cc1-form 1.1.7 → 1.1.9
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 +387 -377
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/index.d.ts +5 -3
- package/dist/components/TCurd/index.vue.d.ts +23 -23
- package/package.json +1 -1
package/dist/cc1-form.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as B, reactive as
|
|
2
|
-
import { ElMessage as ue, ElLoading as ce, ElForm as
|
|
1
|
+
import { defineComponent as B, reactive as Z, onMounted as le, resolveComponent as oe, createElementBlock as k, createCommentVNode as v, openBlock as c, renderSlot as x, createElementVNode as S, createVNode as V, withCtx as h, createTextVNode as D, Fragment as F, renderList as T, createBlock as g, normalizeClass as L, normalizeStyle as ne, ref as M, nextTick as re, unref as a, mergeProps as U, toHandlers as _, resolveDynamicComponent as H, toDisplayString as E, resolveDirective as ie, withDirectives as de } from "vue";
|
|
2
|
+
import { ElMessage as ue, ElLoading as ce, ElForm as G, ElFormItem as N, ElInput as q, ElSwitch as X, ElSelect as A, ElOption as K, ElTreeSelect as ae, ElDatePicker as Q, ElDialog as Y, ElButton as O, ElDropdown as pe, ElDropdownMenu as fe, ElDropdownItem as J, ElTable as me, ElTableColumn as W, ElPagination as he } from "element-plus";
|
|
3
3
|
class $ {
|
|
4
4
|
/**
|
|
5
5
|
* 路由
|
|
@@ -24,13 +24,13 @@ class $ {
|
|
|
24
24
|
* @param data 数据
|
|
25
25
|
* @returns 是否显示
|
|
26
26
|
*/
|
|
27
|
-
static isFun = (
|
|
27
|
+
static isFun = (r, d) => Array.isArray(r) ? r.some((s) => typeof s == "function" ? s(d) : s) : typeof r == "function" ? r(d) : r;
|
|
28
28
|
/**
|
|
29
29
|
* 获取路由参数,自动获取query、params中的参数, 哪个有就返回哪个
|
|
30
30
|
*/
|
|
31
31
|
static getRouterParams = () => {
|
|
32
|
-
const
|
|
33
|
-
return Object.keys(
|
|
32
|
+
const r = this.router.currentRoute.value.query || {}, d = this.router.currentRoute.value.params || {};
|
|
33
|
+
return Object.keys(r).length ? r : Object.keys(d).length ? d : {};
|
|
34
34
|
};
|
|
35
35
|
/**
|
|
36
36
|
* 模块赋值
|
|
@@ -40,10 +40,10 @@ class $ {
|
|
|
40
40
|
* 加载模块
|
|
41
41
|
* @param module
|
|
42
42
|
*/
|
|
43
|
-
static loadModule = async (
|
|
44
|
-
if (!$.moduleObj[
|
|
45
|
-
throw new Error(`模块${
|
|
46
|
-
const d = await $.moduleObj[
|
|
43
|
+
static loadModule = async (r) => {
|
|
44
|
+
if (!$.moduleObj[r])
|
|
45
|
+
throw new Error(`模块${r}未加载,请赋值如:TSys.moduleObj = { ${r}: ()=>import('${r}') }`);
|
|
46
|
+
const d = await $.moduleObj[r]();
|
|
47
47
|
return d.default ?? d;
|
|
48
48
|
};
|
|
49
49
|
/**
|
|
@@ -60,19 +60,19 @@ class $ {
|
|
|
60
60
|
* @param type 消息类型
|
|
61
61
|
* @param options 其他选项
|
|
62
62
|
*/
|
|
63
|
-
static showMessage(
|
|
63
|
+
static showMessage(r, d, s = {}) {
|
|
64
64
|
const f = Date.now();
|
|
65
|
-
if (!this.tipMessages[
|
|
66
|
-
this.tipMessages[
|
|
65
|
+
if (!this.tipMessages[r] || f - this.tipMessages[r] > this.tipMessagesGap) {
|
|
66
|
+
this.tipMessages[r] = f;
|
|
67
67
|
const m = Object.assign(
|
|
68
68
|
{
|
|
69
|
-
message:
|
|
69
|
+
message: r,
|
|
70
70
|
type: d
|
|
71
71
|
},
|
|
72
|
-
|
|
72
|
+
s
|
|
73
73
|
);
|
|
74
74
|
ue(m), setTimeout(() => {
|
|
75
|
-
delete this.tipMessages[
|
|
75
|
+
delete this.tipMessages[r];
|
|
76
76
|
}, this.tipMessagesGap);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -81,16 +81,16 @@ class $ {
|
|
|
81
81
|
* @param content
|
|
82
82
|
* @param options
|
|
83
83
|
*/
|
|
84
|
-
static fail = (
|
|
85
|
-
this.showMessage(
|
|
84
|
+
static fail = (r, d = {}) => {
|
|
85
|
+
this.showMessage(r, "error", d);
|
|
86
86
|
};
|
|
87
87
|
/**
|
|
88
88
|
* 成功提示
|
|
89
89
|
* @param content
|
|
90
90
|
* @param options
|
|
91
91
|
*/
|
|
92
|
-
static success = (
|
|
93
|
-
this.showMessage(
|
|
92
|
+
static success = (r, d = {}) => {
|
|
93
|
+
this.showMessage(r, "success", d);
|
|
94
94
|
};
|
|
95
95
|
static loadingObj = null;
|
|
96
96
|
static loadingTimer = null;
|
|
@@ -99,9 +99,9 @@ class $ {
|
|
|
99
99
|
* @param show
|
|
100
100
|
* @param text
|
|
101
101
|
*/
|
|
102
|
-
static loading = (
|
|
102
|
+
static loading = (r = !0, d = "加载中") => {
|
|
103
103
|
Timer.un(this.loadingTimer), this.loadingTimer = Timer.once(() => {
|
|
104
|
-
|
|
104
|
+
r ? this.loadingObj = ce.service({
|
|
105
105
|
lock: !0,
|
|
106
106
|
text: d,
|
|
107
107
|
background: "rgba(0, 0, 0, 0.3)"
|
|
@@ -113,17 +113,17 @@ class $ {
|
|
|
113
113
|
* @param url 地址
|
|
114
114
|
* @param isCenter 是否居中
|
|
115
115
|
*/
|
|
116
|
-
static openUrl = (
|
|
116
|
+
static openUrl = (r, d = !0) => {
|
|
117
117
|
if (d) {
|
|
118
|
-
let
|
|
118
|
+
let s = screen.width / 2 - 500, f = screen.height / 2 - 800 / 2 - 30;
|
|
119
119
|
window.open(
|
|
120
|
-
|
|
120
|
+
r,
|
|
121
121
|
"_blank",
|
|
122
|
-
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + f + ", left=" +
|
|
122
|
+
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + f + ", left=" + s
|
|
123
123
|
);
|
|
124
124
|
} else
|
|
125
125
|
window.open(
|
|
126
|
-
|
|
126
|
+
r,
|
|
127
127
|
"DescriptiveWindowName" + StrUtil.getId(),
|
|
128
128
|
"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0"
|
|
129
129
|
);
|
|
@@ -133,18 +133,18 @@ class $ {
|
|
|
133
133
|
* @param param
|
|
134
134
|
* @returns
|
|
135
135
|
*/
|
|
136
|
-
static getImgPic = (
|
|
137
|
-
let f = document.getElementById(
|
|
136
|
+
static getImgPic = (r) => new Promise(async (d, s) => {
|
|
137
|
+
let f = document.getElementById(r.id);
|
|
138
138
|
const m = await $.loadModule("html2canvas");
|
|
139
139
|
try {
|
|
140
140
|
m(f, {
|
|
141
141
|
logging: !1,
|
|
142
142
|
allowTaint: !0,
|
|
143
143
|
scale: window.devicePixelRatio,
|
|
144
|
-
width:
|
|
145
|
-
height:
|
|
146
|
-
windowWidth:
|
|
147
|
-
windowHeight:
|
|
144
|
+
width: r.windowWidth,
|
|
145
|
+
height: r.windowHeight,
|
|
146
|
+
windowWidth: r.windowWidth,
|
|
147
|
+
windowHeight: r.windowHeight,
|
|
148
148
|
useCORS: !0,
|
|
149
149
|
backgroundColor: "#ffffff00"
|
|
150
150
|
}).then(function(u) {
|
|
@@ -152,11 +152,11 @@ class $ {
|
|
|
152
152
|
d(e);
|
|
153
153
|
});
|
|
154
154
|
} catch (u) {
|
|
155
|
-
|
|
155
|
+
s(u);
|
|
156
156
|
}
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
|
-
class
|
|
159
|
+
class C {
|
|
160
160
|
/** 全局分页字段 */
|
|
161
161
|
static pageField = {
|
|
162
162
|
num: "num",
|
|
@@ -182,10 +182,10 @@ class V {
|
|
|
182
182
|
* @param field
|
|
183
183
|
* @returns
|
|
184
184
|
*/
|
|
185
|
-
static findOptions = (
|
|
186
|
-
const
|
|
187
|
-
if (
|
|
188
|
-
return
|
|
185
|
+
static findOptions = (r, d) => {
|
|
186
|
+
const s = r.column.find((m) => m.key === d), f = (m) => m.replace(/-([a-z])/g, (u, e) => e.toUpperCase());
|
|
187
|
+
if (s)
|
|
188
|
+
return s.options[f(s.type)];
|
|
189
189
|
};
|
|
190
190
|
/**
|
|
191
191
|
* 更新组件数据
|
|
@@ -203,9 +203,9 @@ class V {
|
|
|
203
203
|
}))
|
|
204
204
|
)
|
|
205
205
|
*/
|
|
206
|
-
static setOptionsData = (
|
|
207
|
-
const f =
|
|
208
|
-
f && (f.data =
|
|
206
|
+
static setOptionsData = (r, d, s) => {
|
|
207
|
+
const f = C.findOptions(r, d);
|
|
208
|
+
f && (f.data = s);
|
|
209
209
|
};
|
|
210
210
|
static form = {
|
|
211
211
|
openBefore: {
|
|
@@ -216,8 +216,8 @@ class V {
|
|
|
216
216
|
* @param treeData 树形数据
|
|
217
217
|
* @param option 组件配置
|
|
218
218
|
*/
|
|
219
|
-
parentId: (
|
|
220
|
-
|
|
219
|
+
parentId: (r, d, s, f) => {
|
|
220
|
+
r ? d.type === $.EDialog.Insert ? (d.form.parentId = r._id, d.form.sort = r.children.length + 1) : d.form.parentId = r.parentId.substring(r.parentId.lastIndexOf(",") + 1) : (d.form.parentId = "0", d.form.sort = s.length + 1), C.setOptionsData(f, "parentId", [{ _id: "0", title: "根", children: s }]);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
};
|
|
@@ -232,9 +232,9 @@ class j {
|
|
|
232
232
|
* @param field 字段名
|
|
233
233
|
* @param row 行数据
|
|
234
234
|
*/
|
|
235
|
-
static setId = (
|
|
236
|
-
d[
|
|
237
|
-
|
|
235
|
+
static setId = (r, d, s) => {
|
|
236
|
+
d[r] || (d[r] = []), d[r].forEach((f) => {
|
|
237
|
+
s.forEach((m) => {
|
|
238
238
|
let u = m.default ?? "";
|
|
239
239
|
m.type === "number" && (u = m.default ?? 0), m.type === "boolean" && (u = m.default ?? !1), m.type === "time" && (u = m.default ?? /* @__PURE__ */ new Date()), f[m.value] === void 0 && (f[m.value] = u);
|
|
240
240
|
}), f._id || (f._id = j.getIdFun());
|
|
@@ -247,13 +247,13 @@ class j {
|
|
|
247
247
|
* @param itemFields 元素字段-如:[{label:'',value:''}]
|
|
248
248
|
* @param callback 回调函数
|
|
249
249
|
*/
|
|
250
|
-
static add = (
|
|
251
|
-
const m = JSONUtil.cp(
|
|
252
|
-
j.setId(
|
|
250
|
+
static add = (r, d, s, f) => {
|
|
251
|
+
const m = JSONUtil.cp(s);
|
|
252
|
+
j.setId(r, d, s), d[r].push(
|
|
253
253
|
m.reduce(
|
|
254
254
|
(u, e) => {
|
|
255
|
-
let
|
|
256
|
-
return e.type === "number" && (
|
|
255
|
+
let n = e.default ?? "";
|
|
256
|
+
return e.type === "number" && (n = e.default ?? 0), e.type === "boolean" && (n = e.default ?? !1), e.type === "time" && (n = e.default ?? /* @__PURE__ */ new Date()), u[e.value] = n, u;
|
|
257
257
|
},
|
|
258
258
|
{ _id: j.getIdFun() }
|
|
259
259
|
)
|
|
@@ -266,8 +266,8 @@ class j {
|
|
|
266
266
|
* @param item 元素-如:{_id:''}
|
|
267
267
|
* @param callback 回调函数
|
|
268
268
|
*/
|
|
269
|
-
static remove = (
|
|
270
|
-
d[
|
|
269
|
+
static remove = (r, d, s, f) => {
|
|
270
|
+
d[r] = d[r].filter((m) => m._id !== s._id), f?.(d);
|
|
271
271
|
};
|
|
272
272
|
/**
|
|
273
273
|
* 获取没有id的数据
|
|
@@ -275,11 +275,11 @@ class j {
|
|
|
275
275
|
* @param childernField 子级字段-如:list、children
|
|
276
276
|
* @returns 没有id的数据
|
|
277
277
|
*/
|
|
278
|
-
static getNoIdData = (
|
|
279
|
-
const
|
|
280
|
-
return
|
|
278
|
+
static getNoIdData = (r, d) => {
|
|
279
|
+
const s = JSONUtil.cp(r);
|
|
280
|
+
return s.forEach((f) => {
|
|
281
281
|
f._id && delete f._id, d && f[d] && j.getNoIdData(f[d], d);
|
|
282
|
-
}),
|
|
282
|
+
}), s;
|
|
283
283
|
};
|
|
284
284
|
}
|
|
285
285
|
const be = {
|
|
@@ -289,7 +289,7 @@ const be = {
|
|
|
289
289
|
}, ye = {
|
|
290
290
|
class: "row items-center",
|
|
291
291
|
style: { gap: "10px", width: "100%" }
|
|
292
|
-
},
|
|
292
|
+
}, ee = /* @__PURE__ */ B({
|
|
293
293
|
__name: "list",
|
|
294
294
|
props: {
|
|
295
295
|
row: {
|
|
@@ -324,8 +324,8 @@ const be = {
|
|
|
324
324
|
}
|
|
325
325
|
},
|
|
326
326
|
emits: ["change"],
|
|
327
|
-
setup(p, { emit:
|
|
328
|
-
const d = p,
|
|
327
|
+
setup(p, { emit: r }) {
|
|
328
|
+
const d = p, s = Z({
|
|
329
329
|
show: !1,
|
|
330
330
|
add: (m, u, e) => {
|
|
331
331
|
j.add(m, u, e, () => {
|
|
@@ -338,19 +338,19 @@ const be = {
|
|
|
338
338
|
});
|
|
339
339
|
}
|
|
340
340
|
});
|
|
341
|
-
|
|
342
|
-
j.setId(d.field, d.row, d.itemFields),
|
|
341
|
+
le(() => {
|
|
342
|
+
j.setId(d.field, d.row, d.itemFields), s.show = !0;
|
|
343
343
|
});
|
|
344
|
-
const f =
|
|
344
|
+
const f = r;
|
|
345
345
|
return (m, u) => {
|
|
346
|
-
const e =
|
|
347
|
-
return
|
|
346
|
+
const e = oe("el-button"), n = oe("el-input");
|
|
347
|
+
return s.show ? (c(), k("div", be, [
|
|
348
348
|
x(m.$slots, "list-start", { row: p.row }),
|
|
349
349
|
S("div", null, [
|
|
350
|
-
|
|
350
|
+
V(e, {
|
|
351
351
|
link: "",
|
|
352
352
|
type: "primary",
|
|
353
|
-
onClick: u[0] || (u[0] = (i) =>
|
|
353
|
+
onClick: u[0] || (u[0] = (i) => s.add(p.field, p.row, p.itemFields))
|
|
354
354
|
}, {
|
|
355
355
|
default: h(() => [...u[2] || (u[2] = [
|
|
356
356
|
D("添加", -1)
|
|
@@ -358,16 +358,16 @@ const be = {
|
|
|
358
358
|
_: 1
|
|
359
359
|
})
|
|
360
360
|
]),
|
|
361
|
-
(c(!0), k(
|
|
361
|
+
(c(!0), k(F, null, T(p.row[p.field], (i) => (c(), k("div", ye, [
|
|
362
362
|
x(m.$slots, "item-start", {
|
|
363
363
|
item: i,
|
|
364
364
|
row: p.row
|
|
365
365
|
}),
|
|
366
|
-
(c(!0), k(
|
|
366
|
+
(c(!0), k(F, null, T(p.itemFields, (o) => (c(), g(n, {
|
|
367
367
|
modelValue: i[o.value],
|
|
368
368
|
"onUpdate:modelValue": (t) => i[o.value] = t,
|
|
369
369
|
style: ne({ width: p.inputWidth }),
|
|
370
|
-
class:
|
|
370
|
+
class: L(p.inputClass),
|
|
371
371
|
placeholder: o[p.label] || o[p.value],
|
|
372
372
|
onChange: u[1] || (u[1] = (t) => f("change"))
|
|
373
373
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
|
|
@@ -375,10 +375,10 @@ const be = {
|
|
|
375
375
|
item: i,
|
|
376
376
|
row: p.row
|
|
377
377
|
}),
|
|
378
|
-
|
|
378
|
+
V(e, {
|
|
379
379
|
link: "",
|
|
380
380
|
type: "danger",
|
|
381
|
-
onClick: (o) =>
|
|
381
|
+
onClick: (o) => s.remove(p.field, p.row, i)
|
|
382
382
|
}, {
|
|
383
383
|
default: h(() => [...u[3] || (u[3] = [
|
|
384
384
|
D("删除", -1)
|
|
@@ -387,7 +387,7 @@ const be = {
|
|
|
387
387
|
}, 8, ["onClick"])
|
|
388
388
|
]))), 256)),
|
|
389
389
|
x(m.$slots, "list-end", { row: p.row })
|
|
390
|
-
])) :
|
|
390
|
+
])) : v("", !0);
|
|
391
391
|
};
|
|
392
392
|
}
|
|
393
393
|
}), ge = { class: "row curd-row" }, we = /* @__PURE__ */ B({
|
|
@@ -406,55 +406,55 @@ const be = {
|
|
|
406
406
|
default: ""
|
|
407
407
|
}
|
|
408
408
|
},
|
|
409
|
-
setup(p, { expose:
|
|
410
|
-
const d = $.isFun,
|
|
409
|
+
setup(p, { expose: r }) {
|
|
410
|
+
const d = $.isFun, s = $.EDialog, f = M(), m = p, u = Z({
|
|
411
411
|
rules: {},
|
|
412
412
|
show: !0,
|
|
413
413
|
form: {},
|
|
414
414
|
formDefault: {},
|
|
415
415
|
formColumn: [],
|
|
416
|
-
getDisabled: (e) => e.disabled?.[(m.type ||
|
|
416
|
+
getDisabled: (e) => e.disabled?.[(m.type || s.Insert) === s.Insert ? "create" : "update"],
|
|
417
417
|
initColumnForm: async () => {
|
|
418
418
|
const e = m.option;
|
|
419
419
|
u.formColumn = [];
|
|
420
|
-
const
|
|
420
|
+
const n = [], i = m.option.form?.maxSpan || 12, o = m.option.form?.defaultSpan || i;
|
|
421
421
|
let t = [];
|
|
422
422
|
const l = (b) => {
|
|
423
423
|
if (u.formDefault[b.key] = b.value, b.isForm) {
|
|
424
424
|
b.form = b.form || { span: o }, b.form.span = b.form.span ?? o;
|
|
425
|
-
let I = b.form.span, y = t.reduce((
|
|
426
|
-
const
|
|
427
|
-
t.push({ item: b, span: I }), (
|
|
425
|
+
let I = b.form.span, y = t.reduce((z, P) => z + P.span, I);
|
|
426
|
+
const R = t.length;
|
|
427
|
+
t.push({ item: b, span: I }), (R === 1 && t[0].span === 0 || y >= i || I === 0 && R > 1) && (n.push(t), t = []), b.rules && (u.rules[b.key] = b.rules);
|
|
428
428
|
}
|
|
429
429
|
};
|
|
430
430
|
e.column.forEach((b) => {
|
|
431
431
|
b.isForm = !0, l(b);
|
|
432
|
-
}), t.length > 0 &&
|
|
432
|
+
}), t.length > 0 && n.push(t), u.formColumn = n, u.form = JSONUtil.cp(u.formDefault);
|
|
433
433
|
},
|
|
434
434
|
init: async () => {
|
|
435
435
|
u.show = !1, await re(), u.initColumnForm();
|
|
436
436
|
}
|
|
437
437
|
});
|
|
438
|
-
return u.initColumnForm(),
|
|
438
|
+
return u.initColumnForm(), r({
|
|
439
439
|
ref: f,
|
|
440
440
|
conf: u
|
|
441
|
-
}), (e,
|
|
441
|
+
}), (e, n) => (c(), g(a(G), {
|
|
442
442
|
ref_key: "ruleFormRef",
|
|
443
443
|
ref: f,
|
|
444
444
|
model: u.form,
|
|
445
445
|
rules: u.rules
|
|
446
446
|
}, {
|
|
447
447
|
default: h(() => [
|
|
448
|
-
u.show ? (c(!0), k(
|
|
448
|
+
u.show ? (c(!0), k(F, { key: 0 }, T(u.formColumn, (i) => (c(), k("div", ge, [
|
|
449
449
|
x(e.$slots, "form-start", {
|
|
450
450
|
row: u.form
|
|
451
451
|
}),
|
|
452
|
-
(c(!0), k(
|
|
453
|
-
|
|
452
|
+
(c(!0), k(F, null, T(i, (o) => (c(), k(F, null, [
|
|
453
|
+
a(d)(o.item.show?.form, u.form) ?? !0 ? (c(), k("div", {
|
|
454
454
|
key: 0,
|
|
455
|
-
class:
|
|
455
|
+
class: L(o.item.form.span > 0 ? `col-${o.item.form.span}` : "col")
|
|
456
456
|
}, [
|
|
457
|
-
|
|
457
|
+
V(a(N), {
|
|
458
458
|
label: o.item.label,
|
|
459
459
|
prop: o.item.key,
|
|
460
460
|
"label-width": o.item.form?.labelWidth || "100px"
|
|
@@ -468,61 +468,61 @@ const be = {
|
|
|
468
468
|
row: u.form,
|
|
469
469
|
item: o.item
|
|
470
470
|
}, () => [
|
|
471
|
-
o.item.type === "input" ? (c(), g(
|
|
471
|
+
o.item.type === "input" ? (c(), g(a(q), U({
|
|
472
472
|
key: 0,
|
|
473
473
|
modelValue: u.form[o.item.key],
|
|
474
474
|
"onUpdate:modelValue": (t) => u.form[o.item.key] = t
|
|
475
|
-
}, { ref_for: !0 }, o.item.options?.input,
|
|
475
|
+
}, { ref_for: !0 }, o.item.options?.input, _(o.item.options?.input?.on || {}), {
|
|
476
476
|
disabled: u.getDisabled(o.item)
|
|
477
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.item.type === "switch" ? (c(), g(
|
|
477
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.item.type === "switch" ? (c(), g(a(X), U({
|
|
478
478
|
key: 1,
|
|
479
479
|
modelValue: u.form[o.item.key],
|
|
480
480
|
"onUpdate:modelValue": (t) => u.form[o.item.key] = t
|
|
481
|
-
}, { ref_for: !0 }, o.item.options?.switch,
|
|
481
|
+
}, { ref_for: !0 }, o.item.options?.switch, _(o.item.options?.switch?.on || {}), {
|
|
482
482
|
disabled: u.getDisabled(o.item)
|
|
483
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.item.type === "select" ? (c(), g(
|
|
483
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.item.type === "select" ? (c(), g(a(A), U({
|
|
484
484
|
key: 2,
|
|
485
485
|
modelValue: u.form[o.item.key],
|
|
486
486
|
"onUpdate:modelValue": (t) => u.form[o.item.key] = t
|
|
487
|
-
}, { ref_for: !0 }, o.item.options?.select,
|
|
487
|
+
}, { ref_for: !0 }, o.item.options?.select, _(o.item.options?.select?.on || {}), {
|
|
488
488
|
disabled: u.getDisabled(o.item),
|
|
489
489
|
style: { width: "100%" }
|
|
490
490
|
}), {
|
|
491
491
|
default: h(() => [
|
|
492
|
-
(c(!0), k(
|
|
492
|
+
(c(!0), k(F, null, T(o.item.options?.select?.data, (t) => (c(), g(a(K), {
|
|
493
493
|
key: t.value,
|
|
494
494
|
label: t.label,
|
|
495
495
|
value: t.value
|
|
496
496
|
}, null, 8, ["label", "value"]))), 128))
|
|
497
497
|
]),
|
|
498
498
|
_: 2
|
|
499
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.item.type === "list" ? (c(), g(
|
|
499
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.item.type === "list" ? (c(), g(ee, U({
|
|
500
500
|
key: 3,
|
|
501
501
|
row: u.form,
|
|
502
502
|
field: o.item.key
|
|
503
|
-
}, { ref_for: !0 }, o.item.options?.list,
|
|
503
|
+
}, { ref_for: !0 }, o.item.options?.list, _(o.item.options?.list?.on || {}), {
|
|
504
504
|
disabled: u.getDisabled(o.item),
|
|
505
505
|
style: { width: "100%" }
|
|
506
|
-
}), null, 16, ["row", "field", "disabled"])) : o.item.type === "tree-select" ? (c(), g(
|
|
506
|
+
}), null, 16, ["row", "field", "disabled"])) : o.item.type === "tree-select" ? (c(), g(a(ae), U({
|
|
507
507
|
key: 4,
|
|
508
508
|
modelValue: u.form[o.item.key],
|
|
509
509
|
"onUpdate:modelValue": (t) => u.form[o.item.key] = t
|
|
510
|
-
}, { ref_for: !0 }, o.item.options?.treeSelect,
|
|
510
|
+
}, { ref_for: !0 }, o.item.options?.treeSelect, _(o.item.options?.treeSelect?.on || {}), {
|
|
511
511
|
disabled: u.getDisabled(o.item),
|
|
512
512
|
style: { width: "100%" }
|
|
513
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.item.type === "datetime" ? (c(), g(
|
|
513
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.item.type === "datetime" ? (c(), g(a(Q), U({
|
|
514
514
|
key: 5,
|
|
515
515
|
modelValue: u.form[o.item.key],
|
|
516
516
|
"onUpdate:modelValue": (t) => u.form[o.item.key] = t
|
|
517
|
-
}, { ref_for: !0 }, o.item.options?.datetime,
|
|
517
|
+
}, { ref_for: !0 }, o.item.options?.datetime, _(o.item.options?.datetime?.on || {}), {
|
|
518
518
|
disabled: u.getDisabled(o.item)
|
|
519
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
519
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : a(C).customComponent[o.item.type] ? (c(), g(H(a(C).customComponent[o.item.type]), U({
|
|
520
520
|
key: 6,
|
|
521
521
|
modelValue: u.form[o.item.key],
|
|
522
522
|
"onUpdate:modelValue": (t) => u.form[o.item.key] = t
|
|
523
|
-
}, { ref_for: !0 }, o.item.options?.[o.item.type],
|
|
523
|
+
}, { ref_for: !0 }, o.item.options?.[o.item.type], _(o.item.options?.[o.item.type]?.on || {}), {
|
|
524
524
|
disabled: u.getDisabled(o.item)
|
|
525
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
525
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : v("", !0)
|
|
526
526
|
]),
|
|
527
527
|
x(e.$slots, "form-" + o.item.key + "-end", {
|
|
528
528
|
row: u.form,
|
|
@@ -531,12 +531,12 @@ const be = {
|
|
|
531
531
|
]),
|
|
532
532
|
_: 2
|
|
533
533
|
}, 1032, ["label", "prop", "label-width"])
|
|
534
|
-
], 2)) :
|
|
534
|
+
], 2)) : v("", !0)
|
|
535
535
|
], 64))), 256)),
|
|
536
536
|
x(e.$slots, "form-end", {
|
|
537
537
|
row: u.form
|
|
538
538
|
})
|
|
539
|
-
]))), 256)) :
|
|
539
|
+
]))), 256)) : v("", !0)
|
|
540
540
|
]),
|
|
541
541
|
_: 3
|
|
542
542
|
}, 8, ["model", "rules"]));
|
|
@@ -549,15 +549,15 @@ class ke {
|
|
|
549
549
|
* @param columns 列
|
|
550
550
|
* @param fileName 文件名
|
|
551
551
|
*/
|
|
552
|
-
static exportToExcel = async (
|
|
553
|
-
if (!
|
|
554
|
-
const f = await $.loadModule("xlsx"), m =
|
|
552
|
+
static exportToExcel = async (r, d, s) => {
|
|
553
|
+
if (!r || r.length === 0) return;
|
|
554
|
+
const f = await $.loadModule("xlsx"), m = r.map((n) => {
|
|
555
555
|
const i = {};
|
|
556
556
|
return d.forEach((o) => {
|
|
557
|
-
i[o.label] =
|
|
557
|
+
i[o.label] = n[o.key];
|
|
558
558
|
}), i;
|
|
559
559
|
}), u = f.utils.json_to_sheet(m), e = f.utils.book_new();
|
|
560
|
-
f.utils.book_append_sheet(e, u, "Sheet1"),
|
|
560
|
+
f.utils.book_append_sheet(e, u, "Sheet1"), s ? typeof s == "function" && (s = s()) : s = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, f.writeFile(e, `${s}.xlsx`);
|
|
561
561
|
};
|
|
562
562
|
}
|
|
563
563
|
const Ce = {
|
|
@@ -592,48 +592,48 @@ const Ce = {
|
|
|
592
592
|
};
|
|
593
593
|
class w {
|
|
594
594
|
/** 解析国际化值:函数则执行返回字符串,否则 */
|
|
595
|
-
static t(
|
|
596
|
-
return typeof
|
|
595
|
+
static t(r, ...d) {
|
|
596
|
+
return typeof r == "function" ? r(...d) : (r = String(r), r.replace(/{([^}]+)}/g, (s, f, m) => typeof d[m] < "u" ? d[m] : `{${f}}`));
|
|
597
597
|
}
|
|
598
598
|
/** 解析curd国际化值 */
|
|
599
|
-
static tCurd(
|
|
600
|
-
return this.t(this.curd[
|
|
599
|
+
static tCurd(r, ...d) {
|
|
600
|
+
return this.t(this.curd[r], ...d);
|
|
601
601
|
}
|
|
602
602
|
/** curd表单 */
|
|
603
603
|
static curd = Ce;
|
|
604
604
|
}
|
|
605
605
|
const ve = { class: "dialog-footer" }, Ve = /* @__PURE__ */ B({
|
|
606
606
|
__name: "switchConfirm",
|
|
607
|
-
setup(p, { expose:
|
|
608
|
-
const d =
|
|
607
|
+
setup(p, { expose: r }) {
|
|
608
|
+
const d = M(!1), s = M("确认修改"), f = M("确认要修改状态吗?");
|
|
609
609
|
let m = null, u = null;
|
|
610
|
-
const e = (o) => (o?.title && (
|
|
610
|
+
const e = (o) => (o?.title && (s.value = o.title), o?.content && (f.value = o.content), d.value = !0, new Promise((t, l) => {
|
|
611
611
|
m = t, u = l;
|
|
612
|
-
})),
|
|
612
|
+
})), n = () => {
|
|
613
613
|
d.value = !1, m?.(!0), m = null, u = null;
|
|
614
614
|
}, i = () => {
|
|
615
615
|
d.value = !1, u?.(new Error("用户取消操作")), m = null, u = null;
|
|
616
616
|
};
|
|
617
|
-
return
|
|
617
|
+
return r({
|
|
618
618
|
open: e
|
|
619
|
-
}), (o, t) => (c(), g(
|
|
619
|
+
}), (o, t) => (c(), g(a(Y), {
|
|
620
620
|
modelValue: d.value,
|
|
621
621
|
"onUpdate:modelValue": t[0] || (t[0] = (l) => d.value = l),
|
|
622
|
-
title:
|
|
622
|
+
title: s.value,
|
|
623
623
|
"close-on-click-modal": !1,
|
|
624
624
|
width: "400px"
|
|
625
625
|
}, {
|
|
626
626
|
footer: h(() => [
|
|
627
627
|
S("span", ve, [
|
|
628
|
-
|
|
628
|
+
V(a(O), { onClick: i }, {
|
|
629
629
|
default: h(() => [...t[1] || (t[1] = [
|
|
630
630
|
D("取消", -1)
|
|
631
631
|
])]),
|
|
632
632
|
_: 1
|
|
633
633
|
}),
|
|
634
|
-
|
|
634
|
+
V(a(O), {
|
|
635
635
|
type: "primary",
|
|
636
|
-
onClick:
|
|
636
|
+
onClick: n
|
|
637
637
|
}, {
|
|
638
638
|
default: h(() => [...t[2] || (t[2] = [
|
|
639
639
|
D("确认", -1)
|
|
@@ -648,33 +648,33 @@ const ve = { class: "dialog-footer" }, Ve = /* @__PURE__ */ B({
|
|
|
648
648
|
_: 1
|
|
649
649
|
}, 8, ["modelValue", "title"]));
|
|
650
650
|
}
|
|
651
|
-
}), xe = (p,
|
|
651
|
+
}), xe = (p, r) => {
|
|
652
652
|
const d = p.__vccOpts || p;
|
|
653
|
-
for (const [
|
|
654
|
-
d[
|
|
653
|
+
for (const [s, f] of r)
|
|
654
|
+
d[s] = f;
|
|
655
655
|
return d;
|
|
656
|
-
}, De = {},
|
|
656
|
+
}, De = {}, Ue = {
|
|
657
657
|
xmlns: "http://www.w3.org/2000/svg",
|
|
658
658
|
viewBox: "0 0 1024 1024"
|
|
659
659
|
};
|
|
660
|
-
function
|
|
661
|
-
return c(), k("svg",
|
|
660
|
+
function Ee(p, r) {
|
|
661
|
+
return c(), k("svg", Ue, [...r[0] || (r[0] = [
|
|
662
662
|
S("path", {
|
|
663
663
|
fill: "currentColor",
|
|
664
664
|
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"
|
|
665
665
|
}, null, -1)
|
|
666
666
|
])]);
|
|
667
667
|
}
|
|
668
|
-
const Se = /* @__PURE__ */ xe(De, [["render",
|
|
668
|
+
const Se = /* @__PURE__ */ xe(De, [["render", Ee]]), $e = { class: "col relative cc1-form-box" }, Fe = {
|
|
669
669
|
class: "absolute row fit",
|
|
670
670
|
style: { overflow: "hidden" }
|
|
671
|
-
},
|
|
671
|
+
}, Oe = { class: "col column" }, _e = {
|
|
672
672
|
key: 0,
|
|
673
673
|
class: "relative curd-search"
|
|
674
|
-
},
|
|
674
|
+
}, Ie = { class: "mb-10 flex justify-between items-center" }, Re = {
|
|
675
675
|
class: "flex items-center",
|
|
676
676
|
style: { gap: "10px" }
|
|
677
|
-
}, Te = { key: 0 }, je = { key: 1 },
|
|
677
|
+
}, Te = { key: 0 }, je = { key: 1 }, ze = { key: 2 }, Le = { class: "export-btn" }, Me = {
|
|
678
678
|
class: "flex items-center",
|
|
679
679
|
style: { gap: "10px" }
|
|
680
680
|
}, Pe = { class: "col fit-width relative" }, Ke = { class: "absolute column fit" }, Ne = { class: "row justify-end mt-10 mb-10" }, Ae = {
|
|
@@ -690,39 +690,39 @@ const Se = /* @__PURE__ */ xe(De, [["render", Ue]]), $e = { class: "col relative
|
|
|
690
690
|
default: {}
|
|
691
691
|
}
|
|
692
692
|
},
|
|
693
|
-
setup(p, { expose:
|
|
694
|
-
const d = $.EDialog,
|
|
693
|
+
setup(p, { expose: r }) {
|
|
694
|
+
const d = $.EDialog, s = p, f = M(), m = M(), u = $.isFun, e = Z({
|
|
695
695
|
search: {
|
|
696
696
|
column: {
|
|
697
697
|
list: []
|
|
698
698
|
},
|
|
699
699
|
form: {},
|
|
700
700
|
formDefault: {},
|
|
701
|
-
getPlaceholder: (
|
|
701
|
+
getPlaceholder: (n, i = w.tCurd("placeholderInput")) => n.text?.search?.placeholder === void 0 ? `${i}${n.label}` : n.text?.search?.placeholder,
|
|
702
702
|
getFormData: () => {
|
|
703
|
-
let
|
|
704
|
-
|
|
705
|
-
(typeof o.show?.search == "function" ? o.show?.search(e.search.form) : o.show?.search) && (
|
|
703
|
+
let n = {};
|
|
704
|
+
s.option.column.forEach((o) => {
|
|
705
|
+
(typeof o.show?.search == "function" ? o.show?.search(e.search.form) : o.show?.search) && (n[o.key] = e.search.form[o.key]);
|
|
706
706
|
});
|
|
707
|
-
const i =
|
|
708
|
-
return i && (
|
|
707
|
+
const i = s.option.search?.before?.(n);
|
|
708
|
+
return i && (n = i), n;
|
|
709
709
|
},
|
|
710
710
|
reset: () => {
|
|
711
|
-
const
|
|
712
|
-
Object.keys(
|
|
713
|
-
|
|
714
|
-
}), e.search.form = JSONUtil.cp(
|
|
711
|
+
const n = e.search.formDefault;
|
|
712
|
+
Object.keys(n).forEach((i) => {
|
|
713
|
+
s.option.search?.resetMode === "none" ? n[i] = void 0 : n[i] = e.search.formDefault[i];
|
|
714
|
+
}), e.search.form = JSONUtil.cp(n), e.page.num = 1, e.table.getList();
|
|
715
715
|
},
|
|
716
716
|
submit: () => {
|
|
717
717
|
e.page.num = 1, e.table.getList();
|
|
718
718
|
}
|
|
719
719
|
},
|
|
720
720
|
page: {
|
|
721
|
-
size:
|
|
722
|
-
sizeList:
|
|
721
|
+
size: s.option.page?.size || 10,
|
|
722
|
+
sizeList: s.option.page?.sizeList || [10, 20, 50, 100],
|
|
723
723
|
num: 1,
|
|
724
724
|
total: 0,
|
|
725
|
-
layout:
|
|
725
|
+
layout: s.option.page?.layout || "total, sizes, prev, pager, next, jumper"
|
|
726
726
|
},
|
|
727
727
|
table: {
|
|
728
728
|
loading: !1,
|
|
@@ -730,19 +730,19 @@ const Se = /* @__PURE__ */ xe(De, [["render", Ue]]), $e = { class: "col relative
|
|
|
730
730
|
expand: {
|
|
731
731
|
isExpand: !1,
|
|
732
732
|
rowKeys: [],
|
|
733
|
-
change: (
|
|
733
|
+
change: (n, i) => {
|
|
734
734
|
},
|
|
735
735
|
all: () => {
|
|
736
736
|
if (e.table.expand.isExpand)
|
|
737
737
|
e.table.expand.rowKeys = [];
|
|
738
738
|
else {
|
|
739
|
-
const
|
|
739
|
+
const n = (i) => {
|
|
740
740
|
let o = [];
|
|
741
741
|
return i.forEach((t) => {
|
|
742
|
-
o.push(t[
|
|
742
|
+
o.push(t[C.tableRowKey]), t.children && t.children.length > 0 && (o = o.concat(n(t.children)));
|
|
743
743
|
}), o;
|
|
744
744
|
};
|
|
745
|
-
e.table.expand.rowKeys =
|
|
745
|
+
e.table.expand.rowKeys = n(e.table.data);
|
|
746
746
|
}
|
|
747
747
|
e.table.expand.isExpand = !e.table.expand.isExpand;
|
|
748
748
|
}
|
|
@@ -768,15 +768,15 @@ const Se = /* @__PURE__ */ xe(De, [["render", Ue]]), $e = { class: "col relative
|
|
|
768
768
|
},
|
|
769
769
|
getList: async () => {
|
|
770
770
|
e.table.loading = !0;
|
|
771
|
-
const
|
|
771
|
+
const n = s.option.api.list;
|
|
772
772
|
try {
|
|
773
|
-
const i = await
|
|
774
|
-
[
|
|
775
|
-
[
|
|
773
|
+
const i = await n({
|
|
774
|
+
[C.pageField.size]: e.page.size,
|
|
775
|
+
[C.pageField.num]: e.page.num,
|
|
776
776
|
...e.search.getFormData()
|
|
777
|
-
}), o =
|
|
777
|
+
}), o = C.resultField, t = i.data || { [o.list]: i };
|
|
778
778
|
let l = (Array.isArray(t[o.list]), t[o.list]);
|
|
779
|
-
e.table.data =
|
|
779
|
+
e.table.data = s.option.data ? await s.option.data(l) : l, e.page.total = t[o.total] || 0;
|
|
780
780
|
} catch (i) {
|
|
781
781
|
console.error(i);
|
|
782
782
|
} finally {
|
|
@@ -785,19 +785,19 @@ const Se = /* @__PURE__ */ xe(De, [["render", Ue]]), $e = { class: "col relative
|
|
|
785
785
|
},
|
|
786
786
|
selection: {
|
|
787
787
|
list: [],
|
|
788
|
-
change: (
|
|
789
|
-
e.table.selection.list =
|
|
788
|
+
change: (n) => {
|
|
789
|
+
e.table.selection.list = n;
|
|
790
790
|
}
|
|
791
791
|
}
|
|
792
792
|
},
|
|
793
793
|
export: {
|
|
794
794
|
run: {
|
|
795
|
-
start: async (
|
|
796
|
-
let i = await e.export.run[
|
|
795
|
+
start: async (n) => {
|
|
796
|
+
let i = await e.export.run[n](), o = s.option.column;
|
|
797
797
|
const t = JSONUtil.cp({
|
|
798
798
|
data: i,
|
|
799
799
|
columns: o
|
|
800
|
-
}), l =
|
|
800
|
+
}), l = s.option.tools?.export || {};
|
|
801
801
|
l.before && l.before(t), ke.exportToExcel(t.data, t.columns, l.fileName);
|
|
802
802
|
},
|
|
803
803
|
select: () => {
|
|
@@ -813,25 +813,29 @@ const Se = /* @__PURE__ */ xe(De, [["render", Ue]]), $e = { class: "col relative
|
|
|
813
813
|
all: async () => {
|
|
814
814
|
e.export.loading = !0;
|
|
815
815
|
try {
|
|
816
|
-
if (
|
|
817
|
-
await
|
|
816
|
+
if (s.option.tools?.export?.all) {
|
|
817
|
+
await s.option.tools?.export?.all({
|
|
818
|
+
[C.pageField.size]: e.page.size,
|
|
819
|
+
[C.pageField.num]: e.page.num,
|
|
820
|
+
...e.search.getFormData()
|
|
821
|
+
});
|
|
818
822
|
return;
|
|
819
823
|
}
|
|
820
|
-
const
|
|
821
|
-
[
|
|
822
|
-
[
|
|
824
|
+
const n = s.option.api.list, i = await n({
|
|
825
|
+
[C.pageField.size]: 999999,
|
|
826
|
+
[C.pageField.num]: 1
|
|
823
827
|
});
|
|
824
|
-
return (i.data || { [
|
|
825
|
-
} catch (
|
|
826
|
-
console.error(
|
|
828
|
+
return (i.data || { [C.resultField.list]: i })[C.resultField.list];
|
|
829
|
+
} catch (n) {
|
|
830
|
+
console.error(n);
|
|
827
831
|
} finally {
|
|
828
832
|
e.export.loading = !1;
|
|
829
833
|
}
|
|
830
834
|
}
|
|
831
835
|
},
|
|
832
836
|
loading: !1,
|
|
833
|
-
click: (
|
|
834
|
-
e.export.loading || e.export.run.start(
|
|
837
|
+
click: (n) => {
|
|
838
|
+
e.export.loading || e.export.run.start(n);
|
|
835
839
|
}
|
|
836
840
|
},
|
|
837
841
|
update: {
|
|
@@ -844,7 +848,7 @@ const Se = /* @__PURE__ */ xe(De, [["render", Ue]]), $e = { class: "col relative
|
|
|
844
848
|
form: {},
|
|
845
849
|
formDefault: {},
|
|
846
850
|
formColumn: [],
|
|
847
|
-
getDisabled: (
|
|
851
|
+
getDisabled: (n) => n.disabled?.[e.update.type === d.Insert ? "create" : "update"],
|
|
848
852
|
edit: {
|
|
849
853
|
/**
|
|
850
854
|
* 编辑原数据
|
|
@@ -853,22 +857,22 @@ const Se = /* @__PURE__ */ xe(De, [["render", Ue]]), $e = { class: "col relative
|
|
|
853
857
|
/**
|
|
854
858
|
* 将form填入数据和data比对差异数据返回
|
|
855
859
|
*/
|
|
856
|
-
getApiData: (
|
|
857
|
-
if (
|
|
858
|
-
return
|
|
860
|
+
getApiData: (n) => {
|
|
861
|
+
if (s.option.form?.editAll)
|
|
862
|
+
return n;
|
|
859
863
|
let i = {
|
|
860
|
-
[
|
|
864
|
+
[C.tableRowKey]: e.update.edit.data[C.tableRowKey]
|
|
861
865
|
};
|
|
862
866
|
return Object.keys(e.update.edit.data).forEach((o) => {
|
|
863
|
-
|
|
867
|
+
n[o] !== e.update.edit.data[o] && (i[o] = n[o]);
|
|
864
868
|
}), i;
|
|
865
869
|
}
|
|
866
870
|
},
|
|
867
|
-
open: (
|
|
871
|
+
open: (n, i) => {
|
|
868
872
|
e.update.showContent || FunUtil.throttle(async () => {
|
|
869
|
-
e.update.type =
|
|
870
|
-
const o =
|
|
871
|
-
e.update.edit.data = i, e.update.title = o ? w.tCurd("add") : w.tCurd("edit"), e.update.form = JSONUtil.cp(o ? e.update.formDefault : i), await
|
|
873
|
+
e.update.type = n;
|
|
874
|
+
const o = n === d.Insert;
|
|
875
|
+
e.update.edit.data = i, e.update.title = o ? w.tCurd("add") : w.tCurd("edit"), e.update.form = JSONUtil.cp(o ? e.update.formDefault : i), await s.option.form?.openBefore?.(i, e.update), e.update.show = !0, e.update.showContent = !0, s.option.form?.openAfter?.(i, e.update);
|
|
872
876
|
});
|
|
873
877
|
},
|
|
874
878
|
submit: () => {
|
|
@@ -876,19 +880,19 @@ const Se = /* @__PURE__ */ xe(De, [["render", Ue]]), $e = { class: "col relative
|
|
|
876
880
|
await m.value?.validate(async (o, t) => new Promise((l, b) => {
|
|
877
881
|
o || ($.fail(w.tCurd("checkFormData")), b(!1)), l();
|
|
878
882
|
})), e.update.loading = !0;
|
|
879
|
-
const
|
|
883
|
+
const n = e.update.type === d.Insert ? s.option.api.create : s.option.api.update;
|
|
880
884
|
let i = JSONUtil.cp(e.update.form);
|
|
881
|
-
delete i.children, await
|
|
885
|
+
delete i.children, await s.option.form?.submitBefore?.(i, e.update), Object.keys(i).forEach((o) => {
|
|
882
886
|
if (typeof i[o] == "string" && i[o].indexOf("T") > -1) {
|
|
883
887
|
const t = new Date(i[o]).getTime();
|
|
884
888
|
!isNaN(t) && t > (/* @__PURE__ */ new Date("1971-01-01")).getTime() && (i[o] = t);
|
|
885
889
|
}
|
|
886
890
|
});
|
|
887
891
|
try {
|
|
888
|
-
if (!
|
|
889
|
-
await
|
|
892
|
+
if (!n) return;
|
|
893
|
+
await n({
|
|
890
894
|
...i
|
|
891
|
-
}), e.update.close(), await e.table.getList(),
|
|
895
|
+
}), e.update.close(), await e.table.getList(), s.option.form?.submitAfter?.(i, e.update);
|
|
892
896
|
} catch (o) {
|
|
893
897
|
console.error(o);
|
|
894
898
|
} finally {
|
|
@@ -910,21 +914,21 @@ const Se = /* @__PURE__ */ xe(De, [["render", Ue]]), $e = { class: "col relative
|
|
|
910
914
|
close: () => {
|
|
911
915
|
e.remove.show = !1;
|
|
912
916
|
},
|
|
913
|
-
open: (
|
|
914
|
-
if (
|
|
917
|
+
open: (n) => {
|
|
918
|
+
if (n.length === 0) {
|
|
915
919
|
$.fail(w.tCurd("selectDataToDelete"));
|
|
916
920
|
return;
|
|
917
921
|
}
|
|
918
|
-
e.remove.items =
|
|
922
|
+
e.remove.items = n, e.remove.show = !0;
|
|
919
923
|
},
|
|
920
924
|
submit: () => {
|
|
921
925
|
FunUtil.throttle(async () => {
|
|
922
926
|
e.remove.loading = !0;
|
|
923
|
-
const
|
|
927
|
+
const n = s.option.api.delete;
|
|
924
928
|
try {
|
|
925
|
-
if (!
|
|
926
|
-
await
|
|
927
|
-
[
|
|
929
|
+
if (!n) return;
|
|
930
|
+
await n({
|
|
931
|
+
[C.tableRowKey]: e.remove.items.map((i) => i[C.tableRowKey]),
|
|
928
932
|
items: e.remove.items
|
|
929
933
|
}), $.success(w.tCurd("operationSuccess")), e.table.data.length <= 1 && e.page.num > 1 && (e.page.num -= 1), e.remove.close(), await e.table.getList();
|
|
930
934
|
} catch (i) {
|
|
@@ -953,11 +957,11 @@ const Se = /* @__PURE__ */ xe(De, [["render", Ue]]), $e = { class: "col relative
|
|
|
953
957
|
},
|
|
954
958
|
table: {
|
|
955
959
|
headerCellClassName: "table-header",
|
|
956
|
-
rowKey:
|
|
960
|
+
rowKey: C.tableRowKey,
|
|
957
961
|
emptyText: w.tCurd("noData"),
|
|
958
962
|
highlightCurrentRow: !0
|
|
959
963
|
}
|
|
960
|
-
}, o =
|
|
964
|
+
}, o = s.option;
|
|
961
965
|
Object.keys(i).forEach((t) => {
|
|
962
966
|
o[t] = ObjectUtil.deepMerge(i[t], o[t] || {});
|
|
963
967
|
});
|
|
@@ -968,7 +972,7 @@ const Se = /* @__PURE__ */ xe(De, [["render", Ue]]), $e = { class: "col relative
|
|
|
968
972
|
* @returns
|
|
969
973
|
*/
|
|
970
974
|
initColumnOptions: () => {
|
|
971
|
-
const
|
|
975
|
+
const n = s.option, i = (o) => {
|
|
972
976
|
const l = {
|
|
973
977
|
options: {
|
|
974
978
|
switch: {
|
|
@@ -977,22 +981,22 @@ const Se = /* @__PURE__ */ xe(De, [["render", Ue]]), $e = { class: "col relative
|
|
|
977
981
|
inactiveValue: !1,
|
|
978
982
|
inactiveLabel: w.tCurd("switchOff"),
|
|
979
983
|
tableBeforeChange: async (I, y) => {
|
|
980
|
-
const
|
|
984
|
+
const R = o.options?.switch;
|
|
981
985
|
try {
|
|
982
986
|
await f.value?.open({
|
|
983
987
|
title: w.tCurd("confirmModify"),
|
|
984
988
|
content: w.tCurd("confirmSwitchMessage")
|
|
985
989
|
}), e.table.loading = !0;
|
|
986
990
|
try {
|
|
987
|
-
return
|
|
988
|
-
[
|
|
989
|
-
[I]: y[I] ===
|
|
990
|
-
final(
|
|
991
|
+
return s.option.api.update ? (await s.option.api.update({
|
|
992
|
+
[C.tableRowKey]: y[C.tableRowKey],
|
|
993
|
+
[I]: y[I] === R.activeValue ? R.inactiveValue : R.activeValue,
|
|
994
|
+
final(z, P, te) {
|
|
991
995
|
e.table.loading = !1;
|
|
992
996
|
}
|
|
993
997
|
}), e.table.loading = !1, $.success(w.tCurd("operationSuccess")), e.table.getList(), !0) : void 0;
|
|
994
|
-
} catch (
|
|
995
|
-
return console.error(
|
|
998
|
+
} catch (z) {
|
|
999
|
+
return console.error(z), !1;
|
|
996
1000
|
} finally {
|
|
997
1001
|
e.table.loading = !1;
|
|
998
1002
|
}
|
|
@@ -1002,8 +1006,8 @@ const Se = /* @__PURE__ */ xe(De, [["render", Ue]]), $e = { class: "col relative
|
|
|
1002
1006
|
}
|
|
1003
1007
|
},
|
|
1004
1008
|
treeSelect: {
|
|
1005
|
-
rowKey:
|
|
1006
|
-
nodeKey:
|
|
1009
|
+
rowKey: C.tableRowKey,
|
|
1010
|
+
nodeKey: C.tableRowKey,
|
|
1007
1011
|
multiple: !0,
|
|
1008
1012
|
renderAfterExpand: !1,
|
|
1009
1013
|
showCheckbox: !0,
|
|
@@ -1035,220 +1039,226 @@ const Se = /* @__PURE__ */ xe(De, [["render", Ue]]), $e = { class: "col relative
|
|
|
1035
1039
|
b[I] = ObjectUtil.deepMerge(l[I], b[I] || {});
|
|
1036
1040
|
});
|
|
1037
1041
|
};
|
|
1038
|
-
|
|
1042
|
+
n.column.forEach(i), n.table?.column?.forEach(i);
|
|
1039
1043
|
},
|
|
1040
1044
|
initColumnForm: () => {
|
|
1041
|
-
const
|
|
1045
|
+
const n = s.option;
|
|
1042
1046
|
e.update.formColumn = [], e.table.column.show = {
|
|
1043
1047
|
list: [],
|
|
1044
1048
|
listSource: []
|
|
1045
1049
|
};
|
|
1046
|
-
const i = [], o =
|
|
1050
|
+
const i = [], o = s.option.form?.maxSpan || 12, t = s.option.form?.defaultSpan || o / 2;
|
|
1047
1051
|
let l = [];
|
|
1048
1052
|
const b = (y) => {
|
|
1049
1053
|
if (e.update.formDefault[y.key] = y.value, y.table.table && (y.show.table && e.table.column.show.list.push(y.key), y.table.table && e.table.column.show.listSource.push(y.key)), y.isForm) {
|
|
1050
1054
|
y.form = y.form || { span: t }, y.form.span = y.form.span ?? t;
|
|
1051
|
-
let
|
|
1055
|
+
let R = y.form.span, z = l.reduce((te, se) => te + se.span, R);
|
|
1052
1056
|
const P = l.length;
|
|
1053
|
-
l.push({ item: y, span:
|
|
1057
|
+
l.push({ item: y, span: R }), (P === 1 && l[0].span === 0 || z >= o || R === 0 && P > 1) && (i.push(l), l = []), y.rules && (e.update.rules[y.key] = y.rules);
|
|
1054
1058
|
}
|
|
1055
1059
|
};
|
|
1056
|
-
|
|
1060
|
+
n.column.forEach((y) => {
|
|
1057
1061
|
y.isForm = !0, b(y);
|
|
1058
|
-
}),
|
|
1062
|
+
}), s.option.table?.column?.forEach((y) => {
|
|
1059
1063
|
y.isForm = !1, b(y);
|
|
1060
|
-
}), e.search.column.list =
|
|
1061
|
-
const I =
|
|
1064
|
+
}), e.search.column.list = n.column.concat(n.table?.column || []), e.table.column.list = e.search.column.list.filter((y) => y.table?.table), e.search.column.list.sort((y, R) => y.sort?.search - R.sort?.search), e.table.column.list.sort((y, R) => y.sort?.table - R.sort?.table), l.length > 0 && i.push(l), e.update.formColumn = i;
|
|
1065
|
+
const I = s.option.search?.formDefault;
|
|
1062
1066
|
I && Object.keys(I).forEach((y) => {
|
|
1063
1067
|
e.search.formDefault[y] = I[y];
|
|
1064
|
-
}),
|
|
1068
|
+
}), n.column.forEach((y) => {
|
|
1065
1069
|
y.show?.search || (e.search.formDefault[y.key] = void 0);
|
|
1066
1070
|
}), e.search.form = JSONUtil.cp(e.search.formDefault);
|
|
1067
1071
|
}
|
|
1068
1072
|
});
|
|
1069
|
-
return e.init(),
|
|
1073
|
+
return e.init(), le(() => {
|
|
1070
1074
|
e.table.getList();
|
|
1071
|
-
}),
|
|
1075
|
+
}), r({
|
|
1072
1076
|
conf: e
|
|
1073
|
-
}), (
|
|
1077
|
+
}), (n, i) => {
|
|
1074
1078
|
const o = ie("loading");
|
|
1075
1079
|
return c(), k("div", $e, [
|
|
1076
|
-
S("div",
|
|
1077
|
-
x(
|
|
1078
|
-
S("div",
|
|
1079
|
-
p.option.search?.show !== !1 ? (c(), k("div",
|
|
1080
|
-
|
|
1080
|
+
S("div", Fe, [
|
|
1081
|
+
x(n.$slots, "box-left"),
|
|
1082
|
+
S("div", Oe, [
|
|
1083
|
+
p.option.search?.show !== !1 ? (c(), k("div", _e, [
|
|
1084
|
+
V(a(G), {
|
|
1081
1085
|
model: e.search.form,
|
|
1082
1086
|
inline: ""
|
|
1083
1087
|
}, {
|
|
1084
1088
|
default: h(() => [
|
|
1085
|
-
x(
|
|
1089
|
+
x(n.$slots, "search-start", {
|
|
1086
1090
|
row: e.search.form
|
|
1087
1091
|
}),
|
|
1088
|
-
(c(!0), k(
|
|
1092
|
+
(c(!0), k(F, null, T(e.search.column.list, (t) => (c(), k(F, {
|
|
1089
1093
|
key: t.key
|
|
1090
1094
|
}, [
|
|
1091
|
-
(typeof t.show?.search == "function" ? t.show?.search(e.search.form) : t.show?.search) ? (c(), g(
|
|
1095
|
+
(typeof t.show?.search == "function" ? t.show?.search(e.search.form) : t.show?.search) ? (c(), g(a(N), {
|
|
1092
1096
|
key: 0,
|
|
1093
1097
|
label: typeof t.text?.search?.label == "string" ? t.text?.search?.label : t.label,
|
|
1094
|
-
class:
|
|
1098
|
+
class: L({
|
|
1095
1099
|
"hide-label": typeof t.text?.search?.label == "boolean" ? !t.text?.search?.label : !1
|
|
1096
1100
|
})
|
|
1097
1101
|
}, {
|
|
1098
1102
|
default: h(() => [
|
|
1099
|
-
x(
|
|
1103
|
+
x(n.$slots, "search-" + t.key, {
|
|
1100
1104
|
row: e.search.form
|
|
1101
1105
|
}, () => [
|
|
1102
|
-
t.type === "input" ? (c(), g(
|
|
1106
|
+
t.type === "input" ? (c(), g(a(q), {
|
|
1103
1107
|
key: 0,
|
|
1104
1108
|
modelValue: e.search.form[t.key],
|
|
1105
1109
|
"onUpdate:modelValue": (l) => e.search.form[t.key] = l,
|
|
1106
1110
|
placeholder: e.search.getPlaceholder(t),
|
|
1107
1111
|
clearable: "",
|
|
1108
1112
|
disabled: t.disabled?.search
|
|
1109
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : t.type === "switch" ? (c(), g(
|
|
1113
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : t.type === "switch" ? (c(), g(a(A), {
|
|
1110
1114
|
key: 1,
|
|
1111
1115
|
modelValue: e.search.form[t.key],
|
|
1112
1116
|
"onUpdate:modelValue": (l) => e.search.form[t.key] = l,
|
|
1113
|
-
placeholder: e.search.getPlaceholder(t,
|
|
1117
|
+
placeholder: e.search.getPlaceholder(t, a(w).tCurd("placeholderSelect")),
|
|
1114
1118
|
clearable: "",
|
|
1115
1119
|
disabled: t.disabled?.search
|
|
1116
1120
|
}, {
|
|
1117
1121
|
default: h(() => [
|
|
1118
|
-
(c(), g(
|
|
1122
|
+
(c(), g(a(K), {
|
|
1119
1123
|
key: t.options?.switch?.activeValue,
|
|
1120
1124
|
label: t.options?.switch?.activeLabel,
|
|
1121
1125
|
value: t.options?.switch?.activeValue
|
|
1122
1126
|
}, null, 8, ["label", "value"])),
|
|
1123
|
-
(c(), g(
|
|
1127
|
+
(c(), g(a(K), {
|
|
1124
1128
|
key: t.options?.switch?.inactiveValue,
|
|
1125
1129
|
label: t.options?.switch?.inactiveLabel,
|
|
1126
1130
|
value: t.options?.switch?.inactiveValue
|
|
1127
1131
|
}, null, 8, ["label", "value"]))
|
|
1128
1132
|
]),
|
|
1129
1133
|
_: 2
|
|
1130
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : t.type === "select" ? (c(), g(
|
|
1134
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : t.type === "select" ? (c(), g(a(A), {
|
|
1131
1135
|
key: 2,
|
|
1132
1136
|
modelValue: e.search.form[t.key],
|
|
1133
1137
|
"onUpdate:modelValue": (l) => e.search.form[t.key] = l,
|
|
1134
|
-
placeholder: e.search.getPlaceholder(t,
|
|
1138
|
+
placeholder: e.search.getPlaceholder(t, a(w).tCurd("placeholderSelect")),
|
|
1135
1139
|
clearable: "",
|
|
1136
1140
|
disabled: t.disabled?.search
|
|
1137
1141
|
}, {
|
|
1138
1142
|
default: h(() => [
|
|
1139
|
-
(c(!0), k(
|
|
1143
|
+
(c(!0), k(F, null, T(t.options?.select?.data, (l) => (c(), g(a(K), {
|
|
1140
1144
|
key: l.value,
|
|
1141
1145
|
label: l.label,
|
|
1142
1146
|
value: l.value
|
|
1143
1147
|
}, null, 8, ["label", "value"]))), 128))
|
|
1144
1148
|
]),
|
|
1145
1149
|
_: 2
|
|
1146
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : t.type === "datetime" ? (c(), g(
|
|
1150
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : t.type === "datetime" ? (c(), g(a(Q), U({
|
|
1147
1151
|
key: 3,
|
|
1148
1152
|
modelValue: e.search.form[t.key],
|
|
1149
1153
|
"onUpdate:modelValue": (l) => e.search.form[t.key] = l
|
|
1150
|
-
}, { ref_for: !0 }, t.options?.datetime,
|
|
1154
|
+
}, { ref_for: !0 }, t.options?.datetime, _(t.options?.datetime?.on || {}), {
|
|
1151
1155
|
disabled: t.disabled?.search
|
|
1152
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C(
|
|
1156
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : a(C).customComponent[t.type] ? (c(), g(H(a(C).customComponent[t.type]), U({
|
|
1157
|
+
key: 4,
|
|
1158
|
+
modelValue: e.search.form[t.key],
|
|
1159
|
+
"onUpdate:modelValue": (l) => e.search.form[t.key] = l
|
|
1160
|
+
}, { ref_for: !0 }, t.options?.[t.type], _(t.options?.[t.type]?.on || {}), {
|
|
1161
|
+
disabled: t.disabled?.search
|
|
1162
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : v("", !0)
|
|
1153
1163
|
])
|
|
1154
1164
|
]),
|
|
1155
1165
|
_: 2
|
|
1156
|
-
}, 1032, ["label", "class"])) :
|
|
1166
|
+
}, 1032, ["label", "class"])) : v("", !0)
|
|
1157
1167
|
], 64))), 128)),
|
|
1158
|
-
x(
|
|
1168
|
+
x(n.$slots, "search-center", {
|
|
1159
1169
|
row: e.search.form
|
|
1160
1170
|
}),
|
|
1161
|
-
|
|
1171
|
+
V(a(N), null, {
|
|
1162
1172
|
default: h(() => [
|
|
1163
|
-
p.option.tools?.search ? (c(), g(
|
|
1173
|
+
p.option.tools?.search ? (c(), g(a(O), {
|
|
1164
1174
|
key: 0,
|
|
1165
1175
|
type: "primary",
|
|
1166
1176
|
onClick: e.search.submit
|
|
1167
1177
|
}, {
|
|
1168
1178
|
default: h(() => [
|
|
1169
|
-
D(E(
|
|
1179
|
+
D(E(a(w).tCurd("search")), 1)
|
|
1170
1180
|
]),
|
|
1171
1181
|
_: 1
|
|
1172
|
-
}, 8, ["onClick"])) :
|
|
1173
|
-
p.option.tools?.reset ? (c(), g(
|
|
1182
|
+
}, 8, ["onClick"])) : v("", !0),
|
|
1183
|
+
p.option.tools?.reset ? (c(), g(a(O), {
|
|
1174
1184
|
key: 1,
|
|
1175
1185
|
onClick: e.search.reset
|
|
1176
1186
|
}, {
|
|
1177
1187
|
default: h(() => [
|
|
1178
|
-
D(E(
|
|
1188
|
+
D(E(a(w).tCurd("reset")), 1)
|
|
1179
1189
|
]),
|
|
1180
1190
|
_: 1
|
|
1181
|
-
}, 8, ["onClick"])) :
|
|
1191
|
+
}, 8, ["onClick"])) : v("", !0)
|
|
1182
1192
|
]),
|
|
1183
1193
|
_: 1
|
|
1184
1194
|
}),
|
|
1185
|
-
x(
|
|
1195
|
+
x(n.$slots, "search-end", {
|
|
1186
1196
|
row: e.search.form
|
|
1187
1197
|
})
|
|
1188
1198
|
]),
|
|
1189
1199
|
_: 3
|
|
1190
1200
|
}, 8, ["model"])
|
|
1191
|
-
])) :
|
|
1192
|
-
S("div",
|
|
1201
|
+
])) : v("", !0),
|
|
1202
|
+
S("div", Ie, [
|
|
1193
1203
|
S("div", Re, [
|
|
1194
|
-
|
|
1195
|
-
|
|
1204
|
+
a(u)(p.option.tools?.add) ? (c(), k("div", Te, [
|
|
1205
|
+
V(a(O), {
|
|
1196
1206
|
type: "primary",
|
|
1197
|
-
onClick: i[0] || (i[0] = (t) => e.update.open(
|
|
1207
|
+
onClick: i[0] || (i[0] = (t) => e.update.open(a(d).Insert))
|
|
1198
1208
|
}, {
|
|
1199
1209
|
default: h(() => [
|
|
1200
|
-
D(E(
|
|
1210
|
+
D(E(a(w).tCurd("add")), 1)
|
|
1201
1211
|
]),
|
|
1202
1212
|
_: 1
|
|
1203
1213
|
})
|
|
1204
|
-
])) :
|
|
1205
|
-
p.option.table?.selectable &&
|
|
1206
|
-
|
|
1214
|
+
])) : v("", !0),
|
|
1215
|
+
p.option.table?.selectable && a(u)(p.option.tools?.delete) ? (c(), k("div", je, [
|
|
1216
|
+
V(a(O), {
|
|
1207
1217
|
type: "danger",
|
|
1208
1218
|
onClick: i[1] || (i[1] = (t) => e.remove.open(e.table.selection.list))
|
|
1209
1219
|
}, {
|
|
1210
1220
|
default: h(() => [
|
|
1211
|
-
D(E(
|
|
1221
|
+
D(E(a(w).tCurd("delete")), 1)
|
|
1212
1222
|
]),
|
|
1213
1223
|
_: 1
|
|
1214
1224
|
})
|
|
1215
|
-
])) :
|
|
1216
|
-
p.option.tools?.expand ? (c(), k("div",
|
|
1217
|
-
|
|
1225
|
+
])) : v("", !0),
|
|
1226
|
+
p.option.tools?.expand ? (c(), k("div", ze, [
|
|
1227
|
+
V(a(O), {
|
|
1218
1228
|
type: "warning",
|
|
1219
1229
|
onClick: i[2] || (i[2] = (t) => e.table.expand.all())
|
|
1220
1230
|
}, {
|
|
1221
1231
|
default: h(() => [
|
|
1222
|
-
D(E(
|
|
1232
|
+
D(E(a(w).tCurd("expandCollapse")), 1)
|
|
1223
1233
|
]),
|
|
1224
1234
|
_: 1
|
|
1225
1235
|
})
|
|
1226
|
-
])) :
|
|
1227
|
-
p.option.tools?.export?.show ? (c(), g(
|
|
1236
|
+
])) : v("", !0),
|
|
1237
|
+
p.option.tools?.export?.show ? (c(), g(a(pe), {
|
|
1228
1238
|
key: 3,
|
|
1229
1239
|
onCommand: e.export.click
|
|
1230
1240
|
}, {
|
|
1231
1241
|
dropdown: h(() => [
|
|
1232
|
-
|
|
1242
|
+
V(a(fe), null, {
|
|
1233
1243
|
default: h(() => [
|
|
1234
|
-
p.option.table?.selectable ? (c(), g(
|
|
1244
|
+
p.option.table?.selectable ? (c(), g(a(J), {
|
|
1235
1245
|
key: 0,
|
|
1236
1246
|
command: "select"
|
|
1237
1247
|
}, {
|
|
1238
1248
|
default: h(() => [
|
|
1239
|
-
D(E(
|
|
1249
|
+
D(E(a(w).tCurd("exportSelect")), 1)
|
|
1240
1250
|
]),
|
|
1241
1251
|
_: 1
|
|
1242
|
-
})) :
|
|
1243
|
-
|
|
1252
|
+
})) : v("", !0),
|
|
1253
|
+
V(a(J), { command: "page" }, {
|
|
1244
1254
|
default: h(() => [
|
|
1245
|
-
D(E(
|
|
1255
|
+
D(E(a(w).tCurd("exportPage")), 1)
|
|
1246
1256
|
]),
|
|
1247
1257
|
_: 1
|
|
1248
1258
|
}),
|
|
1249
|
-
|
|
1259
|
+
V(a(J), { command: "all" }, {
|
|
1250
1260
|
default: h(() => [
|
|
1251
|
-
D(E(
|
|
1261
|
+
D(E(a(w).tCurd("exportAll")), 1)
|
|
1252
1262
|
]),
|
|
1253
1263
|
_: 1
|
|
1254
1264
|
})
|
|
@@ -1257,37 +1267,37 @@ const Se = /* @__PURE__ */ xe(De, [["render", Ue]]), $e = { class: "col relative
|
|
|
1257
1267
|
})
|
|
1258
1268
|
]),
|
|
1259
1269
|
default: h(() => [
|
|
1260
|
-
S("div",
|
|
1261
|
-
|
|
1270
|
+
S("div", Le, [
|
|
1271
|
+
V(a(O), {
|
|
1262
1272
|
type: "warning",
|
|
1263
1273
|
loading: e.export.loading
|
|
1264
1274
|
}, {
|
|
1265
1275
|
default: h(() => [
|
|
1266
|
-
D(E(
|
|
1276
|
+
D(E(a(w).tCurd("export")), 1)
|
|
1267
1277
|
]),
|
|
1268
1278
|
_: 1
|
|
1269
1279
|
}, 8, ["loading"])
|
|
1270
1280
|
])
|
|
1271
1281
|
]),
|
|
1272
1282
|
_: 1
|
|
1273
|
-
}, 8, ["onCommand"])) :
|
|
1274
|
-
x(
|
|
1283
|
+
}, 8, ["onCommand"])) : v("", !0),
|
|
1284
|
+
x(n.$slots, "tools-left")
|
|
1275
1285
|
]),
|
|
1276
|
-
S("div",
|
|
1277
|
-
x(
|
|
1286
|
+
S("div", Me, [
|
|
1287
|
+
x(n.$slots, "tools-right"),
|
|
1278
1288
|
p.option.tools?.refresh === void 0 || p.option.tools?.refresh ? (c(), k("div", {
|
|
1279
1289
|
key: 0,
|
|
1280
1290
|
class: "refresh-btn",
|
|
1281
1291
|
onClick: i[3] || (i[3] = //@ts-ignore
|
|
1282
1292
|
(...t) => e.table.getList && e.table.getList(...t))
|
|
1283
1293
|
}, [
|
|
1284
|
-
|
|
1285
|
-
])) :
|
|
1294
|
+
V(Se)
|
|
1295
|
+
])) : v("", !0)
|
|
1286
1296
|
])
|
|
1287
1297
|
]),
|
|
1288
1298
|
S("div", Pe, [
|
|
1289
1299
|
S("div", Ke, [
|
|
1290
|
-
de((c(), g(
|
|
1300
|
+
de((c(), g(a(me), U({
|
|
1291
1301
|
data: e.table.data
|
|
1292
1302
|
}, p.option.table, {
|
|
1293
1303
|
onSelectionChange: e.table.selection.change,
|
|
@@ -1295,84 +1305,84 @@ const Se = /* @__PURE__ */ xe(De, [["render", Ue]]), $e = { class: "col relative
|
|
|
1295
1305
|
onExpandChange: e.table.expand.change
|
|
1296
1306
|
}), {
|
|
1297
1307
|
default: h(() => [
|
|
1298
|
-
p.option.table?.selectable && (
|
|
1308
|
+
p.option.table?.selectable && (a(u)(p.option.tools?.delete) || p.option.tools?.export?.show) ? (c(), g(a(W), {
|
|
1299
1309
|
key: 0,
|
|
1300
1310
|
type: "selection",
|
|
1301
1311
|
selectable: typeof p.option.table?.selectable == "function" ? p.option.table?.selectable : void 0,
|
|
1302
1312
|
width: "55"
|
|
1303
|
-
}, null, 8, ["selectable"])) :
|
|
1304
|
-
(c(!0), k(
|
|
1313
|
+
}, null, 8, ["selectable"])) : v("", !0),
|
|
1314
|
+
(c(!0), k(F, null, T(e.table.column.list, (t) => (c(), k(F, {
|
|
1305
1315
|
key: t.key
|
|
1306
1316
|
}, [
|
|
1307
|
-
e.table.column.show.list.includes(t.key) ? (c(), g(
|
|
1317
|
+
e.table.column.show.list.includes(t.key) ? (c(), g(a(W), U({
|
|
1308
1318
|
key: 0,
|
|
1309
1319
|
prop: t.key,
|
|
1310
1320
|
label: t.label
|
|
1311
1321
|
}, { ref_for: !0 }, t.table), {
|
|
1312
1322
|
default: h(({ row: l }) => [
|
|
1313
|
-
x(
|
|
1323
|
+
x(n.$slots, "table-" + t.key, {
|
|
1314
1324
|
row: l,
|
|
1315
1325
|
item: t
|
|
1316
1326
|
}, () => [
|
|
1317
|
-
t.type === "switch" ? (c(), g(
|
|
1327
|
+
t.type === "switch" ? (c(), g(a(X), U({
|
|
1318
1328
|
key: 0,
|
|
1319
1329
|
modelValue: l[t.key],
|
|
1320
1330
|
"onUpdate:modelValue": (b) => l[t.key] = b,
|
|
1321
1331
|
"before-change": () => t.options?.switch?.tableBeforeChange?.(t.key, l)
|
|
1322
|
-
}, { ref_for: !0 }, t.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "before-change"])) : (c(), k(
|
|
1332
|
+
}, { ref_for: !0 }, t.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "before-change"])) : (c(), k(F, { key: 1 }, [
|
|
1323
1333
|
D(E(l[t.key]), 1)
|
|
1324
1334
|
], 64))
|
|
1325
1335
|
])
|
|
1326
1336
|
]),
|
|
1327
1337
|
_: 2
|
|
1328
|
-
}, 1040, ["prop", "label"])) :
|
|
1338
|
+
}, 1040, ["prop", "label"])) : v("", !0)
|
|
1329
1339
|
], 64))), 128)),
|
|
1330
|
-
|
|
1340
|
+
a(u)(p.option.tools?.add) || a(u)(p.option.tools?.update) || a(u)(p.option.tools?.delete) || n.$slots["table-op-left"] || n.$slots["table-op-right"] ? (c(), g(a(W), {
|
|
1331
1341
|
key: 1,
|
|
1332
|
-
label:
|
|
1342
|
+
label: a(w).tCurd("operation"),
|
|
1333
1343
|
width: "180",
|
|
1334
1344
|
align: "center",
|
|
1335
1345
|
fixed: "right"
|
|
1336
1346
|
}, {
|
|
1337
1347
|
default: h(({ row: t }) => [
|
|
1338
|
-
x(
|
|
1339
|
-
|
|
1348
|
+
x(n.$slots, "table-op-left", { row: t }),
|
|
1349
|
+
a(u)(p.option.tools?.add, t) ? (c(), g(a(O), {
|
|
1340
1350
|
key: 0,
|
|
1341
1351
|
link: "",
|
|
1342
1352
|
type: "primary",
|
|
1343
|
-
onClick: (l) => e.update.open(
|
|
1353
|
+
onClick: (l) => e.update.open(a(d).Insert, t)
|
|
1344
1354
|
}, {
|
|
1345
1355
|
default: h(() => [
|
|
1346
|
-
D(E(
|
|
1356
|
+
D(E(a(w).tCurd("add")), 1)
|
|
1347
1357
|
]),
|
|
1348
1358
|
_: 1
|
|
1349
|
-
}, 8, ["onClick"])) :
|
|
1350
|
-
|
|
1359
|
+
}, 8, ["onClick"])) : v("", !0),
|
|
1360
|
+
a(u)(p.option.tools?.update, t) ? (c(), g(a(O), {
|
|
1351
1361
|
key: 1,
|
|
1352
1362
|
link: "",
|
|
1353
1363
|
type: "warning",
|
|
1354
|
-
onClick: (l) => e.update.open(
|
|
1364
|
+
onClick: (l) => e.update.open(a(d).Update, t)
|
|
1355
1365
|
}, {
|
|
1356
1366
|
default: h(() => [
|
|
1357
|
-
D(E(
|
|
1367
|
+
D(E(a(w).tCurd("edit")), 1)
|
|
1358
1368
|
]),
|
|
1359
1369
|
_: 1
|
|
1360
|
-
}, 8, ["onClick"])) :
|
|
1361
|
-
|
|
1370
|
+
}, 8, ["onClick"])) : v("", !0),
|
|
1371
|
+
a(u)(p.option.tools?.delete, t) ? (c(), g(a(O), {
|
|
1362
1372
|
key: 2,
|
|
1363
1373
|
link: "",
|
|
1364
1374
|
type: "danger",
|
|
1365
1375
|
onClick: (l) => e.remove.open([t])
|
|
1366
1376
|
}, {
|
|
1367
1377
|
default: h(() => [
|
|
1368
|
-
D(E(
|
|
1378
|
+
D(E(a(w).tCurd("delete")), 1)
|
|
1369
1379
|
]),
|
|
1370
1380
|
_: 1
|
|
1371
|
-
}, 8, ["onClick"])) :
|
|
1372
|
-
x(
|
|
1381
|
+
}, 8, ["onClick"])) : v("", !0),
|
|
1382
|
+
x(n.$slots, "table-op-right", { row: t })
|
|
1373
1383
|
]),
|
|
1374
1384
|
_: 3
|
|
1375
|
-
}, 8, ["label"])) :
|
|
1385
|
+
}, 8, ["label"])) : v("", !0)
|
|
1376
1386
|
]),
|
|
1377
1387
|
_: 3
|
|
1378
1388
|
}, 16, ["data", "onSelectionChange", "expand-row-keys", "onExpandChange"])), [
|
|
@@ -1381,7 +1391,7 @@ const Se = /* @__PURE__ */ xe(De, [["render", Ue]]), $e = { class: "col relative
|
|
|
1381
1391
|
])
|
|
1382
1392
|
]),
|
|
1383
1393
|
S("div", Ne, [
|
|
1384
|
-
|
|
1394
|
+
V(a(he), {
|
|
1385
1395
|
"current-page": e.page.num,
|
|
1386
1396
|
"onUpdate:currentPage": i[4] || (i[4] = (t) => e.page.num = t),
|
|
1387
1397
|
"page-size": e.page.size,
|
|
@@ -1396,9 +1406,9 @@ const Se = /* @__PURE__ */ xe(De, [["render", Ue]]), $e = { class: "col relative
|
|
|
1396
1406
|
}, null, 8, ["current-page", "page-size", "page-sizes", "layout", "total", "onSizeChange", "onCurrentChange"])
|
|
1397
1407
|
])
|
|
1398
1408
|
]),
|
|
1399
|
-
x(
|
|
1409
|
+
x(n.$slots, "box-right")
|
|
1400
1410
|
]),
|
|
1401
|
-
|
|
1411
|
+
V(a(Y), U({
|
|
1402
1412
|
modelValue: e.update.show,
|
|
1403
1413
|
"onUpdate:modelValue": i[6] || (i[6] = (t) => e.update.show = t),
|
|
1404
1414
|
title: e.update.title,
|
|
@@ -1407,54 +1417,54 @@ const Se = /* @__PURE__ */ xe(De, [["render", Ue]]), $e = { class: "col relative
|
|
|
1407
1417
|
}, p.option.dialog), {
|
|
1408
1418
|
footer: h(() => [
|
|
1409
1419
|
S("span", Je, [
|
|
1410
|
-
|
|
1420
|
+
V(a(O), {
|
|
1411
1421
|
onClick: e.update.close
|
|
1412
1422
|
}, {
|
|
1413
1423
|
default: h(() => [
|
|
1414
|
-
D(E(
|
|
1424
|
+
D(E(a(w).tCurd("close")), 1)
|
|
1415
1425
|
]),
|
|
1416
1426
|
_: 1
|
|
1417
1427
|
}, 8, ["onClick"]),
|
|
1418
|
-
|
|
1428
|
+
V(a(O), {
|
|
1419
1429
|
type: "primary",
|
|
1420
1430
|
onClick: e.update.submit,
|
|
1421
1431
|
loading: e.update.loading
|
|
1422
1432
|
}, {
|
|
1423
1433
|
default: h(() => [
|
|
1424
|
-
D(E(
|
|
1434
|
+
D(E(a(w).tCurd("submit")), 1)
|
|
1425
1435
|
]),
|
|
1426
1436
|
_: 1
|
|
1427
1437
|
}, 8, ["onClick", "loading"])
|
|
1428
1438
|
])
|
|
1429
1439
|
]),
|
|
1430
1440
|
default: h(() => [
|
|
1431
|
-
|
|
1441
|
+
V(a(G), {
|
|
1432
1442
|
ref_key: "ruleFormRef",
|
|
1433
1443
|
ref: m,
|
|
1434
1444
|
model: e.update.form,
|
|
1435
1445
|
rules: e.update.rules
|
|
1436
1446
|
}, {
|
|
1437
1447
|
default: h(() => [
|
|
1438
|
-
e.update.showContent ? (c(!0), k(
|
|
1439
|
-
|
|
1448
|
+
e.update.showContent ? (c(!0), k(F, { key: 0 }, T(e.update.formColumn, (t) => (c(), k(F, null, [
|
|
1449
|
+
a(u)(
|
|
1440
1450
|
t.map((l) => l.item.show?.form),
|
|
1441
1451
|
e.update.form
|
|
1442
1452
|
) ? (c(), k("div", {
|
|
1443
1453
|
key: 0,
|
|
1444
|
-
class:
|
|
1454
|
+
class: L(["row curd-row", {
|
|
1445
1455
|
stripe: p.option.form?.stripe === void 0 ? !0 : p.option.form?.stripe
|
|
1446
1456
|
}])
|
|
1447
1457
|
}, [
|
|
1448
|
-
x(
|
|
1458
|
+
x(n.$slots, "form-start", {
|
|
1449
1459
|
row: e.update.form
|
|
1450
1460
|
}),
|
|
1451
|
-
(c(!0), k(
|
|
1452
|
-
|
|
1461
|
+
(c(!0), k(F, null, T(t, (l) => (c(), k(F, null, [
|
|
1462
|
+
a(u)(l.item.show?.form, e.update.form) ? (c(), k("div", {
|
|
1453
1463
|
key: 0,
|
|
1454
|
-
class:
|
|
1464
|
+
class: L(l.item.form.span > 0 ? `col-${l.item.form.span}` : "col")
|
|
1455
1465
|
}, [
|
|
1456
|
-
|
|
1457
|
-
class:
|
|
1466
|
+
V(a(N), {
|
|
1467
|
+
class: L({
|
|
1458
1468
|
"hide-label": typeof l.item.text?.form?.label == "boolean" ? !l.item.text?.form?.label : !1
|
|
1459
1469
|
}),
|
|
1460
1470
|
label: typeof l.item.text?.form?.label == "string" ? l.item.text?.form?.label : l.item.label,
|
|
@@ -1463,73 +1473,73 @@ const Se = /* @__PURE__ */ xe(De, [["render", Ue]]), $e = { class: "col relative
|
|
|
1463
1473
|
}, {
|
|
1464
1474
|
default: h(() => [
|
|
1465
1475
|
S("div", Ae, [
|
|
1466
|
-
x(
|
|
1476
|
+
x(n.$slots, "form-" + l.item.key + "-start", {
|
|
1467
1477
|
row: e.update.form,
|
|
1468
1478
|
item: l.item
|
|
1469
1479
|
}),
|
|
1470
1480
|
S("div", Be, [
|
|
1471
|
-
x(
|
|
1481
|
+
x(n.$slots, "form-" + l.item.key, {
|
|
1472
1482
|
row: e.update.form,
|
|
1473
1483
|
item: l.item
|
|
1474
1484
|
}, () => [
|
|
1475
|
-
l.item.type === "input" ? (c(), g(
|
|
1485
|
+
l.item.type === "input" ? (c(), g(a(q), U({
|
|
1476
1486
|
key: 0,
|
|
1477
1487
|
modelValue: e.update.form[l.item.key],
|
|
1478
1488
|
"onUpdate:modelValue": (b) => e.update.form[l.item.key] = b
|
|
1479
|
-
}, { ref_for: !0 }, l.item.options?.input,
|
|
1489
|
+
}, { ref_for: !0 }, l.item.options?.input, _(l.item.options?.input?.on || {}), {
|
|
1480
1490
|
disabled: e.update.getDisabled(l.item)
|
|
1481
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : l.item.type === "switch" ? (c(), g(
|
|
1491
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : l.item.type === "switch" ? (c(), g(a(X), U({
|
|
1482
1492
|
key: 1,
|
|
1483
1493
|
modelValue: e.update.form[l.item.key],
|
|
1484
1494
|
"onUpdate:modelValue": (b) => e.update.form[l.item.key] = b
|
|
1485
1495
|
}, { ref_for: !0 }, l.item.options?.switch, {
|
|
1486
1496
|
disabled: e.update.getDisabled(l.item)
|
|
1487
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : l.item.type === "select" ? (c(), g(
|
|
1497
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : l.item.type === "select" ? (c(), g(a(A), U({
|
|
1488
1498
|
key: 2,
|
|
1489
1499
|
modelValue: e.update.form[l.item.key],
|
|
1490
1500
|
"onUpdate:modelValue": (b) => e.update.form[l.item.key] = b
|
|
1491
|
-
}, { ref_for: !0 }, l.item.options?.select,
|
|
1501
|
+
}, { ref_for: !0 }, l.item.options?.select, _(l.item.options?.select?.on || {}), {
|
|
1492
1502
|
disabled: e.update.getDisabled(l.item),
|
|
1493
1503
|
style: { width: "100%" }
|
|
1494
1504
|
}), {
|
|
1495
1505
|
default: h(() => [
|
|
1496
|
-
(c(!0), k(
|
|
1506
|
+
(c(!0), k(F, null, T(l.item.options?.select?.data, (b) => (c(), g(a(K), {
|
|
1497
1507
|
key: b.value,
|
|
1498
1508
|
label: b.label,
|
|
1499
1509
|
value: b.value
|
|
1500
1510
|
}, null, 8, ["label", "value"]))), 128))
|
|
1501
1511
|
]),
|
|
1502
1512
|
_: 2
|
|
1503
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : l.item.type === "list" ? (c(), g(
|
|
1513
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : l.item.type === "list" ? (c(), g(ee, U({
|
|
1504
1514
|
key: 3,
|
|
1505
1515
|
row: e.update.form,
|
|
1506
1516
|
field: l.item.key
|
|
1507
|
-
}, { ref_for: !0 }, l.item.options?.list,
|
|
1517
|
+
}, { ref_for: !0 }, l.item.options?.list, _(l.item.options?.list?.on || {}), {
|
|
1508
1518
|
disabled: e.update.getDisabled(l.item),
|
|
1509
1519
|
style: { width: "100%" }
|
|
1510
|
-
}), null, 16, ["row", "field", "disabled"])) : l.item.type === "tree-select" ? (c(), g(
|
|
1520
|
+
}), null, 16, ["row", "field", "disabled"])) : l.item.type === "tree-select" ? (c(), g(a(ae), U({
|
|
1511
1521
|
key: 4,
|
|
1512
1522
|
modelValue: e.update.form[l.item.key],
|
|
1513
1523
|
"onUpdate:modelValue": (b) => e.update.form[l.item.key] = b
|
|
1514
|
-
}, { ref_for: !0 }, l.item.options?.treeSelect,
|
|
1524
|
+
}, { ref_for: !0 }, l.item.options?.treeSelect, _(l.item.options?.treeSelect?.on || {}), {
|
|
1515
1525
|
disabled: e.update.getDisabled(l.item),
|
|
1516
1526
|
style: { width: "100%" }
|
|
1517
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : l.item.type === "datetime" ? (c(), g(
|
|
1527
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : l.item.type === "datetime" ? (c(), g(a(Q), U({
|
|
1518
1528
|
key: 5,
|
|
1519
1529
|
modelValue: e.update.form[l.item.key],
|
|
1520
1530
|
"onUpdate:modelValue": (b) => e.update.form[l.item.key] = b
|
|
1521
|
-
}, { ref_for: !0 }, l.item.options?.datetime,
|
|
1531
|
+
}, { ref_for: !0 }, l.item.options?.datetime, _(l.item.options?.datetime?.on || {}), {
|
|
1522
1532
|
disabled: e.update.getDisabled(l.item)
|
|
1523
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
1533
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : a(C).customComponent[l.item.type] ? (c(), g(H(a(C).customComponent[l.item.type]), U({
|
|
1524
1534
|
key: 6,
|
|
1525
1535
|
modelValue: e.update.form[l.item.key],
|
|
1526
1536
|
"onUpdate:modelValue": (b) => e.update.form[l.item.key] = b
|
|
1527
|
-
}, { ref_for: !0 }, l.item.options?.[l.item.type],
|
|
1537
|
+
}, { ref_for: !0 }, l.item.options?.[l.item.type], _(l.item.options?.[l.item.type]?.on || {}), {
|
|
1528
1538
|
disabled: e.update.getDisabled(l.item)
|
|
1529
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
1539
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : v("", !0)
|
|
1530
1540
|
])
|
|
1531
1541
|
]),
|
|
1532
|
-
x(
|
|
1542
|
+
x(n.$slots, "form-" + l.item.key + "-end", {
|
|
1533
1543
|
row: e.update.form,
|
|
1534
1544
|
item: l.item
|
|
1535
1545
|
})
|
|
@@ -1537,20 +1547,20 @@ const Se = /* @__PURE__ */ xe(De, [["render", Ue]]), $e = { class: "col relative
|
|
|
1537
1547
|
]),
|
|
1538
1548
|
_: 2
|
|
1539
1549
|
}, 1032, ["class", "label", "prop", "label-width"])
|
|
1540
|
-
], 2)) :
|
|
1550
|
+
], 2)) : v("", !0)
|
|
1541
1551
|
], 64))), 256)),
|
|
1542
|
-
x(
|
|
1552
|
+
x(n.$slots, "form-end", {
|
|
1543
1553
|
row: e.update.form
|
|
1544
1554
|
})
|
|
1545
|
-
], 2)) :
|
|
1546
|
-
], 64))), 256)) :
|
|
1555
|
+
], 2)) : v("", !0)
|
|
1556
|
+
], 64))), 256)) : v("", !0)
|
|
1547
1557
|
]),
|
|
1548
1558
|
_: 3
|
|
1549
1559
|
}, 8, ["model", "rules"])
|
|
1550
1560
|
]),
|
|
1551
1561
|
_: 3
|
|
1552
1562
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
1553
|
-
|
|
1563
|
+
V(a(Y), {
|
|
1554
1564
|
modelValue: e.remove.show,
|
|
1555
1565
|
"onUpdate:modelValue": i[7] || (i[7] = (t) => e.remove.show = t),
|
|
1556
1566
|
title: e.remove.title,
|
|
@@ -1558,32 +1568,32 @@ const Se = /* @__PURE__ */ xe(De, [["render", Ue]]), $e = { class: "col relative
|
|
|
1558
1568
|
}, {
|
|
1559
1569
|
footer: h(() => [
|
|
1560
1570
|
S("span", We, [
|
|
1561
|
-
|
|
1571
|
+
V(a(O), {
|
|
1562
1572
|
onClick: e.remove.close
|
|
1563
1573
|
}, {
|
|
1564
1574
|
default: h(() => [
|
|
1565
|
-
D(E(
|
|
1575
|
+
D(E(a(w).tCurd("close")), 1)
|
|
1566
1576
|
]),
|
|
1567
1577
|
_: 1
|
|
1568
1578
|
}, 8, ["onClick"]),
|
|
1569
|
-
|
|
1579
|
+
V(a(O), {
|
|
1570
1580
|
type: "danger",
|
|
1571
1581
|
onClick: e.remove.submit,
|
|
1572
1582
|
loading: e.remove.loading
|
|
1573
1583
|
}, {
|
|
1574
1584
|
default: h(() => [
|
|
1575
|
-
D(E(
|
|
1585
|
+
D(E(a(w).tCurd("confirmDelete")), 1)
|
|
1576
1586
|
]),
|
|
1577
1587
|
_: 1
|
|
1578
1588
|
}, 8, ["onClick", "loading"])
|
|
1579
1589
|
])
|
|
1580
1590
|
]),
|
|
1581
1591
|
default: h(() => [
|
|
1582
|
-
S("div", null, E(
|
|
1592
|
+
S("div", null, E(a(w).tCurd("confirmDeleteMessage", e.remove.items.length)), 1)
|
|
1583
1593
|
]),
|
|
1584
1594
|
_: 1
|
|
1585
1595
|
}, 8, ["modelValue", "title"]),
|
|
1586
|
-
|
|
1596
|
+
V(Ve, {
|
|
1587
1597
|
ref_key: "switchConfirmRef",
|
|
1588
1598
|
ref: f
|
|
1589
1599
|
}, null, 512)
|
|
@@ -1595,17 +1605,17 @@ class Qe {
|
|
|
1595
1605
|
/**
|
|
1596
1606
|
* 通过文件远程地址下载文件
|
|
1597
1607
|
*/
|
|
1598
|
-
static async download(
|
|
1599
|
-
const
|
|
1600
|
-
|
|
1608
|
+
static async download(r, d = "download.png") {
|
|
1609
|
+
const s = document.createElement("a");
|
|
1610
|
+
s.style.display = "none", s.href = r, s.setAttribute("download", d), typeof s.download > "u" && s.setAttribute("target", "_blank"), document.body.appendChild(s), s.click(), document.body.removeChild(s), window.URL.revokeObjectURL(r);
|
|
1601
1611
|
}
|
|
1602
1612
|
/**
|
|
1603
1613
|
* 将json对象或者json数组导出为json文件保存
|
|
1604
1614
|
* @param data
|
|
1605
1615
|
* @param name
|
|
1606
1616
|
*/
|
|
1607
|
-
static exportJSONFile = (
|
|
1608
|
-
const
|
|
1617
|
+
static exportJSONFile = (r, d) => {
|
|
1618
|
+
const s = new Blob([JSON.stringify(r)], { type: "application/json" }), f = URL.createObjectURL(s), m = document.createElement("a");
|
|
1609
1619
|
m.href = f, m.download = `${d || "config"}.json`, m.click();
|
|
1610
1620
|
};
|
|
1611
1621
|
/**
|
|
@@ -1613,31 +1623,31 @@ class Qe {
|
|
|
1613
1623
|
* @param param
|
|
1614
1624
|
* @returns
|
|
1615
1625
|
*/
|
|
1616
|
-
static importFile = async (
|
|
1626
|
+
static importFile = async (r) => new Promise((d, s) => {
|
|
1617
1627
|
const f = document.createElement("input");
|
|
1618
1628
|
f.type = "file";
|
|
1619
|
-
const m =
|
|
1629
|
+
const m = r?.accept || ".json";
|
|
1620
1630
|
f.accept = m, f.style.display = "none", f.onchange = (u) => {
|
|
1621
1631
|
const e = u.target.files[0];
|
|
1622
1632
|
if (!e) {
|
|
1623
|
-
$.fail("未选择文件"),
|
|
1633
|
+
$.fail("未选择文件"), s("未选择文件");
|
|
1624
1634
|
return;
|
|
1625
1635
|
}
|
|
1626
|
-
const
|
|
1627
|
-
|
|
1636
|
+
const n = new FileReader();
|
|
1637
|
+
n.onload = async (i) => {
|
|
1628
1638
|
const o = m == ".json" ? JSON.parse(i.target.result) : i.target.result;
|
|
1629
1639
|
d(o);
|
|
1630
|
-
},
|
|
1631
|
-
$.fail("文件读取失败"),
|
|
1632
|
-
},
|
|
1640
|
+
}, n.onerror = () => {
|
|
1641
|
+
$.fail("文件读取失败"), s("文件读取失败");
|
|
1642
|
+
}, n.readAsText(e), document.body.removeChild(f);
|
|
1633
1643
|
}, document.body.appendChild(f), f.click();
|
|
1634
1644
|
});
|
|
1635
1645
|
}
|
|
1636
|
-
const Ge = (p,
|
|
1637
|
-
if (p.component("TCurd", He), p.component("TFormList",
|
|
1638
|
-
|
|
1639
|
-
for (const d in
|
|
1640
|
-
p.component(d,
|
|
1646
|
+
const Ge = (p, r) => {
|
|
1647
|
+
if (p.component("TCurd", He), p.component("TFormList", ee), p.component("TColumn", we), r?.customComponent) {
|
|
1648
|
+
C.customComponent = r.customComponent;
|
|
1649
|
+
for (const d in r.customComponent)
|
|
1650
|
+
p.component(d, r.customComponent[d]);
|
|
1641
1651
|
}
|
|
1642
1652
|
}, Ye = {
|
|
1643
1653
|
install: Ge
|
|
@@ -1648,8 +1658,8 @@ export {
|
|
|
1648
1658
|
we as TColumn,
|
|
1649
1659
|
He as TCurd,
|
|
1650
1660
|
Qe as TFile,
|
|
1651
|
-
|
|
1652
|
-
|
|
1661
|
+
C as TForm,
|
|
1662
|
+
ee as TFormList,
|
|
1653
1663
|
$ as TSys,
|
|
1654
1664
|
Ye as default,
|
|
1655
1665
|
Ge as install
|