Commit 943f98af9092a92480de31fabaa33653795ef762

Authored by ww
1 parent 5c85498b

feat: 关于软件新增版本号

... ... @@ -42,3 +42,6 @@ VITE_GLOB_ALARM_NOTIFY_DURATION = 5
42 42
43 43 # Should Disabled Task Center Execute Interval Unit (Second)
44 44 VITE_GLOB_DISABLED_TASK_CENTER_EXECUTE_INTERVAL_UNIT_SECOND = false
  45 +
  46 +# Software version number
  47 +VITE_GLOB_SOFTWARE_VERSION_NUMBER = 123
... ...
... ... @@ -54,3 +54,6 @@ VITE_GLOB_ALARM_NOTIFY_DURATION = 5
54 54
55 55 # Should Disabled Task Center Execute Interval Unit (Second)
56 56 VITE_GLOB_DISABLED_TASK_CENTER_EXECUTE_INTERVAL_UNIT_SECOND = false
  57 +
  58 +# software version number
  59 +VITE_GLOB_SOFTWARE_VERSION_NUMBER = 123
... ...
... ... @@ -17,6 +17,7 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
17 17 VITE_GLOB_ALARM_NOTIFY_DURATION,
18 18 VITE_GLOB_LARGE_DESIGNER,
19 19 VITE_GLOB_DISABLED_TASK_CENTER_EXECUTE_INTERVAL_UNIT_SECOND,
  20 + VITE_GLOB_SOFTWARE_VERSION_NUMBER,
20 21 } = getAppEnvConfig();
21 22
22 23 if (!/[a-zA-Z\_]*/.test(VITE_GLOB_APP_SHORT_NAME)) {
... ... @@ -40,6 +41,7 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
40 41 alarmPollingInterval: VITE_GLOB_ALARM_NOTIFY_POLLING_INTERVAL_TIME,
41 42 disabledTaskCenterExecuteIntervalUnitSecond:
42 43 VITE_GLOB_DISABLED_TASK_CENTER_EXECUTE_INTERVAL_UNIT_SECOND,
  44 + softwareVersionNumber: VITE_GLOB_SOFTWARE_VERSION_NUMBER,
43 45 };
44 46 return glob as Readonly<GlobConfig>;
45 47 };
... ...
... ... @@ -5,15 +5,17 @@
5 5 import { BasicModal, useModal } from '/@/components/Modal';
6 6 import { cacheCipher } from '/@/settings/encryptionSetting';
7 7 import { AesEncryption } from '/@/utils/cipher';
  8 + import { useGlobSetting } from '/@/hooks/setting';
8 9
9 10 const encryption = new AesEncryption(cacheCipher);
10 11
11 12 const { t } = useI18n();
12 13
13 14 enum FiledKey {
14   - copyright = 'field1',
15   - website = 'filed2',
16   - authorization = 'field3',
  15 + COPYRIGHT = 'field1',
  16 + WEBSITE = 'filed2',
  17 + AUTHORIZATION = 'field3',
  18 + VERSION = 'field4',
17 19 }
18 20
19 21 // const handleEncode = (string: string) => {
... ... @@ -26,6 +28,8 @@
26 28
27 29 const [register] = useModal();
28 30
  31 + const { softwareVersionNumber } = useGlobSetting();
  32 +
29 33 const [registerDes] = useDescription({
30 34 bordered: false,
31 35 column: 1,
... ... @@ -36,17 +40,18 @@
36 40 paddingRight: '20px',
37 41 },
38 42 data: {
39   - [FiledKey.copyright]: handleDecode(t('routes.aboutSoftware.copyright')),
40   - [FiledKey.website]: handleDecode(t('routes.aboutSoftware.website')),
41   - [FiledKey.authorization]: handleDecode(t('routes.aboutSoftware.authorization')),
  43 + [FiledKey.COPYRIGHT]: handleDecode(t('routes.aboutSoftware.copyright')),
  44 + [FiledKey.WEBSITE]: handleDecode(t('routes.aboutSoftware.website')),
  45 + [FiledKey.AUTHORIZATION]: handleDecode(t('routes.aboutSoftware.authorization')),
  46 + [FiledKey.VERSION]: softwareVersionNumber,
42 47 },
43 48 schema: [
44 49 {
45   - field: FiledKey.copyright,
  50 + field: FiledKey.COPYRIGHT,
46 51 label: handleDecode(t('routes.aboutSoftware.copyrightLabel')),
47 52 },
48 53 {
49   - field: FiledKey.website,
  54 + field: FiledKey.WEBSITE,
50 55 label: handleDecode(t('routes.aboutSoftware.websiteLabel')),
51 56 render: (val: string) => {
52 57 return h(
... ... @@ -57,7 +62,7 @@
57 62 },
58 63 },
59 64 {
60   - field: FiledKey.authorization,
  65 + field: FiledKey.AUTHORIZATION,
61 66 label: handleDecode(t('routes.aboutSoftware.authorizationLabel')),
62 67 render: (val: string) => {
63 68 // https://community.thingskit.com/question/20.html
... ... @@ -74,6 +79,13 @@
74 79 ]);
75 80 },
76 81 },
  82 + {
  83 + field: FiledKey.VERSION,
  84 + label: handleDecode(t('routes.aboutSoftware.versionLabel')),
  85 + render: () => {
  86 + return softwareVersionNumber;
  87 + },
  88 + },
77 89 ],
78 90 });
79 91 </script>
... ...
... ... @@ -3,6 +3,7 @@ export default {
3 3 copyrightLabel: 'euVkVv2k+9lAoBFk2/IcAg==',
4 4 websiteLabel: 'Lg18XskCEQMA57HJp/kFSg==',
5 5 authorizationLabel: 'RgtDsxIoA+6FMp4Ani+utw==',
  6 + versionLabel: 'H7gVdiVRLf4+LjmM3sBcww==',
6 7 copyright:
7 8 '5ZZv6QlLvd5rrVAubQbHxCb2HrJoY+efYpnto5GHh4Diz5PVne8rb1Ao/L+kLUrgeJe5BGIepGMuyURKaDeSPURtCLInlllTNHKjGbnJOm8BZRFm2DUWcHktj20z4WgPf2eu4deeGr1S+i62lLZwj9o9Ynf30T5W500YBzFCnb65cXA7tXGG35JhOy3fe7oo',
8 9 website: 'GJahLAezazanWODyf7QEGjU3xfvz1GEKW0OTFhG9m+U=',
... ...
... ... @@ -3,6 +3,7 @@ export default {
3 3 copyrightLabel: 'euVkVv2k+9lAoBFk2/IcAg==',
4 4 websiteLabel: 'Lg18XskCEQMA57HJp/kFSg==',
5 5 authorizationLabel: 'RgtDsxIoA+6FMp4Ani+utw==',
  6 + versionLabel: 'H7gVdiVRLf4+LjmM3sBcww==',
6 7 copyright:
7 8 '5ZZv6QlLvd5rrVAubQbHxCb2HrJoY+efYpnto5GHh4Diz5PVne8rb1Ao/L+kLUrgeJe5BGIepGMuyURKaDeSPURtCLInlllTNHKjGbnJOm8BZRFm2DUWcHktj20z4WgPf2eu4deeGr1S+i62lLZwj9o9Ynf30T5W500YBzFCnb65cXA7tXGG35JhOy3fe7oo',
8 9 website: 'GJahLAezazanWODyf7QEGjU3xfvz1GEKW0OTFhG9m+U=',
... ...
... ... @@ -34,6 +34,7 @@ export function getAppEnvConfig() {
34 34 VITE_GLOB_ALARM_NOTIFY_DURATION,
35 35 VITE_GLOB_LARGE_DESIGNER,
36 36 VITE_GLOB_DISABLED_TASK_CENTER_EXECUTE_INTERVAL_UNIT_SECOND,
  37 + VITE_GLOB_SOFTWARE_VERSION_NUMBER,
37 38 } = ENV;
38 39
39 40 if (!/^[a-zA-Z\_]*$/.test(VITE_GLOB_APP_SHORT_NAME)) {
... ... @@ -55,6 +56,7 @@ export function getAppEnvConfig() {
55 56 VITE_GLOB_ALARM_NOTIFY_DURATION,
56 57 VITE_GLOB_LARGE_DESIGNER,
57 58 VITE_GLOB_DISABLED_TASK_CENTER_EXECUTE_INTERVAL_UNIT_SECOND,
  59 + VITE_GLOB_SOFTWARE_VERSION_NUMBER,
58 60 };
59 61 }
60 62
... ...
... ... @@ -160,6 +160,8 @@ export interface GlobConfig {
160 160 securityPolicy: string;
161 161 // Should Disabled Task Center Execute Interval Unit (Second)
162 162 disabledTaskCenterExecuteIntervalUnitSecond: string;
  163 + // Software version number
  164 + softwareVersionNumber: string;
163 165 }
164 166 export interface GlobEnvConfig {
165 167 // Site title
... ... @@ -186,4 +188,6 @@ export interface GlobEnvConfig {
186 188 VITE_GLOB_ALARM_NOTIFY_DURATION: string;
187 189 // Should Disabled Task Center Execute Interval Unit (Second)
188 190 VITE_GLOB_DISABLED_TASK_CENTER_EXECUTE_INTERVAL_UNIT_SECOND: string;
  191 + // Software version number
  192 + VITE_GLOB_SOFTWARE_VERSION_NUMBER: string;
189 193 }
... ...