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