分支自 SuZhouGuanHong/TaiYuanTaiZhong

huanghongfeng
2024-06-26 0deffcf086c01690773682b5c4e461386ab059e9
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
118
119
120
121
122
123
124
<!--
*Author:jxx
 *Contact:283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/widesea_wcs/wcs/VV_Dispatch.js此处编写
 -->
<template>
    <div>
        <div class="head">
            <div>
                <!-- <el-button type="success" @click="test" size="small">开启服务</el-button> -->
 
                <span class="msg">服务状态: </span><span :class="wcsState ? 'serveRun' : 'serveClose'">{{ wcsState ? "已启动" :
                    "未启动"
                }}</span>
            </div>
        </div>
        <div class="line"></div>
        <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
            :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
            :table="table" :extend="extend" @onChangeWCSState="ChangeWCSState">
        </view-grid>
    </div>
</template>
<script>
import extend from "@/extension/widesea_wcs/wcs/VV_Dispatch.js";
import { ref, defineComponent } from "vue";
 
export default defineComponent({
    data() {
        return {
            wcsState: false
        }
    },
    mounted() {
        this.http.post('/api/VV_Dispatch/CheckServeState', {}, true).then((x) => {
            this.wcsState = x.status;
        });
    },
    methods: {
        ChangeWCSState(state) {
            this.wcsState = state;
        },
        // test() {
        //     console.log("测试");
        //     this.$refs.grid.search();
        // }
    },
    setup() {
 
        const table = ref({
            key: 'Id',
            footer: "Foots",
            cnName: '调度信息',
            name: 'wcs/VV_Dispatch',
            url: "/VV_Dispatch/",
            sortName: "JobName"
        });
        const editFormFields = ref({});
        const editFormOptions = ref([]);
        const searchFormFields = ref({
            'JobName': '',
            'Enable': ''
        });
        const searchFormOptions = ref([
            [
                { "title": "调度名称", "field": "JobName", "type": "like" },
                { "title": "是否启用", "field": "Enable", "dataKey": "EqStatus", 'data': [], "type": "select" }
            ]
        ]);
        const columns = ref([{ field: 'ID', title: 'ID', hidden: true, type: 'int', width: 110, require: true, align: 'left', sort: true },
        { field: 'JobName', title: '调度名称', type: 'string', width: 110, require: true, align: 'left' },
        { field: 'ClassName', title: '调度类型', type: 'string', width: 120, require: true, align: 'left' },
        { field: 'IntervalSecond', title: '调度时间(s)', type: 'int', width: 110, require: true, align: 'left' },
        { field: 'Remark', title: '描述', type: 'string', width: 220, align: 'left' },
        { field: 'Enable', title: '是否启用',hidden: true, bind: { key: 'EqStatus' }, type: 'string', width: 110, require: true, align: 'left' },
        { field: 'IsRun', title: '运行状态', type: 'string', width: 110, require: true, align: 'left' },
        ]);
        const detail = ref({
            cnName: "#detailCnName",
            table: "#detailTable",
            columns: [],
            sortName: "",
            key: ""
        });
        return {
            table,
            extend,
            editFormFields,
            editFormOptions,
            searchFormFields,
            searchFormOptions,
            columns,
            detail,
        };
    },
});
</script>
 
<style>
.head {
    margin: 10px 20px;
}
 
.line {
    border-top: 1px dashed #ccc;
    margin: 0px 20px;
}
 
.serveClose {
    font-size: 13px;
    color: red;
}
 
.serveRun {
    font-size: 13px;
    color: rgb(39, 236, 108);
}
 
.head .msg {
    margin-left: 30px;
    font-size: 13px;
}
</style>