cc1-form 1.1.22 → 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 +1000 -898
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/com/form/column.vue.d.ts +92 -11
- package/dist/components/TCurd/com/form/list.vue.d.ts +2 -2
- package/dist/components/TCurd/index.d.ts +61 -7
- package/dist/components/TCurd/index.vue.d.ts +280 -54
- package/dist/components/TCurd/indexType.d.ts +70 -40
- package/dist/components/TCurd/tableColumn.vue.d.ts +4 -0
- package/dist/index.d.ts +2 -1
- 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,160 +886,185 @@ 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({
|
|
902
|
+
/** 查询区域相关配置对象 */
|
|
890
903
|
search: {
|
|
904
|
+
/** 查询表单列集合 */
|
|
891
905
|
column: {
|
|
906
|
+
/** 搜索表单列列表 */
|
|
892
907
|
list: []
|
|
893
908
|
},
|
|
909
|
+
/** 搜索表单数据对象 */
|
|
894
910
|
form: {},
|
|
911
|
+
/** 搜索表单默认值 */
|
|
895
912
|
formDefault: {},
|
|
913
|
+
/** 获取占位符 */
|
|
896
914
|
getPlaceholder: (n, e = g.tCurd("placeholderInput")) => n.text?.search?.placeholder === void 0 ? `${e}${n.label}` : n.text?.search?.placeholder,
|
|
915
|
+
/** 组装实际要搜索的数据对象 */
|
|
897
916
|
getFormData: () => {
|
|
898
917
|
let n = {};
|
|
899
|
-
|
|
900
|
-
(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]);
|
|
901
920
|
});
|
|
902
|
-
const e =
|
|
921
|
+
const e = t.option.search?.before?.(n);
|
|
903
922
|
return e && (n = e), n;
|
|
904
923
|
},
|
|
924
|
+
/** 重置搜索表单 */
|
|
905
925
|
reset: () => {
|
|
906
|
-
const n =
|
|
926
|
+
const n = l.search.formDefault;
|
|
907
927
|
Object.keys(n).forEach((e) => {
|
|
908
|
-
|
|
909
|
-
}),
|
|
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();
|
|
910
930
|
},
|
|
931
|
+
/** 提交搜索表单 */
|
|
911
932
|
submit: () => {
|
|
912
|
-
|
|
933
|
+
l.page.num = 1, l.table.getList();
|
|
913
934
|
}
|
|
914
935
|
},
|
|
936
|
+
/** 分页区域相关配置对象 */
|
|
915
937
|
page: {
|
|
916
|
-
|
|
917
|
-
|
|
938
|
+
/** 当前每页条数 */
|
|
939
|
+
size: t.option.page?.size || 10,
|
|
940
|
+
/** 支持切换的每页条数选项 */
|
|
941
|
+
sizeList: t.option.page?.sizeList || [10, 20, 50, 100],
|
|
942
|
+
/** 当前页码 */
|
|
918
943
|
num: 1,
|
|
944
|
+
/** 总条数 */
|
|
919
945
|
total: 0,
|
|
920
|
-
|
|
946
|
+
/** 分页控件的布局方式 */
|
|
947
|
+
layout: t.option.page?.layout || "total, sizes, prev, pager, next, jumper"
|
|
921
948
|
},
|
|
949
|
+
/** 表格区域相关配置对象 */
|
|
922
950
|
table: {
|
|
951
|
+
/** 操作列相关配置 */
|
|
923
952
|
op: {
|
|
953
|
+
/** 动态计算操作列宽度 */
|
|
924
954
|
width: (...n) => n.filter((a) => a).length * 30 + 60
|
|
925
955
|
},
|
|
956
|
+
/** 表格加载中状态 */
|
|
926
957
|
loading: !1,
|
|
958
|
+
/** 表格数据内容 */
|
|
927
959
|
data: [],
|
|
960
|
+
/** 表格展开行相关配置 */
|
|
928
961
|
expand: {
|
|
962
|
+
/** 当前是否全部展开 */
|
|
929
963
|
isExpand: !1,
|
|
964
|
+
/** 已经展开的行key集合 */
|
|
930
965
|
rowKeys: [],
|
|
966
|
+
/** 行展开触发变更函数 */
|
|
931
967
|
change: (n, e) => {
|
|
932
968
|
},
|
|
969
|
+
/** 全部展开/收起 */
|
|
933
970
|
all: () => {
|
|
934
|
-
if (
|
|
935
|
-
|
|
971
|
+
if (l.table.expand.isExpand)
|
|
972
|
+
l.table.expand.rowKeys = [];
|
|
936
973
|
else {
|
|
937
974
|
const n = (e) => {
|
|
938
975
|
let a = [];
|
|
939
|
-
return e.forEach((
|
|
940
|
-
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)));
|
|
941
978
|
}), a;
|
|
942
979
|
};
|
|
943
|
-
|
|
980
|
+
l.table.expand.rowKeys = n(l.table.data);
|
|
944
981
|
}
|
|
945
|
-
|
|
982
|
+
l.table.expand.isExpand = !l.table.expand.isExpand;
|
|
946
983
|
}
|
|
947
984
|
},
|
|
985
|
+
/** 表格列相关配置 */
|
|
948
986
|
column: {
|
|
949
|
-
/**
|
|
950
|
-
* 渲染列数据
|
|
951
|
-
*/
|
|
987
|
+
/** 表格全部列(渲染用) */
|
|
952
988
|
list: [],
|
|
953
|
-
/**
|
|
954
|
-
* 表格列显示控制
|
|
955
|
-
*/
|
|
989
|
+
/** 表格可见列控制集合 */
|
|
956
990
|
show: {
|
|
957
|
-
/**
|
|
958
|
-
* 表格列源数据
|
|
959
|
-
*/
|
|
991
|
+
/** 表格列f原始源数据key数组 */
|
|
960
992
|
listSource: [],
|
|
961
|
-
/**
|
|
962
|
-
* 当前显示表格列数据
|
|
963
|
-
*/
|
|
993
|
+
/** 当前显示表格列数据key数组 */
|
|
964
994
|
list: []
|
|
965
995
|
}
|
|
966
996
|
},
|
|
997
|
+
/** 获取数据列表接口实现 */
|
|
967
998
|
getList: async () => {
|
|
968
|
-
|
|
969
|
-
const n =
|
|
999
|
+
l.table.loading = !0;
|
|
1000
|
+
const n = t.option.api.list;
|
|
970
1001
|
try {
|
|
971
|
-
await
|
|
1002
|
+
await l.initApiData("init");
|
|
972
1003
|
const e = await n({
|
|
973
|
-
[S.config.page.size]:
|
|
974
|
-
[S.config.page.num]:
|
|
975
|
-
...
|
|
976
|
-
}), a = S.config.result,
|
|
977
|
-
let
|
|
978
|
-
const p =
|
|
979
|
-
const I = p.find((j) => j.item.key ===
|
|
980
|
-
|
|
981
|
-
const j = I.item.options?.select?.data?.find((z) => z.value == i[h])?.label;
|
|
982
|
-
j && (i[h] = j);
|
|
983
|
-
}
|
|
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));
|
|
984
1012
|
}), i));
|
|
985
|
-
|
|
1013
|
+
l.table.data = t.option.data ? await t.option.data(c, f) : c, l.page.total = u[a.total] || 0;
|
|
986
1014
|
} catch (e) {
|
|
987
1015
|
console.error(e);
|
|
988
1016
|
} finally {
|
|
989
|
-
|
|
1017
|
+
l.table.loading = !1;
|
|
990
1018
|
}
|
|
991
1019
|
},
|
|
1020
|
+
/** 表格多选相关配置 */
|
|
992
1021
|
selection: {
|
|
1022
|
+
/** 已选数据项 */
|
|
993
1023
|
list: [],
|
|
1024
|
+
/** 选中状态回调 */
|
|
994
1025
|
change: (n) => {
|
|
995
|
-
|
|
1026
|
+
l.table.selection.list = n;
|
|
996
1027
|
}
|
|
997
1028
|
}
|
|
998
1029
|
},
|
|
1030
|
+
/** 导出相关配置与功能 */
|
|
999
1031
|
export: {
|
|
1032
|
+
/** 导出逻辑方法集合 */
|
|
1000
1033
|
run: {
|
|
1034
|
+
/** 执行指定方式的导出(如select、page、all) */
|
|
1001
1035
|
start: async (n) => {
|
|
1002
|
-
let e = await
|
|
1003
|
-
const
|
|
1036
|
+
let e = await l.export.run[n](), a = t.option.column;
|
|
1037
|
+
const u = JSONUtil.cp({
|
|
1004
1038
|
data: e,
|
|
1005
1039
|
columns: a
|
|
1006
|
-
}),
|
|
1007
|
-
|
|
1040
|
+
}), f = t.option.tools?.export || {};
|
|
1041
|
+
f.before && f.before(u), $e.exportToExcel(u.data, u.columns, f.fileName);
|
|
1008
1042
|
},
|
|
1043
|
+
/** 获取当前选中项进行导出 */
|
|
1009
1044
|
select: () => {
|
|
1010
|
-
if (
|
|
1011
|
-
throw
|
|
1012
|
-
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;
|
|
1013
1048
|
},
|
|
1049
|
+
/** 导出当前页的数据 */
|
|
1014
1050
|
page: () => {
|
|
1015
|
-
if (
|
|
1016
|
-
throw
|
|
1017
|
-
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;
|
|
1018
1054
|
},
|
|
1055
|
+
/** 导出所有数据 */
|
|
1019
1056
|
all: async () => {
|
|
1020
|
-
|
|
1057
|
+
l.export.loading = !0;
|
|
1021
1058
|
try {
|
|
1022
|
-
if (
|
|
1023
|
-
await
|
|
1024
|
-
[S.config.page.size]:
|
|
1025
|
-
[S.config.page.num]:
|
|
1026
|
-
...
|
|
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()
|
|
1027
1064
|
});
|
|
1028
1065
|
return;
|
|
1029
1066
|
}
|
|
1030
|
-
const n =
|
|
1067
|
+
const n = t.option.api.list, e = await n({
|
|
1031
1068
|
[S.config.page.size]: 999999,
|
|
1032
1069
|
[S.config.page.num]: 1
|
|
1033
1070
|
});
|
|
@@ -1035,195 +1072,228 @@ const W = $.EDialog, Se = (o) => {
|
|
|
1035
1072
|
} catch (n) {
|
|
1036
1073
|
console.error(n);
|
|
1037
1074
|
} finally {
|
|
1038
|
-
|
|
1075
|
+
l.export.loading = !1;
|
|
1039
1076
|
}
|
|
1040
1077
|
}
|
|
1041
1078
|
},
|
|
1079
|
+
/** 导出时loading状态 */
|
|
1042
1080
|
loading: !1,
|
|
1081
|
+
/** 执行导出操作的触发函数 */
|
|
1043
1082
|
click: (n) => {
|
|
1044
|
-
|
|
1083
|
+
l.export.loading || l.export.run.start(n);
|
|
1045
1084
|
}
|
|
1046
1085
|
},
|
|
1086
|
+
/** 表单增删改弹窗相关对象 */
|
|
1047
1087
|
update: {
|
|
1088
|
+
/** 弹窗标题 */
|
|
1048
1089
|
title: "",
|
|
1090
|
+
/** 当前表单校验规则 */
|
|
1049
1091
|
rules: {},
|
|
1092
|
+
/** 弹窗显示控制 */
|
|
1050
1093
|
show: !1,
|
|
1094
|
+
/** 弹窗内容部分显示控制 */
|
|
1051
1095
|
showContent: !1,
|
|
1096
|
+
/** 弹窗loading */
|
|
1052
1097
|
loading: !1,
|
|
1053
|
-
|
|
1098
|
+
/** 当前操作类型,插入或修改 */
|
|
1099
|
+
type: A.Insert,
|
|
1100
|
+
/** 当前操作表单数据 */
|
|
1054
1101
|
form: {},
|
|
1102
|
+
/** 表单默认值 */
|
|
1055
1103
|
formDefault: {},
|
|
1104
|
+
/** 表单所有列,二维数组结构按行分组 */
|
|
1056
1105
|
formColumn: [],
|
|
1057
|
-
|
|
1106
|
+
/** 判断是否禁用当前字段 */
|
|
1107
|
+
getDisabled: (n) => l.update.type === A.View ? !0 : n.disabled?.[l.update.type === A.Insert ? "create" : "update"],
|
|
1108
|
+
/** 编辑相关数据与方法 */
|
|
1058
1109
|
edit: {
|
|
1059
|
-
/**
|
|
1060
|
-
* 编辑原数据
|
|
1061
|
-
*/
|
|
1110
|
+
/** 当前编辑的数据原始项对象 */
|
|
1062
1111
|
data: {},
|
|
1063
|
-
/**
|
|
1064
|
-
* 将form填入数据和data比对差异数据返回
|
|
1065
|
-
*/
|
|
1112
|
+
/** 返回编辑时与原值的变更数据,用于局部更新API */
|
|
1066
1113
|
getApiData: (n) => {
|
|
1067
|
-
if (
|
|
1114
|
+
if (t.option.form?.editAll)
|
|
1068
1115
|
return n;
|
|
1069
1116
|
let e = {
|
|
1070
|
-
[
|
|
1117
|
+
[t.option.table?.rowKey]: l.update.edit.data[t.option.table?.rowKey]
|
|
1071
1118
|
};
|
|
1072
|
-
return Object.keys(
|
|
1073
|
-
n[a] !==
|
|
1119
|
+
return Object.keys(l.update.edit.data).forEach((a) => {
|
|
1120
|
+
n[a] !== l.update.edit.data[a] && (e[a] = n[a]);
|
|
1074
1121
|
}), e;
|
|
1075
1122
|
}
|
|
1076
1123
|
},
|
|
1124
|
+
view: {},
|
|
1125
|
+
/** 打开增改弹窗 */
|
|
1077
1126
|
open: (n, e) => {
|
|
1078
|
-
|
|
1079
|
-
|
|
1127
|
+
l.update.showContent || FunUtil.throttle(async () => {
|
|
1128
|
+
U.loading(!0);
|
|
1080
1129
|
try {
|
|
1081
|
-
await
|
|
1082
|
-
const a = n ===
|
|
1083
|
-
if (!a &&
|
|
1084
|
-
|
|
1130
|
+
await l.initApiData("update");
|
|
1131
|
+
const a = n === A.Insert;
|
|
1132
|
+
if (!a && t.option.table?.inlineEdit) {
|
|
1133
|
+
l.inlineEdit.open(e);
|
|
1085
1134
|
return;
|
|
1086
1135
|
}
|
|
1087
|
-
|
|
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);
|
|
1088
1137
|
} catch (a) {
|
|
1089
1138
|
console.error(a);
|
|
1090
1139
|
} finally {
|
|
1091
|
-
|
|
1140
|
+
U.loading(!1);
|
|
1092
1141
|
}
|
|
1093
1142
|
});
|
|
1094
1143
|
},
|
|
1144
|
+
/** 提交增改表单操作 */
|
|
1095
1145
|
submit: () => {
|
|
1096
1146
|
FunUtil.throttle(async () => {
|
|
1097
|
-
await r.value?.validate(async (
|
|
1098
|
-
|
|
1099
|
-
})),
|
|
1100
|
-
const n =
|
|
1101
|
-
let e = JSONUtil.cp(
|
|
1102
|
-
delete e.children, await
|
|
1103
|
-
const a = new Set(
|
|
1104
|
-
Object.keys(e).forEach((
|
|
1105
|
-
if (a.has(
|
|
1106
|
-
const
|
|
1107
|
-
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);
|
|
1108
1158
|
}
|
|
1109
1159
|
});
|
|
1110
1160
|
try {
|
|
1111
1161
|
if (!n) return;
|
|
1112
1162
|
await n({
|
|
1113
1163
|
...e
|
|
1114
|
-
}),
|
|
1115
|
-
} catch (
|
|
1116
|
-
console.error(
|
|
1164
|
+
}), l.update.close(), await l.table.getList(), t.option.form?.submitAfter?.(e, l.update);
|
|
1165
|
+
} catch (u) {
|
|
1166
|
+
console.error(u);
|
|
1117
1167
|
} finally {
|
|
1118
|
-
|
|
1168
|
+
l.update.loading = !1;
|
|
1119
1169
|
}
|
|
1120
1170
|
});
|
|
1121
1171
|
},
|
|
1172
|
+
/** 关闭弹窗和内容 */
|
|
1122
1173
|
close: () => {
|
|
1123
|
-
|
|
1124
|
-
|
|
1174
|
+
l.update.show = !1, setTimeout(() => {
|
|
1175
|
+
l.update.showContent = !1;
|
|
1125
1176
|
}, 350);
|
|
1126
1177
|
}
|
|
1127
1178
|
},
|
|
1179
|
+
/** 行内编辑相关对象 */
|
|
1128
1180
|
inlineEdit: {
|
|
1181
|
+
/** 行内编辑当前行对象 */
|
|
1129
1182
|
row: null,
|
|
1183
|
+
/** 行内编辑表单数据副本 */
|
|
1130
1184
|
form: {},
|
|
1185
|
+
/** 行内编辑loading */
|
|
1131
1186
|
loading: !1,
|
|
1187
|
+
/** 打开行内编辑 */
|
|
1132
1188
|
open: (n) => {
|
|
1133
|
-
|
|
1189
|
+
l.inlineEdit.row = n, l.inlineEdit.form = JSONUtil.cp(n);
|
|
1134
1190
|
},
|
|
1191
|
+
/** 关闭行内编辑 */
|
|
1135
1192
|
close: () => {
|
|
1136
|
-
|
|
1193
|
+
l.inlineEdit.row = null, l.inlineEdit.form = {};
|
|
1137
1194
|
},
|
|
1195
|
+
/** 行内保存提交 */
|
|
1138
1196
|
submit: () => {
|
|
1139
1197
|
FunUtil.throttle(async () => {
|
|
1140
|
-
|
|
1141
|
-
const n =
|
|
1142
|
-
let e = JSONUtil.cp(
|
|
1198
|
+
l.inlineEdit.loading = !0;
|
|
1199
|
+
const n = t.option.api.update;
|
|
1200
|
+
let e = JSONUtil.cp(l.inlineEdit.form);
|
|
1143
1201
|
delete e.children;
|
|
1144
1202
|
try {
|
|
1145
1203
|
if (!n) return;
|
|
1146
|
-
await n({ ...e }),
|
|
1204
|
+
await n({ ...e }), l.inlineEdit.close(), await l.table.getList(), U.success(g.tCurd("operationSuccess"));
|
|
1147
1205
|
} catch (a) {
|
|
1148
1206
|
console.error(a);
|
|
1149
1207
|
} finally {
|
|
1150
|
-
|
|
1208
|
+
l.inlineEdit.loading = !1;
|
|
1151
1209
|
}
|
|
1152
1210
|
});
|
|
1153
1211
|
}
|
|
1154
1212
|
},
|
|
1213
|
+
/** 删除操作弹窗与数据对象 */
|
|
1155
1214
|
remove: {
|
|
1215
|
+
/** 删除弹窗标题 */
|
|
1156
1216
|
title: g.tCurd("confirmDelete"),
|
|
1217
|
+
/** 删除弹窗显示控制 */
|
|
1157
1218
|
show: !1,
|
|
1219
|
+
/** 待删除数据项集合 */
|
|
1158
1220
|
items: [],
|
|
1221
|
+
/** 删除操作loading */
|
|
1159
1222
|
loading: !1,
|
|
1223
|
+
/** 关闭删除弹窗 */
|
|
1160
1224
|
close: () => {
|
|
1161
|
-
|
|
1225
|
+
l.remove.show = !1;
|
|
1162
1226
|
},
|
|
1227
|
+
/** 打开删除弹窗并设置待删除项 */
|
|
1163
1228
|
open: (n) => {
|
|
1164
1229
|
if (n.length === 0) {
|
|
1165
|
-
|
|
1230
|
+
U.fail(g.tCurd("selectDataToDelete"));
|
|
1166
1231
|
return;
|
|
1167
1232
|
}
|
|
1168
|
-
|
|
1233
|
+
l.remove.items = n, l.remove.show = !0;
|
|
1169
1234
|
},
|
|
1235
|
+
/** 执行删除实际操作 */
|
|
1170
1236
|
submit: () => {
|
|
1171
1237
|
FunUtil.throttle(async () => {
|
|
1172
|
-
|
|
1173
|
-
const n =
|
|
1238
|
+
l.remove.loading = !0;
|
|
1239
|
+
const n = t.option.api.delete;
|
|
1174
1240
|
try {
|
|
1175
1241
|
if (!n) return;
|
|
1176
1242
|
await n({
|
|
1177
|
-
[
|
|
1178
|
-
items:
|
|
1179
|
-
}),
|
|
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();
|
|
1180
1246
|
} catch (e) {
|
|
1181
1247
|
console.error(e);
|
|
1182
1248
|
} finally {
|
|
1183
|
-
|
|
1249
|
+
l.remove.loading = !1;
|
|
1184
1250
|
}
|
|
1185
1251
|
});
|
|
1186
1252
|
}
|
|
1187
1253
|
},
|
|
1254
|
+
/** 初始化curd关联所有默认与依赖配置及表单列 */
|
|
1188
1255
|
init: () => {
|
|
1189
|
-
|
|
1256
|
+
l.initCurdConfig(), l.initColumnOptions(), l.initColumnForm();
|
|
1190
1257
|
},
|
|
1258
|
+
/** 下拉请求等数据缓存 */
|
|
1191
1259
|
apiDataMap: {},
|
|
1260
|
+
/** 获取并绑定curd中所有下拉数据等远程依赖 */
|
|
1192
1261
|
initApiData: async (n) => {
|
|
1193
|
-
const e = [], a = (
|
|
1194
|
-
if (
|
|
1195
|
-
|
|
1262
|
+
const e = [], a = (u) => {
|
|
1263
|
+
if (u.children && u.children.length) {
|
|
1264
|
+
u.children.forEach((f) => a(f));
|
|
1196
1265
|
return;
|
|
1197
1266
|
}
|
|
1198
|
-
if (
|
|
1199
|
-
if (
|
|
1200
|
-
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 () => {
|
|
1201
1270
|
try {
|
|
1202
|
-
let p = await
|
|
1271
|
+
let p = await u.options?.select?.dataApi?.();
|
|
1203
1272
|
if (p) {
|
|
1204
|
-
const c =
|
|
1205
|
-
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;
|
|
1206
1275
|
}
|
|
1207
1276
|
} catch {
|
|
1208
1277
|
}
|
|
1209
1278
|
})();
|
|
1210
|
-
e.push(
|
|
1279
|
+
e.push(f);
|
|
1211
1280
|
}
|
|
1212
1281
|
};
|
|
1213
|
-
return
|
|
1214
|
-
a(
|
|
1282
|
+
return t.option.column.forEach((u) => {
|
|
1283
|
+
a(u);
|
|
1215
1284
|
}), await Promise.all(e), !0;
|
|
1216
1285
|
},
|
|
1286
|
+
/** 初始化curd配置(option默认值合并等) */
|
|
1217
1287
|
initCurdConfig: () => {
|
|
1218
1288
|
const n = JSONUtil.cp(S.config);
|
|
1219
1289
|
n.table.emptyText = g.tCurd("noData");
|
|
1220
|
-
const e = ObjectUtil.deepMerge(n,
|
|
1290
|
+
const e = ObjectUtil.deepMerge(n, t.option || {});
|
|
1221
1291
|
Object.keys(e).forEach((a) => {
|
|
1222
|
-
|
|
1292
|
+
t.option[a] = e[a];
|
|
1223
1293
|
});
|
|
1224
1294
|
},
|
|
1225
1295
|
/**
|
|
1226
|
-
* 初始化curd
|
|
1296
|
+
* 初始化curd选项配置,每列merge默认配置等
|
|
1227
1297
|
* @param column
|
|
1228
1298
|
* @returns
|
|
1229
1299
|
*/
|
|
@@ -1237,148 +1307,149 @@ const W = $.EDialog, Se = (o) => {
|
|
|
1237
1307
|
});
|
|
1238
1308
|
const e = (a) => {
|
|
1239
1309
|
if (a.table = ObjectUtil.deepMerge(n.table, a.table || {}), a.children) {
|
|
1240
|
-
a.children.forEach((
|
|
1241
|
-
e(
|
|
1310
|
+
a.children.forEach((u) => {
|
|
1311
|
+
e(u);
|
|
1242
1312
|
});
|
|
1243
1313
|
return;
|
|
1244
1314
|
}
|
|
1245
|
-
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) => {
|
|
1246
1316
|
const p = a.options?.switch;
|
|
1247
1317
|
try {
|
|
1248
1318
|
await s.value?.open({
|
|
1249
1319
|
title: g.tCurd("confirmModify"),
|
|
1250
1320
|
content: g.tCurd("confirmSwitchMessage")
|
|
1251
|
-
}),
|
|
1321
|
+
}), l.table.loading = !0;
|
|
1252
1322
|
try {
|
|
1253
|
-
return
|
|
1254
|
-
[
|
|
1255
|
-
[
|
|
1256
|
-
final(c, i,
|
|
1257
|
-
|
|
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;
|
|
1258
1328
|
}
|
|
1259
|
-
}),
|
|
1329
|
+
}), l.table.loading = !1, U.success(g.tCurd("operationSuccess")), l.table.getList(), !0) : void 0;
|
|
1260
1330
|
} catch (c) {
|
|
1261
1331
|
return console.error(c), !1;
|
|
1262
1332
|
} finally {
|
|
1263
|
-
|
|
1333
|
+
l.table.loading = !1;
|
|
1264
1334
|
}
|
|
1265
1335
|
} catch {
|
|
1266
1336
|
return !1;
|
|
1267
1337
|
}
|
|
1268
|
-
}), 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);
|
|
1269
1339
|
};
|
|
1270
|
-
|
|
1340
|
+
t.option.column.forEach(e), t.option.table?.column?.forEach(e);
|
|
1271
1341
|
},
|
|
1342
|
+
/** 初始化配置并生成表单列及默认值及规则 */
|
|
1272
1343
|
initColumnForm: () => {
|
|
1273
|
-
const n =
|
|
1274
|
-
|
|
1344
|
+
const n = t.option;
|
|
1345
|
+
l.update.formColumn = [], l.table.column.show = {
|
|
1275
1346
|
list: [],
|
|
1276
1347
|
listSource: []
|
|
1277
1348
|
};
|
|
1278
|
-
const e = [], a =
|
|
1279
|
-
let
|
|
1280
|
-
const p = (
|
|
1281
|
-
if (
|
|
1282
|
-
|
|
1283
|
-
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);
|
|
1284
1355
|
});
|
|
1285
1356
|
return;
|
|
1286
1357
|
}
|
|
1287
|
-
if (
|
|
1288
|
-
|
|
1289
|
-
let
|
|
1290
|
-
const j =
|
|
1291
|
-
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) {
|
|
1292
1363
|
const z = {
|
|
1293
1364
|
input: g.tCurd("placeholderInput"),
|
|
1294
1365
|
select: g.tCurd("placeholderSelect")
|
|
1295
|
-
},
|
|
1296
|
-
|
|
1366
|
+
}, B = (z[d.type] || z.input) + d.label;
|
|
1367
|
+
l.update.rules[d.key] = typeof d.rules == "boolean" ? [
|
|
1297
1368
|
{
|
|
1298
1369
|
required: !0,
|
|
1299
|
-
message:
|
|
1370
|
+
message: B,
|
|
1300
1371
|
trigger: "blur"
|
|
1301
1372
|
}
|
|
1302
|
-
] :
|
|
1373
|
+
] : d.rules;
|
|
1303
1374
|
}
|
|
1304
1375
|
}
|
|
1305
|
-
}, c = (
|
|
1306
|
-
|
|
1376
|
+
}, c = (d, y) => {
|
|
1377
|
+
d.isForm = y, Array.isArray(d.children) && d.children.forEach((I) => c(I, y));
|
|
1307
1378
|
};
|
|
1308
|
-
n.column.forEach((
|
|
1309
|
-
|
|
1310
|
-
}),
|
|
1311
|
-
c(
|
|
1312
|
-
}),
|
|
1313
|
-
const i =
|
|
1314
|
-
i && Object.keys(i).forEach((
|
|
1315
|
-
|
|
1316
|
-
}), n.column.forEach((
|
|
1317
|
-
|
|
1318
|
-
}),
|
|
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);
|
|
1319
1390
|
}
|
|
1320
1391
|
});
|
|
1321
|
-
return
|
|
1322
|
-
|
|
1323
|
-
}), { conf:
|
|
1324
|
-
}, 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({
|
|
1325
1396
|
__name: "switchConfirm",
|
|
1326
|
-
setup(
|
|
1327
|
-
const r =
|
|
1397
|
+
setup(t, { expose: s }) {
|
|
1398
|
+
const r = K(!1), l = K("确认修改"), n = K("确认要修改状态吗?");
|
|
1328
1399
|
let e = null, a = null;
|
|
1329
|
-
const
|
|
1330
|
-
e = i, a =
|
|
1331
|
-
})),
|
|
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 = () => {
|
|
1332
1403
|
r.value = !1, e?.(!0), e = null, a = null;
|
|
1333
1404
|
}, p = () => {
|
|
1334
1405
|
r.value = !1, a?.(new Error("用户取消操作")), e = null, a = null;
|
|
1335
1406
|
};
|
|
1336
1407
|
return s({
|
|
1337
|
-
open:
|
|
1338
|
-
}), (c, i) => (
|
|
1408
|
+
open: u
|
|
1409
|
+
}), (c, i) => (m(), b(o(Y), {
|
|
1339
1410
|
modelValue: r.value,
|
|
1340
|
-
"onUpdate:modelValue": i[0] || (i[0] = (
|
|
1341
|
-
title:
|
|
1411
|
+
"onUpdate:modelValue": i[0] || (i[0] = (d) => r.value = d),
|
|
1412
|
+
title: l.value,
|
|
1342
1413
|
"close-on-click-modal": !1,
|
|
1343
1414
|
width: "400px"
|
|
1344
1415
|
}, {
|
|
1345
|
-
footer:
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
default:
|
|
1416
|
+
footer: h(() => [
|
|
1417
|
+
$("span", Oe, [
|
|
1418
|
+
V(o(F), { onClick: p }, {
|
|
1419
|
+
default: h(() => [...i[1] || (i[1] = [
|
|
1349
1420
|
E("取消", -1)
|
|
1350
1421
|
])]),
|
|
1351
1422
|
_: 1
|
|
1352
1423
|
}),
|
|
1353
|
-
|
|
1424
|
+
V(o(F), {
|
|
1354
1425
|
type: "primary",
|
|
1355
|
-
onClick:
|
|
1426
|
+
onClick: f
|
|
1356
1427
|
}, {
|
|
1357
|
-
default:
|
|
1428
|
+
default: h(() => [...i[2] || (i[2] = [
|
|
1358
1429
|
E("确认", -1)
|
|
1359
1430
|
])]),
|
|
1360
1431
|
_: 1
|
|
1361
1432
|
})
|
|
1362
1433
|
])
|
|
1363
1434
|
]),
|
|
1364
|
-
default:
|
|
1365
|
-
|
|
1435
|
+
default: h(() => [
|
|
1436
|
+
$("div", null, x(n.value), 1)
|
|
1366
1437
|
]),
|
|
1367
1438
|
_: 1
|
|
1368
1439
|
}, 8, ["modelValue", "title"]));
|
|
1369
1440
|
}
|
|
1370
|
-
}), re = (
|
|
1371
|
-
const r =
|
|
1372
|
-
for (const [
|
|
1373
|
-
r[
|
|
1441
|
+
}), re = (t, s) => {
|
|
1442
|
+
const r = t.__vccOpts || t;
|
|
1443
|
+
for (const [l, n] of s)
|
|
1444
|
+
r[l] = n;
|
|
1374
1445
|
return r;
|
|
1375
1446
|
}, Ie = {}, Me = {
|
|
1376
1447
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1377
1448
|
viewBox: "0 0 1024 1024"
|
|
1378
1449
|
};
|
|
1379
|
-
function je(
|
|
1380
|
-
return
|
|
1381
|
-
|
|
1450
|
+
function je(t, s) {
|
|
1451
|
+
return m(), w("svg", Me, [...s[0] || (s[0] = [
|
|
1452
|
+
$("path", {
|
|
1382
1453
|
fill: "currentColor",
|
|
1383
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"
|
|
1384
1455
|
}, null, -1)
|
|
@@ -1389,183 +1460,202 @@ const Le = /* @__PURE__ */ re(Ie, [["render", je]]), ze = {}, Te = {
|
|
|
1389
1460
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1390
1461
|
viewBox: "0 0 1024 1024"
|
|
1391
1462
|
};
|
|
1392
|
-
function Re(
|
|
1393
|
-
return
|
|
1394
|
-
|
|
1463
|
+
function Re(t, s) {
|
|
1464
|
+
return m(), w("svg", Te, [...s[0] || (s[0] = [
|
|
1465
|
+
$("path", {
|
|
1395
1466
|
fill: "currentColor",
|
|
1396
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"
|
|
1397
1468
|
}, null, -1)
|
|
1398
1469
|
])]);
|
|
1399
1470
|
}
|
|
1400
|
-
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({
|
|
1401
1472
|
__name: "tableColumn",
|
|
1402
1473
|
props: {
|
|
1403
1474
|
conf: {},
|
|
1404
1475
|
columnList: {},
|
|
1405
1476
|
option: {}
|
|
1406
1477
|
},
|
|
1407
|
-
setup(
|
|
1408
|
-
const s =
|
|
1409
|
-
return (
|
|
1410
|
-
const
|
|
1411
|
-
return
|
|
1412
|
-
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
|
|
1413
1484
|
}, [
|
|
1414
|
-
|
|
1485
|
+
t.conf.table.column.show.list.includes(a.key) ? (m(), b(o(Z), C({
|
|
1415
1486
|
key: 0,
|
|
1416
|
-
prop:
|
|
1417
|
-
label:
|
|
1418
|
-
}, { ref_for: !0 },
|
|
1419
|
-
header:
|
|
1420
|
-
k(
|
|
1421
|
-
|
|
1422
|
-
|
|
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, {
|
|
1423
1494
|
key: 0,
|
|
1424
1495
|
effect: "dark",
|
|
1425
|
-
content:
|
|
1496
|
+
content: a.table?.tooltip,
|
|
1426
1497
|
placement: "top"
|
|
1427
1498
|
}, {
|
|
1428
|
-
default:
|
|
1429
|
-
|
|
1430
|
-
|
|
1499
|
+
default: h(() => [
|
|
1500
|
+
$("span", Ke, [
|
|
1501
|
+
V(Ae)
|
|
1431
1502
|
])
|
|
1432
1503
|
]),
|
|
1433
1504
|
_: 1
|
|
1434
|
-
}, 8, ["content"])) :
|
|
1435
|
-
E(" " + x(
|
|
1505
|
+
}, 8, ["content"])) : v("", !0),
|
|
1506
|
+
E(" " + x(a.label), 1)
|
|
1436
1507
|
])
|
|
1437
1508
|
])
|
|
1438
1509
|
]),
|
|
1439
|
-
default:
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
(
|
|
1443
|
-
conf:
|
|
1444
|
-
columnList:
|
|
1445
|
-
option:
|
|
1446
|
-
},
|
|
1447
|
-
M(
|
|
1448
|
-
name:
|
|
1449
|
-
fn:
|
|
1450
|
-
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 || {}))
|
|
1451
1522
|
])
|
|
1452
1523
|
}))
|
|
1453
1524
|
]), 1032, ["conf", "columnList", "option"]))
|
|
1454
|
-
], 64)) : (
|
|
1455
|
-
|
|
1456
|
-
|
|
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({
|
|
1457
1528
|
key: 0,
|
|
1458
|
-
modelValue:
|
|
1459
|
-
"onUpdate:modelValue": (
|
|
1460
|
-
}, { 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, {
|
|
1461
1532
|
size: "small",
|
|
1462
1533
|
style: { width: "100%" },
|
|
1463
|
-
onKeyup:
|
|
1464
|
-
}), 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({
|
|
1465
1536
|
key: 1,
|
|
1466
|
-
modelValue:
|
|
1467
|
-
"onUpdate:modelValue": (
|
|
1468
|
-
}, { 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, {
|
|
1469
1540
|
size: "small",
|
|
1470
1541
|
style: { width: "100%" }
|
|
1471
1542
|
}), {
|
|
1472
|
-
default:
|
|
1473
|
-
(
|
|
1474
|
-
key:
|
|
1475
|
-
label:
|
|
1476
|
-
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
|
|
1477
1548
|
}, null, 8, ["label", "value"]))), 128))
|
|
1478
1549
|
]),
|
|
1479
1550
|
_: 2
|
|
1480
|
-
}, 1040, ["modelValue", "onUpdate:modelValue"])) :
|
|
1481
|
-
], 64)) : k(
|
|
1551
|
+
}, 1040, ["modelValue", "onUpdate:modelValue"])) : v("", !0)
|
|
1552
|
+
], 64)) : k(l.$slots, "table-" + a.key, {
|
|
1482
1553
|
key: 1,
|
|
1483
|
-
row:
|
|
1484
|
-
item:
|
|
1554
|
+
row: u,
|
|
1555
|
+
item: a
|
|
1485
1556
|
}, () => [
|
|
1486
|
-
|
|
1557
|
+
a.type === "switch" ? (m(), b(o(_), C({
|
|
1487
1558
|
key: 0,
|
|
1488
|
-
modelValue: a
|
|
1489
|
-
"onUpdate:modelValue": (
|
|
1490
|
-
"before-change": () =>
|
|
1491
|
-
}, { 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", {
|
|
1492
1563
|
key: 1,
|
|
1493
|
-
style:
|
|
1494
|
-
"--table-text-click-color":
|
|
1564
|
+
style: ie({
|
|
1565
|
+
"--table-text-click-color": a.table?.click?.color
|
|
1495
1566
|
}),
|
|
1496
|
-
class: T({ "table-text-click":
|
|
1497
|
-
onClick: (
|
|
1498
|
-
}, 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))
|
|
1499
1570
|
])
|
|
1500
1571
|
], 64))
|
|
1501
1572
|
]),
|
|
1502
1573
|
_: 2
|
|
1503
|
-
}, 1040, ["prop", "label"])) :
|
|
1574
|
+
}, 1040, ["prop", "label"])) : v("", !0)
|
|
1504
1575
|
], 64))), 128);
|
|
1505
1576
|
};
|
|
1506
1577
|
}
|
|
1507
|
-
}), le = /* @__PURE__ */
|
|
1578
|
+
}), le = /* @__PURE__ */ N({
|
|
1508
1579
|
__name: "formColumn",
|
|
1509
1580
|
props: {
|
|
1510
1581
|
conf: {},
|
|
1511
1582
|
item: {}
|
|
1512
1583
|
},
|
|
1513
|
-
setup(
|
|
1514
|
-
return (s, r) =>
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
modelValue:
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
modelValue:
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
disabled:
|
|
1568
|
-
|
|
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
|
+
};
|
|
1569
1659
|
}
|
|
1570
1660
|
}), Je = { class: "col relative cc1-form-box" }, We = {
|
|
1571
1661
|
class: "absolute row fit",
|
|
@@ -1585,7 +1675,7 @@ const Ae = /* @__PURE__ */ re(ze, [["render", Re]]), Pe = { class: "row flex-cen
|
|
|
1585
1675
|
}, nt = { class: "col" }, it = {
|
|
1586
1676
|
class: "row form-item-content",
|
|
1587
1677
|
style: { width: "100%" }
|
|
1588
|
-
}, 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({
|
|
1589
1679
|
__name: "index",
|
|
1590
1680
|
props: {
|
|
1591
1681
|
/**
|
|
@@ -1595,198 +1685,198 @@ const Ae = /* @__PURE__ */ re(ze, [["render", Re]]), Pe = { class: "row flex-cen
|
|
|
1595
1685
|
default: {}
|
|
1596
1686
|
}
|
|
1597
1687
|
},
|
|
1598
|
-
setup(
|
|
1599
|
-
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);
|
|
1600
1690
|
return s({
|
|
1601
1691
|
conf: e
|
|
1602
|
-
}), (
|
|
1603
|
-
const c =
|
|
1604
|
-
return
|
|
1605
|
-
|
|
1606
|
-
k(
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
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,
|
|
1611
1701
|
inline: ""
|
|
1612
1702
|
}, {
|
|
1613
|
-
default:
|
|
1614
|
-
k(
|
|
1615
|
-
row:
|
|
1703
|
+
default: h(() => [
|
|
1704
|
+
k(f.$slots, "search-start", {
|
|
1705
|
+
row: o(e).search.form
|
|
1616
1706
|
}),
|
|
1617
|
-
(
|
|
1707
|
+
(m(!0), w(D, null, M(o(e).search.column.list, (i) => (m(), w(D, {
|
|
1618
1708
|
key: i.key
|
|
1619
1709
|
}, [
|
|
1620
|
-
(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), {
|
|
1621
1711
|
key: 0,
|
|
1622
1712
|
label: typeof i.text?.search?.label == "string" ? i.text?.search?.label : i.label,
|
|
1623
1713
|
class: T({
|
|
1624
1714
|
"hide-label": typeof i.text?.search?.label == "boolean" ? !i.text?.search?.label : !1
|
|
1625
1715
|
})
|
|
1626
1716
|
}, {
|
|
1627
|
-
default:
|
|
1628
|
-
k(
|
|
1629
|
-
row:
|
|
1717
|
+
default: h(() => [
|
|
1718
|
+
k(f.$slots, "search-" + i.key, {
|
|
1719
|
+
row: o(e).search.form
|
|
1630
1720
|
}, () => [
|
|
1631
|
-
i.type === "input" ? (
|
|
1721
|
+
i.type === "input" ? (m(), b(o(q), C({
|
|
1632
1722
|
key: 0,
|
|
1633
|
-
modelValue:
|
|
1634
|
-
"onUpdate:modelValue": (
|
|
1635
|
-
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),
|
|
1636
1726
|
clearable: "",
|
|
1637
1727
|
disabled: i.disabled?.search
|
|
1638
|
-
}, { 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({
|
|
1639
1729
|
key: 1,
|
|
1640
|
-
modelValue:
|
|
1641
|
-
"onUpdate:modelValue": (
|
|
1642
|
-
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")),
|
|
1643
1733
|
clearable: "",
|
|
1644
1734
|
disabled: i.disabled?.search
|
|
1645
1735
|
}, { ref_for: !0 }, i.options?.switch, O(i.options?.switch?.on || {})), {
|
|
1646
|
-
default:
|
|
1647
|
-
(
|
|
1736
|
+
default: h(() => [
|
|
1737
|
+
(m(), b(o(P), {
|
|
1648
1738
|
key: i.options?.switch?.activeValue,
|
|
1649
1739
|
label: i.options?.switch?.activeLabel,
|
|
1650
1740
|
value: i.options?.switch?.activeValue
|
|
1651
1741
|
}, null, 8, ["label", "value"])),
|
|
1652
|
-
(
|
|
1742
|
+
(m(), b(o(P), {
|
|
1653
1743
|
key: i.options?.switch?.inactiveValue,
|
|
1654
1744
|
label: i.options?.switch?.inactiveLabel,
|
|
1655
1745
|
value: i.options?.switch?.inactiveValue
|
|
1656
1746
|
}, null, 8, ["label", "value"]))
|
|
1657
1747
|
]),
|
|
1658
1748
|
_: 2
|
|
1659
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : i.type === "select" ? (
|
|
1749
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : i.type === "select" ? (m(), b(o(W), C({
|
|
1660
1750
|
key: 2,
|
|
1661
|
-
modelValue:
|
|
1662
|
-
"onUpdate:modelValue": (
|
|
1663
|
-
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")),
|
|
1664
1754
|
clearable: "",
|
|
1665
1755
|
disabled: i.disabled?.search
|
|
1666
1756
|
}, { ref_for: !0 }, i.options?.select, O(i.options?.select?.on || {})), {
|
|
1667
|
-
default:
|
|
1668
|
-
(
|
|
1669
|
-
key:
|
|
1670
|
-
label:
|
|
1671
|
-
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
|
|
1672
1762
|
}, null, 8, ["label", "value"]))), 128))
|
|
1673
1763
|
]),
|
|
1674
1764
|
_: 2
|
|
1675
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : i.type === "datetime" ? (
|
|
1765
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : i.type === "datetime" ? (m(), b(o(ee), C({
|
|
1676
1766
|
key: 3,
|
|
1677
|
-
modelValue:
|
|
1678
|
-
"onUpdate:modelValue": (
|
|
1767
|
+
modelValue: o(e).search.form[i.key],
|
|
1768
|
+
"onUpdate:modelValue": (d) => o(e).search.form[i.key] = d
|
|
1679
1769
|
}, { ref_for: !0 }, i.options?.datetime, O(i.options?.datetime?.on || {}), {
|
|
1680
1770
|
disabled: i.disabled?.search
|
|
1681
|
-
}), 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({
|
|
1682
1772
|
key: 4,
|
|
1683
|
-
modelValue:
|
|
1684
|
-
"onUpdate:modelValue": (
|
|
1773
|
+
modelValue: o(e).search.form[i.key],
|
|
1774
|
+
"onUpdate:modelValue": (d) => o(e).search.form[i.key] = d
|
|
1685
1775
|
}, { ref_for: !0 }, i.options?.[i.type], O(i.options?.[i.type]?.on || {}), {
|
|
1686
1776
|
disabled: i.disabled?.search
|
|
1687
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
1777
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : v("", !0)
|
|
1688
1778
|
]),
|
|
1689
|
-
k(
|
|
1690
|
-
row:
|
|
1779
|
+
k(f.$slots, "search-" + i.key + "-right", {
|
|
1780
|
+
row: o(e).search.form
|
|
1691
1781
|
})
|
|
1692
1782
|
]),
|
|
1693
1783
|
_: 2
|
|
1694
|
-
}, 1032, ["label", "class"])) :
|
|
1784
|
+
}, 1032, ["label", "class"])) : v("", !0)
|
|
1695
1785
|
], 64))), 128)),
|
|
1696
|
-
k(
|
|
1697
|
-
row:
|
|
1786
|
+
k(f.$slots, "search-center", {
|
|
1787
|
+
row: o(e).search.form
|
|
1698
1788
|
}),
|
|
1699
|
-
|
|
1700
|
-
default:
|
|
1701
|
-
|
|
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), {
|
|
1702
1792
|
key: 0,
|
|
1703
1793
|
type: "primary",
|
|
1704
|
-
onClick:
|
|
1794
|
+
onClick: o(e).search.submit
|
|
1705
1795
|
}, {
|
|
1706
|
-
default:
|
|
1707
|
-
E(x(
|
|
1796
|
+
default: h(() => [
|
|
1797
|
+
E(x(o(g).tCurd("search")), 1)
|
|
1708
1798
|
]),
|
|
1709
1799
|
_: 1
|
|
1710
|
-
}, 8, ["onClick"])) :
|
|
1711
|
-
|
|
1800
|
+
}, 8, ["onClick"])) : v("", !0),
|
|
1801
|
+
t.option.tools?.reset ? (m(), b(o(F), {
|
|
1712
1802
|
key: 1,
|
|
1713
|
-
onClick:
|
|
1803
|
+
onClick: o(e).search.reset
|
|
1714
1804
|
}, {
|
|
1715
|
-
default:
|
|
1716
|
-
E(x(
|
|
1805
|
+
default: h(() => [
|
|
1806
|
+
E(x(o(g).tCurd("reset")), 1)
|
|
1717
1807
|
]),
|
|
1718
1808
|
_: 1
|
|
1719
|
-
}, 8, ["onClick"])) :
|
|
1809
|
+
}, 8, ["onClick"])) : v("", !0)
|
|
1720
1810
|
]),
|
|
1721
1811
|
_: 1
|
|
1722
|
-
})) :
|
|
1723
|
-
k(
|
|
1724
|
-
row:
|
|
1812
|
+
})) : v("", !0),
|
|
1813
|
+
k(f.$slots, "search-end", {
|
|
1814
|
+
row: o(e).search.form
|
|
1725
1815
|
})
|
|
1726
1816
|
]),
|
|
1727
1817
|
_: 3
|
|
1728
1818
|
}, 8, ["model"])
|
|
1729
|
-
])) :
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1819
|
+
])) : v("", !0),
|
|
1820
|
+
$("div", Ge, [
|
|
1821
|
+
$("div", Xe, [
|
|
1822
|
+
o(n)(t.option.tools?.add) ? (m(), w("div", Qe, [
|
|
1823
|
+
V(o(F), {
|
|
1734
1824
|
type: "primary",
|
|
1735
|
-
onClick: p[0] || (p[0] = (i) =>
|
|
1825
|
+
onClick: p[0] || (p[0] = (i) => o(e).update.open(o(r).Insert))
|
|
1736
1826
|
}, {
|
|
1737
|
-
default:
|
|
1738
|
-
E(x(
|
|
1827
|
+
default: h(() => [
|
|
1828
|
+
E(x(o(g).tCurd("add")), 1)
|
|
1739
1829
|
]),
|
|
1740
1830
|
_: 1
|
|
1741
1831
|
})
|
|
1742
|
-
])) :
|
|
1743
|
-
|
|
1744
|
-
|
|
1832
|
+
])) : v("", !0),
|
|
1833
|
+
t.option.table?.selectable && o(n)(t.option.tools?.delete) ? (m(), w("div", Ye, [
|
|
1834
|
+
V(o(F), {
|
|
1745
1835
|
type: "danger",
|
|
1746
|
-
onClick: p[1] || (p[1] = (i) =>
|
|
1836
|
+
onClick: p[1] || (p[1] = (i) => o(e).remove.open(o(e).table.selection.list))
|
|
1747
1837
|
}, {
|
|
1748
|
-
default:
|
|
1749
|
-
E(x(
|
|
1838
|
+
default: h(() => [
|
|
1839
|
+
E(x(o(g).tCurd("delete")), 1)
|
|
1750
1840
|
]),
|
|
1751
1841
|
_: 1
|
|
1752
1842
|
})
|
|
1753
|
-
])) :
|
|
1754
|
-
|
|
1755
|
-
|
|
1843
|
+
])) : v("", !0),
|
|
1844
|
+
t.option.tools?.expand ? (m(), w("div", Ze, [
|
|
1845
|
+
V(o(F), {
|
|
1756
1846
|
type: "warning",
|
|
1757
|
-
onClick: p[2] || (p[2] = (i) =>
|
|
1847
|
+
onClick: p[2] || (p[2] = (i) => o(e).table.expand.all())
|
|
1758
1848
|
}, {
|
|
1759
|
-
default:
|
|
1760
|
-
E(x(
|
|
1849
|
+
default: h(() => [
|
|
1850
|
+
E(x(o(g).tCurd("expandCollapse")), 1)
|
|
1761
1851
|
]),
|
|
1762
1852
|
_: 1
|
|
1763
1853
|
})
|
|
1764
|
-
])) :
|
|
1765
|
-
|
|
1854
|
+
])) : v("", !0),
|
|
1855
|
+
t.option.tools?.export?.show ? (m(), b(o(fe), {
|
|
1766
1856
|
key: 3,
|
|
1767
|
-
onCommand:
|
|
1857
|
+
onCommand: o(e).export.click
|
|
1768
1858
|
}, {
|
|
1769
|
-
dropdown:
|
|
1770
|
-
|
|
1771
|
-
default:
|
|
1772
|
-
|
|
1859
|
+
dropdown: h(() => [
|
|
1860
|
+
V(o(me), null, {
|
|
1861
|
+
default: h(() => [
|
|
1862
|
+
t.option.table?.selectable ? (m(), b(o(X), {
|
|
1773
1863
|
key: 0,
|
|
1774
1864
|
command: "select"
|
|
1775
1865
|
}, {
|
|
1776
|
-
default:
|
|
1777
|
-
E(x(
|
|
1866
|
+
default: h(() => [
|
|
1867
|
+
E(x(o(g).tCurd("exportSelect")), 1)
|
|
1778
1868
|
]),
|
|
1779
1869
|
_: 1
|
|
1780
|
-
})) :
|
|
1781
|
-
|
|
1782
|
-
default:
|
|
1783
|
-
E(x(
|
|
1870
|
+
})) : v("", !0),
|
|
1871
|
+
V(o(X), { command: "page" }, {
|
|
1872
|
+
default: h(() => [
|
|
1873
|
+
E(x(o(g).tCurd("exportPage")), 1)
|
|
1784
1874
|
]),
|
|
1785
1875
|
_: 1
|
|
1786
1876
|
}),
|
|
1787
|
-
|
|
1788
|
-
default:
|
|
1789
|
-
E(x(
|
|
1877
|
+
V(o(X), { command: "all" }, {
|
|
1878
|
+
default: h(() => [
|
|
1879
|
+
E(x(o(g).tCurd("exportAll")), 1)
|
|
1790
1880
|
]),
|
|
1791
1881
|
_: 1
|
|
1792
1882
|
})
|
|
@@ -1794,344 +1884,356 @@ const Ae = /* @__PURE__ */ re(ze, [["render", Re]]), Pe = { class: "row flex-cen
|
|
|
1794
1884
|
_: 1
|
|
1795
1885
|
})
|
|
1796
1886
|
]),
|
|
1797
|
-
default:
|
|
1798
|
-
|
|
1799
|
-
|
|
1887
|
+
default: h(() => [
|
|
1888
|
+
$("div", _e, [
|
|
1889
|
+
V(o(F), {
|
|
1800
1890
|
type: "warning",
|
|
1801
|
-
loading:
|
|
1891
|
+
loading: o(e).export.loading
|
|
1802
1892
|
}, {
|
|
1803
|
-
default:
|
|
1804
|
-
E(x(
|
|
1893
|
+
default: h(() => [
|
|
1894
|
+
E(x(o(g).tCurd("export")), 1)
|
|
1805
1895
|
]),
|
|
1806
1896
|
_: 1
|
|
1807
1897
|
}, 8, ["loading"])
|
|
1808
1898
|
])
|
|
1809
1899
|
]),
|
|
1810
1900
|
_: 1
|
|
1811
|
-
}, 8, ["onCommand"])) :
|
|
1812
|
-
k(
|
|
1901
|
+
}, 8, ["onCommand"])) : v("", !0),
|
|
1902
|
+
k(f.$slots, "tools-left")
|
|
1813
1903
|
]),
|
|
1814
|
-
|
|
1815
|
-
k(
|
|
1816
|
-
|
|
1904
|
+
$("div", et, [
|
|
1905
|
+
k(f.$slots, "tools-right"),
|
|
1906
|
+
t.option.tools?.refresh === void 0 || t.option.tools?.refresh ? (m(), w("div", {
|
|
1817
1907
|
key: 0,
|
|
1818
1908
|
class: "refresh-btn",
|
|
1819
1909
|
onClick: p[3] || (p[3] = //@ts-ignore
|
|
1820
|
-
(...i) =>
|
|
1910
|
+
(...i) => o(e).table.getList && o(e).table.getList(...i))
|
|
1821
1911
|
}, [
|
|
1822
|
-
|
|
1823
|
-
])) :
|
|
1912
|
+
V(Le)
|
|
1913
|
+
])) : v("", !0)
|
|
1824
1914
|
])
|
|
1825
1915
|
]),
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
data:
|
|
1830
|
-
border:
|
|
1831
|
-
},
|
|
1832
|
-
onSelectionChange:
|
|
1833
|
-
"expand-row-keys":
|
|
1834
|
-
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
|
|
1835
1925
|
}), {
|
|
1836
|
-
default:
|
|
1837
|
-
|
|
1926
|
+
default: h(() => [
|
|
1927
|
+
t.option.table?.selectable || o(n)(t.option.tools?.delete) || t.option.tools?.export?.show ? (m(), b(o(Z), {
|
|
1838
1928
|
key: 0,
|
|
1839
1929
|
type: "selection",
|
|
1840
|
-
selectable: typeof
|
|
1930
|
+
selectable: typeof t.option.table?.selectable == "function" ? t.option.table?.selectable : void 0,
|
|
1841
1931
|
width: "55"
|
|
1842
|
-
}, null, 8, ["selectable"])) :
|
|
1843
|
-
|
|
1844
|
-
conf:
|
|
1845
|
-
columnList:
|
|
1846
|
-
option:
|
|
1847
|
-
},
|
|
1848
|
-
M(
|
|
1849
|
-
name:
|
|
1850
|
-
fn:
|
|
1851
|
-
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 || {})))
|
|
1852
1942
|
])
|
|
1853
1943
|
}))
|
|
1854
1944
|
]), 1032, ["conf", "columnList", "option"]),
|
|
1855
|
-
|
|
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({
|
|
1856
1946
|
key: 1,
|
|
1857
|
-
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"]),
|
|
1858
1948
|
align: "center",
|
|
1859
1949
|
fixed: "right"
|
|
1860
|
-
},
|
|
1861
|
-
header:
|
|
1862
|
-
k(
|
|
1863
|
-
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)
|
|
1864
1954
|
])
|
|
1865
1955
|
]),
|
|
1866
|
-
default:
|
|
1867
|
-
k(
|
|
1868
|
-
|
|
1869
|
-
|
|
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), {
|
|
1870
1960
|
link: "",
|
|
1871
1961
|
type: "info",
|
|
1872
|
-
onClick:
|
|
1962
|
+
onClick: o(e).inlineEdit.close
|
|
1873
1963
|
}, {
|
|
1874
|
-
default:
|
|
1875
|
-
E(x(
|
|
1964
|
+
default: h(() => [
|
|
1965
|
+
E(x(o(g).tCurd("cancel")), 1)
|
|
1876
1966
|
]),
|
|
1877
1967
|
_: 1
|
|
1878
1968
|
}, 8, ["onClick"]),
|
|
1879
|
-
|
|
1969
|
+
V(o(F), {
|
|
1880
1970
|
link: "",
|
|
1881
1971
|
type: "primary",
|
|
1882
|
-
onClick:
|
|
1883
|
-
loading:
|
|
1972
|
+
onClick: o(e).inlineEdit.submit,
|
|
1973
|
+
loading: o(e).inlineEdit.loading
|
|
1884
1974
|
}, {
|
|
1885
|
-
default:
|
|
1886
|
-
E(x(
|
|
1975
|
+
default: h(() => [
|
|
1976
|
+
E(x(o(g).tCurd("confirm")), 1)
|
|
1887
1977
|
]),
|
|
1888
1978
|
_: 1
|
|
1889
1979
|
}, 8, ["onClick", "loading"]),
|
|
1890
|
-
k(
|
|
1891
|
-
], 64)) : (
|
|
1892
|
-
|
|
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), {
|
|
1893
1983
|
key: 0,
|
|
1894
1984
|
link: "",
|
|
1895
1985
|
type: "primary",
|
|
1896
|
-
onClick: (
|
|
1986
|
+
onClick: (d) => o(e).update.open(o(r).Insert, i)
|
|
1897
1987
|
}, {
|
|
1898
|
-
default:
|
|
1899
|
-
E(x(
|
|
1988
|
+
default: h(() => [
|
|
1989
|
+
E(x(o(g).tCurd("add")), 1)
|
|
1900
1990
|
]),
|
|
1901
1991
|
_: 1
|
|
1902
|
-
}, 8, ["onClick"])) :
|
|
1903
|
-
|
|
1992
|
+
}, 8, ["onClick"])) : v("", !0),
|
|
1993
|
+
o(n)(t.option.table?.view, i) ? (m(), b(o(F), {
|
|
1904
1994
|
key: 1,
|
|
1905
1995
|
link: "",
|
|
1906
|
-
type: "
|
|
1907
|
-
onClick: (
|
|
1996
|
+
type: "primary",
|
|
1997
|
+
onClick: (d) => o(e).update.open(o(r).View, i)
|
|
1908
1998
|
}, {
|
|
1909
|
-
default:
|
|
1910
|
-
E(x(
|
|
1999
|
+
default: h(() => [
|
|
2000
|
+
E(x(o(g).tCurd("view")), 1)
|
|
1911
2001
|
]),
|
|
1912
2002
|
_: 1
|
|
1913
|
-
}, 8, ["onClick"])) :
|
|
1914
|
-
|
|
2003
|
+
}, 8, ["onClick"])) : v("", !0),
|
|
2004
|
+
o(n)(t.option.table?.update, i) ? (m(), b(o(F), {
|
|
1915
2005
|
key: 2,
|
|
1916
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: "",
|
|
1917
2018
|
type: "danger",
|
|
1918
|
-
onClick: (
|
|
2019
|
+
onClick: (d) => o(e).remove.open([i])
|
|
1919
2020
|
}, {
|
|
1920
|
-
default:
|
|
1921
|
-
E(x(
|
|
2021
|
+
default: h(() => [
|
|
2022
|
+
E(x(o(g).tCurd("delete")), 1)
|
|
1922
2023
|
]),
|
|
1923
2024
|
_: 1
|
|
1924
|
-
}, 8, ["onClick"])) :
|
|
1925
|
-
k(
|
|
2025
|
+
}, 8, ["onClick"])) : v("", !0),
|
|
2026
|
+
k(f.$slots, "table-op-right", { row: i })
|
|
1926
2027
|
], 64))
|
|
1927
2028
|
]),
|
|
1928
2029
|
_: 3
|
|
1929
|
-
}, 16, ["width"])) :
|
|
2030
|
+
}, 16, ["width"])) : v("", !0)
|
|
1930
2031
|
]),
|
|
1931
2032
|
_: 3
|
|
1932
2033
|
}, 16, ["data", "border", "onSelectionChange", "expand-row-keys", "onExpandChange"])), [
|
|
1933
|
-
[c,
|
|
2034
|
+
[c, o(e).table.loading]
|
|
1934
2035
|
])
|
|
1935
2036
|
])
|
|
1936
2037
|
]),
|
|
1937
|
-
|
|
1938
|
-
|
|
2038
|
+
$("div", lt, [
|
|
2039
|
+
t.option.page?.show === void 0 || t.option.page?.show ? (m(), b(o(he), {
|
|
1939
2040
|
key: 0,
|
|
1940
|
-
"current-page":
|
|
1941
|
-
"onUpdate:currentPage": p[4] || (p[4] = (i) =>
|
|
1942
|
-
"page-size":
|
|
1943
|
-
"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),
|
|
1944
2045
|
background: "",
|
|
1945
|
-
"page-sizes":
|
|
2046
|
+
"page-sizes": o(e).page.sizeList,
|
|
1946
2047
|
"pager-count": 7,
|
|
1947
|
-
layout:
|
|
1948
|
-
total:
|
|
1949
|
-
onSizeChange:
|
|
1950
|
-
onCurrentChange:
|
|
1951
|
-
}, 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)
|
|
1952
2053
|
])
|
|
1953
2054
|
]),
|
|
1954
|
-
k(
|
|
2055
|
+
k(f.$slots, "box-right")
|
|
1955
2056
|
]),
|
|
1956
|
-
|
|
1957
|
-
modelValue:
|
|
1958
|
-
"onUpdate:modelValue": p[6] || (p[6] = (i) =>
|
|
1959
|
-
title:
|
|
1960
|
-
"before-close":
|
|
1961
|
-
},
|
|
1962
|
-
footer:
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
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
|
|
1966
2067
|
}, {
|
|
1967
|
-
default:
|
|
1968
|
-
E(x(
|
|
2068
|
+
default: h(() => [
|
|
2069
|
+
E(x(o(g).tCurd("close")), 1)
|
|
1969
2070
|
]),
|
|
1970
2071
|
_: 1
|
|
1971
2072
|
}, 8, ["onClick"]),
|
|
1972
|
-
|
|
2073
|
+
o(e).update.type !== o(r).View ? (m(), b(o(F), {
|
|
2074
|
+
key: 0,
|
|
1973
2075
|
type: "primary",
|
|
1974
|
-
onClick:
|
|
1975
|
-
loading:
|
|
2076
|
+
onClick: o(e).update.submit,
|
|
2077
|
+
loading: o(e).update.loading
|
|
1976
2078
|
}, {
|
|
1977
|
-
default:
|
|
1978
|
-
E(x(
|
|
2079
|
+
default: h(() => [
|
|
2080
|
+
E(x(o(g).tCurd("submit")), 1)
|
|
1979
2081
|
]),
|
|
1980
2082
|
_: 1
|
|
1981
|
-
}, 8, ["onClick", "loading"])
|
|
2083
|
+
}, 8, ["onClick", "loading"])) : v("", !0)
|
|
1982
2084
|
])
|
|
1983
2085
|
]),
|
|
1984
|
-
default:
|
|
1985
|
-
|
|
2086
|
+
default: h(() => [
|
|
2087
|
+
V(o(Q), {
|
|
1986
2088
|
ref_key: "ruleFormRef",
|
|
1987
|
-
ref:
|
|
1988
|
-
model:
|
|
1989
|
-
rules:
|
|
2089
|
+
ref: u,
|
|
2090
|
+
model: o(e).update.form,
|
|
2091
|
+
rules: o(e).update.rules
|
|
1990
2092
|
}, {
|
|
1991
|
-
default:
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
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) => {
|
|
1995
2097
|
if (I.children)
|
|
1996
|
-
return
|
|
1997
|
-
|
|
2098
|
+
return y(I.children);
|
|
2099
|
+
d.push(...I.map((j) => j.item.show?.form));
|
|
1998
2100
|
};
|
|
1999
|
-
return
|
|
2000
|
-
},
|
|
2101
|
+
return y(i), d;
|
|
2102
|
+
}, o(e).update.form, o(e).update.type) ? (m(), w("div", {
|
|
2001
2103
|
key: 0,
|
|
2002
2104
|
class: T(["row curd-row", {
|
|
2003
|
-
stripe:
|
|
2105
|
+
stripe: t.option.form?.stripe === void 0 ? !0 : t.option.form?.stripe
|
|
2004
2106
|
}])
|
|
2005
2107
|
}, [
|
|
2006
|
-
k(
|
|
2007
|
-
row:
|
|
2108
|
+
k(f.$slots, "form-start", {
|
|
2109
|
+
row: o(e).update.form
|
|
2008
2110
|
}),
|
|
2009
|
-
(
|
|
2010
|
-
|
|
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", {
|
|
2011
2113
|
key: 0,
|
|
2012
|
-
class: T(
|
|
2114
|
+
class: T(d.item.form.span > 0 ? `col-${d.item.form.span}` : "col")
|
|
2013
2115
|
}, [
|
|
2014
|
-
|
|
2116
|
+
d.item.children ? (m(!0), w(D, { key: 0 }, M(d.children, (y) => (m(), b(o(J), {
|
|
2015
2117
|
class: T({
|
|
2016
|
-
"hide-label": typeof
|
|
2118
|
+
"hide-label": typeof y.item.text?.form?.label == "boolean" ? !y.item.text?.form?.label : !1
|
|
2017
2119
|
}),
|
|
2018
|
-
label: typeof
|
|
2019
|
-
prop:
|
|
2020
|
-
"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"
|
|
2021
2123
|
}, {
|
|
2022
|
-
default:
|
|
2023
|
-
|
|
2024
|
-
k(
|
|
2025
|
-
row:
|
|
2026
|
-
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
|
|
2027
2129
|
}),
|
|
2028
|
-
|
|
2029
|
-
k(
|
|
2030
|
-
row:
|
|
2031
|
-
item:
|
|
2130
|
+
$("div", nt, [
|
|
2131
|
+
k(f.$slots, "form-" + y.item.key, {
|
|
2132
|
+
row: o(e).update.form,
|
|
2133
|
+
item: y.item
|
|
2032
2134
|
}, () => [
|
|
2033
|
-
|
|
2034
|
-
conf:
|
|
2035
|
-
item:
|
|
2135
|
+
V(le, {
|
|
2136
|
+
conf: o(e),
|
|
2137
|
+
item: d
|
|
2036
2138
|
}, null, 8, ["conf", "item"])
|
|
2037
2139
|
]),
|
|
2038
|
-
k(
|
|
2039
|
-
row:
|
|
2040
|
-
item:
|
|
2140
|
+
k(f.$slots, "form-" + y.item.key + "-right", {
|
|
2141
|
+
row: o(e).update.form,
|
|
2142
|
+
item: y.item
|
|
2041
2143
|
})
|
|
2042
2144
|
]),
|
|
2043
|
-
k(
|
|
2044
|
-
row:
|
|
2045
|
-
item:
|
|
2145
|
+
k(f.$slots, "form-" + y.item.key + "-end", {
|
|
2146
|
+
row: o(e).update.form,
|
|
2147
|
+
item: y.item
|
|
2046
2148
|
})
|
|
2047
2149
|
])
|
|
2048
2150
|
]),
|
|
2049
2151
|
_: 2
|
|
2050
|
-
}, 1032, ["class", "label", "prop", "label-width"]))), 256)) : (
|
|
2152
|
+
}, 1032, ["class", "label", "prop", "label-width"]))), 256)) : (m(), b(o(J), {
|
|
2051
2153
|
key: 1,
|
|
2052
2154
|
class: T({
|
|
2053
|
-
"hide-label": typeof
|
|
2155
|
+
"hide-label": typeof d.item.text?.form?.label == "boolean" ? !d.item.text?.form?.label : !1
|
|
2054
2156
|
}),
|
|
2055
|
-
label: typeof
|
|
2056
|
-
prop:
|
|
2057
|
-
"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"
|
|
2058
2160
|
}, {
|
|
2059
|
-
default:
|
|
2060
|
-
|
|
2061
|
-
k(
|
|
2062
|
-
row:
|
|
2063
|
-
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
|
|
2064
2166
|
}),
|
|
2065
|
-
|
|
2066
|
-
k(
|
|
2067
|
-
row:
|
|
2068
|
-
item:
|
|
2167
|
+
$("div", st, [
|
|
2168
|
+
k(f.$slots, "form-" + d.item.key, {
|
|
2169
|
+
row: o(e).update.form,
|
|
2170
|
+
item: d.item
|
|
2069
2171
|
}, () => [
|
|
2070
|
-
|
|
2071
|
-
conf:
|
|
2072
|
-
item:
|
|
2172
|
+
V(le, {
|
|
2173
|
+
conf: o(e),
|
|
2174
|
+
item: d
|
|
2073
2175
|
}, null, 8, ["conf", "item"])
|
|
2074
2176
|
]),
|
|
2075
|
-
k(
|
|
2076
|
-
row:
|
|
2077
|
-
item:
|
|
2177
|
+
k(f.$slots, "form-" + d.item.key + "-right", {
|
|
2178
|
+
row: o(e).update.form,
|
|
2179
|
+
item: d.item
|
|
2078
2180
|
})
|
|
2079
2181
|
]),
|
|
2080
|
-
k(
|
|
2081
|
-
row:
|
|
2082
|
-
item:
|
|
2182
|
+
k(f.$slots, "form-" + d.item.key + "-end", {
|
|
2183
|
+
row: o(e).update.form,
|
|
2184
|
+
item: d.item
|
|
2083
2185
|
})
|
|
2084
2186
|
])
|
|
2085
2187
|
]),
|
|
2086
2188
|
_: 2
|
|
2087
2189
|
}, 1032, ["class", "label", "prop", "label-width"]))
|
|
2088
|
-
], 2)) :
|
|
2190
|
+
], 2)) : v("", !0)
|
|
2089
2191
|
], 64))), 256)),
|
|
2090
|
-
k(
|
|
2091
|
-
row:
|
|
2192
|
+
k(f.$slots, "form-end", {
|
|
2193
|
+
row: o(e).update.form
|
|
2092
2194
|
})
|
|
2093
|
-
], 2)) :
|
|
2094
|
-
], 64))), 256)) :
|
|
2195
|
+
], 2)) : v("", !0)
|
|
2196
|
+
], 64))), 256)) : v("", !0)
|
|
2095
2197
|
]),
|
|
2096
2198
|
_: 3
|
|
2097
2199
|
}, 8, ["model", "rules"])
|
|
2098
2200
|
]),
|
|
2099
2201
|
_: 3
|
|
2100
2202
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
2101
|
-
|
|
2102
|
-
modelValue:
|
|
2103
|
-
"onUpdate:modelValue": p[7] || (p[7] = (i) =>
|
|
2104
|
-
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,
|
|
2105
2207
|
"close-on-click-modal": !1
|
|
2106
2208
|
}, {
|
|
2107
|
-
footer:
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
onClick:
|
|
2209
|
+
footer: h(() => [
|
|
2210
|
+
$("span", dt, [
|
|
2211
|
+
V(o(F), {
|
|
2212
|
+
onClick: o(e).remove.close
|
|
2111
2213
|
}, {
|
|
2112
|
-
default:
|
|
2113
|
-
E(x(
|
|
2214
|
+
default: h(() => [
|
|
2215
|
+
E(x(o(g).tCurd("close")), 1)
|
|
2114
2216
|
]),
|
|
2115
2217
|
_: 1
|
|
2116
2218
|
}, 8, ["onClick"]),
|
|
2117
|
-
|
|
2219
|
+
V(o(F), {
|
|
2118
2220
|
type: "danger",
|
|
2119
|
-
onClick:
|
|
2120
|
-
loading:
|
|
2221
|
+
onClick: o(e).remove.submit,
|
|
2222
|
+
loading: o(e).remove.loading
|
|
2121
2223
|
}, {
|
|
2122
|
-
default:
|
|
2123
|
-
E(x(
|
|
2224
|
+
default: h(() => [
|
|
2225
|
+
E(x(o(g).tCurd("confirmDelete")), 1)
|
|
2124
2226
|
]),
|
|
2125
2227
|
_: 1
|
|
2126
2228
|
}, 8, ["onClick", "loading"])
|
|
2127
2229
|
])
|
|
2128
2230
|
]),
|
|
2129
|
-
default:
|
|
2130
|
-
|
|
2231
|
+
default: h(() => [
|
|
2232
|
+
$("div", null, x(o(g).tCurd("confirmDeleteMessage", o(e).remove.items.length)), 1)
|
|
2131
2233
|
]),
|
|
2132
2234
|
_: 1
|
|
2133
2235
|
}, 8, ["modelValue", "title"]),
|
|
2134
|
-
|
|
2236
|
+
V(Fe, {
|
|
2135
2237
|
ref_key: "switchConfirmRef",
|
|
2136
2238
|
ref: a
|
|
2137
2239
|
}, null, 512)
|
|
@@ -2147,8 +2249,8 @@ class pt {
|
|
|
2147
2249
|
* @param name - 下载后的文件名,默认 `'download.png'`
|
|
2148
2250
|
*/
|
|
2149
2251
|
static async download(s, r = "download.png") {
|
|
2150
|
-
const
|
|
2151
|
-
|
|
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);
|
|
2152
2254
|
}
|
|
2153
2255
|
/**
|
|
2154
2256
|
* 将json对象或者json数组导出为json文件保存
|
|
@@ -2156,7 +2258,7 @@ class pt {
|
|
|
2156
2258
|
* @param name
|
|
2157
2259
|
*/
|
|
2158
2260
|
static exportJSONFile = (s, r) => {
|
|
2159
|
-
const
|
|
2261
|
+
const l = new Blob([JSON.stringify(s)], { type: "application/json" }), n = URL.createObjectURL(l), e = document.createElement("a");
|
|
2160
2262
|
e.href = n, e.download = `${r || "config"}.json`, e.click();
|
|
2161
2263
|
};
|
|
2162
2264
|
/**
|
|
@@ -2164,31 +2266,31 @@ class pt {
|
|
|
2164
2266
|
* @param param
|
|
2165
2267
|
* @returns
|
|
2166
2268
|
*/
|
|
2167
|
-
static importFile = async (s) => new Promise((r,
|
|
2269
|
+
static importFile = async (s) => new Promise((r, l) => {
|
|
2168
2270
|
const n = document.createElement("input");
|
|
2169
2271
|
n.type = "file";
|
|
2170
2272
|
const e = s?.accept || ".json";
|
|
2171
2273
|
n.accept = e, n.style.display = "none", n.onchange = (a) => {
|
|
2172
|
-
const
|
|
2173
|
-
if (!
|
|
2174
|
-
|
|
2274
|
+
const u = a.target.files[0];
|
|
2275
|
+
if (!u) {
|
|
2276
|
+
U.fail("未选择文件"), l("未选择文件");
|
|
2175
2277
|
return;
|
|
2176
2278
|
}
|
|
2177
|
-
const
|
|
2178
|
-
|
|
2279
|
+
const f = new FileReader();
|
|
2280
|
+
f.onload = async (p) => {
|
|
2179
2281
|
const c = e == ".json" ? JSON.parse(p.target.result) : p.target.result;
|
|
2180
2282
|
r(c);
|
|
2181
|
-
},
|
|
2182
|
-
|
|
2183
|
-
},
|
|
2283
|
+
}, f.onerror = () => {
|
|
2284
|
+
U.fail("文件读取失败"), l("文件读取失败");
|
|
2285
|
+
}, f.readAsText(u), document.body.removeChild(n);
|
|
2184
2286
|
}, document.body.appendChild(n), n.click();
|
|
2185
2287
|
});
|
|
2186
2288
|
}
|
|
2187
|
-
const ct = (
|
|
2188
|
-
if (
|
|
2289
|
+
const ct = (t, s) => {
|
|
2290
|
+
if (t.component("TCurd", ut), t.component("TFormList", oe), t.component("TColumn", De), s?.customComponent) {
|
|
2189
2291
|
L.customComponent = s.customComponent;
|
|
2190
2292
|
for (const r in s.customComponent)
|
|
2191
|
-
|
|
2293
|
+
t.component(r, s.customComponent[r]);
|
|
2192
2294
|
}
|
|
2193
2295
|
}, ht = {
|
|
2194
2296
|
install: ct
|
|
@@ -2203,7 +2305,7 @@ export {
|
|
|
2203
2305
|
S as TFormConfig,
|
|
2204
2306
|
g as TFormI18n,
|
|
2205
2307
|
oe as TFormList,
|
|
2206
|
-
|
|
2308
|
+
U as TSys,
|
|
2207
2309
|
ht as default,
|
|
2208
2310
|
ct as install
|
|
2209
2311
|
};
|