@xmszm/core 0.0.1 → 0.0.3

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