vome-core 0.1.77 → 0.1.79

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.
Files changed (203) hide show
  1. package/dist/admin/api/client.js +2 -3
  2. package/dist/admin/components/layout/vm-app-header.vue +341 -0
  3. package/dist/admin/components/layout/vm-app-sidebar.vue +187 -0
  4. package/dist/admin/components/layout/vm-sidebar-flyout.vue +268 -0
  5. package/dist/admin/components/layout/vm-sidebar-nav-item.vue +490 -0
  6. package/dist/admin/components/layout/vm-sidebar-nav.vue +104 -0
  7. package/dist/admin/components/layout/vm-tags-view.vue +233 -0
  8. package/dist/admin/components/ui/avatar/Avatar.vue +18 -0
  9. package/dist/admin/components/ui/avatar/AvatarFallback.vue +21 -0
  10. package/dist/admin/components/ui/avatar/AvatarImage.vue +16 -0
  11. package/dist/admin/components/ui/avatar/index.d.ts +3 -0
  12. package/dist/admin/components/ui/avatar/index.js +1 -0
  13. package/dist/admin/components/ui/badge/Badge.vue +26 -0
  14. package/dist/admin/components/ui/badge/index.d.ts +6 -0
  15. package/dist/admin/components/ui/badge/index.js +1 -0
  16. package/dist/admin/components/ui/button/Button.vue +31 -0
  17. package/dist/admin/components/ui/button/index.d.ts +7 -0
  18. package/dist/admin/components/ui/button/index.js +1 -0
  19. package/dist/admin/components/ui/checkbox/Checkbox.vue +35 -0
  20. package/dist/admin/components/ui/checkbox/index.d.ts +1 -0
  21. package/dist/admin/components/ui/checkbox/index.js +1 -0
  22. package/dist/admin/components/ui/dialog/Dialog.vue +19 -0
  23. package/dist/admin/components/ui/dialog/DialogClose.vue +15 -0
  24. package/dist/admin/components/ui/dialog/DialogContent.vue +135 -0
  25. package/dist/admin/components/ui/dialog/DialogDescription.vue +23 -0
  26. package/dist/admin/components/ui/dialog/DialogFooter.vue +27 -0
  27. package/dist/admin/components/ui/dialog/DialogHeader.vue +17 -0
  28. package/dist/admin/components/ui/dialog/DialogOverlay.vue +21 -0
  29. package/dist/admin/components/ui/dialog/DialogScrollContent.vue +60 -0
  30. package/dist/admin/components/ui/dialog/DialogTitle.vue +23 -0
  31. package/dist/admin/components/ui/dialog/DialogTrigger.vue +15 -0
  32. package/dist/admin/components/ui/dialog/index.d.ts +10 -0
  33. package/dist/admin/components/ui/dialog/index.js +1 -0
  34. package/dist/admin/components/ui/dropdown-menu/DropdownMenu.vue +19 -0
  35. package/dist/admin/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +39 -0
  36. package/dist/admin/components/ui/dropdown-menu/DropdownMenuContent.vue +39 -0
  37. package/dist/admin/components/ui/dropdown-menu/DropdownMenuGroup.vue +15 -0
  38. package/dist/admin/components/ui/dropdown-menu/DropdownMenuItem.vue +31 -0
  39. package/dist/admin/components/ui/dropdown-menu/DropdownMenuLabel.vue +23 -0
  40. package/dist/admin/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +21 -0
  41. package/dist/admin/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +40 -0
  42. package/dist/admin/components/ui/dropdown-menu/DropdownMenuSeparator.vue +23 -0
  43. package/dist/admin/components/ui/dropdown-menu/DropdownMenuShortcut.vue +17 -0
  44. package/dist/admin/components/ui/dropdown-menu/DropdownMenuSub.vue +18 -0
  45. package/dist/admin/components/ui/dropdown-menu/DropdownMenuSubContent.vue +27 -0
  46. package/dist/admin/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +31 -0
  47. package/dist/admin/components/ui/dropdown-menu/DropdownMenuTrigger.vue +17 -0
  48. package/dist/admin/components/ui/dropdown-menu/index.d.ts +15 -0
  49. package/dist/admin/components/ui/dropdown-menu/index.js +1 -0
  50. package/dist/admin/components/ui/input/Input.vue +34 -0
  51. package/dist/admin/components/ui/input/index.d.ts +1 -0
  52. package/dist/admin/components/ui/input/index.js +1 -0
  53. package/dist/admin/components/ui/label/Label.vue +26 -0
  54. package/dist/admin/components/ui/label/index.d.ts +1 -0
  55. package/dist/admin/components/ui/label/index.js +1 -0
  56. package/dist/admin/components/ui/scroll-area/ScrollArea.vue +33 -0
  57. package/dist/admin/components/ui/scroll-area/ScrollBar.vue +32 -0
  58. package/dist/admin/components/ui/scroll-area/index.d.ts +2 -0
  59. package/dist/admin/components/ui/scroll-area/index.js +1 -0
  60. package/dist/admin/components/ui/select/Select.vue +19 -0
  61. package/dist/admin/components/ui/select/SelectContent.vue +51 -0
  62. package/dist/admin/components/ui/select/SelectGroup.vue +15 -0
  63. package/dist/admin/components/ui/select/SelectItem.vue +44 -0
  64. package/dist/admin/components/ui/select/SelectItemText.vue +15 -0
  65. package/dist/admin/components/ui/select/SelectLabel.vue +17 -0
  66. package/dist/admin/components/ui/select/SelectScrollDownButton.vue +26 -0
  67. package/dist/admin/components/ui/select/SelectScrollUpButton.vue +26 -0
  68. package/dist/admin/components/ui/select/SelectSeparator.vue +19 -0
  69. package/dist/admin/components/ui/select/SelectTrigger.vue +33 -0
  70. package/dist/admin/components/ui/select/SelectValue.vue +15 -0
  71. package/dist/admin/components/ui/select/index.d.ts +11 -0
  72. package/dist/admin/components/ui/select/index.js +1 -0
  73. package/dist/admin/components/ui/separator/Separator.vue +29 -0
  74. package/dist/admin/components/ui/separator/index.d.ts +1 -0
  75. package/dist/admin/components/ui/separator/index.js +1 -0
  76. package/dist/admin/components/ui/sheet/Sheet.vue +19 -0
  77. package/dist/admin/components/ui/sheet/SheetClose.vue +15 -0
  78. package/dist/admin/components/ui/sheet/SheetContent.vue +63 -0
  79. package/dist/admin/components/ui/sheet/SheetDescription.vue +21 -0
  80. package/dist/admin/components/ui/sheet/SheetFooter.vue +16 -0
  81. package/dist/admin/components/ui/sheet/SheetHeader.vue +15 -0
  82. package/dist/admin/components/ui/sheet/SheetOverlay.vue +21 -0
  83. package/dist/admin/components/ui/sheet/SheetTitle.vue +21 -0
  84. package/dist/admin/components/ui/sheet/SheetTrigger.vue +15 -0
  85. package/dist/admin/components/ui/sheet/index.d.ts +8 -0
  86. package/dist/admin/components/ui/sheet/index.js +1 -0
  87. package/dist/admin/components/ui/sonner/Toaster.vue +117 -0
  88. package/dist/admin/components/ui/sonner/index.d.ts +1 -0
  89. package/dist/admin/components/ui/sonner/index.js +1 -0
  90. package/dist/admin/components/ui/table/Table.vue +16 -0
  91. package/dist/admin/components/ui/table/TableBody.vue +17 -0
  92. package/dist/admin/components/ui/table/TableCaption.vue +17 -0
  93. package/dist/admin/components/ui/table/TableCell.vue +22 -0
  94. package/dist/admin/components/ui/table/TableEmpty.vue +34 -0
  95. package/dist/admin/components/ui/table/TableFooter.vue +17 -0
  96. package/dist/admin/components/ui/table/TableHead.vue +17 -0
  97. package/dist/admin/components/ui/table/TableHeader.vue +17 -0
  98. package/dist/admin/components/ui/table/TableRow.vue +17 -0
  99. package/dist/admin/components/ui/table/index.d.ts +9 -0
  100. package/dist/admin/components/ui/table/index.js +1 -0
  101. package/dist/admin/components/ui/tabs/Tabs.vue +24 -0
  102. package/dist/admin/components/ui/tabs/TabsContent.vue +21 -0
  103. package/dist/admin/components/ui/tabs/TabsList.vue +24 -0
  104. package/dist/admin/components/ui/tabs/TabsTrigger.vue +26 -0
  105. package/dist/admin/components/ui/tabs/index.d.ts +4 -0
  106. package/dist/admin/components/ui/tabs/index.js +1 -0
  107. package/dist/admin/components/ui/tooltip/Tooltip.vue +19 -0
  108. package/dist/admin/components/ui/tooltip/TooltipContent.vue +34 -0
  109. package/dist/admin/components/ui/tooltip/TooltipProvider.vue +14 -0
  110. package/dist/admin/components/ui/tooltip/TooltipTrigger.vue +15 -0
  111. package/dist/admin/components/ui/tooltip/index.d.ts +4 -0
  112. package/dist/admin/components/ui/tooltip/index.js +1 -0
  113. package/dist/admin/crud/components/vm-color-picker.vue +0 -3
  114. package/dist/admin/crud/components/vm-richtext-extensions.js +1 -1
  115. package/dist/admin/crud/config.js +1 -1
  116. package/dist/admin/crud/confirm.d.ts +8 -0
  117. package/dist/admin/crud/confirm.js +1 -1
  118. package/dist/admin/crud/crud-page-request.js +1 -1
  119. package/dist/admin/crud/dict.js +1 -1
  120. package/dist/admin/crud/export-fetch.js +1 -1
  121. package/dist/admin/crud/key.js +1 -1
  122. package/dist/admin/crud/plugins.js +1 -1
  123. package/dist/admin/crud/span.js +1 -1
  124. package/dist/admin/crud/style.d.ts +4 -0
  125. package/dist/admin/crud/style.js +1 -1
  126. package/dist/admin/crud/validate.js +1 -1
  127. package/dist/admin/directives/perm.js +1 -1
  128. package/dist/admin/env.d.ts +0 -4
  129. package/dist/admin/hooks/useUpload.js +1 -1
  130. package/dist/admin/index.d.ts +11 -9
  131. package/dist/admin/index.js +16 -27
  132. package/dist/admin/lib/browser.js +1 -1
  133. package/dist/admin/lib/cn.js +1 -1
  134. package/dist/admin/lib/dialog-float.js +1 -1
  135. package/dist/admin/lib/document-title.d.ts +6 -0
  136. package/dist/admin/lib/document-title.js +1 -0
  137. package/dist/admin/lib/export-excel.js +1 -1
  138. package/dist/admin/lib/import-excel.js +1 -1
  139. package/dist/admin/lib/json.js +1 -1
  140. package/dist/admin/lib/menu.js +1 -1
  141. package/dist/admin/lib/micro-locale.d.ts +5 -0
  142. package/dist/admin/lib/micro-locale.js +1 -0
  143. package/dist/admin/lib/micro-theme.d.ts +14 -0
  144. package/dist/admin/lib/micro-theme.js +1 -0
  145. package/dist/admin/lib/setup-crud-defaults.d.ts +2 -0
  146. package/dist/admin/lib/setup-crud-defaults.js +1 -0
  147. package/dist/admin/lib/shell.d.ts +13 -0
  148. package/dist/admin/lib/shell.js +1 -0
  149. package/dist/admin/lib/theme-color-options.js +1 -1
  150. package/dist/admin/lib/tree.js +1 -1
  151. package/dist/admin/lib/upload.js +1 -1
  152. package/dist/admin/lib/video-frame.js +1 -1
  153. package/dist/admin/router/create.d.ts +16 -0
  154. package/dist/admin/router/create.js +1 -0
  155. package/dist/admin/router/guards.d.ts +6 -0
  156. package/dist/admin/router/guards.js +1 -0
  157. package/dist/admin/router/index.d.ts +5 -3
  158. package/dist/admin/router/index.js +5 -80
  159. package/dist/admin/router/menu-routes.d.ts +7 -2
  160. package/dist/admin/router/menu-routes.js +10 -12
  161. package/dist/admin/service/index.js +0 -3
  162. package/dist/admin/stores/dict.d.ts +13 -0
  163. package/dist/admin/stores/dict.js +1 -0
  164. package/dist/admin/stores/locale.d.ts +3 -0
  165. package/dist/admin/stores/locale.js +1 -0
  166. package/dist/admin/stores/theme.d.ts +1 -0
  167. package/dist/admin/stores/theme.js +1 -0
  168. package/dist/admin/themes/dark.d.ts +2 -0
  169. package/dist/admin/themes/dark.js +1 -0
  170. package/dist/admin/themes/index.d.ts +9 -0
  171. package/dist/admin/themes/index.js +1 -0
  172. package/dist/admin/themes/light.d.ts +2 -0
  173. package/dist/admin/themes/light.js +1 -0
  174. package/dist/client/configure.d.ts +3 -0
  175. package/dist/client/configure.js +8 -1
  176. package/dist/client/vite-admin.js +2 -4
  177. package/dist/client/vite-auto-import.js +4 -4
  178. package/dist/client/vite-resolve.d.ts +3 -3
  179. package/dist/client/vite-resolve.js +10 -15
  180. package/dist/ext/plugin-market-urls.d.ts +8 -0
  181. package/dist/index.js +1 -1
  182. package/dist/server/index.js +1 -1
  183. package/dist/shared/datetime-picker.js +1 -1
  184. package/dist/shared/excel.js +1 -1
  185. package/dist/shared/index.js +1 -1
  186. package/dist/shared/locale-json.js +1 -1
  187. package/dist/shared/tree.js +1 -1
  188. package/package.json +13 -4
  189. package/typings/admin/theme.ts +10 -0
  190. package/dist/admin/config/plugin-dev.d.ts +0 -52
  191. package/dist/admin/config/plugin-dev.js +0 -1
  192. package/dist/comm/chinese-segments.test.d.ts +0 -1
  193. package/dist/comm/path.test.d.ts +0 -1
  194. package/typings/admin/base/auth.d.ts +0 -21
  195. package/typings/admin/base/permission.d.ts +0 -19
  196. package/typings/admin/comm/crud.d.ts +0 -343
  197. package/typings/admin/comm/eps.d.ts +0 -66
  198. package/typings/admin/comm/request.d.ts +0 -13
  199. package/typings/admin/comm/service.d.ts +0 -48
  200. package/typings/admin/comm/upload.d.ts +0 -26
  201. package/typings/admin/host.d.ts +0 -66
  202. package/typings/admin/vome/browser.d.ts +0 -10
  203. package/typings/admin/vome/module.d.ts +0 -13
@@ -1,343 +0,0 @@
1
- import type { Component, InjectionKey, MaybeRefOrGetter, Ref } from 'vue';
2
- import type { ServiceRequestOptions } from './service';
3
-
4
- type CrudRequestOptions = Pick<ServiceRequestOptions, 'timeoutMs'>;
5
-
6
- /** 标准 CRUD service */
7
- export type CrudService = {
8
- namespace?: string;
9
- page?: (
10
- data: Record<string, unknown>,
11
- options?: CrudRequestOptions,
12
- ) => Promise<{
13
- list: Record<string, unknown>[];
14
- pagination: {
15
- page: number;
16
- size: number;
17
- total: number;
18
- };
19
- }>;
20
- list?: (
21
- data?: Record<string, unknown>,
22
- options?: CrudRequestOptions,
23
- ) => Promise<Record<string, unknown>[]>;
24
- info?: (data: {
25
- id: number | string;
26
- }) => Promise<Record<string, unknown>>;
27
- add?: (data: Record<string, unknown>) => Promise<unknown>;
28
- update?: (data: Record<string, unknown>) => Promise<unknown>;
29
- delete?: (data: {
30
- ids: Array<number | string>;
31
- force?: boolean;
32
- }) => Promise<unknown>;
33
- restore?: (data: {
34
- ids: Array<number | string>;
35
- }) => Promise<unknown>;
36
- /** 权限码字符串 map */
37
- permission?: Partial<CrudPermission> | Record<string, string>;
38
- /** 当前用户是否具备对应权限 */
39
- _permission?: Partial<CrudPermission> & Record<string, boolean>;
40
- request?: (options?: any) => Promise<unknown>;
41
- [key: string]: unknown;
42
- };
43
- export type CrudPermission = {
44
- page: boolean;
45
- list: boolean;
46
- info: boolean;
47
- add: boolean;
48
- delete: boolean;
49
- update: boolean;
50
- /** 有则显示回收站;与 Controller `api` 含 restore 对齐 */
51
- restore: boolean;
52
- };
53
- export type CrudDict = {
54
- primaryId: string;
55
- api: {
56
- list: string;
57
- add: string;
58
- update: string;
59
- delete: string;
60
- info: string;
61
- page: string;
62
- };
63
- pagination: {
64
- page: string;
65
- size: string;
66
- };
67
- search: {
68
- keyWord: string;
69
- query: string;
70
- };
71
- sort: {
72
- order: string;
73
- prop: string;
74
- };
75
- label: Record<string, string>;
76
- };
77
- export type CrudFormComponent = {
78
- name?: string | Component;
79
- props?: Record<string, unknown>;
80
- };
81
- export type CrudSearchItem = {
82
- prop: string;
83
- /** 筛选项不展示 label;占位用 placeholder 或 phMode / fieldKey */
84
- label?: string;
85
- type?: 'input' | 'select' | 'date' | 'daterange' | 'number-range';
86
- placeholder?: string;
87
- options?: MaybeRefOrGetter<Array<{
88
- label: string;
89
- value: string | number | boolean;
90
- }>>;
91
- /** 业务字典 type.key;有则拉 options */
92
- dict?: string;
93
- /** 下拉多选 */
94
- multiple?: boolean;
95
- /** 区间:提交时拆成 min/max 请求参数 */
96
- range?: {
97
- min: string;
98
- max: string;
99
- rangeType: 'int' | 'float' | 'year' | 'month' | 'day' | 'datetime';
100
- };
101
- /** component.name 走 registry */
102
- component?: CrudFormComponent;
103
- /**
104
- * 初始化值(写入 search form;重置亦回到此值)。
105
- * 勿写在 component.props(会被 :model-value 覆盖)。
106
- */
107
- value?: unknown;
108
- /** i18n:field.{table}.{prop},运行时解析占位符 */
109
- fieldKey?: string;
110
- /** 无翻译时的字段中文名(EPS comment) */
111
- nameFallback?: string;
112
- /** 占位符模式:搜索 / 选择 / 关键字 / 区间 */
113
- phMode?: 'search' | 'select' | 'keyword' | 'range';
114
- /** keyword 多字段 fieldKey 列表 */
115
- keywordParts?: string[];
116
- };
117
- export type CrudOpButton = 'edit' | 'delete' | 'info' | {
118
- label: string;
119
- hidden?: boolean;
120
- disabled?: boolean;
121
- variant?: 'softPrimary' | 'softDestructive' | 'softSuccess' | 'ghost' | 'outline';
122
- onClick: (row: Record<string, unknown>) => void;
123
- };
124
- export type CrudColumn = {
125
- prop?: string;
126
- label?: string;
127
- /** i18n 完整 key,优先于 field.*(如 i18n.langName) */
128
- labelKey?: string;
129
- /** 显式 field.{table}.{prop};缺省时按 EPS 推断 */
130
- fieldKey?: string;
131
- /** selection | index | op | expand */
132
- type?: 'selection' | 'index' | 'op' | 'expand';
133
- width?: string | number;
134
- minWidth?: string | number;
135
- align?: 'left' | 'center' | 'right';
136
- /** 横向滚动时固定列;`type: 'op'` 未写时默认 `right` */
137
- fixed?: 'left' | 'right';
138
- hidden?: boolean;
139
- /** true / custom 可点排序;asc|desc 表示默认方向 */
140
- sortable?: boolean | 'custom' | 'asc' | 'desc' | 'ascending' | 'descending';
141
- slot?: string;
142
- formatter?: (row: Record<string, unknown>, value: unknown) => string;
143
- /** op 列:edit/delete/info 或自定义按钮对象 */
144
- buttons?: CrudOpButton[] | ((row: Record<string, unknown>) => CrudOpButton[]);
145
- /** 单元格组件:name 为注册名或直接组件 */
146
- component?: {
147
- name?: string | Component;
148
- props?: Record<string, unknown>;
149
- };
150
- /** dict.get / dict.options(支持 ComputedRef) */
151
- dict?: MaybeRefOrGetter<Array<{
152
- label: string;
153
- value: string | number;
154
- type?: string;
155
- color?: string;
156
- }>>;
157
- children?: CrudColumn[];
158
- };
159
- export type CrudFormItem = {
160
- prop: string;
161
- label: string;
162
- type?: 'input' | 'textarea' | 'select' | 'switch' | 'radio';
163
- required?: boolean;
164
- placeholder?: string;
165
- /** 控件禁用 */
166
- disabled?: boolean;
167
- /** 扁平或树;options: dict.get('x') */
168
- options?: MaybeRefOrGetter<Array<{
169
- label: string;
170
- value: string | number | boolean;
171
- children?: Array<{
172
- label: string;
173
- value: string | number | boolean;
174
- children?: unknown[];
175
- }>;
176
- }>>;
177
- /** 按桌面 24 栅格配置(全宽 24);移动端自动映射到 12 列 */
178
- span?: number;
179
- hidden?: boolean | ((form: Record<string, unknown>) => boolean);
180
- /** 用 component 描述控件 */
181
- component?: CrudFormComponent;
182
- /**
183
- * 新增表单初始化值(rowAdd / openUpsert add 时写入;`:add-data` 同名字段优先)。
184
- * 勿写在 component.props。
185
- */
186
- value?: unknown;
187
- rules?: unknown;
188
- };
189
- export type CrudTrashMode = 'default' | 'onlyTrashed' | 'withTrashed';
190
- export type CrudRefreshHelpers = {
191
- next: (params: Record<string, unknown>) => Promise<unknown>;
192
- done: () => void;
193
- render: (list: Record<string, unknown>[] | {
194
- list: Record<string, unknown>[];
195
- pagination?: unknown;
196
- }, pagination?: {
197
- page?: number;
198
- size?: number;
199
- total?: number;
200
- }) => void;
201
- };
202
- export type CrudDeleteHelpers = {
203
- next: (params?: Record<string, unknown>) => Promise<unknown>;
204
- };
205
- export type CrudOptions = {
206
- /** EPS service 对象,如 service.base.user */
207
- service: CrudService;
208
- dict?: Partial<CrudDict>;
209
- permission?: Partial<CrudPermission>;
210
- onRefresh?: (params: Record<string, unknown>, helpers: CrudRefreshHelpers) => void | Promise<void>;
211
- onDelete?: (selection: Record<string, unknown>[], helpers: CrudDeleteHelpers) => void | Promise<void>;
212
- };
213
- export type CrudUpsertOptions = {
214
- items?: CrudFormItem[];
215
- props?: Record<string, unknown>;
216
- dialog?: {
217
- title?: string;
218
- /** 显式 false 强制隐藏确定;未设时仍按 info 模式自动隐藏 */
219
- confirm?: boolean;
220
- /** 显式 false 隐藏关闭;默认 true */
221
- close?: boolean;
222
- /** 弹窗高度,如 800 / '800px';最高 800px */
223
- height?: string | number;
224
- confirmText?: string;
225
- closeText?: string;
226
- };
227
- sync?: boolean;
228
- onOpen?: (data: Record<string, unknown>) => void;
229
- onOpened?: (data: Record<string, unknown>) => void;
230
- onClose?: (action: 'close' | 'submit', done: () => void) => void;
231
- onInfo?: (data: Record<string, unknown>, helpers: {
232
- next: (data?: Record<string, unknown>) => Promise<Record<string, unknown>>;
233
- done: (data: Record<string, unknown>) => void;
234
- close: () => void;
235
- }) => void | Promise<void>;
236
- onSubmit?: (data: Record<string, unknown>, helpers: {
237
- next: (data?: Record<string, unknown>) => Promise<unknown>;
238
- done: () => void;
239
- close: () => void;
240
- }) => void | Promise<void | unknown>;
241
- };
242
- export type CrudTableOptions = {
243
- columns?: CrudColumn[];
244
- autoHeight?: boolean;
245
- border?: boolean;
246
- contextMenu?: boolean | string[];
247
- rowKey?: string;
248
- /** 树表:list 含 children 时缩进展开 */
249
- tree?: boolean;
250
- treeLazy?: boolean;
251
- /** 树表默认全部展开(为 true 时忽略 defaultExpandLevel) */
252
- defaultExpandAll?: boolean;
253
- /** 树表默认展开到第几级(1=仅根、不展开;默认 1) */
254
- defaultExpandLevel?: number;
255
- /** 默认排序;请求键由 dict.sort 决定 */
256
- defaultSort?: {
257
- prop: string;
258
- order: 'asc' | 'desc' | 'ascending' | 'descending';
259
- };
260
- /** 排序变化时是否 refresh,默认 true */
261
- sortRefresh?: boolean;
262
- plugins?: unknown[];
263
- };
264
- export type CrudSearchOptions = {
265
- items?: CrudSearchItem[];
266
- };
267
- export type CrudContext = {
268
- service: CrudService;
269
- loading: Ref<boolean>;
270
- list: Ref<Record<string, unknown>[]>;
271
- selection: Ref<Record<string, unknown>[]>;
272
- pagination: Ref<{
273
- page: number;
274
- size: number;
275
- total: number;
276
- }>;
277
- params: Ref<Record<string, unknown>>;
278
- trashMode: Ref<CrudTrashMode>;
279
- permission: Ref<CrudPermission>;
280
- dict: CrudDict;
281
- refresh: (extra?: Record<string, unknown>) => Promise<unknown>;
282
- setParams: (p: Record<string, unknown>, doRefresh?: boolean) => void;
283
- /** doRefresh=false 时只清 params 不拉列表(供 search 重置后带初始值再 search) */
284
- resetParams: (doRefresh?: boolean) => void;
285
- setSelection: (rows: Record<string, unknown>[]) => void;
286
- getPermission: (key?: keyof CrudPermission) => boolean | CrudPermission;
287
- getParams: () => Record<string, unknown>;
288
- buildListQuery: (extra?: Record<string, unknown>) => Record<string, unknown>;
289
- buildExportQuery: (extra?: Record<string, unknown>) => Record<string, unknown>;
290
- requestPage: (
291
- body: Record<string, unknown>,
292
- options?: { timeoutMs?: number },
293
- ) => Promise<{
294
- list: Record<string, unknown>[];
295
- pagination?: {
296
- page?: number;
297
- size?: number;
298
- total?: number;
299
- };
300
- }>;
301
- rowAdd: (defaults?: Record<string, unknown>) => void;
302
- rowAppend: (data?: Record<string, unknown>) => void;
303
- rowEdit: (row: Record<string, unknown>) => Promise<void>;
304
- rowInfo: (row: Record<string, unknown>) => Promise<void>;
305
- rowClose: () => void;
306
- /** 打开 upsert,不校验 add 权限 */
307
- openUpsert: (form?: Record<string, unknown>, mode?: 'add' | 'update' | 'info') => void;
308
- rowDelete: (rows?: Record<string, unknown>[], force?: boolean) => Promise<void>;
309
- rowRestore: (rows?: Record<string, unknown>[]) => Promise<void>;
310
- upsertVisible: Ref<boolean>;
311
- upsertMode: Ref<'add' | 'update' | 'info'>;
312
- upsertForm: Ref<Record<string, unknown>>;
313
- upsertSubmit: () => Promise<void>;
314
- upsertClose: () => void;
315
- patchUpsertForm: (patch: Record<string, unknown>) => void;
316
- getUpsertForm: () => Record<string, unknown>;
317
- /** vm-search 注册;vm-toolbar 搜索/重置读取 */
318
- searchActions: import('vue').ShallowRef<{
319
- search: () => void;
320
- reset: () => void;
321
- } | null>;
322
- /** vm-search 是否有筛选项;无配置时不显示 toolbar 搜索/重置 */
323
- hasSearchFilters: Ref<boolean>;
324
- };
325
- /** 表格右键菜单项 */
326
- export type CtxMenuItem = {
327
- key: string;
328
- label: string;
329
- disabled?: boolean;
330
- };
331
- /** 树形下拉选项 */
332
- export type TreeSelectOption = {
333
- label?: string;
334
- value?: string | number | boolean;
335
- children?: TreeSelectOption[];
336
- [key: string]: unknown;
337
- };
338
- /** CRUD Table 插件标记 */
339
- export type TablePlugin = {
340
- __plugin: string;
341
- [key: string]: unknown;
342
- };
343
- export type { InjectionKey, Ref };
@@ -1,66 +0,0 @@
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
- export type EpsColumn = {
12
- propertyName: string;
13
- type: string;
14
- comment?: string;
15
- nullable?: boolean;
16
- dict?: string | string[];
17
- /** 物理表名,供 field.{table}.{prop} */
18
- table?: string;
19
- source?: string;
20
- };
21
- export type EpsEntity = {
22
- module: string;
23
- side: string;
24
- prefix: string;
25
- /** 关联实体/表名(可选);中间列展示用 info.type.name 或 prefix 末段 */
26
- name?: string;
27
- info?: {
28
- type: {
29
- /** 控制器路径末段,对应文件名(如 dict-info) */
30
- name: string;
31
- description: string;
32
- };
33
- };
34
- api: EpsApiItem[];
35
- columns: EpsColumn[];
36
- pageColumns: EpsColumn[];
37
- pageQueryOp?: {
38
- keyWordLikeFields?: unknown[];
39
- fieldEq?: unknown[];
40
- fieldLike?: unknown[];
41
- fieldArray?: unknown[];
42
- fieldRange?: unknown[];
43
- };
44
- };
45
- export type EpsModuleMap = Record<string, EpsEntity[]>;
46
- /** EPS 开放接口完整载荷 */
47
- export type EpsDictFlatRow = {
48
- id: number;
49
- name: string;
50
- typeId: number;
51
- parentId?: number | null;
52
- orderNum?: number;
53
- value?: unknown;
54
- };
55
- export type EpsPayload = {
56
- /** 服务端 vome.eps;写入打包 eps.json,生产仅 true 时前端可再请求 */
57
- eps?: boolean;
58
- modules: EpsModuleMap;
59
- dict: Record<string, EpsDictFlatRow[]>;
60
- };
61
- /** 菜单「自动添加权限」行 */
62
- export type AutoPermRow = {
63
- enabled: boolean;
64
- name: string;
65
- perm: string;
66
- };
@@ -1,13 +0,0 @@
1
- export type ApiResult<T> = {
2
- code: number;
3
- message: string;
4
- data: T;
5
- };
6
- export type RequestOptions = RequestInit & {
7
- /** 失败时是否 toast,默认 true */
8
- toast?: boolean;
9
- /** 跳过自动 refresh */
10
- skipRefresh?: boolean;
11
- /** 请求超时 ms,默认 5000;AI sync 默认 360000,stream 传 0 不掐断 */
12
- timeoutMs?: number;
13
- };
@@ -1,48 +0,0 @@
1
- /** 链式 service 叶子节点 */
2
- export type ServiceRequestOptions = {
3
- url?: string;
4
- method?: string;
5
- data?: unknown;
6
- params?: Record<string, unknown>;
7
- /** 透传 HTTP 超时;默认由 request 客户端处理(5s) */
8
- timeoutMs?: number;
9
- };
10
- export type ServiceLeaf = {
11
- namespace: string;
12
- permission: Record<string, string>;
13
- _permission: Record<string, boolean>;
14
- request: (options?: ServiceRequestOptions) => Promise<unknown>;
15
- page?: (
16
- data?: Record<string, unknown>,
17
- options?: Pick<ServiceRequestOptions, 'timeoutMs'>,
18
- ) => Promise<{
19
- list: Record<string, unknown>[];
20
- pagination: {
21
- page: number;
22
- size: number;
23
- total: number;
24
- };
25
- }>;
26
- list?: (
27
- data?: Record<string, unknown>,
28
- options?: Pick<ServiceRequestOptions, 'timeoutMs'>,
29
- ) => Promise<Record<string, unknown>[]>;
30
- info?: (data: {
31
- id: number | string;
32
- }) => Promise<Record<string, unknown>>;
33
- add?: (data: Record<string, unknown>) => Promise<unknown>;
34
- update?: (data: Record<string, unknown>) => Promise<unknown>;
35
- delete?: (data: {
36
- ids: Array<number | string>;
37
- force?: boolean;
38
- }) => Promise<unknown>;
39
- restore?: (data: {
40
- ids: Array<number | string>;
41
- }) => Promise<unknown>;
42
- [method: string]: unknown;
43
- };
44
- /** 嵌套树:service.base.user(动态键,运行时由 EPS 填充) */
45
- export type ServiceTree = {
46
- request: (options?: ServiceRequestOptions) => Promise<unknown>;
47
- [key: string]: any;
48
- };
@@ -1,26 +0,0 @@
1
- export type UploadFileType = 'image' | 'video' | 'audio' | 'word' | 'excel' | 'ppt' | 'pdf' | 'rar' | 'file';
2
- export type UploadRule = {
3
- name: string;
4
- type: UploadFileType;
5
- color: string;
6
- exts: string[];
7
- };
8
- export type UploadItem = {
9
- uid: string;
10
- name: string;
11
- url: string;
12
- preload?: string;
13
- type: UploadFileType;
14
- size?: number;
15
- progress: number;
16
- error?: string;
17
- };
18
- export type UploadOptions = {
19
- prefixPath?: string;
20
- onProgress?: (progress: number) => void;
21
- };
22
- export type UploadResult = {
23
- url: string;
24
- key?: string;
25
- fileId?: string;
26
- };
@@ -1,66 +0,0 @@
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
- }
62
-
63
- declare module '#vome-host/lib/theme-color-options' {
64
- import type { VmColorThemeOption } from 'vome-core/admin/crud'
65
- export function listThemeColorOptions(): VmColorThemeOption[]
66
- }
@@ -1,10 +0,0 @@
1
- export type BrowserScreen = 'xs' | 'sm' | 'md' | 'xl' | 'full';
2
- export type BrowserInfo = {
3
- height: number;
4
- width: number;
5
- type: string;
6
- /** 断点:xs <768 / sm <992 / md <1200 / xl <1920 / full */
7
- screen: BrowserScreen;
8
- /** 迷你布局:侧栏收起或移动端 */
9
- isMini: boolean;
10
- };
@@ -1,13 +0,0 @@
1
- import type { Component } from 'vue';
2
- /** 视图异步加载器 */
3
- export type ViewLoader = () => Promise<{
4
- default: Component;
5
- }>;
6
- /** 视图路径树(菜单 viewPath 选择) */
7
- export type ViewsTreeNode = {
8
- label: string;
9
- /** 完整 viewPath(叶子)或路径前缀(目录) */
10
- value: string;
11
- isLeaf?: boolean;
12
- children?: ViewsTreeNode[];
13
- };