From d2b249f9eaf34d26427fb4dbfbe26628e7567340 Mon Sep 17 00:00:00 2001 From: icssoa <2570063477@qq.com> Date: Fri, 2 Apr 2021 19:00:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=20vite=20=E6=89=93=E5=8C=85?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 10 +- src/cool/index.ts | 3 - .../modules/base/components/dept/check.vue | 4 +- .../modules/base/components/dept/move.tsx | 6 +- .../modules/base/components/dept/tree.vue | 43 ++- .../modules/base/components/menu/perms.vue | 4 +- .../modules/base/components/menu/tree.vue | 4 +- .../modules/base/components/process/index.vue | 2 +- .../modules/base/components/role/perms.vue | 4 +- .../modules/base/components/role/select.vue | 4 +- .../error-page/components/error-page.vue | 8 +- .../base/pages/login/components/captcha.vue | 4 +- src/cool/modules/base/store/menu.ts | 2 +- src/cool/modules/base/store/user.ts | 17 +- src/cool/modules/base/views/info.vue | 11 +- src/cool/modules/base/views/log.vue | 16 +- src/cool/modules/base/views/menu.vue | 8 +- src/cool/modules/base/views/param.vue | 6 +- src/cool/modules/base/views/plugin.vue | 14 +- src/cool/modules/base/views/role.vue | 6 +- src/cool/modules/base/views/user.vue | 12 +- src/cool/modules/chat/components/chat.vue | 4 +- src/cool/modules/chat/components/message.vue | 4 +- src/cool/modules/chat/components/notice.vue | 2 +- src/cool/modules/chat/components/session.vue | 49 ++-- src/cool/modules/copy/directives/index.ts | 1 - src/{ => cool/modules}/crud/assets/index.scss | 2 +- src/cool/modules/crud/common/index.ts | 0 .../modules}/crud/components/add-btn.tsx | 2 +- .../modules}/crud/components/adv-btn.tsx | 2 +- .../modules}/crud/components/adv-search.tsx | 67 ++--- .../components/context-menu/context-menu.tsx | 10 +- .../crud/components/context-menu/index.ts | 0 .../modules}/crud/components/crud/app.ts | 8 +- .../modules}/crud/components/crud/helper.ts | 9 +- .../modules}/crud/components/crud/index.tsx | 0 .../modules}/crud/components/dialog/helper.ts | 31 +-- .../modules}/crud/components/dialog/index.tsx | 13 +- .../crud/components/error-message.tsx | 0 .../modules}/crud/components/filter.tsx | 0 .../modules}/crud/components/flex1.tsx | 0 .../modules}/crud/components/form-tabs.tsx | 0 .../modules}/crud/components/form/helper.tsx | 0 .../modules}/crud/components/form/index.tsx | 0 .../modules}/crud/components/index.tsx | 0 .../crud/components/multi-delete-btn.tsx | 2 +- .../modules}/crud/components/pagination.tsx | 2 +- .../modules}/crud/components/query.tsx | 2 +- .../modules}/crud/components/refresh-btn.tsx | 2 +- .../modules}/crud/components/search-key.tsx | 26 +- .../modules}/crud/components/table/helper.tsx | 0 .../modules}/crud/components/table/index.tsx | 4 +- .../crud/components/upsert/helper.tsx | 0 .../modules}/crud/components/upsert/index.tsx | 115 ++++---- src/{ => cool/modules}/crud/hooks/core.ts | 0 src/{ => cool/modules}/crud/index.ts | 6 +- .../modules}/crud/types/adv-search.d.ts | 0 .../modules}/crud/types/browser.d.ts | 0 .../modules}/crud/types/context-menu.d.ts | 0 src/{ => cool/modules}/crud/types/crud.d.ts | 9 +- src/{ => cool/modules}/crud/types/form.d.ts | 0 src/{ => cool/modules}/crud/types/index.d.ts | 0 src/{ => cool/modules}/crud/types/op.d.ts | 5 +- src/{ => cool/modules}/crud/types/query.d.ts | 0 src/{ => cool/modules}/crud/types/render.d.ts | 0 src/{ => cool/modules}/crud/types/table.d.ts | 0 src/{ => cool/modules}/crud/types/upsert.d.ts | 0 src/{ => cool/modules}/crud/utils/index.ts | 4 +- src/{ => cool/modules}/crud/utils/mitt.ts | 0 src/{ => cool/modules}/crud/utils/parse.ts | 2 +- src/{ => cool/modules}/crud/utils/vnode.tsx | 0 .../demo/components/crud/adv-search.vue | 2 +- .../demo/components/crud/context-menu.vue | 2 +- .../modules/demo/components/crud/form.vue | 2 +- .../modules/demo/components/crud/query.vue | 2 +- .../modules/demo/components/crud/table.vue | 2 +- .../modules/demo/components/crud/upsert.vue | 2 +- src/cool/modules/demo/views/crud.vue | 10 +- src/cool/modules/task/views/task.vue | 22 +- src/cool/modules/theme/components/theme.vue | 16 +- src/cool/modules/upload/components/index.vue | 13 +- .../upload/components/space/category.vue | 15 +- .../upload/components/space/file-item.vue | 2 +- .../modules/upload/components/space/index.vue | 21 +- src/core/common/index.ts | 12 - src/core/index.ts | 2 +- src/core/set/module.ts | 21 +- src/core/set/router.ts | 16 +- src/core/set/service.ts | 12 +- src/core/types/index.d.ts | 2 +- src/core/utils/storage.ts | 12 +- src/crud/common/index.ts | 12 - src/pages/layout/topbar.vue | 7 +- src/router/index.ts | 5 +- vite.config.ts | 20 +- yarn-error.log | 16 +- yarn.lock | 258 +++++++++++++++--- 97 files changed, 605 insertions(+), 472 deletions(-) rename src/{ => cool/modules}/crud/assets/index.scss (99%) create mode 100644 src/cool/modules/crud/common/index.ts rename src/{ => cool/modules}/crud/components/add-btn.tsx (90%) rename src/{ => cool/modules}/crud/components/adv-btn.tsx (91%) rename src/{ => cool/modules}/crud/components/adv-search.tsx (85%) rename src/{ => cool/modules}/crud/components/context-menu/context-menu.tsx (95%) rename src/{ => cool/modules}/crud/components/context-menu/index.ts (100%) rename src/{ => cool/modules}/crud/components/crud/app.ts (87%) rename src/{ => cool/modules}/crud/components/crud/helper.ts (97%) rename src/{ => cool/modules}/crud/components/crud/index.tsx (100%) rename src/{ => cool/modules}/crud/components/dialog/helper.ts (80%) rename src/{ => cool/modules}/crud/components/dialog/index.tsx (95%) rename src/{ => cool/modules}/crud/components/error-message.tsx (100%) rename src/{ => cool/modules}/crud/components/filter.tsx (100%) rename src/{ => cool/modules}/crud/components/flex1.tsx (100%) rename src/{ => cool/modules}/crud/components/form-tabs.tsx (100%) rename src/{ => cool/modules}/crud/components/form/helper.tsx (100%) rename src/{ => cool/modules}/crud/components/form/index.tsx (100%) rename src/{ => cool/modules}/crud/components/index.tsx (100%) rename src/{ => cool/modules}/crud/components/multi-delete-btn.tsx (91%) rename src/{ => cool/modules}/crud/components/pagination.tsx (96%) rename src/{ => cool/modules}/crud/components/query.tsx (97%) rename src/{ => cool/modules}/crud/components/refresh-btn.tsx (89%) rename src/{ => cool/modules}/crud/components/search-key.tsx (80%) rename src/{ => cool/modules}/crud/components/table/helper.tsx (100%) rename src/{ => cool/modules}/crud/components/table/index.tsx (99%) rename src/{ => cool/modules}/crud/components/upsert/helper.tsx (100%) rename src/{ => cool/modules}/crud/components/upsert/index.tsx (74%) rename src/{ => cool/modules}/crud/hooks/core.ts (100%) rename src/{ => cool/modules}/crud/index.ts (94%) rename src/{ => cool/modules}/crud/types/adv-search.d.ts (100%) rename src/{ => cool/modules}/crud/types/browser.d.ts (100%) rename src/{ => cool/modules}/crud/types/context-menu.d.ts (100%) rename src/{ => cool/modules}/crud/types/crud.d.ts (94%) rename src/{ => cool/modules}/crud/types/form.d.ts (100%) rename src/{ => cool/modules}/crud/types/index.d.ts (100%) rename src/{ => cool/modules}/crud/types/op.d.ts (93%) rename src/{ => cool/modules}/crud/types/query.d.ts (100%) rename src/{ => cool/modules}/crud/types/render.d.ts (100%) rename src/{ => cool/modules}/crud/types/table.d.ts (100%) rename src/{ => cool/modules}/crud/types/upsert.d.ts (100%) rename src/{ => cool/modules}/crud/utils/index.ts (96%) rename src/{ => cool/modules}/crud/utils/mitt.ts (100%) rename src/{ => cool/modules}/crud/utils/parse.ts (88%) rename src/{ => cool/modules}/crud/utils/vnode.tsx (100%) delete mode 100644 src/crud/common/index.ts diff --git a/package.json b/package.json index 6cf98ab..1fb35ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "front-next", - "version": "0.1.0", + "version": "0.2.0", "scripts": { "dev": "vite", "build": "vue-tsc --noEmit --skipLibCheck && vite build", @@ -17,6 +17,7 @@ "core-js": "^3.6.5", "echarts": "^5.0.2", "element-plus": "1.0.2-beta.35", + "glob": "^7.1.6", "js-beautify": "^1.13.5", "lodash": "^4.17.21", "merge": "^2.1.1", @@ -27,7 +28,7 @@ "socket.io-client": "^4.0.0", "store": "^2.0.12", "uuid": "^8.3.2", - "vue": "^3.0.9", + "vue": "^3.0.11", "vue-echarts": "^6.0.0-rc.3", "vue-router": "^4.0.5", "vuedraggable": "^4.0.1", @@ -39,7 +40,7 @@ "@typescript-eslint/eslint-plugin": "^4.20.0", "@typescript-eslint/parser": "^4.20.0", "@vitejs/plugin-vue": "^1.1.5", - "@vitejs/plugin-vue-jsx": "^1.1.2", + "@vitejs/plugin-vue-jsx": "^1.1.3", "@vue/compiler-sfc": "^3.0.5", "eslint": "^7.23.0", "eslint-config-prettier": "^8.1.0", @@ -50,7 +51,8 @@ "sass-loader": "^11.0.1", "svg-sprite-loader": "^6.0.2", "typescript": "^4.1.3", - "vite": "^2.1.3", + "vite": "^2.1.5", + "vite-plugin-style-import": "^0.9.1", "vite-svg-loader": "^1.5.1", "vue-tsc": "^0.0.8" } diff --git a/src/cool/index.ts b/src/cool/index.ts index fa1936d..6025894 100644 --- a/src/cool/index.ts +++ b/src/cool/index.ts @@ -1,5 +1,3 @@ -import Crud from "../crud"; - export default { modules: [ // 基础模块 @@ -14,7 +12,6 @@ export default { }, { name: "crud", - value: Crud, options: { crud: { dict: { diff --git a/src/cool/modules/base/components/dept/check.vue b/src/cool/modules/base/components/dept/check.vue index 77e0504..68b869e 100644 --- a/src/cool/modules/base/components/dept/check.vue +++ b/src/cool/modules/base/components/dept/check.vue @@ -52,7 +52,7 @@ export default defineComponent({ setup(props, { emit }) { // 请求服务 - const $service = inject("service"); + const service = inject("service"); // 表单值 const form = inject("form"); @@ -81,7 +81,7 @@ export default defineComponent({ // 刷新树形列表 function refresh() { - $service.system.dept + service.system.dept .list() .then((res: any[]) => { list.value = deepTree(res); diff --git a/src/cool/modules/base/components/dept/move.tsx b/src/cool/modules/base/components/dept/move.tsx index 47e320d..12eb54e 100644 --- a/src/cool/modules/base/components/dept/move.tsx +++ b/src/cool/modules/base/components/dept/move.tsx @@ -9,7 +9,7 @@ export default defineComponent({ emits: ["success", "error"], setup(_: any, { emit }) { - const $service = inject("service"); + const service = inject("service"); const { refs, setRefs }: any = useRefs(); // 树形列表 @@ -17,7 +17,7 @@ export default defineComponent({ // 刷新列表 async function refresh() { - return await $service.system.dept.list().then(deepTree); + return await service.system.dept.list().then(deepTree); } // 转移 @@ -52,7 +52,7 @@ export default defineComponent({ type: "warning" }) .then(() => { - $service.system.user + service.system.user .move({ departmentId: id, userIds: ids diff --git a/src/cool/modules/base/components/dept/tree.vue b/src/cool/modules/base/components/dept/tree.vue index d43307d..9caad45 100644 --- a/src/cool/modules/base/components/dept/tree.vue +++ b/src/cool/modules/base/components/dept/tree.vue @@ -63,7 +63,7 @@