cc1-form 1.0.0 → 1.0.1
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 +630 -772
- 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 q, resolveComponent as W, createBlock as g, openBlock as f, unref as d, withCtx as b, createElementBlock as w, createCommentVNode as C, Fragment as x, renderList as F, renderSlot as k, normalizeClass as X, createVNode as v, mergeProps as D, toHandlers as Y, resolveDynamicComponent as Z, onMounted as ee, createElementVNode as S, createTextVNode as V, normalizeStyle as se, toDisplayString as A, resolveDirective as ne, withDirectives as re } from "vue";
|
|
2
|
+
import { ElMessage as ie, ElLoading as de, ElForm as J, ElFormItem as M, ElInput as K, ElSwitch as H, ElSelect as _, ElOption as R, ElTreeSelect as te, ElDatePicker as le, ElDialog as G, ElButton as O, ElDropdown as ue, ElDropdownMenu as fe, ElDropdownItem as P, ElTable as pe, ElTableColumn as B, ElPagination as ce } from "element-plus";
|
|
3
|
+
class $ {
|
|
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 (!$.moduleObj[i])
|
|
45
|
+
throw new Error(`模块${i}未加载,请赋值如:TSys.moduleObj = { ${i}: ()=>import('${i}') }`);
|
|
46
|
+
const r = await $.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 $.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 === $.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" }, be = /* @__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 = $.isFun, n = $.EDialog, c = j(), m = p, s = q({
|
|
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 = (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
249
|
}
|
|
250
250
|
};
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}),
|
|
251
|
+
e.column.forEach((h) => {
|
|
252
|
+
h.isForm = !0, l(h);
|
|
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(J), {
|
|
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: 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
271
|
}),
|
|
272
|
-
(
|
|
273
|
-
|
|
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
274
|
key: 0,
|
|
275
|
-
class:
|
|
275
|
+
class: X(t.item.form.span > 0 ? `col-${t.item.form.span}` : "col")
|
|
276
276
|
}, [
|
|
277
|
-
|
|
278
|
-
label:
|
|
279
|
-
prop:
|
|
280
|
-
"label-width":
|
|
277
|
+
v(d(M), {
|
|
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: b(() => [
|
|
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(K), 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, 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
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(_), 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: b(() => [
|
|
312
|
+
(f(!0), w(x, 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 he = {
|
|
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,149 @@ const Ee = {
|
|
|
465
465
|
}
|
|
466
466
|
},
|
|
467
467
|
emits: ["change"],
|
|
468
|
-
setup(
|
|
469
|
-
const
|
|
468
|
+
setup(p, { emit: i }) {
|
|
469
|
+
const r = p, n = q({
|
|
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", he, [
|
|
489
|
+
k(m.$slots, "list-start", { row: p.row }),
|
|
490
|
+
S("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: b(() => [...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(x, 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(x, 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: X(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: b(() => [...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 $.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(G), {
|
|
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: b(() => [
|
|
574
|
+
S("span", we, [
|
|
575
|
+
v(d(O), { onClick: o }, {
|
|
576
|
+
default: b(() => [...t[1] || (t[1] = [
|
|
577
|
+
V("取消", -1)
|
|
720
578
|
])]),
|
|
721
579
|
_: 1
|
|
722
580
|
}),
|
|
723
|
-
|
|
581
|
+
v(d(O), {
|
|
724
582
|
type: "primary",
|
|
725
|
-
onClick:
|
|
583
|
+
onClick: a
|
|
726
584
|
}, {
|
|
727
|
-
default:
|
|
728
|
-
|
|
585
|
+
default: b(() => [...t[2] || (t[2] = [
|
|
586
|
+
V("确认", -1)
|
|
729
587
|
])]),
|
|
730
588
|
_: 1
|
|
731
589
|
})
|
|
732
590
|
])
|
|
733
591
|
]),
|
|
734
|
-
default:
|
|
735
|
-
|
|
592
|
+
default: b(() => [
|
|
593
|
+
S("div", null, A(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 = { class: "dialog-footer" }, Re = { class: "dialog-footer" }, Me = /* @__PURE__ */ N({
|
|
753
611
|
__name: "index",
|
|
754
612
|
props: {
|
|
755
613
|
/**
|
|
@@ -759,8 +617,8 @@ const Se = { class: "dialog-footer" }, Ie = /* @__PURE__ */ H({
|
|
|
759
617
|
default: {}
|
|
760
618
|
}
|
|
761
619
|
},
|
|
762
|
-
setup(
|
|
763
|
-
const
|
|
620
|
+
setup(p, { expose: i }) {
|
|
621
|
+
const r = $.EDialog, n = p, c = j(), m = j(), s = $.isFun, e = q({
|
|
764
622
|
search: {
|
|
765
623
|
column: {
|
|
766
624
|
list: []
|
|
@@ -768,29 +626,29 @@ const Se = { class: "dialog-footer" }, Ie = /* @__PURE__ */ H({
|
|
|
768
626
|
form: {},
|
|
769
627
|
formDefault: {},
|
|
770
628
|
getFormData: () => {
|
|
771
|
-
let
|
|
772
|
-
|
|
773
|
-
(typeof
|
|
629
|
+
let a = {};
|
|
630
|
+
n.option.column.forEach((u) => {
|
|
631
|
+
(typeof u.show?.search == "function" ? u.show?.search(e.search.form) : u.show?.search) && (a[u.key] = e.search.form[u.key]);
|
|
774
632
|
});
|
|
775
|
-
const
|
|
776
|
-
return
|
|
633
|
+
const o = n.option.search?.before?.(a);
|
|
634
|
+
return o && (a = o), a;
|
|
777
635
|
},
|
|
778
636
|
reset: () => {
|
|
779
|
-
const
|
|
780
|
-
Object.keys(
|
|
781
|
-
|
|
782
|
-
}), e.search.form = JSONUtil.cp(
|
|
637
|
+
const a = e.search.formDefault;
|
|
638
|
+
Object.keys(a).forEach((o) => {
|
|
639
|
+
n.option.search?.resetMode === "default" ? a[o] = e.search.formDefault[o] : a[o] = void 0;
|
|
640
|
+
}), e.search.form = JSONUtil.cp(a), e.page.num = 1, e.table.getList();
|
|
783
641
|
},
|
|
784
642
|
submit: () => {
|
|
785
643
|
e.page.num = 1, e.table.getList();
|
|
786
644
|
}
|
|
787
645
|
},
|
|
788
646
|
page: {
|
|
789
|
-
size:
|
|
790
|
-
sizeList:
|
|
647
|
+
size: n.option.page?.size || 10,
|
|
648
|
+
sizeList: n.option.page?.sizeList || [10, 20, 50, 100],
|
|
791
649
|
num: 1,
|
|
792
650
|
total: 0,
|
|
793
|
-
layout:
|
|
651
|
+
layout: n.option.page?.layout || "total, sizes, prev, pager, next, jumper"
|
|
794
652
|
},
|
|
795
653
|
table: {
|
|
796
654
|
loading: !1,
|
|
@@ -798,19 +656,19 @@ const Se = { class: "dialog-footer" }, Ie = /* @__PURE__ */ H({
|
|
|
798
656
|
expand: {
|
|
799
657
|
isExpand: !1,
|
|
800
658
|
rowKeys: [],
|
|
801
|
-
change: (
|
|
659
|
+
change: (a, o) => {
|
|
802
660
|
},
|
|
803
661
|
all: () => {
|
|
804
662
|
if (e.table.expand.isExpand)
|
|
805
663
|
e.table.expand.rowKeys = [];
|
|
806
664
|
else {
|
|
807
|
-
const
|
|
808
|
-
let
|
|
809
|
-
return
|
|
810
|
-
|
|
811
|
-
}),
|
|
665
|
+
const a = (o) => {
|
|
666
|
+
let u = [];
|
|
667
|
+
return o.forEach((t) => {
|
|
668
|
+
u.push(t._id), t.children && t.children.length > 0 && (u = u.concat(a(t.children)));
|
|
669
|
+
}), u;
|
|
812
670
|
};
|
|
813
|
-
e.table.expand.rowKeys =
|
|
671
|
+
e.table.expand.rowKeys = a(e.table.data);
|
|
814
672
|
}
|
|
815
673
|
e.table.expand.isExpand = !e.table.expand.isExpand;
|
|
816
674
|
}
|
|
@@ -836,56 +694,56 @@ const Se = { class: "dialog-footer" }, Ie = /* @__PURE__ */ H({
|
|
|
836
694
|
},
|
|
837
695
|
getList: async () => {
|
|
838
696
|
e.table.loading = !0;
|
|
839
|
-
const
|
|
697
|
+
const a = n.option.api.list, o = await a({
|
|
840
698
|
size: e.page.size,
|
|
841
699
|
num: e.page.num,
|
|
842
700
|
...e.search.getFormData(),
|
|
843
|
-
final(
|
|
701
|
+
final(l, h, U) {
|
|
844
702
|
e.table.loading = !1;
|
|
845
703
|
}
|
|
846
|
-
}),
|
|
847
|
-
let
|
|
848
|
-
e.table.data =
|
|
704
|
+
}), u = o.data || { list: o };
|
|
705
|
+
let t = Array.isArray(u.list) ? u.list : u;
|
|
706
|
+
e.table.data = n.option.data ? await n.option.data(t) : t, e.page.total = u.total || 0;
|
|
849
707
|
},
|
|
850
708
|
selection: {
|
|
851
709
|
list: [],
|
|
852
|
-
change: (
|
|
853
|
-
e.table.selection.list =
|
|
710
|
+
change: (a) => {
|
|
711
|
+
e.table.selection.list = a;
|
|
854
712
|
}
|
|
855
713
|
},
|
|
856
714
|
exportFun: {
|
|
857
|
-
start: async (
|
|
858
|
-
let
|
|
859
|
-
const
|
|
860
|
-
data:
|
|
861
|
-
columns:
|
|
862
|
-
}),
|
|
863
|
-
|
|
715
|
+
start: async (a) => {
|
|
716
|
+
let o = await e.table.exportFun[a](), u = n.option.column;
|
|
717
|
+
const t = JSONUtil.cp({
|
|
718
|
+
data: o,
|
|
719
|
+
columns: u
|
|
720
|
+
}), l = n.option.tools?.export || {};
|
|
721
|
+
l.before && l.before(t), ge.exportToExcel(t.data, t.columns, l.fileName);
|
|
864
722
|
},
|
|
865
723
|
select: () => {
|
|
866
724
|
if (e.table.selection.list.length === 0)
|
|
867
|
-
throw
|
|
725
|
+
throw $.fail("请选择要导出的数据"), new Error("请选择要导出的数据");
|
|
868
726
|
return e.table.selection.list;
|
|
869
727
|
},
|
|
870
728
|
page: () => {
|
|
871
729
|
if (e.table.data.length === 0)
|
|
872
|
-
throw
|
|
730
|
+
throw $.fail("暂无数据"), new Error("暂无数据");
|
|
873
731
|
return e.table.data;
|
|
874
732
|
},
|
|
875
733
|
all: async () => {
|
|
876
734
|
e.table.loading = !0;
|
|
877
|
-
const
|
|
735
|
+
const a = n.option.api.list, { data: o } = await a({
|
|
878
736
|
size: 999999,
|
|
879
737
|
num: 1,
|
|
880
|
-
final(
|
|
738
|
+
final(u, t, l) {
|
|
881
739
|
e.table.loading = !1;
|
|
882
740
|
}
|
|
883
741
|
});
|
|
884
|
-
return
|
|
742
|
+
return o.list;
|
|
885
743
|
}
|
|
886
744
|
},
|
|
887
|
-
export: (
|
|
888
|
-
e.table.exportFun.start(
|
|
745
|
+
export: (a) => {
|
|
746
|
+
e.table.exportFun.start(a);
|
|
889
747
|
}
|
|
890
748
|
},
|
|
891
749
|
update: {
|
|
@@ -894,11 +752,11 @@ const Se = { class: "dialog-footer" }, Ie = /* @__PURE__ */ H({
|
|
|
894
752
|
show: !1,
|
|
895
753
|
showContent: !1,
|
|
896
754
|
loading: !1,
|
|
897
|
-
type:
|
|
755
|
+
type: r.Insert,
|
|
898
756
|
form: {},
|
|
899
757
|
formDefault: {},
|
|
900
758
|
formColumn: [],
|
|
901
|
-
getDisabled: (
|
|
759
|
+
getDisabled: (a) => a.disabled?.[e.update.type === r.Insert ? "create" : "update"],
|
|
902
760
|
edit: {
|
|
903
761
|
/**
|
|
904
762
|
* 编辑原数据
|
|
@@ -907,46 +765,46 @@ const Se = { class: "dialog-footer" }, Ie = /* @__PURE__ */ H({
|
|
|
907
765
|
/**
|
|
908
766
|
* 将form填入数据和data比对差异数据返回
|
|
909
767
|
*/
|
|
910
|
-
getApiData: (
|
|
911
|
-
if (
|
|
912
|
-
return
|
|
913
|
-
let
|
|
768
|
+
getApiData: (a) => {
|
|
769
|
+
if (n.option.form?.editAll)
|
|
770
|
+
return a;
|
|
771
|
+
let o = {
|
|
914
772
|
_id: e.update.edit.data._id
|
|
915
773
|
};
|
|
916
|
-
return Object.keys(e.update.edit.data).forEach((
|
|
917
|
-
|
|
918
|
-
}),
|
|
774
|
+
return Object.keys(e.update.edit.data).forEach((u) => {
|
|
775
|
+
a[u] !== e.update.edit.data[u] && (o[u] = a[u]);
|
|
776
|
+
}), o;
|
|
919
777
|
}
|
|
920
778
|
},
|
|
921
|
-
open: (
|
|
779
|
+
open: (a, o) => {
|
|
922
780
|
e.update.showContent || FunUtil.throttle(async () => {
|
|
923
|
-
e.update.type =
|
|
924
|
-
const
|
|
925
|
-
e.update.edit.data =
|
|
781
|
+
e.update.type = a;
|
|
782
|
+
const u = a === r.Insert;
|
|
783
|
+
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
784
|
});
|
|
927
785
|
},
|
|
928
786
|
submit: () => {
|
|
929
787
|
FunUtil.throttle(async () => {
|
|
930
|
-
await
|
|
931
|
-
|
|
788
|
+
await m.value?.validate(async (u, t) => new Promise((l, h) => {
|
|
789
|
+
u || ($.fail("请检查表单数据"), h(!1)), l();
|
|
932
790
|
})), e.update.loading = !0;
|
|
933
|
-
const
|
|
934
|
-
let
|
|
935
|
-
delete
|
|
936
|
-
if (typeof
|
|
937
|
-
const
|
|
938
|
-
!isNaN(
|
|
791
|
+
const a = e.update.type === r.Insert ? n.option.api.create : n.option.api.update;
|
|
792
|
+
let o = JSONUtil.cp(e.update.form);
|
|
793
|
+
delete o.children, await n.option.form?.submitBefore?.(o, e.update), Object.keys(o).forEach((u) => {
|
|
794
|
+
if (typeof o[u] == "string" && o[u].indexOf("T") > -1) {
|
|
795
|
+
const t = new Date(o[u]).getTime();
|
|
796
|
+
!isNaN(t) && t > (/* @__PURE__ */ new Date("1971-01-01")).getTime() && (o[u] = t);
|
|
939
797
|
}
|
|
940
|
-
}), await
|
|
941
|
-
...
|
|
942
|
-
final(
|
|
798
|
+
}), await a({
|
|
799
|
+
...o,
|
|
800
|
+
final(u, t, l) {
|
|
943
801
|
e.update.loading = !1;
|
|
944
802
|
}
|
|
945
|
-
}), e.update.close(), await e.table.getList(),
|
|
803
|
+
}), e.update.close(), await e.table.getList(), n.option.form?.submitAfter?.(o, e.update);
|
|
946
804
|
});
|
|
947
805
|
},
|
|
948
806
|
close: () => {
|
|
949
|
-
e.update.show = !1,
|
|
807
|
+
e.update.show = !1, setTimeout(() => {
|
|
950
808
|
e.update.showContent = !1;
|
|
951
809
|
}, 350);
|
|
952
810
|
}
|
|
@@ -959,23 +817,23 @@ const Se = { class: "dialog-footer" }, Ie = /* @__PURE__ */ H({
|
|
|
959
817
|
close: () => {
|
|
960
818
|
e.remove.show = !1;
|
|
961
819
|
},
|
|
962
|
-
open: (
|
|
963
|
-
if (
|
|
964
|
-
|
|
820
|
+
open: (a) => {
|
|
821
|
+
if (a.length === 0) {
|
|
822
|
+
$.fail("请选择要删除的数据");
|
|
965
823
|
return;
|
|
966
824
|
}
|
|
967
|
-
e.remove.items =
|
|
825
|
+
e.remove.items = a, e.remove.show = !0;
|
|
968
826
|
},
|
|
969
827
|
submit: () => {
|
|
970
828
|
FunUtil.throttle(async () => {
|
|
971
829
|
e.table.loading = !0;
|
|
972
|
-
const
|
|
973
|
-
await
|
|
974
|
-
_id: e.remove.items.map((
|
|
975
|
-
final(
|
|
830
|
+
const a = n.option.api.delete;
|
|
831
|
+
await a({
|
|
832
|
+
_id: e.remove.items.map((o) => o._id),
|
|
833
|
+
final(o, u, t) {
|
|
976
834
|
e.table.loading = !1;
|
|
977
835
|
}
|
|
978
|
-
}),
|
|
836
|
+
}), $.success("操作成功"), e.table.data.length <= 1 && e.page.num > 1 && (e.page.num -= 1), e.remove.close(), await e.table.getList();
|
|
979
837
|
});
|
|
980
838
|
}
|
|
981
839
|
},
|
|
@@ -983,12 +841,12 @@ const Se = { class: "dialog-footer" }, Ie = /* @__PURE__ */ H({
|
|
|
983
841
|
e.initCurdConfig(), e.initColumnOptions(), e.initColumnForm();
|
|
984
842
|
},
|
|
985
843
|
initCurdConfig: () => {
|
|
986
|
-
const
|
|
844
|
+
const o = {
|
|
987
845
|
tools: {
|
|
988
846
|
search: !0,
|
|
989
847
|
reset: !0,
|
|
990
848
|
expand: !1,
|
|
991
|
-
add: (
|
|
849
|
+
add: (t) => t === void 0,
|
|
992
850
|
update: !0,
|
|
993
851
|
delete: !0,
|
|
994
852
|
export: {
|
|
@@ -1001,9 +859,9 @@ const Se = { class: "dialog-footer" }, Ie = /* @__PURE__ */ H({
|
|
|
1001
859
|
emptyText: "暂无数据",
|
|
1002
860
|
highlightCurrentRow: !0
|
|
1003
861
|
}
|
|
1004
|
-
},
|
|
1005
|
-
Object.keys(
|
|
1006
|
-
|
|
862
|
+
}, u = n.option;
|
|
863
|
+
Object.keys(o).forEach((t) => {
|
|
864
|
+
u[t] = ObjectUtil.deepMerge(o[t], u[t] || {});
|
|
1007
865
|
});
|
|
1008
866
|
},
|
|
1009
867
|
/**
|
|
@@ -1012,27 +870,27 @@ const Se = { class: "dialog-footer" }, Ie = /* @__PURE__ */ H({
|
|
|
1012
870
|
* @returns
|
|
1013
871
|
*/
|
|
1014
872
|
initColumnOptions: () => {
|
|
1015
|
-
const
|
|
1016
|
-
const
|
|
873
|
+
const a = n.option, o = (u) => {
|
|
874
|
+
const l = {
|
|
1017
875
|
options: {
|
|
1018
876
|
switch: {
|
|
1019
877
|
activeValue: !0,
|
|
1020
878
|
activeLabel: "开启",
|
|
1021
879
|
inactiveValue: !1,
|
|
1022
880
|
inactiveLabel: "关闭",
|
|
1023
|
-
tableBeforeChange: async (
|
|
1024
|
-
const
|
|
881
|
+
tableBeforeChange: async (U, y) => {
|
|
882
|
+
const E = u.options?.switch;
|
|
1025
883
|
try {
|
|
1026
|
-
return await
|
|
884
|
+
return await c.value?.open({
|
|
1027
885
|
title: "确认修改",
|
|
1028
|
-
content: `确认要${
|
|
1029
|
-
}), e.table.loading = !0, await
|
|
1030
|
-
_id:
|
|
1031
|
-
[
|
|
1032
|
-
final(
|
|
886
|
+
content: `确认要${y[U] === E.activeValue ? E.inactiveLabel : E.activeLabel}吗?`
|
|
887
|
+
}), e.table.loading = !0, await n.option.api.update({
|
|
888
|
+
_id: y._id,
|
|
889
|
+
[U]: y[U] === E.activeValue ? E.inactiveValue : E.activeValue,
|
|
890
|
+
final(z, T, Q) {
|
|
1033
891
|
e.table.loading = !1;
|
|
1034
892
|
}
|
|
1035
|
-
}),
|
|
893
|
+
}), $.success("操作成功"), e.table.getList(), !0;
|
|
1036
894
|
} catch {
|
|
1037
895
|
return !1;
|
|
1038
896
|
}
|
|
@@ -1067,213 +925,213 @@ const Se = { class: "dialog-footer" }, Ie = /* @__PURE__ */ H({
|
|
|
1067
925
|
table: 0,
|
|
1068
926
|
form: 0
|
|
1069
927
|
}
|
|
1070
|
-
},
|
|
1071
|
-
Object.keys(
|
|
1072
|
-
|
|
928
|
+
}, h = u;
|
|
929
|
+
Object.keys(l).forEach((U) => {
|
|
930
|
+
h[U] = ObjectUtil.deepMerge(l[U], h[U] || {});
|
|
1073
931
|
});
|
|
1074
932
|
};
|
|
1075
|
-
|
|
933
|
+
a.column.forEach(o), a.table?.column?.forEach(o);
|
|
1076
934
|
},
|
|
1077
935
|
initColumnForm: () => {
|
|
1078
|
-
const
|
|
936
|
+
const a = n.option;
|
|
1079
937
|
e.update.formColumn = [], e.table.column.show = {
|
|
1080
938
|
list: [],
|
|
1081
939
|
listSource: []
|
|
1082
940
|
};
|
|
1083
|
-
const
|
|
1084
|
-
let
|
|
1085
|
-
const
|
|
1086
|
-
if (e.update.formDefault[
|
|
1087
|
-
|
|
1088
|
-
let
|
|
1089
|
-
const
|
|
1090
|
-
|
|
941
|
+
const o = [], u = n.option.form?.maxSpan || 12, t = n.option.form?.defaultSpan || u / 2;
|
|
942
|
+
let l = [];
|
|
943
|
+
const h = (y) => {
|
|
944
|
+
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
|
+
y.form = y.form || { span: t }, y.form.span = y.form.span ?? t;
|
|
946
|
+
let E = y.form.span, z = l.reduce((Q, ae) => Q + ae.span, E);
|
|
947
|
+
const T = l.length;
|
|
948
|
+
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
949
|
}
|
|
1092
950
|
};
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
}),
|
|
1096
|
-
|
|
1097
|
-
}), e.search.column.list =
|
|
1098
|
-
const
|
|
1099
|
-
|
|
1100
|
-
e.search.formDefault[
|
|
1101
|
-
}),
|
|
1102
|
-
|
|
951
|
+
a.column.forEach((y) => {
|
|
952
|
+
y.isForm = !0, h(y);
|
|
953
|
+
}), n.option.table?.column?.forEach((y) => {
|
|
954
|
+
y.isForm = !1, h(y);
|
|
955
|
+
}), 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;
|
|
956
|
+
const U = n.option.search?.formDefault;
|
|
957
|
+
U && Object.keys(U).forEach((y) => {
|
|
958
|
+
e.search.formDefault[y] = U[y];
|
|
959
|
+
}), a.column.forEach((y) => {
|
|
960
|
+
y.show?.search || (e.search.formDefault[y.key] = void 0);
|
|
1103
961
|
}), e.search.form = JSONUtil.cp(e.search.formDefault);
|
|
1104
962
|
}
|
|
1105
963
|
});
|
|
1106
|
-
return e.init(),
|
|
964
|
+
return e.init(), ee(() => {
|
|
1107
965
|
e.table.getList();
|
|
1108
|
-
}),
|
|
966
|
+
}), i({
|
|
1109
967
|
conf: e
|
|
1110
|
-
}), (
|
|
1111
|
-
const
|
|
1112
|
-
return
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
968
|
+
}), (a, o) => {
|
|
969
|
+
const u = ne("loading");
|
|
970
|
+
return f(), w("div", ve, [
|
|
971
|
+
S("div", Ce, [
|
|
972
|
+
k(a.$slots, "box-left"),
|
|
973
|
+
S("div", Ve, [
|
|
974
|
+
p.option.search?.show !== !1 ? (f(), w("div", De, [
|
|
975
|
+
v(d(J), {
|
|
1118
976
|
model: e.search.form,
|
|
1119
977
|
inline: ""
|
|
1120
978
|
}, {
|
|
1121
|
-
default:
|
|
1122
|
-
|
|
979
|
+
default: b(() => [
|
|
980
|
+
k(a.$slots, "search-start", {
|
|
1123
981
|
row: e.search.form
|
|
1124
982
|
}),
|
|
1125
|
-
(
|
|
1126
|
-
key:
|
|
983
|
+
(f(!0), w(x, null, F(e.search.column.list, (t) => (f(), w(x, {
|
|
984
|
+
key: t.key
|
|
1127
985
|
}, [
|
|
1128
|
-
(typeof
|
|
986
|
+
(typeof t.show?.search == "function" ? t.show?.search(e.search.form) : t.show?.search) ? (f(), g(d(M), {
|
|
1129
987
|
key: 0,
|
|
1130
|
-
label:
|
|
988
|
+
label: t.label
|
|
1131
989
|
}, {
|
|
1132
|
-
default:
|
|
1133
|
-
|
|
990
|
+
default: b(() => [
|
|
991
|
+
k(a.$slots, "search-" + t.key, {
|
|
1134
992
|
row: e.search.form
|
|
1135
993
|
}, () => [
|
|
1136
|
-
|
|
994
|
+
t.type === "input" ? (f(), g(d(K), {
|
|
1137
995
|
key: 0,
|
|
1138
|
-
modelValue: e.search.form[
|
|
1139
|
-
"onUpdate:modelValue": (
|
|
1140
|
-
placeholder: `请输入${
|
|
996
|
+
modelValue: e.search.form[t.key],
|
|
997
|
+
"onUpdate:modelValue": (l) => e.search.form[t.key] = l,
|
|
998
|
+
placeholder: `请输入${t.label}`,
|
|
1141
999
|
clearable: "",
|
|
1142
|
-
disabled:
|
|
1143
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) :
|
|
1000
|
+
disabled: t.disabled?.search
|
|
1001
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : t.type === "switch" ? (f(), g(d(_), {
|
|
1144
1002
|
key: 1,
|
|
1145
|
-
modelValue: e.search.form[
|
|
1146
|
-
"onUpdate:modelValue": (
|
|
1147
|
-
placeholder: `请选择${
|
|
1003
|
+
modelValue: e.search.form[t.key],
|
|
1004
|
+
"onUpdate:modelValue": (l) => e.search.form[t.key] = l,
|
|
1005
|
+
placeholder: `请选择${t.label}`,
|
|
1148
1006
|
clearable: "",
|
|
1149
|
-
disabled:
|
|
1007
|
+
disabled: t.disabled?.search
|
|
1150
1008
|
}, {
|
|
1151
|
-
default:
|
|
1152
|
-
(
|
|
1153
|
-
key:
|
|
1154
|
-
label:
|
|
1155
|
-
value:
|
|
1009
|
+
default: b(() => [
|
|
1010
|
+
(f(), g(d(R), {
|
|
1011
|
+
key: t.options?.switch?.activeValue,
|
|
1012
|
+
label: t.options?.switch?.activeLabel,
|
|
1013
|
+
value: t.options?.switch?.activeValue
|
|
1156
1014
|
}, null, 8, ["label", "value"])),
|
|
1157
|
-
(
|
|
1158
|
-
key:
|
|
1159
|
-
label:
|
|
1160
|
-
value:
|
|
1015
|
+
(f(), g(d(R), {
|
|
1016
|
+
key: t.options?.switch?.inactiveValue,
|
|
1017
|
+
label: t.options?.switch?.inactiveLabel,
|
|
1018
|
+
value: t.options?.switch?.inactiveValue
|
|
1161
1019
|
}, null, 8, ["label", "value"]))
|
|
1162
1020
|
]),
|
|
1163
1021
|
_: 2
|
|
1164
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) :
|
|
1022
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : t.type === "select" ? (f(), g(d(_), {
|
|
1165
1023
|
key: 2,
|
|
1166
|
-
modelValue: e.search.form[
|
|
1167
|
-
"onUpdate:modelValue": (
|
|
1168
|
-
placeholder: `请选择${
|
|
1024
|
+
modelValue: e.search.form[t.key],
|
|
1025
|
+
"onUpdate:modelValue": (l) => e.search.form[t.key] = l,
|
|
1026
|
+
placeholder: `请选择${t.label}`,
|
|
1169
1027
|
clearable: "",
|
|
1170
|
-
disabled:
|
|
1028
|
+
disabled: t.disabled?.search
|
|
1171
1029
|
}, {
|
|
1172
|
-
default:
|
|
1173
|
-
(
|
|
1174
|
-
key:
|
|
1175
|
-
label:
|
|
1176
|
-
value:
|
|
1030
|
+
default: b(() => [
|
|
1031
|
+
(f(!0), w(x, null, F(t.options?.select?.data, (l) => (f(), g(d(R), {
|
|
1032
|
+
key: l.value,
|
|
1033
|
+
label: l.label,
|
|
1034
|
+
value: l.value
|
|
1177
1035
|
}, null, 8, ["label", "value"]))), 128))
|
|
1178
1036
|
]),
|
|
1179
1037
|
_: 2
|
|
1180
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) :
|
|
1038
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : C("", !0)
|
|
1181
1039
|
])
|
|
1182
1040
|
]),
|
|
1183
1041
|
_: 2
|
|
1184
|
-
}, 1032, ["label"])) :
|
|
1042
|
+
}, 1032, ["label"])) : C("", !0)
|
|
1185
1043
|
], 64))), 128)),
|
|
1186
|
-
|
|
1044
|
+
k(a.$slots, "search-center", {
|
|
1187
1045
|
row: e.search.form
|
|
1188
1046
|
}),
|
|
1189
|
-
|
|
1190
|
-
default:
|
|
1191
|
-
|
|
1047
|
+
v(d(M), null, {
|
|
1048
|
+
default: b(() => [
|
|
1049
|
+
p.option.tools?.search ? (f(), g(d(O), {
|
|
1192
1050
|
key: 0,
|
|
1193
1051
|
type: "primary",
|
|
1194
1052
|
onClick: e.search.submit
|
|
1195
1053
|
}, {
|
|
1196
|
-
default:
|
|
1197
|
-
|
|
1054
|
+
default: b(() => [...o[7] || (o[7] = [
|
|
1055
|
+
V(" 搜索 ", -1)
|
|
1198
1056
|
])]),
|
|
1199
1057
|
_: 1
|
|
1200
|
-
}, 8, ["onClick"])) :
|
|
1201
|
-
|
|
1058
|
+
}, 8, ["onClick"])) : C("", !0),
|
|
1059
|
+
p.option.tools?.reset ? (f(), g(d(O), {
|
|
1202
1060
|
key: 1,
|
|
1203
1061
|
onClick: e.search.reset
|
|
1204
1062
|
}, {
|
|
1205
|
-
default:
|
|
1206
|
-
|
|
1063
|
+
default: b(() => [...o[8] || (o[8] = [
|
|
1064
|
+
V("重置", -1)
|
|
1207
1065
|
])]),
|
|
1208
1066
|
_: 1
|
|
1209
|
-
}, 8, ["onClick"])) :
|
|
1067
|
+
}, 8, ["onClick"])) : C("", !0)
|
|
1210
1068
|
]),
|
|
1211
1069
|
_: 1
|
|
1212
1070
|
}),
|
|
1213
|
-
|
|
1071
|
+
k(a.$slots, "search-end", {
|
|
1214
1072
|
row: e.search.form
|
|
1215
1073
|
})
|
|
1216
1074
|
]),
|
|
1217
1075
|
_: 3
|
|
1218
1076
|
}, 8, ["model"])
|
|
1219
|
-
])) :
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1077
|
+
])) : C("", !0),
|
|
1078
|
+
S("div", Ee, [
|
|
1079
|
+
S("div", Ue, [
|
|
1080
|
+
d(s)(p.option.tools?.add) ? (f(), w("div", xe, [
|
|
1081
|
+
v(d(O), {
|
|
1224
1082
|
type: "primary",
|
|
1225
|
-
onClick:
|
|
1083
|
+
onClick: o[0] || (o[0] = (t) => e.update.open(d(r).Insert))
|
|
1226
1084
|
}, {
|
|
1227
|
-
default:
|
|
1228
|
-
|
|
1085
|
+
default: b(() => [...o[9] || (o[9] = [
|
|
1086
|
+
V("新增", -1)
|
|
1229
1087
|
])]),
|
|
1230
1088
|
_: 1
|
|
1231
1089
|
})
|
|
1232
|
-
])) :
|
|
1233
|
-
|
|
1234
|
-
|
|
1090
|
+
])) : C("", !0),
|
|
1091
|
+
p.option.table?.selectable && d(s)(p.option.tools?.delete) ? (f(), w("div", $e, [
|
|
1092
|
+
v(d(O), {
|
|
1235
1093
|
type: "danger",
|
|
1236
|
-
onClick:
|
|
1094
|
+
onClick: o[1] || (o[1] = (t) => e.remove.open(e.table.selection.list))
|
|
1237
1095
|
}, {
|
|
1238
|
-
default:
|
|
1239
|
-
|
|
1096
|
+
default: b(() => [...o[10] || (o[10] = [
|
|
1097
|
+
V(" 删除 ", -1)
|
|
1240
1098
|
])]),
|
|
1241
1099
|
_: 1
|
|
1242
1100
|
})
|
|
1243
|
-
])) :
|
|
1244
|
-
|
|
1245
|
-
|
|
1101
|
+
])) : C("", !0),
|
|
1102
|
+
p.option.tools?.expand ? (f(), w("div", Oe, [
|
|
1103
|
+
v(d(O), {
|
|
1246
1104
|
type: "warning",
|
|
1247
|
-
onClick:
|
|
1105
|
+
onClick: o[2] || (o[2] = (t) => e.table.expand.all())
|
|
1248
1106
|
}, {
|
|
1249
|
-
default:
|
|
1250
|
-
|
|
1107
|
+
default: b(() => [...o[11] || (o[11] = [
|
|
1108
|
+
V("展开/收缩", -1)
|
|
1251
1109
|
])]),
|
|
1252
1110
|
_: 1
|
|
1253
1111
|
})
|
|
1254
|
-
])) :
|
|
1255
|
-
|
|
1112
|
+
])) : C("", !0),
|
|
1113
|
+
p.option.tools?.export?.show ? (f(), g(d(ue), {
|
|
1256
1114
|
key: 3,
|
|
1257
1115
|
onCommand: e.table.export
|
|
1258
1116
|
}, {
|
|
1259
|
-
dropdown:
|
|
1260
|
-
|
|
1261
|
-
default:
|
|
1262
|
-
|
|
1263
|
-
default:
|
|
1264
|
-
|
|
1117
|
+
dropdown: b(() => [
|
|
1118
|
+
v(d(fe), null, {
|
|
1119
|
+
default: b(() => [
|
|
1120
|
+
v(d(P), { command: "select" }, {
|
|
1121
|
+
default: b(() => [...o[13] || (o[13] = [
|
|
1122
|
+
V("导出选中", -1)
|
|
1265
1123
|
])]),
|
|
1266
1124
|
_: 1
|
|
1267
1125
|
}),
|
|
1268
|
-
|
|
1269
|
-
default:
|
|
1270
|
-
|
|
1126
|
+
v(d(P), { command: "page" }, {
|
|
1127
|
+
default: b(() => [...o[14] || (o[14] = [
|
|
1128
|
+
V("导出本页", -1)
|
|
1271
1129
|
])]),
|
|
1272
1130
|
_: 1
|
|
1273
1131
|
}),
|
|
1274
|
-
|
|
1275
|
-
default:
|
|
1276
|
-
|
|
1132
|
+
v(d(P), { command: "all" }, {
|
|
1133
|
+
default: b(() => [...o[15] || (o[15] = [
|
|
1134
|
+
V("导出全部", -1)
|
|
1277
1135
|
])]),
|
|
1278
1136
|
_: 1
|
|
1279
1137
|
})
|
|
@@ -1281,126 +1139,126 @@ const Se = { class: "dialog-footer" }, Ie = /* @__PURE__ */ H({
|
|
|
1281
1139
|
_: 1
|
|
1282
1140
|
})
|
|
1283
1141
|
]),
|
|
1284
|
-
default:
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
default:
|
|
1288
|
-
|
|
1142
|
+
default: b(() => [
|
|
1143
|
+
S("div", Se, [
|
|
1144
|
+
v(d(O), { type: "warning" }, {
|
|
1145
|
+
default: b(() => [...o[12] || (o[12] = [
|
|
1146
|
+
V("导出", -1)
|
|
1289
1147
|
])]),
|
|
1290
1148
|
_: 1
|
|
1291
1149
|
})
|
|
1292
1150
|
])
|
|
1293
1151
|
]),
|
|
1294
1152
|
_: 1
|
|
1295
|
-
}, 8, ["onCommand"])) :
|
|
1296
|
-
|
|
1153
|
+
}, 8, ["onCommand"])) : C("", !0),
|
|
1154
|
+
k(a.$slots, "tools-left")
|
|
1297
1155
|
]),
|
|
1298
|
-
|
|
1299
|
-
|
|
1156
|
+
S("div", Fe, [
|
|
1157
|
+
k(a.$slots, "tools-right")
|
|
1300
1158
|
])
|
|
1301
1159
|
]),
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1160
|
+
S("div", Ie, [
|
|
1161
|
+
S("div", Le, [
|
|
1162
|
+
re((f(), g(d(pe), D({
|
|
1305
1163
|
data: e.table.data
|
|
1306
|
-
},
|
|
1164
|
+
}, p.option.table, {
|
|
1307
1165
|
onSelectionChange: e.table.selection.change,
|
|
1308
1166
|
"expand-row-keys": e.table.expand.rowKeys,
|
|
1309
1167
|
onExpandChange: e.table.expand.change
|
|
1310
1168
|
}), {
|
|
1311
|
-
default:
|
|
1312
|
-
|
|
1169
|
+
default: b(() => [
|
|
1170
|
+
p.option.table?.selectable && d(s)(p.option.tools?.delete) ? (f(), g(d(B), {
|
|
1313
1171
|
key: 0,
|
|
1314
1172
|
type: "selection",
|
|
1315
|
-
selectable: typeof
|
|
1173
|
+
selectable: typeof p.option.table?.selectable == "function" ? p.option.table?.selectable : void 0,
|
|
1316
1174
|
width: "55"
|
|
1317
|
-
}, null, 8, ["selectable"])) :
|
|
1318
|
-
(
|
|
1319
|
-
key:
|
|
1175
|
+
}, null, 8, ["selectable"])) : C("", !0),
|
|
1176
|
+
(f(!0), w(x, null, F(e.table.column.list, (t) => (f(), w(x, {
|
|
1177
|
+
key: t.key
|
|
1320
1178
|
}, [
|
|
1321
|
-
e.table.column.show.list.includes(
|
|
1179
|
+
e.table.column.show.list.includes(t.key) ? (f(), g(d(B), D({
|
|
1322
1180
|
key: 0,
|
|
1323
|
-
prop:
|
|
1324
|
-
label:
|
|
1325
|
-
}, { ref_for: !0 },
|
|
1326
|
-
default:
|
|
1327
|
-
|
|
1328
|
-
row:
|
|
1329
|
-
item:
|
|
1181
|
+
prop: t.key,
|
|
1182
|
+
label: t.label
|
|
1183
|
+
}, { ref_for: !0 }, t.table), {
|
|
1184
|
+
default: b(({ row: l }) => [
|
|
1185
|
+
k(a.$slots, "table-" + t.key, {
|
|
1186
|
+
row: l,
|
|
1187
|
+
item: t
|
|
1330
1188
|
}, () => [
|
|
1331
|
-
|
|
1189
|
+
t.type === "switch" ? (f(), g(d(H), D({
|
|
1332
1190
|
key: 0,
|
|
1333
|
-
modelValue:
|
|
1334
|
-
"onUpdate:modelValue": (
|
|
1335
|
-
"before-change": () =>
|
|
1336
|
-
}, { ref_for: !0 },
|
|
1337
|
-
|
|
1191
|
+
modelValue: l[t.key],
|
|
1192
|
+
"onUpdate:modelValue": (h) => l[t.key] = h,
|
|
1193
|
+
"before-change": () => t.options?.switch?.tableBeforeChange?.(t.key, l)
|
|
1194
|
+
}, { ref_for: !0 }, t.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "before-change"])) : (f(), w(x, { key: 1 }, [
|
|
1195
|
+
V(A(l[t.key]), 1)
|
|
1338
1196
|
], 64))
|
|
1339
1197
|
])
|
|
1340
1198
|
]),
|
|
1341
1199
|
_: 2
|
|
1342
|
-
}, 1040, ["prop", "label"])) :
|
|
1200
|
+
}, 1040, ["prop", "label"])) : C("", !0)
|
|
1343
1201
|
], 64))), 128)),
|
|
1344
|
-
|
|
1202
|
+
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
1203
|
key: 1,
|
|
1346
1204
|
label: "操作",
|
|
1347
1205
|
width: "180",
|
|
1348
1206
|
align: "center",
|
|
1349
1207
|
fixed: "right"
|
|
1350
1208
|
}, {
|
|
1351
|
-
default:
|
|
1352
|
-
|
|
1353
|
-
|
|
1209
|
+
default: b(({ row: t }) => [
|
|
1210
|
+
k(a.$slots, "table-op-left", { row: t }),
|
|
1211
|
+
d(s)(p.option.tools?.add, t) ? (f(), g(d(O), {
|
|
1354
1212
|
key: 0,
|
|
1355
1213
|
link: "",
|
|
1356
1214
|
type: "primary",
|
|
1357
|
-
onClick: (
|
|
1215
|
+
onClick: (l) => e.update.open(d(r).Insert, t)
|
|
1358
1216
|
}, {
|
|
1359
|
-
default:
|
|
1360
|
-
|
|
1217
|
+
default: b(() => [...o[16] || (o[16] = [
|
|
1218
|
+
V(" 新增 ", -1)
|
|
1361
1219
|
])]),
|
|
1362
1220
|
_: 1
|
|
1363
|
-
}, 8, ["onClick"])) :
|
|
1364
|
-
|
|
1221
|
+
}, 8, ["onClick"])) : C("", !0),
|
|
1222
|
+
d(s)(p.option.tools?.update, t) ? (f(), g(d(O), {
|
|
1365
1223
|
key: 1,
|
|
1366
1224
|
link: "",
|
|
1367
1225
|
type: "warning",
|
|
1368
|
-
onClick: (
|
|
1226
|
+
onClick: (l) => e.update.open(d(r).Update, t)
|
|
1369
1227
|
}, {
|
|
1370
|
-
default:
|
|
1371
|
-
|
|
1228
|
+
default: b(() => [...o[17] || (o[17] = [
|
|
1229
|
+
V(" 编辑 ", -1)
|
|
1372
1230
|
])]),
|
|
1373
1231
|
_: 1
|
|
1374
|
-
}, 8, ["onClick"])) :
|
|
1375
|
-
|
|
1232
|
+
}, 8, ["onClick"])) : C("", !0),
|
|
1233
|
+
d(s)(p.option.tools?.delete, t) ? (f(), g(d(O), {
|
|
1376
1234
|
key: 2,
|
|
1377
1235
|
link: "",
|
|
1378
1236
|
type: "danger",
|
|
1379
|
-
onClick: (
|
|
1237
|
+
onClick: (l) => e.remove.open([t])
|
|
1380
1238
|
}, {
|
|
1381
|
-
default:
|
|
1382
|
-
|
|
1239
|
+
default: b(() => [...o[18] || (o[18] = [
|
|
1240
|
+
V(" 删除 ", -1)
|
|
1383
1241
|
])]),
|
|
1384
1242
|
_: 1
|
|
1385
|
-
}, 8, ["onClick"])) :
|
|
1386
|
-
|
|
1243
|
+
}, 8, ["onClick"])) : C("", !0),
|
|
1244
|
+
k(a.$slots, "table-op-right", { row: t })
|
|
1387
1245
|
]),
|
|
1388
1246
|
_: 3
|
|
1389
|
-
})) :
|
|
1247
|
+
})) : C("", !0)
|
|
1390
1248
|
]),
|
|
1391
1249
|
_: 3
|
|
1392
1250
|
}, 16, ["data", "onSelectionChange", "expand-row-keys", "onExpandChange"])), [
|
|
1393
|
-
[
|
|
1251
|
+
[u, e.table.loading]
|
|
1394
1252
|
])
|
|
1395
1253
|
])
|
|
1396
1254
|
]),
|
|
1397
|
-
|
|
1398
|
-
e.page.total > e.page.size ? (
|
|
1255
|
+
S("div", je, [
|
|
1256
|
+
e.page.total > e.page.size ? (f(), g(d(ce), {
|
|
1399
1257
|
key: 0,
|
|
1400
1258
|
"current-page": e.page.num,
|
|
1401
|
-
"onUpdate:currentPage":
|
|
1259
|
+
"onUpdate:currentPage": o[3] || (o[3] = (t) => e.page.num = t),
|
|
1402
1260
|
"page-size": e.page.size,
|
|
1403
|
-
"onUpdate:pageSize":
|
|
1261
|
+
"onUpdate:pageSize": o[4] || (o[4] = (t) => e.page.size = t),
|
|
1404
1262
|
background: "",
|
|
1405
1263
|
"page-sizes": e.page.sizeList,
|
|
1406
1264
|
"pager-count": 7,
|
|
@@ -1408,200 +1266,200 @@ const Se = { class: "dialog-footer" }, Ie = /* @__PURE__ */ H({
|
|
|
1408
1266
|
total: e.page.total,
|
|
1409
1267
|
onSizeChange: e.table.getList,
|
|
1410
1268
|
onCurrentChange: e.table.getList
|
|
1411
|
-
}, null, 8, ["current-page", "page-size", "page-sizes", "layout", "total", "onSizeChange", "onCurrentChange"])) :
|
|
1269
|
+
}, null, 8, ["current-page", "page-size", "page-sizes", "layout", "total", "onSizeChange", "onCurrentChange"])) : C("", !0)
|
|
1412
1270
|
])
|
|
1413
1271
|
]),
|
|
1414
|
-
|
|
1272
|
+
k(a.$slots, "box-right")
|
|
1415
1273
|
]),
|
|
1416
|
-
|
|
1274
|
+
v(d(G), D({
|
|
1417
1275
|
modelValue: e.update.show,
|
|
1418
|
-
"onUpdate:modelValue":
|
|
1276
|
+
"onUpdate:modelValue": o[5] || (o[5] = (t) => e.update.show = t),
|
|
1419
1277
|
title: e.update.title,
|
|
1420
1278
|
"close-on-click-modal": !1,
|
|
1421
1279
|
"before-close": e.update.close
|
|
1422
|
-
},
|
|
1423
|
-
footer:
|
|
1424
|
-
|
|
1425
|
-
|
|
1280
|
+
}, p.option.dialog), {
|
|
1281
|
+
footer: b(() => [
|
|
1282
|
+
S("span", Te, [
|
|
1283
|
+
v(d(O), {
|
|
1426
1284
|
onClick: e.update.close
|
|
1427
1285
|
}, {
|
|
1428
|
-
default:
|
|
1429
|
-
|
|
1286
|
+
default: b(() => [...o[19] || (o[19] = [
|
|
1287
|
+
V("关闭", -1)
|
|
1430
1288
|
])]),
|
|
1431
1289
|
_: 1
|
|
1432
1290
|
}, 8, ["onClick"]),
|
|
1433
|
-
|
|
1291
|
+
v(d(O), {
|
|
1434
1292
|
type: "primary",
|
|
1435
1293
|
onClick: e.update.submit,
|
|
1436
1294
|
loading: e.update.loading
|
|
1437
1295
|
}, {
|
|
1438
|
-
default:
|
|
1439
|
-
|
|
1296
|
+
default: b(() => [...o[20] || (o[20] = [
|
|
1297
|
+
V(" 提交 ", -1)
|
|
1440
1298
|
])]),
|
|
1441
1299
|
_: 1
|
|
1442
1300
|
}, 8, ["onClick", "loading"])
|
|
1443
1301
|
])
|
|
1444
1302
|
]),
|
|
1445
|
-
default:
|
|
1446
|
-
|
|
1303
|
+
default: b(() => [
|
|
1304
|
+
v(d(J), {
|
|
1447
1305
|
ref_key: "ruleFormRef",
|
|
1448
|
-
ref:
|
|
1306
|
+
ref: m,
|
|
1449
1307
|
model: e.update.form,
|
|
1450
1308
|
rules: e.update.rules
|
|
1451
1309
|
}, {
|
|
1452
|
-
default:
|
|
1453
|
-
e.update.showContent ? (
|
|
1454
|
-
|
|
1310
|
+
default: b(() => [
|
|
1311
|
+
e.update.showContent ? (f(!0), w(x, { key: 0 }, F(e.update.formColumn, (t) => (f(), w("div", ze, [
|
|
1312
|
+
k(a.$slots, "form-start", {
|
|
1455
1313
|
row: e.update.form
|
|
1456
1314
|
}),
|
|
1457
|
-
(
|
|
1458
|
-
|
|
1315
|
+
(f(!0), w(x, null, F(t, (l) => (f(), w(x, null, [
|
|
1316
|
+
d(s)(l.item.show?.form, e.update.form) ? (f(), w("div", {
|
|
1459
1317
|
key: 0,
|
|
1460
|
-
class:
|
|
1318
|
+
class: X(l.item.form.span > 0 ? `col-${l.item.form.span}` : "col")
|
|
1461
1319
|
}, [
|
|
1462
|
-
|
|
1463
|
-
label:
|
|
1464
|
-
prop:
|
|
1465
|
-
"label-width":
|
|
1320
|
+
v(d(M), {
|
|
1321
|
+
label: l.item.label,
|
|
1322
|
+
prop: l.item.key,
|
|
1323
|
+
"label-width": l.item.form?.labelWidth || "100px"
|
|
1466
1324
|
}, {
|
|
1467
|
-
default:
|
|
1468
|
-
|
|
1325
|
+
default: b(() => [
|
|
1326
|
+
k(a.$slots, "form-" + l.item.key + "-start", {
|
|
1469
1327
|
row: e.update.form,
|
|
1470
|
-
item:
|
|
1328
|
+
item: l.item
|
|
1471
1329
|
}),
|
|
1472
|
-
|
|
1330
|
+
k(a.$slots, "form-" + l.item.key, {
|
|
1473
1331
|
row: e.update.form,
|
|
1474
|
-
item:
|
|
1332
|
+
item: l.item
|
|
1475
1333
|
}, () => [
|
|
1476
|
-
|
|
1334
|
+
l.item.type === "input" ? (f(), g(d(K), D({
|
|
1477
1335
|
key: 0,
|
|
1478
|
-
modelValue: e.update.form[
|
|
1479
|
-
"onUpdate:modelValue": (
|
|
1480
|
-
}, { ref_for: !0 },
|
|
1481
|
-
disabled: e.update.getDisabled(
|
|
1482
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
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({
|
|
1483
1341
|
key: 1,
|
|
1484
|
-
modelValue: e.update.form[
|
|
1485
|
-
"onUpdate:modelValue": (
|
|
1486
|
-
}, { ref_for: !0 },
|
|
1487
|
-
disabled: e.update.getDisabled(
|
|
1488
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
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({
|
|
1489
1347
|
key: 2,
|
|
1490
|
-
modelValue: e.update.form[
|
|
1491
|
-
"onUpdate:modelValue": (
|
|
1492
|
-
}, { ref_for: !0 },
|
|
1493
|
-
disabled: e.update.getDisabled(
|
|
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),
|
|
1494
1352
|
style: { width: "100%" }
|
|
1495
1353
|
}), {
|
|
1496
|
-
default:
|
|
1497
|
-
(
|
|
1498
|
-
key:
|
|
1499
|
-
label:
|
|
1500
|
-
value:
|
|
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
|
|
1501
1359
|
}, null, 8, ["label", "value"]))), 128))
|
|
1502
1360
|
]),
|
|
1503
1361
|
_: 2
|
|
1504
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
1362
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : l.item.type === "list" ? (f(), g(oe, D({
|
|
1505
1363
|
key: 3,
|
|
1506
1364
|
row: e.update.form,
|
|
1507
|
-
field:
|
|
1508
|
-
}, { ref_for: !0 },
|
|
1509
|
-
disabled: e.update.getDisabled(
|
|
1365
|
+
field: l.item.key
|
|
1366
|
+
}, { ref_for: !0 }, l.item.options?.list, {
|
|
1367
|
+
disabled: e.update.getDisabled(l.item),
|
|
1510
1368
|
style: { width: "100%" }
|
|
1511
|
-
}), null, 16, ["row", "field", "disabled"])) :
|
|
1369
|
+
}), null, 16, ["row", "field", "disabled"])) : l.item.type === "tree-select" ? (f(), g(d(te), D({
|
|
1512
1370
|
key: 4,
|
|
1513
|
-
modelValue: e.update.form[
|
|
1514
|
-
"onUpdate:modelValue": (
|
|
1515
|
-
}, { ref_for: !0 },
|
|
1516
|
-
disabled: e.update.getDisabled(
|
|
1371
|
+
modelValue: e.update.form[l.item.key],
|
|
1372
|
+
"onUpdate:modelValue": (h) => e.update.form[l.item.key] = h
|
|
1373
|
+
}, { ref_for: !0 }, l.item.options?.treeSelect, {
|
|
1374
|
+
disabled: e.update.getDisabled(l.item),
|
|
1517
1375
|
style: { width: "100%" }
|
|
1518
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
1376
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : l.item.type === "datetime" ? (f(), g(d(le), D({
|
|
1519
1377
|
key: 5,
|
|
1520
|
-
modelValue: e.update.form[
|
|
1521
|
-
"onUpdate:modelValue": (
|
|
1522
|
-
}, { ref_for: !0 },
|
|
1523
|
-
disabled: e.update.getDisabled(
|
|
1524
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
1378
|
+
modelValue: e.update.form[l.item.key],
|
|
1379
|
+
"onUpdate:modelValue": (h) => e.update.form[l.item.key] = h
|
|
1380
|
+
}, { ref_for: !0 }, l.item.options?.datetime, {
|
|
1381
|
+
disabled: e.update.getDisabled(l.item)
|
|
1382
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : d(L).customComponent[l.item.type] ? (f(), g(Z(d(L).customComponent[l.item.type]), D({
|
|
1525
1383
|
key: 6,
|
|
1526
|
-
modelValue: e.update.form[
|
|
1527
|
-
"onUpdate:modelValue": (
|
|
1528
|
-
}, { ref_for: !0 },
|
|
1529
|
-
disabled: e.update.getDisabled(
|
|
1530
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
1384
|
+
modelValue: e.update.form[l.item.key],
|
|
1385
|
+
"onUpdate:modelValue": (h) => e.update.form[l.item.key] = h
|
|
1386
|
+
}, { ref_for: !0 }, l.item.options?.[l.item.type], {
|
|
1387
|
+
disabled: e.update.getDisabled(l.item)
|
|
1388
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0)
|
|
1531
1389
|
]),
|
|
1532
|
-
|
|
1390
|
+
k(a.$slots, "form-" + l.item.key + "-end", {
|
|
1533
1391
|
row: e.update.form,
|
|
1534
|
-
item:
|
|
1392
|
+
item: l.item
|
|
1535
1393
|
})
|
|
1536
1394
|
]),
|
|
1537
1395
|
_: 2
|
|
1538
1396
|
}, 1032, ["label", "prop", "label-width"])
|
|
1539
|
-
], 2)) :
|
|
1397
|
+
], 2)) : C("", !0)
|
|
1540
1398
|
], 64))), 256)),
|
|
1541
|
-
|
|
1399
|
+
k(a.$slots, "form-end", {
|
|
1542
1400
|
row: e.update.form
|
|
1543
1401
|
})
|
|
1544
|
-
]))), 256)) :
|
|
1402
|
+
]))), 256)) : C("", !0)
|
|
1545
1403
|
]),
|
|
1546
1404
|
_: 3
|
|
1547
1405
|
}, 8, ["model", "rules"])
|
|
1548
1406
|
]),
|
|
1549
1407
|
_: 3
|
|
1550
1408
|
}, 16, ["modelValue", "title", "before-close"]),
|
|
1551
|
-
|
|
1409
|
+
v(d(G), {
|
|
1552
1410
|
modelValue: e.remove.show,
|
|
1553
|
-
"onUpdate:modelValue":
|
|
1411
|
+
"onUpdate:modelValue": o[6] || (o[6] = (t) => e.remove.show = t),
|
|
1554
1412
|
title: e.remove.title,
|
|
1555
1413
|
"close-on-click-modal": !1
|
|
1556
1414
|
}, {
|
|
1557
|
-
footer:
|
|
1558
|
-
|
|
1559
|
-
|
|
1415
|
+
footer: b(() => [
|
|
1416
|
+
S("span", Re, [
|
|
1417
|
+
v(d(O), {
|
|
1560
1418
|
onClick: e.remove.close
|
|
1561
1419
|
}, {
|
|
1562
|
-
default:
|
|
1563
|
-
|
|
1420
|
+
default: b(() => [...o[21] || (o[21] = [
|
|
1421
|
+
V("关闭", -1)
|
|
1564
1422
|
])]),
|
|
1565
1423
|
_: 1
|
|
1566
1424
|
}, 8, ["onClick"]),
|
|
1567
|
-
|
|
1425
|
+
v(d(O), {
|
|
1568
1426
|
type: "danger",
|
|
1569
1427
|
onClick: e.remove.submit,
|
|
1570
1428
|
loading: e.remove.loading
|
|
1571
1429
|
}, {
|
|
1572
|
-
default:
|
|
1573
|
-
|
|
1430
|
+
default: b(() => [...o[22] || (o[22] = [
|
|
1431
|
+
V(" 确认删除 ", -1)
|
|
1574
1432
|
])]),
|
|
1575
1433
|
_: 1
|
|
1576
1434
|
}, 8, ["onClick", "loading"])
|
|
1577
1435
|
])
|
|
1578
1436
|
]),
|
|
1579
|
-
default:
|
|
1580
|
-
|
|
1437
|
+
default: b(() => [
|
|
1438
|
+
S("div", null, "确认要删除【" + A(e.remove.items.length) + "】条数据吗?", 1)
|
|
1581
1439
|
]),
|
|
1582
1440
|
_: 1
|
|
1583
1441
|
}, 8, ["modelValue", "title"]),
|
|
1584
|
-
|
|
1442
|
+
v(ke, {
|
|
1585
1443
|
ref_key: "switchConfirmRef",
|
|
1586
|
-
ref:
|
|
1444
|
+
ref: c
|
|
1587
1445
|
}, null, 512)
|
|
1588
1446
|
]);
|
|
1589
1447
|
};
|
|
1590
1448
|
}
|
|
1591
|
-
}),
|
|
1592
|
-
if (
|
|
1593
|
-
|
|
1594
|
-
for (const
|
|
1595
|
-
|
|
1449
|
+
}), Pe = (p, i) => {
|
|
1450
|
+
if (p.component("TCurd", Me), p.component("TFormList", oe), p.component("TColumn", be), i?.customComponent) {
|
|
1451
|
+
L.customComponent = i.customComponent;
|
|
1452
|
+
for (const r in i.customComponent)
|
|
1453
|
+
p.component(r, i.customComponent[r]);
|
|
1596
1454
|
}
|
|
1597
1455
|
};
|
|
1598
1456
|
export {
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1457
|
+
I as ArrUtil,
|
|
1458
|
+
ge as ExcelUtil,
|
|
1459
|
+
be as TColumn,
|
|
1460
|
+
Me as TCurd,
|
|
1461
|
+
L as TForm,
|
|
1462
|
+
oe as TFormList,
|
|
1463
|
+
$ as TSys,
|
|
1464
|
+
Pe as install
|
|
1607
1465
|
};
|