vome-core 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +1 -0
- package/dist/src/auth/define-macro.d.ts +8 -0
- package/dist/src/auth/index.d.ts +2 -0
- package/dist/src/comm/daily-log.d.ts +8 -0
- package/dist/src/comm/env.d.ts +4 -0
- package/dist/src/comm/format-time.d.ts +10 -0
- package/dist/src/comm/merge.d.ts +2 -0
- package/dist/src/comm/scan.d.ts +4 -0
- package/dist/src/comm/startBanner.d.ts +1 -0
- package/dist/src/core/app.d.ts +37 -0
- package/dist/src/core/config.d.ts +2 -0
- package/dist/src/core/context/index.d.ts +22 -0
- package/dist/src/core/host-infra.d.ts +20 -0
- package/dist/src/core/index.d.ts +20 -0
- package/dist/src/core/plugins/async-context.d.ts +3 -0
- package/dist/src/core/plugins/error.d.ts +5 -0
- package/dist/src/core/plugins/logging.d.ts +3 -0
- package/dist/src/core/plugins/openapi.d.ts +3 -0
- package/dist/src/core/vome-config.d.ts +2 -0
- package/dist/src/ext/base-plugin.d.ts +13 -0
- package/dist/src/ext/index.d.ts +15 -0
- package/dist/src/ext/load-plugin.d.ts +12 -0
- package/dist/src/ext/micro-apps.d.ts +60 -0
- package/dist/src/ext/module-gateway.d.ts +10 -0
- package/dist/src/ext/module-registry.d.ts +45 -0
- package/dist/src/ext/path.d.ts +8 -0
- package/dist/src/index.d.ts +10 -0
- package/dist/src/ioc/container.d.ts +29 -0
- package/dist/src/ioc/decorators.d.ts +35 -0
- package/dist/src/ioc/host.d.ts +2 -0
- package/dist/src/ioc/index.d.ts +6 -0
- package/dist/src/ioc/metadata.d.ts +12 -0
- package/dist/src/ioc/scope.d.ts +9 -0
- package/dist/src/logger/bootstrap.d.ts +2 -0
- package/dist/src/logger/exception.d.ts +22 -0
- package/dist/src/logger/index.d.ts +5 -0
- package/dist/src/logger/logger.d.ts +18 -0
- package/dist/src/logger/pino.d.ts +8 -0
- package/dist/src/orm/base-columns.d.ts +11 -0
- package/dist/src/orm/column-comments.d.ts +25 -0
- package/dist/src/orm/crud-config.d.ts +7 -0
- package/dist/src/orm/crud-register.d.ts +5 -0
- package/dist/src/orm/data-scope.d.ts +24 -0
- package/dist/src/orm/db-store.d.ts +12 -0
- package/dist/src/orm/entity-schema.d.ts +7 -0
- package/dist/src/orm/index.d.ts +22 -0
- package/dist/src/orm/query-builder.d.ts +12 -0
- package/dist/src/orm/query-op.d.ts +27 -0
- package/dist/src/orm/repository.d.ts +74 -0
- package/dist/src/orm/service.d.ts +71 -0
- package/dist/src/orm/tenant.d.ts +24 -0
- package/dist/src/routing/base.d.ts +27 -0
- package/dist/src/routing/context.d.ts +14 -0
- package/dist/src/routing/crud-summary.d.ts +2 -0
- package/dist/src/routing/decorators.d.ts +48 -0
- package/dist/src/routing/eps.d.ts +16 -0
- package/dist/src/routing/index.d.ts +8 -0
- package/dist/src/routing/metadata.d.ts +28 -0
- package/dist/src/routing/openapi-tags.d.ts +23 -0
- package/dist/src/routing/path-utils.d.ts +5 -0
- package/dist/src/routing/perm.d.ts +18 -0
- package/dist/src/routing/register.d.ts +7 -0
- package/dist/src/server/index.d.ts +10 -0
- package/dist/src/shared/index.d.ts +8 -0
- package/dist/src/shared/tree.d.ts +18 -0
- package/dist/typings/comm/crud.d.ts +24 -0
- package/dist/typings/comm/page.d.ts +16 -0
- package/dist/typings/comm/scan.d.ts +6 -0
- package/dist/typings/common.d.ts +6 -0
- package/dist/typings/context/data.d.ts +10 -0
- package/dist/typings/ext/module.d.ts +45 -0
- package/dist/typings/ext/plugin.d.ts +40 -0
- package/dist/typings/ioc/metadata.d.ts +31 -0
- package/dist/typings/logger/config.d.ts +6 -0
- package/dist/typings/routing/crud.d.ts +99 -0
- package/dist/typings/routing/eps.d.ts +53 -0
- package/dist/typings/routing/meta.d.ts +56 -0
- package/dist/typings/routing/register.d.ts +15 -0
- package/dist/typings/routing/scan-context.d.ts +6 -0
- package/package.json +96 -0
- package/src/admin/api/client.ts +184 -0
- package/src/admin/components/vm-aside.vue +227 -0
- package/src/admin/components/vm-auto-perm-dialog.vue +361 -0
- package/src/admin/components/vm-check-tree.vue +338 -0
- package/src/admin/components/vm-dept-tree.vue +549 -0
- package/src/admin/components/vm-empty.vue +62 -0
- package/src/admin/components/vm-eps-perm-picker.vue +114 -0
- package/src/admin/components/vm-group-cascader.vue +563 -0
- package/src/admin/components/vm-icon-picker.vue +616 -0
- package/src/admin/components/vm-markdown.vue +141 -0
- package/src/admin/components/vm-ri-icon.vue +21 -0
- package/src/admin/components/vm-role-picker.vue +314 -0
- package/src/admin/components/vm-view-path-picker.vue +56 -0
- package/src/admin/config/plugin-dev.ts +31 -0
- package/src/admin/crud/components/vm-column-custom.vue +196 -0
- package/src/admin/crud/components/vm-context-menu.vue +99 -0
- package/src/admin/crud/components/vm-date-picker.vue +74 -0
- package/src/admin/crud/components/vm-date-range.vue +291 -0
- package/src/admin/crud/components/vm-date-text.vue +41 -0
- package/src/admin/crud/components/vm-dict-tag.vue +47 -0
- package/src/admin/crud/components/vm-file-icon.vue +54 -0
- package/src/admin/crud/components/vm-multi-select.vue +181 -0
- package/src/admin/crud/components/vm-number-range.vue +200 -0
- package/src/admin/crud/components/vm-radio.vue +87 -0
- package/src/admin/crud/components/vm-select.vue +131 -0
- package/src/admin/crud/components/vm-switch.vue +128 -0
- package/src/admin/crud/components/vm-tree-select.vue +456 -0
- package/src/admin/crud/components/vm-upload-item.vue +215 -0
- package/src/admin/crud/components/vm-upload.vue +323 -0
- package/src/admin/crud/components/vm-user-select.vue +234 -0
- package/src/admin/crud/config.ts +38 -0
- package/src/admin/crud/confirm.ts +135 -0
- package/src/admin/crud/dict.ts +49 -0
- package/src/admin/crud/index.ts +79 -0
- package/src/admin/crud/key.ts +47 -0
- package/src/admin/crud/mitt.ts +27 -0
- package/src/admin/crud/plugins.ts +298 -0
- package/src/admin/crud/registry.ts +45 -0
- package/src/admin/crud/span.ts +48 -0
- package/src/admin/crud/style.ts +112 -0
- package/src/admin/crud/useCrud.ts +81 -0
- package/src/admin/crud/validate.ts +109 -0
- package/src/admin/crud/vm-add-btn.vue +68 -0
- package/src/admin/crud/vm-adv-search.vue +73 -0
- package/src/admin/crud/vm-crud.vue +517 -0
- package/src/admin/crud/vm-dialog.vue +234 -0
- package/src/admin/crud/vm-flex1.vue +14 -0
- package/src/admin/crud/vm-form.vue +239 -0
- package/src/admin/crud/vm-multi-delete-btn.vue +48 -0
- package/src/admin/crud/vm-pagination.vue +125 -0
- package/src/admin/crud/vm-refresh-btn.vue +34 -0
- package/src/admin/crud/vm-row.vue +42 -0
- package/src/admin/crud/vm-search-key.vue +76 -0
- package/src/admin/crud/vm-search.vue +367 -0
- package/src/admin/crud/vm-table.vue +852 -0
- package/src/admin/crud/vm-toolbar.vue +245 -0
- package/src/admin/crud/vm-upsert.vue +530 -0
- package/src/admin/data/remixicon-all.json +1 -0
- package/src/admin/directives/perm.ts +18 -0
- package/src/admin/env.d.ts +5 -0
- package/src/admin/hooks/useBrowser.ts +27 -0
- package/src/admin/hooks/useUpload.ts +82 -0
- package/src/admin/hooks/useVome.ts +13 -0
- package/src/admin/index.ts +59 -0
- package/src/admin/lib/browser.ts +28 -0
- package/src/admin/lib/cn.ts +7 -0
- package/src/admin/lib/dialog-float.ts +14 -0
- package/src/admin/lib/eps.ts +43 -0
- package/src/admin/lib/menu.ts +15 -0
- package/src/admin/lib/module.ts +112 -0
- package/src/admin/lib/tree.ts +2 -0
- package/src/admin/lib/upload.ts +102 -0
- package/src/admin/router/index.ts +61 -0
- package/src/admin/router/menu-routes.ts +126 -0
- package/src/admin/service/base.ts +96 -0
- package/src/admin/service/index.ts +281 -0
- package/src/admin/static/fileicon/demo.css +539 -0
- package/src/admin/static/fileicon/demo_index.html +901 -0
- package/src/admin/static/fileicon/iconfont.css +139 -0
- package/src/admin/static/fileicon/iconfont.js +1 -0
- package/src/admin/static/fileicon/iconfont.json +226 -0
- package/src/admin/static/fileicon/iconfont.ttf +0 -0
- package/src/admin/static/fileicon/iconfont.woff +0 -0
- package/src/admin/static/fileicon/iconfont.woff2 +0 -0
- package/src/admin/static/scarce//344/270/213/350/275/275/345/244/261/350/264/245.svg +1 -0
- package/src/admin/static/scarce//346/224/257/344/273/230/346/210/220/345/212/237.svg +1 -0
- package/src/admin/static/scarce//346/232/202/346/227/240/344/274/230/346/203/240/345/210/270.svg +1 -0
- package/src/admin/static/scarce//346/232/202/346/227/240/345/206/205/345/256/271.svg +1 -0
- package/src/admin/static/scarce//346/232/202/346/227/240/345/217/221/347/245/250.svg +1 -0
- package/src/admin/static/scarce//346/232/202/346/227/240/345/233/276/347/211/207.svg +1 -0
- package/src/admin/static/scarce//346/232/202/346/227/240/345/234/260/345/235/200.svg +1 -0
- package/src/admin/static/scarce//346/232/202/346/227/240/345/272/227/351/223/272.svg +1 -0
- package/src/admin/static/scarce//346/232/202/346/227/240/346/216/250/351/200/201.svg +1 -0
- package/src/admin/static/scarce//346/232/202/346/227/240/346/220/234/347/264/242/347/273/223/346/236/234.svg +1 -0
- package/src/admin/static/scarce//346/232/202/346/227/240/346/224/266/350/227/217.svg +1 -0
- package/src/admin/static/scarce//346/232/202/346/227/240/346/225/260/346/215/256.svg +1 -0
- package/src/admin/static/scarce//346/232/202/346/227/240/346/235/203/351/231/220.svg +1 -0
- package/src/admin/static/scarce//346/232/202/346/227/240/346/266/210/346/201/257.svg +1 -0
- package/src/admin/static/scarce//346/232/202/346/227/240/347/244/274/347/211/251.svg +1 -0
- package/src/admin/static/scarce//346/232/202/346/227/240/347/247/257/345/210/206.svg +1 -0
- package/src/admin/static/scarce//346/232/202/346/227/240/347/275/221/347/273/234.svg +1 -0
- package/src/admin/static/scarce//346/232/202/346/227/240/350/247/206/351/242/221.svg +1 -0
- package/src/admin/static/scarce//346/232/202/346/227/240/350/256/242/345/215/225.svg +1 -0
- package/src/admin/static/scarce//346/232/202/346/227/240/350/257/204/350/256/272.svg +1 -0
- package/src/admin/static/scarce//346/232/202/346/227/240/351/205/215/351/200/201.svg +1 -0
- package/src/admin/static/scarce//346/232/202/346/227/240/351/223/266/350/241/214/345/215/241.svg +1 -0
- package/src/admin/static/scarce//346/232/202/346/227/240/351/237/263/344/271/220.svg +1 -0
- package/src/admin/static/scarce//351/241/265/351/235/242/344/270/215/345/255/230/345/234/250.svg +1 -0
- package/src/admin/stores/app.ts +30 -0
- package/src/admin/stores/tags.ts +73 -0
- package/src/admin/stores/user.ts +52 -0
- package/src/admin/styles/base.css +137 -0
- package/src/admin/tsconfig.json +19 -0
- package/typings/admin/base/auth.ts +23 -0
- package/typings/admin/base/permission.ts +19 -0
- package/typings/admin/comm/cascader.ts +7 -0
- package/typings/admin/comm/check-tree.ts +7 -0
- package/typings/admin/comm/crud.ts +294 -0
- package/typings/admin/comm/eps.ts +52 -0
- package/typings/admin/comm/request.ts +12 -0
- package/typings/admin/comm/service.ts +35 -0
- package/typings/admin/comm/upload.ts +39 -0
- package/typings/admin/host.d.ts +61 -0
- package/typings/admin/vome/browser.ts +11 -0
- package/typings/admin/vome/module.ts +13 -0
- package/typings/admin/vome/tags.ts +9 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** 菜单节点 */
|
|
2
|
+
export type MenuTreeNode = {
|
|
3
|
+
id: number
|
|
4
|
+
parentId: number | null
|
|
5
|
+
name: string
|
|
6
|
+
router: string | null
|
|
7
|
+
perms: string | null
|
|
8
|
+
type: number
|
|
9
|
+
icon: string | null
|
|
10
|
+
orderNum: number
|
|
11
|
+
viewPath: string | null
|
|
12
|
+
remoteName: string | null
|
|
13
|
+
remoteEntry: string | null
|
|
14
|
+
remoteModule: string | null
|
|
15
|
+
appKey: string | null
|
|
16
|
+
keepAlive: boolean
|
|
17
|
+
isShow: boolean
|
|
18
|
+
children?: MenuTreeNode[]
|
|
19
|
+
}
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import type { Component, InjectionKey, MaybeRefOrGetter, Ref } from 'vue'
|
|
2
|
+
|
|
3
|
+
/** 标准 CRUD service */
|
|
4
|
+
export type CrudService = {
|
|
5
|
+
namespace?: string
|
|
6
|
+
page?: (data: Record<string, unknown>) => Promise<{
|
|
7
|
+
list: Record<string, unknown>[]
|
|
8
|
+
pagination: { page: number; size: number; total: number }
|
|
9
|
+
}>
|
|
10
|
+
list?: (data?: Record<string, unknown>) => Promise<Record<string, unknown>[]>
|
|
11
|
+
info?: (data: { id: number | string }) => Promise<Record<string, unknown>>
|
|
12
|
+
add?: (data: Record<string, unknown>) => Promise<unknown>
|
|
13
|
+
update?: (data: Record<string, unknown>) => Promise<unknown>
|
|
14
|
+
delete?: (data: {
|
|
15
|
+
ids: Array<number | string>
|
|
16
|
+
force?: boolean
|
|
17
|
+
}) => Promise<unknown>
|
|
18
|
+
restore?: (data: { ids: Array<number | string> }) => Promise<unknown>
|
|
19
|
+
/** 权限码字符串 map */
|
|
20
|
+
permission?: Partial<CrudPermission> | Record<string, string>
|
|
21
|
+
/** 当前用户是否具备对应权限 */
|
|
22
|
+
_permission?: Partial<CrudPermission> & Record<string, boolean>
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
|
+
request?: (options?: any) => Promise<unknown>
|
|
25
|
+
[key: string]: unknown
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type CrudPermission = {
|
|
29
|
+
page: boolean
|
|
30
|
+
list: boolean
|
|
31
|
+
info: boolean
|
|
32
|
+
add: boolean
|
|
33
|
+
delete: boolean
|
|
34
|
+
update: boolean
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type CrudDict = {
|
|
38
|
+
primaryId: string
|
|
39
|
+
api: {
|
|
40
|
+
list: string
|
|
41
|
+
add: string
|
|
42
|
+
update: string
|
|
43
|
+
delete: string
|
|
44
|
+
info: string
|
|
45
|
+
page: string
|
|
46
|
+
}
|
|
47
|
+
pagination: { page: string; size: string }
|
|
48
|
+
search: { keyWord: string; query: string }
|
|
49
|
+
sort: { order: string; prop: string }
|
|
50
|
+
label: Record<string, string>
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export type CrudFormComponent = {
|
|
54
|
+
name?: string | Component
|
|
55
|
+
props?: Record<string, unknown>
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export type CrudSearchItem = {
|
|
59
|
+
prop: string
|
|
60
|
+
label: string
|
|
61
|
+
type?: 'input' | 'select' | 'date' | 'daterange' | 'number-range'
|
|
62
|
+
placeholder?: string
|
|
63
|
+
options?: Array<{ label: string; value: string | number | boolean }>
|
|
64
|
+
/** 业务字典 type.key;有则拉 options */
|
|
65
|
+
dict?: string
|
|
66
|
+
/** 下拉多选 */
|
|
67
|
+
multiple?: boolean
|
|
68
|
+
/** 区间:提交时拆成 min/max 请求参数 */
|
|
69
|
+
range?: {
|
|
70
|
+
min: string
|
|
71
|
+
max: string
|
|
72
|
+
rangeType: 'int' | 'float' | 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second'
|
|
73
|
+
}
|
|
74
|
+
/** component.name 走 registry */
|
|
75
|
+
component?: CrudFormComponent
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export type CrudOpButton =
|
|
79
|
+
| 'edit'
|
|
80
|
+
| 'delete'
|
|
81
|
+
| 'info'
|
|
82
|
+
| {
|
|
83
|
+
label: string
|
|
84
|
+
hidden?: boolean
|
|
85
|
+
variant?: 'softPrimary' | 'softDestructive' | 'softSuccess' | 'ghost' | 'outline'
|
|
86
|
+
onClick: (row: Record<string, unknown>) => void
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export type CrudColumn = {
|
|
90
|
+
prop?: string
|
|
91
|
+
label?: string
|
|
92
|
+
/** selection | index | op | expand */
|
|
93
|
+
type?: 'selection' | 'index' | 'op' | 'expand'
|
|
94
|
+
width?: string | number
|
|
95
|
+
minWidth?: string | number
|
|
96
|
+
align?: 'left' | 'center' | 'right'
|
|
97
|
+
hidden?: boolean
|
|
98
|
+
/** true / custom 可点排序;asc|desc 表示默认方向 */
|
|
99
|
+
sortable?: boolean | 'custom' | 'asc' | 'desc' | 'ascending' | 'descending'
|
|
100
|
+
slot?: string
|
|
101
|
+
formatter?: (row: Record<string, unknown>, value: unknown) => string
|
|
102
|
+
/** op 列:edit/delete/info 或自定义按钮对象 */
|
|
103
|
+
buttons?: CrudOpButton[] | ((row: Record<string, unknown>) => CrudOpButton[])
|
|
104
|
+
/** 单元格组件:name 为注册名或直接组件 */
|
|
105
|
+
component?: {
|
|
106
|
+
name?: string | Component
|
|
107
|
+
props?: Record<string, unknown>
|
|
108
|
+
}
|
|
109
|
+
/** dict.get / dict.options(支持 ComputedRef) */
|
|
110
|
+
dict?: MaybeRefOrGetter<
|
|
111
|
+
Array<{ label: string; value: string | number; type?: string; color?: string }>
|
|
112
|
+
>
|
|
113
|
+
children?: CrudColumn[]
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export type CrudFormItem = {
|
|
117
|
+
prop: string
|
|
118
|
+
label: string
|
|
119
|
+
type?: 'input' | 'textarea' | 'select' | 'switch' | 'radio'
|
|
120
|
+
required?: boolean
|
|
121
|
+
placeholder?: string
|
|
122
|
+
/** 控件禁用 */
|
|
123
|
+
disabled?: boolean
|
|
124
|
+
/** 扁平或树;options: dict.get('x') */
|
|
125
|
+
options?: MaybeRefOrGetter<
|
|
126
|
+
Array<{
|
|
127
|
+
label: string
|
|
128
|
+
value: string | number | boolean
|
|
129
|
+
children?: Array<{
|
|
130
|
+
label: string
|
|
131
|
+
value: string | number | boolean
|
|
132
|
+
children?: unknown[]
|
|
133
|
+
}>
|
|
134
|
+
}>
|
|
135
|
+
>
|
|
136
|
+
/** 按桌面 24 栅格配置(全宽 24);移动端自动映射到 12 列 */
|
|
137
|
+
span?: number
|
|
138
|
+
hidden?: boolean | ((form: Record<string, unknown>) => boolean)
|
|
139
|
+
/** 用 component 描述控件 */
|
|
140
|
+
component?: CrudFormComponent
|
|
141
|
+
value?: unknown
|
|
142
|
+
rules?: unknown
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export type CrudTrashMode = 'default' | 'onlyTrashed' | 'withTrashed'
|
|
146
|
+
|
|
147
|
+
export type CrudRefreshHelpers = {
|
|
148
|
+
next: (params: Record<string, unknown>) => Promise<unknown>
|
|
149
|
+
done: () => void
|
|
150
|
+
render: (
|
|
151
|
+
list: Record<string, unknown>[] | { list: Record<string, unknown>[]; pagination?: unknown },
|
|
152
|
+
pagination?: { page?: number; size?: number; total?: number },
|
|
153
|
+
) => void
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export type CrudDeleteHelpers = {
|
|
157
|
+
next: (params?: Record<string, unknown>) => Promise<unknown>
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export type CrudOptions = {
|
|
161
|
+
/** service.base.user 或字符串路径 */
|
|
162
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
163
|
+
service: CrudService | string | any
|
|
164
|
+
dict?: Partial<CrudDict>
|
|
165
|
+
permission?: Partial<CrudPermission>
|
|
166
|
+
onRefresh?: (
|
|
167
|
+
params: Record<string, unknown>,
|
|
168
|
+
helpers: CrudRefreshHelpers,
|
|
169
|
+
) => void | Promise<void>
|
|
170
|
+
onDelete?: (
|
|
171
|
+
selection: Record<string, unknown>[],
|
|
172
|
+
helpers: CrudDeleteHelpers,
|
|
173
|
+
) => void | Promise<void>
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export type CrudUpsertOptions = {
|
|
177
|
+
items?: CrudFormItem[]
|
|
178
|
+
props?: Record<string, unknown>
|
|
179
|
+
dialog?: {
|
|
180
|
+
title?: string
|
|
181
|
+
/** 显式 false 强制隐藏确定;未设时仍按 info 模式自动隐藏 */
|
|
182
|
+
confirm?: boolean
|
|
183
|
+
}
|
|
184
|
+
sync?: boolean
|
|
185
|
+
onOpen?: (data: Record<string, unknown>) => void
|
|
186
|
+
onOpened?: (data: Record<string, unknown>) => void
|
|
187
|
+
onClose?: (action: 'close' | 'submit', done: () => void) => void
|
|
188
|
+
onInfo?: (
|
|
189
|
+
data: Record<string, unknown>,
|
|
190
|
+
helpers: {
|
|
191
|
+
next: (data?: Record<string, unknown>) => Promise<Record<string, unknown>>
|
|
192
|
+
done: (data: Record<string, unknown>) => void
|
|
193
|
+
close: () => void
|
|
194
|
+
},
|
|
195
|
+
) => void | Promise<void>
|
|
196
|
+
onSubmit?: (
|
|
197
|
+
data: Record<string, unknown>,
|
|
198
|
+
helpers: {
|
|
199
|
+
next: (data?: Record<string, unknown>) => Promise<unknown>
|
|
200
|
+
done: () => void
|
|
201
|
+
close: () => void
|
|
202
|
+
},
|
|
203
|
+
) => void | Promise<void | unknown>
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export type CrudTableOptions = {
|
|
207
|
+
columns?: CrudColumn[]
|
|
208
|
+
autoHeight?: boolean
|
|
209
|
+
border?: boolean
|
|
210
|
+
contextMenu?: boolean | string[]
|
|
211
|
+
rowKey?: string
|
|
212
|
+
/** 树表:list 含 children 时缩进展开 */
|
|
213
|
+
tree?: boolean
|
|
214
|
+
treeLazy?: boolean
|
|
215
|
+
/** 默认排序;请求键由 dict.sort 决定 */
|
|
216
|
+
defaultSort?: {
|
|
217
|
+
prop: string
|
|
218
|
+
order: 'asc' | 'desc' | 'ascending' | 'descending'
|
|
219
|
+
}
|
|
220
|
+
/** 排序变化时是否 refresh,默认 true */
|
|
221
|
+
sortRefresh?: boolean
|
|
222
|
+
plugins?: unknown[]
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export type CrudSearchOptions = {
|
|
226
|
+
items?: CrudSearchItem[]
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export type CrudContext = {
|
|
230
|
+
service: CrudService
|
|
231
|
+
loading: Ref<boolean>
|
|
232
|
+
list: Ref<Record<string, unknown>[]>
|
|
233
|
+
selection: Ref<Record<string, unknown>[]>
|
|
234
|
+
pagination: Ref<{ page: number; size: number; total: number }>
|
|
235
|
+
params: Ref<Record<string, unknown>>
|
|
236
|
+
trashMode: Ref<CrudTrashMode>
|
|
237
|
+
permission: Ref<CrudPermission>
|
|
238
|
+
dict: CrudDict
|
|
239
|
+
refresh: (extra?: Record<string, unknown>) => Promise<unknown>
|
|
240
|
+
setParams: (p: Record<string, unknown>, doRefresh?: boolean) => void
|
|
241
|
+
resetParams: () => void
|
|
242
|
+
setSelection: (rows: Record<string, unknown>[]) => void
|
|
243
|
+
getPermission: (key?: keyof CrudPermission) => boolean | CrudPermission
|
|
244
|
+
getParams: () => Record<string, unknown>
|
|
245
|
+
rowAdd: (defaults?: Record<string, unknown>) => void
|
|
246
|
+
rowAppend: (data?: Record<string, unknown>) => void
|
|
247
|
+
rowEdit: (row: Record<string, unknown>) => Promise<void>
|
|
248
|
+
rowInfo: (row: Record<string, unknown>) => Promise<void>
|
|
249
|
+
rowClose: () => void
|
|
250
|
+
/** 打开 upsert,不校验 add 权限 */
|
|
251
|
+
openUpsert: (
|
|
252
|
+
form?: Record<string, unknown>,
|
|
253
|
+
mode?: 'add' | 'update' | 'info',
|
|
254
|
+
) => void
|
|
255
|
+
rowDelete: (rows?: Record<string, unknown>[], force?: boolean) => Promise<void>
|
|
256
|
+
rowRestore: (rows?: Record<string, unknown>[]) => Promise<void>
|
|
257
|
+
upsertVisible: Ref<boolean>
|
|
258
|
+
upsertMode: Ref<'add' | 'update' | 'info'>
|
|
259
|
+
upsertForm: Ref<Record<string, unknown>>
|
|
260
|
+
upsertSubmit: () => Promise<void>
|
|
261
|
+
upsertClose: () => void
|
|
262
|
+
patchUpsertForm: (patch: Record<string, unknown>) => void
|
|
263
|
+
getUpsertForm: () => Record<string, unknown>
|
|
264
|
+
/** vm-search 注册;vm-toolbar 搜索/重置读取 */
|
|
265
|
+
searchActions: import('vue').ShallowRef<{
|
|
266
|
+
search: () => void
|
|
267
|
+
reset: () => void
|
|
268
|
+
} | null>
|
|
269
|
+
/** vm-search 是否有筛选项;无配置时不显示 toolbar 搜索/重置 */
|
|
270
|
+
hasSearchFilters: Ref<boolean>
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/** 表格右键菜单项 */
|
|
274
|
+
export type CtxMenuItem = {
|
|
275
|
+
key: string
|
|
276
|
+
label: string
|
|
277
|
+
disabled?: boolean
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/** 树形下拉选项 */
|
|
281
|
+
export type TreeSelectOption = {
|
|
282
|
+
label?: string
|
|
283
|
+
value?: string | number | boolean
|
|
284
|
+
children?: TreeSelectOption[]
|
|
285
|
+
[key: string]: unknown
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/** CRUD Table 插件标记 */
|
|
289
|
+
export type TablePlugin = {
|
|
290
|
+
__plugin: string
|
|
291
|
+
[key: string]: unknown
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export type { InjectionKey, Ref }
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** 前端 EPS 类型 */
|
|
2
|
+
export type EpsApiItem = {
|
|
3
|
+
method: string
|
|
4
|
+
path: string
|
|
5
|
+
summary: string
|
|
6
|
+
prefix: string
|
|
7
|
+
ignoreToken: boolean
|
|
8
|
+
ignorePerms: boolean
|
|
9
|
+
perms: string[]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type EpsColumn = {
|
|
13
|
+
propertyName: string
|
|
14
|
+
type: string
|
|
15
|
+
comment?: string
|
|
16
|
+
nullable?: boolean
|
|
17
|
+
dict?: string | string[]
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type EpsEntity = {
|
|
21
|
+
module: string
|
|
22
|
+
side: string
|
|
23
|
+
prefix: string
|
|
24
|
+
/** 关联实体/表名(可选);中间列展示用 info.type.name 或 prefix 末段 */
|
|
25
|
+
name?: string
|
|
26
|
+
info?: {
|
|
27
|
+
type: {
|
|
28
|
+
/** 控制器路径末段,对应文件名(如 dict-info) */
|
|
29
|
+
name: string
|
|
30
|
+
description: string
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
api: EpsApiItem[]
|
|
34
|
+
columns: EpsColumn[]
|
|
35
|
+
pageColumns: EpsColumn[]
|
|
36
|
+
pageQueryOp?: {
|
|
37
|
+
keyWordLikeFields?: unknown[]
|
|
38
|
+
fieldEq?: unknown[]
|
|
39
|
+
fieldLike?: unknown[]
|
|
40
|
+
fieldArray?: unknown[]
|
|
41
|
+
fieldRange?: unknown[]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type EpsModuleMap = Record<string, EpsEntity[]>
|
|
46
|
+
|
|
47
|
+
/** 菜单「自动添加权限」行 */
|
|
48
|
+
export type AutoPermRow = {
|
|
49
|
+
enabled: boolean
|
|
50
|
+
name: string
|
|
51
|
+
perm: string
|
|
52
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** 链式 service 叶子节点 */
|
|
2
|
+
export type ServiceRequestOptions = {
|
|
3
|
+
url?: string
|
|
4
|
+
method?: string
|
|
5
|
+
data?: unknown
|
|
6
|
+
params?: Record<string, unknown>
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export type ServiceLeaf = {
|
|
10
|
+
namespace: string
|
|
11
|
+
permission: Record<string, string>
|
|
12
|
+
_permission: Record<string, boolean>
|
|
13
|
+
request: (options?: ServiceRequestOptions) => Promise<unknown>
|
|
14
|
+
page?: (data?: Record<string, unknown>) => Promise<{
|
|
15
|
+
list: Record<string, unknown>[]
|
|
16
|
+
pagination: { page: number; size: number; total: number }
|
|
17
|
+
}>
|
|
18
|
+
list?: (data?: Record<string, unknown>) => Promise<Record<string, unknown>[]>
|
|
19
|
+
info?: (data: { id: number | string }) => Promise<Record<string, unknown>>
|
|
20
|
+
add?: (data: Record<string, unknown>) => Promise<unknown>
|
|
21
|
+
update?: (data: Record<string, unknown>) => Promise<unknown>
|
|
22
|
+
delete?: (data: {
|
|
23
|
+
ids: Array<number | string>
|
|
24
|
+
force?: boolean
|
|
25
|
+
}) => Promise<unknown>
|
|
26
|
+
restore?: (data: { ids: Array<number | string> }) => Promise<unknown>
|
|
27
|
+
[method: string]: unknown
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** 嵌套树:service.base.user(动态键,运行时由 EPS 填充) */
|
|
31
|
+
export type ServiceTree = {
|
|
32
|
+
request: (options?: ServiceRequestOptions) => Promise<unknown>
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
|
+
[key: string]: any
|
|
35
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export type UploadFileType =
|
|
2
|
+
| 'image'
|
|
3
|
+
| 'video'
|
|
4
|
+
| 'audio'
|
|
5
|
+
| 'word'
|
|
6
|
+
| 'excel'
|
|
7
|
+
| 'ppt'
|
|
8
|
+
| 'pdf'
|
|
9
|
+
| 'rar'
|
|
10
|
+
| 'file'
|
|
11
|
+
|
|
12
|
+
export type UploadRule = {
|
|
13
|
+
name: string
|
|
14
|
+
type: UploadFileType
|
|
15
|
+
color: string
|
|
16
|
+
exts: string[]
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type UploadItem = {
|
|
20
|
+
uid: string
|
|
21
|
+
name: string
|
|
22
|
+
url: string
|
|
23
|
+
preload?: string
|
|
24
|
+
type: UploadFileType
|
|
25
|
+
size?: number
|
|
26
|
+
progress: number
|
|
27
|
+
error?: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type UploadOptions = {
|
|
31
|
+
prefixPath?: string
|
|
32
|
+
onProgress?: (progress: number) => void
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type UploadResult = {
|
|
36
|
+
url: string
|
|
37
|
+
key?: string
|
|
38
|
+
fileId?: string
|
|
39
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 宿主注入点类型(Vite alias `#vome-host` → admin/src)
|
|
3
|
+
* 包内不直接依赖宿主路径,由宿主 vite/tsconfig 解析。
|
|
4
|
+
*/
|
|
5
|
+
declare module '#vome-host/config' {
|
|
6
|
+
export const config: {
|
|
7
|
+
app: {
|
|
8
|
+
name: string
|
|
9
|
+
menu: { isGroup: boolean }
|
|
10
|
+
router: { mode: 'history' | 'hash' }
|
|
11
|
+
}
|
|
12
|
+
ignore: {
|
|
13
|
+
toast: string[]
|
|
14
|
+
token: string[]
|
|
15
|
+
}
|
|
16
|
+
test: { eps: boolean }
|
|
17
|
+
host: string
|
|
18
|
+
baseUrl: string
|
|
19
|
+
[key: string]: unknown
|
|
20
|
+
}
|
|
21
|
+
export const isDev: boolean
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare module '#vome-host/pages/home/index.vue' {
|
|
25
|
+
import type { DefineComponent } from 'vue'
|
|
26
|
+
const c: DefineComponent
|
|
27
|
+
export default c
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
declare module '#vome-host/pages/layout/index.vue' {
|
|
31
|
+
import type { DefineComponent } from 'vue'
|
|
32
|
+
const c: DefineComponent
|
|
33
|
+
export default c
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
declare module '#vome-host/pages/login/index.vue' {
|
|
37
|
+
import type { DefineComponent } from 'vue'
|
|
38
|
+
const c: DefineComponent
|
|
39
|
+
export default c
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare module '#vome-host/pages/missing/index.vue' {
|
|
43
|
+
import type { DefineComponent } from 'vue'
|
|
44
|
+
const c: DefineComponent
|
|
45
|
+
export default c
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
declare module '#vome-host/pages/micro/index.vue' {
|
|
49
|
+
import type { DefineComponent } from 'vue'
|
|
50
|
+
const c: DefineComponent
|
|
51
|
+
export default c
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare module '#vome-host/components/ui/dialog' {
|
|
55
|
+
import type { DefineComponent } from 'vue'
|
|
56
|
+
export const Dialog: DefineComponent
|
|
57
|
+
export const DialogContent: DefineComponent
|
|
58
|
+
export const DialogFooter: DefineComponent
|
|
59
|
+
export const DialogHeader: DefineComponent
|
|
60
|
+
export const DialogTitle: DefineComponent
|
|
61
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type BrowserScreen = 'xs' | 'sm' | 'md' | 'xl' | 'full'
|
|
2
|
+
|
|
3
|
+
export type BrowserInfo = {
|
|
4
|
+
height: number
|
|
5
|
+
width: number
|
|
6
|
+
type: string
|
|
7
|
+
/** 断点:xs <768 / sm <992 / md <1200 / xl <1920 / full */
|
|
8
|
+
screen: BrowserScreen
|
|
9
|
+
/** 迷你布局:侧栏收起或移动端 */
|
|
10
|
+
isMini: boolean
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Component } from 'vue'
|
|
2
|
+
|
|
3
|
+
/** 视图异步加载器 */
|
|
4
|
+
export type ViewLoader = () => Promise<{ default: Component }>
|
|
5
|
+
|
|
6
|
+
/** 视图路径树(菜单 viewPath 选择) */
|
|
7
|
+
export type ViewsTreeNode = {
|
|
8
|
+
label: string
|
|
9
|
+
/** 完整 viewPath(叶子)或路径前缀(目录) */
|
|
10
|
+
value: string
|
|
11
|
+
isLeaf?: boolean
|
|
12
|
+
children?: ViewsTreeNode[]
|
|
13
|
+
}
|