From 19d5e741ea3eba89855b931665bed163f7f25e80 Mon Sep 17 00:00:00 2001 From: icssoa <615206459@qq.com> Date: Sat, 2 Apr 2022 22:50:51 +0800 Subject: [PATCH 01/28] test 1 --- .eslintrc.js | 16 +- .vscode/crud.code-snippets | 62 +- build/cool/index.ts | 65 + build/cool/lib/eps/index.ts | 219 ++ .../cool.ts => cool/lib/menu/index.ts} | 77 +- build/{config => cool/lib/menu}/rules.ts | 4 +- build/cool/lib/modules/index.ts | 11 + build/cool/temp/eps.json | 1 + build/cool/temp/service.d.ts | 723 ++++ build/cool/utils/index.ts | 46 + build/{plugins/svg.ts => svg/index.ts} | 0 package.json | 46 +- src/App.vue | 15 +- .../images => assets}/default-avatar.png | Bin .../images/logo.png => assets/logo-text.png} | Bin src/config/env.ts | 53 - src/cool/bootstrap.ts | 48 + src/cool/config.ts | 58 + src/cool/core/index.ts | 39 - src/cool/core/module/index.ts | 198 - src/cool/core/router/index.ts | 99 - src/cool/core/service/base.ts | 104 - src/cool/core/service/decorator.ts | 44 - src/cool/core/service/index.ts | 139 - src/cool/{core => }/hook/index.ts | 36 +- src/cool/index.ts | 7 +- src/cool/module/index.ts | 161 + src/cool/modules/base/common/index.ts | 4 - src/cool/modules/base/common/resize.ts | 52 - .../modules/base/components/dept/check.vue | 178 - .../base/components/menu/slider/index.scss | 90 - .../base/components/menu/slider/index.tsx | 121 - .../modules/base/components/process/index.vue | 255 -- .../modules/base/components/role/perms.vue | 151 - .../modules/base/components/role/select.vue | 59 - .../modules/base/components/switch/index.vue | 112 - .../modules/base/directives/permission.ts | 43 - src/cool/modules/base/index.ts | 5 - src/cool/modules/base/pages/login/index.vue | 224 -- src/cool/modules/base/service/common.ts | 89 - src/cool/modules/base/service/open.ts | 56 - src/cool/modules/base/store/app.ts | 78 - src/cool/modules/base/store/menu.ts | 154 - src/cool/modules/base/store/module.ts | 30 - src/cool/modules/base/store/process.ts | 66 - src/cool/modules/base/store/user.ts | 104 - src/cool/modules/base/types/index.d.ts | 31 - src/cool/modules/base/views/log.vue | 161 - src/cool/modules/base/views/menu.vue | 398 -- src/cool/modules/base/views/param.vue | 218 -- src/cool/modules/base/views/plugin.vue | 263 -- src/cool/modules/base/views/role.vue | 171 - src/cool/modules/base/views/user.vue | 576 --- src/cool/modules/chat/components/chat.vue | 288 -- src/cool/modules/chat/components/emoji.vue | 210 - .../modules/chat/components/icon-voice.vue | 45 - src/cool/modules/chat/components/input.vue | 216 -- src/cool/modules/chat/components/message.vue | 546 --- src/cool/modules/chat/components/notice.vue | 67 - src/cool/modules/chat/components/session.vue | 316 -- src/cool/modules/chat/components/upload.vue | 120 - src/cool/modules/chat/service/message.ts | 18 - src/cool/modules/chat/service/session.ts | 16 - .../chat/static/images/custom-avatar.png | Bin 4177 -> 0 bytes src/cool/modules/chat/static/images/emoji.png | Bin 1891 -> 0 bytes src/cool/modules/chat/static/images/image.png | Bin 845 -> 0 bytes src/cool/modules/chat/static/images/video.png | Bin 724 -> 0 bytes src/cool/modules/chat/static/notify.mp3 | Bin 46051 -> 0 bytes src/cool/modules/chat/store/message.ts | 58 - src/cool/modules/chat/store/session.ts | 63 - src/cool/modules/chat/utils/index.ts | 31 - .../demo/components/crud/adv-search.vue | 54 - .../demo/components/crud/context-menu.vue | 81 - .../modules/demo/components/crud/dialog.vue | 60 - .../modules/demo/components/crud/form.vue | 316 -- .../modules/demo/components/crud/query.vue | 27 - .../demo/components/crud/render/test.vue | 19 - .../demo/components/crud/render/test2.tsx | 30 - .../modules/demo/components/crud/table.vue | 95 - .../modules/demo/components/crud/upsert.vue | 77 - .../components/demo/b-cl-context-menu.vue | 81 - .../demo/components/demo/b-cl-crud.vue | 14 - .../components/demo/b-cl-editor-quill.vue | 14 - .../demo/components/demo/b-cl-upload.vue | 41 - .../demo/components/demo/b-error-page.vue | 29 - .../demo/components/demo/b-icon-svg.vue | 26 - .../modules/demo/components/demo/b-v-copy.vue | 18 - src/cool/modules/demo/views/crud.vue | 78 - src/cool/modules/demo/views/demo.vue | 118 - src/cool/modules/demo/views/upload.vue | 81 - src/cool/modules/upload/components/index.vue | 676 ---- .../upload/components/space/category.vue | 302 -- .../upload/components/space/file-item.vue | 213 - .../modules/upload/components/space/index.vue | 505 --- src/cool/modules/upload/config.ts | 18 - src/cool/router/base.ts | 89 + src/cool/router/index.ts | 2 + src/cool/router/views.ts | 47 + src/cool/service/base.ts | 127 + src/cool/service/eps.ts | 204 + src/cool/service/index.ts | 23 + src/{ => cool}/service/request.ts | 60 +- src/cool/utils.ts | 1 - src/cool/{core => }/utils/index.ts | 208 +- src/cool/utils/module.ts | 13 + src/cool/{core => }/utils/storage.ts | 0 src/env.d.ts | 2 + src/index.vue | 343 ++ src/main.ts | 39 +- src/mock/index.ts | 3 - src/modules/base/common/index.ts | 4 + src/modules/base/common/permission.ts | 30 + src/modules/base/common/resize.ts | 12 + src/{cool => }/modules/base/common/theme.ts | 14 +- .../modules/base/components/avatar/index.vue | 13 +- .../base/components/codemirror/index.vue | 2 +- .../base/components/date/text.vue} | 4 +- .../base/components/editor-quill/index.vue | 43 +- .../base/components/icon-svg/index.vue | 0 src/modules/base/components/icon/svg.vue | 57 + .../modules/base/components/image/index.vue | 6 +- .../modules/base/components/link/index.vue | 0 .../base/components/scrollbar/index.vue | 0 src/modules/base/components/switch/index.tsx | 86 + .../copy => modules/base}/directives/copy.ts | 0 src/modules/base/directives/permission.ts | 13 + src/modules/base/index.ts | 4 + src/modules/base/pages/error-page/401.vue | 19 + .../modules/base/pages/error-page/403.vue | 2 +- .../modules/base/pages/error-page/404.vue | 2 +- .../modules/base/pages/error-page/500.vue | 2 +- .../modules/base/pages/error-page/502.vue | 2 +- .../error-page/components/error-page.vue | 25 +- .../modules/base/pages/iframe/index.vue | 0 .../base/pages/layout/components/a-menu.vue} | 25 +- .../base/pages/layout/components/process.vue | 238 ++ .../pages/layout/components/route-nav.vue} | 29 +- .../base/pages/layout/components/slider.vue | 257 ++ .../base/pages/layout/components/topbar.vue | 152 + .../base/pages/layout/components/views.vue | 42 + src/modules/base/pages/layout/index.vue | 104 + .../base/pages/login/components/captcha.vue | 36 +- src/modules/base/pages/login/index.vue | 227 ++ .../modules/base/static/css/index.scss | 0 .../modules/base/static/css/theme.scss | 4 +- src/modules/base/store/app.ts | 62 + src/modules/base/store/index.ts | 18 + src/modules/base/store/menu.ts | 188 + src/modules/base/store/process.ts | 72 + src/modules/base/store/user.ts | 103 + src/{cool => }/modules/base/utils/index.ts | 0 .../base/views/components/dept-check.vue | 145 + .../base/views/components/dept-move.tsx} | 38 +- .../base/views/components/dept-tree.vue} | 110 +- .../base/views/components/icon-check.vue} | 63 +- .../base/views/components/menu-check.vue} | 35 +- .../base/views/components/menu-create.vue} | 40 +- .../base/views/components/menu-file.vue} | 6 +- .../base/views/components/menu-perms.vue} | 38 +- .../base/views/components/role-perms.vue | 140 + src/{cool => }/modules/base/views/info.vue | 100 +- src/modules/base/views/log.vue | 136 + src/modules/base/views/menu.vue | 369 ++ src/modules/base/views/param.vue | 195 + src/modules/base/views/role.vue | 148 + src/modules/base/views/user.vue | 522 +++ src/{cool => }/modules/demo/utils/service.ts | 46 +- src/modules/demo/views/crud.vue | 270 ++ .../modules/demo/views/editor-quill.vue | 0 src/modules/demo/views/upload.vue | 58 + .../modules/excel/components/export-btn.vue | 4 +- .../modules/excel/utils/export2excel.ts | 0 src/{cool => }/modules/excel/utils/index.ts | 0 src/{cool => }/modules/index.ts | 2 +- .../modules/task/components/cron/cn.ts | 0 .../modules/task/components/cron/cron.vue | 73 +- .../modules/task/components/cron/index.tsx | 10 +- src/{cool => }/modules/task/views/task.vue | 1159 +++--- .../modules/theme/components/theme.vue | 17 +- src/modules/upload/components/index.vue | 589 +++ src/modules/upload/components/space.vue | 419 ++ .../upload/components/space/category.vue | 263 ++ .../upload/components/space/file-item.vue | 257 ++ src/modules/upload/config.ts | 15 + src/modules/upload/utils/index.ts | 19 + src/pages/layout/index.vue | 186 - src/pages/layout/slider.vue | 80 - src/pages/layout/topbar.vue | 182 - src/router/index.ts | 45 - src/shims-vue.d.ts | 59 +- src/store/index.ts | 11 - src/views/home/components/category-ratio.vue | 106 +- src/views/home/components/count-effect.vue | 5 +- src/views/home/components/count-paid.vue | 114 +- src/views/home/components/count-sales.vue | 5 +- src/views/home/components/count-views.vue | 194 +- src/views/home/components/hot-search.vue | 301 +- src/views/home/components/sales-rank.vue | 62 +- src/views/home/components/tab-chart.vue | 175 +- src/views/home/index.vue | 16 +- tsconfig.json | 11 +- vite.config.ts | 18 +- yarn.lock | 3429 ++++++++++++++--- 203 files changed, 12071 insertions(+), 12199 deletions(-) create mode 100644 build/cool/index.ts create mode 100644 build/cool/lib/eps/index.ts rename build/{plugins/cool.ts => cool/lib/menu/index.ts} (81%) rename build/{config => cool/lib/menu}/rules.ts (98%) create mode 100644 build/cool/lib/modules/index.ts create mode 100644 build/cool/temp/eps.json create mode 100644 build/cool/temp/service.d.ts create mode 100644 build/cool/utils/index.ts rename build/{plugins/svg.ts => svg/index.ts} (100%) rename src/{cool/modules/base/static/images => assets}/default-avatar.png (100%) rename src/{cool/modules/base/static/images/logo.png => assets/logo-text.png} (100%) delete mode 100644 src/config/env.ts create mode 100644 src/cool/bootstrap.ts create mode 100644 src/cool/config.ts delete mode 100644 src/cool/core/index.ts delete mode 100644 src/cool/core/module/index.ts delete mode 100644 src/cool/core/router/index.ts delete mode 100644 src/cool/core/service/base.ts delete mode 100644 src/cool/core/service/decorator.ts delete mode 100644 src/cool/core/service/index.ts rename src/cool/{core => }/hook/index.ts (53%) create mode 100644 src/cool/module/index.ts delete mode 100644 src/cool/modules/base/common/index.ts delete mode 100644 src/cool/modules/base/common/resize.ts delete mode 100644 src/cool/modules/base/components/dept/check.vue delete mode 100644 src/cool/modules/base/components/menu/slider/index.scss delete mode 100644 src/cool/modules/base/components/menu/slider/index.tsx delete mode 100644 src/cool/modules/base/components/process/index.vue delete mode 100644 src/cool/modules/base/components/role/perms.vue delete mode 100644 src/cool/modules/base/components/role/select.vue delete mode 100644 src/cool/modules/base/components/switch/index.vue delete mode 100644 src/cool/modules/base/directives/permission.ts delete mode 100644 src/cool/modules/base/index.ts delete mode 100644 src/cool/modules/base/pages/login/index.vue delete mode 100644 src/cool/modules/base/service/common.ts delete mode 100644 src/cool/modules/base/service/open.ts delete mode 100644 src/cool/modules/base/store/app.ts delete mode 100644 src/cool/modules/base/store/menu.ts delete mode 100644 src/cool/modules/base/store/module.ts delete mode 100644 src/cool/modules/base/store/process.ts delete mode 100644 src/cool/modules/base/store/user.ts delete mode 100644 src/cool/modules/base/types/index.d.ts delete mode 100644 src/cool/modules/base/views/log.vue delete mode 100644 src/cool/modules/base/views/menu.vue delete mode 100644 src/cool/modules/base/views/param.vue delete mode 100644 src/cool/modules/base/views/plugin.vue delete mode 100644 src/cool/modules/base/views/role.vue delete mode 100644 src/cool/modules/base/views/user.vue delete mode 100644 src/cool/modules/chat/components/chat.vue delete mode 100644 src/cool/modules/chat/components/emoji.vue delete mode 100644 src/cool/modules/chat/components/icon-voice.vue delete mode 100644 src/cool/modules/chat/components/input.vue delete mode 100644 src/cool/modules/chat/components/message.vue delete mode 100644 src/cool/modules/chat/components/notice.vue delete mode 100644 src/cool/modules/chat/components/session.vue delete mode 100644 src/cool/modules/chat/components/upload.vue delete mode 100644 src/cool/modules/chat/service/message.ts delete mode 100644 src/cool/modules/chat/service/session.ts delete mode 100644 src/cool/modules/chat/static/images/custom-avatar.png delete mode 100644 src/cool/modules/chat/static/images/emoji.png delete mode 100644 src/cool/modules/chat/static/images/image.png delete mode 100644 src/cool/modules/chat/static/images/video.png delete mode 100644 src/cool/modules/chat/static/notify.mp3 delete mode 100644 src/cool/modules/chat/store/message.ts delete mode 100644 src/cool/modules/chat/store/session.ts delete mode 100644 src/cool/modules/chat/utils/index.ts delete mode 100644 src/cool/modules/demo/components/crud/adv-search.vue delete mode 100644 src/cool/modules/demo/components/crud/context-menu.vue delete mode 100644 src/cool/modules/demo/components/crud/dialog.vue delete mode 100644 src/cool/modules/demo/components/crud/form.vue delete mode 100644 src/cool/modules/demo/components/crud/query.vue delete mode 100644 src/cool/modules/demo/components/crud/render/test.vue delete mode 100644 src/cool/modules/demo/components/crud/render/test2.tsx delete mode 100644 src/cool/modules/demo/components/crud/table.vue delete mode 100644 src/cool/modules/demo/components/crud/upsert.vue delete mode 100644 src/cool/modules/demo/components/demo/b-cl-context-menu.vue delete mode 100644 src/cool/modules/demo/components/demo/b-cl-crud.vue delete mode 100644 src/cool/modules/demo/components/demo/b-cl-editor-quill.vue delete mode 100644 src/cool/modules/demo/components/demo/b-cl-upload.vue delete mode 100644 src/cool/modules/demo/components/demo/b-error-page.vue delete mode 100644 src/cool/modules/demo/components/demo/b-icon-svg.vue delete mode 100644 src/cool/modules/demo/components/demo/b-v-copy.vue delete mode 100644 src/cool/modules/demo/views/crud.vue delete mode 100644 src/cool/modules/demo/views/demo.vue delete mode 100644 src/cool/modules/demo/views/upload.vue delete mode 100644 src/cool/modules/upload/components/index.vue delete mode 100644 src/cool/modules/upload/components/space/category.vue delete mode 100644 src/cool/modules/upload/components/space/file-item.vue delete mode 100644 src/cool/modules/upload/components/space/index.vue delete mode 100644 src/cool/modules/upload/config.ts create mode 100644 src/cool/router/base.ts create mode 100644 src/cool/router/index.ts create mode 100644 src/cool/router/views.ts create mode 100644 src/cool/service/base.ts create mode 100644 src/cool/service/eps.ts create mode 100644 src/cool/service/index.ts rename src/{ => cool}/service/request.ts (75%) delete mode 100644 src/cool/utils.ts rename src/cool/{core => }/utils/index.ts (56%) create mode 100644 src/cool/utils/module.ts rename src/cool/{core => }/utils/storage.ts (100%) create mode 100644 src/env.d.ts create mode 100644 src/index.vue create mode 100644 src/modules/base/common/index.ts create mode 100644 src/modules/base/common/permission.ts create mode 100644 src/modules/base/common/resize.ts rename src/{cool => }/modules/base/common/theme.ts (75%) rename src/{cool => }/modules/base/components/avatar/index.vue (88%) rename src/{cool => }/modules/base/components/codemirror/index.vue (97%) rename src/{cool/modules/base/components/date/index.vue => modules/base/components/date/text.vue} (86%) rename src/{cool => }/modules/base/components/editor-quill/index.vue (90%) rename src/{cool => }/modules/base/components/icon-svg/index.vue (100%) create mode 100644 src/modules/base/components/icon/svg.vue rename src/{cool => }/modules/base/components/image/index.vue (95%) rename src/{cool => }/modules/base/components/link/index.vue (100%) rename src/{cool => }/modules/base/components/scrollbar/index.vue (100%) create mode 100644 src/modules/base/components/switch/index.tsx rename src/{cool/modules/copy => modules/base}/directives/copy.ts (100%) create mode 100644 src/modules/base/directives/permission.ts create mode 100644 src/modules/base/index.ts create mode 100644 src/modules/base/pages/error-page/401.vue rename src/{cool => }/modules/base/pages/error-page/403.vue (92%) rename src/{cool => }/modules/base/pages/error-page/404.vue (92%) rename src/{cool => }/modules/base/pages/error-page/500.vue (92%) rename src/{cool => }/modules/base/pages/error-page/502.vue (92%) rename src/{cool => }/modules/base/pages/error-page/components/error-page.vue (80%) rename src/{cool => }/modules/base/pages/iframe/index.vue (100%) rename src/{cool/modules/base/components/menu/topbar.vue => modules/base/pages/layout/components/a-menu.vue} (76%) create mode 100644 src/modules/base/pages/layout/components/process.vue rename src/{cool/modules/base/components/route-nav/index.vue => modules/base/pages/layout/components/route-nav.vue} (77%) create mode 100644 src/modules/base/pages/layout/components/slider.vue create mode 100644 src/modules/base/pages/layout/components/topbar.vue create mode 100644 src/modules/base/pages/layout/components/views.vue create mode 100644 src/modules/base/pages/layout/index.vue rename src/{cool => }/modules/base/pages/login/components/captcha.vue (64%) create mode 100644 src/modules/base/pages/login/index.vue rename src/{cool => }/modules/base/static/css/index.scss (100%) rename src/{cool => }/modules/base/static/css/theme.scss (94%) create mode 100644 src/modules/base/store/app.ts create mode 100644 src/modules/base/store/index.ts create mode 100644 src/modules/base/store/menu.ts create mode 100644 src/modules/base/store/process.ts create mode 100644 src/modules/base/store/user.ts rename src/{cool => }/modules/base/utils/index.ts (100%) create mode 100644 src/modules/base/views/components/dept-check.vue rename src/{cool/modules/base/components/dept/move.tsx => modules/base/views/components/dept-move.tsx} (76%) rename src/{cool/modules/base/components/dept/tree.vue => modules/base/views/components/dept-tree.vue} (76%) rename src/{cool/modules/base/components/menu/icons.vue => modules/base/views/components/icon-check.vue} (56%) rename src/{cool/modules/base/components/menu/tree.vue => modules/base/views/components/menu-check.vue} (80%) rename src/{cool/modules/base/components/menu/quick.vue => modules/base/views/components/menu-create.vue} (86%) rename src/{cool/modules/base/components/menu/file.vue => modules/base/views/components/menu-file.vue} (94%) rename src/{cool/modules/base/components/menu/perms.vue => modules/base/views/components/menu-perms.vue} (75%) create mode 100644 src/modules/base/views/components/role-perms.vue rename src/{cool => }/modules/base/views/info.vue (52%) create mode 100644 src/modules/base/views/log.vue create mode 100644 src/modules/base/views/menu.vue create mode 100644 src/modules/base/views/param.vue create mode 100644 src/modules/base/views/role.vue create mode 100644 src/modules/base/views/user.vue rename src/{cool => }/modules/demo/utils/service.ts (78%) create mode 100644 src/modules/demo/views/crud.vue rename src/{cool => }/modules/demo/views/editor-quill.vue (100%) create mode 100644 src/modules/demo/views/upload.vue rename src/{cool => }/modules/excel/components/export-btn.vue (98%) rename src/{cool => }/modules/excel/utils/export2excel.ts (100%) rename src/{cool => }/modules/excel/utils/index.ts (100%) rename src/{cool => }/modules/index.ts (90%) rename src/{cool => }/modules/task/components/cron/cn.ts (100%) rename src/{cool => }/modules/task/components/cron/cron.vue (93%) rename src/{cool => }/modules/task/components/cron/index.tsx (91%) rename src/{cool => }/modules/task/views/task.vue (50%) rename src/{cool => }/modules/theme/components/theme.vue (93%) create mode 100644 src/modules/upload/components/index.vue create mode 100644 src/modules/upload/components/space.vue create mode 100644 src/modules/upload/components/space/category.vue create mode 100644 src/modules/upload/components/space/file-item.vue create mode 100644 src/modules/upload/config.ts create mode 100644 src/modules/upload/utils/index.ts delete mode 100644 src/pages/layout/index.vue delete mode 100644 src/pages/layout/slider.vue delete mode 100644 src/pages/layout/topbar.vue delete mode 100644 src/router/index.ts delete mode 100644 src/store/index.ts diff --git a/.eslintrc.js b/.eslintrc.js index df549f7..783015b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -58,19 +58,7 @@ module.exports = { "vue/multiline-html-element-content-newline": "off", "vue/singleline-html-element-content-newline": "off", "vue/attribute-hyphenation": "off", - // "vue/html-self-closing": "off", - "vue/require-default-prop": "off", - "vue/html-self-closing": [ - "error", - { - html: { - void: "always", - normal: "never", - component: "always" - }, - svg: "always", - math: "always" - } - ] + "vue/html-self-closing": "off", + "vue/require-default-prop": "off" } }; diff --git a/.vscode/crud.code-snippets b/.vscode/crud.code-snippets index 9bf91e3..55de878 100644 --- a/.vscode/crud.code-snippets +++ b/.vscode/crud.code-snippets @@ -3,8 +3,8 @@ "prefix": "cl-crud-ts", "body": [ "", - " ", - " ", + " ", + " ", " ", " ", " ", @@ -18,55 +18,47 @@ "", " ", " ", - " ", + " ", " ", "", - " ", + " ", " ", " ", " ", " ", "", " ", - " ", + " ", " ", "", "", - "", "" ], diff --git a/build/cool/index.ts b/build/cool/index.ts new file mode 100644 index 0000000..ce29a7a --- /dev/null +++ b/build/cool/index.ts @@ -0,0 +1,65 @@ +import { Plugin } from "vite"; +import { parseJson } from "./utils"; +import { getModules } from "./lib/modules"; +import { createEps, getEps } from "./lib/eps"; +import { createMenu } from "./lib/menu"; + +export const cool = (): Plugin | null => { + return { + name: "vite-cool", + configureServer(server) { + server.middlewares.use(async (req, res, next) => { + function done(data: any) { + res.writeHead(200, { "Content-Type": "text/html;charset=UTF-8" }); + res.end(JSON.stringify(data)); + } + + // 自定义 + if (req.url.includes("__cool")) { + const body = await parseJson(req); + let next: any = null; + + switch (req.url) { + // 快速创建菜单 + case "/__cool_createMenu": + next = createMenu(body); + break; + + // 获取模块列表 + case "/__cool_modules": + next = getModules(); + break; + + // 创建描述文件 + case "/__cool_eps": + next = createEps(body); + break; + } + + if (next) { + next.then((data: any) => { + done({ + code: 1000, + data + }); + }).catch((message: string) => { + done({ + code: 1001, + message + }); + }); + } + } else { + next(); + } + }); + }, + config() { + return { + define: { + __EPS__: getEps() + } + }; + } + }; +}; diff --git a/build/cool/lib/eps/index.ts b/build/cool/lib/eps/index.ts new file mode 100644 index 0000000..9d995f9 --- /dev/null +++ b/build/cool/lib/eps/index.ts @@ -0,0 +1,219 @@ +import prettier from "prettier"; +import { isEmpty, last } from "lodash"; +import { createDir, firstUpperCase, readFile, toCamel } from "../../utils"; +import { createWriteStream } from "fs"; +import { join } from "path"; + +// 临时目录路径 +const tempPath = join(__dirname, "../../temp"); + +// 创建描述文件 +export async function createEps({ list, service }: any) { + const t0 = [ + [ + ` + declare interface Crud { + /** + * 新增 + * @returns Promise + */ + add(data: any): Promise; + /** + * 删除 + * @returns Promise + */ + delete(data: { ids?: number[] | string[]; [key: string]: any }): Promise; + /** + * 修改 + * @returns Promise + */ + update(data: { id?: number | string; [key: string]: any }): Promise; + /** + * 详情 + * @returns Promise + */ + info(data: { id?: number | string; [key: string]: any }): Promise; + /** + * 全部 + * @returns Promise + */ + list(data?: any): Promise; + /** + * 分页 + * @returns Promise + */ + page(data?: { page?: number | string; size?: number | string; [key: string]: any }): Promise; + } + `, + + ` + declare interface PageResponse { + list: any[]; + pagination: { size: number; page: number; total: number }; + [key: string]: any; + } + `, + + ` + declare interface RequestOptions { + params?: any; + data?: any; + url: string; + method?: "GET" | "get" | "POST" | "post" | string; + [key: string]: any; + } + ` + ] + ]; + + const t1 = [`declare type Service = {`, `request(data: RequestOptions): Promise;`]; + + // 处理数据 + function deep(d: any, k?: string) { + if (!k) k = ""; + + for (const i in d) { + const name = k + toCamel(firstUpperCase(i.replace(/[:]/g, ""))); + + if (d[i].namespace) { + // 查找配置 + const item = list.find((e: any) => (e.prefix || "").includes(d[i].namespace)); + + if (item) { + const t = [ + `declare interface ${name} ${item.extendCrud ? " extends Crud" : ""} {` + ]; + + t1.push(`${i}: ${name};`); + + // 插入方法 + if (item.api) { + // 权限列表 + const permission: string[] = []; + + item.api.forEach((a: any) => { + // 方法名 + const n = toCamel(a.name || last(a.path.split("/"))).replace( + /[:\/-]/g, + "" + ); + + if (n) { + // 参数类型 + let q: string[] = []; + + // 参数列表 + const { parameters = [] } = a.dts || {}; + + parameters.forEach((p: any) => { + if (p.description) { + q.push(`\n/** ${p.description} */\n`); + } + + if (p.name.includes(":")) { + return false; + } + + const a = `${p.name}${p.required ? "" : "?"}`; + const b = `${p.schema.type || "string"}`; + + q.push(`${a}: ${b},`); + }); + + if (isEmpty(q)) { + q = ["any"]; + } else { + q.unshift("{"); + q.push("}"); + } + + // 返回类型 + let res = ""; + + switch (a.path) { + case "/page": + res = "PageResponse"; + break; + default: + res = "any"; + break; + } + + // 描述 + t.push("\n"); + t.push("/**\n"); + t.push(` * ${a.summary || n}\n`); + t.push(` * @returns Promise<${res}>\n`); + t.push(" */\n"); + + t.push( + `${n}(data${q.length == 1 ? "?" : ""}: ${q.join( + "" + )}): Promise<${res}>;` + ); + } + + permission.push(`${n}: string;`); + }); + + // 添加权限 + t.push("\n"); + t.push("/**\n"); + t.push(" * 权限\n"); + t.push(" */\n"); + t.push(`permission: { ${permission.join("\n")} }`); + } + + t.push("}"); + t0.push(t); + } + } else { + t1.push(`${i}: {`); + deep(d[i], name); + t1.push(`},`); + } + } + } + + deep(service); + t1.push("}"); + + // 追加 + t0.push(t1); + + // 文本内容 + const content = prettier.format(t0.map((e) => e.join("")).join("\n\n"), { + parser: "typescript", + useTabs: true, + tabWidth: 4, + endOfLine: "lf", + semi: true, + singleQuote: false, + printWidth: 100, + trailingComma: "none" + }); + + // 创建 temp 目录 + createDir(tempPath); + + // 创建 service 描述文件 + createWriteStream(join(tempPath, "service.d.ts"), { + flags: "w" + }).write(content); + + // 创建 eps 文件 + createWriteStream(join(tempPath, "eps.json"), { + flags: "w" + }).write( + JSON.stringify( + list.map((e: any) => { + return [e.prefix, e.api.map((a: any) => [a.method || "", a.path, a.name || ""])]; + }) + ) + ); +} + +// 获取描述 +export function getEps() { + return JSON.stringify(readFile(join(tempPath, "eps.json"))); +} diff --git a/build/plugins/cool.ts b/build/cool/lib/menu/index.ts similarity index 81% rename from build/plugins/cool.ts rename to build/cool/lib/menu/index.ts index 5efc6df..07eefa0 100644 --- a/build/plugins/cool.ts +++ b/build/cool/lib/menu/index.ts @@ -1,12 +1,9 @@ -import { Plugin } from "vite"; +import { createWriteStream } from "fs"; import prettier from "prettier"; -import fs from "fs"; -import path from "path"; +import { join } from "path"; +import { createDir } from "../../utils"; +import rules from "./rules"; import { isFunction, isRegExp, isString } from "lodash"; -import rules from "../config/rules"; - -// 根路径 -const coolPath = path.join(__dirname, `../../src/cool`); // 格式化 function format(data: any) { @@ -107,23 +104,6 @@ const handler = { } }; -// 解析body -function parseJson(req: any) { - return new Promise((resolve, reject) => { - let d = ""; - req.on("data", function (chunk: Buffer) { - d += chunk; - }); - req.on("end", function () { - try { - resolve(JSON.parse(d)); - } catch (e) { - reject(e); - } - }); - }); -} - // 创建组件 function createComponent(item: any) { const { propertyName: prop, comment: label } = item; @@ -218,7 +198,7 @@ function datetimeMerge({ columns, item }: any) { } // 创建文件 -function createVue({ router, columns, prefix, api, module, filename }: any): void { +export async function createMenu({ router, columns, prefix, api, module, filename }: any): void { const upsert: any = { items: [] }; @@ -352,7 +332,7 @@ export default defineComponent({ : "" } - // 表格配置 + // cl-table 配置 const table = reactive(${JSON.stringify(table)}); // crud 加载 @@ -385,48 +365,13 @@ export default defineComponent({ }); // views 目录是否存在 - const dir = path.join(coolPath, `modules/${module}/views`); - if (!fs.existsSync(dir)) fs.mkdirSync(dir); + const dir = join(__dirname, `../../src/modules/${module}/views`); + + // 创建目录 + createDir(dir); // 创建文件 - fs.createWriteStream(path.join(dir, `${filename}.vue`), { + createWriteStream(join(dir, `${filename}.vue`), { flags: "w" }).write(content); } - -export const cool = (): Plugin | null => { - return { - name: "vite-cool", - configureServer(server) { - server.middlewares.use(async (req, res, next) => { - function done(data) { - res.writeHead(200, { "Content-Type": "text/html;charset=UTF-8" }); - res.end(JSON.stringify(data)); - } - - if (req.url.includes("/__cool_createMenu")) { - try { - const body: any = await parseJson(req); - await createVue(body); - done({ - code: 1000 - }); - } catch (e) { - done({ - code: 1001, - message: e.message - }); - } - } else if (req.url.includes("/__cool_modules")) { - const dirs = fs.readdirSync(path.join(coolPath, "modules")); - done({ - code: 1000, - data: dirs.filter((e) => !e.includes(".")) - }); - } else { - next(); - } - }); - } - }; -}; diff --git a/build/config/rules.ts b/build/cool/lib/menu/rules.ts similarity index 98% rename from build/config/rules.ts rename to build/cool/lib/menu/rules.ts index 47fedaf..0541686 100644 --- a/build/config/rules.ts +++ b/build/cool/lib/menu/rules.ts @@ -73,7 +73,7 @@ export default [ { test: ["date"], table: { - name: "cl-date", + name: "cl-date-text", props: { format: "YYYY-MM-DD" } @@ -89,7 +89,7 @@ export default [ { test: ["dates", "dateRange", "dateScope"], table: { - name: "cl-date", + name: "cl-date-text", props: { format: "YYYY-MM-DD" } diff --git a/build/cool/lib/modules/index.ts b/build/cool/lib/modules/index.ts new file mode 100644 index 0000000..b01d447 --- /dev/null +++ b/build/cool/lib/modules/index.ts @@ -0,0 +1,11 @@ +import fs from "fs"; +import { join } from "path"; + +export function getModules() { + try { + const dirs = fs.readdirSync(join(__dirname, "../../src/modules")); + return Promise.resolve(dirs.filter((e) => !e.includes("."))); + } catch (e) {} + + return ""; +} diff --git a/build/cool/temp/eps.json b/build/cool/temp/eps.json new file mode 100644 index 0000000..5c3df59 --- /dev/null +++ b/build/cool/temp/eps.json @@ -0,0 +1 @@ +[["/admin/base/comm",[["post","/personUpdate",""],["get","/uploadMode",""],["get","/permmenu",""],["get","/person",""],["post","/upload",""],["post","/logout",""],["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/base/open",[["get","/refreshToken",""],["get","/captcha",""],["post","/login",""],["get","/html",""],["get","/eps",""],["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/base/sys/department",[["post","/delete",""],["post","/update",""],["post","/order",""],["post","/list",""],["post","/add",""],["","/page",""],["","/info",""]]],["/admin/base/sys/log",[["post","/setKeep",""],["get","/getKeep",""],["post","/clear",""],["post","/page",""],["","/list",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/base/sys/menu",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/base/sys/param",[["post","/delete",""],["post","/update",""],["get","/html",""],["get","/info",""],["post","/page",""],["post","/add",""],["","/list",""]]],["/admin/base/sys/role",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/base/sys/user",[["post","/delete",""],["post","/update",""],["post","/move",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/demo/goods",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/page",""],["post","/list",""],["post","/add",""]]],["/admin/space/info",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/space/type",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/task/info",[["post","/delete",""],["post","/update",""],["post","/start",""],["post","/once",""],["post","/stop",""],["get","/info",""],["post","/page",""],["get","/log",""],["post","/add",""],["","/list",""]]]] \ No newline at end of file diff --git a/build/cool/temp/service.d.ts b/build/cool/temp/service.d.ts new file mode 100644 index 0000000..b690274 --- /dev/null +++ b/build/cool/temp/service.d.ts @@ -0,0 +1,723 @@ +declare interface Crud { + /** + * 新增 + * @returns Promise + */ + add(data: any): Promise; + /** + * 删除 + * @returns Promise + */ + delete(data: { ids?: number[] | string[]; [key: string]: any }): Promise; + /** + * 修改 + * @returns Promise + */ + update(data: { id?: number | string; [key: string]: any }): Promise; + /** + * 详情 + * @returns Promise + */ + info(data: { id?: number | string; [key: string]: any }): Promise; + /** + * 全部 + * @returns Promise + */ + list(data?: any): Promise; + /** + * 分页 + * @returns Promise + */ + page(data?: { + page?: number | string; + size?: number | string; + [key: string]: any; + }): Promise; +} + +declare interface PageResponse { + list: any[]; + pagination: { size: number; page: number; total: number }; + [key: string]: any; +} + +declare interface RequestOptions { + params?: any; + data?: any; + url: string; + method?: "GET" | "get" | "POST" | "post" | string; + [key: string]: any; +} + +declare interface BaseComm { + /** + * 修改个人信息 + * @returns Promise + */ + personUpdate(data?: any): Promise; + /** + * 文件上传模式 + * @returns Promise + */ + uploadMode(data?: any): Promise; + /** + * 权限与菜单 + * @returns Promise + */ + permmenu(data?: any): Promise; + /** + * 个人信息 + * @returns Promise + */ + person(data?: any): Promise; + /** + * 文件上传 + * @returns Promise + */ + upload(data?: any): Promise; + /** + * 退出 + * @returns Promise + */ + logout(data?: any): Promise; + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + personUpdate: string; + uploadMode: string; + permmenu: string; + person: string; + upload: string; + logout: string; + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + }; +} + +declare interface BaseOpen { + /** + * 刷新token + * @returns Promise + */ + refreshToken(data?: any): Promise; + /** + * 验证码 + * @returns Promise + */ + captcha(data?: any): Promise; + /** + * 登录 + * @returns Promise + */ + login(data?: any): Promise; + /** + * 获得网页内容的参数值 + * @returns Promise + */ + html(data?: any): Promise; + /** + * 实体信息与路径 + * @returns Promise + */ + eps(data?: any): Promise; + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + refreshToken: string; + captcha: string; + login: string; + html: string; + eps: string; + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + }; +} + +declare interface BaseSysDepartment { + /** + * 删除 + * @returns Promise + */ + delete(data?: any): Promise; + /** + * 修改 + * @returns Promise + */ + update(data?: any): Promise; + /** + * 排序 + * @returns Promise + */ + order(data?: any): Promise; + /** + * 列表查询 + * @returns Promise + */ + list(data?: any): Promise; + /** + * 新增 + * @returns Promise + */ + add(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * 权限 + */ + permission: { + delete: string; + update: string; + order: string; + list: string; + add: string; + page: string; + info: string; + }; +} + +declare interface BaseSysLog { + /** + * 日志保存时间 + * @returns Promise + */ + setKeep(data?: any): Promise; + /** + * 获得日志保存时间 + * @returns Promise + */ + getKeep(data?: any): Promise; + /** + * 清理 + * @returns Promise + */ + clear(data?: any): Promise; + /** + * 分页查询 + * @returns Promise + */ + page(data?: any): Promise; + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + setKeep: string; + getKeep: string; + clear: string; + page: string; + list: string; + info: string; + update: string; + delete: string; + add: string; + }; +} + +declare interface BaseSysMenu { + /** + * 删除 + * @returns Promise + */ + delete(data?: any): Promise; + /** + * 修改 + * @returns Promise + */ + update(data?: any): Promise; + /** + * 单个信息 + * @returns Promise + */ + info(data?: any): Promise; + /** + * 列表查询 + * @returns Promise + */ + list(data?: any): Promise; + /** + * 分页查询 + * @returns Promise + */ + page(data?: any): Promise; + /** + * 新增 + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + delete: string; + update: string; + info: string; + list: string; + page: string; + add: string; + }; +} + +declare interface BaseSysParam { + /** + * 删除 + * @returns Promise + */ + delete(data?: any): Promise; + /** + * 修改 + * @returns Promise + */ + update(data?: any): Promise; + /** + * 获得网页内容的参数值 + * @returns Promise + */ + html(data?: any): Promise; + /** + * 单个信息 + * @returns Promise + */ + info(data?: any): Promise; + /** + * 分页查询 + * @returns Promise + */ + page(data?: any): Promise; + /** + * 新增 + * @returns Promise + */ + add(data?: any): Promise; + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * 权限 + */ + permission: { + delete: string; + update: string; + html: string; + info: string; + page: string; + add: string; + list: string; + }; +} + +declare interface BaseSysRole { + /** + * 删除 + * @returns Promise + */ + delete(data?: any): Promise; + /** + * 修改 + * @returns Promise + */ + update(data?: any): Promise; + /** + * 单个信息 + * @returns Promise + */ + info(data?: any): Promise; + /** + * 列表查询 + * @returns Promise + */ + list(data?: any): Promise; + /** + * 分页查询 + * @returns Promise + */ + page(data?: any): Promise; + /** + * 新增 + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + delete: string; + update: string; + info: string; + list: string; + page: string; + add: string; + }; +} + +declare interface BaseSysUser { + /** + * 删除 + * @returns Promise + */ + delete(data?: any): Promise; + /** + * 修改 + * @returns Promise + */ + update(data?: any): Promise; + /** + * 移动部门 + * @returns Promise + */ + move(data?: any): Promise; + /** + * 单个信息 + * @returns Promise + */ + info(data?: any): Promise; + /** + * 列表查询 + * @returns Promise + */ + list(data?: any): Promise; + /** + * 分页查询 + * @returns Promise + */ + page(data?: any): Promise; + /** + * 新增 + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + delete: string; + update: string; + move: string; + info: string; + list: string; + page: string; + add: string; + }; +} + +declare interface DemoGoods { + /** + * 删除 + * @returns Promise + */ + delete(data?: any): Promise; + /** + * 修改 + * @returns Promise + */ + update(data?: any): Promise; + /** + * 单个信息 + * @returns Promise + */ + info(data?: any): Promise; + /** + * 分页查询 + * @returns Promise + */ + page(data?: any): Promise; + /** + * 列表查询 + * @returns Promise + */ + list(data?: any): Promise; + /** + * 新增 + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + delete: string; + update: string; + info: string; + page: string; + list: string; + add: string; + }; +} + +declare interface SpaceInfo { + /** + * 删除 + * @returns Promise + */ + delete(data?: any): Promise; + /** + * 修改 + * @returns Promise + */ + update(data?: any): Promise; + /** + * 单个信息 + * @returns Promise + */ + info(data?: any): Promise; + /** + * 列表查询 + * @returns Promise + */ + list(data?: any): Promise; + /** + * 分页查询 + * @returns Promise + */ + page(data?: any): Promise; + /** + * 新增 + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + delete: string; + update: string; + info: string; + list: string; + page: string; + add: string; + }; +} + +declare interface SpaceType { + /** + * 删除 + * @returns Promise + */ + delete(data?: any): Promise; + /** + * 修改 + * @returns Promise + */ + update(data?: any): Promise; + /** + * 单个信息 + * @returns Promise + */ + info(data?: any): Promise; + /** + * 列表查询 + * @returns Promise + */ + list(data?: any): Promise; + /** + * 分页查询 + * @returns Promise + */ + page(data?: any): Promise; + /** + * 新增 + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + delete: string; + update: string; + info: string; + list: string; + page: string; + add: string; + }; +} + +declare interface TaskInfo { + /** + * 删除 + * @returns Promise + */ + delete(data?: any): Promise; + /** + * 修改 + * @returns Promise + */ + update(data?: any): Promise; + /** + * 开始 + * @returns Promise + */ + start(data?: any): Promise; + /** + * 执行一次 + * @returns Promise + */ + once(data?: any): Promise; + /** + * 停止 + * @returns Promise + */ + stop(data?: any): Promise; + /** + * 单个信息 + * @returns Promise + */ + info(data?: any): Promise; + /** + * 分页查询 + * @returns Promise + */ + page(data?: any): Promise; + /** + * 日志 + * @returns Promise + */ + log(data?: any): Promise; + /** + * 新增 + * @returns Promise + */ + add(data?: any): Promise; + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * 权限 + */ + permission: { + delete: string; + update: string; + start: string; + once: string; + stop: string; + info: string; + page: string; + log: string; + add: string; + list: string; + }; +} + +declare type Service = { + request(data: RequestOptions): Promise; + base: { + comm: BaseComm; + open: BaseOpen; + sys: { + department: BaseSysDepartment; + log: BaseSysLog; + menu: BaseSysMenu; + param: BaseSysParam; + role: BaseSysRole; + user: BaseSysUser; + }; + }; + demo: { goods: DemoGoods }; + space: { info: SpaceInfo; type: SpaceType }; + task: { info: TaskInfo }; +}; diff --git a/build/cool/utils/index.ts b/build/cool/utils/index.ts new file mode 100644 index 0000000..9c1184e --- /dev/null +++ b/build/cool/utils/index.ts @@ -0,0 +1,46 @@ +import fs from "fs"; + +// 首字母大写 +export function firstUpperCase(value: string): string { + return value.replace(/\b(\w)(\w*)/g, function ($0, $1, $2) { + return $1.toUpperCase() + $2; + }); +} + +// 横杠转驼峰 +export function toCamel(str: string): string { + return str.replace(/([^-])(?:-+([^-]))/g, function ($0, $1, $2) { + return $1 + $2.toUpperCase(); + }); +} + +// 创建目录 +export function createDir(path: string) { + if (!fs.existsSync(path)) fs.mkdirSync(path); +} + +// 读取文件 +export function readFile(name: string) { + try { + return fs.readFileSync(name, "utf8"); + } catch (e) {} + + return ""; +} + +// 解析body +export function parseJson(req: any) { + return new Promise((resolve) => { + let d = ""; + req.on("data", function (chunk: Buffer) { + d += chunk; + }); + req.on("end", function () { + try { + resolve(JSON.parse(d)); + } catch { + resolve({}); + } + }); + }); +} diff --git a/build/plugins/svg.ts b/build/svg/index.ts similarity index 100% rename from build/plugins/svg.ts rename to build/svg/index.ts diff --git a/package.json b/package.json index 155d3a7..77aa0d1 100644 --- a/package.json +++ b/package.json @@ -10,51 +10,57 @@ }, "dependencies": { "@cool-vue/crud": "^1.0.6", - "array.prototype.flat": "^1.2.4", - "axios": "^0.21.1", - "clipboard": "^2.0.8", + "@element-plus/icons-vue": "^1.1.3", + "@types/quill": "^2.0.9", + "axios": "^0.26.1", + "clipboard": "^2.0.10", "codemirror": "^5.62.0", "core-js": "^3.6.5", "echarts": "^5.0.2", - "element-plus": "^1.1.0-beta.20", + "element-plus": "^2.1.7", "file-saver": "^2.0.5", "js-beautify": "^1.13.5", - "mitt": "^2.1.0", + "lodash": "^4.17.21", + "mitt": "^3.0.0", "mockjs": "^1.1.0", "nprogress": "^0.2.0", + "pinia": "^2.0.12", "quill": "^1.3.7", - "socket.io-client": "^4.1.2", "store": "^2.0.12", "uuid": "^8.3.2", - "vue": "^3.2.20", - "vue-echarts": "^6.0.0-rc.3", - "vue-router": "^4.0.5", - "vuedraggable": "^4.0.1", - "vuex": "^4.0.0-0", + "vue": "^3.2.31", + "vue-echarts": "^6.0.2", + "vue-router": "^4.0.14", + "vuedraggable": "^4.1.0", "xlsx": "^0.16.9" }, "devDependencies": { "@types/lodash": "^4.14.168", "@types/node": "^16.10.2", + "@types/nprogress": "^0.2.0", + "@types/uuid": "^8.3.4", "@typescript-eslint/eslint-plugin": "^4.20.0", "@typescript-eslint/parser": "^4.20.0", - "@vitejs/plugin-vue": "1.9.2", - "@vitejs/plugin-vue-jsx": "^1.1.6", - "@vue/compiler-sfc": "3.2.19", + "@vitejs/plugin-vue": "^2.2.4", + "@vitejs/plugin-vue-jsx": "^1.3.8", + "@vue/cli-plugin-babel": "^5.0.1", + "@vue/cli-plugin-typescript": "^5.0.1", + "@vue/compiler-sfc": "^3.2.31", "@vue/composition-api": "^1.0.0-rc.13", "eslint": "^7.23.0", "eslint-config-prettier": "^8.1.0", "eslint-plugin-prettier": "^3.3.1", "eslint-plugin-vue": "^7.13.0", "iconv-lite": "^0.6.3", - "prettier": "^2.2.1", - "sass": "^1.42.1", + "prettier": "^2.4.1", + "sass": "^1.49.9", "sass-loader": "^11.1.1", "svg-sprite-loader": "^6.0.2", - "typescript": "4.4.3", - "unplugin-vue-components": "0.15.4", - "vite": "2.6.7", - "vite-plugin-compression": "^0.3.5", + "typescript": "^4.6.2", + "unplugin-vue-components": "^0.17.21", + "vite": "^2.8.6", + "vite-plugin-compression": "^0.5.1", + "vite-plugin-dts": "^0.9.9", "vite-plugin-mock": "^2.9.6", "vite-plugin-style-import": "^1.0.1", "vite-svg-loader": "^2.1.0" diff --git a/src/App.vue b/src/App.vue index acb0447..64a5fb3 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,15 +1,15 @@ - + - {{ app.name }} + {{ app.info.name }} 正在加载菜单... 初次加载资源可能需要较多时间 请耐心等待 @@ -18,10 +18,10 @@ - - diff --git a/src/cool/modules/base/components/menu/slider/index.scss b/src/cool/modules/base/components/menu/slider/index.scss deleted file mode 100644 index c025100..0000000 --- a/src/cool/modules/base/components/menu/slider/index.scss +++ /dev/null @@ -1,90 +0,0 @@ -.cl-slider-menu { - height: 100%; - overflow-y: auto; - - &::-webkit-scrollbar { - width: 0; - height: 0; - } - - .el-menu { - border-right: 0; - background-color: transparent; - - .el-sub-menu__title, - &-item { - &.is-active, - &:hover { - background-color: $color-primary !important; - color: #fff; - } - } - - .el-sub-menu__title, - &-item, - &__title { - color: #eee; - letter-spacing: 0.5px; - height: 50px; - line-height: 50px; - - .icon-svg { - font-size: 16px; - margin: 0 15px 0 5px; - position: relative; - top: 1px; - } - - span { - font-size: 12px; - letter-spacing: 1px; - display: inline-block; - } - } - - &--collapse { - .el-sub-menu__title { - .icon-svg { - margin-left: 2px; - font-size: 19px; - } - } - } - } - - &__popup { - .icon-svg { - margin-right: 10px; - } - } -} - -.cl-slider-menu__submenu { - background-color: #fff; - - &.el-menu { - &--vertical { - .el-sub-menu { - &__title { - display: flex; - align-items: center; - - .icon-svg { - font-size: 18px; - margin-right: 10px; - } - } - } - - .el-menu-item { - display: flex; - align-items: center; - - .icon-svg { - font-size: 18px; - margin-right: 10px; - } - } - } - } -} diff --git a/src/cool/modules/base/components/menu/slider/index.tsx b/src/cool/modules/base/components/menu/slider/index.tsx deleted file mode 100644 index 5d66257..0000000 --- a/src/cool/modules/base/components/menu/slider/index.tsx +++ /dev/null @@ -1,121 +0,0 @@ -import { computed, defineComponent, h, ref, watch } from "vue"; -import "./index.scss"; -import { useCool } from "/@/cool"; - -export default defineComponent({ - name: "cl-menu-slider", - - setup() { - const { router, route, store } = useCool(); - - // 是否可见 - const visible = ref(true); - // 菜单列表 - const menuList = computed(() => store.getters.menuList); - // 菜单是否折叠 - const menuCollapse = computed(() => store.getters.menuCollapse); - // 浏览器信息 - const browser: any = computed(() => store.getters.browser); - - // 页面跳转 - function toView(url: string) { - if (url != route.path) { - router.push(url); - } - } - - // 刷新菜单 - function refresh() { - visible.value = false; - - setTimeout(() => { - visible.value = true; - }, 0); - } - - // 监听菜单变化 - watch(menuList, refresh); - - return { - route, - visible, - menuList, - menuCollapse, - browser, - toView, - refresh - }; - }, - - render(ctx: any) { - function deepMenu(list: any, index: number) { - return list - .filter((e: any) => e.isShow) - .map((e: any) => { - let html = null; - - if (e.type == 0) { - html = h( - , - { - index: String(e.id), - key: e.id, - "popper-class": "cl-slider-menu__popup" - }, - { - title: () => { - return ctx.menuCollapse && index == 1 ? ( - - ) : ( - - - {e.name} - - ); - }, - default() { - return deepMenu(e.children, index + 1); - } - } - ); - } else { - html = h( - , - { - index: e.path, - key: e.id - }, - { - title() { - return {e.name}; - }, - default() { - return ; - } - } - ); - } - - return html; - }); - } - - const children = deepMenu(ctx.menuList, 1); - - return ( - ctx.visible && ( - - - {children} - - - ) - ); - } -}); diff --git a/src/cool/modules/base/components/process/index.vue b/src/cool/modules/base/components/process/index.vue deleted file mode 100644 index 2e8b047..0000000 --- a/src/cool/modules/base/components/process/index.vue +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - - - - {{ item.label }} - - - - - - - - - - - - - diff --git a/src/cool/modules/base/components/role/perms.vue b/src/cool/modules/base/components/role/perms.vue deleted file mode 100644 index 265e694..0000000 --- a/src/cool/modules/base/components/role/perms.vue +++ /dev/null @@ -1,151 +0,0 @@ - - - {{ title }} - - - - - - - - - - - - diff --git a/src/cool/modules/base/components/role/select.vue b/src/cool/modules/base/components/role/select.vue deleted file mode 100644 index 9f22901..0000000 --- a/src/cool/modules/base/components/role/select.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - diff --git a/src/cool/modules/base/components/switch/index.vue b/src/cool/modules/base/components/switch/index.vue deleted file mode 100644 index 653e4e9..0000000 --- a/src/cool/modules/base/components/switch/index.vue +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - diff --git a/src/cool/modules/base/directives/permission.ts b/src/cool/modules/base/directives/permission.ts deleted file mode 100644 index 12cafc0..0000000 --- a/src/cool/modules/base/directives/permission.ts +++ /dev/null @@ -1,43 +0,0 @@ -import store from "/@/store"; - -function parse(value: any) { - const permission = store.getters.permission; - - if (typeof value == "string") { - return value ? permission.some((e: any) => e.includes(value.replace(/\s/g, ""))) : false; - } else { - return Boolean(value); - } -} - -function checkPerm(value: any) { - if (!value) { - return false; - } - - if (Object.prototype.toString.call(value) === "[object Object]") { - if (value.or) { - return value.or.some(parse); - } - - if (value.and) { - return value.and.some((e: any) => !parse(e)) ? false : true; - } - } - - return parse(value); -} - -function change(el: any, binding: any) { - el.style.display = checkPerm(binding.value) ? el.getAttribute("_display") : "none"; -} - -export default { - beforeMount(el: any, binding: any) { - el.setAttribute("_display", el.style.display || ""); - change(el, binding); - }, - updated: change -}; - -export { checkPerm }; diff --git a/src/cool/modules/base/index.ts b/src/cool/modules/base/index.ts deleted file mode 100644 index 1364405..0000000 --- a/src/cool/modules/base/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { checkPerm } from "./directives/permission"; -import { iconList } from "./common"; -import "./static/css/index.scss"; - -export { iconList, checkPerm }; diff --git a/src/cool/modules/base/pages/login/index.vue b/src/cool/modules/base/pages/login/index.vue deleted file mode 100644 index 8b1983e..0000000 --- a/src/cool/modules/base/pages/login/index.vue +++ /dev/null @@ -1,224 +0,0 @@ - - - - - {{ app.name }}是一款快速开发后台权限管理系统 - - - - - - - - - - - - - - { - form.verifyCode = ''; - } - " - /> - - - - 登录 - - - - - - - diff --git a/src/cool/modules/base/service/common.ts b/src/cool/modules/base/service/common.ts deleted file mode 100644 index ab18a87..0000000 --- a/src/cool/modules/base/service/common.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { BaseService, Service } from "/@/cool"; - -@Service("base/comm") -class Common extends BaseService { - /** - * 文件上传模式 - */ - uploadMode() { - return this.request({ - url: "/uploadMode" - }); - } - - /** - * 文件上传,如果模式是 cloud,返回对应参数 - * - * @returns - * @memberof CommonService - */ - upload(params: any) { - return this.request({ - url: "/upload", - method: "POST", - params - }); - } - - /** - * 用户退出 - */ - userLogout() { - return this.request({ - url: "/logout", - method: "POST" - }); - } - - /** - * 用户信息 - * - * @returns - * @memberof CommonService - */ - userInfo() { - return this.request({ - url: "/person" - }); - } - - /** - * 用户信息修改 - * - * @param {*} params - * @returns - * @memberof CommonService - */ - userUpdate(params: any) { - return this.request({ - url: "/personUpdate", - method: "POST", - data: { - ...params - } - }); - } - - /** - * 权限信息 - * - * @returns - * @memberof CommonService - */ - permMenu() { - return this.request({ - url: "/permmenu" - }); - } - - /** - * 数据接口 - */ - eps() { - return this.request({ - url: "/eps" - }); - } -} - -export default Common; diff --git a/src/cool/modules/base/service/open.ts b/src/cool/modules/base/service/open.ts deleted file mode 100644 index f19896a..0000000 --- a/src/cool/modules/base/service/open.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { BaseService, Service } from "/@/cool"; - -@Service("base/open") -class Open extends BaseService { - /** - * 用户登录 - * - * @param {*} { username, password, captchaId, verifyCode } - * @returns - * @memberof CommonService - */ - userLogin({ username, password, captchaId, verifyCode }: any) { - return this.request({ - url: "/login", - method: "POST", - data: { - username, - password, - captchaId, - verifyCode - } - }); - } - - /** - * 图片验证码 svg - * - * @param {*} { height, width } - * @returns - * @memberof CommonService - */ - captcha({ height, width }: any) { - return this.request({ - url: "/captcha", - params: { - height, - width - } - }); - } - - /** - * 刷新 token - * @param {string} token - */ - refreshToken(token: string) { - return this.request({ - url: "/refreshToken", - params: { - refreshToken: token - } - }); - } -} - -export default Open; diff --git a/src/cool/modules/base/store/app.ts b/src/cool/modules/base/store/app.ts deleted file mode 100644 index c136777..0000000 --- a/src/cool/modules/base/store/app.ts +++ /dev/null @@ -1,78 +0,0 @@ -import store from "store"; -import { deepMerge, getBrowser } from "/@/cool/utils"; -import { app } from "/@/config/env"; -import { useEps } from "/@/cool"; - -const browser = getBrowser(); - -const state = { - info: { - ...app - }, - browser, - collapse: browser.isMini ? true : false, - loading: false -}; - -const getters = { - // 程序加载 - appLoading: (state: any) => state.loading, - // 应用配置 - app: (state: any) => state.info, - // 浏览器信息 - browser: (state: any) => state.browser, - // 左侧菜单是否收起 - menuCollapse: (state: any) => state.collapse -}; - -const actions = { - async appLoad({ getters, dispatch, commit }: any) { - if (getters.token) { - commit("SHOW_LOADING"); - - // 读取Eps - await useEps(); - - // 读取菜单权限 - await dispatch("permMenu"); - - // 获取用户信息 - dispatch("userInfo"); - - commit("HIDE_LOADING"); - } - } -}; - -const mutations = { - SHOW_LOADING(state: any) { - state.loading = true; - }, - - HIDE_LOADING(state: any) { - state.loading = false; - }, - - // 设置浏览器信息 - SET_BROWSER(state: any) { - state.browser = getBrowser(); - }, - - // 收起左侧菜单 - COLLAPSE_MENU(state: any, val = false) { - state.collapse = val; - }, - - // 更新应用配置 - UPDATE_APP(state: any, val: any) { - deepMerge(state.info, val); - store.set("__app__", state.info); - } -}; - -export default { - state, - getters, - actions, - mutations -}; diff --git a/src/cool/modules/base/store/menu.ts b/src/cool/modules/base/store/menu.ts deleted file mode 100644 index a98176d..0000000 --- a/src/cool/modules/base/store/menu.ts +++ /dev/null @@ -1,154 +0,0 @@ -import { ElMessage } from "element-plus"; -import storage from "store"; -import store from "/@/store"; -import router from "/@/router"; -import { deepTree, revDeepTree, isArray, isEmpty } from "/@/cool/utils"; -import { menuList } from "/@/config/env"; -import { revisePath } from "../utils"; -import { MenuItem } from "../types"; -import { usePermission } from "/@/cool"; - -const state = { - // 视图路由,type=1 - routes: storage.get("viewRoutes") || [], - // 树形菜单 - group: storage.get("menuGroup") || [], - // showAMenu 模式下,顶级菜单的序号 - index: 0, - // 左侧菜单 - menu: [], - // 权限列表 - permission: storage.get("permission") || [] -}; - -const getters = { - // 树形菜单列表 - menuGroup: (state: any) => state.group, - // 左侧菜单 - menuList: (state: any) => state.menu, - // 视图路由 - routes: (state: any) => state.routes, - // 权限列表 - permission: (state: any) => state.permission -}; - -const actions = { - // 设置菜单、权限 - permMenu({ commit, state, getters }: any) { - return new Promise((resolve, reject) => { - const next = (res: any) => { - if (!isArray(res.menus)) { - res.menus = []; - } - - if (!isArray(res.perms)) { - res.perms = []; - } - - const routes = res.menus - .filter((e: MenuItem) => e.type != 2) - .map((e: MenuItem) => { - return { - id: e.id, - parentId: e.parentId, - path: revisePath(e.router || String(e.id)), - viewPath: e.viewPath, - type: e.type, - name: e.name, - icon: e.icon, - orderNum: e.orderNum, - isShow: isEmpty(e.isShow) ? true : e.isShow, - meta: { - label: e.name, - keepAlive: e.keepAlive - }, - children: [] - }; - }); - - // 转成树形菜单 - const menuGroup = deepTree(routes); - - // 设置权限 - commit("SET_PERMIESSION", res.perms); - // 设置菜单组 - commit("SET_MENU_GROUP", menuGroup); - // 设置视图路由 - commit( - "SET_VIEW_ROUTES", - routes.filter((e: MenuItem) => e.type == 1) - ); - // 设置菜单 - commit("SET_MENU_LIST", state.index); - - resolve(menuGroup); - }; - - // 监测自定义菜单 - if (!getters.app.conf.customMenu) { - store.service.base.common - .permMenu() - .then((res: any) => { - next(res); - }) - .catch((err: string) => { - ElMessage.error("菜单加载异常"); - console.error(err); - reject(err); - }); - } else { - next({ - menus: revDeepTree(menuList) - }); - } - }); - } -}; - -const mutations = { - // 设置树形菜单列表 - SET_MENU_GROUP(state: any, list: MenuItem[]) { - state.group = list; - storage.set("menuGroup", list); - }, - - // 设置视图路由 - SET_VIEW_ROUTES(state: any, list: MenuItem[]) { - router.$plugin?.addViews(list); - - state.routes = list; - storage.set("viewRoutes", list); - }, - - // 设置左侧菜单 - SET_MENU_LIST(state: any, index: number) { - const { showAMenu } = store.getters.app.conf; - - if (isEmpty(index)) { - index = state.index; - } - - if (showAMenu) { - const { children = [] } = state.group[index] || {}; - - state.index = index; - state.menu = children; - } else { - state.menu = state.group; - } - }, - - // 设置权限 - SET_PERMIESSION(state: any, list: Array) { - state.permission = list; - storage.set("permission", list); - usePermission(list); - } -}; - -export default { - state, - getters, - actions, - mutations -}; diff --git a/src/cool/modules/base/store/module.ts b/src/cool/modules/base/store/module.ts deleted file mode 100644 index 4b5d1ac..0000000 --- a/src/cool/modules/base/store/module.ts +++ /dev/null @@ -1,30 +0,0 @@ -const state = { - info: {}, - list: [] -}; - -const getters = { - // 模块信息 - modules: (state: any) => state.info, - // 模块列表 - moduleList: (state: any) => state.list -}; - -const mutations = { - SET_MODULE(state: any, list: Array) { - const d: any = {}; - - list.forEach((e: any) => { - d[e.name] = e; - }); - - state.list = list; - state.info = d; - } -}; - -export default { - state, - getters, - mutations -}; diff --git a/src/cool/modules/base/store/process.ts b/src/cool/modules/base/store/process.ts deleted file mode 100644 index 4511e48..0000000 --- a/src/cool/modules/base/store/process.ts +++ /dev/null @@ -1,66 +0,0 @@ -const fMenu = { - label: "首页", - value: "/", - active: true -}; - -const state = { - list: [fMenu] -}; - -const getters = { - // 页面进程列表 - processList: (state: any) => state.list -}; - -const actions = {}; - -const mutations = { - ADD_PROCESS(state: any, item: any) { - const index = state.list.findIndex( - (e: any) => e.value.split("?")[0] === item.value.split("?")[0] - ); - - state.list.map((e: any) => { - e.active = e.value == item.value; - }); - - if (index < 0) { - if (item.value == "/") { - item.label = fMenu.label; - } - - if (item.label) { - state.list.push({ - ...item, - active: true - }); - } - } else { - state.list[index].active = true; - state.list[index].label = item.label; - state.list[index].value = item.value; - } - }, - - DEL_PROCESS(state: any, index: number) { - if (index != 0) { - state.list.splice(index, 1); - } - }, - - SET_PROCESS(state: any, list: Array) { - state.list = list; - }, - - RESET_PROCESS(state: any) { - state.list = [fMenu]; - } -}; - -export default { - state, - getters, - actions, - mutations -}; diff --git a/src/cool/modules/base/store/user.ts b/src/cool/modules/base/store/user.ts deleted file mode 100644 index b14edc2..0000000 --- a/src/cool/modules/base/store/user.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { storage, href } from "/@/cool/utils"; -import store from "/@/store"; -import { Token } from "../types"; - -const state: any = { - // 授权标识 - token: storage.get("token") || null, - // 用户信息 - info: storage.get("userInfo") || {} -}; - -const getters = { - userInfo: (state: any) => state.info, - token: (state: any) => state.token -}; - -const actions = { - // 用户登录 - userLogin({ commit }: any, form: any): Promise { - return store.service.base.open.userLogin(form).then((res: Token) => { - commit("SET_TOKEN", res); - return res; - }); - }, - - // 用户退出 - async userLogout({ dispatch }: any): Promise { - await store.service.base.common.userLogout(); - return dispatch("userRemove"); - }, - - // 用户信息 - userInfo({ commit }: any): Promise { - return store.service.base.common.userInfo().then((res: any) => { - commit("SET_USERINFO", res); - return res; - }); - }, - - // 用户移除 - userRemove({ commit }: any) { - commit("CLEAR_USER"); - commit("CLEAR_TOKEN"); - commit("RESET_PROCESS"); - commit("SET_MENU_GROUP", []); - commit("SET_VIEW_ROUTES", []); - commit("SET_MENU_LIST", 0); - }, - - // 刷新token - refreshToken({ commit, dispatch }: any) { - return new Promise((resolve, reject) => { - store.service.base.open - .refreshToken(storage.get("refreshToken")) - .then((res: any) => { - commit("SET_TOKEN", res); - resolve(res.token); - }) - .catch((err: Error) => { - dispatch("userRemove"); - href("/login"); - reject(err); - }); - }); - } -}; - -const mutations = { - // 设置用户信息 - SET_USERINFO(state: any, val: any) { - state.info = val; - storage.set("userInfo", val); - }, - - // 设置授权标识 - SET_TOKEN(state: any, { token, expire, refreshToken, refreshExpire }: Token) { - // 请求的唯一标识 - state.token = token; - storage.set("token", token, expire); - - // 刷新 token 的唯一标识 - storage.set("refreshToken", refreshToken, refreshExpire); - }, - - // 移除授权标识 - CLEAR_TOKEN(state: any) { - state.token = null; - storage.remove("token"); - storage.remove("refreshToken"); - }, - - // 移除用户信息 - CLEAR_USER(state: any) { - state.info = {}; - storage.remove("userInfo"); - } -}; - -export default { - state, - getters, - actions, - mutations -}; diff --git a/src/cool/modules/base/types/index.d.ts b/src/cool/modules/base/types/index.d.ts deleted file mode 100644 index 9d32086..0000000 --- a/src/cool/modules/base/types/index.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -export declare interface Token { - expire: number; - refreshExpire: number; - refreshToken: string; - token: string; -} - -export declare enum MenuType { - "目录" = 0, - "菜单" = 1, - "权限" = 2 -} - -export declare interface MenuItem { - id: number; - parentId: number; - path: string; - router?: string; - viewPath?: string; - type: MenuType; - name: string; - icon: string; - orderNum: number; - isShow: number; - keepAlive?: number; - meta?: { - label: string; - keepAlive: number; - }; - children?: MenuItem[]; -} diff --git a/src/cool/modules/base/views/log.vue b/src/cool/modules/base/views/log.vue deleted file mode 100644 index 4e66774..0000000 --- a/src/cool/modules/base/views/log.vue +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - - 清空 - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/cool/modules/base/views/menu.vue b/src/cool/modules/base/views/menu.vue deleted file mode 100644 index 6c72440..0000000 --- a/src/cool/modules/base/views/menu.vue +++ /dev/null @@ -1,398 +0,0 @@ - - - - - - - - - - - - - {{ scope.row.name }} - 隐藏 - - - - - - - - - - {{ item }} - - - - - {{ - scope.row.router - }} - {{ scope.row.router }} - - - - - - - - - - - - - 新增 - - - - - - - - - - - - - - - diff --git a/src/cool/modules/base/views/param.vue b/src/cool/modules/base/views/param.vue deleted file mode 100644 index bdc6b77..0000000 --- a/src/cool/modules/base/views/param.vue +++ /dev/null @@ -1,218 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - {{ - item.label - }} - - - - - - - - - - - - diff --git a/src/cool/modules/base/views/plugin.vue b/src/cool/modules/base/views/plugin.vue deleted file mode 100644 index a96fb98..0000000 --- a/src/cool/modules/base/views/plugin.vue +++ /dev/null @@ -1,263 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - 配置 - - - - - - - - - - - - - - - - - diff --git a/src/cool/modules/base/views/role.vue b/src/cool/modules/base/views/role.vue deleted file mode 100644 index b8f90d8..0000000 --- a/src/cool/modules/base/views/role.vue +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/cool/modules/base/views/user.vue b/src/cool/modules/base/views/user.vue deleted file mode 100644 index 843550d..0000000 --- a/src/cool/modules/base/views/user.vue +++ /dev/null @@ -1,576 +0,0 @@ - - - - - - - - - - - - - - - - - 成员列表 - - - - - - - - - 转移 - - - - - - - - - - - - - - {{ item }} - - - - - 转移 - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/cool/modules/chat/components/chat.vue b/src/cool/modules/chat/components/chat.vue deleted file mode 100644 index c87672f..0000000 --- a/src/cool/modules/chat/components/chat.vue +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/cool/modules/chat/components/emoji.vue b/src/cool/modules/chat/components/emoji.vue deleted file mode 100644 index 919134f..0000000 --- a/src/cool/modules/chat/components/emoji.vue +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/cool/modules/chat/components/icon-voice.vue b/src/cool/modules/chat/components/icon-voice.vue deleted file mode 100644 index 875b4ed..0000000 --- a/src/cool/modules/chat/components/icon-voice.vue +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - diff --git a/src/cool/modules/chat/components/input.vue b/src/cool/modules/chat/components/input.vue deleted file mode 100644 index 44e7005..0000000 --- a/src/cool/modules/chat/components/input.vue +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 发送 - - - - - - - diff --git a/src/cool/modules/chat/components/message.vue b/src/cool/modules/chat/components/message.vue deleted file mode 100644 index fe628bd..0000000 --- a/src/cool/modules/chat/components/message.vue +++ /dev/null @@ -1,546 +0,0 @@ - - - - - - 加载更多 - - - - - - - - {{ item._date }} - - - - - - - - - - - - {{ item.nickName }} - - - - {{ - item.content.text - }} - - - - - - - - - - - - - - - - - - - {{ item.content.duration }}" - - - - - - - - - - - - 待扩展消息类型 - - - - - - - - - - - - - - - - - - - diff --git a/src/cool/modules/chat/components/notice.vue b/src/cool/modules/chat/components/notice.vue deleted file mode 100644 index 7b8c1ff..0000000 --- a/src/cool/modules/chat/components/notice.vue +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - diff --git a/src/cool/modules/chat/components/session.vue b/src/cool/modules/chat/components/session.vue deleted file mode 100644 index 8472e54..0000000 --- a/src/cool/modules/chat/components/session.vue +++ /dev/null @@ -1,316 +0,0 @@ - - - - - - - - - - - - - - - - - - - - {{ item.nickname }} - {{ item.lastMessage }} - - - - - - - - - diff --git a/src/cool/modules/chat/components/upload.vue b/src/cool/modules/chat/components/upload.vue deleted file mode 100644 index 090917e..0000000 --- a/src/cool/modules/chat/components/upload.vue +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - diff --git a/src/cool/modules/chat/service/message.ts b/src/cool/modules/chat/service/message.ts deleted file mode 100644 index 0907cb6..0000000 --- a/src/cool/modules/chat/service/message.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { BaseService, Service, Permission } from "/@/cool"; - -@Service({ - namespace: "im/message", - mock: true -}) -class ImMessage extends BaseService { - @Permission("read") - read(data: any) { - return this.request({ - url: "/read", - method: "POST", - data - }); - } -} - -export default ImMessage; diff --git a/src/cool/modules/chat/service/session.ts b/src/cool/modules/chat/service/session.ts deleted file mode 100644 index 099b670..0000000 --- a/src/cool/modules/chat/service/session.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { BaseService, Service, Permission } from "/@/cool"; - -@Service({ - namespace: "im/session", - mock: true -}) -class ImSession extends BaseService { - @Permission("unreadCount") - unreadCount() { - return this.request({ - url: "/unreadCount" - }); - } -} - -export default ImSession; diff --git a/src/cool/modules/chat/static/images/custom-avatar.png b/src/cool/modules/chat/static/images/custom-avatar.png deleted file mode 100644 index d69c80f7990faff0e8ac890382981da28abb1f5d..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hcm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/src/cool/modules/chat/static/images/video.png deleted file mode 100644 index 80dd1be042c76dd7ade2309668dc50ecaba51f12..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 724 zcmV;_0xSKAP)A6^A&so11U2`hyf!}285FGGBJ^Xfy4wU42VQBLEZ)=GN6=5gb6-@5CcpM zd;s0GPn}L{Kl_}`+54Qc*Q#f<@3XIU|MzvTw`a}ic$@2Z{xX2RJ0%?q00AOg5N;T3qv#CH;C}!Jv5#0*{Jk$xzm7dPgwrK4TW}w5u{;q|rPBl5 zIDim*fXzjDM46=85uCzB>??^0kbm$F3lcH&>9h(U`Wneal814!qLv?FVm(m>B?( z_tyeK*#;=ZW~Ko25`0;Jh%Iwfn@Iq@q&MJ61%a6c5C^2ky9{6*o^}yHXUBj}&jOuT z2kga_F0TY5_W%$e-r!Q#_5xLlnmW&?Y8_A~!K&Y60QpEPp9!{mC|XscO+0VyRJe)c zM$u^GSbXq`%qSfkcWfh9WFm>)C8^W}hH)pEdViyrq}oVuY?^icF*3H!wDIB$pbhGi zq?sKsNnfLlzGMfqL4A@mvjZmSYqZgq?0`0?Pm*Tm9qfI&f8K-8d! zfQTTX*b|zRh)A*H11gHWD^`B-d4KPH*8StY>wE9IYyE!j^L=JWUqWVS=r(?#BYvw>b`xd_1ZXVHTOYE)
{{ app.name }}
{{ app.info.name }}
正在加载菜单...
初次加载资源可能需要较多时间 请耐心等待
{{ title }}
{{ app.name }}是一款快速开发后台权限管理系统
{{ item.nickname }}
{{ item.lastMessage }}