dmx-admin-ui 1.2.209 → 1.2.211
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-C6f8bO9F.js → editor-CDiKcSMv.js} +5 -4
- package/dist/{group-DR2cpzGt.js → group-DKRZjYMs.js} +2 -2
- package/dist/{group-table-DMq80RqE.js → group-table-BIzXBvK9.js} +2 -2
- package/dist/{group-tabs-rI1mWL1a.js → group-tabs-COC9D2v9.js} +2 -2
- package/dist/{group-tabs-plus-D4rEgJ4L.js → group-tabs-plus-Bqb5yZkJ.js} +2 -2
- package/dist/{index-DkuRo3lk.js → index-BhUELsnF.js} +3278 -3201
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/input-item-DpGcurEO.js +4 -0
- package/package.json +1 -1
- package/types/admin.d.ts +449 -0
- package/types/global.d.ts +144 -37
- package/types/plugins/cache.d.ts +8 -8
- package/types/plugins/copy.d.ts +2 -2
- package/types/plugins/index.d.ts +7 -7
- package/types/plugins/layer.d.ts +42 -42
- package/types/plugins/loadjs.d.ts +1 -1
- package/types/plugins/page.d.ts +9 -9
- package/types/plugins/req.d.ts +67 -67
- package/types/plugins/store.d.ts +4 -4
- package/types/plugins/util/areas.d.ts +2 -2
- package/types/plugins/util/csv.d.ts +5 -5
- package/types/plugins/util/index.d.ts +33 -33
- package/types/plugins/util/time.d.ts +6 -6
- package/dist/input-item-BQDqfsKu.js +0 -4
package/types/admin.d.ts
ADDED
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type InputProps,
|
|
3
|
+
type InputNumberProps,
|
|
4
|
+
type SelectPropsPublic,
|
|
5
|
+
type CascaderComponentProps,
|
|
6
|
+
type DatePickerPropsPublic,
|
|
7
|
+
type TimePickerDefaultPropsPublic,
|
|
8
|
+
type SwitchProps,
|
|
9
|
+
type CheckboxProps,
|
|
10
|
+
type RadioProps,
|
|
11
|
+
type SliderPropsPublic,
|
|
12
|
+
type ColorPickerProps,
|
|
13
|
+
type TransferProps,
|
|
14
|
+
type AutocompleteProps,
|
|
15
|
+
type ButtonProps,
|
|
16
|
+
type FormItemRule,
|
|
17
|
+
type TagProps,
|
|
18
|
+
type ImageProps,
|
|
19
|
+
} from 'element-plus'
|
|
20
|
+
import { Component, StyleValue } from 'vue'
|
|
21
|
+
/** 表单字段 */
|
|
22
|
+
interface ColField {
|
|
23
|
+
/** 字段名 */
|
|
24
|
+
field?: string;
|
|
25
|
+
/** 字段标题 */
|
|
26
|
+
title?: string | false;
|
|
27
|
+
/** title 别名 */
|
|
28
|
+
label?: string | false;
|
|
29
|
+
tab?: number | number[];
|
|
30
|
+
labelWidth?: string;
|
|
31
|
+
class?: string;
|
|
32
|
+
colClass?: string;
|
|
33
|
+
colWidth?: string;
|
|
34
|
+
slot?: string | true;
|
|
35
|
+
placeholder?: string;
|
|
36
|
+
clearable?: boolean;
|
|
37
|
+
info?: string;
|
|
38
|
+
required?: boolean;
|
|
39
|
+
width?: number;
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
/** 缺省默认值 */
|
|
42
|
+
value?: any;
|
|
43
|
+
rules?: FormItemRule | FormItemRule[];
|
|
44
|
+
change?: (e: {
|
|
45
|
+
data: any, input: {
|
|
46
|
+
onChange: (e: any) => void;
|
|
47
|
+
setValue: (e: any) => void;
|
|
48
|
+
relatedUpdate: (field: any, e: any) => void;
|
|
49
|
+
prop: Record<string, any>;
|
|
50
|
+
}
|
|
51
|
+
}) => void;
|
|
52
|
+
changeField?: string[];
|
|
53
|
+
format?: Function
|
|
54
|
+
}
|
|
55
|
+
type ColsTypes = 'hidden' | 'text' | 'input-select' | 'radio-button' | 'editor' | 'tags' | 'map' | 'pickerMap' | 'region' | 'url' | 'img' | 'image' | 'file' | 'video' | 'audio'
|
|
56
|
+
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';
|
|
57
|
+
|
|
58
|
+
interface AnyColField extends ColField {
|
|
59
|
+
type: ColsTypes;
|
|
60
|
+
}
|
|
61
|
+
interface OtherColField extends ColField {
|
|
62
|
+
/** 用户自定义类型 */
|
|
63
|
+
type: Omit<string, KnownTypes>;
|
|
64
|
+
}
|
|
65
|
+
interface DiyField extends ColField {
|
|
66
|
+
/** 自定义组件 */
|
|
67
|
+
component: string | Component
|
|
68
|
+
}
|
|
69
|
+
interface inputAutoField extends ColField {
|
|
70
|
+
type: 'input-auto';
|
|
71
|
+
/** input-auto 配置信息 */
|
|
72
|
+
list?: Record<string | number, string>;
|
|
73
|
+
/** el-autocomplete props属性
|
|
74
|
+
* @see https://element-plus.org/zh-CN/component/autocomplete#attributes
|
|
75
|
+
*/
|
|
76
|
+
props?: AutocompleteProps;
|
|
77
|
+
|
|
78
|
+
}
|
|
79
|
+
interface inputBtnField extends ColField {
|
|
80
|
+
type: 'input-button'
|
|
81
|
+
/** input-button Props */
|
|
82
|
+
props: {
|
|
83
|
+
/** el-input props属性
|
|
84
|
+
* @see https://element-plus.org/zh-CN/component/input#attributes
|
|
85
|
+
*/
|
|
86
|
+
props?: InputProps;
|
|
87
|
+
btn: {
|
|
88
|
+
icon?: string
|
|
89
|
+
text: string
|
|
90
|
+
click: (value: any) => any | Promise<any>
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
interface ImgsField extends ColField {
|
|
95
|
+
type: 'imgs' | 'images';
|
|
96
|
+
limit?: number;
|
|
97
|
+
tips?: string;
|
|
98
|
+
cateId?: Number;
|
|
99
|
+
props?: Record<string, any>;
|
|
100
|
+
}
|
|
101
|
+
interface GroupTableField extends ColField {
|
|
102
|
+
type: 'group-table' | 'group';
|
|
103
|
+
limit?: number;
|
|
104
|
+
cols?: (FormCol & { inputWidth?: string })[];
|
|
105
|
+
props?: Record<string, any>;
|
|
106
|
+
}
|
|
107
|
+
interface GroupTabsField extends ColField {
|
|
108
|
+
type: 'group-tabs' | 'group-tabs-plus';
|
|
109
|
+
limit?: number;
|
|
110
|
+
tabs?: Function | Record<string, any>;
|
|
111
|
+
cols?: (FormCol & { inputWidth?: string })[] | (FormCol & { inputWidth?: string });
|
|
112
|
+
props?: Record<string, any>;
|
|
113
|
+
}
|
|
114
|
+
interface InputField extends ColField {
|
|
115
|
+
type?: 'input';
|
|
116
|
+
/** el-input props属性
|
|
117
|
+
* @see https://element-plus.org/zh-CN/component/input#attributes
|
|
118
|
+
*/
|
|
119
|
+
props?: InputProps
|
|
120
|
+
}
|
|
121
|
+
interface SelectField extends ColField {
|
|
122
|
+
type: 'select';
|
|
123
|
+
/** 配置信息 */
|
|
124
|
+
cols?: { value: number | string | boolean, label: string }[] | Record<string, number | string | boolean> | string[];
|
|
125
|
+
/** api接口 或者配置信息
|
|
126
|
+
* 字符串模式 只在admin-table下的表单有效
|
|
127
|
+
* 数组或对象模式 url是兼容处理 请使用cols配置
|
|
128
|
+
*/
|
|
129
|
+
url?: { value: number | string | boolean, label: string }[] | Record<string, number | string | boolean> | string[] | string;
|
|
130
|
+
/** el-select props属性
|
|
131
|
+
* @see https://element-plus.org/zh-CN/component/select#select-attributes
|
|
132
|
+
*/
|
|
133
|
+
props?: SelectPropsPublic
|
|
134
|
+
}
|
|
135
|
+
interface SliderField extends ColField {
|
|
136
|
+
type: 'slider';
|
|
137
|
+
/** el-slider props属性
|
|
138
|
+
* @see https://element-plus.org/zh-CN/component/slider#%E5%B1%9E%E6%80%A7
|
|
139
|
+
*/
|
|
140
|
+
props?: SliderPropsPublic
|
|
141
|
+
}
|
|
142
|
+
interface TextareaField extends ColField {
|
|
143
|
+
type: 'textarea';
|
|
144
|
+
/** el-input props属性
|
|
145
|
+
* @see https://element-plus.org/zh-CN/component/input#attributes
|
|
146
|
+
*/
|
|
147
|
+
props?: InputProps
|
|
148
|
+
}
|
|
149
|
+
interface PassField extends ColField {
|
|
150
|
+
type: 'password';
|
|
151
|
+
/** el-input props属性
|
|
152
|
+
* @see https://element-plus.org/zh-CN/component/input#attributes
|
|
153
|
+
*/
|
|
154
|
+
props?: InputProps
|
|
155
|
+
}
|
|
156
|
+
interface SwitchField extends ColField {
|
|
157
|
+
type: 'switch';
|
|
158
|
+
cols?: [0 | false, 1 | true] | [0 | false, 1 | true, string, string];
|
|
159
|
+
/** el-switch props属性
|
|
160
|
+
* @see https://element-plus.org/zh-CN/component/switch#attributes
|
|
161
|
+
*/
|
|
162
|
+
props?: SwitchProps
|
|
163
|
+
}
|
|
164
|
+
interface CheckboxField extends ColField {
|
|
165
|
+
type: 'checkbox';
|
|
166
|
+
/** el-checkbox props属性
|
|
167
|
+
* @see https://element-plus.org/zh-CN/component/checkbox#checkbox-attributes
|
|
168
|
+
*/
|
|
169
|
+
props?: CheckboxProps;
|
|
170
|
+
}
|
|
171
|
+
interface RadioField extends ColField {
|
|
172
|
+
type: 'radio';
|
|
173
|
+
/** el-radio props属性
|
|
174
|
+
* @see https://element-plus.org/zh-CN/component/radio#radio-attributes
|
|
175
|
+
*/
|
|
176
|
+
props?: RadioProps;
|
|
177
|
+
/** 配置信息 */
|
|
178
|
+
cols?: { value: number | string | boolean, label: string }[] | Record<string, number | string | boolean> | string[];
|
|
179
|
+
}
|
|
180
|
+
interface ColorField extends ColField {
|
|
181
|
+
type: 'color';
|
|
182
|
+
/** el-color-picker props属性
|
|
183
|
+
* @see https://element-plus.org/zh-CN/component/color-picker#attributes
|
|
184
|
+
*/
|
|
185
|
+
props?: ColorPickerProps;
|
|
186
|
+
}
|
|
187
|
+
interface NumberField extends ColField {
|
|
188
|
+
type: 'number';
|
|
189
|
+
/** el-input-number props属性
|
|
190
|
+
* @see https://element-plus.org/zh-CN/component/input-number#attributes
|
|
191
|
+
*/
|
|
192
|
+
props?: InputNumberProps;
|
|
193
|
+
}
|
|
194
|
+
interface DateField extends ColField {
|
|
195
|
+
type: 'datetimes' | 'dates' | 'datetime' | 'date';
|
|
196
|
+
/** el-date-picker props属性
|
|
197
|
+
* @see https://element-plus.org/zh-CN/component/date-picker#%E5%B1%9E%E6%80%A7
|
|
198
|
+
*/
|
|
199
|
+
props?: DatePickerPropsPublic;
|
|
200
|
+
}
|
|
201
|
+
interface TimeField extends ColField {
|
|
202
|
+
type: 'time' | 'times';
|
|
203
|
+
/** el-time-picker props属性
|
|
204
|
+
* @see https://element-plus.org/zh-CN/component/time-picker#attributes
|
|
205
|
+
*/
|
|
206
|
+
props?: TimePickerDefaultPropsPublic;
|
|
207
|
+
}
|
|
208
|
+
interface CascaderField extends ColField {
|
|
209
|
+
type: 'selects';
|
|
210
|
+
/** el-cascader props属性
|
|
211
|
+
* @see https://element-plus.org/zh-CN/component/cascader#cascader-attributes
|
|
212
|
+
*/
|
|
213
|
+
props?: CascaderComponentProps;
|
|
214
|
+
/** api接口 或者配置信息
|
|
215
|
+
* @example
|
|
216
|
+
* url: 'api/goods_cate'
|
|
217
|
+
* url: ['分类1', '分类2']
|
|
218
|
+
* url: [{title:'分类1',id:1},{title:'分类2',id:2},{title:'分类1-1',id:3,pid:1}]
|
|
219
|
+
* url: {cate1: '分类1', cate2: '分类1' }
|
|
220
|
+
*/
|
|
221
|
+
url: string | string[] | { title: string, id: number | string, pid?: number | string }[] | { [key: string]: string };
|
|
222
|
+
}
|
|
223
|
+
export type FormCol = CascaderField | PassField | ImgsField | GroupTableField | NumberField | SelectField | SliderField | InputField | TextareaField | DateField | TimeField | SwitchField | ColorField | RadioField | CheckboxField | GroupTabsField | inputBtnField | inputAutoField | AnyColField | DiyField | OtherColField;
|
|
224
|
+
export interface AdminFormInit {
|
|
225
|
+
confirmButton?: Record<string, any>;
|
|
226
|
+
url?: string | Function;
|
|
227
|
+
/** 表单宽度 字符串
|
|
228
|
+
* @example
|
|
229
|
+
* '50%'
|
|
230
|
+
* '500px'
|
|
231
|
+
*
|
|
232
|
+
*/
|
|
233
|
+
width?: string;
|
|
234
|
+
/** 数据未改变时是否提示 默认true */
|
|
235
|
+
noChangeTip?: boolean;
|
|
236
|
+
beforeSubmit?: (data: Record<string, any>) => void;
|
|
237
|
+
/** 表单字段列表 */
|
|
238
|
+
cols?: FormCol[];
|
|
239
|
+
colWidth?: string
|
|
240
|
+
colClass?: string
|
|
241
|
+
buttonFixed?: true
|
|
242
|
+
buttonText?: string
|
|
243
|
+
tabs?: string[];
|
|
244
|
+
btns?: {
|
|
245
|
+
title: string;
|
|
246
|
+
type?: ButtonType;
|
|
247
|
+
action: Function;
|
|
248
|
+
confirm?: boolean;
|
|
249
|
+
|
|
250
|
+
}[]
|
|
251
|
+
}
|
|
252
|
+
export type ButtonType = ButtonProps['type']
|
|
253
|
+
/** 删除配置 */
|
|
254
|
+
interface DeleteConfig {
|
|
255
|
+
url: string | ((e: Record<string, any>) => void);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/** 标签页配置 */
|
|
259
|
+
interface TabConfig {
|
|
260
|
+
title: string;
|
|
261
|
+
where?: Record<string, any>;
|
|
262
|
+
}
|
|
263
|
+
/** 表格列基础类型 */
|
|
264
|
+
interface BaseCol {
|
|
265
|
+
/** 字段名 */
|
|
266
|
+
field?: string;
|
|
267
|
+
/** 列标题 */
|
|
268
|
+
title?: string;
|
|
269
|
+
/** 列子标题 */
|
|
270
|
+
subTitle?: string;
|
|
271
|
+
slot?: string | true;
|
|
272
|
+
width?: number;
|
|
273
|
+
edit?: boolean;
|
|
274
|
+
/**
|
|
275
|
+
* 列点击事件
|
|
276
|
+
* @param row - 当前行的数据对象
|
|
277
|
+
*/
|
|
278
|
+
on?: (row: Record<string, any>) => void;
|
|
279
|
+
sort?: boolean;
|
|
280
|
+
color?: string;
|
|
281
|
+
class?: string;
|
|
282
|
+
format?: (value: any) => any;
|
|
283
|
+
/** tabs索引 */
|
|
284
|
+
tab?: number | number[];
|
|
285
|
+
align?: 'left' | 'center' | 'right';
|
|
286
|
+
/** 缺省默认值 */
|
|
287
|
+
default?: string | number | boolean;
|
|
288
|
+
}
|
|
289
|
+
/** 基础列 */
|
|
290
|
+
interface AnyCol {
|
|
291
|
+
/** 列类型 */
|
|
292
|
+
type?: 'index' | 'region' | 'time' | 'times' | 'link' | 'img-info' | 'text' | 'imgs' | 'img' | 'checkbox';
|
|
293
|
+
}
|
|
294
|
+
/** 操作按钮 */
|
|
295
|
+
interface ToolButton {
|
|
296
|
+
title?: string;
|
|
297
|
+
action: 'edit' | 'del' | 'detail' | ((row: Record<string, any>, index: number) => void);
|
|
298
|
+
/** tabs索引 */
|
|
299
|
+
tab?: number | number[];
|
|
300
|
+
/** 是否显示确认框 */
|
|
301
|
+
confirm?: boolean;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/** 操作栏列 */
|
|
305
|
+
interface ToolCol {
|
|
306
|
+
type: 'tool';
|
|
307
|
+
before?: (row: Record<string, any>) => void;
|
|
308
|
+
/** 工具栏按钮 */
|
|
309
|
+
btn: ToolButton[];
|
|
310
|
+
|
|
311
|
+
}
|
|
312
|
+
type CSSColor =
|
|
313
|
+
| `#${string}` // 十六进制
|
|
314
|
+
| `rgb(${number}, ${number}, ${number})`
|
|
315
|
+
| `rgba(${number}, ${number}, ${number}, ${number})`
|
|
316
|
+
| `hsl(${number}, ${number}%, ${number}%)`
|
|
317
|
+
| `hsla(${number}, ${number}%, ${number}%, ${number})`
|
|
318
|
+
| `var(--${string})`
|
|
319
|
+
;
|
|
320
|
+
/** 状态列 */
|
|
321
|
+
interface StatusCol {
|
|
322
|
+
type: 'status';
|
|
323
|
+
cols?: { [key: number | string]: [string, '' | 'primary' | 'on' | 'info' | 'end' | 'info' | 'warning' | 'danger' | 'success' | CSSColor] };
|
|
324
|
+
}
|
|
325
|
+
/** (text)文本列 */
|
|
326
|
+
interface TextCol {
|
|
327
|
+
type: 'text';
|
|
328
|
+
/** 文本样式 */
|
|
329
|
+
textClass?: string;
|
|
330
|
+
cols?: Record<string | number, string>;
|
|
331
|
+
}
|
|
332
|
+
/** 图片列 */
|
|
333
|
+
interface ImgCol {
|
|
334
|
+
type: 'img' | 'imgs' | 'image' | 'images';
|
|
335
|
+
/** 图片宽度 图片类型使用这个参数 避免和列宽度冲突,可用此值设置图片宽度 */
|
|
336
|
+
imgWidth?: string;
|
|
337
|
+
/**
|
|
338
|
+
* 图片高度 请使用 imgWidth
|
|
339
|
+
* @deprecated
|
|
340
|
+
* */
|
|
341
|
+
width?: string;
|
|
342
|
+
height?: string;
|
|
343
|
+
/** el-image props属性
|
|
344
|
+
* @see https://element-plus.org/zh-CN/component/image#image-attributes
|
|
345
|
+
*/
|
|
346
|
+
props: ImageProps;
|
|
347
|
+
}
|
|
348
|
+
/** (tags)标签列 */
|
|
349
|
+
interface TagsCol {
|
|
350
|
+
type: 'tags';
|
|
351
|
+
tagsType?: TagProps['type'];
|
|
352
|
+
cols: Record<string | number, string | [string, TagProps['type']]>;
|
|
353
|
+
}
|
|
354
|
+
/** (switch)开关列 */
|
|
355
|
+
interface SwitchCol {
|
|
356
|
+
type: 'switch';
|
|
357
|
+
cols?: [0 | false, 1 | true] | [0 | false, 1 | true, string, string];
|
|
358
|
+
/** el-switch props属性
|
|
359
|
+
* @see https://element-plus.org/zh-CN/component/switch#attributes
|
|
360
|
+
*/
|
|
361
|
+
props?: SwitchProps;
|
|
362
|
+
}
|
|
363
|
+
/** cate列 */
|
|
364
|
+
interface CateCol {
|
|
365
|
+
type: 'cate';
|
|
366
|
+
url?: string;
|
|
367
|
+
}
|
|
368
|
+
/** 表格列类型 */
|
|
369
|
+
type TableCol = BaseCol | ToolCol | StatusCol | CateCol | SwitchCol | TagsCol | TextCol | ImgCol | AnyCol;
|
|
370
|
+
|
|
371
|
+
/** 工具栏按钮 */
|
|
372
|
+
interface ToolItem {
|
|
373
|
+
title?: string;
|
|
374
|
+
icon?: string;
|
|
375
|
+
type?: ButtonType;
|
|
376
|
+
action?: 'add' | Function;
|
|
377
|
+
confirm?: boolean;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
/** 搜索配置 */
|
|
382
|
+
interface SearchConfig {
|
|
383
|
+
cols: FormCol[];
|
|
384
|
+
}
|
|
385
|
+
/** api请求 */
|
|
386
|
+
type BatchActionUrl = string | ((data) => { code: number, msg: string })
|
|
387
|
+
/** 批量操作 */
|
|
388
|
+
interface BatchAction {
|
|
389
|
+
title: string;
|
|
390
|
+
action: 'del' | ((data) => void) | {
|
|
391
|
+
/** 批量操作附加数据 */
|
|
392
|
+
data: any
|
|
393
|
+
/** 批量操作api 已废弃 请使用url
|
|
394
|
+
* @deprecated
|
|
395
|
+
*/
|
|
396
|
+
api?: string
|
|
397
|
+
/** 批量操作api */
|
|
398
|
+
url?: string
|
|
399
|
+
};
|
|
400
|
+
confirm?: boolean;
|
|
401
|
+
}
|
|
402
|
+
interface adminTableFrom extends AdminFormInit {
|
|
403
|
+
title?: string | false;
|
|
404
|
+
}
|
|
405
|
+
/** admin-table init */
|
|
406
|
+
export interface AdminTableInit {
|
|
407
|
+
url?: string;
|
|
408
|
+
data?: Record<string, any>[] | ((data: {
|
|
409
|
+
page: number;
|
|
410
|
+
limit: number;
|
|
411
|
+
where?: Record<string, any>;
|
|
412
|
+
sort?: string;
|
|
413
|
+
}) => { data: Record<string, any>[], count: number });
|
|
414
|
+
title?: string | false;
|
|
415
|
+
rowHeight?: number;
|
|
416
|
+
page?: boolean | number;
|
|
417
|
+
limit?: number;
|
|
418
|
+
pageSizes?: number[]
|
|
419
|
+
pk?: string
|
|
420
|
+
/** 操作缓存标识 */
|
|
421
|
+
name?: string;
|
|
422
|
+
/** 是否树形结构 */
|
|
423
|
+
tree?: boolean;
|
|
424
|
+
/** api请求前处理 包含表格里的删除 修改 添加 等APi请求
|
|
425
|
+
* @param url 请求url
|
|
426
|
+
* @param data 请求参数
|
|
427
|
+
* @returns 返回false则取消请求 返回对象替换请求数据 返回字符串提示错误 不返回则正常请求
|
|
428
|
+
*
|
|
429
|
+
*/
|
|
430
|
+
apiBefore?: (url: string, data: Record<string, any>) => string | void | false | Record<string, any>;
|
|
431
|
+
/** api请求成功后监听
|
|
432
|
+
* @param type api操作类型
|
|
433
|
+
* @param data 参数1 uniApi|cellEdit|dialogSubmit类型->准备提交的数据
|
|
434
|
+
* @param data2 参数2 uniApi|dialogSubmit类型 -> url cellEdit类型 ->当前行索引
|
|
435
|
+
*/
|
|
436
|
+
apiSuccess?: (type: string, data: any, data2?: any) => void;
|
|
437
|
+
tabs?: TabConfig[];
|
|
438
|
+
edit?: adminTableFrom;
|
|
439
|
+
detail?: adminTableFrom;
|
|
440
|
+
del?: DeleteConfig;
|
|
441
|
+
add?: adminTableFrom;
|
|
442
|
+
/** 表格列
|
|
443
|
+
* @see https://dmx-docs.netlify.app/admin/admin-table.html#_1-basecol-%E5%9F%BA%E7%A1%80%E5%88%97
|
|
444
|
+
*/
|
|
445
|
+
cols: TableCol[];
|
|
446
|
+
tools?: ToolItem[];
|
|
447
|
+
search?: SearchConfig;
|
|
448
|
+
batch?: BatchAction[];
|
|
449
|
+
}
|
package/types/global.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ const reqs = new req({})
|
|
|
8
8
|
const pages = new page({})
|
|
9
9
|
import np from "number-precision";
|
|
10
10
|
import { dayjs as dayjss } from 'element-plus'
|
|
11
|
+
import { AdminTableInit, AdminFormInit } from './admin';
|
|
11
12
|
export { };
|
|
12
13
|
interface Config {
|
|
13
14
|
apis: {
|
|
@@ -63,27 +64,63 @@ declare global {
|
|
|
63
64
|
const $prompt: typeof layer.prompt
|
|
64
65
|
const $theme: { [key: string]: string }
|
|
65
66
|
const $store: { [key: string]: string }
|
|
66
|
-
const $cache:typeof cache
|
|
67
|
+
const $cache: typeof cache
|
|
67
68
|
const $config: Config
|
|
68
69
|
const dayjs: typeof dayjss
|
|
69
70
|
const $langs: { [key: string]: string }
|
|
70
71
|
const $fileUrl: (url: string) => string
|
|
71
|
-
const loadjs:typeof load
|
|
72
|
+
const loadjs: typeof load
|
|
72
73
|
/** [宏]导入指定文件下的vue组件 从项目根目录开始 */
|
|
73
|
-
const $macroComponents
|
|
74
|
+
const $macroComponents: (dir: string) => {}
|
|
75
|
+
/** admin-table组件 init */
|
|
76
|
+
const adminTableInit: (init: AdminTableInit) => AdminTableInit
|
|
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 }
|
|
74
111
|
}
|
|
75
112
|
declare module 'vue' {
|
|
76
113
|
interface ComponentCustomProperties {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
114
|
+
$root: InstanceType<typeof root>
|
|
115
|
+
$config: typeof config
|
|
116
|
+
$go: typeof pages
|
|
117
|
+
}
|
|
81
118
|
}
|
|
82
119
|
|
|
83
|
-
import {ElImage} from "element-plus";
|
|
84
|
-
interface
|
|
120
|
+
import { ElImage } from "element-plus";
|
|
121
|
+
interface _default {
|
|
85
122
|
AdminTable: {
|
|
86
|
-
new
|
|
123
|
+
new(...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<globalThis.ExtractPropTypes<{
|
|
87
124
|
init: ObjectConstructor;
|
|
88
125
|
}>> & Readonly<{
|
|
89
126
|
onChange?: (...args: any[]) => any;
|
|
@@ -594,7 +631,77 @@ interface _default {
|
|
|
594
631
|
locale: string;
|
|
595
632
|
threshold: unknown[];
|
|
596
633
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
597
|
-
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>;
|
|
598
705
|
AImageText: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
|
|
599
706
|
modelValue: {
|
|
600
707
|
type: (ObjectConstructor | ArrayConstructor)[];
|
|
@@ -732,7 +839,7 @@ interface _default {
|
|
|
732
839
|
status: string;
|
|
733
840
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
734
841
|
ADraggable: {
|
|
735
|
-
new
|
|
842
|
+
new(...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<globalThis.ExtractPropTypes<{
|
|
736
843
|
options: ObjectConstructor;
|
|
737
844
|
list: {
|
|
738
845
|
type: ArrayConstructor;
|
|
@@ -993,7 +1100,7 @@ interface _default {
|
|
|
993
1100
|
};
|
|
994
1101
|
});
|
|
995
1102
|
AChart: {
|
|
996
|
-
new
|
|
1103
|
+
new(...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<globalThis.ExtractPropTypes<{
|
|
997
1104
|
init: {
|
|
998
1105
|
type: ObjectConstructor;
|
|
999
1106
|
default: () => {};
|
|
@@ -1110,28 +1217,28 @@ interface _default {
|
|
|
1110
1217
|
}
|
|
1111
1218
|
declare module 'vue' {
|
|
1112
1219
|
interface GlobalComponents {
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
}
|
|
1220
|
+
AdminTable: _default['AdminTable']
|
|
1221
|
+
AdminForm: _default['AdminForm']
|
|
1222
|
+
DataApi: _default['DataApi']
|
|
1223
|
+
ASearch: _default['ASearch']
|
|
1224
|
+
AInputs: _default['AInputs']
|
|
1225
|
+
InputButton: _default['InputButton']
|
|
1226
|
+
ASearchBox: _default['ASearchBox']
|
|
1227
|
+
ATip: _default['ATip']
|
|
1228
|
+
ATextEdit: _default['ATextEdit']
|
|
1229
|
+
ACateText: _default['ACateText']
|
|
1230
|
+
ACascader: _default['ACascader']
|
|
1231
|
+
ATags: _default['ATags']
|
|
1232
|
+
ATime: _default['ATime']
|
|
1233
|
+
AImage: _default['AImage'] & typeof ElImage
|
|
1234
|
+
AImageText: _default['AImageText']
|
|
1235
|
+
AColorPicker: _default['AColorPicker']
|
|
1236
|
+
ARegionPicker: _default['ARegionPicker']
|
|
1237
|
+
ARegionText: _default['ARegionText']
|
|
1238
|
+
ARegionMap: _default['ARegionMap']
|
|
1239
|
+
ATextStatus: _default['ATextStatus']
|
|
1240
|
+
ADraggable: _default['ADraggable']
|
|
1241
|
+
AChart: _default['AChart']
|
|
1242
|
+
AEditor: _default['AEditor']
|
|
1243
|
+
}
|
|
1137
1244
|
}
|
package/types/plugins/cache.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
list: () => any[];
|
|
3
|
-
set: (key: any, value: any, time?: number | string) => void;
|
|
4
|
-
remove: (key: any) => void;
|
|
5
|
-
clear: () => void;
|
|
6
|
-
get: (key: any, type?: boolean) => any;
|
|
7
|
-
};
|
|
8
|
-
export default _default;
|
|
1
|
+
declare const _default: {
|
|
2
|
+
list: () => any[];
|
|
3
|
+
set: (key: any, value: any, time?: number | string) => void;
|
|
4
|
+
remove: (key: any) => void;
|
|
5
|
+
clear: () => void;
|
|
6
|
+
get: (key: any, type?: boolean) => any;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|