Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4aeee485
authored
Mar 17, 2023
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加 useCrudSchemas、useTable 的 autoimport 实现
parent
3f2a77f2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
4 deletions
+8
-4
build/vite/index.ts
+4
-1
src/types/auto-imports.d.ts
+2
-0
src/views/system/mail/account/account.data.ts
+1
-1
src/views/system/mail/account/index.vue
+1
-2
No files found.
build/vite/index.ts
View file @
4aeee485
...
@@ -39,11 +39,14 @@ export function createVitePlugins(VITE_APP_TITLE: string) {
...
@@ -39,11 +39,14 @@ export function createVitePlugins(VITE_APP_TITLE: string) {
imports
:
[
imports
:
[
'vue'
,
'vue'
,
'vue-router'
,
'vue-router'
,
// 可额外添加需要 autoImport 的组件
{
{
'@/hooks/web/useI18n'
:
[
'useI18n'
],
'@/hooks/web/useI18n'
:
[
'useI18n'
],
'@/hooks/web/useXTable'
:
[
'useXTable'
],
'@/hooks/web/useMessage'
:
[
'useMessage'
],
'@/hooks/web/useMessage'
:
[
'useMessage'
],
'@/hooks/web/useXTable'
:
[
'useXTable'
],
'@/hooks/web/useVxeCrudSchemas'
:
[
'useVxeCrudSchemas'
],
'@/hooks/web/useVxeCrudSchemas'
:
[
'useVxeCrudSchemas'
],
'@/hooks/web/useTable'
:
[
'useTable'
],
'@/hooks/web/useCrudSchemas'
:
[
'useCrudSchemas'
],
'@/utils/formRules'
:
[
'required'
],
'@/utils/formRules'
:
[
'required'
],
'@/utils/dict'
:
[
'DICT_TYPE'
]
'@/utils/dict'
:
[
'DICT_TYPE'
]
}
}
...
...
src/types/auto-imports.d.ts
View file @
4aeee485
...
@@ -52,6 +52,7 @@ declare global {
...
@@ -52,6 +52,7 @@ declare global {
const
triggerRef
:
typeof
import
(
'vue'
)[
'triggerRef'
]
const
triggerRef
:
typeof
import
(
'vue'
)[
'triggerRef'
]
const
unref
:
typeof
import
(
'vue'
)[
'unref'
]
const
unref
:
typeof
import
(
'vue'
)[
'unref'
]
const
useAttrs
:
typeof
import
(
'vue'
)[
'useAttrs'
]
const
useAttrs
:
typeof
import
(
'vue'
)[
'useAttrs'
]
const
useCrudSchemas
:
typeof
import
(
'@/hooks/web/useCrudSchemas'
)[
'useCrudSchemas'
]
const
useCssModule
:
typeof
import
(
'vue'
)[
'useCssModule'
]
const
useCssModule
:
typeof
import
(
'vue'
)[
'useCssModule'
]
const
useCssVars
:
typeof
import
(
'vue'
)[
'useCssVars'
]
const
useCssVars
:
typeof
import
(
'vue'
)[
'useCssVars'
]
const
useI18n
:
typeof
import
(
'@/hooks/web/useI18n'
)[
'useI18n'
]
const
useI18n
:
typeof
import
(
'@/hooks/web/useI18n'
)[
'useI18n'
]
...
@@ -60,6 +61,7 @@ declare global {
...
@@ -60,6 +61,7 @@ declare global {
const
useRoute
:
typeof
import
(
'vue-router'
)[
'useRoute'
]
const
useRoute
:
typeof
import
(
'vue-router'
)[
'useRoute'
]
const
useRouter
:
typeof
import
(
'vue-router'
)[
'useRouter'
]
const
useRouter
:
typeof
import
(
'vue-router'
)[
'useRouter'
]
const
useSlots
:
typeof
import
(
'vue'
)[
'useSlots'
]
const
useSlots
:
typeof
import
(
'vue'
)[
'useSlots'
]
const
useTable
:
typeof
import
(
'@/hooks/web/useTable'
)[
'useTable'
]
const
useVxeCrudSchemas
:
typeof
import
(
'@/hooks/web/useVxeCrudSchemas'
)[
'useVxeCrudSchemas'
]
const
useVxeCrudSchemas
:
typeof
import
(
'@/hooks/web/useVxeCrudSchemas'
)[
'useVxeCrudSchemas'
]
const
useXTable
:
typeof
import
(
'@/hooks/web/useXTable'
)[
'useXTable'
]
const
useXTable
:
typeof
import
(
'@/hooks/web/useXTable'
)[
'useXTable'
]
const
watch
:
typeof
import
(
'vue'
)[
'watch'
]
const
watch
:
typeof
import
(
'vue'
)[
'watch'
]
...
...
src/views/system/mail/account/account.data.ts
View file @
4aeee485
import
{
CrudSchema
,
useCrudSchemas
}
from
'@/hooks/web/useCrudSchemas'
import
type
{
CrudSchema
}
from
'@/hooks/web/useCrudSchemas'
import
{
DictTag
}
from
'@/components/DictTag'
import
{
DictTag
}
from
'@/components/DictTag'
import
{
TableColumn
}
from
'@/types/table'
import
{
TableColumn
}
from
'@/types/table'
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
{
dateFormatter
}
from
'@/utils/formatTime'
...
...
src/views/system/mail/account/index.vue
View file @
4aeee485
...
@@ -53,13 +53,12 @@
...
@@ -53,13 +53,12 @@
</template>
</template>
<
script
setup
lang=
"ts"
name=
"MailAccount"
>
<
script
setup
lang=
"ts"
name=
"MailAccount"
>
import
{
allSchemas
}
from
'./account.data'
import
{
allSchemas
}
from
'./account.data'
import
{
useTable
}
from
'@/hooks/web/useTable'
import
*
as
MailAccountApi
from
'@/api/system/mail/account'
import
*
as
MailAccountApi
from
'@/api/system/mail/account'
import
MailAccountForm
from
'./form.vue'
import
MailAccountForm
from
'./form.vue'
// https://kailong110120130.gitee.io/vue-element-plus-admin-doc/components/table.html#usetable
// tableObject:表格的属性对象,可获得分页大小、条数等属性
// tableObject:表格的属性对象,可获得分页大小、条数等属性
// tableMethods:表格的操作对象,可进行获得分页、删除记录等操作
// tableMethods:表格的操作对象,可进行获得分页、删除记录等操作
// 详细可见:https://kailong110120130.gitee.io/vue-element-plus-admin-doc/components/table.html#usetable
const
{
tableObject
,
tableMethods
}
=
useTable
({
const
{
tableObject
,
tableMethods
}
=
useTable
({
getListApi
:
MailAccountApi
.
getMailAccountPage
,
// 分页接口
getListApi
:
MailAccountApi
.
getMailAccountPage
,
// 分页接口
delListApi
:
MailAccountApi
.
deleteMailAccount
// 删除接口
delListApi
:
MailAccountApi
.
deleteMailAccount
// 删除接口
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment