Przeglądaj źródła

分站监控详情界面-提交

lxh 3 miesięcy temu
rodzic
commit
7b6f45bbb8

+ 218 - 70
src/views/vent/safetyList/common/detail.vue

@@ -43,43 +43,91 @@
                 </div>
                 <!-- 监测详情 -->
                 <div class="detail-content" v-if="activeKey == 'manageAuto'">
-                    <a-table size="small" :scroll="{ y: 710 }" :columns="columnsDetail" :data-source="tableData"
-                        :pagination="pagination" @change="pageChange">
+                    <div class="search-area">
+                        <span style="color:#fff">分站:</span>
+                        <a-select v-model:value="searchStationId" style="width: 240px;margin-right: 10px;">
+                            <a-select-option v-for="file in stationList" :key="file.label" :value="file.value">{{
+                                file.label }}</a-select-option>
+                        </a-select>
+                        <a-button type="primary" preIcon="ant-design:search-outlined" style="margin-right: 15px"
+                            @click="getSearch">查询</a-button>
+                        <a-button preIcon="ant-design:sync-outlined" @click="getReset">重置</a-button>
+                    </div>
+                    <a-table size="small" :scroll="{ y: 680 }" :columns="columnsDetail" :data-source="tableData">
                         <template #action="{ record }">
-                            <!-- <a-button v-if="!record.devInfoList" type="primary" :disabled="record.linkId != '0'"
-                                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="handleEdit(record)">编辑</a-button>
                         </template>
-                        <template #bodyCell="{ column, text }">
-                            <template v-if="column.dataIndex === 'valueJc' && text">
-                                <div v-for="item in text.split(',')" :key="item">
-                                    <span
-                                        v-if="item.substring(item.indexOf(':') + 1) && !isNaN(parseFloat(item.substring(item.indexOf(':') + 1)))"
-                                        style="display: inline-block;width: 45%;text-align: right; color:rgb(0, 242, 255);margin-right:5px">{{
-                                            item.substring(0, item.indexOf(':') + 1) }}</span>
-                                    <span
-                                        v-if="item.substring(item.indexOf(':') + 1) && !isNaN(parseFloat(item.substring(item.indexOf(':') + 1)))"
-                                        style="display: inline-block; width:50%;text-align: left; color:#fff">{{
-                                            item.substring(item.indexOf(':') + 1) === '1' ? '正风' :
-                                                item.substring(item.indexOf(':') + 1) === '2' ?
-                                                    '反风' : item.substring(item.indexOf(':') + 1) }} </span>
-                                </div>
-                            </template>
-
-                        </template>
+                        <template #bodyCell="{ column, text }"></template>
                     </a-table>
                     <!-- 编辑弹窗 -->
-                    <a-modal  v-model:visible="visibleModalEdit" :width="650" title="编辑信息"
-                        @ok="handleOkEdit" @cancel="handleCancelEdit">
+                    <a-modal v-model:visible="visibleModalEdit" centered :width="650" title="编辑信息" :footer="null">
                         <a-form :model="formEdit" labelAlign="right" :label-col="{ span: 7 }"
                             :wrapper-col="{ span: 17 }">
-                            <a-form-item label="安装位置">
-                                <a-input v-model:value="formEdit.address" placeholder="请输入"
+                            <!-- <a-form-item label="日时:">
+                                <a-select v-model:value="formEdit.rs"   style="width: 260px;margin-right: 10px;">
+                                    <a-select-option v-for="file in timeList" :key="file.label"
+                                        :value="file.value">{{
+                                            file.label }}</a-select-option>
+                                </a-select>
+                                <a-button type="primary">下发</a-button>
+                            </a-form-item>
+                            <a-form-item label="分秒:">
+                                <a-input v-model:value="formEdit.fm" placeholder="请输入"
+                                    style="width: 260px;margin-right: 10px;" />
+                                <a-button type="primary">下发</a-button>
+                            </a-form-item> -->
+                            <!-- <a-form-item label="年月:">
+                                <a-date-picker v-model:value="formEdit.ny" placeholder="请输入"
+                                    style="width: 260px;margin-right: 10px;" />
+                                <a-button type="primary">下发</a-button>
+                            </a-form-item> -->
+                            <a-form-item label="软件版本:">
+                                <a-input v-model:value="formEdit.rjbb" placeholder="请输入"
+                                    style="width: 260px;margin-right: 10px;" />
+                                <a-button type="primary" @click="handleClick('软件版本')">下发</a-button>
+                            </a-form-item>
+                            <a-form-item label="硬件版本:">
+                                <a-input v-model:value="formEdit.yjbb" placeholder="请输入"
+                                    style="width: 260px;margin-right: 10px;" />
+                                <a-button type="primary" @click="handleClick('硬件版本')">下发</a-button>
+                            </a-form-item>
+                            <a-form-item label="电池额定容量:">
+                                <a-input v-model:value="formEdit.dcedrl" placeholder="请输入"
                                     style="width: 260px;margin-right: 10px;" />
-                                    <a-button type="primary" >下发</a-button>
+                                <a-button type="primary" @click="handleClick('电池额定容量')">下发</a-button>
                             </a-form-item>
+                            <a-form-item label="四个字节保存密码:">
+                                <a-input v-model:value="formEdit.sgzjbcmm" placeholder="请输入"
+                                    style="width: 260px;margin-right: 10px;" />
+                                <a-button type="primary" @click="handleClick('四个字节保存密码')">下发</a-button>
+                            </a-form-item>
+                            <a-form-item label="第一路485波特率:">
+                                <a-input v-model:value="formEdit.dyl485btl" placeholder="请输入"
+                                    style="width: 260px;margin-right: 10px;" />
+                                <a-button type="primary" @click="handleClick('第一路485波特率')">下发</a-button>
+                            </a-form-item>
+                            <a-form-item label="维护性放电:">
+                                <a-select v-model:value="formEdit.whxfd" style="width: 260px;margin-right: 10px;">
+                                    <a-select-option v-for="file in whxfdList" :key="file.label" :value="file.value">{{
+                                        file.label }}</a-select-option>
+                                </a-select>
+                                <a-button type="primary" @click="handleClick('维护性放电')">下发</a-button>
+                            </a-form-item>
+                            <a-form-item label="近程断电控制1:">
+                                <a-select v-model:value="formEdit.jcddkz1" style="width: 260px;margin-right: 10px;">
+                                    <a-select-option v-for="file in jcddkzList" :key="file.label" :value="file.value">{{
+                                        file.label }}</a-select-option>
+                                </a-select>
+                                <a-button type="primary" @click="handleClick('近程断电控制1')">下发</a-button>
+                            </a-form-item>
+                            <a-form-item label="近程断电控制2:">
+                                <a-select v-model:value="formEdit.jcddkz2" style="width: 260px;margin-right: 10px;">
+                                    <a-select-option v-for="file in jcddkzList" :key="file.label" :value="file.value">{{
+                                        file.label }}</a-select-option>
+                                </a-select>
+                                <a-button type="primary" @click="handleClick('近程断电控制2')">下发</a-button>
+                            </a-form-item>
+
                         </a-form>
                     </a-modal>
                 </div>
@@ -90,7 +138,7 @@
 
 <script setup lang="ts">
 import { ref, nextTick, reactive, onMounted, onUnmounted } from 'vue';
-import { subStationList, getList, getEdit, runDeviceMonitor, update158DevName, updateDebugStatus } from '../safetyList.api';
+import { subStationList, getList, getEdit, runDeviceMonitor, update158DevName, updateDebugStatus, get158StationData, set158StationData } from '../safetyList.api';
 import { columnsDetail } from '../safetyList.data'
 import customHeader from '/@/components/vent/customHeader.vue';
 
@@ -109,18 +157,39 @@ let clsoeNum = ref(0)
 let stationId = ref(null)
 let tableData = ref<any[]>([])
 //分页参数配置
-let pagination = reactive({
-    current: 1, // 当前页码
-    pageSize: 20, // 每页显示条数
-    total: 0, // 总条目数,后端返回
-    // showTotal: (total, range) => `${range[0]}-${range[1]} 条,总共 ${total} 条`, // 分页右下角显示信息
-    showSizeChanger: true, // 是否可改变每页显示条数
-    pageSizeOptions: ['10', '20', '30', '40', '50', '100'], // 可选的每页显示条数
-});
-let visibleModalEdit=ref(false)
-let formEdit=reactive({
-    address:'',
+// let pagination = reactive({
+//     current: 1, // 当前页码
+//     pageSize: 20, // 每页显示条数
+//     total: 0, // 总条目数,后端返回
+//     // showTotal: (total, range) => `${range[0]}-${range[1]} 条,总共 ${total} 条`, // 分页右下角显示信息
+//     showSizeChanger: true, // 是否可改变每页显示条数
+//     pageSizeOptions: ['10', '20', '30', '40', '50', '100'], // 可选的每页显示条数
+// });
+let visibleModalEdit = ref(false)
+let formEdit = reactive({
+    id: '',
+    rs: '',
+    fm: '',
+    ny: '',
+    rjbb: '',
+    yjbb: '',
+    sgzjbcmm: '',
+    dyl485btl: '',
+    whxfd: '',
+    jcddkz1: '',
+    jcddkz2: '',
+    dcedrl: '',
 })
+let whxfdList = reactive<any[]>([
+    { label: '维护放电开启', value: '1' },
+    { label: '维护放电关闭', value: '0' },
+])
+let jcddkzList = reactive<any[]>([
+    { label: '控制', value: '1' },
+    { label: '不控制', value: '0' },
+])
+let searchStationId = ref('')
+let stationList = reactive<any[]>([])
 
 //tab选项切换
 function onChangeTab(tab) {
@@ -128,9 +197,13 @@ function onChangeTab(tab) {
 }
 //获取分站实时监测信息
 async function getSubStationList() {
+    stationList.length = 0
     let res = await subStationList({ strtype: "modbus" })
     if (res.length != 0) {
         cardList.value = res
+        res.forEach(el => {
+            stationList.push({ label: el.strinstallpos, value: el.id })
+        })
         openNum.value = cardList.value?.filter(v => v.linkstatus == 1)['length']
         clsoeNum.value = cardList.value?.filter(v => v.linkstatus == 0)['length']
     } else {
@@ -160,43 +233,98 @@ function changeStatus(val) {
 }
 //获取详细信息列表
 async function getStationList() {
-    let res = await getList({ subId: stationId.value, pageNo: pagination.current, pageSize: pagination.pageSize, })
-    res.forEach(el => {
-        el.key = el.id
-        el.linkstatusC = el.linkstatus ? '连接' : '未连接'
-        el.gdmsC = el.gdms == '1' ? '直流供电' : el.gdms == '0' ? '交流供电' : ''
-        el.debugTitle = '调试'
-        el.children = el.devInfoList
-        el.children.forEach(v => {
-            v.key = v.id
-            v.linkstatus = v.linkId
-            v.debugTitle = '调试'
-            v.linkstatusC = v.linkstatus == '0' ? '待启用' : v.linkstatus == '1' ? '连接' : '断开'
-            v.updateTime = v.time
-            v.gdmsC = v.gdms == '1' ? '直流供电' : v.gdms == '0' ? '交流供电' : ''
-            v.valueJc = `风向:${v.forward || ''},风量:${v.m3 || ''}m³/min,风速:${v.windSpeed || ''}m/s,气压:${v.pa || ''}Pa,压差:${v.difPress || ''}Pa,温度:${v.temperature || ''}℃,湿度:${v.humidity || ''}%,断面积:${v.area || ''}㎡`
-        })
-    })
-    tableData.value = res
-    pagination.total = res.total
+    tableData.value.length = 0
+    let res = await get158StationData({ stationId: searchStationId.value })
+    res.dqgdfsC = res.dqgdfs == '1' ? '交流供电' : res.dqgdfs == '0' ? '电池供电' : ''
+    res.kgdwztC = res.kgdwzt == '1' ? '开启' : res.kgdwzt == '0' ? '关闭' : ''
+    res.dccfdztC = res.dccfdzt == '0' ? '充电' : res.dccfdzt == '1' ? '放电' : res.dccfdzt == '2' ? '不充不放' : ''
+    res.whxfdC = res.whxfd == '1' ? '维护放电开启' : res.whxfd == '0' ? '维护放电关闭' : ''
+    res.jcddkz1C = res.jcddkz1 == '1' ? '控制' : res.jcddkz1 == '0' ? '不控制' : ''
+    res.jcddkz2C = res.jcddkz2 == '1' ? '控制' : res.jcddkz2 == '0' ? '不控制' : ''
+    tableData.value.push(res)
+    // tableData.value = res
+    // pagination.total = res.total
 }
-//分页切换
-function pageChange(val) {
-    pagination.current = val.current;
-    pagination.pageSize = val.pageSize;
-    getStationList();
+//查询
+function getSearch() {
+    getStationList()
+}
+//重置
+function getReset() {
+    searchStationId.value=''
+    getStationList()
 }
+//分页切换
+// function pageChange(val) {
+//     pagination.current = val.current;
+//     pagination.pageSize = val.pageSize;
+//     getStationList();
+// }
 //编辑
 function handleEdit(record) {
-    visibleModalEdit.value=true
+    visibleModalEdit.value = true
+    formEdit = {
+        id: record.id,
+        rs: record.rs,
+        fm: record.fm,
+        ny: record.ny,
+        rjbb: record.rjbb,
+        yjbb: record.yjbb,
+        sgzjbcmm: record.sgzjbcmm,
+        dyl485btl: record.dyl485btl,
+        whxfd: record.whxfd,
+        jcddkz1: record.jcddkz1,
+        jcddkz2: record.jcddkz2,
+        dcedrl: record.dcedrl,
+    }
 }
-//编辑确认
-function handleOkEdit(){}
-//编辑取消
-function handleCancelEdit(){
-    visibleModalEdit.value=false
+//下发
+async function handleClick(data) {
+    switch (data) {
+        case '软件版本':
+            await set158StationData({ stationId: formEdit.id, plcCode: 'rjbb', value: formEdit.rjbb })
+            visibleModalEdit.value = false
+            getStationList()
+            break;
+        case '硬件版本':
+            await set158StationData({ stationId: formEdit.id, plcCode: 'yjbb', value: formEdit.yjbb })
+            visibleModalEdit.value = false
+            getStationList()
+            break;
+        case '电池额定容量':
+            await set158StationData({ stationId: formEdit.id, plcCode: 'dcedrl', value: formEdit.dcedrl })
+            visibleModalEdit.value = false
+            getStationList()
+            break;
+        case '四个字节保存密码':
+            await set158StationData({ stationId: formEdit.id, plcCode: 'sgzjbcmm', value: formEdit.sgzjbcmm })
+            visibleModalEdit.value = false
+            getStationList()
+            break;
+        case '第一路485波特率':
+            await set158StationData({ stationId: formEdit.id, plcCode: 'dyl485btl', value: formEdit.dyl485btl })
+            visibleModalEdit.value = false
+            getStationList()
+            break;
+        case '维护性放电':
+            await set158StationData({ stationId: formEdit.id, plcCode: 'whxfd', value: formEdit.whxfd })
+            visibleModalEdit.value = false
+            getStationList()
+            break;
+        case '近程断电控制1':
+            await set158StationData({ stationId: formEdit.id, plcCode: 'jcddkz1', value: formEdit.jcddkz1 })
+            visibleModalEdit.value = false
+            getStationList()
+            break;
+        case '近程断电控制2':
+            await set158StationData({ stationId: formEdit.id, plcCode: 'jcddkz2', value: formEdit.jcddkz2 })
+            visibleModalEdit.value = false
+            getStationList()
+            break;
+    }
 }
 
+
 onMounted(() => {
     getSubStationList()
     getStationList()
@@ -389,6 +517,10 @@ onMounted(() => {
             .detail-content {
                 width: 100%;
                 height: 100%;
+
+                .search-area {
+                    margin-bottom: 10px;
+                }
             }
         }
     }
@@ -406,4 +538,20 @@ onMounted(() => {
 ::v-deep(.zxm-input) {
     font-size: 12px;
 }
+
+:deep(.zxm-select:not(.zxm-select-customize-input) .zxm-select-selector) {
+    border: 1px solid #3ad8ff77 !important;
+    background-color: #ffffff00 !important;
+}
+
+:deep(.zxm-select-selection-item) {
+    color: #fff !important;
+}
+
+.zxm-picker,
+.zxm-input {
+    border: 1px solid #3ad8ff77 !important;
+    background-color: #ffffff00 !important;
+    color: #fff !important;
+}
 </style>

+ 8 - 2
src/views/vent/safetyList/safetyList.api.ts

@@ -6,7 +6,9 @@ enum Api {
   getEdit='/safety/ventanalySubStation/edit',
   runDeviceMonitor='/safety/ventanalyDeviceInfo/runDeviceMonitor',
   update158DevName='/safety/ventanalyDeviceInfo/update158DevName',
-  updateDebugStatus='/safety/ventanalyDeviceInfo/updateDebugStatus'
+  updateDebugStatus='/safety/ventanalyDeviceInfo/updateDebugStatus',
+  get158StationData='/safety/ventanalyDeviceInfo/get158StationData',
+  set158StationData='/safety/ventanalyDeviceInfo/set158StationData'
 }
 
 
@@ -21,4 +23,8 @@ export const runDeviceMonitor = (params) => defHttp.post({ url: Api.runDeviceMon
 //编辑设备名称
 export const update158DevName = (params) => defHttp.post({ url: Api.update158DevName, params });
 // 分站设备调试
-export const updateDebugStatus = (params) => defHttp.post({ url: Api.updateDebugStatus,params },{ joinParamsToUrl: true });
+export const updateDebugStatus = (params) => defHttp.post({ url: Api.updateDebugStatus,params },{ joinParamsToUrl: true });
+// 分站详情列表
+export const get158StationData = (params) => defHttp.post({ url: Api.get158StationData,params },{ joinParamsToUrl: true });
+// 分站详情下发
+export const set158StationData = (params) => defHttp.post({ url: Api.set158StationData,params },{ joinParamsToUrl: true });

+ 63 - 89
src/views/vent/safetyList/safetyList.data.ts

@@ -13,12 +13,6 @@ export const columns: BasicColumn[] = [
         key: 'strinstallpos',
         align: 'center',
     },
-    // {
-    //     title: '名称',
-    //     dataIndex: 'strname',
-    //     key: 'strname',
-    //     align: 'center',
-    // },
     {
         title: '监测值',
         dataIndex: 'valueJc',
@@ -29,28 +23,28 @@ export const columns: BasicColumn[] = [
         title: '供电模式',
         dataIndex: 'gdmsC',
         key: 'gdmsC',
-        width:100,
+        width: 100,
         align: 'center',
     },
     {
         title: '电池容量(%)',
         dataIndex: 'dcrl',
         key: 'dcrl',
-        width:110,
+        width: 110,
         align: 'center',
     },
     {
         title: '连接状态',
         dataIndex: 'linkstatusC',
         key: 'linkstatusC',
-        width:80,
+        width: 80,
         align: 'center',
     },
     {
         title: '时间',
         dataIndex: 'updateTime',
         key: 'updateTime',
-        width:120,
+        width: 120,
         align: 'center',
     },
     {
@@ -67,148 +61,128 @@ export const columnsDetail: BasicColumn[] = [
         title: '安装位置',
         dataIndex: 'strinstallpos',
         key: 'strinstallpos',
-        width:120,
-        align: 'center',
-    },
-    {
-        title: '版本号',
-        dataIndex: '',
-        key: '',
         align: 'center',
     },
     {
-        title: '监测值',
-        dataIndex: 'valueJc',
-        key: 'valueJc',
-        width:150,
+        title: '硬件版本',
+        dataIndex: 'yjbb',
+        key: 'yjbb',
+        width: 100,
         align: 'center',
     },
     {
         title: '供电模式',
-        dataIndex: 'gdmsC',
-        key: 'gdmsC',
-        width:100,
+        dataIndex: 'dqgdfsC',
+        key: 'dqgdfsC',
+        width: 100,
         align: 'center',
     },
     {
-        title: '电池容量(%)',
-        dataIndex: 'dcrl',
-        key: 'dcrl',
-        width:80,
+        title: '电量(%)',
+        dataIndex: 'dl',
+        key: 'dl',
+        width: 80,
         align: 'center',
     },
     {
         title: '直流供电电压(mv)',
-        dataIndex: '',
-        key: '',
-        width:80,
+        dataIndex: 'zlgddy',
+        key: 'zlgddy',
+        width: 80,
         align: 'center',
     },
     {
         title: '电池组总电压(mv)',
-        dataIndex: '',
-        key: '',
-        width:80,
+        dataIndex: 'dczzdy',
+        key: 'dczzdy',
+        width: 80,
         align: 'center',
     },
     {
         title: '负载电流(mA)',
-        dataIndex: '',
-        key: '',
-        width:80,
+        dataIndex: 'fzcdl',
+        key: 'fzcdl',
+        width: 80,
         align: 'center',
     },
     {
         title: '充电电流(mA)',
-        dataIndex: '',
-        key: '',
-        width:80,
+        dataIndex: 'dccddl',
+        key: 'dccddl',
+        width: 80,
         align: 'center',
     },
     {
-        title: '电池温度()',
-        dataIndex: '',
-        key: '',
-        width:80,
+        title: '电池温度()',
+        dataIndex: 'dcdwd',
+        key: 'dcdwd',
+        width: 80,
         align: 'center',
     },
     {
-        title: '底板温度()',
-        dataIndex: '',
-        key: '',
-        width:80,
+        title: '底板温度()',
+        dataIndex: 'dbdwd',
+        key: 'dbdwd',
+        width: 80,
         align: 'center',
     },
     {
         title: '档位状态',
-        dataIndex: '',
-        key: '',
-        width:80,
+        dataIndex: 'kgdwztC',
+        key: 'kgdwztC',
+        width: 80,
         align: 'center',
     },
     {
         title: '均衡状态',
-        dataIndex: '',
-        key: '',
-        width:80,
+        dataIndex: 'jhzt',
+        key: 'jhzt',
+        width: 80,
         align: 'center',
     },
     {
         title: '充放电状态',
-        dataIndex: '',
-        key: '',
-        width:80,
+        dataIndex: 'dccfdztC',
+        key: 'dccfdztC',
+        width: 80,
         align: 'center',
     },
     {
-        title: '电池数量',
-        dataIndex: '',
-        key: '',
-        width:80,
+        title: '电池数量(节)',
+        dataIndex: 'jrdcdsl',
+        key: 'jrdcdsl',
+        width: 80,
         align: 'center',
     },
     {
-        title: '电池额定容量',
-        dataIndex: '',
-        key: '',
-        width:80,
+        title: '电池额定容量(mah)',
+        dataIndex: 'dcedrl',
+        key: 'dcedrl',
+        width: 100,
         align: 'center',
     },
     {
-        title: '放电状态',
-        dataIndex: '',
-        key: '',
-        width:80,
+        title: '维护性放电',
+        dataIndex: 'whxfdC',
+        key: 'whxfdC',
+        width: 80,
         align: 'center',
     },
     {
         title: '断电控制1',
-        dataIndex: '',
-        key: '',
-        width:80,
+        dataIndex: 'jcddkz1C',
+        key: 'jcddkz1C',
+        width: 80,
         align: 'center',
     },
     {
         title: '断电控制2',
-        dataIndex: '',
-        key: '',
-        width:80,
-        align: 'center',
-    },
-    {
-        title: '连接状态',
-        dataIndex: 'linkstatusC',
-        key: 'linkstatusC',
-        width:80,
+        dataIndex: 'jcddkz2C',
+        key: 'jcddkz2C',
+        width: 80,
         align: 'center',
     },
-    // {
-    //     title: '时间',
-    //     dataIndex: 'updateTime',
-    //     key: 'updateTime',
-    //     width: 120,
-    //     align: 'center',
-    // },
+
     {
         title: '操作',
         dataIndex: 'action',