@xmszm/core 0.0.2 → 0.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.
Files changed (71) hide show
  1. package/README.md +10 -1
  2. package/dist/index.cjs +2 -2
  3. package/dist/index.mjs +1296 -1285
  4. package/dist/plugin/vite/initRouteMeta.cjs +1 -0
  5. package/dist/plugin/vite/initRouteMeta.mjs +13 -0
  6. package/dist/style.css +1 -1
  7. package/docs/.vitepress/config.mjs +10 -1
  8. package/docs/components/config-options.md +125 -0
  9. package/docs/components/dataform.md +175 -22
  10. package/docs/components/datatable.md +21 -39
  11. package/docs/components/dialog.md +155 -16
  12. package/docs/components/options.md +43 -14
  13. package/docs/components/query.md +20 -12
  14. package/docs/components/utils.md +118 -10
  15. package/docs/guide/changelog.md +81 -0
  16. package/docs/guide/config.md +241 -4
  17. package/docs/guide/quickstart.md +27 -2
  18. package/docs/index.md +1 -1
  19. package/docs/usage.md +16 -3
  20. package/examples/README.md +46 -0
  21. package/examples/index.html +14 -0
  22. package/examples/package.json +25 -0
  23. package/examples/pnpm-lock.yaml +1568 -0
  24. package/examples/pnpm-workspace.yaml +2 -0
  25. package/examples/src/AdminSystem.vue +870 -0
  26. package/examples/src/App.vue +330 -0
  27. package/examples/src/Introduction.vue +307 -0
  28. package/examples/src/main.js +22 -0
  29. package/examples/src/utils/permission.js +16 -0
  30. package/examples/src/utils/request.js +10 -0
  31. package/examples/vite.config.js +41 -0
  32. package/package.json +10 -4
  33. package/src/dialog/commonDialog.tsx +286 -0
  34. package/src/dialog/utils/{dialog.js → dialog.ts} +2 -0
  35. package/src/enum/sort.tsx +45 -0
  36. package/src/form/DataForm.vue +26 -52
  37. package/src/{index.js → index.ts} +7 -6
  38. package/src/list/{useList.jsx → useList.tsx} +49 -14
  39. package/src/options/{Options.jsx → Options.tsx} +37 -36
  40. package/src/options/defaultOptions.tsx +656 -0
  41. package/src/query/CommonQuery.vue +57 -89
  42. package/src/table/DataTable.vue +60 -94
  43. package/src/table/opr/{DataColumnCollet.jsx → DataColumnCollet.tsx} +18 -8
  44. package/src/table/opr/{useDataColumn.jsx → useDataColumn.tsx} +43 -48
  45. package/src/table/opr/{useDataColumnButton.jsx → useDataColumnButton.tsx} +13 -6
  46. package/src/table/opr/{useDataColumnPop.jsx → useDataColumnPop.tsx} +13 -5
  47. package/src/utils/{array.js → array.ts} +4 -6
  48. package/src/utils/{config.js → config.ts} +16 -2
  49. package/src/utils/{dialog.js → dialog.ts} +2 -2
  50. package/src/utils/{object.js → object.ts} +1 -0
  51. package/src/utils/{upload.js → upload.ts} +3 -3
  52. package/types/components.d.ts +402 -0
  53. package/types/index.d.ts +145 -7
  54. package/types/plugin/vite/initRouteMeta.d.ts +23 -0
  55. package/types/src.d.ts +55 -0
  56. package/types/vue-shim.d.ts +9 -0
  57. package/examples/demo.vue +0 -224
  58. package/src/dialog/commonDialog.jsx +0 -262
  59. package/src/enum/sort.jsx +0 -31
  60. package/src/options/defaultOptions.jsx +0 -580
  61. /package/src/dialog/{useCommonDialog.js → useCommonDialog.ts} +0 -0
  62. /package/src/directives/{auto-register.js → auto-register.ts} +0 -0
  63. /package/src/directives/{permission.js → permission.ts} +0 -0
  64. /package/src/enum/{options.js → options.ts} +0 -0
  65. /package/src/plugin/{index.js → index.ts} +0 -0
  66. /package/src/plugin/vite/{initRouteMeta.js → initRouteMeta.ts} +0 -0
  67. /package/src/store/utils/{index.js → index.ts} +0 -0
  68. /package/src/table/opr/{useQRCode.js → useQRCode.ts} +0 -0
  69. /package/src/table/utils/{ellipsis.js → ellipsis.ts} +0 -0
  70. /package/src/utils/{auth.js → auth.ts} +0 -0
  71. /package/src/utils/{time.js → time.ts} +0 -0
package/dist/index.mjs CHANGED
@@ -1,32 +1,33 @@
1
- var Qe = Object.defineProperty;
2
- var Xe = (t, l, e) => l in t ? Qe(t, l, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[l] = e;
3
- var ce = (t, l, e) => Xe(t, typeof l != "symbol" ? l + "" : l, e);
4
- import { unref as g, useCssVars as Ze, ref as P, watchEffect as Ae, resolveComponent as Y, createElementBlock as le, openBlock as T, createVNode as s, createElementVNode as we, withCtx as R, Fragment as ae, renderList as me, createBlock as H, createTextVNode as v, toDisplayString as he, getCurrentInstance as oe, computed as _, watch as ee, onMounted as Be, renderSlot as ge, isProxy as ve, normalizeStyle as Te, mergeProps as I, isVNode as te, defineComponent as re, withDirectives as et, resolveDirective as tt, isRef as lt, mergeModels as pe, useModel as Ye, reactive as nt, onUnmounted as at, createCommentVNode as rt, resolveDynamicComponent as ut } from "vue";
5
- import { useThemeVars as it, NTooltip as ot, NButton as Q, NCheckboxGroup as st, NSpace as z, NCheckbox as ft, NSwitch as ct, NDivider as dt, NProgress as yt, NUpload as mt, NUploadDragger as ht, NIcon as _e, NText as gt, NInputNumber as pt, NInput as Se, NRadioGroup as bt, NRadio as wt, NDatePicker as Ie, NTimePicker as xt, NSelect as Ot, NEllipsis as Ct, NFormItem as Nt, NForm as Dt, useDialog as xe, createDiscreteApi as At, NPopconfirm as St, NPopover as It, NSpin as Ft, NImage as Mt } from "naive-ui";
6
- import { Funnel as Ut, RefreshOutline as $t, SearchOutline as Pt, Code as qt, ChevronDown as Et, ChevronUp as Bt } from "@vicons/ionicons5";
7
- import { useRoute as Re, useRouter as Tt } from "vue-router";
1
+ var lt = Object.defineProperty;
2
+ var nt = (e, l, t) => l in e ? lt(e, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[l] = t;
3
+ var de = (e, l, t) => nt(e, typeof l != "symbol" ? l + "" : l, t);
4
+ import { unref as y, useCssVars as at, ref as P, watchEffect as Fe, resolveComponent as X, createElementBlock as ne, openBlock as B, createVNode as f, createElementVNode as _e, withCtx as v, Fragment as ue, renderList as he, createBlock as K, createTextVNode as Z, toDisplayString as pe, defineComponent as j, getCurrentInstance as re, computed as Y, watch as te, onMounted as ke, renderSlot as be, isProxy as ut, normalizeStyle as ve, mergeProps as I, isVNode as le, withDirectives as rt, resolveDirective as ot, isRef as it, mergeModels as xe, useModel as Le, reactive as st, onUnmounted as ft, createCommentVNode as ct, resolveDynamicComponent as dt, h as ye } from "vue";
5
+ import { useThemeVars as yt, NDataTable as gt, NTooltip as mt, NButton as z, NCheckboxGroup as ht, NSpace as V, NCheckbox as pt, NSwitch as bt, NDivider as xt, NProgress as wt, NUpload as _t, NUploadDragger as Ct, NIcon as Ve, NText as Ot, NInputNumber as At, NInput as Ue, NRadioGroup as Dt, NRadio as Nt, NDatePicker as Pe, NTimePicker as St, NSelect as It, NEllipsis as Mt, NFormItem as Ft, NForm as Ut, useDialog as Ce, createDiscreteApi as Pt, NPopconfirm as Rt, NPopover as qt, NSpin as Et, NImage as $t } from "naive-ui";
6
+ import { Funnel as Tt, ArchiveOutline as Bt, RefreshOutline as Yt, SearchOutline as kt, Code as vt, ChevronDown as Lt, ChevronUp as Vt } from "@vicons/ionicons5";
7
+ import { useRoute as ze, useRouter as zt } from "vue-router";
8
8
  import L from "dayjs";
9
- import { uniqueId as Fe } from "lodash-es";
10
- const j = "name", k = "id";
11
- function ke(t, { labelField: l = j, valueField: e = k } = {}) {
12
- return Object.keys(t).reduce((r, a) => {
13
- const i = Yt(t[a], a), n = {
9
+ import { uniqueId as Re } from "lodash-es";
10
+ import { initRouteMeta as tn } from "./plugin/vite/initRouteMeta.mjs";
11
+ const $ = "name", T = "id";
12
+ function We(e, { labelField: l = $, valueField: t = T } = {}) {
13
+ return Object.keys(e).reduce((a, u) => {
14
+ const i = Wt(e[u], u), n = {
14
15
  ...i
15
16
  };
16
- return n[l] = i == null ? void 0 : i[l], n[e] = i == null ? void 0 : i[e], r.concat(n);
17
+ return n[l] = i == null ? void 0 : i[l], n[t] = i == null ? void 0 : i[t], a.concat(n);
17
18
  }, []);
18
19
  }
19
- function Yt(t, l) {
20
- const e = {
21
- [j]: g(t),
22
- [k]: Number.isNaN(Number(l)) ? l : Number(l)
20
+ function Wt(e, l) {
21
+ const t = {
22
+ [$]: y(e),
23
+ [T]: Number.isNaN(Number(l)) ? l : Number(l)
23
24
  };
24
- return typeof g(t) == "object" ? {
25
- ...g(t),
26
- [k]: Number.isNaN(Number(l)) ? l : Number(l)
27
- } : e;
25
+ return typeof y(e) == "object" ? {
26
+ ...y(e),
27
+ [T]: Number.isNaN(Number(l)) ? l : Number(l)
28
+ } : t;
28
29
  }
29
- const Me = {
30
+ const qe = {
30
31
  style: {
31
32
  cursor: "pointer"
32
33
  },
@@ -47,12 +48,12 @@ const Me = {
47
48
  backgroundColor: "--n-color"
48
49
  }
49
50
  }
50
- }, ue = (t, l) => {
51
- const e = t.__vccOpts || t;
52
- for (const [r, a] of l)
53
- e[r] = a;
54
- return e;
55
- }, _t = { class: "filter-box" }, Rt = { class: "filter-footer" }, kt = {
51
+ }, oe = (e, l) => {
52
+ const t = e.__vccOpts || e;
53
+ for (const [a, u] of l)
54
+ t[a] = u;
55
+ return t;
56
+ }, Ht = { class: "filter-box" }, Kt = { class: "filter-footer" }, jt = {
56
57
  __name: "FilterDialog",
57
58
  props: {
58
59
  type: {
@@ -78,71 +79,71 @@ const Me = {
78
79
  }
79
80
  },
80
81
  emits: ["submit"],
81
- setup(t, { emit: l }) {
82
- var h, p;
83
- Ze((A) => ({
84
- e0ecc754: g(a).infoColor
82
+ setup(e, { emit: l }) {
83
+ var w, p;
84
+ at((_) => ({
85
+ e0ecc754: y(u).infoColor
85
86
  }));
86
- const e = t, r = l, a = it(), i = P([]);
87
- Ae(() => {
88
- i.value = e.selectItem;
87
+ const t = e, a = l, u = yt(), i = P([]);
88
+ Fe(() => {
89
+ i.value = t.selectItem;
89
90
  });
90
- const n = P([]), f = [
91
+ const n = P([]), d = [
91
92
  {
92
93
  key: "all",
93
94
  label: "全选",
94
95
  onCheck: () => {
95
- var A;
96
- return i.value = (A = e.filterItem) == null ? void 0 : A.map((D) => D.key);
96
+ var _;
97
+ return i.value = (_ = t.filterItem) == null ? void 0 : _.map((h) => h.key);
97
98
  },
98
99
  unCheck: () => i.value = []
99
100
  },
100
101
  {
101
102
  key: "selectDefault",
102
103
  label: "选中默认",
103
- onCheck: () => i.value = e.defaultItem,
104
- unCheck: () => i.value = e.selectItem
104
+ onCheck: () => i.value = t.defaultItem,
105
+ unCheck: () => i.value = t.selectItem
105
106
  },
106
107
  {
107
108
  key: "currentSelect",
108
109
  label: "选中当前列表",
109
- onCheck: () => i.value = e.selectItem,
110
- unCheck: () => i.value = e.selectItem
110
+ onCheck: () => i.value = t.selectItem,
111
+ unCheck: () => i.value = t.selectItem
111
112
  }
112
113
  ];
113
- Ae(() => {
114
- n.value = f.filter(
115
- (A) => e.filterButtonKey.includes(A.key)
116
- ), console.log(e.filterButtonKey);
114
+ Fe(() => {
115
+ n.value = d.filter(
116
+ (_) => t.filterButtonKey.includes(_.key)
117
+ ), console.log(t.filterButtonKey);
117
118
  });
118
119
  function o() {
119
- r("submit", i.value);
120
+ a("submit", i.value);
120
121
  }
121
- const d = P(
122
- ((h = e.filterItem) == null ? void 0 : h.length) === ((p = e.selectItem) == null ? void 0 : p.length) ? ["all"] : []
122
+ const s = P(
123
+ ((w = t.filterItem) == null ? void 0 : w.length) === ((p = t.selectItem) == null ? void 0 : p.length) ? ["all"] : []
123
124
  );
124
- function m(A, D) {
125
- var M, S, u, w;
126
- console.log(A), console.log(D), D.actionType === "uncheck" ? ((S = (M = n.value) == null ? void 0 : M.find((c) => (c == null ? void 0 : c.key) === D.value)) == null || S.unCheck(), d.value = []) : ((w = (u = n.value) == null ? void 0 : u.find((c) => (c == null ? void 0 : c.key) === D.value)) == null || w.onCheck(), d.value = [D.value]);
125
+ function g(_, h) {
126
+ var M, N, r, A;
127
+ console.log(_), console.log(h), h.actionType === "uncheck" ? ((N = (M = n.value) == null ? void 0 : M.find((m) => (m == null ? void 0 : m.key) === h.value)) == null || N.unCheck(), s.value = []) : ((A = (r = n.value) == null ? void 0 : r.find((m) => (m == null ? void 0 : m.key) === h.value)) == null || A.onCheck(), s.value = [h.value]);
127
128
  }
128
- return (A, D) => {
129
- const M = Y("n-ellipsis"), S = Y("n-checkbox"), u = Y("n-checkbox-group"), w = Y("n-button");
130
- return T(), le("div", _t, [
131
- s(u, {
129
+ return (_, h) => {
130
+ const M = X("n-ellipsis"), N = X("n-checkbox"), r = X("n-checkbox-group"), A = X("n-button");
131
+ return B(), ne("div", Ht, [
132
+ f(r, {
132
133
  value: i.value,
133
- "onUpdate:value": D[0] || (D[0] = (c) => i.value = c),
134
+ "onUpdate:value": h[0] || (h[0] = (m) => i.value = m),
134
135
  class: "filter-main"
135
136
  }, {
136
- default: R(() => [
137
- (T(!0), le(ae, null, me(t.filterItem, (c) => (T(), H(S, {
138
- key: c.key,
139
- value: c.key,
137
+ default: v(() => [
138
+ (B(!0), ne(ue, null, he(e.filterItem, (m) => (B(), K(N, {
139
+ key: m.key,
140
+ value: m.key,
140
141
  class: "filter-item"
141
142
  }, {
142
- default: R(() => [
143
- s(M, { style: { "max-width": "100px" } }, {
144
- default: R(() => [
145
- v(he(c.title), 1)
143
+ default: v(() => [
144
+ f(M, { style: { "max-width": "100px" } }, {
145
+ default: v(() => [
146
+ Z(pe(m.title), 1)
146
147
  ]),
147
148
  _: 2
148
149
  }, 1024)
@@ -152,32 +153,32 @@ const Me = {
152
153
  ]),
153
154
  _: 1
154
155
  }, 8, ["value"]),
155
- we("div", Rt, [
156
- s(u, {
157
- type: e.type,
158
- value: d.value,
159
- "onUpdate:value": m
156
+ _e("div", Kt, [
157
+ f(r, {
158
+ type: t.type,
159
+ value: s.value,
160
+ "onUpdate:value": g
160
161
  }, {
161
- default: R(() => [
162
- (T(!0), le(ae, null, me(n.value, (c) => (T(), H(S, {
163
- key: c.key,
164
- value: c.key
162
+ default: v(() => [
163
+ (B(!0), ne(ue, null, he(n.value, (m) => (B(), K(N, {
164
+ key: m.key,
165
+ value: m.key
165
166
  }, {
166
- default: R(() => [
167
- v(he(c.label), 1)
167
+ default: v(() => [
168
+ Z(pe(m.label), 1)
168
169
  ]),
169
170
  _: 2
170
171
  }, 1032, ["value"]))), 128))
171
172
  ]),
172
173
  _: 1
173
174
  }, 8, ["type", "value"]),
174
- s(w, {
175
+ f(A, {
175
176
  class: "submit-btn",
176
- type: e.type,
177
+ type: t.type,
177
178
  onClick: o
178
179
  }, {
179
- default: R(() => [...D[1] || (D[1] = [
180
- v(" 保存 ", -1)
180
+ default: v(() => [...h[1] || (h[1] = [
181
+ Z(" 保存 ", -1)
181
182
  ])]),
182
183
  _: 1
183
184
  }, 8, ["type"])
@@ -185,7 +186,7 @@ const Me = {
185
186
  ]);
186
187
  };
187
188
  }
188
- }, Lt = /* @__PURE__ */ ue(kt, [["__scopeId", "data-v-2aba8b9e"]]), E = {
189
+ }, Gt = /* @__PURE__ */ oe(jt, [["__scopeId", "data-v-2aba8b9e"]]), q = {
189
190
  // API 基础地址
190
191
  baseURL: "",
191
192
  // 权限检查函数
@@ -202,266 +203,257 @@ const Me = {
202
203
  themeOverrides: null
203
204
  }
204
205
  };
205
- function jt(t = {}) {
206
- if (t.baseURL !== void 0 && (E.baseURL = t.baseURL), t.hasPermission !== void 0) {
207
- if (typeof t.hasPermission != "function")
206
+ function Jt(e = {}) {
207
+ if (e.baseURL !== void 0 && (q.baseURL = e.baseURL), e.hasPermission !== void 0) {
208
+ if (typeof e.hasPermission != "function")
208
209
  throw new TypeError("hasPermission 必须是一个函数");
209
- E.hasPermission = t.hasPermission;
210
+ q.hasPermission = e.hasPermission;
210
211
  }
211
- if (t.uploadMethod !== void 0) {
212
- if (typeof t.uploadMethod != "function")
212
+ if (e.uploadMethod !== void 0) {
213
+ if (typeof e.uploadMethod != "function")
213
214
  throw new TypeError("uploadMethod 必须是一个函数");
214
- E.uploadMethod = t.uploadMethod;
215
+ q.uploadMethod = e.uploadMethod;
215
216
  }
216
- if (t.dialog !== void 0) {
217
- if (typeof t.dialog != "object")
217
+ if (e.dialog !== void 0) {
218
+ if (typeof e.dialog != "object")
218
219
  throw new TypeError("dialog 必须是一个对象");
219
- t.dialog.instance !== void 0 && (E.dialog.instance = t.dialog.instance), t.dialog.inheritTheme !== void 0 && (E.dialog.inheritTheme = t.dialog.inheritTheme), t.dialog.themeOverrides !== void 0 && (E.dialog.themeOverrides = t.dialog.themeOverrides);
220
+ e.dialog.instance !== void 0 && (q.dialog.instance = e.dialog.instance), e.dialog.inheritTheme !== void 0 && (q.dialog.inheritTheme = e.dialog.inheritTheme), e.dialog.themeOverrides !== void 0 && (q.dialog.themeOverrides = e.dialog.themeOverrides);
220
221
  }
221
- return E;
222
+ return q;
222
223
  }
223
- function Ml() {
224
- return { ...E };
224
+ function Tl() {
225
+ return { ...q };
225
226
  }
226
- function Vt() {
227
- return E.baseURL;
227
+ function Qt() {
228
+ return q.baseURL;
228
229
  }
229
- function Ul() {
230
- return E.hasPermission;
230
+ function Bl() {
231
+ return q.hasPermission;
231
232
  }
232
- function zt() {
233
- return E.uploadMethod;
233
+ function Xt() {
234
+ return q.uploadMethod;
234
235
  }
235
- function Kt() {
236
- return { ...E.dialog };
236
+ function Zt() {
237
+ return { ...q.dialog };
237
238
  }
238
- function Le(t) {
239
- E.dialog.instance = t;
239
+ function He(e) {
240
+ q.dialog.instance = e;
240
241
  }
241
- function $l() {
242
- return E.dialog.instance;
242
+ function el() {
243
+ return q.dialog.instance;
243
244
  }
244
- function be(t) {
245
- return E.hasPermission ? E.hasPermission(t) : (console.warn("hasPermission 未配置,默认返回 true。请使用 setupConfig 配置权限检查函数。"), !0);
245
+ function we(e) {
246
+ return q.hasPermission ? q.hasPermission(e) : (console.warn("hasPermission 未配置,默认返回 true。请使用 setupConfig 配置权限检查函数。"), !0);
246
247
  }
247
- const Wt = {
248
- mounted(t, l) {
249
- const e = l.value;
250
- if (!e)
248
+ const tl = {
249
+ mounted(e, l) {
250
+ const t = l.value;
251
+ if (!t)
251
252
  return;
252
- (Array.isArray(e) ? e : [e]).some((i) => be(i)) || (t.style.display = "none", t._originalDisplay = t.style.display || "");
253
+ (Array.isArray(t) ? t : [t]).some((i) => we(i)) || (e.style.display = "none", e._originalDisplay = e.style.display || "");
253
254
  },
254
- updated(t, l) {
255
- const e = l.value;
256
- if (!e) {
257
- t._originalDisplay !== void 0 ? t.style.display = t._originalDisplay || "" : t.style.display = "";
255
+ updated(e, l) {
256
+ const t = l.value;
257
+ if (!t) {
258
+ e._originalDisplay !== void 0 ? e.style.display = e._originalDisplay || "" : e.style.display = "";
258
259
  return;
259
260
  }
260
- (Array.isArray(e) ? e : [e]).some((i) => be(i)) ? t._originalDisplay !== void 0 ? t.style.display = t._originalDisplay || "" : t.style.display = "" : t.style.display = "none";
261
+ (Array.isArray(t) ? t : [t]).some((i) => we(i)) ? e._originalDisplay !== void 0 ? e.style.display = e._originalDisplay || "" : e.style.display = "" : e.style.display = "none";
261
262
  },
262
- unmounted(t) {
263
- delete t._originalDisplay;
263
+ unmounted(e) {
264
+ delete e._originalDisplay;
264
265
  }
265
266
  };
266
- let je = null;
267
- function X(t) {
267
+ let Ke = null;
268
+ function ee(e) {
268
269
  var l;
269
- t && (je = t, (l = t._context.directives) != null && l.corePermission || t.directive("corePermission", Wt));
270
+ e && (Ke = e, (l = e._context.directives) != null && l.corePermission || e.directive("corePermission", tl));
270
271
  }
271
- function Pl() {
272
- var t;
272
+ function Yl() {
273
+ var e;
273
274
  try {
274
275
  const l = typeof require < "u" ? require("vue") : null;
275
276
  if (!l) return !1;
276
- const { getCurrentInstance: e } = l, r = e == null ? void 0 : e();
277
- if ((t = r == null ? void 0 : r.appContext) != null && t.app)
278
- return X(r.appContext.app), !0;
277
+ const { getCurrentInstance: t } = l, a = t == null ? void 0 : t();
278
+ if ((e = a == null ? void 0 : a.appContext) != null && e.app)
279
+ return ee(a.appContext.app), !0;
279
280
  } catch {
280
281
  }
281
282
  return !1;
282
283
  }
283
- function Ht() {
284
- return je;
284
+ function ll() {
285
+ return Ke;
285
286
  }
286
- const Ue = "filter_key", Gt = {
287
+ const Ee = "filter_key", nl = /* @__PURE__ */ j({
287
288
  __name: "DataTable",
288
289
  props: {
289
290
  data: {
290
- type: Array,
291
291
  default: () => []
292
292
  },
293
293
  pagination: {
294
- type: [Object, null],
295
- default: () => {
296
- }
294
+ default: void 0
297
295
  },
298
296
  columns: {
299
- type: Array,
300
297
  default: () => [{
301
298
  title: "测试案例"
302
299
  }]
303
300
  },
304
301
  oprColumns: {
305
- type: [Object, null],
306
- default: () => null
302
+ default: null
307
303
  },
308
304
  selectColumns: {
309
- type: [Object, null],
310
- default: () => null
305
+ default: null
311
306
  },
312
307
  defaultColumns: {
313
- type: Array,
314
308
  default: () => []
315
309
  },
316
310
  summaryColumns: {
317
- type: null,
318
- default: () => null
311
+ type: Function,
312
+ default: null
319
313
  },
320
314
  emptyText: {
321
- type: String,
322
- default: () => "没有数据"
315
+ default: "没有数据"
323
316
  },
324
317
  emptyIcon: {
325
- type: String,
326
- default: () => ""
318
+ default: ""
327
319
  },
328
320
  isFilter: {
329
321
  type: Boolean,
330
- default: () => !1
322
+ default: !1
331
323
  },
332
324
  isEllipsis: {
333
325
  type: Boolean,
334
- default: () => !0
326
+ default: !0
335
327
  },
336
328
  virtual: {
337
- type: null,
338
- default: () => {
339
- }
329
+ type: [Object, Boolean],
330
+ default: () => ({})
340
331
  },
341
332
  singleColumn: {
342
333
  type: Boolean,
343
- default: () => !1
334
+ default: !1
344
335
  }
345
336
  },
346
337
  emits: ["sorted"],
347
- setup(t, {
338
+ setup(e, {
348
339
  expose: l,
349
- emit: e
340
+ emit: t
350
341
  }) {
351
342
  var x;
352
- const r = oe();
353
- (x = r == null ? void 0 : r.appContext) != null && x.app && X(r.appContext.app);
354
- const a = t, i = Re(), n = e, f = () => {
343
+ const a = re();
344
+ (x = a == null ? void 0 : a.appContext) != null && x.app && ee(a.appContext.app);
345
+ const u = e, i = ze(), n = t, d = () => {
355
346
  try {
356
347
  return (i == null ? void 0 : i.fullPath) || (i == null ? void 0 : i.path) || "";
357
348
  } catch {
358
349
  return "";
359
350
  }
360
- }, o = _(() => (console.log("table -data", a.data), a.data));
361
- function d(y) {
362
- window.localStorage.setItem(Ue, JSON.stringify(y));
351
+ }, o = Y(() => (console.log("table -data", u.data), u.data));
352
+ function s(b) {
353
+ window.localStorage.setItem(Ee, JSON.stringify(b));
363
354
  }
364
- function m() {
365
- return JSON.parse(window.localStorage.getItem(Ue)) || {};
355
+ function g() {
356
+ return JSON.parse(window.localStorage.getItem(Ee) || "{}") || {};
366
357
  }
367
- const h = P(m()), p = P([]), A = P(0);
368
- function D(y) {
369
- if (a.summaryColumns)
370
- return [a.selectColumns, ...g(a.columns), a.oprColumns].reduce((b, C) => {
371
- var $, B;
372
- return C != null && C.key ? b[C.key] = ((B = ($ = a.summaryColumns) == null ? void 0 : $.call(a, y)) == null ? void 0 : B[C.key]) || {
358
+ const w = P(g()), p = P([]), _ = P(0);
359
+ function h(b) {
360
+ if (u.summaryColumns)
361
+ return [u.selectColumns, ...y(u.columns || []), u.oprColumns].reduce((c, C) => {
362
+ var U, E;
363
+ return C != null && C.key ? c[C.key] = ((E = (U = u.summaryColumns) == null ? void 0 : U.call(u, b)) == null ? void 0 : E[C.key]) || {
373
364
  value: null
374
- } : b[Fe("table")] = {
365
+ } : c[Re("table")] = {
375
366
  value: null
376
- }, b;
367
+ }, c;
377
368
  }, {});
378
369
  }
379
370
  const M = P([]);
380
- ee(() => g(a.columns), () => {
381
- S();
371
+ te(() => y(u.columns), () => {
372
+ N();
382
373
  }, {
383
374
  immediate: !0
384
- }), ee(() => a.oprColumns, (y) => {
385
- console.log("oprColumns", y);
375
+ }), te(() => u.oprColumns, (b) => {
376
+ console.log("oprColumns", b);
386
377
  });
387
- function S() {
388
- var B;
389
- const y = g(a.columns), b = f();
390
- p.value = b && ((B = h.value) == null ? void 0 : B[b]) || (y == null ? void 0 : y.map((q, N) => (q == null ? void 0 : q.key) || L().valueOf() + N));
391
- const C = a.isFilter ? y.filter((q) => {
392
- var N;
393
- return (N = p.value) == null ? void 0 : N.includes(q.key);
394
- }) : [...y];
395
- a.selectColumns && C.unshift({
378
+ function N() {
379
+ var E;
380
+ const b = y(u.columns || []), c = d();
381
+ p.value = c && ((E = w.value) == null ? void 0 : E[c]) || (b == null ? void 0 : b.map((R, D) => (R == null ? void 0 : R.key) || String(L().valueOf() + D)));
382
+ const C = u.isFilter ? b.filter((R) => {
383
+ var D;
384
+ return (D = p.value) == null ? void 0 : D.includes(R.key);
385
+ }) : [...b];
386
+ u.selectColumns && C.unshift({
396
387
  key: "selectKey",
397
- ...a.selectColumns
398
- }), a.oprColumns && C.push(a.oprColumns);
399
- let $ = 0;
400
- M.value = C.reduce((q, N) => {
401
- var K;
402
- if (N != null && N.display && console.log("display", N == null ? void 0 : N.display), !((N == null ? void 0 : N.display) ?? !0)) return q;
403
- const U = {
388
+ ...u.selectColumns
389
+ }), u.oprColumns && C.push(u.oprColumns);
390
+ let U = 0;
391
+ M.value = C.reduce((R, D) => {
392
+ var G;
393
+ if (D != null && D.display && console.log("display", D == null ? void 0 : D.display), !((D == null ? void 0 : D.display) ?? !0)) return R;
394
+ const F = {
404
395
  align: "center",
405
396
  width: 120,
406
- ...N,
407
- key: (N == null ? void 0 : N.key) || Fe("table"),
408
- ellipsis: N != null && N.ellipsis || a.isEllipsis ? N != null && N.ellipsisProp ? N == null ? void 0 : N.ellipsisProp(Me) : Me : !1,
397
+ ...D,
398
+ key: (D == null ? void 0 : D.key) || Re("table"),
399
+ ellipsis: D != null && D.ellipsis || u.isEllipsis ? D != null && D.ellipsisProp ? D == null ? void 0 : D.ellipsisProp(qe) : qe : !1,
409
400
  "ellipsis-component": "ellipsis",
410
401
  title: () => {
411
- const V = (N == null ? void 0 : N.label) || (N == null ? void 0 : N.title) || "";
412
- return s("div", {
402
+ const k = (D == null ? void 0 : D.label) || (D == null ? void 0 : D.title) || "";
403
+ return f("div", {
413
404
  style: {
414
405
  width: "100%",
415
406
  whiteSpace: "pre-wrap"
416
407
  }
417
- }, [typeof V == "string" ? V : V == null ? void 0 : V()]);
408
+ }, [typeof k == "string" ? k : k == null ? void 0 : k()]);
418
409
  }
419
410
  };
420
- return N != null && N.sorter && (U.renderSorterIcon = ({
421
- order: V
411
+ return D != null && D.sorter && (F.renderSorterIcon = ({
412
+ order: k
422
413
  }) => {
423
414
  const {
424
415
  Icon: ie,
425
- title: F
426
- } = ye[V];
427
- return s(ot, null, {
416
+ title: se
417
+ } = me[k];
418
+ return f(mt, null, {
428
419
  trigger: () => ie,
429
- default: () => F
420
+ default: () => se
430
421
  });
431
- }, U.sorter = {
422
+ }, F.sorter = {
432
423
  multiple: 1,
433
- fn: N.sorter
434
- }), $ += U != null && U.width ? Number.parseInt(U == null ? void 0 : U.width) : ((K = U == null ? void 0 : U.title) == null ? void 0 : K.length) * U.length + 30 || 0, q.push(U), q;
435
- }, []), A.value = $, console.log("计算");
424
+ fn: D.sorter
425
+ }), U += F != null && F.width ? Number.parseInt(String(F == null ? void 0 : F.width)) : (typeof (F == null ? void 0 : F.title) == "string" ? ((G = F == null ? void 0 : F.title) == null ? void 0 : G.length) * 30 : 0) || 0, R.push(F), R;
426
+ }, []), _.value = U, console.log("计算");
436
427
  }
437
- function u() {
438
- return s(Q, {
428
+ function r() {
429
+ return f(z, {
439
430
  type: "info",
440
- onClick: () => w()
431
+ onClick: () => A()
441
432
  }, {
442
433
  default: () => "筛选字段",
443
- icon: () => s(Ut, null, null)
434
+ icon: () => f(Tt, null, null)
444
435
  });
445
436
  }
446
- function w() {
437
+ function A() {
447
438
  const {
448
- cancel: y
449
- } = Ke({
439
+ cancel: b
440
+ } = Je({
450
441
  title: "筛选字段",
451
442
  read: !0,
452
443
  options: [{
453
- render: () => s(Lt, {
444
+ key: "filter-dialog",
445
+ render: () => f(Gt, {
454
446
  style: {
455
447
  width: "100%",
456
448
  margin: "0",
457
449
  padding: 0
458
450
  },
459
- filterItem: g(a.columns),
451
+ filterItem: y(u.columns || []),
460
452
  selectItem: p.value,
461
- defaultItem: a.defaultColumns,
462
- onSubmit: (b) => {
463
- const C = f();
464
- C && (h.value[C] = b, d(h.value)), S(), y();
453
+ defaultItem: u.defaultColumns,
454
+ onSubmit: (c) => {
455
+ const C = d();
456
+ C && (w.value[C] = c, s(w.value)), N(), b();
465
457
  }
466
458
  }, null)
467
459
  }]
@@ -472,35 +464,35 @@ const Ue = "filter_key", Gt = {
472
464
  }
473
465
  });
474
466
  }
475
- function c(y) {
476
- if (console.log("onSorter", y), !y) return;
477
- Oe(y).forEach((C) => {
478
- var $, B;
479
- console.log("v", C), C != null && C.sorter && ((B = C == null ? void 0 : C.sorter) == null || B.fn((q, N, U) => {
480
- var K;
481
- (K = ye[C.order]) == null || K.fn(q, U), N.fetchData();
467
+ function m(b) {
468
+ if (console.log("onSorter", b), !b) return;
469
+ Oe(b).forEach((C) => {
470
+ var U, E, R;
471
+ console.log("v", C), C != null && C.sorter && ((R = (U = C == null ? void 0 : C.sorter) == null ? void 0 : U.fn) == null || R.call(U, (D, F, G) => {
472
+ var k;
473
+ (k = me[C.order]) == null || k.fn(D, G), F.fetchData();
482
474
  }, {
483
475
  field: C == null ? void 0 : C.columnKey,
484
- value: ($ = ye[C == null ? void 0 : C.order]) == null ? void 0 : $.value,
485
- isClick: !ve(C)
476
+ value: (E = me[C == null ? void 0 : C.order]) == null ? void 0 : E.value,
477
+ isClick: !ut(C)
486
478
  }));
487
479
  }), n("sorted");
488
480
  }
489
481
  return l({
490
- filterHandle: w,
491
- filterButton: u,
492
- initColumns: S
493
- }), Be(() => {
494
- }), (y, b) => {
495
- const C = Y("n-empty"), $ = Y("n-data-table");
496
- return T(), H($, {
482
+ filterHandle: A,
483
+ filterButton: r,
484
+ initColumns: N
485
+ }), ke(() => {
486
+ }), (b, c) => {
487
+ const C = X("n-empty");
488
+ return B(), K(y(gt), {
497
489
  data: o.value,
498
490
  columns: M.value,
499
- "scroll-x": A.value,
500
- "single-column": a.singleColumn,
501
- summary: a.summaryColumns ? D : void 0,
491
+ "scroll-x": _.value,
492
+ "single-column": u.singleColumn,
493
+ summary: u.summaryColumns ? h : void 0,
502
494
  "summary-placement": "bottom",
503
- pagination: a.pagination,
495
+ pagination: u.pagination,
504
496
  "row-props": () => ({
505
497
  style: {
506
498
  height: "60px"
@@ -508,38 +500,38 @@ const Ue = "filter_key", Gt = {
508
500
  }),
509
501
  "flex-height": "",
510
502
  remote: "",
511
- "virtual-scroll": a.virtual ?? a.data.length > 1e3,
503
+ "virtual-scroll": !!(u.virtual ?? u.data.length > 1e3),
512
504
  style: {
513
505
  flex: "1"
514
506
  },
515
- "onUpdate:sorter": c
507
+ "onUpdate:sorter": m
516
508
  }, {
517
- empty: R(() => [ge(y.$slots, "empty", {}, () => [s(C, null, {
518
- default: R(() => [v(he(t.emptyText), 1)]),
509
+ empty: v(() => [be(b.$slots, "empty", {}, () => [f(C, null, {
510
+ default: v(() => [Z(pe(e.emptyText), 1)]),
519
511
  _: 1
520
512
  })], !0)]),
521
513
  _: 3
522
514
  }, 8, ["data", "columns", "scroll-x", "single-column", "summary", "pagination", "virtual-scroll"]);
523
515
  };
524
516
  }
525
- }, Jt = /* @__PURE__ */ ue(Gt, [["__scopeId", "data-v-d6710561"]]);
526
- function ql(t) {
527
- jt({ uploadMethod: t });
517
+ }), al = /* @__PURE__ */ oe(nl, [["__scopeId", "data-v-9de17e68"]]);
518
+ function kl(e) {
519
+ Jt({ uploadMethod: e });
528
520
  }
529
- function Qt(...t) {
530
- const l = zt();
521
+ function ul(...e) {
522
+ const l = Xt();
531
523
  if (typeof l != "function")
532
524
  throw new TypeError("请先通过 setupConfig({ uploadMethod: fn }) 或 registryUpload(fn) 注册上传实现");
533
- return l(...t);
525
+ return l(...e);
534
526
  }
535
- function W(t, l = null) {
536
- if (t && !(t != null && t.startsWith("http"))) {
537
- const e = Vt();
538
- return e ? l ? `${e}${t}?x-oss-process=style/w${l}` : `${e}${t}` : (console.warn('BASE_URL 未配置,返回原始 URL。请使用 setupConfig({ baseURL: "..." }) 配置。'), t);
527
+ function W(e, l = null) {
528
+ if (e && !(e != null && e.startsWith("http"))) {
529
+ const t = Qt();
530
+ return t ? l ? `${t}${e}?x-oss-process=style/w${l}` : `${t}${e}` : (console.warn('BASE_URL 未配置,返回原始 URL。请使用 setupConfig({ baseURL: "..." }) 配置。'), e);
539
531
  }
540
- return t;
532
+ return e;
541
533
  }
542
- const Xt = "/admin/file", Zt = {
534
+ const rl = "/admin/file", ol = {
543
535
  __name: "ImagesUpload",
544
536
  props: {
545
537
  value: {
@@ -585,12 +577,12 @@ const Xt = "/admin/file", Zt = {
585
577
  }
586
578
  },
587
579
  emits: ["update:value", "complete"],
588
- setup(t, {
580
+ setup(e, {
589
581
  emit: l
590
582
  }) {
591
- const e = t, r = l, a = P([]);
592
- ee(() => e.value, (o) => {
593
- console.log("props.value", o), a.value = e.max === 1 ? o ? typeof o != "string" ? o != null && o.length ? [{
583
+ const t = e, a = l, u = P([]);
584
+ te(() => t.value, (o) => {
585
+ console.log("props.value", o), u.value = t.max === 1 ? o ? typeof o != "string" ? o != null && o.length ? [{
594
586
  id: L().valueOf(),
595
587
  name: `img${L().valueOf()}`,
596
588
  url: W(o[0]),
@@ -604,14 +596,14 @@ const Xt = "/admin/file", Zt = {
604
596
  fullPath: o,
605
597
  thumbnailUrl: W(o),
606
598
  status: "finished"
607
- }] : [] : (o == null ? void 0 : o.map((d, m) => ({
608
- id: L().valueOf() + m,
599
+ }] : [] : (o == null ? void 0 : o.map((s, g) => ({
600
+ id: L().valueOf() + g,
609
601
  name: `img${L().valueOf()}`,
610
- url: W(d),
611
- fullPath: d,
612
- thumbnailUrl: W(d),
602
+ url: W(s),
603
+ fullPath: s,
604
+ thumbnailUrl: W(s),
613
605
  status: "finished"
614
- }))) || [], console.log("1", a.value);
606
+ }))) || [], console.log("1", u.value);
615
607
  }, {
616
608
  immediate: !0
617
609
  });
@@ -620,214 +612,220 @@ const Xt = "/admin/file", Zt = {
620
612
  }
621
613
  async function n({
622
614
  file: o,
623
- onFinish: d,
624
- onError: m,
625
- onProgress: h
615
+ onFinish: s,
616
+ onError: g,
617
+ onProgress: w
626
618
  }, p) {
627
- const A = new FormData();
628
- o.status === "pending" && (A.append("file", o.file), e.formData && Object.keys(e.formData).length && Object.keys(e.formData).forEach((D) => {
629
- A.append(D, e.formData[D]);
630
- }), Qt({
631
- url: Xt,
632
- data: A,
619
+ const _ = new FormData();
620
+ o.status === "pending" && (_.append("file", o.file), t.formData && Object.keys(t.formData).length && Object.keys(t.formData).forEach((h) => {
621
+ _.append(h, t.formData[h]);
622
+ }), ul({
623
+ url: rl,
624
+ data: _,
633
625
  method: "post",
634
626
  onUploadProgress: ({
635
- percent: D
636
- }) => h({
637
- percent: D
627
+ percent: h
628
+ }) => w({
629
+ percent: h
638
630
  })
639
- }).then((D) => {
631
+ }).then((h) => {
640
632
  const {
641
633
  url: M
642
- } = D.data;
643
- o.url = W(M), o.fullPath = M, o.thumbnailUrl = W(M), d(), f();
634
+ } = h.data;
635
+ o.url = W(M), o.fullPath = M, o.thumbnailUrl = W(M), s(), d();
644
636
  }).catch(() => {
645
- o = null, m();
637
+ o = null, g();
646
638
  }).finally(() => {
647
639
  }));
648
640
  }
649
- function f() {
650
- console.log("onSubmit", a.value);
651
- const o = a.value.reduce((d, m) => (m.status === "finished" && (m != null && m.fullPath) && d.push(m.fullPath), d), []);
652
- e.max === 1 && o.length === 1 ? r("update:value", o[0]) : o.length ? r("update:value", o) : r("update:value", e.max === 1 ? null : []);
641
+ function d() {
642
+ console.log("onSubmit", u.value);
643
+ const o = u.value.reduce((s, g) => (g.status === "finished" && (g != null && g.fullPath) && s.push(g.fullPath), s), []);
644
+ t.max === 1 && o.length === 1 ? a("update:value", o[0]) : o.length ? a("update:value", o) : a("update:value", t.max === 1 ? null : []);
653
645
  }
654
- return (o, d) => {
655
- const m = Y("n-upload"), h = Y("n-space");
656
- return T(), H(h, {
646
+ return (o, s) => {
647
+ const g = X("n-upload"), w = X("n-space");
648
+ return B(), K(w, {
657
649
  align: "end",
658
650
  "wrap-item": !1
659
651
  }, {
660
- default: R(() => [s(m, {
661
- "file-list": a.value,
662
- "onUpdate:fileList": d[0] || (d[0] = (p) => a.value = p),
652
+ default: v(() => [f(g, {
653
+ "file-list": u.value,
654
+ "onUpdate:fileList": s[0] || (s[0] = (p) => u.value = p),
663
655
  accept: ".jpeg,.jpg,.png",
664
656
  "list-type": "image-card",
665
657
  "custom-request": i,
666
- max: e.read ? Array.isArray(e.value) ? e.value.length : 1 : e.max,
658
+ max: t.read ? Array.isArray(t.value) ? t.value.length : 1 : t.max,
667
659
  "show-retry-button": !1,
668
- "show-remove-button": !e.read,
660
+ "show-remove-button": !t.read,
669
661
  class: "upload-box",
670
- style: Te({
671
- ...e.size ? {
672
- "--image-w": `${e.size}px`,
673
- "--image-h": `${e.size}px`
662
+ style: ve({
663
+ ...t.size ? {
664
+ "--image-w": `${t.size}px`,
665
+ "--image-h": `${t.size}px`
674
666
  } : {
675
- "--image-w": `${e.width}px`,
676
- "--image-h": `${e.height}px`
667
+ "--image-w": `${t.width}px`,
668
+ "--image-h": `${t.height}px`
677
669
  },
678
- "--image-mode": e.mode
670
+ "--image-mode": t.mode
679
671
  }),
680
- onFinish: d[1] || (d[1] = () => {
681
- f(), r("complete");
672
+ onFinish: s[1] || (s[1] = () => {
673
+ d(), a("complete");
682
674
  }),
683
- onRemove: d[2] || (d[2] = (p, A) => (a.value.splice(A, 1), f(), !1))
675
+ onRemove: s[2] || (s[2] = (p, _) => (u.value.splice(_, 1), d(), !1))
684
676
  }, null, 8, ["file-list", "max", "show-remove-button", "style"])]),
685
677
  _: 1
686
678
  });
687
679
  };
688
680
  }
689
- }, vt = /* @__PURE__ */ ue(Zt, [["__scopeId", "data-v-54e2cc87"]]);
690
- function $e(t = [], { labelField: l = j, valueField: e = k } = {
691
- labelField: j,
692
- valueField: k
693
- }) {
694
- return g(t).reduce((r, a) => (r[a[e]] = {
695
- ...a,
696
- [l]: a[l],
697
- [e]: a[e]
698
- }, r), {});
681
+ }, il = /* @__PURE__ */ oe(ol, [["__scopeId", "data-v-54e2cc87"]]);
682
+ function $e(e = [], l = $, t = T) {
683
+ return y(e).reduce((a, u) => (a[u[t]] = {
684
+ ...u,
685
+ [l]: u[l],
686
+ [t]: u[t]
687
+ }, a), {});
699
688
  }
700
- function Oe(t) {
701
- return Array.isArray(t) ? t : [t];
689
+ function Oe(e) {
690
+ return Array.isArray(e) ? e : [e];
702
691
  }
703
- function Pe(t, l = "YYYY-MM-DD", e = { emptyText: "" }) {
704
- return t ? L(Number.isNaN(Number(t)) ? t : Number(t)).format(l) : (e == null ? void 0 : e.emptyText) || "";
692
+ function Te(e, l = "YYYY-MM-DD", t = { emptyText: "" }) {
693
+ return e ? L(Number.isNaN(Number(e)) ? e : Number(e)).format(l) : (t == null ? void 0 : t.emptyText) || "";
705
694
  }
706
- function el(t) {
707
- return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !te(t);
695
+ function sl(e) {
696
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !le(e);
708
697
  }
709
- const tl = {
698
+ const fl = {
710
699
  input: ({
711
- label: t,
700
+ label: e,
712
701
  key: l,
713
- props: e,
714
- readProps: r,
715
- format: a = null,
702
+ props: t,
703
+ readProps: a,
704
+ format: u = null,
716
705
  read: i
717
706
  }, {
718
707
  _value: n,
719
- _isRead: f
720
- }) => i ?? f ? s(Ct, r, {
721
- default: () => [a ? a == null ? void 0 : a(g(n)[l], g(n)) : g(n)[l]]
722
- }) : s(Se, I({
723
- value: n[l],
724
- "onUpdate:value": (o) => n[l] = o,
725
- clearable: !0,
726
- placeholder: `请输入${g(t)}`
727
- }, e), {
728
- ...(e == null ? void 0 : e.slots) || {}
729
- }),
708
+ _isRead: d
709
+ }) => {
710
+ const o = y(n), s = y(d);
711
+ return i ?? s ? f(Mt, a, {
712
+ default: () => [u ? u == null ? void 0 : u(o[l], o) : o[l]]
713
+ }) : f(Ue, I({
714
+ value: o[l],
715
+ "onUpdate:value": (g) => o[l] = g,
716
+ clearable: !0,
717
+ placeholder: `请输入${y(e)}`
718
+ }, t), {
719
+ ...(t == null ? void 0 : t.slots) || {}
720
+ });
721
+ },
730
722
  select: ({
731
- label: t,
723
+ label: e,
732
724
  key: l,
733
- props: e,
734
- options: r = [],
735
- loading: a = !1,
725
+ props: t,
726
+ options: a = [],
727
+ loading: u = !1,
736
728
  format: i = null,
737
729
  read: n
738
730
  }, {
739
- _value: f,
731
+ _value: d,
740
732
  _isRead: o
741
733
  }) => {
742
- var m, h;
743
- const d = (Array.isArray(g(r)) ? g(r) : r == null ? void 0 : r(f[l])) || [];
744
- return n ?? o ? s("div", null, [i ? i == null ? void 0 : i(f[l], d) : (h = (m = $e(d, (e == null ? void 0 : e.labelField) || j, (e == null ? void 0 : e.valueField) || k)) == null ? void 0 : m[f[l]]) == null ? void 0 : h[(e == null ? void 0 : e.labelField) || j]]) : s(Ot, I({
745
- value: f[l],
746
- "onUpdate:value": (p) => f[l] = p,
747
- options: d,
748
- loading: g(a),
734
+ var p, _;
735
+ const s = y(d), g = y(o), w = Array.isArray(a) ? a : typeof a == "function" ? a(s[l]) : [];
736
+ return n ?? g ? f("div", null, [i ? i == null ? void 0 : i(s[l], w) : ((_ = (p = $e(w, (t == null ? void 0 : t.labelField) || $, (t == null ? void 0 : t.valueField) || T)) == null ? void 0 : p[s[l]]) == null ? void 0 : _[(t == null ? void 0 : t.labelField) || $]) || s[l]]) : f(It, I({
737
+ value: s[l],
738
+ "onUpdate:value": (h) => s[l] = h,
739
+ options: w,
740
+ loading: y(u),
749
741
  clearable: !0,
750
742
  filterable: !0,
751
- "fallback-option": () => (e != null && e.asyncFallback || (f[l] = null), !1),
752
- labelField: (e == null ? void 0 : e.labelField) || j,
753
- valueField: (e == null ? void 0 : e.valueField) || k,
754
- placeholder: `请选择${g(t)}`,
743
+ "fallback-option": () => (t != null && t.asyncFallback || (s[l] = null), !1),
744
+ labelField: (t == null ? void 0 : t.labelField) || $,
745
+ valueField: (t == null ? void 0 : t.valueField) || T,
746
+ placeholder: `请选择${y(e)}`,
755
747
  style: "width:100%",
756
748
  "max-tag-count": "responsive"
757
- }, e), {
758
- ...(e == null ? void 0 : e.slots) || {}
749
+ }, t), {
750
+ ...(t == null ? void 0 : t.slots) || {}
759
751
  });
760
752
  },
761
753
  date: ({
762
- label: t,
754
+ label: e,
763
755
  key: l,
764
- props: e,
765
- formatTime: r = "YYYY-MM-DD",
766
- type: a = "date",
756
+ props: t,
757
+ formatTime: a = "YYYY-MM-DD",
758
+ type: u = "date",
767
759
  format: i,
768
760
  read: n
769
761
  }, {
770
- _value: f,
762
+ _value: d,
771
763
  _isRead: o
772
- }) => n ?? o ? s("div", null, [i ? i == null ? void 0 : i(f[l]) : Pe(f[l], r)]) : s(Ie, I({
773
- "formatted-value": f[l],
774
- "onUpdate:formatted-value": (d) => {
775
- f[l] = d;
776
- },
777
- type: a,
778
- clearable: !0,
779
- placeholder: `请选择${g(t)}`,
780
- "update-value-on-close": !["year"].includes(e == null ? void 0 : e.type),
781
- style: "width:100%"
782
- }, e), {
783
- ...(e == null ? void 0 : e.slots) || {}
784
- }),
764
+ }) => {
765
+ const s = y(d), g = y(o);
766
+ return n ?? g ? f("div", null, [i ? i == null ? void 0 : i(s[l]) : Te(s[l], a)]) : f(Pe, I({
767
+ "formatted-value": s[l],
768
+ "onUpdate:formatted-value": (w) => {
769
+ s[l] = w;
770
+ },
771
+ type: u,
772
+ clearable: !0,
773
+ placeholder: `请选择${y(e)}`,
774
+ "update-value-on-close": !["year"].includes(t == null ? void 0 : t.type),
775
+ style: "width:100%"
776
+ }, t), {
777
+ ...(t == null ? void 0 : t.slots) || {}
778
+ });
779
+ },
785
780
  time: ({
786
- label: t,
781
+ label: e,
787
782
  key: l,
788
- props: e,
789
- format: r,
790
- formatTime: a = "YYYY-MM-DD",
783
+ props: t,
784
+ format: a,
785
+ formatTime: u = "YYYY-MM-DD",
791
786
  read: i
792
787
  }, {
793
788
  _value: n,
794
- _isRead: f
795
- }) => i ?? f ? s("div", null, [r ? r == null ? void 0 : r(n[l]) : Pe(n[l], a)]) : s(xt, I({
796
- "formatted-value": n[l],
797
- "onUpdate:value": (o, d) => {
798
- console.log("v", d), n[l] = d;
799
- },
800
- clearable: !0,
801
- format: "HH:mm:ss",
802
- style: "width:100%",
803
- placeholder: `请选择${g(t)}`
804
- }, e), {
805
- ...(e == null ? void 0 : e.slots) || {}
806
- }),
789
+ _isRead: d
790
+ }) => {
791
+ const o = y(n), s = y(d);
792
+ return i ?? s ? f("div", null, [a ? a == null ? void 0 : a(o[l]) : Te(o[l], u)]) : f(St, I({
793
+ "formatted-value": o[l],
794
+ "onUpdate:value": (g, w) => {
795
+ console.log("v", w), o[l] = w;
796
+ },
797
+ clearable: !0,
798
+ format: "HH:mm:ss",
799
+ style: "width:100%",
800
+ placeholder: `请选择${y(e)}`
801
+ }, t), {
802
+ ...(t == null ? void 0 : t.slots) || {}
803
+ });
804
+ },
807
805
  dateRange: ({
808
- key: t,
806
+ key: e,
809
807
  props: l,
810
- type: e = "datetimerange",
811
- read: r
808
+ type: t = "datetimerange",
809
+ read: a
812
810
  }, {
813
- _value: a,
811
+ _value: u,
814
812
  _isRead: i
815
813
  }) => {
816
- var o, d;
817
- const n = {
814
+ var g, w;
815
+ const n = y(u), d = y(i), o = {
818
816
  date: "YYYY-MM-DD",
819
817
  datetime: "YYYY-MM-DD HH:mm:ss",
820
818
  time: "HH:mm:ss",
821
819
  datetimerange: "YYYY-MM-DD HH:mm:ss",
822
820
  daterange: "YYYY-MM-DD"
823
- }, f = l != null && l.format ? (d = (o = l == null ? void 0 : l.format) == null ? void 0 : o.replace("yyyy", "YYYY")) == null ? void 0 : d.replace("dd", "DD") : n[(l == null ? void 0 : l.type) || e];
824
- return console.log("formatStr type", e), console.log("formatStr", f), r ?? i ? s("div", null, [Array.isArray(t) ? `${a == null ? void 0 : a[t == null ? void 0 : t[0]]} - ${a == null ? void 0 : a[t == null ? void 0 : t[1]]}` : a == null ? void 0 : a[t]]) : s(Ie, I({
825
- "formatted-value": Array.isArray(t) ? a != null && a[t == null ? void 0 : t[0]] && (a != null && a[t == null ? void 0 : t[1]]) ? [L(a == null ? void 0 : a[t == null ? void 0 : t[0]]).format(f), L(a == null ? void 0 : a[t == null ? void 0 : t[1]]).format(f)] : null : (a == null ? void 0 : a[t]) || null,
826
- "onUpdate:formatted-value": (m) => {
827
- console.log(m), m && ![n.datetime, n.datetimerange].includes(f) && (m = m.map((h, p) => L(h, f)[p ? "endOf" : "startOf"]("day").format(f))), Array.isArray(t) ? (a[t == null ? void 0 : t[0]] = m == null ? void 0 : m[0], a[t == null ? void 0 : t[1]] = m == null ? void 0 : m[1]) : a[t] = m;
821
+ }, s = l != null && l.format ? (w = (g = l == null ? void 0 : l.format) == null ? void 0 : g.replace("yyyy", "YYYY")) == null ? void 0 : w.replace("dd", "DD") : o[(l == null ? void 0 : l.type) || t];
822
+ return console.log("formatStr type", t), console.log("formatStr", s), a ?? d ? f("div", null, [Array.isArray(e) ? `${n == null ? void 0 : n[e == null ? void 0 : e[0]]} - ${n == null ? void 0 : n[e == null ? void 0 : e[1]]}` : n == null ? void 0 : n[e]]) : f(Pe, I({
823
+ "formatted-value": Array.isArray(e) ? n != null && n[e == null ? void 0 : e[0]] && (n != null && n[e == null ? void 0 : e[1]]) ? [L(n == null ? void 0 : n[e == null ? void 0 : e[0]]).format(s), L(n == null ? void 0 : n[e == null ? void 0 : e[1]]).format(s)] : null : (n == null ? void 0 : n[e]) || null,
824
+ "onUpdate:formatted-value": (p) => {
825
+ console.log(p), p && ![o.datetime, o.datetimerange].includes(s) && (p = p.map((_, h) => L(_, s)[h ? "endOf" : "startOf"]("day").format(s))), Array.isArray(e) ? (n[e == null ? void 0 : e[0]] = p == null ? void 0 : p[0], n[e == null ? void 0 : e[1]] = p == null ? void 0 : p[1]) : n[e] = p;
828
826
  },
829
827
  "update-value-on-close": !["year", "month"].includes(l == null ? void 0 : l.type),
830
- type: e,
828
+ type: t,
831
829
  clearable: !0,
832
830
  style: "width:100%"
833
831
  }, l), {
@@ -835,279 +833,312 @@ const tl = {
835
833
  });
836
834
  },
837
835
  radio: ({
838
- key: t,
836
+ key: e,
839
837
  options: l = [],
840
- props: e,
841
- radioLabelProps: r,
842
- read: a
838
+ props: t,
839
+ radioLabelProps: a,
840
+ read: u
843
841
  }, {
844
842
  _value: i,
845
843
  _isRead: n,
846
- labelField: f,
844
+ labelField: d,
847
845
  valueField: o
848
846
  }) => {
849
- var d, m;
850
- return a ?? n ? s("div", null, [(m = (d = $e(l, (e == null ? void 0 : e.labelField) || f, (e == null ? void 0 : e.valueField) || o)) == null ? void 0 : d[i[t]]) == null ? void 0 : m[(e == null ? void 0 : e.labelField) || f]]) : s(bt, I({
847
+ var w, p;
848
+ const s = y(i), g = y(n);
849
+ return u ?? g ? f("div", null, [(p = (w = $e(Array.isArray(l) ? l : [], (t == null ? void 0 : t.labelField) || d || $, (t == null ? void 0 : t.valueField) || o || T)) == null ? void 0 : w[s[e]]) == null ? void 0 : p[(t == null ? void 0 : t.labelField) || d || $]]) : f(Dt, I({
851
850
  style: {
852
851
  width: "100%"
853
852
  },
854
- value: i[t],
855
- "onUpdate:value": (h) => i[t] = h
856
- }, e), {
857
- ...(e == null ? void 0 : e.slots) || {},
858
- default: () => s(z, I({
853
+ value: s[e],
854
+ "onUpdate:value": (_) => s[e] = _
855
+ }, t), {
856
+ ...(t == null ? void 0 : t.slots) || {},
857
+ default: () => f(V, I({
859
858
  "item-wrap": !1
860
- }, (e == null ? void 0 : e.radioProps) || {}), {
861
- default: () => [l == null ? void 0 : l.map((h) => s(wt, {
862
- key: h.value,
863
- value: h == null ? void 0 : h[(e == null ? void 0 : e.valueField) || o],
864
- class: "items-center"
865
- }, {
866
- default: () => [s("div", (r == null ? void 0 : r(h)) || {}, [h == null ? void 0 : h[(e == null ? void 0 : e.labelField) || f]])]
867
- }))]
859
+ }, (t == null ? void 0 : t.radioProps) || {}), {
860
+ default: () => {
861
+ var _;
862
+ return [(_ = Array.isArray(l) ? l : []) == null ? void 0 : _.map((h) => f(Nt, {
863
+ key: h.value,
864
+ value: h == null ? void 0 : h[(t == null ? void 0 : t.valueField) || o || T],
865
+ class: "items-center"
866
+ }, {
867
+ default: () => [f("div", (a == null ? void 0 : a(h)) || {}, [h == null ? void 0 : h[(t == null ? void 0 : t.labelField) || d || $]])]
868
+ }))];
869
+ }
868
870
  })
869
871
  });
870
872
  },
871
873
  inputPhone: ({
872
- label: t,
874
+ label: e,
873
875
  key: l,
874
- props: e,
875
- read: r
876
+ props: t,
877
+ read: a
876
878
  }, {
877
- _value: a,
879
+ _value: u,
878
880
  _isRead: i
879
- }) => r ?? i ? s("div", null, [a[l]]) : s(Se, I({
880
- value: a[l],
881
- "onUpdate:value": (n) => a[l] = n,
882
- clearable: !0,
883
- style: "width:100%",
884
- "allow-input": (n) => !n || /^\d$/.test(n) || n.length <= 11,
885
- placeholder: `请输入${g(t)}`
886
- }, e), {
887
- ...e == null ? void 0 : e.slots
888
- }),
881
+ }) => {
882
+ const n = y(u), d = y(i);
883
+ return a ?? d ? f("div", null, [n[l]]) : f(Ue, I({
884
+ value: n[l],
885
+ "onUpdate:value": (o) => n[l] = o,
886
+ clearable: !0,
887
+ style: "width:100%",
888
+ "allow-input": (o) => !o || /^\d$/.test(o) || o.length <= 11,
889
+ placeholder: `请输入${y(e)}`
890
+ }, t), {
891
+ ...t == null ? void 0 : t.slots
892
+ });
893
+ },
889
894
  inputNumber: ({
890
- label: t,
895
+ label: e,
891
896
  key: l,
892
- props: e,
893
- read: r
897
+ props: t,
898
+ read: a
894
899
  }, {
895
- _value: a,
900
+ _value: u,
896
901
  _isRead: i
897
- }) => r ?? i ? s("div", null, [a[l]]) : s(pt, I({
898
- value: typeof a[l] == "string" && a[l] ? Number(a[l]) : a[l],
899
- "onUpdate:value": (n) => {
900
- a[l] = n;
901
- },
902
- showButton: !1,
903
- clearable: !0,
904
- style: "width:100%",
905
- placeholder: `请输入${g(t)}`,
906
- min: 0
907
- }, e), {
908
- ...(e == null ? void 0 : e.slots) || {}
909
- }),
902
+ }) => {
903
+ const n = y(u), d = y(i);
904
+ return a ?? d ? f("div", null, [n[l]]) : f(At, I({
905
+ value: typeof n[l] == "string" && n[l] ? Number(n[l]) : n[l],
906
+ "onUpdate:value": (o) => {
907
+ n[l] = o;
908
+ },
909
+ showButton: !1,
910
+ clearable: !0,
911
+ style: "width:100%",
912
+ placeholder: `请输入${y(e)}`,
913
+ min: 0
914
+ }, t), {
915
+ ...(t == null ? void 0 : t.slots) || {}
916
+ });
917
+ },
910
918
  uploadFile: ({
911
- key: t,
919
+ key: e,
912
920
  props: l
913
921
  }, {
914
- _value: e
915
- }) => s(mt, I({
916
- multiple: !0,
917
- max: 1,
918
- accept: ".xls,.xlsx",
919
- "file-list": e[t],
920
- "onUpdate:file-list": (r) => e[t] = r
921
- }, l), {
922
- default: () => [s(ht, null, {
923
- default: () => [s("div", {
924
- style: "margin-bottom: 12px"
925
- }, [s(_e, {
926
- size: "48",
927
- depth: 3
928
- }, {
929
- default: () => [s(Y("ArchiveOutline"), null, null)]
930
- })]), s(gt, {
931
- style: "font-size: 16px"
932
- }, {
933
- default: () => [v("点击或者拖动文件到该区域来上传")]
922
+ _value: t
923
+ }) => {
924
+ const a = y(t);
925
+ return f(_t, I({
926
+ multiple: !0,
927
+ max: 1,
928
+ accept: ".xls,.xlsx",
929
+ "file-list": a[e],
930
+ "onUpdate:file-list": (u) => a[e] = u
931
+ }, l), {
932
+ default: () => [f(Ct, null, {
933
+ default: () => [f("div", {
934
+ style: "margin-bottom: 12px"
935
+ }, [f(Ve, {
936
+ size: "48",
937
+ depth: 3
938
+ }, {
939
+ default: () => [f(Bt, null, null)]
940
+ })]), f(Ot, {
941
+ style: "font-size: 16px"
942
+ }, {
943
+ default: () => [Z("点击或者拖动文件到该区域来上传")]
944
+ })]
934
945
  })]
935
- })]
936
- }),
946
+ });
947
+ },
937
948
  dataTable: ({
938
- key: t,
949
+ key: e,
939
950
  loading: l = !1,
940
- props: e,
941
- options: r,
942
- opr: a,
951
+ props: t,
952
+ options: a,
953
+ opr: u,
943
954
  pageState: i
944
955
  }, {
945
956
  _value: n,
946
- _isRead: f
957
+ _isRead: d
947
958
  }) => {
948
- var o;
949
- return console.log(l), console.log(i), s(Jt, I({
950
- data: (o = i == null ? void 0 : i.data) != null && o.length ? i.data : n[t],
951
- columns: g(r),
959
+ var p;
960
+ const o = y(n);
961
+ console.log(l), console.log(i);
962
+ const s = (p = i == null ? void 0 : i.data) != null && p.length ? i.data : o[e], g = Array.isArray(a) ? a : typeof a == "function" ? a(o[e]) : [], w = {
963
+ data: s,
964
+ columns: g,
952
965
  maxHeight: 200,
953
966
  minHeight: 200,
954
- "is-ellipsis": !1,
955
- "opr-columns": a,
956
- loading: i == null ? void 0 : i.loading
957
- }, e), null);
967
+ isEllipsis: !1,
968
+ oprColumns: u,
969
+ loading: i == null ? void 0 : i.loading,
970
+ ...t
971
+ };
972
+ return f(al, w, null);
958
973
  },
959
974
  progress: ({
960
- key: t,
975
+ key: e,
961
976
  props: l
962
977
  }, {
963
- _value: e
964
- }) => s(yt, I({
965
- percentage: e[t]
966
- }, l), null),
967
- line: () => s(dt, null, null),
978
+ _value: t
979
+ }) => {
980
+ const a = y(t);
981
+ return f(wt, I({
982
+ percentage: a[e]
983
+ }, l), null);
984
+ },
985
+ line: () => f(xt, null, null),
968
986
  image: ({
969
- key: t,
987
+ key: e,
970
988
  props: l,
971
- read: e
989
+ read: t
972
990
  }, {
973
- _isRead: r,
974
- _value: a
975
- }) => s(vt, I({
976
- value: a[t],
977
- "onUpdate:value": (i) => a[t] = i,
978
- max: 1
979
- }, l, {
980
- read: e ?? r
981
- }), null),
991
+ _isRead: a,
992
+ _value: u
993
+ }) => {
994
+ const i = y(u), n = y(a);
995
+ return f(il, I({
996
+ value: i[e],
997
+ "onUpdate:value": (d) => i[e] = d,
998
+ max: 1
999
+ }, l, {
1000
+ read: t ?? n
1001
+ }), null);
1002
+ },
982
1003
  button: ({
983
- onClick: t,
1004
+ onClick: e,
984
1005
  props: l,
985
- text: e
1006
+ text: t
986
1007
  }, {
987
- _value: r
988
- }) => s(Q, I({
989
- type: "info"
990
- }, l, {
991
- onClick: () => l != null && l.onClick ? l == null ? void 0 : l.onClick(g(r)) : t(g(r))
992
- }), el(e) ? e : {
993
- default: () => [e]
994
- }),
1008
+ _value: a
1009
+ }) => {
1010
+ const u = y(a);
1011
+ return f(z, I({
1012
+ type: "info"
1013
+ }, l, {
1014
+ onClick: () => l != null && l.onClick ? l == null ? void 0 : l.onClick(u) : e == null ? void 0 : e(u)
1015
+ }), sl(t) ? t : {
1016
+ default: () => [t]
1017
+ });
1018
+ },
995
1019
  switch: ({
996
- key: t,
1020
+ key: e,
997
1021
  props: l,
998
- read: e
1022
+ read: t
999
1023
  }, {
1000
- _isRead: r,
1001
- _value: a
1002
- }) => e ?? r ? s("div", null, [a[t] ? "是" : "否"]) : s(ct, I({
1003
- value: a[t],
1004
- "onUpdate:value": (i) => a[t] = i
1005
- }, l), {
1006
- ...(l == null ? void 0 : l.slots) || {}
1007
- }),
1024
+ _isRead: a,
1025
+ _value: u
1026
+ }) => {
1027
+ const i = y(u), n = y(a);
1028
+ return t ?? n ? f("div", null, [i[e] ? "是" : "否"]) : f(bt, I({
1029
+ value: i[e],
1030
+ "onUpdate:value": (d) => i[e] = d
1031
+ }, l), {
1032
+ ...(l == null ? void 0 : l.slots) || {}
1033
+ });
1034
+ },
1008
1035
  checkbox: ({
1009
- key: t,
1036
+ key: e,
1010
1037
  options: l = [],
1011
- props: e,
1012
- read: r
1038
+ props: t,
1039
+ read: a
1013
1040
  }, {
1014
- _value: a,
1041
+ _value: u,
1015
1042
  _isRead: i,
1016
1043
  labelField: n,
1017
- valueField: f
1044
+ valueField: d
1018
1045
  }) => {
1019
- var o, d, m;
1020
- return r ?? i ? s("div", null, [(m = (d = (o = g(l)) == null ? void 0 : o.filter((h) => {
1021
- var p;
1022
- return (p = g(a)[t]) == null ? void 0 : p.includes(h[(e == null ? void 0 : e.valueField) || f || k]);
1023
- })) == null ? void 0 : d.map((h) => h[[(e == null ? void 0 : e.labelField) || n || j]])) == null ? void 0 : m.join("、")]) : s(st, I({
1024
- value: a[t],
1025
- "onUpdate:value": (h) => a[t] = h,
1046
+ var g, w, p;
1047
+ const o = y(u), s = y(i);
1048
+ return a ?? s ? f("div", null, [(p = (w = (g = Array.isArray(l) ? l : []) == null ? void 0 : g.filter((_) => {
1049
+ var h;
1050
+ return (h = o[e]) == null ? void 0 : h.includes(_[(t == null ? void 0 : t.valueField) || d || T]);
1051
+ })) == null ? void 0 : w.map((_) => _[(t == null ? void 0 : t.labelField) || n || $])) == null ? void 0 : p.join("、")]) : f(ht, I({
1052
+ value: o[e],
1053
+ "onUpdate:value": (_) => o[e] = _,
1026
1054
  style: {
1027
1055
  width: "100%"
1028
1056
  }
1029
- }, e), {
1030
- ...(e == null ? void 0 : e.slots) || {},
1031
- default: () => s(z, (e == null ? void 0 : e.checkBoxProps) || {}, {
1057
+ }, t), {
1058
+ ...(t == null ? void 0 : t.slots) || {},
1059
+ default: () => f(V, (t == null ? void 0 : t.checkBoxProps) || {}, {
1032
1060
  default: () => {
1033
- var h;
1034
- return [(h = g(l)) == null ? void 0 : h.map((p) => s(ft, {
1035
- key: p == null ? void 0 : p[(e == null ? void 0 : e.valueField) || f || k],
1036
- value: p == null ? void 0 : p[(e == null ? void 0 : e.valueField) || f || k]
1061
+ var _;
1062
+ return [(_ = Array.isArray(l) ? l : []) == null ? void 0 : _.map((h) => f(pt, {
1063
+ key: h == null ? void 0 : h[(t == null ? void 0 : t.valueField) || d || T],
1064
+ value: h == null ? void 0 : h[(t == null ? void 0 : t.valueField) || d || T]
1037
1065
  }, {
1038
- default: () => [p == null ? void 0 : p[(e == null ? void 0 : e.labelField) || n || j]]
1066
+ default: () => [h == null ? void 0 : h[(t == null ? void 0 : t.labelField) || n || $]]
1039
1067
  }))];
1040
1068
  }
1041
1069
  })
1042
1070
  });
1043
1071
  },
1044
1072
  filterList: ({
1045
- key: t,
1073
+ key: e,
1046
1074
  props: l,
1047
- options: e
1075
+ options: t
1048
1076
  }, {
1049
- _value: r
1050
- }) => s(Y("FilterSelect"), I({
1051
- value: r[t],
1052
- "onUpdate:value": (a) => r[t] = a,
1053
- option: e,
1054
- clearable: !0,
1055
- filterButtonKey: ["all", "selectDefault"]
1056
- }, l), null)
1077
+ _value: a
1078
+ }) => (y(a), f("div", null, [Z("FilterSelect 组件需要外部提供")]))
1057
1079
  };
1058
- let G = {};
1059
- class ll {
1080
+ let J = {};
1081
+ class cl {
1060
1082
  constructor() {
1061
- ce(this, "defaultMap", null);
1062
- ce(this, "extendOptions", null);
1083
+ de(this, "defaultMap", null);
1084
+ de(this, "extendOptions", null);
1063
1085
  console.log("DefaultOptions init"), this.defaultMap = null, this.init();
1064
1086
  }
1065
- set(l, e) {
1066
- this.options.set(l, e);
1087
+ set(l, t) {
1088
+ this.defaultMap && this.defaultMap.set(l, t);
1067
1089
  }
1068
1090
  get(l) {
1069
- return this.options.get(l);
1091
+ if (this.defaultMap)
1092
+ return this.defaultMap.get(l);
1070
1093
  }
1071
1094
  clear() {
1072
- this.defaultMap.clear();
1095
+ var l;
1096
+ (l = this.defaultMap) == null || l.clear();
1073
1097
  }
1074
- setupOptions(l, e) {
1075
- const r = this.defaultMap.size > 0 ? [...this.defaultMap.keys()] : [];
1076
- if (this.defaultMap.has(l)) return console.error(`${l} 已存在,不能使用${r == null ? void 0 : r.join("、")}`);
1077
- this.defaultMap.set(l, e);
1098
+ setupOptions(l, t) {
1099
+ if (!this.defaultMap) return;
1100
+ const a = this.defaultMap.size > 0 ? [...this.defaultMap.keys()] : [];
1101
+ if (this.defaultMap.has(l)) return console.error(`${l} 已存在,不能使用${a == null ? void 0 : a.join("、")}`);
1102
+ this.defaultMap.set(l, t);
1078
1103
  }
1079
- setupExtendOptions(l, e) {
1080
- G || (G = {}), G != null && G[l] || (G[l] = e);
1104
+ setupExtendOptions(l, t) {
1105
+ J || (J = {}), J != null && J[l] || (J[l] = t);
1081
1106
  }
1082
1107
  getAllOptions() {
1108
+ var t;
1083
1109
  const l = {};
1084
- return this.defaultMap.forEach((e, r) => {
1085
- l[r] = e;
1110
+ return (t = this.defaultMap) == null || t.forEach((a, u) => {
1111
+ l[u] = a;
1086
1112
  }), l;
1087
1113
  }
1088
1114
  getOptions(l = []) {
1089
- return console.log("getOptions", this.defaultMap), l.reduce((r, a) => (this.defaultMap.has(a) && (r[a] = this.defaultMap.get(a)), r), {});
1115
+ console.log("getOptions", this.defaultMap);
1116
+ const t = {};
1117
+ return l.forEach((a) => {
1118
+ var u;
1119
+ (u = this.defaultMap) != null && u.has(a) && (t[a] = this.defaultMap.get(a));
1120
+ }), t;
1090
1121
  }
1091
- initOptions(l = []) {
1092
- Object.keys(l).forEach((e) => {
1093
- this.setupOptions(e, l[e]);
1122
+ initOptions(l = {}) {
1123
+ Object.keys(l).forEach((t) => {
1124
+ this.setupOptions(t, l[t]);
1094
1125
  });
1095
1126
  }
1096
1127
  initSetup(l) {
1097
- this.defaultMap && this.clear(), this.defaultMap = /* @__PURE__ */ new Map(), this.initOptions(tl), l && l(), this.initOptions(G);
1128
+ this.defaultMap && this.clear(), this.defaultMap = /* @__PURE__ */ new Map(), this.initOptions(fl), l && l(), this.initOptions(J);
1098
1129
  }
1099
1130
  init(l) {
1100
1131
  this.initSetup(l);
1101
1132
  }
1102
1133
  }
1103
- const Ce = new ll(), Ve = (...t) => Ce.getOptions(...t);
1104
- function El(...t) {
1105
- return Ce.getAllOptions(...t);
1134
+ const Ae = new cl(), je = (e = []) => Ae.getOptions(e);
1135
+ function vl() {
1136
+ return Ae.getAllOptions();
1106
1137
  }
1107
- function Bl(...t) {
1108
- return Ce.setupExtendOptions(...t);
1138
+ function Ll(e, l) {
1139
+ return Ae.setupExtendOptions(e, l);
1109
1140
  }
1110
- const nl = ["xlink:href", "fill"], al = /* @__PURE__ */ re({
1141
+ const dl = ["xlink:href", "fill"], yl = /* @__PURE__ */ j({
1111
1142
  __name: "SvgIcon",
1112
1143
  props: {
1113
1144
  name: {
@@ -1119,179 +1150,175 @@ const nl = ["xlink:href", "fill"], al = /* @__PURE__ */ re({
1119
1150
  default: ""
1120
1151
  }
1121
1152
  },
1122
- setup(t) {
1123
- const l = t, e = _(() => `#svg-${l.name}`);
1124
- return (r, a) => (T(), le("svg", I({ class: "svg-icon" }, r.$attrs, {
1125
- style: { color: t.color },
1153
+ setup(e) {
1154
+ const l = e, t = Y(() => `#svg-${l.name}`);
1155
+ return (a, u) => (B(), ne("svg", I({ class: "svg-icon" }, a.$attrs, {
1156
+ style: { color: e.color },
1126
1157
  "aria-hidden": ""
1127
1158
  }), [
1128
- we("use", {
1129
- "xlink:href": e.value,
1130
- fill: t.color
1131
- }, null, 8, nl)
1159
+ _e("use", {
1160
+ "xlink:href": t.value,
1161
+ fill: e.color
1162
+ }, null, 8, dl)
1132
1163
  ], 16));
1133
1164
  }
1134
- }), rl = /* @__PURE__ */ ue(al, [["__scopeId", "data-v-9dbe5f10"]]);
1135
- function ul(t) {
1136
- return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !te(t);
1165
+ }), gl = /* @__PURE__ */ oe(yl, [["__scopeId", "data-v-9dbe5f10"]]);
1166
+ function ml(e) {
1167
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !le(e);
1137
1168
  }
1138
- const il = /* @__PURE__ */ re((t, {
1169
+ const hl = /* @__PURE__ */ j((e, {
1139
1170
  emit: l
1140
1171
  }) => {
1141
- var S;
1142
- const e = oe();
1143
- if ((S = e == null ? void 0 : e.appContext) != null && S.app)
1144
- X(e.appContext.app);
1172
+ var N;
1173
+ const t = re();
1174
+ if ((N = t == null ? void 0 : t.appContext) != null && N.app)
1175
+ ee(t.appContext.app);
1145
1176
  else {
1146
- const u = Ht();
1147
- u && X(u);
1177
+ const r = ll();
1178
+ r && ee(r);
1148
1179
  }
1149
- const r = P(t.value), a = _(() => t.read || !1);
1150
- let i = t.formRef;
1151
- ee(() => t.formRef, (u) => i = u);
1152
- const n = _(() => t.option);
1153
- function f(u) {
1154
- return u.reduce((w, c) => {
1155
- w.push((c == null ? void 0 : c.way) ?? "input");
1156
- const x = [c == null ? void 0 : c.default, c == null ? void 0 : c.suffix, c == null ? void 0 : c.prefix].reduce((y, b) => {
1180
+ const a = P(e.value || {}), u = Y(() => e.read || !1);
1181
+ let i = e.formRef;
1182
+ te(() => e.formRef, (r) => i = r);
1183
+ const n = Y(() => e.option || []);
1184
+ function d(r) {
1185
+ return r.reduce((A, m) => {
1186
+ A.push((m == null ? void 0 : m.way) ?? "input");
1187
+ const x = [m == null ? void 0 : m.default, m == null ? void 0 : m.suffix, m == null ? void 0 : m.prefix].reduce((b, c) => {
1157
1188
  var C;
1158
- return Array.isArray(b) ? y = y.concat(b) : b && ((C = Object.keys(b)) != null && C.length) && y.push(b), y;
1189
+ return Array.isArray(c) ? b = b.concat(c) : c && ((C = Object.keys(c)) != null && C.length) && b.push(c), b;
1159
1190
  }, []);
1160
- return console.log(x), x.length && x.forEach((y) => w.push((y == null ? void 0 : y.way) ?? "input")), w;
1191
+ return console.log(x), x.length && x.forEach((b) => A.push((b == null ? void 0 : b.way) ?? "input")), A;
1161
1192
  }, []);
1162
1193
  }
1163
- const o = _(() => [...new Set(f(t.option))]), d = Ve(o.value);
1164
- console.log(t.option), console.log("defaultOption", d, o.value), ee(() => r.value, (u) => {
1165
- l("update:value", u);
1194
+ const o = Y(() => [...new Set(d(e.option || []))]), s = je(o.value);
1195
+ console.log(e.option), console.log("defaultOption", s, o.value), te(() => a.value, (r) => {
1196
+ l("update:value", r);
1166
1197
  }, {
1167
1198
  immediate: !0
1168
1199
  });
1169
- function m(u) {
1170
- let w = {};
1171
- const c = typeof u;
1172
- let x = null;
1200
+ function g(r, A) {
1201
+ let m = {};
1202
+ const x = typeof r;
1203
+ let b = null;
1173
1204
  try {
1174
- return u ? c === "string" || c === "object" ? x = u : c === "function" && (x = u(g(r), {
1205
+ return r ? x === "string" || x === "object" ? b = r : x === "function" && (b = r(y(a), {
1175
1206
  formRef: i,
1176
1207
  resetForm: () => {
1177
- var y;
1178
- return (y = i == null ? void 0 : i.value) == null ? void 0 : y.restoreValidation();
1208
+ var c;
1209
+ return (c = i == null ? void 0 : i.value) == null ? void 0 : c.restoreValidation();
1210
+ },
1211
+ close: () => {
1212
+ var c;
1213
+ return (c = e.cancel) == null ? void 0 : c.call(e);
1179
1214
  },
1180
- close: () => t.cancel(),
1181
- setValue: h
1182
- })) : x = u, typeof x == "object" && !Array.isArray(x) ? Object.keys(x).forEach((y) => {
1183
- const b = x[y];
1184
- lt(b) ? w[y] = g(b) : w[y] = b;
1185
- }) : w = x, w;
1215
+ setValue: w
1216
+ })) : b = r, typeof b == "object" && !Array.isArray(b) ? Object.keys(b).forEach((c) => {
1217
+ const C = b[c];
1218
+ it(C) ? m[c] = y(C) : m[c] = C;
1219
+ }) : m = b, m;
1186
1220
  } catch {
1187
1221
  return {};
1188
1222
  }
1189
1223
  }
1190
- ee(() => t.value, (u) => {
1191
- console.log(u), r.value = u;
1224
+ te(() => e.value, (r) => {
1225
+ console.log(r), a.value = r || {};
1192
1226
  }, {
1193
1227
  immediate: !0
1194
1228
  });
1195
- function h(u) {
1196
- r.value = u;
1229
+ function w(r) {
1230
+ a.value = r;
1197
1231
  }
1198
- function p(u) {
1199
- return s(z, I({
1232
+ function p(r) {
1233
+ return f(V, I({
1200
1234
  "wrap-item": !1,
1201
- wrap: !!(u != null && u.isWrap),
1235
+ wrap: !!(r != null && r.isWrap),
1202
1236
  align: "center",
1203
1237
  style: {
1204
1238
  width: "100%"
1205
1239
  }
1206
- }, (u == null ? void 0 : u.contentProps) || {}), {
1207
- default: () => [A(u == null ? void 0 : u.prefix), A((u == null ? void 0 : u.default) || u), A(u == null ? void 0 : u.suffix)]
1240
+ }, (r == null ? void 0 : r.contentProps) || {}), {
1241
+ default: () => [_(r == null ? void 0 : r.prefix), _((r == null ? void 0 : r.default) || r), _(r == null ? void 0 : r.suffix)]
1208
1242
  });
1209
1243
  }
1210
- function A(u) {
1211
- if (!u) return;
1212
- let w = u;
1213
- if (typeof u == "function" && (w = m(u)), w = m(w), te(w))
1214
- return console.log("??? isVNode"), w;
1215
- if (typeof w == "string")
1216
- return console.log("??? string"), w;
1217
- if (Array.isArray(w))
1218
- return console.log("???"), s(ae, null, [w.map((c, x) => s(M, {
1219
- item: c,
1220
- index: x
1221
- }, null))]);
1222
- if (typeof w == "object")
1223
- return console.log("??? object"), w.props = m((w == null ? void 0 : w.props) ?? {}), g(_(() => {
1224
- var c;
1225
- return (c = d == null ? void 0 : d[(w == null ? void 0 : w.way) || "input"]) == null ? void 0 : c.call(d, D(w), {
1226
- _value: w != null && w.queryType ? g(r)[w == null ? void 0 : w.queryType] : g(r),
1227
- _formRef: g(i),
1228
- _isRead: g(a),
1229
- labelField: j,
1230
- valueField: k
1231
- });
1232
- }));
1244
+ function _(r) {
1245
+ if (!r) return;
1246
+ let A = r;
1247
+ return typeof r == "function" && (A = g(r)), A = g(A), le(A) ? (console.log("??? isVNode"), A) : typeof A == "string" ? (console.log("??? string"), A) : Array.isArray(A) ? (console.log("???"), f(ue, null, [A.map((m, x) => f(M, {
1248
+ item: m,
1249
+ index: x
1250
+ }, null))])) : typeof A == "object" ? (console.log("??? object"), A.props = g((A == null ? void 0 : A.props) ?? {}), y(Y(() => {
1251
+ var m;
1252
+ return (m = s == null ? void 0 : s[(A == null ? void 0 : A.way) || "input"]) == null ? void 0 : m.call(s, h(A), {
1253
+ _value: A != null && A.queryType ? y(a)[A == null ? void 0 : A.queryType] : y(a),
1254
+ _formRef: y(i),
1255
+ _isRead: y(u),
1256
+ labelField: $,
1257
+ valueField: T
1258
+ });
1259
+ }))) : null;
1233
1260
  }
1234
- function D(u) {
1235
- return g(u.enum) && (u.options = ke(g(u.enum))), u;
1261
+ function h(r) {
1262
+ return y(r.enum) && (r.options = We(y(r.enum))), r;
1236
1263
  }
1237
1264
  function M({
1238
- item: u,
1239
- index: w
1265
+ item: r,
1266
+ index: A
1240
1267
  }) {
1241
- var c, x, y, b, C, $;
1242
- return u.formItemProps = m(u == null ? void 0 : u.formItemProps), u.formItemProps || (u.formItemProps = {}), !((c = u == null ? void 0 : u.formItemProps) != null && c.labelWidth) && ((x = t.formProps) != null && x.labelWidth) && (u.formItemProps.labelWidth = (y = t.formProps) == null ? void 0 : y.labelWidth), et(s(Nt, I({
1243
- key: w,
1244
- showLabel: !(u != null && u.noLabel)
1245
- }, u == null ? void 0 : u.formItemProps, {
1246
- labelWidth: ((b = u == null ? void 0 : u.formItemProps) == null ? void 0 : b.labelWidth) || "auto",
1247
- feedback: m((C = u == null ? void 0 : u.formItemProps) == null ? void 0 : C.feedback),
1268
+ var m, x, b, c, C, U;
1269
+ return r.formItemProps = g(r == null ? void 0 : r.formItemProps), r.formItemProps || (r.formItemProps = {}), !((m = r.formItemProps) != null && m.labelWidth) && ((x = e.formProps) != null && x.labelWidth) && (r.formItemProps.labelWidth = (b = e.formProps) == null ? void 0 : b.labelWidth), rt(f(Ft, I({
1270
+ key: A,
1271
+ showLabel: !(r != null && r.noLabel)
1272
+ }, r == null ? void 0 : r.formItemProps, {
1273
+ labelWidth: ((c = r == null ? void 0 : r.formItemProps) == null ? void 0 : c.labelWidth) || "auto",
1274
+ feedback: g((C = r == null ? void 0 : r.formItemProps) == null ? void 0 : C.feedback),
1248
1275
  style: {
1249
1276
  padding: "0 15px",
1250
1277
  boxSizing: "border-box",
1251
1278
  width: "100%",
1252
- ...(($ = u == null ? void 0 : u.formItemProps) == null ? void 0 : $.style) || {}
1279
+ ...((U = r == null ? void 0 : r.formItemProps) == null ? void 0 : U.style) || {}
1253
1280
  },
1254
- path: String(u.key)
1281
+ path: String(r.key)
1255
1282
  }), {
1256
- default: () => p(u),
1283
+ default: () => p(r),
1257
1284
  label: () => {
1258
- var B, q;
1259
- return s("div", {
1260
- class: u != null && u.labelClass || u != null && u.labelSuffix ? ` ${u == null ? void 0 : u.labelClass} flex items-center gap-col-9px` : ""
1261
- }, [u != null && u.labelSuffix ? typeof (u == null ? void 0 : u.labelSuffix) == "string" ? s(_e, {
1285
+ var E, R;
1286
+ return f("div", {
1287
+ class: r != null && r.labelClass || r != null && r.labelSuffix ? ` ${r == null ? void 0 : r.labelClass} flex items-center gap-col-9px` : ""
1288
+ }, [r != null && r.labelSuffix ? typeof (r == null ? void 0 : r.labelSuffix) == "string" ? f(Ve, {
1262
1289
  class: "wh-20px c-inherit",
1263
- ...u == null ? void 0 : u.labelSuffixProps
1290
+ ...r == null ? void 0 : r.labelSuffixProps
1264
1291
  }, {
1265
- default: () => [s(rl, {
1266
- name: u == null ? void 0 : u.labelSuffix
1292
+ default: () => [f(gl, {
1293
+ name: r == null ? void 0 : r.labelSuffix
1267
1294
  }, null)]
1268
- }) : (B = u == null ? void 0 : u.labelSuffix) == null ? void 0 : B.call(u) : s(ae, null, null), `${g(typeof (u == null ? void 0 : u[t.labelField]) == "function" ? (q = u == null ? void 0 : u[t.labelField]) == null ? void 0 : q.call(u) : u == null ? void 0 : u[t.labelField]) || ""} ${a.value || u.read, " "}
1295
+ }) : (E = r == null ? void 0 : r.labelSuffix) == null ? void 0 : E.call(r) : f(ue, null, null), `${y(typeof (r == null ? void 0 : r[e.labelField || "label"]) == "function" ? (R = r == null ? void 0 : r[e.labelField || "label"]) == null ? void 0 : R.call(r) : r == null ? void 0 : r[e.labelField || "label"]) || ""} ${u.value || r.read, " "}
1269
1296
  `]);
1270
1297
  }
1271
- }), [[tt("corePermission"), u == null ? void 0 : u.permission]]);
1298
+ }), [[ot("corePermission"), r == null ? void 0 : r.permission]]);
1272
1299
  }
1273
1300
  return () => {
1274
- let u;
1275
- return s(z, {
1301
+ let r;
1302
+ return f(V, {
1276
1303
  "wrap-item": !1,
1277
1304
  size: [0, 8],
1278
1305
  style: {
1279
1306
  width: "100%",
1280
1307
  minHeight: "100%",
1281
1308
  alignContent: "baseline",
1282
- ...t.style
1309
+ ...e.style
1283
1310
  }
1284
- }, ul(u = n.value.map(({
1285
- isRender: w = !0,
1286
- ...c
1287
- }, x) => (typeof g(w) != "boolean" ? w != null && w(g(r)) : g(w)) ? c != null && c.render ? c == null ? void 0 : c.render(g(r), x, {
1288
- setValue: h,
1289
- value: g(r)
1290
- }) : s(M, {
1291
- item: c,
1311
+ }, ml(r = n.value.map(({
1312
+ isRender: A = !0,
1313
+ ...m
1314
+ }, x) => (typeof y(A) != "boolean" ? A != null && A(y(a)) : y(A)) ? m != null && m.render ? m == null ? void 0 : m.render(y(a), x, {
1315
+ setValue: w,
1316
+ value: y(a)
1317
+ }) : f(M, {
1318
+ item: m,
1292
1319
  index: x
1293
- }, null) : null)) ? u : {
1294
- default: () => [u]
1320
+ }, null) : null)) ? r : {
1321
+ default: () => [r]
1295
1322
  });
1296
1323
  };
1297
1324
  }, {
@@ -1310,11 +1337,11 @@ const il = /* @__PURE__ */ re((t, {
1310
1337
  },
1311
1338
  labelField: {
1312
1339
  type: String,
1313
- default: () => j
1340
+ default: () => $
1314
1341
  },
1315
1342
  valueField: {
1316
1343
  type: String,
1317
- default: () => k
1344
+ default: () => T
1318
1345
  },
1319
1346
  style: {
1320
1347
  type: Object,
@@ -1330,86 +1357,60 @@ const il = /* @__PURE__ */ re((t, {
1330
1357
  }
1331
1358
  },
1332
1359
  emits: ["update:value"]
1333
- }), ol = {
1360
+ }), pl = {
1334
1361
  showIcon: !1,
1335
1362
  autoFocus: !1
1336
1363
  };
1337
- function sl({
1338
- options: t = [],
1364
+ function bl({
1365
+ options: e = [],
1339
1366
  model: l,
1340
- labelField: e = "label",
1341
- formOpr: r = {}
1367
+ labelField: t = "label",
1368
+ formOpr: a = {}
1342
1369
  }) {
1343
- return _(
1344
- () => (t == null ? void 0 : t.reduce((a, { fields: i, ...n }) => {
1345
- var o, d;
1346
- Array.isArray(n == null ? void 0 : n.key) && n.key.forEach((m) => {
1347
- n != null && n.required && (a[String(m)] = {
1348
- key: m,
1370
+ return Y(
1371
+ () => (e == null ? void 0 : e.reduce((u, { fields: i, ...n }) => {
1372
+ var o, s;
1373
+ Array.isArray(n == null ? void 0 : n.key) && n.key.forEach((g) => {
1374
+ n != null && n.required && (u[String(g)] = {
1375
+ key: g,
1349
1376
  type: "any",
1350
- required: n != null && n.required ? typeof (n == null ? void 0 : n.required) == "function" ? n == null ? void 0 : n.required(g(l), { ...r }) : n == null ? void 0 : n.required : !1,
1351
- message: (n == null ? void 0 : n.message) || `请选择${n == null ? void 0 : n[e]}`,
1377
+ required: n != null && n.required ? typeof (n == null ? void 0 : n.required) == "function" ? n == null ? void 0 : n.required(y(l), { ...a }) : n == null ? void 0 : n.required : !1,
1378
+ message: (n == null ? void 0 : n.message) || `请选择${n == null ? void 0 : n[t]}`,
1352
1379
  fields: i
1353
1380
  });
1354
1381
  });
1355
- const f = n != null && n.rule ? typeof (n == null ? void 0 : n.rule) != "function" ? n == null ? void 0 : n.rule : n == null ? void 0 : n.rule(g(l), { ...r }) : i ? {
1382
+ const d = n != null && n.rule ? typeof (n == null ? void 0 : n.rule) != "function" ? n == null ? void 0 : n.rule : n == null ? void 0 : n.rule(y(l), { ...a }) : i ? {
1356
1383
  key: n == null ? void 0 : n.key,
1357
1384
  type: "any",
1358
- required: n != null && n.required ? typeof (n == null ? void 0 : n.required) == "function" ? n == null ? void 0 : n.required(g(l), { ...r }) : n == null ? void 0 : n.required : !1,
1359
- message: (n == null ? void 0 : n.message) || `请${(o = n == null ? void 0 : n.options) != null && o.length ? "选择" : "输入"}${n == null ? void 0 : n[e]}`,
1385
+ required: n != null && n.required ? typeof (n == null ? void 0 : n.required) == "function" ? n == null ? void 0 : n.required(y(l), { ...a }) : n == null ? void 0 : n.required : !1,
1386
+ message: (n == null ? void 0 : n.message) || `请${(o = n == null ? void 0 : n.options) != null && o.length ? "选择" : "输入"}${n == null ? void 0 : n[t]}`,
1360
1387
  fields: i
1361
1388
  } : {
1362
1389
  key: n == null ? void 0 : n.key,
1363
1390
  type: "any",
1364
- required: n != null && n.required ? typeof (n == null ? void 0 : n.required) == "function" ? n == null ? void 0 : n.required(g(l), { ...r }) : n == null ? void 0 : n.required : !1,
1365
- message: (n == null ? void 0 : n.message) || `请${(d = n == null ? void 0 : n.options) != null && d.length ? "选择" : "输入"}${n == null ? void 0 : n[e]}`,
1391
+ required: n != null && n.required ? typeof (n == null ? void 0 : n.required) == "function" ? n == null ? void 0 : n.required(y(l), { ...a }) : n == null ? void 0 : n.required : !1,
1392
+ message: (n == null ? void 0 : n.message) || `请${(s = n == null ? void 0 : n.options) != null && s.length ? "选择" : "输入"}${n == null ? void 0 : n[t]}`,
1366
1393
  ...Array.isArray(n == null ? void 0 : n.key) ? {
1367
- validator: (m) => (console.log(m), !(n == null ? void 0 : n.key.every((p) => g(l)[p])) && (n != null && n.required) ? new Error(m == null ? void 0 : m.message) : !0)
1394
+ validator: (g) => (console.log(g), !(n == null ? void 0 : n.key.every((p) => y(l)[p])) && (n != null && n.required) ? new Error(g == null ? void 0 : g.message) : !0)
1368
1395
  } : {}
1369
1396
  };
1370
- return f != null && f.required && (a[String(n == null ? void 0 : n.key)] = f), a;
1397
+ return d != null && d.required && (u[String(n == null ? void 0 : n.key)] = d), u;
1371
1398
  }, {})) || {}
1372
1399
  );
1373
1400
  }
1374
- const ze = {
1401
+ const Ge = /* @__PURE__ */ j({
1375
1402
  __name: "DataForm",
1376
- props: /* @__PURE__ */ pe({
1377
- isNo: {
1378
- type: Boolean,
1379
- default: () => !0
1380
- },
1381
- read: {
1382
- type: Boolean,
1383
- default: () => !1
1384
- },
1385
- labelField: {
1386
- type: String,
1387
- default: () => "label"
1388
- },
1389
- contentStyle: {
1390
- type: Object,
1391
- default: () => ({})
1392
- },
1393
- options: {
1394
- type: Array,
1395
- default: () => []
1396
- },
1397
- rules: {
1398
- type: Object,
1399
- default: () => ({})
1400
- },
1401
- formProps: {
1402
- type: Object,
1403
- default: () => ({})
1404
- },
1405
- formItemProps: {
1406
- type: Object,
1407
- default: () => ({})
1408
- },
1409
- dialog: {
1410
- type: Boolean,
1411
- default: () => !1
1412
- }
1403
+ props: /* @__PURE__ */ xe({
1404
+ value: {},
1405
+ options: { default: () => [] },
1406
+ isNo: { type: Boolean, default: !0 },
1407
+ read: { type: Boolean, default: !1 },
1408
+ labelField: { default: "label" },
1409
+ contentStyle: { default: () => ({}) },
1410
+ rules: { default: () => ({}) },
1411
+ formProps: { default: () => ({}) },
1412
+ formItemProps: { default: () => ({}) },
1413
+ dialog: { type: Boolean, default: !1 }
1413
1414
  }, {
1414
1415
  value: {
1415
1416
  type: Object,
@@ -1418,103 +1419,105 @@ const ze = {
1418
1419
  valueModifiers: {}
1419
1420
  }),
1420
1421
  emits: ["update:value"],
1421
- setup(t, { expose: l }) {
1422
+ setup(e, { expose: l }) {
1422
1423
  var o;
1423
- const e = oe();
1424
- (o = e == null ? void 0 : e.appContext) != null && o.app && X(e.appContext.app);
1425
- const r = t, a = _(() => r.options), i = P(), n = Ye(t, "value"), f = _(() => g(
1426
- a.value ? sl({
1427
- options: a.value,
1424
+ const t = re();
1425
+ (o = t == null ? void 0 : t.appContext) != null && o.app && ee(t.appContext.app);
1426
+ const a = e, u = Y(() => a.options), i = P(), n = Le(e, "value"), d = Y(() => y(
1427
+ u.value ? bl({
1428
+ options: u.value,
1428
1429
  model: n,
1429
- labelField: r.labelField,
1430
+ labelField: a.labelField,
1430
1431
  formOpr: { formRef: i }
1431
1432
  }) : {}
1432
1433
  ));
1433
- return console.log(f.value), l({
1434
+ return console.log(d.value), l({
1434
1435
  formRef: i,
1435
- getRule: () => f.value,
1436
- valid: (d = []) => (console.log("?? valid", d), new Promise((m, h) => {
1437
- var A;
1438
- const p = Oe(d);
1439
- (A = i.value) == null || A.validate((D) => {
1440
- if (D) return h(D);
1441
- m();
1442
- }, (D) => p.length ? p.includes(D == null ? void 0 : D.key) : !0);
1436
+ getRule: () => d.value,
1437
+ valid: (s = []) => (console.log("?? valid", s), new Promise((g, w) => {
1438
+ var _;
1439
+ const p = Oe(s);
1440
+ (_ = i.value) == null || _.validate((h) => {
1441
+ if (h) return w(h);
1442
+ g();
1443
+ }, (h) => p.length ? p.includes(h == null ? void 0 : h.key) : !0);
1443
1444
  })),
1444
- confirm: (d) => new Promise((m, h) => {
1445
+ confirm: (s) => new Promise((g, w) => {
1445
1446
  var p;
1446
- (p = i.value) == null || p.validate((A) => {
1447
- if (A) return h(A);
1448
- d && d(g(n)), m(g(n));
1447
+ (p = i.value) == null || p.validate((_) => {
1448
+ if (_) return w(_);
1449
+ s && s(y(n)), g(y(n));
1449
1450
  });
1450
1451
  })
1451
- }), (d, m) => (T(), H(g(Dt), I({
1452
+ }), (s, g) => (B(), K(y(Ut), I({
1452
1453
  ref_key: "formRef",
1453
1454
  ref: i,
1454
1455
  model: n.value,
1455
- rules: r.read ? {} : g(f),
1456
+ rules: a.read ? {} : d.value,
1456
1457
  "label-placement": "left",
1457
1458
  "label-width": "100px",
1458
1459
  "require-mark-placement": "right-hanging",
1459
- class: r.dialog ? r.read ? "core-dialog-content" : "core-dialog-main" : "",
1460
- style: { minHeight: r.isNo ? "unset" : null }
1461
- }, r.formProps), {
1462
- default: R(() => [
1463
- s(g(il), {
1460
+ class: a.dialog ? a.read ? "core-dialog-content" : "core-dialog-main" : "",
1461
+ style: { minHeight: a.isNo ? "unset" : null }
1462
+ }, a.formProps), {
1463
+ default: v(() => [
1464
+ f(y(hl), {
1464
1465
  value: n.value,
1465
- "onUpdate:value": m[0] || (m[0] = (h) => n.value = h),
1466
+ "onUpdate:value": g[0] || (g[0] = (w) => n.value = w),
1466
1467
  "form-ref": i.value,
1467
- option: r.options,
1468
- "label-field": r.labelField,
1469
- read: r.read,
1470
- style: Te(r.contentStyle),
1471
- "form-props": r.formProps
1468
+ option: a.options,
1469
+ "label-field": a.labelField,
1470
+ read: a.read,
1471
+ style: ve(a.contentStyle),
1472
+ "form-props": a.formProps
1472
1473
  }, null, 8, ["value", "form-ref", "option", "label-field", "read", "style", "form-props"])
1473
1474
  ]),
1474
1475
  _: 1
1475
1476
  }, 16, ["model", "rules", "class", "style"]));
1476
1477
  }
1477
- };
1478
- function fl(t) {
1479
- return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !te(t);
1478
+ });
1479
+ function xl(e) {
1480
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !le(e);
1480
1481
  }
1481
- let Z = typeof $dialog < "u" ? $dialog : null, de = null;
1482
- function cl() {
1483
- if (Z) return Z;
1482
+ let H = null, ge = null;
1483
+ function wl() {
1484
+ if (H) return H;
1485
+ if (typeof $dialog < "u" && $dialog)
1486
+ return H = $dialog, H;
1484
1487
  try {
1485
- const t = xe();
1486
- if (t)
1487
- return Z = t, Z;
1488
+ const e = Ce();
1489
+ if (e)
1490
+ return H = e, H;
1488
1491
  } catch {
1489
1492
  }
1490
- if (!de) {
1493
+ if (!ge) {
1491
1494
  const {
1492
- dialog: t
1493
- } = At(["dialog"]);
1494
- de = {
1495
- dialog: t
1495
+ dialog: e
1496
+ } = Pt(["dialog"]);
1497
+ ge = {
1498
+ dialog: e
1496
1499
  };
1497
1500
  }
1498
- return Z = de.dialog, Z;
1501
+ return H = ge.dialog, H;
1499
1502
  }
1500
- function Ke({
1501
- title: t = "",
1503
+ function Je({
1504
+ title: e = "",
1502
1505
  noTitle: l = !1,
1503
- titleFull: e = null,
1504
- options: r = [],
1505
- mode: a = "add",
1506
+ titleFull: t = null,
1507
+ options: a = [],
1508
+ mode: u = "add",
1506
1509
  modeEnum: i = {},
1507
1510
  labelField: n = "label",
1508
- isNo: f = !0,
1511
+ isNo: d = !0,
1509
1512
  formProps: o = {},
1510
- interfaceFn: d = null,
1511
- interfaceFnCancel: m = null,
1512
- valueData: h,
1513
+ interfaceFn: s = null,
1514
+ interfaceFnCancel: g = null,
1515
+ valueData: w,
1513
1516
  read: p,
1514
- isRead: A,
1515
- action: D = null,
1517
+ isRead: _,
1518
+ action: h = null,
1516
1519
  contentStyle: M = {},
1517
- actionProps: S = {}
1520
+ actionProps: N = {}
1518
1521
  } = {
1519
1522
  title: "自定义弹窗",
1520
1523
  noTitle: !1,
@@ -1523,9 +1526,9 @@ function Ke({
1523
1526
  read: !1,
1524
1527
  isRead: !1,
1525
1528
  valueData: {}
1526
- }, u = null) {
1527
- var ie;
1528
- const w = cl(), c = {
1529
+ }, r = null) {
1530
+ var De;
1531
+ const A = wl(), m = {
1529
1532
  none: {
1530
1533
  sub: "",
1531
1534
  read: !1
@@ -1563,192 +1566,186 @@ function Ke({
1563
1566
  read: !1
1564
1567
  },
1565
1568
  ...i
1566
- }, x = P(), y = nt([]), b = P({
1567
- ...h
1569
+ }, x = P(), b = st([]), c = P({
1570
+ ...w
1568
1571
  }), C = {
1569
1572
  justify: "end",
1570
1573
  wrapItem: !1,
1571
1574
  style: {
1572
1575
  width: "100%"
1573
1576
  }
1574
- }, $ = {
1577
+ }, U = {
1575
1578
  width: "120px"
1576
- }, B = [{
1579
+ }, E = [{
1577
1580
  label: "取消",
1578
1581
  props: {
1579
1582
  type: "primary",
1580
1583
  ghost: !0
1581
1584
  },
1582
1585
  onClick: ({
1583
- cancel: F
1586
+ cancel: S
1584
1587
  }) => {
1585
- m ? m(g(b), {
1586
- close: F
1587
- }) : F();
1588
+ g ? g(y(c), {
1589
+ close: S
1590
+ }) : S();
1588
1591
  }
1589
1592
  }, {
1590
1593
  label: "确定",
1591
1594
  valid: !0,
1592
1595
  onClick: async ({
1593
- cancel: F,
1596
+ cancel: S,
1594
1597
  hideLoading: O
1595
- }) => d ? await d(g(b), {
1596
- close: F,
1598
+ }) => s ? await s(y(c), {
1599
+ close: S,
1597
1600
  hideLoading: O
1598
- }) : F()
1601
+ }) : S()
1599
1602
  }];
1600
- D || B.forEach((F, O) => {
1601
- y[O] = !1;
1603
+ (Array.isArray(h) ? h : E).forEach((S, O) => {
1604
+ b[O] = !1;
1602
1605
  });
1603
- const q = typeof e == "function" ? () => {
1604
- var F;
1605
- return e((F = c[a]) == null ? void 0 : F.sub);
1606
- } : e, N = w.create({
1606
+ const R = typeof t == "function" ? () => {
1607
+ var S;
1608
+ return t(((S = m[u]) == null ? void 0 : S.sub) || "");
1609
+ } : t, D = P();
1610
+ function F() {
1611
+ var S;
1612
+ console.log("取消", c.value), (S = D.value) == null || S.destroy();
1613
+ }
1614
+ async function G(S = []) {
1615
+ var O;
1616
+ console.log("开启验证"), await ((O = x.value) == null ? void 0 : O.valid());
1617
+ }
1618
+ async function k(S) {
1619
+ return S && S();
1620
+ }
1621
+ const ie = p ?? _ ? null : typeof h == "function" ? () => h({
1622
+ formRef: x,
1623
+ data: y(c),
1624
+ d: D.value,
1625
+ close: F
1626
+ }) : () => {
1627
+ let S;
1628
+ return f(V, I(C, N, {
1629
+ style: {
1630
+ ...C == null ? void 0 : C.style,
1631
+ ...(N == null ? void 0 : N.style) || {}
1632
+ }
1633
+ }), xl(S = (Array.isArray(h) ? h : E).map((O, fe) => {
1634
+ var Ne;
1635
+ return O != null && O.render ? (Ne = O == null ? void 0 : O.render) == null ? void 0 : Ne.call(O) : f(z, I({
1636
+ type: "primary",
1637
+ ghost: O.mode === "cancel"
1638
+ }, (O == null ? void 0 : O.props) || {}, (N == null ? void 0 : N.buttonProps) || {}, {
1639
+ style: {
1640
+ ...U,
1641
+ ...(O == null ? void 0 : O.style) || {}
1642
+ },
1643
+ loading: b[fe],
1644
+ onClick: async () => {
1645
+ var Se, Ie;
1646
+ if (O.mode === "cancel")
1647
+ (Se = D.value) == null || Se.destroy();
1648
+ else {
1649
+ const ce = () => b[fe] = !0, Me = () => b[fe] = !1;
1650
+ O != null && O.loading && ce();
1651
+ try {
1652
+ console.log("model", y(c)), O != null && O.valid && await G(), console.log(O == null ? void 0 : O.valid), (O != null && O.valid || O != null && O.loading) && ce(), await ((Ie = O == null ? void 0 : O.onClick) == null ? void 0 : Ie.call(O, {
1653
+ model: y(c),
1654
+ comfirm: k,
1655
+ cancel: F,
1656
+ validate: G,
1657
+ showLoading: ce,
1658
+ hideLoading: Me
1659
+ }));
1660
+ } catch (tt) {
1661
+ console.log(tt);
1662
+ } finally {
1663
+ (O != null && O.valid || O != null && O.loading) && Me();
1664
+ }
1665
+ }
1666
+ }
1667
+ }), {
1668
+ default: () => [O.label || ""]
1669
+ });
1670
+ })) ? S : {
1671
+ default: () => [S]
1672
+ });
1673
+ }, se = A.create({
1607
1674
  type: "info",
1608
- ...ol,
1675
+ ...pl,
1609
1676
  ...l ? {} : {
1610
- title: q || (((ie = c[a]) == null ? void 0 : ie.sub) ?? "") + t
1677
+ title: R || (((De = m[u]) == null ? void 0 : De.sub) ?? "") + e
1611
1678
  },
1612
1679
  style: {
1613
1680
  width: "500px"
1614
1681
  },
1615
- content: () => s(ze, {
1616
- ref: (F) => {
1617
- x.value = F;
1682
+ content: () => f(Ge, {
1683
+ ref: (S) => {
1684
+ x.value = S;
1618
1685
  },
1619
- options: r,
1620
- value: b.value,
1621
- "onUpdate:value": (F) => b.value = F,
1622
- isNo: f,
1623
- read: p ?? A,
1686
+ options: a,
1687
+ value: y(c),
1688
+ "onUpdate:value": (S) => c.value = S,
1689
+ isNo: d,
1690
+ read: p ?? _,
1624
1691
  labelField: n,
1625
1692
  formProps: o,
1626
1693
  contentStyle: M,
1627
1694
  dialog: !0
1628
1695
  }, null),
1629
- action: p ?? A ? null : typeof D == "function" ? () => D({
1630
- formRef: x,
1631
- data: g(b),
1632
- d: N,
1633
- close: U
1634
- }) : () => {
1635
- let F;
1636
- return s(z, I(C, S, {
1637
- style: {
1638
- ...C == null ? void 0 : C.style,
1639
- ...(S == null ? void 0 : S.style) || {}
1640
- }
1641
- }), fl(F = (D || B).map((O, se) => {
1642
- var Ne;
1643
- return O != null && O.render ? (Ne = O == null ? void 0 : O.render) == null ? void 0 : Ne.call(O) : s(Q, I({
1644
- type: "primary",
1645
- ghost: O.mode === "cancel"
1646
- }, {
1647
- ...O == null ? void 0 : O.props,
1648
- ...S == null ? void 0 : S.buttonProps
1649
- }, {
1650
- style: {
1651
- ...$,
1652
- ...(O == null ? void 0 : O.style) || {}
1653
- },
1654
- loading: y[se],
1655
- onClick: async () => {
1656
- if (O.mode === "cancel")
1657
- N.destroy();
1658
- else {
1659
- const fe = () => y[se] = !0, De = () => y[se] = !1;
1660
- O != null && O.loading && fe();
1661
- try {
1662
- console.log("model", g(b)), O != null && O.valid && await K(), console.log(O == null ? void 0 : O.valid), (O != null && O.valid || O != null && O.loading) && fe(), await (O == null ? void 0 : O.onClick({
1663
- model: g(b),
1664
- comfirm: V,
1665
- cancel: U,
1666
- validate: K,
1667
- showLoading: fe,
1668
- hideLoading: De
1669
- }));
1670
- } catch (Je) {
1671
- console.log(Je);
1672
- } finally {
1673
- (O != null && O.valid || O != null && O.loading) && De();
1674
- }
1675
- }
1676
- }
1677
- }), {
1678
- default: () => [O.label || ""]
1679
- });
1680
- })) ? F : {
1681
- default: () => [F]
1682
- });
1683
- },
1696
+ action: ie,
1684
1697
  // ...readButton.value,
1685
- ...u,
1686
- class: `core-dialog ${g(p) ? "core-dialog-read" : ""} ${(u == null ? void 0 : u.class) || ""}`
1698
+ ...r,
1699
+ class: `core-dialog ${p ?? _ ? "core-dialog-read" : ""} ${(r == null ? void 0 : r.class) || ""}`
1687
1700
  });
1688
- function U() {
1689
- console.log("取消", b.value), N == null || N.destroy();
1690
- }
1691
- async function K(F = []) {
1692
- var O;
1693
- console.log("开启验证"), await ((O = x.value) == null ? void 0 : O.valid());
1694
- }
1695
- async function V(F) {
1696
- return F && F();
1697
- }
1698
- return {
1699
- cancel: U,
1700
- setValue: (F, O) => O ? b.value[O] = F : b.value = {
1701
- ...b.value,
1702
- ...F
1703
- },
1704
- model: g(b),
1705
- modeEnum: c
1701
+ return D.value = se, {
1702
+ cancel: F,
1703
+ setValue: (S, O) => O ? c.value[O] = S : c.value = {
1704
+ ...c.value,
1705
+ ...S
1706
+ },
1707
+ model: y(c),
1708
+ modeEnum: m
1706
1709
  };
1707
1710
  }
1708
- function Tl() {
1709
- const t = xe();
1710
- return Le(t), (l, e) => Ke(l, e);
1711
+ function Vl() {
1712
+ const e = Ce();
1713
+ return He(e), (l, t) => Je(l, t);
1711
1714
  }
1712
- const dl = {
1715
+ const _l = {
1713
1716
  class: "flex-1"
1714
- }, yl = {
1717
+ }, Cl = /* @__PURE__ */ j({
1715
1718
  __name: "CommonQuery",
1716
- props: /* @__PURE__ */ pe({
1717
- inlineText: {
1718
- type: Boolean,
1719
- default: () => !0
1719
+ props: /* @__PURE__ */ xe({
1720
+ query: {
1721
+ default: () => ({})
1720
1722
  },
1721
1723
  options: {
1722
- type: Array,
1723
1724
  default: () => []
1724
1725
  },
1725
- query: {
1726
- type: Object,
1727
- default: () => ({})
1726
+ inlineText: {
1727
+ type: Boolean,
1728
+ default: !0
1728
1729
  },
1729
1730
  selectCount: {
1730
- type: Number,
1731
- default: () => 1
1731
+ default: 1
1732
1732
  },
1733
1733
  type: {
1734
- type: String,
1735
- default: () => "primary"
1734
+ default: "primary"
1736
1735
  },
1737
1736
  noButton: {
1738
1737
  type: Boolean,
1739
- default: () => !1
1738
+ default: !1
1740
1739
  },
1741
1740
  isRead: {
1742
1741
  type: Boolean,
1743
- default: () => !1
1742
+ default: !1
1744
1743
  },
1745
1744
  btn: {
1746
- type: Array,
1747
1745
  default: () => ["reset", "search"]
1748
1746
  },
1749
1747
  size: {
1750
- type: String,
1751
- default: () => "medium"
1748
+ default: "medium"
1752
1749
  }
1753
1750
  }, {
1754
1751
  query: {
@@ -1757,184 +1754,188 @@ const dl = {
1757
1754
  },
1758
1755
  queryModifiers: {}
1759
1756
  }),
1760
- emits: /* @__PURE__ */ pe(["update:query", "submit", "reset"], ["update:query"]),
1761
- setup(t, {
1757
+ emits: /* @__PURE__ */ xe(["update:query", "submit", "reset"], ["update:query"]),
1758
+ setup(e, {
1762
1759
  emit: l
1763
1760
  }) {
1764
- var w;
1765
- const e = oe();
1766
- (w = e == null ? void 0 : e.appContext) != null && w.app && X(e.appContext.app);
1767
- function r(c, x) {
1768
- let y;
1769
- return function(...b) {
1770
- clearTimeout(y), y = setTimeout(() => {
1771
- c.apply(this, b);
1761
+ var A;
1762
+ const t = re();
1763
+ (A = t == null ? void 0 : t.appContext) != null && A.app && ee(t.appContext.app);
1764
+ function a(m, x) {
1765
+ let b;
1766
+ return function(...c) {
1767
+ clearTimeout(b), b = setTimeout(() => {
1768
+ m.apply(this, c);
1772
1769
  }, x);
1773
1770
  };
1774
1771
  }
1775
- const a = l, i = t;
1776
- function n(c) {
1777
- return c.map((x) => ({
1772
+ const u = l, i = e;
1773
+ function n(m) {
1774
+ return m.map((x) => ({
1778
1775
  ...x,
1779
1776
  props: {
1780
1777
  ...x.props,
1781
1778
  ...!x.way || x.way === "input" ? {
1782
- onUpdateValue: (...y) => {
1783
- var b, C;
1784
- (C = (b = y.props) == null ? void 0 : b.onUpdateValue) == null || C.call(b, ...y), f();
1779
+ onUpdateValue: (...b) => {
1780
+ var c, C;
1781
+ (C = (c = x.props) == null ? void 0 : c.onUpdateValue) == null || C.call(c, ...b), d();
1785
1782
  }
1786
1783
  } : {},
1787
1784
  ...(x == null ? void 0 : x.way) === "select" ? {
1788
- onUpdateValue: (...y) => {
1789
- var b, C;
1790
- (C = (b = y.props) == null ? void 0 : b.onUpdateValue) == null || C.call(b, ...y), f();
1785
+ onUpdateValue: (...b) => {
1786
+ var c, C;
1787
+ (C = (c = x.props) == null ? void 0 : c.onUpdateValue) == null || C.call(c, ...b), d();
1791
1788
  }
1792
1789
  } : {}
1793
1790
  }
1794
1791
  }));
1795
1792
  }
1796
- const f = r(() => {
1797
- a("submit");
1793
+ const d = a(() => {
1794
+ u("submit");
1798
1795
  }, 500);
1799
1796
  function o() {
1800
- f();
1797
+ d();
1801
1798
  }
1802
- const d = P(!1), m = Ye(t, "query"), h = {
1799
+ const s = P(!1), g = Le(e, "query"), w = {
1803
1800
  style: {
1804
1801
  width: "33%"
1805
1802
  }
1806
- }, p = _(() => {
1807
- var c;
1808
- return (c = i.options) == null ? void 0 : c.map((x) => (x == null ? void 0 : x.way) || "input");
1803
+ }, p = Y(() => {
1804
+ var m;
1805
+ return (m = i.options) == null ? void 0 : m.map((x) => (x == null ? void 0 : x.way) || "input");
1809
1806
  });
1810
- Ve(p.value);
1811
- const A = _(() => {
1807
+ je(p.value);
1808
+ const _ = Y(() => {
1809
+ var m;
1812
1810
  try {
1813
- const c = [];
1814
- for (let x = 0; x < i.options.length; x++) {
1815
- const y = i.options[x];
1816
- y != null && y.enum && !(y != null && y.options) && (y.options = ke(y.enum)), y != null && y.props || (y.props = {
1811
+ const x = [];
1812
+ for (let b = 0; b < (((m = i.options) == null ? void 0 : m.length) || 0); b++) {
1813
+ const c = i.options[b];
1814
+ if (c != null && c.enum && !(c != null && c.options) && (c.options = We(c.enum)), c != null && c.props || (c.props = {
1817
1815
  size: i.size
1818
- }), y != null && y.formItemProps ? y.formItemProps = {
1819
- ...h,
1820
- ...y.formItemProps,
1821
- style: {
1822
- ...h.style,
1823
- ...y.formItemProps.style
1824
- }
1825
- } : y.formItemProps = {
1826
- ...h
1827
- };
1828
- const b = (y == null ? void 0 : y.key) || (y == null ? void 0 : y.value);
1829
- if (!b) throw new Error("key no set");
1830
- c.push({
1831
- ...y,
1832
- key: b
1816
+ }), !(c != null && c.formItemProps))
1817
+ c.formItemProps = {
1818
+ ...w
1819
+ };
1820
+ else {
1821
+ const U = typeof c.formItemProps == "function" ? c.formItemProps({}, {}) : c.formItemProps;
1822
+ c.formItemProps = {
1823
+ ...w,
1824
+ ...U,
1825
+ style: {
1826
+ ...w.style,
1827
+ ...U == null ? void 0 : U.style
1828
+ }
1829
+ };
1830
+ }
1831
+ const C = (c == null ? void 0 : c.key) || (c == null ? void 0 : c.value);
1832
+ if (!C) throw new Error("key no set");
1833
+ x.push({
1834
+ ...c,
1835
+ key: C
1833
1836
  });
1834
1837
  }
1835
- return n(c);
1836
- } catch (c) {
1837
- return console.warn("error", c), [];
1838
+ return n(x);
1839
+ } catch (x) {
1840
+ return console.warn("error", x), [];
1838
1841
  }
1839
- }), D = {
1842
+ }), h = {
1840
1843
  style: {
1841
1844
  borderRadius: "3px"
1842
1845
  }
1843
1846
  }, M = {
1844
- search: () => s(Y("NButton"), I({
1847
+ search: () => f(z, I({
1845
1848
  type: i.type,
1846
- loading: d.value,
1849
+ loading: s.value,
1847
1850
  "default-props": {
1848
1851
  attrType: "submit"
1849
1852
  },
1850
1853
  onClick: () => o()
1851
- }, D), {
1854
+ }, h), {
1852
1855
  default: () => "搜索",
1853
- icon: () => s(Pt, null, null)
1856
+ icon: () => f(kt, null, null)
1854
1857
  }),
1855
- reset: () => s(Y("NButton"), I({
1858
+ reset: () => f(z, I({
1856
1859
  type: "default",
1857
1860
  onClick: () => {
1858
- S();
1861
+ N();
1859
1862
  }
1860
- }, D), {
1863
+ }, h), {
1861
1864
  default: () => "重置",
1862
- icon: () => s($t, null, null)
1865
+ icon: () => f(Yt, null, null)
1863
1866
  })
1864
1867
  };
1865
- function S() {
1866
- i.options.forEach((c) => {
1867
- const x = (c == null ? void 0 : c.key) || (c == null ? void 0 : c.value);
1868
- x && (c != null && c.queryType ? m.value[c.queryType][x] = null : m.value[x] = null);
1869
- }), a("reset");
1868
+ function N() {
1869
+ var m;
1870
+ (m = i.options) == null || m.forEach((x) => {
1871
+ const b = (x == null ? void 0 : x.key) || (x == null ? void 0 : x.value);
1872
+ b && (x != null && x.queryType ? (g.value[x.queryType] || (g.value[x.queryType] = {}), g.value[x.queryType][b] = null) : g.value[b] = null);
1873
+ }), u("reset");
1870
1874
  }
1871
- function u(c) {
1872
- c.key === "Enter" && o();
1875
+ function r(m) {
1876
+ m.key === "Enter" && o();
1873
1877
  }
1874
- return Be(() => {
1875
- document.addEventListener("keydown", u);
1876
- }), at(() => {
1877
- document.removeEventListener("keydown", u);
1878
- }), (c, x) => {
1879
- const y = Y("n-space");
1880
- return T(), H(y, {
1881
- "wrap-item": !1,
1882
- justify: "space-between",
1878
+ return ke(() => {
1879
+ document.addEventListener("keydown", r);
1880
+ }), ft(() => {
1881
+ document.removeEventListener("keydown", r);
1882
+ }), (m, x) => (B(), K(y(V), {
1883
+ "wrap-item": !1,
1884
+ justify: "space-between",
1885
+ align: "center",
1886
+ wrap: !1
1887
+ }, {
1888
+ default: v(() => [_e("div", _l, [f(Ge, {
1889
+ value: g.value,
1890
+ "onUpdate:value": x[0] || (x[0] = (b) => g.value = b),
1891
+ options: _.value,
1892
+ "form-props": {
1893
+ showFeedback: !1
1894
+ }
1895
+ }, null, 8, ["value", "options"])]), i.noButton ? ct("", !0) : (B(), K(y(V), {
1896
+ key: 0,
1883
1897
  align: "center",
1884
1898
  wrap: !1
1885
1899
  }, {
1886
- default: R(() => [we("div", dl, [s(g(ze), {
1887
- value: m.value,
1888
- "onUpdate:value": x[0] || (x[0] = (b) => m.value = b),
1889
- options: A.value,
1890
- "form-props": {
1891
- showFeedback: !1
1892
- }
1893
- }, null, 8, ["value", "options"])]), i.noButton ? rt("", !0) : (T(), H(y, {
1894
- key: 0,
1895
- align: "center",
1896
- wrap: !1
1897
- }, {
1898
- default: R(() => [ge(c.$slots, "left-btn", {}, void 0, !0), (T(!0), le(ae, null, me(i.btn, (b, C) => {
1899
- var $;
1900
- return T(), H(ut(($ = M == null ? void 0 : M[b]) == null ? void 0 : $.call(M)), {
1901
- key: C
1902
- });
1903
- }), 128)), ge(c.$slots, "right-btn", {}, void 0, !0)]),
1904
- _: 3
1905
- }))]),
1900
+ default: v(() => [be(m.$slots, "left-btn", {}, void 0, !0), (B(!0), ne(ue, null, he(i.btn, (b, c) => {
1901
+ var C;
1902
+ return B(), K(dt((C = M == null ? void 0 : M[b]) == null ? void 0 : C.call(M)), {
1903
+ key: c
1904
+ });
1905
+ }), 128)), be(m.$slots, "right-btn", {}, void 0, !0)]),
1906
1906
  _: 3
1907
- });
1908
- };
1907
+ }))]),
1908
+ _: 3
1909
+ }));
1909
1910
  }
1910
- }, Yl = /* @__PURE__ */ ue(yl, [["__scopeId", "data-v-6ef17b7a"]]), We = /* @__PURE__ */ re(({
1911
- action: t,
1911
+ }), zl = /* @__PURE__ */ oe(Cl, [["__scopeId", "data-v-643f6214"]]), Qe = /* @__PURE__ */ j(({
1912
+ action: e,
1912
1913
  row: l,
1913
- index: e
1914
+ index: t
1914
1915
  }) => {
1915
1916
  const {
1916
- onClick: r,
1917
- disabled: a,
1917
+ onClick: a,
1918
+ disabled: u,
1918
1919
  type: i = "primary",
1919
1920
  loading: n = !1,
1920
- label: f = null,
1921
+ label: d = null,
1921
1922
  ...o
1922
- } = t, d = P(!1);
1923
- return () => s(Q, I({
1923
+ } = e || {}, s = P(!1);
1924
+ return () => f(z, I({
1924
1925
  text: !0,
1925
1926
  onClick: async () => {
1926
- if (r)
1927
+ if (a)
1927
1928
  try {
1928
- n && (d.value = !0), await r(l, e);
1929
+ n && (s.value = !0), await a(l);
1929
1930
  } finally {
1930
- setTimeout(() => d.value = !1, 500);
1931
+ setTimeout(() => s.value = !1, 500);
1931
1932
  }
1932
1933
  },
1933
- disabled: a && a(l),
1934
- loading: d.value,
1935
- type: a && a(l) ? "default" : i
1934
+ disabled: typeof u == "function" ? u(l) : u,
1935
+ loading: s.value,
1936
+ type: typeof u == "function" && u(l) ? "default" : i
1936
1937
  }, o), {
1937
- default: () => [typeof f == "function" ? f == null ? void 0 : f(l) : f]
1938
+ default: () => [typeof d == "function" ? d == null ? void 0 : d(l) : d]
1938
1939
  });
1939
1940
  }, {
1940
1941
  props: {
@@ -1951,40 +1952,40 @@ const dl = {
1951
1952
  default: 0
1952
1953
  }
1953
1954
  }
1954
- }), He = /* @__PURE__ */ re(({
1955
- onClick: t,
1955
+ }), Xe = /* @__PURE__ */ j(({
1956
+ onClick: e,
1956
1957
  row: l,
1957
- index: e,
1958
- action: r
1958
+ index: t,
1959
+ action: a
1959
1960
  }, {
1960
- slots: a
1961
+ slots: u
1961
1962
  }) => {
1962
1963
  const i = P(!1);
1963
- return () => s(St, {
1964
+ return () => f(Rt, {
1964
1965
  "positive-button-props": {
1965
1966
  type: "warning",
1966
1967
  loading: i.value
1967
1968
  },
1968
1969
  onPositiveClick: async () => {
1969
1970
  try {
1970
- if (t)
1971
- return i.value = !0, await t(l, e), i.value = !1, !0;
1971
+ if (e)
1972
+ return i.value = !0, await e(l, t), i.value = !1, !0;
1972
1973
  } catch {
1973
1974
  return i.value = !1, !1;
1974
1975
  }
1975
1976
  return !1;
1976
1977
  }
1977
1978
  }, {
1978
- trigger: a.default,
1979
+ trigger: u.default,
1979
1980
  default: () => {
1980
1981
  var n;
1981
- return ((n = r == null ? void 0 : r.popProps) == null ? void 0 : n.content) || (r == null ? void 0 : r.content) || "确定删除该记录?";
1982
+ return ((n = a == null ? void 0 : a.popProps) == null ? void 0 : n.content) || (a == null ? void 0 : a.content) || "确定删除该记录?";
1982
1983
  }
1983
1984
  });
1984
1985
  }, {
1985
1986
  props: {
1986
1987
  onClick: {
1987
- type: [Function, null],
1988
+ type: Function,
1988
1989
  default: null
1989
1990
  },
1990
1991
  row: {
@@ -2001,46 +2002,48 @@ const dl = {
2001
2002
  }
2002
2003
  }
2003
2004
  });
2004
- function qe(t) {
2005
- return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !te(t);
2005
+ function Be(e) {
2006
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !le(e);
2006
2007
  }
2007
- const ml = /* @__PURE__ */ re((t) => {
2008
- const l = t.options.length, e = P(!1), r = _(() => t.options.slice(0, e.value ? l : t.max)), a = _(() => t.options.slice(t.max));
2008
+ const Ol = /* @__PURE__ */ j((e) => {
2009
+ const l = e.options.length, t = P(!1), a = Y(() => e.options.slice(0, t.value ? l : e.max)), u = Y(() => e.options.slice(e.max));
2009
2010
  function i(n) {
2010
2011
  return n == null ? void 0 : n.map(({
2011
- isRender: f = () => !0,
2012
+ isRender: d = () => !0,
2012
2013
  onClick: o = null,
2013
- mode: d = null,
2014
- disabled: m = !1,
2015
- type: h = "primary",
2014
+ mode: s = null,
2015
+ disabled: g = !1,
2016
+ type: w = "primary",
2016
2017
  ...p
2017
- }, A) => f != null && f(t.data) ? d === "pop" ? s(He, {
2018
+ }, _) => (typeof d == "function" ? d(e.data) : d) ? s === "pop" ? f(Xe, {
2018
2019
  onClick: o,
2019
- row: t.data,
2020
+ row: e.data,
2021
+ index: e.index,
2020
2022
  action: p,
2021
- key: ne(t.data, t.index) + A
2023
+ key: ae(e.data, e.index) + _
2022
2024
  }, {
2023
- default: () => [s(Q, I({
2025
+ default: () => [f(z, I({
2024
2026
  text: !0,
2025
- disabled: m && m(t.data),
2026
- type: m && m(t.data) ? "default" : h
2027
+ disabled: typeof g == "function" ? g(e.data) : g,
2028
+ type: typeof g == "function" && g(e.data) ? "default" : w
2027
2029
  }, p), {
2028
- default: () => [typeof (p == null ? void 0 : p.label) == "function" ? p == null ? void 0 : p.label(t.data) : p == null ? void 0 : p.label]
2030
+ default: () => [typeof (p == null ? void 0 : p.label) == "function" ? p == null ? void 0 : p.label(e.data) : p == null ? void 0 : p.label]
2029
2031
  })]
2030
- }) : s(We, {
2031
- row: t.data,
2032
+ }) : f(Qe, {
2033
+ row: e.data,
2032
2034
  action: {
2033
2035
  ...p,
2034
- disabled: m,
2036
+ disabled: g,
2035
2037
  onClick: o,
2036
- type: h
2038
+ type: w
2037
2039
  },
2038
- key: ne(t.data, t.index) + A
2039
- }, null) : void 0).filter((f) => f);
2040
+ index: e.index,
2041
+ key: ae(e.data, e.index) + _
2042
+ }, null) : void 0).filter((d) => d !== void 0);
2040
2043
  }
2041
2044
  return () => {
2042
2045
  let n;
2043
- return s(z, {
2046
+ return f(V, {
2044
2047
  style: {
2045
2048
  width: "100%"
2046
2049
  },
@@ -2048,31 +2051,31 @@ const ml = /* @__PURE__ */ re((t) => {
2048
2051
  justify: "center",
2049
2052
  align: "center"
2050
2053
  }, {
2051
- default: () => [s(z, {
2054
+ default: () => [f(V, {
2052
2055
  "wrap-item": !1,
2053
2056
  align: "center"
2054
- }, qe(n = i(r.value)) ? n : {
2057
+ }, Be(n = i(a.value)) ? n : {
2055
2058
  default: () => [n]
2056
- }), s(It, {
2059
+ }), f(qt, {
2057
2060
  trigger: "click"
2058
2061
  }, {
2059
- trigger: () => s(Q, {
2062
+ trigger: () => f(z, {
2060
2063
  text: !0,
2061
2064
  type: "info"
2062
2065
  }, {
2063
- default: () => [v("更多")]
2066
+ default: () => [Z("更多")]
2064
2067
  }),
2065
2068
  default: () => {
2066
- let f;
2067
- return s(z, {
2069
+ let d;
2070
+ return f(V, {
2068
2071
  "wrap-item": !1,
2069
2072
  align: "center",
2070
2073
  style: {
2071
2074
  width: "250px",
2072
2075
  padding: "5px"
2073
2076
  }
2074
- }, qe(f = i(a.value)) ? f : {
2075
- default: () => [f]
2077
+ }, Be(d = i(u.value)) ? d : {
2078
+ default: () => [d]
2076
2079
  });
2077
2080
  }
2078
2081
  })]
@@ -2091,8 +2094,7 @@ const ml = /* @__PURE__ */ re((t) => {
2091
2094
  },
2092
2095
  data: {
2093
2096
  type: Object,
2094
- default: () => {
2095
- }
2097
+ default: () => ({})
2096
2098
  },
2097
2099
  index: {
2098
2100
  type: Number,
@@ -2100,296 +2102,305 @@ const ml = /* @__PURE__ */ re((t) => {
2100
2102
  }
2101
2103
  }
2102
2104
  });
2103
- function J(t = {}, l = null) {
2104
- const e = Kt();
2105
- return !e.inheritTheme && e.themeOverrides ? {
2106
- ...t,
2105
+ function Al() {
2106
+ var l;
2107
+ const e = el();
2108
+ if (e)
2109
+ return e;
2110
+ try {
2111
+ const t = re();
2112
+ if ((l = t == null ? void 0 : t.appContext) != null && l.app)
2113
+ return null;
2114
+ } catch {
2115
+ }
2116
+ return null;
2117
+ }
2118
+ function Q(e = {}, l = null) {
2119
+ const t = Zt();
2120
+ return !t.inheritTheme && t.themeOverrides ? {
2121
+ ...e,
2107
2122
  themeOverrides: {
2108
- ...e.themeOverrides,
2109
- ...t.themeOverrides || {}
2123
+ ...t.themeOverrides,
2124
+ ...e.themeOverrides || {}
2110
2125
  }
2111
- } : t;
2126
+ } : e;
2112
2127
  }
2113
- function _l(t, l = {}) {
2114
- if (!t)
2128
+ function Wl(e, l = {}) {
2129
+ if (!e)
2115
2130
  throw new Error("dialogInstance 是必需的。请在组件中使用 useDialog() 获取实例,然后传递给此函数。");
2116
- const e = J(l, t);
2117
- return t.create(e);
2131
+ const t = Q(l, e);
2132
+ return e.create(t);
2118
2133
  }
2119
- function Rl(t) {
2120
- if (!t)
2134
+ function Hl(e) {
2135
+ if (!e)
2121
2136
  throw new Error("dialogInstance 是必需的。请在组件中使用 useDialog() 获取实例。");
2122
2137
  return {
2123
2138
  info: (l) => {
2124
- const e = J({ type: "info", ...l }, t);
2125
- return t.info(e);
2139
+ const t = Q({ type: "info", ...l }, e);
2140
+ return e.info(t);
2126
2141
  },
2127
2142
  success: (l) => {
2128
- const e = J({ type: "success", ...l }, t);
2129
- return t.success(e);
2143
+ const t = Q({ type: "success", ...l }, e);
2144
+ return e.success(t);
2130
2145
  },
2131
2146
  warning: (l) => {
2132
- const e = J({ type: "warning", ...l }, t);
2133
- return t.warning(e);
2147
+ const t = Q({ type: "warning", ...l }, e);
2148
+ return e.warning(t);
2134
2149
  },
2135
2150
  error: (l) => {
2136
- const e = J({ type: "error", ...l }, t);
2137
- return t.error(e);
2151
+ const t = Q({ type: "error", ...l }, e);
2152
+ return e.error(t);
2138
2153
  },
2139
2154
  create: (l) => {
2140
- const e = J(l, t);
2141
- return t.create(e);
2155
+ const t = Q(l, e);
2156
+ return e.create(t);
2142
2157
  }
2143
2158
  };
2144
2159
  }
2145
- function hl(t) {
2146
- return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !te(t);
2160
+ function Dl(e) {
2161
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !le(e);
2147
2162
  }
2148
- const ne = (t, l) => t ? JSON.stringify(t) : l;
2149
- function kl(t, l = null, e) {
2150
- const r = {
2163
+ const ae = (e, l) => e ? JSON.stringify(e) : String(l);
2164
+ function Kl(e, l = null, t) {
2165
+ const a = {
2151
2166
  max: 4,
2152
2167
  width: 80
2153
2168
  };
2154
- let a = !1;
2155
- if (typeof e == "boolean" ? a = r : typeof e == "object" && (a = {
2156
- ...r,
2157
- ...e
2158
- }), console.log("collect", a), console.log(Array.isArray(t)), !Array.isArray(t))
2169
+ let u = !1;
2170
+ if (typeof t == "boolean" ? u = a : typeof t == "object" && (u = {
2171
+ ...a,
2172
+ ...t
2173
+ }), console.log("collect", u), console.log(Array.isArray(e)), !Array.isArray(e))
2159
2174
  throw new TypeError("需要配置数组");
2160
2175
  console.log("ddd");
2161
2176
  let i = [], n = 0;
2162
- const f = [];
2163
- return Array.isArray(t) && (i = t, i.forEach((o, d) => {
2164
- var m, h;
2165
- o.permission ? be(o.permission) && ((!e || d < a.max) && (n += ((m = o == null ? void 0 : o.label) == null ? void 0 : m.length) * 12 + 36), f.push(o)) : ((!e || d < a.max) && (n += ((h = o == null ? void 0 : o.label) == null ? void 0 : h.length) * 12 + 36), f.push(o));
2166
- })), n = Math.max(80, n), n += 0, a && (n += 2), f.length ? {
2177
+ const d = [];
2178
+ return Array.isArray(e) && (i = e, i.forEach((o, s) => {
2179
+ var g, w;
2180
+ o.permission ? we(o.permission) && ((!t || typeof u == "object" && s < u.max) && (n += (typeof (o == null ? void 0 : o.label) == "string" ? (g = o == null ? void 0 : o.label) == null ? void 0 : g.length : 10) * 12 + 36), d.push(o)) : ((!t || typeof u == "object" && s < u.max) && (n += (typeof (o == null ? void 0 : o.label) == "string" ? (w = o == null ? void 0 : o.label) == null ? void 0 : w.length : 10) * 12 + 36), d.push(o));
2181
+ })), n = Math.max(80, n), n += 0, u && (n += 2), d.length ? {
2167
2182
  title: "操作",
2168
2183
  key: "opr",
2169
2184
  fixed: "right",
2170
2185
  align: "left",
2171
2186
  width: n,
2172
2187
  ...l,
2173
- render(o, d) {
2174
- const m = a ? s(ml, {
2188
+ render(o, s) {
2189
+ const g = u ? f(Ol, {
2175
2190
  data: o,
2176
- index: d,
2177
- max: a.max,
2178
- options: f
2179
- }, null) : f.map(({
2180
- isRender: h = () => !0,
2191
+ index: s,
2192
+ max: u.max,
2193
+ options: d
2194
+ }, null) : d.map(({
2195
+ isRender: w = () => !0,
2181
2196
  onClick: p = null,
2182
- mode: A = null,
2183
- disabled: D = !1,
2197
+ mode: _ = null,
2198
+ disabled: h = !1,
2184
2199
  type: M = "primary",
2185
- ...S
2186
- }, u) => h != null && h(o) ? A === "pop" ? s(He, {
2200
+ ...N
2201
+ }, r) => (typeof w == "function" ? w(o) : w) ? _ === "pop" ? f(Xe, {
2187
2202
  onClick: p,
2188
2203
  row: o,
2189
- index: d,
2190
- action: S,
2191
- key: ne(o, d) + u
2204
+ index: s,
2205
+ action: N,
2206
+ key: ae(o, s) + r
2192
2207
  }, {
2193
- default: () => [s(Q, I({
2208
+ default: () => [f(z, I({
2194
2209
  text: !0,
2195
- disabled: D && D(o),
2196
- type: D && D(o) ? "default" : M
2197
- }, S), {
2198
- default: () => [typeof (S == null ? void 0 : S.label) == "function" ? S == null ? void 0 : S.label(o) : S == null ? void 0 : S.label]
2210
+ disabled: typeof h == "function" ? h(o) : h,
2211
+ type: typeof h == "function" && h(o) ? "default" : M
2212
+ }, N), {
2213
+ default: () => [typeof (N == null ? void 0 : N.label) == "function" ? N == null ? void 0 : N.label(o) : N == null ? void 0 : N.label]
2199
2214
  })]
2200
- }) : s(We, {
2215
+ }) : f(Qe, {
2201
2216
  row: o,
2202
2217
  action: {
2203
- ...S,
2204
- disabled: D,
2218
+ ...N,
2219
+ disabled: h,
2205
2220
  onClick: p,
2206
2221
  type: M
2207
2222
  },
2208
- index: d,
2209
- key: ne(o, d) + u
2210
- }, null) : void 0).filter((h) => h);
2211
- return l != null && l.isRender ? l == null ? void 0 : l.render(o) : s(z, {
2223
+ index: s,
2224
+ key: ae(o, s) + r
2225
+ }, null) : void 0).filter((w) => w !== void 0);
2226
+ return l != null && l.isRender ? l == null ? void 0 : l.render(o) : f(V, {
2212
2227
  align: "center",
2213
2228
  "wrap-item": !1,
2214
2229
  size: 18,
2215
- key: ne(o, d)
2216
- }, hl(m) ? m : {
2217
- default: () => [m]
2230
+ key: ae(o, s)
2231
+ }, Dl(g) ? g : {
2232
+ default: () => [g]
2218
2233
  });
2219
2234
  }
2220
2235
  } : void 0;
2221
2236
  }
2222
- async function gl(t, l = null) {
2223
- const e = getDialogInstance();
2224
- if (!e)
2237
+ async function Nl(e, l = null) {
2238
+ const t = Al();
2239
+ if (!t)
2225
2240
  throw new Error("无法获取 dialog 实例。请使用 useQRCode hook 或在组件中通过 setupConfig 注册 dialog 实例。");
2226
- const r = P(null), a = P(!1), i = J({
2241
+ const a = P(null), u = P(!1), i = Q({
2227
2242
  type: "info",
2228
2243
  showIcon: !1,
2229
2244
  style: {
2230
2245
  width: "350px",
2231
2246
  height: "350px"
2232
2247
  },
2233
- content: () => s("div", {
2234
- className: "qr-box"
2235
- }, [a.value ? s(Ft, {
2248
+ content: () => f("div", {
2249
+ class: "qr-box"
2250
+ }, [u.value ? f(Et, {
2236
2251
  class: "qr-spin",
2237
2252
  show: !0
2238
- }, null) : "", s("div", {
2239
- className: "qr-img"
2240
- }, [s(Mt, {
2241
- src: r.value,
2253
+ }, null) : "", f("div", {
2254
+ class: "qr-img"
2255
+ }, [f($t, {
2256
+ src: a.value,
2242
2257
  style: {
2243
2258
  width: "100%"
2244
2259
  }
2245
- }, null)]), s("div", {
2246
- className: "qr-title"
2247
- }, [a.value ? "" : t.name])])
2248
- }, e);
2249
- return e.info(i), l && (a.value = !0, r.value = await l(), a.value = !1), !0;
2260
+ }, null)]), f("div", {
2261
+ class: "qr-title"
2262
+ }, [u.value ? "" : e.name])])
2263
+ }, t);
2264
+ return t.info(i), l && (u.value = !0, a.value = await l(), u.value = !1), !0;
2250
2265
  }
2251
- function Ll() {
2252
- const t = xe();
2253
- return Le(t), (l, e) => gl(l, e);
2266
+ function jl() {
2267
+ const e = Ce();
2268
+ return He(e), (l, t) => Nl(l, t);
2254
2269
  }
2255
- function pl(t) {
2256
- var l, e;
2257
- if ((l = t == null ? void 0 : t.children) != null && l.length) {
2258
- const r = [];
2259
- t.children.forEach((a) => {
2260
- var n, f, o, d;
2261
- pl(a);
2270
+ function Sl(e) {
2271
+ var l, t;
2272
+ if ((l = e == null ? void 0 : e.children) != null && l.length) {
2273
+ const a = [];
2274
+ e.children.forEach((u) => {
2275
+ var n, d, o, s;
2276
+ Sl(u);
2262
2277
  let i = [];
2263
- typeof ((n = a == null ? void 0 : a.meta) == null ? void 0 : n.permission) == "string" ? i = [a.meta.permission] : Array.isArray((f = a.meta) == null ? void 0 : f.permission) ? i.push(...a.meta.permission) : typeof ((o = a.meta) == null ? void 0 : o.permission) == "object" ? i.push(...bl(Ge(a.meta.permission))) : (d = a == null ? void 0 : a.meta) != null && d.permission || (i = null), a.meta.permission = i, r.push(...new Set(i));
2264
- }), (e = t == null ? void 0 : t.meta) != null && e.permission ? t.meta.permission = [...new Set(t.meta.permission.concat(r))] : t.meta.permission = r;
2278
+ typeof ((n = u == null ? void 0 : u.meta) == null ? void 0 : n.permission) == "string" ? i = [u.meta.permission] : Array.isArray((d = u.meta) == null ? void 0 : d.permission) ? i.push(...u.meta.permission) : typeof ((o = u.meta) == null ? void 0 : o.permission) == "object" ? i.push(...Il(Ze(u.meta.permission))) : (s = u == null ? void 0 : u.meta) != null && s.permission || (i = null), u.meta.permission = i, a.push(...new Set(i));
2279
+ }), (t = e == null ? void 0 : e.meta) != null && t.permission ? e.meta.permission = [...new Set(e.meta.permission.concat(a))] : e.meta.permission = a;
2265
2280
  }
2266
- return t;
2281
+ return e;
2267
2282
  }
2268
- function bl(...t) {
2269
- const l = t == null ? void 0 : t.map((e) => Array.isArray(e) ? e : e == null ? void 0 : e.ALL);
2283
+ function Il(...e) {
2284
+ const l = e == null ? void 0 : e.map((t) => Array.isArray(t) ? t : t == null ? void 0 : t.ALL);
2270
2285
  return [].concat(...l);
2271
2286
  }
2272
- function Ge(t) {
2273
- return t ? Object.keys(t).reduce((l, e) => (typeof t[e] != "string" ? l.concat(Ge(t[e])) : l.push(t[e]), l), []) : [];
2287
+ function Ze(e) {
2288
+ return e ? Object.keys(e).reduce((l, t) => (typeof e[t] != "string" ? l.concat(Ze(e[t])) : l.push(e[t]), l), []) : [];
2274
2289
  }
2275
- function jl(...t) {
2290
+ function Gl(...e) {
2276
2291
  return {
2277
- ...wl("api", t)
2292
+ ...et("auth", e)
2278
2293
  };
2279
2294
  }
2280
- function Vl(t, l = {}) {
2281
- const e = Object.keys(l);
2282
- return e.length && e.forEach((r) => {
2283
- const a = new RegExp(`${r}`, "g");
2284
- t = t == null ? void 0 : t.replace(a, l[r]);
2285
- }), t;
2295
+ function Jl(...e) {
2296
+ return {
2297
+ ...et("api", e)
2298
+ };
2286
2299
  }
2287
- function wl(t, l) {
2300
+ function Ql(e, l = {}) {
2301
+ const t = Object.keys(l);
2302
+ return t.length && t.forEach((a) => {
2303
+ const u = new RegExp(`${a}`, "g");
2304
+ e = e == null ? void 0 : e.replace(u, l[a]);
2305
+ }), e;
2306
+ }
2307
+ function et(e, l) {
2288
2308
  var n;
2289
- const e = Re(), r = Tt(), a = Ee(((n = e == null ? void 0 : e.meta) == null ? void 0 : n[t]) ?? {}), i = Oe(l[0]);
2290
- return i != null && i.length && r.getRoutes().filter((o) => i.includes(o.name)).forEach((o) => {
2291
- var d;
2292
- (d = o.meta) != null && d[t] && (a[o.name] = Ee(o.meta[t]));
2309
+ const t = ze(), a = zt(), u = Ye(((n = t == null ? void 0 : t.meta) == null ? void 0 : n[e]) ?? {}), i = Oe(l[0]);
2310
+ return i != null && i.length && a.getRoutes().filter((o) => i.includes(o.name)).forEach((o) => {
2311
+ var s;
2312
+ (s = o.meta) != null && s[e] && (u[o.name] = Ye(o.meta[e]));
2293
2313
  }), {
2294
- ...a
2314
+ ...u
2295
2315
  };
2296
2316
  }
2297
- function Ee(t = {}) {
2298
- return Object.keys(t).reduce((l, e) => {
2299
- const r = t[e];
2300
- return typeof r == "object" ? l[e] = r == null ? void 0 : r.key : typeof r == "string" && (l[e] = String(r)), l;
2317
+ function Ye(e = {}) {
2318
+ return Object.keys(e).reduce((l, t) => {
2319
+ const a = e[t];
2320
+ return typeof a == "object" ? l[t] = a == null ? void 0 : a.key : typeof a == "string" && (l[t] = String(a)), l;
2301
2321
  }, {});
2302
2322
  }
2303
- function xl(t, l = "") {
2304
- return t.length ? (t.forEach((e) => {
2305
- var i;
2306
- e.children && xl(e.children, e == null ? void 0 : e.path), e.path && (e.sourceFullPath = `${l ? `${l}/`.replace(/^\/\//, "/") : ""}${e.path}`), e.meta || (e.meta = {});
2307
- const r = (e == null ? void 0 : e.title) ?? ((i = e == null ? void 0 : e.meta) == null ? void 0 : i.title) ?? "未命名页面";
2308
- e != null && e.api && (e.meta.api = e.api), r && (e.meta.title = r, e.title = r), e != null && e.hidden && (e.meta.hidden = e.hidden);
2309
- let a = [];
2310
- e != null && e.auth && (e.meta.auth = e.auth, a = Object.keys(e.auth).reduce((n, f) => (typeof e.auth[f] == "string" ? n.push(e.auth[f]) : typeof e.auth[f] == "boolean" && n.push(f), n), [])), e != null && e.permission && (e.meta.permission = e.permission), e.meta.permission && Array.isArray(e.meta.permission) ? e.meta.permission = e.meta.permission.concat(a) : a.length && (e.meta.permission = a);
2311
- }), t) : [];
2312
- }
2313
- const ye = {
2323
+ const me = {
2314
2324
  ascend: {
2315
2325
  title: "升序",
2316
2326
  value: !0,
2317
- Icon: s(Bt, null, null),
2318
- fn: (t, l) => {
2319
- t.desc = !0, t.sortFieldName = l;
2327
+ Icon: ye(Vt),
2328
+ fn: (e, l) => {
2329
+ e.desc = !0, e.sortFieldName = l;
2320
2330
  }
2321
2331
  },
2322
2332
  descend: {
2323
2333
  title: "降序",
2324
2334
  value: !1,
2325
- Icon: s(Et, null, null),
2326
- fn: (t) => {
2327
- t.sortFieldName = "", t.desc = !0;
2335
+ Icon: ye(Lt),
2336
+ fn: (e) => {
2337
+ e.sortFieldName = "", e.desc = !0;
2328
2338
  }
2329
2339
  },
2330
2340
  false: {
2331
2341
  title: "默认",
2332
2342
  value: null,
2333
- Icon: s(qt, {
2343
+ Icon: ye(vt, {
2334
2344
  style: "transform:rotateZ(90deg)"
2335
- }, null),
2336
- fn: (t) => {
2337
- t.desc = !1, t.sortFieldName = "";
2345
+ }),
2346
+ fn: (e) => {
2347
+ e.desc = !1, e.sortFieldName = "";
2338
2348
  }
2339
2349
  }
2340
2350
  };
2341
- function Ol(t, l = {}) {
2342
- X(t);
2351
+ function Ml(e, l = {}) {
2352
+ ee(e);
2343
2353
  }
2344
- const zl = {
2345
- install: Ol
2354
+ const Xl = {
2355
+ install: Ml
2346
2356
  };
2347
2357
  export {
2348
2358
  $e as ArrayToObject,
2349
- Yl as CommonQuery,
2350
- zl as CorePlugin,
2351
- ze as DataForm,
2352
- Jt as DataTable,
2353
- ke as ObjectToArray,
2354
- We as OprButton,
2355
- il as Options,
2356
- He as Pop,
2357
- Pl as autoRegisterDirectives,
2358
- pl as cellectChildenPermission,
2359
- be as checkPermission,
2360
- Ke as commonDialogMethod,
2361
- kl as createActionColumnJsx,
2362
- _l as createDialog,
2363
- Rl as createDialogMethods,
2364
- J as createDialogOptions,
2365
- gl as createQRCode,
2366
- Qt as customUpload,
2367
- Me as ellipsis,
2368
- El as getAllOptions,
2369
- Vt as getBaseURL,
2370
- Ml as getConfig,
2371
- Kt as getDialogConfig,
2372
- $l as getDialogInstance,
2359
+ zl as CommonQuery,
2360
+ Xl as CorePlugin,
2361
+ Ge as DataForm,
2362
+ al as DataTable,
2363
+ We as ObjectToArray,
2364
+ Qe as OprButton,
2365
+ hl as Options,
2366
+ Xe as Pop,
2367
+ Yl as autoRegisterDirectives,
2368
+ Sl as cellectChildenPermission,
2369
+ we as checkPermission,
2370
+ Je as commonDialogMethod,
2371
+ Kl as createActionColumnJsx,
2372
+ Wl as createDialog,
2373
+ Hl as createDialogMethods,
2374
+ Q as createDialogOptions,
2375
+ Nl as createQRCode,
2376
+ ul as customUpload,
2377
+ qe as ellipsis,
2378
+ vl as getAllOptions,
2379
+ Qt as getBaseURL,
2380
+ Tl as getConfig,
2381
+ Zt as getDialogConfig,
2382
+ el as getDialogInstance,
2373
2383
  W as getFileUrl,
2374
- Ht as getGlobalApp,
2375
- Ul as getHasPermission,
2376
- Ve as getOptions,
2377
- zt as getUploadMethod,
2378
- j as globalLabelField,
2379
- k as globalValueField,
2380
- Vl as handleParams,
2381
- xl as initRouteMeta,
2382
- sl as initRules,
2383
- Ol as install,
2384
- ye as orderEnum,
2385
- Wt as permissionDirective,
2386
- Le as registerDialogInstance,
2387
- X as registerDirectives,
2388
- ql as registryUpload,
2389
- jt as setupConfig,
2390
- Bl as setupOptions,
2384
+ ll as getGlobalApp,
2385
+ Bl as getHasPermission,
2386
+ je as getOptions,
2387
+ Xt as getUploadMethod,
2388
+ $ as globalLabelField,
2389
+ T as globalValueField,
2390
+ Ql as handleParams,
2391
+ tn as initRouteMeta,
2392
+ bl as initRules,
2393
+ Ml as install,
2394
+ me as orderEnum,
2395
+ tl as permissionDirective,
2396
+ He as registerDialogInstance,
2397
+ ee as registerDirectives,
2398
+ kl as registryUpload,
2399
+ Jt as setupConfig,
2400
+ Ll as setupOptions,
2391
2401
  Oe as toArray,
2392
- jl as useApiConfig,
2393
- Tl as useCommonDialog,
2394
- Ll as useQRCode
2402
+ Jl as useApiConfig,
2403
+ Gl as useAuthPermission,
2404
+ Vl as useCommonDialog,
2405
+ jl as useQRCode
2395
2406
  };