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