Browse Source

[Feat 0000] 对接瓦斯抽采单元接口、对接瓦斯综合管理接口

hongrunxia 2 weeks ago
parent
commit
80dc3bf14f

+ 1 - 1
src/components/Form/src/jeecg/components/base/JSelectBiz.vue

@@ -22,7 +22,7 @@
           style="width: 100%"
           @click="!disabled && openModal(false)"
           v-bind="attrs"
-        ></a-select>
+        />
       </a-col>
       <a-col v-if="showButton" class="right">
         <a-button v-if="buttonIcon" :preIcon="buttonIcon" type="primary" @click="openModal(true)" :disabled="disabled">选择</a-button>

+ 5 - 7
src/hooks/vent/useSystemSelect.ts

@@ -31,13 +31,11 @@ export function useSystemSelect(sysType: string, changeModalType?: (param) => vo
         const readData = data.readData;
         return Object.assign(data, readData);
       });
-      if (item.type != 'sys') {
-        deviceArr.unshift({
-          deviceType: item.type,
-          deviceName: item['typeName'] ? item['typeName'] : item['datalist'][0]['typeName'],
-          datalist: data,
-        });
-      }
+      deviceArr.unshift({
+        deviceType: item.type,
+        deviceName: item['typeName'] ? item['typeName'] : item['datalist'][0]['typeName'],
+        datalist: data,
+      });
     });
     deviceList.value = deviceArr;
     if (isFirst) {

+ 9 - 9
src/utils/dict/DictColors.js

@@ -1,5 +1,5 @@
-const whiteColor = '#ffffff'
-const blackColor = '#666666'
+const whiteColor = '#ffffff';
+const blackColor = '#666666';
 
 export const Colors = [
   // 背景颜色,文字颜色
@@ -24,9 +24,9 @@ export const Colors = [
   ['#DEC2FA', blackColor],
   ['#CCD2F1', blackColor],
   ['#D3D3D3', blackColor],
-]
+];
 
-export const NONE_COLOR = ['#e9e9e9', blackColor]
+export const NONE_COLOR = ['#e9e9e9', blackColor];
 
 /**
  * 返回一个颜色迭代器,每次调用返回一个颜色,当颜色用完后,再从头开始
@@ -45,20 +45,20 @@ export function getColorIterator(initIndex = 0) {
       index = (index + 1) % Colors.length;
       return color;
     },
-  }
+  };
 }
 
 /**
  * 根据颜色获取当前坐标和颜色
  */
 export function getItemColor(color) {
-  if(!color){
+  if (!color) {
     return NONE_COLOR[1];
   }
-  let colorIndex = Colors.findIndex((value)=>{
+  let colorIndex = Colors.findIndex((value) => {
     return value[0] === color;
-  })
-  if(colorIndex === -1){
+  });
+  if (colorIndex === -1) {
     return NONE_COLOR[1];
   }
   return Colors[colorIndex][1];

+ 25 - 23
src/views/vent/gas/gasAssessment/components/workFace.vue

@@ -12,7 +12,7 @@
               v-for="(item, index) in gasMonitor"
               :key="index"
               class="w-100% mb-5px"
-              :value="get(dataSource, item.code)"
+              :value="get(workFaceData, item.code)"
               :label="item.title"
               labelWidth="200px"
             />
@@ -24,7 +24,7 @@
             <div>工作面基础信息</div>
           </template>
           <template #container>
-            <CustomChart :chart-config="gasUnitBarOption" :chart-data="mockData" height="280px" />
+            <CustomChart :chart-config="gasUnitBarOption" :chart-data="gasUnitDataSource" height="280px" />
           </template>
         </ventBox1>
       </div>
@@ -41,7 +41,7 @@
                 v-for="(item, index) in gasPumpValve"
                 :key="index"
                 class="w-100% mb-5px"
-                :value="get(dataSource, item.code)"
+                :value="get(workFaceData, item.code)"
                 :label="item.title"
                 labelWidth="200px"
               />
@@ -52,7 +52,7 @@
               <div>工作面基础信息</div>
             </template>
             <template #container>
-              <CustomChart :chart-config="gasUnitPieOption" :chart-data="mockPieData" height="280px" />
+              <CustomChart :chart-config="gasUnitPieOption" :chart-data="gasUnitDataSource" height="280px" />
             </template>
           </ventBox1>
         </div>
@@ -62,37 +62,39 @@
 </template>
 
 <script setup lang="ts">
-  import { ref, onMounted } from 'vue';
+  import { ref, onMounted, watch } from 'vue';
   import ventBox1 from '/@/components/vent/ventBox1.vue';
   import CustomBadges from './customHeader.vue';
   import { gasMonitor, headerBadges, gasPumpValve, gasUnitBarOption, mockData, gasUnitPieOption, mockPieData } from '../gasAssessment.data';
   import ListItem from '@/views/vent/gas/components/list/listItem.vue';
   import { get } from '@/utils/ventutil';
   import CustomChart from '@/views/vent/home/configurable/components/detail/CustomChart.vue';
+  type DeviceType = { deviceType: string; deviceName: string; datalist: any[] };
+  const props = defineProps({
+    dataSource: {
+      type: Object,
+      default: () => {},
+    },
+  });
 
   const loading = ref(false);
-  const dataSource = ref({});
+  const gasUnitDataSource = ref<DeviceType>(); // 抽采单元监测数据
+  const workFaceData = ref<any>({}); // 工作面基础数据
 
-  // // https获取监测数据
-  let timer: null | NodeJS.Timeout = null;
-  function getMonitor(flag?) {
-    if (Object.prototype.toString.call(timer) === '[object Null]') {
-      timer = setTimeout(
-        async () => {
-          if (timer) {
-            timer = null;
-          }
-          await getMonitor();
-          // loading.value = false;
-        },
-        flag ? 0 : 1000
-      );
+  watch(
+    () => props.dataSource,
+    (newValue: DeviceType[]) => {
+      if (newValue && newValue.length > 0) {
+        gasUnitDataSource.value = newValue.find((item) => item.deviceType.startsWith('unit'));
+        const workFaceDataSorce = newValue.find((item) => item.deviceType === 'sys');
+        if (workFaceDataSorce) {
+          workFaceData.value = workFaceDataSorce.datalist[0];
+        }
+      }
     }
-  }
+  );
 
   onMounted(async () => {
-    timer = null;
-    await getMonitor(true);
     loading.value = true;
   });
 </script>

+ 80 - 60
src/views/vent/gas/gasAssessment/gasAssessment.data.ts

@@ -137,53 +137,48 @@ export const echartsOption = reactive({
 
 export const gasMonitor = [
   {
-    title: '工作面编号',
-    code: 'T0',
-    unit: '',
-  },
-  {
-    title: '所属采区',
-    code: 'T1',
-    unit: '',
+    title: '工作面走向长度',
+    code: 'workingFaceZouxiangLength',
+    unit: 'm',
   },
   {
-    title: '开采煤层',
-    code: 'T2',
-    unit: '',
+    title: '煤层厚度',
+    code: 'coalSeamThickness',
+    unit: 'm',
   },
   {
-    title: '工作面走向长度',
-    code: 'CO2',
+    title: '切眼长度',
+    code: 'workingFaceQieyanLength',
     unit: 'm',
   },
   {
-    title: '工作面切眼长度',
-    code: 'gasC',
+    title: '工作面长度',
+    code: 'workingFaceLengeh',
     unit: 'm',
   },
   {
-    title: '工作面煤炭储量',
-    code: 'gasMixMass',
-    unit: 'm³/t',
+    title: '工作面采高',
+    code: 'workingFaceHeight',
+    unit: 'm',
   },
   {
-    title: '原始瓦斯储量',
-    code: 'gasMass',
-    unit: 'm³/t',
+    title: '煤炭储量',
+    code: 'coalReserves',
+    unit: 't',
   },
   {
-    title: '工作面瓦斯含量',
-    code: 'gasMass',
+    title: '原始瓦斯含量',
+    code: 'originalGasContent',
     unit: 'm³/t',
   },
   {
-    title: '预抽瓦斯标量 (m³)',
-    code: 'gasTotalMass',
-    unit: '',
+    title: '工作面瓦斯储量',
+    code: 'gasReserves',
+    unit: '',
   },
   {
-    title: '抽采单元数量',
-    code: 'windPressure',
+    title: '预抽瓦斯认标量',
+    code: 'scalarRecognition',
     unit: '',
   },
 ];
@@ -411,45 +406,70 @@ export const currentGasMonitor = [
 
 export const gasPumpValve = [
   {
-    title: '开抽日期',
-    code: 'T0',
-    unit: '',
-  },
-  {
-    title: '支管抽采负压',
-    code: 'T0',
-    unit: '',
-  },
-  {
-    title: '支管抽采流量',
-    code: 'T0',
-    unit: '',
-  },
-  {
-    title: '抽采管路气体温度',
-    code: 'T0',
+    title: '开始抽采日期',
+    code: 'beginDrainageDate',
     unit: '',
   },
   {
-    title: '抽采管路甲烷浓度',
-    code: 'T0',
-    unit: '',
+    title: '已抽时间',
+    code: 'totalDate',
+    unit: '天',
   },
   {
-    title: '抽采管路一氧化碳浓度',
-    code: 'T0',
+    title: '抽采单元数量',
+    code: 'unitNum',
     unit: '',
   },
   {
     title: '累计流量',
-    code: 'T0',
-    unit: '',
+    code: 'cumulativeFlow',
+    unit: '',
   },
   {
     title: '累计纯量',
-    code: 'T0',
-    unit: '',
+    code: 'cumulativeScalar',
+    unit: '',
   },
+  // {
+  //   title: '开抽日期',
+  //   code: 'T0',
+  //   unit: '',
+  // },
+  // {
+  //   title: '支管抽采负压',
+  //   code: 'T0',
+  //   unit: '',
+  // },
+  // {
+  //   title: '支管抽采流量',
+  //   code: 'T0',
+  //   unit: '',
+  // },
+  // {
+  //   title: '抽采管路气体温度',
+  //   code: 'T0',
+  //   unit: '',
+  // },
+  // {
+  //   title: '抽采管路甲烷浓度',
+  //   code: 'T0',
+  //   unit: '',
+  // },
+  // {
+  //   title: '抽采管路一氧化碳浓度',
+  //   code: 'T0',
+  //   unit: '',
+  // },
+  // {
+  //   title: '累计流量',
+  //   code: 'T0',
+  //   unit: '',
+  // },
+  // {
+  //   title: '累计纯量',
+  //   code: 'T0',
+  //   unit: '',
+  // },
 ];
 
 export const gasUnitDetail = [
@@ -541,9 +561,9 @@ export const gasUnitBarOption: ModuleDataChart = {
   yAxis: [{ show: true, name: '', position: 'left' }],
   series: [
     {
-      readFrom: 'arrayDev',
-      xprop: 'strinstallpos',
-      yprop: 'val',
+      readFrom: 'datalist',
+      xprop: 'strname',
+      yprop: 'unitval',
       label: '',
     },
   ],
@@ -584,9 +604,9 @@ export const gasUnitPieOption: ModuleDataChart = {
   yAxis: [{ show: true, name: '', position: 'left' }],
   series: [
     {
-      readFrom: 'arrayDev',
-      xprop: 'strinstallpos',
-      yprop: 'val',
+      readFrom: 'datalist',
+      xprop: 'strname',
+      yprop: 'unitval',
       label: '',
     },
   ],

+ 6 - 6
src/views/vent/gas/gasAssessment/index.vue

@@ -32,7 +32,7 @@
     </div>
   </div>
   <template v-if="activeKey == 'gasAssessment'">
-    <WorkFace class="point-event" v-if="pageType == 'workFace'" />
+    <WorkFace class="point-event" v-if="pageType == 'workFace'" :data-source="dataSource" />
     <gasUnit class="point-event" v-if="pageType == 'gasUnit'" />
   </template>
   <template v-if="activeKey == 'gasEcharts'">
@@ -64,10 +64,11 @@
   import WorkFace from './components/workFace.vue';
   import GasVideo from './components/gasVideo.vue';
   import BottomMenu from '/@/views/vent/comment/components/bottomMenu.vue';
+  type DeviceType = { deviceType: string; deviceName: string; datalist: any[] };
 
   const activeKey = ref('gasAssessment');
   const loading = ref(false);
-  const dataSource = ref({});
+  const dataSource = ref<DeviceType[]>([]);
   const pageType = ref('workFace');
   const activeUnitId = ref('');
 
@@ -81,7 +82,7 @@
     setModelType(modalType, gasUnitNum.value);
   };
 
-  const { options, optionValue, deviceActive, getSelectRow, getSysDataSource, getDeviceList } = useSystemSelect(
+  const { options, optionValue, deviceActive, deviceValue, getSelectRow, getSysDataSource, getDeviceList } = useSystemSelect(
     'sys_surface_caimei',
     changeModalType
   );
@@ -98,9 +99,8 @@
     if (Object.prototype.toString.call(timer) === '[object Null]') {
       timer = setTimeout(
         async () => {
-          if (deviceActive.value) {
-            await getDeviceList();
-          }
+          debugger;
+          dataSource.value = await getDeviceList();
           if (timer) {
             timer = null;
           }

+ 12 - 11
src/views/vent/gas/gasHome/components/customHeader.vue

@@ -16,9 +16,9 @@
   import Badge01Src from '@/assets/images/vent/home/badge01.png';
   import Badge02Src from '@/assets/images/vent/home/badge02.png';
   import Badge03Src from '@/assets/images/vent/home/badge03.png';
-  import Badge04Src from '@/assets/images/vent/home/badge04.png';
-  import Badge05Src from '@/assets/images/vent/home/badge05.png';
-  import Badge06Src from '@/assets/images/vent/home/badge06.png';
+  // import Badge04Src from '@/assets/images/vent/home/badge04.png';
+  import Badge04Src from '@/assets/images/vent/home/badge05.png';
+  import Badge05Src from '@/assets/images/vent/home/badge06.png';
 
   // @TODO 对组件的颜色、背景等样式进行修改,符合全局规范
 
@@ -29,7 +29,7 @@
 
   const items = [
     {
-      bgSrc: Badge06Src,
+      bgSrc: Badge05Src,
       color: '#d9e6ec',
     },
     {
@@ -41,17 +41,17 @@
       color: '#9ea890',
     },
     {
-      bgSrc: Badge05Src,
+      bgSrc: Badge04Src,
       color: '#d7deea',
     },
     {
       bgSrc: Badge01Src,
       color: '#dbe0d7',
     },
-    {
-      bgSrc: Badge04Src,
-      color: '#d8d5e4',
-    },
+    // {
+    //   bgSrc: Badge04Src,
+    //   color: '#d8d5e4',
+    // },
   ];
 </script>
 
@@ -74,15 +74,16 @@
     background-repeat: no-repeat;
     background-position: center center;
     background-size: 100% auto;
-    width: 185px;
+    width: 235px;
     height: 70px;
     padding-left: 80px;
   }
 
   .custom-header__badge_title {
     font-size: 20px;
+    margin-left: 10px;
   }
   .custom-header__badge_desc {
-    font-size: 12px;
+    font-size: 14px;
   }
 </style>

+ 5 - 9
src/views/vent/gas/gasHome/gasHome.data.ts

@@ -87,19 +87,15 @@ export const caikongqu = [
     code: 'juejin.num',
   },
   {
-    title: '回采工作面位置(?)',
+    title: '采空区数量',
     code: 'caikongqu.num',
   },
   {
-    title: '掘进工作面位置(?)',
-    code: 'caikongqu.num',
+    title: '抽采达标数量',
+    code: 'sysInfo.totalComplteQuantity',
   },
   {
-    title: '采空区数量',
-    code: 'caikongqu.num',
-  },
-  {
-    title: '采空区位置(?)',
-    code: 'caikongqu.num',
+    title: '平均抽采率',
+    code: 'sysInfo.totalAverageRate',
   },
 ];

+ 14 - 16
src/views/vent/gas/gasHome/index.vue

@@ -11,7 +11,7 @@
   </div>
 </template>
 <script lang="ts" setup>
-  import { ref, onBeforeMount, onBeforeUnmount, onMounted } from 'vue';
+  import { ref, onBeforeMount, onBeforeUnmount, onMounted, computed } from 'vue';
   import CustomHeader from '/@/components/vent/customHeader.vue';
   import CustomBadges from './components/customHeader.vue';
   import GasMonitor from './components/gasMonitor.vue';
@@ -21,6 +21,8 @@
   import BottomMenu from '/@/views/vent/comment/components/bottomMenu.vue';
   import { navList } from './gasHome.data';
   import { useRouter } from 'vue-router';
+  import { get } from '@/utils/ventutil';
+
   const router = useRouter();
   const activeKey = ref('gasHome');
   const dataSource = ref<any | null>(null);
@@ -60,30 +62,26 @@
     }
   }
 
-  const headerBadges = ref([
-    {
-      title: 'T1',
-      desc: '累积瓦斯抽采量',
-    },
+  const headerBadges = computed(() => [
     {
-      title: 'T2',
-      desc: '平均瓦斯抽采率',
+      title: get(dataSource.value, 'sysInfo.totalGasVolume'),
+      desc: '累积瓦斯抽采量(万t/d)',
     },
     {
-      title: 'T3',
-      desc: '抽采达标工作面数量',
+      title: get(dataSource.value, 'sysInfo.totalAverageRate'),
+      desc: '平均瓦斯抽采率(%)',
     },
     {
-      title: 'T4',
-      desc: '抽采钻孔类型',
+      title: get(dataSource.value, 'sysInfo.totalComplteQuantity'),
+      desc: '抽采达标工作面数量(个)',
     },
     {
-      title: 'T5',
-      desc: '回采中工作面数量',
+      title: get(dataSource.value, 'sysInfo.useM3Perent'),
+      desc: '有效风量率(%)', //回采中工作面数量
     },
     {
-      title: 'T6',
-      desc: '抽采钻孔总进尺',
+      title: get(dataSource.value, 'sysInfo.drillinFootage'),
+      desc: '抽采钻孔总进尺(m)',
     },
   ]);
 

+ 2 - 10
src/views/vent/reportManager/comment/common/cameraTree.vue

@@ -1,11 +1,5 @@
 <template>
-  <treeList
-    v-for="model in list"
-    v-bind="$attrs"
-    :model="model"
-    :key="model.id"
-    @detail-node="onDetail"
-  >
+  <treeList v-for="model in list" v-bind="$attrs" :model="model" :key="model.id" @detail-node="onDetail">
     <template #icon="slotProps">
       <slot name="icon" v-bind="slotProps"></slot>
     </template>
@@ -17,7 +11,7 @@
 <script setup lang="ts">
   import { ref } from 'vue';
   import treeList from './treeList.vue';
-  const emit = defineEmits([ 'detailNode']);
+  const emit = defineEmits(['detailNode']);
   interface IFileSystem {
     id: string;
     title: string;
@@ -57,7 +51,5 @@
       eventType: 'detail',
     });
   };
- 
-  
 </script>
 <style scoped></style>