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