cc1-form 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cc1-form.js CHANGED
@@ -1,5 +1,5 @@
1
- import { defineComponent as A, reactive as X, onMounted as ee, resolveComponent as Z, createElementBlock as w, createCommentVNode as k, openBlock as c, renderSlot as v, createElementVNode as x, createVNode as C, withCtx as h, createTextVNode as V, Fragment as $, renderList as L, createBlock as g, normalizeClass as T, normalizeStyle as se, ref as R, nextTick as ne, unref as u, mergeProps as U, toHandlers as I, resolveDynamicComponent as te, toDisplayString as _, resolveDirective as re, withDirectives as ie } from "vue";
2
- import { ElMessage as de, ElLoading as ue, ElForm as K, ElFormItem as P, ElInput as H, ElSwitch as G, ElSelect as B, ElOption as N, ElTreeSelect as oe, ElDatePicker as le, ElDialog as q, ElButton as O, ElDropdown as ce, ElDropdownMenu as pe, ElDropdownItem as J, ElTable as fe, ElTableColumn as W, ElPagination as me } from "element-plus";
1
+ import { defineComponent as B, reactive as X, onMounted as ee, resolveComponent as Z, createElementBlock as w, createCommentVNode as k, openBlock as c, renderSlot as C, createElementVNode as x, createVNode as v, withCtx as h, createTextVNode as V, Fragment as $, renderList as L, createBlock as g, normalizeClass as R, normalizeStyle as se, ref as T, nextTick as ne, unref as u, mergeProps as U, toHandlers as I, resolveDynamicComponent as te, toDisplayString as W, resolveDirective as re, withDirectives as ie } from "vue";
2
+ import { ElMessage as de, ElLoading as ue, ElForm as K, ElFormItem as P, ElInput as H, ElSwitch as G, ElSelect as _, ElOption as N, ElTreeSelect as oe, ElDatePicker as le, ElDialog as q, ElButton as F, ElDropdown as ce, ElDropdownMenu as pe, ElDropdownItem as A, ElTable as fe, ElTableColumn as J, ElPagination as me } from "element-plus";
3
3
  class D {
4
4
  /**
5
5
  * 路由
@@ -24,7 +24,7 @@ class D {
24
24
  * @param data 数据
25
25
  * @returns 是否显示
26
26
  */
27
- static isFun = (i, d) => Array.isArray(i) ? i.some((n) => typeof n == "function" ? n(d) : n) : typeof i == "function" ? i(d) : i;
27
+ static isFun = (i, d) => Array.isArray(i) ? i.some((s) => typeof s == "function" ? s(d) : s) : typeof i == "function" ? i(d) : i;
28
28
  /**
29
29
  * 获取路由参数,自动获取query、params中的参数, 哪个有就返回哪个
30
30
  */
@@ -60,16 +60,16 @@ class D {
60
60
  * @param type 消息类型
61
61
  * @param options 其他选项
62
62
  */
63
- static showMessage(i, d, n = {}) {
64
- const p = Date.now();
65
- if (!this.tipMessages[i] || p - this.tipMessages[i] > this.tipMessagesGap) {
66
- this.tipMessages[i] = p;
63
+ static showMessage(i, d, s = {}) {
64
+ const f = Date.now();
65
+ if (!this.tipMessages[i] || f - this.tipMessages[i] > this.tipMessagesGap) {
66
+ this.tipMessages[i] = f;
67
67
  const m = Object.assign(
68
68
  {
69
69
  message: i,
70
70
  type: d
71
71
  },
72
- n
72
+ s
73
73
  );
74
74
  de(m), setTimeout(() => {
75
75
  delete this.tipMessages[i];
@@ -115,11 +115,11 @@ class D {
115
115
  */
116
116
  static openUrl = (i, d = !0) => {
117
117
  if (d) {
118
- let n = screen.width / 2 - 500, p = screen.height / 2 - 800 / 2 - 30;
118
+ let s = screen.width / 2 - 500, f = 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=" + p + ", left=" + n
122
+ "toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + f + ", left=" + s
123
123
  );
124
124
  } else
125
125
  window.open(
@@ -133,11 +133,11 @@ class D {
133
133
  * @param param
134
134
  * @returns
135
135
  */
136
- static getImgPic = (i) => new Promise(async (d, n) => {
137
- let p = document.getElementById(i.id);
136
+ static getImgPic = (i) => new Promise(async (d, s) => {
137
+ let f = document.getElementById(i.id);
138
138
  const m = await D.loadModule("html2canvas");
139
139
  try {
140
- m(p, {
140
+ m(f, {
141
141
  logging: !1,
142
142
  allowTaint: !0,
143
143
  scale: window.devicePixelRatio,
@@ -152,7 +152,7 @@ class D {
152
152
  d(e);
153
153
  });
154
154
  } catch (r) {
155
- n(r);
155
+ s(r);
156
156
  }
157
157
  });
158
158
  }
@@ -181,9 +181,9 @@ class S {
181
181
  * @returns
182
182
  */
183
183
  static findOptions = (i, d) => {
184
- const n = i.column.find((m) => m.key === d), p = (m) => m.replace(/-([a-z])/g, (r, e) => e.toUpperCase());
185
- if (n)
186
- return n.options[p(n.type)];
184
+ const s = i.column.find((m) => m.key === d), f = (m) => m.replace(/-([a-z])/g, (r, e) => e.toUpperCase());
185
+ if (s)
186
+ return s.options[f(s.type)];
187
187
  };
188
188
  /**
189
189
  * 更新组件数据
@@ -201,9 +201,9 @@ class S {
201
201
  }))
202
202
  )
203
203
  */
204
- static setOptionsData = (i, d, n) => {
205
- const p = S.findOptions(i, d);
206
- p && (p.data = n);
204
+ static setOptionsData = (i, d, s) => {
205
+ const f = S.findOptions(i, d);
206
+ f && (f.data = s);
207
207
  };
208
208
  static form = {
209
209
  openBefore: {
@@ -214,8 +214,8 @@ class S {
214
214
  * @param treeData 树形数据
215
215
  * @param option 组件配置
216
216
  */
217
- parentId: (i, d, n, p) => {
218
- i ? d.type === D.EDialog.Insert ? (d.form.parentId = i._id, d.form.sort = i.children.length + 1) : d.form.parentId = i.parentId.substring(i.parentId.lastIndexOf(",") + 1) : (d.form.parentId = "0", d.form.sort = n.length + 1), S.setOptionsData(p, "parentId", [{ _id: "0", title: "根", children: n }]);
217
+ parentId: (i, d, s, f) => {
218
+ i ? d.type === D.EDialog.Insert ? (d.form.parentId = i._id, d.form.sort = i.children.length + 1) : d.form.parentId = i.parentId.substring(i.parentId.lastIndexOf(",") + 1) : (d.form.parentId = "0", d.form.sort = s.length + 1), S.setOptionsData(f, "parentId", [{ _id: "0", title: "根", children: s }]);
219
219
  }
220
220
  }
221
221
  };
@@ -230,12 +230,12 @@ class j {
230
230
  * @param field 字段名
231
231
  * @param row 行数据
232
232
  */
233
- static setId = (i, d, n) => {
234
- d[i] || (d[i] = []), d[i].forEach((p) => {
235
- n.forEach((m) => {
233
+ static setId = (i, d, s) => {
234
+ d[i] || (d[i] = []), d[i].forEach((f) => {
235
+ s.forEach((m) => {
236
236
  let r = m.default ?? "";
237
- m.type === "number" && (r = m.default ?? 0), m.type === "boolean" && (r = m.default ?? !1), m.type === "time" && (r = m.default ?? /* @__PURE__ */ new Date()), p[m.value] === void 0 && (p[m.value] = r);
238
- }), p._id || (p._id = j.getIdFun());
237
+ m.type === "number" && (r = m.default ?? 0), m.type === "boolean" && (r = m.default ?? !1), m.type === "time" && (r = m.default ?? /* @__PURE__ */ new Date()), f[m.value] === void 0 && (f[m.value] = r);
238
+ }), f._id || (f._id = j.getIdFun());
239
239
  });
240
240
  };
241
241
  /**
@@ -245,17 +245,17 @@ class j {
245
245
  * @param itemFields 元素字段-如:[{label:'',value:''}]
246
246
  * @param callback 回调函数
247
247
  */
248
- static add = (i, d, n, p) => {
249
- const m = JSONUtil.cp(n);
250
- j.setId(i, d, n), d[i].push(
248
+ static add = (i, d, s, f) => {
249
+ const m = JSONUtil.cp(s);
250
+ j.setId(i, d, s), d[i].push(
251
251
  m.reduce(
252
252
  (r, e) => {
253
- let s = e.default ?? "";
254
- return e.type === "number" && (s = e.default ?? 0), e.type === "boolean" && (s = e.default ?? !1), e.type === "time" && (s = e.default ?? /* @__PURE__ */ new Date()), r[e.value] = s, r;
253
+ let n = e.default ?? "";
254
+ return e.type === "number" && (n = e.default ?? 0), e.type === "boolean" && (n = e.default ?? !1), e.type === "time" && (n = e.default ?? /* @__PURE__ */ new Date()), r[e.value] = n, r;
255
255
  },
256
256
  { _id: j.getIdFun() }
257
257
  )
258
- ), p?.(d);
258
+ ), f?.(d);
259
259
  };
260
260
  /**
261
261
  * 删除数组元素
@@ -264,8 +264,8 @@ class j {
264
264
  * @param item 元素-如:{_id:''}
265
265
  * @param callback 回调函数
266
266
  */
267
- static remove = (i, d, n, p) => {
268
- d[i] = d[i].filter((m) => m._id !== n._id), p?.(d);
267
+ static remove = (i, d, s, f) => {
268
+ d[i] = d[i].filter((m) => m._id !== s._id), f?.(d);
269
269
  };
270
270
  /**
271
271
  * 获取没有id的数据
@@ -274,10 +274,10 @@ class j {
274
274
  * @returns 没有id的数据
275
275
  */
276
276
  static getNoIdData = (i, d) => {
277
- const n = JSONUtil.cp(i);
278
- return n.forEach((p) => {
279
- p._id && delete p._id, d && p[d] && j.getNoIdData(p[d], d);
280
- }), n;
277
+ const s = JSONUtil.cp(i);
278
+ return s.forEach((f) => {
279
+ f._id && delete f._id, d && f[d] && j.getNoIdData(f[d], d);
280
+ }), s;
281
281
  };
282
282
  }
283
283
  const he = {
@@ -287,7 +287,7 @@ const he = {
287
287
  }, be = {
288
288
  class: "row items-center",
289
289
  style: { gap: "10px", width: "100%" }
290
- }, Q = /* @__PURE__ */ A({
290
+ }, Q = /* @__PURE__ */ B({
291
291
  __name: "list",
292
292
  props: {
293
293
  row: {
@@ -322,33 +322,33 @@ const he = {
322
322
  }
323
323
  },
324
324
  emits: ["change"],
325
- setup(f, { emit: i }) {
326
- const d = f, n = X({
325
+ setup(p, { emit: i }) {
326
+ const d = p, s = X({
327
327
  show: !1,
328
328
  add: (m, r, e) => {
329
329
  j.add(m, r, e, () => {
330
- p("change");
330
+ f("change");
331
331
  });
332
332
  },
333
333
  remove: (m, r, e) => {
334
334
  j.remove(m, r, e, () => {
335
- p("change");
335
+ f("change");
336
336
  });
337
337
  }
338
338
  });
339
339
  ee(() => {
340
- j.setId(d.field, d.row, d.itemFields), n.show = !0;
340
+ j.setId(d.field, d.row, d.itemFields), s.show = !0;
341
341
  });
342
- const p = i;
342
+ const f = i;
343
343
  return (m, r) => {
344
- const e = Z("el-button"), s = Z("el-input");
345
- return n.show ? (c(), w("div", he, [
346
- v(m.$slots, "list-start", { row: f.row }),
344
+ const e = Z("el-button"), n = Z("el-input");
345
+ return s.show ? (c(), w("div", he, [
346
+ C(m.$slots, "list-start", { row: p.row }),
347
347
  x("div", null, [
348
- C(e, {
348
+ v(e, {
349
349
  link: "",
350
350
  type: "primary",
351
- onClick: r[0] || (r[0] = (o) => n.add(f.field, f.row, f.itemFields))
351
+ onClick: r[0] || (r[0] = (l) => s.add(p.field, p.row, p.itemFields))
352
352
  }, {
353
353
  default: h(() => [...r[2] || (r[2] = [
354
354
  V("添加", -1)
@@ -356,27 +356,27 @@ const he = {
356
356
  _: 1
357
357
  })
358
358
  ]),
359
- (c(!0), w($, null, L(f.row[f.field], (o) => (c(), w("div", be, [
360
- v(m.$slots, "item-start", {
361
- item: o,
362
- row: f.row
359
+ (c(!0), w($, null, L(p.row[p.field], (l) => (c(), w("div", be, [
360
+ C(m.$slots, "item-start", {
361
+ item: l,
362
+ row: p.row
363
363
  }),
364
- (c(!0), w($, null, L(f.itemFields, (l) => (c(), g(s, {
365
- modelValue: o[l.value],
366
- "onUpdate:modelValue": (t) => o[l.value] = t,
367
- style: se({ width: f.inputWidth }),
368
- class: T(f.inputClass),
369
- placeholder: l[f.label] || l[f.value],
370
- onChange: r[1] || (r[1] = (t) => p("change"))
364
+ (c(!0), w($, null, L(p.itemFields, (o) => (c(), g(n, {
365
+ modelValue: l[o.value],
366
+ "onUpdate:modelValue": (t) => l[o.value] = t,
367
+ style: se({ width: p.inputWidth }),
368
+ class: R(p.inputClass),
369
+ placeholder: o[p.label] || o[p.value],
370
+ onChange: r[1] || (r[1] = (t) => f("change"))
371
371
  }, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
372
- v(m.$slots, "item-end", {
373
- item: o,
374
- row: f.row
372
+ C(m.$slots, "item-end", {
373
+ item: l,
374
+ row: p.row
375
375
  }),
376
- C(e, {
376
+ v(e, {
377
377
  link: "",
378
378
  type: "danger",
379
- onClick: (l) => n.remove(f.field, f.row, o)
379
+ onClick: (o) => s.remove(p.field, p.row, l)
380
380
  }, {
381
381
  default: h(() => [...r[3] || (r[3] = [
382
382
  V("删除", -1)
@@ -384,11 +384,11 @@ const he = {
384
384
  _: 1
385
385
  }, 8, ["onClick"])
386
386
  ]))), 256)),
387
- v(m.$slots, "list-end", { row: f.row })
387
+ C(m.$slots, "list-end", { row: p.row })
388
388
  ])) : k("", !0);
389
389
  };
390
390
  }
391
- }), ye = { class: "row curd-row" }, ge = /* @__PURE__ */ A({
391
+ }), ye = { class: "row curd-row" }, ge = /* @__PURE__ */ B({
392
392
  __name: "column",
393
393
  props: {
394
394
  /**
@@ -404,134 +404,134 @@ const he = {
404
404
  default: ""
405
405
  }
406
406
  },
407
- setup(f, { expose: i }) {
408
- const d = D.isFun, n = D.EDialog, p = R(), m = f, r = X({
407
+ setup(p, { expose: i }) {
408
+ const d = D.isFun, s = D.EDialog, f = T(), m = p, r = X({
409
409
  rules: {},
410
410
  show: !0,
411
411
  form: {},
412
412
  formDefault: {},
413
413
  formColumn: [],
414
- getDisabled: (e) => e.disabled?.[(m.type || n.Insert) === n.Insert ? "create" : "update"],
414
+ getDisabled: (e) => e.disabled?.[(m.type || s.Insert) === s.Insert ? "create" : "update"],
415
415
  initColumnForm: async () => {
416
416
  const e = m.option;
417
417
  r.formColumn = [];
418
- const s = [], o = m.option.form?.maxSpan || 12, l = m.option.form?.defaultSpan || o;
418
+ const n = [], l = m.option.form?.maxSpan || 12, o = m.option.form?.defaultSpan || l;
419
419
  let t = [];
420
420
  const a = (b) => {
421
421
  if (r.formDefault[b.key] = b.value, b.isForm) {
422
- b.form = b.form || { span: l }, b.form.span = b.form.span ?? l;
423
- let F = b.form.span, y = t.reduce((z, M) => z + M.span, F);
422
+ b.form = b.form || { span: o }, b.form.span = b.form.span ?? o;
423
+ let O = b.form.span, y = t.reduce((z, M) => z + M.span, O);
424
424
  const E = t.length;
425
- t.push({ item: b, span: F }), (E === 1 && t[0].span === 0 || y >= o || F === 0 && E > 1) && (s.push(t), t = []), b.rules && (r.rules[b.key] = b.rules);
425
+ t.push({ item: b, span: O }), (E === 1 && t[0].span === 0 || y >= l || O === 0 && E > 1) && (n.push(t), t = []), b.rules && (r.rules[b.key] = b.rules);
426
426
  }
427
427
  };
428
428
  e.column.forEach((b) => {
429
429
  b.isForm = !0, a(b);
430
- }), t.length > 0 && s.push(t), r.formColumn = s, r.form = JSONUtil.cp(r.formDefault);
430
+ }), t.length > 0 && n.push(t), r.formColumn = n, r.form = JSONUtil.cp(r.formDefault);
431
431
  },
432
432
  init: async () => {
433
433
  r.show = !1, await ne(), r.initColumnForm();
434
434
  }
435
435
  });
436
436
  return r.initColumnForm(), i({
437
- ref: p,
437
+ ref: f,
438
438
  conf: r
439
- }), (e, s) => (c(), g(u(K), {
439
+ }), (e, n) => (c(), g(u(K), {
440
440
  ref_key: "ruleFormRef",
441
- ref: p,
441
+ ref: f,
442
442
  model: r.form,
443
443
  rules: r.rules
444
444
  }, {
445
445
  default: h(() => [
446
- r.show ? (c(!0), w($, { key: 0 }, L(r.formColumn, (o) => (c(), w("div", ye, [
447
- v(e.$slots, "form-start", {
446
+ r.show ? (c(!0), w($, { key: 0 }, L(r.formColumn, (l) => (c(), w("div", ye, [
447
+ C(e.$slots, "form-start", {
448
448
  row: r.form
449
449
  }),
450
- (c(!0), w($, null, L(o, (l) => (c(), w($, null, [
451
- u(d)(l.item.show?.form, r.form) ?? !0 ? (c(), w("div", {
450
+ (c(!0), w($, null, L(l, (o) => (c(), w($, null, [
451
+ u(d)(o.item.show?.form, r.form) ?? !0 ? (c(), w("div", {
452
452
  key: 0,
453
- class: T(l.item.form.span > 0 ? `col-${l.item.form.span}` : "col")
453
+ class: R(o.item.form.span > 0 ? `col-${o.item.form.span}` : "col")
454
454
  }, [
455
- C(u(P), {
456
- label: l.item.label,
457
- prop: l.item.key,
458
- "label-width": l.item.form?.labelWidth || "100px"
455
+ v(u(P), {
456
+ label: o.item.label,
457
+ prop: o.item.key,
458
+ "label-width": o.item.form?.labelWidth || "100px"
459
459
  }, {
460
460
  default: h(() => [
461
- v(e.$slots, "form-" + l.item.key + "-start", {
461
+ C(e.$slots, "form-" + o.item.key + "-start", {
462
462
  row: r.form,
463
- item: l.item
463
+ item: o.item
464
464
  }),
465
- v(e.$slots, "form-" + l.item.key, {
465
+ C(e.$slots, "form-" + o.item.key, {
466
466
  row: r.form,
467
- item: l.item
467
+ item: o.item
468
468
  }, () => [
469
- l.item.type === "input" ? (c(), g(u(H), U({
469
+ o.item.type === "input" ? (c(), g(u(H), U({
470
470
  key: 0,
471
- modelValue: r.form[l.item.key],
472
- "onUpdate:modelValue": (t) => r.form[l.item.key] = t
473
- }, { ref_for: !0 }, l.item.options?.input, I(l.item.options?.input?.on || {}), {
474
- disabled: r.getDisabled(l.item)
475
- }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : l.item.type === "switch" ? (c(), g(u(G), U({
471
+ modelValue: r.form[o.item.key],
472
+ "onUpdate:modelValue": (t) => r.form[o.item.key] = t
473
+ }, { ref_for: !0 }, o.item.options?.input, I(o.item.options?.input?.on || {}), {
474
+ disabled: r.getDisabled(o.item)
475
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.item.type === "switch" ? (c(), g(u(G), U({
476
476
  key: 1,
477
- modelValue: r.form[l.item.key],
478
- "onUpdate:modelValue": (t) => r.form[l.item.key] = t
479
- }, { ref_for: !0 }, l.item.options?.switch, I(l.item.options?.switch?.on || {}), {
480
- disabled: r.getDisabled(l.item)
481
- }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : l.item.type === "select" ? (c(), g(u(B), U({
477
+ modelValue: r.form[o.item.key],
478
+ "onUpdate:modelValue": (t) => r.form[o.item.key] = t
479
+ }, { ref_for: !0 }, o.item.options?.switch, I(o.item.options?.switch?.on || {}), {
480
+ disabled: r.getDisabled(o.item)
481
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.item.type === "select" ? (c(), g(u(_), U({
482
482
  key: 2,
483
- modelValue: r.form[l.item.key],
484
- "onUpdate:modelValue": (t) => r.form[l.item.key] = t
485
- }, { ref_for: !0 }, l.item.options?.select, I(l.item.options?.select?.on || {}), {
486
- disabled: r.getDisabled(l.item),
483
+ modelValue: r.form[o.item.key],
484
+ "onUpdate:modelValue": (t) => r.form[o.item.key] = t
485
+ }, { ref_for: !0 }, o.item.options?.select, I(o.item.options?.select?.on || {}), {
486
+ disabled: r.getDisabled(o.item),
487
487
  style: { width: "100%" }
488
488
  }), {
489
489
  default: h(() => [
490
- (c(!0), w($, null, L(l.item.options?.select?.data, (t) => (c(), g(u(N), {
490
+ (c(!0), w($, null, L(o.item.options?.select?.data, (t) => (c(), g(u(N), {
491
491
  key: t.value,
492
492
  label: t.label,
493
493
  value: t.value
494
494
  }, null, 8, ["label", "value"]))), 128))
495
495
  ]),
496
496
  _: 2
497
- }, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : l.item.type === "list" ? (c(), g(Q, U({
497
+ }, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.item.type === "list" ? (c(), g(Q, U({
498
498
  key: 3,
499
499
  row: r.form,
500
- field: l.item.key
501
- }, { ref_for: !0 }, l.item.options?.list, I(l.item.options?.list?.on || {}), {
502
- disabled: r.getDisabled(l.item),
500
+ field: o.item.key
501
+ }, { ref_for: !0 }, o.item.options?.list, I(o.item.options?.list?.on || {}), {
502
+ disabled: r.getDisabled(o.item),
503
503
  style: { width: "100%" }
504
- }), null, 16, ["row", "field", "disabled"])) : l.item.type === "tree-select" ? (c(), g(u(oe), U({
504
+ }), null, 16, ["row", "field", "disabled"])) : o.item.type === "tree-select" ? (c(), g(u(oe), U({
505
505
  key: 4,
506
- modelValue: r.form[l.item.key],
507
- "onUpdate:modelValue": (t) => r.form[l.item.key] = t
508
- }, { ref_for: !0 }, l.item.options?.treeSelect, I(l.item.options?.treeSelect?.on || {}), {
509
- disabled: r.getDisabled(l.item),
506
+ modelValue: r.form[o.item.key],
507
+ "onUpdate:modelValue": (t) => r.form[o.item.key] = t
508
+ }, { ref_for: !0 }, o.item.options?.treeSelect, I(o.item.options?.treeSelect?.on || {}), {
509
+ disabled: r.getDisabled(o.item),
510
510
  style: { width: "100%" }
511
- }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : l.item.type === "datetime" ? (c(), g(u(le), U({
511
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.item.type === "datetime" ? (c(), g(u(le), U({
512
512
  key: 5,
513
- modelValue: r.form[l.item.key],
514
- "onUpdate:modelValue": (t) => r.form[l.item.key] = t
515
- }, { ref_for: !0 }, l.item.options?.datetime, I(l.item.options?.datetime?.on || {}), {
516
- disabled: r.getDisabled(l.item)
517
- }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u(S).customComponent[l.item.type] ? (c(), g(te(u(S).customComponent[l.item.type]), U({
513
+ modelValue: r.form[o.item.key],
514
+ "onUpdate:modelValue": (t) => r.form[o.item.key] = t
515
+ }, { ref_for: !0 }, o.item.options?.datetime, I(o.item.options?.datetime?.on || {}), {
516
+ disabled: r.getDisabled(o.item)
517
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u(S).customComponent[o.item.type] ? (c(), g(te(u(S).customComponent[o.item.type]), U({
518
518
  key: 6,
519
- modelValue: r.form[l.item.key],
520
- "onUpdate:modelValue": (t) => r.form[l.item.key] = t
521
- }, { ref_for: !0 }, l.item.options?.[l.item.type], I(l.item.options?.[l.item.type]?.on || {}), {
522
- disabled: r.getDisabled(l.item)
519
+ modelValue: r.form[o.item.key],
520
+ "onUpdate:modelValue": (t) => r.form[o.item.key] = t
521
+ }, { ref_for: !0 }, o.item.options?.[o.item.type], I(o.item.options?.[o.item.type]?.on || {}), {
522
+ disabled: r.getDisabled(o.item)
523
523
  }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : k("", !0)
524
524
  ]),
525
- v(e.$slots, "form-" + l.item.key + "-end", {
525
+ C(e.$slots, "form-" + o.item.key + "-end", {
526
526
  row: r.form,
527
- item: l.item
527
+ item: o.item
528
528
  })
529
529
  ]),
530
530
  _: 2
531
531
  }, 1032, ["label", "prop", "label-width"])
532
532
  ], 2)) : k("", !0)
533
533
  ], 64))), 256)),
534
- v(e.$slots, "form-end", {
534
+ C(e.$slots, "form-end", {
535
535
  row: r.form
536
536
  })
537
537
  ]))), 256)) : k("", !0)
@@ -547,48 +547,49 @@ class we {
547
547
  * @param columns 列
548
548
  * @param fileName 文件名
549
549
  */
550
- static exportToExcel = async (i, d, n) => {
551
- const p = await D.loadModule("xlsx"), m = i.map((s) => {
552
- const o = {};
553
- return d.forEach((l) => {
554
- o[l.label] = s[l.key];
555
- }), o;
556
- }), r = p.utils.json_to_sheet(m), e = p.utils.book_new();
557
- p.utils.book_append_sheet(e, r, "Sheet1"), n ? typeof n == "function" && (n = n()) : n = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, p.writeFile(e, `${n}.xlsx`);
550
+ static exportToExcel = async (i, d, s) => {
551
+ if (!i || i.length === 0) return;
552
+ const f = await D.loadModule("xlsx"), m = i.map((n) => {
553
+ const l = {};
554
+ return d.forEach((o) => {
555
+ l[o.label] = n[o.key];
556
+ }), l;
557
+ }), r = f.utils.json_to_sheet(m), e = f.utils.book_new();
558
+ f.utils.book_append_sheet(e, r, "Sheet1"), s ? typeof s == "function" && (s = s()) : s = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, f.writeFile(e, `${s}.xlsx`);
558
559
  };
559
560
  }
560
- const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
561
+ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ B({
561
562
  __name: "switchConfirm",
562
- setup(f, { expose: i }) {
563
- const d = R(!1), n = R("确认修改"), p = R("确认要修改状态吗?");
563
+ setup(p, { expose: i }) {
564
+ const d = T(!1), s = T("确认修改"), f = T("确认要修改状态吗?");
564
565
  let m = null, r = null;
565
- const e = (l) => (l?.title && (n.value = l.title), l?.content && (p.value = l.content), d.value = !0, new Promise((t, a) => {
566
+ const e = (o) => (o?.title && (s.value = o.title), o?.content && (f.value = o.content), d.value = !0, new Promise((t, a) => {
566
567
  m = t, r = a;
567
- })), s = () => {
568
+ })), n = () => {
568
569
  d.value = !1, m?.(!0), m = null, r = null;
569
- }, o = () => {
570
+ }, l = () => {
570
571
  d.value = !1, r?.(new Error("用户取消操作")), m = null, r = null;
571
572
  };
572
573
  return i({
573
574
  open: e
574
- }), (l, t) => (c(), g(u(q), {
575
+ }), (o, t) => (c(), g(u(q), {
575
576
  modelValue: d.value,
576
577
  "onUpdate:modelValue": t[0] || (t[0] = (a) => d.value = a),
577
- title: n.value,
578
+ title: s.value,
578
579
  "close-on-click-modal": !1,
579
580
  width: "400px"
580
581
  }, {
581
582
  footer: h(() => [
582
583
  x("span", ke, [
583
- C(u(O), { onClick: o }, {
584
+ v(u(F), { onClick: l }, {
584
585
  default: h(() => [...t[1] || (t[1] = [
585
586
  V("取消", -1)
586
587
  ])]),
587
588
  _: 1
588
589
  }),
589
- C(u(O), {
590
+ v(u(F), {
590
591
  type: "primary",
591
- onClick: s
592
+ onClick: n
592
593
  }, {
593
594
  default: h(() => [...t[2] || (t[2] = [
594
595
  V("确认", -1)
@@ -598,27 +599,44 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
598
599
  ])
599
600
  ]),
600
601
  default: h(() => [
601
- x("div", null, _(p.value), 1)
602
+ x("div", null, W(f.value), 1)
602
603
  ]),
603
604
  _: 1
604
605
  }, 8, ["modelValue", "title"]));
605
606
  }
606
- }), Ce = { class: "col relative cc1-form-box" }, Ve = {
607
+ }), Ce = (p, i) => {
608
+ const d = p.__vccOpts || p;
609
+ for (const [s, f] of i)
610
+ d[s] = f;
611
+ return d;
612
+ }, Ve = {}, xe = {
613
+ xmlns: "http://www.w3.org/2000/svg",
614
+ viewBox: "0 0 1024 1024"
615
+ };
616
+ function Ue(p, i) {
617
+ return c(), w("svg", xe, [...i[0] || (i[0] = [
618
+ x("path", {
619
+ fill: "currentColor",
620
+ d: "M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"
621
+ }, null, -1)
622
+ ])]);
623
+ }
624
+ const De = /* @__PURE__ */ Ce(Ve, [["render", Ue]]), Ee = { class: "col relative cc1-form-box" }, $e = {
607
625
  class: "absolute row fit",
608
626
  style: { overflow: "hidden" }
609
- }, xe = { class: "col column" }, Ue = {
627
+ }, Oe = { class: "col column" }, Fe = {
610
628
  key: 0,
611
629
  class: "relative curd-search"
612
- }, De = { class: "mb-10 flex justify-between items-center" }, Ee = {
630
+ }, Se = { class: "mb-10 flex justify-between items-center" }, Ie = {
613
631
  class: "flex items-center",
614
632
  style: { gap: "10px" }
615
- }, $e = { key: 0 }, Fe = { key: 1 }, Oe = { key: 2 }, Se = { class: "export-btn" }, Ie = {
633
+ }, Le = { key: 0 }, je = { key: 1 }, ze = { key: 2 }, Re = { class: "export-btn" }, Te = {
616
634
  class: "flex items-center",
617
635
  style: { gap: "10px" }
618
- }, Le = { class: "col fit-width relative" }, je = { class: "absolute column fit" }, ze = { class: "row justify-end mt-10 mb-10" }, Te = {
636
+ }, Me = { class: "col fit-width relative" }, Ne = { class: "absolute column fit" }, Pe = { class: "row justify-end mt-10 mb-10" }, _e = {
619
637
  class: "row form-item-content",
620
638
  style: { width: "100%" }
621
- }, Re = { class: "col" }, Me = { class: "dialog-footer" }, Ne = { class: "dialog-footer" }, Pe = /* @__PURE__ */ A({
639
+ }, Be = { class: "col" }, Ae = { class: "dialog-footer" }, Je = { class: "dialog-footer" }, We = /* @__PURE__ */ B({
622
640
  __name: "index",
623
641
  props: {
624
642
  /**
@@ -628,39 +646,39 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
628
646
  default: {}
629
647
  }
630
648
  },
631
- setup(f, { expose: i }) {
632
- const d = D.EDialog, n = f, p = R(), m = R(), r = D.isFun, e = X({
649
+ setup(p, { expose: i }) {
650
+ const d = D.EDialog, s = p, f = T(), m = T(), r = D.isFun, e = X({
633
651
  search: {
634
652
  column: {
635
653
  list: []
636
654
  },
637
655
  form: {},
638
656
  formDefault: {},
639
- getPlaceholder: (s, o = "请输入") => s.text?.search?.placeholder === void 0 ? `${o}${s.label}` : s.text?.search?.placeholder,
657
+ getPlaceholder: (n, l = "请输入") => n.text?.search?.placeholder === void 0 ? `${l}${n.label}` : n.text?.search?.placeholder,
640
658
  getFormData: () => {
641
- let s = {};
642
- n.option.column.forEach((l) => {
643
- (typeof l.show?.search == "function" ? l.show?.search(e.search.form) : l.show?.search) && (s[l.key] = e.search.form[l.key]);
659
+ let n = {};
660
+ s.option.column.forEach((o) => {
661
+ (typeof o.show?.search == "function" ? o.show?.search(e.search.form) : o.show?.search) && (n[o.key] = e.search.form[o.key]);
644
662
  });
645
- const o = n.option.search?.before?.(s);
646
- return o && (s = o), s;
663
+ const l = s.option.search?.before?.(n);
664
+ return l && (n = l), n;
647
665
  },
648
666
  reset: () => {
649
- const s = e.search.formDefault;
650
- Object.keys(s).forEach((o) => {
651
- n.option.search?.resetMode === "default" ? s[o] = e.search.formDefault[o] : s[o] = void 0;
652
- }), e.search.form = JSONUtil.cp(s), e.page.num = 1, e.table.getList();
667
+ const n = e.search.formDefault;
668
+ Object.keys(n).forEach((l) => {
669
+ s.option.search?.resetMode === "default" ? n[l] = e.search.formDefault[l] : n[l] = void 0;
670
+ }), e.search.form = JSONUtil.cp(n), e.page.num = 1, e.table.getList();
653
671
  },
654
672
  submit: () => {
655
673
  e.page.num = 1, e.table.getList();
656
674
  }
657
675
  },
658
676
  page: {
659
- size: n.option.page?.size || 10,
660
- sizeList: n.option.page?.sizeList || [10, 20, 50, 100],
677
+ size: s.option.page?.size || 10,
678
+ sizeList: s.option.page?.sizeList || [10, 20, 50, 100],
661
679
  num: 1,
662
680
  total: 0,
663
- layout: n.option.page?.layout || "total, sizes, prev, pager, next, jumper"
681
+ layout: s.option.page?.layout || "total, sizes, prev, pager, next, jumper"
664
682
  },
665
683
  table: {
666
684
  loading: !1,
@@ -668,19 +686,19 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
668
686
  expand: {
669
687
  isExpand: !1,
670
688
  rowKeys: [],
671
- change: (s, o) => {
689
+ change: (n, l) => {
672
690
  },
673
691
  all: () => {
674
692
  if (e.table.expand.isExpand)
675
693
  e.table.expand.rowKeys = [];
676
694
  else {
677
- const s = (o) => {
678
- let l = [];
679
- return o.forEach((t) => {
680
- l.push(t._id), t.children && t.children.length > 0 && (l = l.concat(s(t.children)));
681
- }), l;
695
+ const n = (l) => {
696
+ let o = [];
697
+ return l.forEach((t) => {
698
+ o.push(t._id), t.children && t.children.length > 0 && (o = o.concat(n(t.children)));
699
+ }), o;
682
700
  };
683
- e.table.expand.rowKeys = s(e.table.data);
701
+ e.table.expand.rowKeys = n(e.table.data);
684
702
  }
685
703
  e.table.expand.isExpand = !e.table.expand.isExpand;
686
704
  }
@@ -706,34 +724,36 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
706
724
  },
707
725
  getList: async () => {
708
726
  e.table.loading = !0;
709
- const s = n.option.api.list;
727
+ const n = s.option.api.list;
710
728
  try {
711
- const o = await s({
729
+ const l = await n({
712
730
  [S.pageField.size]: e.page.size,
713
731
  [S.pageField.num]: e.page.num,
714
732
  ...e.search.getFormData()
715
- }), l = S.resultField, t = o.data || { [l.list]: o };
716
- let a = (Array.isArray(t[l.list]), t[l.list]);
717
- e.table.data = n.option.data ? await n.option.data(a) : a, e.page.total = t[l.total] || 0;
718
- } catch (o) {
719
- console.error(o);
733
+ }), o = S.resultField, t = l.data || { [o.list]: l };
734
+ let a = (Array.isArray(t[o.list]), t[o.list]);
735
+ e.table.data = s.option.data ? await s.option.data(a) : a, e.page.total = t[o.total] || 0;
736
+ } catch (l) {
737
+ console.error(l);
720
738
  } finally {
721
739
  e.table.loading = !1;
722
740
  }
723
741
  },
724
742
  selection: {
725
743
  list: [],
726
- change: (s) => {
727
- e.table.selection.list = s;
744
+ change: (n) => {
745
+ e.table.selection.list = n;
728
746
  }
729
- },
730
- exportFun: {
731
- start: async (s) => {
732
- let o = await e.table.exportFun[s](), l = n.option.column;
747
+ }
748
+ },
749
+ export: {
750
+ run: {
751
+ start: async (n) => {
752
+ let l = await e.export.run[n](), o = s.option.column;
733
753
  const t = JSONUtil.cp({
734
- data: o,
735
- columns: l
736
- }), a = n.option.tools?.export || {};
754
+ data: l,
755
+ columns: o
756
+ }), a = s.option.tools?.export || {};
737
757
  a.before && a.before(t), we.exportToExcel(t.data, t.columns, a.fileName);
738
758
  },
739
759
  select: () => {
@@ -747,23 +767,27 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
747
767
  return e.table.data;
748
768
  },
749
769
  all: async () => {
750
- e.table.loading = !0;
751
- const s = n.option.api.list;
770
+ e.export.loading = !0;
752
771
  try {
753
- const { data: o } = await s({
772
+ if (s.option.export?.all) {
773
+ await s.option.export.all();
774
+ return;
775
+ }
776
+ const n = s.option.api.list, { data: l } = await n({
754
777
  [S.pageField.size]: 999999,
755
778
  [S.pageField.num]: 1
756
779
  });
757
- return o[S.resultField.list];
758
- } catch (o) {
759
- console.error(o);
780
+ return l[S.resultField.list];
781
+ } catch (n) {
782
+ console.error(n);
760
783
  } finally {
761
- e.table.loading = !1;
784
+ e.export.loading = !1;
762
785
  }
763
786
  }
764
787
  },
765
- export: (s) => {
766
- e.table.exportFun.start(s);
788
+ loading: !1,
789
+ click: (n) => {
790
+ e.export.loading || e.export.run.start(n);
767
791
  }
768
792
  },
769
793
  update: {
@@ -776,7 +800,7 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
776
800
  form: {},
777
801
  formDefault: {},
778
802
  formColumn: [],
779
- getDisabled: (s) => s.disabled?.[e.update.type === d.Insert ? "create" : "update"],
803
+ getDisabled: (n) => n.disabled?.[e.update.type === d.Insert ? "create" : "update"],
780
804
  edit: {
781
805
  /**
782
806
  * 编辑原数据
@@ -785,43 +809,43 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
785
809
  /**
786
810
  * 将form填入数据和data比对差异数据返回
787
811
  */
788
- getApiData: (s) => {
789
- if (n.option.form?.editAll)
790
- return s;
791
- let o = {
812
+ getApiData: (n) => {
813
+ if (s.option.form?.editAll)
814
+ return n;
815
+ let l = {
792
816
  _id: e.update.edit.data._id
793
817
  };
794
- return Object.keys(e.update.edit.data).forEach((l) => {
795
- s[l] !== e.update.edit.data[l] && (o[l] = s[l]);
796
- }), o;
818
+ return Object.keys(e.update.edit.data).forEach((o) => {
819
+ n[o] !== e.update.edit.data[o] && (l[o] = n[o]);
820
+ }), l;
797
821
  }
798
822
  },
799
- open: (s, o) => {
823
+ open: (n, l) => {
800
824
  e.update.showContent || FunUtil.throttle(async () => {
801
- e.update.type = s;
802
- const l = s === d.Insert;
803
- e.update.edit.data = o, e.update.title = l ? "新增" : "编辑", e.update.form = JSONUtil.cp(l ? 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);
825
+ e.update.type = n;
826
+ const o = n === d.Insert;
827
+ e.update.edit.data = l, e.update.title = o ? "新增" : "编辑", e.update.form = JSONUtil.cp(o ? e.update.formDefault : l), await s.option.form?.openBefore?.(l, e.update), e.update.show = !0, e.update.showContent = !0, s.option.form?.openAfter?.(l, e.update);
804
828
  });
805
829
  },
806
830
  submit: () => {
807
831
  FunUtil.throttle(async () => {
808
- await m.value?.validate(async (l, t) => new Promise((a, b) => {
809
- l || (D.fail("请检查表单数据"), b(!1)), a();
832
+ await m.value?.validate(async (o, t) => new Promise((a, b) => {
833
+ o || (D.fail("请检查表单数据"), b(!1)), a();
810
834
  })), e.update.loading = !0;
811
- const s = e.update.type === d.Insert ? n.option.api.create : n.option.api.update;
812
- let o = JSONUtil.cp(e.update.form);
813
- delete o.children, await n.option.form?.submitBefore?.(o, e.update), Object.keys(o).forEach((l) => {
814
- if (typeof o[l] == "string" && o[l].indexOf("T") > -1) {
815
- const t = new Date(o[l]).getTime();
816
- !isNaN(t) && t > (/* @__PURE__ */ new Date("1971-01-01")).getTime() && (o[l] = t);
835
+ const n = e.update.type === d.Insert ? s.option.api.create : s.option.api.update;
836
+ let l = JSONUtil.cp(e.update.form);
837
+ delete l.children, await s.option.form?.submitBefore?.(l, e.update), Object.keys(l).forEach((o) => {
838
+ if (typeof l[o] == "string" && l[o].indexOf("T") > -1) {
839
+ const t = new Date(l[o]).getTime();
840
+ !isNaN(t) && t > (/* @__PURE__ */ new Date("1971-01-01")).getTime() && (l[o] = t);
817
841
  }
818
842
  });
819
843
  try {
820
- await s({
821
- ...o
822
- }), e.update.close(), await e.table.getList(), n.option.form?.submitAfter?.(o, e.update);
823
- } catch (l) {
824
- console.error(l);
844
+ await n({
845
+ ...l
846
+ }), e.update.close(), await e.table.getList(), s.option.form?.submitAfter?.(l, e.update);
847
+ } catch (o) {
848
+ console.error(o);
825
849
  } finally {
826
850
  e.update.loading = !1;
827
851
  }
@@ -841,24 +865,24 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
841
865
  close: () => {
842
866
  e.remove.show = !1;
843
867
  },
844
- open: (s) => {
845
- if (s.length === 0) {
868
+ open: (n) => {
869
+ if (n.length === 0) {
846
870
  D.fail("请选择要删除的数据");
847
871
  return;
848
872
  }
849
- e.remove.items = s, e.remove.show = !0;
873
+ e.remove.items = n, e.remove.show = !0;
850
874
  },
851
875
  submit: () => {
852
876
  FunUtil.throttle(async () => {
853
877
  e.remove.loading = !0;
854
- const s = n.option.api.delete;
878
+ const n = s.option.api.delete;
855
879
  try {
856
- await s({
857
- _id: e.remove.items.map((o) => o._id),
880
+ await n({
881
+ _id: e.remove.items.map((l) => l._id),
858
882
  items: e.remove.items
859
883
  }), D.success("操作成功"), e.table.data.length <= 1 && e.page.num > 1 && (e.page.num -= 1), e.remove.close(), await e.table.getList();
860
- } catch (o) {
861
- console.error(o);
884
+ } catch (l) {
885
+ console.error(l);
862
886
  } finally {
863
887
  e.remove.loading = !1;
864
888
  }
@@ -869,7 +893,7 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
869
893
  e.initCurdConfig(), e.initColumnOptions(), e.initColumnForm();
870
894
  },
871
895
  initCurdConfig: () => {
872
- const o = {
896
+ const l = {
873
897
  tools: {
874
898
  search: !0,
875
899
  reset: !0,
@@ -887,9 +911,9 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
887
911
  emptyText: "暂无数据",
888
912
  highlightCurrentRow: !0
889
913
  }
890
- }, l = n.option;
891
- Object.keys(o).forEach((t) => {
892
- l[t] = ObjectUtil.deepMerge(o[t], l[t] || {});
914
+ }, o = s.option;
915
+ Object.keys(l).forEach((t) => {
916
+ o[t] = ObjectUtil.deepMerge(l[t], o[t] || {});
893
917
  });
894
918
  },
895
919
  /**
@@ -898,7 +922,7 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
898
922
  * @returns
899
923
  */
900
924
  initColumnOptions: () => {
901
- const s = n.option, o = (l) => {
925
+ const n = s.option, l = (o) => {
902
926
  const a = {
903
927
  options: {
904
928
  switch: {
@@ -906,17 +930,17 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
906
930
  activeLabel: "开启",
907
931
  inactiveValue: !1,
908
932
  inactiveLabel: "关闭",
909
- tableBeforeChange: async (F, y) => {
910
- const E = l.options?.switch;
933
+ tableBeforeChange: async (O, y) => {
934
+ const E = o.options?.switch;
911
935
  try {
912
- await p.value?.open({
936
+ await f.value?.open({
913
937
  title: "确认修改",
914
- content: `确认要${y[F] === E.activeValue ? E.inactiveLabel : E.activeLabel}吗?`
938
+ content: `确认要${y[O] === E.activeValue ? E.inactiveLabel : E.activeLabel}吗?`
915
939
  }), e.table.loading = !0;
916
940
  try {
917
- return await n.option.api.update({
941
+ return await s.option.api.update({
918
942
  _id: y._id,
919
- [F]: y[F] === E.activeValue ? E.inactiveValue : E.activeValue,
943
+ [O]: y[O] === E.activeValue ? E.inactiveValue : E.activeValue,
920
944
  final(z, M, Y) {
921
945
  e.table.loading = !1;
922
946
  }
@@ -960,38 +984,38 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
960
984
  table: 0,
961
985
  form: 0
962
986
  }
963
- }, b = l;
964
- Object.keys(a).forEach((F) => {
965
- b[F] = ObjectUtil.deepMerge(a[F], b[F] || {});
987
+ }, b = o;
988
+ Object.keys(a).forEach((O) => {
989
+ b[O] = ObjectUtil.deepMerge(a[O], b[O] || {});
966
990
  });
967
991
  };
968
- s.column.forEach(o), s.table?.column?.forEach(o);
992
+ n.column.forEach(l), n.table?.column?.forEach(l);
969
993
  },
970
994
  initColumnForm: () => {
971
- const s = n.option;
995
+ const n = s.option;
972
996
  e.update.formColumn = [], e.table.column.show = {
973
997
  list: [],
974
998
  listSource: []
975
999
  };
976
- const o = [], l = n.option.form?.maxSpan || 12, t = n.option.form?.defaultSpan || l / 2;
1000
+ const l = [], o = s.option.form?.maxSpan || 12, t = s.option.form?.defaultSpan || o / 2;
977
1001
  let a = [];
978
1002
  const b = (y) => {
979
1003
  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) {
980
1004
  y.form = y.form || { span: t }, y.form.span = y.form.span ?? t;
981
1005
  let E = y.form.span, z = a.reduce((Y, ae) => Y + ae.span, E);
982
1006
  const M = a.length;
983
- a.push({ item: y, span: E }), (M === 1 && a[0].span === 0 || z >= l || E === 0 && M > 1) && (o.push(a), a = []), y.rules && (e.update.rules[y.key] = y.rules);
1007
+ a.push({ item: y, span: E }), (M === 1 && a[0].span === 0 || z >= o || E === 0 && M > 1) && (l.push(a), a = []), y.rules && (e.update.rules[y.key] = y.rules);
984
1008
  }
985
1009
  };
986
- s.column.forEach((y) => {
1010
+ n.column.forEach((y) => {
987
1011
  y.isForm = !0, b(y);
988
- }), n.option.table?.column?.forEach((y) => {
1012
+ }), s.option.table?.column?.forEach((y) => {
989
1013
  y.isForm = !1, b(y);
990
- }), e.search.column.list = s.column.concat(s.table?.column || []), e.table.column.list = e.search.column.list.filter((y) => y.table?.table), e.search.column.list.sort((y, E) => y.sort?.search - E.sort?.search), e.table.column.list.sort((y, E) => y.sort?.table - E.sort?.table), a.length > 0 && o.push(a), e.update.formColumn = o;
991
- const F = n.option.search?.formDefault;
992
- F && Object.keys(F).forEach((y) => {
993
- e.search.formDefault[y] = F[y];
994
- }), s.column.forEach((y) => {
1014
+ }), e.search.column.list = n.column.concat(n.table?.column || []), e.table.column.list = e.search.column.list.filter((y) => y.table?.table), e.search.column.list.sort((y, E) => y.sort?.search - E.sort?.search), e.table.column.list.sort((y, E) => y.sort?.table - E.sort?.table), a.length > 0 && l.push(a), e.update.formColumn = l;
1015
+ const O = s.option.search?.formDefault;
1016
+ O && Object.keys(O).forEach((y) => {
1017
+ e.search.formDefault[y] = O[y];
1018
+ }), n.column.forEach((y) => {
995
1019
  y.show?.search || (e.search.formDefault[y.key] = void 0);
996
1020
  }), e.search.form = JSONUtil.cp(e.search.formDefault);
997
1021
  }
@@ -1000,19 +1024,19 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
1000
1024
  e.table.getList();
1001
1025
  }), i({
1002
1026
  conf: e
1003
- }), (s, o) => {
1004
- const l = re("loading");
1005
- return c(), w("div", Ce, [
1006
- x("div", Ve, [
1007
- v(s.$slots, "box-left"),
1008
- x("div", xe, [
1009
- f.option.search?.show !== !1 ? (c(), w("div", Ue, [
1010
- C(u(K), {
1027
+ }), (n, l) => {
1028
+ const o = re("loading");
1029
+ return c(), w("div", Ee, [
1030
+ x("div", $e, [
1031
+ C(n.$slots, "box-left"),
1032
+ x("div", Oe, [
1033
+ p.option.search?.show !== !1 ? (c(), w("div", Fe, [
1034
+ v(u(K), {
1011
1035
  model: e.search.form,
1012
1036
  inline: ""
1013
1037
  }, {
1014
1038
  default: h(() => [
1015
- v(s.$slots, "search-start", {
1039
+ C(n.$slots, "search-start", {
1016
1040
  row: e.search.form
1017
1041
  }),
1018
1042
  (c(!0), w($, null, L(e.search.column.list, (t) => (c(), w($, {
@@ -1021,12 +1045,12 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
1021
1045
  (typeof t.show?.search == "function" ? t.show?.search(e.search.form) : t.show?.search) ? (c(), g(u(P), {
1022
1046
  key: 0,
1023
1047
  label: typeof t.text?.search?.label == "string" ? t.text?.search?.label : t.label,
1024
- class: T({
1048
+ class: R({
1025
1049
  "hide-label": typeof t.text?.search?.label == "boolean" ? !t.text?.search?.label : !1
1026
1050
  })
1027
1051
  }, {
1028
1052
  default: h(() => [
1029
- v(s.$slots, "search-" + t.key, {
1053
+ C(n.$slots, "search-" + t.key, {
1030
1054
  row: e.search.form
1031
1055
  }, () => [
1032
1056
  t.type === "input" ? (c(), g(u(H), {
@@ -1036,7 +1060,7 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
1036
1060
  placeholder: e.search.getPlaceholder(t),
1037
1061
  clearable: "",
1038
1062
  disabled: t.disabled?.search
1039
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : t.type === "switch" ? (c(), g(u(B), {
1063
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : t.type === "switch" ? (c(), g(u(_), {
1040
1064
  key: 1,
1041
1065
  modelValue: e.search.form[t.key],
1042
1066
  "onUpdate:modelValue": (a) => e.search.form[t.key] = a,
@@ -1057,7 +1081,7 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
1057
1081
  }, null, 8, ["label", "value"]))
1058
1082
  ]),
1059
1083
  _: 2
1060
- }, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : t.type === "select" ? (c(), g(u(B), {
1084
+ }, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : t.type === "select" ? (c(), g(u(_), {
1061
1085
  key: 2,
1062
1086
  modelValue: e.search.form[t.key],
1063
1087
  "onUpdate:modelValue": (a) => e.search.form[t.key] = a,
@@ -1079,26 +1103,26 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
1079
1103
  _: 2
1080
1104
  }, 1032, ["label", "class"])) : k("", !0)
1081
1105
  ], 64))), 128)),
1082
- v(s.$slots, "search-center", {
1106
+ C(n.$slots, "search-center", {
1083
1107
  row: e.search.form
1084
1108
  }),
1085
- C(u(P), null, {
1109
+ v(u(P), null, {
1086
1110
  default: h(() => [
1087
- f.option.tools?.search ? (c(), g(u(O), {
1111
+ p.option.tools?.search ? (c(), g(u(F), {
1088
1112
  key: 0,
1089
1113
  type: "primary",
1090
1114
  onClick: e.search.submit
1091
1115
  }, {
1092
- default: h(() => [...o[8] || (o[8] = [
1116
+ default: h(() => [...l[8] || (l[8] = [
1093
1117
  V(" 搜索 ", -1)
1094
1118
  ])]),
1095
1119
  _: 1
1096
1120
  }, 8, ["onClick"])) : k("", !0),
1097
- f.option.tools?.reset ? (c(), g(u(O), {
1121
+ p.option.tools?.reset ? (c(), g(u(F), {
1098
1122
  key: 1,
1099
1123
  onClick: e.search.reset
1100
1124
  }, {
1101
- default: h(() => [...o[9] || (o[9] = [
1125
+ default: h(() => [...l[9] || (l[9] = [
1102
1126
  V("重置", -1)
1103
1127
  ])]),
1104
1128
  _: 1
@@ -1106,69 +1130,72 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
1106
1130
  ]),
1107
1131
  _: 1
1108
1132
  }),
1109
- v(s.$slots, "search-end", {
1133
+ C(n.$slots, "search-end", {
1110
1134
  row: e.search.form
1111
1135
  })
1112
1136
  ]),
1113
1137
  _: 3
1114
1138
  }, 8, ["model"])
1115
1139
  ])) : k("", !0),
1116
- x("div", De, [
1117
- x("div", Ee, [
1118
- u(r)(f.option.tools?.add) ? (c(), w("div", $e, [
1119
- C(u(O), {
1140
+ x("div", Se, [
1141
+ x("div", Ie, [
1142
+ u(r)(p.option.tools?.add) ? (c(), w("div", Le, [
1143
+ v(u(F), {
1120
1144
  type: "primary",
1121
- onClick: o[0] || (o[0] = (t) => e.update.open(u(d).Insert))
1145
+ onClick: l[0] || (l[0] = (t) => e.update.open(u(d).Insert))
1122
1146
  }, {
1123
- default: h(() => [...o[10] || (o[10] = [
1147
+ default: h(() => [...l[10] || (l[10] = [
1124
1148
  V("新增", -1)
1125
1149
  ])]),
1126
1150
  _: 1
1127
1151
  })
1128
1152
  ])) : k("", !0),
1129
- f.option.table?.selectable && u(r)(f.option.tools?.delete) ? (c(), w("div", Fe, [
1130
- C(u(O), {
1153
+ p.option.table?.selectable && u(r)(p.option.tools?.delete) ? (c(), w("div", je, [
1154
+ v(u(F), {
1131
1155
  type: "danger",
1132
- onClick: o[1] || (o[1] = (t) => e.remove.open(e.table.selection.list))
1156
+ onClick: l[1] || (l[1] = (t) => e.remove.open(e.table.selection.list))
1133
1157
  }, {
1134
- default: h(() => [...o[11] || (o[11] = [
1158
+ default: h(() => [...l[11] || (l[11] = [
1135
1159
  V(" 删除 ", -1)
1136
1160
  ])]),
1137
1161
  _: 1
1138
1162
  })
1139
1163
  ])) : k("", !0),
1140
- f.option.tools?.expand ? (c(), w("div", Oe, [
1141
- C(u(O), {
1164
+ p.option.tools?.expand ? (c(), w("div", ze, [
1165
+ v(u(F), {
1142
1166
  type: "warning",
1143
- onClick: o[2] || (o[2] = (t) => e.table.expand.all())
1167
+ onClick: l[2] || (l[2] = (t) => e.table.expand.all())
1144
1168
  }, {
1145
- default: h(() => [...o[12] || (o[12] = [
1169
+ default: h(() => [...l[12] || (l[12] = [
1146
1170
  V("展开/收缩", -1)
1147
1171
  ])]),
1148
1172
  _: 1
1149
1173
  })
1150
1174
  ])) : k("", !0),
1151
- f.option.tools?.export?.show ? (c(), g(u(ce), {
1175
+ p.option.tools?.export?.show ? (c(), g(u(ce), {
1152
1176
  key: 3,
1153
- onCommand: e.table.export
1177
+ onCommand: e.export.click
1154
1178
  }, {
1155
1179
  dropdown: h(() => [
1156
- C(u(pe), null, {
1180
+ v(u(pe), null, {
1157
1181
  default: h(() => [
1158
- C(u(J), { command: "select" }, {
1159
- default: h(() => [...o[14] || (o[14] = [
1160
- V("导出选中", -1)
1182
+ p.option.table?.selectable ? (c(), g(u(A), {
1183
+ key: 0,
1184
+ command: "select"
1185
+ }, {
1186
+ default: h(() => [...l[14] || (l[14] = [
1187
+ V(" 导出选中 ", -1)
1161
1188
  ])]),
1162
1189
  _: 1
1163
- }),
1164
- C(u(J), { command: "page" }, {
1165
- default: h(() => [...o[15] || (o[15] = [
1190
+ })) : k("", !0),
1191
+ v(u(A), { command: "page" }, {
1192
+ default: h(() => [...l[15] || (l[15] = [
1166
1193
  V("导出本页", -1)
1167
1194
  ])]),
1168
1195
  _: 1
1169
1196
  }),
1170
- C(u(J), { command: "all" }, {
1171
- default: h(() => [...o[16] || (o[16] = [
1197
+ v(u(A), { command: "all" }, {
1198
+ default: h(() => [...l[16] || (l[16] = [
1172
1199
  V("导出全部", -1)
1173
1200
  ])]),
1174
1201
  _: 1
@@ -1178,65 +1205,60 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
1178
1205
  })
1179
1206
  ]),
1180
1207
  default: h(() => [
1181
- x("div", Se, [
1182
- C(u(O), { type: "warning" }, {
1183
- default: h(() => [...o[13] || (o[13] = [
1208
+ x("div", Re, [
1209
+ v(u(F), {
1210
+ type: "warning",
1211
+ loading: e.export.loading
1212
+ }, {
1213
+ default: h(() => [...l[13] || (l[13] = [
1184
1214
  V("导出", -1)
1185
1215
  ])]),
1186
1216
  _: 1
1187
- })
1217
+ }, 8, ["loading"])
1188
1218
  ])
1189
1219
  ]),
1190
1220
  _: 1
1191
1221
  }, 8, ["onCommand"])) : k("", !0),
1192
- v(s.$slots, "tools-left")
1222
+ C(n.$slots, "tools-left")
1193
1223
  ]),
1194
- x("div", Ie, [
1195
- v(s.$slots, "tools-right"),
1196
- f.option.tools?.refresh === void 0 || f.option.tools?.refresh ? (c(), w("div", {
1224
+ x("div", Te, [
1225
+ C(n.$slots, "tools-right"),
1226
+ p.option.tools?.refresh === void 0 || p.option.tools?.refresh ? (c(), w("div", {
1197
1227
  key: 0,
1198
1228
  class: "refresh-btn",
1199
- onClick: o[3] || (o[3] = //@ts-ignore
1229
+ onClick: l[3] || (l[3] = //@ts-ignore
1200
1230
  (...t) => e.table.getList && e.table.getList(...t))
1201
- }, [...o[17] || (o[17] = [
1202
- x("svg", {
1203
- xmlns: "http://www.w3.org/2000/svg",
1204
- viewBox: "0 0 1024 1024"
1205
- }, [
1206
- x("path", {
1207
- fill: "currentColor",
1208
- d: "M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"
1209
- })
1210
- ], -1)
1211
- ])])) : k("", !0)
1231
+ }, [
1232
+ v(De)
1233
+ ])) : k("", !0)
1212
1234
  ])
1213
1235
  ]),
1214
- x("div", Le, [
1215
- x("div", je, [
1236
+ x("div", Me, [
1237
+ x("div", Ne, [
1216
1238
  ie((c(), g(u(fe), U({
1217
1239
  data: e.table.data
1218
- }, f.option.table, {
1240
+ }, p.option.table, {
1219
1241
  onSelectionChange: e.table.selection.change,
1220
1242
  "expand-row-keys": e.table.expand.rowKeys,
1221
1243
  onExpandChange: e.table.expand.change
1222
1244
  }), {
1223
1245
  default: h(() => [
1224
- f.option.table?.selectable && u(r)(f.option.tools?.delete) ? (c(), g(u(W), {
1246
+ p.option.table?.selectable && (u(r)(p.option.tools?.delete) || p.option.tools?.export?.show) ? (c(), g(u(J), {
1225
1247
  key: 0,
1226
1248
  type: "selection",
1227
- selectable: typeof f.option.table?.selectable == "function" ? f.option.table?.selectable : void 0,
1249
+ selectable: typeof p.option.table?.selectable == "function" ? p.option.table?.selectable : void 0,
1228
1250
  width: "55"
1229
1251
  }, null, 8, ["selectable"])) : k("", !0),
1230
1252
  (c(!0), w($, null, L(e.table.column.list, (t) => (c(), w($, {
1231
1253
  key: t.key
1232
1254
  }, [
1233
- e.table.column.show.list.includes(t.key) ? (c(), g(u(W), U({
1255
+ e.table.column.show.list.includes(t.key) ? (c(), g(u(J), U({
1234
1256
  key: 0,
1235
1257
  prop: t.key,
1236
1258
  label: t.label
1237
1259
  }, { ref_for: !0 }, t.table), {
1238
1260
  default: h(({ row: a }) => [
1239
- v(s.$slots, "table-" + t.key, {
1261
+ C(n.$slots, "table-" + t.key, {
1240
1262
  row: a,
1241
1263
  item: t
1242
1264
  }, () => [
@@ -1246,14 +1268,14 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
1246
1268
  "onUpdate:modelValue": (b) => a[t.key] = b,
1247
1269
  "before-change": () => t.options?.switch?.tableBeforeChange?.(t.key, a)
1248
1270
  }, { ref_for: !0 }, t.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "before-change"])) : (c(), w($, { key: 1 }, [
1249
- V(_(a[t.key]), 1)
1271
+ V(W(a[t.key]), 1)
1250
1272
  ], 64))
1251
1273
  ])
1252
1274
  ]),
1253
1275
  _: 2
1254
1276
  }, 1040, ["prop", "label"])) : k("", !0)
1255
1277
  ], 64))), 128)),
1256
- u(r)(f.option.tools?.add) || u(r)(f.option.tools?.update) || u(r)(f.option.tools?.delete) || s.$slots["table-op-left"] || s.$slots["table-op-right"] ? (c(), g(u(W), {
1278
+ u(r)(p.option.tools?.add) || u(r)(p.option.tools?.update) || u(r)(p.option.tools?.delete) || n.$slots["table-op-left"] || n.$slots["table-op-right"] ? (c(), g(u(J), {
1257
1279
  key: 1,
1258
1280
  label: "操作",
1259
1281
  width: "180",
@@ -1261,58 +1283,57 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
1261
1283
  fixed: "right"
1262
1284
  }, {
1263
1285
  default: h(({ row: t }) => [
1264
- v(s.$slots, "table-op-left", { row: t }),
1265
- u(r)(f.option.tools?.add, t) ? (c(), g(u(O), {
1286
+ C(n.$slots, "table-op-left", { row: t }),
1287
+ u(r)(p.option.tools?.add, t) ? (c(), g(u(F), {
1266
1288
  key: 0,
1267
1289
  link: "",
1268
1290
  type: "primary",
1269
1291
  onClick: (a) => e.update.open(u(d).Insert, t)
1270
1292
  }, {
1271
- default: h(() => [...o[18] || (o[18] = [
1293
+ default: h(() => [...l[17] || (l[17] = [
1272
1294
  V(" 新增 ", -1)
1273
1295
  ])]),
1274
1296
  _: 1
1275
1297
  }, 8, ["onClick"])) : k("", !0),
1276
- u(r)(f.option.tools?.update, t) ? (c(), g(u(O), {
1298
+ u(r)(p.option.tools?.update, t) ? (c(), g(u(F), {
1277
1299
  key: 1,
1278
1300
  link: "",
1279
1301
  type: "warning",
1280
1302
  onClick: (a) => e.update.open(u(d).Update, t)
1281
1303
  }, {
1282
- default: h(() => [...o[19] || (o[19] = [
1304
+ default: h(() => [...l[18] || (l[18] = [
1283
1305
  V(" 编辑 ", -1)
1284
1306
  ])]),
1285
1307
  _: 1
1286
1308
  }, 8, ["onClick"])) : k("", !0),
1287
- u(r)(f.option.tools?.delete, t) ? (c(), g(u(O), {
1309
+ u(r)(p.option.tools?.delete, t) ? (c(), g(u(F), {
1288
1310
  key: 2,
1289
1311
  link: "",
1290
1312
  type: "danger",
1291
1313
  onClick: (a) => e.remove.open([t])
1292
1314
  }, {
1293
- default: h(() => [...o[20] || (o[20] = [
1315
+ default: h(() => [...l[19] || (l[19] = [
1294
1316
  V(" 删除 ", -1)
1295
1317
  ])]),
1296
1318
  _: 1
1297
1319
  }, 8, ["onClick"])) : k("", !0),
1298
- v(s.$slots, "table-op-right", { row: t })
1320
+ C(n.$slots, "table-op-right", { row: t })
1299
1321
  ]),
1300
1322
  _: 3
1301
1323
  })) : k("", !0)
1302
1324
  ]),
1303
1325
  _: 3
1304
1326
  }, 16, ["data", "onSelectionChange", "expand-row-keys", "onExpandChange"])), [
1305
- [l, e.table.loading]
1327
+ [o, e.table.loading]
1306
1328
  ])
1307
1329
  ])
1308
1330
  ]),
1309
- x("div", ze, [
1310
- e.page.total > e.page.size ? (c(), g(u(me), {
1311
- key: 0,
1331
+ x("div", Pe, [
1332
+ v(u(me), {
1312
1333
  "current-page": e.page.num,
1313
- "onUpdate:currentPage": o[4] || (o[4] = (t) => e.page.num = t),
1334
+ "onUpdate:currentPage": l[4] || (l[4] = (t) => e.page.num = t),
1314
1335
  "page-size": e.page.size,
1315
- "onUpdate:pageSize": o[5] || (o[5] = (t) => e.page.size = t),
1336
+ "onUpdate:pageSize": l[5] || (l[5] = (t) => e.page.size = t),
1316
1337
  background: "",
1317
1338
  "page-sizes": e.page.sizeList,
1318
1339
  "pager-count": 7,
@@ -1320,34 +1341,34 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
1320
1341
  total: e.page.total,
1321
1342
  onSizeChange: e.table.getList,
1322
1343
  onCurrentChange: e.table.getList
1323
- }, null, 8, ["current-page", "page-size", "page-sizes", "layout", "total", "onSizeChange", "onCurrentChange"])) : k("", !0)
1344
+ }, null, 8, ["current-page", "page-size", "page-sizes", "layout", "total", "onSizeChange", "onCurrentChange"])
1324
1345
  ])
1325
1346
  ]),
1326
- v(s.$slots, "box-right")
1347
+ C(n.$slots, "box-right")
1327
1348
  ]),
1328
- C(u(q), U({
1349
+ v(u(q), U({
1329
1350
  modelValue: e.update.show,
1330
- "onUpdate:modelValue": o[6] || (o[6] = (t) => e.update.show = t),
1351
+ "onUpdate:modelValue": l[6] || (l[6] = (t) => e.update.show = t),
1331
1352
  title: e.update.title,
1332
1353
  "close-on-click-modal": !1,
1333
1354
  "before-close": e.update.close
1334
- }, f.option.dialog), {
1355
+ }, p.option.dialog), {
1335
1356
  footer: h(() => [
1336
- x("span", Me, [
1337
- C(u(O), {
1357
+ x("span", Ae, [
1358
+ v(u(F), {
1338
1359
  onClick: e.update.close
1339
1360
  }, {
1340
- default: h(() => [...o[21] || (o[21] = [
1361
+ default: h(() => [...l[20] || (l[20] = [
1341
1362
  V("关闭", -1)
1342
1363
  ])]),
1343
1364
  _: 1
1344
1365
  }, 8, ["onClick"]),
1345
- C(u(O), {
1366
+ v(u(F), {
1346
1367
  type: "primary",
1347
1368
  onClick: e.update.submit,
1348
1369
  loading: e.update.loading
1349
1370
  }, {
1350
- default: h(() => [...o[22] || (o[22] = [
1371
+ default: h(() => [...l[21] || (l[21] = [
1351
1372
  V(" 提交 ", -1)
1352
1373
  ])]),
1353
1374
  _: 1
@@ -1355,7 +1376,7 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
1355
1376
  ])
1356
1377
  ]),
1357
1378
  default: h(() => [
1358
- C(u(K), {
1379
+ v(u(K), {
1359
1380
  ref_key: "ruleFormRef",
1360
1381
  ref: m,
1361
1382
  model: e.update.form,
@@ -1368,20 +1389,20 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
1368
1389
  e.update.form
1369
1390
  ) ? (c(), w("div", {
1370
1391
  key: 0,
1371
- class: T(["row curd-row", {
1372
- stripe: f.option.form?.stripe === void 0 ? !0 : f.option.form?.stripe
1392
+ class: R(["row curd-row", {
1393
+ stripe: p.option.form?.stripe === void 0 ? !0 : p.option.form?.stripe
1373
1394
  }])
1374
1395
  }, [
1375
- v(s.$slots, "form-start", {
1396
+ C(n.$slots, "form-start", {
1376
1397
  row: e.update.form
1377
1398
  }),
1378
1399
  (c(!0), w($, null, L(t, (a) => (c(), w($, null, [
1379
1400
  u(r)(a.item.show?.form, e.update.form) ? (c(), w("div", {
1380
1401
  key: 0,
1381
- class: T(a.item.form.span > 0 ? `col-${a.item.form.span}` : "col")
1402
+ class: R(a.item.form.span > 0 ? `col-${a.item.form.span}` : "col")
1382
1403
  }, [
1383
- C(u(P), {
1384
- class: T({
1404
+ v(u(P), {
1405
+ class: R({
1385
1406
  "hide-label": typeof a.item.text?.form?.label == "boolean" ? !a.item.text?.form?.label : !1
1386
1407
  }),
1387
1408
  label: typeof a.item.text?.form?.label == "string" ? a.item.text?.form?.label : a.item.label,
@@ -1389,13 +1410,13 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
1389
1410
  "label-width": a.item.form?.labelWidth || "100px"
1390
1411
  }, {
1391
1412
  default: h(() => [
1392
- x("div", Te, [
1393
- v(s.$slots, "form-" + a.item.key + "-start", {
1413
+ x("div", _e, [
1414
+ C(n.$slots, "form-" + a.item.key + "-start", {
1394
1415
  row: e.update.form,
1395
1416
  item: a.item
1396
1417
  }),
1397
- x("div", Re, [
1398
- v(s.$slots, "form-" + a.item.key, {
1418
+ x("div", Be, [
1419
+ C(n.$slots, "form-" + a.item.key, {
1399
1420
  row: e.update.form,
1400
1421
  item: a.item
1401
1422
  }, () => [
@@ -1411,7 +1432,7 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
1411
1432
  "onUpdate:modelValue": (b) => e.update.form[a.item.key] = b
1412
1433
  }, { ref_for: !0 }, a.item.options?.switch, {
1413
1434
  disabled: e.update.getDisabled(a.item)
1414
- }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : a.item.type === "select" ? (c(), g(u(B), U({
1435
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : a.item.type === "select" ? (c(), g(u(_), U({
1415
1436
  key: 2,
1416
1437
  modelValue: e.update.form[a.item.key],
1417
1438
  "onUpdate:modelValue": (b) => e.update.form[a.item.key] = b
@@ -1456,7 +1477,7 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
1456
1477
  }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : k("", !0)
1457
1478
  ])
1458
1479
  ]),
1459
- v(s.$slots, "form-" + a.item.key + "-end", {
1480
+ C(n.$slots, "form-" + a.item.key + "-end", {
1460
1481
  row: e.update.form,
1461
1482
  item: a.item
1462
1483
  })
@@ -1466,7 +1487,7 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
1466
1487
  }, 1032, ["class", "label", "prop", "label-width"])
1467
1488
  ], 2)) : k("", !0)
1468
1489
  ], 64))), 256)),
1469
- v(s.$slots, "form-end", {
1490
+ C(n.$slots, "form-end", {
1470
1491
  row: e.update.form
1471
1492
  })
1472
1493
  ], 2)) : k("", !0)
@@ -1477,28 +1498,28 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
1477
1498
  ]),
1478
1499
  _: 3
1479
1500
  }, 16, ["modelValue", "title", "before-close"]),
1480
- C(u(q), {
1501
+ v(u(q), {
1481
1502
  modelValue: e.remove.show,
1482
- "onUpdate:modelValue": o[7] || (o[7] = (t) => e.remove.show = t),
1503
+ "onUpdate:modelValue": l[7] || (l[7] = (t) => e.remove.show = t),
1483
1504
  title: e.remove.title,
1484
1505
  "close-on-click-modal": !1
1485
1506
  }, {
1486
1507
  footer: h(() => [
1487
- x("span", Ne, [
1488
- C(u(O), {
1508
+ x("span", Je, [
1509
+ v(u(F), {
1489
1510
  onClick: e.remove.close
1490
1511
  }, {
1491
- default: h(() => [...o[23] || (o[23] = [
1512
+ default: h(() => [...l[22] || (l[22] = [
1492
1513
  V("关闭", -1)
1493
1514
  ])]),
1494
1515
  _: 1
1495
1516
  }, 8, ["onClick"]),
1496
- C(u(O), {
1517
+ v(u(F), {
1497
1518
  type: "danger",
1498
1519
  onClick: e.remove.submit,
1499
1520
  loading: e.remove.loading
1500
1521
  }, {
1501
- default: h(() => [...o[24] || (o[24] = [
1522
+ default: h(() => [...l[23] || (l[23] = [
1502
1523
  V(" 确认删除 ", -1)
1503
1524
  ])]),
1504
1525
  _: 1
@@ -1506,25 +1527,25 @@ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ A({
1506
1527
  ])
1507
1528
  ]),
1508
1529
  default: h(() => [
1509
- x("div", null, "确认要删除【" + _(e.remove.items.length) + "】条数据吗?", 1)
1530
+ x("div", null, "确认要删除【" + W(e.remove.items.length) + "】条数据吗?", 1)
1510
1531
  ]),
1511
1532
  _: 1
1512
1533
  }, 8, ["modelValue", "title"]),
1513
- C(ve, {
1534
+ v(ve, {
1514
1535
  ref_key: "switchConfirmRef",
1515
- ref: p
1536
+ ref: f
1516
1537
  }, null, 512)
1517
1538
  ]);
1518
1539
  };
1519
1540
  }
1520
1541
  });
1521
- class We {
1542
+ class qe {
1522
1543
  /**
1523
1544
  * 通过文件远程地址下载文件
1524
1545
  */
1525
1546
  static async download(i, d = "download.png") {
1526
- const n = document.createElement("a");
1527
- n.style.display = "none", n.href = i, n.setAttribute("download", d), typeof n.download > "u" && n.setAttribute("target", "_blank"), document.body.appendChild(n), n.click(), document.body.removeChild(n), window.URL.revokeObjectURL(i);
1547
+ const s = document.createElement("a");
1548
+ s.style.display = "none", s.href = i, s.setAttribute("download", d), typeof s.download > "u" && s.setAttribute("target", "_blank"), document.body.appendChild(s), s.click(), document.body.removeChild(s), window.URL.revokeObjectURL(i);
1528
1549
  }
1529
1550
  /**
1530
1551
  * 将json对象或者json数组导出为json文件保存
@@ -1532,52 +1553,52 @@ class We {
1532
1553
  * @param name
1533
1554
  */
1534
1555
  static exportJSONFile = (i, d) => {
1535
- const n = new Blob([JSON.stringify(i)], { type: "application/json" }), p = URL.createObjectURL(n), m = document.createElement("a");
1536
- m.href = p, m.download = `${d || "config"}.json`, m.click();
1556
+ const s = new Blob([JSON.stringify(i)], { type: "application/json" }), f = URL.createObjectURL(s), m = document.createElement("a");
1557
+ m.href = f, m.download = `${d || "config"}.json`, m.click();
1537
1558
  };
1538
1559
  /**
1539
1560
  * 导入文件内容,默认为json
1540
1561
  * @param param
1541
1562
  * @returns
1542
1563
  */
1543
- static importFile = async (i) => new Promise((d, n) => {
1544
- const p = document.createElement("input");
1545
- p.type = "file";
1564
+ static importFile = async (i) => new Promise((d, s) => {
1565
+ const f = document.createElement("input");
1566
+ f.type = "file";
1546
1567
  const m = i?.accept || ".json";
1547
- p.accept = m, p.style.display = "none", p.onchange = (r) => {
1568
+ f.accept = m, f.style.display = "none", f.onchange = (r) => {
1548
1569
  const e = r.target.files[0];
1549
1570
  if (!e) {
1550
- D.fail("未选择文件"), n("未选择文件");
1571
+ D.fail("未选择文件"), s("未选择文件");
1551
1572
  return;
1552
1573
  }
1553
- const s = new FileReader();
1554
- s.onload = async (o) => {
1555
- const l = m == ".json" ? JSON.parse(o.target.result) : o.target.result;
1556
- d(l);
1557
- }, s.onerror = () => {
1558
- D.fail("文件读取失败"), n("文件读取失败");
1559
- }, s.readAsText(e), document.body.removeChild(p);
1560
- }, document.body.appendChild(p), p.click();
1574
+ const n = new FileReader();
1575
+ n.onload = async (l) => {
1576
+ const o = m == ".json" ? JSON.parse(l.target.result) : l.target.result;
1577
+ d(o);
1578
+ }, n.onerror = () => {
1579
+ D.fail("文件读取失败"), s("文件读取失败");
1580
+ }, n.readAsText(e), document.body.removeChild(f);
1581
+ }, document.body.appendChild(f), f.click();
1561
1582
  });
1562
1583
  }
1563
- const Be = (f, i) => {
1564
- if (f.component("TCurd", Pe), f.component("TFormList", Q), f.component("TColumn", ge), i?.customComponent) {
1584
+ const Ke = (p, i) => {
1585
+ if (p.component("TCurd", We), p.component("TFormList", Q), p.component("TColumn", ge), i?.customComponent) {
1565
1586
  S.customComponent = i.customComponent;
1566
1587
  for (const d in i.customComponent)
1567
- f.component(d, i.customComponent[d]);
1588
+ p.component(d, i.customComponent[d]);
1568
1589
  }
1569
- }, _e = {
1570
- install: Be
1590
+ }, Xe = {
1591
+ install: Ke
1571
1592
  };
1572
1593
  export {
1573
1594
  j as ArrUtil,
1574
1595
  we as ExcelUtil,
1575
1596
  ge as TColumn,
1576
- Pe as TCurd,
1577
- We as TFile,
1597
+ We as TCurd,
1598
+ qe as TFile,
1578
1599
  S as TForm,
1579
1600
  Q as TFormList,
1580
1601
  D as TSys,
1581
- _e as default,
1582
- Be as install
1602
+ Xe as default,
1603
+ Ke as install
1583
1604
  };