Browse Source

158分站详情安装位置,通信状态添加,分站调试去除-提交

lxh 1 week ago
parent
commit
844d534335
2 changed files with 113 additions and 65 deletions
  1. 100 65
      src/views/vent/safetyList/common/detail.vue
  2. 13 0
      src/views/vent/safetyList/safetyList.data.ts

+ 100 - 65
src/views/vent/safetyList/common/detail.vue

@@ -50,7 +50,8 @@
                                     size="small" @click="handlerunDeviceMonitor(record, '启动')">启动</a-button>
                                 <a-button type="success" size="small" style="margin: 0px 10px"
                                     @click="handlerunDeviceMonitor(record, '编辑')">编辑</a-button>
-                                <a-button type="primary" size="small" @click="debugClick(record)">{{ record.debugTitle
+                                <a-button type="primary" v-if="!record.devInfoList" size="small"
+                                    @click="debugClick(record)">{{ record.debugTitle
                                     }}</a-button>
                             </template>
                             <template #bodyCell="{ column, text }">
@@ -172,7 +173,8 @@
                         <a-form :model="formEdit" labelAlign="right" :label-col="{ span: 7 }"
                             :wrapper-col="{ span: 17 }">
                             <a-form-item label="传感器设备:">
-                                <a-select v-model:value="formEdit.cgq" @change="changeCgq" style="width: 260px;margin-right: 10px;">
+                                <a-select v-model:value="formEdit.cgq" @change="changeCgq"
+                                    style="width: 260px;margin-right: 10px;">
                                     <a-select-option v-for="file in cgqList" :key="file.label" :value="file.value">{{
                                         file.label }}</a-select-option>
                                 </a-select>
@@ -393,8 +395,8 @@ let debugFlag = ref('')
 let debugStationId = ref('')
 let debugDeviceId = ref('')
 let derictList = reactive<any[]>([
-    { label: '正向', value: '1' },
-    { label: '反向', value: '0' }
+    { label: '正向', value: '0' },
+    { label: '反向', value: '1' }
 ])
 let devStationId = ref('')
 
@@ -458,7 +460,7 @@ function onChangeTab(tab) {
 }
 
 //弹窗关闭
-function cancenModal(){
+function cancenModal() {
     formEdit = {
         id: '',
         cgq: '',
@@ -490,20 +492,23 @@ function cancenModal(){
 //获取详细信息列表
 async function getStationList() {
     let res = await get158StationData()
+    res.forEach(el => {
+        el.linkstatusC = el.linkstatus ? '连接' : '断开'
+    })
     tableData1.value = res
 }
 //传感器选项切换
-function changeCgq(val){
-    console.log(val,'val---------')
-    formEdit.cgq=val
-    console.log(formEdit.cgq,'cgq------')
+function changeCgq(val) {
+    console.log(val, 'val---------')
+    formEdit.cgq = val
+    console.log(formEdit.cgq, 'cgq------')
 }
 //编辑
 async function handleEdit(record) {
     cgqList.length = 0
     visibleModalEdit1.value = true
     devStationId.value = record.stationId
-   
+
     let res = await get158StationDevices({ stationId: devStationId.value })
     console.log(res, '分站下设备下拉选项-------------')
     if (res.length != 0) {
@@ -675,7 +680,7 @@ async function getStationList1() {
         el.linkIdC = el.linkId || ''
         el.linkstatusC = el.linkstatus ? '连接' : '断开'
         el.gdmsC = el.gdms == '1' ? '直流供电' : el.gdms == '0' ? '交流供电' : ''
-        el.debugTitle = '调试'
+        // el.debugTitle = '调试'
         el.children = el.devInfoList
         el.children.forEach(v => {
             v.key = v.id
@@ -712,62 +717,87 @@ function debugClick(record) {
         startupDataDebug.speed = ''
         startupDataDebug.direction = ''
         visibleModalDebug.value = true
-        if (record.devInfoList) {
-            debugFlag.value = 'station'
-            debugStationId.value = record.id
-            tableData.value.forEach(el => {
-                el.debugTitle = '结束调试'
-                el.devInfoList.forEach(v => {
-                    v.debugTitle = '结束调试'
-                })
-            })
-        } else {
-            debugFlag.value = 'device'
-            debugDeviceId.value = record.id
-            tableData.value.forEach(el => {
-                el.devInfoList.forEach(v => {
-                    if (v.id == debugDeviceId.value) {
-                        debugStationId.value = el.id
-                    }
-                })
+        debugFlag.value = 'device'
+        debugDeviceId.value = record.id
+        tableData.value.forEach(el => {
+            el.devInfoList.forEach(v => {
+                if (v.id == debugDeviceId.value) {
+                    debugStationId.value = el.id
+                }
             })
-            record.debugTitle = '结束调试'
-        }
+        })
+        record.debugTitle = '结束调试'
+        // if (record.devInfoList) {
+        //     debugFlag.value = 'station'
+        //     debugStationId.value = record.id
+        //     tableData.value.forEach(el => {
+        //         el.debugTitle = '结束调试'
+        //         el.devInfoList.forEach(v => {
+        //             v.debugTitle = '结束调试'
+        //         })
+        //     })
+        // } else {
+        //     debugFlag.value = 'device'
+        //     debugDeviceId.value = record.id
+        //     tableData.value.forEach(el => {
+        //         el.devInfoList.forEach(v => {
+        //             if (v.id == debugDeviceId.value) {
+        //                 debugStationId.value = el.id
+        //             }
+        //         })
+        //     })
+        //     record.debugTitle = '结束调试'
+        // }
     } else {
-        if (record.devInfoList) {
-            debugFlag.value = 'station'
-            debugStationId.value = record.id
-            tableData.value.forEach(el => {
-                el.debugTitle = '调试'
-                el.devInfoList.forEach(v => {
-                    v.debugTitle = '调试'
-                })
-            })
-            stopDebug()
-        } else {
-            debugFlag.value = 'device'
-            debugDeviceId.value = record.id
-            tableData.value.forEach(el => {
-                el.devInfoList.forEach(v => {
-                    if (v.id == debugDeviceId.value) {
-                        debugStationId.value = el.id
-                    }
-                })
+        debugFlag.value = 'device'
+        debugDeviceId.value = record.id
+        tableData.value.forEach(el => {
+            el.devInfoList.forEach(v => {
+                if (v.id == debugDeviceId.value) {
+                    debugStationId.value = el.id
+                }
             })
-            record.debugTitle = '调试'
-            stopDebug()
-        }
+        })
+        record.debugTitle = '调试'
+        stopDebug()
+        // if (record.devInfoList) {
+        //     debugFlag.value = 'station'
+        //     debugStationId.value = record.id
+        //     tableData.value.forEach(el => {
+        //         el.debugTitle = '调试'
+        //         el.devInfoList.forEach(v => {
+        //             v.debugTitle = '调试'
+        //         })
+        //     })
+        //     stopDebug()
+        // } else {
+        //     debugFlag.value = 'device'
+        //     debugDeviceId.value = record.id
+        //     tableData.value.forEach(el => {
+        //         el.devInfoList.forEach(v => {
+        //             if (v.id == debugDeviceId.value) {
+        //                 debugStationId.value = el.id
+        //             }
+        //         })
+        //     })
+        //     record.debugTitle = '调试'
+        //     stopDebug()
+        // }
     }
 }
 //停止调试
 async function stopDebug() {
-    if (debugFlag.value == 'station') {
-        let res = await updateDebugStatus({ stationId: debugStationId.value, debugFlag: '0' })
-        getStationList1()
-    } else {
-        let res = await updateDebugStatus({ stationId: debugStationId.value, deviceId: debugDeviceId.value, debugFlag: '0' })
+    let res = await updateDebugStatus({ stationId: debugStationId.value, deviceId: debugDeviceId.value, debugFlag: '0' })
+    if (res) {
         getStationList1()
     }
+    // if (debugFlag.value == 'station') {
+    //     let res = await updateDebugStatus({ stationId: debugStationId.value, debugFlag: '0' })
+    //     getStationList1()
+    // } else {
+    //     let res = await updateDebugStatus({ stationId: debugStationId.value, deviceId: debugDeviceId.value, debugFlag: '0' })
+    //     getStationList1()
+    // }
 }
 async function handleOk() {
     let res = await runDeviceMonitor({ devId: devId.value, devName: startupData.address })
@@ -799,21 +829,26 @@ function handleCancelEdit() {
 }
 //调试确认
 async function handleOkDebug() {
-    if (debugFlag.value == 'station') {
-        let res = await updateDebugStatus({ stationId: debugStationId.value, speed: startupDataDebug.speed, direction: startupDataDebug.direction, debugFlag: '1' })
-        visibleModalDebug.value = false
-        getStationList1()
-    } else {
-        let res = await updateDebugStatus({ stationId: debugStationId.value, deviceId: debugDeviceId.value, speed: startupDataDebug.speed, direction: startupDataDebug.direction, debugFlag: '1' })
+    let res = await updateDebugStatus({ stationId: debugStationId.value, deviceId: debugDeviceId.value, speed: startupDataDebug.speed, direction: startupDataDebug.direction, debugFlag: '1' })
+    if (res) {
         visibleModalDebug.value = false
         getStationList1()
     }
+    // if (debugFlag.value == 'station') {
+    //     let res = await updateDebugStatus({ stationId: debugStationId.value, speed: startupDataDebug.speed, direction: startupDataDebug.direction, debugFlag: '1' })
+    //     visibleModalDebug.value = false
+    //     getStationList1()
+    // } else {
+    //     let res = await updateDebugStatus({ stationId: debugStationId.value, deviceId: debugDeviceId.value, speed: startupDataDebug.speed, direction: startupDataDebug.direction, debugFlag: '1' })
+    //     visibleModalDebug.value = false
+    //     getStationList1()
+    // }
 }
 //调试取消
 function handleCancelDebug() {
     visibleModalDebug.value = false
     tableData.value.forEach(el => {
-        el.debugTitle = '调试'
+        // el.debugTitle = '调试'
         el.devInfoList.forEach(v => {
             v.debugTitle = '调试'
         })

+ 13 - 0
src/views/vent/safetyList/safetyList.data.ts

@@ -66,6 +66,19 @@ export const columns: BasicColumn[] = [
 
 export const columnsDetail: BasicColumn[] = [
     {
+        title: '安装位置',
+        dataIndex: 'strInstallPos',
+        key: 'strInstallPos',
+        width:180,
+        align: 'center',
+    },
+    {
+        title: '通讯状态',
+        dataIndex: 'linkstatusC',
+        key: 'linkstatusC',
+        align: 'center',
+    },
+    {
         title: '读写状态',
         dataIndex: 'dxzt',
         key: 'dxzt',