hongrunxia vor 1 Jahr
Ursprung
Commit
c46ed09692

BIN
public/model/glft/cf/ddcf_2023-07-13.glb


+ 1 - 0
src/utils/threejs/main.worker.ts

@@ -20,6 +20,7 @@ export function initModalWorker() {
     'cf/zdcf_2023-06-02.glb',
     'cf/dscf_2023-06-02.glb',
     'cf/dsgd_2023-06-02.glb',
+    'cf/ddcf_2023-07-13.glb',
     'cf/dsmove_2023-06-02.glb',
 
     'jbfj/jbfj-hd_2023-06-06.glb',

+ 132 - 0
src/views/vent/deviceManager/comment/warningTabel/index3.vue

@@ -0,0 +1,132 @@
+<template>
+  <div class="vent-flex-row">
+    <span style="color: #fff;">关联的控制设备:</span>
+    <a-select v-model:value="sysDeviceId" style="width: 200px" placeholder="关联的控制设备" :options="sysDeviceOptions"
+      @change="handleChange" :allowClear="true" />
+    <a-button class="vent-margin-l-8" type="primary" @click="getDeviceWarningPointList"> 查询 </a-button>
+    <a-button class="vent-margin-l-8" type="primary" @click="addPoint"> 新增 </a-button>
+  </div>
+
+  <EditRowTableVue v-if="refresh" ref="RefComponent" :columns="BackWindDevicePointColumns" :data-source="dataSource"
+    @save-or-update="saveOrUpdate" @delete-by-id="handleDelete" :isAdd="false" style="margin-top: 10px">
+
+  </EditRowTableVue>
+
+  <DevicePointTable @register="registerModal" :data-source="devicePointList" :selection-row-keys="selectionRowKeys"
+    @reload="reload" />
+</template>
+
+<script lang="ts" setup>
+import { defineProps, ref, onMounted } from 'vue';
+import { BackWindDevicePointColumns } from './warning.data';
+import EditRowTableVue from '../../../comment/EditRowTable.vue';
+import { backWindControlDevicePointList, backWindControlDevicePointEdit, backWindControlDevicePointDelete, workFaceDeviceList, workFacePointList, backWindControlDevicePointBatchAdd } from './warning.api';
+import DevicePointTable from './DevicePointTable.vue';
+import { useModal } from '/@/components/Modal';
+
+const props = defineProps({
+  deviceId: { type: String },
+  pointType: {
+    type: String,
+    requried: true,
+  },
+});
+
+const sysDeviceId = ref('') // 选中的关联设备的id
+const sysDeviceType = ref('')
+const devicePointList = ref<any[]>([])
+const selectionRowKeys = ref<any[]>([])
+const sysDeviceOptions = ref<any[]>([])
+let sysDeviceList = <any[]>[]
+const RefComponent = ref()
+const dataSource = ref<any[]>([])
+
+const refresh = ref(true)
+
+const [registerModal, { openModal }] = useModal();
+
+const handleChange = async (value) => {
+  sysDeviceId.value = value
+  const obj = sysDeviceList.find((element) => {
+    return element.id == value
+  })
+  sysDeviceType.value = obj['strtype']
+  await getDeviceWarningPointList()
+}
+
+async function getDeviceWarningPointList() {
+
+  const result = await backWindControlDevicePointList({ deviceId: sysDeviceId.value })
+  if (result && result.records.length > 0) {
+    dataSource.value = result.records
+  } else {
+    dataSource.value = []
+  }
+}
+
+async function getDevicePointList() {
+  try {
+    const result = await workFacePointList({ deviceType: sysDeviceType.value, valueType: 1 });
+    devicePointList.value = result
+    const rowKeys = <any[]>[]
+    dataSource.value.forEach((item) => {
+      rowKeys.push(item['monitorId'])
+    })
+    selectionRowKeys.value = rowKeys
+  } catch (error) {
+    devicePointList.value = []
+  }
+};
+
+async function getDeviceOptions() {
+  const result = await workFaceDeviceList({ id: props.deviceId })
+  const options = <any[]>[]
+  if (result.length > 0) {
+    result.forEach(element => {
+      options.push({ value: element.id, label: element.strname })
+    });
+    sysDeviceOptions.value = options
+    sysDeviceList = result
+  }
+
+}
+
+async function saveOrUpdate(record) {
+  try {
+    if (record.id) {
+      await backWindControlDevicePointEdit({ ...record });
+    }
+    RefComponent.value.reload()
+  } catch (error) { }
+}
+
+function handleDelete(id) {
+  backWindControlDevicePointDelete({ id }).then(() => {
+    getDeviceWarningPointList()
+  })
+}
+
+async function reload(list) {
+  const monitorList = <any[]>[]
+  list.forEach(item => {
+    monitorList.push({ deviceId: sysDeviceId.value, monitorId: item['id'], monitorName: item['valuename'], sysId: props.deviceId })
+  })
+  await backWindControlDevicePointBatchAdd(monitorList)
+  getDeviceWarningPointList()
+}
+
+function addPoint() {
+  getDevicePointList().then(() => {
+    openModal();
+  })
+}
+
+onMounted(async () => {
+  await getDeviceOptions()
+  await getDeviceWarningPointList()
+});
+</script>
+
+<style lang="less" scoped>
+@ventSpace: zxm;
+</style>

+ 1 - 15
src/views/vent/monitorManager/windrectMonitor/dantou.threejs.ts

@@ -1,7 +1,6 @@
 import * as THREE from 'three';
 
-import { getTextCanvas, renderVideo } from '/@/utils/threejs/util';
-import gsap from 'gsap';
+import { getTextCanvas } from '/@/utils/threejs/util';
 // import * as dat from 'dat.gui';
 // const gui = new dat.GUI();
 // gui.domElement.style = 'position:absolute;top:100px;left:10px;z-index:99999999999999';
@@ -29,19 +28,6 @@ class ddWindRect {
     // gui.add(directionalLight.position, 'y', -500, 500);
     // gui.add(directionalLight.position, 'z', -500, 500);
 
-    const spotLight = new THREE.SpotLight();
-    spotLight.angle = Math.PI / 16;
-    spotLight.penumbra = 0;
-    spotLight.castShadow = true;
-    spotLight.distance = 0;
-    spotLight.position.set(-470, -500, 500);
-    this.group.add(spotLight);
-
-    spotLight.shadow.camera.near = 0.5; // default
-    spotLight.shadow.camera.far = 1000; // default
-    spotLight.shadow.focus = 1;
-    spotLight.shadow.bias = -0.000002;
-
     // gui.add(spotLight.position, 'x', -500, 500);
     // gui.add(spotLight.position, 'y', -500, 500);
     // gui.add(spotLight.position, 'z', -500, 500);

+ 60 - 2
src/views/vent/monitorManager/windrectMonitor/windrect.threejs.ts

@@ -7,6 +7,7 @@ import dsWindRect from './duishe.threejs';
 import lmWindRectSide from './longmenSide.threejs';
 import useEvent from '../../../../utils/threejs/useEvent';
 import gsap from 'gsap';
+import ddWindRect from './dantou.threejs';
 // import * as dat from 'dat.gui';
 // const gui = new dat.GUI();
 // gui.domElement.style = 'position:absolute;top:100px;left:10px;z-index:99999999999999';
@@ -18,6 +19,7 @@ let model, //
   zdWindRectObj,
   dsWindRectObj,
   lmWindRectSideObj,
+  ddWindRectObj,
   windRectType = 'lmWindRect';
 
 const { mouseDownFn } = useEvent();
@@ -37,6 +39,8 @@ const startAnimation = () => {
       dsWindRectObj.mouseUpModel.call(dsWindRectObj);
     } else if (windRectType === 'lmWindSide') {
       lmWindRectSideObj.mouseUpModel.call(lmWindRectSideObj);
+    } else if (windRectType === 'ddWindSide') {
+      ddWindRectObj.mouseUpModel.call(ddWindRectObj);
     }
   });
 };
@@ -52,6 +56,8 @@ const mouseEvent = (event) => {
       dsWindRectObj.mousedownModel.call(dsWindRectObj, intersects);
     } else if (windRectType === 'lmWindSide') {
       lmWindRectSideObj.mousedownModel.call(lmWindRectSideObj, intersects);
+    } else if (windRectType === 'ddWindSide') {
+      ddWindRectObj.mousedownModel.call(ddWindRectObj, intersects);
     }
   });
   console.log('摄像头控制信息', model.orbitControls, model.camera);
@@ -66,7 +72,9 @@ export const addFmText = (selectData) => {
   } else if (windRectType.startsWith('dsWindRect')) {
     return dsWindRectObj.addFmText.call(dsWindRectObj, selectData);
   } else if (windRectType === 'lmWindSide') {
-    lmWindRectSideObj.addFmText.call(lmWindRectSideObj, selectData);
+    return lmWindRectSideObj.addFmText.call(lmWindRectSideObj, selectData);
+  } else if (windRectType === 'ddWindSide') {
+    return ddWindRectObj.addFmText.call(ddWindRectObj, selectData);
   }
 };
 
@@ -122,6 +130,9 @@ export const setModelType = (type) => {
       if (model.scene.getObjectByName('lmcfSide')) {
         model.scene.remove(lmWindRectSideObj.group);
       }
+      if (model.scene.getObjectByName('ddcf')) {
+        model.scene.remove(ddWindRectObj.group);
+      }
       const oldCameraPosition = { x: -1000, y: 100, z: 500 };
       model.scene.add(lmWindRectObj.group);
       setTimeout(async () => {
@@ -151,6 +162,9 @@ export const setModelType = (type) => {
       if (model.scene.getObjectByName('lmcfSide')) {
         model.scene.remove(lmWindRectSideObj.group);
       }
+      if (model.scene.getObjectByName('ddcf')) {
+        model.scene.remove(ddWindRectObj.group);
+      }
       model.scene.add(zdWindRectObj.group);
       const oldCameraPosition = { x: -1000, y: 100, z: 500 };
       setTimeout(async () => {
@@ -185,11 +199,21 @@ export const setModelType = (type) => {
       if (model.scene.getObjectByName('lmcfSide')) {
         model.scene.remove(lmWindRectSideObj.group);
       }
+      if (model.scene.getObjectByName('ddcf')) {
+        model.scene.remove(ddWindRectObj.group);
+      }
       model.scene.add(dsWindRectObj.group);
       setTimeout(async () => {
         resolve(null);
         const oldCameraPosition = { x: -1020, y: 100, z: 500 };
-        await animateCamera(oldCameraPosition, { x: 0, y: 0, z: 0 }, { x: 46.257, y: 57.539, z: 104.313 }, { x: 1.84, y: 0.98, z: -1.44 }, model, 0.8);
+        await animateCamera(
+          oldCameraPosition,
+          { x: 0, y: 0, z: 0 },
+          { x: 46.257, y: 57.539, z: 104.313 },
+          { x: 1.84, y: 0.98, z: -1.44 },
+          model,
+          0.8
+        );
       }, 300);
     } else if (windRectType === 'lmWindSide') {
       model.startAnimation = lmWindRectSideObj.render.bind(lmWindRectSideObj);
@@ -206,6 +230,9 @@ export const setModelType = (type) => {
       if (model.scene.getObjectByName('dscf')) {
         model.scene.remove(dsWindRectObj.group);
       }
+      if (model.scene.getObjectByName('ddcf')) {
+        model.scene.remove(ddWindRectObj.group);
+      }
       const oldCameraPosition = { x: -1000, y: 100, z: 500 };
       model.scene.add(lmWindRectSideObj.group);
       setTimeout(async () => {
@@ -223,6 +250,35 @@ export const setModelType = (type) => {
         );
         // lmWindRectSideObj.playCamera(true);
       }, 300);
+    } else if (windRectType.startsWith('ddWindSide')) {
+      model.startAnimation = ddWindRectObj.render.bind(ddWindRectObj);
+      group = ddWindRectObj.group;
+
+      if (model.scene.getObjectByName('lmcf')) {
+        model.scene.remove(lmWindRectObj.group);
+      }
+      if (model.scene.getObjectByName('zdcf')) {
+        model.scene.remove(zdWindRectObj.group);
+      }
+      if (model.scene.getObjectByName('lmcfSide')) {
+        model.scene.remove(lmWindRectSideObj.group);
+      }
+      if (model.scene.getObjectByName('dscf')) {
+        model.scene.remove(dsWindRectObj.group);
+      }
+      model.scene.add(ddWindRectObj.group);
+      setTimeout(async () => {
+        resolve(null);
+        const oldCameraPosition = { x: -1020, y: 100, z: 500 };
+        await animateCamera(
+          oldCameraPosition,
+          { x: 0, y: 0, z: 0 },
+          { x: 46.257, y: 57.539, z: 104.313 },
+          { x: 1.84, y: 0.98, z: -1.44 },
+          model,
+          0.8
+        );
+      }, 300);
     }
   });
 };
@@ -241,6 +297,8 @@ export const mountedThree = (playerVal1, playerVal2) => {
     await dsWindRectObj.mountedThree();
     lmWindRectSideObj = new lmWindRectSide(model, playerVal1, playerVal2);
     await lmWindRectSideObj.mountedThree();
+    ddWindRectObj = new ddWindRect(model);
+    await ddWindRectObj.mountedThree();
 
     resolve(null);
     model.animate();