Commit b4cbab0527405be38f5306b6293067b9f7058ab1
Merge branch 'local_dev_ft' into 'main'
feat:新增大屏设计器页面和跳转配置 See merge request yunteng/thingskit-front!503
Showing
11 changed files
with
966 additions
and
399 deletions
@@ -16,7 +16,7 @@ VITE_GLOB_PUBLIC_PATH = / | @@ -16,7 +16,7 @@ VITE_GLOB_PUBLIC_PATH = / | ||
16 | # VITE_PROXY = [["/api","http://localhost:8080/api"],["/thingskit-drawio","http://localhost:3000/"]] | 16 | # VITE_PROXY = [["/api","http://localhost:8080/api"],["/thingskit-drawio","http://localhost:3000/"]] |
17 | VITE_PROXY = [["/api","http://222.180.200.114:48080/api"],["/thingskit-drawio","http://localhost:3000/"],["/large-designer", "http://localhost:5555/large-designer/"]] | 17 | VITE_PROXY = [["/api","http://222.180.200.114:48080/api"],["/thingskit-drawio","http://localhost:3000/"],["/large-designer", "http://localhost:5555/large-designer/"]] |
18 | # VITE_PROXY = [["/api","http://121.37.251.8:8080/api"],["/thingskit-drawio","http://localhost:3000/"]] | 18 | # VITE_PROXY = [["/api","http://121.37.251.8:8080/api"],["/thingskit-drawio","http://localhost:3000/"]] |
19 | -# VITE_PROXY = [["/api","http://192.168.10.103:8080/api"],["/thingskit-drawio","http://192.168.10.136:8080/api"]] | 19 | +# VITE_PROXY = [["/api","http://192.168.10.125:8080/api"],["/thingskit-drawio","http://192.168.10.125:8080/api"]] |
20 | 20 | ||
21 | # 实时数据的ws地址 | 21 | # 实时数据的ws地址 |
22 | # VITE_WEB_SOCKET = ws://localhost:8080/api/ws/plugins/telemetry?token= | 22 | # VITE_WEB_SOCKET = ws://localhost:8080/api/ws/plugins/telemetry?token= |
@@ -39,6 +39,9 @@ VITE_GLOB_API_URL_PREFIX=/yt | @@ -39,6 +39,9 @@ VITE_GLOB_API_URL_PREFIX=/yt | ||
39 | #configuration | 39 | #configuration |
40 | VITE_GLOB_CONFIGURATION = /thingskit-drawio | 40 | VITE_GLOB_CONFIGURATION = /thingskit-drawio |
41 | 41 | ||
42 | +# 大屏设计器 | ||
43 | +VITE_GLOB_LARGE_DESIGNER = /large-designer | ||
44 | + | ||
42 | # Content Security Policy | 45 | # Content Security Policy |
43 | VITE_GLOB_CONTENT_SECURITY_POLICY = false | 46 | VITE_GLOB_CONTENT_SECURITY_POLICY = false |
44 | 47 |
1 | -# Whether to open mock | ||
2 | -VITE_GLOB_USE_MOCK = false | ||
3 | - | ||
4 | -# public path | ||
5 | -VITE_GLOB_PUBLIC_PATH = / | ||
6 | - | ||
7 | -# Delete console | ||
8 | -VITE_GLOB_DROP_CONSOLE = true | ||
9 | - | ||
10 | -# Whether to enable gzip or brotli compression | ||
11 | -# Optional: gzip | brotli | none | ||
12 | -# If you need multiple forms, you can use `,` to separate | ||
13 | -VITE_GLOB_BUILD_COMPRESS = 'gzip' | ||
14 | - | ||
15 | -# Whether to delete origin files when using compress, default false | ||
16 | -VITE_GLOB_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false | ||
17 | - | ||
18 | -# Basic interface address SPA | ||
19 | -VITE_GLOB_API_URL=http://122.9.141.195:8080/api | ||
20 | - | ||
21 | -# File upload address, optional | ||
22 | -# It can be forwarded by nginx or write the actual address directly | ||
23 | -VITE_GLOB_UPLOAD_URL=http://122.9.141.195:8080/api/yt/oss/upload | ||
24 | - | ||
25 | -# Interface prefix | ||
26 | -VITE_GLOB_API_URL_PREFIX=/yt | ||
27 | - | ||
28 | -# Whether to enable image compression | ||
29 | -VITE_GLOB_USE_IMAGEMIN= false | ||
30 | - | ||
31 | -# use pwa | ||
32 | -VITE_USE_PWA = false | ||
33 | - | ||
34 | -# Is it compatible with older browsers | ||
35 | -VITE_LEGACY = true | ||
36 | - | ||
37 | -# 实时数据的ws地址 | ||
38 | -VITE_GLOB_WEB_SOCKET = ws://122.9.141.195:8080/api/ws/plugins/telemetry?token= | ||
39 | - | ||
40 | -#configuration | ||
41 | -VITE_GLOB_CONFIGURATION = /thingskit-scada | ||
42 | - | ||
43 | -# Content Security Policy | ||
44 | -VITE_GLOB_CONTENT_SECURITY_POLICY = false | ||
45 | - | ||
46 | -# Alarm Notify Polling Interval Time | ||
47 | -VITE_GLOB_ALARM_NOTIFY_POLLING_INTERVAL_TIME = 60000 | ||
48 | - | ||
49 | -# Alarm Notify Auto Close Time Unit is Second | ||
50 | -VITE_GLOB_ALARM_NOTIFY_DURATION = 5 | 1 | +# Whether to open mock |
2 | +VITE_GLOB_USE_MOCK = false | ||
3 | + | ||
4 | +# public path | ||
5 | +VITE_GLOB_PUBLIC_PATH = / | ||
6 | + | ||
7 | +# Delete console | ||
8 | +VITE_GLOB_DROP_CONSOLE = true | ||
9 | + | ||
10 | +# Whether to enable gzip or brotli compression | ||
11 | +# Optional: gzip | brotli | none | ||
12 | +# If you need multiple forms, you can use `,` to separate | ||
13 | +VITE_GLOB_BUILD_COMPRESS = 'gzip' | ||
14 | + | ||
15 | +# Whether to delete origin files when using compress, default false | ||
16 | +VITE_GLOB_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false | ||
17 | + | ||
18 | +# Basic interface address SPA | ||
19 | +VITE_GLOB_API_URL=http://122.9.141.195:8080/api | ||
20 | + | ||
21 | +# File upload address, optional | ||
22 | +# It can be forwarded by nginx or write the actual address directly | ||
23 | +VITE_GLOB_UPLOAD_URL=http://122.9.141.195:8080/api/yt/oss/upload | ||
24 | + | ||
25 | +# Interface prefix | ||
26 | +VITE_GLOB_API_URL_PREFIX=/yt | ||
27 | + | ||
28 | +# Whether to enable image compression | ||
29 | +VITE_GLOB_USE_IMAGEMIN= false | ||
30 | + | ||
31 | +# use pwa | ||
32 | +VITE_USE_PWA = false | ||
33 | + | ||
34 | +# Is it compatible with older browsers | ||
35 | +VITE_LEGACY = true | ||
36 | + | ||
37 | +# 实时数据的ws地址 | ||
38 | +VITE_GLOB_WEB_SOCKET = ws://122.9.141.195:8080/api/ws/plugins/telemetry?token= | ||
39 | + | ||
40 | +#configuration | ||
41 | +VITE_GLOB_CONFIGURATION = /thingskit-scada | ||
42 | + | ||
43 | +# 大屏设计器 | ||
44 | +VITE_GLOB_LARGE_DESIGNER = /large-designer | ||
45 | + | ||
46 | +# Content Security Policy | ||
47 | +VITE_GLOB_CONTENT_SECURITY_POLICY = false | ||
48 | + | ||
49 | +# Alarm Notify Polling Interval Time | ||
50 | +VITE_GLOB_ALARM_NOTIFY_POLLING_INTERVAL_TIME = 60000 | ||
51 | + | ||
52 | +# Alarm Notify Auto Close Time Unit is Second | ||
53 | +VITE_GLOB_ALARM_NOTIFY_DURATION = 5 |
src/api/bigscreen/center/bigscreenCenter.ts
0 → 100644
1 | +import { defHttp } from '/@/utils/http/axios'; | ||
2 | +import type { | ||
3 | + queryPageParams, | ||
4 | + BigScreenCenterParams, | ||
5 | + ConfigurationCenterInfo, | ||
6 | + BigScreenCenterItemsModal, | ||
7 | +} from './model/bigscreenCenterModel'; | ||
8 | +import { getPageData } from '../../base'; | ||
9 | +import { FileUploadResponse } from '../../oem/model'; | ||
10 | +enum API { | ||
11 | + basicUrl = '/data_view', | ||
12 | + UPLOAD = '/oss/upload', | ||
13 | +} | ||
14 | + | ||
15 | +export const getPage = (params: queryPageParams) => { | ||
16 | + return getPageData<BigScreenCenterItemsModal>(params, API.basicUrl); | ||
17 | +}; | ||
18 | + | ||
19 | +export const saveConfigurationCenter = (params: BigScreenCenterParams) => { | ||
20 | + return defHttp.post({ | ||
21 | + url: API.basicUrl, | ||
22 | + data: params, | ||
23 | + }); | ||
24 | +}; | ||
25 | + | ||
26 | +export const updateConfigurationCenter = (params: BigScreenCenterParams) => { | ||
27 | + return defHttp.put({ | ||
28 | + url: API.basicUrl, | ||
29 | + data: params, | ||
30 | + }); | ||
31 | +}; | ||
32 | + | ||
33 | +export const deleteBigScreenenter = (ids: string[]) => { | ||
34 | + return defHttp.delete({ | ||
35 | + url: API.basicUrl, | ||
36 | + data: { | ||
37 | + ids: ids, | ||
38 | + }, | ||
39 | + }); | ||
40 | +}; | ||
41 | + | ||
42 | +export const saveOrUpdateBigScreenCenter = (params: ConfigurationCenterInfo, isUpdate: boolean) => { | ||
43 | + return isUpdate ? updateConfigurationCenter(params) : saveConfigurationCenter(params); | ||
44 | +}; | ||
45 | + | ||
46 | +export const uploadThumbnail = (file: FormData) => { | ||
47 | + return defHttp.post<FileUploadResponse>({ url: API.UPLOAD, params: file }); | ||
48 | +}; |
1 | +import { BasicPageParams } from '/@/api/model/baseModel'; | ||
2 | + | ||
3 | +export interface BigScreenCenterItemsModel { | ||
4 | + id: string; | ||
5 | + name: string; | ||
6 | + createTime: string; | ||
7 | + creator: string; | ||
8 | + remark: string; | ||
9 | +} | ||
10 | +export type queryPageParams = BasicPageParams & { | ||
11 | + name?: Nullable<string>; | ||
12 | + organizationId?: Nullable<number>; | ||
13 | +}; | ||
14 | + | ||
15 | +export interface ConfigurationModal { | ||
16 | + items: BigScreenCenterItemsModel[]; | ||
17 | + total: number; | ||
18 | +} | ||
19 | + | ||
20 | +export interface BigScreenCenterParams { | ||
21 | + name: string; | ||
22 | + createTime: string; | ||
23 | + creator: string; | ||
24 | + remark: string; | ||
25 | + defaultContent?: string; | ||
26 | +} | ||
27 | +export type ConfigurationCenterInfo = BigScreenCenterParams; |
1 | -<script lang="ts" setup> | ||
2 | - import { Icon } from '/@/components/Icon'; | ||
3 | - import { computed, ExtractPropTypes, unref } from 'vue'; | ||
4 | - import { usePermission } from '/@/hooks/web/usePermission'; | ||
5 | - | ||
6 | - interface AuthIconProps extends ExtractPropTypes<typeof Icon> { | ||
7 | - auth?: string; | ||
8 | - } | ||
9 | - | ||
10 | - const props = defineProps<AuthIconProps>(); | ||
11 | - | ||
12 | - const emit = defineEmits(['click']); | ||
13 | - | ||
14 | - const { hasPermission } = usePermission(); | ||
15 | - | ||
16 | - const getHasPermission = computed(() => { | ||
17 | - const { auth } = props; | ||
18 | - return auth ? hasPermission(auth) : true; | ||
19 | - }); | ||
20 | - | ||
21 | - const getBindProps = computed(() => { | ||
22 | - return { | ||
23 | - ...props, | ||
24 | - ...(unref(getHasPermission) ? { onClick: (event: Event) => emit('click', event) } : {}), | ||
25 | - }; | ||
26 | - }); | ||
27 | -</script> | ||
28 | - | ||
29 | -<template> | ||
30 | - <Icon | ||
31 | - v-bind="getBindProps" | ||
32 | - class="justify-center items-center" | ||
33 | - :class="getHasPermission ? '' : '!cursor-not-allowed !text-gray-200'" | ||
34 | - /> | ||
35 | -</template> | 1 | +<script lang="ts" setup> |
2 | + import { Icon } from '/@/components/Icon'; | ||
3 | + import { computed, ExtractPropTypes, unref } from 'vue'; | ||
4 | + import { usePermission } from '/@/hooks/web/usePermission'; | ||
5 | + | ||
6 | + interface AuthIconProps extends ExtractPropTypes<typeof Icon> { | ||
7 | + auth?: string; | ||
8 | + } | ||
9 | + | ||
10 | + const props = defineProps<AuthIconProps>(); | ||
11 | + | ||
12 | + const emit = defineEmits(['click']); | ||
13 | + | ||
14 | + const { hasPermission } = usePermission(); | ||
15 | + | ||
16 | + const getHasPermission = computed(() => { | ||
17 | + const { auth } = props; | ||
18 | + console.log(auth); | ||
19 | + return auth ? hasPermission(auth) : true; | ||
20 | + }); | ||
21 | + | ||
22 | + const getBindProps = computed(() => { | ||
23 | + return { | ||
24 | + ...props, | ||
25 | + ...(unref(getHasPermission) ? { onClick: (event: Event) => emit('click', event) } : {}), | ||
26 | + }; | ||
27 | + }); | ||
28 | +</script> | ||
29 | + | ||
30 | +<template> | ||
31 | + <Icon | ||
32 | + v-bind="getBindProps" | ||
33 | + class="justify-center items-center" | ||
34 | + :class="getHasPermission ? '' : '!cursor-not-allowed !text-gray-200'" | ||
35 | + /> | ||
36 | +</template> |
1 | -import type { GlobConfig } from '/#/config'; | ||
2 | - | ||
3 | -import { warn } from '/@/utils/log'; | ||
4 | -import { getAppEnvConfig } from '/@/utils/env'; | ||
5 | - | ||
6 | -export const useGlobSetting = (): Readonly<GlobConfig> => { | ||
7 | - const { | ||
8 | - VITE_GLOB_APP_TITLE, | ||
9 | - VITE_GLOB_API_URL, | ||
10 | - VITE_GLOB_APP_SHORT_NAME, | ||
11 | - VITE_GLOB_API_URL_PREFIX, | ||
12 | - VITE_GLOB_UPLOAD_URL, | ||
13 | - VITE_GLOB_CONFIGURATION, | ||
14 | - VITE_GLOB_WEB_SOCKET, | ||
15 | - VITE_GLOB_CONTENT_SECURITY_POLICY, | ||
16 | - VITE_GLOB_ALARM_NOTIFY_POLLING_INTERVAL_TIME, | ||
17 | - VITE_GLOB_ALARM_NOTIFY_DURATION, | ||
18 | - } = getAppEnvConfig(); | ||
19 | - | ||
20 | - if (!/[a-zA-Z\_]*/.test(VITE_GLOB_APP_SHORT_NAME)) { | ||
21 | - warn( | ||
22 | - `VITE_GLOB_APP_SHORT_NAME Variables can only be characters/underscores, please modify in the environment variables and re-running.` | ||
23 | - ); | ||
24 | - } | ||
25 | - | ||
26 | - // Take global configuration | ||
27 | - const glob: Readonly<GlobConfig> = { | ||
28 | - title: VITE_GLOB_APP_TITLE, | ||
29 | - apiUrl: VITE_GLOB_API_URL, | ||
30 | - shortName: VITE_GLOB_APP_SHORT_NAME, | ||
31 | - urlPrefix: VITE_GLOB_API_URL_PREFIX, | ||
32 | - uploadUrl: VITE_GLOB_UPLOAD_URL, | ||
33 | - configurationPrefix: VITE_GLOB_CONFIGURATION, | ||
34 | - socketUrl: VITE_GLOB_WEB_SOCKET, | ||
35 | - securityPolicy: VITE_GLOB_CONTENT_SECURITY_POLICY, | ||
36 | - alarmNotifyDuration: VITE_GLOB_ALARM_NOTIFY_DURATION, | ||
37 | - alarmPollingInterval: VITE_GLOB_ALARM_NOTIFY_POLLING_INTERVAL_TIME, | ||
38 | - }; | ||
39 | - return glob as Readonly<GlobConfig>; | ||
40 | -}; | 1 | +import type { GlobConfig } from '/#/config'; |
2 | + | ||
3 | +import { warn } from '/@/utils/log'; | ||
4 | +import { getAppEnvConfig } from '/@/utils/env'; | ||
5 | + | ||
6 | +export const useGlobSetting = (): Readonly<GlobConfig> => { | ||
7 | + const { | ||
8 | + VITE_GLOB_APP_TITLE, | ||
9 | + VITE_GLOB_API_URL, | ||
10 | + VITE_GLOB_APP_SHORT_NAME, | ||
11 | + VITE_GLOB_API_URL_PREFIX, | ||
12 | + VITE_GLOB_UPLOAD_URL, | ||
13 | + VITE_GLOB_CONFIGURATION, | ||
14 | + VITE_GLOB_WEB_SOCKET, | ||
15 | + VITE_GLOB_CONTENT_SECURITY_POLICY, | ||
16 | + VITE_GLOB_ALARM_NOTIFY_POLLING_INTERVAL_TIME, | ||
17 | + VITE_GLOB_ALARM_NOTIFY_DURATION, | ||
18 | + VITE_GLOB_LARGE_DESIGNER, | ||
19 | + } = getAppEnvConfig(); | ||
20 | + | ||
21 | + if (!/[a-zA-Z\_]*/.test(VITE_GLOB_APP_SHORT_NAME)) { | ||
22 | + warn( | ||
23 | + `VITE_GLOB_APP_SHORT_NAME Variables can only be characters/underscores, please modify in the environment variables and re-running.` | ||
24 | + ); | ||
25 | + } | ||
26 | + | ||
27 | + // Take global configuration | ||
28 | + const glob: Readonly<GlobConfig> = { | ||
29 | + title: VITE_GLOB_APP_TITLE, | ||
30 | + apiUrl: VITE_GLOB_API_URL, | ||
31 | + shortName: VITE_GLOB_APP_SHORT_NAME, | ||
32 | + urlPrefix: VITE_GLOB_API_URL_PREFIX, | ||
33 | + uploadUrl: VITE_GLOB_UPLOAD_URL, | ||
34 | + configurationPrefix: VITE_GLOB_CONFIGURATION, | ||
35 | + largeDesignerPrefix: VITE_GLOB_LARGE_DESIGNER, | ||
36 | + socketUrl: VITE_GLOB_WEB_SOCKET, | ||
37 | + securityPolicy: VITE_GLOB_CONTENT_SECURITY_POLICY, | ||
38 | + alarmNotifyDuration: VITE_GLOB_ALARM_NOTIFY_DURATION, | ||
39 | + alarmPollingInterval: VITE_GLOB_ALARM_NOTIFY_POLLING_INTERVAL_TIME, | ||
40 | + }; | ||
41 | + return glob as Readonly<GlobConfig>; | ||
42 | +}; |
1 | -import type { GlobEnvConfig } from '/#/config'; | ||
2 | - | ||
3 | -import { warn } from '/@/utils/log'; | ||
4 | -import pkg from '../../package.json'; | ||
5 | -import { getConfigFileName } from '../../build/getConfigFileName'; | ||
6 | - | ||
7 | -export function getCommonStoragePrefix() { | ||
8 | - const { VITE_GLOB_APP_SHORT_NAME } = getAppEnvConfig(); | ||
9 | - return `${VITE_GLOB_APP_SHORT_NAME}__${getEnv()}`.toUpperCase(); | ||
10 | -} | ||
11 | - | ||
12 | -// Generate cache key according to version | ||
13 | -export function getStorageShortName() { | ||
14 | - return `${getCommonStoragePrefix()}${`__${pkg.version}`}__`.toUpperCase(); | ||
15 | -} | ||
16 | - | ||
17 | -export function getAppEnvConfig() { | ||
18 | - const ENV_NAME = getConfigFileName(import.meta.env); | ||
19 | - | ||
20 | - const ENV = (import.meta.env.DEV | ||
21 | - ? // Get the global configuration (the configuration will be extracted independently when packaging) | ||
22 | - (import.meta.env as unknown as GlobEnvConfig) | ||
23 | - : window[ENV_NAME as any]) as unknown as GlobEnvConfig; | ||
24 | - const { | ||
25 | - VITE_GLOB_APP_TITLE, | ||
26 | - VITE_GLOB_API_URL, | ||
27 | - VITE_GLOB_APP_SHORT_NAME, | ||
28 | - VITE_GLOB_API_URL_PREFIX, | ||
29 | - VITE_GLOB_UPLOAD_URL, | ||
30 | - VITE_GLOB_CONFIGURATION, | ||
31 | - VITE_GLOB_WEB_SOCKET, | ||
32 | - VITE_GLOB_CONTENT_SECURITY_POLICY, | ||
33 | - VITE_GLOB_ALARM_NOTIFY_POLLING_INTERVAL_TIME, | ||
34 | - VITE_GLOB_ALARM_NOTIFY_DURATION, | ||
35 | - } = ENV; | ||
36 | - | ||
37 | - if (!/^[a-zA-Z\_]*$/.test(VITE_GLOB_APP_SHORT_NAME)) { | ||
38 | - warn( | ||
39 | - `VITE_GLOB_APP_SHORT_NAME Variables can only be characters/underscores, please modify in the environment variables and re-running.` | ||
40 | - ); | ||
41 | - } | ||
42 | - | ||
43 | - return { | ||
44 | - VITE_GLOB_APP_TITLE, | ||
45 | - VITE_GLOB_API_URL, | ||
46 | - VITE_GLOB_APP_SHORT_NAME, | ||
47 | - VITE_GLOB_API_URL_PREFIX, | ||
48 | - VITE_GLOB_UPLOAD_URL, | ||
49 | - VITE_GLOB_CONFIGURATION, | ||
50 | - VITE_GLOB_WEB_SOCKET, | ||
51 | - VITE_GLOB_CONTENT_SECURITY_POLICY, | ||
52 | - VITE_GLOB_ALARM_NOTIFY_POLLING_INTERVAL_TIME, | ||
53 | - VITE_GLOB_ALARM_NOTIFY_DURATION, | ||
54 | - }; | ||
55 | -} | ||
56 | - | ||
57 | -/** | ||
58 | - * @description: Development mode | ||
59 | - */ | ||
60 | -export const devMode = 'development'; | ||
61 | - | ||
62 | -/** | ||
63 | - * @description: Production mode | ||
64 | - */ | ||
65 | -export const prodMode = 'production'; | ||
66 | - | ||
67 | -/** | ||
68 | - * @description: Get environment variables | ||
69 | - * @returns: | ||
70 | - * @example: | ||
71 | - */ | ||
72 | -export function getEnv(): string { | ||
73 | - return import.meta.env.MODE; | ||
74 | -} | ||
75 | - | ||
76 | -/** | ||
77 | - * @description: Is it a development mode | ||
78 | - * @returns: | ||
79 | - * @example: | ||
80 | - */ | ||
81 | -export function isDevMode(): boolean { | ||
82 | - return import.meta.env.DEV; | ||
83 | -} | ||
84 | - | ||
85 | -/** | ||
86 | - * @description: Is it a production mode | ||
87 | - * @returns: | ||
88 | - * @example: | ||
89 | - */ | ||
90 | -export function isProdMode(): boolean { | ||
91 | - return import.meta.env.PROD; | ||
92 | -} | 1 | +import type { GlobEnvConfig } from '/#/config'; |
2 | + | ||
3 | +import { warn } from '/@/utils/log'; | ||
4 | +import pkg from '../../package.json'; | ||
5 | +import { getConfigFileName } from '../../build/getConfigFileName'; | ||
6 | + | ||
7 | +export function getCommonStoragePrefix() { | ||
8 | + const { VITE_GLOB_APP_SHORT_NAME } = getAppEnvConfig(); | ||
9 | + return `${VITE_GLOB_APP_SHORT_NAME}__${getEnv()}`.toUpperCase(); | ||
10 | +} | ||
11 | + | ||
12 | +// Generate cache key according to version | ||
13 | +export function getStorageShortName() { | ||
14 | + return `${getCommonStoragePrefix()}${`__${pkg.version}`}__`.toUpperCase(); | ||
15 | +} | ||
16 | + | ||
17 | +export function getAppEnvConfig() { | ||
18 | + const ENV_NAME = getConfigFileName(import.meta.env); | ||
19 | + | ||
20 | + const ENV = (import.meta.env.DEV | ||
21 | + ? // Get the global configuration (the configuration will be extracted independently when packaging) | ||
22 | + (import.meta.env as unknown as GlobEnvConfig) | ||
23 | + : window[ENV_NAME as any]) as unknown as GlobEnvConfig; | ||
24 | + const { | ||
25 | + VITE_GLOB_APP_TITLE, | ||
26 | + VITE_GLOB_API_URL, | ||
27 | + VITE_GLOB_APP_SHORT_NAME, | ||
28 | + VITE_GLOB_API_URL_PREFIX, | ||
29 | + VITE_GLOB_UPLOAD_URL, | ||
30 | + VITE_GLOB_CONFIGURATION, | ||
31 | + VITE_GLOB_WEB_SOCKET, | ||
32 | + VITE_GLOB_CONTENT_SECURITY_POLICY, | ||
33 | + VITE_GLOB_ALARM_NOTIFY_POLLING_INTERVAL_TIME, | ||
34 | + VITE_GLOB_ALARM_NOTIFY_DURATION, | ||
35 | + VITE_GLOB_LARGE_DESIGNER, | ||
36 | + } = ENV; | ||
37 | + | ||
38 | + if (!/^[a-zA-Z\_]*$/.test(VITE_GLOB_APP_SHORT_NAME)) { | ||
39 | + warn( | ||
40 | + `VITE_GLOB_APP_SHORT_NAME Variables can only be characters/underscores, please modify in the environment variables and re-running.` | ||
41 | + ); | ||
42 | + } | ||
43 | + | ||
44 | + return { | ||
45 | + VITE_GLOB_APP_TITLE, | ||
46 | + VITE_GLOB_API_URL, | ||
47 | + VITE_GLOB_APP_SHORT_NAME, | ||
48 | + VITE_GLOB_API_URL_PREFIX, | ||
49 | + VITE_GLOB_UPLOAD_URL, | ||
50 | + VITE_GLOB_CONFIGURATION, | ||
51 | + VITE_GLOB_WEB_SOCKET, | ||
52 | + VITE_GLOB_CONTENT_SECURITY_POLICY, | ||
53 | + VITE_GLOB_ALARM_NOTIFY_POLLING_INTERVAL_TIME, | ||
54 | + VITE_GLOB_ALARM_NOTIFY_DURATION, | ||
55 | + VITE_GLOB_LARGE_DESIGNER, | ||
56 | + }; | ||
57 | +} | ||
58 | + | ||
59 | +/** | ||
60 | + * @description: Development mode | ||
61 | + */ | ||
62 | +export const devMode = 'development'; | ||
63 | + | ||
64 | +/** | ||
65 | + * @description: Production mode | ||
66 | + */ | ||
67 | +export const prodMode = 'production'; | ||
68 | + | ||
69 | +/** | ||
70 | + * @description: Get environment variables | ||
71 | + * @returns: | ||
72 | + * @example: | ||
73 | + */ | ||
74 | +export function getEnv(): string { | ||
75 | + return import.meta.env.MODE; | ||
76 | +} | ||
77 | + | ||
78 | +/** | ||
79 | + * @description: Is it a development mode | ||
80 | + * @returns: | ||
81 | + * @example: | ||
82 | + */ | ||
83 | +export function isDevMode(): boolean { | ||
84 | + return import.meta.env.DEV; | ||
85 | +} | ||
86 | + | ||
87 | +/** | ||
88 | + * @description: Is it a production mode | ||
89 | + * @returns: | ||
90 | + * @example: | ||
91 | + */ | ||
92 | +export function isProdMode(): boolean { | ||
93 | + return import.meta.env.PROD; | ||
94 | +} |
src/views/dataview/BigScreenDrawer.vue
0 → 100644
1 | +<template> | ||
2 | + <BasicDrawer | ||
3 | + v-bind="$attrs" | ||
4 | + @register="registerDrawer" | ||
5 | + showFooter | ||
6 | + :title="getTitle" | ||
7 | + width="30%" | ||
8 | + @ok="handleSubmit" | ||
9 | + > | ||
10 | + <BasicForm @register="registerForm" /> | ||
11 | + </BasicDrawer> | ||
12 | +</template> | ||
13 | +<script lang="ts"> | ||
14 | + import { defineComponent, ref, computed, unref } from 'vue'; | ||
15 | + import { BasicForm, useForm } from '/@/components/Form'; | ||
16 | + import { formSchema, Platform } from './config'; | ||
17 | + import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; | ||
18 | + import { useMessage } from '/@/hooks/web/useMessage'; | ||
19 | + import { saveOrUpdateBigScreenCenter } from '/@/api/bigscreen/center/bigscreenCenter'; | ||
20 | + import { FileItem } from '/@/components/Form/src/components/ApiUpload.vue'; | ||
21 | + import { buildUUID } from '/@/utils/uuid'; | ||
22 | + | ||
23 | + export default defineComponent({ | ||
24 | + name: 'BigScreenDrawer', | ||
25 | + components: { BasicDrawer, BasicForm }, | ||
26 | + emits: ['success', 'register'], | ||
27 | + setup(_, { emit }) { | ||
28 | + const isUpdate = ref(true); | ||
29 | + | ||
30 | + const [registerForm, { validate, setFieldsValue, resetFields }] = useForm({ | ||
31 | + labelWidth: 120, | ||
32 | + schemas: formSchema, | ||
33 | + showActionButtonGroup: false, | ||
34 | + }); | ||
35 | + | ||
36 | + const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { | ||
37 | + await resetFields(); | ||
38 | + setDrawerProps({ confirmLoading: false }); | ||
39 | + isUpdate.value = !!data?.isUpdate; | ||
40 | + if (unref(isUpdate)) { | ||
41 | + if (data.record.thumbnail) { | ||
42 | + data.record.thumbnail = [ | ||
43 | + { uid: buildUUID(), name: 'name', url: data.record.thumbnail } as FileItem, | ||
44 | + ]; | ||
45 | + } | ||
46 | + if (data.record.organizationDTO) { | ||
47 | + await setFieldsValue(data.record); | ||
48 | + } else { | ||
49 | + Reflect.deleteProperty(data.record, 'organizationId'); | ||
50 | + await setFieldsValue(data.record); | ||
51 | + } | ||
52 | + } | ||
53 | + }); | ||
54 | + | ||
55 | + const getTitle = computed(() => (!unref(isUpdate) ? '新增大屏' : '编辑大屏')); | ||
56 | + | ||
57 | + const getDefaultContent = (platform: Platform) => { | ||
58 | + if (platform === Platform.PC) { | ||
59 | + } | ||
60 | + }; | ||
61 | + | ||
62 | + async function handleSubmit() { | ||
63 | + try { | ||
64 | + const { createMessage } = useMessage(); | ||
65 | + const values = await validate(); | ||
66 | + if (Reflect.has(values, 'thumbnail')) { | ||
67 | + const file = (values.thumbnail || []).at(0) || {}; | ||
68 | + values.thumbnail = file.url || null; | ||
69 | + } | ||
70 | + setDrawerProps({ confirmLoading: true }); | ||
71 | + let saveMessage = '添加成功'; | ||
72 | + let updateMessage = '修改成功'; | ||
73 | + values.defaultContent = getDefaultContent(values.platform); | ||
74 | + await saveOrUpdateBigScreenCenter(values, unref(isUpdate)); | ||
75 | + closeDrawer(); | ||
76 | + emit('success'); | ||
77 | + createMessage.success(unref(isUpdate) ? updateMessage : saveMessage); | ||
78 | + } finally { | ||
79 | + setDrawerProps({ confirmLoading: false }); | ||
80 | + } | ||
81 | + } | ||
82 | + | ||
83 | + return { | ||
84 | + getTitle, | ||
85 | + registerDrawer, | ||
86 | + registerForm, | ||
87 | + handleSubmit, | ||
88 | + }; | ||
89 | + }, | ||
90 | + }); | ||
91 | +</script> |
src/views/dataview/config.ts
0 → 100644
1 | +import { FormSchema } from '/@/components/Table'; | ||
2 | +import { getOrganizationList } from '/@/api/system/system'; | ||
3 | +import { copyTransFun } from '/@/utils/fnUtils'; | ||
4 | +import { FileItem } from '/@/components/Form/src/components/ApiUpload.vue'; | ||
5 | +import { createImgPreview } from '/@/components/Preview'; | ||
6 | +import { uploadThumbnail } from '/@/api/configuration/center/configurationCenter'; | ||
7 | +export enum Platform { | ||
8 | + PHONE = 0, | ||
9 | + PC = 1, | ||
10 | +} | ||
11 | + | ||
12 | +export enum ConfigurationPermission { | ||
13 | + CREATE = 'api:yt:dataview:center:post', | ||
14 | + UPDATE = 'api:yt:dataview:center:update', | ||
15 | + DELETE = 'api:yt:dataview:center:delete', | ||
16 | + DESIGN = 'api:yt:dataview:center:get_configuration_info:design', | ||
17 | + PREVIEW = 'api:yt:dataview:center:get_configuration_info:preview', | ||
18 | +} | ||
19 | + | ||
20 | +// 查询字段 | ||
21 | +export const searchFormSchema: FormSchema[] = [ | ||
22 | + { | ||
23 | + field: 'name', | ||
24 | + label: '大屏名称', | ||
25 | + component: 'Input', | ||
26 | + colProps: { span: 8 }, | ||
27 | + componentProps: { | ||
28 | + maxLength: 36, | ||
29 | + placeholder: '请输入大屏名称', | ||
30 | + }, | ||
31 | + }, | ||
32 | +]; | ||
33 | + | ||
34 | +export const formSchema: FormSchema[] = [ | ||
35 | + { | ||
36 | + field: 'thumbnail', | ||
37 | + label: '缩略图', | ||
38 | + component: 'ApiUpload', | ||
39 | + changeEvent: 'update:fileList', | ||
40 | + valueField: 'fileList', | ||
41 | + componentProps: () => { | ||
42 | + return { | ||
43 | + listType: 'picture-card', | ||
44 | + maxFileLimit: 1, | ||
45 | + api: async (file: File) => { | ||
46 | + try { | ||
47 | + const formData = new FormData(); | ||
48 | + formData.set('file', file); | ||
49 | + const { fileStaticUri, fileName } = await uploadThumbnail(formData); | ||
50 | + return { | ||
51 | + uid: fileStaticUri, | ||
52 | + name: fileName, | ||
53 | + url: fileStaticUri, | ||
54 | + } as FileItem; | ||
55 | + } catch (error) { | ||
56 | + return {}; | ||
57 | + } | ||
58 | + }, | ||
59 | + onPreview: (fileList: FileItem) => { | ||
60 | + createImgPreview({ imageList: [fileList.url!] }); | ||
61 | + }, | ||
62 | + }; | ||
63 | + }, | ||
64 | + }, | ||
65 | + | ||
66 | + { | ||
67 | + field: 'name', | ||
68 | + label: '大屏名称', | ||
69 | + required: true, | ||
70 | + component: 'Input', | ||
71 | + componentProps: { | ||
72 | + placeholder: '请输入大屏名称', | ||
73 | + maxLength: 255, | ||
74 | + }, | ||
75 | + }, | ||
76 | + { | ||
77 | + field: 'organizationId', | ||
78 | + label: '所属组织', | ||
79 | + required: true, | ||
80 | + component: 'ApiTreeSelect', | ||
81 | + componentProps: { | ||
82 | + api: async () => { | ||
83 | + const data = await getOrganizationList(); | ||
84 | + copyTransFun(data as any as any[]); | ||
85 | + return data; | ||
86 | + }, | ||
87 | + }, | ||
88 | + }, | ||
89 | + { | ||
90 | + field: 'state', | ||
91 | + label: '发布状态', | ||
92 | + required: true, | ||
93 | + component: 'RadioGroup', | ||
94 | + defaultValue: Platform.PC, | ||
95 | + componentProps: { | ||
96 | + defaultValue: Platform.PC, | ||
97 | + options: [ | ||
98 | + { label: '未发布', value: Platform.PC }, | ||
99 | + { label: '已发布', value: Platform.PHONE }, | ||
100 | + ], | ||
101 | + }, | ||
102 | + }, | ||
103 | + { | ||
104 | + field: 'remark', | ||
105 | + label: '备注', | ||
106 | + component: 'InputTextArea', | ||
107 | + componentProps: { | ||
108 | + placeholder: '请输入备注', | ||
109 | + maxLength: 255, | ||
110 | + }, | ||
111 | + }, | ||
112 | + { | ||
113 | + field: 'id', | ||
114 | + label: '', | ||
115 | + component: 'Input', | ||
116 | + show: false, | ||
117 | + componentProps: { | ||
118 | + maxLength: 36, | ||
119 | + placeholder: 'id', | ||
120 | + }, | ||
121 | + }, | ||
122 | +]; |
src/views/dataview/index.vue
0 → 100644
1 | +<script setup lang="ts"> | ||
2 | + import { List, Card, Button, PaginationProps, Tooltip } from 'ant-design-vue'; | ||
3 | + import { ReloadOutlined } from '@ant-design/icons-vue'; | ||
4 | + import { onMounted, reactive, ref, unref } from 'vue'; | ||
5 | + import { OrganizationIdTree, useResetOrganizationTree } from '../common/organizationIdTree'; | ||
6 | + import { deleteBigScreenenter, getPage } from '/@/api/bigscreen/center/bigscreenCenter'; | ||
7 | + import { BigScreenCenterItemsModel } from '/@/api/bigscreen/center/model/bigscreenCenterModel'; | ||
8 | + import { PageWrapper } from '/@/components/Page'; | ||
9 | + import { BasicForm, useForm } from '/@/components/Form'; | ||
10 | + import { ConfigurationPermission, searchFormSchema } from './config'; | ||
11 | + import { useMessage } from '/@/hooks/web/useMessage'; | ||
12 | + import { Authority } from '/@/components/Authority'; | ||
13 | + import ConfigurationCenterDrawer from './BigScreenDrawer.vue'; | ||
14 | + import { useDrawer } from '/@/components/Drawer'; | ||
15 | + import { getBoundingClientRect } from '/@/utils/domUtils'; | ||
16 | + import configurationSrc from '/@/assets/icons/configuration.svg'; | ||
17 | + import { cloneDeep } from 'lodash'; | ||
18 | + import { useGlobSetting } from '/@/hooks/setting'; | ||
19 | + import { AuthIcon, CardLayoutButton } from '/@/components/Widget'; | ||
20 | + import AuthDropDown from '/@/components/Widget/AuthDropDown.vue'; | ||
21 | + | ||
22 | + const listColumn = ref(5); | ||
23 | + | ||
24 | + const { createMessage } = useMessage(); | ||
25 | + | ||
26 | + const organizationId = ref<Nullable<number>>(null); | ||
27 | + | ||
28 | + const pagination = reactive<PaginationProps>({ | ||
29 | + size: 'small', | ||
30 | + showTotal: (total: number) => `共 ${total} 条数据`, | ||
31 | + current: 1, | ||
32 | + pageSize: unref(listColumn) * 2, | ||
33 | + onChange: (page: number) => { | ||
34 | + pagination.current = page; | ||
35 | + getListData(); | ||
36 | + }, | ||
37 | + }); | ||
38 | + | ||
39 | + const loading = ref(false); | ||
40 | + | ||
41 | + const dataSource = ref<BigScreenCenterItemsModel[]>([]); | ||
42 | + | ||
43 | + const [registerForm, { getFieldsValue }] = useForm({ | ||
44 | + schemas: searchFormSchema, | ||
45 | + showAdvancedButton: true, | ||
46 | + labelWidth: 100, | ||
47 | + compact: true, | ||
48 | + resetFunc: () => { | ||
49 | + resetFn(); | ||
50 | + organizationId.value = null; | ||
51 | + return getListData(); | ||
52 | + }, | ||
53 | + submitFunc: async () => { | ||
54 | + const value = getFieldsValue(); | ||
55 | + getListData(value); | ||
56 | + }, | ||
57 | + }); | ||
58 | + | ||
59 | + async function getListData(value: Recordable = {}) { | ||
60 | + try { | ||
61 | + loading.value = true; | ||
62 | + const pageSize = unref(listColumn) * 2; | ||
63 | + const { items, total } = await getPage({ | ||
64 | + organizationId: unref(organizationId), | ||
65 | + ...value, | ||
66 | + page: pagination.current!, | ||
67 | + pageSize, | ||
68 | + }); | ||
69 | + | ||
70 | + dataSource.value = items; | ||
71 | + Object.assign(pagination, { total, pageSize }); | ||
72 | + } catch (error) { | ||
73 | + } finally { | ||
74 | + loading.value = false; | ||
75 | + } | ||
76 | + } | ||
77 | + | ||
78 | + onMounted(() => { | ||
79 | + getListData(); | ||
80 | + }); | ||
81 | + | ||
82 | + const searchInfo = reactive<Recordable>({}); | ||
83 | + const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); | ||
84 | + const handleSelect = (orgId: number) => { | ||
85 | + organizationId.value = orgId; | ||
86 | + getListData(); | ||
87 | + }; | ||
88 | + | ||
89 | + const [registerDrawer, { openDrawer }] = useDrawer(); | ||
90 | + | ||
91 | + const handleCreateOrUpdate = (record?: BigScreenCenterItemsModel) => { | ||
92 | + if (record) { | ||
93 | + openDrawer(true, { | ||
94 | + isUpdate: true, | ||
95 | + record: cloneDeep(record), | ||
96 | + }); | ||
97 | + } else { | ||
98 | + openDrawer(true, { | ||
99 | + isUpdate: false, | ||
100 | + }); | ||
101 | + } | ||
102 | + }; | ||
103 | + | ||
104 | + const { largeDesignerPrefix } = useGlobSetting(); | ||
105 | + | ||
106 | + const handlePreview = (record: BigScreenCenterItemsModel) => { | ||
107 | + window.open(`${largeDesignerPrefix}/${record.id}`); | ||
108 | + }; | ||
109 | + | ||
110 | + const handleDesign = (record: BigScreenCenterItemsModel) => { | ||
111 | + window.open(`${largeDesignerPrefix}/${record.id}`); | ||
112 | + }; | ||
113 | + | ||
114 | + const handleDelete = async (record: BigScreenCenterItemsModel) => { | ||
115 | + try { | ||
116 | + await deleteBigScreenenter([record.id]); | ||
117 | + createMessage.success('删除成功'); | ||
118 | + await getListData(); | ||
119 | + } catch (error) {} | ||
120 | + }; | ||
121 | + | ||
122 | + const handleCardLayoutChange = () => { | ||
123 | + pagination.current = 1; | ||
124 | + getListData(); | ||
125 | + }; | ||
126 | + | ||
127 | + const listEl = ref<Nullable<ComponentElRef>>(null); | ||
128 | + | ||
129 | + onMounted(() => { | ||
130 | + const clientHeight = document.documentElement.clientHeight; | ||
131 | + const rect = getBoundingClientRect(unref(listEl)!.$el!) as DOMRect; | ||
132 | + // margin-top 24 height 24 | ||
133 | + const paginationHeight = 24 + 24 + 8; | ||
134 | + // list pading top 8 maring-top 8 extra slot 56 | ||
135 | + const listContainerMarginBottom = 8 + 8 + 56; | ||
136 | + const listContainerHeight = | ||
137 | + clientHeight - rect.top - paginationHeight - listContainerMarginBottom; | ||
138 | + const listContainerEl = (unref(listEl)!.$el as HTMLElement).querySelector( | ||
139 | + '.ant-spin-container' | ||
140 | + ) as HTMLElement; | ||
141 | + listContainerEl && | ||
142 | + (listContainerEl.style.height = listContainerHeight + 'px') && | ||
143 | + (listContainerEl.style.overflowY = 'auto') && | ||
144 | + (listContainerEl.style.overflowX = 'hidden'); | ||
145 | + }); | ||
146 | +</script> | ||
147 | + | ||
148 | +<template> | ||
149 | + <PageWrapper dense contentFullHeight contentClass="flex"> | ||
150 | + <OrganizationIdTree @select="handleSelect" ref="organizationIdTreeRef" /> | ||
151 | + <section class="flex-auto p-4 w-3/4 xl:w-4/5 w-full configuration-list"> | ||
152 | + <div class="flex-auto w-full bg-light-50 dark:bg-dark-900 p-4"> | ||
153 | + <BasicForm @register="registerForm" /> | ||
154 | + </div> | ||
155 | + <List | ||
156 | + ref="listEl" | ||
157 | + :loading="loading" | ||
158 | + class="flex-auto bg-light-50 dark:bg-dark-900 !p-2 !mt-4" | ||
159 | + position="bottom" | ||
160 | + :pagination="pagination" | ||
161 | + :data-source="dataSource" | ||
162 | + :grid="{ gutter: 4, column: listColumn }" | ||
163 | + > | ||
164 | + <template #header> | ||
165 | + <div class="flex gap-3 justify-end"> | ||
166 | + <Authority :value="ConfigurationPermission.CREATE"> | ||
167 | + <Button type="primary" @click="handleCreateOrUpdate()">新增大屏</Button> | ||
168 | + </Authority> | ||
169 | + <CardLayoutButton v-model:value="listColumn" @change="handleCardLayoutChange" /> | ||
170 | + <Tooltip title="刷新"> | ||
171 | + <Button type="primary" @click="getListData"> | ||
172 | + <ReloadOutlined @click="getListData" /> | ||
173 | + </Button> | ||
174 | + </Tooltip> | ||
175 | + </div> | ||
176 | + </template> | ||
177 | + <template #renderItem="{ item }"> | ||
178 | + <List.Item> | ||
179 | + <Card hoverable> | ||
180 | + <template #cover> | ||
181 | + <div class="h-full w-full !flex justify-center items-center text-center p-1"> | ||
182 | + <img | ||
183 | + class="w-full h-36" | ||
184 | + alt="example" | ||
185 | + :src="item.thumbnail || configurationSrc" | ||
186 | + @click="handlePreview(item)" | ||
187 | + /> | ||
188 | + </div> | ||
189 | + </template> | ||
190 | + <template class="ant-card-actions" #actions> | ||
191 | + <Tooltip title="预览"> | ||
192 | + <AuthIcon | ||
193 | + class="!text-lg" | ||
194 | + icon="ant-design:eye-outlined" | ||
195 | + @click="handlePreview(item)" | ||
196 | + /> | ||
197 | + </Tooltip> | ||
198 | + <Tooltip title="设计"> | ||
199 | + <AuthIcon | ||
200 | + class="!text-lg" | ||
201 | + icon="ant-design:edit-outlined" | ||
202 | + @click="handleDesign(item)" | ||
203 | + /> | ||
204 | + </Tooltip> | ||
205 | + <AuthDropDown | ||
206 | + :dropMenuList="[ | ||
207 | + { | ||
208 | + text: '编辑', | ||
209 | + auth: ConfigurationPermission.UPDATE, | ||
210 | + icon: 'clarity:note-edit-line', | ||
211 | + event: '', | ||
212 | + onClick: handleCreateOrUpdate.bind(null, item), | ||
213 | + }, | ||
214 | + { | ||
215 | + text: '删除', | ||
216 | + auth: ConfigurationPermission.DELETE, | ||
217 | + icon: 'ant-design:delete-outlined', | ||
218 | + event: '', | ||
219 | + popconfirm: { | ||
220 | + title: '是否确认删除操作?', | ||
221 | + onConfirm: handleDelete.bind(null, item), | ||
222 | + }, | ||
223 | + }, | ||
224 | + ]" | ||
225 | + :trigger="['hover']" | ||
226 | + /> | ||
227 | + </template> | ||
228 | + <Card.Meta> | ||
229 | + <template #title> | ||
230 | + <span class="truncate">{{ item.name }}</span> | ||
231 | + </template> | ||
232 | + <template #description> | ||
233 | + <div class="truncate h-11"> | ||
234 | + <div class="truncate">{{ item.organizationDTO.name }}</div> | ||
235 | + <div class="truncate">{{ item.remark || '' }} </div> | ||
236 | + </div> | ||
237 | + </template> | ||
238 | + </Card.Meta> | ||
239 | + </Card> | ||
240 | + </List.Item> | ||
241 | + </template> | ||
242 | + </List> | ||
243 | + </section> | ||
244 | + <ConfigurationCenterDrawer @register="registerDrawer" @success="getListData" /> | ||
245 | + </PageWrapper> | ||
246 | +</template> | ||
247 | + | ||
248 | +<style lang="less" scoped> | ||
249 | + .configuration-list:deep(.ant-list-header) { | ||
250 | + border-bottom: none !important; | ||
251 | + } | ||
252 | + | ||
253 | + .configuration-list:deep(.ant-list-pagination) { | ||
254 | + height: 24px; | ||
255 | + } | ||
256 | + | ||
257 | + .configuration-list:deep(.ant-card-body) { | ||
258 | + padding: 16px !important; | ||
259 | + } | ||
260 | + | ||
261 | + .configuration-list:deep(.ant-list-empty-text) { | ||
262 | + @apply w-full h-full flex justify-center items-center; | ||
263 | + } | ||
264 | +</style> |
1 | -import { MenuTypeEnum, MenuModeEnum, TriggerEnum, MixSidebarTriggerEnum } from '/@/enums/menuEnum'; | ||
2 | -import { | ||
3 | - ContentEnum, | ||
4 | - PermissionModeEnum, | ||
5 | - ThemeEnum, | ||
6 | - RouterTransitionEnum, | ||
7 | - SettingButtonPositionEnum, | ||
8 | - SessionTimeoutProcessingEnum, | ||
9 | -} from '/@/enums/appEnum'; | ||
10 | - | ||
11 | -import { CacheTypeEnum } from '/@/enums/cacheEnum'; | ||
12 | - | ||
13 | -export type LocaleType = 'zh_CN' | 'en' | 'ru' | 'ja' | 'ko'; | ||
14 | - | ||
15 | -export interface MenuSetting { | ||
16 | - bgColor: string; | ||
17 | - fixed: boolean; | ||
18 | - collapsed: boolean; | ||
19 | - canDrag: boolean; | ||
20 | - show: boolean; | ||
21 | - hidden: boolean; | ||
22 | - split: boolean; | ||
23 | - menuWidth: number; | ||
24 | - mode: MenuModeEnum; | ||
25 | - type: MenuTypeEnum; | ||
26 | - theme: ThemeEnum; | ||
27 | - topMenuAlign: 'start' | 'center' | 'end'; | ||
28 | - trigger: TriggerEnum; | ||
29 | - accordion: boolean; | ||
30 | - closeMixSidebarOnChange: boolean; | ||
31 | - collapsedShowTitle: boolean; | ||
32 | - mixSideTrigger: MixSidebarTriggerEnum; | ||
33 | - mixSideFixed: boolean; | ||
34 | -} | ||
35 | - | ||
36 | -export interface MultiTabsSetting { | ||
37 | - cache: boolean; | ||
38 | - show: boolean; | ||
39 | - showQuick: boolean; | ||
40 | - canDrag: boolean; | ||
41 | - showRedo: boolean; | ||
42 | - showFold: boolean; | ||
43 | -} | ||
44 | - | ||
45 | -export interface HeaderSetting { | ||
46 | - bgColor: string; | ||
47 | - fixed: boolean; | ||
48 | - show: boolean; | ||
49 | - theme: ThemeEnum; | ||
50 | - // Turn on full screen | ||
51 | - showFullScreen: boolean; | ||
52 | - // Whether to show the lock screen | ||
53 | - useLockPage: boolean; | ||
54 | - // Show document button | ||
55 | - showDoc: boolean; | ||
56 | - // Show message center button | ||
57 | - showNotice: boolean; | ||
58 | - showSearch: boolean; | ||
59 | -} | ||
60 | - | ||
61 | -export interface LocaleSetting { | ||
62 | - showPicker: boolean; | ||
63 | - // Current language | ||
64 | - locale: LocaleType; | ||
65 | - // default language | ||
66 | - fallback: LocaleType; | ||
67 | - // available Locales | ||
68 | - availableLocales: LocaleType[]; | ||
69 | -} | ||
70 | - | ||
71 | -export interface TransitionSetting { | ||
72 | - // Whether to open the page switching animation | ||
73 | - enable: boolean; | ||
74 | - // Route basic switching animation | ||
75 | - basicTransition: RouterTransitionEnum; | ||
76 | - // Whether to open page switching loading | ||
77 | - openPageLoading: boolean; | ||
78 | - // Whether to open the top progress bar | ||
79 | - openNProgress: boolean; | ||
80 | -} | ||
81 | - | ||
82 | -export interface ProjectConfig { | ||
83 | - // Storage location of permission related information | ||
84 | - permissionCacheType: CacheTypeEnum; | ||
85 | - // Whether to show the configuration button | ||
86 | - showSettingButton: boolean; | ||
87 | - // Whether to show the theme switch button | ||
88 | - showDarkModeToggle: boolean; | ||
89 | - // Configure where the button is displayed | ||
90 | - settingButtonPosition: SettingButtonPositionEnum; | ||
91 | - // Permission mode | ||
92 | - permissionMode: PermissionModeEnum; | ||
93 | - // Session timeout processing | ||
94 | - sessionTimeoutProcessing: SessionTimeoutProcessingEnum; | ||
95 | - // Website gray mode, open for possible mourning dates | ||
96 | - grayMode: boolean; | ||
97 | - // Whether to turn on the color weak mode | ||
98 | - colorWeak: boolean; | ||
99 | - // Theme color | ||
100 | - themeColor: string; | ||
101 | - | ||
102 | - // The main interface is displayed in full screen, the menu is not displayed, and the top | ||
103 | - fullContent: boolean; | ||
104 | - // content width | ||
105 | - contentMode: ContentEnum; | ||
106 | - // Whether to display the logo | ||
107 | - showLogo: boolean; | ||
108 | - // Whether to show the global footer | ||
109 | - showFooter: boolean; | ||
110 | - // menuType: MenuTypeEnum; | ||
111 | - headerSetting: HeaderSetting; | ||
112 | - // menuSetting | ||
113 | - menuSetting: MenuSetting; | ||
114 | - // Multi-tab settings | ||
115 | - multiTabsSetting: MultiTabsSetting; | ||
116 | - // Animation configuration | ||
117 | - transitionSetting: TransitionSetting; | ||
118 | - // pageLayout whether to enable keep-alive | ||
119 | - openKeepAlive: boolean; | ||
120 | - // Lock screen time | ||
121 | - lockTime: number; | ||
122 | - // Show breadcrumbs | ||
123 | - showBreadCrumb: boolean; | ||
124 | - // Show breadcrumb icon | ||
125 | - showBreadCrumbIcon: boolean; | ||
126 | - // Use error-handler-plugin | ||
127 | - useErrorHandle: boolean; | ||
128 | - // Whether to open back to top | ||
129 | - useOpenBackTop: boolean; | ||
130 | - // Is it possible to embed iframe pages | ||
131 | - canEmbedIFramePage: boolean; | ||
132 | - // Whether to delete unclosed messages and notify when switching the interface | ||
133 | - closeMessageOnSwitch: boolean; | ||
134 | - // Whether to cancel the http request that has been sent but not responded when switching the interface. | ||
135 | - removeAllHttpPending: boolean; | ||
136 | -} | ||
137 | - | ||
138 | -export interface GlobConfig { | ||
139 | - // Site title | ||
140 | - title: string; | ||
141 | - // Service interface url | ||
142 | - apiUrl: string; | ||
143 | - // Upload url | ||
144 | - uploadUrl?: string; | ||
145 | - // Service interface url prefix | ||
146 | - urlPrefix?: string; | ||
147 | - // Project abbreviation | ||
148 | - shortName: string; | ||
149 | - // configuration center proxy prefix | ||
150 | - configurationPrefix: string; | ||
151 | - // socket url | ||
152 | - socketUrl: string; | ||
153 | - // alarm notify alarm duration | ||
154 | - alarmNotifyDuration: string; | ||
155 | - // alarm notify polling interval | ||
156 | - alarmPollingInterval: string; | ||
157 | - // upgrade your http policy to https | ||
158 | - securityPolicy: string; | ||
159 | -} | ||
160 | -export interface GlobEnvConfig { | ||
161 | - // Site title | ||
162 | - VITE_GLOB_APP_TITLE: string; | ||
163 | - // Service interface url | ||
164 | - VITE_GLOB_API_URL: string; | ||
165 | - // Service interface url prefix | ||
166 | - VITE_GLOB_API_URL_PREFIX?: string; | ||
167 | - // Project abbreviation | ||
168 | - VITE_GLOB_APP_SHORT_NAME: string; | ||
169 | - // Upload url | ||
170 | - VITE_GLOB_UPLOAD_URL?: string; | ||
171 | - // configuration | ||
172 | - VITE_GLOB_CONFIGURATION: string; | ||
173 | - // socket | ||
174 | - VITE_GLOB_WEB_SOCKET: string; | ||
175 | - // force transform http to https | ||
176 | - VITE_GLOB_CONTENT_SECURITY_POLICY: string; | ||
177 | - // notify polling interval time | ||
178 | - VITE_GLOB_ALARM_NOTIFY_POLLING_INTERVAL_TIME: string; | ||
179 | - // notify duration | ||
180 | - VITE_GLOB_ALARM_NOTIFY_DURATION: string; | ||
181 | -} | 1 | +import { MenuTypeEnum, MenuModeEnum, TriggerEnum, MixSidebarTriggerEnum } from '/@/enums/menuEnum'; |
2 | +import { | ||
3 | + ContentEnum, | ||
4 | + PermissionModeEnum, | ||
5 | + ThemeEnum, | ||
6 | + RouterTransitionEnum, | ||
7 | + SettingButtonPositionEnum, | ||
8 | + SessionTimeoutProcessingEnum, | ||
9 | +} from '/@/enums/appEnum'; | ||
10 | + | ||
11 | +import { CacheTypeEnum } from '/@/enums/cacheEnum'; | ||
12 | + | ||
13 | +export type LocaleType = 'zh_CN' | 'en' | 'ru' | 'ja' | 'ko'; | ||
14 | + | ||
15 | +export interface MenuSetting { | ||
16 | + bgColor: string; | ||
17 | + fixed: boolean; | ||
18 | + collapsed: boolean; | ||
19 | + canDrag: boolean; | ||
20 | + show: boolean; | ||
21 | + hidden: boolean; | ||
22 | + split: boolean; | ||
23 | + menuWidth: number; | ||
24 | + mode: MenuModeEnum; | ||
25 | + type: MenuTypeEnum; | ||
26 | + theme: ThemeEnum; | ||
27 | + topMenuAlign: 'start' | 'center' | 'end'; | ||
28 | + trigger: TriggerEnum; | ||
29 | + accordion: boolean; | ||
30 | + closeMixSidebarOnChange: boolean; | ||
31 | + collapsedShowTitle: boolean; | ||
32 | + mixSideTrigger: MixSidebarTriggerEnum; | ||
33 | + mixSideFixed: boolean; | ||
34 | +} | ||
35 | + | ||
36 | +export interface MultiTabsSetting { | ||
37 | + cache: boolean; | ||
38 | + show: boolean; | ||
39 | + showQuick: boolean; | ||
40 | + canDrag: boolean; | ||
41 | + showRedo: boolean; | ||
42 | + showFold: boolean; | ||
43 | +} | ||
44 | + | ||
45 | +export interface HeaderSetting { | ||
46 | + bgColor: string; | ||
47 | + fixed: boolean; | ||
48 | + show: boolean; | ||
49 | + theme: ThemeEnum; | ||
50 | + // Turn on full screen | ||
51 | + showFullScreen: boolean; | ||
52 | + // Whether to show the lock screen | ||
53 | + useLockPage: boolean; | ||
54 | + // Show document button | ||
55 | + showDoc: boolean; | ||
56 | + // Show message center button | ||
57 | + showNotice: boolean; | ||
58 | + showSearch: boolean; | ||
59 | +} | ||
60 | + | ||
61 | +export interface LocaleSetting { | ||
62 | + showPicker: boolean; | ||
63 | + // Current language | ||
64 | + locale: LocaleType; | ||
65 | + // default language | ||
66 | + fallback: LocaleType; | ||
67 | + // available Locales | ||
68 | + availableLocales: LocaleType[]; | ||
69 | +} | ||
70 | + | ||
71 | +export interface TransitionSetting { | ||
72 | + // Whether to open the page switching animation | ||
73 | + enable: boolean; | ||
74 | + // Route basic switching animation | ||
75 | + basicTransition: RouterTransitionEnum; | ||
76 | + // Whether to open page switching loading | ||
77 | + openPageLoading: boolean; | ||
78 | + // Whether to open the top progress bar | ||
79 | + openNProgress: boolean; | ||
80 | +} | ||
81 | + | ||
82 | +export interface ProjectConfig { | ||
83 | + // Storage location of permission related information | ||
84 | + permissionCacheType: CacheTypeEnum; | ||
85 | + // Whether to show the configuration button | ||
86 | + showSettingButton: boolean; | ||
87 | + // Whether to show the theme switch button | ||
88 | + showDarkModeToggle: boolean; | ||
89 | + // Configure where the button is displayed | ||
90 | + settingButtonPosition: SettingButtonPositionEnum; | ||
91 | + // Permission mode | ||
92 | + permissionMode: PermissionModeEnum; | ||
93 | + // Session timeout processing | ||
94 | + sessionTimeoutProcessing: SessionTimeoutProcessingEnum; | ||
95 | + // Website gray mode, open for possible mourning dates | ||
96 | + grayMode: boolean; | ||
97 | + // Whether to turn on the color weak mode | ||
98 | + colorWeak: boolean; | ||
99 | + // Theme color | ||
100 | + themeColor: string; | ||
101 | + | ||
102 | + // The main interface is displayed in full screen, the menu is not displayed, and the top | ||
103 | + fullContent: boolean; | ||
104 | + // content width | ||
105 | + contentMode: ContentEnum; | ||
106 | + // Whether to display the logo | ||
107 | + showLogo: boolean; | ||
108 | + // Whether to show the global footer | ||
109 | + showFooter: boolean; | ||
110 | + // menuType: MenuTypeEnum; | ||
111 | + headerSetting: HeaderSetting; | ||
112 | + // menuSetting | ||
113 | + menuSetting: MenuSetting; | ||
114 | + // Multi-tab settings | ||
115 | + multiTabsSetting: MultiTabsSetting; | ||
116 | + // Animation configuration | ||
117 | + transitionSetting: TransitionSetting; | ||
118 | + // pageLayout whether to enable keep-alive | ||
119 | + openKeepAlive: boolean; | ||
120 | + // Lock screen time | ||
121 | + lockTime: number; | ||
122 | + // Show breadcrumbs | ||
123 | + showBreadCrumb: boolean; | ||
124 | + // Show breadcrumb icon | ||
125 | + showBreadCrumbIcon: boolean; | ||
126 | + // Use error-handler-plugin | ||
127 | + useErrorHandle: boolean; | ||
128 | + // Whether to open back to top | ||
129 | + useOpenBackTop: boolean; | ||
130 | + // Is it possible to embed iframe pages | ||
131 | + canEmbedIFramePage: boolean; | ||
132 | + // Whether to delete unclosed messages and notify when switching the interface | ||
133 | + closeMessageOnSwitch: boolean; | ||
134 | + // Whether to cancel the http request that has been sent but not responded when switching the interface. | ||
135 | + removeAllHttpPending: boolean; | ||
136 | +} | ||
137 | + | ||
138 | +export interface GlobConfig { | ||
139 | + // Site title | ||
140 | + title: string; | ||
141 | + // Service interface url | ||
142 | + apiUrl: string; | ||
143 | + // Upload url | ||
144 | + uploadUrl?: string; | ||
145 | + // Service interface url prefix | ||
146 | + urlPrefix?: string; | ||
147 | + // Project abbreviation | ||
148 | + shortName: string; | ||
149 | + // configuration center proxy prefix | ||
150 | + configurationPrefix: string; | ||
151 | + // large designer proxy prefix | ||
152 | + largeDesignerPrefix: string; | ||
153 | + // socket url | ||
154 | + socketUrl: string; | ||
155 | + // alarm notify alarm duration | ||
156 | + alarmNotifyDuration: string; | ||
157 | + // alarm notify polling interval | ||
158 | + alarmPollingInterval: string; | ||
159 | + // upgrade your http policy to https | ||
160 | + securityPolicy: string; | ||
161 | +} | ||
162 | +export interface GlobEnvConfig { | ||
163 | + // Site title | ||
164 | + VITE_GLOB_APP_TITLE: string; | ||
165 | + // Service interface url | ||
166 | + VITE_GLOB_API_URL: string; | ||
167 | + // Service interface url prefix | ||
168 | + VITE_GLOB_API_URL_PREFIX?: string; | ||
169 | + // Project abbreviation | ||
170 | + VITE_GLOB_APP_SHORT_NAME: string; | ||
171 | + // Upload url | ||
172 | + VITE_GLOB_UPLOAD_URL?: string; | ||
173 | + // configuration | ||
174 | + VITE_GLOB_CONFIGURATION: string; | ||
175 | + // large designer | ||
176 | + VITE_GLOB_LARGE_DESIGNER: string; | ||
177 | + // socket | ||
178 | + VITE_GLOB_WEB_SOCKET: string; | ||
179 | + // force transform http to https | ||
180 | + VITE_GLOB_CONTENT_SECURITY_POLICY: string; | ||
181 | + // notify polling interval time | ||
182 | + VITE_GLOB_ALARM_NOTIFY_POLLING_INTERVAL_TIME: string; | ||
183 | + // notify duration | ||
184 | + VITE_GLOB_ALARM_NOTIFY_DURATION: string; | ||
185 | +} |