cc1-form 1.0.3 → 1.0.4

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 P, reactive as q, onMounted as ee, resolveComponent as Z, createElementBlock as w, createCommentVNode as C, openBlock as p, renderSlot as k, createElementVNode as U, createVNode as v, withCtx as h, createTextVNode as V, Fragment as $, renderList as I, createBlock as g, normalizeClass as X, normalizeStyle as se, ref as z, unref as u, mergeProps as D, toHandlers as F, resolveDynamicComponent as te, toDisplayString as A, resolveDirective as ne, withDirectives as re } from "vue";
2
- import { ElMessage as ie, ElLoading as de, ElForm as J, ElFormItem as _, ElInput as K, ElSwitch as H, ElSelect as N, ElOption as M, ElTreeSelect as oe, ElDatePicker as le, ElDialog as G, ElButton as S, ElDropdown as ue, ElDropdownMenu as pe, ElDropdownItem as B, ElTable as fe, ElTableColumn as W, ElPagination as ce } from "element-plus";
1
+ import { defineComponent as P, reactive as q, onMounted as ee, resolveComponent as Z, createElementBlock as w, createCommentVNode as C, openBlock as p, renderSlot as k, createElementVNode as U, createVNode as v, withCtx as h, createTextVNode as V, Fragment as $, renderList as I, createBlock as g, normalizeClass as X, normalizeStyle as se, ref as T, nextTick as ne, unref as u, mergeProps as D, toHandlers as F, resolveDynamicComponent as te, toDisplayString as A, resolveDirective as ie, withDirectives as re } from "vue";
2
+ import { ElMessage as de, ElLoading as ue, ElForm as J, ElFormItem as _, ElInput as K, ElSwitch as H, ElSelect as N, ElOption as M, ElTreeSelect as oe, ElDatePicker as le, ElDialog as G, ElButton as S, ElDropdown as pe, ElDropdownMenu as fe, ElDropdownItem as B, ElTable as ce, ElTableColumn as W, ElPagination as me } from "element-plus";
3
3
  class O {
4
4
  /**
5
5
  * 路由
@@ -24,13 +24,13 @@ class O {
24
24
  * @param data 数据
25
25
  * @returns 是否显示
26
26
  */
27
- static isFun = (d, i) => typeof d == "function" ? d(i) : d;
27
+ static isFun = (d, r) => typeof d == "function" ? d(r) : d;
28
28
  /**
29
29
  * 获取路由参数,自动获取query、params中的参数, 哪个有就返回哪个
30
30
  */
31
31
  static getRouterParams = () => {
32
- const d = this.router.currentRoute.value.query || {}, i = this.router.currentRoute.value.params || {};
33
- return Object.keys(d).length ? d : Object.keys(i).length ? i : {};
32
+ const d = this.router.currentRoute.value.query || {}, r = this.router.currentRoute.value.params || {};
33
+ return Object.keys(d).length ? d : Object.keys(r).length ? r : {};
34
34
  };
35
35
  /**
36
36
  * 模块赋值
@@ -43,8 +43,8 @@ class O {
43
43
  static loadModule = async (d) => {
44
44
  if (!O.moduleObj[d])
45
45
  throw new Error(`模块${d}未加载,请赋值如:TSys.moduleObj = { ${d}: ()=>import('${d}') }`);
46
- const i = await O.moduleObj[d]();
47
- return i.default ?? i;
46
+ const r = await O.moduleObj[d]();
47
+ return r.default ?? r;
48
48
  };
49
49
  /**
50
50
  * 提示信息对象管理
@@ -60,18 +60,18 @@ class O {
60
60
  * @param type 消息类型
61
61
  * @param options 其他选项
62
62
  */
63
- static showMessage(d, i, r = {}) {
63
+ static showMessage(d, r, i = {}) {
64
64
  const c = Date.now();
65
65
  if (!this.tipMessages[d] || c - this.tipMessages[d] > this.tipMessagesGap) {
66
66
  this.tipMessages[d] = c;
67
67
  const m = Object.assign(
68
68
  {
69
69
  message: d,
70
- type: i
70
+ type: r
71
71
  },
72
- r
72
+ i
73
73
  );
74
- ie(m), setTimeout(() => {
74
+ de(m), setTimeout(() => {
75
75
  delete this.tipMessages[d];
76
76
  }, this.tipMessagesGap);
77
77
  }
@@ -81,16 +81,16 @@ class O {
81
81
  * @param content
82
82
  * @param options
83
83
  */
84
- static fail = (d, i = {}) => {
85
- this.showMessage(d, "error", i);
84
+ static fail = (d, r = {}) => {
85
+ this.showMessage(d, "error", r);
86
86
  };
87
87
  /**
88
88
  * 成功提示
89
89
  * @param content
90
90
  * @param options
91
91
  */
92
- static success = (d, i = {}) => {
93
- this.showMessage(d, "success", i);
92
+ static success = (d, r = {}) => {
93
+ this.showMessage(d, "success", r);
94
94
  };
95
95
  static loadingObj = null;
96
96
  static loadingTimer = null;
@@ -99,11 +99,11 @@ class O {
99
99
  * @param show
100
100
  * @param text
101
101
  */
102
- static loading = (d = !0, i = "加载中") => {
102
+ static loading = (d = !0, r = "加载中") => {
103
103
  Timer.un(this.loadingTimer), this.loadingTimer = Timer.once(() => {
104
- d ? this.loadingObj = de.service({
104
+ d ? this.loadingObj = ue.service({
105
105
  lock: !0,
106
- text: i,
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,13 +113,13 @@ class O {
113
113
  * @param url 地址
114
114
  * @param isCenter 是否居中
115
115
  */
116
- static openUrl = (d, i = !0) => {
117
- if (i) {
118
- let r = screen.width / 2 - 500, c = screen.height / 2 - 800 / 2 - 30;
116
+ static openUrl = (d, r = !0) => {
117
+ if (r) {
118
+ let i = screen.width / 2 - 500, c = screen.height / 2 - 800 / 2 - 30;
119
119
  window.open(
120
120
  d,
121
121
  "_blank",
122
- "toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + c + ", left=" + r
122
+ "toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + c + ", left=" + i
123
123
  );
124
124
  } else
125
125
  window.open(
@@ -133,7 +133,7 @@ class O {
133
133
  * @param param
134
134
  * @returns
135
135
  */
136
- static getImgPic = (d) => new Promise(async (i, r) => {
136
+ static getImgPic = (d) => new Promise(async (r, i) => {
137
137
  let c = document.getElementById(d.id);
138
138
  const m = await O.loadModule("html2canvas");
139
139
  try {
@@ -147,20 +147,20 @@ class O {
147
147
  windowHeight: d.windowHeight,
148
148
  useCORS: !0,
149
149
  backgroundColor: "#ffffff00"
150
- }).then(function(n) {
151
- let e = n.toDataURL("image/png");
152
- i(e);
150
+ }).then(function(s) {
151
+ let e = s.toDataURL("image/png");
152
+ r(e);
153
153
  });
154
- } catch (n) {
155
- r(n);
154
+ } catch (s) {
155
+ i(s);
156
156
  }
157
157
  });
158
158
  /**
159
159
  * 下载文件
160
160
  */
161
- static async download(d, i = "download.png") {
162
- const r = document.createElement("a");
163
- r.style.display = "none", r.href = d, r.setAttribute("download", i), typeof r.download > "u" && r.setAttribute("target", "_blank"), document.body.appendChild(r), r.click(), document.body.removeChild(r), window.URL.revokeObjectURL(d);
161
+ static async download(d, r = "download.png") {
162
+ const i = document.createElement("a");
163
+ i.style.display = "none", i.href = d, i.setAttribute("download", r), typeof i.download > "u" && i.setAttribute("target", "_blank"), document.body.appendChild(i), i.click(), document.body.removeChild(i), window.URL.revokeObjectURL(d);
164
164
  }
165
165
  }
166
166
  class j {
@@ -174,10 +174,10 @@ class j {
174
174
  * @param field
175
175
  * @returns
176
176
  */
177
- static findOptions = (d, i) => {
178
- const r = d.column.find((m) => m.key === i), c = (m) => m.replace(/-([a-z])/g, (n, e) => e.toUpperCase());
179
- if (r)
180
- return r.options[c(r.type)];
177
+ static findOptions = (d, r) => {
178
+ const i = d.column.find((m) => m.key === r), c = (m) => m.replace(/-([a-z])/g, (s, e) => e.toUpperCase());
179
+ if (i)
180
+ return i.options[c(i.type)];
181
181
  };
182
182
  /**
183
183
  * 更新组件数据
@@ -195,9 +195,9 @@ class j {
195
195
  }))
196
196
  )
197
197
  */
198
- static setOptionsData = (d, i, r) => {
199
- const c = j.findOptions(d, i);
200
- c && (c.data = r);
198
+ static setOptionsData = (d, r, i) => {
199
+ const c = j.findOptions(d, r);
200
+ c && (c.data = i);
201
201
  };
202
202
  static form = {
203
203
  openBefore: {
@@ -208,8 +208,8 @@ class j {
208
208
  * @param treeData 树形数据
209
209
  * @param option 组件配置
210
210
  */
211
- parentId: (d, i, r, c) => {
212
- d ? i.type === O.EDialog.Insert ? (i.form.parentId = d._id, i.form.sort = d.children.length + 1) : i.form.parentId = d.parentId.substring(d.parentId.lastIndexOf(",") + 1) : (i.form.parentId = "0", i.form.sort = r.length + 1), j.setOptionsData(c, "parentId", [{ _id: "0", title: "根", children: r }]);
211
+ parentId: (d, r, i, c) => {
212
+ d ? r.type === O.EDialog.Insert ? (r.form.parentId = d._id, r.form.sort = d.children.length + 1) : r.form.parentId = d.parentId.substring(d.parentId.lastIndexOf(",") + 1) : (r.form.parentId = "0", r.form.sort = i.length + 1), j.setOptionsData(c, "parentId", [{ _id: "0", title: "根", children: i }]);
213
213
  }
214
214
  }
215
215
  };
@@ -224,11 +224,11 @@ class L {
224
224
  * @param field 字段名
225
225
  * @param row 行数据
226
226
  */
227
- static setId = (d, i, r) => {
228
- i[d] || (i[d] = []), i[d].forEach((c) => {
229
- r.forEach((m) => {
230
- let n = m.default ?? "";
231
- m.type === "number" && (n = m.default ?? 0), m.type === "boolean" && (n = m.default ?? !1), m.type === "time" && (n = m.default ?? /* @__PURE__ */ new Date()), c[m.value] === void 0 && (c[m.value] = n);
227
+ static setId = (d, r, i) => {
228
+ r[d] || (r[d] = []), r[d].forEach((c) => {
229
+ i.forEach((m) => {
230
+ let s = m.default ?? "";
231
+ 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);
232
232
  }), c._id || (c._id = L.getIdFun());
233
233
  });
234
234
  };
@@ -239,17 +239,17 @@ class L {
239
239
  * @param itemFields 元素字段-如:[{label:'',value:''}]
240
240
  * @param callback 回调函数
241
241
  */
242
- static add = (d, i, r, c) => {
243
- const m = JSONUtil.cp(r);
244
- L.setId(d, i, r), i[d].push(
242
+ static add = (d, r, i, c) => {
243
+ const m = JSONUtil.cp(i);
244
+ L.setId(d, r, i), r[d].push(
245
245
  m.reduce(
246
- (n, e) => {
247
- let s = e.default ?? "";
248
- return e.type === "number" && (s = e.default ?? 0), e.type === "boolean" && (s = e.default ?? !1), e.type === "time" && (s = e.default ?? /* @__PURE__ */ new Date()), n[e.value] = s, n;
246
+ (s, e) => {
247
+ let n = e.default ?? "";
248
+ return e.type === "number" && (n = e.default ?? 0), e.type === "boolean" && (n = e.default ?? !1), e.type === "time" && (n = e.default ?? /* @__PURE__ */ new Date()), s[e.value] = n, s;
249
249
  },
250
250
  { _id: L.getIdFun() }
251
251
  )
252
- ), c?.(i);
252
+ ), c?.(r);
253
253
  };
254
254
  /**
255
255
  * 删除数组元素
@@ -258,8 +258,8 @@ class L {
258
258
  * @param item 元素-如:{_id:''}
259
259
  * @param callback 回调函数
260
260
  */
261
- static remove = (d, i, r, c) => {
262
- i[d] = i[d].filter((m) => m._id !== r._id), c?.(i);
261
+ static remove = (d, r, i, c) => {
262
+ r[d] = r[d].filter((m) => m._id !== i._id), c?.(r);
263
263
  };
264
264
  /**
265
265
  * 获取没有id的数据
@@ -267,18 +267,18 @@ class L {
267
267
  * @param childernField 子级字段-如:list、children
268
268
  * @returns 没有id的数据
269
269
  */
270
- static getNoIdData = (d, i) => {
271
- const r = JSONUtil.cp(d);
272
- return r.forEach((c) => {
273
- c._id && delete c._id, i && c[i] && L.getNoIdData(c[i], i);
274
- }), r;
270
+ static getNoIdData = (d, r) => {
271
+ const i = JSONUtil.cp(d);
272
+ return i.forEach((c) => {
273
+ c._id && delete c._id, r && c[r] && L.getNoIdData(c[r], r);
274
+ }), i;
275
275
  };
276
276
  }
277
- const me = {
277
+ const he = {
278
278
  key: 0,
279
279
  class: "column",
280
280
  style: { width: "100%", gap: "10px" }
281
- }, he = {
281
+ }, be = {
282
282
  class: "row items-center",
283
283
  style: { gap: "10px", width: "100%" }
284
284
  }, Q = /* @__PURE__ */ P({
@@ -317,51 +317,51 @@ const me = {
317
317
  },
318
318
  emits: ["change"],
319
319
  setup(f, { emit: d }) {
320
- const i = f, r = q({
320
+ const r = f, i = q({
321
321
  show: !1,
322
- add: (m, n, e) => {
323
- L.add(m, n, e, () => {
322
+ add: (m, s, e) => {
323
+ L.add(m, s, e, () => {
324
324
  c("change");
325
325
  });
326
326
  },
327
- remove: (m, n, e) => {
328
- L.remove(m, n, e, () => {
327
+ remove: (m, s, e) => {
328
+ L.remove(m, s, e, () => {
329
329
  c("change");
330
330
  });
331
331
  }
332
332
  });
333
333
  ee(() => {
334
- L.setId(i.field, i.row, i.itemFields), r.show = !0;
334
+ L.setId(r.field, r.row, r.itemFields), i.show = !0;
335
335
  });
336
336
  const c = d;
337
- return (m, n) => {
338
- const e = Z("el-button"), s = Z("el-input");
339
- return r.show ? (p(), w("div", me, [
337
+ return (m, s) => {
338
+ const e = Z("el-button"), n = Z("el-input");
339
+ return i.show ? (p(), w("div", he, [
340
340
  k(m.$slots, "list-start", { row: f.row }),
341
341
  U("div", null, [
342
342
  v(e, {
343
343
  link: "",
344
344
  type: "primary",
345
- onClick: n[0] || (n[0] = (l) => r.add(f.field, f.row, f.itemFields))
345
+ onClick: s[0] || (s[0] = (l) => i.add(f.field, f.row, f.itemFields))
346
346
  }, {
347
- default: h(() => [...n[2] || (n[2] = [
347
+ default: h(() => [...s[2] || (s[2] = [
348
348
  V("添加", -1)
349
349
  ])]),
350
350
  _: 1
351
351
  })
352
352
  ]),
353
- (p(!0), w($, null, I(f.row[f.field], (l) => (p(), w("div", he, [
353
+ (p(!0), w($, null, I(f.row[f.field], (l) => (p(), w("div", be, [
354
354
  k(m.$slots, "item-start", {
355
355
  item: l,
356
356
  row: f.row
357
357
  }),
358
- (p(!0), w($, null, I(f.itemFields, (o) => (p(), g(s, {
358
+ (p(!0), w($, null, I(f.itemFields, (o) => (p(), g(n, {
359
359
  modelValue: l[o.value],
360
360
  "onUpdate:modelValue": (t) => l[o.value] = t,
361
361
  style: se({ width: f.inputWidth }),
362
362
  class: X(f.inputClass),
363
363
  placeholder: o[f.label] || o[f.value],
364
- onChange: n[1] || (n[1] = (t) => c("change"))
364
+ onChange: s[1] || (s[1] = (t) => c("change"))
365
365
  }, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
366
366
  k(m.$slots, "item-end", {
367
367
  item: l,
@@ -370,9 +370,9 @@ const me = {
370
370
  v(e, {
371
371
  link: "",
372
372
  type: "danger",
373
- onClick: (o) => r.remove(f.field, f.row, l)
373
+ onClick: (o) => i.remove(f.field, f.row, l)
374
374
  }, {
375
- default: h(() => [...n[3] || (n[3] = [
375
+ default: h(() => [...s[3] || (s[3] = [
376
376
  V("删除", -1)
377
377
  ])]),
378
378
  _: 1
@@ -382,7 +382,7 @@ const me = {
382
382
  ])) : C("", !0);
383
383
  };
384
384
  }
385
- }), be = { class: "row curd-row" }, ye = /* @__PURE__ */ P({
385
+ }), ye = { class: "row curd-row" }, ge = /* @__PURE__ */ P({
386
386
  __name: "column",
387
387
  props: {
388
388
  /**
@@ -390,53 +390,59 @@ const me = {
390
390
  */
391
391
  option: {
392
392
  default: {}
393
+ },
394
+ /**
395
+ * 类型
396
+ */
397
+ type: {
398
+ default: ""
393
399
  }
394
400
  },
395
401
  setup(f, { expose: d }) {
396
- const i = O.isFun, r = O.EDialog, c = z(), m = f, n = q({
402
+ const r = O.isFun, i = O.EDialog, c = T(), m = f, s = q({
397
403
  rules: {},
398
- show: !1,
399
- showContent: !1,
400
- loading: !1,
401
- type: r.Insert,
404
+ show: !0,
402
405
  form: {},
403
406
  formDefault: {},
404
407
  formColumn: [],
405
- getDisabled: (e) => e.disabled?.[n.type === r.Insert ? "create" : "update"],
408
+ getDisabled: (e) => e.disabled?.[(m.type || i.Insert) === i.Insert ? "create" : "update"],
406
409
  initColumnForm: () => {
407
410
  const e = m.option;
408
- n.formColumn = [];
409
- const s = [], l = m.option.form?.maxSpan || 12, o = m.option.form?.defaultSpan || l;
411
+ s.formColumn = [];
412
+ const n = [], l = m.option.form?.maxSpan || 12, o = m.option.form?.defaultSpan || l;
410
413
  let t = [];
411
414
  const a = (b) => {
412
- if (n.formDefault[b.key] = b.value, b.isForm) {
415
+ if (s.formDefault[b.key] = b.value, b.isForm) {
413
416
  b.form = b.form || { span: o }, b.form.span = b.form.span ?? o;
414
- let x = b.form.span, y = t.reduce((T, R) => T + R.span, x);
417
+ let x = b.form.span, y = t.reduce((z, R) => z + R.span, x);
415
418
  const E = t.length;
416
- t.push({ item: b, span: x }), (E === 1 && t[0].span === 0 || y >= l || x === 0 && E > 1) && (s.push(t), t = []), b.rules && (n.rules[b.key] = b.rules);
419
+ t.push({ item: b, span: x }), (E === 1 && t[0].span === 0 || y >= l || x === 0 && E > 1) && (n.push(t), t = []), b.rules && (s.rules[b.key] = b.rules);
417
420
  }
418
421
  };
419
422
  e.column.forEach((b) => {
420
423
  b.isForm = !0, a(b);
421
- }), t.length > 0 && s.push(t), n.formColumn = s;
424
+ }), t.length > 0 && n.push(t), s.formColumn = n;
425
+ },
426
+ init: async () => {
427
+ s.show = !1, await ne(), s.initColumnForm(), s.show = !0;
422
428
  }
423
429
  });
424
- return n.initColumnForm(), d({
430
+ return s.initColumnForm(), d({
425
431
  ref: c,
426
- conf: n
427
- }), (e, s) => (p(), g(u(J), {
432
+ conf: s
433
+ }), (e, n) => (p(), g(u(J), {
428
434
  ref_key: "ruleFormRef",
429
435
  ref: c,
430
- model: n.form,
431
- rules: n.rules
436
+ model: s.form,
437
+ rules: s.rules
432
438
  }, {
433
439
  default: h(() => [
434
- n.showContent ? (p(!0), w($, { key: 0 }, I(n.formColumn, (l) => (p(), w("div", be, [
440
+ s.show ? (p(!0), w($, { key: 0 }, I(s.formColumn, (l) => (p(), w("div", ye, [
435
441
  k(e.$slots, "form-start", {
436
- row: n.form
442
+ row: s.form
437
443
  }),
438
444
  (p(!0), w($, null, I(l, (o) => (p(), w($, null, [
439
- u(i)(o.item.show?.form, n.form) ? (p(), w("div", {
445
+ u(r)(o.item.show?.form, s.form) ?? !0 ? (p(), w("div", {
440
446
  key: 0,
441
447
  class: X(o.item.form.span > 0 ? `col-${o.item.form.span}` : "col")
442
448
  }, [
@@ -447,31 +453,31 @@ const me = {
447
453
  }, {
448
454
  default: h(() => [
449
455
  k(e.$slots, "form-" + o.item.key + "-start", {
450
- row: n.form,
456
+ row: s.form,
451
457
  item: o.item
452
458
  }),
453
459
  k(e.$slots, "form-" + o.item.key, {
454
- row: n.form,
460
+ row: s.form,
455
461
  item: o.item
456
462
  }, () => [
457
463
  o.item.type === "input" ? (p(), g(u(K), D({
458
464
  key: 0,
459
- modelValue: n.form[o.item.key],
460
- "onUpdate:modelValue": (t) => n.form[o.item.key] = t
465
+ modelValue: s.form[o.item.key],
466
+ "onUpdate:modelValue": (t) => s.form[o.item.key] = t
461
467
  }, { ref_for: !0 }, o.item.options?.input, F(o.item.options?.input?.on), {
462
- disabled: n.getDisabled(o.item)
468
+ disabled: s.getDisabled(o.item)
463
469
  }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.item.type === "switch" ? (p(), g(u(H), D({
464
470
  key: 1,
465
- modelValue: n.form[o.item.key],
466
- "onUpdate:modelValue": (t) => n.form[o.item.key] = t
471
+ modelValue: s.form[o.item.key],
472
+ "onUpdate:modelValue": (t) => s.form[o.item.key] = t
467
473
  }, { ref_for: !0 }, o.item.options?.switch, F(o.item.options?.switch?.on || {}), {
468
- disabled: n.getDisabled(o.item)
474
+ disabled: s.getDisabled(o.item)
469
475
  }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.item.type === "select" ? (p(), g(u(N), D({
470
476
  key: 2,
471
- modelValue: n.form[o.item.key],
472
- "onUpdate:modelValue": (t) => n.form[o.item.key] = t
477
+ modelValue: s.form[o.item.key],
478
+ "onUpdate:modelValue": (t) => s.form[o.item.key] = t
473
479
  }, { ref_for: !0 }, o.item.options?.select, F(o.item.options?.select?.on || {}), {
474
- disabled: n.getDisabled(o.item),
480
+ disabled: s.getDisabled(o.item),
475
481
  style: { width: "100%" }
476
482
  }), {
477
483
  default: h(() => [
@@ -484,34 +490,34 @@ const me = {
484
490
  _: 2
485
491
  }, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.item.type === "list" ? (p(), g(Q, D({
486
492
  key: 3,
487
- row: n.form,
493
+ row: s.form,
488
494
  field: o.item.key
489
495
  }, { ref_for: !0 }, o.item.options?.list, F(o.item.options?.list?.on || {}), {
490
- disabled: n.getDisabled(o.item),
496
+ disabled: s.getDisabled(o.item),
491
497
  style: { width: "100%" }
492
498
  }), null, 16, ["row", "field", "disabled"])) : o.item.type === "tree-select" ? (p(), g(u(oe), D({
493
499
  key: 4,
494
- modelValue: n.form[o.item.key],
495
- "onUpdate:modelValue": (t) => n.form[o.item.key] = t
500
+ modelValue: s.form[o.item.key],
501
+ "onUpdate:modelValue": (t) => s.form[o.item.key] = t
496
502
  }, { ref_for: !0 }, o.item.options?.treeSelect, F(o.item.options?.treeSelect?.on || {}), {
497
- disabled: n.getDisabled(o.item),
503
+ disabled: s.getDisabled(o.item),
498
504
  style: { width: "100%" }
499
505
  }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : o.item.type === "datetime" ? (p(), g(u(le), D({
500
506
  key: 5,
501
- modelValue: n.form[o.item.key],
502
- "onUpdate:modelValue": (t) => n.form[o.item.key] = t
507
+ modelValue: s.form[o.item.key],
508
+ "onUpdate:modelValue": (t) => s.form[o.item.key] = t
503
509
  }, { ref_for: !0 }, o.item.options?.datetime, F(o.item.options?.datetime?.on || {}), {
504
- disabled: n.getDisabled(o.item)
510
+ disabled: s.getDisabled(o.item)
505
511
  }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : u(j).customComponent[o.item.type] ? (p(), g(te(u(j).customComponent[o.item.type]), D({
506
512
  key: 6,
507
- modelValue: n.form[o.item.key],
508
- "onUpdate:modelValue": (t) => n.form[o.item.key] = t
513
+ modelValue: s.form[o.item.key],
514
+ "onUpdate:modelValue": (t) => s.form[o.item.key] = t
509
515
  }, { ref_for: !0 }, o.item.options?.[o.item.type], F(o.item.options?.[o.item.type]?.on || {}), {
510
- disabled: n.getDisabled(o.item)
516
+ disabled: s.getDisabled(o.item)
511
517
  }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0)
512
518
  ]),
513
519
  k(e.$slots, "form-" + o.item.key + "-end", {
514
- row: n.form,
520
+ row: s.form,
515
521
  item: o.item
516
522
  })
517
523
  ]),
@@ -520,7 +526,7 @@ const me = {
520
526
  ], 2)) : C("", !0)
521
527
  ], 64))), 256)),
522
528
  k(e.$slots, "form-end", {
523
- row: n.form
529
+ row: s.form
524
530
  })
525
531
  ]))), 256)) : C("", !0)
526
532
  ]),
@@ -528,46 +534,46 @@ const me = {
528
534
  }, 8, ["model", "rules"]));
529
535
  }
530
536
  });
531
- class ge {
537
+ class we {
532
538
  /**
533
539
  * 导出Excel
534
540
  * @param data 数据
535
541
  * @param columns 列
536
542
  * @param fileName 文件名
537
543
  */
538
- static exportToExcel = async (d, i, r) => {
539
- const c = await O.loadModule("xlsx"), m = d.map((s) => {
544
+ static exportToExcel = async (d, r, i) => {
545
+ const c = await O.loadModule("xlsx"), m = d.map((n) => {
540
546
  const l = {};
541
- return i.forEach((o) => {
542
- l[o.label] = s[o.key];
547
+ return r.forEach((o) => {
548
+ l[o.label] = n[o.key];
543
549
  }), l;
544
- }), n = c.utils.json_to_sheet(m), e = c.utils.book_new();
545
- c.utils.book_append_sheet(e, n, "Sheet1"), r ? typeof r == "function" && (r = r()) : r = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, c.writeFile(e, `${r}.xlsx`);
550
+ }), s = c.utils.json_to_sheet(m), e = c.utils.book_new();
551
+ c.utils.book_append_sheet(e, s, "Sheet1"), i ? typeof i == "function" && (i = i()) : i = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, c.writeFile(e, `${i}.xlsx`);
546
552
  };
547
553
  }
548
- const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
554
+ const ke = { class: "dialog-footer" }, ve = /* @__PURE__ */ P({
549
555
  __name: "switchConfirm",
550
556
  setup(f, { expose: d }) {
551
- const i = z(!1), r = z("确认修改"), c = z("确认要修改状态吗?");
552
- let m = null, n = null;
553
- const e = (o) => (o?.title && (r.value = o.title), o?.content && (c.value = o.content), i.value = !0, new Promise((t, a) => {
554
- m = t, n = a;
555
- })), s = () => {
556
- i.value = !1, m?.(!0), m = null, n = null;
557
+ const r = T(!1), i = T("确认修改"), c = T("确认要修改状态吗?");
558
+ let m = null, s = null;
559
+ const e = (o) => (o?.title && (i.value = o.title), o?.content && (c.value = o.content), r.value = !0, new Promise((t, a) => {
560
+ m = t, s = a;
561
+ })), n = () => {
562
+ r.value = !1, m?.(!0), m = null, s = null;
557
563
  }, l = () => {
558
- i.value = !1, n?.(new Error("用户取消操作")), m = null, n = null;
564
+ r.value = !1, s?.(new Error("用户取消操作")), m = null, s = null;
559
565
  };
560
566
  return d({
561
567
  open: e
562
568
  }), (o, t) => (p(), g(u(G), {
563
- modelValue: i.value,
564
- "onUpdate:modelValue": t[0] || (t[0] = (a) => i.value = a),
565
- title: r.value,
569
+ modelValue: r.value,
570
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => r.value = a),
571
+ title: i.value,
566
572
  "close-on-click-modal": !1,
567
573
  width: "400px"
568
574
  }, {
569
575
  footer: h(() => [
570
- U("span", we, [
576
+ U("span", ke, [
571
577
  v(u(S), { onClick: l }, {
572
578
  default: h(() => [...t[1] || (t[1] = [
573
579
  V("取消", -1)
@@ -576,7 +582,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
576
582
  }),
577
583
  v(u(S), {
578
584
  type: "primary",
579
- onClick: s
585
+ onClick: n
580
586
  }, {
581
587
  default: h(() => [...t[2] || (t[2] = [
582
588
  V("确认", -1)
@@ -591,22 +597,22 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
591
597
  _: 1
592
598
  }, 8, ["modelValue", "title"]));
593
599
  }
594
- }), ve = { class: "col relative cc1-form-box" }, Ce = {
600
+ }), Ce = { class: "col relative cc1-form-box" }, Ve = {
595
601
  class: "absolute row fit",
596
602
  style: { overflow: "hidden" }
597
- }, Ve = { class: "col column" }, De = {
603
+ }, De = { class: "col column" }, Ee = {
598
604
  key: 0,
599
605
  class: "relative curd-search"
600
- }, Ee = { class: "mb-20 flex justify-between items-center" }, Ue = {
606
+ }, Ue = { class: "mb-20 flex justify-between items-center" }, xe = {
601
607
  class: "flex items-center",
602
608
  style: { gap: "10px" }
603
- }, xe = { key: 0 }, $e = { key: 1 }, Oe = { key: 2 }, Se = { class: "export-btn" }, Fe = {
609
+ }, $e = { key: 0 }, Oe = { key: 1 }, Se = { key: 2 }, Fe = { class: "export-btn" }, Ie = {
604
610
  class: "flex items-center",
605
611
  style: { gap: "10px" }
606
- }, Ie = { class: "col fit-width relative" }, Le = { class: "absolute column fit" }, je = { class: "row justify-end mt-20 mb-20" }, ze = { class: "row curd-row" }, Te = {
612
+ }, Le = { class: "col fit-width relative" }, je = { class: "absolute column fit" }, Te = { class: "row justify-end mt-20 mb-20" }, ze = { class: "row curd-row" }, Re = {
607
613
  class: "row form-item-content",
608
614
  style: { width: "100%" }
609
- }, Re = { class: "col" }, Me = { class: "dialog-footer" }, _e = { class: "dialog-footer" }, Ne = /* @__PURE__ */ P({
615
+ }, Me = { class: "col" }, _e = { class: "dialog-footer" }, Ne = { class: "dialog-footer" }, Pe = /* @__PURE__ */ P({
610
616
  __name: "index",
611
617
  props: {
612
618
  /**
@@ -617,7 +623,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
617
623
  }
618
624
  },
619
625
  setup(f, { expose: d }) {
620
- const i = O.EDialog, r = f, c = z(), m = z(), n = O.isFun, e = q({
626
+ const r = O.EDialog, i = f, c = T(), m = T(), s = O.isFun, e = q({
621
627
  search: {
622
628
  column: {
623
629
  list: []
@@ -625,29 +631,29 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
625
631
  form: {},
626
632
  formDefault: {},
627
633
  getFormData: () => {
628
- let s = {};
629
- r.option.column.forEach((o) => {
630
- (typeof o.show?.search == "function" ? o.show?.search(e.search.form) : o.show?.search) && (s[o.key] = e.search.form[o.key]);
634
+ let n = {};
635
+ i.option.column.forEach((o) => {
636
+ (typeof o.show?.search == "function" ? o.show?.search(e.search.form) : o.show?.search) && (n[o.key] = e.search.form[o.key]);
631
637
  });
632
- const l = r.option.search?.before?.(s);
633
- return l && (s = l), s;
638
+ const l = i.option.search?.before?.(n);
639
+ return l && (n = l), n;
634
640
  },
635
641
  reset: () => {
636
- const s = e.search.formDefault;
637
- Object.keys(s).forEach((l) => {
638
- r.option.search?.resetMode === "default" ? s[l] = e.search.formDefault[l] : s[l] = void 0;
639
- }), e.search.form = JSONUtil.cp(s), e.page.num = 1, e.table.getList();
642
+ const n = e.search.formDefault;
643
+ Object.keys(n).forEach((l) => {
644
+ i.option.search?.resetMode === "default" ? n[l] = e.search.formDefault[l] : n[l] = void 0;
645
+ }), e.search.form = JSONUtil.cp(n), e.page.num = 1, e.table.getList();
640
646
  },
641
647
  submit: () => {
642
648
  e.page.num = 1, e.table.getList();
643
649
  }
644
650
  },
645
651
  page: {
646
- size: r.option.page?.size || 10,
647
- sizeList: r.option.page?.sizeList || [10, 20, 50, 100],
652
+ size: i.option.page?.size || 10,
653
+ sizeList: i.option.page?.sizeList || [10, 20, 50, 100],
648
654
  num: 1,
649
655
  total: 0,
650
- layout: r.option.page?.layout || "total, sizes, prev, pager, next, jumper"
656
+ layout: i.option.page?.layout || "total, sizes, prev, pager, next, jumper"
651
657
  },
652
658
  table: {
653
659
  loading: !1,
@@ -655,19 +661,19 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
655
661
  expand: {
656
662
  isExpand: !1,
657
663
  rowKeys: [],
658
- change: (s, l) => {
664
+ change: (n, l) => {
659
665
  },
660
666
  all: () => {
661
667
  if (e.table.expand.isExpand)
662
668
  e.table.expand.rowKeys = [];
663
669
  else {
664
- const s = (l) => {
670
+ const n = (l) => {
665
671
  let o = [];
666
672
  return l.forEach((t) => {
667
- o.push(t._id), t.children && t.children.length > 0 && (o = o.concat(s(t.children)));
673
+ o.push(t._id), t.children && t.children.length > 0 && (o = o.concat(n(t.children)));
668
674
  }), o;
669
675
  };
670
- e.table.expand.rowKeys = s(e.table.data);
676
+ e.table.expand.rowKeys = n(e.table.data);
671
677
  }
672
678
  e.table.expand.isExpand = !e.table.expand.isExpand;
673
679
  }
@@ -693,7 +699,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
693
699
  },
694
700
  getList: async () => {
695
701
  e.table.loading = !0;
696
- const s = r.option.api.list, l = await s({
702
+ const n = i.option.api.list, l = await n({
697
703
  size: e.page.size,
698
704
  num: e.page.num,
699
705
  ...e.search.getFormData(),
@@ -702,22 +708,22 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
702
708
  }
703
709
  }), o = l.data || { list: l };
704
710
  let t = Array.isArray(o.list) ? o.list : o;
705
- e.table.data = r.option.data ? await r.option.data(t) : t, e.page.total = o.total || 0;
711
+ e.table.data = i.option.data ? await i.option.data(t) : t, e.page.total = o.total || 0;
706
712
  },
707
713
  selection: {
708
714
  list: [],
709
- change: (s) => {
710
- e.table.selection.list = s;
715
+ change: (n) => {
716
+ e.table.selection.list = n;
711
717
  }
712
718
  },
713
719
  exportFun: {
714
- start: async (s) => {
715
- let l = await e.table.exportFun[s](), o = r.option.column;
720
+ start: async (n) => {
721
+ let l = await e.table.exportFun[n](), o = i.option.column;
716
722
  const t = JSONUtil.cp({
717
723
  data: l,
718
724
  columns: o
719
- }), a = r.option.tools?.export || {};
720
- a.before && a.before(t), ge.exportToExcel(t.data, t.columns, a.fileName);
725
+ }), a = i.option.tools?.export || {};
726
+ a.before && a.before(t), we.exportToExcel(t.data, t.columns, a.fileName);
721
727
  },
722
728
  select: () => {
723
729
  if (e.table.selection.list.length === 0)
@@ -731,7 +737,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
731
737
  },
732
738
  all: async () => {
733
739
  e.table.loading = !0;
734
- const s = r.option.api.list, { data: l } = await s({
740
+ const n = i.option.api.list, { data: l } = await n({
735
741
  size: 999999,
736
742
  num: 1,
737
743
  final(o, t, a) {
@@ -741,8 +747,8 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
741
747
  return l.list;
742
748
  }
743
749
  },
744
- export: (s) => {
745
- e.table.exportFun.start(s);
750
+ export: (n) => {
751
+ e.table.exportFun.start(n);
746
752
  }
747
753
  },
748
754
  update: {
@@ -751,11 +757,11 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
751
757
  show: !1,
752
758
  showContent: !1,
753
759
  loading: !1,
754
- type: i.Insert,
760
+ type: r.Insert,
755
761
  form: {},
756
762
  formDefault: {},
757
763
  formColumn: [],
758
- getDisabled: (s) => s.disabled?.[e.update.type === i.Insert ? "create" : "update"],
764
+ getDisabled: (n) => n.disabled?.[e.update.type === r.Insert ? "create" : "update"],
759
765
  edit: {
760
766
  /**
761
767
  * 编辑原数据
@@ -764,22 +770,22 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
764
770
  /**
765
771
  * 将form填入数据和data比对差异数据返回
766
772
  */
767
- getApiData: (s) => {
768
- if (r.option.form?.editAll)
769
- return s;
773
+ getApiData: (n) => {
774
+ if (i.option.form?.editAll)
775
+ return n;
770
776
  let l = {
771
777
  _id: e.update.edit.data._id
772
778
  };
773
779
  return Object.keys(e.update.edit.data).forEach((o) => {
774
- s[o] !== e.update.edit.data[o] && (l[o] = s[o]);
780
+ n[o] !== e.update.edit.data[o] && (l[o] = n[o]);
775
781
  }), l;
776
782
  }
777
783
  },
778
- open: (s, l) => {
784
+ open: (n, l) => {
779
785
  e.update.showContent || FunUtil.throttle(async () => {
780
- e.update.type = s;
781
- const o = s === i.Insert;
782
- e.update.edit.data = l, e.update.title = o ? "新增" : "编辑", e.update.form = JSONUtil.cp(o ? e.update.formDefault : l), await r.option.form?.openBefore?.(l, e.update), e.update.show = !0, e.update.showContent = !0, r.option.form?.openAfter?.(l, e.update);
786
+ e.update.type = n;
787
+ const o = n === r.Insert;
788
+ e.update.edit.data = l, e.update.title = o ? "新增" : "编辑", e.update.form = JSONUtil.cp(o ? e.update.formDefault : l), await i.option.form?.openBefore?.(l, e.update), e.update.show = !0, e.update.showContent = !0, i.option.form?.openAfter?.(l, e.update);
783
789
  });
784
790
  },
785
791
  submit: () => {
@@ -787,19 +793,19 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
787
793
  await m.value?.validate(async (o, t) => new Promise((a, b) => {
788
794
  o || (O.fail("请检查表单数据"), b(!1)), a();
789
795
  })), e.update.loading = !0;
790
- const s = e.update.type === i.Insert ? r.option.api.create : r.option.api.update;
796
+ const n = e.update.type === r.Insert ? i.option.api.create : i.option.api.update;
791
797
  let l = JSONUtil.cp(e.update.form);
792
- delete l.children, await r.option.form?.submitBefore?.(l, e.update), Object.keys(l).forEach((o) => {
798
+ delete l.children, await i.option.form?.submitBefore?.(l, e.update), Object.keys(l).forEach((o) => {
793
799
  if (typeof l[o] == "string" && l[o].indexOf("T") > -1) {
794
800
  const t = new Date(l[o]).getTime();
795
801
  !isNaN(t) && t > (/* @__PURE__ */ new Date("1971-01-01")).getTime() && (l[o] = t);
796
802
  }
797
- }), await s({
803
+ }), await n({
798
804
  ...l,
799
805
  final(o, t, a) {
800
806
  e.update.loading = !1;
801
807
  }
802
- }), e.update.close(), await e.table.getList(), r.option.form?.submitAfter?.(l, e.update);
808
+ }), e.update.close(), await e.table.getList(), i.option.form?.submitAfter?.(l, e.update);
803
809
  });
804
810
  },
805
811
  close: () => {
@@ -816,18 +822,18 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
816
822
  close: () => {
817
823
  e.remove.show = !1;
818
824
  },
819
- open: (s) => {
820
- if (s.length === 0) {
825
+ open: (n) => {
826
+ if (n.length === 0) {
821
827
  O.fail("请选择要删除的数据");
822
828
  return;
823
829
  }
824
- e.remove.items = s, e.remove.show = !0;
830
+ e.remove.items = n, e.remove.show = !0;
825
831
  },
826
832
  submit: () => {
827
833
  FunUtil.throttle(async () => {
828
834
  e.table.loading = !0;
829
- const s = r.option.api.delete;
830
- await s({
835
+ const n = i.option.api.delete;
836
+ await n({
831
837
  _id: e.remove.items.map((l) => l._id),
832
838
  final(l, o, t) {
833
839
  e.table.loading = !1;
@@ -858,7 +864,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
858
864
  emptyText: "暂无数据",
859
865
  highlightCurrentRow: !0
860
866
  }
861
- }, o = r.option;
867
+ }, o = i.option;
862
868
  Object.keys(l).forEach((t) => {
863
869
  o[t] = ObjectUtil.deepMerge(l[t], o[t] || {});
864
870
  });
@@ -869,7 +875,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
869
875
  * @returns
870
876
  */
871
877
  initColumnOptions: () => {
872
- const s = r.option, l = (o) => {
878
+ const n = i.option, l = (o) => {
873
879
  const a = {
874
880
  options: {
875
881
  switch: {
@@ -883,10 +889,10 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
883
889
  return await c.value?.open({
884
890
  title: "确认修改",
885
891
  content: `确认要${y[x] === E.activeValue ? E.inactiveLabel : E.activeLabel}吗?`
886
- }), e.table.loading = !0, await r.option.api.update({
892
+ }), e.table.loading = !0, await i.option.api.update({
887
893
  _id: y._id,
888
894
  [x]: y[x] === E.activeValue ? E.inactiveValue : E.activeValue,
889
- final(T, R, Y) {
895
+ final(z, R, Y) {
890
896
  e.table.loading = !1;
891
897
  }
892
898
  }), O.success("操作成功"), e.table.getList(), !0;
@@ -929,33 +935,33 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
929
935
  b[x] = ObjectUtil.deepMerge(a[x], b[x] || {});
930
936
  });
931
937
  };
932
- s.column.forEach(l), s.table?.column?.forEach(l);
938
+ n.column.forEach(l), n.table?.column?.forEach(l);
933
939
  },
934
940
  initColumnForm: () => {
935
- const s = r.option;
941
+ const n = i.option;
936
942
  e.update.formColumn = [], e.table.column.show = {
937
943
  list: [],
938
944
  listSource: []
939
945
  };
940
- const l = [], o = r.option.form?.maxSpan || 12, t = r.option.form?.defaultSpan || o / 2;
946
+ const l = [], o = i.option.form?.maxSpan || 12, t = i.option.form?.defaultSpan || o / 2;
941
947
  let a = [];
942
948
  const b = (y) => {
943
949
  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) {
944
950
  y.form = y.form || { span: t }, y.form.span = y.form.span ?? t;
945
- let E = y.form.span, T = a.reduce((Y, ae) => Y + ae.span, E);
951
+ let E = y.form.span, z = a.reduce((Y, ae) => Y + ae.span, E);
946
952
  const R = a.length;
947
- a.push({ item: y, span: E }), (R === 1 && a[0].span === 0 || T >= o || E === 0 && R > 1) && (l.push(a), a = []), y.rules && (e.update.rules[y.key] = y.rules);
953
+ a.push({ item: y, span: E }), (R === 1 && a[0].span === 0 || z >= o || E === 0 && R > 1) && (l.push(a), a = []), y.rules && (e.update.rules[y.key] = y.rules);
948
954
  }
949
955
  };
950
- s.column.forEach((y) => {
956
+ n.column.forEach((y) => {
951
957
  y.isForm = !0, b(y);
952
- }), r.option.table?.column?.forEach((y) => {
958
+ }), i.option.table?.column?.forEach((y) => {
953
959
  y.isForm = !1, b(y);
954
- }), e.search.column.list = s.column.concat(s.table?.column || []), e.table.column.list = e.search.column.list.filter((y) => y.table?.table), e.search.column.list.sort((y, E) => y.sort?.search - E.sort?.search), e.table.column.list.sort((y, E) => y.sort?.table - E.sort?.table), a.length > 0 && l.push(a), e.update.formColumn = l;
955
- const x = r.option.search?.formDefault;
960
+ }), 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;
961
+ const x = i.option.search?.formDefault;
956
962
  x && Object.keys(x).forEach((y) => {
957
963
  e.search.formDefault[y] = x[y];
958
- }), s.column.forEach((y) => {
964
+ }), n.column.forEach((y) => {
959
965
  y.show?.search || (e.search.formDefault[y.key] = void 0);
960
966
  }), e.search.form = JSONUtil.cp(e.search.formDefault);
961
967
  }
@@ -964,19 +970,19 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
964
970
  e.table.getList();
965
971
  }), d({
966
972
  conf: e
967
- }), (s, l) => {
968
- const o = ne("loading");
969
- return p(), w("div", ve, [
970
- U("div", Ce, [
971
- k(s.$slots, "box-left"),
972
- U("div", Ve, [
973
- f.option.search?.show !== !1 ? (p(), w("div", De, [
973
+ }), (n, l) => {
974
+ const o = ie("loading");
975
+ return p(), w("div", Ce, [
976
+ U("div", Ve, [
977
+ k(n.$slots, "box-left"),
978
+ U("div", De, [
979
+ f.option.search?.show !== !1 ? (p(), w("div", Ee, [
974
980
  v(u(J), {
975
981
  model: e.search.form,
976
982
  inline: ""
977
983
  }, {
978
984
  default: h(() => [
979
- k(s.$slots, "search-start", {
985
+ k(n.$slots, "search-start", {
980
986
  row: e.search.form
981
987
  }),
982
988
  (p(!0), w($, null, I(e.search.column.list, (t) => (p(), w($, {
@@ -987,7 +993,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
987
993
  label: t.label
988
994
  }, {
989
995
  default: h(() => [
990
- k(s.$slots, "search-" + t.key, {
996
+ k(n.$slots, "search-" + t.key, {
991
997
  row: e.search.form
992
998
  }, () => [
993
999
  t.type === "input" ? (p(), g(u(K), {
@@ -1040,7 +1046,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
1040
1046
  _: 2
1041
1047
  }, 1032, ["label"])) : C("", !0)
1042
1048
  ], 64))), 128)),
1043
- k(s.$slots, "search-center", {
1049
+ k(n.$slots, "search-center", {
1044
1050
  row: e.search.form
1045
1051
  }),
1046
1052
  v(u(_), null, {
@@ -1067,19 +1073,19 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
1067
1073
  ]),
1068
1074
  _: 1
1069
1075
  }),
1070
- k(s.$slots, "search-end", {
1076
+ k(n.$slots, "search-end", {
1071
1077
  row: e.search.form
1072
1078
  })
1073
1079
  ]),
1074
1080
  _: 3
1075
1081
  }, 8, ["model"])
1076
1082
  ])) : C("", !0),
1077
- U("div", Ee, [
1078
- U("div", Ue, [
1079
- u(n)(f.option.tools?.add) ? (p(), w("div", xe, [
1083
+ U("div", Ue, [
1084
+ U("div", xe, [
1085
+ u(s)(f.option.tools?.add) ? (p(), w("div", $e, [
1080
1086
  v(u(S), {
1081
1087
  type: "primary",
1082
- onClick: l[0] || (l[0] = (t) => e.update.open(u(i).Insert))
1088
+ onClick: l[0] || (l[0] = (t) => e.update.open(u(r).Insert))
1083
1089
  }, {
1084
1090
  default: h(() => [...l[9] || (l[9] = [
1085
1091
  V("新增", -1)
@@ -1087,7 +1093,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
1087
1093
  _: 1
1088
1094
  })
1089
1095
  ])) : C("", !0),
1090
- f.option.table?.selectable && u(n)(f.option.tools?.delete) ? (p(), w("div", $e, [
1096
+ f.option.table?.selectable && u(s)(f.option.tools?.delete) ? (p(), w("div", Oe, [
1091
1097
  v(u(S), {
1092
1098
  type: "danger",
1093
1099
  onClick: l[1] || (l[1] = (t) => e.remove.open(e.table.selection.list))
@@ -1098,7 +1104,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
1098
1104
  _: 1
1099
1105
  })
1100
1106
  ])) : C("", !0),
1101
- f.option.tools?.expand ? (p(), w("div", Oe, [
1107
+ f.option.tools?.expand ? (p(), w("div", Se, [
1102
1108
  v(u(S), {
1103
1109
  type: "warning",
1104
1110
  onClick: l[2] || (l[2] = (t) => e.table.expand.all())
@@ -1109,12 +1115,12 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
1109
1115
  _: 1
1110
1116
  })
1111
1117
  ])) : C("", !0),
1112
- f.option.tools?.export?.show ? (p(), g(u(ue), {
1118
+ f.option.tools?.export?.show ? (p(), g(u(pe), {
1113
1119
  key: 3,
1114
1120
  onCommand: e.table.export
1115
1121
  }, {
1116
1122
  dropdown: h(() => [
1117
- v(u(pe), null, {
1123
+ v(u(fe), null, {
1118
1124
  default: h(() => [
1119
1125
  v(u(B), { command: "select" }, {
1120
1126
  default: h(() => [...l[13] || (l[13] = [
@@ -1139,7 +1145,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
1139
1145
  })
1140
1146
  ]),
1141
1147
  default: h(() => [
1142
- U("div", Se, [
1148
+ U("div", Fe, [
1143
1149
  v(u(S), { type: "warning" }, {
1144
1150
  default: h(() => [...l[12] || (l[12] = [
1145
1151
  V("导出", -1)
@@ -1150,15 +1156,15 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
1150
1156
  ]),
1151
1157
  _: 1
1152
1158
  }, 8, ["onCommand"])) : C("", !0),
1153
- k(s.$slots, "tools-left")
1159
+ k(n.$slots, "tools-left")
1154
1160
  ]),
1155
- U("div", Fe, [
1156
- k(s.$slots, "tools-right")
1161
+ U("div", Ie, [
1162
+ k(n.$slots, "tools-right")
1157
1163
  ])
1158
1164
  ]),
1159
- U("div", Ie, [
1160
- U("div", Le, [
1161
- re((p(), g(u(fe), D({
1165
+ U("div", Le, [
1166
+ U("div", je, [
1167
+ re((p(), g(u(ce), D({
1162
1168
  data: e.table.data
1163
1169
  }, f.option.table, {
1164
1170
  onSelectionChange: e.table.selection.change,
@@ -1166,7 +1172,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
1166
1172
  onExpandChange: e.table.expand.change
1167
1173
  }), {
1168
1174
  default: h(() => [
1169
- f.option.table?.selectable && u(n)(f.option.tools?.delete) ? (p(), g(u(W), {
1175
+ f.option.table?.selectable && u(s)(f.option.tools?.delete) ? (p(), g(u(W), {
1170
1176
  key: 0,
1171
1177
  type: "selection",
1172
1178
  selectable: typeof f.option.table?.selectable == "function" ? f.option.table?.selectable : void 0,
@@ -1181,7 +1187,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
1181
1187
  label: t.label
1182
1188
  }, { ref_for: !0 }, t.table), {
1183
1189
  default: h(({ row: a }) => [
1184
- k(s.$slots, "table-" + t.key, {
1190
+ k(n.$slots, "table-" + t.key, {
1185
1191
  row: a,
1186
1192
  item: t
1187
1193
  }, () => [
@@ -1198,7 +1204,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
1198
1204
  _: 2
1199
1205
  }, 1040, ["prop", "label"])) : C("", !0)
1200
1206
  ], 64))), 128)),
1201
- u(n)(f.option.tools?.add) || u(n)(f.option.tools?.update) || u(n)(f.option.tools?.delete) || s.$slots["table-op-left"] || s.$slots["table-op-right"] ? (p(), g(u(W), {
1207
+ u(s)(f.option.tools?.add) || u(s)(f.option.tools?.update) || u(s)(f.option.tools?.delete) || n.$slots["table-op-left"] || n.$slots["table-op-right"] ? (p(), g(u(W), {
1202
1208
  key: 1,
1203
1209
  label: "操作",
1204
1210
  width: "180",
@@ -1206,30 +1212,30 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
1206
1212
  fixed: "right"
1207
1213
  }, {
1208
1214
  default: h(({ row: t }) => [
1209
- k(s.$slots, "table-op-left", { row: t }),
1210
- u(n)(f.option.tools?.add, t) ? (p(), g(u(S), {
1215
+ k(n.$slots, "table-op-left", { row: t }),
1216
+ u(s)(f.option.tools?.add, t) ? (p(), g(u(S), {
1211
1217
  key: 0,
1212
1218
  link: "",
1213
1219
  type: "primary",
1214
- onClick: (a) => e.update.open(u(i).Insert, t)
1220
+ onClick: (a) => e.update.open(u(r).Insert, t)
1215
1221
  }, {
1216
1222
  default: h(() => [...l[16] || (l[16] = [
1217
1223
  V(" 新增 ", -1)
1218
1224
  ])]),
1219
1225
  _: 1
1220
1226
  }, 8, ["onClick"])) : C("", !0),
1221
- u(n)(f.option.tools?.update, t) ? (p(), g(u(S), {
1227
+ u(s)(f.option.tools?.update, t) ? (p(), g(u(S), {
1222
1228
  key: 1,
1223
1229
  link: "",
1224
1230
  type: "warning",
1225
- onClick: (a) => e.update.open(u(i).Update, t)
1231
+ onClick: (a) => e.update.open(u(r).Update, t)
1226
1232
  }, {
1227
1233
  default: h(() => [...l[17] || (l[17] = [
1228
1234
  V(" 编辑 ", -1)
1229
1235
  ])]),
1230
1236
  _: 1
1231
1237
  }, 8, ["onClick"])) : C("", !0),
1232
- u(n)(f.option.tools?.delete, t) ? (p(), g(u(S), {
1238
+ u(s)(f.option.tools?.delete, t) ? (p(), g(u(S), {
1233
1239
  key: 2,
1234
1240
  link: "",
1235
1241
  type: "danger",
@@ -1240,7 +1246,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
1240
1246
  ])]),
1241
1247
  _: 1
1242
1248
  }, 8, ["onClick"])) : C("", !0),
1243
- k(s.$slots, "table-op-right", { row: t })
1249
+ k(n.$slots, "table-op-right", { row: t })
1244
1250
  ]),
1245
1251
  _: 3
1246
1252
  })) : C("", !0)
@@ -1251,8 +1257,8 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
1251
1257
  ])
1252
1258
  ])
1253
1259
  ]),
1254
- U("div", je, [
1255
- e.page.total > e.page.size ? (p(), g(u(ce), {
1260
+ U("div", Te, [
1261
+ e.page.total > e.page.size ? (p(), g(u(me), {
1256
1262
  key: 0,
1257
1263
  "current-page": e.page.num,
1258
1264
  "onUpdate:currentPage": l[3] || (l[3] = (t) => e.page.num = t),
@@ -1268,7 +1274,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
1268
1274
  }, null, 8, ["current-page", "page-size", "page-sizes", "layout", "total", "onSizeChange", "onCurrentChange"])) : C("", !0)
1269
1275
  ])
1270
1276
  ]),
1271
- k(s.$slots, "box-right")
1277
+ k(n.$slots, "box-right")
1272
1278
  ]),
1273
1279
  v(u(G), D({
1274
1280
  modelValue: e.update.show,
@@ -1278,7 +1284,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
1278
1284
  "before-close": e.update.close
1279
1285
  }, f.option.dialog), {
1280
1286
  footer: h(() => [
1281
- U("span", Me, [
1287
+ U("span", _e, [
1282
1288
  v(u(S), {
1283
1289
  onClick: e.update.close
1284
1290
  }, {
@@ -1308,11 +1314,11 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
1308
1314
  }, {
1309
1315
  default: h(() => [
1310
1316
  e.update.showContent ? (p(!0), w($, { key: 0 }, I(e.update.formColumn, (t) => (p(), w("div", ze, [
1311
- k(s.$slots, "form-start", {
1317
+ k(n.$slots, "form-start", {
1312
1318
  row: e.update.form
1313
1319
  }),
1314
1320
  (p(!0), w($, null, I(t, (a) => (p(), w($, null, [
1315
- u(n)(a.item.show?.form, e.update.form) ? (p(), w("div", {
1321
+ u(s)(a.item.show?.form, e.update.form) ? (p(), w("div", {
1316
1322
  key: 0,
1317
1323
  class: X(a.item.form.span > 0 ? `col-${a.item.form.span}` : "col")
1318
1324
  }, [
@@ -1322,13 +1328,13 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
1322
1328
  "label-width": a.item.form?.labelWidth || "100px"
1323
1329
  }, {
1324
1330
  default: h(() => [
1325
- U("div", Te, [
1326
- k(s.$slots, "form-" + a.item.key + "-start", {
1331
+ U("div", Re, [
1332
+ k(n.$slots, "form-" + a.item.key + "-start", {
1327
1333
  row: e.update.form,
1328
1334
  item: a.item
1329
1335
  }),
1330
- U("div", Re, [
1331
- k(s.$slots, "form-" + a.item.key, {
1336
+ U("div", Me, [
1337
+ k(n.$slots, "form-" + a.item.key, {
1332
1338
  row: e.update.form,
1333
1339
  item: a.item
1334
1340
  }, () => [
@@ -1389,7 +1395,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
1389
1395
  }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0)
1390
1396
  ])
1391
1397
  ]),
1392
- k(s.$slots, "form-" + a.item.key + "-end", {
1398
+ k(n.$slots, "form-" + a.item.key + "-end", {
1393
1399
  row: e.update.form,
1394
1400
  item: a.item
1395
1401
  })
@@ -1399,7 +1405,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
1399
1405
  }, 1032, ["label", "prop", "label-width"])
1400
1406
  ], 2)) : C("", !0)
1401
1407
  ], 64))), 256)),
1402
- k(s.$slots, "form-end", {
1408
+ k(n.$slots, "form-end", {
1403
1409
  row: e.update.form
1404
1410
  })
1405
1411
  ]))), 256)) : C("", !0)
@@ -1416,7 +1422,7 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
1416
1422
  "close-on-click-modal": !1
1417
1423
  }, {
1418
1424
  footer: h(() => [
1419
- U("span", _e, [
1425
+ U("span", Ne, [
1420
1426
  v(u(S), {
1421
1427
  onClick: e.remove.close
1422
1428
  }, {
@@ -1442,27 +1448,27 @@ const we = { class: "dialog-footer" }, ke = /* @__PURE__ */ P({
1442
1448
  ]),
1443
1449
  _: 1
1444
1450
  }, 8, ["modelValue", "title"]),
1445
- v(ke, {
1451
+ v(ve, {
1446
1452
  ref_key: "switchConfirmRef",
1447
1453
  ref: c
1448
1454
  }, null, 512)
1449
1455
  ]);
1450
1456
  };
1451
1457
  }
1452
- }), We = (f, d) => {
1453
- if (f.component("TCurd", Ne), f.component("TFormList", Q), f.component("TColumn", ye), d?.customComponent) {
1458
+ }), Ae = (f, d) => {
1459
+ if (f.component("TCurd", Pe), f.component("TFormList", Q), f.component("TColumn", ge), d?.customComponent) {
1454
1460
  j.customComponent = d.customComponent;
1455
- for (const i in d.customComponent)
1456
- f.component(i, d.customComponent[i]);
1461
+ for (const r in d.customComponent)
1462
+ f.component(r, d.customComponent[r]);
1457
1463
  }
1458
1464
  };
1459
1465
  export {
1460
1466
  L as ArrUtil,
1461
- ge as ExcelUtil,
1462
- ye as TColumn,
1463
- Ne as TCurd,
1467
+ we as ExcelUtil,
1468
+ ge as TColumn,
1469
+ Pe as TCurd,
1464
1470
  j as TForm,
1465
1471
  Q as TFormList,
1466
1472
  O as TSys,
1467
- We as install
1473
+ Ae as install
1468
1474
  };