cc1-form 1.0.1 → 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 +621 -618
- 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,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ElMessage as ie, ElLoading as de, ElForm as J, ElFormItem as
|
|
3
|
-
class
|
|
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
|
+
class O {
|
|
4
4
|
/**
|
|
5
5
|
* 路由
|
|
6
6
|
*/
|
|
@@ -24,13 +24,13 @@ class $ {
|
|
|
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 $ {
|
|
|
40
40
|
* 加载模块
|
|
41
41
|
* @param module
|
|
42
42
|
*/
|
|
43
|
-
static loadModule = async (
|
|
44
|
-
if (
|
|
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 $ {
|
|
|
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 $ {
|
|
|
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 $ {
|
|
|
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 $ {
|
|
|
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 $ {
|
|
|
133
133
|
* @param param
|
|
134
134
|
* @returns
|
|
135
135
|
*/
|
|
136
|
-
static getImgPic = (
|
|
137
|
-
let c = document.getElementById(
|
|
138
|
-
const m = await
|
|
136
|
+
static getImgPic = (d) => new Promise(async (i, r) => {
|
|
137
|
+
let c = document.getElementById(d.id);
|
|
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 = $.isFun, n = $.EDialog, c = j(), m = p, s = q({
|
|
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 = (h) => {
|
|
244
|
-
if (s.formDefault[h.key] = h.value, h.isForm) {
|
|
245
|
-
h.form = h.form || { span: u }, h.form.span = h.form.span ?? u;
|
|
246
|
-
let U = h.form.span, y = t.reduce((z, T) => z + T.span, U);
|
|
247
|
-
const E = t.length;
|
|
248
|
-
t.push({ item: h, span: U }), (E === 1 && t[0].span === 0 || y >= o || U === 0 && E > 1) && (a.push(t), t = []), h.rules && (s.rules[h.key] = h.rules);
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
e.column.forEach((h) => {
|
|
252
|
-
h.isForm = !0, l(h);
|
|
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(J), {
|
|
262
|
-
ref_key: "ruleFormRef",
|
|
263
|
-
ref: c,
|
|
264
|
-
model: s.form,
|
|
265
|
-
rules: s.rules
|
|
266
|
-
}, {
|
|
267
|
-
default: b(() => [
|
|
268
|
-
s.showContent ? (f(!0), w(x, { 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(x, null, F(u, (t) => (f(), w(x, null, [
|
|
273
|
-
d(r)(t.item.show?.form, s.form) ? (f(), w("div", {
|
|
274
|
-
key: 0,
|
|
275
|
-
class: X(t.item.form.span > 0 ? `col-${t.item.form.span}` : "col")
|
|
276
|
-
}, [
|
|
277
|
-
v(d(M), {
|
|
278
|
-
label: t.item.label,
|
|
279
|
-
prop: t.item.key,
|
|
280
|
-
"label-width": t.item.form?.labelWidth || "100px"
|
|
281
|
-
}, {
|
|
282
|
-
default: b(() => [
|
|
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(K), 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, Y(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(H), 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(_), 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: b(() => [
|
|
312
|
-
(f(!0), w(x, 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 he = {
|
|
|
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:
|
|
490
|
-
|
|
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 }),
|
|
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:
|
|
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: X(
|
|
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:
|
|
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,58 +535,58 @@ class ge {
|
|
|
539
535
|
* @param columns 列
|
|
540
536
|
* @param fileName 文件名
|
|
541
537
|
*/
|
|
542
|
-
static exportToExcel = async (i, r
|
|
543
|
-
const c = await
|
|
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
|
-
footer:
|
|
574
|
-
|
|
575
|
-
v(
|
|
576
|
-
default:
|
|
569
|
+
footer: h(() => [
|
|
570
|
+
U("span", we, [
|
|
571
|
+
v(u(S), { onClick: l }, {
|
|
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
|
-
default:
|
|
581
|
+
default: h(() => [...t[2] || (t[2] = [
|
|
586
582
|
V("确认", -1)
|
|
587
583
|
])]),
|
|
588
584
|
_: 1
|
|
589
585
|
})
|
|
590
586
|
])
|
|
591
587
|
]),
|
|
592
|
-
default:
|
|
593
|
-
|
|
588
|
+
default: h(() => [
|
|
589
|
+
U("div", null, A(c.value), 1)
|
|
594
590
|
]),
|
|
595
591
|
_: 1
|
|
596
592
|
}, 8, ["modelValue", "title"]));
|
|
@@ -607,7 +603,10 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
607
603
|
}, xe = { key: 0 }, $e = { key: 1 }, Oe = { key: 2 }, Se = { class: "export-btn" }, Fe = {
|
|
608
604
|
class: "flex items-center",
|
|
609
605
|
style: { gap: "10px" }
|
|
610
|
-
}, 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 = {
|
|
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 = {
|
|
607
|
+
class: "row form-item-content",
|
|
608
|
+
style: { width: "100%" }
|
|
609
|
+
}, Re = { class: "col" }, Me = { class: "dialog-footer" }, _e = { class: "dialog-footer" }, Ne = /* @__PURE__ */ P({
|
|
611
610
|
__name: "index",
|
|
612
611
|
props: {
|
|
613
612
|
/**
|
|
@@ -617,8 +616,8 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
617
616
|
default: {}
|
|
618
617
|
}
|
|
619
618
|
},
|
|
620
|
-
setup(
|
|
621
|
-
const
|
|
619
|
+
setup(f, { expose: d }) {
|
|
620
|
+
const i = O.EDialog, r = f, c = z(), m = z(), n = O.isFun, e = q({
|
|
622
621
|
search: {
|
|
623
622
|
column: {
|
|
624
623
|
list: []
|
|
@@ -626,29 +625,29 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
626
625
|
form: {},
|
|
627
626
|
formDefault: {},
|
|
628
627
|
getFormData: () => {
|
|
629
|
-
let
|
|
630
|
-
|
|
631
|
-
(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]);
|
|
632
631
|
});
|
|
633
|
-
const
|
|
634
|
-
return
|
|
632
|
+
const l = r.option.search?.before?.(s);
|
|
633
|
+
return l && (s = l), s;
|
|
635
634
|
},
|
|
636
635
|
reset: () => {
|
|
637
|
-
const
|
|
638
|
-
Object.keys(
|
|
639
|
-
|
|
640
|
-
}), 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();
|
|
641
640
|
},
|
|
642
641
|
submit: () => {
|
|
643
642
|
e.page.num = 1, e.table.getList();
|
|
644
643
|
}
|
|
645
644
|
},
|
|
646
645
|
page: {
|
|
647
|
-
size:
|
|
648
|
-
sizeList:
|
|
646
|
+
size: r.option.page?.size || 10,
|
|
647
|
+
sizeList: r.option.page?.sizeList || [10, 20, 50, 100],
|
|
649
648
|
num: 1,
|
|
650
649
|
total: 0,
|
|
651
|
-
layout:
|
|
650
|
+
layout: r.option.page?.layout || "total, sizes, prev, pager, next, jumper"
|
|
652
651
|
},
|
|
653
652
|
table: {
|
|
654
653
|
loading: !1,
|
|
@@ -656,19 +655,19 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
656
655
|
expand: {
|
|
657
656
|
isExpand: !1,
|
|
658
657
|
rowKeys: [],
|
|
659
|
-
change: (
|
|
658
|
+
change: (s, l) => {
|
|
660
659
|
},
|
|
661
660
|
all: () => {
|
|
662
661
|
if (e.table.expand.isExpand)
|
|
663
662
|
e.table.expand.rowKeys = [];
|
|
664
663
|
else {
|
|
665
|
-
const
|
|
666
|
-
let
|
|
667
|
-
return
|
|
668
|
-
|
|
669
|
-
}),
|
|
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;
|
|
670
669
|
};
|
|
671
|
-
e.table.expand.rowKeys =
|
|
670
|
+
e.table.expand.rowKeys = s(e.table.data);
|
|
672
671
|
}
|
|
673
672
|
e.table.expand.isExpand = !e.table.expand.isExpand;
|
|
674
673
|
}
|
|
@@ -694,56 +693,56 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
694
693
|
},
|
|
695
694
|
getList: async () => {
|
|
696
695
|
e.table.loading = !0;
|
|
697
|
-
const
|
|
696
|
+
const s = r.option.api.list, l = await s({
|
|
698
697
|
size: e.page.size,
|
|
699
698
|
num: e.page.num,
|
|
700
699
|
...e.search.getFormData(),
|
|
701
|
-
final(
|
|
700
|
+
final(a, b, x) {
|
|
702
701
|
e.table.loading = !1;
|
|
703
702
|
}
|
|
704
|
-
}),
|
|
705
|
-
let t = Array.isArray(
|
|
706
|
-
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;
|
|
707
706
|
},
|
|
708
707
|
selection: {
|
|
709
708
|
list: [],
|
|
710
|
-
change: (
|
|
711
|
-
e.table.selection.list =
|
|
709
|
+
change: (s) => {
|
|
710
|
+
e.table.selection.list = s;
|
|
712
711
|
}
|
|
713
712
|
},
|
|
714
713
|
exportFun: {
|
|
715
|
-
start: async (
|
|
716
|
-
let
|
|
714
|
+
start: async (s) => {
|
|
715
|
+
let l = await e.table.exportFun[s](), o = r.option.column;
|
|
717
716
|
const t = JSONUtil.cp({
|
|
718
|
-
data:
|
|
719
|
-
columns:
|
|
720
|
-
}),
|
|
721
|
-
|
|
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);
|
|
722
721
|
},
|
|
723
722
|
select: () => {
|
|
724
723
|
if (e.table.selection.list.length === 0)
|
|
725
|
-
throw
|
|
724
|
+
throw O.fail("请选择要导出的数据"), new Error("请选择要导出的数据");
|
|
726
725
|
return e.table.selection.list;
|
|
727
726
|
},
|
|
728
727
|
page: () => {
|
|
729
728
|
if (e.table.data.length === 0)
|
|
730
|
-
throw
|
|
729
|
+
throw O.fail("暂无数据"), new Error("暂无数据");
|
|
731
730
|
return e.table.data;
|
|
732
731
|
},
|
|
733
732
|
all: async () => {
|
|
734
733
|
e.table.loading = !0;
|
|
735
|
-
const
|
|
734
|
+
const s = r.option.api.list, { data: l } = await s({
|
|
736
735
|
size: 999999,
|
|
737
736
|
num: 1,
|
|
738
|
-
final(
|
|
737
|
+
final(o, t, a) {
|
|
739
738
|
e.table.loading = !1;
|
|
740
739
|
}
|
|
741
740
|
});
|
|
742
|
-
return
|
|
741
|
+
return l.list;
|
|
743
742
|
}
|
|
744
743
|
},
|
|
745
|
-
export: (
|
|
746
|
-
e.table.exportFun.start(
|
|
744
|
+
export: (s) => {
|
|
745
|
+
e.table.exportFun.start(s);
|
|
747
746
|
}
|
|
748
747
|
},
|
|
749
748
|
update: {
|
|
@@ -752,11 +751,11 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
752
751
|
show: !1,
|
|
753
752
|
showContent: !1,
|
|
754
753
|
loading: !1,
|
|
755
|
-
type:
|
|
754
|
+
type: i.Insert,
|
|
756
755
|
form: {},
|
|
757
756
|
formDefault: {},
|
|
758
757
|
formColumn: [],
|
|
759
|
-
getDisabled: (
|
|
758
|
+
getDisabled: (s) => s.disabled?.[e.update.type === i.Insert ? "create" : "update"],
|
|
760
759
|
edit: {
|
|
761
760
|
/**
|
|
762
761
|
* 编辑原数据
|
|
@@ -765,42 +764,42 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
765
764
|
/**
|
|
766
765
|
* 将form填入数据和data比对差异数据返回
|
|
767
766
|
*/
|
|
768
|
-
getApiData: (
|
|
769
|
-
if (
|
|
770
|
-
return
|
|
771
|
-
let
|
|
767
|
+
getApiData: (s) => {
|
|
768
|
+
if (r.option.form?.editAll)
|
|
769
|
+
return s;
|
|
770
|
+
let l = {
|
|
772
771
|
_id: e.update.edit.data._id
|
|
773
772
|
};
|
|
774
|
-
return Object.keys(e.update.edit.data).forEach((
|
|
775
|
-
|
|
776
|
-
}),
|
|
773
|
+
return Object.keys(e.update.edit.data).forEach((o) => {
|
|
774
|
+
s[o] !== e.update.edit.data[o] && (l[o] = s[o]);
|
|
775
|
+
}), l;
|
|
777
776
|
}
|
|
778
777
|
},
|
|
779
|
-
open: (
|
|
778
|
+
open: (s, l) => {
|
|
780
779
|
e.update.showContent || FunUtil.throttle(async () => {
|
|
781
|
-
e.update.type =
|
|
782
|
-
const
|
|
783
|
-
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);
|
|
784
783
|
});
|
|
785
784
|
},
|
|
786
785
|
submit: () => {
|
|
787
786
|
FunUtil.throttle(async () => {
|
|
788
|
-
await m.value?.validate(async (
|
|
789
|
-
|
|
787
|
+
await m.value?.validate(async (o, t) => new Promise((a, b) => {
|
|
788
|
+
o || (O.fail("请检查表单数据"), b(!1)), a();
|
|
790
789
|
})), e.update.loading = !0;
|
|
791
|
-
const
|
|
792
|
-
let
|
|
793
|
-
delete
|
|
794
|
-
if (typeof o
|
|
795
|
-
const t = new Date(o
|
|
796
|
-
!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);
|
|
797
796
|
}
|
|
798
|
-
}), await
|
|
799
|
-
...
|
|
800
|
-
final(
|
|
797
|
+
}), await s({
|
|
798
|
+
...l,
|
|
799
|
+
final(o, t, a) {
|
|
801
800
|
e.update.loading = !1;
|
|
802
801
|
}
|
|
803
|
-
}), e.update.close(), await e.table.getList(),
|
|
802
|
+
}), e.update.close(), await e.table.getList(), r.option.form?.submitAfter?.(l, e.update);
|
|
804
803
|
});
|
|
805
804
|
},
|
|
806
805
|
close: () => {
|
|
@@ -817,23 +816,23 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
817
816
|
close: () => {
|
|
818
817
|
e.remove.show = !1;
|
|
819
818
|
},
|
|
820
|
-
open: (
|
|
821
|
-
if (
|
|
822
|
-
|
|
819
|
+
open: (s) => {
|
|
820
|
+
if (s.length === 0) {
|
|
821
|
+
O.fail("请选择要删除的数据");
|
|
823
822
|
return;
|
|
824
823
|
}
|
|
825
|
-
e.remove.items =
|
|
824
|
+
e.remove.items = s, e.remove.show = !0;
|
|
826
825
|
},
|
|
827
826
|
submit: () => {
|
|
828
827
|
FunUtil.throttle(async () => {
|
|
829
828
|
e.table.loading = !0;
|
|
830
|
-
const
|
|
831
|
-
await
|
|
832
|
-
_id: e.remove.items.map((
|
|
833
|
-
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) {
|
|
834
833
|
e.table.loading = !1;
|
|
835
834
|
}
|
|
836
|
-
}),
|
|
835
|
+
}), O.success("操作成功"), e.table.data.length <= 1 && e.page.num > 1 && (e.page.num -= 1), e.remove.close(), await e.table.getList();
|
|
837
836
|
});
|
|
838
837
|
}
|
|
839
838
|
},
|
|
@@ -841,7 +840,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
841
840
|
e.initCurdConfig(), e.initColumnOptions(), e.initColumnForm();
|
|
842
841
|
},
|
|
843
842
|
initCurdConfig: () => {
|
|
844
|
-
const
|
|
843
|
+
const l = {
|
|
845
844
|
tools: {
|
|
846
845
|
search: !0,
|
|
847
846
|
reset: !0,
|
|
@@ -859,9 +858,9 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
859
858
|
emptyText: "暂无数据",
|
|
860
859
|
highlightCurrentRow: !0
|
|
861
860
|
}
|
|
862
|
-
},
|
|
863
|
-
Object.keys(
|
|
864
|
-
|
|
861
|
+
}, o = r.option;
|
|
862
|
+
Object.keys(l).forEach((t) => {
|
|
863
|
+
o[t] = ObjectUtil.deepMerge(l[t], o[t] || {});
|
|
865
864
|
});
|
|
866
865
|
},
|
|
867
866
|
/**
|
|
@@ -870,27 +869,27 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
870
869
|
* @returns
|
|
871
870
|
*/
|
|
872
871
|
initColumnOptions: () => {
|
|
873
|
-
const
|
|
874
|
-
const
|
|
872
|
+
const s = r.option, l = (o) => {
|
|
873
|
+
const a = {
|
|
875
874
|
options: {
|
|
876
875
|
switch: {
|
|
877
876
|
activeValue: !0,
|
|
878
877
|
activeLabel: "开启",
|
|
879
878
|
inactiveValue: !1,
|
|
880
879
|
inactiveLabel: "关闭",
|
|
881
|
-
tableBeforeChange: async (
|
|
882
|
-
const E =
|
|
880
|
+
tableBeforeChange: async (x, y) => {
|
|
881
|
+
const E = o.options?.switch;
|
|
883
882
|
try {
|
|
884
883
|
return await c.value?.open({
|
|
885
884
|
title: "确认修改",
|
|
886
|
-
content: `确认要${y[
|
|
887
|
-
}), e.table.loading = !0, await
|
|
885
|
+
content: `确认要${y[x] === E.activeValue ? E.inactiveLabel : E.activeLabel}吗?`
|
|
886
|
+
}), e.table.loading = !0, await r.option.api.update({
|
|
888
887
|
_id: y._id,
|
|
889
|
-
[
|
|
890
|
-
final(
|
|
888
|
+
[x]: y[x] === E.activeValue ? E.inactiveValue : E.activeValue,
|
|
889
|
+
final(T, R, Y) {
|
|
891
890
|
e.table.loading = !1;
|
|
892
891
|
}
|
|
893
|
-
}),
|
|
892
|
+
}), O.success("操作成功"), e.table.getList(), !0;
|
|
894
893
|
} catch {
|
|
895
894
|
return !1;
|
|
896
895
|
}
|
|
@@ -925,113 +924,113 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
925
924
|
table: 0,
|
|
926
925
|
form: 0
|
|
927
926
|
}
|
|
928
|
-
},
|
|
929
|
-
Object.keys(
|
|
930
|
-
|
|
927
|
+
}, b = o;
|
|
928
|
+
Object.keys(a).forEach((x) => {
|
|
929
|
+
b[x] = ObjectUtil.deepMerge(a[x], b[x] || {});
|
|
931
930
|
});
|
|
932
931
|
};
|
|
933
|
-
|
|
932
|
+
s.column.forEach(l), s.table?.column?.forEach(l);
|
|
934
933
|
},
|
|
935
934
|
initColumnForm: () => {
|
|
936
|
-
const
|
|
935
|
+
const s = r.option;
|
|
937
936
|
e.update.formColumn = [], e.table.column.show = {
|
|
938
937
|
list: [],
|
|
939
938
|
listSource: []
|
|
940
939
|
};
|
|
941
|
-
const
|
|
942
|
-
let
|
|
943
|
-
const
|
|
940
|
+
const l = [], o = r.option.form?.maxSpan || 12, t = r.option.form?.defaultSpan || o / 2;
|
|
941
|
+
let a = [];
|
|
942
|
+
const b = (y) => {
|
|
944
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) {
|
|
945
944
|
y.form = y.form || { span: t }, y.form.span = y.form.span ?? t;
|
|
946
|
-
let E = y.form.span,
|
|
947
|
-
const
|
|
948
|
-
|
|
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);
|
|
949
948
|
}
|
|
950
949
|
};
|
|
951
|
-
|
|
952
|
-
y.isForm = !0,
|
|
953
|
-
}),
|
|
954
|
-
y.isForm = !1,
|
|
955
|
-
}), e.search.column.list =
|
|
956
|
-
const
|
|
957
|
-
|
|
958
|
-
e.search.formDefault[y] =
|
|
959
|
-
}),
|
|
950
|
+
s.column.forEach((y) => {
|
|
951
|
+
y.isForm = !0, b(y);
|
|
952
|
+
}), r.option.table?.column?.forEach((y) => {
|
|
953
|
+
y.isForm = !1, b(y);
|
|
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;
|
|
956
|
+
x && Object.keys(x).forEach((y) => {
|
|
957
|
+
e.search.formDefault[y] = x[y];
|
|
958
|
+
}), s.column.forEach((y) => {
|
|
960
959
|
y.show?.search || (e.search.formDefault[y.key] = void 0);
|
|
961
960
|
}), e.search.form = JSONUtil.cp(e.search.formDefault);
|
|
962
961
|
}
|
|
963
962
|
});
|
|
964
963
|
return e.init(), ee(() => {
|
|
965
964
|
e.table.getList();
|
|
966
|
-
}),
|
|
965
|
+
}), d({
|
|
967
966
|
conf: e
|
|
968
|
-
}), (
|
|
969
|
-
const
|
|
970
|
-
return
|
|
971
|
-
|
|
972
|
-
k(
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
v(
|
|
967
|
+
}), (s, l) => {
|
|
968
|
+
const o = ne("loading");
|
|
969
|
+
return p(), w("div", ve, [
|
|
970
|
+
U("div", Ce, [
|
|
971
|
+
k(s.$slots, "box-left"),
|
|
972
|
+
U("div", Ve, [
|
|
973
|
+
f.option.search?.show !== !1 ? (p(), w("div", De, [
|
|
974
|
+
v(u(J), {
|
|
976
975
|
model: e.search.form,
|
|
977
976
|
inline: ""
|
|
978
977
|
}, {
|
|
979
|
-
default:
|
|
980
|
-
k(
|
|
978
|
+
default: h(() => [
|
|
979
|
+
k(s.$slots, "search-start", {
|
|
981
980
|
row: e.search.form
|
|
982
981
|
}),
|
|
983
|
-
(
|
|
982
|
+
(p(!0), w($, null, I(e.search.column.list, (t) => (p(), w($, {
|
|
984
983
|
key: t.key
|
|
985
984
|
}, [
|
|
986
|
-
(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(_), {
|
|
987
986
|
key: 0,
|
|
988
987
|
label: t.label
|
|
989
988
|
}, {
|
|
990
|
-
default:
|
|
991
|
-
k(
|
|
989
|
+
default: h(() => [
|
|
990
|
+
k(s.$slots, "search-" + t.key, {
|
|
992
991
|
row: e.search.form
|
|
993
992
|
}, () => [
|
|
994
|
-
t.type === "input" ? (
|
|
993
|
+
t.type === "input" ? (p(), g(u(K), {
|
|
995
994
|
key: 0,
|
|
996
995
|
modelValue: e.search.form[t.key],
|
|
997
|
-
"onUpdate:modelValue": (
|
|
996
|
+
"onUpdate:modelValue": (a) => e.search.form[t.key] = a,
|
|
998
997
|
placeholder: `请输入${t.label}`,
|
|
999
998
|
clearable: "",
|
|
1000
999
|
disabled: t.disabled?.search
|
|
1001
|
-
}, 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), {
|
|
1002
1001
|
key: 1,
|
|
1003
1002
|
modelValue: e.search.form[t.key],
|
|
1004
|
-
"onUpdate:modelValue": (
|
|
1003
|
+
"onUpdate:modelValue": (a) => e.search.form[t.key] = a,
|
|
1005
1004
|
placeholder: `请选择${t.label}`,
|
|
1006
1005
|
clearable: "",
|
|
1007
1006
|
disabled: t.disabled?.search
|
|
1008
1007
|
}, {
|
|
1009
|
-
default:
|
|
1010
|
-
(
|
|
1008
|
+
default: h(() => [
|
|
1009
|
+
(p(), g(u(M), {
|
|
1011
1010
|
key: t.options?.switch?.activeValue,
|
|
1012
1011
|
label: t.options?.switch?.activeLabel,
|
|
1013
1012
|
value: t.options?.switch?.activeValue
|
|
1014
1013
|
}, null, 8, ["label", "value"])),
|
|
1015
|
-
(
|
|
1014
|
+
(p(), g(u(M), {
|
|
1016
1015
|
key: t.options?.switch?.inactiveValue,
|
|
1017
1016
|
label: t.options?.switch?.inactiveLabel,
|
|
1018
1017
|
value: t.options?.switch?.inactiveValue
|
|
1019
1018
|
}, null, 8, ["label", "value"]))
|
|
1020
1019
|
]),
|
|
1021
1020
|
_: 2
|
|
1022
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : t.type === "select" ? (
|
|
1021
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : t.type === "select" ? (p(), g(u(N), {
|
|
1023
1022
|
key: 2,
|
|
1024
1023
|
modelValue: e.search.form[t.key],
|
|
1025
|
-
"onUpdate:modelValue": (
|
|
1024
|
+
"onUpdate:modelValue": (a) => e.search.form[t.key] = a,
|
|
1026
1025
|
placeholder: `请选择${t.label}`,
|
|
1027
1026
|
clearable: "",
|
|
1028
1027
|
disabled: t.disabled?.search
|
|
1029
1028
|
}, {
|
|
1030
|
-
default:
|
|
1031
|
-
(
|
|
1032
|
-
key:
|
|
1033
|
-
label:
|
|
1034
|
-
value:
|
|
1029
|
+
default: h(() => [
|
|
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
|
|
1035
1034
|
}, null, 8, ["label", "value"]))), 128))
|
|
1036
1035
|
]),
|
|
1037
1036
|
_: 2
|
|
@@ -1041,26 +1040,26 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
1041
1040
|
_: 2
|
|
1042
1041
|
}, 1032, ["label"])) : C("", !0)
|
|
1043
1042
|
], 64))), 128)),
|
|
1044
|
-
k(
|
|
1043
|
+
k(s.$slots, "search-center", {
|
|
1045
1044
|
row: e.search.form
|
|
1046
1045
|
}),
|
|
1047
|
-
v(
|
|
1048
|
-
default:
|
|
1049
|
-
|
|
1046
|
+
v(u(_), null, {
|
|
1047
|
+
default: h(() => [
|
|
1048
|
+
f.option.tools?.search ? (p(), g(u(S), {
|
|
1050
1049
|
key: 0,
|
|
1051
1050
|
type: "primary",
|
|
1052
1051
|
onClick: e.search.submit
|
|
1053
1052
|
}, {
|
|
1054
|
-
default:
|
|
1053
|
+
default: h(() => [...l[7] || (l[7] = [
|
|
1055
1054
|
V(" 搜索 ", -1)
|
|
1056
1055
|
])]),
|
|
1057
1056
|
_: 1
|
|
1058
1057
|
}, 8, ["onClick"])) : C("", !0),
|
|
1059
|
-
|
|
1058
|
+
f.option.tools?.reset ? (p(), g(u(S), {
|
|
1060
1059
|
key: 1,
|
|
1061
1060
|
onClick: e.search.reset
|
|
1062
1061
|
}, {
|
|
1063
|
-
default:
|
|
1062
|
+
default: h(() => [...l[8] || (l[8] = [
|
|
1064
1063
|
V("重置", -1)
|
|
1065
1064
|
])]),
|
|
1066
1065
|
_: 1
|
|
@@ -1068,69 +1067,69 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
1068
1067
|
]),
|
|
1069
1068
|
_: 1
|
|
1070
1069
|
}),
|
|
1071
|
-
k(
|
|
1070
|
+
k(s.$slots, "search-end", {
|
|
1072
1071
|
row: e.search.form
|
|
1073
1072
|
})
|
|
1074
1073
|
]),
|
|
1075
1074
|
_: 3
|
|
1076
1075
|
}, 8, ["model"])
|
|
1077
1076
|
])) : C("", !0),
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
v(
|
|
1077
|
+
U("div", Ee, [
|
|
1078
|
+
U("div", Ue, [
|
|
1079
|
+
u(n)(f.option.tools?.add) ? (p(), w("div", xe, [
|
|
1080
|
+
v(u(S), {
|
|
1082
1081
|
type: "primary",
|
|
1083
|
-
onClick:
|
|
1082
|
+
onClick: l[0] || (l[0] = (t) => e.update.open(u(i).Insert))
|
|
1084
1083
|
}, {
|
|
1085
|
-
default:
|
|
1084
|
+
default: h(() => [...l[9] || (l[9] = [
|
|
1086
1085
|
V("新增", -1)
|
|
1087
1086
|
])]),
|
|
1088
1087
|
_: 1
|
|
1089
1088
|
})
|
|
1090
1089
|
])) : C("", !0),
|
|
1091
|
-
|
|
1092
|
-
v(
|
|
1090
|
+
f.option.table?.selectable && u(n)(f.option.tools?.delete) ? (p(), w("div", $e, [
|
|
1091
|
+
v(u(S), {
|
|
1093
1092
|
type: "danger",
|
|
1094
|
-
onClick:
|
|
1093
|
+
onClick: l[1] || (l[1] = (t) => e.remove.open(e.table.selection.list))
|
|
1095
1094
|
}, {
|
|
1096
|
-
default:
|
|
1095
|
+
default: h(() => [...l[10] || (l[10] = [
|
|
1097
1096
|
V(" 删除 ", -1)
|
|
1098
1097
|
])]),
|
|
1099
1098
|
_: 1
|
|
1100
1099
|
})
|
|
1101
1100
|
])) : C("", !0),
|
|
1102
|
-
|
|
1103
|
-
v(
|
|
1101
|
+
f.option.tools?.expand ? (p(), w("div", Oe, [
|
|
1102
|
+
v(u(S), {
|
|
1104
1103
|
type: "warning",
|
|
1105
|
-
onClick:
|
|
1104
|
+
onClick: l[2] || (l[2] = (t) => e.table.expand.all())
|
|
1106
1105
|
}, {
|
|
1107
|
-
default:
|
|
1106
|
+
default: h(() => [...l[11] || (l[11] = [
|
|
1108
1107
|
V("展开/收缩", -1)
|
|
1109
1108
|
])]),
|
|
1110
1109
|
_: 1
|
|
1111
1110
|
})
|
|
1112
1111
|
])) : C("", !0),
|
|
1113
|
-
|
|
1112
|
+
f.option.tools?.export?.show ? (p(), g(u(ue), {
|
|
1114
1113
|
key: 3,
|
|
1115
1114
|
onCommand: e.table.export
|
|
1116
1115
|
}, {
|
|
1117
|
-
dropdown:
|
|
1118
|
-
v(
|
|
1119
|
-
default:
|
|
1120
|
-
v(
|
|
1121
|
-
default:
|
|
1116
|
+
dropdown: h(() => [
|
|
1117
|
+
v(u(pe), null, {
|
|
1118
|
+
default: h(() => [
|
|
1119
|
+
v(u(B), { command: "select" }, {
|
|
1120
|
+
default: h(() => [...l[13] || (l[13] = [
|
|
1122
1121
|
V("导出选中", -1)
|
|
1123
1122
|
])]),
|
|
1124
1123
|
_: 1
|
|
1125
1124
|
}),
|
|
1126
|
-
v(
|
|
1127
|
-
default:
|
|
1125
|
+
v(u(B), { command: "page" }, {
|
|
1126
|
+
default: h(() => [...l[14] || (l[14] = [
|
|
1128
1127
|
V("导出本页", -1)
|
|
1129
1128
|
])]),
|
|
1130
1129
|
_: 1
|
|
1131
1130
|
}),
|
|
1132
|
-
v(
|
|
1133
|
-
default:
|
|
1131
|
+
v(u(B), { command: "all" }, {
|
|
1132
|
+
default: h(() => [...l[15] || (l[15] = [
|
|
1134
1133
|
V("导出全部", -1)
|
|
1135
1134
|
])]),
|
|
1136
1135
|
_: 1
|
|
@@ -1139,10 +1138,10 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
1139
1138
|
_: 1
|
|
1140
1139
|
})
|
|
1141
1140
|
]),
|
|
1142
|
-
default:
|
|
1143
|
-
|
|
1144
|
-
v(
|
|
1145
|
-
default:
|
|
1141
|
+
default: h(() => [
|
|
1142
|
+
U("div", Se, [
|
|
1143
|
+
v(u(S), { type: "warning" }, {
|
|
1144
|
+
default: h(() => [...l[12] || (l[12] = [
|
|
1146
1145
|
V("导出", -1)
|
|
1147
1146
|
])]),
|
|
1148
1147
|
_: 1
|
|
@@ -1151,114 +1150,114 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
1151
1150
|
]),
|
|
1152
1151
|
_: 1
|
|
1153
1152
|
}, 8, ["onCommand"])) : C("", !0),
|
|
1154
|
-
k(
|
|
1153
|
+
k(s.$slots, "tools-left")
|
|
1155
1154
|
]),
|
|
1156
|
-
|
|
1157
|
-
k(
|
|
1155
|
+
U("div", Fe, [
|
|
1156
|
+
k(s.$slots, "tools-right")
|
|
1158
1157
|
])
|
|
1159
1158
|
]),
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
re((
|
|
1159
|
+
U("div", Ie, [
|
|
1160
|
+
U("div", Le, [
|
|
1161
|
+
re((p(), g(u(fe), D({
|
|
1163
1162
|
data: e.table.data
|
|
1164
|
-
},
|
|
1163
|
+
}, f.option.table, {
|
|
1165
1164
|
onSelectionChange: e.table.selection.change,
|
|
1166
1165
|
"expand-row-keys": e.table.expand.rowKeys,
|
|
1167
1166
|
onExpandChange: e.table.expand.change
|
|
1168
1167
|
}), {
|
|
1169
|
-
default:
|
|
1170
|
-
|
|
1168
|
+
default: h(() => [
|
|
1169
|
+
f.option.table?.selectable && u(n)(f.option.tools?.delete) ? (p(), g(u(W), {
|
|
1171
1170
|
key: 0,
|
|
1172
1171
|
type: "selection",
|
|
1173
|
-
selectable: typeof
|
|
1172
|
+
selectable: typeof f.option.table?.selectable == "function" ? f.option.table?.selectable : void 0,
|
|
1174
1173
|
width: "55"
|
|
1175
1174
|
}, null, 8, ["selectable"])) : C("", !0),
|
|
1176
|
-
(
|
|
1175
|
+
(p(!0), w($, null, I(e.table.column.list, (t) => (p(), w($, {
|
|
1177
1176
|
key: t.key
|
|
1178
1177
|
}, [
|
|
1179
|
-
e.table.column.show.list.includes(t.key) ? (
|
|
1178
|
+
e.table.column.show.list.includes(t.key) ? (p(), g(u(W), D({
|
|
1180
1179
|
key: 0,
|
|
1181
1180
|
prop: t.key,
|
|
1182
1181
|
label: t.label
|
|
1183
1182
|
}, { ref_for: !0 }, t.table), {
|
|
1184
|
-
default:
|
|
1185
|
-
k(
|
|
1186
|
-
row:
|
|
1183
|
+
default: h(({ row: a }) => [
|
|
1184
|
+
k(s.$slots, "table-" + t.key, {
|
|
1185
|
+
row: a,
|
|
1187
1186
|
item: t
|
|
1188
1187
|
}, () => [
|
|
1189
|
-
t.type === "switch" ? (
|
|
1188
|
+
t.type === "switch" ? (p(), g(u(H), D({
|
|
1190
1189
|
key: 0,
|
|
1191
|
-
modelValue:
|
|
1192
|
-
"onUpdate:modelValue": (
|
|
1193
|
-
"before-change": () => t.options?.switch?.tableBeforeChange?.(t.key,
|
|
1194
|
-
}, { ref_for: !0 }, t.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "before-change"])) : (
|
|
1195
|
-
V(A(
|
|
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)
|
|
1196
1195
|
], 64))
|
|
1197
1196
|
])
|
|
1198
1197
|
]),
|
|
1199
1198
|
_: 2
|
|
1200
1199
|
}, 1040, ["prop", "label"])) : C("", !0)
|
|
1201
1200
|
], 64))), 128)),
|
|
1202
|
-
|
|
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), {
|
|
1203
1202
|
key: 1,
|
|
1204
1203
|
label: "操作",
|
|
1205
1204
|
width: "180",
|
|
1206
1205
|
align: "center",
|
|
1207
1206
|
fixed: "right"
|
|
1208
1207
|
}, {
|
|
1209
|
-
default:
|
|
1210
|
-
k(
|
|
1211
|
-
|
|
1208
|
+
default: h(({ row: t }) => [
|
|
1209
|
+
k(s.$slots, "table-op-left", { row: t }),
|
|
1210
|
+
u(n)(f.option.tools?.add, t) ? (p(), g(u(S), {
|
|
1212
1211
|
key: 0,
|
|
1213
1212
|
link: "",
|
|
1214
1213
|
type: "primary",
|
|
1215
|
-
onClick: (
|
|
1214
|
+
onClick: (a) => e.update.open(u(i).Insert, t)
|
|
1216
1215
|
}, {
|
|
1217
|
-
default:
|
|
1216
|
+
default: h(() => [...l[16] || (l[16] = [
|
|
1218
1217
|
V(" 新增 ", -1)
|
|
1219
1218
|
])]),
|
|
1220
1219
|
_: 1
|
|
1221
1220
|
}, 8, ["onClick"])) : C("", !0),
|
|
1222
|
-
|
|
1221
|
+
u(n)(f.option.tools?.update, t) ? (p(), g(u(S), {
|
|
1223
1222
|
key: 1,
|
|
1224
1223
|
link: "",
|
|
1225
1224
|
type: "warning",
|
|
1226
|
-
onClick: (
|
|
1225
|
+
onClick: (a) => e.update.open(u(i).Update, t)
|
|
1227
1226
|
}, {
|
|
1228
|
-
default:
|
|
1227
|
+
default: h(() => [...l[17] || (l[17] = [
|
|
1229
1228
|
V(" 编辑 ", -1)
|
|
1230
1229
|
])]),
|
|
1231
1230
|
_: 1
|
|
1232
1231
|
}, 8, ["onClick"])) : C("", !0),
|
|
1233
|
-
|
|
1232
|
+
u(n)(f.option.tools?.delete, t) ? (p(), g(u(S), {
|
|
1234
1233
|
key: 2,
|
|
1235
1234
|
link: "",
|
|
1236
1235
|
type: "danger",
|
|
1237
|
-
onClick: (
|
|
1236
|
+
onClick: (a) => e.remove.open([t])
|
|
1238
1237
|
}, {
|
|
1239
|
-
default:
|
|
1238
|
+
default: h(() => [...l[18] || (l[18] = [
|
|
1240
1239
|
V(" 删除 ", -1)
|
|
1241
1240
|
])]),
|
|
1242
1241
|
_: 1
|
|
1243
1242
|
}, 8, ["onClick"])) : C("", !0),
|
|
1244
|
-
k(
|
|
1243
|
+
k(s.$slots, "table-op-right", { row: t })
|
|
1245
1244
|
]),
|
|
1246
1245
|
_: 3
|
|
1247
1246
|
})) : C("", !0)
|
|
1248
1247
|
]),
|
|
1249
1248
|
_: 3
|
|
1250
1249
|
}, 16, ["data", "onSelectionChange", "expand-row-keys", "onExpandChange"])), [
|
|
1251
|
-
[
|
|
1250
|
+
[o, e.table.loading]
|
|
1252
1251
|
])
|
|
1253
1252
|
])
|
|
1254
1253
|
]),
|
|
1255
|
-
|
|
1256
|
-
e.page.total > e.page.size ? (
|
|
1254
|
+
U("div", je, [
|
|
1255
|
+
e.page.total > e.page.size ? (p(), g(u(ce), {
|
|
1257
1256
|
key: 0,
|
|
1258
1257
|
"current-page": e.page.num,
|
|
1259
|
-
"onUpdate:currentPage":
|
|
1258
|
+
"onUpdate:currentPage": l[3] || (l[3] = (t) => e.page.num = t),
|
|
1260
1259
|
"page-size": e.page.size,
|
|
1261
|
-
"onUpdate:pageSize":
|
|
1260
|
+
"onUpdate:pageSize": l[4] || (l[4] = (t) => e.page.size = t),
|
|
1262
1261
|
background: "",
|
|
1263
1262
|
"page-sizes": e.page.sizeList,
|
|
1264
1263
|
"pager-count": 7,
|
|
@@ -1269,134 +1268,138 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
1269
1268
|
}, null, 8, ["current-page", "page-size", "page-sizes", "layout", "total", "onSizeChange", "onCurrentChange"])) : C("", !0)
|
|
1270
1269
|
])
|
|
1271
1270
|
]),
|
|
1272
|
-
k(
|
|
1271
|
+
k(s.$slots, "box-right")
|
|
1273
1272
|
]),
|
|
1274
|
-
v(
|
|
1273
|
+
v(u(G), D({
|
|
1275
1274
|
modelValue: e.update.show,
|
|
1276
|
-
"onUpdate:modelValue":
|
|
1275
|
+
"onUpdate:modelValue": l[5] || (l[5] = (t) => e.update.show = t),
|
|
1277
1276
|
title: e.update.title,
|
|
1278
1277
|
"close-on-click-modal": !1,
|
|
1279
1278
|
"before-close": e.update.close
|
|
1280
|
-
},
|
|
1281
|
-
footer:
|
|
1282
|
-
|
|
1283
|
-
v(
|
|
1279
|
+
}, f.option.dialog), {
|
|
1280
|
+
footer: h(() => [
|
|
1281
|
+
U("span", Me, [
|
|
1282
|
+
v(u(S), {
|
|
1284
1283
|
onClick: e.update.close
|
|
1285
1284
|
}, {
|
|
1286
|
-
default:
|
|
1285
|
+
default: h(() => [...l[19] || (l[19] = [
|
|
1287
1286
|
V("关闭", -1)
|
|
1288
1287
|
])]),
|
|
1289
1288
|
_: 1
|
|
1290
1289
|
}, 8, ["onClick"]),
|
|
1291
|
-
v(
|
|
1290
|
+
v(u(S), {
|
|
1292
1291
|
type: "primary",
|
|
1293
1292
|
onClick: e.update.submit,
|
|
1294
1293
|
loading: e.update.loading
|
|
1295
1294
|
}, {
|
|
1296
|
-
default:
|
|
1295
|
+
default: h(() => [...l[20] || (l[20] = [
|
|
1297
1296
|
V(" 提交 ", -1)
|
|
1298
1297
|
])]),
|
|
1299
1298
|
_: 1
|
|
1300
1299
|
}, 8, ["onClick", "loading"])
|
|
1301
1300
|
])
|
|
1302
1301
|
]),
|
|
1303
|
-
default:
|
|
1304
|
-
v(
|
|
1302
|
+
default: h(() => [
|
|
1303
|
+
v(u(J), {
|
|
1305
1304
|
ref_key: "ruleFormRef",
|
|
1306
1305
|
ref: m,
|
|
1307
1306
|
model: e.update.form,
|
|
1308
1307
|
rules: e.update.rules
|
|
1309
1308
|
}, {
|
|
1310
|
-
default:
|
|
1311
|
-
e.update.showContent ? (
|
|
1312
|
-
k(
|
|
1309
|
+
default: h(() => [
|
|
1310
|
+
e.update.showContent ? (p(!0), w($, { key: 0 }, I(e.update.formColumn, (t) => (p(), w("div", ze, [
|
|
1311
|
+
k(s.$slots, "form-start", {
|
|
1313
1312
|
row: e.update.form
|
|
1314
1313
|
}),
|
|
1315
|
-
(
|
|
1316
|
-
|
|
1314
|
+
(p(!0), w($, null, I(t, (a) => (p(), w($, null, [
|
|
1315
|
+
u(n)(a.item.show?.form, e.update.form) ? (p(), w("div", {
|
|
1317
1316
|
key: 0,
|
|
1318
|
-
class: X(
|
|
1317
|
+
class: X(a.item.form.span > 0 ? `col-${a.item.form.span}` : "col")
|
|
1319
1318
|
}, [
|
|
1320
|
-
v(
|
|
1321
|
-
label:
|
|
1322
|
-
prop:
|
|
1323
|
-
"label-width":
|
|
1319
|
+
v(u(_), {
|
|
1320
|
+
label: a.item.label,
|
|
1321
|
+
prop: a.item.key,
|
|
1322
|
+
"label-width": a.item.form?.labelWidth || "100px"
|
|
1324
1323
|
}, {
|
|
1325
|
-
default:
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
item: l.item
|
|
1329
|
-
}),
|
|
1330
|
-
k(a.$slots, "form-" + l.item.key, {
|
|
1331
|
-
row: e.update.form,
|
|
1332
|
-
item: l.item
|
|
1333
|
-
}, () => [
|
|
1334
|
-
l.item.type === "input" ? (f(), g(d(K), D({
|
|
1335
|
-
key: 0,
|
|
1336
|
-
modelValue: e.update.form[l.item.key],
|
|
1337
|
-
"onUpdate:modelValue": (h) => e.update.form[l.item.key] = h
|
|
1338
|
-
}, { ref_for: !0 }, l.item.options?.input, Y(l.item.options?.input?.on), {
|
|
1339
|
-
disabled: e.update.getDisabled(l.item)
|
|
1340
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : l.item.type === "switch" ? (f(), g(d(H), D({
|
|
1341
|
-
key: 1,
|
|
1342
|
-
modelValue: e.update.form[l.item.key],
|
|
1343
|
-
"onUpdate:modelValue": (h) => e.update.form[l.item.key] = h
|
|
1344
|
-
}, { ref_for: !0 }, l.item.options?.switch, {
|
|
1345
|
-
disabled: e.update.getDisabled(l.item)
|
|
1346
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : l.item.type === "select" ? (f(), g(d(_), D({
|
|
1347
|
-
key: 2,
|
|
1348
|
-
modelValue: e.update.form[l.item.key],
|
|
1349
|
-
"onUpdate:modelValue": (h) => e.update.form[l.item.key] = h
|
|
1350
|
-
}, { ref_for: !0 }, l.item.options?.select, {
|
|
1351
|
-
disabled: e.update.getDisabled(l.item),
|
|
1352
|
-
style: { width: "100%" }
|
|
1353
|
-
}), {
|
|
1354
|
-
default: b(() => [
|
|
1355
|
-
(f(!0), w(x, null, F(l.item.options?.select?.data, (h) => (f(), g(d(R), {
|
|
1356
|
-
key: h.value,
|
|
1357
|
-
label: h.label,
|
|
1358
|
-
value: h.value
|
|
1359
|
-
}, null, 8, ["label", "value"]))), 128))
|
|
1360
|
-
]),
|
|
1361
|
-
_: 2
|
|
1362
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : l.item.type === "list" ? (f(), g(oe, D({
|
|
1363
|
-
key: 3,
|
|
1324
|
+
default: h(() => [
|
|
1325
|
+
U("div", Te, [
|
|
1326
|
+
k(s.$slots, "form-" + a.item.key + "-start", {
|
|
1364
1327
|
row: e.update.form,
|
|
1365
|
-
|
|
1366
|
-
},
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1328
|
+
item: a.item
|
|
1329
|
+
}),
|
|
1330
|
+
U("div", Re, [
|
|
1331
|
+
k(s.$slots, "form-" + a.item.key, {
|
|
1332
|
+
row: e.update.form,
|
|
1333
|
+
item: a.item
|
|
1334
|
+
}, () => [
|
|
1335
|
+
a.item.type === "input" ? (p(), g(u(K), D({
|
|
1336
|
+
key: 0,
|
|
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({
|
|
1342
|
+
key: 1,
|
|
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({
|
|
1348
|
+
key: 2,
|
|
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),
|
|
1353
|
+
style: { width: "100%" }
|
|
1354
|
+
}), {
|
|
1355
|
+
default: h(() => [
|
|
1356
|
+
(p(!0), w($, null, I(a.item.options?.select?.data, (b) => (p(), g(u(M), {
|
|
1357
|
+
key: b.value,
|
|
1358
|
+
label: b.label,
|
|
1359
|
+
value: b.value
|
|
1360
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
1361
|
+
]),
|
|
1362
|
+
_: 2
|
|
1363
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : a.item.type === "list" ? (p(), g(Q, D({
|
|
1364
|
+
key: 3,
|
|
1365
|
+
row: e.update.form,
|
|
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),
|
|
1369
|
+
style: { width: "100%" }
|
|
1370
|
+
}), null, 16, ["row", "field", "disabled"])) : a.item.type === "tree-select" ? (p(), g(u(oe), D({
|
|
1371
|
+
key: 4,
|
|
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),
|
|
1376
|
+
style: { width: "100%" }
|
|
1377
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : a.item.type === "datetime" ? (p(), g(u(le), D({
|
|
1378
|
+
key: 5,
|
|
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({
|
|
1384
|
+
key: 6,
|
|
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)
|
|
1389
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0)
|
|
1390
|
+
])
|
|
1391
|
+
]),
|
|
1392
|
+
k(s.$slots, "form-" + a.item.key + "-end", {
|
|
1393
|
+
row: e.update.form,
|
|
1394
|
+
item: a.item
|
|
1395
|
+
})
|
|
1396
|
+
])
|
|
1394
1397
|
]),
|
|
1395
1398
|
_: 2
|
|
1396
1399
|
}, 1032, ["label", "prop", "label-width"])
|
|
1397
1400
|
], 2)) : C("", !0)
|
|
1398
1401
|
], 64))), 256)),
|
|
1399
|
-
k(
|
|
1402
|
+
k(s.$slots, "form-end", {
|
|
1400
1403
|
row: e.update.form
|
|
1401
1404
|
})
|
|
1402
1405
|
]))), 256)) : C("", !0)
|
|
@@ -1406,36 +1409,36 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
1406
1409
|
]),
|
|
1407
1410
|
_: 3
|
|
1408
1411
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
1409
|
-
v(
|
|
1412
|
+
v(u(G), {
|
|
1410
1413
|
modelValue: e.remove.show,
|
|
1411
|
-
"onUpdate:modelValue":
|
|
1414
|
+
"onUpdate:modelValue": l[6] || (l[6] = (t) => e.remove.show = t),
|
|
1412
1415
|
title: e.remove.title,
|
|
1413
1416
|
"close-on-click-modal": !1
|
|
1414
1417
|
}, {
|
|
1415
|
-
footer:
|
|
1416
|
-
|
|
1417
|
-
v(
|
|
1418
|
+
footer: h(() => [
|
|
1419
|
+
U("span", _e, [
|
|
1420
|
+
v(u(S), {
|
|
1418
1421
|
onClick: e.remove.close
|
|
1419
1422
|
}, {
|
|
1420
|
-
default:
|
|
1423
|
+
default: h(() => [...l[21] || (l[21] = [
|
|
1421
1424
|
V("关闭", -1)
|
|
1422
1425
|
])]),
|
|
1423
1426
|
_: 1
|
|
1424
1427
|
}, 8, ["onClick"]),
|
|
1425
|
-
v(
|
|
1428
|
+
v(u(S), {
|
|
1426
1429
|
type: "danger",
|
|
1427
1430
|
onClick: e.remove.submit,
|
|
1428
1431
|
loading: e.remove.loading
|
|
1429
1432
|
}, {
|
|
1430
|
-
default:
|
|
1433
|
+
default: h(() => [...l[22] || (l[22] = [
|
|
1431
1434
|
V(" 确认删除 ", -1)
|
|
1432
1435
|
])]),
|
|
1433
1436
|
_: 1
|
|
1434
1437
|
}, 8, ["onClick", "loading"])
|
|
1435
1438
|
])
|
|
1436
1439
|
]),
|
|
1437
|
-
default:
|
|
1438
|
-
|
|
1440
|
+
default: h(() => [
|
|
1441
|
+
U("div", null, "确认要删除【" + A(e.remove.items.length) + "】条数据吗?", 1)
|
|
1439
1442
|
]),
|
|
1440
1443
|
_: 1
|
|
1441
1444
|
}, 8, ["modelValue", "title"]),
|
|
@@ -1446,20 +1449,20 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ N({
|
|
|
1446
1449
|
]);
|
|
1447
1450
|
};
|
|
1448
1451
|
}
|
|
1449
|
-
}),
|
|
1450
|
-
if (
|
|
1451
|
-
|
|
1452
|
-
for (const
|
|
1453
|
-
|
|
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]);
|
|
1454
1457
|
}
|
|
1455
1458
|
};
|
|
1456
1459
|
export {
|
|
1457
|
-
|
|
1460
|
+
L as ArrUtil,
|
|
1458
1461
|
ge as ExcelUtil,
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1462
|
+
ye as TColumn,
|
|
1463
|
+
Ne as TCurd,
|
|
1464
|
+
j as TForm,
|
|
1465
|
+
Q as TFormList,
|
|
1466
|
+
O as TSys,
|
|
1467
|
+
We as install
|
|
1465
1468
|
};
|