瀏覽代碼

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

bobo04052021@163.com 2 周之前
父節點
當前提交
85e90fe1a0

二進制
src/assets/images/themify/deepblue/home-container/configurable/1200.png


+ 12 - 7
src/hooks/vent/useSvgAnimation.ts

@@ -1,4 +1,5 @@
 import { ref } from 'vue';
+import _ from 'lodash';
 
 /**
  * svg二维模型动画使用的钩子,需要配合指定的组件使用,即svg模型组件(README里有更详细的说明)
@@ -18,8 +19,10 @@ export function useSvgAnimation(elementInfo: Map<string, { key: string; transfor
    *
    * @param id 标识符号(可以在页面中使用元素选择器选择具体元素后查询其id),可以传数组
    * @param reverse 是否需要反向执行动画,如果id传了数组该参数可以传数组以一一匹配,默认为false
+   * @param duration 动画持续时长,越长动画执行的越慢
+   * @param progress 指定动画执行的进度,默认为1,即动画执行到100%,该数字范围为0-1
    */
-  function triggerAnimation(id: string | string[], reverse: boolean | boolean[] = false, duration = 3000) {
+  function triggerAnimation(id: string | string[], reverse: boolean | boolean[] = false, duration = 3000, progress = 1) {
     const idArray = typeof id === 'string' ? [id] : id;
     const reverseArray = typeof reverse === 'boolean' ? idArray.map(() => reverse) : reverse;
 
@@ -33,34 +36,36 @@ export function useSvgAnimation(elementInfo: Map<string, { key: string; transfor
       // 不指定反向播放且group处于初始状态时播放正常动画
       if (!reverse && unchanged) {
         animationManager.value[id] = false;
-        animateByKey(id, true, duration);
+        animateByKey(id, true, duration, progress);
         return;
       }
       if (reverse && !unchanged) {
         animationManager.value[id] = true;
-        animateByKey(id, false, duration);
+        animateByKey(id, false, duration, progress);
         return;
       }
     });
   }
 
   // 直接控制动画的方法
-  const animateElement = (elementId: string, toEnd: boolean, duration: number = 3000) => {
+  const animateElement = (elementId: string, toEnd: boolean, duration = 3000, progress = 1) => {
     const el = animationElements.get(elementId);
     const info = elementInfo.get(elementId);
 
     if (el && info && info.transforms.length > 1) {
+      const endTransform = _.nth(info.transforms, Math.floor(info.transforms.length * progress));
+      const startTransform = _.nth(info.transforms, -Math.ceil(info.transforms.length * progress));
       el.style.transition = `transform ${duration}ms`;
-      el.setAttribute('transform', toEnd ? info.transforms[info.transforms.length - 1] : info.transforms[0]);
+      el.setAttribute('transform', toEnd ? endTransform : startTransform);
     }
   };
 
   // 批量控制同一key的所有元素
-  const animateByKey = (key: string, toEnd: boolean, duration: number = 3000) => {
+  const animateByKey = (key: string, toEnd: boolean, duration = 3000, progress = 1) => {
     animationElements.forEach((__, elementId) => {
       const info = elementInfo.get(elementId);
       if (info && info.key === key) {
-        animateElement(elementId, toEnd, duration);
+        animateElement(elementId, toEnd, duration, progress);
       }
     });
   };

+ 3 - 2
src/layouts/default/sider/bottomSideder.vue

@@ -84,8 +84,9 @@
       const glob = useGlobSetting();
       const isShowMenu = ref(route.path.startsWith('/cad-viewer') ? 1 : 0);
       const userStore = useUserStoreWithOut();
-      const appStore = useAppStore();
-      const themeIcon = ref(appStore.getDarkMode);
+      // const appStore = useAppStore();
+      // const themeIcon = appStore.getDarkMode;
+        const themeIcon=ref('styleTwo')
 
       function selectMenu(e: Event, programMenu) {
         e.stopPropagation();

+ 3 - 2
src/layouts/default/sider/bottomSideder1.vue

@@ -45,8 +45,9 @@ export default defineComponent({
   name: 'BottomSider',
   components: { FourBorderBg, SvgIcon },
   setup() {
-    const appStore = useAppStore();
-    const themeIcon = ref(appStore.getDarkMode)
+    // const appStore = useAppStore();
+    // const themeIcon = appStore.getDarkMode
+    const themeIcon=ref('styleTwo')
     const isShowMenu = ref(0);
     let menuModules = ref<Menu[]>([]);
     const go = useGo();

+ 3 - 2
src/views/monitor/log/index.vue

@@ -22,7 +22,7 @@
   </BasicTable>
 </template>
 <script lang="ts" name="monitor-log" setup>
-import { ref } from 'vue';
+import { ref,reactive } from 'vue';
 import { BasicTable, useTable, TableAction } from '/@/components/Table';
 import { getLogList, getUserLoginStats } from './log.api';
 import { columns, searchFormSchema, searchFormSchema1, operationLogColumn, browserColumn, loginTjColumn } from './log.data';
@@ -33,7 +33,7 @@ const logColumns = ref<any>(columns);
 const logApi = ref<any>(getLogList)
 const logSchemas = ref<any[]>(searchFormSchema)
 const paramTime = ref<any[]>(['createTime_begin', 'createTime_end'])
-const searchInfo = { logType: '1' };
+let searchInfo =reactive( { logType: '1' });
 // 列表页面公共参数、方法
 const { prefixCls, tableContext } = useListPage({
   designScope: 'user-list',
@@ -81,6 +81,7 @@ function tabChange(key) {
       logSchemas.value = searchFormSchema1
       paramTime.value = [['fieldTime', ['dayStart', 'dayEnd'], 'YYYY-MM-DD']]
       logApi.value = getUserLoginStats
+      searchInfo={}
       break;
   }
   //update-end---author:wangshuai ---date:20220506  for:[VUEN-943]vue3日志管理列表翻译不对--------------

+ 19 - 0
src/views/vent/home/configurable/components/MonitorBar.vue

@@ -35,13 +35,32 @@
 <script lang="ts" setup>
   import { computed } from 'vue';
   import { getFormattedText } from '../hooks/helper';
+  import { useGlobSetting } from '/@/hooks/setting';
 
   const props = defineProps<{
     isDataRealTime: boolean;
     data: any;
   }>();
 
+  const { sysOrgCode } = useGlobSetting();
+
   const config = computed(() => {
+    if (sysOrgCode === 'huainanzhangji') {
+      return [
+        {
+          label: '总回风量(m³/min)',
+          value: '${midinfo[0].sysdata.zonghuifeng}',
+        },
+        {
+          label: '总进风量(m³/min)',
+          value: '${midinfo[0].sysdata.zongjinfeng}',
+        },
+        {
+          label: '有效风量率(%)',
+          value: '${midinfo[0].sysinfo.useM3Perent}',
+        },
+      ];
+    }
     if (props.isDataRealTime) {
       return [
         {

+ 2 - 2
src/views/vent/home/configurable/ventV5.vue

@@ -88,7 +88,7 @@
   import { list } from './configurable.api';
   import { useRoute, useRouter } from 'vue-router';
   import { useGlobSetting } from '/@/hooks/setting';
-  import { testConfigVent, testConfigVentRealtime } from './configurable.data';
+  // import { testConfigVent, testConfigVentRealtime } from './configurable.data';
 
   const { sysDataType = 'monitor', title = '智能通风管控系统' } = useGlobSetting();
   const { configs, isOriginal, isCommon, fetchConfigs } = useInitConfigs();
@@ -106,7 +106,7 @@
 
   function refresh() {
     fetchConfigs(isDataRealTime.value ? 'vent_realtime' : 'vent').then(() => {
-      configs.value = isDataRealTime.value ? testConfigVentRealtime : testConfigVent;
+      // configs.value = isDataRealTime.value ? testConfigVentRealtime : testConfigVent;
       updateEnhancedConfigs(configs.value);
 
       list({}).then(updateData);

文件差異過大導致無法顯示
+ 524 - 0
src/views/vent/monitorManager/windowMonitor/components/windowDualSVG.vue


文件差異過大導致無法顯示
+ 22 - 33
src/views/vent/monitorManager/windowMonitor/components/windowSVG.vue


+ 12 - 9
src/views/vent/monitorManager/windowMonitor/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <component :loading="loading" :manager="animationManager" :is="modelComponent" />
+  <component ref="modelRef" :loading="loading" :is="modelComponent" />
   <div class="scene-box">
     <div class="top-box">
       <div class="top-center" style="display: flex">
@@ -230,16 +230,15 @@
   import { useMessage } from '/@/hooks/web/useMessage';
   import { useGlobSetting } from '/@/hooks/setting';
   import { getModelComponent } from './window.data';
-  import { useSvgAnimation } from '/@/hooks/vent/useSvgAnimation';
 
   const { hasPermission } = usePermission();
   const { sysOrgCode } = useGlobSetting();
   const globalConfig = inject('globalConfig');
 
+  const modelRef = ref();
   /** 模型对应的组件,根据实际情况分为二维三维 */
   const modelComponent = getModelComponent(globalConfig.is2DModel, sysOrgCode);
 
-  const { animationManager, triggerAnimation } = useSvgAnimation();
   const { currentRoute } = useRouter();
 
   const MonitorDataTable = ref();
@@ -386,7 +385,7 @@
 
   // 判断前后窗的面积是否发生改变,如果改变则开启动画
   const playAnimation = (data, maxarea = 90, isFirst = false) => {
-    triggerAnimation('shanye_0_Layer0_0_FILL', isFirst);
+    modelRef.value?.animate?.(data);
     computePlay(data, maxarea, isFirst);
   };
 
@@ -623,12 +622,16 @@
   onMounted(() => {
     const { query } = unref(currentRoute);
     if (query['deviceType']) deviceType.value = query['deviceType'] as string;
-    loading.value = true;
-    mountedThree().then(async () => {
+    if (globalConfig.is2DModel) {
       getMonitor(true);
-      loading.value = false;
-      addMonitorText(selectData.value);
-    });
+    } else {
+      loading.value = true;
+      mountedThree().then(async () => {
+        getMonitor(true);
+        loading.value = false;
+        addMonitorText(selectData.value);
+      });
+    }
   });
   onUnmounted(() => {
     destroy();

+ 3 - 1
src/views/vent/monitorManager/windowMonitor/window.data.ts

@@ -311,8 +311,10 @@ export function getModelComponent(is2DModel: boolean = false, sysOrgCode?: strin
     switch (sysOrgCode) {
       // case '000000':
       //   return import('./components/000000.vue');
+      // return import('./components/windowDualSVG.vue');
       default:
-        return import('./components/windowSVG.vue');
+        return import('./components/windowDualSVG.vue');
+      // return import('./components/windowSVG.vue');
     }
   });
 }

+ 5 - 0
src/views/vent/monitorManager/windowMonitor/window.threejs.ts

@@ -97,6 +97,7 @@ const startAnimation = () => {
 
 // 鼠标点击、松开事件
 const mouseEvent = (event) => {
+  if (!model) return;
   if (event.button == 0) {
     mouseDownFn(model, group, event, (intersects) => {
       if (windowType === 'ddFc5' && ddFc5) {
@@ -140,6 +141,7 @@ const addMouseEvent = () => {
   // model.canvasContainer?.addEventListener('pointerup', mouseUp);
 };
 export const addMonitorText = (selectData) => {
+  if (!model) return;
   if (windowType === 'ddFc5' && ddFc5) {
     return ddFc5.addMonitorText.call(ddFc5, selectData);
   } else if (windowType === 'ddFc1' && ddFc1) {
@@ -174,6 +176,7 @@ export const addMonitorText = (selectData) => {
 };
 
 export function computePlay(data, maxarea, isFirst = false) {
+  if (!model) return;
   const isJz = data.windowModal == 'sdFc4';
   if (windowType === 'singleXkWindow') {
     const acosToAngle = (cosValue) => {
@@ -262,6 +265,7 @@ export function computePlay(data, maxarea, isFirst = false) {
 }
 
 export const play = (rotationParam, flag) => {
+  if (!model) return;
   if (windowType === 'ddFc5' && ddFc5) {
     return ddFc5.play.call(ddFc5, rotationParam, flag);
   } else if (windowType === 'ddFc1' && ddFc1) {
@@ -297,6 +301,7 @@ export const play = (rotationParam, flag) => {
 
 // 切换风窗类型
 export const setModelType = (type) => {
+  if (!model) return;
   // if (!model || !model.scene) return;
   windowType = type;
   const windowConfigurations = {

部分文件因文件數量過多而無法顯示