dmx-admin-ui 1.2.210 → 1.2.212
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{editor-DvQYlbuU.js → editor-DfIMjc-7.js} +5 -4
- package/dist/{group-Czf_0bJw.js → group-C8OwpZGI.js} +2 -2
- package/dist/{group-table-BstC_Gsh.js → group-table-DQpcld_c.js} +2 -2
- package/dist/{group-tabs-DIKvFcaQ.js → group-tabs-Bu8WJs3Q.js} +2 -2
- package/dist/{group-tabs-plus-DnzHn56m.js → group-tabs-plus-CBB7ZBLP.js} +2 -2
- package/dist/{index-DFfplvww.js → index-C-PUpQca.js} +3359 -3257
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/input-item-BeooUH0A.js +4 -0
- package/package.json +1 -1
- package/types/admin.d.ts +239 -41
- package/types/global.d.ts +104 -1
- package/types/plugins/loadjs.d.ts +1 -1
- package/dist/input-item-Du4IANs5.js +0 -4
package/types/admin.d.ts
CHANGED
|
@@ -13,17 +13,26 @@ import {
|
|
|
13
13
|
type TransferProps,
|
|
14
14
|
type AutocompleteProps,
|
|
15
15
|
type ButtonProps,
|
|
16
|
-
type FormItemRule
|
|
16
|
+
type FormItemRule,
|
|
17
|
+
type TagProps,
|
|
18
|
+
type ImageProps,
|
|
19
|
+
type ColProps,
|
|
20
|
+
type TextProps,
|
|
17
21
|
} from 'element-plus'
|
|
18
|
-
import { Component } from 'vue'
|
|
22
|
+
import { Component, StyleValue } from 'vue'
|
|
19
23
|
/** 表单字段 */
|
|
20
24
|
interface ColField {
|
|
21
25
|
/** 字段名 */
|
|
22
|
-
field
|
|
26
|
+
field?: string;
|
|
23
27
|
/** 字段标题 */
|
|
24
28
|
title?: string | false;
|
|
25
29
|
/** title 别名 */
|
|
26
30
|
label?: string | false;
|
|
31
|
+
tab?: number | number[];
|
|
32
|
+
labelWidth?: string;
|
|
33
|
+
class?: string;
|
|
34
|
+
colClass?: string;
|
|
35
|
+
colWidth?: string;
|
|
27
36
|
slot?: string | true;
|
|
28
37
|
placeholder?: string;
|
|
29
38
|
clearable?: boolean;
|
|
@@ -31,39 +40,85 @@ interface ColField {
|
|
|
31
40
|
required?: boolean;
|
|
32
41
|
width?: number;
|
|
33
42
|
disabled?: boolean;
|
|
43
|
+
/** 缺省默认值 */
|
|
44
|
+
value?: any;
|
|
34
45
|
rules?: FormItemRule | FormItemRule[];
|
|
35
|
-
change?: (e:
|
|
46
|
+
change?: (e: {
|
|
47
|
+
data: any, input: {
|
|
48
|
+
onChange: (e: any) => void;
|
|
49
|
+
setValue: (e: any) => void;
|
|
50
|
+
relatedUpdate: (field: any, e: any) => void;
|
|
51
|
+
prop: Record<string, any>;
|
|
52
|
+
}
|
|
53
|
+
}) => void;
|
|
36
54
|
changeField?: string[];
|
|
55
|
+
format?: Function
|
|
37
56
|
}
|
|
38
|
-
type ColsTypes = 'hidden' | '
|
|
57
|
+
type ColsTypes = 'hidden' | 'text' | 'input-select' | 'radio-button' | 'editor' | 'tags' | 'map' | 'pickerMap' | 'region' | 'url' | 'img' | 'image' | 'file' | 'video' | 'audio'
|
|
58
|
+
type KnownTypes = ColsTypes | 'input-button' | 'input-auto' | 'imgs' | 'group-table' | 'group' | 'group-tabs' | 'group-tabs-plus' | 'selects' | 'password' | 'textarea' | 'number' | 'color' | 'switch' | 'checkbox' | 'radio' | 'slider' | 'datetimes' | 'dates' | 'datetime' | 'date' | 'time' | 'times';
|
|
59
|
+
|
|
39
60
|
interface AnyColField extends ColField {
|
|
40
|
-
type: ColsTypes
|
|
41
|
-
props?: Record<string, any>;
|
|
61
|
+
type: ColsTypes;
|
|
42
62
|
}
|
|
43
63
|
interface OtherColField extends ColField {
|
|
44
|
-
props?: Record<string, any>;
|
|
45
64
|
/** 用户自定义类型 */
|
|
46
|
-
type: Omit<string,
|
|
65
|
+
type: Omit<string, KnownTypes>;
|
|
47
66
|
}
|
|
48
67
|
interface DiyField extends ColField {
|
|
49
68
|
/** 自定义组件 */
|
|
50
69
|
component: string | Component
|
|
51
|
-
|
|
70
|
+
}
|
|
71
|
+
interface inputAutoField extends ColField {
|
|
72
|
+
type: 'input-auto';
|
|
73
|
+
/** input-auto 配置信息 */
|
|
74
|
+
list?: Record<string | number, string>;
|
|
75
|
+
/** el-autocomplete props属性
|
|
76
|
+
* @see https://element-plus.org/zh-CN/component/autocomplete#attributes
|
|
77
|
+
*/
|
|
78
|
+
props?: AutocompleteProps;
|
|
79
|
+
|
|
80
|
+
}
|
|
81
|
+
interface inputBtnField extends ColField {
|
|
82
|
+
type: 'input-button'
|
|
83
|
+
/** input-button Props */
|
|
84
|
+
props: {
|
|
85
|
+
/** el-input props属性
|
|
86
|
+
* @see https://element-plus.org/zh-CN/component/input#attributes
|
|
87
|
+
*/
|
|
88
|
+
props?: InputProps;
|
|
89
|
+
btn: {
|
|
90
|
+
icon?: string
|
|
91
|
+
text: string
|
|
92
|
+
click: (value: any) => any | Promise<any>
|
|
93
|
+
}
|
|
94
|
+
}
|
|
52
95
|
}
|
|
53
96
|
interface ImgsField extends ColField {
|
|
54
97
|
type: 'imgs' | 'images';
|
|
55
98
|
limit?: number;
|
|
99
|
+
tips?: string;
|
|
100
|
+
cateId?: Number;
|
|
56
101
|
props?: Record<string, any>;
|
|
57
102
|
}
|
|
58
103
|
interface GroupTableField extends ColField {
|
|
59
|
-
type: 'group-table' | 'group
|
|
104
|
+
type: 'group-table' | 'group';
|
|
60
105
|
limit?: number;
|
|
61
|
-
cols?: FormCol[];
|
|
106
|
+
cols?: (FormCol & { inputWidth?: string })[];
|
|
107
|
+
props?: Record<string, any>;
|
|
108
|
+
}
|
|
109
|
+
interface GroupTabsField extends ColField {
|
|
110
|
+
type: 'group-tabs' | 'group-tabs-plus';
|
|
111
|
+
limit?: number;
|
|
112
|
+
tabs?: Function | Record<string, any>;
|
|
113
|
+
cols?: (FormCol & { inputWidth?: string })[] | (FormCol & { inputWidth?: string });
|
|
62
114
|
props?: Record<string, any>;
|
|
63
115
|
}
|
|
64
116
|
interface InputField extends ColField {
|
|
65
117
|
type?: 'input';
|
|
66
|
-
|
|
118
|
+
/** el-input props属性
|
|
119
|
+
* @see https://element-plus.org/zh-CN/component/input#attributes
|
|
120
|
+
*/
|
|
121
|
+
props?: InputProps
|
|
67
122
|
}
|
|
68
123
|
interface SelectField extends ColField {
|
|
69
124
|
type: 'select';
|
|
@@ -74,53 +129,90 @@ interface SelectField extends ColField {
|
|
|
74
129
|
* 数组或对象模式 url是兼容处理 请使用cols配置
|
|
75
130
|
*/
|
|
76
131
|
url?: { value: number | string | boolean, label: string }[] | Record<string, number | string | boolean> | string[] | string;
|
|
77
|
-
|
|
132
|
+
/** el-select props属性
|
|
133
|
+
* @see https://element-plus.org/zh-CN/component/select#select-attributes
|
|
134
|
+
*/
|
|
135
|
+
props?: SelectPropsPublic
|
|
78
136
|
}
|
|
79
137
|
interface SliderField extends ColField {
|
|
80
138
|
type: 'slider';
|
|
81
|
-
|
|
139
|
+
/** el-slider props属性
|
|
140
|
+
* @see https://element-plus.org/zh-CN/component/slider#%E5%B1%9E%E6%80%A7
|
|
141
|
+
*/
|
|
142
|
+
props?: SliderPropsPublic
|
|
82
143
|
}
|
|
83
144
|
interface TextareaField extends ColField {
|
|
84
145
|
type: 'textarea';
|
|
85
|
-
|
|
146
|
+
/** el-input props属性
|
|
147
|
+
* @see https://element-plus.org/zh-CN/component/input#attributes
|
|
148
|
+
*/
|
|
149
|
+
maxlength?:InputProps['maxlength']
|
|
150
|
+
props?: InputProps
|
|
86
151
|
}
|
|
87
152
|
interface PassField extends ColField {
|
|
88
153
|
type: 'password';
|
|
89
|
-
|
|
154
|
+
/** el-input props属性
|
|
155
|
+
* @see https://element-plus.org/zh-CN/component/input#attributes
|
|
156
|
+
*/
|
|
157
|
+
props?: InputProps
|
|
90
158
|
}
|
|
91
159
|
interface SwitchField extends ColField {
|
|
92
160
|
type: 'switch';
|
|
93
|
-
|
|
161
|
+
cols?: [0 | false, 1 | true] | [0 | false, 1 | true, string, string];
|
|
162
|
+
/** el-switch props属性
|
|
163
|
+
* @see https://element-plus.org/zh-CN/component/switch#attributes
|
|
164
|
+
*/
|
|
165
|
+
props?: SwitchProps
|
|
94
166
|
}
|
|
95
167
|
interface CheckboxField extends ColField {
|
|
96
168
|
type: 'checkbox';
|
|
97
|
-
|
|
169
|
+
/** el-checkbox props属性
|
|
170
|
+
* @see https://element-plus.org/zh-CN/component/checkbox#checkbox-attributes
|
|
171
|
+
*/
|
|
172
|
+
props?: CheckboxProps;
|
|
98
173
|
}
|
|
99
174
|
interface RadioField extends ColField {
|
|
100
175
|
type: 'radio';
|
|
101
|
-
|
|
102
|
-
|
|
176
|
+
/** el-radio props属性
|
|
177
|
+
* @see https://element-plus.org/zh-CN/component/radio#radio-attributes
|
|
178
|
+
*/
|
|
179
|
+
props?: RadioProps;
|
|
180
|
+
/** 配置信息 */
|
|
103
181
|
cols?: { value: number | string | boolean, label: string }[] | Record<string, number | string | boolean> | string[];
|
|
104
182
|
}
|
|
105
183
|
interface ColorField extends ColField {
|
|
106
184
|
type: 'color';
|
|
107
|
-
|
|
185
|
+
/** el-color-picker props属性
|
|
186
|
+
* @see https://element-plus.org/zh-CN/component/color-picker#attributes
|
|
187
|
+
*/
|
|
188
|
+
props?: ColorPickerProps;
|
|
108
189
|
}
|
|
109
190
|
interface NumberField extends ColField {
|
|
110
191
|
type: 'number';
|
|
111
|
-
|
|
192
|
+
/** el-input-number props属性
|
|
193
|
+
* @see https://element-plus.org/zh-CN/component/input-number#attributes
|
|
194
|
+
*/
|
|
195
|
+
props?: InputNumberProps;
|
|
112
196
|
}
|
|
113
197
|
interface DateField extends ColField {
|
|
114
198
|
type: 'datetimes' | 'dates' | 'datetime' | 'date';
|
|
115
|
-
|
|
199
|
+
/** el-date-picker props属性
|
|
200
|
+
* @see https://element-plus.org/zh-CN/component/date-picker#%E5%B1%9E%E6%80%A7
|
|
201
|
+
*/
|
|
202
|
+
props?: DatePickerPropsPublic;
|
|
116
203
|
}
|
|
117
204
|
interface TimeField extends ColField {
|
|
118
205
|
type: 'time' | 'times';
|
|
119
|
-
|
|
206
|
+
/** el-time-picker props属性
|
|
207
|
+
* @see https://element-plus.org/zh-CN/component/time-picker#attributes
|
|
208
|
+
*/
|
|
209
|
+
props?: TimePickerDefaultPropsPublic;
|
|
120
210
|
}
|
|
121
211
|
interface CascaderField extends ColField {
|
|
122
212
|
type: 'selects';
|
|
123
|
-
/** el-cascader props
|
|
213
|
+
/** el-cascader props属性
|
|
214
|
+
* @see https://element-plus.org/zh-CN/component/cascader#cascader-attributes
|
|
215
|
+
*/
|
|
124
216
|
props?: CascaderComponentProps;
|
|
125
217
|
/** api接口 或者配置信息
|
|
126
218
|
* @example
|
|
@@ -131,10 +223,10 @@ interface CascaderField extends ColField {
|
|
|
131
223
|
*/
|
|
132
224
|
url: string | string[] | { title: string, id: number | string, pid?: number | string }[] | { [key: string]: string };
|
|
133
225
|
}
|
|
134
|
-
export type FormCol = CascaderField | PassField | ImgsField | GroupTableField | NumberField | SelectField | SliderField | InputField | TextareaField | DateField | TimeField | SwitchField | ColorField | RadioField | CheckboxField | AnyColField | DiyField | OtherColField;
|
|
226
|
+
export type FormCol = CascaderField | PassField | ImgsField | GroupTableField | NumberField | SelectField | SliderField | InputField | TextareaField | DateField | TimeField | SwitchField | ColorField | RadioField | CheckboxField | GroupTabsField | inputBtnField | inputAutoField | AnyColField | DiyField | OtherColField;
|
|
135
227
|
export interface AdminFormInit {
|
|
136
228
|
confirmButton?: Record<string, any>;
|
|
137
|
-
url
|
|
229
|
+
url?: string | Function;
|
|
138
230
|
/** 表单宽度 字符串
|
|
139
231
|
* @example
|
|
140
232
|
* '50%'
|
|
@@ -144,9 +236,14 @@ export interface AdminFormInit {
|
|
|
144
236
|
width?: string;
|
|
145
237
|
/** 数据未改变时是否提示 默认true */
|
|
146
238
|
noChangeTip?: boolean;
|
|
147
|
-
beforeSubmit?: (data: Record<string, any>)=> void;
|
|
239
|
+
beforeSubmit?: (data: Record<string, any>) => void;
|
|
148
240
|
/** 表单字段列表 */
|
|
149
241
|
cols?: FormCol[];
|
|
242
|
+
colWidth?: string
|
|
243
|
+
colClass?: string
|
|
244
|
+
buttonFixed?: true
|
|
245
|
+
buttonText?: string
|
|
246
|
+
tabs?: string[];
|
|
150
247
|
btns?: {
|
|
151
248
|
title: string;
|
|
152
249
|
type?: ButtonType;
|
|
@@ -174,7 +271,7 @@ interface BaseCol {
|
|
|
174
271
|
title?: string;
|
|
175
272
|
/** 列子标题 */
|
|
176
273
|
subTitle?: string;
|
|
177
|
-
slot?: string|true;
|
|
274
|
+
slot?: string | true;
|
|
178
275
|
width?: number;
|
|
179
276
|
edit?: boolean;
|
|
180
277
|
/**
|
|
@@ -182,13 +279,21 @@ interface BaseCol {
|
|
|
182
279
|
* @param row - 当前行的数据对象
|
|
183
280
|
*/
|
|
184
281
|
on?: (row: Record<string, any>) => void;
|
|
185
|
-
/** 列类型 */
|
|
186
|
-
type?: string;
|
|
187
282
|
sort?: boolean;
|
|
188
283
|
color?: string;
|
|
284
|
+
tdClass?: string;
|
|
189
285
|
class?: string;
|
|
286
|
+
format?: (value: any) => any;
|
|
190
287
|
/** tabs索引 */
|
|
191
288
|
tab?: number | number[];
|
|
289
|
+
align?: 'left' | 'center' | 'right';
|
|
290
|
+
/** 缺省默认值 */
|
|
291
|
+
default?: string | number | boolean;
|
|
292
|
+
}
|
|
293
|
+
/** 基础列 */
|
|
294
|
+
interface AnyCol {
|
|
295
|
+
/** 列类型 */
|
|
296
|
+
type?: 'index' | 'region' | 'time' | 'times' | 'link' | 'img-info' | 'text' | 'imgs' | 'img' | 'checkbox';
|
|
192
297
|
}
|
|
193
298
|
/** 操作按钮 */
|
|
194
299
|
interface ToolButton {
|
|
@@ -208,10 +313,69 @@ interface ToolCol {
|
|
|
208
313
|
btn: ToolButton[];
|
|
209
314
|
|
|
210
315
|
}
|
|
316
|
+
type CSSColor =
|
|
317
|
+
| `#${string}` // 十六进制
|
|
318
|
+
| `rgb(${number}, ${number}, ${number})`
|
|
319
|
+
| `rgba(${number}, ${number}, ${number}, ${number})`
|
|
320
|
+
| `hsl(${number}, ${number}%, ${number}%)`
|
|
321
|
+
| `hsla(${number}, ${number}%, ${number}%, ${number})`
|
|
322
|
+
| `var(--${string})`
|
|
323
|
+
;
|
|
211
324
|
/** 状态列 */
|
|
212
325
|
interface StatusCol {
|
|
213
326
|
type: 'status';
|
|
214
|
-
cols?: { [key: number | string]: [string, '' | 'primary' | 'on' | 'info' | 'end' | 'info' | 'warning' | 'danger' | 'success'] };
|
|
327
|
+
cols?: { [key: number | string]: [string, '' | 'primary' | 'on' | 'info' | 'end' | 'info' | 'warning' | 'danger' | 'success' | CSSColor] };
|
|
328
|
+
}
|
|
329
|
+
/** (el-text)文本列 */
|
|
330
|
+
interface ElTextCol {
|
|
331
|
+
type: 'el-text';
|
|
332
|
+
/** el-text props属性
|
|
333
|
+
* @see https://element-plus.org/zh-CN/component/text#attributes
|
|
334
|
+
*/
|
|
335
|
+
props?: TextProps;
|
|
336
|
+
}
|
|
337
|
+
interface UserCol {
|
|
338
|
+
type: 'user',
|
|
339
|
+
/** 无数据时候显示的文本 */
|
|
340
|
+
error?:string
|
|
341
|
+
}
|
|
342
|
+
/** (text)文本列 */
|
|
343
|
+
interface TextCol {
|
|
344
|
+
type: 'text';
|
|
345
|
+
/** 文本样式 */
|
|
346
|
+
textClass?: string;
|
|
347
|
+
cols?: Record<string | number, string>;
|
|
348
|
+
}
|
|
349
|
+
/** 图片列 */
|
|
350
|
+
interface ImgCol {
|
|
351
|
+
type: 'img' | 'imgs' | 'image' | 'images';
|
|
352
|
+
/** 图片宽度 图片类型使用这个参数 避免和列宽度冲突,可用此值设置图片宽度 */
|
|
353
|
+
imgWidth?: string;
|
|
354
|
+
/**
|
|
355
|
+
* 图片高度 请使用 imgWidth
|
|
356
|
+
* @deprecated
|
|
357
|
+
* */
|
|
358
|
+
width?: string;
|
|
359
|
+
height?: string;
|
|
360
|
+
/** el-image props属性
|
|
361
|
+
* @see https://element-plus.org/zh-CN/component/image#image-attributes
|
|
362
|
+
*/
|
|
363
|
+
props: ImageProps;
|
|
364
|
+
}
|
|
365
|
+
/** (tags)标签列 */
|
|
366
|
+
interface TagsCol {
|
|
367
|
+
type: 'tags';
|
|
368
|
+
tagsType?: TagProps['type'];
|
|
369
|
+
cols: Record<string | number, string | [string, TagProps['type']]>;
|
|
370
|
+
}
|
|
371
|
+
/** (switch)开关列 */
|
|
372
|
+
interface SwitchCol {
|
|
373
|
+
type: 'switch';
|
|
374
|
+
cols?: [0 | false, 1 | true] | [0 | false, 1 | true, string, string];
|
|
375
|
+
/** el-switch props属性
|
|
376
|
+
* @see https://element-plus.org/zh-CN/component/switch#attributes
|
|
377
|
+
*/
|
|
378
|
+
props?: SwitchProps;
|
|
215
379
|
}
|
|
216
380
|
/** cate列 */
|
|
217
381
|
interface CateCol {
|
|
@@ -219,7 +383,7 @@ interface CateCol {
|
|
|
219
383
|
url?: string;
|
|
220
384
|
}
|
|
221
385
|
/** 表格列类型 */
|
|
222
|
-
type TableCol = BaseCol | ToolCol | StatusCol | CateCol;
|
|
386
|
+
type TableCol = BaseCol | ToolCol | StatusCol | CateCol | SwitchCol | TagsCol | ElTextCol | TextCol | ImgCol |UserCol |AnyCol;
|
|
223
387
|
|
|
224
388
|
/** 工具栏按钮 */
|
|
225
389
|
interface ToolItem {
|
|
@@ -233,23 +397,53 @@ interface ToolItem {
|
|
|
233
397
|
|
|
234
398
|
/** 搜索配置 */
|
|
235
399
|
interface SearchConfig {
|
|
236
|
-
|
|
400
|
+
labelWidth?: Number;
|
|
401
|
+
class?: string;
|
|
402
|
+
/** 列宽度
|
|
403
|
+
*@default "{ sm: 24, md: 12, lg: 8, xl: 6 }"
|
|
404
|
+
*/
|
|
405
|
+
span?: ColProps;
|
|
406
|
+
size?: 'small' | 'large' | 'default';
|
|
407
|
+
cols: (FormCol & { span?: ColProps })[];
|
|
237
408
|
}
|
|
238
|
-
|
|
409
|
+
/** api请求 */
|
|
410
|
+
type BatchActionUrl = string | ((data) => { code: number, msg: string })
|
|
239
411
|
/** 批量操作 */
|
|
240
412
|
interface BatchAction {
|
|
241
413
|
title: string;
|
|
242
|
-
action: 'del' |
|
|
414
|
+
action: 'del' | ((data) => void) | {
|
|
415
|
+
/** 批量操作附加数据 */
|
|
416
|
+
data: any
|
|
417
|
+
/** 批量操作api 已废弃 请使用url
|
|
418
|
+
* @deprecated
|
|
419
|
+
*/
|
|
420
|
+
api?: string
|
|
421
|
+
/** 批量操作api */
|
|
422
|
+
url?: string
|
|
423
|
+
};
|
|
243
424
|
confirm?: boolean;
|
|
244
425
|
}
|
|
245
426
|
interface adminTableFrom extends AdminFormInit {
|
|
246
427
|
title?: string | false;
|
|
428
|
+
updateTable?: boolean;
|
|
429
|
+
/** 表单数据格式化并加载结束监听 */
|
|
430
|
+
end?: (e: any, form: any) => void;
|
|
431
|
+
/** 表单数据变化监听 */
|
|
432
|
+
change?: (e: any, form: any) => void;
|
|
247
433
|
}
|
|
248
434
|
/** admin-table init */
|
|
249
435
|
export interface AdminTableInit {
|
|
250
436
|
url?: string;
|
|
251
|
-
data?: any[]
|
|
437
|
+
data?: Record<string, any>[] | ((data: {
|
|
438
|
+
page: number;
|
|
439
|
+
limit: number;
|
|
440
|
+
where?: Record<string, any>;
|
|
441
|
+
sort?: string;
|
|
442
|
+
}) => { data: Record<string, any>[], count: number });
|
|
252
443
|
title?: string | false;
|
|
444
|
+
/** 编辑后是否刷新表格 */
|
|
445
|
+
editUpdateTable?: boolean;
|
|
446
|
+
rowHeight?: number;
|
|
253
447
|
page?: boolean | number;
|
|
254
448
|
limit?: number;
|
|
255
449
|
pageSizes?: number[]
|
|
@@ -264,17 +458,21 @@ export interface AdminTableInit {
|
|
|
264
458
|
* @returns 返回false则取消请求 返回对象替换请求数据 返回字符串提示错误 不返回则正常请求
|
|
265
459
|
*
|
|
266
460
|
*/
|
|
267
|
-
apiBefore?: (url: string, data: Record<string, any>) => string |
|
|
461
|
+
apiBefore?: (url: string, data: Record<string, any>) => string | void | false | Record<string, any>;
|
|
268
462
|
/** api请求成功后监听
|
|
269
463
|
* @param type api操作类型
|
|
270
|
-
* @param data 参数1 uniApi|cellEdit|dialogSubmit
|
|
271
|
-
* @param data2 参数2 uniApi|dialogSubmit类型
|
|
464
|
+
* @param data 参数1 uniApi|cellEdit|dialogSubmit类型->准备提交的数据
|
|
465
|
+
* @param data2 参数2 uniApi|dialogSubmit类型 -> url cellEdit类型 ->当前行索引
|
|
272
466
|
*/
|
|
273
467
|
apiSuccess?: (type: string, data: any, data2?: any) => void;
|
|
274
468
|
tabs?: TabConfig[];
|
|
275
469
|
edit?: adminTableFrom;
|
|
470
|
+
detail?: adminTableFrom;
|
|
276
471
|
del?: DeleteConfig;
|
|
277
472
|
add?: adminTableFrom;
|
|
473
|
+
/** 表格列
|
|
474
|
+
* @see https://dmx-docs.netlify.app/admin/admin-table.html#_1-basecol-%E5%9F%BA%E7%A1%80%E5%88%97
|
|
475
|
+
*/
|
|
278
476
|
cols: TableCol[];
|
|
279
477
|
tools?: ToolItem[];
|
|
280
478
|
search?: SearchConfig;
|
package/types/global.d.ts
CHANGED
|
@@ -75,6 +75,39 @@ declare global {
|
|
|
75
75
|
/** admin-table组件 init */
|
|
76
76
|
const adminTableInit: (init: AdminTableInit) => AdminTableInit
|
|
77
77
|
const adminFormInit: (init: AdminFormInit) => AdminFormInit
|
|
78
|
+
/** 比较操作符类型 */
|
|
79
|
+
type ComparisonOperator =
|
|
80
|
+
| '=' // 等于
|
|
81
|
+
| '!=' // 不等于
|
|
82
|
+
| '>' // 大于
|
|
83
|
+
| '>=' // 大于等于
|
|
84
|
+
| '<' // 小于
|
|
85
|
+
| '<=' // 小于等于
|
|
86
|
+
| 'in' // 在数组中
|
|
87
|
+
| '!in' // 不在数组中
|
|
88
|
+
| 'contains' // 包含字符串
|
|
89
|
+
| 'startsWith' // 以...开头
|
|
90
|
+
| 'endsWith' // 以...结尾
|
|
91
|
+
| '>time' // 日期大于
|
|
92
|
+
| '<time'; // 日期小于
|
|
93
|
+
/**
|
|
94
|
+
* 数据搜索函数
|
|
95
|
+
*
|
|
96
|
+
* @param data - 数据数组
|
|
97
|
+
* @param option - 搜索选项
|
|
98
|
+
* - page: 页码
|
|
99
|
+
* - limit: 每页数量
|
|
100
|
+
* - where: 过滤条件
|
|
101
|
+
* - sort: 排序字段
|
|
102
|
+
* @param comparisonOperators - 比较运算符映射
|
|
103
|
+
*/
|
|
104
|
+
const dataSearch: (data: Record<string, any>[], option: {
|
|
105
|
+
page: number;
|
|
106
|
+
limit: number;
|
|
107
|
+
where?: Record<string, any>;
|
|
108
|
+
sort?: string;
|
|
109
|
+
},
|
|
110
|
+
comparisonOperators?: Record<string,((itemValue:any, targetValue:any)=>boolean) | ComparisonOperator>) => { data: Record<string, any>[], count: number }
|
|
78
111
|
}
|
|
79
112
|
declare module 'vue' {
|
|
80
113
|
interface ComponentCustomProperties {
|
|
@@ -598,7 +631,77 @@ interface _default {
|
|
|
598
631
|
locale: string;
|
|
599
632
|
threshold: unknown[];
|
|
600
633
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
601
|
-
AImage: import('vue').
|
|
634
|
+
AImage: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
|
|
635
|
+
src: StringConstructor;
|
|
636
|
+
width: {
|
|
637
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
638
|
+
};
|
|
639
|
+
height: {
|
|
640
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
641
|
+
};
|
|
642
|
+
background: {
|
|
643
|
+
type: StringConstructor;
|
|
644
|
+
default: string;
|
|
645
|
+
};
|
|
646
|
+
borderRadius: StringConstructor;
|
|
647
|
+
css: StringConstructor;
|
|
648
|
+
process: {
|
|
649
|
+
type: StringConstructor;
|
|
650
|
+
default: string;
|
|
651
|
+
};
|
|
652
|
+
lazy: {
|
|
653
|
+
type: BooleanConstructor;
|
|
654
|
+
default: boolean;
|
|
655
|
+
};
|
|
656
|
+
index: {
|
|
657
|
+
type: NumberConstructor;
|
|
658
|
+
default: number;
|
|
659
|
+
};
|
|
660
|
+
preview: {
|
|
661
|
+
type: (ArrayConstructor | BooleanConstructor)[];
|
|
662
|
+
default: boolean;
|
|
663
|
+
};
|
|
664
|
+
}>, {}, {
|
|
665
|
+
previewSrcList: never[];
|
|
666
|
+
}, {}, {
|
|
667
|
+
addUnit(value: string | number): string;
|
|
668
|
+
}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
669
|
+
src: StringConstructor;
|
|
670
|
+
width: {
|
|
671
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
672
|
+
};
|
|
673
|
+
height: {
|
|
674
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
675
|
+
};
|
|
676
|
+
background: {
|
|
677
|
+
type: StringConstructor;
|
|
678
|
+
default: string;
|
|
679
|
+
};
|
|
680
|
+
borderRadius: StringConstructor;
|
|
681
|
+
css: StringConstructor;
|
|
682
|
+
process: {
|
|
683
|
+
type: StringConstructor;
|
|
684
|
+
default: string;
|
|
685
|
+
};
|
|
686
|
+
lazy: {
|
|
687
|
+
type: BooleanConstructor;
|
|
688
|
+
default: boolean;
|
|
689
|
+
};
|
|
690
|
+
index: {
|
|
691
|
+
type: NumberConstructor;
|
|
692
|
+
default: number;
|
|
693
|
+
};
|
|
694
|
+
preview: {
|
|
695
|
+
type: (ArrayConstructor | BooleanConstructor)[];
|
|
696
|
+
default: boolean;
|
|
697
|
+
};
|
|
698
|
+
}>> & Readonly<{}>, {
|
|
699
|
+
background: string;
|
|
700
|
+
process: string;
|
|
701
|
+
lazy: boolean;
|
|
702
|
+
index: number;
|
|
703
|
+
preview: boolean | unknown[];
|
|
704
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
602
705
|
AImageText: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
|
|
603
706
|
modelValue: {
|
|
604
707
|
type: (ObjectConstructor | ArrayConstructor)[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function loadScript(
|
|
1
|
+
export default async function loadScript(config:any): void;
|