Browse Source

东泰鑫源bug修改提交

lxh 1 year ago
parent
commit
5a1221c20d

+ 4 - 1
.vscode/settings.json

@@ -170,5 +170,8 @@
     ".eslintrc.js": ".eslintignore,.prettierignore,.stylelintignore,.commitlintrc.js,.prettierrc.js,.stylelintrc.js"
   },
   "terminal.integrated.scrollback": 10000,
-  "nuxt.isNuxtApp": false
+  "nuxt.isNuxtApp": false,
+  "[json]": {
+    "editor.defaultFormatter": "vscode.json-language-features"
+  }
 }

+ 4 - 0
src/ant-design/index.ts

@@ -1,4 +1,6 @@
 import { 
+  Pagination,
+  Tree,
   Table,
   Form,
   DatePicker,
@@ -14,6 +16,8 @@ import {
   } from "ant-design-vue";
 
 const components = [
+  Pagination,
+  Tree,
   RangePicker,
   Table,
   Form,

+ 4 - 5
src/locales/lang/zh-CN/routes/vent.json

@@ -3,22 +3,21 @@
     "fire": "火灾",
     "home": "火灾预警监测",
     "fireCompositeWarn": "工作面监测预警分析",
-   
     "goaf": "密闭采空区监测预警分析",
-   
     "fireMonitor": "变电硐室防灭火监控预警系统",
     "workFace": "工作面监测预警分析",
     "beltConveyor": "带试运输机防灭火监测系统",
     "fireDistributionPoint": "安全监控系统预警分析",
     "fireZhud": "智能注氮系统监测分析",
-    "fireZhuj": "智能灌浆系统监测分析"
+    "fireZhuj": "智能灌浆系统监测分析",
+    "fireRecord":"预警记录"
   },
   "dust": {
     "dust": "粉尘",
     "home": "粉尘预警监测",
     "dustWarnAnalysis": "粉尘监测预警分析",
-   
-    "dustAtomizing": "智能喷雾降尘装置"
+    "dustAtomizing": "智能喷雾降尘装置",
+    "dustRecord":"预警记录"
   },
   "monitor": {
     "monitor": "监测",

+ 8 - 9
src/router/routes/vent/dust.ts

@@ -19,7 +19,6 @@ const dust: AppRouteModule = {
       meta: {
         title: t('routes.vent.dust.home'),
       },
-      // component: () => import('@/views/vent/dust/home/index.vue'),
       component: () => import('@/views/vent/dust/dustHome/index.vue'),
     },
 
@@ -31,14 +30,6 @@ const dust: AppRouteModule = {
       },
       component: () => import('@/views/vent/dust/dustWarnAnalysis/index.vue'),
     },
-    // {
-    //   path: 'dust-warnAnalysisList',
-    //   name: 'dustWarnAnalysisList',
-    //   meta: {
-    //     title: t('routes.vent.dust.dustWarnAnalysislist'),
-    //   },
-    //   component: () => import('@/views/vent/dust/dustWarnAnalysisList/index.vue'),
-    // },
     {
       path: 'dust-atomizing',
       name: 'dustAtomizing',
@@ -47,6 +38,14 @@ const dust: AppRouteModule = {
       },
       component: () => import('@/views/vent/dust/dustAtomizing/index.vue'),
     },
+    {
+      path: 'dust-record',
+      name: 'dustRecord',
+      meta: {
+        title: t('routes.vent.dust.dustRecord'),
+      },
+      component: () => import('@/views/vent/dust/warnRecordDust/index.vue'),
+    },
   ],
 };
 

+ 8 - 0
src/router/routes/vent/fire.ts

@@ -94,6 +94,14 @@ const fire: AppRouteModule = {
       },
       component: () => import('@/views/vent/fire/fireZhud/index.vue'),
     },
+    {
+      path: 'fire-record',
+      name: 'fireRecord',
+      meta: {
+        title: t('routes.vent.fire.fireRecord'),
+      },
+      component: () => import('@/views/vent/fire/warnRecordFire/index.vue'),
+    },
   ],
 };
 

+ 0 - 8
src/views/vent/dust/dustAtomizing/index.vue

@@ -5,8 +5,6 @@
       <div class="search-area">
         <a-form :model="formState" :label-col="{ span: 1.5 }">
           <a-form-item label="设备名称 : ">
-            <!-- <a-input v-model:value="formState.devicename" clearable placeholder="请输入..."
-              style="width:240px;margin-right: 20px;" /> -->
             <a-select style="width:240px;margin-right: 20px;" :options="selectAreaList" size="small" placeholder="请选择"
               v-model:value="selectCode" allowClear @change="areaChange"></a-select>
           </a-form-item>
@@ -18,12 +16,6 @@
               </template>
               查询
             </a-button>
-            <!-- <a-button type="primary" style="height: 30px;margin: 0 10px; padding: 2px 15px;background-color: #227fad;">
-              <template #icon>
-                <PlusOutlined />
-              </template>
-              新增
-            </a-button> -->
             <a-button type="primary" :disabled="disabled"
               style="height: 30px;margin: 0 10px; padding: 2px 15px;background-color: #227fad;" @click="openAll(1)">
               一键开启

+ 2 - 2
src/views/vent/dust/dustHome/index.vue

@@ -259,9 +259,9 @@ async function historyAndForecastList(params) {
     let nowData = []
     let ycDate = []
     res.lineData.forEach((el, index) => {
-      if (el.time == res.splitTime) {
-        console.log(index, '实时值与预测值分界线===========')
+      if (new Date(el.time).getTime() <= new Date(res.splitTime).getTime()) {
         nowData = res.lineData.slice(0, index)
+      }else {
         ycDate = res.lineData.slice(index)
       }
       console.log(nowData, 'nowData---------------------------')

+ 29 - 12
src/views/vent/dust/dustWarnAnalysis/index.vue

@@ -7,7 +7,8 @@
       <div style="width:100%;height:100%"
         v-if="cardData4.length != 0 || echartData.xData.length != 0 || echartData.yData.length != 0 || echartData.yData1.length != 0">
         <div class="warn-top-box">
-          <basicCard4 :cardData4="cardData4" :warningLevel="warningLevel" @toggleDustCards="toggleDustCards"></basicCard4>
+          <basicCard4 :cardData4="cardData4" :warningLevel="warningLevel" @toggleDustCards="toggleDustCards">
+          </basicCard4>
         </div>
         <div class="warn-top-box1">
           <!-- <basicCard5 :cardData5="cardData5"></basicCard5> -->
@@ -47,10 +48,10 @@ let warningLevel = ref('')//风险等级
 
 let cardData4 = reactive<any[]>([])
 let cardData5 = reactive<any[]>([
-  { id: 0, label:'粉尘浓度(mg/m³)',value:'' },
-  { id: 1, label:'总尘浓度(mg/m³)',value:''},
-  { id: 2, label:'呼尘加权容许浓度(mg/m³)',value:''},
-  { id: 3, label:'爆炸浓度(mg/m³)',value:''},
+  { id: 0, label: '粉尘浓度(mg/m³)', value: '' },
+  { id: 1, label: '总尘浓度(mg/m³)', value: '' },
+  { id: 2, label: '呼尘加权容许浓度(mg/m³)', value: '' },
+  { id: 3, label: '爆炸浓度(mg/m³)', value: '' },
 ])
 
 
@@ -137,7 +138,7 @@ function toggleDustCards(data) {
 async function getDustInfosList() {
   let res = await getDustInfos({ sensorCode: sensorCode.value })
   cardData5[0].value = parseFloat(res.dustDensity).toFixed(2)
-  cardData5[1].value =parseFloat( res.dustDensityAverage).toFixed(2)
+  cardData5[1].value = parseFloat(res.dustDensityAverage).toFixed(2)
   cardData5[2].value = parseFloat(res.dustDensityAverage40).toFixed(2)
   cardData5[3].value = parseFloat(res.explodeDensity).toFixed(2)
 
@@ -149,13 +150,29 @@ async function getDustInfosList() {
 async function historyAndForecastList(params) {
   let res = await historyAndForecast({ areaCode: params })
   if (res.lineData.length != 0) {
-    echartData.xData.length = 0
-    echartData.yData.length = 0
+    echartData.xData.length = 0;
+    echartData.yData.length = 0;
     echartData.yData1.length = 0
-    res.lineData.forEach(el => {
-      echartData.xData.push(el.time)
-      echartData.yData.push(el.value )
-      echartData.yData1.push(el.valuePredict)
+    let nowData = []
+    let ycDate = []
+    res.lineData.forEach((el, index) => {
+      if (new Date(el.time).getTime() <= new Date(res.splitTime).getTime()) {
+        nowData = res.lineData.slice(0, index)
+      } else {
+        ycDate = res.lineData.slice(index)
+      }
+      console.log(nowData, 'nowData---------------------------')
+      console.log(ycDate, 'ycDate============')
+      echartData.xData.push(el.time);
+    });
+    echartData.xData.forEach((el, index) => {
+      if (nowData[index]) {
+        echartData.yData.push(nowData[index]['value']);
+        echartData.yData1.push('')
+      } else {
+        echartData.yData.push('');
+        echartData.yData1.push(ycDate[index]['valuePredict'])
+      }
     })
   }
 }

+ 13 - 0
src/views/vent/dust/warnRecordDust/index.vue

@@ -0,0 +1,13 @@
+<template>
+  <div>
+
+  </div>
+</template>
+
+<script lang="ts" setup>
+
+</script>
+
+<style lang="less" scoped>
+
+</style>

+ 25 - 22
src/views/vent/fire/fireHome/components/workJc.vue

@@ -63,9 +63,9 @@ let props = defineProps({
       return []
     }
   },
-  echartData:{
-    type:Array,
-    default:()=>{
+  echartData: {
+    type: Array,
+    default: () => {
       return []
     }
   }
@@ -74,13 +74,14 @@ let props = defineProps({
 //获取dom节点
 let ring = ref();
 
-let fxLenged =reactive<any[]>([]);//图表数据
+let fxLenged = reactive<any[]>([]);//图表数据
+let echartDatas=ref<any[]>([])
 
 let cardList = ref<any[]>([]);
 
 function getOption() {
   nextTick(() => {
-    let color = ['#1fb3f7', '#3751E6', '#FFC722', '#886EFF', '#008DEC', '#114C90', '#00BFA5'];
+    let color = ['#1fb3f7'];
     let myChart = echarts.init(ring.value);
     let option = {
       color: color,
@@ -119,7 +120,7 @@ function getOption() {
                   align: 'center',
                   verticalAlign: 'middle',
                   fontSize: 18,
-                  color:'#fff',
+                  color: '#fff',
                 },
                 label: {
                   align: 'center',
@@ -140,7 +141,7 @@ function getOption() {
             length: 0,
             length2: 0,
           },
-          data: fxLenged,
+          data: echartDatas,
         },
       ],
     };
@@ -156,16 +157,18 @@ watch(() => props.cardData, (newC, oldC) => {
   cardList.value = newC
 }, { immediate: true, deep: true })
 
-watch(()=>props.echartData,(newV,oldV)=>{
-  console.log(newV,'图表数据------')
-  fxLenged.length=0
+watch(() => props.echartData, (newV, oldV) => {
+  console.log(newV, '图表数据------')
+  fxLenged.length = 0
   if(newV.length!=0){
     fxLenged.length=0
     newV.forEach(el=>{
       fxLenged.push({name:el.label,value:el.value})
     })
+    let maxValue=fxLenged.sort((a,b)=>b.value - a.value)
+    echartDatas.value=maxValue[0]
   }
-},{immediate:true,deep:true})
+}, { immediate: true, deep: true })
 
 onMounted(() => {
   getOption();
@@ -248,12 +251,12 @@ onMounted(() => {
 
       .fx-box {
         display: flex;
-    flex-direction: column;
-    align-items: center;
-    justify-content: center;
-    width: 50%;
-    height: 50%;
-    color: #9da5aa;
+        flex-direction: column;
+        align-items: center;
+        justify-content: center;
+        width: 50%;
+        height: 50%;
+        color: #9da5aa;
 
         .fx-label {
           display: flex;
@@ -277,7 +280,7 @@ onMounted(() => {
             }
           }
 
-          .fx-label-r{
+          .fx-label-r {
             font-size: 12px;
           }
         }
@@ -288,8 +291,8 @@ onMounted(() => {
           font-weight: bold;
         }
 
-        .fx-unit{
-      width: 20px;
+        .fx-unit {
+          width: 20px;
           height: 1px;
           margin: 2px;
           background-color: #a1b6c2;
@@ -318,7 +321,7 @@ onMounted(() => {
           position: absolute;
           top: 12%;
           left: 5.5%;
-          color:  #9da5aa;
+          color: #9da5aa;
           font-size: 12px;
           letter-spacing: 2px;
         }
@@ -336,7 +339,7 @@ onMounted(() => {
           top: 11%;
           left: 20%;
           border-bottom: 1px solid #d0d2d3;
-          color:  #d0d2d3;
+          color: #d0d2d3;
           font-size: 12px;
         }
 

+ 176 - 0
src/views/vent/fire/warnRecordFire/index.vue

@@ -0,0 +1,176 @@
+<template>
+  <div class="warnRecordFire">
+    <div class="record-left">
+      <basicTree :treeData="treeData" @selectChange="selectChange"></basicTree>
+    </div>
+    <div class="record-right">
+      <div class="search-box">
+        <div class="search-label">监测日期 :</div>
+        <div class="search-time">
+          <a-range-picker v-model:value="TimeRange" :format="dateFormat" @change="onDataChange" />
+        </div>
+      </div>
+      <div class="content-record">
+        <a-table size="small" :dataSource="dataSource" :columns="columns" :scroll="{ y: 730 }" :pagination="pagination"
+          @change="pageChange">
+
+          <template #action="{ record }">
+            <a-button type="link" style="color:#3DF6FF">
+              查看
+            </a-button>
+          </template>
+        </a-table>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script lang="ts" setup>
+import { ref, reactive, onMounted, onUnmounted } from 'vue'
+import basicTree from '../../common/basicTree.vue'
+import { getFireAreaInfo, getFireWarnHistory } from './warnRecordFire.api'
+import {columns} from './warnRecordFire.data'
+import dayjs, { Dayjs } from 'dayjs';
+
+let areaCode = ref('')
+let treeData = reactive<any[]>([])
+
+let dateFormat = ref('YYYY-MM-DD');
+let TimeRange = ref<[Dayjs, Dayjs]>([dayjs(dayjs(new Date().getTime()).format('YYYY-MM-DD'), dateFormat.value), dayjs(dayjs(new Date().getTime() + 24 * 60 * 60 * 1000).format('YYYY-MM-DD'), dateFormat.value)])
+
+let dataSource = ref<any[]>([])
+
+let pagination = reactive({
+  current: 1, // 当前页码
+  pageSize: 10, // 每页显示条数
+  total: 0, // 总条目数,后端返回
+  // showTotal: (total, range) => `${range[0]}-${range[1]} 条,总共 ${total} 条`, // 分页右下角显示信息
+  showSizeChanger: true, // 是否可改变每页显示条数
+  pageSizeOptions: ['10', '20', '50',], // 可选的每页显示条数
+})
+
+//获取树形菜单数据
+async function getTreeList() {
+  let res = await getFireAreaInfo({})
+  console.log(res, 'tree列表')
+  if (res.length != 0) {
+    treeData.length = 0
+    res.forEach(el => {
+      treeData.push({ name: el.areaName, value: el.ind, id: el.ind, pid: null, areaCode: el.areaCode, warningLevel: el.warningLevel })
+    })
+    areaCode.value = areaCode.value ? areaCode.value : treeData[0]['areaCode']
+  }
+}
+//树形菜单选项切换
+function selectChange(treeNode) {
+  console.log(treeNode, 'treeNode--------')
+  pagination.current = 1
+  dataSource.value = dataSource.value.filter(v => v.areaName == treeNode.node.dataRef.title)
+}
+//时间选项切换
+function onDataChange(value, dateString) {
+  TimeRange.value = [value[0], value[1]]
+}
+
+//获取预警记录
+async function getFireWarnHistoryList() {
+  let ttime_begin = `${dayjs(TimeRange.value[0]).format('YYYY-MM-DD')} 00:00:00`
+  let ttime_end = `${dayjs(TimeRange.value[1]).format('YYYY-MM-DD')} 00:00:00`
+  let res = await getFireWarnHistory({ pageNo: pagination.current, pageSize: pagination.pageSize, ttime_begin: ttime_begin, ttime_end: ttime_end })
+  console.log(res, '预警记录------------')
+  if (res.result.records.length != 0) {
+    res.result.records.forEach(el => {
+      el.zhType = '火灾'
+      el.isLk = '未联控'
+    })
+    dataSource.value = res.result.records
+    pagination.total = res.result.total
+  }
+}
+//分页切换
+function pageChange(page,page1) {
+  console.log(page,page1,'page------')
+  pagination.current=page.current
+  pagination.pageSize=page.pageSize
+}
+
+onMounted(() => {
+  getTreeList()
+  getFireWarnHistoryList()
+})
+</script>
+
+<style lang="less" scoped>
+.warnRecordFire {
+  display: flex;
+  position: relative;
+  align-items: center;
+  justify-content: space-between;
+  width: calc(100% - 20px);
+  height: 928px;
+  margin: 0 10px;
+  background: #282828;
+
+  .record-left {
+    width: 220px;
+    height: 100%;
+    background-color: rgb(27 35 39 / 80%);
+  }
+
+  .record-right {
+    box-sizing: border-box;
+    width: calc(100% - 230px);
+    height: 100%;
+    margin-left: 10px;
+    padding: 15px 10px;
+    overflow-y: auto;
+    background-color: rgb(27 35 39 / 80%);
+
+    .search-box {
+      display: flex;
+      box-sizing: border-box;
+      align-items: center;
+      width: 100%;
+      height: 60px;
+      padding: 0 15px;
+    }
+  }
+
+}
+
+:deep(.vMonitor-table) {
+  background-color: transparent;
+  color: #fff;
+}
+
+:deep(.vMonitor-table-wrapper .vMonitor-table-thead >tr>th) {
+  padding: 4px 0;
+  border-bottom: none;
+  background: rgb(34 127 173/ 50%);
+  color: #04ffdb;
+}
+
+:deep(.vMonitor-table-thead >tr>th:not(:last-child):not(.vMonitor-table-selection-column):not(.vMonitor-table-row-expand-icon-cell):not([colspan])::before) {
+  background: transparent;
+}
+
+:deep(.vMonitor-table-wrapper .vMonitor-table-cell-scrollbar:not([rowspan])) {
+  box-shadow: none;
+}
+
+:deep(.vMonitor-table-wrapper .vMonitor-table:not(.vMonitor-table-bordered) .vMonitor-table-tbody >tr >td) {
+  border-top: none;
+}
+
+:deep(.vMonitor-table.vMonitor-table-small .vMonitor-table-tbody>tr>td) {
+  padding: 4px 8px;
+}
+
+:deep(.vMonitor-table-wrapper .vMonitor-table-tbody >tr >td.vMonitor-table-cell-row-hover) {
+  background: rgb(38 74 96) !important;
+}
+
+:deep(.vMonitor-table-wrapper .vMonitor-table-tbody >tr.vMonitor-table-row:hover>td) {
+  background: rgb(38 74 96) !important;
+}
+</style>

+ 19 - 0
src/views/vent/fire/warnRecordFire/warnRecordFire.api.ts

@@ -0,0 +1,19 @@
+import { defHttp } from '@/utils/http/axios';
+
+enum Api {
+  getFireAreaInfo = '/fire/fireDisasterApi/getFireAreaInfo',
+  getFireWarnHistory='/fire/fireDisasterApi/getFireWarnHistory  '
+}
+/**
+ * 菜单树接口
+ * @param params
+ */
+export const getFireAreaInfo = (params) => defHttp.get({ url: Api.getFireAreaInfo, params });
+
+/**
+ * 预警记录
+ * @param params
+ */
+export const getFireWarnHistory = (params) => defHttp.post({ url: Api.getFireWarnHistory, params });
+
+

+ 69 - 0
src/views/vent/fire/warnRecordFire/warnRecordFire.data.ts

@@ -0,0 +1,69 @@
+import { reactive } from 'vue';
+import { BasicColumn, FormSchema } from '/@/components/Table';
+export const  columns = reactive<any[]>([
+  {
+    title: '序号',
+    width: 60,
+    align: 'center',
+    customRender: ({ index }: { index: number }) => `${index + 1}`
+  },
+  {
+    title: '预警区域名称',
+    dataIndex: 'areaName',
+    key: 'areaName',
+    align: 'center',
+    ellipsis: true,
+  },
+  {
+    title: '预警等级',
+    dataIndex: 'warnLevel_dictText',
+    key: 'warnLevel_dictText',
+    align: 'center',
+    ellipsis: true,
+  },
+  {
+    title: '灾害类型',
+    dataIndex: 'zhType',
+    key: 'zhType',
+    align: 'center',
+    ellipsis: true,
+  },
+  {
+    title: '是否联控',
+    dataIndex: 'isLk',
+    key: 'isLk',
+    align: 'center',
+    ellipsis: true,
+  },
+  {
+    title: '预警产生原因',
+    dataIndex: 'remarks',
+    key: 'remarks',
+    width: 200,
+    align: 'center',
+    ellipsis: true,
+  },
+  {
+    title: '给出的预警建议',
+    dataIndex: 'suggestMsg',
+    key: 'suggestMsg',
+    width: 200,
+    align: 'center',
+    ellipsis: true,
+  },
+  {
+    title: '预警时间',
+    dataIndex: 'startTime',
+    key: 'startTime',
+    align: 'center',
+    ellipsis: true,
+  },
+
+  {
+    title: '操作',
+    key: 'action',
+    width: 150,
+    slots: { customRender: 'action' },
+    align: 'center',
+  },
+])