Commit 3ecac4f9b17c24db878f07c3c730d9f8e98f8efc
Merge branch 'ww' into 'main'
perf: add user config in dropConsoleInVue3VideoPlay vite plugin See merge request huang/yun-teng-iot-front!379
Showing
7 changed files
with
95 additions
and
77 deletions
1 | +import { Plugin } from 'vite'; | ||
2 | + | ||
3 | +export function dropConsoleInVue3VideoPlayPlugin(params?: { enabled: boolean }) { | ||
4 | + const { enabled = true } = params || {}; | ||
5 | + return { | ||
6 | + name: 'drop-console-in-vue3-video-play-plugin', | ||
7 | + transform(src, id) { | ||
8 | + if (enabled) { | ||
9 | + if (id.includes('vue3-video-play')) { | ||
10 | + return { | ||
11 | + code: src.replaceAll('console.log', ''), | ||
12 | + }; | ||
13 | + } | ||
14 | + } | ||
15 | + }, | ||
16 | + } as Plugin; | ||
17 | +} |
@@ -16,6 +16,7 @@ import { configThemePlugin } from './theme'; | @@ -16,6 +16,7 @@ import { configThemePlugin } from './theme'; | ||
16 | import { configImageminPlugin } from './imagemin'; | 16 | import { configImageminPlugin } from './imagemin'; |
17 | import { configSvgIconsPlugin } from './svgSprite'; | 17 | import { configSvgIconsPlugin } from './svgSprite'; |
18 | import { configHmrPlugin } from './hmr'; | 18 | import { configHmrPlugin } from './hmr'; |
19 | +import { dropConsoleInVue3VideoPlayPlugin } from './dropConsoleInVue3VideoPlay'; | ||
19 | 20 | ||
20 | export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) { | 21 | export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) { |
21 | const { | 22 | const { |
@@ -63,6 +64,8 @@ export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) { | @@ -63,6 +64,8 @@ export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) { | ||
63 | //vite-plugin-theme | 64 | //vite-plugin-theme |
64 | vitePlugins.push(configThemePlugin(isBuild)); | 65 | vitePlugins.push(configThemePlugin(isBuild)); |
65 | 66 | ||
67 | + vitePlugins.push(dropConsoleInVue3VideoPlayPlugin()); | ||
68 | + | ||
66 | // The following plugins only work in the production environment | 69 | // The following plugins only work in the production environment |
67 | if (isBuild) { | 70 | if (isBuild) { |
68 | //vite-plugin-imagemin | 71 | //vite-plugin-imagemin |
@@ -2,68 +2,67 @@ | @@ -2,68 +2,67 @@ | ||
2 | * Introduces component library styles on demand. | 2 | * Introduces component library styles on demand. |
3 | * https://github.com/anncwb/vite-plugin-style-import | 3 | * https://github.com/anncwb/vite-plugin-style-import |
4 | */ | 4 | */ |
5 | - import styleImport from 'vite-plugin-style-import'; | 5 | +import styleImport from 'vite-plugin-style-import'; |
6 | 6 | ||
7 | - export function configStyleImportPlugin(isBuild: boolean) { | ||
8 | - if (!isBuild) { | ||
9 | - return []; | ||
10 | - } | ||
11 | - const styleImportPlugin = styleImport({ | ||
12 | - libs: [ | ||
13 | - { | ||
14 | - libraryName: 'ant-design-vue', | ||
15 | - esModule: true, | ||
16 | - resolveStyle: (name) => { | ||
17 | - // 这里是“子组件”列表,无需额外引入样式文件 | ||
18 | - const ignoreList = [ | ||
19 | - 'typography-text', | ||
20 | - 'typography-title', | ||
21 | - 'typography-paragraph', | ||
22 | - 'typography-link', | ||
23 | - 'anchor-link', | ||
24 | - 'sub-menu', | ||
25 | - 'menu-item', | ||
26 | - 'menu-item-group', | ||
27 | - 'dropdown-button', | ||
28 | - 'breadcrumb-item', | ||
29 | - 'breadcrumb-separator', | ||
30 | - 'input-password', | ||
31 | - 'input-search', | ||
32 | - 'input-group', | ||
33 | - 'form-item', | ||
34 | - 'radio-group', | ||
35 | - 'checkbox-group', | ||
36 | - 'layout-sider', | ||
37 | - 'layout-content', | ||
38 | - 'layout-footer', | ||
39 | - 'layout-header', | ||
40 | - 'step', | ||
41 | - 'select-option', | ||
42 | - 'select-opt-group', | ||
43 | - 'card-grid', | ||
44 | - 'card-meta', | ||
45 | - 'collapse-panel', | ||
46 | - 'descriptions-item', | ||
47 | - 'list-item', | ||
48 | - 'list-item-meta', | ||
49 | - 'table-column', | ||
50 | - 'table-column-group', | ||
51 | - 'tab-pane', | ||
52 | - 'tab-content', | ||
53 | - 'timeline-item', | ||
54 | - 'tree-node', | ||
55 | - 'skeleton-input', | ||
56 | - 'skeleton-avatar', | ||
57 | - 'skeleton-title', | ||
58 | - 'skeleton-paragraph', | ||
59 | - 'skeleton-image', | ||
60 | - 'skeleton-button', | ||
61 | - ]; | ||
62 | - return ignoreList.includes(name) ? '' : `ant-design-vue/es/${name}/style/index`; | ||
63 | - }, | ||
64 | - }, | ||
65 | - ], | ||
66 | - }); | ||
67 | - return styleImportPlugin; | ||
68 | - } | ||
69 | - | ||
7 | +export function configStyleImportPlugin(isBuild: boolean) { | ||
8 | + if (!isBuild) { | ||
9 | + return []; | ||
10 | + } | ||
11 | + const styleImportPlugin = styleImport({ | ||
12 | + libs: [ | ||
13 | + { | ||
14 | + libraryName: 'ant-design-vue', | ||
15 | + esModule: true, | ||
16 | + resolveStyle: (name) => { | ||
17 | + // 这里是“子组件”列表,无需额外引入样式文件 | ||
18 | + const ignoreList = [ | ||
19 | + 'typography-text', | ||
20 | + 'typography-title', | ||
21 | + 'typography-paragraph', | ||
22 | + 'typography-link', | ||
23 | + 'anchor-link', | ||
24 | + 'sub-menu', | ||
25 | + 'menu-item', | ||
26 | + 'menu-item-group', | ||
27 | + 'dropdown-button', | ||
28 | + 'breadcrumb-item', | ||
29 | + 'breadcrumb-separator', | ||
30 | + 'input-password', | ||
31 | + 'input-search', | ||
32 | + 'input-group', | ||
33 | + 'form-item', | ||
34 | + 'radio-group', | ||
35 | + 'checkbox-group', | ||
36 | + 'layout-sider', | ||
37 | + 'layout-content', | ||
38 | + 'layout-footer', | ||
39 | + 'layout-header', | ||
40 | + 'step', | ||
41 | + 'select-option', | ||
42 | + 'select-opt-group', | ||
43 | + 'card-grid', | ||
44 | + 'card-meta', | ||
45 | + 'collapse-panel', | ||
46 | + 'descriptions-item', | ||
47 | + 'list-item', | ||
48 | + 'list-item-meta', | ||
49 | + 'table-column', | ||
50 | + 'table-column-group', | ||
51 | + 'tab-pane', | ||
52 | + 'tab-content', | ||
53 | + 'timeline-item', | ||
54 | + 'tree-node', | ||
55 | + 'skeleton-input', | ||
56 | + 'skeleton-avatar', | ||
57 | + 'skeleton-title', | ||
58 | + 'skeleton-paragraph', | ||
59 | + 'skeleton-image', | ||
60 | + 'skeleton-button', | ||
61 | + ]; | ||
62 | + return ignoreList.includes(name) ? '' : `ant-design-vue/es/${name}/style/index`; | ||
63 | + }, | ||
64 | + }, | ||
65 | + ], | ||
66 | + }); | ||
67 | + return styleImportPlugin; | ||
68 | +} |
@@ -47,8 +47,8 @@ export default defineComponent({ | @@ -47,8 +47,8 @@ export default defineComponent({ | ||
47 | const { | 47 | const { |
48 | getContentMode, | 48 | getContentMode, |
49 | getShowFooter, | 49 | getShowFooter, |
50 | - // getShowBreadCrumb, | ||
51 | - // getShowBreadCrumbIcon, | 50 | + getShowBreadCrumb, |
51 | + getShowBreadCrumbIcon, | ||
52 | getShowLogo, | 52 | getShowLogo, |
53 | getFullContent, | 53 | getFullContent, |
54 | getColorWeak, | 54 | getColorWeak, |
@@ -281,7 +281,7 @@ export default defineComponent({ | @@ -281,7 +281,7 @@ export default defineComponent({ | ||
281 | function renderContent() { | 281 | function renderContent() { |
282 | return ( | 282 | return ( |
283 | <> | 283 | <> |
284 | - {/* <SwitchItem | 284 | + <SwitchItem |
285 | title={t('layout.setting.breadcrumb')} | 285 | title={t('layout.setting.breadcrumb')} |
286 | event={HandlerEnum.SHOW_BREADCRUMB} | 286 | event={HandlerEnum.SHOW_BREADCRUMB} |
287 | def={unref(getShowBreadCrumb)} | 287 | def={unref(getShowBreadCrumb)} |
@@ -299,7 +299,7 @@ export default defineComponent({ | @@ -299,7 +299,7 @@ export default defineComponent({ | ||
299 | title={t('layout.setting.tabs')} | 299 | title={t('layout.setting.tabs')} |
300 | event={HandlerEnum.TABS_SHOW} | 300 | event={HandlerEnum.TABS_SHOW} |
301 | def={unref(getShowMultipleTab)} | 301 | def={unref(getShowMultipleTab)} |
302 | - /> */} | 302 | + /> |
303 | 303 | ||
304 | <SwitchItem | 304 | <SwitchItem |
305 | title={t('layout.setting.tabsRedoBtn')} | 305 | title={t('layout.setting.tabsRedoBtn')} |
@@ -120,7 +120,7 @@ const setting: ProjectConfig = { | @@ -120,7 +120,7 @@ const setting: ProjectConfig = { | ||
120 | multiTabsSetting: { | 120 | multiTabsSetting: { |
121 | cache: false, | 121 | cache: false, |
122 | // Turn on | 122 | // Turn on |
123 | - show: true, | 123 | + show: false, |
124 | // Is it possible to drag and drop sorting tabs | 124 | // Is it possible to drag and drop sorting tabs |
125 | canDrag: true, | 125 | canDrag: true, |
126 | // Turn on quick actions | 126 | // Turn on quick actions |
@@ -155,7 +155,7 @@ const setting: ProjectConfig = { | @@ -155,7 +155,7 @@ const setting: ProjectConfig = { | ||
155 | lockTime: 0, | 155 | lockTime: 0, |
156 | 156 | ||
157 | // Whether to show breadcrumbs | 157 | // Whether to show breadcrumbs |
158 | - showBreadCrumb: true, | 158 | + showBreadCrumb: false, |
159 | 159 | ||
160 | // Whether to show the breadcrumb icon | 160 | // Whether to show the breadcrumb icon |
161 | showBreadCrumbIcon: false, | 161 | showBreadCrumbIcon: false, |
@@ -90,7 +90,6 @@ | @@ -90,7 +90,6 @@ | ||
90 | placeholder: true, | 90 | placeholder: true, |
91 | })); | 91 | })); |
92 | items = [...items, ...fillArr]; | 92 | items = [...items, ...fillArr]; |
93 | - console.log(fillArr); | ||
94 | } | 93 | } |
95 | cameraList.value = items; | 94 | cameraList.value = items; |
96 | } catch (error) { | 95 | } catch (error) { |
@@ -96,7 +96,7 @@ export const step1Schemas: FormSchema[] = [ | @@ -96,7 +96,7 @@ export const step1Schemas: FormSchema[] = [ | ||
96 | }, | 96 | }, |
97 | { | 97 | { |
98 | field: 'name', | 98 | field: 'name', |
99 | - label: '配置名称', | 99 | + label: '产品名称', |
100 | required: true, | 100 | required: true, |
101 | component: 'Input', | 101 | component: 'Input', |
102 | colProps: { span: 14 }, | 102 | colProps: { span: 14 }, |
@@ -104,7 +104,7 @@ export const step1Schemas: FormSchema[] = [ | @@ -104,7 +104,7 @@ export const step1Schemas: FormSchema[] = [ | ||
104 | return { | 104 | return { |
105 | disabled: false, | 105 | disabled: false, |
106 | ength: 255, | 106 | ength: 255, |
107 | - placeholder: '请输入配置名称', | 107 | + placeholder: '请输入产品名称', |
108 | }; | 108 | }; |
109 | }, | 109 | }, |
110 | }, | 110 | }, |
@@ -242,12 +242,12 @@ export const defaultObj = { | @@ -242,12 +242,12 @@ export const defaultObj = { | ||
242 | export const searchFormSchema: FormSchema[] = [ | 242 | export const searchFormSchema: FormSchema[] = [ |
243 | { | 243 | { |
244 | field: 'name', | 244 | field: 'name', |
245 | - label: '配置名称', | 245 | + label: '产品名称', |
246 | component: 'Input', | 246 | component: 'Input', |
247 | colProps: { span: 6 }, | 247 | colProps: { span: 6 }, |
248 | componentProps: { | 248 | componentProps: { |
249 | maxLength: 255, | 249 | maxLength: 255, |
250 | - placeholder: '请输入配置名称', | 250 | + placeholder: '请输入产品名称', |
251 | }, | 251 | }, |
252 | }, | 252 | }, |
253 | ]; | 253 | ]; |
@@ -262,12 +262,12 @@ export const isEmail = (type: string) => { | @@ -262,12 +262,12 @@ export const isEmail = (type: string) => { | ||
262 | export const formSchema: FormSchema[] = [ | 262 | export const formSchema: FormSchema[] = [ |
263 | { | 263 | { |
264 | field: 'configName', | 264 | field: 'configName', |
265 | - label: '配置名称', | 265 | + label: '产品名称', |
266 | required: true, | 266 | required: true, |
267 | component: 'Input', | 267 | component: 'Input', |
268 | componentProps: { | 268 | componentProps: { |
269 | maxLength: 255, | 269 | maxLength: 255, |
270 | - placeholder: '请输入配置名称', | 270 | + placeholder: '请输入产品名称', |
271 | }, | 271 | }, |
272 | }, | 272 | }, |
273 | { | 273 | { |