cc1-form 1.0.2 → 1.0.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 +543 -541
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/com/form/column.vue.d.ts +69 -35
- package/dist/components/TCurd/com/form/list.vue.d.ts +4 -4
- package/dist/components/TCurd/index.d.ts +14 -6
- package/dist/components/TCurd/index.vue.d.ts +70 -50
- package/package.json +1 -1
package/dist/cc1-form.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ElMessage as
|
|
1
|
+
import { defineComponent as P, reactive as q, onMounted as ee, resolveComponent as Z, createElementBlock as w, createCommentVNode as C, openBlock as p, renderSlot as k, createElementVNode as U, createVNode as v, withCtx as h, createTextVNode as V, Fragment as $, renderList as I, createBlock as g, normalizeClass as X, normalizeStyle as se, ref as T, nextTick as ne, unref as u, mergeProps as D, toHandlers as F, resolveDynamicComponent as te, toDisplayString as A, resolveDirective as ie, withDirectives as re } from "vue";
|
|
2
|
+
import { ElMessage as de, ElLoading as ue, ElForm as J, ElFormItem as _, ElInput as K, ElSwitch as H, ElSelect as N, ElOption as M, ElTreeSelect as oe, ElDatePicker as le, ElDialog as G, ElButton as S, ElDropdown as pe, ElDropdownMenu as fe, ElDropdownItem as B, ElTable as ce, ElTableColumn as W, ElPagination as me } from "element-plus";
|
|
3
3
|
class O {
|
|
4
4
|
/**
|
|
5
5
|
* 路由
|
|
@@ -24,13 +24,13 @@ class O {
|
|
|
24
24
|
* @param data 数据
|
|
25
25
|
* @returns 是否显示
|
|
26
26
|
*/
|
|
27
|
-
static isFun = (
|
|
27
|
+
static isFun = (d, r) => typeof d == "function" ? d(r) : d;
|
|
28
28
|
/**
|
|
29
29
|
* 获取路由参数,自动获取query、params中的参数, 哪个有就返回哪个
|
|
30
30
|
*/
|
|
31
31
|
static getRouterParams = () => {
|
|
32
|
-
const
|
|
33
|
-
return Object.keys(
|
|
32
|
+
const d = this.router.currentRoute.value.query || {}, r = this.router.currentRoute.value.params || {};
|
|
33
|
+
return Object.keys(d).length ? d : Object.keys(r).length ? r : {};
|
|
34
34
|
};
|
|
35
35
|
/**
|
|
36
36
|
* 模块赋值
|
|
@@ -40,10 +40,10 @@ class O {
|
|
|
40
40
|
* 加载模块
|
|
41
41
|
* @param module
|
|
42
42
|
*/
|
|
43
|
-
static loadModule = async (
|
|
44
|
-
if (!O.moduleObj[
|
|
45
|
-
throw new Error(`模块${
|
|
46
|
-
const r = await O.moduleObj[
|
|
43
|
+
static loadModule = async (d) => {
|
|
44
|
+
if (!O.moduleObj[d])
|
|
45
|
+
throw new Error(`模块${d}未加载,请赋值如:TSys.moduleObj = { ${d}: ()=>import('${d}') }`);
|
|
46
|
+
const r = await O.moduleObj[d]();
|
|
47
47
|
return r.default ?? r;
|
|
48
48
|
};
|
|
49
49
|
/**
|
|
@@ -60,19 +60,19 @@ class O {
|
|
|
60
60
|
* @param type 消息类型
|
|
61
61
|
* @param options 其他选项
|
|
62
62
|
*/
|
|
63
|
-
static showMessage(
|
|
63
|
+
static showMessage(d, r, i = {}) {
|
|
64
64
|
const c = Date.now();
|
|
65
|
-
if (!this.tipMessages[
|
|
66
|
-
this.tipMessages[
|
|
65
|
+
if (!this.tipMessages[d] || c - this.tipMessages[d] > this.tipMessagesGap) {
|
|
66
|
+
this.tipMessages[d] = c;
|
|
67
67
|
const m = Object.assign(
|
|
68
68
|
{
|
|
69
|
-
message:
|
|
69
|
+
message: d,
|
|
70
70
|
type: r
|
|
71
71
|
},
|
|
72
|
-
|
|
72
|
+
i
|
|
73
73
|
);
|
|
74
|
-
|
|
75
|
-
delete this.tipMessages[
|
|
74
|
+
de(m), setTimeout(() => {
|
|
75
|
+
delete this.tipMessages[d];
|
|
76
76
|
}, this.tipMessagesGap);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -81,16 +81,16 @@ class O {
|
|
|
81
81
|
* @param content
|
|
82
82
|
* @param options
|
|
83
83
|
*/
|
|
84
|
-
static fail = (
|
|
85
|
-
this.showMessage(
|
|
84
|
+
static fail = (d, r = {}) => {
|
|
85
|
+
this.showMessage(d, "error", r);
|
|
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 = (d, r = {}) => {
|
|
93
|
+
this.showMessage(d, "success", r);
|
|
94
94
|
};
|
|
95
95
|
static loadingObj = null;
|
|
96
96
|
static loadingTimer = null;
|
|
@@ -99,9 +99,9 @@ class O {
|
|
|
99
99
|
* @param show
|
|
100
100
|
* @param text
|
|
101
101
|
*/
|
|
102
|
-
static loading = (
|
|
102
|
+
static loading = (d = !0, r = "加载中") => {
|
|
103
103
|
Timer.un(this.loadingTimer), this.loadingTimer = Timer.once(() => {
|
|
104
|
-
|
|
104
|
+
d ? this.loadingObj = ue.service({
|
|
105
105
|
lock: !0,
|
|
106
106
|
text: r,
|
|
107
107
|
background: "rgba(0, 0, 0, 0.3)"
|
|
@@ -113,17 +113,17 @@ class O {
|
|
|
113
113
|
* @param url 地址
|
|
114
114
|
* @param isCenter 是否居中
|
|
115
115
|
*/
|
|
116
|
-
static openUrl = (
|
|
116
|
+
static openUrl = (d, r = !0) => {
|
|
117
117
|
if (r) {
|
|
118
|
-
let
|
|
118
|
+
let i = screen.width / 2 - 500, c = screen.height / 2 - 800 / 2 - 30;
|
|
119
119
|
window.open(
|
|
120
|
-
|
|
120
|
+
d,
|
|
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=" + c + ", left=" +
|
|
122
|
+
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + c + ", left=" + i
|
|
123
123
|
);
|
|
124
124
|
} else
|
|
125
125
|
window.open(
|
|
126
|
-
|
|
126
|
+
d,
|
|
127
127
|
"DescriptiveWindowName" + StrUtil.getId(),
|
|
128
128
|
"resizable,scrollbars=yes,status=1,width=1024, height=600, top=0, left=0"
|
|
129
129
|
);
|
|
@@ -133,18 +133,18 @@ class O {
|
|
|
133
133
|
* @param param
|
|
134
134
|
* @returns
|
|
135
135
|
*/
|
|
136
|
-
static getImgPic = (
|
|
137
|
-
let c = document.getElementById(
|
|
136
|
+
static getImgPic = (d) => new Promise(async (r, i) => {
|
|
137
|
+
let c = document.getElementById(d.id);
|
|
138
138
|
const m = await O.loadModule("html2canvas");
|
|
139
139
|
try {
|
|
140
140
|
m(c, {
|
|
141
141
|
logging: !1,
|
|
142
142
|
allowTaint: !0,
|
|
143
143
|
scale: window.devicePixelRatio,
|
|
144
|
-
width:
|
|
145
|
-
height:
|
|
146
|
-
windowWidth:
|
|
147
|
-
windowHeight:
|
|
144
|
+
width: d.windowWidth,
|
|
145
|
+
height: d.windowHeight,
|
|
146
|
+
windowWidth: d.windowWidth,
|
|
147
|
+
windowHeight: d.windowHeight,
|
|
148
148
|
useCORS: !0,
|
|
149
149
|
backgroundColor: "#ffffff00"
|
|
150
150
|
}).then(function(s) {
|
|
@@ -152,18 +152,18 @@ class O {
|
|
|
152
152
|
r(e);
|
|
153
153
|
});
|
|
154
154
|
} catch (s) {
|
|
155
|
-
|
|
155
|
+
i(s);
|
|
156
156
|
}
|
|
157
157
|
});
|
|
158
158
|
/**
|
|
159
159
|
* 下载文件
|
|
160
160
|
*/
|
|
161
|
-
static async download(
|
|
162
|
-
const
|
|
163
|
-
|
|
161
|
+
static async download(d, r = "download.png") {
|
|
162
|
+
const i = document.createElement("a");
|
|
163
|
+
i.style.display = "none", i.href = d, i.setAttribute("download", r), typeof i.download > "u" && i.setAttribute("target", "_blank"), document.body.appendChild(i), i.click(), document.body.removeChild(i), window.URL.revokeObjectURL(d);
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
class
|
|
166
|
+
class j {
|
|
167
167
|
/**
|
|
168
168
|
* 自定义组件
|
|
169
169
|
*/
|
|
@@ -174,10 +174,10 @@ class L {
|
|
|
174
174
|
* @param field
|
|
175
175
|
* @returns
|
|
176
176
|
*/
|
|
177
|
-
static findOptions = (
|
|
178
|
-
const
|
|
179
|
-
if (
|
|
180
|
-
return
|
|
177
|
+
static findOptions = (d, r) => {
|
|
178
|
+
const i = d.column.find((m) => m.key === r), c = (m) => m.replace(/-([a-z])/g, (s, e) => e.toUpperCase());
|
|
179
|
+
if (i)
|
|
180
|
+
return i.options[c(i.type)];
|
|
181
181
|
};
|
|
182
182
|
/**
|
|
183
183
|
* 更新组件数据
|
|
@@ -195,9 +195,9 @@ class L {
|
|
|
195
195
|
}))
|
|
196
196
|
)
|
|
197
197
|
*/
|
|
198
|
-
static setOptionsData = (
|
|
199
|
-
const c =
|
|
200
|
-
c && (c.data =
|
|
198
|
+
static setOptionsData = (d, r, i) => {
|
|
199
|
+
const c = j.findOptions(d, r);
|
|
200
|
+
c && (c.data = i);
|
|
201
201
|
};
|
|
202
202
|
static form = {
|
|
203
203
|
openBefore: {
|
|
@@ -208,162 +208,13 @@ class L {
|
|
|
208
208
|
* @param treeData 树形数据
|
|
209
209
|
* @param option 组件配置
|
|
210
210
|
*/
|
|
211
|
-
parentId: (
|
|
212
|
-
|
|
211
|
+
parentId: (d, r, i, c) => {
|
|
212
|
+
d ? r.type === O.EDialog.Insert ? (r.form.parentId = d._id, r.form.sort = d.children.length + 1) : r.form.parentId = d.parentId.substring(d.parentId.lastIndexOf(",") + 1) : (r.form.parentId = "0", r.form.sort = i.length + 1), j.setOptionsData(c, "parentId", [{ _id: "0", title: "根", children: i }]);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
};
|
|
216
216
|
}
|
|
217
|
-
|
|
218
|
-
__name: "column",
|
|
219
|
-
props: {
|
|
220
|
-
/**
|
|
221
|
-
* 配置
|
|
222
|
-
*/
|
|
223
|
-
option: {
|
|
224
|
-
default: {}
|
|
225
|
-
}
|
|
226
|
-
},
|
|
227
|
-
setup(p, { expose: i }) {
|
|
228
|
-
const r = O.isFun, n = O.EDialog, c = j(), m = p, s = X({
|
|
229
|
-
rules: {},
|
|
230
|
-
show: !1,
|
|
231
|
-
showContent: !1,
|
|
232
|
-
loading: !1,
|
|
233
|
-
type: n.Insert,
|
|
234
|
-
form: {},
|
|
235
|
-
formDefault: {},
|
|
236
|
-
formColumn: [],
|
|
237
|
-
getDisabled: (e) => e.disabled?.[s.type === n.Insert ? "create" : "update"],
|
|
238
|
-
initColumnForm: () => {
|
|
239
|
-
const e = m.option;
|
|
240
|
-
s.formColumn = [];
|
|
241
|
-
const a = [], o = m.option.form?.maxSpan || 12, u = m.option.form?.defaultSpan || o;
|
|
242
|
-
let t = [];
|
|
243
|
-
const l = (b) => {
|
|
244
|
-
if (s.formDefault[b.key] = b.value, b.isForm) {
|
|
245
|
-
b.form = b.form || { span: u }, b.form.span = b.form.span ?? u;
|
|
246
|
-
let x = b.form.span, y = t.reduce((z, T) => z + T.span, x);
|
|
247
|
-
const E = t.length;
|
|
248
|
-
t.push({ item: b, span: x }), (E === 1 && t[0].span === 0 || y >= o || x === 0 && E > 1) && (a.push(t), t = []), b.rules && (s.rules[b.key] = b.rules);
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
e.column.forEach((b) => {
|
|
252
|
-
b.isForm = !0, l(b);
|
|
253
|
-
}), t.length > 0 && a.push(t), s.formColumn = a;
|
|
254
|
-
}
|
|
255
|
-
});
|
|
256
|
-
return s.initColumnForm(), i({
|
|
257
|
-
ref: c,
|
|
258
|
-
conf: s
|
|
259
|
-
}), (e, a) => {
|
|
260
|
-
const o = W("FormList");
|
|
261
|
-
return f(), g(d(K), {
|
|
262
|
-
ref_key: "ruleFormRef",
|
|
263
|
-
ref: c,
|
|
264
|
-
model: s.form,
|
|
265
|
-
rules: s.rules
|
|
266
|
-
}, {
|
|
267
|
-
default: h(() => [
|
|
268
|
-
s.showContent ? (f(!0), w($, { key: 0 }, F(s.formColumn, (u) => (f(), w("div", me, [
|
|
269
|
-
k(e.$slots, "form-start", {
|
|
270
|
-
row: s.form
|
|
271
|
-
}),
|
|
272
|
-
(f(!0), w($, null, F(u, (t) => (f(), w($, null, [
|
|
273
|
-
d(r)(t.item.show?.form, s.form) ? (f(), w("div", {
|
|
274
|
-
key: 0,
|
|
275
|
-
class: Q(t.item.form.span > 0 ? `col-${t.item.form.span}` : "col")
|
|
276
|
-
}, [
|
|
277
|
-
v(d(_), {
|
|
278
|
-
label: t.item.label,
|
|
279
|
-
prop: t.item.key,
|
|
280
|
-
"label-width": t.item.form?.labelWidth || "100px"
|
|
281
|
-
}, {
|
|
282
|
-
default: h(() => [
|
|
283
|
-
k(e.$slots, "form-" + t.item.key + "-start", {
|
|
284
|
-
row: s.form,
|
|
285
|
-
item: t.item
|
|
286
|
-
}),
|
|
287
|
-
k(e.$slots, "form-" + t.item.key, {
|
|
288
|
-
row: s.form,
|
|
289
|
-
item: t.item
|
|
290
|
-
}, () => [
|
|
291
|
-
t.item.type === "input" ? (f(), g(d(H), D({
|
|
292
|
-
key: 0,
|
|
293
|
-
modelValue: s.form[t.item.key],
|
|
294
|
-
"onUpdate:modelValue": (l) => s.form[t.item.key] = l
|
|
295
|
-
}, { ref_for: !0 }, t.item.options?.input, A(t.item.options?.input?.on), {
|
|
296
|
-
disabled: s.getDisabled(t.item)
|
|
297
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : t.item.type === "switch" ? (f(), g(d(G), D({
|
|
298
|
-
key: 1,
|
|
299
|
-
modelValue: s.form[t.item.key],
|
|
300
|
-
"onUpdate:modelValue": (l) => s.form[t.item.key] = l
|
|
301
|
-
}, { ref_for: !0 }, t.item.options?.switch, {
|
|
302
|
-
disabled: s.getDisabled(t.item)
|
|
303
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : t.item.type === "select" ? (f(), g(d(M), D({
|
|
304
|
-
key: 2,
|
|
305
|
-
modelValue: s.form[t.item.key],
|
|
306
|
-
"onUpdate:modelValue": (l) => s.form[t.item.key] = l
|
|
307
|
-
}, { ref_for: !0 }, t.item.options?.select, {
|
|
308
|
-
disabled: s.getDisabled(t.item),
|
|
309
|
-
style: { width: "100%" }
|
|
310
|
-
}), {
|
|
311
|
-
default: h(() => [
|
|
312
|
-
(f(!0), w($, null, F(t.item.options?.select?.data, (l) => (f(), g(d(R), {
|
|
313
|
-
key: l.value,
|
|
314
|
-
label: l.label,
|
|
315
|
-
value: l.value
|
|
316
|
-
}, null, 8, ["label", "value"]))), 128))
|
|
317
|
-
]),
|
|
318
|
-
_: 2
|
|
319
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : t.item.type === "list" ? (f(), g(o, D({
|
|
320
|
-
key: 3,
|
|
321
|
-
row: s.form,
|
|
322
|
-
field: t.item.key
|
|
323
|
-
}, { ref_for: !0 }, t.item.options?.list, {
|
|
324
|
-
disabled: s.getDisabled(t.item),
|
|
325
|
-
style: { width: "100%" }
|
|
326
|
-
}), null, 16, ["row", "field", "disabled"])) : t.item.type === "tree-select" ? (f(), g(d(te), D({
|
|
327
|
-
key: 4,
|
|
328
|
-
modelValue: s.form[t.item.key],
|
|
329
|
-
"onUpdate:modelValue": (l) => s.form[t.item.key] = l
|
|
330
|
-
}, { ref_for: !0 }, t.item.options?.treeSelect, {
|
|
331
|
-
disabled: s.getDisabled(t.item),
|
|
332
|
-
style: { width: "100%" }
|
|
333
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : t.item.type === "datetime" ? (f(), g(d(le), D({
|
|
334
|
-
key: 5,
|
|
335
|
-
modelValue: s.form[t.item.key],
|
|
336
|
-
"onUpdate:modelValue": (l) => s.form[t.item.key] = l
|
|
337
|
-
}, { ref_for: !0 }, t.item.options?.datetime, {
|
|
338
|
-
disabled: s.getDisabled(t.item)
|
|
339
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : d(L).customComponent[t.item.type] ? (f(), g(Z(d(L).customComponent[t.item.type]), D({
|
|
340
|
-
key: 6,
|
|
341
|
-
modelValue: s.form[t.item.key],
|
|
342
|
-
"onUpdate:modelValue": (l) => s.form[t.item.key] = l
|
|
343
|
-
}, { ref_for: !0 }, t.item.options?.[t.item.type], {
|
|
344
|
-
disabled: s.getDisabled(t.item)
|
|
345
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0)
|
|
346
|
-
]),
|
|
347
|
-
k(e.$slots, "form-" + t.item.key + "-end", {
|
|
348
|
-
row: s.form,
|
|
349
|
-
item: t.item
|
|
350
|
-
})
|
|
351
|
-
]),
|
|
352
|
-
_: 2
|
|
353
|
-
}, 1032, ["label", "prop", "label-width"])
|
|
354
|
-
], 2)) : C("", !0)
|
|
355
|
-
], 64))), 256)),
|
|
356
|
-
k(e.$slots, "form-end", {
|
|
357
|
-
row: s.form
|
|
358
|
-
})
|
|
359
|
-
]))), 256)) : C("", !0)
|
|
360
|
-
]),
|
|
361
|
-
_: 3
|
|
362
|
-
}, 8, ["model", "rules"]);
|
|
363
|
-
};
|
|
364
|
-
}
|
|
365
|
-
});
|
|
366
|
-
class I {
|
|
217
|
+
class L {
|
|
367
218
|
/**
|
|
368
219
|
* 获取id函数-可以直接覆盖
|
|
369
220
|
*/
|
|
@@ -373,12 +224,12 @@ class I {
|
|
|
373
224
|
* @param field 字段名
|
|
374
225
|
* @param row 行数据
|
|
375
226
|
*/
|
|
376
|
-
static setId = (
|
|
377
|
-
r[
|
|
378
|
-
|
|
227
|
+
static setId = (d, r, i) => {
|
|
228
|
+
r[d] || (r[d] = []), r[d].forEach((c) => {
|
|
229
|
+
i.forEach((m) => {
|
|
379
230
|
let s = m.default ?? "";
|
|
380
231
|
m.type === "number" && (s = m.default ?? 0), m.type === "boolean" && (s = m.default ?? !1), m.type === "time" && (s = m.default ?? /* @__PURE__ */ new Date()), c[m.value] === void 0 && (c[m.value] = s);
|
|
381
|
-
}), c._id || (c._id =
|
|
232
|
+
}), c._id || (c._id = L.getIdFun());
|
|
382
233
|
});
|
|
383
234
|
};
|
|
384
235
|
/**
|
|
@@ -388,15 +239,15 @@ class I {
|
|
|
388
239
|
* @param itemFields 元素字段-如:[{label:'',value:''}]
|
|
389
240
|
* @param callback 回调函数
|
|
390
241
|
*/
|
|
391
|
-
static add = (
|
|
392
|
-
const m = JSONUtil.cp(
|
|
393
|
-
|
|
242
|
+
static add = (d, r, i, c) => {
|
|
243
|
+
const m = JSONUtil.cp(i);
|
|
244
|
+
L.setId(d, r, i), r[d].push(
|
|
394
245
|
m.reduce(
|
|
395
246
|
(s, e) => {
|
|
396
|
-
let
|
|
397
|
-
return e.type === "number" && (
|
|
247
|
+
let n = e.default ?? "";
|
|
248
|
+
return e.type === "number" && (n = e.default ?? 0), e.type === "boolean" && (n = e.default ?? !1), e.type === "time" && (n = e.default ?? /* @__PURE__ */ new Date()), s[e.value] = n, s;
|
|
398
249
|
},
|
|
399
|
-
{ _id:
|
|
250
|
+
{ _id: L.getIdFun() }
|
|
400
251
|
)
|
|
401
252
|
), c?.(r);
|
|
402
253
|
};
|
|
@@ -407,8 +258,8 @@ class I {
|
|
|
407
258
|
* @param item 元素-如:{_id:''}
|
|
408
259
|
* @param callback 回调函数
|
|
409
260
|
*/
|
|
410
|
-
static remove = (
|
|
411
|
-
r[
|
|
261
|
+
static remove = (d, r, i, c) => {
|
|
262
|
+
r[d] = r[d].filter((m) => m._id !== i._id), c?.(r);
|
|
412
263
|
};
|
|
413
264
|
/**
|
|
414
265
|
* 获取没有id的数据
|
|
@@ -416,21 +267,21 @@ class I {
|
|
|
416
267
|
* @param childernField 子级字段-如:list、children
|
|
417
268
|
* @returns 没有id的数据
|
|
418
269
|
*/
|
|
419
|
-
static getNoIdData = (
|
|
420
|
-
const
|
|
421
|
-
return
|
|
422
|
-
c._id && delete c._id, r && c[r] &&
|
|
423
|
-
}),
|
|
270
|
+
static getNoIdData = (d, r) => {
|
|
271
|
+
const i = JSONUtil.cp(d);
|
|
272
|
+
return i.forEach((c) => {
|
|
273
|
+
c._id && delete c._id, r && c[r] && L.getNoIdData(c[r], r);
|
|
274
|
+
}), i;
|
|
424
275
|
};
|
|
425
276
|
}
|
|
426
|
-
const
|
|
277
|
+
const he = {
|
|
427
278
|
key: 0,
|
|
428
279
|
class: "column",
|
|
429
280
|
style: { width: "100%", gap: "10px" }
|
|
430
|
-
},
|
|
281
|
+
}, be = {
|
|
431
282
|
class: "row items-center",
|
|
432
283
|
style: { gap: "10px", width: "100%" }
|
|
433
|
-
},
|
|
284
|
+
}, Q = /* @__PURE__ */ P({
|
|
434
285
|
__name: "list",
|
|
435
286
|
props: {
|
|
436
287
|
row: {
|
|
@@ -465,33 +316,33 @@ const be = {
|
|
|
465
316
|
}
|
|
466
317
|
},
|
|
467
318
|
emits: ["change"],
|
|
468
|
-
setup(
|
|
469
|
-
const r =
|
|
319
|
+
setup(f, { emit: d }) {
|
|
320
|
+
const r = f, i = q({
|
|
470
321
|
show: !1,
|
|
471
322
|
add: (m, s, e) => {
|
|
472
|
-
|
|
323
|
+
L.add(m, s, e, () => {
|
|
473
324
|
c("change");
|
|
474
325
|
});
|
|
475
326
|
},
|
|
476
327
|
remove: (m, s, e) => {
|
|
477
|
-
|
|
328
|
+
L.remove(m, s, e, () => {
|
|
478
329
|
c("change");
|
|
479
330
|
});
|
|
480
331
|
}
|
|
481
332
|
});
|
|
482
333
|
ee(() => {
|
|
483
|
-
|
|
334
|
+
L.setId(r.field, r.row, r.itemFields), i.show = !0;
|
|
484
335
|
});
|
|
485
|
-
const c =
|
|
336
|
+
const c = d;
|
|
486
337
|
return (m, s) => {
|
|
487
|
-
const e =
|
|
488
|
-
return
|
|
489
|
-
k(m.$slots, "list-start", { row:
|
|
338
|
+
const e = Z("el-button"), n = Z("el-input");
|
|
339
|
+
return i.show ? (p(), w("div", he, [
|
|
340
|
+
k(m.$slots, "list-start", { row: f.row }),
|
|
490
341
|
U("div", null, [
|
|
491
342
|
v(e, {
|
|
492
343
|
link: "",
|
|
493
344
|
type: "primary",
|
|
494
|
-
onClick: s[0] || (s[0] = (
|
|
345
|
+
onClick: s[0] || (s[0] = (l) => i.add(f.field, f.row, f.itemFields))
|
|
495
346
|
}, {
|
|
496
347
|
default: h(() => [...s[2] || (s[2] = [
|
|
497
348
|
V("添加", -1)
|
|
@@ -499,27 +350,27 @@ const be = {
|
|
|
499
350
|
_: 1
|
|
500
351
|
})
|
|
501
352
|
]),
|
|
502
|
-
(
|
|
353
|
+
(p(!0), w($, null, I(f.row[f.field], (l) => (p(), w("div", be, [
|
|
503
354
|
k(m.$slots, "item-start", {
|
|
504
|
-
item:
|
|
505
|
-
row:
|
|
355
|
+
item: l,
|
|
356
|
+
row: f.row
|
|
506
357
|
}),
|
|
507
|
-
(
|
|
508
|
-
modelValue: o
|
|
509
|
-
"onUpdate:modelValue": (t) => o
|
|
510
|
-
style: se({ width:
|
|
511
|
-
class:
|
|
512
|
-
placeholder:
|
|
358
|
+
(p(!0), w($, null, I(f.itemFields, (o) => (p(), g(n, {
|
|
359
|
+
modelValue: l[o.value],
|
|
360
|
+
"onUpdate:modelValue": (t) => l[o.value] = t,
|
|
361
|
+
style: se({ width: f.inputWidth }),
|
|
362
|
+
class: X(f.inputClass),
|
|
363
|
+
placeholder: o[f.label] || o[f.value],
|
|
513
364
|
onChange: s[1] || (s[1] = (t) => c("change"))
|
|
514
365
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
|
|
515
366
|
k(m.$slots, "item-end", {
|
|
516
|
-
item:
|
|
517
|
-
row:
|
|
367
|
+
item: l,
|
|
368
|
+
row: f.row
|
|
518
369
|
}),
|
|
519
370
|
v(e, {
|
|
520
371
|
link: "",
|
|
521
372
|
type: "danger",
|
|
522
|
-
onClick: (
|
|
373
|
+
onClick: (o) => i.remove(f.field, f.row, l)
|
|
523
374
|
}, {
|
|
524
375
|
default: h(() => [...s[3] || (s[3] = [
|
|
525
376
|
V("删除", -1)
|
|
@@ -527,60 +378,211 @@ const be = {
|
|
|
527
378
|
_: 1
|
|
528
379
|
}, 8, ["onClick"])
|
|
529
380
|
]))), 256)),
|
|
530
|
-
k(m.$slots, "list-end", { row:
|
|
381
|
+
k(m.$slots, "list-end", { row: f.row })
|
|
531
382
|
])) : C("", !0);
|
|
532
383
|
};
|
|
533
384
|
}
|
|
385
|
+
}), ye = { class: "row curd-row" }, ge = /* @__PURE__ */ P({
|
|
386
|
+
__name: "column",
|
|
387
|
+
props: {
|
|
388
|
+
/**
|
|
389
|
+
* 配置
|
|
390
|
+
*/
|
|
391
|
+
option: {
|
|
392
|
+
default: {}
|
|
393
|
+
},
|
|
394
|
+
/**
|
|
395
|
+
* 类型
|
|
396
|
+
*/
|
|
397
|
+
type: {
|
|
398
|
+
default: ""
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
setup(f, { expose: d }) {
|
|
402
|
+
const r = O.isFun, i = O.EDialog, c = T(), m = f, s = q({
|
|
403
|
+
rules: {},
|
|
404
|
+
show: !0,
|
|
405
|
+
form: {},
|
|
406
|
+
formDefault: {},
|
|
407
|
+
formColumn: [],
|
|
408
|
+
getDisabled: (e) => e.disabled?.[(m.type || i.Insert) === i.Insert ? "create" : "update"],
|
|
409
|
+
initColumnForm: () => {
|
|
410
|
+
const e = m.option;
|
|
411
|
+
s.formColumn = [];
|
|
412
|
+
const n = [], l = m.option.form?.maxSpan || 12, o = m.option.form?.defaultSpan || l;
|
|
413
|
+
let t = [];
|
|
414
|
+
const a = (b) => {
|
|
415
|
+
if (s.formDefault[b.key] = b.value, b.isForm) {
|
|
416
|
+
b.form = b.form || { span: o }, b.form.span = b.form.span ?? o;
|
|
417
|
+
let x = b.form.span, y = t.reduce((z, R) => z + R.span, x);
|
|
418
|
+
const E = t.length;
|
|
419
|
+
t.push({ item: b, span: x }), (E === 1 && t[0].span === 0 || y >= l || x === 0 && E > 1) && (n.push(t), t = []), b.rules && (s.rules[b.key] = b.rules);
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
e.column.forEach((b) => {
|
|
423
|
+
b.isForm = !0, a(b);
|
|
424
|
+
}), t.length > 0 && n.push(t), s.formColumn = n;
|
|
425
|
+
},
|
|
426
|
+
init: async () => {
|
|
427
|
+
s.show = !1, await ne(), s.initColumnForm(), s.show = !0;
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
return s.initColumnForm(), d({
|
|
431
|
+
ref: c,
|
|
432
|
+
conf: s
|
|
433
|
+
}), (e, n) => (p(), g(u(J), {
|
|
434
|
+
ref_key: "ruleFormRef",
|
|
435
|
+
ref: c,
|
|
436
|
+
model: s.form,
|
|
437
|
+
rules: s.rules
|
|
438
|
+
}, {
|
|
439
|
+
default: h(() => [
|
|
440
|
+
s.show ? (p(!0), w($, { key: 0 }, I(s.formColumn, (l) => (p(), w("div", ye, [
|
|
441
|
+
k(e.$slots, "form-start", {
|
|
442
|
+
row: s.form
|
|
443
|
+
}),
|
|
444
|
+
(p(!0), w($, null, I(l, (o) => (p(), w($, null, [
|
|
445
|
+
u(r)(o.item.show?.form, s.form) ?? !0 ? (p(), w("div", {
|
|
446
|
+
key: 0,
|
|
447
|
+
class: X(o.item.form.span > 0 ? `col-${o.item.form.span}` : "col")
|
|
448
|
+
}, [
|
|
449
|
+
v(u(_), {
|
|
450
|
+
label: o.item.label,
|
|
451
|
+
prop: o.item.key,
|
|
452
|
+
"label-width": o.item.form?.labelWidth || "100px"
|
|
453
|
+
}, {
|
|
454
|
+
default: h(() => [
|
|
455
|
+
k(e.$slots, "form-" + o.item.key + "-start", {
|
|
456
|
+
row: s.form,
|
|
457
|
+
item: o.item
|
|
458
|
+
}),
|
|
459
|
+
k(e.$slots, "form-" + o.item.key, {
|
|
460
|
+
row: s.form,
|
|
461
|
+
item: o.item
|
|
462
|
+
}, () => [
|
|
463
|
+
o.item.type === "input" ? (p(), g(u(K), D({
|
|
464
|
+
key: 0,
|
|
465
|
+
modelValue: s.form[o.item.key],
|
|
466
|
+
"onUpdate:modelValue": (t) => s.form[o.item.key] = t
|
|
467
|
+
}, { ref_for: !0 }, o.item.options?.input, F(o.item.options?.input?.on), {
|
|
468
|
+
disabled: s.getDisabled(o.item)
|
|
469
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.item.type === "switch" ? (p(), g(u(H), D({
|
|
470
|
+
key: 1,
|
|
471
|
+
modelValue: s.form[o.item.key],
|
|
472
|
+
"onUpdate:modelValue": (t) => s.form[o.item.key] = t
|
|
473
|
+
}, { ref_for: !0 }, o.item.options?.switch, F(o.item.options?.switch?.on || {}), {
|
|
474
|
+
disabled: s.getDisabled(o.item)
|
|
475
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.item.type === "select" ? (p(), g(u(N), D({
|
|
476
|
+
key: 2,
|
|
477
|
+
modelValue: s.form[o.item.key],
|
|
478
|
+
"onUpdate:modelValue": (t) => s.form[o.item.key] = t
|
|
479
|
+
}, { ref_for: !0 }, o.item.options?.select, F(o.item.options?.select?.on || {}), {
|
|
480
|
+
disabled: s.getDisabled(o.item),
|
|
481
|
+
style: { width: "100%" }
|
|
482
|
+
}), {
|
|
483
|
+
default: h(() => [
|
|
484
|
+
(p(!0), w($, null, I(o.item.options?.select?.data, (t) => (p(), g(u(M), {
|
|
485
|
+
key: t.value,
|
|
486
|
+
label: t.label,
|
|
487
|
+
value: t.value
|
|
488
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
489
|
+
]),
|
|
490
|
+
_: 2
|
|
491
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.item.type === "list" ? (p(), g(Q, D({
|
|
492
|
+
key: 3,
|
|
493
|
+
row: s.form,
|
|
494
|
+
field: o.item.key
|
|
495
|
+
}, { ref_for: !0 }, o.item.options?.list, F(o.item.options?.list?.on || {}), {
|
|
496
|
+
disabled: s.getDisabled(o.item),
|
|
497
|
+
style: { width: "100%" }
|
|
498
|
+
}), null, 16, ["row", "field", "disabled"])) : o.item.type === "tree-select" ? (p(), g(u(oe), D({
|
|
499
|
+
key: 4,
|
|
500
|
+
modelValue: s.form[o.item.key],
|
|
501
|
+
"onUpdate:modelValue": (t) => s.form[o.item.key] = t
|
|
502
|
+
}, { ref_for: !0 }, o.item.options?.treeSelect, F(o.item.options?.treeSelect?.on || {}), {
|
|
503
|
+
disabled: s.getDisabled(o.item),
|
|
504
|
+
style: { width: "100%" }
|
|
505
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.item.type === "datetime" ? (p(), g(u(le), D({
|
|
506
|
+
key: 5,
|
|
507
|
+
modelValue: s.form[o.item.key],
|
|
508
|
+
"onUpdate:modelValue": (t) => s.form[o.item.key] = t
|
|
509
|
+
}, { ref_for: !0 }, o.item.options?.datetime, F(o.item.options?.datetime?.on || {}), {
|
|
510
|
+
disabled: s.getDisabled(o.item)
|
|
511
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u(j).customComponent[o.item.type] ? (p(), g(te(u(j).customComponent[o.item.type]), D({
|
|
512
|
+
key: 6,
|
|
513
|
+
modelValue: s.form[o.item.key],
|
|
514
|
+
"onUpdate:modelValue": (t) => s.form[o.item.key] = t
|
|
515
|
+
}, { ref_for: !0 }, o.item.options?.[o.item.type], F(o.item.options?.[o.item.type]?.on || {}), {
|
|
516
|
+
disabled: s.getDisabled(o.item)
|
|
517
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0)
|
|
518
|
+
]),
|
|
519
|
+
k(e.$slots, "form-" + o.item.key + "-end", {
|
|
520
|
+
row: s.form,
|
|
521
|
+
item: o.item
|
|
522
|
+
})
|
|
523
|
+
]),
|
|
524
|
+
_: 2
|
|
525
|
+
}, 1032, ["label", "prop", "label-width"])
|
|
526
|
+
], 2)) : C("", !0)
|
|
527
|
+
], 64))), 256)),
|
|
528
|
+
k(e.$slots, "form-end", {
|
|
529
|
+
row: s.form
|
|
530
|
+
})
|
|
531
|
+
]))), 256)) : C("", !0)
|
|
532
|
+
]),
|
|
533
|
+
_: 3
|
|
534
|
+
}, 8, ["model", "rules"]));
|
|
535
|
+
}
|
|
534
536
|
});
|
|
535
|
-
class
|
|
537
|
+
class we {
|
|
536
538
|
/**
|
|
537
539
|
* 导出Excel
|
|
538
540
|
* @param data 数据
|
|
539
541
|
* @param columns 列
|
|
540
542
|
* @param fileName 文件名
|
|
541
543
|
*/
|
|
542
|
-
static exportToExcel = async (
|
|
543
|
-
const c = await O.loadModule("xlsx"), m =
|
|
544
|
-
const
|
|
545
|
-
return r.forEach((
|
|
546
|
-
o
|
|
547
|
-
}),
|
|
544
|
+
static exportToExcel = async (d, r, i) => {
|
|
545
|
+
const c = await O.loadModule("xlsx"), m = d.map((n) => {
|
|
546
|
+
const l = {};
|
|
547
|
+
return r.forEach((o) => {
|
|
548
|
+
l[o.label] = n[o.key];
|
|
549
|
+
}), l;
|
|
548
550
|
}), s = c.utils.json_to_sheet(m), e = c.utils.book_new();
|
|
549
|
-
c.utils.book_append_sheet(e, s, "Sheet1"),
|
|
551
|
+
c.utils.book_append_sheet(e, s, "Sheet1"), i ? typeof i == "function" && (i = i()) : i = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, c.writeFile(e, `${i}.xlsx`);
|
|
550
552
|
};
|
|
551
553
|
}
|
|
552
|
-
const
|
|
554
|
+
const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ P({
|
|
553
555
|
__name: "switchConfirm",
|
|
554
|
-
setup(
|
|
555
|
-
const r =
|
|
556
|
+
setup(f, { expose: d }) {
|
|
557
|
+
const r = T(!1), i = T("确认修改"), c = T("确认要修改状态吗?");
|
|
556
558
|
let m = null, s = null;
|
|
557
|
-
const e = (
|
|
558
|
-
m = t, s =
|
|
559
|
-
})),
|
|
559
|
+
const e = (o) => (o?.title && (i.value = o.title), o?.content && (c.value = o.content), r.value = !0, new Promise((t, a) => {
|
|
560
|
+
m = t, s = a;
|
|
561
|
+
})), n = () => {
|
|
560
562
|
r.value = !1, m?.(!0), m = null, s = null;
|
|
561
|
-
},
|
|
563
|
+
}, l = () => {
|
|
562
564
|
r.value = !1, s?.(new Error("用户取消操作")), m = null, s = null;
|
|
563
565
|
};
|
|
564
|
-
return
|
|
566
|
+
return d({
|
|
565
567
|
open: e
|
|
566
|
-
}), (
|
|
568
|
+
}), (o, t) => (p(), g(u(G), {
|
|
567
569
|
modelValue: r.value,
|
|
568
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
569
|
-
title:
|
|
570
|
+
"onUpdate:modelValue": t[0] || (t[0] = (a) => r.value = a),
|
|
571
|
+
title: i.value,
|
|
570
572
|
"close-on-click-modal": !1,
|
|
571
573
|
width: "400px"
|
|
572
574
|
}, {
|
|
573
575
|
footer: h(() => [
|
|
574
|
-
U("span",
|
|
575
|
-
v(
|
|
576
|
+
U("span", ke, [
|
|
577
|
+
v(u(S), { onClick: l }, {
|
|
576
578
|
default: h(() => [...t[1] || (t[1] = [
|
|
577
579
|
V("取消", -1)
|
|
578
580
|
])]),
|
|
579
581
|
_: 1
|
|
580
582
|
}),
|
|
581
|
-
v(
|
|
583
|
+
v(u(S), {
|
|
582
584
|
type: "primary",
|
|
583
|
-
onClick:
|
|
585
|
+
onClick: n
|
|
584
586
|
}, {
|
|
585
587
|
default: h(() => [...t[2] || (t[2] = [
|
|
586
588
|
V("确认", -1)
|
|
@@ -590,27 +592,27 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
590
592
|
])
|
|
591
593
|
]),
|
|
592
594
|
default: h(() => [
|
|
593
|
-
U("div", null,
|
|
595
|
+
U("div", null, A(c.value), 1)
|
|
594
596
|
]),
|
|
595
597
|
_: 1
|
|
596
598
|
}, 8, ["modelValue", "title"]));
|
|
597
599
|
}
|
|
598
|
-
}),
|
|
600
|
+
}), Ce = { class: "col relative cc1-form-box" }, Ve = {
|
|
599
601
|
class: "absolute row fit",
|
|
600
602
|
style: { overflow: "hidden" }
|
|
601
|
-
},
|
|
603
|
+
}, De = { class: "col column" }, Ee = {
|
|
602
604
|
key: 0,
|
|
603
605
|
class: "relative curd-search"
|
|
604
|
-
},
|
|
606
|
+
}, Ue = { class: "mb-20 flex justify-between items-center" }, xe = {
|
|
605
607
|
class: "flex items-center",
|
|
606
608
|
style: { gap: "10px" }
|
|
607
|
-
},
|
|
609
|
+
}, $e = { key: 0 }, Oe = { key: 1 }, Se = { key: 2 }, Fe = { class: "export-btn" }, Ie = {
|
|
608
610
|
class: "flex items-center",
|
|
609
611
|
style: { gap: "10px" }
|
|
610
|
-
},
|
|
612
|
+
}, Le = { class: "col fit-width relative" }, je = { class: "absolute column fit" }, Te = { class: "row justify-end mt-20 mb-20" }, ze = { class: "row curd-row" }, Re = {
|
|
611
613
|
class: "row form-item-content",
|
|
612
614
|
style: { width: "100%" }
|
|
613
|
-
},
|
|
615
|
+
}, Me = { class: "col" }, _e = { class: "dialog-footer" }, Ne = { class: "dialog-footer" }, Pe = /* @__PURE__ */ P({
|
|
614
616
|
__name: "index",
|
|
615
617
|
props: {
|
|
616
618
|
/**
|
|
@@ -620,8 +622,8 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
620
622
|
default: {}
|
|
621
623
|
}
|
|
622
624
|
},
|
|
623
|
-
setup(
|
|
624
|
-
const r = O.EDialog,
|
|
625
|
+
setup(f, { expose: d }) {
|
|
626
|
+
const r = O.EDialog, i = f, c = T(), m = T(), s = O.isFun, e = q({
|
|
625
627
|
search: {
|
|
626
628
|
column: {
|
|
627
629
|
list: []
|
|
@@ -629,29 +631,29 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
629
631
|
form: {},
|
|
630
632
|
formDefault: {},
|
|
631
633
|
getFormData: () => {
|
|
632
|
-
let
|
|
633
|
-
|
|
634
|
-
(typeof
|
|
634
|
+
let n = {};
|
|
635
|
+
i.option.column.forEach((o) => {
|
|
636
|
+
(typeof o.show?.search == "function" ? o.show?.search(e.search.form) : o.show?.search) && (n[o.key] = e.search.form[o.key]);
|
|
635
637
|
});
|
|
636
|
-
const
|
|
637
|
-
return
|
|
638
|
+
const l = i.option.search?.before?.(n);
|
|
639
|
+
return l && (n = l), n;
|
|
638
640
|
},
|
|
639
641
|
reset: () => {
|
|
640
|
-
const
|
|
641
|
-
Object.keys(
|
|
642
|
-
|
|
643
|
-
}), e.search.form = JSONUtil.cp(
|
|
642
|
+
const n = e.search.formDefault;
|
|
643
|
+
Object.keys(n).forEach((l) => {
|
|
644
|
+
i.option.search?.resetMode === "default" ? n[l] = e.search.formDefault[l] : n[l] = void 0;
|
|
645
|
+
}), e.search.form = JSONUtil.cp(n), e.page.num = 1, e.table.getList();
|
|
644
646
|
},
|
|
645
647
|
submit: () => {
|
|
646
648
|
e.page.num = 1, e.table.getList();
|
|
647
649
|
}
|
|
648
650
|
},
|
|
649
651
|
page: {
|
|
650
|
-
size:
|
|
651
|
-
sizeList:
|
|
652
|
+
size: i.option.page?.size || 10,
|
|
653
|
+
sizeList: i.option.page?.sizeList || [10, 20, 50, 100],
|
|
652
654
|
num: 1,
|
|
653
655
|
total: 0,
|
|
654
|
-
layout:
|
|
656
|
+
layout: i.option.page?.layout || "total, sizes, prev, pager, next, jumper"
|
|
655
657
|
},
|
|
656
658
|
table: {
|
|
657
659
|
loading: !1,
|
|
@@ -659,19 +661,19 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
659
661
|
expand: {
|
|
660
662
|
isExpand: !1,
|
|
661
663
|
rowKeys: [],
|
|
662
|
-
change: (
|
|
664
|
+
change: (n, l) => {
|
|
663
665
|
},
|
|
664
666
|
all: () => {
|
|
665
667
|
if (e.table.expand.isExpand)
|
|
666
668
|
e.table.expand.rowKeys = [];
|
|
667
669
|
else {
|
|
668
|
-
const
|
|
669
|
-
let
|
|
670
|
-
return
|
|
671
|
-
|
|
672
|
-
}),
|
|
670
|
+
const n = (l) => {
|
|
671
|
+
let o = [];
|
|
672
|
+
return l.forEach((t) => {
|
|
673
|
+
o.push(t._id), t.children && t.children.length > 0 && (o = o.concat(n(t.children)));
|
|
674
|
+
}), o;
|
|
673
675
|
};
|
|
674
|
-
e.table.expand.rowKeys =
|
|
676
|
+
e.table.expand.rowKeys = n(e.table.data);
|
|
675
677
|
}
|
|
676
678
|
e.table.expand.isExpand = !e.table.expand.isExpand;
|
|
677
679
|
}
|
|
@@ -697,31 +699,31 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
697
699
|
},
|
|
698
700
|
getList: async () => {
|
|
699
701
|
e.table.loading = !0;
|
|
700
|
-
const
|
|
702
|
+
const n = i.option.api.list, l = await n({
|
|
701
703
|
size: e.page.size,
|
|
702
704
|
num: e.page.num,
|
|
703
705
|
...e.search.getFormData(),
|
|
704
|
-
final(
|
|
706
|
+
final(a, b, x) {
|
|
705
707
|
e.table.loading = !1;
|
|
706
708
|
}
|
|
707
|
-
}),
|
|
708
|
-
let t = Array.isArray(
|
|
709
|
-
e.table.data =
|
|
709
|
+
}), o = l.data || { list: l };
|
|
710
|
+
let t = Array.isArray(o.list) ? o.list : o;
|
|
711
|
+
e.table.data = i.option.data ? await i.option.data(t) : t, e.page.total = o.total || 0;
|
|
710
712
|
},
|
|
711
713
|
selection: {
|
|
712
714
|
list: [],
|
|
713
|
-
change: (
|
|
714
|
-
e.table.selection.list =
|
|
715
|
+
change: (n) => {
|
|
716
|
+
e.table.selection.list = n;
|
|
715
717
|
}
|
|
716
718
|
},
|
|
717
719
|
exportFun: {
|
|
718
|
-
start: async (
|
|
719
|
-
let
|
|
720
|
+
start: async (n) => {
|
|
721
|
+
let l = await e.table.exportFun[n](), o = i.option.column;
|
|
720
722
|
const t = JSONUtil.cp({
|
|
721
|
-
data:
|
|
722
|
-
columns:
|
|
723
|
-
}),
|
|
724
|
-
|
|
723
|
+
data: l,
|
|
724
|
+
columns: o
|
|
725
|
+
}), a = i.option.tools?.export || {};
|
|
726
|
+
a.before && a.before(t), we.exportToExcel(t.data, t.columns, a.fileName);
|
|
725
727
|
},
|
|
726
728
|
select: () => {
|
|
727
729
|
if (e.table.selection.list.length === 0)
|
|
@@ -735,18 +737,18 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
735
737
|
},
|
|
736
738
|
all: async () => {
|
|
737
739
|
e.table.loading = !0;
|
|
738
|
-
const
|
|
740
|
+
const n = i.option.api.list, { data: l } = await n({
|
|
739
741
|
size: 999999,
|
|
740
742
|
num: 1,
|
|
741
|
-
final(
|
|
743
|
+
final(o, t, a) {
|
|
742
744
|
e.table.loading = !1;
|
|
743
745
|
}
|
|
744
746
|
});
|
|
745
|
-
return
|
|
747
|
+
return l.list;
|
|
746
748
|
}
|
|
747
749
|
},
|
|
748
|
-
export: (
|
|
749
|
-
e.table.exportFun.start(
|
|
750
|
+
export: (n) => {
|
|
751
|
+
e.table.exportFun.start(n);
|
|
750
752
|
}
|
|
751
753
|
},
|
|
752
754
|
update: {
|
|
@@ -759,7 +761,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
759
761
|
form: {},
|
|
760
762
|
formDefault: {},
|
|
761
763
|
formColumn: [],
|
|
762
|
-
getDisabled: (
|
|
764
|
+
getDisabled: (n) => n.disabled?.[e.update.type === r.Insert ? "create" : "update"],
|
|
763
765
|
edit: {
|
|
764
766
|
/**
|
|
765
767
|
* 编辑原数据
|
|
@@ -768,42 +770,42 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
768
770
|
/**
|
|
769
771
|
* 将form填入数据和data比对差异数据返回
|
|
770
772
|
*/
|
|
771
|
-
getApiData: (
|
|
772
|
-
if (
|
|
773
|
-
return
|
|
774
|
-
let
|
|
773
|
+
getApiData: (n) => {
|
|
774
|
+
if (i.option.form?.editAll)
|
|
775
|
+
return n;
|
|
776
|
+
let l = {
|
|
775
777
|
_id: e.update.edit.data._id
|
|
776
778
|
};
|
|
777
|
-
return Object.keys(e.update.edit.data).forEach((
|
|
778
|
-
|
|
779
|
-
}),
|
|
779
|
+
return Object.keys(e.update.edit.data).forEach((o) => {
|
|
780
|
+
n[o] !== e.update.edit.data[o] && (l[o] = n[o]);
|
|
781
|
+
}), l;
|
|
780
782
|
}
|
|
781
783
|
},
|
|
782
|
-
open: (
|
|
784
|
+
open: (n, l) => {
|
|
783
785
|
e.update.showContent || FunUtil.throttle(async () => {
|
|
784
|
-
e.update.type =
|
|
785
|
-
const
|
|
786
|
-
e.update.edit.data =
|
|
786
|
+
e.update.type = n;
|
|
787
|
+
const o = n === r.Insert;
|
|
788
|
+
e.update.edit.data = l, e.update.title = o ? "新增" : "编辑", e.update.form = JSONUtil.cp(o ? e.update.formDefault : l), await i.option.form?.openBefore?.(l, e.update), e.update.show = !0, e.update.showContent = !0, i.option.form?.openAfter?.(l, e.update);
|
|
787
789
|
});
|
|
788
790
|
},
|
|
789
791
|
submit: () => {
|
|
790
792
|
FunUtil.throttle(async () => {
|
|
791
|
-
await m.value?.validate(async (
|
|
792
|
-
|
|
793
|
+
await m.value?.validate(async (o, t) => new Promise((a, b) => {
|
|
794
|
+
o || (O.fail("请检查表单数据"), b(!1)), a();
|
|
793
795
|
})), e.update.loading = !0;
|
|
794
|
-
const
|
|
795
|
-
let
|
|
796
|
-
delete
|
|
797
|
-
if (typeof o
|
|
798
|
-
const t = new Date(o
|
|
799
|
-
!isNaN(t) && t > (/* @__PURE__ */ new Date("1971-01-01")).getTime() && (o
|
|
796
|
+
const n = e.update.type === r.Insert ? i.option.api.create : i.option.api.update;
|
|
797
|
+
let l = JSONUtil.cp(e.update.form);
|
|
798
|
+
delete l.children, await i.option.form?.submitBefore?.(l, e.update), Object.keys(l).forEach((o) => {
|
|
799
|
+
if (typeof l[o] == "string" && l[o].indexOf("T") > -1) {
|
|
800
|
+
const t = new Date(l[o]).getTime();
|
|
801
|
+
!isNaN(t) && t > (/* @__PURE__ */ new Date("1971-01-01")).getTime() && (l[o] = t);
|
|
800
802
|
}
|
|
801
|
-
}), await
|
|
802
|
-
...
|
|
803
|
-
final(
|
|
803
|
+
}), await n({
|
|
804
|
+
...l,
|
|
805
|
+
final(o, t, a) {
|
|
804
806
|
e.update.loading = !1;
|
|
805
807
|
}
|
|
806
|
-
}), e.update.close(), await e.table.getList(),
|
|
808
|
+
}), e.update.close(), await e.table.getList(), i.option.form?.submitAfter?.(l, e.update);
|
|
807
809
|
});
|
|
808
810
|
},
|
|
809
811
|
close: () => {
|
|
@@ -820,20 +822,20 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
820
822
|
close: () => {
|
|
821
823
|
e.remove.show = !1;
|
|
822
824
|
},
|
|
823
|
-
open: (
|
|
824
|
-
if (
|
|
825
|
+
open: (n) => {
|
|
826
|
+
if (n.length === 0) {
|
|
825
827
|
O.fail("请选择要删除的数据");
|
|
826
828
|
return;
|
|
827
829
|
}
|
|
828
|
-
e.remove.items =
|
|
830
|
+
e.remove.items = n, e.remove.show = !0;
|
|
829
831
|
},
|
|
830
832
|
submit: () => {
|
|
831
833
|
FunUtil.throttle(async () => {
|
|
832
834
|
e.table.loading = !0;
|
|
833
|
-
const
|
|
834
|
-
await
|
|
835
|
-
_id: e.remove.items.map((
|
|
836
|
-
final(
|
|
835
|
+
const n = i.option.api.delete;
|
|
836
|
+
await n({
|
|
837
|
+
_id: e.remove.items.map((l) => l._id),
|
|
838
|
+
final(l, o, t) {
|
|
837
839
|
e.table.loading = !1;
|
|
838
840
|
}
|
|
839
841
|
}), O.success("操作成功"), e.table.data.length <= 1 && e.page.num > 1 && (e.page.num -= 1), e.remove.close(), await e.table.getList();
|
|
@@ -844,7 +846,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
844
846
|
e.initCurdConfig(), e.initColumnOptions(), e.initColumnForm();
|
|
845
847
|
},
|
|
846
848
|
initCurdConfig: () => {
|
|
847
|
-
const
|
|
849
|
+
const l = {
|
|
848
850
|
tools: {
|
|
849
851
|
search: !0,
|
|
850
852
|
reset: !0,
|
|
@@ -862,9 +864,9 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
862
864
|
emptyText: "暂无数据",
|
|
863
865
|
highlightCurrentRow: !0
|
|
864
866
|
}
|
|
865
|
-
},
|
|
866
|
-
Object.keys(
|
|
867
|
-
|
|
867
|
+
}, o = i.option;
|
|
868
|
+
Object.keys(l).forEach((t) => {
|
|
869
|
+
o[t] = ObjectUtil.deepMerge(l[t], o[t] || {});
|
|
868
870
|
});
|
|
869
871
|
},
|
|
870
872
|
/**
|
|
@@ -873,8 +875,8 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
873
875
|
* @returns
|
|
874
876
|
*/
|
|
875
877
|
initColumnOptions: () => {
|
|
876
|
-
const
|
|
877
|
-
const
|
|
878
|
+
const n = i.option, l = (o) => {
|
|
879
|
+
const a = {
|
|
878
880
|
options: {
|
|
879
881
|
switch: {
|
|
880
882
|
activeValue: !0,
|
|
@@ -882,15 +884,15 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
882
884
|
inactiveValue: !1,
|
|
883
885
|
inactiveLabel: "关闭",
|
|
884
886
|
tableBeforeChange: async (x, y) => {
|
|
885
|
-
const E =
|
|
887
|
+
const E = o.options?.switch;
|
|
886
888
|
try {
|
|
887
889
|
return await c.value?.open({
|
|
888
890
|
title: "确认修改",
|
|
889
891
|
content: `确认要${y[x] === E.activeValue ? E.inactiveLabel : E.activeLabel}吗?`
|
|
890
|
-
}), e.table.loading = !0, await
|
|
892
|
+
}), e.table.loading = !0, await i.option.api.update({
|
|
891
893
|
_id: y._id,
|
|
892
894
|
[x]: y[x] === E.activeValue ? E.inactiveValue : E.activeValue,
|
|
893
|
-
final(z,
|
|
895
|
+
final(z, R, Y) {
|
|
894
896
|
e.table.loading = !1;
|
|
895
897
|
}
|
|
896
898
|
}), O.success("操作成功"), e.table.getList(), !0;
|
|
@@ -928,113 +930,113 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
928
930
|
table: 0,
|
|
929
931
|
form: 0
|
|
930
932
|
}
|
|
931
|
-
}, b =
|
|
932
|
-
Object.keys(
|
|
933
|
-
b[x] = ObjectUtil.deepMerge(
|
|
933
|
+
}, b = o;
|
|
934
|
+
Object.keys(a).forEach((x) => {
|
|
935
|
+
b[x] = ObjectUtil.deepMerge(a[x], b[x] || {});
|
|
934
936
|
});
|
|
935
937
|
};
|
|
936
|
-
|
|
938
|
+
n.column.forEach(l), n.table?.column?.forEach(l);
|
|
937
939
|
},
|
|
938
940
|
initColumnForm: () => {
|
|
939
|
-
const
|
|
941
|
+
const n = i.option;
|
|
940
942
|
e.update.formColumn = [], e.table.column.show = {
|
|
941
943
|
list: [],
|
|
942
944
|
listSource: []
|
|
943
945
|
};
|
|
944
|
-
const
|
|
945
|
-
let
|
|
946
|
+
const l = [], o = i.option.form?.maxSpan || 12, t = i.option.form?.defaultSpan || o / 2;
|
|
947
|
+
let a = [];
|
|
946
948
|
const b = (y) => {
|
|
947
949
|
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) {
|
|
948
950
|
y.form = y.form || { span: t }, y.form.span = y.form.span ?? t;
|
|
949
|
-
let E = y.form.span, z =
|
|
950
|
-
const
|
|
951
|
-
|
|
951
|
+
let E = y.form.span, z = a.reduce((Y, ae) => Y + ae.span, E);
|
|
952
|
+
const R = a.length;
|
|
953
|
+
a.push({ item: y, span: E }), (R === 1 && a[0].span === 0 || z >= o || E === 0 && R > 1) && (l.push(a), a = []), y.rules && (e.update.rules[y.key] = y.rules);
|
|
952
954
|
}
|
|
953
955
|
};
|
|
954
|
-
|
|
956
|
+
n.column.forEach((y) => {
|
|
955
957
|
y.isForm = !0, b(y);
|
|
956
|
-
}),
|
|
958
|
+
}), i.option.table?.column?.forEach((y) => {
|
|
957
959
|
y.isForm = !1, b(y);
|
|
958
|
-
}), e.search.column.list =
|
|
959
|
-
const x =
|
|
960
|
+
}), e.search.column.list = n.column.concat(n.table?.column || []), e.table.column.list = e.search.column.list.filter((y) => y.table?.table), e.search.column.list.sort((y, E) => y.sort?.search - E.sort?.search), e.table.column.list.sort((y, E) => y.sort?.table - E.sort?.table), a.length > 0 && l.push(a), e.update.formColumn = l;
|
|
961
|
+
const x = i.option.search?.formDefault;
|
|
960
962
|
x && Object.keys(x).forEach((y) => {
|
|
961
963
|
e.search.formDefault[y] = x[y];
|
|
962
|
-
}),
|
|
964
|
+
}), n.column.forEach((y) => {
|
|
963
965
|
y.show?.search || (e.search.formDefault[y.key] = void 0);
|
|
964
966
|
}), e.search.form = JSONUtil.cp(e.search.formDefault);
|
|
965
967
|
}
|
|
966
968
|
});
|
|
967
969
|
return e.init(), ee(() => {
|
|
968
970
|
e.table.getList();
|
|
969
|
-
}),
|
|
971
|
+
}), d({
|
|
970
972
|
conf: e
|
|
971
|
-
}), (
|
|
972
|
-
const
|
|
973
|
-
return
|
|
974
|
-
U("div",
|
|
975
|
-
k(
|
|
976
|
-
U("div",
|
|
977
|
-
|
|
978
|
-
v(
|
|
973
|
+
}), (n, l) => {
|
|
974
|
+
const o = ie("loading");
|
|
975
|
+
return p(), w("div", Ce, [
|
|
976
|
+
U("div", Ve, [
|
|
977
|
+
k(n.$slots, "box-left"),
|
|
978
|
+
U("div", De, [
|
|
979
|
+
f.option.search?.show !== !1 ? (p(), w("div", Ee, [
|
|
980
|
+
v(u(J), {
|
|
979
981
|
model: e.search.form,
|
|
980
982
|
inline: ""
|
|
981
983
|
}, {
|
|
982
984
|
default: h(() => [
|
|
983
|
-
k(
|
|
985
|
+
k(n.$slots, "search-start", {
|
|
984
986
|
row: e.search.form
|
|
985
987
|
}),
|
|
986
|
-
(
|
|
988
|
+
(p(!0), w($, null, I(e.search.column.list, (t) => (p(), w($, {
|
|
987
989
|
key: t.key
|
|
988
990
|
}, [
|
|
989
|
-
(typeof t.show?.search == "function" ? t.show?.search(e.search.form) : t.show?.search) ? (
|
|
991
|
+
(typeof t.show?.search == "function" ? t.show?.search(e.search.form) : t.show?.search) ? (p(), g(u(_), {
|
|
990
992
|
key: 0,
|
|
991
993
|
label: t.label
|
|
992
994
|
}, {
|
|
993
995
|
default: h(() => [
|
|
994
|
-
k(
|
|
996
|
+
k(n.$slots, "search-" + t.key, {
|
|
995
997
|
row: e.search.form
|
|
996
998
|
}, () => [
|
|
997
|
-
t.type === "input" ? (
|
|
999
|
+
t.type === "input" ? (p(), g(u(K), {
|
|
998
1000
|
key: 0,
|
|
999
1001
|
modelValue: e.search.form[t.key],
|
|
1000
|
-
"onUpdate:modelValue": (
|
|
1002
|
+
"onUpdate:modelValue": (a) => e.search.form[t.key] = a,
|
|
1001
1003
|
placeholder: `请输入${t.label}`,
|
|
1002
1004
|
clearable: "",
|
|
1003
1005
|
disabled: t.disabled?.search
|
|
1004
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : t.type === "switch" ? (
|
|
1006
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : t.type === "switch" ? (p(), g(u(N), {
|
|
1005
1007
|
key: 1,
|
|
1006
1008
|
modelValue: e.search.form[t.key],
|
|
1007
|
-
"onUpdate:modelValue": (
|
|
1009
|
+
"onUpdate:modelValue": (a) => e.search.form[t.key] = a,
|
|
1008
1010
|
placeholder: `请选择${t.label}`,
|
|
1009
1011
|
clearable: "",
|
|
1010
1012
|
disabled: t.disabled?.search
|
|
1011
1013
|
}, {
|
|
1012
1014
|
default: h(() => [
|
|
1013
|
-
(
|
|
1015
|
+
(p(), g(u(M), {
|
|
1014
1016
|
key: t.options?.switch?.activeValue,
|
|
1015
1017
|
label: t.options?.switch?.activeLabel,
|
|
1016
1018
|
value: t.options?.switch?.activeValue
|
|
1017
1019
|
}, null, 8, ["label", "value"])),
|
|
1018
|
-
(
|
|
1020
|
+
(p(), g(u(M), {
|
|
1019
1021
|
key: t.options?.switch?.inactiveValue,
|
|
1020
1022
|
label: t.options?.switch?.inactiveLabel,
|
|
1021
1023
|
value: t.options?.switch?.inactiveValue
|
|
1022
1024
|
}, null, 8, ["label", "value"]))
|
|
1023
1025
|
]),
|
|
1024
1026
|
_: 2
|
|
1025
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : t.type === "select" ? (
|
|
1027
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : t.type === "select" ? (p(), g(u(N), {
|
|
1026
1028
|
key: 2,
|
|
1027
1029
|
modelValue: e.search.form[t.key],
|
|
1028
|
-
"onUpdate:modelValue": (
|
|
1030
|
+
"onUpdate:modelValue": (a) => e.search.form[t.key] = a,
|
|
1029
1031
|
placeholder: `请选择${t.label}`,
|
|
1030
1032
|
clearable: "",
|
|
1031
1033
|
disabled: t.disabled?.search
|
|
1032
1034
|
}, {
|
|
1033
1035
|
default: h(() => [
|
|
1034
|
-
(
|
|
1035
|
-
key:
|
|
1036
|
-
label:
|
|
1037
|
-
value:
|
|
1036
|
+
(p(!0), w($, null, I(t.options?.select?.data, (a) => (p(), g(u(M), {
|
|
1037
|
+
key: a.value,
|
|
1038
|
+
label: a.label,
|
|
1039
|
+
value: a.value
|
|
1038
1040
|
}, null, 8, ["label", "value"]))), 128))
|
|
1039
1041
|
]),
|
|
1040
1042
|
_: 2
|
|
@@ -1044,26 +1046,26 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
1044
1046
|
_: 2
|
|
1045
1047
|
}, 1032, ["label"])) : C("", !0)
|
|
1046
1048
|
], 64))), 128)),
|
|
1047
|
-
k(
|
|
1049
|
+
k(n.$slots, "search-center", {
|
|
1048
1050
|
row: e.search.form
|
|
1049
1051
|
}),
|
|
1050
|
-
v(
|
|
1052
|
+
v(u(_), null, {
|
|
1051
1053
|
default: h(() => [
|
|
1052
|
-
|
|
1054
|
+
f.option.tools?.search ? (p(), g(u(S), {
|
|
1053
1055
|
key: 0,
|
|
1054
1056
|
type: "primary",
|
|
1055
1057
|
onClick: e.search.submit
|
|
1056
1058
|
}, {
|
|
1057
|
-
default: h(() => [...
|
|
1059
|
+
default: h(() => [...l[7] || (l[7] = [
|
|
1058
1060
|
V(" 搜索 ", -1)
|
|
1059
1061
|
])]),
|
|
1060
1062
|
_: 1
|
|
1061
1063
|
}, 8, ["onClick"])) : C("", !0),
|
|
1062
|
-
|
|
1064
|
+
f.option.tools?.reset ? (p(), g(u(S), {
|
|
1063
1065
|
key: 1,
|
|
1064
1066
|
onClick: e.search.reset
|
|
1065
1067
|
}, {
|
|
1066
|
-
default: h(() => [...
|
|
1068
|
+
default: h(() => [...l[8] || (l[8] = [
|
|
1067
1069
|
V("重置", -1)
|
|
1068
1070
|
])]),
|
|
1069
1071
|
_: 1
|
|
@@ -1071,69 +1073,69 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
1071
1073
|
]),
|
|
1072
1074
|
_: 1
|
|
1073
1075
|
}),
|
|
1074
|
-
k(
|
|
1076
|
+
k(n.$slots, "search-end", {
|
|
1075
1077
|
row: e.search.form
|
|
1076
1078
|
})
|
|
1077
1079
|
]),
|
|
1078
1080
|
_: 3
|
|
1079
1081
|
}, 8, ["model"])
|
|
1080
1082
|
])) : C("", !0),
|
|
1081
|
-
U("div",
|
|
1082
|
-
U("div",
|
|
1083
|
-
|
|
1084
|
-
v(
|
|
1083
|
+
U("div", Ue, [
|
|
1084
|
+
U("div", xe, [
|
|
1085
|
+
u(s)(f.option.tools?.add) ? (p(), w("div", $e, [
|
|
1086
|
+
v(u(S), {
|
|
1085
1087
|
type: "primary",
|
|
1086
|
-
onClick:
|
|
1088
|
+
onClick: l[0] || (l[0] = (t) => e.update.open(u(r).Insert))
|
|
1087
1089
|
}, {
|
|
1088
|
-
default: h(() => [...
|
|
1090
|
+
default: h(() => [...l[9] || (l[9] = [
|
|
1089
1091
|
V("新增", -1)
|
|
1090
1092
|
])]),
|
|
1091
1093
|
_: 1
|
|
1092
1094
|
})
|
|
1093
1095
|
])) : C("", !0),
|
|
1094
|
-
|
|
1095
|
-
v(
|
|
1096
|
+
f.option.table?.selectable && u(s)(f.option.tools?.delete) ? (p(), w("div", Oe, [
|
|
1097
|
+
v(u(S), {
|
|
1096
1098
|
type: "danger",
|
|
1097
|
-
onClick:
|
|
1099
|
+
onClick: l[1] || (l[1] = (t) => e.remove.open(e.table.selection.list))
|
|
1098
1100
|
}, {
|
|
1099
|
-
default: h(() => [...
|
|
1101
|
+
default: h(() => [...l[10] || (l[10] = [
|
|
1100
1102
|
V(" 删除 ", -1)
|
|
1101
1103
|
])]),
|
|
1102
1104
|
_: 1
|
|
1103
1105
|
})
|
|
1104
1106
|
])) : C("", !0),
|
|
1105
|
-
|
|
1106
|
-
v(
|
|
1107
|
+
f.option.tools?.expand ? (p(), w("div", Se, [
|
|
1108
|
+
v(u(S), {
|
|
1107
1109
|
type: "warning",
|
|
1108
|
-
onClick:
|
|
1110
|
+
onClick: l[2] || (l[2] = (t) => e.table.expand.all())
|
|
1109
1111
|
}, {
|
|
1110
|
-
default: h(() => [...
|
|
1112
|
+
default: h(() => [...l[11] || (l[11] = [
|
|
1111
1113
|
V("展开/收缩", -1)
|
|
1112
1114
|
])]),
|
|
1113
1115
|
_: 1
|
|
1114
1116
|
})
|
|
1115
1117
|
])) : C("", !0),
|
|
1116
|
-
|
|
1118
|
+
f.option.tools?.export?.show ? (p(), g(u(pe), {
|
|
1117
1119
|
key: 3,
|
|
1118
1120
|
onCommand: e.table.export
|
|
1119
1121
|
}, {
|
|
1120
1122
|
dropdown: h(() => [
|
|
1121
|
-
v(
|
|
1123
|
+
v(u(fe), null, {
|
|
1122
1124
|
default: h(() => [
|
|
1123
|
-
v(
|
|
1124
|
-
default: h(() => [...
|
|
1125
|
+
v(u(B), { command: "select" }, {
|
|
1126
|
+
default: h(() => [...l[13] || (l[13] = [
|
|
1125
1127
|
V("导出选中", -1)
|
|
1126
1128
|
])]),
|
|
1127
1129
|
_: 1
|
|
1128
1130
|
}),
|
|
1129
|
-
v(
|
|
1130
|
-
default: h(() => [...
|
|
1131
|
+
v(u(B), { command: "page" }, {
|
|
1132
|
+
default: h(() => [...l[14] || (l[14] = [
|
|
1131
1133
|
V("导出本页", -1)
|
|
1132
1134
|
])]),
|
|
1133
1135
|
_: 1
|
|
1134
1136
|
}),
|
|
1135
|
-
v(
|
|
1136
|
-
default: h(() => [...
|
|
1137
|
+
v(u(B), { command: "all" }, {
|
|
1138
|
+
default: h(() => [...l[15] || (l[15] = [
|
|
1137
1139
|
V("导出全部", -1)
|
|
1138
1140
|
])]),
|
|
1139
1141
|
_: 1
|
|
@@ -1143,9 +1145,9 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
1143
1145
|
})
|
|
1144
1146
|
]),
|
|
1145
1147
|
default: h(() => [
|
|
1146
|
-
U("div",
|
|
1147
|
-
v(
|
|
1148
|
-
default: h(() => [...
|
|
1148
|
+
U("div", Fe, [
|
|
1149
|
+
v(u(S), { type: "warning" }, {
|
|
1150
|
+
default: h(() => [...l[12] || (l[12] = [
|
|
1149
1151
|
V("导出", -1)
|
|
1150
1152
|
])]),
|
|
1151
1153
|
_: 1
|
|
@@ -1154,55 +1156,55 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
1154
1156
|
]),
|
|
1155
1157
|
_: 1
|
|
1156
1158
|
}, 8, ["onCommand"])) : C("", !0),
|
|
1157
|
-
k(
|
|
1159
|
+
k(n.$slots, "tools-left")
|
|
1158
1160
|
]),
|
|
1159
|
-
U("div",
|
|
1160
|
-
k(
|
|
1161
|
+
U("div", Ie, [
|
|
1162
|
+
k(n.$slots, "tools-right")
|
|
1161
1163
|
])
|
|
1162
1164
|
]),
|
|
1163
|
-
U("div",
|
|
1164
|
-
U("div",
|
|
1165
|
-
re((
|
|
1165
|
+
U("div", Le, [
|
|
1166
|
+
U("div", je, [
|
|
1167
|
+
re((p(), g(u(ce), D({
|
|
1166
1168
|
data: e.table.data
|
|
1167
|
-
},
|
|
1169
|
+
}, f.option.table, {
|
|
1168
1170
|
onSelectionChange: e.table.selection.change,
|
|
1169
1171
|
"expand-row-keys": e.table.expand.rowKeys,
|
|
1170
1172
|
onExpandChange: e.table.expand.change
|
|
1171
1173
|
}), {
|
|
1172
1174
|
default: h(() => [
|
|
1173
|
-
|
|
1175
|
+
f.option.table?.selectable && u(s)(f.option.tools?.delete) ? (p(), g(u(W), {
|
|
1174
1176
|
key: 0,
|
|
1175
1177
|
type: "selection",
|
|
1176
|
-
selectable: typeof
|
|
1178
|
+
selectable: typeof f.option.table?.selectable == "function" ? f.option.table?.selectable : void 0,
|
|
1177
1179
|
width: "55"
|
|
1178
1180
|
}, null, 8, ["selectable"])) : C("", !0),
|
|
1179
|
-
(
|
|
1181
|
+
(p(!0), w($, null, I(e.table.column.list, (t) => (p(), w($, {
|
|
1180
1182
|
key: t.key
|
|
1181
1183
|
}, [
|
|
1182
|
-
e.table.column.show.list.includes(t.key) ? (
|
|
1184
|
+
e.table.column.show.list.includes(t.key) ? (p(), g(u(W), D({
|
|
1183
1185
|
key: 0,
|
|
1184
1186
|
prop: t.key,
|
|
1185
1187
|
label: t.label
|
|
1186
1188
|
}, { ref_for: !0 }, t.table), {
|
|
1187
|
-
default: h(({ row:
|
|
1188
|
-
k(
|
|
1189
|
-
row:
|
|
1189
|
+
default: h(({ row: a }) => [
|
|
1190
|
+
k(n.$slots, "table-" + t.key, {
|
|
1191
|
+
row: a,
|
|
1190
1192
|
item: t
|
|
1191
1193
|
}, () => [
|
|
1192
|
-
t.type === "switch" ? (
|
|
1194
|
+
t.type === "switch" ? (p(), g(u(H), D({
|
|
1193
1195
|
key: 0,
|
|
1194
|
-
modelValue:
|
|
1195
|
-
"onUpdate:modelValue": (b) =>
|
|
1196
|
-
"before-change": () => t.options?.switch?.tableBeforeChange?.(t.key,
|
|
1197
|
-
}, { ref_for: !0 }, t.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "before-change"])) : (
|
|
1198
|
-
V(
|
|
1196
|
+
modelValue: a[t.key],
|
|
1197
|
+
"onUpdate:modelValue": (b) => a[t.key] = b,
|
|
1198
|
+
"before-change": () => t.options?.switch?.tableBeforeChange?.(t.key, a)
|
|
1199
|
+
}, { ref_for: !0 }, t.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "before-change"])) : (p(), w($, { key: 1 }, [
|
|
1200
|
+
V(A(a[t.key]), 1)
|
|
1199
1201
|
], 64))
|
|
1200
1202
|
])
|
|
1201
1203
|
]),
|
|
1202
1204
|
_: 2
|
|
1203
1205
|
}, 1040, ["prop", "label"])) : C("", !0)
|
|
1204
1206
|
], 64))), 128)),
|
|
1205
|
-
|
|
1207
|
+
u(s)(f.option.tools?.add) || u(s)(f.option.tools?.update) || u(s)(f.option.tools?.delete) || n.$slots["table-op-left"] || n.$slots["table-op-right"] ? (p(), g(u(W), {
|
|
1206
1208
|
key: 1,
|
|
1207
1209
|
label: "操作",
|
|
1208
1210
|
width: "180",
|
|
@@ -1210,58 +1212,58 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
1210
1212
|
fixed: "right"
|
|
1211
1213
|
}, {
|
|
1212
1214
|
default: h(({ row: t }) => [
|
|
1213
|
-
k(
|
|
1214
|
-
|
|
1215
|
+
k(n.$slots, "table-op-left", { row: t }),
|
|
1216
|
+
u(s)(f.option.tools?.add, t) ? (p(), g(u(S), {
|
|
1215
1217
|
key: 0,
|
|
1216
1218
|
link: "",
|
|
1217
1219
|
type: "primary",
|
|
1218
|
-
onClick: (
|
|
1220
|
+
onClick: (a) => e.update.open(u(r).Insert, t)
|
|
1219
1221
|
}, {
|
|
1220
|
-
default: h(() => [...
|
|
1222
|
+
default: h(() => [...l[16] || (l[16] = [
|
|
1221
1223
|
V(" 新增 ", -1)
|
|
1222
1224
|
])]),
|
|
1223
1225
|
_: 1
|
|
1224
1226
|
}, 8, ["onClick"])) : C("", !0),
|
|
1225
|
-
|
|
1227
|
+
u(s)(f.option.tools?.update, t) ? (p(), g(u(S), {
|
|
1226
1228
|
key: 1,
|
|
1227
1229
|
link: "",
|
|
1228
1230
|
type: "warning",
|
|
1229
|
-
onClick: (
|
|
1231
|
+
onClick: (a) => e.update.open(u(r).Update, t)
|
|
1230
1232
|
}, {
|
|
1231
|
-
default: h(() => [...
|
|
1233
|
+
default: h(() => [...l[17] || (l[17] = [
|
|
1232
1234
|
V(" 编辑 ", -1)
|
|
1233
1235
|
])]),
|
|
1234
1236
|
_: 1
|
|
1235
1237
|
}, 8, ["onClick"])) : C("", !0),
|
|
1236
|
-
|
|
1238
|
+
u(s)(f.option.tools?.delete, t) ? (p(), g(u(S), {
|
|
1237
1239
|
key: 2,
|
|
1238
1240
|
link: "",
|
|
1239
1241
|
type: "danger",
|
|
1240
|
-
onClick: (
|
|
1242
|
+
onClick: (a) => e.remove.open([t])
|
|
1241
1243
|
}, {
|
|
1242
|
-
default: h(() => [...
|
|
1244
|
+
default: h(() => [...l[18] || (l[18] = [
|
|
1243
1245
|
V(" 删除 ", -1)
|
|
1244
1246
|
])]),
|
|
1245
1247
|
_: 1
|
|
1246
1248
|
}, 8, ["onClick"])) : C("", !0),
|
|
1247
|
-
k(
|
|
1249
|
+
k(n.$slots, "table-op-right", { row: t })
|
|
1248
1250
|
]),
|
|
1249
1251
|
_: 3
|
|
1250
1252
|
})) : C("", !0)
|
|
1251
1253
|
]),
|
|
1252
1254
|
_: 3
|
|
1253
1255
|
}, 16, ["data", "onSelectionChange", "expand-row-keys", "onExpandChange"])), [
|
|
1254
|
-
[
|
|
1256
|
+
[o, e.table.loading]
|
|
1255
1257
|
])
|
|
1256
1258
|
])
|
|
1257
1259
|
]),
|
|
1258
|
-
U("div",
|
|
1259
|
-
e.page.total > e.page.size ? (
|
|
1260
|
+
U("div", Te, [
|
|
1261
|
+
e.page.total > e.page.size ? (p(), g(u(me), {
|
|
1260
1262
|
key: 0,
|
|
1261
1263
|
"current-page": e.page.num,
|
|
1262
|
-
"onUpdate:currentPage":
|
|
1264
|
+
"onUpdate:currentPage": l[3] || (l[3] = (t) => e.page.num = t),
|
|
1263
1265
|
"page-size": e.page.size,
|
|
1264
|
-
"onUpdate:pageSize":
|
|
1266
|
+
"onUpdate:pageSize": l[4] || (l[4] = (t) => e.page.size = t),
|
|
1265
1267
|
background: "",
|
|
1266
1268
|
"page-sizes": e.page.sizeList,
|
|
1267
1269
|
"pager-count": 7,
|
|
@@ -1272,31 +1274,31 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
1272
1274
|
}, null, 8, ["current-page", "page-size", "page-sizes", "layout", "total", "onSizeChange", "onCurrentChange"])) : C("", !0)
|
|
1273
1275
|
])
|
|
1274
1276
|
]),
|
|
1275
|
-
k(
|
|
1277
|
+
k(n.$slots, "box-right")
|
|
1276
1278
|
]),
|
|
1277
|
-
v(
|
|
1279
|
+
v(u(G), D({
|
|
1278
1280
|
modelValue: e.update.show,
|
|
1279
|
-
"onUpdate:modelValue":
|
|
1281
|
+
"onUpdate:modelValue": l[5] || (l[5] = (t) => e.update.show = t),
|
|
1280
1282
|
title: e.update.title,
|
|
1281
1283
|
"close-on-click-modal": !1,
|
|
1282
1284
|
"before-close": e.update.close
|
|
1283
|
-
},
|
|
1285
|
+
}, f.option.dialog), {
|
|
1284
1286
|
footer: h(() => [
|
|
1285
1287
|
U("span", _e, [
|
|
1286
|
-
v(
|
|
1288
|
+
v(u(S), {
|
|
1287
1289
|
onClick: e.update.close
|
|
1288
1290
|
}, {
|
|
1289
|
-
default: h(() => [...
|
|
1291
|
+
default: h(() => [...l[19] || (l[19] = [
|
|
1290
1292
|
V("关闭", -1)
|
|
1291
1293
|
])]),
|
|
1292
1294
|
_: 1
|
|
1293
1295
|
}, 8, ["onClick"]),
|
|
1294
|
-
v(
|
|
1296
|
+
v(u(S), {
|
|
1295
1297
|
type: "primary",
|
|
1296
1298
|
onClick: e.update.submit,
|
|
1297
1299
|
loading: e.update.loading
|
|
1298
1300
|
}, {
|
|
1299
|
-
default: h(() => [...
|
|
1301
|
+
default: h(() => [...l[20] || (l[20] = [
|
|
1300
1302
|
V(" 提交 ", -1)
|
|
1301
1303
|
])]),
|
|
1302
1304
|
_: 1
|
|
@@ -1304,98 +1306,98 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
1304
1306
|
])
|
|
1305
1307
|
]),
|
|
1306
1308
|
default: h(() => [
|
|
1307
|
-
v(
|
|
1309
|
+
v(u(J), {
|
|
1308
1310
|
ref_key: "ruleFormRef",
|
|
1309
1311
|
ref: m,
|
|
1310
1312
|
model: e.update.form,
|
|
1311
1313
|
rules: e.update.rules
|
|
1312
1314
|
}, {
|
|
1313
1315
|
default: h(() => [
|
|
1314
|
-
e.update.showContent ? (
|
|
1315
|
-
k(
|
|
1316
|
+
e.update.showContent ? (p(!0), w($, { key: 0 }, I(e.update.formColumn, (t) => (p(), w("div", ze, [
|
|
1317
|
+
k(n.$slots, "form-start", {
|
|
1316
1318
|
row: e.update.form
|
|
1317
1319
|
}),
|
|
1318
|
-
(
|
|
1319
|
-
|
|
1320
|
+
(p(!0), w($, null, I(t, (a) => (p(), w($, null, [
|
|
1321
|
+
u(s)(a.item.show?.form, e.update.form) ? (p(), w("div", {
|
|
1320
1322
|
key: 0,
|
|
1321
|
-
class:
|
|
1323
|
+
class: X(a.item.form.span > 0 ? `col-${a.item.form.span}` : "col")
|
|
1322
1324
|
}, [
|
|
1323
|
-
v(
|
|
1324
|
-
label:
|
|
1325
|
-
prop:
|
|
1326
|
-
"label-width":
|
|
1325
|
+
v(u(_), {
|
|
1326
|
+
label: a.item.label,
|
|
1327
|
+
prop: a.item.key,
|
|
1328
|
+
"label-width": a.item.form?.labelWidth || "100px"
|
|
1327
1329
|
}, {
|
|
1328
1330
|
default: h(() => [
|
|
1329
|
-
U("div",
|
|
1330
|
-
k(
|
|
1331
|
+
U("div", Re, [
|
|
1332
|
+
k(n.$slots, "form-" + a.item.key + "-start", {
|
|
1331
1333
|
row: e.update.form,
|
|
1332
|
-
item:
|
|
1334
|
+
item: a.item
|
|
1333
1335
|
}),
|
|
1334
|
-
U("div",
|
|
1335
|
-
k(
|
|
1336
|
+
U("div", Me, [
|
|
1337
|
+
k(n.$slots, "form-" + a.item.key, {
|
|
1336
1338
|
row: e.update.form,
|
|
1337
|
-
item:
|
|
1339
|
+
item: a.item
|
|
1338
1340
|
}, () => [
|
|
1339
|
-
|
|
1341
|
+
a.item.type === "input" ? (p(), g(u(K), D({
|
|
1340
1342
|
key: 0,
|
|
1341
|
-
modelValue: e.update.form[
|
|
1342
|
-
"onUpdate:modelValue": (b) => e.update.form[
|
|
1343
|
-
}, { ref_for: !0 },
|
|
1344
|
-
disabled: e.update.getDisabled(
|
|
1345
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
1343
|
+
modelValue: e.update.form[a.item.key],
|
|
1344
|
+
"onUpdate:modelValue": (b) => e.update.form[a.item.key] = b
|
|
1345
|
+
}, { ref_for: !0 }, a.item.options?.input, F(a.item.options?.input?.on || {}), {
|
|
1346
|
+
disabled: e.update.getDisabled(a.item)
|
|
1347
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : a.item.type === "switch" ? (p(), g(u(H), D({
|
|
1346
1348
|
key: 1,
|
|
1347
|
-
modelValue: e.update.form[
|
|
1348
|
-
"onUpdate:modelValue": (b) => e.update.form[
|
|
1349
|
-
}, { ref_for: !0 },
|
|
1350
|
-
disabled: e.update.getDisabled(
|
|
1351
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
1349
|
+
modelValue: e.update.form[a.item.key],
|
|
1350
|
+
"onUpdate:modelValue": (b) => e.update.form[a.item.key] = b
|
|
1351
|
+
}, { ref_for: !0 }, a.item.options?.switch, {
|
|
1352
|
+
disabled: e.update.getDisabled(a.item)
|
|
1353
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : a.item.type === "select" ? (p(), g(u(N), D({
|
|
1352
1354
|
key: 2,
|
|
1353
|
-
modelValue: e.update.form[
|
|
1354
|
-
"onUpdate:modelValue": (b) => e.update.form[
|
|
1355
|
-
}, { ref_for: !0 },
|
|
1356
|
-
disabled: e.update.getDisabled(
|
|
1355
|
+
modelValue: e.update.form[a.item.key],
|
|
1356
|
+
"onUpdate:modelValue": (b) => e.update.form[a.item.key] = b
|
|
1357
|
+
}, { ref_for: !0 }, a.item.options?.select, F(a.item.options?.select?.on || {}), {
|
|
1358
|
+
disabled: e.update.getDisabled(a.item),
|
|
1357
1359
|
style: { width: "100%" }
|
|
1358
1360
|
}), {
|
|
1359
1361
|
default: h(() => [
|
|
1360
|
-
(
|
|
1362
|
+
(p(!0), w($, null, I(a.item.options?.select?.data, (b) => (p(), g(u(M), {
|
|
1361
1363
|
key: b.value,
|
|
1362
1364
|
label: b.label,
|
|
1363
1365
|
value: b.value
|
|
1364
1366
|
}, null, 8, ["label", "value"]))), 128))
|
|
1365
1367
|
]),
|
|
1366
1368
|
_: 2
|
|
1367
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
1369
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : a.item.type === "list" ? (p(), g(Q, D({
|
|
1368
1370
|
key: 3,
|
|
1369
1371
|
row: e.update.form,
|
|
1370
|
-
field:
|
|
1371
|
-
}, { ref_for: !0 },
|
|
1372
|
-
disabled: e.update.getDisabled(
|
|
1372
|
+
field: a.item.key
|
|
1373
|
+
}, { ref_for: !0 }, a.item.options?.list, F(a.item.options?.list?.on || {}), {
|
|
1374
|
+
disabled: e.update.getDisabled(a.item),
|
|
1373
1375
|
style: { width: "100%" }
|
|
1374
|
-
}), null, 16, ["row", "field", "disabled"])) :
|
|
1376
|
+
}), null, 16, ["row", "field", "disabled"])) : a.item.type === "tree-select" ? (p(), g(u(oe), D({
|
|
1375
1377
|
key: 4,
|
|
1376
|
-
modelValue: e.update.form[
|
|
1377
|
-
"onUpdate:modelValue": (b) => e.update.form[
|
|
1378
|
-
}, { ref_for: !0 },
|
|
1379
|
-
disabled: e.update.getDisabled(
|
|
1378
|
+
modelValue: e.update.form[a.item.key],
|
|
1379
|
+
"onUpdate:modelValue": (b) => e.update.form[a.item.key] = b
|
|
1380
|
+
}, { ref_for: !0 }, a.item.options?.treeSelect, F(a.item.options?.treeSelect?.on || {}), {
|
|
1381
|
+
disabled: e.update.getDisabled(a.item),
|
|
1380
1382
|
style: { width: "100%" }
|
|
1381
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
1383
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : a.item.type === "datetime" ? (p(), g(u(le), D({
|
|
1382
1384
|
key: 5,
|
|
1383
|
-
modelValue: e.update.form[
|
|
1384
|
-
"onUpdate:modelValue": (b) => e.update.form[
|
|
1385
|
-
}, { ref_for: !0 },
|
|
1386
|
-
disabled: e.update.getDisabled(
|
|
1387
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
1385
|
+
modelValue: e.update.form[a.item.key],
|
|
1386
|
+
"onUpdate:modelValue": (b) => e.update.form[a.item.key] = b
|
|
1387
|
+
}, { ref_for: !0 }, a.item.options?.datetime, F(a.item.options?.datetime?.on || {}), {
|
|
1388
|
+
disabled: e.update.getDisabled(a.item)
|
|
1389
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u(j).customComponent[a.item.type] ? (p(), g(te(u(j).customComponent[a.item.type]), D({
|
|
1388
1390
|
key: 6,
|
|
1389
|
-
modelValue: e.update.form[
|
|
1390
|
-
"onUpdate:modelValue": (b) => e.update.form[
|
|
1391
|
-
}, { ref_for: !0 },
|
|
1392
|
-
disabled: e.update.getDisabled(
|
|
1391
|
+
modelValue: e.update.form[a.item.key],
|
|
1392
|
+
"onUpdate:modelValue": (b) => e.update.form[a.item.key] = b
|
|
1393
|
+
}, { ref_for: !0 }, a.item.options?.[a.item.type], F(a.item.options?.[a.item.type]?.on || {}), {
|
|
1394
|
+
disabled: e.update.getDisabled(a.item)
|
|
1393
1395
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0)
|
|
1394
1396
|
])
|
|
1395
1397
|
]),
|
|
1396
|
-
k(
|
|
1398
|
+
k(n.$slots, "form-" + a.item.key + "-end", {
|
|
1397
1399
|
row: e.update.form,
|
|
1398
|
-
item:
|
|
1400
|
+
item: a.item
|
|
1399
1401
|
})
|
|
1400
1402
|
])
|
|
1401
1403
|
]),
|
|
@@ -1403,7 +1405,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
1403
1405
|
}, 1032, ["label", "prop", "label-width"])
|
|
1404
1406
|
], 2)) : C("", !0)
|
|
1405
1407
|
], 64))), 256)),
|
|
1406
|
-
k(
|
|
1408
|
+
k(n.$slots, "form-end", {
|
|
1407
1409
|
row: e.update.form
|
|
1408
1410
|
})
|
|
1409
1411
|
]))), 256)) : C("", !0)
|
|
@@ -1413,28 +1415,28 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
1413
1415
|
]),
|
|
1414
1416
|
_: 3
|
|
1415
1417
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
1416
|
-
v(
|
|
1418
|
+
v(u(G), {
|
|
1417
1419
|
modelValue: e.remove.show,
|
|
1418
|
-
"onUpdate:modelValue":
|
|
1420
|
+
"onUpdate:modelValue": l[6] || (l[6] = (t) => e.remove.show = t),
|
|
1419
1421
|
title: e.remove.title,
|
|
1420
1422
|
"close-on-click-modal": !1
|
|
1421
1423
|
}, {
|
|
1422
1424
|
footer: h(() => [
|
|
1423
|
-
U("span",
|
|
1424
|
-
v(
|
|
1425
|
+
U("span", Ne, [
|
|
1426
|
+
v(u(S), {
|
|
1425
1427
|
onClick: e.remove.close
|
|
1426
1428
|
}, {
|
|
1427
|
-
default: h(() => [...
|
|
1429
|
+
default: h(() => [...l[21] || (l[21] = [
|
|
1428
1430
|
V("关闭", -1)
|
|
1429
1431
|
])]),
|
|
1430
1432
|
_: 1
|
|
1431
1433
|
}, 8, ["onClick"]),
|
|
1432
|
-
v(
|
|
1434
|
+
v(u(S), {
|
|
1433
1435
|
type: "danger",
|
|
1434
1436
|
onClick: e.remove.submit,
|
|
1435
1437
|
loading: e.remove.loading
|
|
1436
1438
|
}, {
|
|
1437
|
-
default: h(() => [...
|
|
1439
|
+
default: h(() => [...l[22] || (l[22] = [
|
|
1438
1440
|
V(" 确认删除 ", -1)
|
|
1439
1441
|
])]),
|
|
1440
1442
|
_: 1
|
|
@@ -1442,31 +1444,31 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
1442
1444
|
])
|
|
1443
1445
|
]),
|
|
1444
1446
|
default: h(() => [
|
|
1445
|
-
U("div", null, "确认要删除【" +
|
|
1447
|
+
U("div", null, "确认要删除【" + A(e.remove.items.length) + "】条数据吗?", 1)
|
|
1446
1448
|
]),
|
|
1447
1449
|
_: 1
|
|
1448
1450
|
}, 8, ["modelValue", "title"]),
|
|
1449
|
-
v(
|
|
1451
|
+
v(ve, {
|
|
1450
1452
|
ref_key: "switchConfirmRef",
|
|
1451
1453
|
ref: c
|
|
1452
1454
|
}, null, 512)
|
|
1453
1455
|
]);
|
|
1454
1456
|
};
|
|
1455
1457
|
}
|
|
1456
|
-
}),
|
|
1457
|
-
if (
|
|
1458
|
-
|
|
1459
|
-
for (const r in
|
|
1460
|
-
|
|
1458
|
+
}), Ae = (f, d) => {
|
|
1459
|
+
if (f.component("TCurd", Pe), f.component("TFormList", Q), f.component("TColumn", ge), d?.customComponent) {
|
|
1460
|
+
j.customComponent = d.customComponent;
|
|
1461
|
+
for (const r in d.customComponent)
|
|
1462
|
+
f.component(r, d.customComponent[r]);
|
|
1461
1463
|
}
|
|
1462
1464
|
};
|
|
1463
1465
|
export {
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1466
|
+
L as ArrUtil,
|
|
1467
|
+
we as ExcelUtil,
|
|
1468
|
+
ge as TColumn,
|
|
1469
|
+
Pe as TCurd,
|
|
1470
|
+
j as TForm,
|
|
1471
|
+
Q as TFormList,
|
|
1470
1472
|
O as TSys,
|
|
1471
|
-
|
|
1473
|
+
Ae as install
|
|
1472
1474
|
};
|