Selaa lähdekoodia

Merge branch 'master' of http://39.97.59.228:8013/hrx/mky-vent-base

lxh 3 kuukautta sitten
vanhempi
commit
d2223b096c

+ 1 - 1
.env

@@ -1,5 +1,5 @@
 # port
-VITE_PORT = 3100
+VITE_PORT = 8062
 
 #  网站标题
 VITE_GLOB_APP_TITLE = 智能通风管控系统

+ 1 - 1
.env.development

@@ -6,7 +6,7 @@ VITE_PUBLIC_PATH = /
 
 # 跨域代理,您可以配置多个 ,请注意,没有换行符
 #VITE_PROXY = [["/jeecgboot","http://localhost:8080/jeecg-boot"],["/upload","http://localhost:3300/upload"]]
-VITE_PROXY = [["/sw","http://182.92.126.35:6008"],["/jeecgsystem","http://182.92.126.35:9999"],["/upload","http://182.92.126.35:9999/upload"],["/documents", "http://182.92.126.35:9050"],["/modelreq", "http://182.92.126.35:9999"],["/webRtc", "http://182.92.126.35:8051"], ["/python", "http://127.0.0.1:8008"], ["/tun2D", "http://127.0.0.1:8088/micro-vent-2dModal/tun2D"],["/dataCenter", "http://192.168.1.88:10999"]]
+VITE_PROXY = [["/sw","http://182.92.126.35:6008"],["/jeecgsystem","http://182.92.126.35:9999"],["/upload","http://182.92.126.35:9999/upload"],["/documents", "http://182.92.126.35:9050"],["/modelreq", "http://182.92.126.35:9999"],["/webRtc", "http://182.92.126.35:8051"], ["/python", "http://127.0.0.1:8008"], ["/tun2D", "http://127.0.0.1:8088/micro-vent-2dModal/tun2D"],["/dataCenter", "http://39.97.59.228:10999"]]
 # VITE_PROXY = [["/jeecgsystem","http://192.168.183.88:9999"],["/upload","http://192.168.183.88:9999/upload"],["/documents", "http://192.168.183.88:9050"],["/modelreq", "http://192.168.183.88:9999"],["/webRtc", "http://192.168.183.88:8051"]]
 # VITE_PROXY = [["/jeecgsystem","http://10.10.150.72:9999"],["/upload","http://localhost:3300/upload"],["/documents", "http://10.10.150.72:9050"],["/modelreq", "http://10.10.150.72:9999"],["/webRtc", "http://192.168.183.216:8051"]]
 # VITE_PROXY = [["/jeecgsystem","http://192.168.1.8:9999"],["/upload","http://localhost:3300/upload"]]

+ 1 - 1
.env.production

@@ -17,7 +17,7 @@ VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
 #VITE_PROXY = [["/jeecgsystem","http://10.248.223.116:9999"],["/upload","http://localhost:3300/upload"]]
 #VITE_PROXY = [["/jeecgsystem","http://10.248.210.152:9999"],["/upload","http://10.248.210.152:9999/upload"]]
 #VITE_PROXY = [["/jeecgsystem","http://182.92.126.35:9999"],["/upload","http://182.92.126.35:9999/upload"]]
-VITE_PROXY = [["/sw","http://10.246.167.205:6008"],["/modelreq","http://172.16.41.171:9999"],["/upload","http://172.16.41.171:9999/upload"],["/documents", "http://182.92.126.35:9050"],["/dataCenter", "http://192.168.1.88:10999"]]
+VITE_PROXY = [["/sw","http://10.246.167.205:6008"],["/modelreq","http://172.16.41.171:9999"],["/upload","http://172.16.41.171:9999/upload"],["/documents", "http://182.92.126.35:9050"],["/dataCenter", "http://39.97.59.228:10999"]]
 #VITE_PROXY = [["/jeecgsystem","http://172.16.41.171:9999"],["/upload","http://172.16.41.171:9999/upload"]]
 #VITE_PROXY = [["/jeecgsystem","http://10.120.120.163:9999"],["/upload","http://10.120.120.163:9999/upload"]]
 #VITE_PROXY = [["/jeecgsystem","http://192.168.1.4:9999"],["/upload","http://localhost:3300/upload"]]

+ 2 - 2
src/router/routes/index.ts

@@ -40,9 +40,9 @@ export const LoginRoute: AppRouteRecordRaw = {
   //新版后台登录,如果想要使用旧版登录放开即可
   // component: () => import('/@/views/sys/login/Login.vue'),
   //数据中心登录
-  // component: () => import('/@/views/sys/login/LoginDataCenter.vue'),
+  component: () => import('/@/views/sys/login/LoginDataCenter.vue'),
   // 内页登录
-  component: () => import('/@/views/sys/login/LoginNeiye.vue'),
+  // component: () => import('/@/views/sys/login/LoginNeiye.vue'),
   // component: () => import('/@/views/system/loginmini/MiniLogin.vue'),
   meta: {
     title: t('routes.basic.login'),

+ 1 - 1
src/views/sys/login/LoginDataCenter.vue

@@ -52,7 +52,7 @@ const handleForgotPwd = () => {
 /* 标题样式 */
 .title {
   position: absolute;
-  top: 24vh;
+  top: 28vh;
   left: 20%;
   transform: translateX(-50%);
   color: #e2e8f0;

+ 1 - 1
src/views/vent/dataCenter/deviceCenter/device.api.ts

@@ -1,7 +1,7 @@
 import { defHttp } from '/@/utils/http/axios';
 
 enum Api {
-  deviceTypeList = '/safety/ventanalyDeviceInfo/DeviceKind/queryBySystem',
+  deviceTypeList = '/safety/ventanalyDeviceInfo/DeviceKind/queryByCatagory',
   deviceList = '/dataCenter/compute/deviceData/getDeviceAll',
   devMonitorList = '/dataCenter/compute/deviceData/getDeviceMonitorInfo',
 }

+ 21 - 11
src/views/vent/dataCenter/deviceCenter/index.vue

@@ -37,6 +37,7 @@
               :expand-row-by-click="true"
               :expanded-row-keys="expandedRowKeys"
               @expand="onExpand"
+              :loading="loading"
             >
               <!-- 自定义展开图标 -->
               <template #expandIcon="{ expanded, onExpand, record }">
@@ -59,7 +60,7 @@
                 <a-table
                   size="small"
                   :columns="innerColumns"
-                  :data-source="monitorList"
+                  :data-source="monitorList[record.id] || []"
                   :pagination="false"
                   :loading="loadingMap[record.id]"
                   bordered
@@ -145,7 +146,8 @@ const monitorTable = ref();
 const isRefresh = ref(true);
 const treeNodeTitle = ref(''); // 选中的树形标题
 const deviceList = ref<any[]>([]); // 设备列表
-const monitorList = ref<any[]>([]); // 监测数据列表
+const monitorList = ref<Record<string, any[]>>({}); // 监测数据列表
+const loading = ref(false);
 // 当前展开的行key数组
 const expandedRowKeys = ref([]);
 const scroll = reactive({
@@ -167,16 +169,19 @@ const onSelect: TreeProps['onSelect'] = (keys, e) => {
   deviceType.value = '';
   systemID.value = '';
   deviceList.value = [];
-  const title = e.node.title;
-  if (e.node.parent && e.node.parent.node.type.toString().startsWith('sys')) {
-    systemType.value = e.node.parent.node.type;
-    if (deviceType.value != e.node.parent.node.type) deviceType.value = e.node.parent.node.type;
-    systemID.value = e.node.type;
+  const currentNode = e.node;
+  const parentNode = currentNode.parent?.node;
+  let newDeviceType = '';
+  if (parentNode && parentNode.type.toString().startsWith('sys')) {
+    systemType.value = parentNode.type;
+    newDeviceType = parentNode.type;
+    systemID.value = currentNode.type;
   } else {
-    systemType.value = e.node.type;
-    if (deviceType.value != e.node.type) deviceType.value = e.node.type;
+    systemType.value = currentNode.type;
+    newDeviceType = currentNode.type;
   }
-  getDeviceList(deviceType.value);
+  deviceType.value = newDeviceType;
+  getDeviceList(newDeviceType);
 };
 // 获取所有节点key的函数
 const getAllNodeKeys = (nodes, type) => {
@@ -237,19 +242,23 @@ async function getDeviceList(deviceTypeVal?: any) {
     clearInterval(timer);
     timer = undefined;
   }
+  loading.value = true;
   const fetchDeviceData = async () => {
     const params: any = {
       devKind: deviceTypeVal,
+      pageNo: 1,
+      pageSize: 2000,
     };
     try {
       const result = await getDeviceListByType(params);
+      loading.value = false;
       deviceList.value = result.records; // 更新设备列表
     } catch (error) {
       console.error('定时请求设备列表失败:', error);
     }
   };
   await fetchDeviceData();
-  timer = setInterval(fetchDeviceData, 2000); // 2000ms = 2秒
+  timer = setInterval(fetchDeviceData, 3000);
 }
 
 // 外层表格列配置
@@ -351,6 +360,7 @@ async function refreshData(deviceId: string) {
   const device = deviceList.value.find((d) => d.id === deviceId);
   const result = await getDevMonitorListById({ devId: deviceId.toString() });
   monitorList.value[deviceId] = Object.values(result.readData);
+  console.log(monitorList.value[deviceId], '123123');
 }
 
 onMounted(() => {

+ 3 - 2
src/views/vent/dataCenter/infoCenter/index.vue

@@ -51,7 +51,7 @@
           <template #title> 每日采集数据量 </template>
           <template #container>
             <div class="content-wrapper">
-              <CustomChart :chart-config="dailyNumOption" :chart-data="deviceData" height="260px" width="100%" />
+              <CustomChartSJZX :chart-config="dailyNumOption" :chart-data="deviceData" height="260px" width="100%" />
             </div>
           </template>
         </infoBox>
@@ -89,7 +89,8 @@
   import customHeader from '/@/components/vent/customHeader.vue';
   import infoBox from './components/infoBox.vue';
   import { sysDataColumn, accessStatusColumn, dailyNumOption } from './infoCenter.data';
-  import CustomChart from '@/views/vent/home/configurable/components/detail/CustomChart.vue';
+  import CustomChartSJZX from '@/views/vent/home/configurable/components/detail/CustomChart-SJZX.vue';
+  // import CustomChart from '@/views/vent/home/configurable/components/detail/CustomChart.vue';
   import { getDeviceAll, getHomepageSummaryIndexes } from './infoCenter.api';
   import { useRouter } from 'vue-router';
   let mainTitle = ref('智能通风数据中心');

+ 8 - 1
src/views/vent/dataCenter/stationCenter/index.vue

@@ -29,6 +29,7 @@
               :expand-row-by-click="true"
               :expandedRowKeys="expandedRowKeys"
               @expand="handleExpand"
+              :loading="loading"
             >
               <!-- 自定义展开图标 -->
               <template #expandIcon="{ expanded, onExpand, record }">
@@ -66,7 +67,7 @@
                 <a-table
                   size="small"
                   :columns="innerColumns"
-                  :data-source="monitorList"
+                  :data-source="monitorList[record.id] || []"
                   :pagination="false"
                   :loading="loadingMap[record.id]"
                   bordered
@@ -109,6 +110,7 @@ const clsoeNum = ref(0);
 const monitorList = ref<Record<string, any[]>>({}); // 监测数据列表
 const expandedRowKeys = ref([]);
 const selectedIndex = ref(0);
+const loading = ref(false);
 // // 分页参数
 // const paginationState = ref({
 //   current: 1,
@@ -187,6 +189,8 @@ async function getSubStationList() {
 }
 //菜单选项切换
 function cardClick(item, ind) {
+  loading.value = true;
+
   selectedIndex.value = selectedIndex.value === ind ? -1 : ind;
   if (timer) {
     clearInterval(timer);
@@ -202,8 +206,11 @@ const loadingMap = reactive({});
 async function getDeviceList(ID?) {
   const params: any = {
     subId: ID.toString(),
+    pageNo: 1,
+    pageSize: 2000,
   };
   const result = await getDeviceListByType(params);
+  loading.value = false;
   deviceList.value = result.records;
 }
 // 外层表格列配置

+ 1 - 1
src/views/vent/deviceManager/configurationTable/types.ts

@@ -323,7 +323,7 @@ export interface ModuleDataChart extends ReadFrom {
     /** 图表系列的类型,若不配置则取 type 的值 */
     type?: 'pie' | 'bar' | 'line' | 'scatter';
     /** 该系列的数据说明, formatter 格式,将用于 legend 相关的内容 */
-    label: string;
+    label: string | {};
     /** 设置 series 系列时的基础路径,配合上级 readFrom 使用,其应指向一个数组,该数组将作为映射系列时的基准 */
     readFrom: string;
     /** 取值 prop,注意该项不支持 formatter 格式,将用于 xAxis 相关的内容 */

+ 1 - 1
src/views/vent/home/configurable/blue/components/content.vue

@@ -115,7 +115,7 @@
         </template>
         <!-- lxh -->
         <template v-if="config.name === 'select_cs'">
-          <SelectCs :devicedata="config.data" :setLabelData="config.config.setLabelConfig" />
+          <SelectCs :devicedata="config.data" :config="config.config" />
         </template>
         <template v-if="config.name === 'measure_detail'">
           <MeasureDetail

+ 1 - 1
src/views/vent/home/configurable/components/content.vue

@@ -121,7 +121,7 @@
         </template>
         <!-- lxh -->
         <template v-if="config.name === 'select_cs'">
-          <SelectCs :devicedata="config.data" :setLabelData="config.config.setLabelConfig" />
+          <SelectCs :devicedata="config.data" :config="config.config" />
         </template>
         <template v-if="config.name === 'measure_detail'">
           <MeasureDetail

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 352 - 0
src/views/vent/home/configurable/components/detail/CustomChart-SJZX.vue


+ 138 - 101
src/views/vent/home/configurable/components/preset/SelectCs.vue

@@ -2,136 +2,173 @@
   <div class="select-cs">
     <div class="select-item">
       <div class="select-item-box">
-        <a-select v-model:value="selectVal" :placeholder="setLabelData['selectL']" :bordered="false" style="width: 100%">
-          <a-select-option v-for="item in optionList" :key="item.value" :value="item.value">{{ item.label
-          }}</a-select-option>
+        <a-select v-model:value="selectVal" :bordered="false" style="width: 100%">
+          <a-select-option v-for="item in options" :key="item.value" :value="item.value">{{ item.label }}</a-select-option>
         </a-select>
       </div>
       <div class="select-item-box">
-        <span>{{ setLabelData['switchL'][0] }}</span>
-        <a-switch v-model:checked="checkedStatus" />
-        <span>{{ setLabelData['switchL'][1] }}</span>
+        <span>{{ config.switch1.label[0] }}</span>
+        <a-switch
+          :disabled="config.switch1.disabled"
+          :checked="getFormattedText(devicedata, config.switch1.value, config.switch1.trans)"
+          @update:checked="handlUpdate($event, config.switch1)"
+        />
+        <span>{{ config.switch1.label[1] }}</span>
       </div>
-
-
     </div>
     <div class="select-item">
       <div class="select-item-box1">
-        <span>{{ setLabelData['switchL1'] }}</span>
-        <a-switch v-model:checked="checkedJlb" />
+        <span>{{ config.switch2.label[0] }}</span>
+        <a-switch
+          :disabled="config.switch2.disabled"
+          :checked="getFormattedText(devicedata, config.switch2.value, config.switch2.trans)"
+          @update:checked="handlUpdate($event, config.switch2)"
+        />
       </div>
       <div class="select-item-box1">
-        <span>{{ setLabelData['switchL2'] }}</span>
-        <a-switch v-model:checked="checkedZjb" />
+        <span>{{ config.switch3.label[0] }}</span>
+        <a-switch
+          :disabled="config.switch3.disabled"
+          :checked="getFormattedText(devicedata, config.switch3.value, config.switch3.trans)"
+          @update:checked="handlUpdate($event, config.switch3)"
+        />
       </div>
     </div>
   </div>
 </template>
 
 <script lang="ts" setup>
-import { ref, watch } from 'vue'
-
-let props = defineProps({
-  devicedata: {
-    type: Object,
-    default: () => {
-      return {}
-    }
-  },
-  setLabelData: {
-    type: Object,
-    default: () => {
-      return {}
-    }
-  },
-
-})
-
-let selectVal = ref(undefined)
-let optionList = ref<any[]>([
-  { label: '测试', value: 1 },
-  { label: '测试1', value: 2 },
-  { label: '测试2', value: 3 },
-])
-let checkedStatus = ref(false)
-let checkedJlb = ref(false)
-let checkedZjb = ref(false)
-
-watch(() => props.devicedata, (newV, oldV) => {
-  console.log(newV, '测试---')
-}, {
-  deep: true,
-  immediate: true
-})
+  import { computed, ref } from 'vue';
+  import { getData, getFormattedText } from '../../hooks/helper';
+  import { deviceControlApi } from '/@/api/vent';
+  import { message } from 'ant-design-vue';
+
+  interface SwitchConfig {
+    /** 提交控制时 启动 状态对应的key */
+    keyOn: string;
+    /** 提交控制时 关闭 状态对应的key */
+    keyOff: string;
+    /** 提交控制时 启动 状态对应的value */
+    valueOn: string;
+    /** 提交控制时 关闭 状态对应的value */
+    valueOff: string;
+    /** 提示文本,按需从数组中依次读取内容 */
+    label: string[];
+    disabled?: boolean;
+    /** 判断该项的默认状态时用到的value,formatter格式 */
+    value: string;
+    /** 如果value不是boolean类型,需要给出trans转换 */
+    trans: any;
+  }
+  interface CSConfig {
+    selector: {
+      label: string;
+      value: string;
+      readFrom: string;
+    };
+    switch1: SwitchConfig;
+    switch2: SwitchConfig;
+    switch3: SwitchConfig;
+  }
 
+  const props = defineProps<{
+    config: CSConfig;
+    devicedata: Record<string, any>;
+  }>();
+
+  const options = computed(() => {
+    const { readFrom, value, label } = props.config.selector;
+    const res = getData(props.devicedata.value, readFrom);
+    return (Array.isArray(res) ? res : [res]).map((item) => {
+      return {
+        label: getFormattedText(item, label),
+        value: getFormattedText(item, value),
+      };
+    });
+  });
+
+  const selectVal = ref(undefined);
+
+  function handlUpdate(checked: boolean, item: SwitchConfig) {
+    deviceControlApi({
+      deviceid: selectVal,
+      paramcode: checked ? item.keyOn : item.keyOff,
+      value: checked ? item.valueOn : item.valueOff,
+    })
+      .then((r) => {
+        if (!r.success) throw r.message || '操作失败';
+        message.success('指令下发成功');
+      })
+      .catch((e) => {
+        message.error(typeof e === 'string' ? e : '指令下发失败');
+      });
+  }
 </script>
 
 <style lang="less" scoped>
-.select-cs {
-  height: 100%;
-  padding: 5px 15px;
-  box-sizing: border-box;
-  width: 100%;
-  overflow-y: auto;
-
-  .select-item {
-    display: flex;
+  .select-cs {
+    height: 100%;
+    padding: 5px 15px;
+    box-sizing: border-box;
     width: 100%;
-    height: calc(50% - 2px);
-
-    &:nth-child(1) {
-      margin-bottom: 2px;
-      padding: 0px 10px;
-      background: url('@/assets/images/vent/homeNew/databg/11.png') no-repeat;
-      background-size: 100% 100%;
-    }
+    overflow-y: auto;
 
-    &:nth-child(2) {
-      margin-top: 2px;
-    }
-
-    .select-item-box {
+    .select-item {
       display: flex;
-      justify-content: center;
-      align-items: center;
-      width: 50%;
-      height: 34px;
-      padding-top: 6px;
-      box-sizing: border-box;
+      width: 100%;
+      height: calc(50% - 2px);
 
       &:nth-child(1) {
-        background: url('@/assets/images/vent/homeNew/databg/bg-line.png') no-repeat right;
+        margin-bottom: 2px;
+        padding: 0px 10px;
+        background: url('@/assets/images/vent/homeNew/databg/11.png') no-repeat;
+        background-size: 100% 100%;
       }
 
-      span {
-        margin: 0px 10px;
+      &:nth-child(2) {
+        margin-top: 2px;
       }
-    }
 
-    .select-item-box1 {
-      display: flex;
-      justify-content: space-between;
-      width: 100%;
-      height: 100%;
-      padding: 10px 20px 0px 20px;
-      box-sizing: border-box;
-      background: url('@/assets/images/vent/homeNew/databg/13.png') no-repeat;
-      background-size: 100% 100%;
-    }
-  }
+      .select-item-box {
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        width: 50%;
+        height: 34px;
+        padding-top: 6px;
+        box-sizing: border-box;
+
+        &:nth-child(1) {
+          background: url('@/assets/images/vent/homeNew/databg/bg-line.png') no-repeat right;
+        }
+
+        span {
+          margin: 0px 10px;
+        }
+      }
 
-  ::v-deep .zxm-select-selector {
-    background-color: transparent;
-    height: 28px;
-    padding: 0 10px;
-  }
+      .select-item-box1 {
+        display: flex;
+        justify-content: space-between;
+        width: 100%;
+        height: 100%;
+        padding: 10px 20px 0px 20px;
+        box-sizing: border-box;
+        background: url('@/assets/images/vent/homeNew/databg/13.png') no-repeat;
+        background-size: 100% 100%;
+      }
+    }
 
-  ::v-deep .zxm-switch {
+    ::v-deep .zxm-select-selector {
+      background-color: transparent;
+      height: 28px;
+      padding: 0 10px;
+    }
 
-    border-top: 1px solid rgba(45, 187, 255);
-    border-bottom: 1px solid rgba(45, 187, 255);
-    border-right: 1px solid rgba(45, 187, 255);
+    ::v-deep .zxm-switch {
+      border-top: 1px solid rgba(45, 187, 255);
+      border-bottom: 1px solid rgba(45, 187, 255);
+      border-right: 1px solid rgba(45, 187, 255);
+    }
   }
-
-}
-</style>
+</style>

+ 43 - 6
src/views/vent/home/configurable/configurable.data.tashan.ts

@@ -135,12 +135,49 @@ export const testConfigTSFire: Config[] = [
       complex_list: [],
       preset: [
         {
-          readFrom: 'select_cs',
-          setLabelConfig: {
-            selectL: '请选择...',
-            switchL: ['开启', '关闭'],
-            switchL1: '进料泵',
-            switchL2: '注浆泵',
+          readFrom: 'spray.datalist',
+          config: {
+            selector: {
+              label: '',
+              value: '',
+            },
+            switch1: {
+              keyOn: 'run_auto_sign',
+              keyOff: 'run_auto_sign',
+              valueOn: '1',
+              valueOff: '0',
+              label: ['开启', '关闭'],
+              value: '${readData.isOnline}',
+              trans: {
+                '1': true,
+                '0': false,
+              },
+            },
+            switch2: {
+              keyOn: '',
+              keyOff: '',
+              valueOn: '1',
+              valueOff: '0',
+              disabled: true,
+              label: ['注浆电机'],
+              value: '${readData.ZjDjStatus}',
+              trans: {
+                '1': true,
+                '0': false,
+              },
+            },
+            switch3: {
+              keyOn: '',
+              keyOff: '',
+              valueOn: '1',
+              valueOff: '0',
+              label: ['送料电机'],
+              value: '${readData.SlDjStatus}',
+              trans: {
+                '1': true,
+                '0': false,
+              },
+            },
           },
         },
       ],

+ 99 - 0
src/views/vent/monitorManager/sprayMonitor/backup.vue

@@ -0,0 +1,99 @@
+<!-- eslint-disable vue/multi-word-component-names -->
+<template>
+  <div class="spray-wrapper">
+    <BasicMonitoring
+      main-title="凝胶防灭火材料自动喷洒系统"
+      :main-config="{
+        operations: operations,
+        configs: configs,
+      }"
+      :monitor-history-config="{}"
+      :handler-history-config="{}"
+      :alarm-history-config="{}"
+      strtype="sys_surface_juejin"
+    >
+      <template #default="{ monitorData }">
+        <div id="spray3D" class="w-full h-full flex justify-center items-center overflow-hidden">
+          <a-spin :spinning="loading" />
+          <div id="sprayCSS3D" v-show="!loading" style="width: 100%; height: 100%; position: absolute; overflow: hidden; pointer-events: none">
+            <FourBorderBg id="sprayCSS3DEnvA">
+              <div>送料电机</div>
+              <div>电压US:{{ get(monitorData, 'spray_auto[0].readData.SlDjdy', '-') }}</div>
+              <div>电流LA:{{ get(monitorData, 'spray_auto[0].readData.SlDjAdl', '-') }}</div>
+              <div>电流LB:{{ get(monitorData, 'spray_auto[0].readData.SlDjBdl', '-') }}</div>
+              <div>电流LC:{{ get(monitorData, 'spray_auto[0].readData.SlDjCdl', '-') }}</div>
+            </FourBorderBg>
+            <FourBorderBg id="sprayCSS3DEnvB">
+              <div>注浆电机</div>
+              <div>电压US:{{ get(monitorData, 'spray_auto[0].readData.ZjDjdy', '-') }}</div>
+              <div>电流LA:{{ get(monitorData, 'spray_auto[0].readData.ZjDjAdl', '-') }}</div>
+              <div>电流LB:{{ get(monitorData, 'spray_auto[0].readData.ZjDjBdl', '-') }}</div>
+              <div>电流LC:{{ get(monitorData, 'spray_auto[0].readData.ZjDjCdl', '-') }}</div>
+            </FourBorderBg>
+          </div>
+        </div>
+      </template>
+    </BasicMonitoring>
+  </div>
+</template>
+<script setup lang="ts">
+  import { onMounted, ref } from 'vue';
+  import BasicMonitoring from '/@/components/vent/BasicMonitoring.vue';
+  import { useInitConfigs } from '../../home/configurable/hooks/useInit';
+  import { mountedThree, setModelType } from './spray.three';
+  import FourBorderBg from '/@/components/vent/fourBorderBg.vue';
+  import { get } from 'lodash-es';
+
+  const { configs, fetchConfigs } = useInitConfigs();
+  const loading = ref(false);
+
+  const operations = ref([
+    {
+      label: '开启控制箱',
+      key: 'run_auto_sign',
+      value: '1',
+      disabled: false,
+      showPassword: true,
+      // permission: 'spray:run_auto_sign',
+    },
+    {
+      label: '关闭控制箱',
+      key: 'run_auto_sign',
+      value: '0',
+      disabled: false,
+      showPassword: true,
+      // permission: 'spray:run_auto_sign',
+    },
+  ]);
+
+  onMounted(() => {
+    fetchConfigs('spray');
+    loading.value = true;
+    mountedThree('#spray3D', ['#sprayCSS3D', '#sprayCSS3DEnvA', '#sprayCSS3DEnvB']).then(() => {
+      setModelType('spray').finally(() => {
+        loading.value = false;
+      });
+    });
+  });
+</script>
+
+<style lang="less" scoped>
+  .spray-wrapper {
+    width: 100%;
+    height: 100%;
+  }
+
+  #spray3D {
+    pointer-events: all;
+  }
+
+  .spray-wrapper :deep(.list-item_L .list-item__icon_L) {
+    background-image: url('/@/assets/images/home-container/configurable/minehome/list-icon-file.png');
+  }
+  .spray-wrapper :deep(.list-item_N:nth-child(1)) {
+    background-image: url('/@/assets/images/home-container/configurable/minehome/list-bg-n5.png');
+  }
+  .spray-wrapper :deep(.list-item_N:nth-child(2)) {
+    background-image: url('/@/assets/images/home-container/configurable/minehome/list-bg-n6.png');
+  }
+</style>

+ 81 - 5
src/views/vent/monitorManager/sprayMonitor/index.vue

@@ -16,7 +16,7 @@
         <div id="spray3D" class="w-full h-full flex justify-center items-center overflow-hidden">
           <a-spin :spinning="loading" />
           <div id="sprayCSS3D" v-show="!loading" style="width: 100%; height: 100%; position: absolute; overflow: hidden; pointer-events: none">
-            <FourBorderBg id="sprayCSS3DEnvA">
+            <!-- <FourBorderBg id="sprayCSS3DEnvA">
               <div>送料电机</div>
               <div>电压US:{{ get(monitorData, 'spray_auto[0].readData.SlDjdy', '-') }}</div>
               <div>电流LA:{{ get(monitorData, 'spray_auto[0].readData.SlDjAdl', '-') }}</div>
@@ -29,7 +29,7 @@
               <div>电流LA:{{ get(monitorData, 'spray_auto[0].readData.ZjDjAdl', '-') }}</div>
               <div>电流LB:{{ get(monitorData, 'spray_auto[0].readData.ZjDjBdl', '-') }}</div>
               <div>电流LC:{{ get(monitorData, 'spray_auto[0].readData.ZjDjCdl', '-') }}</div>
-            </FourBorderBg>
+            </FourBorderBg> -->
           </div>
         </div>
       </template>
@@ -44,6 +44,7 @@
   import { mountedThree, setModelType } from './spray.three';
   import FourBorderBg from '/@/components/vent/fourBorderBg.vue';
   import { get } from 'lodash-es';
+  import { zuhuabengConfigs } from './spray.data';
 
   const defaultConfigs: Config[] = [
     {
@@ -279,9 +280,27 @@
   const { configs, fetchConfigs } = useInitConfigs();
   const loading = ref(false);
 
+  // const operations = ref([
+  //   {
+  //     label: '开启控制箱',
+  //     key: 'run_auto_sign',
+  //     value: '1',
+  //     disabled: false,
+  //     showPassword: true,
+  //     // permission: 'spray:run_auto_sign',
+  //   },
+  //   {
+  //     label: '关闭控制箱',
+  //     key: 'run_auto_sign',
+  //     value: '0',
+  //     disabled: false,
+  //     showPassword: true,
+  //     // permission: 'spray:run_auto_sign',
+  //   },
+  // ]);
   const operations = ref([
     {
-      label: '开启控制箱',
+      label: '急停',
       key: 'run_auto_sign',
       value: '1',
       disabled: false,
@@ -289,7 +308,63 @@
       // permission: 'spray:run_auto_sign',
     },
     {
-      label: '关闭控制箱',
+      label: '补水阀启停',
+      key: 'run_auto_sign',
+      value: '0',
+      disabled: false,
+      showPassword: true,
+      // permission: 'spray:run_auto_sign',
+    },
+    {
+      label: '搅拌阀启停',
+      key: 'run_auto_sign',
+      value: '0',
+      disabled: false,
+      showPassword: true,
+      // permission: 'spray:run_auto_sign',
+    },
+    {
+      label: '组化泵启停',
+      key: 'run_auto_sign',
+      value: '0',
+      disabled: false,
+      showPassword: true,
+      // permission: 'spray:run_auto_sign',
+    },
+    {
+      label: '上料机启停',
+      key: 'run_auto_sign',
+      value: '0',
+      disabled: false,
+      showPassword: true,
+      // permission: 'spray:run_auto_sign',
+    },
+    // {
+    //   label: '上料机2启停',
+    //   key: 'run_auto_sign',
+    //   value: '0',
+    //   disabled: false,
+    //   showPassword: true,
+    //   // permission: 'spray:run_auto_sign',
+    // },
+    {
+      label: '搅拌电机启停',
+      key: 'run_auto_sign',
+      value: '0',
+      disabled: false,
+      showPassword: true,
+      // permission: 'spray:run_auto_sign',
+    },
+    {
+      label: '上料自动',
+      key: 'run_auto_sign',
+      value: '0',
+      disabled: false,
+      showPassword: true,
+      // permission: 'spray:run_auto_sign',
+    },
+    {
+      label: '喷洒自动',
       key: 'run_auto_sign',
       value: '0',
       disabled: false,
@@ -299,7 +374,8 @@
   ]);
 
   onMounted(() => {
-    fetchConfigs('spray');
+    // fetchConfigs('spray');
+    configs.value = zuhuabengConfigs;
     loading.value = true;
     mountedThree('#spray3D', ['#sprayCSS3D', '#sprayCSS3DEnvA', '#sprayCSS3DEnvB']).then(() => {
       setModelType('spray').finally(() => {

+ 611 - 0
src/views/vent/monitorManager/sprayMonitor/spray.data.ts

@@ -0,0 +1,611 @@
+import { Config } from '../../deviceManager/configurationTable/types';
+
+export const defaultConfigs: Config[] = [
+  {
+    deviceType: '',
+    moduleName: '压力传感器',
+    pageType: 'spray',
+    moduleData: {
+      header: {
+        show: false,
+        readFrom: '',
+        selector: {
+          show: false,
+          value: '',
+        },
+        slot: {
+          show: false,
+          value: '',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: {
+        direction: 'row',
+        items: [
+          {
+            name: 'board',
+            basis: '100%',
+          },
+        ],
+      },
+      board: [
+        {
+          type: 'P',
+          layout: 'label-top',
+          items: [
+            {
+              label: '在线数量',
+              value: '1',
+            },
+            {
+              label: '异常数量',
+              value: '0',
+            },
+          ],
+          readFrom: '',
+        },
+      ],
+    },
+    showStyle: {
+      size: 'width:440px;height:250px;',
+      version: '保德',
+      position: 'top:80px;left:10px;',
+    },
+  },
+  {
+    deviceType: '',
+    moduleName: '喷洒实况',
+    pageType: 'spray',
+    moduleData: {
+      header: {
+        show: false,
+        readFrom: '',
+        selector: {
+          show: false,
+          value: '',
+        },
+        slot: {
+          show: false,
+          value: '',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: {
+        direction: 'row',
+        items: [
+          {
+            name: 'table',
+            basis: '100%',
+          },
+        ],
+      },
+      table: [
+        {
+          type: 'A',
+          columns: [
+            {
+              name: '支架',
+              prop: 'strinstallpos',
+            },
+            {
+              name: '工作状态',
+              prop: 'readData.online_str',
+            },
+          ],
+          readFrom: 'spray_auto',
+        },
+      ],
+      preset: [],
+    },
+    showStyle: {
+      size: 'width:440px;height:430px;',
+      version: '保德',
+      position: 'top:350px;left:10px;',
+    },
+  },
+  {
+    deviceType: '',
+    moduleName: '场景信息总览',
+    pageType: 'spray',
+    moduleData: {
+      header: { show: false, readFrom: '', selector: { show: false, value: '' }, slot: { show: false, value: '' } },
+      background: { show: false, type: 'video', link: '' },
+      layout: {
+        direction: 'column',
+        items: [
+          {
+            name: 'list',
+            basis: '50%',
+            overflow: false,
+          },
+          {
+            name: 'partition',
+            basis: 'auto',
+            overflow: false,
+          },
+          {
+            name: 'list',
+            basis: 'auto',
+            overflow: false,
+          },
+          {
+            name: 'partition',
+            basis: 'auto',
+            overflow: false,
+          },
+          {
+            name: 'list',
+            basis: 'auto',
+            overflow: false,
+          },
+        ],
+      },
+      list: [
+        {
+          type: 'L',
+          readFrom: '',
+          items: [
+            {
+              label: '绑定控制箱名称',
+              value: '${spray_auto[0].strinstallpos}',
+            },
+            {
+              label: '控制箱地址',
+              value: '${spray_auto[0].readData.snumber}',
+            },
+            {
+              label: '故障从机',
+              value: '${spray_auto[0].readData.Cjgz}',
+            },
+            {
+              label: '浮球液位报警',
+              value: '${spray_auto[0].readData.minimumgrouting}',
+            },
+            {
+              label: '输送管道压力',
+              value: '${spray_auto[0].readData.zjbhglpaV}',
+            },
+          ],
+        },
+        {
+          type: 'N',
+          readFrom: '',
+          items: [
+            {
+              label: '启动状态',
+              value: '${spray_auto[0].readData.online_str}',
+              color: 'blue',
+            },
+            {
+              label: '报警状态',
+              value: '${spray_auto[0].warnLevel_str}',
+            },
+          ],
+        },
+        {
+          type: 'N',
+          readFrom: '',
+          items: [
+            {
+              label: '启动状态',
+              value: '${spray_auto[0].readData.online_str}',
+              color: 'blue',
+            },
+            {
+              label: '故障状态',
+              value: '${spray_auto[0].readData.warnLevel_str}',
+            },
+          ],
+        },
+      ],
+      partition: [
+        {
+          type: 'A',
+          readFrom: '',
+          layout: 'icon-pre',
+          label: '送料电机',
+          icon: '/src/assets/images/home-container/configurable/tashanhome/partition-icon-1.png',
+        },
+        {
+          type: 'A',
+          readFrom: '',
+          layout: 'icon-pre',
+          label: '输送电机',
+          icon: '/src/assets/images/home-container/configurable/tashanhome/partition-icon-2.png',
+        },
+      ],
+    },
+    showStyle: {
+      size: 'width:440px;height:700px;',
+      version: '原版',
+      position: 'top:80px;right:10px;',
+    },
+  },
+];
+
+/** 阻化泵 */
+export const zuhuabengConfigs: Config[] = [
+  {
+    deviceType: '',
+    moduleName: '实时数据',
+    pageType: 'spray',
+    moduleData: {
+      header: {
+        show: false,
+        readFrom: '',
+        selector: {
+          show: false,
+          value: '',
+        },
+        slot: {
+          show: false,
+          value: '',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: {
+        direction: 'column',
+        items: [
+          {
+            name: 'list',
+            basis: '100%',
+            overflow: false,
+          },
+        ],
+      },
+      list: [
+        {
+          type: 'F',
+          readFrom: '',
+          items: [
+            {
+              label: '溶液液位',
+              value: '-',
+            },
+            {
+              label: '出口压力',
+              value: '-',
+            },
+            {
+              label: '溶液浓度',
+              value: '-',
+            },
+            {
+              label: '出液瞬时流量',
+              value: '-',
+            },
+            {
+              label: '出液累计流量',
+              value: '-',
+            },
+            {
+              label: '补水瞬时流量',
+              value: '-',
+            },
+            {
+              label: '单次下料量',
+              value: '-',
+            },
+            {
+              label: '单次补水量',
+              value: '-',
+            },
+            {
+              label: '累计补水量',
+              value: '-',
+            },
+            {
+              label: '阻化剂重量',
+              value: '-',
+            },
+            {
+              label: '需下料量',
+              value: '-',
+            },
+            {
+              label: '当天出液量',
+              value: '-',
+            },
+            {
+              label: '采煤机位置',
+              value: '-',
+            },
+            {
+              label: '下料时间',
+              value: '-',
+            },
+            {
+              label: '补水流量计状态',
+              value: '-',
+            },
+            {
+              label: '出液流量计状态',
+              value: '-',
+            },
+          ],
+        },
+      ],
+    },
+    showStyle: {
+      size: 'width:440px;height:450px;',
+      version: '保德',
+      position: 'top:60px;left:10px;',
+    },
+  },
+  {
+    deviceType: '',
+    moduleName: '阻化泵',
+    pageType: 'spray',
+    moduleData: {
+      header: {
+        show: false,
+        readFrom: '',
+        selector: {
+          show: false,
+          value: '',
+        },
+        slot: {
+          show: false,
+          value: '',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: {
+        direction: 'column',
+        items: [
+          {
+            name: 'list',
+            basis: '100%',
+            overflow: false,
+          },
+        ],
+      },
+      list: [
+        {
+          type: 'L',
+          readFrom: '',
+          items: [
+            {
+              label: '工作电压',
+              value: '-',
+            },
+            {
+              label: 'A相电流',
+              value: '-',
+            },
+            {
+              label: 'B相电流',
+              value: '-',
+            },
+            {
+              label: 'C相电流',
+              value: '-',
+            },
+            {
+              label: '运行状态',
+              value: '-',
+            },
+            {
+              label: '通讯状态',
+              value: '-',
+            },
+          ],
+        },
+      ],
+      preset: [],
+    },
+    showStyle: {
+      size: 'width:440px;height:320px;',
+      version: '保德',
+      position: 'top:520px;left:10px;',
+    },
+  },
+  {
+    deviceType: '',
+    moduleName: '搅拌装置',
+    pageType: 'spray',
+    moduleData: {
+      header: {
+        show: false,
+        readFrom: '',
+        selector: {
+          show: false,
+          value: '',
+        },
+        slot: {
+          show: false,
+          value: '',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: {
+        direction: 'column',
+        items: [
+          {
+            name: 'list',
+            basis: '100%',
+            overflow: false,
+          },
+        ],
+      },
+      list: [
+        {
+          type: 'L',
+          readFrom: '',
+          items: [
+            {
+              label: '工作电压',
+              value: '-',
+            },
+            {
+              label: 'A相电流',
+              value: '-',
+            },
+            {
+              label: 'B相电流',
+              value: '-',
+            },
+            {
+              label: 'C相电流',
+              value: '-',
+            },
+            {
+              label: '运行状态',
+              value: '-',
+            },
+            {
+              label: '通讯状态',
+              value: '-',
+            },
+          ],
+        },
+      ],
+      preset: [],
+    },
+    showStyle: {
+      size: 'width:440px;height:320px;',
+      version: '保德',
+      position: 'top:50px;right:10px;',
+    },
+  },
+  {
+    deviceType: '',
+    moduleName: '上料机',
+    pageType: 'spray',
+    moduleData: {
+      header: {
+        show: false,
+        readFrom: '',
+        selector: {
+          show: false,
+          value: '',
+        },
+        slot: {
+          show: false,
+          value: '',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: {
+        direction: 'column',
+        items: [
+          {
+            name: 'list',
+            basis: '100%',
+            overflow: false,
+          },
+        ],
+      },
+      list: [
+        {
+          type: 'L',
+          readFrom: '',
+          items: [
+            {
+              label: '工作电压',
+              value: '-',
+            },
+            {
+              label: 'A相电流',
+              value: '-',
+            },
+            {
+              label: 'B相电流',
+              value: '-',
+            },
+            {
+              label: 'C相电流',
+              value: '-',
+            },
+            {
+              label: '运行状态',
+              value: '-',
+            },
+            {
+              label: '通讯状态',
+              value: '-',
+            },
+          ],
+        },
+      ],
+      preset: [],
+    },
+    showStyle: {
+      size: 'width:440px;height:320px;',
+      version: '保德',
+      position: 'top:380px;right:10px;',
+    },
+  },
+  {
+    deviceType: '',
+    moduleName: '场景信息总览',
+    pageType: 'spray',
+    moduleData: {
+      header: { show: false, readFrom: '', selector: { show: false, value: '' }, slot: { show: false, value: '' } },
+      background: { show: false, type: 'video', link: '' },
+      layout: {
+        direction: 'row',
+        items: [
+          {
+            name: 'board',
+            basis: '100%',
+          },
+        ],
+      },
+      board: [
+        {
+          type: 'G',
+          layout: 'label-top',
+          items: [
+            {
+              label: '压力高限报警',
+              value: '1',
+            },
+            {
+              label: '流量下限报警',
+              value: '0',
+            },
+            {
+              label: '急停报警',
+              value: '1',
+            },
+            {
+              label: '液位低限报警',
+              value: '0',
+            },
+          ],
+          readFrom: '',
+        },
+      ],
+    },
+    showStyle: {
+      size: 'width:440px;height:180px;',
+      version: '原版',
+      position: 'top:710px;right:10px;',
+    },
+  },
+];

+ 1 - 1
src/views/vent/monitorManager/sprayMonitor/spray.three.ts

@@ -28,7 +28,7 @@ function dispatchMouseEvent(event) {
 function initEventListender() {
   if (!model) return;
   model.canvasContainer?.addEventListener('mousedown', (e) => dispatchMouseEvent(e));
-  // model.orbitControls?.addEventListener('change', () => {});
+  // model.orbitControls?.addEventListener('change', () => console.log('debug camera', model.camera, model.orbitControls));
 }
 
 /** 渲染并更新总模型 */

+ 10 - 9
src/views/vent/monitorManager/sprayMonitor/spray.threejs.base.ts

@@ -8,15 +8,16 @@ import { setModalCenter } from '/@/utils/threejs/util';
 
 class ModelContext {
   model;
-  modelName = 'spray-ts';
+  modelName = 'spray-upper';
+  // modelName = 'spray-ts';
   // modelName = 'dedust';
   group: THREE.Object3D | null = null;
   /** 本模型内支持的锚点位置数组 */
   anchors: [number, number, number][] = [
-    [-0.6, 0.3, -0.05],
+    [1.5, 0.5, 1.6],
     // [0, 0, 0],
     // 右侧传感器
-    [-0.3, 0.3, -0.05],
+    [1.3, 0.5, 1.6],
     // [-25.847, 8.783, 3.267],
     // [31.142, 8.783, 3.267],
   ];
@@ -24,15 +25,15 @@ class ModelContext {
   cssSprites: CSS3DSprite[] = [];
   /** 初始化时用到的摄像头位置参数,可以供外部访问或初始化时使用 */
   cameraPostion = {
-    x: 0.05342932338990988,
-    y: 0.08324360118266554,
-    z: 1.2186385420339856,
+    x: 2.0063999826191625,
+    y: 0.3963997081529602,
+    z: 3.275298992446514,
   };
   /** 初始化时用到的滑轨目标参数,可以供外部访问或初始化时使用,配合摄像头可以实现更精确的控制 */
   orbitTarget = {
-    x: 0,
-    y: 0,
-    z: 0,
+    x: 2.023679325280445,
+    y: -0.1461634482645532,
+    z: 0.04677126793423104,
   };
 
   constructor(model) {

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä