From 8c74e527a9aee2ac0e69e1d64279e0e13ab8f021 Mon Sep 17 00:00:00 2001 From: xingyu Date: Wed, 18 Jan 2023 14:23:45 +0800 Subject: [PATCH] perf: aotu import hooks --- yudao-ui-admin-vue3/build/vite/index.ts | 19 ++++++++++++++++++- yudao-ui-admin-vue3/package.json | 2 +- .../src/ContentDetailWrap.vue | 2 +- .../components/Cropper/src/CropperAvatar.vue | 2 +- .../src/components/Error/src/Error.vue | 1 - .../src/components/Form/src/helper.ts | 1 - .../src/components/Search/src/Search.vue | 2 +- .../components/UploadFile/src/UploadFile.vue | 2 +- .../components/UploadFile/src/UploadImg.vue | 3 +-- .../components/UploadFile/src/UploadImgs.vue | 2 +- .../src/components/Verifition/src/Verify.vue | 1 - .../Verifition/src/Verify/VerifyPoints.vue | 1 - .../Verifition/src/Verify/VerifySlide.vue | 1 - .../src/components/XTable/src/XTable.vue | 3 +-- .../src/config/axios/service.ts | 2 +- .../src/directives/permission/hasPermi.ts | 2 +- .../src/directives/permission/hasRole.ts | 2 +- .../src/hooks/web/useCrudSchemas.ts | 2 +- yudao-ui-admin-vue3/src/hooks/web/useIntro.ts | 2 +- yudao-ui-admin-vue3/src/hooks/web/useTable.ts | 2 +- yudao-ui-admin-vue3/src/hooks/web/useTitle.ts | 1 - .../src/hooks/web/useValidator.ts | 2 -- .../src/hooks/web/useVxeCrudSchemas.ts | 2 +- .../src/hooks/web/useVxeGrid.ts | 3 +-- .../components/Breadcrumb/src/Breadcrumb.vue | 2 +- .../ContextMenu/src/ContextMenu.vue | 2 +- .../src/components/useRenderMenuTitle.tsx | 1 - .../layout/components/Setting/src/Setting.vue | 2 +- .../src/components/InterfaceDisplay.vue | 2 +- .../SizeDropdown/src/SizeDropdown.vue | 2 +- .../layout/components/TabMenu/src/TabMenu.vue | 2 +- .../components/TagsView/src/TagsView.vue | 2 +- .../components/UserInfo/src/UserInfo.vue | 2 +- .../vxeTable/renderer/dataTimeRangePicker.tsx | 1 - .../src/router/modules/remaining.ts | 2 +- .../src/types/auto-imports.d.ts | 6 ++++++ yudao-ui-admin-vue3/src/utils/formRules.ts | 2 -- yudao-ui-admin-vue3/src/views/Home/Index.vue | 2 +- yudao-ui-admin-vue3/src/views/Home/Index2.vue | 2 +- .../src/views/Home/echarts-data.ts | 1 - yudao-ui-admin-vue3/src/views/Login/Login.vue | 2 +- .../src/views/Login/components/LoginForm.vue | 5 ++--- .../views/Login/components/LoginFormTitle.vue | 1 - .../src/views/Login/components/MobileForm.vue | 5 ++--- .../src/views/Login/components/QrCodeForm.vue | 2 +- .../views/Login/components/RegisterForm.vue | 2 +- .../src/views/Profile/Index.vue | 1 - .../views/Profile/components/BasicInfo.vue | 2 +- .../views/Profile/components/ProfileUser.vue | 2 +- .../src/views/Profile/components/ResetPwd.vue | 3 +-- .../views/Profile/components/UserSocial.vue | 1 - .../src/views/bpm/form/form.data.ts | 3 --- .../src/views/bpm/form/index.vue | 9 ++++----- .../src/views/bpm/group/group.data.ts | 3 --- .../src/views/bpm/group/index.vue | 7 +++---- .../src/views/bpm/model/index.vue | 5 ++--- .../src/views/bpm/model/model.data.ts | 3 --- .../src/views/bpm/processInstance/index.vue | 6 +++--- .../views/bpm/processInstance/process.data.ts | 2 -- .../src/views/bpm/task/done/done.data.ts | 2 -- .../src/views/bpm/task/done/index.vue | 3 +-- .../src/views/bpm/task/todo/done.data.ts | 1 - .../infra/apiAccessLog/apiAccessLog.data.ts | 3 +-- .../src/views/infra/apiAccessLog/index.vue | 2 -- .../infra/apiErrorLog/apiErrorLog.data.ts | 3 +-- .../src/views/infra/apiErrorLog/index.vue | 3 --- .../src/views/infra/codegen/EditTable.vue | 2 -- .../src/views/infra/codegen/codegen.data.ts | 4 +--- .../codegen/components/BasicInfoForm.vue | 5 ++--- .../infra/codegen/components/ImportTable.vue | 2 -- .../infra/codegen/components/Preview.vue | 2 -- .../src/views/infra/codegen/index.vue | 3 --- .../src/views/infra/config/config.data.ts | 5 +---- .../src/views/infra/config/index.vue | 4 +--- .../dataSourceConfig/dataSourceConfig.data.ts | 4 +--- .../views/infra/dataSourceConfig/index.vue | 4 +--- .../src/views/infra/dbDoc/index.vue | 2 +- .../views/infra/fileConfig/fileConfig.data.ts | 5 +---- .../src/views/infra/fileConfig/index.vue | 4 +--- .../src/views/infra/fileList/fileList.data.ts | 3 +-- .../src/views/infra/fileList/index.vue | 3 --- .../src/views/infra/job/JobLog.vue | 3 +-- .../src/views/infra/job/index.vue | 3 --- .../src/views/infra/job/job.data.ts | 5 +---- .../src/views/infra/job/jobLog.data.ts | 4 +--- .../src/views/infra/redis/index.vue | 3 +-- .../src/views/pay/app/app.data.ts | 5 +---- .../src/views/pay/app/index.vue | 3 --- .../src/views/pay/merchant/index.vue | 3 --- .../src/views/pay/merchant/merchant.data.ts | 5 +---- .../src/views/pay/order/index.vue | 2 -- .../src/views/pay/order/order.data.ts | 5 +---- .../src/views/pay/refund/index.vue | 2 -- .../src/views/pay/refund/refund.data.ts | 4 +--- .../src/views/system/dept/dept.data.ts | 6 ++---- .../src/views/system/dept/index.vue | 3 --- .../src/views/system/dict/dict.data.ts | 5 +---- .../src/views/system/dict/dict.type.ts | 5 +---- .../src/views/system/dict/index.vue | 3 --- .../views/system/errorCode/errorCode.data.ts | 5 +---- .../src/views/system/errorCode/index.vue | 4 +--- .../src/views/system/loginlog/index.vue | 3 --- .../views/system/loginlog/loginLog.data.ts | 3 +-- .../src/views/system/menu/index.vue | 3 --- .../src/views/system/menu/menu.data.ts | 5 +---- .../src/views/system/notice/index.vue | 3 --- .../src/views/system/notice/notice.data.ts | 5 +---- .../views/system/oauth2/client/client.data.ts | 4 +--- .../src/views/system/oauth2/client/index.vue | 3 --- .../src/views/system/oauth2/token/index.vue | 4 ---- .../views/system/oauth2/token/token.data.ts | 4 +--- .../src/views/system/operatelog/index.vue | 3 --- .../system/operatelog/operatelog.data.ts | 4 +--- .../src/views/system/post/index.vue | 3 --- .../src/views/system/post/post.data.ts | 5 +---- .../src/views/system/role/index.vue | 3 --- .../src/views/system/role/role.data.ts | 5 +---- .../src/views/system/sensitiveWord/index.vue | 3 --- .../sensitiveWord/sensitiveWord.data.ts | 5 +---- .../src/views/system/sms/smsChannel/index.vue | 4 ---- .../system/sms/smsChannel/sms.channel.data.ts | 5 +---- .../src/views/system/sms/smsLog/index.vue | 3 --- .../views/system/sms/smsLog/sms.log.data.ts | 4 +--- .../views/system/sms/smsTemplate/index.vue | 4 ---- .../sms/smsTemplate/sms.template.data.ts | 5 +---- .../src/views/system/tenant/index.vue | 3 --- .../src/views/system/tenant/tenant.data.ts | 5 +---- .../src/views/system/tenantPackage/index.vue | 3 --- .../tenantPackage/tenantPackage.data.ts | 5 +---- .../src/views/system/user/index.vue | 3 --- .../src/views/system/user/user.data.ts | 5 +---- yudao-ui-admin-vue3/use.md | 1 - 132 files changed, 116 insertions(+), 308 deletions(-) diff --git a/yudao-ui-admin-vue3/build/vite/index.ts b/yudao-ui-admin-vue3/build/vite/index.ts index 34ffc9b1c..fe03700a4 100644 --- a/yudao-ui-admin-vue3/build/vite/index.ts +++ b/yudao-ui-admin-vue3/build/vite/index.ts @@ -32,7 +32,24 @@ export function createVitePlugins(VITE_APP_TITLE: string) { PurgeIcons(), vueSetupExtend(), AutoImport({ - imports: ['vue', 'vue-router'], + include: [ + /\.[tj]sx?$/, // .ts, .tsx, .js, .jsx + /\.vue$/, + /\.vue\?vue/, // .vue + /\.md$/ // .md + ], + imports: [ + 'vue', + 'vue-router', + { + '@/hooks/web/useI18n': ['useI18n'], + '@/hooks/web/useXTable': ['useXTable'], + '@/hooks/web/useMessage': ['useMessage'], + '@/hooks/web/useVxeCrudSchemas': ['useVxeCrudSchemas'], + '@/utils/formRules': ['required'], + '@/utils/dict': ['DICT_TYPE'] + } + ], dts: 'src/types/auto-imports.d.ts', resolvers: [ElementPlusResolver()], eslintrc: { diff --git a/yudao-ui-admin-vue3/package.json b/yudao-ui-admin-vue3/package.json index b5528eea1..4a12c1be9 100644 --- a/yudao-ui-admin-vue3/package.json +++ b/yudao-ui-admin-vue3/package.json @@ -1,6 +1,6 @@ { "name": "yudao-ui-admin-vue3", - "version": "1.6.6-snapshot.1923", + "version": "1.6.6-snapshot.1925", "description": "基于vue3、vite4、element-plus、typesScript", "author": "xingyu", "private": false, diff --git a/yudao-ui-admin-vue3/src/components/ContentDetailWrap/src/ContentDetailWrap.vue b/yudao-ui-admin-vue3/src/components/ContentDetailWrap/src/ContentDetailWrap.vue index d99105627..697ea18a7 100644 --- a/yudao-ui-admin-vue3/src/components/ContentDetailWrap/src/ContentDetailWrap.vue +++ b/yudao-ui-admin-vue3/src/components/ContentDetailWrap/src/ContentDetailWrap.vue @@ -1,7 +1,7 @@