cc1-form 1.1.23 → 1.1.24
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/cc1-form.js +920 -879
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/com/form/column.vue.d.ts +92 -11
- package/dist/components/TCurd/index.d.ts +60 -7
- package/dist/components/TCurd/index.vue.d.ts +280 -54
- package/dist/components/TCurd/indexType.d.ts +69 -39
- package/dist/components/TCurd/tableColumn.vue.d.ts +4 -0
- package/dist/utils/TFormConfig.d.ts +10 -0
- package/dist/utils/TFormI18n.d.ts +2 -0
- package/dist/utils/TSys.d.ts +2 -1
- package/package.json +1 -1
package/dist/cc1-form.js
CHANGED
|
@@ -1,5 +1,162 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ElMessage as ue, ElLoading as ce, ElForm as Q, ElFormItem as J, ElInput as q, ElSwitch as _, ElSelect as W, ElOption as P, ElTreeSelect as ae, ElDatePicker as ee, ElDialog as Y, ElButton as F, ElTableColumn as Z, ElDropdown as fe, ElDropdownMenu as me, ElDropdownItem as X, ElTable as pe, ElPagination as he } from "element-plus";
|
|
2
|
+
import { defineComponent as N, reactive as te, onMounted as ne, resolveComponent as H, createElementBlock as w, createCommentVNode as v, openBlock as m, renderSlot as k, createElementVNode as $, createVNode as V, withCtx as h, createTextVNode as E, Fragment as D, renderList as M, createBlock as b, normalizeClass as T, normalizeStyle as ie, ref as K, nextTick as be, unref as o, mergeProps as C, toHandlers as O, resolveDynamicComponent as G, toDisplayString as x, getCurrentInstance as ye, createSlots as se, withKeys as ge, resolveDirective as we, withDirectives as ke, normalizeProps as ve, guardReactiveProps as Ce } from "vue";
|
|
3
|
+
class U {
|
|
4
|
+
/**
|
|
5
|
+
* Vue Router 实例,需在应用初始化时赋值
|
|
6
|
+
*/
|
|
7
|
+
static router;
|
|
8
|
+
/**
|
|
9
|
+
* 原始路由列表
|
|
10
|
+
*/
|
|
11
|
+
static routes;
|
|
12
|
+
/**
|
|
13
|
+
* 获取路由路径
|
|
14
|
+
*/
|
|
15
|
+
static getRouterPath = () => this.router.currentRoute.value.path;
|
|
16
|
+
static EDialog = {
|
|
17
|
+
Insert: "Insert",
|
|
18
|
+
Update: "Update",
|
|
19
|
+
View: "View",
|
|
20
|
+
Remove: "Remove"
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* 判断是否是函数,是就执行返回,否则返回本身
|
|
24
|
+
* @param fun 函数
|
|
25
|
+
* @param data 数据
|
|
26
|
+
* @returns 是否显示
|
|
27
|
+
*/
|
|
28
|
+
static isFun = (s, ...r) => Array.isArray(s) ? s.some((l) => typeof l == "function" ? l(...r) : l) : typeof s == "function" ? s(...r) : s;
|
|
29
|
+
/**
|
|
30
|
+
* 获取路由参数,自动获取query、params中的参数, 哪个有就返回哪个
|
|
31
|
+
*/
|
|
32
|
+
static getRouterParams = () => {
|
|
33
|
+
const s = this.router.currentRoute.value.query || {}, r = this.router.currentRoute.value.params || {};
|
|
34
|
+
return Object.keys(s).length ? s : Object.keys(r).length ? r : {};
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* 模块赋值
|
|
38
|
+
*/
|
|
39
|
+
static moduleObj = {};
|
|
40
|
+
/**
|
|
41
|
+
* 加载模块
|
|
42
|
+
* @param module
|
|
43
|
+
*/
|
|
44
|
+
static loadModule = async (s) => {
|
|
45
|
+
if (!U.moduleObj[s])
|
|
46
|
+
throw new Error(`模块${s}未加载,请赋值如:TSys.moduleObj = { ${s}: ()=>import('${s}') }`);
|
|
47
|
+
const r = await U.moduleObj[s]();
|
|
48
|
+
return r.default ?? r;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* 提示信息对象管理
|
|
52
|
+
*/
|
|
53
|
+
static tipMessages = {};
|
|
54
|
+
/**
|
|
55
|
+
* 提示信息间隔时间
|
|
56
|
+
*/
|
|
57
|
+
static tipMessagesGap = 500;
|
|
58
|
+
/**
|
|
59
|
+
* 显示提示信息
|
|
60
|
+
* @param content 消息内容
|
|
61
|
+
* @param type 消息类型
|
|
62
|
+
* @param options 其他选项
|
|
63
|
+
*/
|
|
64
|
+
static showMessage(s, r, l = {}) {
|
|
65
|
+
const n = Date.now();
|
|
66
|
+
if (!this.tipMessages[s] || n - this.tipMessages[s] > this.tipMessagesGap) {
|
|
67
|
+
this.tipMessages[s] = n;
|
|
68
|
+
const e = Object.assign(
|
|
69
|
+
{
|
|
70
|
+
message: s,
|
|
71
|
+
type: r
|
|
72
|
+
},
|
|
73
|
+
l
|
|
74
|
+
);
|
|
75
|
+
ue(e), setTimeout(() => {
|
|
76
|
+
delete this.tipMessages[s];
|
|
77
|
+
}, this.tipMessagesGap);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* 失败提示
|
|
82
|
+
* @param content
|
|
83
|
+
* @param options
|
|
84
|
+
*/
|
|
85
|
+
static fail = (s, r = {}) => {
|
|
86
|
+
this.showMessage(s, "error", r);
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* 成功提示
|
|
90
|
+
* @param content
|
|
91
|
+
* @param options
|
|
92
|
+
*/
|
|
93
|
+
static success = (s, r = {}) => {
|
|
94
|
+
this.showMessage(s, "success", r);
|
|
95
|
+
};
|
|
96
|
+
static loadingObj = null;
|
|
97
|
+
static loadingTimer = null;
|
|
98
|
+
/**
|
|
99
|
+
* 加载中
|
|
100
|
+
* @param show
|
|
101
|
+
* @param text
|
|
102
|
+
*/
|
|
103
|
+
static loading = (s = !0, r = "Loading...") => {
|
|
104
|
+
Timer.un(this.loadingTimer), this.loadingTimer = Timer.once(() => {
|
|
105
|
+
s ? this.loadingObj = ce.service({
|
|
106
|
+
lock: !0,
|
|
107
|
+
text: r,
|
|
108
|
+
background: "rgba(0, 0, 0, 0.3)"
|
|
109
|
+
}) : this.loadingObj && (this.loadingObj.close(), this.loadingObj = null);
|
|
110
|
+
}, 50);
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* 使用window.open打开新地址
|
|
114
|
+
* @param url 地址
|
|
115
|
+
* @param isCenter 是否居中
|
|
116
|
+
*/
|
|
117
|
+
static openUrl = (s, r = !0) => {
|
|
118
|
+
if (r) {
|
|
119
|
+
let l = screen.width / 2 - 500, n = screen.height / 2 - 800 / 2 - 30;
|
|
120
|
+
window.open(
|
|
121
|
+
s,
|
|
122
|
+
"_blank",
|
|
123
|
+
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + n + ", left=" + l
|
|
124
|
+
);
|
|
125
|
+
} else
|
|
126
|
+
window.open(
|
|
127
|
+
s,
|
|
128
|
+
"DescriptiveWindowName" + StrUtil.getId(),
|
|
129
|
+
"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0"
|
|
130
|
+
);
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* 根据dom id截图并返回图片数据
|
|
134
|
+
* @param param
|
|
135
|
+
* @returns
|
|
136
|
+
*/
|
|
137
|
+
static getImgPic = (s) => new Promise(async (r, l) => {
|
|
138
|
+
let n = document.getElementById(s.id);
|
|
139
|
+
const e = await U.loadModule("html2canvas");
|
|
140
|
+
try {
|
|
141
|
+
e(n, {
|
|
142
|
+
logging: !1,
|
|
143
|
+
allowTaint: !0,
|
|
144
|
+
scale: window.devicePixelRatio,
|
|
145
|
+
width: s.windowWidth,
|
|
146
|
+
height: s.windowHeight,
|
|
147
|
+
windowWidth: s.windowWidth,
|
|
148
|
+
windowHeight: s.windowHeight,
|
|
149
|
+
useCORS: !0,
|
|
150
|
+
backgroundColor: "#ffffff00"
|
|
151
|
+
}).then(function(a) {
|
|
152
|
+
let u = a.toDataURL("image/png");
|
|
153
|
+
r(u);
|
|
154
|
+
});
|
|
155
|
+
} catch (a) {
|
|
156
|
+
l(a);
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
}
|
|
3
160
|
class S {
|
|
4
161
|
/**
|
|
5
162
|
* 全局配置对象
|
|
@@ -263,6 +420,16 @@ class S {
|
|
|
263
420
|
create: !0,
|
|
264
421
|
update: !0
|
|
265
422
|
}
|
|
423
|
+
},
|
|
424
|
+
radio: {
|
|
425
|
+
data: [],
|
|
426
|
+
dataPath: "data.data",
|
|
427
|
+
dataApiConfig: {
|
|
428
|
+
once: !0,
|
|
429
|
+
init: !0,
|
|
430
|
+
create: !0,
|
|
431
|
+
update: !0
|
|
432
|
+
}
|
|
266
433
|
}
|
|
267
434
|
}
|
|
268
435
|
}
|
|
@@ -276,162 +443,6 @@ class S {
|
|
|
276
443
|
S.config = ObjectUtil.deepMerge(S.config, s);
|
|
277
444
|
};
|
|
278
445
|
}
|
|
279
|
-
class $ {
|
|
280
|
-
/**
|
|
281
|
-
* Vue Router 实例,需在应用初始化时赋值
|
|
282
|
-
*/
|
|
283
|
-
static router;
|
|
284
|
-
/**
|
|
285
|
-
* 原始路由列表
|
|
286
|
-
*/
|
|
287
|
-
static routes;
|
|
288
|
-
/**
|
|
289
|
-
* 获取路由路径
|
|
290
|
-
*/
|
|
291
|
-
static getRouterPath = () => this.router.currentRoute.value.path;
|
|
292
|
-
static EDialog = {
|
|
293
|
-
Insert: "Insert",
|
|
294
|
-
Update: "Update",
|
|
295
|
-
Remove: "Remove"
|
|
296
|
-
};
|
|
297
|
-
/**
|
|
298
|
-
* 判断是否是函数,是就执行返回,否则返回本身
|
|
299
|
-
* @param fun 函数
|
|
300
|
-
* @param data 数据
|
|
301
|
-
* @returns 是否显示
|
|
302
|
-
*/
|
|
303
|
-
static isFun = (s, r) => Array.isArray(s) ? s.some((t) => typeof t == "function" ? t(r) : t) : typeof s == "function" ? s(r) : s;
|
|
304
|
-
/**
|
|
305
|
-
* 获取路由参数,自动获取query、params中的参数, 哪个有就返回哪个
|
|
306
|
-
*/
|
|
307
|
-
static getRouterParams = () => {
|
|
308
|
-
const s = this.router.currentRoute.value.query || {}, r = this.router.currentRoute.value.params || {};
|
|
309
|
-
return Object.keys(s).length ? s : Object.keys(r).length ? r : {};
|
|
310
|
-
};
|
|
311
|
-
/**
|
|
312
|
-
* 模块赋值
|
|
313
|
-
*/
|
|
314
|
-
static moduleObj = {};
|
|
315
|
-
/**
|
|
316
|
-
* 加载模块
|
|
317
|
-
* @param module
|
|
318
|
-
*/
|
|
319
|
-
static loadModule = async (s) => {
|
|
320
|
-
if (!$.moduleObj[s])
|
|
321
|
-
throw new Error(`模块${s}未加载,请赋值如:TSys.moduleObj = { ${s}: ()=>import('${s}') }`);
|
|
322
|
-
const r = await $.moduleObj[s]();
|
|
323
|
-
return r.default ?? r;
|
|
324
|
-
};
|
|
325
|
-
/**
|
|
326
|
-
* 提示信息对象管理
|
|
327
|
-
*/
|
|
328
|
-
static tipMessages = {};
|
|
329
|
-
/**
|
|
330
|
-
* 提示信息间隔时间
|
|
331
|
-
*/
|
|
332
|
-
static tipMessagesGap = 500;
|
|
333
|
-
/**
|
|
334
|
-
* 显示提示信息
|
|
335
|
-
* @param content 消息内容
|
|
336
|
-
* @param type 消息类型
|
|
337
|
-
* @param options 其他选项
|
|
338
|
-
*/
|
|
339
|
-
static showMessage(s, r, t = {}) {
|
|
340
|
-
const n = Date.now();
|
|
341
|
-
if (!this.tipMessages[s] || n - this.tipMessages[s] > this.tipMessagesGap) {
|
|
342
|
-
this.tipMessages[s] = n;
|
|
343
|
-
const e = Object.assign(
|
|
344
|
-
{
|
|
345
|
-
message: s,
|
|
346
|
-
type: r
|
|
347
|
-
},
|
|
348
|
-
t
|
|
349
|
-
);
|
|
350
|
-
ye(e), setTimeout(() => {
|
|
351
|
-
delete this.tipMessages[s];
|
|
352
|
-
}, this.tipMessagesGap);
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
/**
|
|
356
|
-
* 失败提示
|
|
357
|
-
* @param content
|
|
358
|
-
* @param options
|
|
359
|
-
*/
|
|
360
|
-
static fail = (s, r = {}) => {
|
|
361
|
-
this.showMessage(s, "error", r);
|
|
362
|
-
};
|
|
363
|
-
/**
|
|
364
|
-
* 成功提示
|
|
365
|
-
* @param content
|
|
366
|
-
* @param options
|
|
367
|
-
*/
|
|
368
|
-
static success = (s, r = {}) => {
|
|
369
|
-
this.showMessage(s, "success", r);
|
|
370
|
-
};
|
|
371
|
-
static loadingObj = null;
|
|
372
|
-
static loadingTimer = null;
|
|
373
|
-
/**
|
|
374
|
-
* 加载中
|
|
375
|
-
* @param show
|
|
376
|
-
* @param text
|
|
377
|
-
*/
|
|
378
|
-
static loading = (s = !0, r = "Loading...") => {
|
|
379
|
-
Timer.un(this.loadingTimer), this.loadingTimer = Timer.once(() => {
|
|
380
|
-
s ? this.loadingObj = ge.service({
|
|
381
|
-
lock: !0,
|
|
382
|
-
text: r,
|
|
383
|
-
background: "rgba(0, 0, 0, 0.3)"
|
|
384
|
-
}) : this.loadingObj && (this.loadingObj.close(), this.loadingObj = null);
|
|
385
|
-
}, 50);
|
|
386
|
-
};
|
|
387
|
-
/**
|
|
388
|
-
* 使用window.open打开新地址
|
|
389
|
-
* @param url 地址
|
|
390
|
-
* @param isCenter 是否居中
|
|
391
|
-
*/
|
|
392
|
-
static openUrl = (s, r = !0) => {
|
|
393
|
-
if (r) {
|
|
394
|
-
let t = screen.width / 2 - 500, n = screen.height / 2 - 800 / 2 - 30;
|
|
395
|
-
window.open(
|
|
396
|
-
s,
|
|
397
|
-
"_blank",
|
|
398
|
-
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + n + ", left=" + t
|
|
399
|
-
);
|
|
400
|
-
} else
|
|
401
|
-
window.open(
|
|
402
|
-
s,
|
|
403
|
-
"DescriptiveWindowName" + StrUtil.getId(),
|
|
404
|
-
"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0"
|
|
405
|
-
);
|
|
406
|
-
};
|
|
407
|
-
/**
|
|
408
|
-
* 根据dom id截图并返回图片数据
|
|
409
|
-
* @param param
|
|
410
|
-
* @returns
|
|
411
|
-
*/
|
|
412
|
-
static getImgPic = (s) => new Promise(async (r, t) => {
|
|
413
|
-
let n = document.getElementById(s.id);
|
|
414
|
-
const e = await $.loadModule("html2canvas");
|
|
415
|
-
try {
|
|
416
|
-
e(n, {
|
|
417
|
-
logging: !1,
|
|
418
|
-
allowTaint: !0,
|
|
419
|
-
scale: window.devicePixelRatio,
|
|
420
|
-
width: s.windowWidth,
|
|
421
|
-
height: s.windowHeight,
|
|
422
|
-
windowWidth: s.windowWidth,
|
|
423
|
-
windowHeight: s.windowHeight,
|
|
424
|
-
useCORS: !0,
|
|
425
|
-
backgroundColor: "#ffffff00"
|
|
426
|
-
}).then(function(a) {
|
|
427
|
-
let d = a.toDataURL("image/png");
|
|
428
|
-
r(d);
|
|
429
|
-
});
|
|
430
|
-
} catch (a) {
|
|
431
|
-
t(a);
|
|
432
|
-
}
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
446
|
class L {
|
|
436
447
|
/**
|
|
437
448
|
* 自定义组件映射表,key 为组件名(同时作为 column.type 值),value 为 Vue 组件定义
|
|
@@ -450,9 +461,9 @@ class L {
|
|
|
450
461
|
* @returns 该字段对应类型的 options 配置,如 select 类型返回 `options.select`
|
|
451
462
|
*/
|
|
452
463
|
static findOptions = (s, r) => {
|
|
453
|
-
const
|
|
454
|
-
if (
|
|
455
|
-
return
|
|
464
|
+
const l = s.column.find((e) => e.key === r), n = (e) => e.replace(/-([a-z])/g, (a, u) => u.toUpperCase());
|
|
465
|
+
if (l)
|
|
466
|
+
return l.options[n(l.type)];
|
|
456
467
|
};
|
|
457
468
|
/**
|
|
458
469
|
* 更新组件数据
|
|
@@ -470,9 +481,9 @@ class L {
|
|
|
470
481
|
}))
|
|
471
482
|
)
|
|
472
483
|
*/
|
|
473
|
-
static setOptionsData = (s, r,
|
|
484
|
+
static setOptionsData = (s, r, l) => {
|
|
474
485
|
const n = L.findOptions(s, r);
|
|
475
|
-
n && (n.data =
|
|
486
|
+
n && (n.data = l);
|
|
476
487
|
};
|
|
477
488
|
static form = {
|
|
478
489
|
openBefore: {
|
|
@@ -483,9 +494,9 @@ class L {
|
|
|
483
494
|
* @param treeData 树形数据
|
|
484
495
|
* @param option 组件配置
|
|
485
496
|
*/
|
|
486
|
-
parentId: (s, r,
|
|
497
|
+
parentId: (s, r, l, n) => {
|
|
487
498
|
const e = S.config.table.rowKey;
|
|
488
|
-
s ? r.type ===
|
|
499
|
+
s ? r.type === U.EDialog.Insert ? (r.form.parentId = s[e], r.form.sort = s.children.length + 1) : r.form.parentId = s.parentId.substring(s.parentId.lastIndexOf(",") + 1) : (r.form.parentId = "0", r.form.sort = l.length + 1), L.setOptionsData(n, "parentId", [{ [e]: "0", title: "根", children: l }]);
|
|
489
500
|
}
|
|
490
501
|
}
|
|
491
502
|
};
|
|
@@ -500,13 +511,13 @@ class R {
|
|
|
500
511
|
* @param field 字段名
|
|
501
512
|
* @param row 行数据
|
|
502
513
|
*/
|
|
503
|
-
static setId = (s, r,
|
|
514
|
+
static setId = (s, r, l) => {
|
|
504
515
|
r[s] || (r[s] = []);
|
|
505
516
|
const n = S.config.table.rowKey;
|
|
506
517
|
r[s].forEach((e) => {
|
|
507
|
-
|
|
508
|
-
let
|
|
509
|
-
a.type === "number" && (
|
|
518
|
+
l.forEach((a) => {
|
|
519
|
+
let u = a.default ?? "";
|
|
520
|
+
a.type === "number" && (u = a.default ?? 0), a.type === "boolean" && (u = a.default ?? !1), a.type === "time" && (u = a.default ?? /* @__PURE__ */ new Date()), e[a.value] === void 0 && (e[a.value] = u);
|
|
510
521
|
}), e[n] || (e[n] = R.getIdFun());
|
|
511
522
|
});
|
|
512
523
|
};
|
|
@@ -517,15 +528,15 @@ class R {
|
|
|
517
528
|
* @param itemFields 元素字段-如:[{label:'',value:''}]
|
|
518
529
|
* @param callback 回调函数
|
|
519
530
|
*/
|
|
520
|
-
static add = (s, r,
|
|
521
|
-
const e = JSONUtil.cp(
|
|
522
|
-
R.setId(s, r,
|
|
531
|
+
static add = (s, r, l, n) => {
|
|
532
|
+
const e = JSONUtil.cp(l);
|
|
533
|
+
R.setId(s, r, l);
|
|
523
534
|
const a = S.config.table.rowKey;
|
|
524
535
|
r[s].push(
|
|
525
536
|
e.reduce(
|
|
526
|
-
(
|
|
527
|
-
let p =
|
|
528
|
-
return
|
|
537
|
+
(u, f) => {
|
|
538
|
+
let p = f.default ?? "";
|
|
539
|
+
return f.type === "number" && (p = f.default ?? 0), f.type === "boolean" && (p = f.default ?? !1), f.type === "time" && (p = f.default ?? /* @__PURE__ */ new Date()), u[f.value] = p, u;
|
|
529
540
|
},
|
|
530
541
|
{ [a]: R.getIdFun() }
|
|
531
542
|
)
|
|
@@ -538,9 +549,9 @@ class R {
|
|
|
538
549
|
* @param item 元素-如:{_id:''}
|
|
539
550
|
* @param callback 回调函数
|
|
540
551
|
*/
|
|
541
|
-
static remove = (s, r,
|
|
552
|
+
static remove = (s, r, l, n) => {
|
|
542
553
|
const e = S.config.table.rowKey;
|
|
543
|
-
r[s] = r[s].filter((a) => a[e] !==
|
|
554
|
+
r[s] = r[s].filter((a) => a[e] !== l[e]), n?.(r);
|
|
544
555
|
};
|
|
545
556
|
/**
|
|
546
557
|
* 获取没有id的数据
|
|
@@ -549,10 +560,10 @@ class R {
|
|
|
549
560
|
* @returns 没有id的数据
|
|
550
561
|
*/
|
|
551
562
|
static getNoIdData = (s, r) => {
|
|
552
|
-
const
|
|
553
|
-
return
|
|
563
|
+
const l = JSONUtil.cp(s), n = S.config.table.rowKey;
|
|
564
|
+
return l.forEach((e) => {
|
|
554
565
|
e[n] && delete e[n], r && e[r] && R.getNoIdData(e[r], r);
|
|
555
|
-
}),
|
|
566
|
+
}), l;
|
|
556
567
|
};
|
|
557
568
|
}
|
|
558
569
|
const Ve = {
|
|
@@ -562,7 +573,7 @@ const Ve = {
|
|
|
562
573
|
}, Ee = {
|
|
563
574
|
class: "row items-center",
|
|
564
575
|
style: { gap: "10px", width: "100%" }
|
|
565
|
-
}, oe = /* @__PURE__ */
|
|
576
|
+
}, oe = /* @__PURE__ */ N({
|
|
566
577
|
__name: "list",
|
|
567
578
|
props: {
|
|
568
579
|
row: {
|
|
@@ -597,73 +608,73 @@ const Ve = {
|
|
|
597
608
|
}
|
|
598
609
|
},
|
|
599
610
|
emits: ["change"],
|
|
600
|
-
setup(
|
|
601
|
-
const r =
|
|
611
|
+
setup(t, { emit: s }) {
|
|
612
|
+
const r = t, l = te({
|
|
602
613
|
show: !1,
|
|
603
|
-
add: (e, a,
|
|
604
|
-
R.add(e, a,
|
|
614
|
+
add: (e, a, u) => {
|
|
615
|
+
R.add(e, a, u, () => {
|
|
605
616
|
n("change");
|
|
606
617
|
});
|
|
607
618
|
},
|
|
608
|
-
remove: (e, a,
|
|
609
|
-
R.remove(e, a,
|
|
619
|
+
remove: (e, a, u) => {
|
|
620
|
+
R.remove(e, a, u, () => {
|
|
610
621
|
n("change");
|
|
611
622
|
});
|
|
612
623
|
}
|
|
613
624
|
});
|
|
614
|
-
|
|
615
|
-
R.setId(r.field, r.row, r.itemFields),
|
|
625
|
+
ne(() => {
|
|
626
|
+
R.setId(r.field, r.row, r.itemFields), l.show = !0;
|
|
616
627
|
});
|
|
617
628
|
const n = s;
|
|
618
629
|
return (e, a) => {
|
|
619
|
-
const
|
|
620
|
-
return
|
|
621
|
-
k(e.$slots, "list-start", { row:
|
|
622
|
-
|
|
623
|
-
|
|
630
|
+
const u = H("el-button"), f = H("el-input");
|
|
631
|
+
return l.show ? (m(), w("div", Ve, [
|
|
632
|
+
k(e.$slots, "list-start", { row: t.row }),
|
|
633
|
+
$("div", null, [
|
|
634
|
+
V(u, {
|
|
624
635
|
link: "",
|
|
625
636
|
type: "primary",
|
|
626
|
-
onClick: a[0] || (a[0] = (p) =>
|
|
637
|
+
onClick: a[0] || (a[0] = (p) => l.add(t.field, t.row, t.itemFields))
|
|
627
638
|
}, {
|
|
628
|
-
default:
|
|
639
|
+
default: h(() => [...a[2] || (a[2] = [
|
|
629
640
|
E("添加", -1)
|
|
630
641
|
])]),
|
|
631
642
|
_: 1
|
|
632
643
|
})
|
|
633
644
|
]),
|
|
634
|
-
(
|
|
645
|
+
(m(!0), w(D, null, M(t.row[t.field], (p) => (m(), w("div", Ee, [
|
|
635
646
|
k(e.$slots, "item-start", {
|
|
636
647
|
item: p,
|
|
637
|
-
row:
|
|
648
|
+
row: t.row
|
|
638
649
|
}),
|
|
639
|
-
(
|
|
650
|
+
(m(!0), w(D, null, M(t.itemFields, (c) => (m(), b(f, {
|
|
640
651
|
modelValue: p[c.value],
|
|
641
652
|
"onUpdate:modelValue": (i) => p[c.value] = i,
|
|
642
|
-
style:
|
|
643
|
-
class: T(
|
|
644
|
-
placeholder: c[
|
|
653
|
+
style: ie({ width: t.inputWidth }),
|
|
654
|
+
class: T(t.inputClass),
|
|
655
|
+
placeholder: c[t.label] || c[t.value],
|
|
645
656
|
onChange: a[1] || (a[1] = (i) => n("change"))
|
|
646
657
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
|
|
647
658
|
k(e.$slots, "item-end", {
|
|
648
659
|
item: p,
|
|
649
|
-
row:
|
|
660
|
+
row: t.row
|
|
650
661
|
}),
|
|
651
|
-
|
|
662
|
+
V(u, {
|
|
652
663
|
link: "",
|
|
653
664
|
type: "danger",
|
|
654
|
-
onClick: (c) =>
|
|
665
|
+
onClick: (c) => l.remove(t.field, t.row, p)
|
|
655
666
|
}, {
|
|
656
|
-
default:
|
|
667
|
+
default: h(() => [...a[3] || (a[3] = [
|
|
657
668
|
E("删除", -1)
|
|
658
669
|
])]),
|
|
659
670
|
_: 1
|
|
660
671
|
}, 8, ["onClick"])
|
|
661
672
|
]))), 256)),
|
|
662
|
-
k(e.$slots, "list-end", { row:
|
|
663
|
-
])) :
|
|
673
|
+
k(e.$slots, "list-end", { row: t.row })
|
|
674
|
+
])) : v("", !0);
|
|
664
675
|
};
|
|
665
676
|
}
|
|
666
|
-
}), xe = { class: "row curd-row" }, De = /* @__PURE__ */
|
|
677
|
+
}), xe = { class: "row curd-row" }, De = /* @__PURE__ */ N({
|
|
667
678
|
__name: "column",
|
|
668
679
|
props: {
|
|
669
680
|
/**
|
|
@@ -679,81 +690,81 @@ const Ve = {
|
|
|
679
690
|
default: ""
|
|
680
691
|
}
|
|
681
692
|
},
|
|
682
|
-
setup(
|
|
683
|
-
const r =
|
|
693
|
+
setup(t, { expose: s }) {
|
|
694
|
+
const r = U.isFun, l = U.EDialog, n = K(), e = t, a = te({
|
|
684
695
|
rules: {},
|
|
685
696
|
show: !0,
|
|
686
697
|
form: {},
|
|
687
698
|
formDefault: {},
|
|
688
699
|
formColumn: [],
|
|
689
|
-
getDisabled: (
|
|
700
|
+
getDisabled: (u) => u.disabled?.[(e.type || l.Insert) === l.Insert ? "create" : "update"],
|
|
690
701
|
initColumnForm: async () => {
|
|
691
|
-
const
|
|
702
|
+
const u = e.option;
|
|
692
703
|
a.formColumn = [];
|
|
693
|
-
const
|
|
704
|
+
const f = [], p = e.option.form?.maxSpan || 12, c = e.option.form?.defaultSpan || p;
|
|
694
705
|
let i = [];
|
|
695
|
-
const
|
|
696
|
-
if (a.formDefault[
|
|
697
|
-
|
|
698
|
-
let I =
|
|
706
|
+
const d = (y) => {
|
|
707
|
+
if (a.formDefault[y.key] = y.value, y.isForm) {
|
|
708
|
+
y.form = y.form || { span: c }, y.form.span = y.form.span ?? c;
|
|
709
|
+
let I = y.form.span, j = i.reduce((B, de) => B + de.span, I);
|
|
699
710
|
const z = i.length;
|
|
700
|
-
i.push({ item:
|
|
711
|
+
i.push({ item: y, span: I }), (z === 1 && i[0].span === 0 || j >= p || I === 0 && z > 1) && (f.push(i), i = []), y.rules && (a.rules[y.key] = y.rules);
|
|
701
712
|
}
|
|
702
713
|
};
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
}), i.length > 0 &&
|
|
714
|
+
u.column.forEach((y) => {
|
|
715
|
+
y.isForm = !0, d(y);
|
|
716
|
+
}), i.length > 0 && f.push(i), a.formColumn = f, a.form = JSONUtil.cp(a.formDefault);
|
|
706
717
|
},
|
|
707
718
|
init: async () => {
|
|
708
|
-
a.show = !1, await
|
|
719
|
+
a.show = !1, await be(), a.initColumnForm();
|
|
709
720
|
}
|
|
710
721
|
});
|
|
711
722
|
return a.initColumnForm(), s({
|
|
712
723
|
ref: n,
|
|
713
724
|
conf: a
|
|
714
|
-
}), (
|
|
725
|
+
}), (u, f) => (m(), b(o(Q), {
|
|
715
726
|
ref_key: "ruleFormRef",
|
|
716
727
|
ref: n,
|
|
717
728
|
model: a.form,
|
|
718
729
|
rules: a.rules
|
|
719
730
|
}, {
|
|
720
|
-
default:
|
|
721
|
-
a.show ? (
|
|
722
|
-
k(
|
|
731
|
+
default: h(() => [
|
|
732
|
+
a.show ? (m(!0), w(D, { key: 0 }, M(a.formColumn, (p) => (m(), w("div", xe, [
|
|
733
|
+
k(u.$slots, "form-start", {
|
|
723
734
|
row: a.form
|
|
724
735
|
}),
|
|
725
|
-
(
|
|
726
|
-
|
|
736
|
+
(m(!0), w(D, null, M(p, (c) => (m(), w(D, null, [
|
|
737
|
+
o(r)(c.item.show?.form, a.form) ?? !0 ? (m(), w("div", {
|
|
727
738
|
key: 0,
|
|
728
739
|
class: T(c.item.form.span > 0 ? `col-${c.item.form.span}` : "col")
|
|
729
740
|
}, [
|
|
730
|
-
|
|
741
|
+
V(o(J), {
|
|
731
742
|
label: c.item.label,
|
|
732
743
|
prop: c.item.key,
|
|
733
744
|
"label-width": c.item.form?.labelWidth || "100px"
|
|
734
745
|
}, {
|
|
735
|
-
default:
|
|
736
|
-
k(
|
|
746
|
+
default: h(() => [
|
|
747
|
+
k(u.$slots, "form-" + c.item.key + "-start", {
|
|
737
748
|
row: a.form,
|
|
738
749
|
item: c.item
|
|
739
750
|
}),
|
|
740
|
-
k(
|
|
751
|
+
k(u.$slots, "form-" + c.item.key, {
|
|
741
752
|
row: a.form,
|
|
742
753
|
item: c.item
|
|
743
754
|
}, () => [
|
|
744
|
-
c.item.type === "input" ? (
|
|
755
|
+
c.item.type === "input" ? (m(), b(o(q), C({
|
|
745
756
|
key: 0,
|
|
746
757
|
modelValue: a.form[c.item.key],
|
|
747
758
|
"onUpdate:modelValue": (i) => a.form[c.item.key] = i
|
|
748
759
|
}, { ref_for: !0 }, c.item.options?.input, O(c.item.options?.input?.on || {}), {
|
|
749
760
|
disabled: a.getDisabled(c.item)
|
|
750
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : c.item.type === "switch" ? (
|
|
761
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : c.item.type === "switch" ? (m(), b(o(_), C({
|
|
751
762
|
key: 1,
|
|
752
763
|
modelValue: a.form[c.item.key],
|
|
753
764
|
"onUpdate:modelValue": (i) => a.form[c.item.key] = i
|
|
754
765
|
}, { ref_for: !0 }, c.item.options?.switch, O(c.item.options?.switch?.on || {}), {
|
|
755
766
|
disabled: a.getDisabled(c.item)
|
|
756
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : c.item.type === "select" ? (
|
|
767
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : c.item.type === "select" ? (m(), b(o(W), C({
|
|
757
768
|
key: 2,
|
|
758
769
|
modelValue: a.form[c.item.key],
|
|
759
770
|
"onUpdate:modelValue": (i) => a.form[c.item.key] = i
|
|
@@ -761,55 +772,55 @@ const Ve = {
|
|
|
761
772
|
disabled: a.getDisabled(c.item),
|
|
762
773
|
style: { width: "100%" }
|
|
763
774
|
}), {
|
|
764
|
-
default:
|
|
765
|
-
(
|
|
775
|
+
default: h(() => [
|
|
776
|
+
(m(!0), w(D, null, M(c.item.options?.select?.data, (i) => (m(), b(o(P), {
|
|
766
777
|
key: i.value,
|
|
767
778
|
label: i.label,
|
|
768
779
|
value: i.value
|
|
769
780
|
}, null, 8, ["label", "value"]))), 128))
|
|
770
781
|
]),
|
|
771
782
|
_: 2
|
|
772
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : c.item.type === "list" ? (
|
|
783
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : c.item.type === "list" ? (m(), b(oe, C({
|
|
773
784
|
key: 3,
|
|
774
785
|
row: a.form,
|
|
775
786
|
field: c.item.key
|
|
776
787
|
}, { ref_for: !0 }, c.item.options?.list, O(c.item.options?.list?.on || {}), {
|
|
777
788
|
disabled: a.getDisabled(c.item),
|
|
778
789
|
style: { width: "100%" }
|
|
779
|
-
}), null, 16, ["row", "field", "disabled"])) : c.item.type === "tree-select" ? (
|
|
790
|
+
}), null, 16, ["row", "field", "disabled"])) : c.item.type === "tree-select" ? (m(), b(o(ae), C({
|
|
780
791
|
key: 4,
|
|
781
792
|
modelValue: a.form[c.item.key],
|
|
782
793
|
"onUpdate:modelValue": (i) => a.form[c.item.key] = i
|
|
783
794
|
}, { ref_for: !0 }, c.item.options?.treeSelect, O(c.item.options?.treeSelect?.on || {}), {
|
|
784
795
|
disabled: a.getDisabled(c.item),
|
|
785
796
|
style: { width: "100%" }
|
|
786
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : c.item.type === "datetime" ? (
|
|
797
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : c.item.type === "datetime" ? (m(), b(o(ee), C({
|
|
787
798
|
key: 5,
|
|
788
799
|
modelValue: a.form[c.item.key],
|
|
789
800
|
"onUpdate:modelValue": (i) => a.form[c.item.key] = i
|
|
790
801
|
}, { ref_for: !0 }, c.item.options?.datetime, O(c.item.options?.datetime?.on || {}), {
|
|
791
802
|
disabled: a.getDisabled(c.item)
|
|
792
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : c.item.type &&
|
|
803
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : c.item.type && o(L).customComponent[c.item.type] ? (m(), b(G(o(L).customComponent[c.item.type]), C({
|
|
793
804
|
key: 6,
|
|
794
805
|
modelValue: a.form[c.item.key],
|
|
795
806
|
"onUpdate:modelValue": (i) => a.form[c.item.key] = i
|
|
796
807
|
}, { ref_for: !0 }, c.item.options?.[c.item.type], O(c.item.options?.[c.item.type]?.on || {}), {
|
|
797
808
|
disabled: a.getDisabled(c.item)
|
|
798
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
809
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : v("", !0)
|
|
799
810
|
]),
|
|
800
|
-
k(
|
|
811
|
+
k(u.$slots, "form-" + c.item.key + "-end", {
|
|
801
812
|
row: a.form,
|
|
802
813
|
item: c.item
|
|
803
814
|
})
|
|
804
815
|
]),
|
|
805
816
|
_: 2
|
|
806
817
|
}, 1032, ["label", "prop", "label-width"])
|
|
807
|
-
], 2)) :
|
|
818
|
+
], 2)) : v("", !0)
|
|
808
819
|
], 64))), 256)),
|
|
809
|
-
k(
|
|
820
|
+
k(u.$slots, "form-end", {
|
|
810
821
|
row: a.form
|
|
811
822
|
})
|
|
812
|
-
]))), 256)) :
|
|
823
|
+
]))), 256)) : v("", !0)
|
|
813
824
|
]),
|
|
814
825
|
_: 3
|
|
815
826
|
}, 8, ["model", "rules"]));
|
|
@@ -819,6 +830,7 @@ const Ue = {
|
|
|
819
830
|
search: "搜索",
|
|
820
831
|
add: "新增",
|
|
821
832
|
edit: "编辑",
|
|
833
|
+
view: "查看",
|
|
822
834
|
delete: "删除",
|
|
823
835
|
export: "导出",
|
|
824
836
|
exportSelect: "导出选中",
|
|
@@ -853,8 +865,8 @@ class g {
|
|
|
853
865
|
if (typeof s == "function")
|
|
854
866
|
return s(...r);
|
|
855
867
|
s = String(s);
|
|
856
|
-
let
|
|
857
|
-
return s.replace(/{([^}]+)}/g, (n, e) =>
|
|
868
|
+
let l = 0;
|
|
869
|
+
return s.replace(/{([^}]+)}/g, (n, e) => l < r.length ? String(r[l++]) : `{${e}}`);
|
|
858
870
|
}
|
|
859
871
|
static setI18n = (s) => {
|
|
860
872
|
g.curd = ObjectUtil.deepMerge(g.curd, s);
|
|
@@ -874,19 +886,19 @@ class $e {
|
|
|
874
886
|
* @param columns - 列配置数组,需包含 `key`(数据字段)和 `label`(Excel 表头)
|
|
875
887
|
* @param fileName - 文件名(不含扩展名),支持字符串或返回字符串的函数;默认生成「导出数据_日期_时间戳」
|
|
876
888
|
*/
|
|
877
|
-
static exportToExcel = async (s, r,
|
|
889
|
+
static exportToExcel = async (s, r, l) => {
|
|
878
890
|
if (!s || s.length === 0) return;
|
|
879
|
-
const n = await
|
|
891
|
+
const n = await U.loadModule("xlsx"), e = s.map((f) => {
|
|
880
892
|
const p = {};
|
|
881
893
|
return r.forEach((c) => {
|
|
882
|
-
p[c.label] =
|
|
894
|
+
p[c.label] = f[c.key];
|
|
883
895
|
}), p;
|
|
884
|
-
}), a = n.utils.json_to_sheet(e),
|
|
885
|
-
n.utils.book_append_sheet(
|
|
896
|
+
}), a = n.utils.json_to_sheet(e), u = n.utils.book_new();
|
|
897
|
+
n.utils.book_append_sheet(u, a, "Sheet1"), l ? typeof l == "function" && (l = l()) : l = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, n.writeFile(u, `${l}.xlsx`);
|
|
886
898
|
};
|
|
887
899
|
}
|
|
888
|
-
const
|
|
889
|
-
const s =
|
|
900
|
+
const A = U.EDialog, Se = (t) => {
|
|
901
|
+
const s = K(), r = K(), l = te({
|
|
890
902
|
/** 查询区域相关配置对象 */
|
|
891
903
|
search: {
|
|
892
904
|
/** 查询表单列集合 */
|
|
@@ -903,36 +915,36 @@ const W = $.EDialog, Se = (o) => {
|
|
|
903
915
|
/** 组装实际要搜索的数据对象 */
|
|
904
916
|
getFormData: () => {
|
|
905
917
|
let n = {};
|
|
906
|
-
|
|
907
|
-
(typeof a.show?.search == "function" ? a.show?.search(
|
|
918
|
+
t.option.column.forEach((a) => {
|
|
919
|
+
(typeof a.show?.search == "function" ? a.show?.search(l.search.form) : a.show?.search) && (n[a.key] = l.search.form[a.key]);
|
|
908
920
|
});
|
|
909
|
-
const e =
|
|
921
|
+
const e = t.option.search?.before?.(n);
|
|
910
922
|
return e && (n = e), n;
|
|
911
923
|
},
|
|
912
924
|
/** 重置搜索表单 */
|
|
913
925
|
reset: () => {
|
|
914
|
-
const n =
|
|
926
|
+
const n = l.search.formDefault;
|
|
915
927
|
Object.keys(n).forEach((e) => {
|
|
916
|
-
|
|
917
|
-
}),
|
|
928
|
+
t.option.search?.resetMode === "none" ? n[e] = void 0 : n[e] = l.search.formDefault[e];
|
|
929
|
+
}), l.search.form = JSONUtil.cp(n), l.page.num = 1, t.option.init !== !1 && l.table.getList();
|
|
918
930
|
},
|
|
919
931
|
/** 提交搜索表单 */
|
|
920
932
|
submit: () => {
|
|
921
|
-
|
|
933
|
+
l.page.num = 1, l.table.getList();
|
|
922
934
|
}
|
|
923
935
|
},
|
|
924
936
|
/** 分页区域相关配置对象 */
|
|
925
937
|
page: {
|
|
926
938
|
/** 当前每页条数 */
|
|
927
|
-
size:
|
|
939
|
+
size: t.option.page?.size || 10,
|
|
928
940
|
/** 支持切换的每页条数选项 */
|
|
929
|
-
sizeList:
|
|
941
|
+
sizeList: t.option.page?.sizeList || [10, 20, 50, 100],
|
|
930
942
|
/** 当前页码 */
|
|
931
943
|
num: 1,
|
|
932
944
|
/** 总条数 */
|
|
933
945
|
total: 0,
|
|
934
946
|
/** 分页控件的布局方式 */
|
|
935
|
-
layout:
|
|
947
|
+
layout: t.option.page?.layout || "total, sizes, prev, pager, next, jumper"
|
|
936
948
|
},
|
|
937
949
|
/** 表格区域相关配置对象 */
|
|
938
950
|
table: {
|
|
@@ -956,18 +968,18 @@ const W = $.EDialog, Se = (o) => {
|
|
|
956
968
|
},
|
|
957
969
|
/** 全部展开/收起 */
|
|
958
970
|
all: () => {
|
|
959
|
-
if (
|
|
960
|
-
|
|
971
|
+
if (l.table.expand.isExpand)
|
|
972
|
+
l.table.expand.rowKeys = [];
|
|
961
973
|
else {
|
|
962
974
|
const n = (e) => {
|
|
963
975
|
let a = [];
|
|
964
|
-
return e.forEach((
|
|
965
|
-
a.push(
|
|
976
|
+
return e.forEach((u) => {
|
|
977
|
+
a.push(u[t.option.table.rowKey]), u.children && u.children.length > 0 && (a = a.concat(n(u.children)));
|
|
966
978
|
}), a;
|
|
967
979
|
};
|
|
968
|
-
|
|
980
|
+
l.table.expand.rowKeys = n(l.table.data);
|
|
969
981
|
}
|
|
970
|
-
|
|
982
|
+
l.table.expand.isExpand = !l.table.expand.isExpand;
|
|
971
983
|
}
|
|
972
984
|
},
|
|
973
985
|
/** 表格列相关配置 */
|
|
@@ -984,28 +996,25 @@ const W = $.EDialog, Se = (o) => {
|
|
|
984
996
|
},
|
|
985
997
|
/** 获取数据列表接口实现 */
|
|
986
998
|
getList: async () => {
|
|
987
|
-
|
|
988
|
-
const n =
|
|
999
|
+
l.table.loading = !0;
|
|
1000
|
+
const n = t.option.api.list;
|
|
989
1001
|
try {
|
|
990
|
-
await
|
|
1002
|
+
await l.initApiData("init");
|
|
991
1003
|
const e = await n({
|
|
992
|
-
[S.config.page.size]:
|
|
993
|
-
[S.config.page.num]:
|
|
994
|
-
...
|
|
995
|
-
}), a = S.config.result,
|
|
996
|
-
let
|
|
997
|
-
const p =
|
|
998
|
-
const I = p.find((j) => j.item.key ===
|
|
999
|
-
|
|
1000
|
-
const j = I.item.options?.select?.data?.find((z) => z.value == i[h])?.label;
|
|
1001
|
-
j && (i[h] = j);
|
|
1002
|
-
}
|
|
1004
|
+
[S.config.page.size]: l.page.size,
|
|
1005
|
+
[S.config.page.num]: l.page.num,
|
|
1006
|
+
...l.search.getFormData()
|
|
1007
|
+
}), a = S.config.result, u = e.data || { [a.list]: e };
|
|
1008
|
+
let f = (Array.isArray(u[a.list]), u[a.list]);
|
|
1009
|
+
const p = l.update.formColumn.flat(), c = JSONUtil.cp(f).map((i) => (Object.keys(i).forEach((y) => {
|
|
1010
|
+
const I = p.find((j) => j.item.key === y);
|
|
1011
|
+
I && I.item.type === "select" && (I.item.table.format || (I.item.table.format = (j) => I.item.options?.select?.data?.find((z) => z.value == j[y])?.label));
|
|
1003
1012
|
}), i));
|
|
1004
|
-
|
|
1013
|
+
l.table.data = t.option.data ? await t.option.data(c, f) : c, l.page.total = u[a.total] || 0;
|
|
1005
1014
|
} catch (e) {
|
|
1006
1015
|
console.error(e);
|
|
1007
1016
|
} finally {
|
|
1008
|
-
|
|
1017
|
+
l.table.loading = !1;
|
|
1009
1018
|
}
|
|
1010
1019
|
},
|
|
1011
1020
|
/** 表格多选相关配置 */
|
|
@@ -1014,7 +1023,7 @@ const W = $.EDialog, Se = (o) => {
|
|
|
1014
1023
|
list: [],
|
|
1015
1024
|
/** 选中状态回调 */
|
|
1016
1025
|
change: (n) => {
|
|
1017
|
-
|
|
1026
|
+
l.table.selection.list = n;
|
|
1018
1027
|
}
|
|
1019
1028
|
}
|
|
1020
1029
|
},
|
|
@@ -1024,38 +1033,38 @@ const W = $.EDialog, Se = (o) => {
|
|
|
1024
1033
|
run: {
|
|
1025
1034
|
/** 执行指定方式的导出(如select、page、all) */
|
|
1026
1035
|
start: async (n) => {
|
|
1027
|
-
let e = await
|
|
1028
|
-
const
|
|
1036
|
+
let e = await l.export.run[n](), a = t.option.column;
|
|
1037
|
+
const u = JSONUtil.cp({
|
|
1029
1038
|
data: e,
|
|
1030
1039
|
columns: a
|
|
1031
|
-
}),
|
|
1032
|
-
|
|
1040
|
+
}), f = t.option.tools?.export || {};
|
|
1041
|
+
f.before && f.before(u), $e.exportToExcel(u.data, u.columns, f.fileName);
|
|
1033
1042
|
},
|
|
1034
1043
|
/** 获取当前选中项进行导出 */
|
|
1035
1044
|
select: () => {
|
|
1036
|
-
if (
|
|
1037
|
-
throw
|
|
1038
|
-
return
|
|
1045
|
+
if (l.table.selection.list.length === 0)
|
|
1046
|
+
throw U.fail(g.tCurd("selectDataToExport")), new Error(g.tCurd("selectDataToExport"));
|
|
1047
|
+
return l.table.selection.list;
|
|
1039
1048
|
},
|
|
1040
1049
|
/** 导出当前页的数据 */
|
|
1041
1050
|
page: () => {
|
|
1042
|
-
if (
|
|
1043
|
-
throw
|
|
1044
|
-
return
|
|
1051
|
+
if (l.table.data.length === 0)
|
|
1052
|
+
throw U.fail(g.tCurd("noData")), new Error(g.tCurd("noData"));
|
|
1053
|
+
return l.table.data;
|
|
1045
1054
|
},
|
|
1046
1055
|
/** 导出所有数据 */
|
|
1047
1056
|
all: async () => {
|
|
1048
|
-
|
|
1057
|
+
l.export.loading = !0;
|
|
1049
1058
|
try {
|
|
1050
|
-
if (
|
|
1051
|
-
await
|
|
1052
|
-
[S.config.page.size]:
|
|
1053
|
-
[S.config.page.num]:
|
|
1054
|
-
...
|
|
1059
|
+
if (t.option.tools?.export?.all) {
|
|
1060
|
+
await t.option.tools?.export?.all({
|
|
1061
|
+
[S.config.page.size]: l.page.size,
|
|
1062
|
+
[S.config.page.num]: l.page.num,
|
|
1063
|
+
...l.search.getFormData()
|
|
1055
1064
|
});
|
|
1056
1065
|
return;
|
|
1057
1066
|
}
|
|
1058
|
-
const n =
|
|
1067
|
+
const n = t.option.api.list, e = await n({
|
|
1059
1068
|
[S.config.page.size]: 999999,
|
|
1060
1069
|
[S.config.page.num]: 1
|
|
1061
1070
|
});
|
|
@@ -1063,7 +1072,7 @@ const W = $.EDialog, Se = (o) => {
|
|
|
1063
1072
|
} catch (n) {
|
|
1064
1073
|
console.error(n);
|
|
1065
1074
|
} finally {
|
|
1066
|
-
|
|
1075
|
+
l.export.loading = !1;
|
|
1067
1076
|
}
|
|
1068
1077
|
}
|
|
1069
1078
|
},
|
|
@@ -1071,7 +1080,7 @@ const W = $.EDialog, Se = (o) => {
|
|
|
1071
1080
|
loading: !1,
|
|
1072
1081
|
/** 执行导出操作的触发函数 */
|
|
1073
1082
|
click: (n) => {
|
|
1074
|
-
|
|
1083
|
+
l.export.loading || l.export.run.start(n);
|
|
1075
1084
|
}
|
|
1076
1085
|
},
|
|
1077
1086
|
/** 表单增删改弹窗相关对象 */
|
|
@@ -1087,7 +1096,7 @@ const W = $.EDialog, Se = (o) => {
|
|
|
1087
1096
|
/** 弹窗loading */
|
|
1088
1097
|
loading: !1,
|
|
1089
1098
|
/** 当前操作类型,插入或修改 */
|
|
1090
|
-
type:
|
|
1099
|
+
type: A.Insert,
|
|
1091
1100
|
/** 当前操作表单数据 */
|
|
1092
1101
|
form: {},
|
|
1093
1102
|
/** 表单默认值 */
|
|
@@ -1095,74 +1104,75 @@ const W = $.EDialog, Se = (o) => {
|
|
|
1095
1104
|
/** 表单所有列,二维数组结构按行分组 */
|
|
1096
1105
|
formColumn: [],
|
|
1097
1106
|
/** 判断是否禁用当前字段 */
|
|
1098
|
-
getDisabled: (n) => n.disabled?.[
|
|
1107
|
+
getDisabled: (n) => l.update.type === A.View ? !0 : n.disabled?.[l.update.type === A.Insert ? "create" : "update"],
|
|
1099
1108
|
/** 编辑相关数据与方法 */
|
|
1100
1109
|
edit: {
|
|
1101
1110
|
/** 当前编辑的数据原始项对象 */
|
|
1102
1111
|
data: {},
|
|
1103
1112
|
/** 返回编辑时与原值的变更数据,用于局部更新API */
|
|
1104
1113
|
getApiData: (n) => {
|
|
1105
|
-
if (
|
|
1114
|
+
if (t.option.form?.editAll)
|
|
1106
1115
|
return n;
|
|
1107
1116
|
let e = {
|
|
1108
|
-
[
|
|
1117
|
+
[t.option.table?.rowKey]: l.update.edit.data[t.option.table?.rowKey]
|
|
1109
1118
|
};
|
|
1110
|
-
return Object.keys(
|
|
1111
|
-
n[a] !==
|
|
1119
|
+
return Object.keys(l.update.edit.data).forEach((a) => {
|
|
1120
|
+
n[a] !== l.update.edit.data[a] && (e[a] = n[a]);
|
|
1112
1121
|
}), e;
|
|
1113
1122
|
}
|
|
1114
1123
|
},
|
|
1124
|
+
view: {},
|
|
1115
1125
|
/** 打开增改弹窗 */
|
|
1116
1126
|
open: (n, e) => {
|
|
1117
|
-
|
|
1118
|
-
|
|
1127
|
+
l.update.showContent || FunUtil.throttle(async () => {
|
|
1128
|
+
U.loading(!0);
|
|
1119
1129
|
try {
|
|
1120
|
-
await
|
|
1121
|
-
const a = n ===
|
|
1122
|
-
if (!a &&
|
|
1123
|
-
|
|
1130
|
+
await l.initApiData("update");
|
|
1131
|
+
const a = n === A.Insert;
|
|
1132
|
+
if (!a && t.option.table?.inlineEdit) {
|
|
1133
|
+
l.inlineEdit.open(e);
|
|
1124
1134
|
return;
|
|
1125
1135
|
}
|
|
1126
|
-
|
|
1136
|
+
l.update.type = n, l.update.edit.data = e, l.update.title = g.tCurd(a ? "add" : n === A.View ? "view" : "edit"), l.update.form = JSONUtil.cp(a ? l.update.formDefault : e), await t.option.form?.openBefore?.(e, l.update), l.update.show = !0, l.update.showContent = !0, t.option.form?.openAfter?.(e, l.update);
|
|
1127
1137
|
} catch (a) {
|
|
1128
1138
|
console.error(a);
|
|
1129
1139
|
} finally {
|
|
1130
|
-
|
|
1140
|
+
U.loading(!1);
|
|
1131
1141
|
}
|
|
1132
1142
|
});
|
|
1133
1143
|
},
|
|
1134
1144
|
/** 提交增改表单操作 */
|
|
1135
1145
|
submit: () => {
|
|
1136
1146
|
FunUtil.throttle(async () => {
|
|
1137
|
-
await r.value?.validate(async (
|
|
1138
|
-
|
|
1139
|
-
})),
|
|
1140
|
-
const n =
|
|
1141
|
-
let e = JSONUtil.cp(
|
|
1142
|
-
delete e.children, await
|
|
1143
|
-
const a = new Set(
|
|
1144
|
-
Object.keys(e).forEach((
|
|
1145
|
-
if (a.has(
|
|
1146
|
-
const
|
|
1147
|
-
isNaN(
|
|
1147
|
+
await r.value?.validate(async (u, f) => new Promise((p, c) => {
|
|
1148
|
+
u || (U.fail(g.tCurd("checkFormData")), c(!1)), p();
|
|
1149
|
+
})), l.update.loading = !0;
|
|
1150
|
+
const n = l.update.type === A.Insert ? t.option.api.create : t.option.api.update;
|
|
1151
|
+
let e = JSONUtil.cp(l.update.form);
|
|
1152
|
+
delete e.children, await t.option.form?.submitBefore?.(e, l.update);
|
|
1153
|
+
const a = new Set(t.option.column.filter((u) => u.type === "datetime").map((u) => u.key));
|
|
1154
|
+
Object.keys(e).forEach((u) => {
|
|
1155
|
+
if (a.has(u) && e[u] != null) {
|
|
1156
|
+
const f = new Date(e[u]).getTime();
|
|
1157
|
+
isNaN(f) || (e[u] = f);
|
|
1148
1158
|
}
|
|
1149
1159
|
});
|
|
1150
1160
|
try {
|
|
1151
1161
|
if (!n) return;
|
|
1152
1162
|
await n({
|
|
1153
1163
|
...e
|
|
1154
|
-
}),
|
|
1155
|
-
} catch (
|
|
1156
|
-
console.error(
|
|
1164
|
+
}), l.update.close(), await l.table.getList(), t.option.form?.submitAfter?.(e, l.update);
|
|
1165
|
+
} catch (u) {
|
|
1166
|
+
console.error(u);
|
|
1157
1167
|
} finally {
|
|
1158
|
-
|
|
1168
|
+
l.update.loading = !1;
|
|
1159
1169
|
}
|
|
1160
1170
|
});
|
|
1161
1171
|
},
|
|
1162
1172
|
/** 关闭弹窗和内容 */
|
|
1163
1173
|
close: () => {
|
|
1164
|
-
|
|
1165
|
-
|
|
1174
|
+
l.update.show = !1, setTimeout(() => {
|
|
1175
|
+
l.update.showContent = !1;
|
|
1166
1176
|
}, 350);
|
|
1167
1177
|
}
|
|
1168
1178
|
},
|
|
@@ -1176,26 +1186,26 @@ const W = $.EDialog, Se = (o) => {
|
|
|
1176
1186
|
loading: !1,
|
|
1177
1187
|
/** 打开行内编辑 */
|
|
1178
1188
|
open: (n) => {
|
|
1179
|
-
|
|
1189
|
+
l.inlineEdit.row = n, l.inlineEdit.form = JSONUtil.cp(n);
|
|
1180
1190
|
},
|
|
1181
1191
|
/** 关闭行内编辑 */
|
|
1182
1192
|
close: () => {
|
|
1183
|
-
|
|
1193
|
+
l.inlineEdit.row = null, l.inlineEdit.form = {};
|
|
1184
1194
|
},
|
|
1185
1195
|
/** 行内保存提交 */
|
|
1186
1196
|
submit: () => {
|
|
1187
1197
|
FunUtil.throttle(async () => {
|
|
1188
|
-
|
|
1189
|
-
const n =
|
|
1190
|
-
let e = JSONUtil.cp(
|
|
1198
|
+
l.inlineEdit.loading = !0;
|
|
1199
|
+
const n = t.option.api.update;
|
|
1200
|
+
let e = JSONUtil.cp(l.inlineEdit.form);
|
|
1191
1201
|
delete e.children;
|
|
1192
1202
|
try {
|
|
1193
1203
|
if (!n) return;
|
|
1194
|
-
await n({ ...e }),
|
|
1204
|
+
await n({ ...e }), l.inlineEdit.close(), await l.table.getList(), U.success(g.tCurd("operationSuccess"));
|
|
1195
1205
|
} catch (a) {
|
|
1196
1206
|
console.error(a);
|
|
1197
1207
|
} finally {
|
|
1198
|
-
|
|
1208
|
+
l.inlineEdit.loading = !1;
|
|
1199
1209
|
}
|
|
1200
1210
|
});
|
|
1201
1211
|
}
|
|
@@ -1212,74 +1222,74 @@ const W = $.EDialog, Se = (o) => {
|
|
|
1212
1222
|
loading: !1,
|
|
1213
1223
|
/** 关闭删除弹窗 */
|
|
1214
1224
|
close: () => {
|
|
1215
|
-
|
|
1225
|
+
l.remove.show = !1;
|
|
1216
1226
|
},
|
|
1217
1227
|
/** 打开删除弹窗并设置待删除项 */
|
|
1218
1228
|
open: (n) => {
|
|
1219
1229
|
if (n.length === 0) {
|
|
1220
|
-
|
|
1230
|
+
U.fail(g.tCurd("selectDataToDelete"));
|
|
1221
1231
|
return;
|
|
1222
1232
|
}
|
|
1223
|
-
|
|
1233
|
+
l.remove.items = n, l.remove.show = !0;
|
|
1224
1234
|
},
|
|
1225
1235
|
/** 执行删除实际操作 */
|
|
1226
1236
|
submit: () => {
|
|
1227
1237
|
FunUtil.throttle(async () => {
|
|
1228
|
-
|
|
1229
|
-
const n =
|
|
1238
|
+
l.remove.loading = !0;
|
|
1239
|
+
const n = t.option.api.delete;
|
|
1230
1240
|
try {
|
|
1231
1241
|
if (!n) return;
|
|
1232
1242
|
await n({
|
|
1233
|
-
[
|
|
1234
|
-
items:
|
|
1235
|
-
}),
|
|
1243
|
+
[t.option.table?.rowKey]: l.remove.items.map((e) => e[t.option.table?.rowKey]),
|
|
1244
|
+
items: l.remove.items
|
|
1245
|
+
}), U.success(g.tCurd("operationSuccess")), l.table.data.length <= 1 && l.page.num > 1 && (l.page.num -= 1), l.remove.close(), await l.table.getList();
|
|
1236
1246
|
} catch (e) {
|
|
1237
1247
|
console.error(e);
|
|
1238
1248
|
} finally {
|
|
1239
|
-
|
|
1249
|
+
l.remove.loading = !1;
|
|
1240
1250
|
}
|
|
1241
1251
|
});
|
|
1242
1252
|
}
|
|
1243
1253
|
},
|
|
1244
1254
|
/** 初始化curd关联所有默认与依赖配置及表单列 */
|
|
1245
1255
|
init: () => {
|
|
1246
|
-
|
|
1256
|
+
l.initCurdConfig(), l.initColumnOptions(), l.initColumnForm();
|
|
1247
1257
|
},
|
|
1248
1258
|
/** 下拉请求等数据缓存 */
|
|
1249
1259
|
apiDataMap: {},
|
|
1250
1260
|
/** 获取并绑定curd中所有下拉数据等远程依赖 */
|
|
1251
1261
|
initApiData: async (n) => {
|
|
1252
|
-
const e = [], a = (
|
|
1253
|
-
if (
|
|
1254
|
-
|
|
1262
|
+
const e = [], a = (u) => {
|
|
1263
|
+
if (u.children && u.children.length) {
|
|
1264
|
+
u.children.forEach((f) => a(f));
|
|
1255
1265
|
return;
|
|
1256
1266
|
}
|
|
1257
|
-
if (
|
|
1258
|
-
if (
|
|
1259
|
-
const
|
|
1267
|
+
if (u.type === "select" && u.options?.select?.dataApi && u.options?.select?.dataApiConfig?.[n]) {
|
|
1268
|
+
if (l.apiDataMap[u.key] && u.options?.select?.dataApiConfig?.once) return;
|
|
1269
|
+
const f = (async () => {
|
|
1260
1270
|
try {
|
|
1261
|
-
let p = await
|
|
1271
|
+
let p = await u.options?.select?.dataApi?.();
|
|
1262
1272
|
if (p) {
|
|
1263
|
-
const c =
|
|
1264
|
-
c && (p = ObjectUtil.getPathValue(p, c)),
|
|
1273
|
+
const c = u.options?.select?.dataPath;
|
|
1274
|
+
c && (p = ObjectUtil.getPathValue(p, c)), u.options.select.data = p, l.apiDataMap[u.key] = p;
|
|
1265
1275
|
}
|
|
1266
1276
|
} catch {
|
|
1267
1277
|
}
|
|
1268
1278
|
})();
|
|
1269
|
-
e.push(
|
|
1279
|
+
e.push(f);
|
|
1270
1280
|
}
|
|
1271
1281
|
};
|
|
1272
|
-
return
|
|
1273
|
-
a(
|
|
1282
|
+
return t.option.column.forEach((u) => {
|
|
1283
|
+
a(u);
|
|
1274
1284
|
}), await Promise.all(e), !0;
|
|
1275
1285
|
},
|
|
1276
1286
|
/** 初始化curd配置(option默认值合并等) */
|
|
1277
1287
|
initCurdConfig: () => {
|
|
1278
1288
|
const n = JSONUtil.cp(S.config);
|
|
1279
1289
|
n.table.emptyText = g.tCurd("noData");
|
|
1280
|
-
const e = ObjectUtil.deepMerge(n,
|
|
1290
|
+
const e = ObjectUtil.deepMerge(n, t.option || {});
|
|
1281
1291
|
Object.keys(e).forEach((a) => {
|
|
1282
|
-
|
|
1292
|
+
t.option[a] = e[a];
|
|
1283
1293
|
});
|
|
1284
1294
|
},
|
|
1285
1295
|
/**
|
|
@@ -1297,149 +1307,149 @@ const W = $.EDialog, Se = (o) => {
|
|
|
1297
1307
|
});
|
|
1298
1308
|
const e = (a) => {
|
|
1299
1309
|
if (a.table = ObjectUtil.deepMerge(n.table, a.table || {}), a.children) {
|
|
1300
|
-
a.children.forEach((
|
|
1301
|
-
e(
|
|
1310
|
+
a.children.forEach((u) => {
|
|
1311
|
+
e(u);
|
|
1302
1312
|
});
|
|
1303
1313
|
return;
|
|
1304
1314
|
}
|
|
1305
|
-
a.options = ObjectUtil.deepMerge(n.options, a.options || {}), a.form = ObjectUtil.deepMerge(n.form, a.form || {}), a.show = ObjectUtil.deepMerge(n.show, a.show || {}), a.sort = ObjectUtil.deepMerge(n.sort, a.sort || {}), a.type = a.type || n.type, a.type === "switch" && (a.options.switch.tableBeforeChange = async (
|
|
1315
|
+
a.options = ObjectUtil.deepMerge(n.options, a.options || {}), a.form = ObjectUtil.deepMerge(n.form, a.form || {}), a.show = ObjectUtil.deepMerge(n.show, a.show || {}), a.sort = ObjectUtil.deepMerge(n.sort, a.sort || {}), a.type = a.type || n.type, a.type === "switch" && (a.options.switch.tableBeforeChange = async (u, f) => {
|
|
1306
1316
|
const p = a.options?.switch;
|
|
1307
1317
|
try {
|
|
1308
1318
|
await s.value?.open({
|
|
1309
1319
|
title: g.tCurd("confirmModify"),
|
|
1310
1320
|
content: g.tCurd("confirmSwitchMessage")
|
|
1311
|
-
}),
|
|
1321
|
+
}), l.table.loading = !0;
|
|
1312
1322
|
try {
|
|
1313
|
-
return
|
|
1314
|
-
[
|
|
1315
|
-
[
|
|
1316
|
-
final(c, i,
|
|
1317
|
-
|
|
1323
|
+
return t.option.api.update ? (await t.option.api.update({
|
|
1324
|
+
[t.option.table?.rowKey]: f[t.option.table?.rowKey],
|
|
1325
|
+
[u]: f[u] === p.activeValue ? p.inactiveValue : p.activeValue,
|
|
1326
|
+
final(c, i, d) {
|
|
1327
|
+
l.table.loading = !1;
|
|
1318
1328
|
}
|
|
1319
|
-
}),
|
|
1329
|
+
}), l.table.loading = !1, U.success(g.tCurd("operationSuccess")), l.table.getList(), !0) : void 0;
|
|
1320
1330
|
} catch (c) {
|
|
1321
1331
|
return console.error(c), !1;
|
|
1322
1332
|
} finally {
|
|
1323
|
-
|
|
1333
|
+
l.table.loading = !1;
|
|
1324
1334
|
}
|
|
1325
1335
|
} catch {
|
|
1326
1336
|
return !1;
|
|
1327
1337
|
}
|
|
1328
|
-
}), a.type === "tree-select" && (a.options.treeSelect.rowKey =
|
|
1338
|
+
}), a.type === "tree-select" && (a.options.treeSelect.rowKey = t.option.table?.rowKey, a.options.treeSelect.nodeKey = t.option.table?.rowKey);
|
|
1329
1339
|
};
|
|
1330
|
-
|
|
1340
|
+
t.option.column.forEach(e), t.option.table?.column?.forEach(e);
|
|
1331
1341
|
},
|
|
1332
1342
|
/** 初始化配置并生成表单列及默认值及规则 */
|
|
1333
1343
|
initColumnForm: () => {
|
|
1334
|
-
const n =
|
|
1335
|
-
|
|
1344
|
+
const n = t.option;
|
|
1345
|
+
l.update.formColumn = [], l.table.column.show = {
|
|
1336
1346
|
list: [],
|
|
1337
1347
|
listSource: []
|
|
1338
1348
|
};
|
|
1339
|
-
const e = [], a =
|
|
1340
|
-
let
|
|
1341
|
-
const p = (
|
|
1342
|
-
if (
|
|
1343
|
-
|
|
1344
|
-
p(
|
|
1349
|
+
const e = [], a = t.option.form?.maxSpan || 12, u = t.option.form?.defaultSpan || a / 2;
|
|
1350
|
+
let f = [];
|
|
1351
|
+
const p = (d) => {
|
|
1352
|
+
if (d.children) {
|
|
1353
|
+
l.table.column.show.list.push(d.key), d.children.forEach((y) => {
|
|
1354
|
+
p(y);
|
|
1345
1355
|
});
|
|
1346
1356
|
return;
|
|
1347
1357
|
}
|
|
1348
|
-
if (
|
|
1349
|
-
|
|
1350
|
-
let
|
|
1351
|
-
const j =
|
|
1352
|
-
if (
|
|
1358
|
+
if (l.update.formDefault[d.key] = d.value, d.table.table && (d.show.table && l.table.column.show.list.push(d.key), d.table.table && l.table.column.show.listSource.push(d.key)), d.isForm) {
|
|
1359
|
+
d.form = d.form || { span: u }, d.form.span = d.form.span ?? u;
|
|
1360
|
+
let y = d.form.span, I = f.reduce((z, B) => z + B.span, y);
|
|
1361
|
+
const j = f.length;
|
|
1362
|
+
if (f.push({ item: d, span: y }), (j === 1 && f[0].span === 0 || I >= a || y === 0 && j > 1) && (e.push(f), f = []), d.rules) {
|
|
1353
1363
|
const z = {
|
|
1354
1364
|
input: g.tCurd("placeholderInput"),
|
|
1355
1365
|
select: g.tCurd("placeholderSelect")
|
|
1356
|
-
},
|
|
1357
|
-
|
|
1366
|
+
}, B = (z[d.type] || z.input) + d.label;
|
|
1367
|
+
l.update.rules[d.key] = typeof d.rules == "boolean" ? [
|
|
1358
1368
|
{
|
|
1359
1369
|
required: !0,
|
|
1360
|
-
message:
|
|
1370
|
+
message: B,
|
|
1361
1371
|
trigger: "blur"
|
|
1362
1372
|
}
|
|
1363
|
-
] :
|
|
1373
|
+
] : d.rules;
|
|
1364
1374
|
}
|
|
1365
1375
|
}
|
|
1366
|
-
}, c = (
|
|
1367
|
-
|
|
1376
|
+
}, c = (d, y) => {
|
|
1377
|
+
d.isForm = y, Array.isArray(d.children) && d.children.forEach((I) => c(I, y));
|
|
1368
1378
|
};
|
|
1369
|
-
n.column.forEach((
|
|
1370
|
-
|
|
1371
|
-
}),
|
|
1372
|
-
c(
|
|
1373
|
-
}),
|
|
1374
|
-
const i =
|
|
1375
|
-
i && Object.keys(i).forEach((
|
|
1376
|
-
|
|
1377
|
-
}), n.column.forEach((
|
|
1378
|
-
|
|
1379
|
-
}),
|
|
1379
|
+
n.column.forEach((d) => {
|
|
1380
|
+
d.isForm = !0, c(d, !0), p(d);
|
|
1381
|
+
}), t.option.table?.column?.forEach((d) => {
|
|
1382
|
+
c(d, !1), p(d);
|
|
1383
|
+
}), l.search.column.list = n.column.concat(n.table?.column || []), l.table.column.list = l.search.column.list.filter((d) => d.table?.table), l.search.column.list.sort((d, y) => d.sort?.search - y.sort?.search), l.table.column.list.sort((d, y) => d.sort?.table - y.sort?.table), f.length > 0 && e.push(f), l.update.formColumn = e;
|
|
1384
|
+
const i = t.option.search?.formDefault;
|
|
1385
|
+
i && Object.keys(i).forEach((d) => {
|
|
1386
|
+
l.search.formDefault[d] = i[d];
|
|
1387
|
+
}), n.column.forEach((d) => {
|
|
1388
|
+
d.show?.search || (l.search.formDefault[d.key] = void 0);
|
|
1389
|
+
}), l.search.form = JSONUtil.cp(l.search.formDefault);
|
|
1380
1390
|
}
|
|
1381
1391
|
});
|
|
1382
|
-
return
|
|
1383
|
-
|
|
1384
|
-
}), { conf:
|
|
1385
|
-
}, Oe = { class: "dialog-footer" }, Fe = /* @__PURE__ */
|
|
1392
|
+
return l.init(), ne(() => {
|
|
1393
|
+
t.option.init !== !1 && l.table.getList();
|
|
1394
|
+
}), { conf: l, switchConfirmRef: s, ruleFormRef: r };
|
|
1395
|
+
}, Oe = { class: "dialog-footer" }, Fe = /* @__PURE__ */ N({
|
|
1386
1396
|
__name: "switchConfirm",
|
|
1387
|
-
setup(
|
|
1388
|
-
const r =
|
|
1397
|
+
setup(t, { expose: s }) {
|
|
1398
|
+
const r = K(!1), l = K("确认修改"), n = K("确认要修改状态吗?");
|
|
1389
1399
|
let e = null, a = null;
|
|
1390
|
-
const
|
|
1391
|
-
e = i, a =
|
|
1392
|
-
})),
|
|
1400
|
+
const u = (c) => (c?.title && (l.value = c.title), c?.content && (n.value = c.content), r.value = !0, new Promise((i, d) => {
|
|
1401
|
+
e = i, a = d;
|
|
1402
|
+
})), f = () => {
|
|
1393
1403
|
r.value = !1, e?.(!0), e = null, a = null;
|
|
1394
1404
|
}, p = () => {
|
|
1395
1405
|
r.value = !1, a?.(new Error("用户取消操作")), e = null, a = null;
|
|
1396
1406
|
};
|
|
1397
1407
|
return s({
|
|
1398
|
-
open:
|
|
1399
|
-
}), (c, i) => (
|
|
1408
|
+
open: u
|
|
1409
|
+
}), (c, i) => (m(), b(o(Y), {
|
|
1400
1410
|
modelValue: r.value,
|
|
1401
|
-
"onUpdate:modelValue": i[0] || (i[0] = (
|
|
1402
|
-
title:
|
|
1411
|
+
"onUpdate:modelValue": i[0] || (i[0] = (d) => r.value = d),
|
|
1412
|
+
title: l.value,
|
|
1403
1413
|
"close-on-click-modal": !1,
|
|
1404
1414
|
width: "400px"
|
|
1405
1415
|
}, {
|
|
1406
|
-
footer:
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
default:
|
|
1416
|
+
footer: h(() => [
|
|
1417
|
+
$("span", Oe, [
|
|
1418
|
+
V(o(F), { onClick: p }, {
|
|
1419
|
+
default: h(() => [...i[1] || (i[1] = [
|
|
1410
1420
|
E("取消", -1)
|
|
1411
1421
|
])]),
|
|
1412
1422
|
_: 1
|
|
1413
1423
|
}),
|
|
1414
|
-
|
|
1424
|
+
V(o(F), {
|
|
1415
1425
|
type: "primary",
|
|
1416
|
-
onClick:
|
|
1426
|
+
onClick: f
|
|
1417
1427
|
}, {
|
|
1418
|
-
default:
|
|
1428
|
+
default: h(() => [...i[2] || (i[2] = [
|
|
1419
1429
|
E("确认", -1)
|
|
1420
1430
|
])]),
|
|
1421
1431
|
_: 1
|
|
1422
1432
|
})
|
|
1423
1433
|
])
|
|
1424
1434
|
]),
|
|
1425
|
-
default:
|
|
1426
|
-
|
|
1435
|
+
default: h(() => [
|
|
1436
|
+
$("div", null, x(n.value), 1)
|
|
1427
1437
|
]),
|
|
1428
1438
|
_: 1
|
|
1429
1439
|
}, 8, ["modelValue", "title"]));
|
|
1430
1440
|
}
|
|
1431
|
-
}), re = (
|
|
1432
|
-
const r =
|
|
1433
|
-
for (const [
|
|
1434
|
-
r[
|
|
1441
|
+
}), re = (t, s) => {
|
|
1442
|
+
const r = t.__vccOpts || t;
|
|
1443
|
+
for (const [l, n] of s)
|
|
1444
|
+
r[l] = n;
|
|
1435
1445
|
return r;
|
|
1436
1446
|
}, Ie = {}, Me = {
|
|
1437
1447
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1438
1448
|
viewBox: "0 0 1024 1024"
|
|
1439
1449
|
};
|
|
1440
|
-
function je(
|
|
1441
|
-
return
|
|
1442
|
-
|
|
1450
|
+
function je(t, s) {
|
|
1451
|
+
return m(), w("svg", Me, [...s[0] || (s[0] = [
|
|
1452
|
+
$("path", {
|
|
1443
1453
|
fill: "currentColor",
|
|
1444
1454
|
d: "M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"
|
|
1445
1455
|
}, null, -1)
|
|
@@ -1450,183 +1460,202 @@ const Le = /* @__PURE__ */ re(Ie, [["render", je]]), ze = {}, Te = {
|
|
|
1450
1460
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1451
1461
|
viewBox: "0 0 1024 1024"
|
|
1452
1462
|
};
|
|
1453
|
-
function Re(
|
|
1454
|
-
return
|
|
1455
|
-
|
|
1463
|
+
function Re(t, s) {
|
|
1464
|
+
return m(), w("svg", Te, [...s[0] || (s[0] = [
|
|
1465
|
+
$("path", {
|
|
1456
1466
|
fill: "currentColor",
|
|
1457
1467
|
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592q0-64.416-42.24-101.376c-28.16-25.344-65.472-37.312-111.232-37.312m-12.672 406.208a54.27 54.27 0 0 0-38.72 14.784 49.4 49.4 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.85 54.85 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.97 51.97 0 0 0-15.488-38.016 55.94 55.94 0 0 0-39.424-14.784"
|
|
1458
1468
|
}, null, -1)
|
|
1459
1469
|
])]);
|
|
1460
1470
|
}
|
|
1461
|
-
const Ae = /* @__PURE__ */ re(ze, [["render", Re]]), Pe = { class: "row flex-center table-header-label" }, Ke = { class: "table-header-tooltip" }, Ne = ["onClick"], Be = /* @__PURE__ */
|
|
1471
|
+
const Ae = /* @__PURE__ */ re(ze, [["render", Re]]), Pe = { class: "row flex-center table-header-label" }, Ke = { class: "table-header-tooltip" }, Ne = ["onClick"], Be = /* @__PURE__ */ N({
|
|
1462
1472
|
__name: "tableColumn",
|
|
1463
1473
|
props: {
|
|
1464
1474
|
conf: {},
|
|
1465
1475
|
columnList: {},
|
|
1466
1476
|
option: {}
|
|
1467
1477
|
},
|
|
1468
|
-
setup(
|
|
1469
|
-
const s =
|
|
1470
|
-
return (
|
|
1471
|
-
const
|
|
1472
|
-
return
|
|
1473
|
-
key:
|
|
1478
|
+
setup(t) {
|
|
1479
|
+
const s = U.isFun, r = ye().type;
|
|
1480
|
+
return (l, n) => {
|
|
1481
|
+
const e = H("el-tooltip");
|
|
1482
|
+
return m(!0), w(D, null, M(t.columnList, (a) => (m(), w(D, {
|
|
1483
|
+
key: a.key
|
|
1474
1484
|
}, [
|
|
1475
|
-
|
|
1485
|
+
t.conf.table.column.show.list.includes(a.key) ? (m(), b(o(Z), C({
|
|
1476
1486
|
key: 0,
|
|
1477
|
-
prop:
|
|
1478
|
-
label:
|
|
1479
|
-
}, { ref_for: !0 },
|
|
1480
|
-
header:
|
|
1481
|
-
k(
|
|
1482
|
-
|
|
1483
|
-
|
|
1487
|
+
prop: a.key,
|
|
1488
|
+
label: a.label
|
|
1489
|
+
}, { ref_for: !0 }, a.table), {
|
|
1490
|
+
header: h(() => [
|
|
1491
|
+
k(l.$slots, "table-header-" + a.key, { item: a }, () => [
|
|
1492
|
+
$("div", Pe, [
|
|
1493
|
+
a.table?.tooltip ? (m(), b(e, {
|
|
1484
1494
|
key: 0,
|
|
1485
1495
|
effect: "dark",
|
|
1486
|
-
content:
|
|
1496
|
+
content: a.table?.tooltip,
|
|
1487
1497
|
placement: "top"
|
|
1488
1498
|
}, {
|
|
1489
|
-
default:
|
|
1490
|
-
|
|
1491
|
-
|
|
1499
|
+
default: h(() => [
|
|
1500
|
+
$("span", Ke, [
|
|
1501
|
+
V(Ae)
|
|
1492
1502
|
])
|
|
1493
1503
|
]),
|
|
1494
1504
|
_: 1
|
|
1495
|
-
}, 8, ["content"])) :
|
|
1496
|
-
E(" " + x(
|
|
1505
|
+
}, 8, ["content"])) : v("", !0),
|
|
1506
|
+
E(" " + x(a.label), 1)
|
|
1497
1507
|
])
|
|
1498
1508
|
])
|
|
1499
1509
|
]),
|
|
1500
|
-
default:
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
(
|
|
1504
|
-
conf:
|
|
1505
|
-
columnList:
|
|
1506
|
-
option:
|
|
1507
|
-
},
|
|
1508
|
-
M(
|
|
1509
|
-
name:
|
|
1510
|
-
fn:
|
|
1511
|
-
k(
|
|
1510
|
+
default: h(({ row: u }) => [
|
|
1511
|
+
a.children ? (m(), w(D, { key: 0 }, [
|
|
1512
|
+
n[0] || (n[0] = E(" ", -1)),
|
|
1513
|
+
(m(), b(G(o(r)), {
|
|
1514
|
+
conf: t.conf,
|
|
1515
|
+
columnList: a.children,
|
|
1516
|
+
option: t.option
|
|
1517
|
+
}, se({ _: 2 }, [
|
|
1518
|
+
M(l.$slots, (f, p) => ({
|
|
1519
|
+
name: p,
|
|
1520
|
+
fn: h((c) => [
|
|
1521
|
+
k(l.$slots, p, C({ ref_for: !0 }, c || {}))
|
|
1512
1522
|
])
|
|
1513
1523
|
}))
|
|
1514
1524
|
]), 1032, ["conf", "columnList", "option"]))
|
|
1515
|
-
], 64)) : (
|
|
1516
|
-
|
|
1517
|
-
|
|
1525
|
+
], 64)) : (m(), w(D, { key: 1 }, [
|
|
1526
|
+
o(s)(a.show?.form, t.conf.inlineEdit.form, o(U).EDialog.Update) && t.option.table?.inlineEdit && t.conf.inlineEdit.row === u && (a.type === "input" || a.type === "select") ? (m(), w(D, { key: 0 }, [
|
|
1527
|
+
a.type === "input" ? (m(), b(o(q), C({
|
|
1518
1528
|
key: 0,
|
|
1519
|
-
modelValue:
|
|
1520
|
-
"onUpdate:modelValue": (
|
|
1521
|
-
}, { ref_for: !0 },
|
|
1529
|
+
modelValue: t.conf.inlineEdit.form[a.key],
|
|
1530
|
+
"onUpdate:modelValue": (f) => t.conf.inlineEdit.form[a.key] = f
|
|
1531
|
+
}, { ref_for: !0 }, a.options?.input, {
|
|
1522
1532
|
size: "small",
|
|
1523
1533
|
style: { width: "100%" },
|
|
1524
|
-
onKeyup:
|
|
1525
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "onKeyup"])) :
|
|
1534
|
+
onKeyup: ge(t.conf.inlineEdit.submit, ["enter"])
|
|
1535
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "onKeyup"])) : a.type === "select" ? (m(), b(o(W), C({
|
|
1526
1536
|
key: 1,
|
|
1527
|
-
modelValue:
|
|
1528
|
-
"onUpdate:modelValue": (
|
|
1529
|
-
}, { ref_for: !0 },
|
|
1537
|
+
modelValue: t.conf.inlineEdit.form[a.key],
|
|
1538
|
+
"onUpdate:modelValue": (f) => t.conf.inlineEdit.form[a.key] = f
|
|
1539
|
+
}, { ref_for: !0 }, a.options?.select, {
|
|
1530
1540
|
size: "small",
|
|
1531
1541
|
style: { width: "100%" }
|
|
1532
1542
|
}), {
|
|
1533
|
-
default:
|
|
1534
|
-
(
|
|
1535
|
-
key:
|
|
1536
|
-
label:
|
|
1537
|
-
value:
|
|
1543
|
+
default: h(() => [
|
|
1544
|
+
(m(!0), w(D, null, M(a.options?.select?.data, (f) => (m(), b(o(P), {
|
|
1545
|
+
key: f.value,
|
|
1546
|
+
label: f.label,
|
|
1547
|
+
value: f.value
|
|
1538
1548
|
}, null, 8, ["label", "value"]))), 128))
|
|
1539
1549
|
]),
|
|
1540
1550
|
_: 2
|
|
1541
|
-
}, 1040, ["modelValue", "onUpdate:modelValue"])) :
|
|
1542
|
-
], 64)) : k(
|
|
1551
|
+
}, 1040, ["modelValue", "onUpdate:modelValue"])) : v("", !0)
|
|
1552
|
+
], 64)) : k(l.$slots, "table-" + a.key, {
|
|
1543
1553
|
key: 1,
|
|
1544
|
-
row:
|
|
1545
|
-
item:
|
|
1554
|
+
row: u,
|
|
1555
|
+
item: a
|
|
1546
1556
|
}, () => [
|
|
1547
|
-
|
|
1557
|
+
a.type === "switch" ? (m(), b(o(_), C({
|
|
1548
1558
|
key: 0,
|
|
1549
|
-
modelValue: a
|
|
1550
|
-
"onUpdate:modelValue": (
|
|
1551
|
-
"before-change": () =>
|
|
1552
|
-
}, { ref_for: !0 },
|
|
1559
|
+
modelValue: u[a.key],
|
|
1560
|
+
"onUpdate:modelValue": (f) => u[a.key] = f,
|
|
1561
|
+
"before-change": () => a.options?.switch?.tableBeforeChange?.(a.key, u)
|
|
1562
|
+
}, { ref_for: !0 }, a.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "before-change"])) : (m(), w("span", {
|
|
1553
1563
|
key: 1,
|
|
1554
|
-
style:
|
|
1555
|
-
"--table-text-click-color":
|
|
1564
|
+
style: ie({
|
|
1565
|
+
"--table-text-click-color": a.table?.click?.color
|
|
1556
1566
|
}),
|
|
1557
|
-
class: T({ "table-text-click":
|
|
1558
|
-
onClick: (
|
|
1559
|
-
}, x(a[
|
|
1567
|
+
class: T({ "table-text-click": a.table?.click?.callback }),
|
|
1568
|
+
onClick: (f) => a.table?.click?.callback?.(u)
|
|
1569
|
+
}, x(a.table?.format ? a.table?.format(u) : u[a.key]), 15, Ne))
|
|
1560
1570
|
])
|
|
1561
1571
|
], 64))
|
|
1562
1572
|
]),
|
|
1563
1573
|
_: 2
|
|
1564
|
-
}, 1040, ["prop", "label"])) :
|
|
1574
|
+
}, 1040, ["prop", "label"])) : v("", !0)
|
|
1565
1575
|
], 64))), 128);
|
|
1566
1576
|
};
|
|
1567
1577
|
}
|
|
1568
|
-
}), le = /* @__PURE__ */
|
|
1578
|
+
}), le = /* @__PURE__ */ N({
|
|
1569
1579
|
__name: "formColumn",
|
|
1570
1580
|
props: {
|
|
1571
1581
|
conf: {},
|
|
1572
1582
|
item: {}
|
|
1573
1583
|
},
|
|
1574
|
-
setup(
|
|
1575
|
-
return (s, r) =>
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
modelValue:
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
modelValue:
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
disabled:
|
|
1629
|
-
|
|
1584
|
+
setup(t) {
|
|
1585
|
+
return (s, r) => {
|
|
1586
|
+
const l = H("el-radio"), n = H("el-radio-group");
|
|
1587
|
+
return t.item.item.type === "input" ? (m(), b(o(q), C({
|
|
1588
|
+
key: 0,
|
|
1589
|
+
modelValue: t.conf.update.form[t.item.item.key],
|
|
1590
|
+
"onUpdate:modelValue": r[0] || (r[0] = (e) => t.conf.update.form[t.item.item.key] = e)
|
|
1591
|
+
}, t.item.item.options?.input, O(t.item.item.options?.input?.on || {}), {
|
|
1592
|
+
disabled: t.conf.update.getDisabled(t.item.item)
|
|
1593
|
+
}), null, 16, ["modelValue", "disabled"])) : t.item.item.type === "switch" ? (m(), b(o(_), C({
|
|
1594
|
+
key: 1,
|
|
1595
|
+
modelValue: t.conf.update.form[t.item.item.key],
|
|
1596
|
+
"onUpdate:modelValue": r[1] || (r[1] = (e) => t.conf.update.form[t.item.item.key] = e)
|
|
1597
|
+
}, t.item.item.options?.switch, {
|
|
1598
|
+
disabled: t.conf.update.getDisabled(t.item.item)
|
|
1599
|
+
}), null, 16, ["modelValue", "disabled"])) : t.item.item.type === "select" ? (m(), b(o(W), C({
|
|
1600
|
+
key: 2,
|
|
1601
|
+
modelValue: t.conf.update.form[t.item.item.key],
|
|
1602
|
+
"onUpdate:modelValue": r[2] || (r[2] = (e) => t.conf.update.form[t.item.item.key] = e)
|
|
1603
|
+
}, t.item.item.options?.select, O(t.item.item.options?.select?.on || {}), {
|
|
1604
|
+
disabled: t.conf.update.getDisabled(t.item.item),
|
|
1605
|
+
style: { width: "100%" }
|
|
1606
|
+
}), {
|
|
1607
|
+
default: h(() => [
|
|
1608
|
+
(m(!0), w(D, null, M(t.item.item.options?.select?.data, (e) => (m(), b(o(P), {
|
|
1609
|
+
key: e.value,
|
|
1610
|
+
label: e.label,
|
|
1611
|
+
value: e.value
|
|
1612
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
1613
|
+
]),
|
|
1614
|
+
_: 1
|
|
1615
|
+
}, 16, ["modelValue", "disabled"])) : t.item.item.type === "radio" ? (m(), b(n, C({
|
|
1616
|
+
key: 3,
|
|
1617
|
+
modelValue: t.conf.update.form[t.item.item.key],
|
|
1618
|
+
"onUpdate:modelValue": r[3] || (r[3] = (e) => t.conf.update.form[t.item.item.key] = e)
|
|
1619
|
+
}, t.item.item.options?.radio, O(t.item.item.options?.radio?.on || {}), {
|
|
1620
|
+
disabled: t.conf.update.getDisabled(t.item.item),
|
|
1621
|
+
style: { width: "100%" }
|
|
1622
|
+
}), {
|
|
1623
|
+
default: h(() => [
|
|
1624
|
+
(m(!0), w(D, null, M(t.item.item.options?.radio?.data, (e) => (m(), b(l, {
|
|
1625
|
+
key: e.value,
|
|
1626
|
+
label: e.label,
|
|
1627
|
+
value: e.value
|
|
1628
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
1629
|
+
]),
|
|
1630
|
+
_: 1
|
|
1631
|
+
}, 16, ["modelValue", "disabled"])) : t.item.item.type === "list" ? (m(), b(oe, C({
|
|
1632
|
+
key: 4,
|
|
1633
|
+
row: t.conf.update.form,
|
|
1634
|
+
field: t.item.item.key
|
|
1635
|
+
}, t.item.item.options?.list, O(t.item.item.options?.list?.on || {}), {
|
|
1636
|
+
disabled: t.conf.update.getDisabled(t.item.item),
|
|
1637
|
+
style: { width: "100%" }
|
|
1638
|
+
}), null, 16, ["row", "field", "disabled"])) : t.item.item.type === "tree-select" ? (m(), b(o(ae), C({
|
|
1639
|
+
key: 5,
|
|
1640
|
+
modelValue: t.conf.update.form[t.item.item.key],
|
|
1641
|
+
"onUpdate:modelValue": r[4] || (r[4] = (e) => t.conf.update.form[t.item.item.key] = e)
|
|
1642
|
+
}, t.item.item.options?.treeSelect, O(t.item.item.options?.treeSelect?.on || {}), {
|
|
1643
|
+
disabled: t.conf.update.getDisabled(t.item.item),
|
|
1644
|
+
style: { width: "100%" }
|
|
1645
|
+
}), null, 16, ["modelValue", "disabled"])) : t.item.item.type === "datetime" ? (m(), b(o(ee), C({
|
|
1646
|
+
key: 6,
|
|
1647
|
+
modelValue: t.conf.update.form[t.item.item.key],
|
|
1648
|
+
"onUpdate:modelValue": r[5] || (r[5] = (e) => t.conf.update.form[t.item.item.key] = e)
|
|
1649
|
+
}, t.item.item.options?.datetime, O(t.item.item.options?.datetime?.on || {}), {
|
|
1650
|
+
disabled: t.conf.update.getDisabled(t.item.item)
|
|
1651
|
+
}), null, 16, ["modelValue", "disabled"])) : t.item.item.type && o(L).customComponent[t.item.item.type] ? (m(), b(G(o(L).customComponent[t.item.item.type]), C({
|
|
1652
|
+
key: 7,
|
|
1653
|
+
modelValue: t.conf.update.form[t.item.item.key],
|
|
1654
|
+
"onUpdate:modelValue": r[6] || (r[6] = (e) => t.conf.update.form[t.item.item.key] = e)
|
|
1655
|
+
}, t.item.item.options?.[t.item.item.type], O(t.item.item.options?.[t.item.item.type]?.on || {}), {
|
|
1656
|
+
disabled: t.conf.update.getDisabled(t.item.item)
|
|
1657
|
+
}), null, 16, ["modelValue", "disabled"])) : v("", !0);
|
|
1658
|
+
};
|
|
1630
1659
|
}
|
|
1631
1660
|
}), Je = { class: "col relative cc1-form-box" }, We = {
|
|
1632
1661
|
class: "absolute row fit",
|
|
@@ -1646,7 +1675,7 @@ const Ae = /* @__PURE__ */ re(ze, [["render", Re]]), Pe = { class: "row flex-cen
|
|
|
1646
1675
|
}, nt = { class: "col" }, it = {
|
|
1647
1676
|
class: "row form-item-content",
|
|
1648
1677
|
style: { width: "100%" }
|
|
1649
|
-
}, st = { class: "col" }, rt = { class: "dialog-footer" }, dt = { class: "dialog-footer" }, ut = /* @__PURE__ */
|
|
1678
|
+
}, st = { class: "col" }, rt = { class: "dialog-footer" }, dt = { class: "dialog-footer" }, ut = /* @__PURE__ */ N({
|
|
1650
1679
|
__name: "index",
|
|
1651
1680
|
props: {
|
|
1652
1681
|
/**
|
|
@@ -1656,198 +1685,198 @@ const Ae = /* @__PURE__ */ re(ze, [["render", Re]]), Pe = { class: "row flex-cen
|
|
|
1656
1685
|
default: {}
|
|
1657
1686
|
}
|
|
1658
1687
|
},
|
|
1659
|
-
setup(
|
|
1660
|
-
const r =
|
|
1688
|
+
setup(t, { expose: s }) {
|
|
1689
|
+
const r = U.EDialog, l = t, n = U.isFun, { conf: e, switchConfirmRef: a, ruleFormRef: u } = Se(l);
|
|
1661
1690
|
return s({
|
|
1662
1691
|
conf: e
|
|
1663
|
-
}), (
|
|
1664
|
-
const c =
|
|
1665
|
-
return
|
|
1666
|
-
|
|
1667
|
-
k(
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
model:
|
|
1692
|
+
}), (f, p) => {
|
|
1693
|
+
const c = we("loading");
|
|
1694
|
+
return m(), w("div", Je, [
|
|
1695
|
+
$("div", We, [
|
|
1696
|
+
k(f.$slots, "box-left"),
|
|
1697
|
+
$("div", He, [
|
|
1698
|
+
t.option.search?.show !== !1 ? (m(), w("div", qe, [
|
|
1699
|
+
V(o(Q), {
|
|
1700
|
+
model: o(e).search.form,
|
|
1672
1701
|
inline: ""
|
|
1673
1702
|
}, {
|
|
1674
|
-
default:
|
|
1675
|
-
k(
|
|
1676
|
-
row:
|
|
1703
|
+
default: h(() => [
|
|
1704
|
+
k(f.$slots, "search-start", {
|
|
1705
|
+
row: o(e).search.form
|
|
1677
1706
|
}),
|
|
1678
|
-
(
|
|
1707
|
+
(m(!0), w(D, null, M(o(e).search.column.list, (i) => (m(), w(D, {
|
|
1679
1708
|
key: i.key
|
|
1680
1709
|
}, [
|
|
1681
|
-
(typeof i.show?.search == "function" ? i.show?.search(
|
|
1710
|
+
(typeof i.show?.search == "function" ? i.show?.search(o(e).search.form) : i.show?.search) ? (m(), b(o(J), {
|
|
1682
1711
|
key: 0,
|
|
1683
1712
|
label: typeof i.text?.search?.label == "string" ? i.text?.search?.label : i.label,
|
|
1684
1713
|
class: T({
|
|
1685
1714
|
"hide-label": typeof i.text?.search?.label == "boolean" ? !i.text?.search?.label : !1
|
|
1686
1715
|
})
|
|
1687
1716
|
}, {
|
|
1688
|
-
default:
|
|
1689
|
-
k(
|
|
1690
|
-
row:
|
|
1717
|
+
default: h(() => [
|
|
1718
|
+
k(f.$slots, "search-" + i.key, {
|
|
1719
|
+
row: o(e).search.form
|
|
1691
1720
|
}, () => [
|
|
1692
|
-
i.type === "input" ? (
|
|
1721
|
+
i.type === "input" ? (m(), b(o(q), C({
|
|
1693
1722
|
key: 0,
|
|
1694
|
-
modelValue:
|
|
1695
|
-
"onUpdate:modelValue": (
|
|
1696
|
-
placeholder:
|
|
1723
|
+
modelValue: o(e).search.form[i.key],
|
|
1724
|
+
"onUpdate:modelValue": (d) => o(e).search.form[i.key] = d,
|
|
1725
|
+
placeholder: o(e).search.getPlaceholder(i),
|
|
1697
1726
|
clearable: "",
|
|
1698
1727
|
disabled: i.disabled?.search
|
|
1699
|
-
}, { ref_for: !0 }, i.options?.input, O(i.options?.input?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : i.type === "switch" ? (
|
|
1728
|
+
}, { ref_for: !0 }, i.options?.input, O(i.options?.input?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : i.type === "switch" ? (m(), b(o(W), C({
|
|
1700
1729
|
key: 1,
|
|
1701
|
-
modelValue:
|
|
1702
|
-
"onUpdate:modelValue": (
|
|
1703
|
-
placeholder:
|
|
1730
|
+
modelValue: o(e).search.form[i.key],
|
|
1731
|
+
"onUpdate:modelValue": (d) => o(e).search.form[i.key] = d,
|
|
1732
|
+
placeholder: o(e).search.getPlaceholder(i, o(g).tCurd("placeholderSelect")),
|
|
1704
1733
|
clearable: "",
|
|
1705
1734
|
disabled: i.disabled?.search
|
|
1706
1735
|
}, { ref_for: !0 }, i.options?.switch, O(i.options?.switch?.on || {})), {
|
|
1707
|
-
default:
|
|
1708
|
-
(
|
|
1736
|
+
default: h(() => [
|
|
1737
|
+
(m(), b(o(P), {
|
|
1709
1738
|
key: i.options?.switch?.activeValue,
|
|
1710
1739
|
label: i.options?.switch?.activeLabel,
|
|
1711
1740
|
value: i.options?.switch?.activeValue
|
|
1712
1741
|
}, null, 8, ["label", "value"])),
|
|
1713
|
-
(
|
|
1742
|
+
(m(), b(o(P), {
|
|
1714
1743
|
key: i.options?.switch?.inactiveValue,
|
|
1715
1744
|
label: i.options?.switch?.inactiveLabel,
|
|
1716
1745
|
value: i.options?.switch?.inactiveValue
|
|
1717
1746
|
}, null, 8, ["label", "value"]))
|
|
1718
1747
|
]),
|
|
1719
1748
|
_: 2
|
|
1720
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : i.type === "select" ? (
|
|
1749
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : i.type === "select" ? (m(), b(o(W), C({
|
|
1721
1750
|
key: 2,
|
|
1722
|
-
modelValue:
|
|
1723
|
-
"onUpdate:modelValue": (
|
|
1724
|
-
placeholder:
|
|
1751
|
+
modelValue: o(e).search.form[i.key],
|
|
1752
|
+
"onUpdate:modelValue": (d) => o(e).search.form[i.key] = d,
|
|
1753
|
+
placeholder: o(e).search.getPlaceholder(i, o(g).tCurd("placeholderSelect")),
|
|
1725
1754
|
clearable: "",
|
|
1726
1755
|
disabled: i.disabled?.search
|
|
1727
1756
|
}, { ref_for: !0 }, i.options?.select, O(i.options?.select?.on || {})), {
|
|
1728
|
-
default:
|
|
1729
|
-
(
|
|
1730
|
-
key:
|
|
1731
|
-
label:
|
|
1732
|
-
value:
|
|
1757
|
+
default: h(() => [
|
|
1758
|
+
(m(!0), w(D, null, M(i.options?.select?.data, (d) => (m(), b(o(P), {
|
|
1759
|
+
key: d.value,
|
|
1760
|
+
label: d.label,
|
|
1761
|
+
value: d.value
|
|
1733
1762
|
}, null, 8, ["label", "value"]))), 128))
|
|
1734
1763
|
]),
|
|
1735
1764
|
_: 2
|
|
1736
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : i.type === "datetime" ? (
|
|
1765
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : i.type === "datetime" ? (m(), b(o(ee), C({
|
|
1737
1766
|
key: 3,
|
|
1738
|
-
modelValue:
|
|
1739
|
-
"onUpdate:modelValue": (
|
|
1767
|
+
modelValue: o(e).search.form[i.key],
|
|
1768
|
+
"onUpdate:modelValue": (d) => o(e).search.form[i.key] = d
|
|
1740
1769
|
}, { ref_for: !0 }, i.options?.datetime, O(i.options?.datetime?.on || {}), {
|
|
1741
1770
|
disabled: i.disabled?.search
|
|
1742
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : i.type &&
|
|
1771
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : i.type && o(L).customComponent[i.type] ? (m(), b(G(o(L).customComponent[i.type]), C({
|
|
1743
1772
|
key: 4,
|
|
1744
|
-
modelValue:
|
|
1745
|
-
"onUpdate:modelValue": (
|
|
1773
|
+
modelValue: o(e).search.form[i.key],
|
|
1774
|
+
"onUpdate:modelValue": (d) => o(e).search.form[i.key] = d
|
|
1746
1775
|
}, { ref_for: !0 }, i.options?.[i.type], O(i.options?.[i.type]?.on || {}), {
|
|
1747
1776
|
disabled: i.disabled?.search
|
|
1748
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
1777
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : v("", !0)
|
|
1749
1778
|
]),
|
|
1750
|
-
k(
|
|
1751
|
-
row:
|
|
1779
|
+
k(f.$slots, "search-" + i.key + "-right", {
|
|
1780
|
+
row: o(e).search.form
|
|
1752
1781
|
})
|
|
1753
1782
|
]),
|
|
1754
1783
|
_: 2
|
|
1755
|
-
}, 1032, ["label", "class"])) :
|
|
1784
|
+
}, 1032, ["label", "class"])) : v("", !0)
|
|
1756
1785
|
], 64))), 128)),
|
|
1757
|
-
k(
|
|
1758
|
-
row:
|
|
1786
|
+
k(f.$slots, "search-center", {
|
|
1787
|
+
row: o(e).search.form
|
|
1759
1788
|
}),
|
|
1760
|
-
|
|
1761
|
-
default:
|
|
1762
|
-
|
|
1789
|
+
t.option.tools?.search || t.option.tools?.reset ? (m(), b(o(J), { key: 0 }, {
|
|
1790
|
+
default: h(() => [
|
|
1791
|
+
t.option.tools?.search ? (m(), b(o(F), {
|
|
1763
1792
|
key: 0,
|
|
1764
1793
|
type: "primary",
|
|
1765
|
-
onClick:
|
|
1794
|
+
onClick: o(e).search.submit
|
|
1766
1795
|
}, {
|
|
1767
|
-
default:
|
|
1768
|
-
E(x(
|
|
1796
|
+
default: h(() => [
|
|
1797
|
+
E(x(o(g).tCurd("search")), 1)
|
|
1769
1798
|
]),
|
|
1770
1799
|
_: 1
|
|
1771
|
-
}, 8, ["onClick"])) :
|
|
1772
|
-
|
|
1800
|
+
}, 8, ["onClick"])) : v("", !0),
|
|
1801
|
+
t.option.tools?.reset ? (m(), b(o(F), {
|
|
1773
1802
|
key: 1,
|
|
1774
|
-
onClick:
|
|
1803
|
+
onClick: o(e).search.reset
|
|
1775
1804
|
}, {
|
|
1776
|
-
default:
|
|
1777
|
-
E(x(
|
|
1805
|
+
default: h(() => [
|
|
1806
|
+
E(x(o(g).tCurd("reset")), 1)
|
|
1778
1807
|
]),
|
|
1779
1808
|
_: 1
|
|
1780
|
-
}, 8, ["onClick"])) :
|
|
1809
|
+
}, 8, ["onClick"])) : v("", !0)
|
|
1781
1810
|
]),
|
|
1782
1811
|
_: 1
|
|
1783
|
-
})) :
|
|
1784
|
-
k(
|
|
1785
|
-
row:
|
|
1812
|
+
})) : v("", !0),
|
|
1813
|
+
k(f.$slots, "search-end", {
|
|
1814
|
+
row: o(e).search.form
|
|
1786
1815
|
})
|
|
1787
1816
|
]),
|
|
1788
1817
|
_: 3
|
|
1789
1818
|
}, 8, ["model"])
|
|
1790
|
-
])) :
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1819
|
+
])) : v("", !0),
|
|
1820
|
+
$("div", Ge, [
|
|
1821
|
+
$("div", Xe, [
|
|
1822
|
+
o(n)(t.option.tools?.add) ? (m(), w("div", Qe, [
|
|
1823
|
+
V(o(F), {
|
|
1795
1824
|
type: "primary",
|
|
1796
|
-
onClick: p[0] || (p[0] = (i) =>
|
|
1825
|
+
onClick: p[0] || (p[0] = (i) => o(e).update.open(o(r).Insert))
|
|
1797
1826
|
}, {
|
|
1798
|
-
default:
|
|
1799
|
-
E(x(
|
|
1827
|
+
default: h(() => [
|
|
1828
|
+
E(x(o(g).tCurd("add")), 1)
|
|
1800
1829
|
]),
|
|
1801
1830
|
_: 1
|
|
1802
1831
|
})
|
|
1803
|
-
])) :
|
|
1804
|
-
|
|
1805
|
-
|
|
1832
|
+
])) : v("", !0),
|
|
1833
|
+
t.option.table?.selectable && o(n)(t.option.tools?.delete) ? (m(), w("div", Ye, [
|
|
1834
|
+
V(o(F), {
|
|
1806
1835
|
type: "danger",
|
|
1807
|
-
onClick: p[1] || (p[1] = (i) =>
|
|
1836
|
+
onClick: p[1] || (p[1] = (i) => o(e).remove.open(o(e).table.selection.list))
|
|
1808
1837
|
}, {
|
|
1809
|
-
default:
|
|
1810
|
-
E(x(
|
|
1838
|
+
default: h(() => [
|
|
1839
|
+
E(x(o(g).tCurd("delete")), 1)
|
|
1811
1840
|
]),
|
|
1812
1841
|
_: 1
|
|
1813
1842
|
})
|
|
1814
|
-
])) :
|
|
1815
|
-
|
|
1816
|
-
|
|
1843
|
+
])) : v("", !0),
|
|
1844
|
+
t.option.tools?.expand ? (m(), w("div", Ze, [
|
|
1845
|
+
V(o(F), {
|
|
1817
1846
|
type: "warning",
|
|
1818
|
-
onClick: p[2] || (p[2] = (i) =>
|
|
1847
|
+
onClick: p[2] || (p[2] = (i) => o(e).table.expand.all())
|
|
1819
1848
|
}, {
|
|
1820
|
-
default:
|
|
1821
|
-
E(x(
|
|
1849
|
+
default: h(() => [
|
|
1850
|
+
E(x(o(g).tCurd("expandCollapse")), 1)
|
|
1822
1851
|
]),
|
|
1823
1852
|
_: 1
|
|
1824
1853
|
})
|
|
1825
|
-
])) :
|
|
1826
|
-
|
|
1854
|
+
])) : v("", !0),
|
|
1855
|
+
t.option.tools?.export?.show ? (m(), b(o(fe), {
|
|
1827
1856
|
key: 3,
|
|
1828
|
-
onCommand:
|
|
1857
|
+
onCommand: o(e).export.click
|
|
1829
1858
|
}, {
|
|
1830
|
-
dropdown:
|
|
1831
|
-
|
|
1832
|
-
default:
|
|
1833
|
-
|
|
1859
|
+
dropdown: h(() => [
|
|
1860
|
+
V(o(me), null, {
|
|
1861
|
+
default: h(() => [
|
|
1862
|
+
t.option.table?.selectable ? (m(), b(o(X), {
|
|
1834
1863
|
key: 0,
|
|
1835
1864
|
command: "select"
|
|
1836
1865
|
}, {
|
|
1837
|
-
default:
|
|
1838
|
-
E(x(
|
|
1866
|
+
default: h(() => [
|
|
1867
|
+
E(x(o(g).tCurd("exportSelect")), 1)
|
|
1839
1868
|
]),
|
|
1840
1869
|
_: 1
|
|
1841
|
-
})) :
|
|
1842
|
-
|
|
1843
|
-
default:
|
|
1844
|
-
E(x(
|
|
1870
|
+
})) : v("", !0),
|
|
1871
|
+
V(o(X), { command: "page" }, {
|
|
1872
|
+
default: h(() => [
|
|
1873
|
+
E(x(o(g).tCurd("exportPage")), 1)
|
|
1845
1874
|
]),
|
|
1846
1875
|
_: 1
|
|
1847
1876
|
}),
|
|
1848
|
-
|
|
1849
|
-
default:
|
|
1850
|
-
E(x(
|
|
1877
|
+
V(o(X), { command: "all" }, {
|
|
1878
|
+
default: h(() => [
|
|
1879
|
+
E(x(o(g).tCurd("exportAll")), 1)
|
|
1851
1880
|
]),
|
|
1852
1881
|
_: 1
|
|
1853
1882
|
})
|
|
@@ -1855,344 +1884,356 @@ const Ae = /* @__PURE__ */ re(ze, [["render", Re]]), Pe = { class: "row flex-cen
|
|
|
1855
1884
|
_: 1
|
|
1856
1885
|
})
|
|
1857
1886
|
]),
|
|
1858
|
-
default:
|
|
1859
|
-
|
|
1860
|
-
|
|
1887
|
+
default: h(() => [
|
|
1888
|
+
$("div", _e, [
|
|
1889
|
+
V(o(F), {
|
|
1861
1890
|
type: "warning",
|
|
1862
|
-
loading:
|
|
1891
|
+
loading: o(e).export.loading
|
|
1863
1892
|
}, {
|
|
1864
|
-
default:
|
|
1865
|
-
E(x(
|
|
1893
|
+
default: h(() => [
|
|
1894
|
+
E(x(o(g).tCurd("export")), 1)
|
|
1866
1895
|
]),
|
|
1867
1896
|
_: 1
|
|
1868
1897
|
}, 8, ["loading"])
|
|
1869
1898
|
])
|
|
1870
1899
|
]),
|
|
1871
1900
|
_: 1
|
|
1872
|
-
}, 8, ["onCommand"])) :
|
|
1873
|
-
k(
|
|
1901
|
+
}, 8, ["onCommand"])) : v("", !0),
|
|
1902
|
+
k(f.$slots, "tools-left")
|
|
1874
1903
|
]),
|
|
1875
|
-
|
|
1876
|
-
k(
|
|
1877
|
-
|
|
1904
|
+
$("div", et, [
|
|
1905
|
+
k(f.$slots, "tools-right"),
|
|
1906
|
+
t.option.tools?.refresh === void 0 || t.option.tools?.refresh ? (m(), w("div", {
|
|
1878
1907
|
key: 0,
|
|
1879
1908
|
class: "refresh-btn",
|
|
1880
1909
|
onClick: p[3] || (p[3] = //@ts-ignore
|
|
1881
|
-
(...i) =>
|
|
1910
|
+
(...i) => o(e).table.getList && o(e).table.getList(...i))
|
|
1882
1911
|
}, [
|
|
1883
|
-
|
|
1884
|
-
])) :
|
|
1912
|
+
V(Le)
|
|
1913
|
+
])) : v("", !0)
|
|
1885
1914
|
])
|
|
1886
1915
|
]),
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
data:
|
|
1891
|
-
border:
|
|
1892
|
-
},
|
|
1893
|
-
onSelectionChange:
|
|
1894
|
-
"expand-row-keys":
|
|
1895
|
-
onExpandChange:
|
|
1916
|
+
$("div", tt, [
|
|
1917
|
+
$("div", ot, [
|
|
1918
|
+
ke((m(), b(o(pe), C({
|
|
1919
|
+
data: o(e).table.data,
|
|
1920
|
+
border: t.option.table?.border === void 0 ? !0 : t.option.table?.border
|
|
1921
|
+
}, t.option.table, {
|
|
1922
|
+
onSelectionChange: o(e).table.selection.change,
|
|
1923
|
+
"expand-row-keys": o(e).table.expand.rowKeys,
|
|
1924
|
+
onExpandChange: o(e).table.expand.change
|
|
1896
1925
|
}), {
|
|
1897
|
-
default:
|
|
1898
|
-
|
|
1926
|
+
default: h(() => [
|
|
1927
|
+
t.option.table?.selectable || o(n)(t.option.tools?.delete) || t.option.tools?.export?.show ? (m(), b(o(Z), {
|
|
1899
1928
|
key: 0,
|
|
1900
1929
|
type: "selection",
|
|
1901
|
-
selectable: typeof
|
|
1930
|
+
selectable: typeof t.option.table?.selectable == "function" ? t.option.table?.selectable : void 0,
|
|
1902
1931
|
width: "55"
|
|
1903
|
-
}, null, 8, ["selectable"])) :
|
|
1904
|
-
|
|
1905
|
-
conf:
|
|
1906
|
-
columnList:
|
|
1907
|
-
option:
|
|
1908
|
-
},
|
|
1909
|
-
M(
|
|
1910
|
-
name:
|
|
1911
|
-
fn:
|
|
1912
|
-
k(
|
|
1932
|
+
}, null, 8, ["selectable"])) : v("", !0),
|
|
1933
|
+
V(Be, {
|
|
1934
|
+
conf: o(e),
|
|
1935
|
+
columnList: o(e).table.column.list,
|
|
1936
|
+
option: t.option
|
|
1937
|
+
}, se({ _: 2 }, [
|
|
1938
|
+
M(f.$slots, (i, d) => ({
|
|
1939
|
+
name: d,
|
|
1940
|
+
fn: h((y) => [
|
|
1941
|
+
k(f.$slots, d, ve(Ce(y || {})))
|
|
1913
1942
|
])
|
|
1914
1943
|
}))
|
|
1915
1944
|
]), 1032, ["conf", "columnList", "option"]),
|
|
1916
|
-
|
|
1945
|
+
o(n)(t.option.table?.add) || o(n)(t.option.table?.update) || o(n)(t.option.table?.delete) || o(n)(t.option.table?.view) || f.$slots["table-op-left"] || f.$slots["table-op-right"] ? (m(), b(o(Z), C({
|
|
1917
1946
|
key: 1,
|
|
1918
|
-
width:
|
|
1947
|
+
width: o(e).table.op.width(o(n)(t.option.table?.add), o(n)(t.option.table?.update), o(n)(t.option.table?.delete), o(n)(t.option.table?.view), f.$slots["table-op-left"], f.$slots["table-op-right"]),
|
|
1919
1948
|
align: "center",
|
|
1920
1949
|
fixed: "right"
|
|
1921
|
-
},
|
|
1922
|
-
header:
|
|
1923
|
-
k(
|
|
1924
|
-
E(x(
|
|
1950
|
+
}, t.option.table?.operate), {
|
|
1951
|
+
header: h(() => [
|
|
1952
|
+
k(f.$slots, "table-header-op", {}, () => [
|
|
1953
|
+
E(x(o(g).tCurd("operation")), 1)
|
|
1925
1954
|
])
|
|
1926
1955
|
]),
|
|
1927
|
-
default:
|
|
1928
|
-
k(
|
|
1929
|
-
|
|
1930
|
-
|
|
1956
|
+
default: h(({ row: i }) => [
|
|
1957
|
+
k(f.$slots, "table-op-left", { row: i }),
|
|
1958
|
+
t.option.table?.inlineEdit && o(e).inlineEdit.row === i ? (m(), w(D, { key: 0 }, [
|
|
1959
|
+
V(o(F), {
|
|
1931
1960
|
link: "",
|
|
1932
1961
|
type: "info",
|
|
1933
|
-
onClick:
|
|
1962
|
+
onClick: o(e).inlineEdit.close
|
|
1934
1963
|
}, {
|
|
1935
|
-
default:
|
|
1936
|
-
E(x(
|
|
1964
|
+
default: h(() => [
|
|
1965
|
+
E(x(o(g).tCurd("cancel")), 1)
|
|
1937
1966
|
]),
|
|
1938
1967
|
_: 1
|
|
1939
1968
|
}, 8, ["onClick"]),
|
|
1940
|
-
|
|
1969
|
+
V(o(F), {
|
|
1941
1970
|
link: "",
|
|
1942
1971
|
type: "primary",
|
|
1943
|
-
onClick:
|
|
1944
|
-
loading:
|
|
1972
|
+
onClick: o(e).inlineEdit.submit,
|
|
1973
|
+
loading: o(e).inlineEdit.loading
|
|
1945
1974
|
}, {
|
|
1946
|
-
default:
|
|
1947
|
-
E(x(
|
|
1975
|
+
default: h(() => [
|
|
1976
|
+
E(x(o(g).tCurd("confirm")), 1)
|
|
1948
1977
|
]),
|
|
1949
1978
|
_: 1
|
|
1950
1979
|
}, 8, ["onClick", "loading"]),
|
|
1951
|
-
k(
|
|
1952
|
-
], 64)) : (
|
|
1953
|
-
|
|
1980
|
+
k(f.$slots, "table-op-edit-right", { row: i })
|
|
1981
|
+
], 64)) : (m(), w(D, { key: 1 }, [
|
|
1982
|
+
o(n)(t.option.table?.add, i) ? (m(), b(o(F), {
|
|
1954
1983
|
key: 0,
|
|
1955
1984
|
link: "",
|
|
1956
1985
|
type: "primary",
|
|
1957
|
-
onClick: (
|
|
1986
|
+
onClick: (d) => o(e).update.open(o(r).Insert, i)
|
|
1958
1987
|
}, {
|
|
1959
|
-
default:
|
|
1960
|
-
E(x(
|
|
1988
|
+
default: h(() => [
|
|
1989
|
+
E(x(o(g).tCurd("add")), 1)
|
|
1961
1990
|
]),
|
|
1962
1991
|
_: 1
|
|
1963
|
-
}, 8, ["onClick"])) :
|
|
1964
|
-
|
|
1992
|
+
}, 8, ["onClick"])) : v("", !0),
|
|
1993
|
+
o(n)(t.option.table?.view, i) ? (m(), b(o(F), {
|
|
1965
1994
|
key: 1,
|
|
1966
1995
|
link: "",
|
|
1967
|
-
type: "
|
|
1968
|
-
onClick: (
|
|
1996
|
+
type: "primary",
|
|
1997
|
+
onClick: (d) => o(e).update.open(o(r).View, i)
|
|
1969
1998
|
}, {
|
|
1970
|
-
default:
|
|
1971
|
-
E(x(
|
|
1999
|
+
default: h(() => [
|
|
2000
|
+
E(x(o(g).tCurd("view")), 1)
|
|
1972
2001
|
]),
|
|
1973
2002
|
_: 1
|
|
1974
|
-
}, 8, ["onClick"])) :
|
|
1975
|
-
|
|
2003
|
+
}, 8, ["onClick"])) : v("", !0),
|
|
2004
|
+
o(n)(t.option.table?.update, i) ? (m(), b(o(F), {
|
|
1976
2005
|
key: 2,
|
|
1977
2006
|
link: "",
|
|
2007
|
+
type: "warning",
|
|
2008
|
+
onClick: (d) => o(e).update.open(o(r).Update, i)
|
|
2009
|
+
}, {
|
|
2010
|
+
default: h(() => [
|
|
2011
|
+
E(x(o(g).tCurd("edit")), 1)
|
|
2012
|
+
]),
|
|
2013
|
+
_: 1
|
|
2014
|
+
}, 8, ["onClick"])) : v("", !0),
|
|
2015
|
+
o(n)(t.option.table?.delete, i) ? (m(), b(o(F), {
|
|
2016
|
+
key: 3,
|
|
2017
|
+
link: "",
|
|
1978
2018
|
type: "danger",
|
|
1979
|
-
onClick: (
|
|
2019
|
+
onClick: (d) => o(e).remove.open([i])
|
|
1980
2020
|
}, {
|
|
1981
|
-
default:
|
|
1982
|
-
E(x(
|
|
2021
|
+
default: h(() => [
|
|
2022
|
+
E(x(o(g).tCurd("delete")), 1)
|
|
1983
2023
|
]),
|
|
1984
2024
|
_: 1
|
|
1985
|
-
}, 8, ["onClick"])) :
|
|
1986
|
-
k(
|
|
2025
|
+
}, 8, ["onClick"])) : v("", !0),
|
|
2026
|
+
k(f.$slots, "table-op-right", { row: i })
|
|
1987
2027
|
], 64))
|
|
1988
2028
|
]),
|
|
1989
2029
|
_: 3
|
|
1990
|
-
}, 16, ["width"])) :
|
|
2030
|
+
}, 16, ["width"])) : v("", !0)
|
|
1991
2031
|
]),
|
|
1992
2032
|
_: 3
|
|
1993
2033
|
}, 16, ["data", "border", "onSelectionChange", "expand-row-keys", "onExpandChange"])), [
|
|
1994
|
-
[c,
|
|
2034
|
+
[c, o(e).table.loading]
|
|
1995
2035
|
])
|
|
1996
2036
|
])
|
|
1997
2037
|
]),
|
|
1998
|
-
|
|
1999
|
-
|
|
2038
|
+
$("div", lt, [
|
|
2039
|
+
t.option.page?.show === void 0 || t.option.page?.show ? (m(), b(o(he), {
|
|
2000
2040
|
key: 0,
|
|
2001
|
-
"current-page":
|
|
2002
|
-
"onUpdate:currentPage": p[4] || (p[4] = (i) =>
|
|
2003
|
-
"page-size":
|
|
2004
|
-
"onUpdate:pageSize": p[5] || (p[5] = (i) =>
|
|
2041
|
+
"current-page": o(e).page.num,
|
|
2042
|
+
"onUpdate:currentPage": p[4] || (p[4] = (i) => o(e).page.num = i),
|
|
2043
|
+
"page-size": o(e).page.size,
|
|
2044
|
+
"onUpdate:pageSize": p[5] || (p[5] = (i) => o(e).page.size = i),
|
|
2005
2045
|
background: "",
|
|
2006
|
-
"page-sizes":
|
|
2046
|
+
"page-sizes": o(e).page.sizeList,
|
|
2007
2047
|
"pager-count": 7,
|
|
2008
|
-
layout:
|
|
2009
|
-
total:
|
|
2010
|
-
onSizeChange:
|
|
2011
|
-
onCurrentChange:
|
|
2012
|
-
}, null, 8, ["current-page", "page-size", "page-sizes", "layout", "total", "onSizeChange", "onCurrentChange"])) :
|
|
2048
|
+
layout: o(e).page.layout,
|
|
2049
|
+
total: o(e).page.total,
|
|
2050
|
+
onSizeChange: o(e).table.getList,
|
|
2051
|
+
onCurrentChange: o(e).table.getList
|
|
2052
|
+
}, null, 8, ["current-page", "page-size", "page-sizes", "layout", "total", "onSizeChange", "onCurrentChange"])) : v("", !0)
|
|
2013
2053
|
])
|
|
2014
2054
|
]),
|
|
2015
|
-
k(
|
|
2055
|
+
k(f.$slots, "box-right")
|
|
2016
2056
|
]),
|
|
2017
|
-
|
|
2018
|
-
modelValue:
|
|
2019
|
-
"onUpdate:modelValue": p[6] || (p[6] = (i) =>
|
|
2020
|
-
title:
|
|
2021
|
-
"before-close":
|
|
2022
|
-
},
|
|
2023
|
-
footer:
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
onClick:
|
|
2057
|
+
V(o(Y), C({
|
|
2058
|
+
modelValue: o(e).update.show,
|
|
2059
|
+
"onUpdate:modelValue": p[6] || (p[6] = (i) => o(e).update.show = i),
|
|
2060
|
+
title: o(e).update.title,
|
|
2061
|
+
"before-close": o(e).update.close
|
|
2062
|
+
}, t.option.dialog), {
|
|
2063
|
+
footer: h(() => [
|
|
2064
|
+
$("span", rt, [
|
|
2065
|
+
V(o(F), {
|
|
2066
|
+
onClick: o(e).update.close
|
|
2027
2067
|
}, {
|
|
2028
|
-
default:
|
|
2029
|
-
E(x(
|
|
2068
|
+
default: h(() => [
|
|
2069
|
+
E(x(o(g).tCurd("close")), 1)
|
|
2030
2070
|
]),
|
|
2031
2071
|
_: 1
|
|
2032
2072
|
}, 8, ["onClick"]),
|
|
2033
|
-
|
|
2073
|
+
o(e).update.type !== o(r).View ? (m(), b(o(F), {
|
|
2074
|
+
key: 0,
|
|
2034
2075
|
type: "primary",
|
|
2035
|
-
onClick:
|
|
2036
|
-
loading:
|
|
2076
|
+
onClick: o(e).update.submit,
|
|
2077
|
+
loading: o(e).update.loading
|
|
2037
2078
|
}, {
|
|
2038
|
-
default:
|
|
2039
|
-
E(x(
|
|
2079
|
+
default: h(() => [
|
|
2080
|
+
E(x(o(g).tCurd("submit")), 1)
|
|
2040
2081
|
]),
|
|
2041
2082
|
_: 1
|
|
2042
|
-
}, 8, ["onClick", "loading"])
|
|
2083
|
+
}, 8, ["onClick", "loading"])) : v("", !0)
|
|
2043
2084
|
])
|
|
2044
2085
|
]),
|
|
2045
|
-
default:
|
|
2046
|
-
|
|
2086
|
+
default: h(() => [
|
|
2087
|
+
V(o(Q), {
|
|
2047
2088
|
ref_key: "ruleFormRef",
|
|
2048
|
-
ref:
|
|
2049
|
-
model:
|
|
2050
|
-
rules:
|
|
2089
|
+
ref: u,
|
|
2090
|
+
model: o(e).update.form,
|
|
2091
|
+
rules: o(e).update.rules
|
|
2051
2092
|
}, {
|
|
2052
|
-
default:
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
const
|
|
2093
|
+
default: h(() => [
|
|
2094
|
+
o(e).update.showContent ? (m(!0), w(D, { key: 0 }, M(o(e).update.formColumn, (i) => (m(), w(D, null, [
|
|
2095
|
+
o(n)(() => {
|
|
2096
|
+
const d = [], y = (I) => {
|
|
2056
2097
|
if (I.children)
|
|
2057
|
-
return
|
|
2058
|
-
|
|
2098
|
+
return y(I.children);
|
|
2099
|
+
d.push(...I.map((j) => j.item.show?.form));
|
|
2059
2100
|
};
|
|
2060
|
-
return
|
|
2061
|
-
},
|
|
2101
|
+
return y(i), d;
|
|
2102
|
+
}, o(e).update.form, o(e).update.type) ? (m(), w("div", {
|
|
2062
2103
|
key: 0,
|
|
2063
2104
|
class: T(["row curd-row", {
|
|
2064
|
-
stripe:
|
|
2105
|
+
stripe: t.option.form?.stripe === void 0 ? !0 : t.option.form?.stripe
|
|
2065
2106
|
}])
|
|
2066
2107
|
}, [
|
|
2067
|
-
k(
|
|
2068
|
-
row:
|
|
2108
|
+
k(f.$slots, "form-start", {
|
|
2109
|
+
row: o(e).update.form
|
|
2069
2110
|
}),
|
|
2070
|
-
(
|
|
2071
|
-
|
|
2111
|
+
(m(!0), w(D, null, M(i, (d) => (m(), w(D, null, [
|
|
2112
|
+
o(n)(d.item.show?.form, o(e).update.form) ? (m(), w("div", {
|
|
2072
2113
|
key: 0,
|
|
2073
|
-
class: T(
|
|
2114
|
+
class: T(d.item.form.span > 0 ? `col-${d.item.form.span}` : "col")
|
|
2074
2115
|
}, [
|
|
2075
|
-
|
|
2116
|
+
d.item.children ? (m(!0), w(D, { key: 0 }, M(d.children, (y) => (m(), b(o(J), {
|
|
2076
2117
|
class: T({
|
|
2077
|
-
"hide-label": typeof
|
|
2118
|
+
"hide-label": typeof y.item.text?.form?.label == "boolean" ? !y.item.text?.form?.label : !1
|
|
2078
2119
|
}),
|
|
2079
|
-
label: typeof
|
|
2080
|
-
prop:
|
|
2081
|
-
"label-width":
|
|
2120
|
+
label: typeof y.item.text?.form?.label == "string" ? y.item.text?.form?.label : y.item.label,
|
|
2121
|
+
prop: y.item.key,
|
|
2122
|
+
"label-width": y.item.form?.labelWidth || "100px"
|
|
2082
2123
|
}, {
|
|
2083
|
-
default:
|
|
2084
|
-
|
|
2085
|
-
k(
|
|
2086
|
-
row:
|
|
2087
|
-
item:
|
|
2124
|
+
default: h(() => [
|
|
2125
|
+
$("div", at, [
|
|
2126
|
+
k(f.$slots, "form-" + y.item.key + "-start", {
|
|
2127
|
+
row: o(e).update.form,
|
|
2128
|
+
item: y.item
|
|
2088
2129
|
}),
|
|
2089
|
-
|
|
2090
|
-
k(
|
|
2091
|
-
row:
|
|
2092
|
-
item:
|
|
2130
|
+
$("div", nt, [
|
|
2131
|
+
k(f.$slots, "form-" + y.item.key, {
|
|
2132
|
+
row: o(e).update.form,
|
|
2133
|
+
item: y.item
|
|
2093
2134
|
}, () => [
|
|
2094
|
-
|
|
2095
|
-
conf:
|
|
2096
|
-
item:
|
|
2135
|
+
V(le, {
|
|
2136
|
+
conf: o(e),
|
|
2137
|
+
item: d
|
|
2097
2138
|
}, null, 8, ["conf", "item"])
|
|
2098
2139
|
]),
|
|
2099
|
-
k(
|
|
2100
|
-
row:
|
|
2101
|
-
item:
|
|
2140
|
+
k(f.$slots, "form-" + y.item.key + "-right", {
|
|
2141
|
+
row: o(e).update.form,
|
|
2142
|
+
item: y.item
|
|
2102
2143
|
})
|
|
2103
2144
|
]),
|
|
2104
|
-
k(
|
|
2105
|
-
row:
|
|
2106
|
-
item:
|
|
2145
|
+
k(f.$slots, "form-" + y.item.key + "-end", {
|
|
2146
|
+
row: o(e).update.form,
|
|
2147
|
+
item: y.item
|
|
2107
2148
|
})
|
|
2108
2149
|
])
|
|
2109
2150
|
]),
|
|
2110
2151
|
_: 2
|
|
2111
|
-
}, 1032, ["class", "label", "prop", "label-width"]))), 256)) : (
|
|
2152
|
+
}, 1032, ["class", "label", "prop", "label-width"]))), 256)) : (m(), b(o(J), {
|
|
2112
2153
|
key: 1,
|
|
2113
2154
|
class: T({
|
|
2114
|
-
"hide-label": typeof
|
|
2155
|
+
"hide-label": typeof d.item.text?.form?.label == "boolean" ? !d.item.text?.form?.label : !1
|
|
2115
2156
|
}),
|
|
2116
|
-
label: typeof
|
|
2117
|
-
prop:
|
|
2118
|
-
"label-width":
|
|
2157
|
+
label: typeof d.item.text?.form?.label == "string" ? d.item.text?.form?.label : d.item.label,
|
|
2158
|
+
prop: d.item.key,
|
|
2159
|
+
"label-width": d.item.form?.labelWidth || "100px"
|
|
2119
2160
|
}, {
|
|
2120
|
-
default:
|
|
2121
|
-
|
|
2122
|
-
k(
|
|
2123
|
-
row:
|
|
2124
|
-
item:
|
|
2161
|
+
default: h(() => [
|
|
2162
|
+
$("div", it, [
|
|
2163
|
+
k(f.$slots, "form-" + d.item.key + "-start", {
|
|
2164
|
+
row: o(e).update.form,
|
|
2165
|
+
item: d.item
|
|
2125
2166
|
}),
|
|
2126
|
-
|
|
2127
|
-
k(
|
|
2128
|
-
row:
|
|
2129
|
-
item:
|
|
2167
|
+
$("div", st, [
|
|
2168
|
+
k(f.$slots, "form-" + d.item.key, {
|
|
2169
|
+
row: o(e).update.form,
|
|
2170
|
+
item: d.item
|
|
2130
2171
|
}, () => [
|
|
2131
|
-
|
|
2132
|
-
conf:
|
|
2133
|
-
item:
|
|
2172
|
+
V(le, {
|
|
2173
|
+
conf: o(e),
|
|
2174
|
+
item: d
|
|
2134
2175
|
}, null, 8, ["conf", "item"])
|
|
2135
2176
|
]),
|
|
2136
|
-
k(
|
|
2137
|
-
row:
|
|
2138
|
-
item:
|
|
2177
|
+
k(f.$slots, "form-" + d.item.key + "-right", {
|
|
2178
|
+
row: o(e).update.form,
|
|
2179
|
+
item: d.item
|
|
2139
2180
|
})
|
|
2140
2181
|
]),
|
|
2141
|
-
k(
|
|
2142
|
-
row:
|
|
2143
|
-
item:
|
|
2182
|
+
k(f.$slots, "form-" + d.item.key + "-end", {
|
|
2183
|
+
row: o(e).update.form,
|
|
2184
|
+
item: d.item
|
|
2144
2185
|
})
|
|
2145
2186
|
])
|
|
2146
2187
|
]),
|
|
2147
2188
|
_: 2
|
|
2148
2189
|
}, 1032, ["class", "label", "prop", "label-width"]))
|
|
2149
|
-
], 2)) :
|
|
2190
|
+
], 2)) : v("", !0)
|
|
2150
2191
|
], 64))), 256)),
|
|
2151
|
-
k(
|
|
2152
|
-
row:
|
|
2192
|
+
k(f.$slots, "form-end", {
|
|
2193
|
+
row: o(e).update.form
|
|
2153
2194
|
})
|
|
2154
|
-
], 2)) :
|
|
2155
|
-
], 64))), 256)) :
|
|
2195
|
+
], 2)) : v("", !0)
|
|
2196
|
+
], 64))), 256)) : v("", !0)
|
|
2156
2197
|
]),
|
|
2157
2198
|
_: 3
|
|
2158
2199
|
}, 8, ["model", "rules"])
|
|
2159
2200
|
]),
|
|
2160
2201
|
_: 3
|
|
2161
2202
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
2162
|
-
|
|
2163
|
-
modelValue:
|
|
2164
|
-
"onUpdate:modelValue": p[7] || (p[7] = (i) =>
|
|
2165
|
-
title:
|
|
2203
|
+
V(o(Y), {
|
|
2204
|
+
modelValue: o(e).remove.show,
|
|
2205
|
+
"onUpdate:modelValue": p[7] || (p[7] = (i) => o(e).remove.show = i),
|
|
2206
|
+
title: o(e).remove.title,
|
|
2166
2207
|
"close-on-click-modal": !1
|
|
2167
2208
|
}, {
|
|
2168
|
-
footer:
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
onClick:
|
|
2209
|
+
footer: h(() => [
|
|
2210
|
+
$("span", dt, [
|
|
2211
|
+
V(o(F), {
|
|
2212
|
+
onClick: o(e).remove.close
|
|
2172
2213
|
}, {
|
|
2173
|
-
default:
|
|
2174
|
-
E(x(
|
|
2214
|
+
default: h(() => [
|
|
2215
|
+
E(x(o(g).tCurd("close")), 1)
|
|
2175
2216
|
]),
|
|
2176
2217
|
_: 1
|
|
2177
2218
|
}, 8, ["onClick"]),
|
|
2178
|
-
|
|
2219
|
+
V(o(F), {
|
|
2179
2220
|
type: "danger",
|
|
2180
|
-
onClick:
|
|
2181
|
-
loading:
|
|
2221
|
+
onClick: o(e).remove.submit,
|
|
2222
|
+
loading: o(e).remove.loading
|
|
2182
2223
|
}, {
|
|
2183
|
-
default:
|
|
2184
|
-
E(x(
|
|
2224
|
+
default: h(() => [
|
|
2225
|
+
E(x(o(g).tCurd("confirmDelete")), 1)
|
|
2185
2226
|
]),
|
|
2186
2227
|
_: 1
|
|
2187
2228
|
}, 8, ["onClick", "loading"])
|
|
2188
2229
|
])
|
|
2189
2230
|
]),
|
|
2190
|
-
default:
|
|
2191
|
-
|
|
2231
|
+
default: h(() => [
|
|
2232
|
+
$("div", null, x(o(g).tCurd("confirmDeleteMessage", o(e).remove.items.length)), 1)
|
|
2192
2233
|
]),
|
|
2193
2234
|
_: 1
|
|
2194
2235
|
}, 8, ["modelValue", "title"]),
|
|
2195
|
-
|
|
2236
|
+
V(Fe, {
|
|
2196
2237
|
ref_key: "switchConfirmRef",
|
|
2197
2238
|
ref: a
|
|
2198
2239
|
}, null, 512)
|
|
@@ -2208,8 +2249,8 @@ class pt {
|
|
|
2208
2249
|
* @param name - 下载后的文件名,默认 `'download.png'`
|
|
2209
2250
|
*/
|
|
2210
2251
|
static async download(s, r = "download.png") {
|
|
2211
|
-
const
|
|
2212
|
-
|
|
2252
|
+
const l = document.createElement("a");
|
|
2253
|
+
l.style.display = "none", l.href = s, l.setAttribute("download", r), typeof l.download > "u" && l.setAttribute("target", "_blank"), document.body.appendChild(l), l.click(), document.body.removeChild(l), window.URL.revokeObjectURL(s);
|
|
2213
2254
|
}
|
|
2214
2255
|
/**
|
|
2215
2256
|
* 将json对象或者json数组导出为json文件保存
|
|
@@ -2217,7 +2258,7 @@ class pt {
|
|
|
2217
2258
|
* @param name
|
|
2218
2259
|
*/
|
|
2219
2260
|
static exportJSONFile = (s, r) => {
|
|
2220
|
-
const
|
|
2261
|
+
const l = new Blob([JSON.stringify(s)], { type: "application/json" }), n = URL.createObjectURL(l), e = document.createElement("a");
|
|
2221
2262
|
e.href = n, e.download = `${r || "config"}.json`, e.click();
|
|
2222
2263
|
};
|
|
2223
2264
|
/**
|
|
@@ -2225,31 +2266,31 @@ class pt {
|
|
|
2225
2266
|
* @param param
|
|
2226
2267
|
* @returns
|
|
2227
2268
|
*/
|
|
2228
|
-
static importFile = async (s) => new Promise((r,
|
|
2269
|
+
static importFile = async (s) => new Promise((r, l) => {
|
|
2229
2270
|
const n = document.createElement("input");
|
|
2230
2271
|
n.type = "file";
|
|
2231
2272
|
const e = s?.accept || ".json";
|
|
2232
2273
|
n.accept = e, n.style.display = "none", n.onchange = (a) => {
|
|
2233
|
-
const
|
|
2234
|
-
if (!
|
|
2235
|
-
|
|
2274
|
+
const u = a.target.files[0];
|
|
2275
|
+
if (!u) {
|
|
2276
|
+
U.fail("未选择文件"), l("未选择文件");
|
|
2236
2277
|
return;
|
|
2237
2278
|
}
|
|
2238
|
-
const
|
|
2239
|
-
|
|
2279
|
+
const f = new FileReader();
|
|
2280
|
+
f.onload = async (p) => {
|
|
2240
2281
|
const c = e == ".json" ? JSON.parse(p.target.result) : p.target.result;
|
|
2241
2282
|
r(c);
|
|
2242
|
-
},
|
|
2243
|
-
|
|
2244
|
-
},
|
|
2283
|
+
}, f.onerror = () => {
|
|
2284
|
+
U.fail("文件读取失败"), l("文件读取失败");
|
|
2285
|
+
}, f.readAsText(u), document.body.removeChild(n);
|
|
2245
2286
|
}, document.body.appendChild(n), n.click();
|
|
2246
2287
|
});
|
|
2247
2288
|
}
|
|
2248
|
-
const ct = (
|
|
2249
|
-
if (
|
|
2289
|
+
const ct = (t, s) => {
|
|
2290
|
+
if (t.component("TCurd", ut), t.component("TFormList", oe), t.component("TColumn", De), s?.customComponent) {
|
|
2250
2291
|
L.customComponent = s.customComponent;
|
|
2251
2292
|
for (const r in s.customComponent)
|
|
2252
|
-
|
|
2293
|
+
t.component(r, s.customComponent[r]);
|
|
2253
2294
|
}
|
|
2254
2295
|
}, ht = {
|
|
2255
2296
|
install: ct
|
|
@@ -2264,7 +2305,7 @@ export {
|
|
|
2264
2305
|
S as TFormConfig,
|
|
2265
2306
|
g as TFormI18n,
|
|
2266
2307
|
oe as TFormList,
|
|
2267
|
-
|
|
2308
|
+
U as TSys,
|
|
2268
2309
|
ht as default,
|
|
2269
2310
|
ct as install
|
|
2270
2311
|
};
|