From cc2b2dc6c98177f1fd827f4edf7346969ea6df28 Mon Sep 17 00:00:00 2001 From: smallchill Date: Fri, 31 Mar 2023 00:19:38 +0800 Subject: [PATCH] :zap: optimization --- .env.production | 2 +- jsconfig.json | 9 +++++++++ src/mixins/index.js | 3 +-- src/option/system/dict.js | 2 +- src/option/system/dictbiz.js | 2 +- src/option/system/param.js | 2 +- src/views/desk/notice.vue | 2 +- src/views/flow/follow.vue | 2 +- src/views/flow/manager.vue | 2 +- src/views/flow/model.vue | 2 +- src/views/monitor/log/api.vue | 2 +- src/views/monitor/log/error.vue | 2 +- src/views/monitor/log/usual.vue | 2 +- src/views/report/reportlist.vue | 2 +- src/views/resource/attach.vue | 2 +- src/views/resource/oss.vue | 2 +- src/views/resource/sms.vue | 2 +- src/views/system/client.vue | 2 +- src/views/system/dept.vue | 4 +++- src/views/system/menu.vue | 2 +- src/views/system/post.vue | 2 +- src/views/system/tenant.vue | 2 +- src/views/system/tenantpackage.vue | 2 +- src/views/system/topmenu.vue | 2 +- src/views/system/user.vue | 2 +- src/views/tool/code.vue | 28 +++++++++++++--------------- src/views/tool/datasource.vue | 2 +- src/views/work/claim.vue | 2 +- src/views/work/done.vue | 2 +- src/views/work/send.vue | 2 +- src/views/work/start.vue | 2 +- src/views/work/todo.vue | 2 +- vite.config.js | 4 ++-- 33 files changed, 56 insertions(+), 48 deletions(-) create mode 100644 jsconfig.json diff --git a/.env.production b/.env.production index 2d4163e..6722e37 100644 --- a/.env.production +++ b/.env.production @@ -1,7 +1,7 @@ #生产环境配置 VITE_APP_ENV = 'production' -#接口地址前缀 +#接口地址 #填写前缀 [/api] 需要用nginx进行反向代理 #填写地址 [https://api.bladex.vip] 只需要保证接口支持跨域即可, 无需再做代理 VITE_APP_API=/api diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..adc4845 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "paths": { + "@/*": ["src/*"] + } + }, + "exclude": ["node_modules", "dist"] +} diff --git a/src/mixins/index.js b/src/mixins/index.js index 3a65ccf..5d0862c 100644 --- a/src/mixins/index.js +++ b/src/mixins/index.js @@ -27,8 +27,7 @@ export default { if (validatenull(date)) return; if (date >= this.website.tokenTime && !this.refreshLock) { this.refreshLock = true; - this.$store - .dispatch("RefreshToken") + this.$store.dispatch("RefreshToken") .then(() => { this.refreshLock = false; }) diff --git a/src/option/system/dict.js b/src/option/system/dict.js index 119e92e..0b4373f 100644 --- a/src/option/system/dict.js +++ b/src/option/system/dict.js @@ -1,6 +1,6 @@ export const optionParent = { height: 'auto', - calcHeight: 30, + calcHeight: 32, tip: false, searchShow: true, searchMenuSpan: 10, diff --git a/src/option/system/dictbiz.js b/src/option/system/dictbiz.js index bdf7906..ed36170 100644 --- a/src/option/system/dictbiz.js +++ b/src/option/system/dictbiz.js @@ -1,6 +1,6 @@ export const optionParent = { height: 'auto', - calcHeight: 30, + calcHeight: 32, tip: false, searchShow: true, searchMenuSpan: 10, diff --git a/src/option/system/param.js b/src/option/system/param.js index e0b8447..3d64e82 100644 --- a/src/option/system/param.js +++ b/src/option/system/param.js @@ -1,6 +1,6 @@ export default { height: 'auto', - calcHeight: 30, + calcHeight: 32, tip: false, searchShow: true, searchMenuSpan: 6, diff --git a/src/views/desk/notice.vue b/src/views/desk/notice.vue index 92cbbf1..9a0399c 100644 --- a/src/views/desk/notice.vue +++ b/src/views/desk/notice.vue @@ -51,7 +51,7 @@ export default { selectionList: [], option: { height: 'auto', - calcHeight: 30, + calcHeight: 32, dialogWidth: 950, tip: false, searchShow: true, diff --git a/src/views/flow/follow.vue b/src/views/flow/follow.vue index 882d2ad..53b8eb9 100644 --- a/src/views/flow/follow.vue +++ b/src/views/flow/follow.vue @@ -64,7 +64,7 @@ export default { deleteReason: '', option: { height: 'auto', - calcHeight: 30, + calcHeight: 32, tip: false, searchShow: true, searchMenuSpan: 6, diff --git a/src/views/flow/manager.vue b/src/views/flow/manager.vue index f79b640..1036f64 100644 --- a/src/views/flow/manager.vue +++ b/src/views/flow/manager.vue @@ -118,7 +118,7 @@ export default { }], option: { height: 'auto', - calcHeight: 30, + calcHeight: 32, tip: false, searchShow: true, searchMenuSpan: 6, diff --git a/src/views/flow/model.vue b/src/views/flow/model.vue index ee83d17..09f29d8 100644 --- a/src/views/flow/model.vue +++ b/src/views/flow/model.vue @@ -200,7 +200,7 @@ export default { flowBox: false, option: { height: 'auto', - calcHeight: 30, + calcHeight: 32, tip: false, searchShow: true, searchMenuSpan: 6, diff --git a/src/views/monitor/log/api.vue b/src/views/monitor/log/api.vue index bcda231..0742f66 100644 --- a/src/views/monitor/log/api.vue +++ b/src/views/monitor/log/api.vue @@ -36,7 +36,7 @@ export default { }, option: { height: 'auto', - calcHeight: 30, + calcHeight: 32, tip: false, searchShow: true, searchMenuSpan: 6, diff --git a/src/views/monitor/log/error.vue b/src/views/monitor/log/error.vue index 4c99505..8abff84 100644 --- a/src/views/monitor/log/error.vue +++ b/src/views/monitor/log/error.vue @@ -36,7 +36,7 @@ export default { }, option: { height: 'auto', - calcHeight: 30, + calcHeight: 32, tip: false, searchShow: true, searchMenuSpan: 6, diff --git a/src/views/monitor/log/usual.vue b/src/views/monitor/log/usual.vue index 7948bd6..83bbf8e 100644 --- a/src/views/monitor/log/usual.vue +++ b/src/views/monitor/log/usual.vue @@ -36,7 +36,7 @@ export default { }, option: { height: 'auto', - calcHeight: 30, + calcHeight: 32, tip: false, searchShow: true, searchMenuSpan: 6, diff --git a/src/views/report/reportlist.vue b/src/views/report/reportlist.vue index 8ae6bd6..7ac99ee 100644 --- a/src/views/report/reportlist.vue +++ b/src/views/report/reportlist.vue @@ -62,7 +62,7 @@ export default { }, option: { height: 'auto', - calcHeight: 30, + calcHeight: 32, tip: false, searchShow: true, searchMenuSpan: 6, diff --git a/src/views/resource/attach.vue b/src/views/resource/attach.vue index 58d9956..9cd0857 100644 --- a/src/views/resource/attach.vue +++ b/src/views/resource/attach.vue @@ -74,7 +74,7 @@ export default { selectionList: [], option: { height: 'auto', - calcHeight: 30, + calcHeight: 32, tip: false, searchShow: true, searchMenuSpan: 6, diff --git a/src/views/resource/oss.vue b/src/views/resource/oss.vue index 2866419..d3476db 100644 --- a/src/views/resource/oss.vue +++ b/src/views/resource/oss.vue @@ -79,7 +79,7 @@ export default { selectionList: [], option: { height: 'auto', - calcHeight: 30, + calcHeight: 32, tip: false, searchShow: true, searchMenuSpan: 6, diff --git a/src/views/resource/sms.vue b/src/views/resource/sms.vue index 8792de9..22361cd 100644 --- a/src/views/resource/sms.vue +++ b/src/views/resource/sms.vue @@ -78,7 +78,7 @@ export default { selectionList: [], option: { height: 'auto', - calcHeight: 30, + calcHeight: 32, tip: false, searchShow: true, searchMenuSpan: 6, diff --git a/src/views/system/client.vue b/src/views/system/client.vue index 0700d13..4c26f2c 100644 --- a/src/views/system/client.vue +++ b/src/views/system/client.vue @@ -48,7 +48,7 @@ export default { selectionList: [], option: { height: 'auto', - calcHeight: 30, + calcHeight: 32, tip: false, searchShow: true, searchMenuSpan: 6, diff --git a/src/views/system/dept.vue b/src/views/system/dept.vue index 8b26de5..58243b0 100644 --- a/src/views/system/dept.vue +++ b/src/views/system/dept.vue @@ -316,7 +316,9 @@ export default { } if (["edit", "view"].includes(type)) { getDept(this.form.id).then(res => { - this.form = res.data.data; + this.form = Object.assign(res.data.data, { + hasChildren: this.form.hasChildren + }); }); } done(); diff --git a/src/views/system/menu.vue b/src/views/system/menu.vue index 2cea2d6..22723b7 100644 --- a/src/views/system/menu.vue +++ b/src/views/system/menu.vue @@ -382,7 +382,7 @@ export default { getMenu(this.form.id).then(res => { this.form = Object.assign(res.data.data, { hasChildren: this.form.hasChildren - }) + }); }); } done(); diff --git a/src/views/system/post.vue b/src/views/system/post.vue index dd43fda..a8e69b4 100644 --- a/src/views/system/post.vue +++ b/src/views/system/post.vue @@ -52,7 +52,7 @@ export default { selectionList: [], option: { height: 'auto', - calcHeight: 30, + calcHeight: 32, tip: false, searchShow: true, searchMenuSpan: 6, diff --git a/src/views/system/tenant.vue b/src/views/system/tenant.vue index bcc803d..dfaae0e 100644 --- a/src/views/system/tenant.vue +++ b/src/views/system/tenant.vue @@ -132,7 +132,7 @@ export default { }, option: { height: 'auto', - calcHeight: 30, + calcHeight: 32, tip: false, searchShow: true, searchMenuSpan: 6, diff --git a/src/views/system/tenantpackage.vue b/src/views/system/tenantpackage.vue index ca543f6..a220bab 100644 --- a/src/views/system/tenantpackage.vue +++ b/src/views/system/tenantpackage.vue @@ -47,7 +47,7 @@ export default { selectionList: [], option: { height: 'auto', - calcHeight: 30, + calcHeight: 32, tip: false, searchShow: true, searchMenuSpan: 6, diff --git a/src/views/system/topmenu.vue b/src/views/system/topmenu.vue index a129e9a..54a8e1d 100644 --- a/src/views/system/topmenu.vue +++ b/src/views/system/topmenu.vue @@ -97,7 +97,7 @@ export default { menuTreeObj: [], option: { height: 'auto', - calcHeight: 30, + calcHeight: 32, tip: false, searchShow: true, searchMenuSpan: 6, diff --git a/src/views/system/user.vue b/src/views/system/user.vue index 693c7da..0452196 100644 --- a/src/views/system/user.vue +++ b/src/views/system/user.vue @@ -259,7 +259,7 @@ export default { }, option: { height: 'auto', - calcHeight: 80, + calcHeight: 140, tip: false, searchShow: true, searchMenuSpan: 6, diff --git a/src/views/tool/code.vue b/src/views/tool/code.vue index 4d4047a..480175b 100644 --- a/src/views/tool/code.vue +++ b/src/views/tool/code.vue @@ -65,7 +65,7 @@ export default { }, option: { height: 'auto', - calcHeight: 30, + calcHeight: 32, dialogWidth: 900, tip: false, searchShow: true, @@ -346,12 +346,12 @@ export default { type: 'radio', dicData: [ { - label: "saber", - value: "saber" + label: "saber3", + value: "saber3" }, { - label: "element", - value: "element" + label: "element-plus", + value: "element-plus" } ], value: "saber", @@ -568,17 +568,15 @@ export default { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" - }) - .then(() => { - return build(this.ids); - }) - .then(() => { - this.onLoad(this.page); - this.$message({ - type: "success", - message: "操作成功!" + }).then(() => { + return build(this.ids).then(() => { + this.onLoad(this.page); + this.$message({ + type: "success", + message: "操作成功!" + }); + this.$refs.crud.toggleSelection(); }); - this.$refs.crud.toggleSelection(); }); }, handleCopy (row) { diff --git a/src/views/tool/datasource.vue b/src/views/tool/datasource.vue index a503f71..699b32f 100644 --- a/src/views/tool/datasource.vue +++ b/src/views/tool/datasource.vue @@ -48,7 +48,7 @@ export default { selectionList: [], option: { height: 'auto', - calcHeight: 30, + calcHeight: 32, dialogWidth: 900, tip: false, searchShow: true, diff --git a/src/views/work/claim.vue b/src/views/work/claim.vue index 8940c5f..f0e7b4d 100644 --- a/src/views/work/claim.vue +++ b/src/views/work/claim.vue @@ -65,7 +65,7 @@ export default { workBox: false, option: { height: 'auto', - calcHeight: 30, + calcHeight: 32, tip: false, simplePage: true, searchShow: true, diff --git a/src/views/work/done.vue b/src/views/work/done.vue index 7e27c84..42f8709 100644 --- a/src/views/work/done.vue +++ b/src/views/work/done.vue @@ -60,7 +60,7 @@ export default { workBox: false, option: { height: 'auto', - calcHeight: 30, + calcHeight: 32, tip: false, searchShow: true, searchMenuSpan: 6, diff --git a/src/views/work/send.vue b/src/views/work/send.vue index ef3bde6..7312d6c 100644 --- a/src/views/work/send.vue +++ b/src/views/work/send.vue @@ -63,7 +63,7 @@ export default { workBox: false, option: { height: 'auto', - calcHeight: 30, + calcHeight: 32, tip: false, searchShow: true, searchMenuSpan: 6, diff --git a/src/views/work/start.vue b/src/views/work/start.vue index f5bca82..f12b8a1 100644 --- a/src/views/work/start.vue +++ b/src/views/work/start.vue @@ -76,7 +76,7 @@ export default { workBox: false, option: { height: 'auto', - calcHeight: 30, + calcHeight: 32, tip: false, searchShow: true, searchMenuSpan: 6, diff --git a/src/views/work/todo.vue b/src/views/work/todo.vue index 0262f82..c9283b6 100644 --- a/src/views/work/todo.vue +++ b/src/views/work/todo.vue @@ -65,7 +65,7 @@ export default { workBox: false, option: { height: 'auto', - calcHeight: 30, + calcHeight: 32, tip: false, simplePage: true, searchShow: true, diff --git a/vite.config.js b/vite.config.js index d96ae46..4b8a274 100755 --- a/vite.config.js +++ b/vite.config.js @@ -11,8 +11,8 @@ export default ({ mode, command }) => { port: 1888, proxy: { '/api': { - //target: 'http://localhost', - target: 'http://test3.javablade.com', + target: 'http://localhost', + //target: 'http://test3.javablade.com', changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, '') }