From 59294ba61d30a85f91b31b53962054891dc73292 Mon Sep 17 00:00:00 2001 From: icssoa <2570063477@qq.com> Date: Fri, 12 Mar 2021 21:46:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=96=87=E4=BB=B6=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=EF=BC=8C=E5=88=A0=E9=99=A4=E7=B3=BB=E7=BB=9F=E7=9B=91?= =?UTF-8?q?=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintignore | 2 +- package.json | 4 +- .../modules/base/components/perf/common.js | 28 -- src/cool/modules/base/components/perf/ct.vue | 253 ------------- .../modules/base/components/perf/mysql.vue | 275 -------------- .../modules/base/components/perf/network.vue | 345 ------------------ .../modules/base/components/perf/redis.vue | 324 ---------------- src/cool/modules/base/service/index.js | 2 - src/cool/modules/base/service/system/info.js | 13 - src/cool/modules/base/views/perf.vue | 82 ----- src/cool/modules/demo/utils/service.js | 2 +- vue.config.js | 26 +- 12 files changed, 18 insertions(+), 1338 deletions(-) delete mode 100644 src/cool/modules/base/components/perf/common.js delete mode 100644 src/cool/modules/base/components/perf/ct.vue delete mode 100644 src/cool/modules/base/components/perf/mysql.vue delete mode 100644 src/cool/modules/base/components/perf/network.vue delete mode 100644 src/cool/modules/base/components/perf/redis.vue delete mode 100644 src/cool/modules/base/service/system/info.js delete mode 100644 src/cool/modules/base/views/perf.vue diff --git a/.eslintignore b/.eslintignore index 3300625..5384192 100644 --- a/.eslintignore +++ b/.eslintignore @@ -3,4 +3,4 @@ /node_modules/ /src/icons/svg/ /mock/ -vue.config.js \ No newline at end of file +vue.config.js diff --git a/package.json b/package.json index a428fea..c819afc 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ }, "dependencies": { "axios": "^0.21.1", - "cl-admin": "^1.3.2", - "cl-admin-crud": "^1.4.4", + "cl-admin": "^1.3.3", + "cl-admin-crud": "^1.4.5", "cl-admin-theme": "^0.0.3", "clipboard": "^2.0.7", "codemirror": "^5.59.4", diff --git a/src/cool/modules/base/components/perf/common.js b/src/cool/modules/base/components/perf/common.js deleted file mode 100644 index 2f8b7ba..0000000 --- a/src/cool/modules/base/components/perf/common.js +++ /dev/null @@ -1,28 +0,0 @@ -import VueEcharts from "vue-echarts"; - -function unit_size(v) { - if (v === 0) return "0 B"; - let k = 1024; - let sizes = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]; - let i = Math.floor(Math.log(v) / Math.log(k)); - - return (v / Math.pow(k, i)).toPrecision(3) + " " + sizes[i]; -} - -export default { - components: { - VueEcharts - }, - - filters: { - unit_size, - - fixed2(v) { - return v ? parseFloat(parseFloat(v).toFixed(2)) : 0; - } - }, - - methods: { - conByte: unit_size - } -}; diff --git a/src/cool/modules/base/components/perf/ct.vue b/src/cool/modules/base/components/perf/ct.vue deleted file mode 100644 index 3a9f6b4..0000000 --- a/src/cool/modules/base/components/perf/ct.vue +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - - diff --git a/src/cool/modules/base/components/perf/mysql.vue b/src/cool/modules/base/components/perf/mysql.vue deleted file mode 100644 index edb5635..0000000 --- a/src/cool/modules/base/components/perf/mysql.vue +++ /dev/null @@ -1,275 +0,0 @@ - - - - - diff --git a/src/cool/modules/base/components/perf/network.vue b/src/cool/modules/base/components/perf/network.vue deleted file mode 100644 index 40670ba..0000000 --- a/src/cool/modules/base/components/perf/network.vue +++ /dev/null @@ -1,345 +0,0 @@ - - - - - diff --git a/src/cool/modules/base/components/perf/redis.vue b/src/cool/modules/base/components/perf/redis.vue deleted file mode 100644 index 50e394c..0000000 --- a/src/cool/modules/base/components/perf/redis.vue +++ /dev/null @@ -1,324 +0,0 @@ - - - - - diff --git a/src/cool/modules/base/service/index.js b/src/cool/modules/base/service/index.js index 9cec05a..5082787 100644 --- a/src/cool/modules/base/service/index.js +++ b/src/cool/modules/base/service/index.js @@ -4,7 +4,6 @@ import SysUser from "./system/user"; import SysMenu from "./system/menu"; import SysRole from "./system/role"; import SysDept from "./system/dept"; -import SysInfo from "./system/info"; import SysParam from "./system/param"; import SysLog from "./system/log"; import PluginInfo from "./plugin/info"; @@ -17,7 +16,6 @@ export default { menu: new SysMenu(), role: new SysRole(), dept: new SysDept(), - info: new SysInfo(), param: new SysParam(), log: new SysLog() }, diff --git a/src/cool/modules/base/service/system/info.js b/src/cool/modules/base/service/system/info.js deleted file mode 100644 index 93e185b..0000000 --- a/src/cool/modules/base/service/system/info.js +++ /dev/null @@ -1,13 +0,0 @@ -import { BaseService, Service, Permission } from "cl-admin"; - -@Service("base/sys/info") -class SysInfo extends BaseService { - @Permission("record") - record() { - return this.request({ - url: "/record" - }); - } -} - -export default SysInfo; diff --git a/src/cool/modules/base/views/perf.vue b/src/cool/modules/base/views/perf.vue deleted file mode 100644 index fa8f4fb..0000000 --- a/src/cool/modules/base/views/perf.vue +++ /dev/null @@ -1,82 +0,0 @@ - - - - - diff --git a/src/cool/modules/demo/utils/service.js b/src/cool/modules/demo/utils/service.js index 7e473bd..89215b3 100644 --- a/src/cool/modules/demo/utils/service.js +++ b/src/cool/modules/demo/utils/service.js @@ -76,7 +76,7 @@ export const TestService = { info: d => { console.log("GET[info]", d); return new Promise(resolve => { - resolve(UserList.find(e.id == d.id)); + resolve(UserList.find(e => e.id == d.id)); }); }, add: d => { diff --git a/vue.config.js b/vue.config.js index ad11821..5c4fac3 100644 --- a/vue.config.js +++ b/vue.config.js @@ -18,7 +18,7 @@ const PROXY_LIST = { "^/pro": "/api" } } -} +}; module.exports = { publicPath: "/", @@ -50,10 +50,10 @@ module.exports = { chainWebpack: config => { // 设置环境变量 - config.plugin('define').tap(args => { - args[0]['process.env'].PROXY_LIST = JSON.stringify(PROXY_LIST) - return args - }) + config.plugin("define").tap(args => { + args[0]["process.env"].PROXY_LIST = JSON.stringify(PROXY_LIST); + return args; + }); // 设置 svg config.module.rule("svg").uses.clear(); @@ -88,26 +88,28 @@ module.exports = { // 移除 preload 插件,避免加载多余的资源 config.plugins.delete("preload-index"); - config.optimization.minimizer('terser').tap((args) => { + config.optimization.minimizer("terser").tap(args => { // 去掉注释 args[0].terserOptions.output = { comments: false }; - return args - }) + return args; + }); // 分割模块 config.optimization.splitChunks({ - chunks: 'all', + chunks: "all", maxInitialRequests: Infinity, minSize: 300000, - automaticNameDelimiter: '-', + automaticNameDelimiter: "-", cacheGroups: { vendor: { test: /[\\/]node_modules[\\/]/, name(module) { - const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1]; - return `chunk.${packageName.replace('@', '')}`; + const packageName = module.context.match( + /[\\/]node_modules[\\/](.*?)([\\/]|$)/ + )[1]; + return `chunk.${packageName.replace("@", "")}`; }, priority: 10 }