diff --git a/index.html b/index.html index 840df55..4bee971 100644 --- a/index.html +++ b/index.html @@ -1,13 +1,82 @@ - + + - + %VITE_APP_NAME% - - -
+ + + + +
+
+ + +

系统加载中...

+

System Loading...

+ +
+
- - + + + \ No newline at end of file diff --git a/mock/MockCity.js b/mock/MockCity.js index a7cf82e..5182519 100644 --- a/mock/MockCity.js +++ b/mock/MockCity.js @@ -52,8 +52,9 @@ export default [ { url: '/simple/city/selectCities', method: 'post', - response: request => { + response: () => { return { + success: true, message: 'Success', resultData: { diff --git a/src/components/common-form-control/control-child.vue b/src/components/common-form-control/control-child.vue index 9692f62..89b6b1c 100644 --- a/src/components/common-form-control/control-child.vue +++ b/src/components/common-form-control/control-child.vue @@ -1,5 +1,5 @@ diff --git a/src/views/tools/WindowForms.vue b/src/views/tools/WindowForms.vue index 922aae6..b7a1e0f 100644 --- a/src/views/tools/WindowForms.vue +++ b/src/views/tools/WindowForms.vue @@ -2,6 +2,7 @@ import { ref } from 'vue' import { defineFormOptions } from '@/components/utils' const showWindow = ref(false) +const okLoading = ref(false) const userModel = ref({ cert: {} @@ -42,9 +43,14 @@ const formOptions2 = defineFormOptions([ ]) const submitForm = ({ form }) => { - console.info('=============================', form) form.validate(valid => { - console.info('======================valid', valid) + if (valid) { + okLoading.value = true + setTimeout(() => { + okLoading.value = false + showWindow.value = false + }, 1000) + } }) return false } @@ -62,6 +68,7 @@ const submitForm = ({ form }) => { diff --git a/vite.config.js b/vite.config.mjs similarity index 82% rename from vite.config.js rename to vite.config.mjs index d548ed3..3b5cf87 100644 --- a/vite.config.js +++ b/vite.config.mjs @@ -8,30 +8,33 @@ import eslint from 'vite-plugin-eslint' import { visualizer } from 'rollup-plugin-visualizer' import packageJson from './package.json' -const optionalPlugins = [{ - plugin: visualizer({ open: true }), - enabled: false -}, { - plugin: viteMockServe({ - mockPath: './mock' - }), - enabled: true -}].filter(p => p.enabled).map(p => p.plugin) - const JS_FILE_NAMES = 'js/[name]-[hash].js' const CSS_FILE_NAMES = 'css/[name]-[hash].css' const IMG_EXT_LIST = ['.png', '.jpg', '.gif', '.svg', '.bmp', '.webp'] const IMG_FILE_NAMES = 'images/[name]-[hash].[ext]' // https://vitejs.dev/config/ -export default ({ mode }) => { +export default ({ mode, command }) => { + const env = loadEnv(mode, process.cwd()) + const optionalPlugins = [{ + plugin: visualizer({ open: true }), + enabled: false + }, { + plugin: viteMockServe({ + mockPath: './mock', + enable: command === 'serve' + }), + enabled: command === 'serve' + }].filter(p => p.enabled).map(p => p.plugin) + return defineConfig({ base: env.VITE_APP_CONTEXT_PATH, define: { 'import.meta.env.VITE_APP_VERSION': JSON.stringify(packageJson.version) }, plugins: [vue(), vueJsx(), eslint(), ...optionalPlugins], + esbuild: { drop: mode === 'production' ? ['console', 'debugger'] : [] }, @@ -46,7 +49,7 @@ export default ({ mode }) => { output: { chunkFileNames: JS_FILE_NAMES, // 引入文件名的名称 entryFileNames: JS_FILE_NAMES, // 包的入口文件名称 - assetFileNames(assetInfo) { + assetFileNames (assetInfo) { if (assetInfo.name?.endsWith('.css')) { // CSS文件 return CSS_FILE_NAMES } else if (IMG_EXT_LIST.some((ext) => assetInfo.name?.endsWith(ext))) { // 图片 @@ -54,7 +57,7 @@ export default ({ mode }) => { } return 'assets/[name]-[hash].[ext]' // 其他资源 }, - manualChunks(id) { + manualChunks (id) { if (id.includes('element-plus')) { return 'elp' }