瀏覽代碼

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

wangkeyi 1 天之前
父節點
當前提交
9cdde9688e

+ 40 - 0
src/views/vent/deviceManager/configurationTable/ModulePlain.vue

@@ -0,0 +1,40 @@
+<template>
+  <div :style="style">
+    <Header :deviceType="deviceType" :moduleData="moduleData" :data="data" @select="selectedData = $event" />
+    <Content :style="{ height: header.show ? 'calc(100% - 30px)' : '100%' }" :moduleData="moduleData" :data="selectedData" />
+  </div>
+</template>
+<script lang="ts" setup>
+  import Header from '/@/views/vent/home/configurable/components/header.vue';
+  import Content from '/@/views/vent/home/configurable/components/content.vue';
+  // import ModuleLeft from './original/moduleLeft.vue';
+  // import ModuleBottom from './original/moduleBottom.vue';
+  import { computed, ref } from 'vue';
+  // import { ModuleProps } from '../types';
+
+  const props = defineProps<{
+    /** 配置的详细模块信息 */
+    moduleData: any;
+    /** 配置的详细样式信息 */
+    showStyle: any;
+    /** 该模块配置中的设备标识符 */
+    deviceType: string;
+    /** api返回的数据 */
+    data: any;
+    moduleName: string;
+    visible: boolean;
+  }>();
+  defineEmits(['close', 'click']);
+
+  const { header } = props.moduleData;
+  const selectedData = ref();
+
+  const style = computed(() => {
+    const size = props.showStyle.size;
+    const position = props.showStyle.position;
+    return size + position + 'pointer-events: auto;';
+  });
+</script>
+<style lang="less" scoped>
+  @import '/@/design/theme.less';
+</style>

+ 23 - 3
src/views/vent/deviceManager/configurationTable/index.vue

@@ -22,7 +22,21 @@
   </BasicTable>
   <DeviceModal @register="registerModal" @save-or-update="saveOrUpdateHandler" :showTab="false" :deviceType="deviceType" />
   <BasicModal @register="registerConfigModal" @ok="handleUpdate" title="配置文件编辑" defaultFullscreen>
-    <CodeEditor v-model:value="configJSON" />
+    <a-row class="h-full">
+      <a-col class="h-full" :span="12">
+        <CodeEditor class="h-100%" :value="configJSON" @change="editorChangeHandler" />
+      </a-col>
+      <a-col class="justify-center items-center" style="display: flex" :span="12">
+        <ModulePlain
+          :device-type="configJSON!.deviceType"
+          :module-data="configJSON!.moduleData"
+          :module-name="configJSON!.moduleName"
+          :show-style="configJSON!.showStyle"
+          :data="{}"
+          :visible="true"
+        />
+      </a-col>
+    </a-row>
   </BasicModal>
   <BasicModal @register="registerPageTypeModal" @ok="handleUpdatePageType" title="一键修改模块版本">
     <BasicForm @register="registerForm" />
@@ -48,13 +62,15 @@
   import _ from 'lodash';
   /** @ts-ignore-next-line */
   import helpContext from './types?raw';
+  import ModulePlain from './ModulePlain.vue';
+  import { Config } from './types';
 
   const formData = reactive<any>({});
   const isUpdate = ref(false);
   const deviceType = ref('');
   const formSchemaData = ref(formSchema);
   // const pageType = ref('');
-  const configJSON = ref('');
+  const configJSON = ref<Config>();
 
   provide('formSchema', formSchemaData);
   provide('isUpdate', isUpdate);
@@ -167,7 +183,7 @@
     try {
       saveOrUpdateHandler({
         id: formData.id,
-        ...JSON.parse(configJSON.value),
+        ...configJSON.value,
       })
         .then(() => {
           message.success('保存成功');
@@ -239,6 +255,10 @@
       console.error(e);
     }
   }
+
+  function editorChangeHandler(val) {
+    configJSON.value = JSON.parse(val);
+  }
 </script>
 
 <style scoped lang="less">

+ 36 - 1
src/views/vent/monitorManager/gateMonitor/gate.threejs.ts

@@ -699,6 +699,23 @@ export const initCameraCanvas = async (playerVal1) => {
   }
 };
 
+const loadModel = (code): Promise<any> => {
+  if (code === 'Fm1') return import('./gate.threejs.yy').then((r) => r.default);
+  if (code === 'Fm3') return import('./gate.threejs.qd').then((r) => r.default);
+  if (code === 'FmXR') return import('./gate.threejs.xr').then((r) => r.default);
+  if (code === 'Fm2') return import('./gate.threejs.three').then((r) => r.default);
+  if (code === 'FmTwoSs') return import('./gate.threejs.two.ss').then((r) => r.default);
+  if (code === 'FmThreeTl') return import('./gate.threejs.three.tl').then((r) => r.default);
+  if (code === 'FmDc') return import('./gate.threejs.window').then((r) => r.default);
+  if (code === 'FmDcHJG') return import('./gate.threejs.window.hjg').then((r) => r.default);
+  if (code === 'FmDcZHQ') return import('./gate.threejs.window.zhq').then((r) => r.default);
+  if (code === 'FmHsw3') return import('./gate.threejs.three.hsw').then((r) => r.default);
+  if (code === 'FmYjXr') return import('./gate.threejs.two.yj').then((r) => r.default); // 姚街行人
+  if (code === 'FmYj') return import('./gate.threejs.yj').then((r) => r.default); // 姚街
+  if (code === 'FmSp1') return import('./gate.threejs.one.sp').then((r) => r.default);
+  return import('./gate.threejs.yy').then((r) => r.default);
+};
+
 export const mountedThree = (playerDom) => {
   // const { sysOrgCode } = useGlobSetting();
   // const sysOrgCode = 'gsgszdek';
@@ -713,55 +730,67 @@ export const mountedThree = (playerDom) => {
         const dict = dictCodes[i];
         switch (dict.value) {
           case 'fmXr':
+            const FmXR = await loadModel('FmXR');
             fmXr = new FmXR(model);
             fmXr.mountedThree(playerDom);
             break;
           case 'fmYy':
+            const Fm1 = await loadModel('Fm1');
             fm1 = new Fm1(model);
             fm1.mountedThree(playerDom);
             break;
           case 'gate_qd':
+            const Fm3 = await loadModel('Fm3');
             fm3 = new Fm3(model);
             await fm3.mountedThree();
             break;
           case 'fmSs':
+            const FmTwoSs = await loadModel('FmTwoSs');
             fmTwoSs = new FmTwoSs(model);
             await fmTwoSs.mountedThree();
             break;
           case 'fmtl3':
+            const FmThreeTl = await loadModel('FmThreeTl');
             fmThreeTl = new FmThreeTl(model);
             await fmThreeTl.mountedThree();
             break;
           case 'fmSs3':
+            const Fm2 = await loadModel('Fm2');
             fm2 = new Fm2(model);
             await fm2.mountedThree();
             break;
           case 'fm_fc_hjg':
+            const FmDcHJG = await loadModel('FmDcHJG');
             fmWindowHjg = new FmDcHJG(model);
             await fmWindowHjg.mountedThree();
             break;
           case 'fm_fc':
+            const FmDc = await loadModel('FmDc');
             fmWindow = new FmDc(model);
             await fmWindow.mountedThree();
             break;
           case 'fm_fc_zhq': //fmWindowZhq
+            const FmDcZHQ = await loadModel('FmDcZHQ');
             fmWindowZhq = new FmDcZHQ(model);
             await fmWindowZhq.mountedThree();
             break;
           case 'fmHsw3':
+            const FmHsw3 = await loadModel('FmHsw3');
             fmHsw3 = new FmHsw3(model);
             await fmHsw3.mountedThree();
             break;
           case 'fmYjXr':
+            const FmYjXr = await loadModel('FmYjXr');
             fmYjXr = new FmYjXr(model);
             await fmYjXr.mountedThree();
             break;
           case 'fmYj':
+            const FmYj = await loadModel('FmYj');
             fmYj = new FmYj(model);
             await fmYj.mountedThree();
             break;
           case 'fmSp1':
-            debugger;
+            const FmSp1 = await loadModel('FmSp1');
             fmSp1 = new FmSp1(model);
             await fmSp1.mountedThree();
             break;
@@ -769,18 +798,24 @@ export const mountedThree = (playerDom) => {
       }
       resolve(null);
     } else {
+      const Fm3 = await loadModel('Fm3');
       fm3 = new Fm3(model);
       fm3.mountedThree(playerDom);
+      const FmTwoSs = await loadModel('FmTwoSs');
       fmTwoSs = new FmTwoSs(model);
       fmTwoSs.mountedThree(playerDom);
+      const Fm2 = await loadModel('Fm2');
       fm2 = new Fm2(model);
       fm2.mountedThree(playerDom);
       // 三道门
+      const FmThreeTl = await loadModel('FmThreeTl');
       fmThreeTl = new FmThreeTl(model);
       if (fmThreeTl) fmThreeTl.mountedThree(playerDom);
+      const FmXR = await loadModel('FmXR');
       fmXr = new FmXR(model);
       fmXr.mountedThree(playerDom);
       // 液压风门
+      const Fm1 = await loadModel('Fm1');
       fm1 = new Fm1(model);
       fm1.mountedThree(playerDom);
       resolve(null);

+ 1 - 1
src/views/vent/monitorManager/gateMonitor/index.vue

@@ -1202,7 +1202,7 @@
     destroy();
   });
 </script>
-,
+
 <style lang="less" scoped>
   @import '/@/design/theme.less';
   @import '/@/design/vent/modal.less';