Commit 11770292bbb5824113fe8ac48a381d5238b4b006
1 parent
bf12cb89
chore: 添加打包进度条
Showing
4 changed files
with
45 additions
and
7 deletions
yudao-ui-admin-vue3/package.json
| @@ -38,8 +38,8 @@ | @@ -38,8 +38,8 @@ | ||
| 38 | "echarts-wordcloud": "^2.0.0", | 38 | "echarts-wordcloud": "^2.0.0", |
| 39 | "element-plus": "2.2.21", | 39 | "element-plus": "2.2.21", |
| 40 | "intro.js": "^6.0.0", | 40 | "intro.js": "^6.0.0", |
| 41 | - "jsencrypt": "^3.3.1", | ||
| 42 | "js-cookie": "^3.0.1", | 41 | "js-cookie": "^3.0.1", |
| 42 | + "jsencrypt": "^3.3.1", | ||
| 43 | "lodash-es": "^4.17.21", | 43 | "lodash-es": "^4.17.21", |
| 44 | "mitt": "^3.0.0", | 44 | "mitt": "^3.0.0", |
| 45 | "nprogress": "^0.2.0", | 45 | "nprogress": "^0.2.0", |
| @@ -98,6 +98,7 @@ | @@ -98,6 +98,7 @@ | ||
| 98 | "vite-plugin-compression": "^0.5.1", | 98 | "vite-plugin-compression": "^0.5.1", |
| 99 | "vite-plugin-eslint": "^1.8.1", | 99 | "vite-plugin-eslint": "^1.8.1", |
| 100 | "vite-plugin-html": "^3.2.0", | 100 | "vite-plugin-html": "^3.2.0", |
| 101 | + "vite-plugin-progress": "^0.0.6", | ||
| 101 | "vite-plugin-purge-icons": "^0.9.1", | 102 | "vite-plugin-purge-icons": "^0.9.1", |
| 102 | "vite-plugin-style-import": "2.0.0", | 103 | "vite-plugin-style-import": "2.0.0", |
| 103 | "vite-plugin-svg-icons": "^2.0.1", | 104 | "vite-plugin-svg-icons": "^2.0.1", |
yudao-ui-admin-vue3/pnpm-lock.yaml
| @@ -64,6 +64,7 @@ specifiers: | @@ -64,6 +64,7 @@ specifiers: | ||
| 64 | vite-plugin-compression: ^0.5.1 | 64 | vite-plugin-compression: ^0.5.1 |
| 65 | vite-plugin-eslint: ^1.8.1 | 65 | vite-plugin-eslint: ^1.8.1 |
| 66 | vite-plugin-html: ^3.2.0 | 66 | vite-plugin-html: ^3.2.0 |
| 67 | + vite-plugin-progress: ^0.0.6 | ||
| 67 | vite-plugin-purge-icons: ^0.9.1 | 68 | vite-plugin-purge-icons: ^0.9.1 |
| 68 | vite-plugin-style-import: 2.0.0 | 69 | vite-plugin-style-import: 2.0.0 |
| 69 | vite-plugin-svg-icons: ^2.0.1 | 70 | vite-plugin-svg-icons: ^2.0.1 |
| @@ -153,6 +154,7 @@ devDependencies: | @@ -153,6 +154,7 @@ devDependencies: | ||
| 153 | vite-plugin-compression: registry.npmmirror.com/vite-plugin-compression/0.5.1_vite@3.2.4 | 154 | vite-plugin-compression: registry.npmmirror.com/vite-plugin-compression/0.5.1_vite@3.2.4 |
| 154 | vite-plugin-eslint: registry.npmmirror.com/vite-plugin-eslint/1.8.1_eslint@8.28.0+vite@3.2.4 | 155 | vite-plugin-eslint: registry.npmmirror.com/vite-plugin-eslint/1.8.1_eslint@8.28.0+vite@3.2.4 |
| 155 | vite-plugin-html: registry.npmmirror.com/vite-plugin-html/3.2.0_vite@3.2.4 | 156 | vite-plugin-html: registry.npmmirror.com/vite-plugin-html/3.2.0_vite@3.2.4 |
| 157 | + vite-plugin-progress: registry.npmmirror.com/vite-plugin-progress/0.0.6_vite@3.2.4 | ||
| 156 | vite-plugin-purge-icons: registry.npmmirror.com/vite-plugin-purge-icons/0.9.1_vite@3.2.4 | 158 | vite-plugin-purge-icons: registry.npmmirror.com/vite-plugin-purge-icons/0.9.1_vite@3.2.4 |
| 157 | vite-plugin-style-import: registry.npmmirror.com/vite-plugin-style-import/2.0.0_vite@3.2.4 | 159 | vite-plugin-style-import: registry.npmmirror.com/vite-plugin-style-import/2.0.0_vite@3.2.4 |
| 158 | vite-plugin-svg-icons: registry.npmmirror.com/vite-plugin-svg-icons/2.0.1_vite@3.2.4 | 160 | vite-plugin-svg-icons: registry.npmmirror.com/vite-plugin-svg-icons/2.0.1_vite@3.2.4 |
| @@ -1245,6 +1247,12 @@ packages: | @@ -1245,6 +1247,12 @@ packages: | ||
| 1245 | version: 1.2.2 | 1247 | version: 1.2.2 |
| 1246 | dev: true | 1248 | dev: true |
| 1247 | 1249 | ||
| 1250 | + registry.npmmirror.com/@types/node/10.17.60: | ||
| 1251 | + resolution: {integrity: sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@types/node/-/node-10.17.60.tgz} | ||
| 1252 | + name: '@types/node' | ||
| 1253 | + version: 10.17.60 | ||
| 1254 | + dev: true | ||
| 1255 | + | ||
| 1248 | registry.npmmirror.com/@types/node/14.18.33: | 1256 | registry.npmmirror.com/@types/node/14.18.33: |
| 1249 | resolution: {integrity: sha512-qelS/Ra6sacc4loe/3MSjXNL1dNQ/GjxNHVzuChwMfmk7HuycRLVQN2qNY3XahK+fZc5E2szqQSKUyAF0E+2bg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@types/node/-/node-14.18.33.tgz} | 1257 | resolution: {integrity: sha512-qelS/Ra6sacc4loe/3MSjXNL1dNQ/GjxNHVzuChwMfmk7HuycRLVQN2qNY3XahK+fZc5E2szqQSKUyAF0E+2bg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@types/node/-/node-14.18.33.tgz} |
| 1250 | name: '@types/node' | 1258 | name: '@types/node' |
| @@ -6995,6 +7003,13 @@ packages: | @@ -6995,6 +7003,13 @@ packages: | ||
| 6995 | engines: {node: '>=6'} | 7003 | engines: {node: '>=6'} |
| 6996 | dev: false | 7004 | dev: false |
| 6997 | 7005 | ||
| 7006 | + registry.npmmirror.com/progress/2.0.3: | ||
| 7007 | + resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/progress/-/progress-2.0.3.tgz} | ||
| 7008 | + name: progress | ||
| 7009 | + version: 2.0.3 | ||
| 7010 | + engines: {node: '>=0.4.0'} | ||
| 7011 | + dev: true | ||
| 7012 | + | ||
| 6998 | registry.npmmirror.com/proxy-from-env/1.1.0: | 7013 | registry.npmmirror.com/proxy-from-env/1.1.0: |
| 6999 | resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz} | 7014 | resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz} |
| 7000 | name: proxy-from-env | 7015 | name: proxy-from-env |
| @@ -7081,6 +7096,14 @@ packages: | @@ -7081,6 +7096,14 @@ packages: | ||
| 7081 | engines: {node: '>=8'} | 7096 | engines: {node: '>=8'} |
| 7082 | dev: true | 7097 | dev: true |
| 7083 | 7098 | ||
| 7099 | + registry.npmmirror.com/rd/2.0.1: | ||
| 7100 | + resolution: {integrity: sha512-/XdKU4UazUZTXFmI0dpABt8jSXPWcEyaGdk340KdHnsEOdkTctlX23aAK7ChQDn39YGNlAJr1M5uvaKt4QnpNw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/rd/-/rd-2.0.1.tgz} | ||
| 7101 | + name: rd | ||
| 7102 | + version: 2.0.1 | ||
| 7103 | + dependencies: | ||
| 7104 | + '@types/node': registry.npmmirror.com/@types/node/10.17.60 | ||
| 7105 | + dev: true | ||
| 7106 | + | ||
| 7084 | registry.npmmirror.com/read-pkg-up/7.0.1: | 7107 | registry.npmmirror.com/read-pkg-up/7.0.1: |
| 7085 | resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz} | 7108 | resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz} |
| 7086 | name: read-pkg-up | 7109 | name: read-pkg-up |
| @@ -8511,6 +8534,21 @@ packages: | @@ -8511,6 +8534,21 @@ packages: | ||
| 8511 | vite: registry.npmmirror.com/vite/3.2.4_mp5lu76ee5qtwstsyca37sdhqi | 8534 | vite: registry.npmmirror.com/vite/3.2.4_mp5lu76ee5qtwstsyca37sdhqi |
| 8512 | dev: true | 8535 | dev: true |
| 8513 | 8536 | ||
| 8537 | + registry.npmmirror.com/vite-plugin-progress/0.0.6_vite@3.2.4: | ||
| 8538 | + resolution: {integrity: sha512-pIK2TVEY4XFGrz10CQDdEufBBCDaV0geRHfXV3abGTBr+OF9O0Zmd3ZDrHJXDv4Rl3qAQP4BTCuPYQ3XqstmqA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/vite-plugin-progress/-/vite-plugin-progress-0.0.6.tgz} | ||
| 8539 | + id: registry.npmmirror.com/vite-plugin-progress/0.0.6 | ||
| 8540 | + name: vite-plugin-progress | ||
| 8541 | + version: 0.0.6 | ||
| 8542 | + engines: {node: '>=14', pnpm: '>=7.0.0'} | ||
| 8543 | + peerDependencies: | ||
| 8544 | + vite: '>2.0.0-0' | ||
| 8545 | + dependencies: | ||
| 8546 | + picocolors: registry.npmmirror.com/picocolors/1.0.0 | ||
| 8547 | + progress: registry.npmmirror.com/progress/2.0.3 | ||
| 8548 | + rd: registry.npmmirror.com/rd/2.0.1 | ||
| 8549 | + vite: registry.npmmirror.com/vite/3.2.4_mp5lu76ee5qtwstsyca37sdhqi | ||
| 8550 | + dev: true | ||
| 8551 | + | ||
| 8514 | registry.npmmirror.com/vite-plugin-purge-icons/0.9.1_vite@3.2.4: | 8552 | registry.npmmirror.com/vite-plugin-purge-icons/0.9.1_vite@3.2.4: |
| 8515 | resolution: {integrity: sha512-oS0Y9Iq6vGnTDVRzB8xJNhA/gGlyR0lfCICU6+9FRKdrO5PnT34fRjvd8YWEsegCrk91+w3GVZc0HJDj/dPp5Q==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/vite-plugin-purge-icons/-/vite-plugin-purge-icons-0.9.1.tgz} | 8553 | resolution: {integrity: sha512-oS0Y9Iq6vGnTDVRzB8xJNhA/gGlyR0lfCICU6+9FRKdrO5PnT34fRjvd8YWEsegCrk91+w3GVZc0HJDj/dPp5Q==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/vite-plugin-purge-icons/-/vite-plugin-purge-icons-0.9.1.tgz} |
| 8516 | id: registry.npmmirror.com/vite-plugin-purge-icons/0.9.1 | 8554 | id: registry.npmmirror.com/vite-plugin-purge-icons/0.9.1 |
yudao-ui-admin-vue3/src/components/IFrame/src/IFrame.vue
| @@ -5,11 +5,9 @@ const props = defineProps({ | @@ -5,11 +5,9 @@ const props = defineProps({ | ||
| 5 | src: propTypes.string.def('') | 5 | src: propTypes.string.def('') |
| 6 | }) | 6 | }) |
| 7 | const loading = ref(true) | 7 | const loading = ref(true) |
| 8 | -const frameSrc = ref<string>('') | ||
| 9 | const height = ref('') | 8 | const height = ref('') |
| 10 | const frameRef = ref<HTMLElement | null>(null) | 9 | const frameRef = ref<HTMLElement | null>(null) |
| 11 | const init = () => { | 10 | const init = () => { |
| 12 | - frameSrc.value = props.src | ||
| 13 | height.value = document.documentElement.clientHeight - 94.5 + 'px' | 11 | height.value = document.documentElement.clientHeight - 94.5 + 'px' |
| 14 | loading.value = false | 12 | loading.value = false |
| 15 | } | 13 | } |
| @@ -22,7 +20,7 @@ onMounted(() => { | @@ -22,7 +20,7 @@ onMounted(() => { | ||
| 22 | <template> | 20 | <template> |
| 23 | <div v-loading="loading" :style="'height:' + height"> | 21 | <div v-loading="loading" :style="'height:' + height"> |
| 24 | <iframe | 22 | <iframe |
| 25 | - :src="frameSrc" | 23 | + :src="props.src" |
| 26 | style="width: 100%; height: 100%" | 24 | style="width: 100%; height: 100%" |
| 27 | frameborder="no" | 25 | frameborder="no" |
| 28 | scrolling="auto" | 26 | scrolling="auto" |
yudao-ui-admin-vue3/vite.config.ts
| @@ -7,11 +7,11 @@ import VueJsx from '@vitejs/plugin-vue-jsx' | @@ -7,11 +7,11 @@ import VueJsx from '@vitejs/plugin-vue-jsx' | ||
| 7 | import EslintPlugin from 'vite-plugin-eslint' | 7 | import EslintPlugin from 'vite-plugin-eslint' |
| 8 | import VueI18n from '@intlify/vite-plugin-vue-i18n' | 8 | import VueI18n from '@intlify/vite-plugin-vue-i18n' |
| 9 | import { createStyleImportPlugin, ElementPlusResolve, VxeTableResolve } from 'vite-plugin-style-import' | 9 | import { createStyleImportPlugin, ElementPlusResolve, VxeTableResolve } from 'vite-plugin-style-import' |
| 10 | +import progress from 'vite-plugin-progress' | ||
| 10 | import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' | 11 | import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' |
| 11 | import PurgeIcons from 'vite-plugin-purge-icons' | 12 | import PurgeIcons from 'vite-plugin-purge-icons' |
| 12 | import { createHtmlPlugin } from 'vite-plugin-html' | 13 | import { createHtmlPlugin } from 'vite-plugin-html' |
| 13 | import viteCompression from 'vite-plugin-compression' | 14 | import viteCompression from 'vite-plugin-compression' |
| 14 | - | ||
| 15 | // 当前执行node命令时文件夹的地址(工作目录) | 15 | // 当前执行node命令时文件夹的地址(工作目录) |
| 16 | const root = process.cwd() | 16 | const root = process.cwd() |
| 17 | 17 | ||
| @@ -54,6 +54,8 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { | @@ -54,6 +54,8 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { | ||
| 54 | Vue(), | 54 | Vue(), |
| 55 | VueJsx(), | 55 | VueJsx(), |
| 56 | WindiCSS(), | 56 | WindiCSS(), |
| 57 | + progress(), | ||
| 58 | + PurgeIcons(), | ||
| 57 | createStyleImportPlugin({ | 59 | createStyleImportPlugin({ |
| 58 | resolves: [ElementPlusResolve(),VxeTableResolve()], | 60 | resolves: [ElementPlusResolve(),VxeTableResolve()], |
| 59 | libs: [{ | 61 | libs: [{ |
| @@ -84,7 +86,6 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { | @@ -84,7 +86,6 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { | ||
| 84 | symbolId: 'icon-[dir]-[name]', | 86 | symbolId: 'icon-[dir]-[name]', |
| 85 | svgoOptions: true | 87 | svgoOptions: true |
| 86 | }), | 88 | }), |
| 87 | - PurgeIcons(), | ||
| 88 | viteCompression({ | 89 | viteCompression({ |
| 89 | verbose: true, // 是否在控制台输出压缩结果 | 90 | verbose: true, // 是否在控制台输出压缩结果 |
| 90 | disable: false, // 是否禁用 | 91 | disable: false, // 是否禁用 |
| @@ -102,7 +103,6 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { | @@ -102,7 +103,6 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { | ||
| 102 | } | 103 | } |
| 103 | }) | 104 | }) |
| 104 | ], | 105 | ], |
| 105 | - | ||
| 106 | css: { | 106 | css: { |
| 107 | preprocessorOptions: { | 107 | preprocessorOptions: { |
| 108 | less: { | 108 | less: { |
| @@ -144,6 +144,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { | @@ -144,6 +144,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { | ||
| 144 | 'vue-i18n', | 144 | 'vue-i18n', |
| 145 | 'vxe-table', | 145 | 'vxe-table', |
| 146 | 'xe-utils', | 146 | 'xe-utils', |
| 147 | + 'lodash-es', | ||
| 147 | 'element-plus/es', | 148 | 'element-plus/es', |
| 148 | 'element-plus/es/locale/lang/zh-cn', | 149 | 'element-plus/es/locale/lang/zh-cn', |
| 149 | 'element-plus/es/locale/lang/en', | 150 | 'element-plus/es/locale/lang/en', |