Просмотр исходного кода

[Feat 0000] 添加版本信息到系统中

houzekong 1 месяц назад
Родитель
Сommit
ba366926e5

+ 1 - 0
build/script/buildTag.ts

@@ -24,6 +24,7 @@ function createTag(params: CreateTagParams) {
       // last commit's SHA
       // last commit's SHA
       commit: execSync('git rev-parse --short HEAD').toString().replace('\n', ''),
       commit: execSync('git rev-parse --short HEAD').toString().replace('\n', ''),
       buildtime: dayjs().format('YYYY-MM-DD_HH:mm:ss'),
       buildtime: dayjs().format('YYYY-MM-DD_HH:mm:ss'),
+      version: execSync('npm pkg get version').toString().replace('\n', ''),
     };
     };
     // Ensure that the variable will not be modified
     // Ensure that the variable will not be modified
     const evalExp = `
     const evalExp = `

+ 7 - 2
src/layouts/default/header/components/user-dropdown/index.vue

@@ -25,6 +25,7 @@
             :text="t('layout.header.tooltipLock')"
             :text="t('layout.header.tooltipLock')"
             icon="ion:lock-closed-outline"
             icon="ion:lock-closed-outline"
         />-->
         />-->
+        <MenuItem key="about" :text="t('layout.header.dropdownItemAbout')" icon="ion:information-outline" />
         <MenuItem key="logout" :text="t('layout.header.dropdownItemLoginOut')" icon="ion:power-outline" />
         <MenuItem key="logout" :text="t('layout.header.dropdownItemLoginOut')" icon="ion:power-outline" />
       </Menu>
       </Menu>
     </template>
     </template>
@@ -36,7 +37,7 @@
 </template>
 </template>
 <script lang="ts">
 <script lang="ts">
   // components
   // components
-  import { Dropdown, Menu } from 'ant-design-vue';
+  import { Dropdown, Menu, message } from 'ant-design-vue';
 
 
   import { defineComponent, computed, ref } from 'vue';
   import { defineComponent, computed, ref } from 'vue';
 
 
@@ -60,8 +61,9 @@
   import { removeAuthCache, setAuthCache } from '/@/utils/auth/index';
   import { removeAuthCache, setAuthCache } from '/@/utils/auth/index';
   import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
   import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
   import { getRefPromise } from '/@/utils/index';
   import { getRefPromise } from '/@/utils/index';
+  import { get } from 'lodash-es';
 
 
-  type MenuEvent = 'logout' | 'doc' | 'lock' | 'cache' | 'depart' | 'modalCache' | 'switchTheme';
+  type MenuEvent = 'logout' | 'doc' | 'lock' | 'cache' | 'depart' | 'modalCache' | 'switchTheme' | 'info';
   const { createMessage } = useMessage();
   const { createMessage } = useMessage();
   export default defineComponent({
   export default defineComponent({
     name: 'UserDropdown',
     name: 'UserDropdown',
@@ -173,6 +175,9 @@
       // update-end--author:liaozhiyang---date:20230901---for:【QQYUN-6333】空路由问题—首次访问资源太大
       // update-end--author:liaozhiyang---date:20230901---for:【QQYUN-6333】空路由问题—首次访问资源太大
       function handleMenuClick(e: { key: MenuEvent }) {
       function handleMenuClick(e: { key: MenuEvent }) {
         switch (e.key) {
         switch (e.key) {
+          case 'about':
+            message.info(`当前版本:${get(window, '__LAST_PRODUCTION_TAG__.version', '开发模式')}`);
+            break;
           case 'logout':
           case 'logout':
             handleLoginOut();
             handleLoginOut();
             break;
             break;

+ 1 - 0
src/locales/lang/en/layout.ts

@@ -3,6 +3,7 @@ export default {
   header: {
   header: {
     // user dropdown
     // user dropdown
     dropdownItemDoc: 'Document',
     dropdownItemDoc: 'Document',
+    dropdownItemAbout: 'About',
     dropdownItemLoginOut: 'Login Out',
     dropdownItemLoginOut: 'Login Out',
     dropdownItemSwitchPassword: 'Password Change',
     dropdownItemSwitchPassword: 'Password Change',
     dropdownItemSwitchDepart: 'Switch Department',
     dropdownItemSwitchDepart: 'Switch Department',

+ 1 - 0
src/locales/lang/zh-CN/layout.ts

@@ -3,6 +3,7 @@ export default {
   header: {
   header: {
     // user dropdown
     // user dropdown
     // dropdownItemDoc: '官网',
     // dropdownItemDoc: '官网',
+    dropdownItemAbout: '关于',
     dropdownItemLoginOut: '退出系统',
     dropdownItemLoginOut: '退出系统',
     dropdownItemSwitchPassword: '密码修改',
     dropdownItemSwitchPassword: '密码修改',
     // dropdownItemSwitchHome: '切换风格',
     // dropdownItemSwitchHome: '切换风格',

+ 104 - 104
src/views/vent/home/configurable/belt/components/ModuleCommon.vue

@@ -33,124 +33,124 @@
   </Transition>
   </Transition>
 </template>
 </template>
 <script lang="ts" setup>
 <script lang="ts" setup>
-import Header from './header.vue';
-import Content from '../../components/content.vue';
-// import ModuleLeft from './original/moduleLeft.vue';
-// import ModuleBottom from './original/moduleBottom.vue';
-import { computed, ref, watch } from 'vue';
-import ventBox1 from './ventBoxBelt.vue';
-import { openWindow } from '/@/utils';
-import { getFormattedText } from '../../hooks/helper';
-import { useInitModule } from '../../hooks/useInit';
-// import { ModuleProps } from '../types';
+  import Header from './Header.vue';
+  import Content from '../../components/content.vue';
+  // import ModuleLeft from './original/moduleLeft.vue';
+  // import ModuleBottom from './original/moduleBottom.vue';
+  import { computed, ref, watch } from 'vue';
+  import ventBox1 from './ventBoxBelt.vue';
+  import { openWindow } from '/@/utils';
+  import { getFormattedText } from '../../hooks/helper';
+  import { useInitModule } from '../../hooks/useInit';
+  // import { ModuleProps } from '../types';
 
 
-const props = defineProps<{
-  pageType: string;
-  /** 配置的详细模块信息 */
-  moduleData: any;
-  /** 配置的详细样式信息 */
-  showStyle: any;
-  /** 该模块配置中的设备标识符 */
-  deviceType: string;
-  /** api返回的数据 */
-  data: any;
-  moduleName: string;
-  visible: boolean;
-  chartData?: any;
-  activeId?: [String, Number]; // 接收ID
-}>();
-// defineEmits(['close', 'click']);
-const emit = defineEmits<{
-  (e: 'close'): void;
-  (e: 'click'): void;
-  (e: 'clickItem', data: any): void;
-}>();
-const { header } = props.moduleData;
+  const props = defineProps<{
+    pageType: string;
+    /** 配置的详细模块信息 */
+    moduleData: any;
+    /** 配置的详细样式信息 */
+    showStyle: any;
+    /** 该模块配置中的设备标识符 */
+    deviceType: string;
+    /** api返回的数据 */
+    data: any;
+    moduleName: string;
+    visible: boolean;
+    chartData?: any;
+    activeId?: [String, Number]; // 接收ID
+  }>();
+  // defineEmits(['close', 'click']);
+  const emit = defineEmits<{
+    (e: 'close'): void;
+    (e: 'click'): void;
+    (e: 'clickItem', data: any): void;
+  }>();
+  const { header } = props.moduleData;
 
 
-const { selectedDeviceID, selectedDevice, options, init } = useInitModule(props.deviceType, props.moduleData);
+  const { selectedDeviceID, selectedDevice, options, init } = useInitModule(props.deviceType, props.moduleData);
 
 
-const selectedData = ref();
+  const selectedData = ref();
 
 
-const style = computed(() => {
-  const size = props.showStyle.size;
-  const position = props.showStyle.position;
-  return size + position + 'position: absolute; pointer-events: auto; z-index: 1';
-});
-const pageType = computed(() => {
-  return props.pageType || '';
-});
-const capitalizedPosition = computed(() => {
-  return props.showStyle.position.includes('left') ? 'Left' : 'Right';
-});
+  const style = computed(() => {
+    const size = props.showStyle.size;
+    const position = props.showStyle.position;
+    return size + position + 'position: absolute; pointer-events: auto; z-index: 1';
+  });
+  const pageType = computed(() => {
+    return props.pageType || '';
+  });
+  const capitalizedPosition = computed(() => {
+    return props.showStyle.position.includes('left') ? 'Left' : 'Right';
+  });
 
 
-// 根据配置里的定位判断应该使用哪个class
-function getModuleClass({ size, position }) {
-  const [_, width] = size.match(/width:([0-9]+)px/) || [];
-  if (position.includes('bottom') || parseInt(width) > 800) {
-    return 'module-common module-common-longer';
+  // 根据配置里的定位判断应该使用哪个class
+  function getModuleClass({ size, position }) {
+    const [_, width] = size.match(/width:([0-9]+)px/) || [];
+    if (position.includes('bottom') || parseInt(width) > 800) {
+      return 'module-common module-common-longer';
+    }
+    return 'module-common';
   }
   }
-  return 'module-common';
-}
 
 
-function redirectTo() {
-  const { to } = props.moduleData;
-  if (!to) return;
-  openWindow(getFormattedText(props.data, to));
-}
+  function redirectTo() {
+    const { to } = props.moduleData;
+    if (!to) return;
+    openWindow(getFormattedText(props.data, to));
+  }
 
 
-/**
- * 模块选择切换事件
- * @param selectedItem
- */
-// function handleSelect(selectedItem: any) {
-//   selectedData.value = selectedItem;
-//   if (!selectedItem) return;
+  /**
+   * 模块选择切换事件
+   * @param selectedItem
+   */
+  // function handleSelect(selectedItem: any) {
+  //   selectedData.value = selectedItem;
+  //   if (!selectedItem) return;
 
 
-//   selectedDeviceID.value = options.value[0]?.value;
-//   if (selectedItem.id !== undefined && selectedItem.id !== null) {
-//     // 确保这个 ID 在当前的 options 里存在
-//     const isValid = options.value.some((opt) => opt.value === selectedItem.id);
-//     if (isValid) {
-//       selectedDeviceID.value = selectedItem.id;
-//     }
-//   }
-// }
-watch(
-  () => props.data,
-  (d) => {
-    init(d);
-    if (!selectedDeviceID.value) {
-      selectedDeviceID.value = options.value[0]?.value;
+  //   selectedDeviceID.value = options.value[0]?.value;
+  //   if (selectedItem.id !== undefined && selectedItem.id !== null) {
+  //     // 确保这个 ID 在当前的 options 里存在
+  //     const isValid = options.value.some((opt) => opt.value === selectedItem.id);
+  //     if (isValid) {
+  //       selectedDeviceID.value = selectedItem.id;
+  //     }
+  //   }
+  // }
+  watch(
+    () => props.data,
+    (d) => {
+      init(d);
+      if (!selectedDeviceID.value) {
+        selectedDeviceID.value = options.value[0]?.value;
+      }
+    },
+    {
+      immediate: true,
     }
     }
-  },
-  {
-    immediate: true,
-  }
-);
+  );
 </script>
 </script>
 <style lang="less" scoped>
 <style lang="less" scoped>
-@import '/@/design/theme.less';
+  @import '/@/design/theme.less';
 
 
-.module-common .box1-center {
-  height: calc(100% - 48px);
-}
+  .module-common .box1-center {
+    height: calc(100% - 48px);
+  }
 
 
-:deep(.box1-center) {
-  height: calc(100% - 48px);
-}
-:deep(.box1-center > .box-container) {
-  height: 100%;
-  padding: 0 !important;
-  width: 100% !important;
-}
-.module-common-longer {
-  :deep(.box1-top) {
-    --image-box1-top: url('/@/assets/images/beltFire/1-1.png');
-    background-image: url('/@/assets/images/beltFire/1-1.png');
+  :deep(.box1-center) {
+    height: calc(100% - 48px);
   }
   }
-  :deep(.box1-bottom) {
-    --image-box1-bottom: url('/@/assets/images/beltFire/1-2.png');
-    background-image: url('/@/assets/images/beltFire/1-2.png');
+  :deep(.box1-center > .box-container) {
+    height: 100%;
+    padding: 0 !important;
+    width: 100% !important;
+  }
+  .module-common-longer {
+    :deep(.box1-top) {
+      --image-box1-top: url('/@/assets/images/beltFire/1-1.png');
+      background-image: url('/@/assets/images/beltFire/1-1.png');
+    }
+    :deep(.box1-bottom) {
+      --image-box1-bottom: url('/@/assets/images/beltFire/1-2.png');
+      background-image: url('/@/assets/images/beltFire/1-2.png');
+    }
   }
   }
-}
 </style>
 </style>

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

@@ -1,7 +1,7 @@
 <template>
 <template>
   <div></div>
   <div></div>
 </template>
 </template>
-<!-- <!-- <template>
+<!-- <template>
   <div class="screen-container">
   <div class="screen-container">
     <div class="top-section">
     <div class="top-section">
       <div class="system-title">局部风机无人值守演示系统</div>
       <div class="system-title">局部风机无人值守演示系统</div>