Commit 3e1ce8b76aeb53f336c3977bbf67f59a44f983ef

Authored by xingyu4j
1 parent cbb6a379

perf: add aotu components

yudao-ui-admin-vue3/package.json
@@ -38,8 +38,8 @@ @@ -38,8 +38,8 @@
38 "echarts-wordcloud": "^2.0.0", 38 "echarts-wordcloud": "^2.0.0",
39 "element-plus": "2.2.21", 39 "element-plus": "2.2.21",
40 "intro.js": "^6.0.0", 40 "intro.js": "^6.0.0",
41 - "jsencrypt": "^3.3.1",  
42 "js-cookie": "^3.0.1", 41 "js-cookie": "^3.0.1",
  42 + "jsencrypt": "^3.3.1",
43 "lodash-es": "^4.17.21", 43 "lodash-es": "^4.17.21",
44 "mitt": "^3.0.0", 44 "mitt": "^3.0.0",
45 "nprogress": "^0.2.0", 45 "nprogress": "^0.2.0",
@@ -94,6 +94,7 @@ @@ -94,6 +94,7 @@
94 "stylelint-config-standard": "^29.0.0", 94 "stylelint-config-standard": "^29.0.0",
95 "stylelint-order": "^5.0.0", 95 "stylelint-order": "^5.0.0",
96 "typescript": "4.8.4", 96 "typescript": "4.8.4",
  97 + "unplugin-vue-components": "^0.22.9",
97 "unplugin-vue-macros": "^0.16.3", 98 "unplugin-vue-macros": "^0.16.3",
98 "vite": "3.2.4", 99 "vite": "3.2.4",
99 "vite-plugin-compression": "^0.5.1", 100 "vite-plugin-compression": "^0.5.1",
yudao-ui-admin-vue3/pnpm-lock.yaml
@@ -59,6 +59,7 @@ specifiers: @@ -59,6 +59,7 @@ specifiers:
59 stylelint-config-standard: ^29.0.0 59 stylelint-config-standard: ^29.0.0
60 stylelint-order: ^5.0.0 60 stylelint-order: ^5.0.0
61 typescript: 4.8.4 61 typescript: 4.8.4
  62 + unplugin-vue-components: ^0.22.9
62 unplugin-vue-macros: ^0.16.3 63 unplugin-vue-macros: ^0.16.3
63 url: ^0.11.0 64 url: ^0.11.0
64 vite: 3.2.4 65 vite: 3.2.4
@@ -150,6 +151,7 @@ devDependencies: @@ -150,6 +151,7 @@ devDependencies:
150 stylelint-config-standard: 29.0.0_stylelint@14.15.0 151 stylelint-config-standard: 29.0.0_stylelint@14.15.0
151 stylelint-order: 5.0.0_stylelint@14.15.0 152 stylelint-order: 5.0.0_stylelint@14.15.0
152 typescript: 4.8.4 153 typescript: 4.8.4
  154 + unplugin-vue-components: 0.22.9_rollup@3.3.0+vue@3.2.45
153 unplugin-vue-macros: 0.16.3_drqowttw7xgwfzqyhu6wuedde4 155 unplugin-vue-macros: 0.16.3_drqowttw7xgwfzqyhu6wuedde4
154 vite: 3.2.4_mp5lu76ee5qtwstsyca37sdhqi 156 vite: 3.2.4_mp5lu76ee5qtwstsyca37sdhqi
155 vite-plugin-compression: 0.5.1_vite@3.2.4 157 vite-plugin-compression: 0.5.1_vite@3.2.4
@@ -963,6 +965,21 @@ packages: @@ -963,6 +965,21 @@ packages:
963 picomatch: 2.3.1 965 picomatch: 2.3.1
964 dev: true 966 dev: true
965 967
  968 + /@rollup/pluginutils/5.0.2_rollup@3.3.0:
  969 + resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==}
  970 + engines: {node: '>=14.0.0'}
  971 + peerDependencies:
  972 + rollup: ^1.20.0||^2.0.0||^3.0.0
  973 + peerDependenciesMeta:
  974 + rollup:
  975 + optional: true
  976 + dependencies:
  977 + '@types/estree': 1.0.0
  978 + estree-walker: 2.0.2
  979 + picomatch: 2.3.1
  980 + rollup: 3.3.0
  981 + dev: true
  982 +
966 /@sxzz/popperjs-es/2.11.7: 983 /@sxzz/popperjs-es/2.11.7:
967 resolution: {integrity: sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ==} 984 resolution: {integrity: sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ==}
968 dev: false 985 dev: false
@@ -6829,6 +6846,32 @@ packages: @@ -6829,6 +6846,32 @@ packages:
6829 vite: 3.2.4_mp5lu76ee5qtwstsyca37sdhqi 6846 vite: 3.2.4_mp5lu76ee5qtwstsyca37sdhqi
6830 dev: true 6847 dev: true
6831 6848
  6849 + /unplugin-vue-components/0.22.9_rollup@3.3.0+vue@3.2.45:
  6850 + resolution: {integrity: sha512-qBvooq3EgpjtYicxeccRUGUBBQCCw9rJ0kHPZPOSJd8TBZViSv86vuKLTRDHPyjWtclwOIkVStZJfPdJFhYUMw==}
  6851 + engines: {node: '>=14'}
  6852 + peerDependencies:
  6853 + '@babel/parser': ^7.15.8
  6854 + vue: 2 || 3
  6855 + peerDependenciesMeta:
  6856 + '@babel/parser':
  6857 + optional: true
  6858 + dependencies:
  6859 + '@antfu/utils': 0.6.0
  6860 + '@rollup/pluginutils': 5.0.2_rollup@3.3.0
  6861 + chokidar: 3.5.3
  6862 + debug: 4.3.4
  6863 + fast-glob: 3.2.12
  6864 + local-pkg: 0.4.2
  6865 + magic-string: 0.26.7
  6866 + minimatch: 5.1.0
  6867 + resolve: 1.22.1
  6868 + unplugin: 0.10.2
  6869 + vue: 3.2.45
  6870 + transitivePeerDependencies:
  6871 + - rollup
  6872 + - supports-color
  6873 + dev: true
  6874 +
6832 /unplugin-vue-define-options/0.12.7: 6875 /unplugin-vue-define-options/0.12.7:
6833 resolution: {integrity: sha512-relFORVPLDs4dd3ogEti5YyAqQ62XEieRgLu/OrDIRZdSZQ942pydf9ilfLFiFwCUt+EES/2Xl4EERtgP1T/og==} 6876 resolution: {integrity: sha512-relFORVPLDs4dd3ogEti5YyAqQ62XEieRgLu/OrDIRZdSZQ942pydf9ilfLFiFwCUt+EES/2Xl4EERtgP1T/og==}
6834 engines: {node: '>=14.19.0'} 6877 engines: {node: '>=14.19.0'}
yudao-ui-admin-vue3/src/auto-components.d.ts 0 → 100644
  1 +// generated by unplugin-vue-components
  2 +// We suggest you to commit this file into source control
  3 +// Read more: https://github.com/vuejs/core/pull/3399
  4 +import '@vue/runtime-core'
  5 +
  6 +export {}
  7 +
  8 +declare module '@vue/runtime-core' {
  9 + export interface GlobalComponents {
  10 + Backtop: typeof import('./components/Backtop/src/Backtop.vue')['default']
  11 + Breadcrumb: typeof import('./components/Breadcrumb/src/Breadcrumb.vue')['default']
  12 + Collapse: typeof import('./components/Collapse/src/Collapse.vue')['default']
  13 + ColorRadioPicker: typeof import('./components/Setting/src/components/ColorRadioPicker.vue')['default']
  14 + ConfigGlobal: typeof import('./components/ConfigGlobal/src/ConfigGlobal.vue')['default']
  15 + ContentDetailWrap: typeof import('./components/ContentDetailWrap/src/ContentDetailWrap.vue')['default']
  16 + ContentWrap: typeof import('./components/ContentWrap/src/ContentWrap.vue')['default']
  17 + ContextMenu: typeof import('./components/ContextMenu/src/ContextMenu.vue')['default']
  18 + CountTo: typeof import('./components/CountTo/src/CountTo.vue')['default']
  19 + Crontab: typeof import('./components/Crontab/src/Crontab.vue')['default']
  20 + Descriptions: typeof import('./components/Descriptions/src/Descriptions.vue')['default']
  21 + Dialog: typeof import('./components/Dialog/src/Dialog.vue')['default']
  22 + DictTag: typeof import('./components/DictTag/src/DictTag.vue')['default']
  23 + Echart: typeof import('./components/Echart/src/Echart.vue')['default']
  24 + Editor: typeof import('./components/Editor/src/Editor.vue')['default']
  25 + ElButton: typeof import('element-plus/es')['ElButton']
  26 + ElCard: typeof import('element-plus/es')['ElCard']
  27 + ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
  28 + ElCol: typeof import('element-plus/es')['ElCol']
  29 + ElForm: typeof import('element-plus/es')['ElForm']
  30 + ElFormItem: typeof import('element-plus/es')['ElFormItem']
  31 + ElInput: typeof import('element-plus/es')['ElInput']
  32 + ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
  33 + ElOption: typeof import('element-plus/es')['ElOption']
  34 + ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
  35 + ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
  36 + ElRow: typeof import('element-plus/es')['ElRow']
  37 + ElSelect: typeof import('element-plus/es')['ElSelect']
  38 + ElSwitch: typeof import('element-plus/es')['ElSwitch']
  39 + ElTag: typeof import('element-plus/es')['ElTag']
  40 + ElTransfer: typeof import('element-plus/es')['ElTransfer']
  41 + ElTree: typeof import('element-plus/es')['ElTree']
  42 + ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
  43 + ElUpload: typeof import('element-plus/es')['ElUpload']
  44 + Error: typeof import('./components/Error/src/Error.vue')['default']
  45 + Footer: typeof import('./components/Footer/src/Footer.vue')['default']
  46 + Form: typeof import('./components/Form/src/Form.vue')['default']
  47 + Highlight: typeof import('./components/Highlight/src/Highlight.vue')['default']
  48 + Icon: typeof import('./components/Icon/src/Icon.vue')['default']
  49 + IconSelect: typeof import('./components/Icon/src/IconSelect.vue')['default']
  50 + IFrame: typeof import('./components/IFrame/src/IFrame.vue')['default']
  51 + ImageViewer: typeof import('./components/ImageViewer/src/ImageViewer.vue')['default']
  52 + Infotip: typeof import('./components/Infotip/src/Infotip.vue')['default']
  53 + InputPassword: typeof import('./components/InputPassword/src/InputPassword.vue')['default']
  54 + InterfaceDisplay: typeof import('./components/Setting/src/components/InterfaceDisplay.vue')['default']
  55 + LayoutRadioPicker: typeof import('./components/Setting/src/components/LayoutRadioPicker.vue')['default']
  56 + LocaleDropdown: typeof import('./components/LocaleDropdown/src/LocaleDropdown.vue')['default']
  57 + Logo: typeof import('./components/Logo/src/Logo.vue')['default']
  58 + Menu: typeof import('./components/Menu/src/Menu.vue')['default']
  59 + Qrcode: typeof import('./components/Qrcode/src/Qrcode.vue')['default']
  60 + RouterLink: typeof import('vue-router')['RouterLink']
  61 + RouterView: typeof import('vue-router')['RouterView']
  62 + Screenfull: typeof import('./components/Screenfull/src/Screenfull.vue')['default']
  63 + Search: typeof import('./components/Search/src/Search.vue')['default']
  64 + Setting: typeof import('./components/Setting/src/Setting.vue')['default']
  65 + SizeDropdown: typeof import('./components/SizeDropdown/src/SizeDropdown.vue')['default']
  66 + Sticky: typeof import('./components/Sticky/src/Sticky.vue')['default']
  67 + Table: typeof import('./components/Table/src/Table.vue')['default']
  68 + TabMenu: typeof import('./components/TabMenu/src/TabMenu.vue')['default']
  69 + TagsView: typeof import('./components/TagsView/src/TagsView.vue')['default']
  70 + ThemeSwitch: typeof import('./components/ThemeSwitch/src/ThemeSwitch.vue')['default']
  71 + Tooltip: typeof import('./components/Tooltip/src/Tooltip.vue')['default']
  72 + UserInfo: typeof import('./components/UserInfo/src/UserInfo.vue')['default']
  73 + Verify: typeof import('./components/Verifition/src/Verify.vue')['default']
  74 + VerifyPoints: typeof import('./components/Verifition/src/Verify/VerifyPoints.vue')['default']
  75 + VerifySlide: typeof import('./components/Verifition/src/Verify/VerifySlide.vue')['default']
  76 + XButton: typeof import('./components/XButton/src/XButton.vue')['default']
  77 + XModal: typeof import('./components/XModal/src/XModal.vue')['default']
  78 + XTextButton: typeof import('./components/XButton/src/XTextButton.vue')['default']
  79 + }
  80 + export interface ComponentCustomProperties {
  81 + vLoading: typeof import('element-plus/es')['ElLoadingDirective']
  82 + }
  83 +}
yudao-ui-admin-vue3/src/views/system/dept/index.vue
@@ -103,11 +103,10 @@ @@ -103,11 +103,10 @@
103 </template> 103 </template>
104 <script setup lang="ts"> 104 <script setup lang="ts">
105 import { useI18n } from '@/hooks/web/useI18n' 105 import { useI18n } from '@/hooks/web/useI18n'
106 -import { ElInput, ElCard, ElTree, ElTreeSelect, ElSelect, ElOption } from 'element-plus'  
107 import { handleTree } from '@/utils/tree' 106 import { handleTree } from '@/utils/tree'
108 import { onMounted, ref, unref, watch } from 'vue' 107 import { onMounted, ref, unref, watch } from 'vue'
109 import * as DeptApi from '@/api/system/dept' 108 import * as DeptApi from '@/api/system/dept'
110 -import { Form, FormExpose } from '@/components/Form' 109 +import { FormExpose } from '@/components/Form'
111 import { modelSchema, rules } from './dept.data' 110 import { modelSchema, rules } from './dept.data'
112 import { DeptVO } from '@/api/system/dept/types' 111 import { DeptVO } from '@/api/system/dept/types'
113 import { useMessage } from '@/hooks/web/useMessage' 112 import { useMessage } from '@/hooks/web/useMessage'
yudao-ui-admin-vue3/src/views/system/dict/index.vue
@@ -159,11 +159,9 @@ import { ref, unref, onMounted } from &#39;vue&#39; @@ -159,11 +159,9 @@ import { ref, unref, onMounted } from &#39;vue&#39;
159 import { DICT_TYPE } from '@/utils/dict' 159 import { DICT_TYPE } from '@/utils/dict'
160 import { useI18n } from '@/hooks/web/useI18n' 160 import { useI18n } from '@/hooks/web/useI18n'
161 import { FormExpose } from '@/components/Form' 161 import { FormExpose } from '@/components/Form'
162 -import { ElInput, ElTag } from 'element-plus'  
163 import * as DictTypeSchemas from './dict.type' 162 import * as DictTypeSchemas from './dict.type'
164 import * as DictDataSchemas from './dict.data' 163 import * as DictDataSchemas from './dict.data'
165 import { useTable } from '@/hooks/web/useTable' 164 import { useTable } from '@/hooks/web/useTable'
166 -import { ElCard, ElMessage } from 'element-plus'  
167 import * as DictTypeApi from '@/api/system/dict/dict.type' 165 import * as DictTypeApi from '@/api/system/dict/dict.type'
168 import * as DictDataApi from '@/api/system/dict/dict.data' 166 import * as DictDataApi from '@/api/system/dict/dict.data'
169 import { DictDataVO, DictTypeVO } from '@/api/system/dict/types' 167 import { DictDataVO, DictTypeVO } from '@/api/system/dict/types'
yudao-ui-admin-vue3/src/views/system/menu/index.vue
@@ -247,20 +247,7 @@ @@ -247,20 +247,7 @@
247 import { onMounted, reactive, ref } from 'vue' 247 import { onMounted, reactive, ref } from 'vue'
248 import { useI18n } from '@/hooks/web/useI18n' 248 import { useI18n } from '@/hooks/web/useI18n'
249 import { useMessage } from '@/hooks/web/useMessage' 249 import { useMessage } from '@/hooks/web/useMessage'
250 -import {  
251 - ElRow,  
252 - ElCol,  
253 - ElForm,  
254 - ElFormItem,  
255 - ElInput,  
256 - ElInputNumber,  
257 - ElSelect,  
258 - ElTreeSelect,  
259 - ElOption,  
260 - ElRadioGroup,  
261 - ElRadioButton,  
262 - FormInstance  
263 -} from 'element-plus' 250 +import { FormInstance } from 'element-plus'
264 import { Tooltip } from '@/components/Tooltip' 251 import { Tooltip } from '@/components/Tooltip'
265 import { IconSelect } from '@/components/Icon' 252 import { IconSelect } from '@/components/Icon'
266 import { VxeTableInstance } from 'vxe-table' 253 import { VxeTableInstance } from 'vxe-table'
yudao-ui-admin-vue3/src/views/system/role/index.vue
@@ -143,25 +143,16 @@ @@ -143,25 +143,16 @@
143 </template> 143 </template>
144 <script setup lang="ts"> 144 <script setup lang="ts">
145 import { onMounted, reactive, ref, unref } from 'vue' 145 import { onMounted, reactive, ref, unref } from 'vue'
146 -import {  
147 - ElForm,  
148 - ElFormItem,  
149 - ElSelect,  
150 - ElOption,  
151 - ElTree,  
152 - ElCard,  
153 - ElSwitch,  
154 - ElTag  
155 -} from 'element-plus'  
156 -import { DICT_TYPE, getDictOptions } from '@/utils/dict' 146 +import { ElTree } from 'element-plus'
157 import { useI18n } from '@/hooks/web/useI18n' 147 import { useI18n } from '@/hooks/web/useI18n'
158 import { useMessage } from '@/hooks/web/useMessage' 148 import { useMessage } from '@/hooks/web/useMessage'
  149 +import { useVxeGrid } from '@/hooks/web/useVxeGrid'
159 import { FormExpose } from '@/components/Form' 150 import { FormExpose } from '@/components/Form'
160 -import { rules, allSchemas } from './role.data' 151 +import { VxeGridInstance } from 'vxe-table'
161 import { handleTree } from '@/utils/tree' 152 import { handleTree } from '@/utils/tree'
162 import { SystemDataScopeEnum } from '@/utils/constants' 153 import { SystemDataScopeEnum } from '@/utils/constants'
163 -import { useVxeGrid } from '@/hooks/web/useVxeGrid'  
164 -import { VxeGridInstance } from 'vxe-table' 154 +import { DICT_TYPE, getDictOptions } from '@/utils/dict'
  155 +import { rules, allSchemas } from './role.data'
165 import * as RoleApi from '@/api/system/role' 156 import * as RoleApi from '@/api/system/role'
166 import { listSimpleMenusApi } from '@/api/system/menu' 157 import { listSimpleMenusApi } from '@/api/system/menu'
167 import { listSimpleDeptApi } from '@/api/system/dept' 158 import { listSimpleDeptApi } from '@/api/system/dept'
@@ -170,6 +161,7 @@ import type { @@ -170,6 +161,7 @@ import type {
170 PermissionAssignRoleDataScopeReqVO, 161 PermissionAssignRoleDataScopeReqVO,
171 PermissionAssignRoleMenuReqVO 162 PermissionAssignRoleMenuReqVO
172 } from '@/api/system/permission/types' 163 } from '@/api/system/permission/types'
  164 +
173 const { t } = useI18n() // 国际化 165 const { t } = useI18n() // 国际化
174 const message = useMessage() // 消息弹窗 166 const message = useMessage() // 消息弹窗
175 // 列表相关的变量 167 // 列表相关的变量
yudao-ui-admin-vue3/src/views/system/sensitiveWord/index.vue
@@ -114,7 +114,7 @@ @@ -114,7 +114,7 @@
114 <script setup lang="ts"> 114 <script setup lang="ts">
115 import { onMounted, ref, unref } from 'vue' 115 import { onMounted, ref, unref } from 'vue'
116 import dayjs from 'dayjs' 116 import dayjs from 'dayjs'
117 -import { ElMessage, ElTag, ElSelect, ElOption } from 'element-plus' 117 +import { useMessage } from '@/hooks/web/useMessage'
118 import { DICT_TYPE } from '@/utils/dict' 118 import { DICT_TYPE } from '@/utils/dict'
119 import { useTable } from '@/hooks/web/useTable' 119 import { useTable } from '@/hooks/web/useTable'
120 import { useI18n } from '@/hooks/web/useI18n' 120 import { useI18n } from '@/hooks/web/useI18n'
@@ -122,7 +122,9 @@ import { FormExpose } from &#39;@/components/Form&#39; @@ -122,7 +122,9 @@ import { FormExpose } from &#39;@/components/Form&#39;
122 import type { SensitiveWordVO } from '@/api/system/sensitiveWord/types' 122 import type { SensitiveWordVO } from '@/api/system/sensitiveWord/types'
123 import { rules, allSchemas } from './sensitiveWord.data' 123 import { rules, allSchemas } from './sensitiveWord.data'
124 import * as SensitiveWordApi from '@/api/system/sensitiveWord' 124 import * as SensitiveWordApi from '@/api/system/sensitiveWord'
  125 +
125 const { t } = useI18n() // 国际化 126 const { t } = useI18n() // 国际化
  127 +const message = useMessage() // 消息弹窗
126 128
127 // ========== 列表相关 ========== 129 // ========== 列表相关 ==========
128 const { register, tableObject, methods } = useTable<SensitiveWordVO>({ 130 const { register, tableObject, methods } = useTable<SensitiveWordVO>({
@@ -180,10 +182,10 @@ const submitForm = async () =&gt; { @@ -180,10 +182,10 @@ const submitForm = async () =&gt; {
180 data.tags = tags.value 182 data.tags = tags.value
181 if (actionType.value === 'create') { 183 if (actionType.value === 'create') {
182 await SensitiveWordApi.createSensitiveWordApi(data) 184 await SensitiveWordApi.createSensitiveWordApi(data)
183 - ElMessage.success(t('common.createSuccess')) 185 + message.success(t('common.createSuccess'))
184 } else { 186 } else {
185 await SensitiveWordApi.updateSensitiveWordApi(data) 187 await SensitiveWordApi.updateSensitiveWordApi(data)
186 - ElMessage.success(t('common.updateSuccess')) 188 + message.success(t('common.updateSuccess'))
187 } 189 }
188 // 操作成功,重新加载列表 190 // 操作成功,重新加载列表
189 dialogVisible.value = false 191 dialogVisible.value = false
yudao-ui-admin-vue3/src/views/system/sms/smsTemplate/index.vue
@@ -118,7 +118,6 @@ import { useMessage } from &#39;@/hooks/web/useMessage&#39; @@ -118,7 +118,6 @@ import { useMessage } from &#39;@/hooks/web/useMessage&#39;
118 import { useVxeGrid } from '@/hooks/web/useVxeGrid' 118 import { useVxeGrid } from '@/hooks/web/useVxeGrid'
119 import { VxeGridInstance } from 'vxe-table' 119 import { VxeGridInstance } from 'vxe-table'
120 import { FormExpose } from '@/components/Form' 120 import { FormExpose } from '@/components/Form'
121 -import { ElForm, ElFormItem, ElInput } from 'element-plus'  
122 // 业务相关的 import 121 // 业务相关的 import
123 import * as SmsTemplateApi from '@/api/system/sms/smsTemplate' 122 import * as SmsTemplateApi from '@/api/system/sms/smsTemplate'
124 import { rules, allSchemas } from './sms.template.data' 123 import { rules, allSchemas } from './sms.template.data'
yudao-ui-admin-vue3/src/views/system/tenant/index.vue
@@ -124,17 +124,19 @@ @@ -124,17 +124,19 @@
124 <script setup lang="ts"> 124 <script setup lang="ts">
125 import { ref, unref, onMounted } from 'vue' 125 import { ref, unref, onMounted } from 'vue'
126 import dayjs from 'dayjs' 126 import dayjs from 'dayjs'
127 -import { ElMessage, ElTag, ElSelect, ElOption } from 'element-plus'  
128 import { DICT_TYPE } from '@/utils/dict' 127 import { DICT_TYPE } from '@/utils/dict'
129 import { useTable } from '@/hooks/web/useTable' 128 import { useTable } from '@/hooks/web/useTable'
130 import { useI18n } from '@/hooks/web/useI18n' 129 import { useI18n } from '@/hooks/web/useI18n'
  130 +import { useMessage } from '@/hooks/web/useMessage'
131 import { FormExpose } from '@/components/Form' 131 import { FormExpose } from '@/components/Form'
132 import type { TenantVO } from '@/api/system/tenant/types' 132 import type { TenantVO } from '@/api/system/tenant/types'
133 import { rules, allSchemas } from './tenant.data' 133 import { rules, allSchemas } from './tenant.data'
134 import * as TenantApi from '@/api/system/tenant' 134 import * as TenantApi from '@/api/system/tenant'
135 import { getTenantPackageList } from '@/api/system/tenantPackage' 135 import { getTenantPackageList } from '@/api/system/tenantPackage'
136 import { TenantPackageVO } from '@/api/system/tenantPackage/types' 136 import { TenantPackageVO } from '@/api/system/tenantPackage/types'
  137 +
137 const { t } = useI18n() // 国际化 138 const { t } = useI18n() // 国际化
  139 +const message = useMessage() // 消息弹窗
138 140
139 // ========== 列表相关 ========== 141 // ========== 列表相关 ==========
140 const { register, tableObject, methods } = useTable<TenantVO>({ 142 const { register, tableObject, methods } = useTable<TenantVO>({
@@ -205,11 +207,11 @@ const submitForm = async () =&gt; { @@ -205,11 +207,11 @@ const submitForm = async () =&gt; {
205 if (actionType.value === 'create') { 207 if (actionType.value === 'create') {
206 data.expireTime = dayjs(data.expireTime).valueOf().toString() 208 data.expireTime = dayjs(data.expireTime).valueOf().toString()
207 await TenantApi.createTenantApi(data) 209 await TenantApi.createTenantApi(data)
208 - ElMessage.success(t('common.createSuccess')) 210 + message.success(t('common.createSuccess'))
209 } else { 211 } else {
210 data.expireTime = dayjs(data.expireTime).valueOf().toString() 212 data.expireTime = dayjs(data.expireTime).valueOf().toString()
211 await TenantApi.updateTenantApi(data) 213 await TenantApi.updateTenantApi(data)
212 - ElMessage.success(t('common.updateSuccess')) 214 + message.success(t('common.updateSuccess'))
213 } 215 }
214 // 操作成功,重新加载列表 216 // 操作成功,重新加载列表
215 dialogVisible.value = false 217 dialogVisible.value = false
yudao-ui-admin-vue3/src/views/system/tenantPackage/index.vue
@@ -94,13 +94,16 @@ import { handleTree } from &#39;@/utils/tree&#39; @@ -94,13 +94,16 @@ import { handleTree } from &#39;@/utils/tree&#39;
94 import { DICT_TYPE } from '@/utils/dict' 94 import { DICT_TYPE } from '@/utils/dict'
95 import { useTable } from '@/hooks/web/useTable' 95 import { useTable } from '@/hooks/web/useTable'
96 import { useI18n } from '@/hooks/web/useI18n' 96 import { useI18n } from '@/hooks/web/useI18n'
  97 +import { useMessage } from '@/hooks/web/useMessage'
97 import { FormExpose } from '@/components/Form' 98 import { FormExpose } from '@/components/Form'
98 import { TenantPackageVO } from '@/api/system/tenantPackage/types' 99 import { TenantPackageVO } from '@/api/system/tenantPackage/types'
99 -import { ElMessage, ElCard, ElSwitch, ElTree } from 'element-plus'  
100 import { rules, allSchemas } from './tenantPackage.data' 100 import { rules, allSchemas } from './tenantPackage.data'
101 import * as TenantPackageApi from '@/api/system/tenantPackage' 101 import * as TenantPackageApi from '@/api/system/tenantPackage'
102 import { listSimpleMenusApi } from '@/api/system/menu' 102 import { listSimpleMenusApi } from '@/api/system/menu'
  103 +
  104 +import { ElTree } from 'element-plus'
103 const { t } = useI18n() // 国际化 105 const { t } = useI18n() // 国际化
  106 +const message = useMessage() // 消息弹窗
104 107
105 const defaultProps = { 108 const defaultProps = {
106 children: 'children', 109 children: 'children',
@@ -174,10 +177,10 @@ const submitForm = async () =&gt; { @@ -174,10 +177,10 @@ const submitForm = async () =&gt; {
174 data.menuIds = treeRef.value!.getCheckedKeys(false) as string[] 177 data.menuIds = treeRef.value!.getCheckedKeys(false) as string[]
175 if (actionType.value === 'create') { 178 if (actionType.value === 'create') {
176 await TenantPackageApi.createTenantPackageTypeApi(data) 179 await TenantPackageApi.createTenantPackageTypeApi(data)
177 - ElMessage.success(t('common.createSuccess')) 180 + message.success(t('common.createSuccess'))
178 } else { 181 } else {
179 await TenantPackageApi.updateTenantPackageTypeApi(data) 182 await TenantPackageApi.updateTenantPackageTypeApi(data)
180 - ElMessage.success(t('common.updateSuccess')) 183 + message.success(t('common.updateSuccess'))
181 } 184 }
182 // 操作成功,重新加载列表 185 // 操作成功,重新加载列表
183 dialogVisible.value = false 186 dialogVisible.value = false
yudao-ui-admin-vue3/src/views/system/user/index.vue
@@ -237,23 +237,6 @@ @@ -237,23 +237,6 @@
237 </template> 237 </template>
238 <script setup lang="ts"> 238 <script setup lang="ts">
239 import { nextTick, onMounted, reactive, ref, unref, watch } from 'vue' 239 import { nextTick, onMounted, reactive, ref, unref, watch } from 'vue'
240 -import {  
241 - ElTag,  
242 - ElInput,  
243 - ElCard,  
244 - ElTree,  
245 - ElTreeSelect,  
246 - ElSelect,  
247 - ElOption,  
248 - ElTransfer,  
249 - ElForm,  
250 - ElFormItem,  
251 - ElUpload,  
252 - ElSwitch,  
253 - ElCheckbox,  
254 - UploadInstance,  
255 - UploadRawFile  
256 -} from 'element-plus'  
257 import { handleTree } from '@/utils/tree' 240 import { handleTree } from '@/utils/tree'
258 import { useI18n } from '@/hooks/web/useI18n' 241 import { useI18n } from '@/hooks/web/useI18n'
259 import { FormExpose } from '@/components/Form' 242 import { FormExpose } from '@/components/Form'
@@ -272,6 +255,7 @@ import { getAccessToken, getTenantId } from &#39;@/utils/auth&#39; @@ -272,6 +255,7 @@ import { getAccessToken, getTenantId } from &#39;@/utils/auth&#39;
272 import { useMessage } from '@/hooks/web/useMessage' 255 import { useMessage } from '@/hooks/web/useMessage'
273 import { VxeGridInstance } from 'vxe-table' 256 import { VxeGridInstance } from 'vxe-table'
274 import { useVxeGrid } from '@/hooks/web/useVxeGrid' 257 import { useVxeGrid } from '@/hooks/web/useVxeGrid'
  258 +import { ElTree, UploadInstance, UploadRawFile } from 'element-plus'
275 259
276 const { t } = useI18n() // 国际化 260 const { t } = useI18n() // 国际化
277 const message = useMessage() // 消息弹窗 261 const message = useMessage() // 消息弹窗
yudao-ui-admin-vue3/tsconfig.json
@@ -34,6 +34,6 @@ @@ -34,6 +34,6 @@
34 ], 34 ],
35 "typeRoots": ["./node_modules/@types/", "./types"] 35 "typeRoots": ["./node_modules/@types/", "./types"]
36 }, 36 },
37 - "include": ["src/**/*", "types/**/*.d.ts"], 37 + "include": ["src/**/*", "types/**/*.d.ts", "src/auto-components.d.ts"],
38 "exclude": ["dist", "node_modules"] 38 "exclude": ["dist", "node_modules"]
39 } 39 }
yudao-ui-admin-vue3/vite.config.ts
@@ -6,6 +6,8 @@ import WindiCSS from &#39;vite-plugin-windicss&#39; @@ -6,6 +6,8 @@ import WindiCSS from &#39;vite-plugin-windicss&#39;
6 import VueJsx from '@vitejs/plugin-vue-jsx' 6 import VueJsx from '@vitejs/plugin-vue-jsx'
7 import EslintPlugin from 'vite-plugin-eslint' 7 import EslintPlugin from 'vite-plugin-eslint'
8 import VueI18n from '@intlify/vite-plugin-vue-i18n' 8 import VueI18n from '@intlify/vite-plugin-vue-i18n'
  9 +import Components from 'unplugin-vue-components/vite'
  10 +import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
9 import { createStyleImportPlugin, ElementPlusResolve, VxeTableResolve } from 'vite-plugin-style-import' 11 import { createStyleImportPlugin, ElementPlusResolve, VxeTableResolve } from 'vite-plugin-style-import'
10 import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' 12 import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
11 import PurgeIcons from 'vite-plugin-purge-icons' 13 import PurgeIcons from 'vite-plugin-purge-icons'
@@ -71,6 +73,20 @@ export default ({ command, mode }: ConfigEnv): UserConfig =&gt; { @@ -71,6 +73,20 @@ export default ({ command, mode }: ConfigEnv): UserConfig =&gt; {
71 } 73 }
72 }] 74 }]
73 }), 75 }),
  76 + Components({
  77 + // 要搜索组件的目录的相对路径
  78 + dirs: ['src/components'],
  79 + // 组件的有效文件扩展名
  80 + extensions: ['vue', 'md'],
  81 + // 搜索子目录
  82 + deep: true,
  83 + include: [/\.vue$/, /\.vue\?vue/],
  84 + // 生成自定义 `auto-components.d.ts` 全局声明
  85 + dts: 'src/auto-components.d.ts',
  86 + // 自定义组件的解析器
  87 + resolvers: [ElementPlusResolver()],
  88 + exclude: [/[\\/]node_modules[\\/]/]
  89 + }),
74 EslintPlugin({ 90 EslintPlugin({
75 cache: false, 91 cache: false,
76 include: ['src/**/*.vue', 'src/**/*.ts', 'src/**/*.tsx'] // 检查的文件 92 include: ['src/**/*.vue', 'src/**/*.ts', 'src/**/*.tsx'] // 检查的文件