dengjunjie
3 天以前 d2a1ccd801f942381723c5a6001989d8da8ba6f5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/Alarm/container.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'id',
                footer: "Foots",
                cnName: '容器管理',
                name: 'Container',
                url: "/Container/",
                sortName: "id"
            });
            const editFormFields = ref({
                deviceName: "",
                currentTemperature: "",
                humidity: "",
                alarm: "",
                AlarmInformation: ""
            });
            const editFormOptions = ref([
                [
                    {
                        field: "deviceName",
                        title: "设备名称",
                        type: "string",
                        required: true,
                        span: 12
                    },
                    {
                        field: "currentTemperature", 
                        title: "温度",
                        type: "number",
                        span: 12
                    }
                ],
                [
                    {
                        field: "cumidity",
                        title: "湿度",
                        type: "number",
                        required: true,
                        span: 12
                    },
                    {
                        field: "alarm",
                        title: "是否报警",
                        type: "select",
                        // bind: { key: "enable", data: [] },
                        data:[],
                        datakey: "enable",
                        span: 12
                    }
                ],
                [
                    {
                        field: "alarmInformation",
                        title: "报警信息",
                        type: "string",
                        span: 24
                    }
                ]
            ]);
            const searchFormFields = ref({
                deviceName: "",
                Alarm: ""
            });
            const searchFormOptions = ref([
               [
                    {title:"设备名称", field:"deviceName", type:"like"},
                    {title:"报警状态", field:"Alarm", type:"select", dataKey: "enable",data:[]}
               ]
            ]);
            const columns = ref([
                {field:'id',title:'主键',type:'int',width:90,hidden:true,readonly:true,require:true,align:'left'},
                {field:'deviceName',title:'设备名称',type:'string',width:120,align:'left',sort:true},
                {field:'currentTemperature',title:'温度',type:'float',width:100,align:'left'},
                {field:'humidity',title:'湿度',type:'float',width:100,align:'left'},
                {field:'alarm',title:'是否报警',type:'select',width:100,align:'left',bind:{key:'enable',data:[]}},
                {field:'alarmInformation',title:'报警信息',type:'string',width:200,align:'left'},
                // {field:'creater',title:'创建者',type:'string',width:100,require:true,align:'left'},
                {field:'createDate',title:'创建时间',type:'datetime',width:160,require:true,align:'left',sort:true},
                // {field:'modifier',title:'修改人',type:'string',width:100,align:'left'},
                {field:'modifyDate',title:'修改日期',type:'datetime',width:160,align:'left',sort:true}
            ]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>