jwt-ui 1.11.26 → 1.11.27
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/package.json +6 -3
- package/types/global.d.ts +36 -0
- package/types/index.d.ts +1689 -0
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,1689 @@
|
|
|
1
|
+
// Type definitions for jwt-ui v1.x
|
|
2
|
+
// Definitions by WGL
|
|
3
|
+
|
|
4
|
+
import type {
|
|
5
|
+
App,
|
|
6
|
+
ComputedRef,
|
|
7
|
+
DefineComponent,
|
|
8
|
+
Ref,
|
|
9
|
+
VNodeChild,
|
|
10
|
+
} from 'vue'
|
|
11
|
+
|
|
12
|
+
/** 插槽函数类型 */
|
|
13
|
+
type Slot<T extends Record<string, any> = Record<string, any>> = (props: T) => VNodeChild
|
|
14
|
+
|
|
15
|
+
// ============================================================
|
|
16
|
+
// Plugin Configuration - 插件初始化配置
|
|
17
|
+
// ============================================================
|
|
18
|
+
|
|
19
|
+
/** setupJwt 初始化配置项 */
|
|
20
|
+
export interface JwtUiOptions {
|
|
21
|
+
/** 翻译/国际化函数 */
|
|
22
|
+
translateTitle: (text: string) => string
|
|
23
|
+
/** 网络请求函数 (axios 封装) */
|
|
24
|
+
request: (opt: any) => Promise<any>
|
|
25
|
+
/** 图片路径补全函数 */
|
|
26
|
+
fillUrl: (url: string, ...args: any[]) => string
|
|
27
|
+
/** Vue Router 实例 */
|
|
28
|
+
router: { push: (options: { path: string; query?: any }) => void }
|
|
29
|
+
/** 图片上传接口地址 */
|
|
30
|
+
uploadImgUrl?: string
|
|
31
|
+
/** 富文本上传接口地址 */
|
|
32
|
+
uploadRichTextUrl?: string
|
|
33
|
+
/** 腾讯 COS 上传文件地址 */
|
|
34
|
+
txCosUploadFileUrl?: string
|
|
35
|
+
/** 图片上传返回的路径字段名,默认 'relative_path' */
|
|
36
|
+
imgUploadResKey: string
|
|
37
|
+
/** 空图片默认地址 */
|
|
38
|
+
emptyImgUrl?: string
|
|
39
|
+
/** 图片加载错误时的占位图地址 */
|
|
40
|
+
errorImgUrl?: string
|
|
41
|
+
/** 图片默认名称 key */
|
|
42
|
+
defaultImgNameKey?: string
|
|
43
|
+
/** 图片默认名称长度 */
|
|
44
|
+
defaultImgNameLength?: number
|
|
45
|
+
/** Token 字段名,默认 'Authorization' */
|
|
46
|
+
tokenKey: string
|
|
47
|
+
/** 本地存储 Token 的 key,默认 'admin-token' */
|
|
48
|
+
localTokenKey: string
|
|
49
|
+
/** 自定义文件类型判断函数 */
|
|
50
|
+
getFileType?: (filename: string, typeName?: boolean, obj?: boolean) => any
|
|
51
|
+
/** 自动保存表单函数 */
|
|
52
|
+
autoSaveForm: () => any
|
|
53
|
+
/** 上传文件字段名,默认 'filedata' */
|
|
54
|
+
uploadFileName: string
|
|
55
|
+
/** 表格按钮权限字段名,默认 'show_table' */
|
|
56
|
+
showTableKey: string
|
|
57
|
+
/** 表头按钮权限字段名,默认 'show_header' */
|
|
58
|
+
showHeaderKey: string
|
|
59
|
+
/** 联合 ID 字段名 */
|
|
60
|
+
unionIdKey?: string
|
|
61
|
+
/** 分页页码字段名 */
|
|
62
|
+
pageKey?: string
|
|
63
|
+
/** 分页大小字段名 */
|
|
64
|
+
pageSizeKey?: string
|
|
65
|
+
/** 表格每页显示条数选项 */
|
|
66
|
+
tablePageSizes?: number[] | null
|
|
67
|
+
/** 自定义图标映射对象 */
|
|
68
|
+
customIconObj?: Record<string, any>
|
|
69
|
+
/** 自动保存间隔时间(ms) */
|
|
70
|
+
autoSaveIntervalTime?: number
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** 注册 jwt-ui 插件,注册后所有组件全局可用 */
|
|
74
|
+
export function setupJwt(app: App, options?: Partial<JwtUiOptions>): void
|
|
75
|
+
|
|
76
|
+
export function setAppOptions(options: Partial<JwtUiOptions>): void
|
|
77
|
+
export function getAppOptions(): JwtUiOptions
|
|
78
|
+
export function t(text: string): string
|
|
79
|
+
export function getToken(): Record<string, string | null>
|
|
80
|
+
|
|
81
|
+
// ============================================================
|
|
82
|
+
// JwtTable - 数据表格
|
|
83
|
+
// ============================================================
|
|
84
|
+
|
|
85
|
+
export interface JwtTableProps {
|
|
86
|
+
/** 表格配置对象,包含列配置、接口地址、搜索条件等 */
|
|
87
|
+
config: Record<string, any>
|
|
88
|
+
/** 表格高度 */
|
|
89
|
+
tableHeight?: string | number
|
|
90
|
+
/** 用户菜单权限对象 */
|
|
91
|
+
userMenusAuth?: Record<string, any>
|
|
92
|
+
/** 当前路由对象 */
|
|
93
|
+
route?: Record<string, any>
|
|
94
|
+
/** 路由实例 */
|
|
95
|
+
router?: Record<string, any>
|
|
96
|
+
/** 用户字段配置列表 */
|
|
97
|
+
userFieldList?: Record<string, any>
|
|
98
|
+
/** 关联菜单 ID */
|
|
99
|
+
refMenuId?: string | number
|
|
100
|
+
/** 权限 URL */
|
|
101
|
+
pageUrl?: string
|
|
102
|
+
/** 自定义表格列配置,覆盖 config 中的列 */
|
|
103
|
+
tableColumn?: any[]
|
|
104
|
+
/** 是否冻结响应式数据 (markRaw),默认 true */
|
|
105
|
+
freezeList?: boolean
|
|
106
|
+
/** 是否缓存搜索条件,默认 false */
|
|
107
|
+
cacheSearch?: boolean
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** JwtTable / JwtTableV2 事件 */
|
|
111
|
+
export interface JwtTableEmits {
|
|
112
|
+
/** 选中行变化 */
|
|
113
|
+
'selection-change': (selection: any[]) => void
|
|
114
|
+
/** 列表数据加载成功后触发 */
|
|
115
|
+
'list-change': () => void
|
|
116
|
+
/** 表头按钮操作事件 */
|
|
117
|
+
'header-action': (action: any, selectionRow: any[], detailInfo?: any, rowAction?: any) => void
|
|
118
|
+
/** 表格行操作按钮点击 */
|
|
119
|
+
'table-action': (action: any, row: any, rowAction: any, data: any) => void
|
|
120
|
+
/** 新增操作触发 */
|
|
121
|
+
'add-handle': (...args: any[]) => void
|
|
122
|
+
/** 编辑操作触发 */
|
|
123
|
+
'edit-handle': (...args: any[]) => void
|
|
124
|
+
/** 新增请求成功 */
|
|
125
|
+
'add-success': (data: any, type: string) => void
|
|
126
|
+
/** 编辑请求成功 */
|
|
127
|
+
'edit-success': (data: any, type: string) => void
|
|
128
|
+
/** 删除请求成功 */
|
|
129
|
+
'delete-success': (row: any) => void
|
|
130
|
+
/** 当前高亮行变化 */
|
|
131
|
+
'table-current-change': (currentRow: any) => void
|
|
132
|
+
/** 表格数据加载完成 */
|
|
133
|
+
'tablelist-change': (data: any) => void
|
|
134
|
+
/** 获取详情成功 */
|
|
135
|
+
'get-detail-success': (res: any) => void
|
|
136
|
+
/** 单元格点击 */
|
|
137
|
+
'click-cell': (row: any, item: any) => void
|
|
138
|
+
/** 描述面板内联编辑成功 */
|
|
139
|
+
'des-edit-success': (res: any, code: string) => void
|
|
140
|
+
/** 上传按钮点击 */
|
|
141
|
+
'upload-btn': (item: any) => void
|
|
142
|
+
/** 通用事件透传 */
|
|
143
|
+
'event-name': (...args: any[]) => void
|
|
144
|
+
/** 复制成功 */
|
|
145
|
+
'copy-success': (row: any) => void
|
|
146
|
+
/** 异步导出 */
|
|
147
|
+
asynExport: (...args: any[]) => void
|
|
148
|
+
/** 搜索提交返回结果 */
|
|
149
|
+
'search-result': (data: any) => void
|
|
150
|
+
/** 表格列配置变更(显隐/宽度/拖拽) */
|
|
151
|
+
'change-table-column': (type: string, item: any) => void
|
|
152
|
+
/** 固定列变更 */
|
|
153
|
+
'fixed-table-column': (...args: any[]) => void
|
|
154
|
+
/** 弹窗关闭 */
|
|
155
|
+
'dialog-close': () => void
|
|
156
|
+
/** 刷新抽屉详情 (仅 JwtTable) */
|
|
157
|
+
'refresh-draw': () => void
|
|
158
|
+
/** 刷新表格 */
|
|
159
|
+
'refresh-table': () => void
|
|
160
|
+
/** 表单项值变化 */
|
|
161
|
+
'form-item-change': (val: any, item: any, model: any) => void
|
|
162
|
+
/** 行内编辑值变化 */
|
|
163
|
+
'row-change': (row: any, item: any) => void
|
|
164
|
+
/** 单元格双击 */
|
|
165
|
+
'dbclick-cell': (data: any) => void
|
|
166
|
+
/** 表格行拖拽排序变更 */
|
|
167
|
+
'change-table-rank': (tableData: any[]) => void
|
|
168
|
+
/** 弹窗底部按钮点击后 */
|
|
169
|
+
'after-btns-click': (btn: any, modelData: any, item: any, fetchContent?: any) => void
|
|
170
|
+
/** 文件预览 */
|
|
171
|
+
'show-file': (url: string) => void
|
|
172
|
+
/** 排序变更 */
|
|
173
|
+
'sort-change': (sort: { prop: string; order: string; param?: any; tableFields?: any }) => void
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** JwtTable / JwtTableV2 插槽 */
|
|
177
|
+
export interface JwtTableSlots {
|
|
178
|
+
/** 搜索区域之前 */
|
|
179
|
+
'search-before'?: Slot
|
|
180
|
+
/** 搜索表单之后 */
|
|
181
|
+
'search-form-after'?: Slot
|
|
182
|
+
/** 搜索区域之后 */
|
|
183
|
+
'search-after'?: Slot
|
|
184
|
+
/** 表头按钮之前 */
|
|
185
|
+
'header-button-before'?: Slot
|
|
186
|
+
/** 表头按钮之后 */
|
|
187
|
+
'header-button-after'?: Slot
|
|
188
|
+
/** 表格上方 */
|
|
189
|
+
'table-before'?: Slot
|
|
190
|
+
/** 替换整个表格内容,接收当前列表数据 */
|
|
191
|
+
'table-content'?: Slot<{ list: any[] }>
|
|
192
|
+
/** 表格下方 */
|
|
193
|
+
'table-after'?: Slot
|
|
194
|
+
/** 分页之前,可用于显示统计信息 */
|
|
195
|
+
'table-pagination-before'?: Slot<{ data: any }>
|
|
196
|
+
/** 分页之后 */
|
|
197
|
+
'table-pagination-after'?: Slot
|
|
198
|
+
/**
|
|
199
|
+
* 动态插槽,支持以下命名规则:
|
|
200
|
+
* - `col-[prop]` 列内容插槽,如 col-name,props: { row, column, $index }
|
|
201
|
+
* - `col-[prop]-header` 列头插槽,props: { column }
|
|
202
|
+
* - `[name]` 表单插槽 (由 formList 项的 name 决定),props: { model }
|
|
203
|
+
*/
|
|
204
|
+
[slotName: string]: Slot<any> | undefined
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/** JwtTable ref 暴露的方法和状态 */
|
|
208
|
+
export interface JwtTableExpose {
|
|
209
|
+
/** el-table 实例引用 */
|
|
210
|
+
tableRef: Ref<any>
|
|
211
|
+
/** 当前表格数据 */
|
|
212
|
+
tableData: Ref<any[]>
|
|
213
|
+
/** 当前渲染的列配置 */
|
|
214
|
+
appTableColumn: Ref<any[]>
|
|
215
|
+
/** 合并后的配置对象 */
|
|
216
|
+
appConfig: Record<string, any>
|
|
217
|
+
/** 分页信息 */
|
|
218
|
+
pagination: { currentPage: number; pageCount: number; pageSize: number; totalCount: number; sort: string; order: string }
|
|
219
|
+
/** 编辑弹窗表单引用 */
|
|
220
|
+
editBoxRef: Ref<any>
|
|
221
|
+
/** 编辑弹窗表单 model */
|
|
222
|
+
editBoxRefModel: ComputedRef<any>
|
|
223
|
+
/** 编辑弹窗状态 (title, type, visible, model, config, boxName) */
|
|
224
|
+
editBoxInfo: Record<string, any>
|
|
225
|
+
/** 新增弹窗状态 */
|
|
226
|
+
addBoxInfo: Record<string, any>
|
|
227
|
+
/** 当前选中行 */
|
|
228
|
+
selectionRow: Ref<any[]>
|
|
229
|
+
/** 选中行 ID (逗号分隔) */
|
|
230
|
+
selectionRowIds: ComputedRef<string>
|
|
231
|
+
/** 搜索表单 model */
|
|
232
|
+
tableSearchModel: Ref<any>
|
|
233
|
+
/** 获取列表数据 */
|
|
234
|
+
getList(param?: any): Promise<void>
|
|
235
|
+
/** 初始化搜索并请求 */
|
|
236
|
+
initSearch(param?: any): void
|
|
237
|
+
/** 刷新 (回到第一页) */
|
|
238
|
+
handleRefresh(): void
|
|
239
|
+
/** 重置 (清空搜索回到第一页) */
|
|
240
|
+
handleReset(): void
|
|
241
|
+
/** 刷新当前页 */
|
|
242
|
+
handleRefreshCurrent(): void
|
|
243
|
+
/** 获取选中行 */
|
|
244
|
+
getSelectionRows(): any[]
|
|
245
|
+
/** 清空选中 */
|
|
246
|
+
handleClearSelection(): void
|
|
247
|
+
/** 切换行选中状态 */
|
|
248
|
+
handleToggleRowSelection(row: any, selected?: boolean): void
|
|
249
|
+
/** 切换行展开状态 */
|
|
250
|
+
handleToggleRowExpansion(row: any, expanded?: boolean): void
|
|
251
|
+
/** 直接设置表格数据 */
|
|
252
|
+
handleSetTableData(data: any[]): void
|
|
253
|
+
/** 设置表格列配置 */
|
|
254
|
+
handleSetTableColumn(data: any[]): void
|
|
255
|
+
/** 排序 */
|
|
256
|
+
handleSort(prop: string, order: string): void
|
|
257
|
+
/** 打开编辑弹窗 */
|
|
258
|
+
handleEdit(row: any, rowAction?: any): void
|
|
259
|
+
/** 获取表单提交数据 */
|
|
260
|
+
getSubmitData(): Promise<any>
|
|
261
|
+
/** 设置弹窗表单字段值 */
|
|
262
|
+
setFormModelVal(key: string, val: any): void
|
|
263
|
+
/** 设置搜索表单字段值 */
|
|
264
|
+
handleSetSearchModelVal(key: string, val: any): void
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// ============================================================
|
|
268
|
+
// JwtTableV2 - 优化版数据表格(与 JwtTable 接口一致)
|
|
269
|
+
// ============================================================
|
|
270
|
+
|
|
271
|
+
/** JwtTableV2 Props 与 JwtTable 相同 */
|
|
272
|
+
export type JwtTableV2Props = JwtTableProps
|
|
273
|
+
/** JwtTableV2 事件与 JwtTable 相同 (无 refresh-draw) */
|
|
274
|
+
export type JwtTableV2Emits = JwtTableEmits
|
|
275
|
+
/** JwtTableV2 插槽与 JwtTable 相同 */
|
|
276
|
+
export type JwtTableV2Slots = JwtTableSlots
|
|
277
|
+
|
|
278
|
+
// ============================================================
|
|
279
|
+
// JwtTableOnly - 纯表格(无工具栏/分页)
|
|
280
|
+
// ============================================================
|
|
281
|
+
|
|
282
|
+
export interface JwtTableOnlyProps {
|
|
283
|
+
/** 表格配置 */
|
|
284
|
+
config: Record<string, any>
|
|
285
|
+
/** 表格高度 */
|
|
286
|
+
tableHeight?: string | number
|
|
287
|
+
/** 用户菜单权限 */
|
|
288
|
+
userMenusAuth?: Record<string, any>
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export interface JwtTableOnlyEmits {
|
|
292
|
+
/** 选中行变化 */
|
|
293
|
+
'selection-change': (selection: any[]) => void
|
|
294
|
+
/** 当前高亮行变化 */
|
|
295
|
+
'table-current-change': (currentRow: any) => void
|
|
296
|
+
/** 排序变更 */
|
|
297
|
+
'sort-change': (sort: { prop: string; order: string }) => void
|
|
298
|
+
/** 单元格点击 */
|
|
299
|
+
'click-cell': (data: any) => void
|
|
300
|
+
/** 文件预览 */
|
|
301
|
+
'show-file': (url: string) => void
|
|
302
|
+
/** 表格行操作 */
|
|
303
|
+
'table-action': (action: any, row: any, rowAction: any, data: any) => void
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export interface JwtTableOnlySlots {
|
|
307
|
+
/** 表格上方 */
|
|
308
|
+
'table-before'?: Slot
|
|
309
|
+
/** 动态列插槽,名称为 col-[prop],props: { row, column, $index } */
|
|
310
|
+
[slotName: string]: Slot<any> | undefined
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// ============================================================
|
|
314
|
+
// JwtTableButton - 表格操作按钮
|
|
315
|
+
// ============================================================
|
|
316
|
+
|
|
317
|
+
export interface JwtTableButtonProps {
|
|
318
|
+
/** 当前页面路径(用于权限匹配) */
|
|
319
|
+
currentPath?: string
|
|
320
|
+
/** 用户菜单权限对象 */
|
|
321
|
+
menusObj?: Record<string, any>
|
|
322
|
+
/** 操作按钮配置 */
|
|
323
|
+
config?: Record<string, any>
|
|
324
|
+
/** 当前行数据 */
|
|
325
|
+
row?: Record<string, any>
|
|
326
|
+
/** 操作属性名,默认 'operations' */
|
|
327
|
+
operationName?: string
|
|
328
|
+
/** 最多显示按钮数量,超出显示省略号,默认 3 */
|
|
329
|
+
showButtonNum?: number
|
|
330
|
+
/** 是否显示图标 */
|
|
331
|
+
showIcon?: boolean
|
|
332
|
+
/** 是否显示文字 */
|
|
333
|
+
showText?: boolean
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export interface JwtTableButtonEmits {
|
|
337
|
+
/** 按钮点击事件 */
|
|
338
|
+
'table-action': (payload: { action: any; e: Event }) => void
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// ============================================================
|
|
342
|
+
// JwtForm - 动态表单
|
|
343
|
+
// ============================================================
|
|
344
|
+
|
|
345
|
+
export interface JwtFormProps {
|
|
346
|
+
/** 表单数据对象 (v-model) */
|
|
347
|
+
modelValue?: Record<string, any> | (() => Record<string, any>)
|
|
348
|
+
/** 表单配置,包含 formList、api 等 */
|
|
349
|
+
config: Record<string, any>
|
|
350
|
+
/** 是否为搜索表单模式 */
|
|
351
|
+
isSearch?: boolean
|
|
352
|
+
/** 选中行 ID (逗号分隔) */
|
|
353
|
+
selectionRowIds?: string
|
|
354
|
+
/** 当前选中行数据 */
|
|
355
|
+
selectionRow?: any[]
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
export interface JwtFormEmits {
|
|
359
|
+
/** 表单提交 */
|
|
360
|
+
submit: (data: any) => void
|
|
361
|
+
/** 表单重置 */
|
|
362
|
+
reset: (model: any) => void
|
|
363
|
+
/** v-model 更新 */
|
|
364
|
+
'update:modelValue': (value: any) => void
|
|
365
|
+
/** 新增成功 */
|
|
366
|
+
'add-success': (res: any, type: string) => void
|
|
367
|
+
/** 编辑成功 */
|
|
368
|
+
'edit-success': (res: any, type: string) => void
|
|
369
|
+
/** 获取详情成功 */
|
|
370
|
+
'get-detail-success': (res: any) => void
|
|
371
|
+
/** 请求错误 */
|
|
372
|
+
error: () => void
|
|
373
|
+
/** 上传按钮点击 */
|
|
374
|
+
'upload-btn': (item: any) => void
|
|
375
|
+
/** 新增选项 */
|
|
376
|
+
'add-option': (item: any) => void
|
|
377
|
+
/** 图片操作 */
|
|
378
|
+
'picture-action': (payload: { action: any; item: any }) => void
|
|
379
|
+
/** 表单项值变化 */
|
|
380
|
+
'item-change': (val: any, item: any, model: any) => void
|
|
381
|
+
/** 多按钮点击后 */
|
|
382
|
+
'after-btns-click': (btn: any, modelData: any, item: any, fetchContent?: any) => void
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
export interface JwtFormSlots {
|
|
386
|
+
/** 动态插槽,名称由 formList 项的 name 字段决定 (type='slot' 时),props: { model } */
|
|
387
|
+
[slotName: string]: Slot<any> | undefined
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/** JwtForm ref 暴露的方法 */
|
|
391
|
+
export interface JwtFormExpose {
|
|
392
|
+
/** el-form 实例引用 */
|
|
393
|
+
formRef: Ref<any>
|
|
394
|
+
/** 表单数据对象 */
|
|
395
|
+
appModel: Ref<Record<string, any>>
|
|
396
|
+
/** 处理后的表单配置 */
|
|
397
|
+
formConfig: ComputedRef<any>
|
|
398
|
+
/** 判断是否为新增表单 */
|
|
399
|
+
isAddForm(info?: any): Promise<boolean>
|
|
400
|
+
/** 提交表单 (验证 + 请求) */
|
|
401
|
+
formSubmit(type?: string, params?: Record<string, any>): Promise<void>
|
|
402
|
+
/** 重置表单 */
|
|
403
|
+
formReset(): void
|
|
404
|
+
/** 验证表单,返回是否通过 */
|
|
405
|
+
formValidate(): Promise<boolean>
|
|
406
|
+
/** 获取详情数据 */
|
|
407
|
+
getDetail(param?: Record<string, any>): void
|
|
408
|
+
/** 设置表单字段值 */
|
|
409
|
+
setModelVal(key: string, val: any): void
|
|
410
|
+
/** 通过回调设置字段值 */
|
|
411
|
+
handleSetModelVal(key: string, callBack: (model: any) => any): void
|
|
412
|
+
/** 构建提交数据 */
|
|
413
|
+
createSubmitData(): Promise<any>
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
// ============================================================
|
|
417
|
+
// JwtFormItem - 表单项渲染器
|
|
418
|
+
// ============================================================
|
|
419
|
+
|
|
420
|
+
export interface JwtFormItemProps {
|
|
421
|
+
/** 表单项配置 (type, key, label, formAttrs 等) */
|
|
422
|
+
item?: Record<string, any>
|
|
423
|
+
/** 数据源 */
|
|
424
|
+
sourceData?: Record<string, any>
|
|
425
|
+
/** 当前选中行 */
|
|
426
|
+
selectionRow?: any[]
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
export interface JwtFormItemEmits {
|
|
430
|
+
/** 值变化 */
|
|
431
|
+
change: (val: any, item: any) => void
|
|
432
|
+
/** 新增选项 */
|
|
433
|
+
'add-option': (item: any) => void
|
|
434
|
+
/** 按钮点击 */
|
|
435
|
+
'after-btn-click': (item: any) => void
|
|
436
|
+
/** 多按钮点击 */
|
|
437
|
+
'after-btns-click': (btn: any, fetchContent: any, sourceData: any, item: any) => void
|
|
438
|
+
/** 图片操作 */
|
|
439
|
+
'picture-action': (action: any, item: any) => void
|
|
440
|
+
/** 输入选择框变化 */
|
|
441
|
+
'input-select-change': (val: any, item: any) => void
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// ============================================================
|
|
445
|
+
// JwtDialogForm - 弹窗表单
|
|
446
|
+
// ============================================================
|
|
447
|
+
|
|
448
|
+
export interface JwtDialogFormProps {
|
|
449
|
+
/** 应用配置 (包含 editBox 等弹窗配置) */
|
|
450
|
+
appConfig?: Record<string, any>
|
|
451
|
+
/** 当前弹窗配置 (响应式,会被 watchEffect 监听) */
|
|
452
|
+
config?: Record<string, any>
|
|
453
|
+
/** 选中行 ID */
|
|
454
|
+
selectionRowIds?: string
|
|
455
|
+
/** 选中行数据 */
|
|
456
|
+
selectionRow?: any[]
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
export interface JwtDialogFormEmits {
|
|
460
|
+
/** 弹窗关闭 */
|
|
461
|
+
'dialog-close': () => void
|
|
462
|
+
/** 新增选项 */
|
|
463
|
+
'add-option': (data: any) => void
|
|
464
|
+
/** 新增成功 */
|
|
465
|
+
'add-success': (data: any, type: string) => void
|
|
466
|
+
/** 编辑成功 */
|
|
467
|
+
'edit-success': (data: any, type: string) => void
|
|
468
|
+
/** 上传按钮点击 */
|
|
469
|
+
'upload-btn': (item: any) => void
|
|
470
|
+
/** 表单项变化 */
|
|
471
|
+
'item-change': (val: any, item: any, model: any) => void
|
|
472
|
+
/** 多按钮点击后 */
|
|
473
|
+
'after-btns-click': (btn: any, modelData: any, item: any, fetchContent?: any) => void
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
export interface JwtDialogFormSlots {
|
|
477
|
+
/** 弹窗底部按钮之前,可自定义按钮 */
|
|
478
|
+
'dialog-footer-before'?: Slot<{ model: any }>
|
|
479
|
+
/** 弹窗底部按钮之后 */
|
|
480
|
+
'dialog-footer-after'?: Slot<{ model: any }>
|
|
481
|
+
/** 动态插槽,名称由 formList 项的 name 决定,props: { model } */
|
|
482
|
+
[slotName: string]: Slot<any> | undefined
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/** JwtDialogForm ref 暴露的方法 */
|
|
486
|
+
export interface JwtDialogFormExpose {
|
|
487
|
+
/** 弹窗状态对象 (title, type, visible, model, config, boxName, refreshTable) */
|
|
488
|
+
editBoxInfo: { title: string; type: string; visible: boolean; model: Record<string, any>; config: Record<string, any>; boxName: string; refreshTable: boolean }
|
|
489
|
+
/** 内部 JwtForm 引用 */
|
|
490
|
+
editBoxRef: Ref<any>
|
|
491
|
+
/** 内部表单 model */
|
|
492
|
+
editBoxRefModel: ComputedRef<any>
|
|
493
|
+
/** 是否全屏 */
|
|
494
|
+
fullScreen: Ref<boolean>
|
|
495
|
+
/** 提交加载状态 */
|
|
496
|
+
submitLoading: Ref<boolean>
|
|
497
|
+
/** 关闭弹窗 */
|
|
498
|
+
handleDialogClose(): void
|
|
499
|
+
/** 弹窗操作: confirm=提交并关闭, continue=提交并继续, cancel=取消 */
|
|
500
|
+
handleBox(type: 'confirm' | 'continue' | 'cancel', params?: any): Promise<void>
|
|
501
|
+
/** 设置表单字段值 */
|
|
502
|
+
setModelVal(key: string, val: any): void
|
|
503
|
+
/** 构建提交数据 */
|
|
504
|
+
createSubmitData(): Promise<any>
|
|
505
|
+
/** 切换全屏 */
|
|
506
|
+
handleFullScreen(): void
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
// ============================================================
|
|
510
|
+
// JwtInput - 带变更标记的输入框
|
|
511
|
+
// ============================================================
|
|
512
|
+
|
|
513
|
+
export interface JwtInputProps {
|
|
514
|
+
/** 输入值 (v-model) */
|
|
515
|
+
modelValue?: string | number
|
|
516
|
+
/** 未变更时的背景色 */
|
|
517
|
+
defaultBg?: string
|
|
518
|
+
/** 变更后的背景色 */
|
|
519
|
+
changeBg?: string
|
|
520
|
+
/** 文字颜色 */
|
|
521
|
+
textColor?: string
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
export interface JwtInputEmits {
|
|
525
|
+
/** v-model 更新 */
|
|
526
|
+
'update:modelValue': (value: string | number) => void
|
|
527
|
+
/** 失焦时值发生变化触发 */
|
|
528
|
+
blur: (value: string | number) => void
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
// ============================================================
|
|
532
|
+
// JwtColumnItme - 表格列内容渲染器
|
|
533
|
+
// ============================================================
|
|
534
|
+
|
|
535
|
+
export interface JwtColumnItmeProps {
|
|
536
|
+
/** 列配置项 */
|
|
537
|
+
item?: Record<string, any>
|
|
538
|
+
/** 当前行数据 */
|
|
539
|
+
row?: Record<string, any>
|
|
540
|
+
/** 当前行索引 */
|
|
541
|
+
index?: number
|
|
542
|
+
/** 分页起始索引 */
|
|
543
|
+
pagestart?: number
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
export interface JwtColumnItmeEmits {
|
|
547
|
+
/** 值变化 (编辑模式下) */
|
|
548
|
+
change: (appModel: any, item: any) => void
|
|
549
|
+
/** 单元格点击 */
|
|
550
|
+
'click-cell': (appModel: any, item: any) => void
|
|
551
|
+
/** v-model 更新 */
|
|
552
|
+
'update:modelValue': (appModel: any) => void
|
|
553
|
+
/** 文件预览 */
|
|
554
|
+
'show-file': (url: string) => void
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
export interface JwtColumnItmeSlots {
|
|
558
|
+
/** 动态透传插槽,名称由父组件决定,props: { scope } */
|
|
559
|
+
[slotName: string]: Slot<any> | undefined
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
// Column 子组件共享 Props
|
|
563
|
+
export interface ColumnItemCommonProps {
|
|
564
|
+
/** 列配置项 */
|
|
565
|
+
item?: Record<string, any>
|
|
566
|
+
/** 当前行数据 */
|
|
567
|
+
row?: Record<string, any>
|
|
568
|
+
/** 完整数据源 */
|
|
569
|
+
sourceData?: Record<string, any>
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
/** 日期格式化列 */
|
|
573
|
+
export interface ColumnDateTimeFormatProps extends ColumnItemCommonProps { modelValue?: string | number }
|
|
574
|
+
/** 默认值显示列 */
|
|
575
|
+
export interface ColumnDefaultProps extends ColumnItemCommonProps { index?: number }
|
|
576
|
+
/** 文件列 */
|
|
577
|
+
export interface ColumnFileProps extends ColumnItemCommonProps {}
|
|
578
|
+
/** HTML 富文本列 */
|
|
579
|
+
export interface ColumnHtmlProps extends ColumnItemCommonProps {}
|
|
580
|
+
/** 单图列 */
|
|
581
|
+
export interface ColumnImgProps extends ColumnItemCommonProps {}
|
|
582
|
+
/** 可添加图片列 */
|
|
583
|
+
export interface ColumnImgAddProps extends ColumnItemCommonProps {}
|
|
584
|
+
/** 多图列 */
|
|
585
|
+
export interface ColumnImgsProps extends ColumnItemCommonProps {}
|
|
586
|
+
/** 链接列 */
|
|
587
|
+
export interface ColumnLinkProps extends ColumnItemCommonProps {}
|
|
588
|
+
/** 标签列 */
|
|
589
|
+
export interface ColumnTagProps extends ColumnItemCommonProps {}
|
|
590
|
+
/** 标签列表列 */
|
|
591
|
+
export interface ColumnTagListProps extends ColumnItemCommonProps { tagType?: string; valKey?: string }
|
|
592
|
+
/** 文本列 */
|
|
593
|
+
export interface ColumnTextProps extends ColumnItemCommonProps {}
|
|
594
|
+
/** 视频列 */
|
|
595
|
+
export interface ColumnVideoProps extends ColumnItemCommonProps {}
|
|
596
|
+
|
|
597
|
+
// ============================================================
|
|
598
|
+
// JwtUploadImage - 图片上传
|
|
599
|
+
// ============================================================
|
|
600
|
+
|
|
601
|
+
export interface JwtUploadImageProps {
|
|
602
|
+
/** 图片路径 (v-model),字符串或数组 */
|
|
603
|
+
modelValue?: string | any[]
|
|
604
|
+
/** 文件大小限制 (KB),默认 2048 (2MB) */
|
|
605
|
+
limitSize?: string | number
|
|
606
|
+
/** 是否禁用 */
|
|
607
|
+
disabled?: boolean
|
|
608
|
+
/** 是否允许多选 */
|
|
609
|
+
multiple?: boolean
|
|
610
|
+
/** el-upload 列表类型,默认 'picture-card' */
|
|
611
|
+
listType?: string
|
|
612
|
+
/** 最大上传数量,默认 10 */
|
|
613
|
+
limit?: string | number
|
|
614
|
+
/** 上传额外参数 */
|
|
615
|
+
uploadParam?: Record<string, any>
|
|
616
|
+
/** 上传文件名前缀 */
|
|
617
|
+
uploadPrefixName?: string
|
|
618
|
+
/** 是否显示粘贴上传图片 */
|
|
619
|
+
copyImgUploade?: boolean
|
|
620
|
+
/** 是否校验文件类型,默认 true */
|
|
621
|
+
verifyFileType?: boolean
|
|
622
|
+
/** 上传字段名 */
|
|
623
|
+
uploadName?: string
|
|
624
|
+
/** 是否启用拖拽上传 */
|
|
625
|
+
dragUpload?: boolean
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
export interface JwtUploadImageEmits {
|
|
629
|
+
/** v-model 更新 */
|
|
630
|
+
'update:modelValue': (value: string | any[]) => void
|
|
631
|
+
/** 文件列表变化 */
|
|
632
|
+
onChange: (result: string | any[]) => void
|
|
633
|
+
/** 上传成功 */
|
|
634
|
+
success: (response: any) => void
|
|
635
|
+
/** 图片操作 (设为主图/设计等) */
|
|
636
|
+
'picture-action': (payload: { action: any; item: any }) => void
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
export interface JwtUploadImageSlots {
|
|
640
|
+
/** 自定义触发器内容 */
|
|
641
|
+
trigger?: Slot
|
|
642
|
+
/** 自定义文件渲染,仅在配置 mattingUrl 时生效,props: { file } */
|
|
643
|
+
file?: Slot<{ file: any }>
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
// ============================================================
|
|
647
|
+
// JwtUploadFile - 文件上传
|
|
648
|
+
// ============================================================
|
|
649
|
+
|
|
650
|
+
export interface JwtUploadFileProps {
|
|
651
|
+
/** 文件路径 (v-model) */
|
|
652
|
+
modelValue?: string | any[]
|
|
653
|
+
/** 文件大小限制 (KB) */
|
|
654
|
+
limitSize?: string | number
|
|
655
|
+
/** 是否禁用 */
|
|
656
|
+
disabled?: boolean
|
|
657
|
+
/** 是否允许多选 */
|
|
658
|
+
multiple?: boolean
|
|
659
|
+
/** 最大上传数量,默认 10 */
|
|
660
|
+
limit?: string | number
|
|
661
|
+
/** 上传额外参数 */
|
|
662
|
+
uploadParam?: Record<string, any>
|
|
663
|
+
/** 模块标识 */
|
|
664
|
+
module?: string
|
|
665
|
+
/** 是否启用拖拽上传 */
|
|
666
|
+
dragUpload?: boolean
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
export interface JwtUploadFileEmits {
|
|
670
|
+
/** v-model 更新 */
|
|
671
|
+
'update:modelValue': (value: string | any[]) => void
|
|
672
|
+
/** 文件列表变化 */
|
|
673
|
+
onChange: (result: string | any[]) => void
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
// ============================================================
|
|
677
|
+
// JwtUploadVideo - 视频上传
|
|
678
|
+
// ============================================================
|
|
679
|
+
|
|
680
|
+
export interface JwtUploadVideoProps {
|
|
681
|
+
/** 视频路径 (v-model) */
|
|
682
|
+
modelValue?: string | any[]
|
|
683
|
+
/** 文件大小限制 (KB) */
|
|
684
|
+
limitSize?: string | number
|
|
685
|
+
/** 是否禁用 */
|
|
686
|
+
disabled?: boolean
|
|
687
|
+
/** 是否允许多选 */
|
|
688
|
+
multiple?: boolean
|
|
689
|
+
/** 最大上传数量,默认 10 */
|
|
690
|
+
limit?: string | number
|
|
691
|
+
/** 上传额外参数 */
|
|
692
|
+
uploadParam?: Record<string, any>
|
|
693
|
+
/** 是否使用腾讯 COS SDK 上传 */
|
|
694
|
+
isCosSdk?: boolean
|
|
695
|
+
/** 是否 COS 批量上传 */
|
|
696
|
+
isCosBacthUpload?: boolean
|
|
697
|
+
/** 模块标识 */
|
|
698
|
+
module?: string
|
|
699
|
+
/** 是否启用拖拽上传 */
|
|
700
|
+
dragUpload?: boolean
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
export interface JwtUploadVideoEmits {
|
|
704
|
+
/** v-model 更新 */
|
|
705
|
+
'update:modelValue': (value: string | any[]) => void
|
|
706
|
+
/** 文件列表变化 */
|
|
707
|
+
onChange: (result: string | any[]) => void
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
// ============================================================
|
|
711
|
+
// JwtFileUpload - 拖拽文件上传 (COS SDK)
|
|
712
|
+
// ============================================================
|
|
713
|
+
|
|
714
|
+
export interface JwtFileUploadProps {
|
|
715
|
+
/** 模块路径 */
|
|
716
|
+
module?: string
|
|
717
|
+
/** 标识 ID */
|
|
718
|
+
id?: string
|
|
719
|
+
/** 最大上传数量,默认 5 */
|
|
720
|
+
limit?: number
|
|
721
|
+
/** 文件列表 (v-model) */
|
|
722
|
+
modelValue?: any[]
|
|
723
|
+
/** 接受的文件类型 */
|
|
724
|
+
accept?: string
|
|
725
|
+
/** 文件大小限制 (KB) */
|
|
726
|
+
limitSize?: string | number
|
|
727
|
+
/** 是否使用 COS SDK,默认 true */
|
|
728
|
+
isCosSdk?: boolean
|
|
729
|
+
/** 是否 COS 批量上传,默认 true */
|
|
730
|
+
isCosBacthUpload?: boolean
|
|
731
|
+
/** 是否显示粘贴上传 */
|
|
732
|
+
copyImgUploade?: boolean
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
export interface JwtFileUploadEmits {
|
|
736
|
+
/** 非 COS 模式上传成功 */
|
|
737
|
+
'on-success': (uploadFiles: any) => void
|
|
738
|
+
/** v-model 更新 */
|
|
739
|
+
'update:modelValue': (value: any[]) => void
|
|
740
|
+
/** COS 上传成功 (单文件完成,isAllDone 表示是否全部完成) */
|
|
741
|
+
'upload-success': (file: any, isAllDone: boolean) => void
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
// ============================================================
|
|
745
|
+
// JwtEditor - 富文本编辑器 (wangEditor)
|
|
746
|
+
// ============================================================
|
|
747
|
+
|
|
748
|
+
export interface JwtEditorProps {
|
|
749
|
+
/** 编辑器 HTML 内容 (v-model) */
|
|
750
|
+
modelValue?: string
|
|
751
|
+
/** 编辑器高度 (px),默认 500 */
|
|
752
|
+
height?: string | number
|
|
753
|
+
/** 自定义工具栏 key 配置 */
|
|
754
|
+
toolbarKeys?: any[]
|
|
755
|
+
/** 需要排除的工具栏 key */
|
|
756
|
+
excludeKeys?: any[]
|
|
757
|
+
/** 上传自定义 headers,支持对象或函数 */
|
|
758
|
+
uploadHeaders?: Record<string, any> | (() => Record<string, any>)
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
export interface JwtEditorEmits {
|
|
762
|
+
/** v-model 更新 */
|
|
763
|
+
'update:modelValue': (html: string) => void
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
// ============================================================
|
|
767
|
+
// JwtCropper - 图片裁剪
|
|
768
|
+
// ============================================================
|
|
769
|
+
|
|
770
|
+
export interface JwtCropperProps {
|
|
771
|
+
/** 待裁剪的图片 URL */
|
|
772
|
+
url?: string
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
export interface JwtCropperEmits {
|
|
776
|
+
/** 裁剪完成,返回 base64 图片数据 */
|
|
777
|
+
change: (imgBase64: string) => void
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
export interface JwtCropperExpose {
|
|
781
|
+
/** 销毁裁剪实例 */
|
|
782
|
+
handleDestroy(): void
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
// ============================================================
|
|
786
|
+
// JwtCropperDialog - 弹窗裁剪
|
|
787
|
+
// ============================================================
|
|
788
|
+
|
|
789
|
+
export interface JwtCropperDialogProps {
|
|
790
|
+
/** 待裁剪的图片 URL */
|
|
791
|
+
url?: string
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
export interface JwtCropperDialogEmits {
|
|
795
|
+
/** 用户点击"上传保存"时触发,返回裁剪后的 base64 */
|
|
796
|
+
select: (imgBase64: string) => void
|
|
797
|
+
/** 裁剪变化时实时触发 */
|
|
798
|
+
change: (imgBase64: string) => void
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
export interface JwtCropperDialogExpose {
|
|
802
|
+
/** 打开弹窗 */
|
|
803
|
+
showDialogVisible(): void
|
|
804
|
+
/** 关闭弹窗 */
|
|
805
|
+
closeDialogVisible(): void
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
// ============================================================
|
|
809
|
+
// JwtSelectServer - 服务端下拉选择
|
|
810
|
+
// ============================================================
|
|
811
|
+
|
|
812
|
+
export interface JwtSelectServerProps {
|
|
813
|
+
/** v-model 绑定值 */
|
|
814
|
+
modelValue?: string | number | any[]
|
|
815
|
+
/** 列表接口地址或函数 */
|
|
816
|
+
listApi?: string | ((...args: any[]) => string)
|
|
817
|
+
/** 新增选项接口地址 */
|
|
818
|
+
addApi?: string
|
|
819
|
+
/** 本地静态选项 */
|
|
820
|
+
options?: any[]
|
|
821
|
+
/** 数据源对象 (用于回显和动态参数) */
|
|
822
|
+
sourceData?: Record<string, any>
|
|
823
|
+
/** 显示文本字段名,默认 'title' */
|
|
824
|
+
labelKey?: string
|
|
825
|
+
/** 值字段名,默认 'id' */
|
|
826
|
+
valueKey?: string
|
|
827
|
+
/** 值类型,'number' | 'string' */
|
|
828
|
+
valueType?: string
|
|
829
|
+
/** 搜索字段名 */
|
|
830
|
+
searchKey?: string
|
|
831
|
+
/** 扩展标签字段 */
|
|
832
|
+
exLabelKey?: string
|
|
833
|
+
/** 头像字段名 (有值时显示头像) */
|
|
834
|
+
avatarKey?: string
|
|
835
|
+
/** 回显文本 */
|
|
836
|
+
modelValueName?: string | number | any[]
|
|
837
|
+
/** sourceData 中的取值路径 */
|
|
838
|
+
modelValueKey?: string
|
|
839
|
+
/** 是否用 value 作为初始搜索条件 */
|
|
840
|
+
searchValueKey?: boolean
|
|
841
|
+
/** 是否多选 */
|
|
842
|
+
multiple?: boolean
|
|
843
|
+
/** 是否禁用 */
|
|
844
|
+
disabled?: boolean
|
|
845
|
+
/** 每次聚焦是否重新请求 */
|
|
846
|
+
focusFetch?: boolean
|
|
847
|
+
/** 无数据时显示添加按钮 */
|
|
848
|
+
showAdd?: boolean
|
|
849
|
+
/** 始终显示添加按钮 */
|
|
850
|
+
alwaysAdd?: boolean
|
|
851
|
+
/** 行内快速添加模式 */
|
|
852
|
+
autoAdd?: boolean
|
|
853
|
+
/** 占位文本 */
|
|
854
|
+
placeholder?: string
|
|
855
|
+
/** 额外请求参数 */
|
|
856
|
+
exParams?: Record<string, any>
|
|
857
|
+
/** 新增时额外参数 */
|
|
858
|
+
addParams?: Record<string, any>
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
export interface JwtSelectServerEmits {
|
|
862
|
+
/** v-model 更新 */
|
|
863
|
+
'update:modelValue': (value: any) => void
|
|
864
|
+
/** 选中值变化 */
|
|
865
|
+
change: (val: any) => void
|
|
866
|
+
/** 完整选中项 (需配置 emitSelect) */
|
|
867
|
+
select: (result: any) => void
|
|
868
|
+
/** 请求新增选项 */
|
|
869
|
+
'add-option': () => void
|
|
870
|
+
/** 新增成功 */
|
|
871
|
+
'add-success': (res: any) => void
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
export interface JwtSelectServerSlots {
|
|
875
|
+
/** 自定义选项渲染,props: { list } */
|
|
876
|
+
default?: Slot<{ list: any[] }>
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
/** JwtSelectServer ref 暴露的方法 */
|
|
880
|
+
export interface JwtSelectServerExpose {
|
|
881
|
+
/** 重新获取选项列表 */
|
|
882
|
+
getDataList(init?: boolean, refSearchVal?: string, refSearchKey?: string, req?: boolean): void
|
|
883
|
+
/** 手动设置选项数据 */
|
|
884
|
+
handleSetListData(list: any[]): void
|
|
885
|
+
/** 设置动态请求参数 */
|
|
886
|
+
handleSetDynamicParams(data: Record<string, any>): void
|
|
887
|
+
/** 清空选中 */
|
|
888
|
+
handleClear(): void
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
// ============================================================
|
|
892
|
+
// JwtCascaderArea - 地区级联选择
|
|
893
|
+
// ============================================================
|
|
894
|
+
|
|
895
|
+
export interface JwtCascaderAreaProps {
|
|
896
|
+
/** v-model 绑定值 */
|
|
897
|
+
modelValue?: string | number | any[]
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
export interface JwtCascaderAreaEmits {
|
|
901
|
+
/** v-model 更新 */
|
|
902
|
+
'update:modelValue': (value: any) => void
|
|
903
|
+
/** 选中值变化 */
|
|
904
|
+
change: (val: any) => void
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
export interface JwtCascaderAreaExpose {
|
|
908
|
+
/** 地区数据列表 */
|
|
909
|
+
listData: Ref<any[]>
|
|
910
|
+
/** 重新获取数据 */
|
|
911
|
+
getDataList(): void
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
// ============================================================
|
|
915
|
+
// JwtCascaderServer - 服务端级联选择
|
|
916
|
+
// ============================================================
|
|
917
|
+
|
|
918
|
+
export interface JwtCascaderServerProps {
|
|
919
|
+
/** v-model 绑定值 */
|
|
920
|
+
modelValue?: string | number | any[]
|
|
921
|
+
/** 无数据时显示添加按钮 */
|
|
922
|
+
showAdd?: boolean
|
|
923
|
+
/** 始终显示添加按钮 */
|
|
924
|
+
alwaysAdd?: boolean
|
|
925
|
+
/** 聚焦时重新请求 */
|
|
926
|
+
focusFetch?: boolean
|
|
927
|
+
/** 额外请求参数 */
|
|
928
|
+
exParams?: Record<string, any>
|
|
929
|
+
/** 显示层级过滤 */
|
|
930
|
+
showLevel?: string | number
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
export interface JwtCascaderServerEmits {
|
|
934
|
+
/** v-model 更新 */
|
|
935
|
+
'update:modelValue': (value: any) => void
|
|
936
|
+
/** 选中值变化 */
|
|
937
|
+
change: (val: any) => void
|
|
938
|
+
/** 请求新增选项 */
|
|
939
|
+
'add-option': () => void
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
export interface JwtCascaderServerExpose {
|
|
943
|
+
/** el-cascader 引用 */
|
|
944
|
+
JwtCascaderServerRef: Ref<any>
|
|
945
|
+
/** 级联选项数据 */
|
|
946
|
+
listData: Ref<any[]>
|
|
947
|
+
/** 获取数据 */
|
|
948
|
+
getDataList(req?: boolean): void
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
// ============================================================
|
|
952
|
+
// JwtTree - 树形组件
|
|
953
|
+
// ============================================================
|
|
954
|
+
|
|
955
|
+
export interface JwtTreeProps {
|
|
956
|
+
/** 树形数据 */
|
|
957
|
+
treeData?: any[]
|
|
958
|
+
/** 节点唯一标识字段,默认 'id' */
|
|
959
|
+
nodeKey?: string
|
|
960
|
+
/** 节点标题字段,默认 'title' */
|
|
961
|
+
menuTitleKey?: string
|
|
962
|
+
/** 子节点字段,默认 'children' */
|
|
963
|
+
children?: string
|
|
964
|
+
/** 默认选中的节点 key */
|
|
965
|
+
checkedKeys?: any[]
|
|
966
|
+
/** 默认展开所有节点,默认 true */
|
|
967
|
+
expandAll?: boolean
|
|
968
|
+
/** 菜单 ID 映射对象 */
|
|
969
|
+
menusIdObj?: Record<string, any>
|
|
970
|
+
/** 是否显示右侧导航 */
|
|
971
|
+
showNav?: boolean
|
|
972
|
+
/** 是否禁用所有节点 */
|
|
973
|
+
disabled?: boolean
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
export interface JwtTreeEmits {
|
|
977
|
+
/** 选中节点变化 */
|
|
978
|
+
'update:checked-keys': (keys: any[]) => void
|
|
979
|
+
/** 节点勾选变化 */
|
|
980
|
+
change: (payload: { key: string; checked: boolean; level: number; data: any; checkedKeys: any[]; halfCheckedKeys: any[] }) => void
|
|
981
|
+
/** 节点展开/折叠 */
|
|
982
|
+
toggle: (node: any, nodeChildrenMenuId: any[]) => void
|
|
983
|
+
/** 导航标签切换 */
|
|
984
|
+
'tab-change': (val: string) => void
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
// ============================================================
|
|
988
|
+
// JwtTabs - 标签页
|
|
989
|
+
// ============================================================
|
|
990
|
+
|
|
991
|
+
export interface JwtTabsProps {
|
|
992
|
+
/** 标签页配置 (tabPaneList, tabsAttrs, activeName) */
|
|
993
|
+
config: Record<string, any>
|
|
994
|
+
/** 当前页面路径 (权限匹配) */
|
|
995
|
+
currentPath?: string
|
|
996
|
+
/** 菜单权限对象 */
|
|
997
|
+
menusObj?: Record<string, any>
|
|
998
|
+
/** 传递给子组件的额外数据 */
|
|
999
|
+
info: Record<string, any>
|
|
1000
|
+
/** 是否缓存组件状态,默认 true */
|
|
1001
|
+
keepAlive?: boolean
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
export interface JwtTabsEmits {
|
|
1005
|
+
/** 标签页点击 */
|
|
1006
|
+
'tab-click': (tab: any, event: Event, currentComponent: any) => void
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
export interface JwtTabsExpose {
|
|
1010
|
+
/** 当前激活的子组件实例引用 */
|
|
1011
|
+
componentRef: Ref<any>
|
|
1012
|
+
/** 编程式切换标签 */
|
|
1013
|
+
handleChangeTab(name: string): void
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
// ============================================================
|
|
1017
|
+
// JwtTags - 标签选择/展示
|
|
1018
|
+
// ============================================================
|
|
1019
|
+
|
|
1020
|
+
export interface JwtTagsProps {
|
|
1021
|
+
/** 标签值 (v-model),逗号分隔字符串或对象数组 */
|
|
1022
|
+
modelValue?: string | any[]
|
|
1023
|
+
/** 添加按钮文字,默认 '添加' */
|
|
1024
|
+
btnTitle?: string
|
|
1025
|
+
/** 是否禁用 */
|
|
1026
|
+
disabled?: boolean
|
|
1027
|
+
/** 数组项的标签字段,默认 'title' */
|
|
1028
|
+
labelKey?: string
|
|
1029
|
+
/** 数组项的值字段,默认 'id' */
|
|
1030
|
+
valueKey?: string
|
|
1031
|
+
/** 是否使用对象数组模式 */
|
|
1032
|
+
isArray?: boolean
|
|
1033
|
+
/** 是否使用输入框样式 */
|
|
1034
|
+
isInput?: boolean
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
export interface JwtTagsEmits {
|
|
1038
|
+
/** v-model 更新 */
|
|
1039
|
+
'update:modelValue': (value: string | any[]) => void
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
// ============================================================
|
|
1043
|
+
// JwtImage - 图片展示
|
|
1044
|
+
// ============================================================
|
|
1045
|
+
|
|
1046
|
+
export interface JwtImageProps {
|
|
1047
|
+
/** 图片填充模式,默认 'cover' */
|
|
1048
|
+
fit?: string
|
|
1049
|
+
/** 图片地址,多图用逗号分隔 */
|
|
1050
|
+
src?: string
|
|
1051
|
+
/** 覆盖图标类型: 'search' | 'add' | 'delete' */
|
|
1052
|
+
type?: string
|
|
1053
|
+
/** 是否多图模式 */
|
|
1054
|
+
multiple?: boolean
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
// ============================================================
|
|
1058
|
+
// JwtIcon - 图标 (remixicon)
|
|
1059
|
+
// ============================================================
|
|
1060
|
+
|
|
1061
|
+
export interface JwtIconProps {
|
|
1062
|
+
/** 图标名称,默认 'settings-3-line' */
|
|
1063
|
+
icon?: string
|
|
1064
|
+
/** 图标大小 */
|
|
1065
|
+
size?: string | number
|
|
1066
|
+
/** 是否为自定义图标 */
|
|
1067
|
+
isCustom?: boolean
|
|
1068
|
+
/** 是否为自定义 SVG 图标 */
|
|
1069
|
+
isCustomSvg?: boolean
|
|
1070
|
+
/** SVG 名称前缀,默认 'icon-' */
|
|
1071
|
+
prefixSvg?: string
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
// ============================================================
|
|
1075
|
+
// JwtIconSelect - 图标选择器
|
|
1076
|
+
// ============================================================
|
|
1077
|
+
|
|
1078
|
+
export interface JwtIconSelectProps {
|
|
1079
|
+
/** 当前选中图标名称 (v-model) */
|
|
1080
|
+
modelValue?: string
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
export interface JwtIconSelectEmits {
|
|
1084
|
+
/** v-model 更新 */
|
|
1085
|
+
'update:modelValue': (value: string) => void
|
|
1086
|
+
/** 图标变化 */
|
|
1087
|
+
change: (icon: string) => void
|
|
1088
|
+
/** 图标选中 */
|
|
1089
|
+
select: (item: { icon: string; name: string; isCustom: boolean }) => void
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
// ============================================================
|
|
1093
|
+
// JwtEmojiSelect - 表情选择器
|
|
1094
|
+
// ============================================================
|
|
1095
|
+
|
|
1096
|
+
export interface JwtEmojiSelectProps {
|
|
1097
|
+
/** 预览位置,默认 'top' */
|
|
1098
|
+
previewPosition?: string
|
|
1099
|
+
/** 肤色选择位置 */
|
|
1100
|
+
skinTonePosition?: string
|
|
1101
|
+
/** 主题,默认 'light' */
|
|
1102
|
+
theme?: string
|
|
1103
|
+
/** 语言,默认 'zh' */
|
|
1104
|
+
locale?: string
|
|
1105
|
+
/** 当前选中表情 (v-model) */
|
|
1106
|
+
modelValue?: string
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
export interface JwtEmojiSelectEmits {
|
|
1110
|
+
/** 表情选中 */
|
|
1111
|
+
select: (emoji: { id: string; name: string; native: string; unified: string; keywords: string[]; shortcodes: string }) => void
|
|
1112
|
+
/** v-model 更新 */
|
|
1113
|
+
'update:modelValue': (value: string) => void
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
// ============================================================
|
|
1117
|
+
// JwtFileIcon - 文件类型图标
|
|
1118
|
+
// ============================================================
|
|
1119
|
+
|
|
1120
|
+
export interface JwtFileIconProps {
|
|
1121
|
+
/** 文件 URL */
|
|
1122
|
+
url?: string
|
|
1123
|
+
/** 图标大小,默认 45 */
|
|
1124
|
+
size?: number
|
|
1125
|
+
/** 提示文字 */
|
|
1126
|
+
title?: string
|
|
1127
|
+
/** 是否显示为图片 */
|
|
1128
|
+
showImg?: boolean
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
export interface JwtFileIconEmits {
|
|
1132
|
+
/** 文件预览 */
|
|
1133
|
+
'show-file': (url: string) => void
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
// ============================================================
|
|
1137
|
+
// JwtMaterial - 素材库
|
|
1138
|
+
// ============================================================
|
|
1139
|
+
|
|
1140
|
+
export interface JwtMaterialProps {
|
|
1141
|
+
/** 是否多选,默认 true */
|
|
1142
|
+
multiple?: boolean
|
|
1143
|
+
/** 是否为已使用素材模式 */
|
|
1144
|
+
used?: boolean
|
|
1145
|
+
/** 素材库配置 */
|
|
1146
|
+
config?: Record<string, any>
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
export interface JwtMaterialEmits {
|
|
1150
|
+
/** 删除成功 */
|
|
1151
|
+
'delete-success': () => void
|
|
1152
|
+
/** 删除操作 */
|
|
1153
|
+
'on-delete': (result: any) => void
|
|
1154
|
+
/** 编辑操作 */
|
|
1155
|
+
'on-edit': (item: any) => void
|
|
1156
|
+
/** 编辑成功 */
|
|
1157
|
+
'edit-success': () => void
|
|
1158
|
+
/** 选中素材 */
|
|
1159
|
+
select: (selectedItems: any[]) => void
|
|
1160
|
+
/** v-model 更新 */
|
|
1161
|
+
'update:modelValue': (value: any) => void
|
|
1162
|
+
/** 抠图操作 */
|
|
1163
|
+
'on-matting': (ids: string) => void
|
|
1164
|
+
/** 抠图成功 */
|
|
1165
|
+
'matting-success': () => void
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
export interface JwtMaterialSlots {
|
|
1169
|
+
/** 树节点自定义渲染,props: { node, data } */
|
|
1170
|
+
default?: Slot<{ node: any; data: any }>
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
// ============================================================
|
|
1174
|
+
// JwtMaterialItemMask - 素材项遮罩层
|
|
1175
|
+
// ============================================================
|
|
1176
|
+
|
|
1177
|
+
export interface JwtMaterialItemMaskProps {
|
|
1178
|
+
/** 素材项数据 */
|
|
1179
|
+
item?: Record<string, any>
|
|
1180
|
+
/** 素材项索引 */
|
|
1181
|
+
index?: number
|
|
1182
|
+
/** 是否显示删除按钮 */
|
|
1183
|
+
showDelete?: boolean
|
|
1184
|
+
/** 是否显示编辑按钮 */
|
|
1185
|
+
showEdit?: boolean
|
|
1186
|
+
/** 是否显示选中框,默认 true */
|
|
1187
|
+
showChecked?: boolean
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
export interface JwtMaterialItemMaskEmits {
|
|
1191
|
+
/** 预览图片 */
|
|
1192
|
+
previewImg: (index: number, item: any) => void
|
|
1193
|
+
/** 删除 */
|
|
1194
|
+
delete: (index: number, item: any) => void
|
|
1195
|
+
/** 切换编辑 */
|
|
1196
|
+
toggleEdit: (index: number, item: any) => void
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
// ============================================================
|
|
1200
|
+
// JwtRateIcon - 评分组件
|
|
1201
|
+
// ============================================================
|
|
1202
|
+
|
|
1203
|
+
export interface JwtRateIconProps {
|
|
1204
|
+
/** 当前评分值 (v-model) */
|
|
1205
|
+
modelValue?: number | string
|
|
1206
|
+
/** 图标大小,默认 18 */
|
|
1207
|
+
size?: number | string
|
|
1208
|
+
/** 是否禁用 */
|
|
1209
|
+
disabled?: boolean
|
|
1210
|
+
/** 未选中图标,默认 'star-line' */
|
|
1211
|
+
voidIcon?: string
|
|
1212
|
+
/** 选中图标,默认 'star-fill' */
|
|
1213
|
+
icon?: string
|
|
1214
|
+
/** 选中颜色,默认 '#f7ba2a' */
|
|
1215
|
+
color?: string
|
|
1216
|
+
/** 未选中颜色,默认 '#c6d1de' */
|
|
1217
|
+
voidColor?: string
|
|
1218
|
+
/** 最大分值,默认 5 */
|
|
1219
|
+
max?: number | string
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
export interface JwtRateIconEmits {
|
|
1223
|
+
/** v-model 更新 */
|
|
1224
|
+
'update:modelValue': (value: number) => void
|
|
1225
|
+
/** 评分变化 */
|
|
1226
|
+
change: (value: number) => void
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
// ============================================================
|
|
1230
|
+
// JwtCount - 数字动画
|
|
1231
|
+
// ============================================================
|
|
1232
|
+
|
|
1233
|
+
export interface JwtCountProps {
|
|
1234
|
+
/** 起始值,默认 0 */
|
|
1235
|
+
startVal?: number
|
|
1236
|
+
/** 结束值,默认 0 */
|
|
1237
|
+
endVal?: number
|
|
1238
|
+
/** 动画时长 (ms),默认 3000 */
|
|
1239
|
+
duration?: number
|
|
1240
|
+
/** 是否自动播放,默认 true */
|
|
1241
|
+
autoplay?: boolean
|
|
1242
|
+
/** 小数位数,默认 0 */
|
|
1243
|
+
decimals?: number
|
|
1244
|
+
/** 小数点符号,默认 '.' */
|
|
1245
|
+
decimal?: string
|
|
1246
|
+
/** 千分位分隔符,默认 ',' */
|
|
1247
|
+
separator?: string
|
|
1248
|
+
/** 前缀 */
|
|
1249
|
+
prefix?: string
|
|
1250
|
+
/** 后缀 */
|
|
1251
|
+
suffix?: string
|
|
1252
|
+
/** 是否使用缓动动画,默认 true */
|
|
1253
|
+
useEasing?: boolean
|
|
1254
|
+
/** 自定义缓动函数 */
|
|
1255
|
+
easingFn?: (t: number, b: number, c: number, d: number) => number
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
export interface JwtCountEmits {
|
|
1259
|
+
/** 挂载完成回调 */
|
|
1260
|
+
mountedCallback: () => void
|
|
1261
|
+
/** 动画完成回调 */
|
|
1262
|
+
callback: () => void
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
export interface JwtCountExpose {
|
|
1266
|
+
/** 开始动画 */
|
|
1267
|
+
start(): void
|
|
1268
|
+
/** 暂停/恢复 */
|
|
1269
|
+
pauseResume(): void
|
|
1270
|
+
/** 暂停 */
|
|
1271
|
+
pause(): void
|
|
1272
|
+
/** 恢复 */
|
|
1273
|
+
resume(): void
|
|
1274
|
+
/** 重置 */
|
|
1275
|
+
reset(): void
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
// ============================================================
|
|
1279
|
+
// JwtDesHeader - 描述区域标题
|
|
1280
|
+
// ============================================================
|
|
1281
|
+
|
|
1282
|
+
export interface JwtDesHeaderProps {
|
|
1283
|
+
/** 标题文字 */
|
|
1284
|
+
title?: string
|
|
1285
|
+
/** 提示信息 */
|
|
1286
|
+
tips?: string
|
|
1287
|
+
/** 是否显示边框 */
|
|
1288
|
+
border?: boolean
|
|
1289
|
+
/** 提示是否在 hover 时显示,默认 true */
|
|
1290
|
+
tipsHover?: boolean
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
export interface JwtDesHeaderSlots {
|
|
1294
|
+
/** 标题左侧区域 */
|
|
1295
|
+
left?: Slot
|
|
1296
|
+
/** 标题右侧区域 */
|
|
1297
|
+
default?: Slot
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
// ============================================================
|
|
1301
|
+
// JwtDesInfo - 描述信息展示
|
|
1302
|
+
// ============================================================
|
|
1303
|
+
|
|
1304
|
+
export interface JwtDesInfoProps {
|
|
1305
|
+
/** 描述配置 */
|
|
1306
|
+
config?: Record<string, any>
|
|
1307
|
+
/** 数据信息 */
|
|
1308
|
+
info?: Record<string, any>
|
|
1309
|
+
/** 用户菜单权限 */
|
|
1310
|
+
userMenusAuth?: Record<string, any>
|
|
1311
|
+
/** 当前页面路径 */
|
|
1312
|
+
currentPagePath?: string
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
export interface JwtDesInfoEmits {
|
|
1316
|
+
/** 表头按钮操作 */
|
|
1317
|
+
'header-action': (action: any) => void
|
|
1318
|
+
/** 值变化 */
|
|
1319
|
+
change: (row: any, item: any, source: string) => void
|
|
1320
|
+
/** 单元格点击 */
|
|
1321
|
+
'click-cell': (row: any, item: any) => void
|
|
1322
|
+
/** 内联编辑成功 */
|
|
1323
|
+
'des-edit-success': (item: any) => void
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
export interface JwtDesInfoSlots {
|
|
1327
|
+
/** 动态插槽,名称由 item.slotName 或 item.prop 决定,props: { scope: info } */
|
|
1328
|
+
[slotName: string]: Slot<any> | undefined
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
// ============================================================
|
|
1332
|
+
// JwtDesTable - 描述表格
|
|
1333
|
+
// ============================================================
|
|
1334
|
+
|
|
1335
|
+
export interface JwtDesTableProps {
|
|
1336
|
+
/** 描述表格配置 */
|
|
1337
|
+
config: Record<string, any>
|
|
1338
|
+
/** 详情数据 */
|
|
1339
|
+
detailInfo: Record<string, any>
|
|
1340
|
+
/** 用户菜单权限 */
|
|
1341
|
+
userMenusAuth?: Record<string, any>
|
|
1342
|
+
/** 当前页面路径 */
|
|
1343
|
+
currentPagePath?: string
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
export interface JwtDesTableEmits {
|
|
1347
|
+
/** 表头按钮操作 */
|
|
1348
|
+
'header-action': (action: any) => void
|
|
1349
|
+
/** 值变化 */
|
|
1350
|
+
change: (row: any, item: any, source: string) => void
|
|
1351
|
+
/** 单元格点击 */
|
|
1352
|
+
'click-cell': (row: any, item: any) => void
|
|
1353
|
+
/** 内联编辑成功 */
|
|
1354
|
+
'des-edit-success': (item: any) => void
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
export interface JwtDesTableSlots {
|
|
1358
|
+
/** 标题插槽 (名称由 config.titleSlotName 决定),props: { scope } */
|
|
1359
|
+
title?: Slot<{ scope: any }>
|
|
1360
|
+
/** 额外区域 (名称由 config.extraSlotName 决定),props: { scope } */
|
|
1361
|
+
extra?: Slot<{ scope: any }>
|
|
1362
|
+
/** 动态列插槽,名称由 item.prop 决定,props: { index, scope } */
|
|
1363
|
+
[propName: string]: Slot<any> | undefined
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
// ============================================================
|
|
1367
|
+
// JwtDetailDrawer - 详情抽屉
|
|
1368
|
+
// ============================================================
|
|
1369
|
+
|
|
1370
|
+
export interface JwtDetailDrawerProps {
|
|
1371
|
+
/** 抽屉配置 */
|
|
1372
|
+
config?: Record<string, any>
|
|
1373
|
+
/** 用户菜单权限 */
|
|
1374
|
+
userMenusAuth?: Record<string, any>
|
|
1375
|
+
/** 当前页面路径 */
|
|
1376
|
+
currentPagePath?: string
|
|
1377
|
+
/** 当前页面抽屉配置 */
|
|
1378
|
+
currentPageDrawerConfig?: Record<string, any>
|
|
1379
|
+
/** 已打开的页面抽屉配置列表 */
|
|
1380
|
+
openPageDrawerConfigList?: any[]
|
|
1381
|
+
/** 数据信息 */
|
|
1382
|
+
info?: Record<string, any>
|
|
1383
|
+
/** 请求参数 */
|
|
1384
|
+
params?: Record<string, any>
|
|
1385
|
+
/** 当前行数据 */
|
|
1386
|
+
row?: Record<string, any>
|
|
1387
|
+
/** 是否缓存组件,默认 true */
|
|
1388
|
+
keepAlive?: boolean
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
export interface JwtDetailDrawerEmits {
|
|
1392
|
+
/** 表头按钮操作 */
|
|
1393
|
+
'header-action': (action: any, selectionRow: any[], detailInfo: any) => void
|
|
1394
|
+
/** 获取详情成功 */
|
|
1395
|
+
'get-detail-success': (response: any) => void
|
|
1396
|
+
/** 内联编辑成功 */
|
|
1397
|
+
'des-edit-success': (response: any, code: string) => void
|
|
1398
|
+
/** 通用事件透传 */
|
|
1399
|
+
'event-name': (...args: any[]) => void
|
|
1400
|
+
/** 刷新关联表格 */
|
|
1401
|
+
'refresh-table': () => void
|
|
1402
|
+
/** 关闭抽屉 */
|
|
1403
|
+
'close-drawer': () => void
|
|
1404
|
+
/** 返回上一级抽屉 */
|
|
1405
|
+
'back-drawer': () => void
|
|
1406
|
+
/** 推入新抽屉 */
|
|
1407
|
+
'push-drawer': (data: any) => void
|
|
1408
|
+
/** 删除成功 */
|
|
1409
|
+
'delete-success': () => void
|
|
1410
|
+
/** 新增成功 */
|
|
1411
|
+
'add-success': (data: any) => void
|
|
1412
|
+
/** 编辑成功 */
|
|
1413
|
+
'edit-success': (data: any) => void
|
|
1414
|
+
/** 底部操作 */
|
|
1415
|
+
'footer-action': (type: string, model: any) => void
|
|
1416
|
+
/** 单元格点击 */
|
|
1417
|
+
'click-cell': (row: any, item: any) => void
|
|
1418
|
+
/** 值变化 */
|
|
1419
|
+
change: (row: any, item: any) => void
|
|
1420
|
+
/** 标签切换 */
|
|
1421
|
+
'tab-click': (tab: any, event: Event) => void
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
export interface JwtDetailDrawerSlots {
|
|
1425
|
+
/** 头部图标之前 */
|
|
1426
|
+
'drawer-header-icon'?: Slot<{ row: any }>
|
|
1427
|
+
/** 头部图标之后 */
|
|
1428
|
+
'drawer-header-icon-after'?: Slot<{ row: any }>
|
|
1429
|
+
/** 头部按钮之前 */
|
|
1430
|
+
'header-btn-before'?: Slot<{ row: any }>
|
|
1431
|
+
/** 头部按钮之后 */
|
|
1432
|
+
'header-btn-after'?: Slot<{ row: any }>
|
|
1433
|
+
/** 内容区域之前 */
|
|
1434
|
+
'drawer-content-before'?: Slot<{ row: any; scope: any }>
|
|
1435
|
+
/** 内容区域之后 */
|
|
1436
|
+
'drawer-content-after'?: Slot<{ row: any; scope: any }>
|
|
1437
|
+
/** 弹窗底部之前 */
|
|
1438
|
+
'dialog-footer-before'?: Slot<{ model: any }>
|
|
1439
|
+
/** 弹窗底部之后 */
|
|
1440
|
+
'dialog-footer-after'?: Slot<{ model: any }>
|
|
1441
|
+
/**
|
|
1442
|
+
* 动态插槽,支持:
|
|
1443
|
+
* - 头部插槽 (由 config.headerSlotName 决定),props: { scope }
|
|
1444
|
+
* - 内容插槽 (由 config.contentSlotName 决定),props: { row, scope }
|
|
1445
|
+
* - 表单插槽 (由 formList 项的 name 决定),props: { model }
|
|
1446
|
+
*/
|
|
1447
|
+
[slotName: string]: Slot<any> | undefined
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
export interface JwtDetailDrawerExpose {
|
|
1451
|
+
/** 刷新抽屉详情数据 */
|
|
1452
|
+
handleRefreshDrawerDetail(): void
|
|
1453
|
+
/** 显示抽屉 */
|
|
1454
|
+
handleShowDrawer(): void
|
|
1455
|
+
/** 关闭抽屉 */
|
|
1456
|
+
handleCloseDrawer(): void
|
|
1457
|
+
/** 返回上一级 */
|
|
1458
|
+
handleDrawerBack(): void
|
|
1459
|
+
/** 处理表头操作 */
|
|
1460
|
+
handleHeaderAction(action: any): void
|
|
1461
|
+
/** 弹窗操作 */
|
|
1462
|
+
handleBox(action: any, box: any): void
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
// ============================================================
|
|
1466
|
+
// JwtHeaderButton - 表头操作按钮
|
|
1467
|
+
// ============================================================
|
|
1468
|
+
|
|
1469
|
+
export interface JwtHeaderButtonProps {
|
|
1470
|
+
/** 是否加载中 */
|
|
1471
|
+
loading?: boolean
|
|
1472
|
+
/** 当前页面路径 */
|
|
1473
|
+
currentPath?: string
|
|
1474
|
+
/** 用户菜单权限对象 */
|
|
1475
|
+
menusObj?: Record<string, any>
|
|
1476
|
+
/** 当前选中行 */
|
|
1477
|
+
selectionRow?: any[]
|
|
1478
|
+
/** 操作按钮配置 */
|
|
1479
|
+
config?: Record<string, any>
|
|
1480
|
+
/** 文件导入配置 */
|
|
1481
|
+
fileImport?: Record<string, any>
|
|
1482
|
+
/** 当前行数据 */
|
|
1483
|
+
row?: Record<string, any>
|
|
1484
|
+
/** 操作属性名 */
|
|
1485
|
+
operationName?: string
|
|
1486
|
+
/** 是否显示图标,默认 true */
|
|
1487
|
+
showIcon?: boolean
|
|
1488
|
+
/** 是否显示文字,默认 true */
|
|
1489
|
+
showText?: boolean
|
|
1490
|
+
/** 上传成功回调 */
|
|
1491
|
+
uploadSuccessCb?: Function
|
|
1492
|
+
/** 数据总条数 */
|
|
1493
|
+
totalCount?: number
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
export interface JwtHeaderButtonEmits {
|
|
1497
|
+
/** 表头按钮操作 */
|
|
1498
|
+
'header-action': (action: any, row?: any) => void
|
|
1499
|
+
/** 上传成功 */
|
|
1500
|
+
'upload-success': () => void
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
// ============================================================
|
|
1504
|
+
// JwtPrefixSuffix - 前缀/后缀包装器
|
|
1505
|
+
// ============================================================
|
|
1506
|
+
|
|
1507
|
+
export interface JwtPrefixSuffixProps {
|
|
1508
|
+
/** 列配置项 */
|
|
1509
|
+
item?: Record<string, any>
|
|
1510
|
+
/** 当前行数据 */
|
|
1511
|
+
row?: Record<string, any>
|
|
1512
|
+
/** 类型: 'pre' 前缀 | 'suf' 后缀 */
|
|
1513
|
+
type?: 'pre' | 'suf'
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
// ============================================================
|
|
1517
|
+
// Exported Hooks & Utilities
|
|
1518
|
+
// ============================================================
|
|
1519
|
+
|
|
1520
|
+
/** 记忆化计算属性,相同参数返回缓存结果 */
|
|
1521
|
+
export function useComputed<T>(fn: (...args: any[]) => T): (...args: any[]) => ComputedRef<T>
|
|
1522
|
+
|
|
1523
|
+
/** 根据文件名获取文件图标信息 */
|
|
1524
|
+
export function getFileIcon(fileName?: string, type?: string): { icon: string; cls: string; file: string }
|
|
1525
|
+
|
|
1526
|
+
/** 根据文件名获取文件类型 */
|
|
1527
|
+
export function getFileType(filename: string, typeName?: boolean, obj?: boolean): string | Record<string, any>
|
|
1528
|
+
|
|
1529
|
+
/** 打开编辑弹窗 */
|
|
1530
|
+
export function handleDialogEdit(row: any, rowAction: any, appConfig: any, boxInfo: any, options?: any): void
|
|
1531
|
+
|
|
1532
|
+
/** 获取弹窗标题 */
|
|
1533
|
+
export function getDialogTitle(isEdit: boolean, config: any, editBoxName: string, t?: (text: string) => string): string
|
|
1534
|
+
|
|
1535
|
+
/** 处理表格操作按钮事件 */
|
|
1536
|
+
export function handleTableActions(action: { code: string }, row?: any, rowAction?: any, selectionRow?: any[], type?: string, options?: any): void
|
|
1537
|
+
|
|
1538
|
+
/** 发送简单请求 */
|
|
1539
|
+
export function handleSimpleReq(
|
|
1540
|
+
row: any,
|
|
1541
|
+
rowAction: any,
|
|
1542
|
+
code: string,
|
|
1543
|
+
opt?: { selectionRow?: any[] | null; callback?: (res: any, code: string) => void; cancel?: boolean; rowKey?: string }
|
|
1544
|
+
): void
|
|
1545
|
+
|
|
1546
|
+
/** 表格按钮逻辑 hook */
|
|
1547
|
+
export function useTableButton(
|
|
1548
|
+
props: {
|
|
1549
|
+
config?: Record<string, any>
|
|
1550
|
+
row?: Record<string, any>
|
|
1551
|
+
selectionRow?: any[]
|
|
1552
|
+
menusObj?: Record<string, any>
|
|
1553
|
+
currentPath?: string
|
|
1554
|
+
operationName?: string
|
|
1555
|
+
showButtonNum?: number | string
|
|
1556
|
+
totalCount?: number
|
|
1557
|
+
loading?: boolean
|
|
1558
|
+
fileImport?: Record<string, any>
|
|
1559
|
+
tableCopyText?: string
|
|
1560
|
+
},
|
|
1561
|
+
position?: 'table' | 'header'
|
|
1562
|
+
): {
|
|
1563
|
+
visibleActions: ComputedRef<any[]>
|
|
1564
|
+
hasOverflowActions: ComputedRef<boolean>
|
|
1565
|
+
tableButtonActions: ComputedRef<any[]>
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
/** 表单项数据 hook */
|
|
1569
|
+
export function useFormItem(props: any, emit: any): {
|
|
1570
|
+
itemOptions: ComputedRef<any>
|
|
1571
|
+
itemAttrs: Record<string, any>
|
|
1572
|
+
itemText: ComputedRef<any>
|
|
1573
|
+
renderText: ComputedRef<any>
|
|
1574
|
+
imgUrl: ComputedRef<any>
|
|
1575
|
+
listUrl: ComputedRef<any>
|
|
1576
|
+
previewUrl: ComputedRef<any[]>
|
|
1577
|
+
itemTagType: ComputedRef<string>
|
|
1578
|
+
defaultImgUrl: ComputedRef<string>
|
|
1579
|
+
errorImgUrl: ComputedRef<string>
|
|
1580
|
+
handleChange(val: any): void
|
|
1581
|
+
handleGetList(listData: Ref<any[]>, req?: boolean): void
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
// ============================================================
|
|
1585
|
+
// Global Component Registration - 全局组件注册
|
|
1586
|
+
// ============================================================
|
|
1587
|
+
|
|
1588
|
+
declare module '@vue/runtime-core' {
|
|
1589
|
+
export interface GlobalComponents {
|
|
1590
|
+
/** 数据表格 - 包含搜索、工具栏、分页、弹窗编辑 */
|
|
1591
|
+
JwtTable: DefineComponent<JwtTableProps>
|
|
1592
|
+
/** 数据表格 V2 - 优化版,接口与 JwtTable 一致 */
|
|
1593
|
+
JwtTableV2: DefineComponent<JwtTableV2Props>
|
|
1594
|
+
/** 纯表格 - 无工具栏和分页 */
|
|
1595
|
+
JwtTableOnly: DefineComponent<JwtTableOnlyProps>
|
|
1596
|
+
/** 表格行操作按钮 */
|
|
1597
|
+
JwtTableButton: DefineComponent<JwtTableButtonProps>
|
|
1598
|
+
/** 动态表单 */
|
|
1599
|
+
JwtForm: DefineComponent<JwtFormProps>
|
|
1600
|
+
/** 表单项渲染器 */
|
|
1601
|
+
JwtFormItem: DefineComponent<JwtFormItemProps>
|
|
1602
|
+
/** 弹窗表单 */
|
|
1603
|
+
JwtDialogForm: DefineComponent<JwtDialogFormProps>
|
|
1604
|
+
/** 带变更标记的输入框 */
|
|
1605
|
+
JwtInput: DefineComponent<JwtInputProps>
|
|
1606
|
+
/** 表格列内容渲染器 */
|
|
1607
|
+
JwtColumnItme: DefineComponent<JwtColumnItmeProps>
|
|
1608
|
+
/** 日期格式化列 */
|
|
1609
|
+
ColumnDateTimeFormat: DefineComponent<ColumnDateTimeFormatProps>
|
|
1610
|
+
/** 默认值显示列 */
|
|
1611
|
+
ColumnDefault: DefineComponent<ColumnDefaultProps>
|
|
1612
|
+
/** 文件列 */
|
|
1613
|
+
ColumnFile: DefineComponent<ColumnFileProps>
|
|
1614
|
+
/** HTML 富文本列 */
|
|
1615
|
+
ColumnHtml: DefineComponent<ColumnHtmlProps>
|
|
1616
|
+
/** 单图列 */
|
|
1617
|
+
ColumnImg: DefineComponent<ColumnImgProps>
|
|
1618
|
+
/** 可添加图片列 */
|
|
1619
|
+
ColumnImgAdd: DefineComponent<ColumnImgAddProps>
|
|
1620
|
+
/** 多图列 */
|
|
1621
|
+
ColumnImgs: DefineComponent<ColumnImgsProps>
|
|
1622
|
+
/** 链接列 */
|
|
1623
|
+
ColumnLink: DefineComponent<ColumnLinkProps>
|
|
1624
|
+
/** 标签列 */
|
|
1625
|
+
ColumnTag: DefineComponent<ColumnTagProps>
|
|
1626
|
+
/** 标签列表列 */
|
|
1627
|
+
ColumnTagList: DefineComponent<ColumnTagListProps>
|
|
1628
|
+
/** 文本列 */
|
|
1629
|
+
ColumnText: DefineComponent<ColumnTextProps>
|
|
1630
|
+
/** 视频列 */
|
|
1631
|
+
ColumnVideo: DefineComponent<ColumnVideoProps>
|
|
1632
|
+
/** 图片上传 */
|
|
1633
|
+
JwtUploadImage: DefineComponent<JwtUploadImageProps>
|
|
1634
|
+
/** 文件上传 */
|
|
1635
|
+
JwtUploadFile: DefineComponent<JwtUploadFileProps>
|
|
1636
|
+
/** 视频上传 */
|
|
1637
|
+
JwtUploadVideo: DefineComponent<JwtUploadVideoProps>
|
|
1638
|
+
/** 拖拽文件上传 (COS SDK) */
|
|
1639
|
+
JwtFileUpload: DefineComponent<JwtFileUploadProps>
|
|
1640
|
+
/** 富文本编辑器 (wangEditor) */
|
|
1641
|
+
JwtEditor: DefineComponent<JwtEditorProps>
|
|
1642
|
+
/** 图片裁剪 */
|
|
1643
|
+
JwtCropper: DefineComponent<JwtCropperProps>
|
|
1644
|
+
/** 弹窗裁剪 */
|
|
1645
|
+
JwtCropperDialog: DefineComponent<JwtCropperDialogProps>
|
|
1646
|
+
/** 服务端下拉选择 */
|
|
1647
|
+
JwtSelectServer: DefineComponent<JwtSelectServerProps>
|
|
1648
|
+
/** 地区级联选择 */
|
|
1649
|
+
JwtCascaderArea: DefineComponent<JwtCascaderAreaProps>
|
|
1650
|
+
/** 服务端级联选择 */
|
|
1651
|
+
JwtCascaderServer: DefineComponent<JwtCascaderServerProps>
|
|
1652
|
+
/** 树形组件 */
|
|
1653
|
+
JwtTree: DefineComponent<JwtTreeProps>
|
|
1654
|
+
/** 标签页 */
|
|
1655
|
+
JwtTabs: DefineComponent<JwtTabsProps>
|
|
1656
|
+
/** 标签选择/展示 */
|
|
1657
|
+
JwtTags: DefineComponent<JwtTagsProps>
|
|
1658
|
+
/** 图片展示 */
|
|
1659
|
+
JwtImage: DefineComponent<JwtImageProps>
|
|
1660
|
+
/** 图标 (remixicon) */
|
|
1661
|
+
JwtIcon: DefineComponent<JwtIconProps>
|
|
1662
|
+
/** 图标选择器 */
|
|
1663
|
+
JwtIconSelect: DefineComponent<JwtIconSelectProps>
|
|
1664
|
+
/** 表情选择器 */
|
|
1665
|
+
JwtEmojiSelect: DefineComponent<JwtEmojiSelectProps>
|
|
1666
|
+
/** 文件类型图标 */
|
|
1667
|
+
JwtFileIcon: DefineComponent<JwtFileIconProps>
|
|
1668
|
+
/** 素材库 */
|
|
1669
|
+
JwtMaterial: DefineComponent<JwtMaterialProps>
|
|
1670
|
+
/** 素材项遮罩层 */
|
|
1671
|
+
JwtMaterialItemMask: DefineComponent<JwtMaterialItemMaskProps>
|
|
1672
|
+
/** 评分组件 */
|
|
1673
|
+
JwtRateIcon: DefineComponent<JwtRateIconProps>
|
|
1674
|
+
/** 数字动画 */
|
|
1675
|
+
JwtCount: DefineComponent<JwtCountProps>
|
|
1676
|
+
/** 描述区域标题 */
|
|
1677
|
+
JwtDesHeader: DefineComponent<JwtDesHeaderProps>
|
|
1678
|
+
/** 描述信息展示 */
|
|
1679
|
+
JwtDesInfo: DefineComponent<JwtDesInfoProps>
|
|
1680
|
+
/** 描述表格 */
|
|
1681
|
+
JwtDesTable: DefineComponent<JwtDesTableProps>
|
|
1682
|
+
/** 详情抽屉 */
|
|
1683
|
+
JwtDetailDrawer: DefineComponent<JwtDetailDrawerProps>
|
|
1684
|
+
/** 表头操作按钮 */
|
|
1685
|
+
JwtHeaderButton: DefineComponent<JwtHeaderButtonProps>
|
|
1686
|
+
/** 前缀/后缀包装器 */
|
|
1687
|
+
JwtPrefixSuffix: DefineComponent<JwtPrefixSuffixProps>
|
|
1688
|
+
}
|
|
1689
|
+
}
|