From 3fd0114971442a957dbb5950facd6234e927d95d Mon Sep 17 00:00:00 2001 From: icssoa <2570063477@qq.com> Date: Mon, 29 Mar 2021 00:10:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0vue3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .browserslistrc | 1 + .dockerignore | 21 - .eslintignore | 7 +- .eslintrc.js | 19 +- .gitignore | 4 +- Dockerfile | 14 - LICENSE | 21 - README.md | 292 +- babel.config.js | 12 +- nginx.conf | 84 - package.json | 65 +- postcss.config.js | 5 - public/favicon.ico | Bin 67646 -> 4286 bytes public/index.html | 112 +- src/assets/css/element-variables.scss | 4 +- src/assets/css/index.scss | 1 - src/assets/logo.png | Bin 0 -> 6849 bytes src/config/{env.js => env.ts} | 27 +- src/cool/index.js | 46 - src/cool/index.ts | 3 + .../base/common/{index.js => index.ts} | 0 .../base/common/{resize.js => resize.ts} | 2 +- .../base/common/{theme.js => theme.ts} | 2 +- .../modules/base/components/avatar/index.vue | 31 +- .../base/components/codemirror/index.vue | 127 +- .../modules/base/components/dept/check.vue | 166 +- .../modules/base/components/dept/move.tsx | 120 + .../modules/base/components/dept/move.vue | 104 - .../modules/base/components/dept/tree.vue | 279 +- .../base/components/editor-quill/index.vue | 223 +- .../base/components/icon-svg/index.vue | 43 +- src/cool/modules/base/components/index.js | 39 - src/cool/modules/base/components/index.ts | 39 + .../modules/base/components/menu/file.vue | 65 +- .../modules/base/components/menu/icons.vue | 98 +- .../modules/base/components/menu/perms.vue | 170 +- .../base/components/menu/slider/index.js | 92 - .../base/components/menu/slider/index.scss | 2 + .../base/components/menu/slider/index.tsx | 122 + .../modules/base/components/menu/topbar.vue | 106 +- .../modules/base/components/menu/tree.vue | 135 +- .../modules/base/components/process/index.vue | 205 +- .../modules/base/components/role/perms.vue | 145 +- .../modules/base/components/role/select.vue | 70 +- .../base/components/route-nav/index.vue | 64 +- .../base/components/scrollbar/index.vue | 23 +- .../base/directives/{index.js => index.ts} | 0 .../{permission.js => permission.ts} | 36 +- src/cool/modules/base/filters/index.js | 17 - src/cool/modules/base/{index.js => index.ts} | 3 +- .../error-page/components/error-page.vue | 99 +- src/cool/modules/base/pages/index.js | 22 - src/cool/modules/base/pages/index.ts | 22 + .../base/pages/login/components/captcha.vue | 61 +- src/cool/modules/base/pages/login/index.vue | 98 +- .../base/service/{common.js => common.ts} | 6 +- .../base/service/{index.js => index.ts} | 2 + .../modules/base/service/{open.js => open.ts} | 8 +- .../base/service/plugin/{info.js => info.ts} | 8 +- .../base/service/system/{dept.js => dept.ts} | 4 +- .../base/service/system/{log.js => log.ts} | 4 +- .../base/service/system/{menu.js => menu.ts} | 2 +- .../service/system/{param.js => param.ts} | 2 +- .../base/service/system/{role.js => role.ts} | 2 +- src/cool/modules/base/service/system/task.ts | 41 + .../base/service/system/{user.js => user.ts} | 4 +- src/cool/modules/base/store/app.js | 50 - src/cool/modules/base/store/app.ts | 58 + .../modules/base/store/{index.js => index.ts} | 0 src/cool/modules/base/store/menu.js | 143 - src/cool/modules/base/store/menu.ts | 152 + src/cool/modules/base/store/module.js | 26 - src/cool/modules/base/store/module.ts | 30 + src/cool/modules/base/store/process.js | 57 - src/cool/modules/base/store/process.ts | 66 + src/cool/modules/base/store/user.js | 102 - src/cool/modules/base/store/user.ts | 109 + src/cool/modules/base/types/index.d.ts | 31 + .../modules/base/utils/{index.js => index.ts} | 15 +- src/cool/modules/base/views/index.js | 10 - src/cool/modules/base/views/index.ts | 7 + src/cool/modules/base/views/info.vue | 59 +- src/cool/modules/base/views/log.vue | 207 +- src/cool/modules/base/views/menu.vue | 575 +- src/cool/modules/base/views/param.vue | 287 +- src/cool/modules/base/views/plugin.vue | 321 +- src/cool/modules/base/views/role.vue | 261 +- src/cool/modules/base/views/user.vue | 652 +- src/cool/modules/chat/components/chat.vue | 267 +- src/cool/modules/chat/components/emoji.vue | 108 +- src/cool/modules/chat/components/index.js | 4 - src/cool/modules/chat/components/index.ts | 4 + src/cool/modules/chat/components/input.vue | 167 +- src/cool/modules/chat/components/message.vue | 251 +- src/cool/modules/chat/components/notice.vue | 2 +- src/cool/modules/chat/components/session.vue | 237 +- src/cool/modules/chat/{index.js => index.ts} | 0 .../chat/service/{index.js => index.ts} | 0 .../chat/service/{message.js => message.ts} | 4 +- .../chat/service/{session.js => session.ts} | 2 +- .../modules/chat/store/{index.js => index.ts} | 0 src/cool/modules/chat/store/message.js | 53 - src/cool/modules/chat/store/message.ts | 58 + src/cool/modules/chat/store/session.js | 58 - src/cool/modules/chat/store/session.ts | 63 + src/cool/modules/chat/utils/event-bus.js | 2 - .../modules/chat/utils/{index.js => index.ts} | 6 +- .../copy/directives/{index.js => index.ts} | 10 +- src/cool/modules/copy/{index.js => index.ts} | 0 src/cool/modules/demo/{index.js => index.ts} | 0 .../demo/utils/{service.js => service.ts} | 18 +- .../demo/views/components/b-cl-form.vue | 8 +- src/cool/modules/demo/views/crud.vue | 663 +- .../modules/demo/views/crud/adv-search.vue | 56 + .../demo/views/crud/components/test.vue | 19 + .../modules/demo/views/crud/context-menu.vue | 83 + src/cool/modules/demo/views/crud/dialog.vue | 62 + src/cool/modules/demo/views/crud/form.vue | 329 + src/cool/modules/demo/views/crud/query.vue | 29 + src/cool/modules/demo/views/crud/table.vue | 70 + src/cool/modules/demo/views/crud/upsert.vue | 117 + src/cool/modules/demo/views/demo.vue | 2 + src/cool/modules/demo/views/editor-quill.vue | 27 +- src/cool/modules/demo/views/upload.vue | 29 +- .../modules/distpicker/components/data.json | 5312 -------- .../modules/distpicker/components/index.vue | 66 - src/cool/modules/distpicker/index.js | 7 - .../task/components/cron/{cn.js => cn.ts} | 0 .../modules/task/components/cron/cron.vue | 78 +- .../modules/task/components/cron/index.js | 68 - .../modules/task/components/cron/index.tsx | 100 + src/cool/modules/task/{index.js => index.ts} | 0 .../task/service/{index.js => index.ts} | 0 .../modules/task/service/{info.js => info.ts} | 10 +- src/cool/modules/task/views/task.vue | 958 +- src/cool/modules/theme/components/index.ts | 5 + src/cool/modules/theme/components/theme.vue | 343 + src/cool/modules/theme/index.ts | 3 + .../upload/components/{index.js => index.ts} | 0 src/cool/modules/upload/components/index.vue | 38 +- .../upload/components/space/category.vue | 8 +- .../modules/upload/components/space/index.vue | 12 +- src/cool/modules/upload/filters/index.js | 6 - src/cool/modules/upload/filters/oss.js | 48 - src/cool/modules/upload/index.js | 5 - src/cool/modules/upload/index.ts | 4 + .../upload/service/{index.js => index.ts} | 0 .../upload/service/{info.js => info.ts} | 2 +- .../upload/service/{type.js => type.ts} | 2 +- src/core/common/index.ts | 12 + src/core/hook/core.ts | 15 + src/core/index.ts | 15 + src/core/service/base.ts | 117 + src/core/service/desorator.ts | 45 + src/core/service/index.ts | 4 + src/core/set/index.ts | 5 + src/core/set/module.ts | 152 + src/core/set/router.ts | 95 + src/core/set/service.ts | 54 + src/core/utils/index.ts | 292 + src/core/utils/storage.ts | 81 + src/crud/assets/index.scss | 592 + src/crud/common/index.ts | 11 + src/crud/components/add-btn.tsx | 30 + src/crud/components/adv-btn.tsx | 30 + src/crud/components/adv-search.tsx | 280 + .../components/context-menu/context-menu.tsx | 207 + src/crud/components/context-menu/index.ts | 26 + src/crud/components/crud/app.ts | 55 + src/crud/components/crud/helper.ts | 205 + src/crud/components/crud/index.tsx | 120 + src/crud/components/dialog/helper.ts | 139 + src/crud/components/dialog/index.tsx | 293 + src/crud/components/error-message.tsx | 15 + src/crud/components/filter.tsx | 21 + src/crud/components/flex1.tsx | 11 + src/crud/components/form-tabs.tsx | 109 + src/crud/components/form/helper.tsx | 131 + src/crud/components/form/index.tsx | 488 + src/crud/components/index.tsx | 39 + src/crud/components/multi-delete-btn.tsx | 26 + src/crud/components/pagination.tsx | 84 + src/crud/components/query.tsx | 118 + src/crud/components/refresh-btn.tsx | 23 + src/crud/components/search-key.tsx | 135 + src/crud/components/table/helper.tsx | 67 + src/crud/components/table/index.tsx | 512 + src/crud/components/upsert/helper.tsx | 26 + src/crud/components/upsert/index.tsx | 293 + src/crud/hooks/core.ts | 41 + src/crud/index.ts | 57 + src/crud/types/adv-search.d.ts | 3 + src/crud/types/browser.d.ts | 4 + src/crud/types/context-menu.d.ts | 15 + src/crud/types/crud.d.ts | 108 + src/crud/types/form.d.ts | 58 + src/crud/types/index.d.ts | 9 + src/crud/types/op.d.ts | 111 + src/crud/types/query.d.ts | 4 + src/crud/types/render.d.ts | 12 + src/crud/types/table.d.ts | 63 + src/crud/types/upsert.d.ts | 7 + src/crud/utils/index.ts | 115 + src/crud/utils/mitt.ts | 29 + src/crud/utils/parse.ts | 33 + src/crud/utils/vnode.tsx | 138 + src/element.js | 172 - src/main.js | 37 - src/main.ts | 58 + src/mock/{chat.js => chat.ts} | 8 +- src/mock/{index.js => index.ts} | 2 + src/pages/layout/index.vue | 66 +- src/pages/layout/topbar.vue | 28 +- src/router/index.js | 42 - src/router/index.ts | 34 + src/service/{request.js => request.ts} | 27 +- src/shims-vue.d.ts | 94 + src/store/index.js | 8 - src/store/index.ts | 7 + src/views/home/components/category-ratio.vue | 112 +- src/views/home/components/count-effect.vue | 5 +- src/views/home/components/count-paid.vue | 110 +- src/views/home/components/count-sales.vue | 5 +- src/views/home/components/count-views.vue | 191 +- src/views/home/components/hot-search.vue | 204 +- src/views/home/components/sales-rank.vue | 78 +- src/views/home/components/tab-chart.vue | 182 +- src/views/home/index.vue | 25 +- tsconfig.json | 23 + vue.config.js | 32 +- yarn.lock | 10499 ++++++++++++++++ 231 files changed, 23098 insertions(+), 11483 deletions(-) delete mode 100644 .dockerignore delete mode 100644 Dockerfile delete mode 100644 LICENSE delete mode 100644 nginx.conf delete mode 100644 postcss.config.js create mode 100644 src/assets/logo.png rename src/config/{env.js => env.ts} (56%) delete mode 100644 src/cool/index.js create mode 100644 src/cool/index.ts rename src/cool/modules/base/common/{index.js => index.ts} (100%) rename src/cool/modules/base/common/{resize.js => resize.ts} (98%) rename src/cool/modules/base/common/{theme.js => theme.ts} (95%) create mode 100644 src/cool/modules/base/components/dept/move.tsx delete mode 100644 src/cool/modules/base/components/dept/move.vue delete mode 100644 src/cool/modules/base/components/index.js create mode 100644 src/cool/modules/base/components/index.ts delete mode 100644 src/cool/modules/base/components/menu/slider/index.js create mode 100644 src/cool/modules/base/components/menu/slider/index.tsx rename src/cool/modules/base/directives/{index.js => index.ts} (100%) rename src/cool/modules/base/directives/{permission.js => permission.ts} (63%) delete mode 100644 src/cool/modules/base/filters/index.js rename src/cool/modules/base/{index.js => index.ts} (73%) delete mode 100644 src/cool/modules/base/pages/index.js create mode 100644 src/cool/modules/base/pages/index.ts rename src/cool/modules/base/service/{common.js => common.ts} (91%) rename src/cool/modules/base/service/{index.js => index.ts} (90%) rename src/cool/modules/base/service/{open.js => open.ts} (80%) rename src/cool/modules/base/service/plugin/{info.js => info.ts} (75%) rename src/cool/modules/base/service/system/{dept.js => dept.ts} (72%) rename src/cool/modules/base/service/system/{log.js => log.ts} (83%) rename src/cool/modules/base/service/system/{menu.js => menu.ts} (64%) rename src/cool/modules/base/service/system/{param.js => param.ts} (65%) rename src/cool/modules/base/service/system/{role.js => role.ts} (64%) create mode 100644 src/cool/modules/base/service/system/task.ts rename src/cool/modules/base/service/system/{user.js => user.ts} (70%) delete mode 100644 src/cool/modules/base/store/app.js create mode 100644 src/cool/modules/base/store/app.ts rename src/cool/modules/base/store/{index.js => index.ts} (100%) delete mode 100644 src/cool/modules/base/store/menu.js create mode 100644 src/cool/modules/base/store/menu.ts delete mode 100644 src/cool/modules/base/store/module.js create mode 100644 src/cool/modules/base/store/module.ts delete mode 100644 src/cool/modules/base/store/process.js create mode 100644 src/cool/modules/base/store/process.ts delete mode 100644 src/cool/modules/base/store/user.js create mode 100644 src/cool/modules/base/store/user.ts create mode 100644 src/cool/modules/base/types/index.d.ts rename src/cool/modules/base/utils/{index.js => index.ts} (65%) delete mode 100644 src/cool/modules/base/views/index.js create mode 100644 src/cool/modules/base/views/index.ts delete mode 100644 src/cool/modules/chat/components/index.js create mode 100644 src/cool/modules/chat/components/index.ts rename src/cool/modules/chat/{index.js => index.ts} (100%) rename src/cool/modules/chat/service/{index.js => index.ts} (100%) rename src/cool/modules/chat/service/{message.js => message.ts} (73%) rename src/cool/modules/chat/service/{session.js => session.ts} (78%) rename src/cool/modules/chat/store/{index.js => index.ts} (100%) delete mode 100644 src/cool/modules/chat/store/message.js create mode 100644 src/cool/modules/chat/store/message.ts delete mode 100644 src/cool/modules/chat/store/session.js create mode 100644 src/cool/modules/chat/store/session.ts delete mode 100644 src/cool/modules/chat/utils/event-bus.js rename src/cool/modules/chat/utils/{index.js => index.ts} (66%) rename src/cool/modules/copy/directives/{index.js => index.ts} (67%) rename src/cool/modules/copy/{index.js => index.ts} (100%) rename src/cool/modules/demo/{index.js => index.ts} (100%) rename src/cool/modules/demo/utils/{service.js => service.ts} (85%) create mode 100644 src/cool/modules/demo/views/crud/adv-search.vue create mode 100644 src/cool/modules/demo/views/crud/components/test.vue create mode 100644 src/cool/modules/demo/views/crud/context-menu.vue create mode 100644 src/cool/modules/demo/views/crud/dialog.vue create mode 100644 src/cool/modules/demo/views/crud/form.vue create mode 100644 src/cool/modules/demo/views/crud/query.vue create mode 100644 src/cool/modules/demo/views/crud/table.vue create mode 100644 src/cool/modules/demo/views/crud/upsert.vue delete mode 100644 src/cool/modules/distpicker/components/data.json delete mode 100644 src/cool/modules/distpicker/components/index.vue delete mode 100644 src/cool/modules/distpicker/index.js rename src/cool/modules/task/components/cron/{cn.js => cn.ts} (100%) delete mode 100644 src/cool/modules/task/components/cron/index.js create mode 100644 src/cool/modules/task/components/cron/index.tsx rename src/cool/modules/task/{index.js => index.ts} (100%) rename src/cool/modules/task/service/{index.js => index.ts} (100%) rename src/cool/modules/task/service/{info.js => info.ts} (77%) create mode 100644 src/cool/modules/theme/components/index.ts create mode 100644 src/cool/modules/theme/components/theme.vue create mode 100644 src/cool/modules/theme/index.ts rename src/cool/modules/upload/components/{index.js => index.ts} (100%) delete mode 100644 src/cool/modules/upload/filters/index.js delete mode 100644 src/cool/modules/upload/filters/oss.js delete mode 100644 src/cool/modules/upload/index.js create mode 100644 src/cool/modules/upload/index.ts rename src/cool/modules/upload/service/{index.js => index.ts} (100%) rename src/cool/modules/upload/service/{info.js => info.ts} (64%) rename src/cool/modules/upload/service/{type.js => type.ts} (64%) create mode 100644 src/core/common/index.ts create mode 100644 src/core/hook/core.ts create mode 100644 src/core/index.ts create mode 100644 src/core/service/base.ts create mode 100644 src/core/service/desorator.ts create mode 100644 src/core/service/index.ts create mode 100644 src/core/set/index.ts create mode 100644 src/core/set/module.ts create mode 100644 src/core/set/router.ts create mode 100644 src/core/set/service.ts create mode 100644 src/core/utils/index.ts create mode 100644 src/core/utils/storage.ts create mode 100644 src/crud/assets/index.scss create mode 100644 src/crud/common/index.ts create mode 100644 src/crud/components/add-btn.tsx create mode 100644 src/crud/components/adv-btn.tsx create mode 100644 src/crud/components/adv-search.tsx create mode 100644 src/crud/components/context-menu/context-menu.tsx create mode 100644 src/crud/components/context-menu/index.ts create mode 100644 src/crud/components/crud/app.ts create mode 100644 src/crud/components/crud/helper.ts create mode 100644 src/crud/components/crud/index.tsx create mode 100644 src/crud/components/dialog/helper.ts create mode 100644 src/crud/components/dialog/index.tsx create mode 100644 src/crud/components/error-message.tsx create mode 100644 src/crud/components/filter.tsx create mode 100644 src/crud/components/flex1.tsx create mode 100644 src/crud/components/form-tabs.tsx create mode 100644 src/crud/components/form/helper.tsx create mode 100644 src/crud/components/form/index.tsx create mode 100644 src/crud/components/index.tsx create mode 100644 src/crud/components/multi-delete-btn.tsx create mode 100644 src/crud/components/pagination.tsx create mode 100644 src/crud/components/query.tsx create mode 100644 src/crud/components/refresh-btn.tsx create mode 100644 src/crud/components/search-key.tsx create mode 100644 src/crud/components/table/helper.tsx create mode 100644 src/crud/components/table/index.tsx create mode 100644 src/crud/components/upsert/helper.tsx create mode 100644 src/crud/components/upsert/index.tsx create mode 100644 src/crud/hooks/core.ts create mode 100644 src/crud/index.ts create mode 100644 src/crud/types/adv-search.d.ts create mode 100644 src/crud/types/browser.d.ts create mode 100644 src/crud/types/context-menu.d.ts create mode 100644 src/crud/types/crud.d.ts create mode 100644 src/crud/types/form.d.ts create mode 100644 src/crud/types/index.d.ts create mode 100644 src/crud/types/op.d.ts create mode 100644 src/crud/types/query.d.ts create mode 100644 src/crud/types/render.d.ts create mode 100644 src/crud/types/table.d.ts create mode 100644 src/crud/types/upsert.d.ts create mode 100644 src/crud/utils/index.ts create mode 100644 src/crud/utils/mitt.ts create mode 100644 src/crud/utils/parse.ts create mode 100644 src/crud/utils/vnode.tsx delete mode 100644 src/element.js delete mode 100644 src/main.js create mode 100644 src/main.ts rename src/mock/{chat.js => chat.ts} (83%) rename src/mock/{index.js => index.ts} (87%) delete mode 100644 src/router/index.js create mode 100644 src/router/index.ts rename src/service/{request.js => request.ts} (86%) create mode 100644 src/shims-vue.d.ts delete mode 100644 src/store/index.js create mode 100644 src/store/index.ts create mode 100644 tsconfig.json create mode 100644 yarn.lock diff --git a/.browserslistrc b/.browserslistrc index d6471a3..214388f 100644 --- a/.browserslistrc +++ b/.browserslistrc @@ -1,2 +1,3 @@ > 1% last 2 versions +not dead diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 27ef30a..0000000 --- a/.dockerignore +++ /dev/null @@ -1,21 +0,0 @@ -.DS_Store -node_modules -/dist - -# local env files -.env.local -.env.*.local - -# Log files -npm-debug.log* -yarn-debug.log* -yarn-error.log* -yarn.lock - -# Editor directories and files -.idea -*.suo -*.ntvs* -*.njsproj -*.sln -*.sw? diff --git a/.eslintignore b/.eslintignore index 5384192..af2f677 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,6 +1,3 @@ -/public/ -/dist/ -/node_modules/ -/src/icons/svg/ -/mock/ vue.config.js +/src/crud +/src/core \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index 39bd413..a2c2908 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -3,12 +3,19 @@ module.exports = { env: { node: true }, - extends: ["plugin:vue/essential", "@vue/prettier"], - rules: { - "no-console": "off", - "comma-dangle": [2, "never"] - }, + extends: [ + "plugin:vue/vue3-essential", + "eslint:recommended", + "@vue/typescript/recommended", + "@vue/prettier", + "@vue/prettier/@typescript-eslint" + ], parserOptions: { - parser: "@typescript-eslint/parser" + ecmaVersion: 2020 + }, + rules: { + "no-console": process.env.NODE_ENV === "production" ? "warn" : "off", + "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", + "@typescript-eslint/no-explicit-any": ["off"] } }; diff --git a/.gitignore b/.gitignore index 27ef30a..403adbc 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ node_modules /dist + # local env files .env.local .env.*.local @@ -10,10 +11,11 @@ node_modules npm-debug.log* yarn-debug.log* yarn-error.log* -yarn.lock +pnpm-debug.log* # Editor directories and files .idea +.vscode *.suo *.ntvs* *.njsproj diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index dad46df..0000000 --- a/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM node:lts-alpine -WORKDIR /build -RUN npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass -RUN npm set registry https://registry.npm.taobao.org -COPY package.json /build/package.json -RUN npm install -COPY ./ /build -RUN npm run build - -FROM nginx -RUN mkdir /app -COPY --from=0 /build/dist /app -COPY --from=0 /build/nginx.conf /etc/nginx/nginx.conf -EXPOSE 80 \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 83140ce..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 cool-team-official - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md index 76604df..747e143 100644 --- a/README.md +++ b/README.md @@ -1,290 +1,24 @@ -
+# front-next-vue3 -cool-admin 一个很酷的后台权限管理系统,开源免费,模块化、插件化、极速开发 CRUD,方便快速构建迭代后台管理系统, 到论坛 进一步了解
- -- - - -
- -## 演示 - -[https://show.cool-admin.com](https://show.cool-admin.com) - -- 账户:admin -- 密码:123456 - - - -## 项目后端 - -[https://github.com/cool-team-official/cool-admin-midway](https://github.com/cool-team-official/cool-admin-midway) - -## 微信群 - - - -## 微信公众号 - - - -## 在线社区 - -[https://bbs.cool-js.com/](https://bbs.cool-js.com/) - -## 使用条件 - -请确保您的操作系统上安装了 Node.js(> = 8.9.0)、@vue/cli (> 3.0.0)。 - -## 安装项目依赖 - -推荐使用 `yarn`: - -```shell -yarn +## Project setup +``` +yarn install ``` -解决 `node-sass` 网络慢的方法: - -```shell -yarn config set sass-binary-site http://npm.taobao.org/mirrors/node-sass +### Compiles and hot-reloads for development ``` - -## 运行应用程序 - -安装过程完成后,运行以下命令启动服务。您可以在浏览器中预览网站 [http://localhost:9000](http://localhost:9000) - -```shell yarn serve ``` -## 极速 CRUD - -1. `vscode` 编辑器下输入关键字 `cl-crud`,会生成对应的模板代码: - -```html - -COOL-ADMIN
-正在加载资源...
-初次加载资源可能需要较多时间 请耐心等待
-Rz$KlnO_H2c< z(XX#lPuW_%H#Q+c&(nRyX1-Ia dKR-%$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filter(e => e.includes("icon")) .sort(); } diff --git a/src/cool/modules/base/components/avatar/index.vue b/src/cool/modules/base/components/avatar/index.vue index 1d8a7df..8486b48 100644 --- a/src/cool/modules/base/components/avatar/index.vue +++ b/src/cool/modules/base/components/avatar/index.vue @@ -1,17 +1,20 @@ - diff --git a/src/cool/modules/base/components/menu/slider/index.js b/src/cool/modules/base/components/menu/slider/index.js deleted file mode 100644 index 8fd7881..0000000 --- a/src/cool/modules/base/components/menu/slider/index.js +++ /dev/null @@ -1,92 +0,0 @@ -import { mapGetters } from "vuex"; -import "./index.scss"; - -export default { - name: "cl-menu-slider", - - data() { - return { - visible: true - }; - }, - - computed: { - ...mapGetters(["menuList", "menuCollapse", "browser", "app"]) - }, - - watch: { - menuList() { - this.refresh(); - }, - "app.conf.showAMenu"() { - this.$store.commit("SET_MENU_LIST"); - } - }, - - methods: { - toView(url) { - if (url != this.$route.path) { - this.$router.push(url); - } - }, - - refresh() { - this.visible = false; - - setTimeout(() => { - this.visible = true; - }, 0); - } - }, - - render() { - const fn = list => { - return list - .filter(e => e.isShow) - .map(e => { - let html = null; - - if (e.type == 0) { - html = ( -- - -+ ++ ++- - - ); - } else { - html = ( -- {e.name} - - {fn(e.children)} - - - ); - } - - return html; - }); - }; - - let el = fn(this.menuList); - - return ( - this.visible && ( - - ) - ); - } -}; diff --git a/src/cool/modules/base/components/menu/slider/index.scss b/src/cool/modules/base/components/menu/slider/index.scss index 47004b2..fb46bc4 100644 --- a/src/cool/modules/base/components/menu/slider/index.scss +++ b/src/cool/modules/base/components/menu/slider/index.scss @@ -30,6 +30,8 @@ .icon-svg { font-size: 16px; margin: 0 15px 0 5px; + position: relative; + top: 1px; } span { diff --git a/src/cool/modules/base/components/menu/slider/index.tsx b/src/cool/modules/base/components/menu/slider/index.tsx new file mode 100644 index 0000000..7d3ade7 --- /dev/null +++ b/src/cool/modules/base/components/menu/slider/index.tsx @@ -0,0 +1,122 @@ +import { useStore } from "vuex"; +import { computed, defineComponent, h, ref, watch } from "vue"; +import "./index.scss"; +import { useRoute, useRouter } from "vue-router"; + +export default defineComponent({ + name: "cl-menu-slider", + + setup() { + const router = useRouter(); + const route = useRoute(); + const store = useStore(); + + // 是否可见 + const visible = ref- {e.name} - (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) { + 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 + }, + { + title: () => { + return !ctx.menuCollapse ? ( + + + {e.name} + + ) : ( + + ); + }, + default() { + return deepMenu(e.children); + } + } + ); + } else { + html = h( + , + { + index: e.path, + key: e.id + }, + { + title() { + return {e.name}; + }, + default() { + return ; + } + } + ); + } + + return html; + }); + } + + const children = deepMenu(ctx.menuList); + + return ( + ctx.visible && ( + + ) + ); + } +}); diff --git a/src/cool/modules/base/components/menu/topbar.vue b/src/cool/modules/base/components/menu/topbar.vue index bfc39cd..a1b8dd5 100644 --- a/src/cool/modules/base/components/menu/topbar.vue +++ b/src/cool/modules/base/components/menu/topbar.vue @@ -1,5 +1,5 @@ -