import services from "./service";
import { createSubscribe } from "applet-page-component";
import { reportCmPV_YL } from "../../utils/cloudMonitorHelper";
Component(
	createSubscribe({
		onShow() {
			this.saveRef.refresh();
		},
	})({
		props: {},
		tabsShow: false,
		data: {
			typeOptions: [
				{
					value: "normal",
					label: "普通号",
				},
				{
					value: "expert",
					label: "专家号",
				},
				{
					value: "nucleic",
					label: "核酸",
				},
			],
			showInpatient: false,
			hasFilter: false,
		},

		didMount() {
			/* 服务预警， 挂号记录查询 */
			reportCmPV_YL({
				title: "挂号记录查询",
			});
		},

		methods: {
			onFilterHandel(filters) {
				this.filters = filters;
				this.saveRef.refresh();
			},

			saveRef(ref) {
				this.saveRef = ref;
			},

			/* 分页逻辑 */
			async onService(params) {
				return services.getSubscribeRecordList(
					Object.assign({
						...this.filters,
						...params,
					})
				);
			},
		},
	})
);
