Browse Source

Merge branch 'master' of http://182.92.126.35:3000/hrx/mky-vent-base

hongrunxia 2 weeks ago
parent
commit
617845b1ac

BIN
src/assets/images/zd-1.png


BIN
src/assets/images/zd-2.png


BIN
src/assets/images/zd-3.png


+ 409 - 0
src/views/vent/safetyList/common/detail.vue

@@ -0,0 +1,409 @@
+<template>
+    <div class="safetyList">
+        <customHeader>监控分站管理详情</customHeader>
+        <div class="content">
+            <a-tabs class="tab-box" v-model:activeKey="activeKey" @change="onChangeTab">
+                <a-tab-pane tab="分站监测" key="device" />
+                <a-tab-pane tab="监测详情" key="manageAuto" />
+            </a-tabs>
+            <div class="box-content">
+                <!-- 分站监测 -->
+                <div class="now-content" v-if="activeKey == 'device'">
+                    <div class="now-title">
+                        <div class="title-fz">
+                            <span>分站:</span>
+                            <span>
+                                [通讯正常]
+                                <span class="zd-open">{{ openNum || 0 }}</span>
+                            </span>
+                            <span>
+                                [通讯中断]
+                                <span class="zd-close">{{ clsoeNum || 0 }}</span>
+                            </span>
+                        </div>
+                    </div>
+                    <div class="card-content">
+                        <div class="card-box" v-for="(item, index) in cardList" :key="index">
+                            <div :class="item.isNewAccess ? 'card-itemN' : item.linkstatus ? 'card-itemL' : 'card-itemD'"
+                                @click="cardClick(item, index)">
+                                <div class="card-item-label">{{ item.strname }}</div>
+                            </div>
+                            <div :class="activeIndex % 4 == 3 ? 'card-modal1' : 'card-modal'"
+                                v-if="activeIndex == index && isShow">
+                                <div class="modal-name">站点名称:</div>
+                                <a-input v-model:value="stationName" size="small" placeholder="请输入"
+                                    @blur="changeName" />
+                                <div class="modal-lj">连接状态:</div>
+                                <a-radio-group v-model:value="stationStatus" size="small" :options="ljList"
+                                    @change="changeStatus" />
+                            </div>
+                        </div>
+                    </div>
+
+                </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">
+                        <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>
+                    </a-table>
+                    <!-- 编辑弹窗 -->
+                    <a-modal  v-model:visible="visibleModalEdit" :width="650" title="编辑信息"
+                        @ok="handleOkEdit" @cancel="handleCancelEdit">
+                        <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="请输入"
+                                    style="width: 260px;margin-right: 10px;" />
+                                    <a-button type="primary" >下发</a-button>
+                            </a-form-item>
+                        </a-form>
+                    </a-modal>
+                </div>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script setup lang="ts">
+import { ref, nextTick, reactive, onMounted, onUnmounted } from 'vue';
+import { subStationList, getList, getEdit, runDeviceMonitor, update158DevName, updateDebugStatus } from '../safetyList.api';
+import { columnsDetail } from '../safetyList.data'
+import customHeader from '/@/components/vent/customHeader.vue';
+
+let activeKey = ref('device')
+let cardList = ref<any[]>()
+let activeIndex = ref(null)
+let isShow = ref(false)
+let stationName = ref('')
+let stationStatus = ref(null)
+let ljList = reactive<any[]>([
+    { value: 0, label: '断开' },
+    { value: 1, label: '连接' }
+])
+let openNum = ref(0)
+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:'',
+})
+
+//tab选项切换
+function onChangeTab(tab) {
+    activeKey.value = tab
+}
+//获取分站实时监测信息
+async function getSubStationList() {
+    let res = await subStationList({ strtype: "modbus" })
+    if (res.length != 0) {
+        cardList.value = res
+        openNum.value = cardList.value?.filter(v => v.linkstatus == 1)['length']
+        clsoeNum.value = cardList.value?.filter(v => v.linkstatus == 0)['length']
+    } else {
+        cardList.value = []
+    }
+}
+//分站站点选项点击
+function cardClick(item, index) {
+    activeIndex.value = item.isNewAccess ? index : null
+    stationName.value = item.strname
+    stationStatus.value = item.linkstatus
+    stationId.value = item.id
+    isShow.value = true
+}
+//分站站点名称编辑
+function changeName(val) {
+    getChangeStation()
+}
+async function getChangeStation() {
+    let res = await getEdit({ id: stationId.value, strname: stationName.value, linkstatus: stationStatus.value })
+    getSubStationList()
+    isShow.value = false
+}
+//站点连接状态修改
+function changeStatus(val) {
+    getChangeStation()
+}
+//获取详细信息列表
+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
+}
+//分页切换
+function pageChange(val) {
+    pagination.current = val.current;
+    pagination.pageSize = val.pageSize;
+    getStationList();
+}
+//编辑
+function handleEdit(record) {
+    visibleModalEdit.value=true
+}
+//编辑确认
+function handleOkEdit(){}
+//编辑取消
+function handleCancelEdit(){
+    visibleModalEdit.value=false
+}
+
+onMounted(() => {
+    getSubStationList()
+    getStationList()
+})
+</script>
+
+<style lang="less" scoped>
+.safetyList {
+    width: calc(100% - 20px);
+    height: calc(100% - 80px);
+    position: relative;
+    margin: 70px 10px 10px 10px;
+
+    .content {
+        position: relative;
+        width: 100%;
+        height: 100%;
+
+        .tab-box {
+            display: flex;
+            color: #fff;
+            position: relative;
+            background: linear-gradient(#001325, #012e4f);
+
+            :deep(.zxm-tabs-nav) {
+                margin: 0 !important;
+
+                .zxm-tabs-tab {
+                    width: 180px;
+                    height: 45px;
+                    background: url('/@/assets/images/top-btn.png') center no-repeat;
+                    background-size: cover;
+                    display: flex;
+                    justify-content: center;
+                    font-size: 16px;
+                }
+
+                .zxm-tabs-tab-active {
+                    width: 180px;
+                    position: relative;
+                    background: url('/@/assets/images/top-btn-select.png') center no-repeat;
+                    background-size: cover;
+
+                    .zxm-tabs-tab-btn {
+                        color: #fff !important;
+                    }
+                }
+
+                .zxm-tabs-ink-bar {
+                    width: 0 !important;
+                }
+
+                .zxm-tabs-tab+.zxm-tabs-tab {
+                    margin: 0 !important;
+                }
+            }
+        }
+
+        .box-content {
+            height: calc(100% - 50px);
+            padding: 10px;
+            box-sizing: border-box;
+
+            .now-content {
+                width: 100%;
+                height: 100%;
+
+                .now-title {
+                    display: flex;
+                    height: 30px;
+                    align-items: center;
+                    font-size: 14px;
+                    margin-bottom: 10px;
+
+                    span {
+                        color: #fff;
+                    }
+
+                    .zd-open {
+                        color: rgb(0, 242, 255);
+                    }
+
+                    .zd-close {
+                        color: #ff0000;
+                    }
+
+                    .title-fz {
+                        margin-right: 25px;
+                    }
+                }
+
+                .card-content {
+                    width: 100%;
+                    height: calc(100% - 40px);
+                    display: flex;
+                    justify-content: flex-start;
+                    align-items: flex-start;
+                    flex-wrap: wrap;
+                    overflow-y: auto;
+
+                    .card-box {
+                        position: relative;
+                        // width: 242px;
+                        width: 187px;
+                        height: 110px;
+                        margin-bottom: 15px;
+                        display: flex;
+                        justify-content: center;
+
+                        .card-itemN {
+                            position: relative;
+                            width: 85px;
+                            height: 110px;
+                            background: url('/@/assets/images/zd-2.png') no-repeat center;
+                            background-size: 100% 100%;
+                            cursor: pointer;
+
+                            .card-item-label {
+                                width: 100%;
+                                position: absolute;
+                                bottom: 5px;
+                                font-size: 12px;
+                                color: #fff;
+                                text-align: center;
+                            }
+                        }
+
+                        .card-itemL {
+                            position: relative;
+                            width: 85px;
+                            height: 110px;
+                            background: url('/@/assets/images/zd-3.png') no-repeat center;
+                            background-size: 100% 100%;
+                            cursor: pointer;
+
+                            .card-item-label {
+                                width: 100%;
+                                position: absolute;
+                                bottom: 5px;
+                                font-size: 12px;
+                                color: #fff;
+                                text-align: center;
+                            }
+                        }
+
+                        .card-itemD {
+                            position: relative;
+                            width: 85px;
+                            height: 110px;
+                            background: url('/@/assets/images/zd-1.png') no-repeat center;
+                            background-size: 100% 100%;
+                            cursor: pointer;
+
+                            .card-item-label {
+                                width: 100%;
+                                position: absolute;
+                                bottom: 5px;
+                                font-size: 12px;
+                                color: #fff;
+                                text-align: center;
+                            }
+                        }
+
+                        .card-modal {
+                            width: 86px;
+                            position: absolute;
+                            left: 140px;
+                            color: #FFF;
+                            top: 50%;
+                            transform: translate(0, -50%);
+                            font-size: 12px;
+                        }
+
+                        .card-modal1 {
+                            width: 86px;
+                            position: absolute;
+                            left: -42px;
+                            color: #FFF;
+                            top: 50%;
+                            transform: translate(0, -50%);
+                            font-size: 12px;
+                        }
+
+                    }
+                }
+
+
+            }
+
+            .detail-content {
+                width: 100%;
+                height: 100%;
+            }
+        }
+    }
+}
+
+.zxm-form {
+    padding-top: 20px !important;
+    box-sizing: border-box;
+}
+
+::v-deep(.zxm-radio-wrapper) {
+    font-size: 12px;
+}
+
+::v-deep(.zxm-input) {
+    font-size: 12px;
+}
+</style>

+ 5 - 5
src/views/vent/safetyList/index.vue

@@ -410,7 +410,7 @@ onUnmounted(() => {
       margin-right: 15px;
       padding: 10px;
       box-sizing: border-box;
-      background: url('@/assets/images/fire/bj1.png') no-repeat center;
+      background: url('/@/assets/images/fire/bj1.png') no-repeat center;
       background-size: 100% 100%;
 
       .left-title {
@@ -458,7 +458,7 @@ onUnmounted(() => {
             position: relative;
             width: 85px;
             height: 110px;
-            background: url('../../../assets/images/zd-2.png') no-repeat center;
+            background: url('/@/assets/images/zd-2.png') no-repeat center;
             background-size: 100% 100%;
             cursor: pointer;
 
@@ -476,7 +476,7 @@ onUnmounted(() => {
             position: relative;
             width: 85px;
             height: 110px;
-            background: url('../../../assets/images/zd-3.png') no-repeat center;
+            background: url('/@/assets/images/zd-3.png') no-repeat center;
             background-size: 100% 100%;
             cursor: pointer;
 
@@ -494,7 +494,7 @@ onUnmounted(() => {
             position: relative;
             width: 85px;
             height: 110px;
-            background: url('../../../assets/images/zd-1.png') no-repeat center;
+            background: url('/@/assets/images/zd-1.png') no-repeat center;
             background-size: 100% 100%;
             cursor: pointer;
 
@@ -537,7 +537,7 @@ onUnmounted(() => {
       height: 100%;
       padding: 10px;
       box-sizing: border-box;
-      background: url('@/assets/images/fire/bj1.png') no-repeat center;
+      background: url('/@/assets/images/fire/bj1.png') no-repeat center;
       background-size: 100% 100%;
 
       .right-title {

+ 159 - 2
src/views/vent/safetyList/safetyList.data.ts

@@ -33,10 +33,10 @@ export const columns: BasicColumn[] = [
         align: 'center',
     },
     {
-        title: '电池容量',
+        title: '电池容量(%)',
         dataIndex: 'dcrl',
         key: 'dcrl',
-        width:80,
+        width:110,
         align: 'center',
     },
     {
@@ -50,6 +50,7 @@ export const columns: BasicColumn[] = [
         title: '时间',
         dataIndex: 'updateTime',
         key: 'updateTime',
+        width:120,
         align: 'center',
     },
     {
@@ -60,3 +61,159 @@ export const columns: BasicColumn[] = [
         slots: { customRender: 'action' },
     },
 ];
+
+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,
+        align: 'center',
+    },
+    {
+        title: '供电模式',
+        dataIndex: 'gdmsC',
+        key: 'gdmsC',
+        width:100,
+        align: 'center',
+    },
+    {
+        title: '电池容量(%)',
+        dataIndex: 'dcrl',
+        key: 'dcrl',
+        width:80,
+        align: 'center',
+    },
+    {
+        title: '直流供电电压(mv)',
+        dataIndex: '',
+        key: '',
+        width:80,
+        align: 'center',
+    },
+    {
+        title: '电池组总电压(mv)',
+        dataIndex: '',
+        key: '',
+        width:80,
+        align: 'center',
+    },
+    {
+        title: '负载电流(mA)',
+        dataIndex: '',
+        key: '',
+        width:80,
+        align: 'center',
+    },
+    {
+        title: '充电电流(mA)',
+        dataIndex: '',
+        key: '',
+        width:80,
+        align: 'center',
+    },
+    {
+        title: '电池温度()',
+        dataIndex: '',
+        key: '',
+        width:80,
+        align: 'center',
+    },
+    {
+        title: '底板温度()',
+        dataIndex: '',
+        key: '',
+        width:80,
+        align: 'center',
+    },
+    {
+        title: '档位状态',
+        dataIndex: '',
+        key: '',
+        width:80,
+        align: 'center',
+    },
+    {
+        title: '均衡状态',
+        dataIndex: '',
+        key: '',
+        width:80,
+        align: 'center',
+    },
+    {
+        title: '充放电状态',
+        dataIndex: '',
+        key: '',
+        width:80,
+        align: 'center',
+    },
+    {
+        title: '电池数量',
+        dataIndex: '',
+        key: '',
+        width:80,
+        align: 'center',
+    },
+    {
+        title: '电池额定容量',
+        dataIndex: '',
+        key: '',
+        width:80,
+        align: 'center',
+    },
+    {
+        title: '放电状态',
+        dataIndex: '',
+        key: '',
+        width:80,
+        align: 'center',
+    },
+    {
+        title: '断电控制1',
+        dataIndex: '',
+        key: '',
+        width:80,
+        align: 'center',
+    },
+    {
+        title: '断电控制2',
+        dataIndex: '',
+        key: '',
+        width:80,
+        align: 'center',
+    },
+    {
+        title: '连接状态',
+        dataIndex: 'linkstatusC',
+        key: 'linkstatusC',
+        width:80,
+        align: 'center',
+    },
+    // {
+    //     title: '时间',
+    //     dataIndex: 'updateTime',
+    //     key: 'updateTime',
+    //     width: 120,
+    //     align: 'center',
+    // },
+    {
+        title: '操作',
+        dataIndex: 'action',
+        width: 150,
+        align: 'center',
+        slots: { customRender: 'action' },
+    },
+];