<template>
    <div class="page">
        <LayoutTable notAdd notDel :data="tableData" :config="tableConfig">
          <el-button
              slot="table-head-left2"
              style="margin-left: 10px"
              icon="el-icon-tickets"
              size="mini"
              type="danger"
              @click="monitorWarn"
          >监测预警</el-button
          >

                    </LayoutTable>

       <drawer-show ref="dataDrawerShow"  />
        <dialog-show ref="dialogform" @ok="getData" />
    </div>
</template>

<script>
    /** 表单弹出框模式需引入 */
    import dialogShow from "./dialogshow";
    import drawerShow from "./dataDrawerShow";
    import table from "@/assets/mixins/table";
    export default {
        name: "RealtimeDataflowList",
        components: {
            dialogShow,drawerShow

},
        mixins: [table],
        created() {
        },
        methods: {
            /** 重写新增方法 */
            toAdd(row) {
                this.$refs.dialogform.add(row);
            },
            /** 重写编辑方法 */
            toEdit(row) {
                this.$refs.dialogform.edit(row);
            },
            /** 重写查看方法 */
            toView(row) {
                this.$refs.dialogform.view(row);
            },

          monitorWarn(row) {
            this.$refs.dataDrawerShow.view(row);
          },

        },
        data() {
            return {
                config: {
                    search: [
                      {
                        name: "device",
                        type: "select",
                        label: "监测设备",
                      },

                      {
                        name: "detectTimeStart",
                        type: "datetime",
                        label: "开始时间",
                      },

                      {
                        name: "detectTimeEnd",
                        type: "datetime",
                        label: "结束时间",
                      },
                    ],
                    columns: [
                        {type: "selection", width: 60},
                        {type: "index",label: "序号",width: 50},

                        {label: "姓名", prop: "name"},

                        {label: "监测设备", prop: "device"},

                        {label: "监测时间", prop: "detectTime", formatter: this.formatterDate},

                        {label: "联系方式", prop: "contact"},

                        {label: "身份证号码", prop: "idNumber"},

                        {label: "是否预约", prop: "isBooking",formatter: this.formatter},

                        {label: "排队编码", prop: "queueNum"},

                        {label: "办理位置", prop: "location"},

                        {label: "识别截图", prop: "picture"},
                        {
                            label: "操作",
                            width: 240,
                            formatter: row => {
                                return (
                                    <table-buttons noAdd row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
                            );
                            }
                        }
                    ]
                }
            };
        }
    };
</script>
