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