urit-qf-ui 0.1.10 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,30 +1,33 @@
1
- var De = Object.defineProperty;
2
- var ke = (a, t, e) => t in a ? De(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
- var v = (a, t, e) => ke(a, typeof t != "symbol" ? t + "" : t, e);
4
- import Te, { ElMessage as he, ElMessageBox as ue } from "element-plus";
1
+ var Te = Object.defineProperty;
2
+ var Ve = (l, t, e) => t in l ? Te(l, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[t] = e;
3
+ var _ = (l, t, e) => Ve(l, typeof t != "symbol" ? t + "" : t, e);
4
+ import Pe, { ElMessage as ge, ElMessageBox as fe } from "element-plus";
5
5
  import "element-plus/dist/index.css";
6
- import { ElInput as Ve, ElInputNumber as Pe, ElSelect as le, ElOption as oe, ElSwitch as Ee, ElDatePicker as $e, ElDialog as Re, ElIcon as Ue, ElForm as Be, ElButton as Q, ElTable as Ae, ElTableColumn as Ie, ElPagination as Fe, ElDrawer as Le } from "element-plus/es";
6
+ import { ElInput as $e, ElInputNumber as Ie, ElSelect as ne, ElOption as ie, ElSwitch as Ee, ElDatePicker as Ae, ElMenu as Be, ElSubMenu as Re, ElMenuItem as Ue, ElIcon as ye, ElButton as Y, ElDialog as Me, ElForm as Le, ElTable as Fe, ElTableColumn as ze, ElPagination as qe, ElDrawer as Ne } from "element-plus/es";
7
7
  import "element-plus/es/components/base/style/css";
8
8
  import "element-plus/es/components/input/style/css";
9
- import { defineComponent as S, computed as g, openBlock as f, createElementBlock as p, normalizeClass as V, normalizeStyle as I, createTextVNode as U, toDisplayString as P, createElementVNode as C, createCommentVNode as T, createVNode as x, reactive as q, watch as M, withCtx as _, Fragment as $, renderList as F, createBlock as E, mergeProps as ge, ref as L, toRefs as qe, unref as A, renderSlot as N, markRaw as Me, resolveDynamicComponent as ie, onMounted as Z, withModifiers as fe } from "vue";
9
+ import { defineComponent as V, computed as y, openBlock as f, createElementBlock as h, normalizeClass as $, normalizeStyle as U, createTextVNode as B, toDisplayString as T, createElementVNode as x, createCommentVNode as D, createVNode as S, reactive as z, watch as F, withCtx as w, Fragment as I, renderList as M, createBlock as k, mergeProps as be, ref as q, markRaw as ve, onMounted as H, renderSlot as L, resolveDynamicComponent as O, toRefs as We, unref as R, withModifiers as me } from "vue";
10
10
  import "element-plus/es/components/input-number/style/css";
11
11
  import "element-plus/es/components/select/style/css";
12
12
  import "element-plus/es/components/option/style/css";
13
- import ye from "axios";
13
+ import we from "axios";
14
14
  import "element-plus/es/components/switch/style/css";
15
15
  import "element-plus/es/components/date-picker/style/css";
16
16
  import "element-plus/es/components/button/style/css";
17
+ import "element-plus/es/components/menu/style/css";
18
+ import "element-plus/es/components/sub-menu/style/css";
19
+ import "element-plus/es/components/menu-item/style/css";
20
+ import "element-plus/es/components/icon/style/css";
17
21
  import "element-plus/es/components/form/style/css";
18
22
  import "element-plus/es/components/dialog/style/css";
19
- import "element-plus/es/components/icon/style/css";
20
- import { Loading as me } from "@element-plus/icons-vue";
23
+ import { Loading as pe } from "@element-plus/icons-vue";
21
24
  import "element-plus/es/components/table/style/css";
22
25
  import "element-plus/es/components/table-column/style/css";
23
26
  import "element-plus/es/components/pagination/style/css";
24
27
  import "element-plus/es/components/drawer/style/css";
25
- import We from "mitt";
26
- import ze from "mqtt";
27
- const Ne = /* @__PURE__ */ S({
28
+ import je from "mitt";
29
+ import Oe from "mqtt";
30
+ const Ye = /* @__PURE__ */ V({
28
31
  __name: "UInput",
29
32
  props: {
30
33
  fieldLabel: {},
@@ -51,55 +54,55 @@ const Ne = /* @__PURE__ */ S({
51
54
  maxlength: {}
52
55
  },
53
56
  emits: ["update:modelValue"],
54
- setup(a, { emit: t }) {
55
- const e = a, l = t, s = g(() => {
56
- const c = {};
57
- return e.labelPosition === "left" && e.labelWidth && (c.width = typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth), e.labelAlign && (c.textAlign = e.labelAlign), c;
58
- }), d = g(() => ({
57
+ setup(l, { emit: t }) {
58
+ const e = l, o = t, c = y(() => {
59
+ const d = {};
60
+ return e.labelPosition === "left" && e.labelWidth && (d.width = typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth), e.labelAlign && (d.textAlign = e.labelAlign), d;
61
+ }), r = y(() => ({
59
62
  "u-input-label-left": e.labelPosition === "left",
60
63
  "u-input-label-top": e.labelPosition === "top"
61
- })), o = {
62
- onInput(c) {
63
- l("update:modelValue", c);
64
+ })), s = {
65
+ onInput(d) {
66
+ o("update:modelValue", d);
64
67
  }
65
68
  };
66
- return (c, n) => {
67
- const r = Ve;
68
- return f(), p("div", {
69
- class: V(["u-input", d.value])
69
+ return (d, a) => {
70
+ const i = $e;
71
+ return f(), h("div", {
72
+ class: $(["u-input", r.value])
70
73
  }, [
71
- a.fieldLabel ? (f(), p("div", {
74
+ l.fieldLabel ? (f(), h("div", {
72
75
  key: 0,
73
76
  class: "u-input-label",
74
- style: I(s.value)
77
+ style: U(c.value)
75
78
  }, [
76
- U(P(a.fieldLabel) + " ", 1),
77
- C("span", {
78
- class: V(["required-star", { "required-star--visible": a.required }])
79
+ B(T(l.fieldLabel) + " ", 1),
80
+ x("span", {
81
+ class: $(["required-star", { "required-star--visible": l.required }])
79
82
  }, "*", 2)
80
- ], 4)) : T("", !0),
81
- C("div", {
82
- class: V(["u-input-field", { "u-input-field--top": a.labelPosition === "top" }])
83
+ ], 4)) : D("", !0),
84
+ x("div", {
85
+ class: $(["u-input-field", { "u-input-field--top": l.labelPosition === "top" }])
83
86
  }, [
84
- x(r, {
85
- "model-value": a.modelValue,
86
- placeholder: a.placeholder,
87
- type: a.type,
88
- disabled: a.disable,
89
- readonly: a.readonly,
90
- maxlength: a.maxlength,
91
- "onUpdate:modelValue": o.onInput
87
+ S(i, {
88
+ "model-value": l.modelValue,
89
+ placeholder: l.placeholder,
90
+ type: l.type,
91
+ disabled: l.disable,
92
+ readonly: l.readonly,
93
+ maxlength: l.maxlength,
94
+ "onUpdate:modelValue": s.onInput
92
95
  }, null, 8, ["model-value", "placeholder", "type", "disabled", "readonly", "maxlength", "onUpdate:modelValue"])
93
96
  ], 2)
94
97
  ], 2);
95
98
  };
96
99
  }
97
- }), D = (a, t) => {
98
- const e = a.__vccOpts || a;
99
- for (const [l, s] of t)
100
- e[l] = s;
100
+ }), P = (l, t) => {
101
+ const e = l.__vccOpts || l;
102
+ for (const [o, c] of t)
103
+ e[o] = c;
101
104
  return e;
102
- }, Y = /* @__PURE__ */ D(Ne, [["__scopeId", "data-v-ecf5177c"]]), Oe = { class: "u-input-number-field" }, je = /* @__PURE__ */ S({
105
+ }, K = /* @__PURE__ */ P(Ye, [["__scopeId", "data-v-ecf5177c"]]), Qe = { class: "u-input-number-field" }, Ge = /* @__PURE__ */ V({
103
106
  __name: "UInputNumber",
104
107
  props: {
105
108
  fieldLabel: {},
@@ -126,172 +129,172 @@ const Ne = /* @__PURE__ */ S({
126
129
  precision: {}
127
130
  },
128
131
  emits: ["update:modelValue"],
129
- setup(a, { emit: t }) {
130
- const e = a, l = t, s = g(() => {
131
- const c = {};
132
- return e.labelPosition === "left" && e.labelWidth && (c.width = typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth), e.labelAlign && (c.textAlign = e.labelAlign), c;
133
- }), d = g(() => ({
132
+ setup(l, { emit: t }) {
133
+ const e = l, o = t, c = y(() => {
134
+ const d = {};
135
+ return e.labelPosition === "left" && e.labelWidth && (d.width = typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth), e.labelAlign && (d.textAlign = e.labelAlign), d;
136
+ }), r = y(() => ({
134
137
  "u-input-number-label-left": e.labelPosition === "left",
135
138
  "u-input-number-label-top": e.labelPosition === "top"
136
- })), o = {
137
- onUpdate(c) {
138
- l("update:modelValue", c === void 0 ? 0 : c);
139
+ })), s = {
140
+ onUpdate(d) {
141
+ o("update:modelValue", d === void 0 ? 0 : d);
139
142
  }
140
143
  };
141
- return (c, n) => {
142
- const r = Pe;
143
- return f(), p("div", {
144
- class: V(["u-input-number", d.value])
144
+ return (d, a) => {
145
+ const i = Ie;
146
+ return f(), h("div", {
147
+ class: $(["u-input-number", r.value])
145
148
  }, [
146
- a.fieldLabel ? (f(), p("div", {
149
+ l.fieldLabel ? (f(), h("div", {
147
150
  key: 0,
148
151
  class: "u-input-number-label",
149
- style: I(s.value)
152
+ style: U(c.value)
150
153
  }, [
151
- U(P(a.fieldLabel) + " ", 1),
152
- C("span", {
153
- class: V(["required-star", { "required-star--visible": a.required }])
154
+ B(T(l.fieldLabel) + " ", 1),
155
+ x("span", {
156
+ class: $(["required-star", { "required-star--visible": l.required }])
154
157
  }, "*", 2)
155
- ], 4)) : T("", !0),
156
- C("div", Oe, [
157
- x(r, {
158
- "model-value": a.modelValue,
159
- placeholder: a.placeholder || "请输入数值",
160
- disabled: a.disable,
161
- min: a.min,
162
- max: a.max,
163
- step: a.step,
164
- precision: a.precision,
158
+ ], 4)) : D("", !0),
159
+ x("div", Qe, [
160
+ S(i, {
161
+ "model-value": l.modelValue,
162
+ placeholder: l.placeholder || "请输入数值",
163
+ disabled: l.disable,
164
+ min: l.min,
165
+ max: l.max,
166
+ step: l.step,
167
+ precision: l.precision,
165
168
  controls: !0,
166
169
  "controls-position": "right",
167
170
  style: { width: "100%" },
168
- onChange: o.onUpdate
171
+ onChange: s.onUpdate
169
172
  }, null, 8, ["model-value", "placeholder", "disabled", "min", "max", "step", "precision", "onChange"])
170
173
  ])
171
174
  ], 2);
172
175
  };
173
176
  }
174
- }), be = /* @__PURE__ */ D(je, [["__scopeId", "data-v-cb70bd5b"]]), O = ye.create({
177
+ }), xe = /* @__PURE__ */ P(Ge, [["__scopeId", "data-v-cb70bd5b"]]), Q = we.create({
175
178
  timeout: 3e4,
176
179
  headers: {
177
180
  "Content-Type": "application/json"
178
181
  }
179
182
  });
180
- O.interceptors.request.use(
181
- (a) => {
183
+ Q.interceptors.request.use(
184
+ (l) => {
182
185
  const t = localStorage.getItem("token");
183
- return t && (a.headers.Authorization = `Bearer ${t}`), a;
186
+ return t && (l.headers.Authorization = `Bearer ${t}`), l;
184
187
  },
185
- (a) => Promise.reject(a)
188
+ (l) => Promise.reject(l)
186
189
  );
187
- O.interceptors.response.use(
188
- (a) => {
189
- const t = a.data;
190
+ Q.interceptors.response.use(
191
+ (l) => {
192
+ const t = l.data;
190
193
  if (t && typeof t == "object" && !Array.isArray(t)) {
191
194
  if (t.status === void 0 && t.code !== void 0) {
192
- const e = t.code, l = e === 0 || e === 200 || Number(e) === 0 || Number(e) === 200;
193
- t.status = l ? 200 : Number(e);
195
+ const e = t.code, o = e === 0 || e === 200 || Number(e) === 0 || Number(e) === 200;
196
+ t.status = o ? 200 : Number(e);
194
197
  }
195
198
  if (t.status !== void 0 && t.status !== 200) {
196
199
  const e = t.message || "请求失败";
197
200
  return console.error("[HTTP Error]", e), Promise.reject(new Error(e));
198
201
  }
199
202
  }
200
- return a;
203
+ return l;
201
204
  },
202
- (a) => {
203
- var e, l;
204
- const t = ((l = (e = a.response) == null ? void 0 : e.data) == null ? void 0 : l.message) || a.message || "请求失败";
205
- return console.error("[HTTP Error]", t), Promise.reject(a);
205
+ (l) => {
206
+ var e, o;
207
+ const t = ((o = (e = l.response) == null ? void 0 : e.data) == null ? void 0 : o.message) || l.message || "请求失败";
208
+ return console.error("[HTTP Error]", t), Promise.reject(l);
206
209
  }
207
210
  );
208
- const R = {
209
- get(a, t) {
210
- return O.get(a, t).then((e) => e.data);
211
+ const A = {
212
+ get(l, t) {
213
+ return Q.get(l, t).then((e) => e.data);
211
214
  },
212
- post(a, t, e) {
213
- return O.post(a, t, e).then((l) => l.data);
215
+ post(l, t, e) {
216
+ return Q.post(l, t, e).then((o) => o.data);
214
217
  },
215
218
  // 原始 axios 实例,用于特殊需求
216
- instance: O
217
- }, z = {
218
- formCfgApi(a) {
219
- return `/api/form?file-id=${a}`;
219
+ instance: Q
220
+ }, N = {
221
+ formCfgApi(l) {
222
+ return `/api/form?file-id=${l}`;
220
223
  },
221
224
  // 获取字典数据(单一/级联共用接口,返回树形结构)
222
- dictApi(a) {
223
- return `/api/dict/tree-list?dict_type=${a}&children=true`;
225
+ dictApi(l) {
226
+ return `/api/dict/tree-list?dict_type=${l}&children=true`;
224
227
  },
225
228
  // 获取级联数据(与单一字典共用接口)
226
- cascaderApi(a) {
227
- return `/api/dict/tree-list?dict_type=${a}&children=true`;
229
+ cascaderApi(l) {
230
+ return `/api/dict/tree-list?dict_type=${l}&children=true`;
228
231
  }
229
- }, X = {}, K = {};
230
- function ve(a) {
231
- const { children: t, ...e } = a;
232
+ }, te = {}, X = {};
233
+ function Ce(l) {
234
+ const { children: t, ...e } = l;
232
235
  return {
233
- label: a.label ?? a.dict_value ?? String(a.value ?? ""),
234
- value: a.value ?? a.dict_code,
236
+ label: l.label ?? l.dict_value ?? String(l.value ?? ""),
237
+ value: l.value ?? l.dict_code,
235
238
  ...e
236
239
  };
237
240
  }
238
- function we(a) {
239
- return Array.isArray(a) ? a.map((t) => {
241
+ function se(l) {
242
+ return Array.isArray(l) ? l.map((t) => {
240
243
  if (!t || typeof t != "object") return t;
241
- const e = ve(t), l = t.children;
242
- return Array.isArray(l) && l.length > 0 && (e.children = we(l)), e;
244
+ const e = Ce(t), o = t.children;
245
+ return Array.isArray(o) && o.length > 0 && (e.children = se(o)), e;
243
246
  }) : [];
244
247
  }
245
- function ne(a) {
246
- if (!Array.isArray(a)) return [];
247
- const t = [], e = (l) => {
248
- for (const s of l) {
249
- if (!s || typeof s != "object") continue;
250
- const d = s.children;
251
- t.push(ve(s)), Array.isArray(d) && d.length > 0 && e(d);
248
+ function re(l) {
249
+ if (!Array.isArray(l)) return [];
250
+ const t = [], e = (o) => {
251
+ for (const c of o) {
252
+ if (!c || typeof c != "object") continue;
253
+ const r = c.children;
254
+ t.push(Ce(c)), Array.isArray(r) && r.length > 0 && e(r);
252
255
  }
253
256
  };
254
- return e(a), t;
257
+ return e(l), t;
255
258
  }
256
- async function ee(a) {
257
- if (!a)
259
+ async function ae(l) {
260
+ if (!l)
258
261
  return [];
259
- if (X[a])
260
- return X[a];
261
- if (a in K)
262
- return await K[a];
262
+ if (te[l])
263
+ return te[l];
264
+ if (l in X)
265
+ return await X[l];
263
266
  const t = (async () => {
264
267
  try {
265
- const e = await R.get(z.dictApi(a));
268
+ const e = await A.get(N.dictApi(l));
266
269
  if (e.status === 200) {
267
- const l = ne(e.data);
268
- return X[a] = l, l;
270
+ const o = re(e.data);
271
+ return te[l] = o, o;
269
272
  }
270
273
  return [];
271
274
  } catch (e) {
272
- return console.error(`[dict] 加载字典 ${a} 失败:`, e), [];
275
+ return console.error(`[dict] 加载字典 ${l} 失败:`, e), [];
273
276
  } finally {
274
- delete K[a];
277
+ delete X[l];
275
278
  }
276
279
  })();
277
- return K[a] = t, t;
280
+ return X[l] = t, t;
278
281
  }
279
- async function Ye(a, t, e = "") {
282
+ async function He(l, t, e = "") {
280
283
  if (t == null || t === "")
281
284
  return e;
282
- const l = X[a];
283
- if (l && l.length > 0)
284
- return pe(l, t);
285
- const s = await ee(a);
286
- return s && s.length > 0 ? pe(s, t) : e || String(t);
285
+ const o = te[l];
286
+ if (o && o.length > 0)
287
+ return he(o, t);
288
+ const c = await ae(l);
289
+ return c && c.length > 0 ? he(c, t) : e || String(t);
287
290
  }
288
- function pe(a, t) {
289
- const e = a.find(
290
- (l) => l.value === t || String(l.value) === String(t)
291
+ function he(l, t) {
292
+ const e = l.find(
293
+ (o) => o.value === t || String(o.value) === String(t)
291
294
  );
292
295
  return e ? e.label : String(t);
293
296
  }
294
- const Qe = { class: "u-dict-field" }, Ge = /* @__PURE__ */ S({
297
+ const Ke = { class: "u-dict-field" }, Je = /* @__PURE__ */ V({
295
298
  __name: "UDict",
296
299
  props: {
297
300
  fieldLabel: {},
@@ -315,67 +318,67 @@ const Qe = { class: "u-dict-field" }, Ge = /* @__PURE__ */ S({
315
318
  dictType: {}
316
319
  },
317
320
  emits: ["update:modelValue"],
318
- setup(a, { emit: t }) {
319
- const e = a, l = t, s = q({
321
+ setup(l, { emit: t }) {
322
+ const e = l, o = t, c = z({
320
323
  excluded: ["fieldLabel", "labelPosition", "labelWidth", "labelAlign", "required", "modelValue", "dictType"],
321
324
  options: [],
322
325
  loading: !1
323
- }), d = async () => {
326
+ }), r = async () => {
324
327
  if (e.dictType) {
325
- s.loading = !0;
328
+ c.loading = !0;
326
329
  try {
327
- const r = await R.get(z.dictApi(e.dictType));
328
- r.status === 200 ? s.options = ne(r.data) : (console.error("[UDict] 请求失败:", r.message), s.options = []);
329
- } catch (r) {
330
- console.error("[UDict] 加载字典失败:", r), s.options = [];
330
+ const i = await A.get(N.dictApi(e.dictType));
331
+ i.status === 200 ? c.options = re(i.data) : (console.error("[UDict] 请求失败:", i.message), c.options = []);
332
+ } catch (i) {
333
+ console.error("[UDict] 加载字典失败:", i), c.options = [];
331
334
  } finally {
332
- s.loading = !1;
335
+ c.loading = !1;
333
336
  }
334
337
  }
335
338
  };
336
- M(() => e.dictType, () => {
337
- d();
339
+ F(() => e.dictType, () => {
340
+ r();
338
341
  }, { immediate: !0 });
339
- const o = g(() => {
340
- const r = {};
341
- return e.labelPosition === "left" && e.labelWidth && (r.width = typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth), e.labelAlign && (r.textAlign = e.labelAlign), r;
342
- }), c = g(() => ({
342
+ const s = y(() => {
343
+ const i = {};
344
+ return e.labelPosition === "left" && e.labelWidth && (i.width = typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth), e.labelAlign && (i.textAlign = e.labelAlign), i;
345
+ }), d = y(() => ({
343
346
  "u-dict-label-left": e.labelPosition === "left",
344
347
  "u-dict-label-top": e.labelPosition === "top"
345
- })), n = {
346
- onUpdate(r) {
347
- l("update:modelValue", r);
348
+ })), a = {
349
+ onUpdate(i) {
350
+ o("update:modelValue", i);
348
351
  }
349
352
  };
350
- return (r, i) => {
351
- const u = oe, m = le;
352
- return f(), p("div", {
353
- class: V(["u-dict", c.value])
353
+ return (i, n) => {
354
+ const u = ie, m = ne;
355
+ return f(), h("div", {
356
+ class: $(["u-dict", d.value])
354
357
  }, [
355
- a.fieldLabel ? (f(), p("div", {
358
+ l.fieldLabel ? (f(), h("div", {
356
359
  key: 0,
357
360
  class: "u-dict-label",
358
- style: I(o.value)
361
+ style: U(s.value)
359
362
  }, [
360
- U(P(a.fieldLabel) + " ", 1),
361
- C("span", {
362
- class: V(["required-star", { "required-star--visible": a.required }])
363
+ B(T(l.fieldLabel) + " ", 1),
364
+ x("span", {
365
+ class: $(["required-star", { "required-star--visible": l.required }])
363
366
  }, "*", 2)
364
- ], 4)) : T("", !0),
365
- C("div", Qe, [
366
- x(m, {
367
- "model-value": a.modelValue,
368
- placeholder: a.placeholder || "请选择",
369
- loading: s.loading,
370
- disabled: a.disable,
367
+ ], 4)) : D("", !0),
368
+ x("div", Ke, [
369
+ S(m, {
370
+ "model-value": l.modelValue,
371
+ placeholder: l.placeholder || "请选择",
372
+ loading: c.loading,
373
+ disabled: l.disable,
371
374
  style: { width: "100%" },
372
- onChange: n.onUpdate
375
+ onChange: a.onUpdate
373
376
  }, {
374
- default: _(() => [
375
- (f(!0), p($, null, F(s.options, (y) => (f(), E(u, {
376
- key: y.value,
377
- label: y.label,
378
- value: y.value
377
+ default: w(() => [
378
+ (f(!0), h(I, null, M(c.options, (g) => (f(), k(u, {
379
+ key: g.value,
380
+ label: g.label,
381
+ value: g.value
379
382
  }, null, 8, ["label", "value"]))), 128))
380
383
  ]),
381
384
  _: 1
@@ -384,7 +387,7 @@ const Qe = { class: "u-dict-field" }, Ge = /* @__PURE__ */ S({
384
387
  ], 2);
385
388
  };
386
389
  }
387
- }), j = /* @__PURE__ */ D(Ge, [["__scopeId", "data-v-239bb25f"]]), Ke = { class: "u-toggle-field" }, He = /* @__PURE__ */ S({
390
+ }), G = /* @__PURE__ */ P(Je, [["__scopeId", "data-v-239bb25f"]]), Xe = { class: "u-toggle-field" }, Ze = /* @__PURE__ */ V({
388
391
  __name: "UToggle",
389
392
  props: {
390
393
  fieldLabel: {},
@@ -407,53 +410,53 @@ const Qe = { class: "u-dict-field" }, Ge = /* @__PURE__ */ S({
407
410
  inactiveColor: {}
408
411
  },
409
412
  emits: ["update:modelValue"],
410
- setup(a, { emit: t }) {
411
- const e = a, l = t, s = q({
413
+ setup(l, { emit: t }) {
414
+ const e = l, o = t, c = z({
412
415
  excluded: ["fieldLabel", "labelPosition", "labelWidth", "labelAlign", "required", "modelValue", "trueValue", "falseValue", "activeText", "inactiveText", "activeColor", "inactiveColor"]
413
- }), d = () => {
414
- const n = {};
415
- return e.labelPosition === "left" && e.labelWidth && (n.width = typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth), e.labelAlign && (n.textAlign = e.labelAlign), n;
416
- }, o = g({
416
+ }), r = () => {
417
+ const a = {};
418
+ return e.labelPosition === "left" && e.labelWidth && (a.width = typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth), e.labelAlign && (a.textAlign = e.labelAlign), a;
419
+ }, s = y({
417
420
  get: () => e.modelValue === e.trueValue,
418
- set: (n) => {
419
- l("update:modelValue", n ? e.trueValue : e.falseValue);
421
+ set: (a) => {
422
+ o("update:modelValue", a ? e.trueValue : e.falseValue);
420
423
  }
421
- }), c = g(() => {
422
- const n = {};
423
- for (const r in e)
424
- !s.excluded.includes(r) && r !== "modelValue" && (n[r] = e[r]);
425
- return n;
424
+ }), d = y(() => {
425
+ const a = {};
426
+ for (const i in e)
427
+ !c.excluded.includes(i) && i !== "modelValue" && (a[i] = e[i]);
428
+ return a;
426
429
  });
427
- return (n, r) => {
428
- const i = Ee;
429
- return f(), p("div", {
430
- class: V(["u-toggle", { "u-toggle-label-left": a.labelPosition === "left" }])
430
+ return (a, i) => {
431
+ const n = Ee;
432
+ return f(), h("div", {
433
+ class: $(["u-toggle", { "u-toggle-label-left": l.labelPosition === "left" }])
431
434
  }, [
432
- a.fieldLabel ? (f(), p("div", {
435
+ l.fieldLabel ? (f(), h("div", {
433
436
  key: 0,
434
437
  class: "u-toggle-label",
435
- style: I(d())
438
+ style: U(r())
436
439
  }, [
437
- U(P(a.fieldLabel) + " ", 1),
438
- C("span", {
439
- class: V(["required-star", { "required-star--visible": a.required }])
440
+ B(T(l.fieldLabel) + " ", 1),
441
+ x("span", {
442
+ class: $(["required-star", { "required-star--visible": l.required }])
440
443
  }, "*", 2)
441
- ], 4)) : T("", !0),
442
- C("div", Ke, [
443
- x(i, ge({
444
- modelValue: o.value,
445
- "onUpdate:modelValue": r[0] || (r[0] = (u) => o.value = u)
446
- }, c.value, {
447
- "active-text": a.activeText,
448
- "inactive-text": a.inactiveText,
449
- "active-color": a.activeColor,
450
- "inactive-color": a.inactiveColor
444
+ ], 4)) : D("", !0),
445
+ x("div", Xe, [
446
+ S(n, be({
447
+ modelValue: s.value,
448
+ "onUpdate:modelValue": i[0] || (i[0] = (u) => s.value = u)
449
+ }, d.value, {
450
+ "active-text": l.activeText,
451
+ "inactive-text": l.inactiveText,
452
+ "active-color": l.activeColor,
453
+ "inactive-color": l.inactiveColor
451
454
  }), null, 16, ["modelValue", "active-text", "inactive-text", "active-color", "inactive-color"])
452
455
  ])
453
456
  ], 2);
454
457
  };
455
458
  }
456
- }), Ce = /* @__PURE__ */ D(He, [["__scopeId", "data-v-94c1fd38"]]), Je = { class: "u-cascader-levels" }, Xe = /* @__PURE__ */ S({
459
+ }), _e = /* @__PURE__ */ P(Ze, [["__scopeId", "data-v-94c1fd38"]]), et = { class: "u-cascader-levels" }, tt = /* @__PURE__ */ V({
457
460
  __name: "UCascader",
458
461
  props: {
459
462
  fieldLabel: {},
@@ -466,64 +469,64 @@ const Qe = { class: "u-dict-field" }, Ge = /* @__PURE__ */ S({
466
469
  depth: { default: 1 }
467
470
  },
468
471
  emits: ["update:modelValue"],
469
- setup(a, { emit: t }) {
470
- const e = a, l = t, s = () => {
471
- const n = {};
472
- return e.labelPosition === "left" && e.labelWidth && (n.width = typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth), e.labelAlign && (n.textAlign = e.labelAlign), n;
473
- }, d = L([]), o = g(() => {
474
- const n = [];
475
- let r = e.options || [];
476
- for (let i = 0; i < e.depth; i++)
477
- if (n.push(r), d.value[i] !== void 0) {
478
- const u = r.find((m) => m.value === d.value[i]);
479
- u && u.children ? r = u.children : r = [];
472
+ setup(l, { emit: t }) {
473
+ const e = l, o = t, c = () => {
474
+ const a = {};
475
+ return e.labelPosition === "left" && e.labelWidth && (a.width = typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth), e.labelAlign && (a.textAlign = e.labelAlign), a;
476
+ }, r = q([]), s = y(() => {
477
+ const a = [];
478
+ let i = e.options || [];
479
+ for (let n = 0; n < e.depth; n++)
480
+ if (a.push(i), r.value[n] !== void 0) {
481
+ const u = i.find((m) => m.value === r.value[n]);
482
+ u && u.children ? i = u.children : i = [];
480
483
  } else
481
- r = [];
482
- return n;
484
+ i = [];
485
+ return a;
483
486
  });
484
- M(() => e.modelValue, (n) => {
485
- n != null ? d.value = Array.isArray(n) ? n : [n] : d.value = [];
487
+ F(() => e.modelValue, (a) => {
488
+ a != null ? r.value = Array.isArray(a) ? a : [a] : r.value = [];
486
489
  }, { immediate: !0 });
487
- const c = (n, r) => {
488
- d.value[n] = r;
489
- for (let u = n + 1; u < e.depth; u++)
490
- d.value[u] = void 0;
491
- const i = d.value.filter((u) => u !== void 0);
492
- l("update:modelValue", i);
490
+ const d = (a, i) => {
491
+ r.value[a] = i;
492
+ for (let u = a + 1; u < e.depth; u++)
493
+ r.value[u] = void 0;
494
+ const n = r.value.filter((u) => u !== void 0);
495
+ o("update:modelValue", n);
493
496
  };
494
- return (n, r) => {
495
- const i = oe, u = le;
496
- return f(), p("div", {
497
- class: V(["u-cascader", { "u-cascader-label-left": a.labelPosition === "left" }])
497
+ return (a, i) => {
498
+ const n = ie, u = ne;
499
+ return f(), h("div", {
500
+ class: $(["u-cascader", { "u-cascader-label-left": l.labelPosition === "left" }])
498
501
  }, [
499
- a.fieldLabel ? (f(), p("div", {
502
+ l.fieldLabel ? (f(), h("div", {
500
503
  key: 0,
501
504
  class: "u-cascader-label",
502
- style: I(s())
505
+ style: U(c())
503
506
  }, [
504
- U(P(a.fieldLabel) + " ", 1),
505
- C("span", {
506
- class: V(["required-star", { "required-star--visible": a.required }])
507
+ B(T(l.fieldLabel) + " ", 1),
508
+ x("span", {
509
+ class: $(["required-star", { "required-star--visible": l.required }])
507
510
  }, "*", 2)
508
- ], 4)) : T("", !0),
509
- C("div", Je, [
510
- (f(!0), p($, null, F(a.depth, (m) => (f(), p("div", {
511
+ ], 4)) : D("", !0),
512
+ x("div", et, [
513
+ (f(!0), h(I, null, M(l.depth, (m) => (f(), h("div", {
511
514
  key: m - 1,
512
515
  class: "u-cascader-level"
513
516
  }, [
514
- x(u, {
515
- "model-value": d.value[m - 1],
516
- options: o.value[m - 1] || [],
517
- disabled: m > 1 && d.value[m - 2] === void 0,
517
+ S(u, {
518
+ "model-value": r.value[m - 1],
519
+ options: s.value[m - 1] || [],
520
+ disabled: m > 1 && r.value[m - 2] === void 0,
518
521
  placeholder: `请选择${m}级`,
519
522
  style: { width: "100%" },
520
- onChange: (y) => c(m - 1, y)
523
+ onChange: (g) => d(m - 1, g)
521
524
  }, {
522
- default: _(() => [
523
- (f(!0), p($, null, F(o.value[m - 1] || [], (y) => (f(), E(i, {
524
- key: y.value,
525
- label: y.label,
526
- value: y.value
525
+ default: w(() => [
526
+ (f(!0), h(I, null, M(s.value[m - 1] || [], (g) => (f(), k(n, {
527
+ key: g.value,
528
+ label: g.label,
529
+ value: g.value
527
530
  }, null, 8, ["label", "value"]))), 128))
528
531
  ]),
529
532
  _: 2
@@ -533,7 +536,7 @@ const Qe = { class: "u-dict-field" }, Ge = /* @__PURE__ */ S({
533
536
  ], 2);
534
537
  };
535
538
  }
536
- }), xe = /* @__PURE__ */ D(Xe, [["__scopeId", "data-v-d66c339c"]]), Ze = { class: "u-date-field" }, et = /* @__PURE__ */ S({
539
+ }), Se = /* @__PURE__ */ P(tt, [["__scopeId", "data-v-d66c339c"]]), at = { class: "u-date-field" }, ot = /* @__PURE__ */ V({
537
540
  __name: "UDate",
538
541
  props: {
539
542
  fieldLabel: {},
@@ -549,62 +552,445 @@ const Qe = { class: "u-dict-field" }, Ge = /* @__PURE__ */ S({
549
552
  max: {}
550
553
  },
551
554
  emits: ["update:modelValue"],
552
- setup(a, { emit: t }) {
553
- const e = a, l = t, s = () => {
554
- const n = {};
555
- return e.labelPosition === "left" && e.labelWidth && (n.width = typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth), e.labelAlign && (n.textAlign = e.labelAlign), n;
556
- }, d = L("");
557
- M(() => e.modelValue, (n) => {
558
- e.mode === "single" ? d.value = n || "" : e.mode === "multiple" ? d.value = Array.isArray(n) ? n : n ? [n] : [] : e.mode === "range" && (n && typeof n == "object" && n.from && n.to ? d.value = [n.from, n.to] : d.value = []);
555
+ setup(l, { emit: t }) {
556
+ const e = l, o = t, c = () => {
557
+ const a = {};
558
+ return e.labelPosition === "left" && e.labelWidth && (a.width = typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth), e.labelAlign && (a.textAlign = e.labelAlign), a;
559
+ }, r = q("");
560
+ F(() => e.modelValue, (a) => {
561
+ e.mode === "single" ? r.value = a || "" : e.mode === "multiple" ? r.value = Array.isArray(a) ? a : a ? [a] : [] : e.mode === "range" && (a && typeof a == "object" && a.from && a.to ? r.value = [a.from, a.to] : r.value = []);
559
562
  }, { immediate: !0 });
560
- const o = (n) => {
561
- n && (e.mode === "single" || e.mode === "multiple" ? l("update:modelValue", n) : e.mode === "range" && n && n.length === 2 && l("update:modelValue", { from: n[0], to: n[1] }));
562
- }, c = g(() => e.mode === "range" ? "daterange" : e.mode === "multiple" ? "dates" : "date");
563
- return (n, r) => {
564
- const i = $e;
565
- return f(), p("div", {
566
- class: V(["u-date", { "u-date-label-left": a.labelPosition === "left" }])
563
+ const s = (a) => {
564
+ a && (e.mode === "single" || e.mode === "multiple" ? o("update:modelValue", a) : e.mode === "range" && a && a.length === 2 && o("update:modelValue", { from: a[0], to: a[1] }));
565
+ }, d = y(() => e.mode === "range" ? "daterange" : e.mode === "multiple" ? "dates" : "date");
566
+ return (a, i) => {
567
+ const n = Ae;
568
+ return f(), h("div", {
569
+ class: $(["u-date", { "u-date-label-left": l.labelPosition === "left" }])
567
570
  }, [
568
- a.fieldLabel ? (f(), p("div", {
571
+ l.fieldLabel ? (f(), h("div", {
569
572
  key: 0,
570
573
  class: "u-date-label",
571
- style: I(s())
574
+ style: U(c())
572
575
  }, [
573
- U(P(a.fieldLabel) + " ", 1),
574
- C("span", {
575
- class: V(["required-star", { "required-star--visible": a.required }])
576
+ B(T(l.fieldLabel) + " ", 1),
577
+ x("span", {
578
+ class: $(["required-star", { "required-star--visible": l.required }])
576
579
  }, "*", 2)
577
- ], 4)) : T("", !0),
578
- C("div", Ze, [
579
- x(i, {
580
- modelValue: d.value,
581
- "onUpdate:modelValue": r[0] || (r[0] = (u) => d.value = u),
582
- type: c.value,
583
- placeholder: a.locale === "en-US" ? "Select date" : "选择日期",
584
- "range-separator": a.locale === "en-US" ? "to" : "至",
585
- "start-placeholder": a.locale === "en-US" ? "Start date" : "开始日期",
586
- "end-placeholder": a.locale === "en-US" ? "End date" : "结束日期",
587
- format: a.mask.replace("YYYY", "YYYY").replace("MM", "MM").replace("DD", "DD"),
588
- "value-format": a.mask.replace("YYYY", "YYYY").replace("MM", "MM").replace("DD", "DD"),
589
- onChange: o
580
+ ], 4)) : D("", !0),
581
+ x("div", at, [
582
+ S(n, {
583
+ modelValue: r.value,
584
+ "onUpdate:modelValue": i[0] || (i[0] = (u) => r.value = u),
585
+ type: d.value,
586
+ placeholder: l.locale === "en-US" ? "Select date" : "选择日期",
587
+ "range-separator": l.locale === "en-US" ? "to" : "至",
588
+ "start-placeholder": l.locale === "en-US" ? "Start date" : "开始日期",
589
+ "end-placeholder": l.locale === "en-US" ? "End date" : "结束日期",
590
+ format: l.mask.replace("YYYY", "YYYY").replace("MM", "MM").replace("DD", "DD"),
591
+ "value-format": l.mask.replace("YYYY", "YYYY").replace("MM", "MM").replace("DD", "DD"),
592
+ onChange: s
590
593
  }, null, 8, ["modelValue", "type", "placeholder", "range-separator", "start-placeholder", "end-placeholder", "format", "value-format"])
591
594
  ])
592
595
  ], 2);
593
596
  };
594
597
  }
595
- }), te = /* @__PURE__ */ D(et, [["__scopeId", "data-v-9cd05064"]]), tt = {
598
+ }), oe = /* @__PURE__ */ P(ot, [["__scopeId", "data-v-9cd05064"]]);
599
+ function J(l, t = "info") {
600
+ ge({
601
+ message: l,
602
+ type: t,
603
+ duration: 1e3,
604
+ showClose: !1
605
+ });
606
+ }
607
+ function E(l) {
608
+ ge({
609
+ message: l,
610
+ type: "error",
611
+ duration: 2e3,
612
+ showClose: !1
613
+ });
614
+ }
615
+ function lt(l) {
616
+ J(l, "success");
617
+ }
618
+ function nt(l) {
619
+ J(l, "error");
620
+ }
621
+ function it(l) {
622
+ J(l, "warning");
623
+ }
624
+ function st(l) {
625
+ J(l, "info");
626
+ }
627
+ const j = {
628
+ notify: J,
629
+ success: lt,
630
+ error: nt,
631
+ warning: it,
632
+ info: st,
633
+ alertError: E
634
+ }, rt = {
635
+ key: 0,
636
+ class: "u-menu-brand"
637
+ }, dt = ["src"], ct = { class: "u-menu-brand-text" }, ut = {
638
+ key: 1,
639
+ class: "u-menu-logout"
640
+ }, ft = /* @__PURE__ */ V({
641
+ __name: "UMenu",
642
+ props: {
643
+ menuId: { default: "menu" },
644
+ config: {},
645
+ mode: {},
646
+ projectName: {},
647
+ activePath: {},
648
+ width: {}
649
+ },
650
+ emits: ["menu-click", "logout"],
651
+ setup(l, { expose: t, emit: e }) {
652
+ const o = l, c = e, r = z({
653
+ // 菜单配置
654
+ config: null,
655
+ // 实际渲染的菜单列表(静态配置或字典菜单)
656
+ menus: [],
657
+ // 当前激活的跳转目标
658
+ activePath: "",
659
+ // 图标映射(@element-plus/icons-vue 的具名导出)
660
+ iconMap: {},
661
+ // 图标是否已加载
662
+ iconsLoaded: !1
663
+ }), s = y(() => {
664
+ var a, i, n, u, m, g, b, p;
665
+ return {
666
+ // 项目名称:为空则不显示
667
+ projectName: o.projectName ?? ((a = r.config) == null ? void 0 : a.projectName) ?? "",
668
+ // 项目 logo
669
+ logo: ((i = r.config) == null ? void 0 : i.logo) || "",
670
+ // 菜单模式
671
+ mode: o.mode ?? ((n = r.config) == null ? void 0 : n.mode) ?? "sidebar",
672
+ // 是否水平模式
673
+ isHorizontal: (o.mode ?? ((u = r.config) == null ? void 0 : u.mode) ?? "sidebar") === "horizontal",
674
+ // el-menu 的 mode
675
+ elMode: (o.mode ?? ((m = r.config) == null ? void 0 : m.mode) ?? "sidebar") === "horizontal" ? "horizontal" : "vertical",
676
+ // 菜单宽度(仅 sidebar 生效)
677
+ width: o.width ?? ((g = r.config) == null ? void 0 : g.width) ?? 220,
678
+ // 菜单列表
679
+ menus: r.menus,
680
+ // 当前激活项的 el-menu index
681
+ activeIndex: d.getIndexByPath(r.activePath),
682
+ // 是否显示退出登录区域
683
+ showLogout: ((b = r.config) == null ? void 0 : b.showLogout) !== !1,
684
+ // 退出登录按钮文本
685
+ logoutText: ((p = r.config) == null ? void 0 : p.logoutText) || "退出登录",
686
+ // 图标映射
687
+ iconMap: r.iconMap
688
+ };
689
+ }), d = {
690
+ // 初始化
691
+ async init() {
692
+ await d.ensureIcons(), o.config ? (r.config = o.config, r.menus = d.normalizeMenus(o.config.menus)) : await d.loadConfig(o.menuId), r.activePath = o.activePath || r.activePath;
693
+ },
694
+ // 加载菜单配置(与 UDict 一致:http + status === 200 判断)
695
+ async loadConfig(a) {
696
+ if (a)
697
+ try {
698
+ const i = await A.get(N.formCfgApi(a));
699
+ if (i.status !== 200) {
700
+ E(i.message || "获取菜单配置失败");
701
+ return;
702
+ }
703
+ const n = i.data || {};
704
+ r.config = n, n.dictType ? await d.loadDictMenus(n.dictType) : r.menus = d.normalizeMenus(n.menus);
705
+ } catch (i) {
706
+ E((i == null ? void 0 : i.message) || "获取菜单配置失败"), r.menus = [];
707
+ }
708
+ },
709
+ // 加载字典菜单(参考 UDict 的字典数据来源,字典树对应菜单的 1、2 级)
710
+ async loadDictMenus(a) {
711
+ try {
712
+ const i = await A.get(N.dictApi(a));
713
+ if (i.status !== 200) {
714
+ E(i.message || "获取菜单字典失败");
715
+ return;
716
+ }
717
+ r.menus = d.normalizeMenus(se(i.data));
718
+ } catch (i) {
719
+ E((i == null ? void 0 : i.message) || "获取菜单字典失败"), r.menus = [];
720
+ }
721
+ },
722
+ // 规范化菜单列表(最多 2 级,第二级的 children 不再展开)
723
+ normalizeMenus(a) {
724
+ return Array.isArray(a) ? a.map((i) => d.normalizeMenuNode(i)).filter(Boolean) : [];
725
+ },
726
+ // 规范化单个菜单节点(兼容静态配置与字典节点两种结构)
727
+ normalizeMenuNode(a) {
728
+ if (!a || typeof a != "object") return null;
729
+ const i = d.parseInfo(a.info), n = a.label ?? a.dict_value ?? a.name;
730
+ if (!n) return null;
731
+ const u = i.path ?? a.path ?? a.dict_code ?? a.value ?? "", m = i.type ?? a.type ?? "route", g = {
732
+ ...a,
733
+ label: String(n),
734
+ type: m,
735
+ path: String(u ?? ""),
736
+ icon: i.icon ?? a.icon ?? ""
737
+ };
738
+ delete g.children;
739
+ const b = a.children;
740
+ return Array.isArray(b) && b.length > 0 && (g.children = b.map((p) => d.normalizeMenuNode(p)).filter(Boolean)), g;
741
+ },
742
+ // 解析字典节点的 info(可能是 JSON 字符串,也可能是对象)
743
+ parseInfo(a) {
744
+ if (!a) return {};
745
+ if (typeof a == "object") return a;
746
+ if (typeof a == "string")
747
+ try {
748
+ const i = JSON.parse(a);
749
+ return i && typeof i == "object" ? i : {};
750
+ } catch {
751
+ return { path: a };
752
+ }
753
+ return {};
754
+ },
755
+ // 生成 el-menu 的 index(一级)
756
+ itemIndex(a, i) {
757
+ return a.path || `menu-${i}`;
758
+ },
759
+ // 生成 el-menu 的 index(二级)
760
+ childIndex(a, i, n, u) {
761
+ return n.path ? n.path : `${d.itemIndex(a, i)}-${u}`;
762
+ },
763
+ // 是否有二级菜单(最多支持 2 级)
764
+ hasChildren(a) {
765
+ return Array.isArray(a.children) && a.children.length > 0;
766
+ },
767
+ // 根据跳转目标找到 el-menu index(用于 default-active)
768
+ getIndexByPath(a) {
769
+ if (!a) return "";
770
+ for (let i = 0; i < r.menus.length; i++) {
771
+ const n = r.menus[i];
772
+ if (n.path === a) return d.itemIndex(n, i);
773
+ const u = n.children || [];
774
+ for (let m = 0; m < u.length; m++)
775
+ if (u[m].path === a) return d.childIndex(n, i, u[m], m);
776
+ }
777
+ return "";
778
+ },
779
+ // 根据 el-menu index 找到菜单项
780
+ findItemByIndex(a, i) {
781
+ for (let n = 0; n < r.menus.length; n++) {
782
+ const u = r.menus[n], m = d.itemIndex(u, n);
783
+ if (m === a)
784
+ return { item: u, level: 1, indexPath: i || [m], index: a };
785
+ const g = u.children || [];
786
+ for (let b = 0; b < g.length; b++) {
787
+ const p = g[b], C = d.childIndex(u, n, p, b);
788
+ if (C === a)
789
+ return { item: p, level: 2, indexPath: i || [m, C], index: a };
790
+ }
791
+ }
792
+ return null;
793
+ },
794
+ // 解析跳转目标:外部可直接通过 type 判断跳转类型
795
+ resolveTarget(a) {
796
+ const i = a.type || "route", n = a.path || "";
797
+ return i === "url" ? { type: i, path: n, url: n } : i === "yaml" ? { type: i, path: n, fileId: a.fileId || n } : { type: "route", path: n, route: n };
798
+ },
799
+ // 菜单点击
800
+ handleSelect(a, i) {
801
+ const n = d.findItemByIndex(a, i);
802
+ if (!n || d.hasChildren(n.item)) return;
803
+ const u = d.resolveTarget(n.item);
804
+ r.activePath = n.item.path || a;
805
+ const m = {
806
+ ...u,
807
+ item: n.item,
808
+ level: n.level,
809
+ indexPath: n.indexPath,
810
+ index: a
811
+ };
812
+ c("menu-click", m);
813
+ },
814
+ // 退出登录
815
+ handleLogout() {
816
+ c("logout");
817
+ },
818
+ // 设置激活项
819
+ setActivePath(a) {
820
+ r.activePath = a;
821
+ },
822
+ // 加载图标(按需 import,避免无图标时把整包图标打进产物)
823
+ async ensureIcons() {
824
+ if (!r.iconsLoaded) {
825
+ r.iconsLoaded = !0;
826
+ try {
827
+ const a = await import("@element-plus/icons-vue"), i = a != null && a.default ? { ...a.default, ...a } : { ...a }, n = {};
828
+ for (const [u, m] of Object.entries(i))
829
+ n[u] = ve(m);
830
+ r.iconMap = n;
831
+ } catch (a) {
832
+ console.warn("[UMenu] @element-plus/icons-vue 不可用,菜单图标将被忽略", a);
833
+ }
834
+ }
835
+ },
836
+ // 取图标组件
837
+ getIcon(a) {
838
+ return a && r.iconMap[a] || null;
839
+ }
840
+ };
841
+ return F(() => o.menuId, (a) => {
842
+ o.config || d.loadConfig(a);
843
+ }), F(() => o.activePath, (a) => {
844
+ r.activePath = a || "";
845
+ }), F(() => o.config, (a) => {
846
+ a && (r.config = a, r.menus = d.normalizeMenus(a.menus));
847
+ }), H(() => {
848
+ d.init();
849
+ }), t({
850
+ loadConfig: d.loadConfig,
851
+ setActivePath: d.setActivePath
852
+ }), (a, i) => {
853
+ const n = ye, u = Ue, m = Re, g = Be, b = Y;
854
+ return f(), h("div", {
855
+ class: $(["u-menu", [`u-menu--${s.value.mode}`, { "u-menu--no-brand": !s.value.projectName }]]),
856
+ style: U(s.value.isHorizontal ? {} : { width: s.value.width + "px" })
857
+ }, [
858
+ s.value.projectName ? (f(), h("div", rt, [
859
+ L(a.$slots, "brand", {
860
+ projectName: s.value.projectName,
861
+ mode: s.value.mode
862
+ }, () => [
863
+ s.value.logo ? (f(), h("img", {
864
+ key: 0,
865
+ class: "u-menu-logo",
866
+ src: s.value.logo,
867
+ alt: "logo"
868
+ }, null, 8, dt)) : D("", !0),
869
+ x("span", ct, T(s.value.projectName), 1)
870
+ ], !0)
871
+ ])) : D("", !0),
872
+ S(g, {
873
+ class: "u-menu-list",
874
+ mode: s.value.elMode,
875
+ "default-active": s.value.activeIndex,
876
+ "unique-opened": !s.value.isHorizontal,
877
+ onSelect: d.handleSelect
878
+ }, {
879
+ default: w(() => [
880
+ (f(!0), h(I, null, M(s.value.menus, (p, C) => (f(), h(I, {
881
+ key: d.itemIndex(p, C)
882
+ }, [
883
+ d.hasChildren(p) ? (f(), k(m, {
884
+ key: 0,
885
+ index: d.itemIndex(p, C)
886
+ }, {
887
+ title: w(() => [
888
+ L(a.$slots, "menu-title", {
889
+ item: p,
890
+ level: 1,
891
+ index: C
892
+ }, () => [
893
+ d.getIcon(p.icon) ? (f(), k(n, {
894
+ key: 0,
895
+ class: "u-menu-icon"
896
+ }, {
897
+ default: w(() => [
898
+ (f(), k(O(d.getIcon(p.icon))))
899
+ ]),
900
+ _: 2
901
+ }, 1024)) : D("", !0),
902
+ x("span", null, T(p.label), 1)
903
+ ], !0)
904
+ ]),
905
+ default: w(() => [
906
+ (f(!0), h(I, null, M(p.children, (v, W) => (f(), k(u, {
907
+ key: d.childIndex(p, C, v, W),
908
+ index: d.childIndex(p, C, v, W)
909
+ }, {
910
+ default: w(() => [
911
+ L(a.$slots, "menu-item", {
912
+ item: v,
913
+ level: 2,
914
+ index: W,
915
+ parent: p
916
+ }, () => [
917
+ d.getIcon(v.icon) ? (f(), k(n, {
918
+ key: 0,
919
+ class: "u-menu-icon"
920
+ }, {
921
+ default: w(() => [
922
+ (f(), k(O(d.getIcon(v.icon))))
923
+ ]),
924
+ _: 2
925
+ }, 1024)) : D("", !0),
926
+ x("span", null, T(v.label), 1)
927
+ ], !0)
928
+ ]),
929
+ _: 2
930
+ }, 1032, ["index"]))), 128))
931
+ ]),
932
+ _: 2
933
+ }, 1032, ["index"])) : (f(), k(u, {
934
+ key: 1,
935
+ index: d.itemIndex(p, C)
936
+ }, {
937
+ default: w(() => [
938
+ L(a.$slots, "menu-item", {
939
+ item: p,
940
+ level: 1,
941
+ index: C,
942
+ parent: null
943
+ }, () => [
944
+ d.getIcon(p.icon) ? (f(), k(n, {
945
+ key: 0,
946
+ class: "u-menu-icon"
947
+ }, {
948
+ default: w(() => [
949
+ (f(), k(O(d.getIcon(p.icon))))
950
+ ]),
951
+ _: 2
952
+ }, 1024)) : D("", !0),
953
+ x("span", null, T(p.label), 1)
954
+ ], !0)
955
+ ]),
956
+ _: 2
957
+ }, 1032, ["index"]))
958
+ ], 64))), 128))
959
+ ]),
960
+ _: 3
961
+ }, 8, ["mode", "default-active", "unique-opened", "onSelect"]),
962
+ s.value.showLogout ? (f(), h("div", ut, [
963
+ L(a.$slots, "logout", {
964
+ mode: s.value.mode
965
+ }, () => [
966
+ S(b, {
967
+ class: "u-menu-logout-btn",
968
+ text: "",
969
+ onClick: d.handleLogout
970
+ }, {
971
+ default: w(() => [
972
+ B(T(s.value.logoutText), 1)
973
+ ]),
974
+ _: 1
975
+ }, 8, ["onClick"])
976
+ ], !0)
977
+ ])) : D("", !0)
978
+ ], 6);
979
+ };
980
+ }
981
+ }), mt = /* @__PURE__ */ P(ft, [["__scopeId", "data-v-48e7e044"]]), pt = {
596
982
  key: 0,
597
983
  class: "form-content"
598
- }, at = {
984
+ }, ht = {
599
985
  key: 1,
600
986
  class: "form-layout"
601
- }, lt = {
987
+ }, gt = {
602
988
  key: 0,
603
989
  class: "form-header"
604
- }, ot = { class: "title" }, it = { class: "form-body" }, nt = {
990
+ }, yt = { class: "title" }, bt = { class: "form-body" }, vt = {
605
991
  key: 1,
606
992
  class: "form-footer"
607
- }, st = /* @__PURE__ */ S({
993
+ }, wt = /* @__PURE__ */ V({
608
994
  __name: "FormContainer",
609
995
  props: {
610
996
  visible: { type: Boolean },
@@ -613,95 +999,95 @@ const Qe = { class: "u-dict-field" }, Ge = /* @__PURE__ */ S({
613
999
  loading: { type: Boolean, default: !1 }
614
1000
  },
615
1001
  emits: ["update:visible", "close"],
616
- setup(a, { emit: t }) {
617
- const e = a, l = t, { visible: s } = qe(e), d = g(() => e.layout.open === "normal"), o = g(() => e.layout.width || 400), c = {
1002
+ setup(l, { emit: t }) {
1003
+ const e = l, o = t, { visible: c } = We(e), r = y(() => e.layout.open === "normal"), s = y(() => e.layout.width || 400), d = {
618
1004
  handleClose() {
619
- l("update:visible", !1), l("close");
1005
+ o("update:visible", !1), o("close");
620
1006
  },
621
- updateVisible(n) {
622
- l("update:visible", n);
1007
+ updateVisible(a) {
1008
+ o("update:visible", a);
623
1009
  }
624
1010
  };
625
- return (n, r) => {
626
- const i = Ue, u = Re;
627
- return d.value ? A(s) ? (f(), p("div", at, [
628
- a.title ? (f(), p("div", lt, [
629
- C("div", ot, P(a.title), 1)
630
- ])) : T("", !0),
631
- C("div", it, [
632
- a.loading ? (f(), E(i, {
1011
+ return (a, i) => {
1012
+ const n = ye, u = Me;
1013
+ return r.value ? R(c) ? (f(), h("div", ht, [
1014
+ l.title ? (f(), h("div", gt, [
1015
+ x("div", yt, T(l.title), 1)
1016
+ ])) : D("", !0),
1017
+ x("div", bt, [
1018
+ l.loading ? (f(), k(n, {
633
1019
  key: 0,
634
1020
  class: "is-loading",
635
1021
  size: 40
636
1022
  }, {
637
- default: _(() => [
638
- x(A(me))
1023
+ default: w(() => [
1024
+ S(R(pe))
639
1025
  ]),
640
1026
  _: 1
641
- })) : N(n.$slots, "default", {}, void 0, !0, 1)
1027
+ })) : L(a.$slots, "default", {}, void 0, !0, 1)
642
1028
  ]),
643
- n.$slots.actions ? (f(), p("div", nt, [
644
- N(n.$slots, "actions", {}, void 0, !0)
645
- ])) : T("", !0)
646
- ])) : T("", !0) : (f(), E(u, {
1029
+ a.$slots.actions ? (f(), h("div", vt, [
1030
+ L(a.$slots, "actions", {}, void 0, !0)
1031
+ ])) : D("", !0)
1032
+ ])) : D("", !0) : (f(), k(u, {
647
1033
  key: 0,
648
- "model-value": A(s),
649
- title: a.title,
650
- width: o.value,
1034
+ "model-value": R(c),
1035
+ title: l.title,
1036
+ width: s.value,
651
1037
  "close-on-click-modal": !1,
652
- "onUpdate:modelValue": c.updateVisible,
653
- onClose: c.handleClose
1038
+ "onUpdate:modelValue": d.updateVisible,
1039
+ onClose: d.handleClose
654
1040
  }, {
655
- footer: _(() => [
656
- N(n.$slots, "actions", {}, void 0, !0)
1041
+ footer: w(() => [
1042
+ L(a.$slots, "actions", {}, void 0, !0)
657
1043
  ]),
658
- default: _(() => [
659
- A(s) ? (f(), p("div", tt, [
660
- a.loading ? (f(), E(i, {
1044
+ default: w(() => [
1045
+ R(c) ? (f(), h("div", pt, [
1046
+ l.loading ? (f(), k(n, {
661
1047
  key: 0,
662
1048
  class: "is-loading",
663
1049
  size: 40
664
1050
  }, {
665
- default: _(() => [
666
- x(A(me))
1051
+ default: w(() => [
1052
+ S(R(pe))
667
1053
  ]),
668
1054
  _: 1
669
- })) : N(n.$slots, "default", {}, void 0, !0, 1)
670
- ])) : T("", !0)
1055
+ })) : L(a.$slots, "default", {}, void 0, !0, 1)
1056
+ ])) : D("", !0)
671
1057
  ]),
672
1058
  _: 3
673
1059
  }, 8, ["model-value", "title", "width", "onUpdate:modelValue", "onClose"]));
674
1060
  };
675
1061
  }
676
- }), rt = /* @__PURE__ */ D(st, [["__scopeId", "data-v-7e522999"]]), dt = /* @__PURE__ */ S({
1062
+ }), xt = /* @__PURE__ */ P(wt, [["__scopeId", "data-v-7e522999"]]), Ct = /* @__PURE__ */ V({
677
1063
  __name: "FormGrid",
678
1064
  props: {
679
1065
  fields: {},
680
1066
  layout: {}
681
1067
  },
682
- setup(a) {
683
- const t = a, e = q({
684
- columns: g(() => t.layout.columns || 1)
685
- }), l = {
686
- getColSpan(s) {
687
- const d = s.colSpan || 1;
688
- return Math.min(d, e.columns);
1068
+ setup(l) {
1069
+ const t = l, e = z({
1070
+ columns: y(() => t.layout.columns || 1)
1071
+ }), o = {
1072
+ getColSpan(c) {
1073
+ const r = c.colSpan || 1;
1074
+ return Math.min(r, e.columns);
689
1075
  }
690
1076
  };
691
- return (s, d) => (f(), p("div", {
1077
+ return (c, r) => (f(), h("div", {
692
1078
  class: "form-grid",
693
- style: I({ "--grid-columns": e.columns })
1079
+ style: U({ "--grid-columns": e.columns })
694
1080
  }, [
695
- (f(!0), p($, null, F(a.fields, (o) => (f(), p("div", {
696
- key: o.field,
1081
+ (f(!0), h(I, null, M(l.fields, (s) => (f(), h("div", {
1082
+ key: s.field,
697
1083
  class: "form-grid-item",
698
- style: I({ gridColumn: `span ${l.getColSpan(o)}` })
1084
+ style: U({ gridColumn: `span ${o.getColSpan(s)}` })
699
1085
  }, [
700
- N(s.$slots, "default", { field: o }, void 0, !0)
1086
+ L(c.$slots, "default", { field: s }, void 0, !0)
701
1087
  ], 4))), 128))
702
1088
  ], 4));
703
1089
  }
704
- }), ct = /* @__PURE__ */ D(dt, [["__scopeId", "data-v-90ed35a4"]]), ut = { class: "form-field" }, ft = /* @__PURE__ */ S({
1090
+ }), _t = /* @__PURE__ */ P(Ct, [["__scopeId", "data-v-90ed35a4"]]), St = { class: "form-field" }, kt = /* @__PURE__ */ V({
705
1091
  __name: "FormField",
706
1092
  props: {
707
1093
  field: {},
@@ -711,113 +1097,113 @@ const Qe = { class: "u-dict-field" }, Ge = /* @__PURE__ */ S({
711
1097
  error: {}
712
1098
  },
713
1099
  emits: ["update:modelValue"],
714
- setup(a, { emit: t }) {
715
- const e = a, l = t, s = q({
716
- componentMap: Me({
717
- input: Y,
718
- "input-number": be,
719
- dict: j,
720
- switch: Ce,
721
- cascader: xe,
722
- date: te
1100
+ setup(l, { emit: t }) {
1101
+ const e = l, o = t, c = z({
1102
+ componentMap: ve({
1103
+ input: K,
1104
+ "input-number": xe,
1105
+ dict: G,
1106
+ switch: _e,
1107
+ cascader: Se,
1108
+ date: oe
723
1109
  }),
724
1110
  cascaderOptions: []
725
1111
  });
726
- M(() => e.field.cascaderKey, () => {
727
- e.field.cascaderKey && R.get(z.cascaderApi(e.field.cascaderKey)).then((i) => {
728
- i.status === 200 && (s.cascaderOptions = we(i.data));
1112
+ F(() => e.field.cascaderKey, () => {
1113
+ e.field.cascaderKey && A.get(N.cascaderApi(e.field.cascaderKey)).then((n) => {
1114
+ n.status === 200 && (c.cascaderOptions = se(n.data));
729
1115
  });
730
1116
  }, { immediate: !0 });
731
- const o = g(() => s.componentMap[e.field.type] || Y), c = g(() => {
1117
+ const s = y(() => c.componentMap[e.field.type] || K), d = y(() => {
732
1118
  if ((e.layout.labelPosition || "top") === "left") {
733
1119
  const u = e.layout.labelWidth || 0, m = typeof u == "number" ? u + 4 : u;
734
1120
  return { marginLeft: typeof m == "number" ? `${m}px` : m };
735
1121
  }
736
1122
  return {};
737
- }), n = g(() => {
738
- const { field: i, modelValue: u, layout: m, disabled: y } = e;
739
- let w = u;
740
- i.type === "switch" && u == null && (w = !1);
741
- const h = {
742
- fieldLabel: i.label,
743
- modelValue: w,
1123
+ }), a = y(() => {
1124
+ const { field: n, modelValue: u, layout: m, disabled: g } = e;
1125
+ let b = u;
1126
+ n.type === "switch" && u == null && (b = !1);
1127
+ const p = {
1128
+ fieldLabel: n.label,
1129
+ modelValue: b,
744
1130
  labelPosition: m.labelPosition || "top",
745
- disable: y,
746
- name: i.field,
747
- required: i.required
1131
+ disable: g,
1132
+ name: n.field,
1133
+ required: n.required
748
1134
  };
749
- if (m.labelWidth && (h.labelWidth = m.labelWidth), m.labelAlign && (h.labelAlign = m.labelAlign), i.maxlength && (h.maxlength = i.maxlength), i.placeholder && (h.placeholder = i.placeholder), i.readonly && (h.readonly = i.readonly), i.lineCount && i.lineCount >= 2 ? (h.type = "textarea", h.rows = i.lineCount) : i.inputType && (h.type = i.inputType), i.type === "switch" && (i.activeText && (h.activeText = i.activeText), i.inactiveText && (h.inactiveText = i.inactiveText), i.activeColor && (h.activeColor = i.activeColor), i.inactiveColor && (h.inactiveColor = i.inactiveColor), i.trueValue !== void 0 && (h.trueValue = i.trueValue), i.falseValue !== void 0 && (h.falseValue = i.falseValue)), i.dictType && (h.dictType = i.dictType), i.cascaderKey && (h.options = s.cascaderOptions, h.depth = i.cascaderDepth || 2), i.type === "date") {
750
- i.mode && (h.mode = i.mode), i.locale && (h.locale = i.locale), i.format ? h.mask = i.format : i.mask && (h.mask = i.mask);
751
- const k = i.dateMin ?? i.min, b = i.dateMax ?? i.max;
752
- k != null && (h.min = k), b != null && (h.max = b);
1135
+ if (m.labelWidth && (p.labelWidth = m.labelWidth), m.labelAlign && (p.labelAlign = m.labelAlign), n.maxlength && (p.maxlength = n.maxlength), n.placeholder && (p.placeholder = n.placeholder), n.readonly && (p.readonly = n.readonly), n.lineCount && n.lineCount >= 2 ? (p.type = "textarea", p.rows = n.lineCount) : n.inputType && (p.type = n.inputType), n.type === "switch" && (n.activeText && (p.activeText = n.activeText), n.inactiveText && (p.inactiveText = n.inactiveText), n.activeColor && (p.activeColor = n.activeColor), n.inactiveColor && (p.inactiveColor = n.inactiveColor), n.trueValue !== void 0 && (p.trueValue = n.trueValue), n.falseValue !== void 0 && (p.falseValue = n.falseValue)), n.dictType && (p.dictType = n.dictType), n.cascaderKey && (p.options = c.cascaderOptions, p.depth = n.cascaderDepth || 2), n.type === "date") {
1136
+ n.mode && (p.mode = n.mode), n.locale && (p.locale = n.locale), n.format ? p.mask = n.format : n.mask && (p.mask = n.mask);
1137
+ const C = n.dateMin ?? n.min, v = n.dateMax ?? n.max;
1138
+ C != null && (p.min = C), v != null && (p.max = v);
753
1139
  }
754
- return i.type === "input-number" && (i.min !== void 0 && (h.min = i.min), i.max !== void 0 && (h.max = i.max), i.step && (h.step = i.step), i.precision !== void 0 && (h.precision = i.precision)), h;
755
- }), r = {
756
- handleUpdate(i) {
757
- l("update:modelValue", i);
1140
+ return n.type === "input-number" && (n.min !== void 0 && (p.min = n.min), n.max !== void 0 && (p.max = n.max), n.step && (p.step = n.step), n.precision !== void 0 && (p.precision = n.precision)), p;
1141
+ }), i = {
1142
+ handleUpdate(n) {
1143
+ o("update:modelValue", n);
758
1144
  }
759
1145
  };
760
- return (i, u) => (f(), p("div", ut, [
761
- (f(), E(ie(o.value), ge(n.value, {
762
- "onUpdate:modelValue": r.handleUpdate
1146
+ return (n, u) => (f(), h("div", St, [
1147
+ (f(), k(O(s.value), be(a.value, {
1148
+ "onUpdate:modelValue": i.handleUpdate
763
1149
  }), null, 16, ["onUpdate:modelValue"])),
764
- C("div", {
765
- class: V(["field-error", { "field-error--visible": a.error }]),
766
- style: I(c.value)
767
- }, P(a.error || ""), 7)
1150
+ x("div", {
1151
+ class: $(["field-error", { "field-error--visible": l.error }]),
1152
+ style: U(d.value)
1153
+ }, T(l.error || ""), 7)
768
1154
  ]));
769
1155
  }
770
- }), mt = /* @__PURE__ */ D(ft, [["__scopeId", "data-v-10299c8d"]]);
771
- class pt {
1156
+ }), Dt = /* @__PURE__ */ P(kt, [["__scopeId", "data-v-10299c8d"]]);
1157
+ class Tt {
772
1158
  constructor() {
773
- v(this, "formConfig", null);
774
- v(this, "formData", {});
775
- v(this, "loading", !1);
776
- v(this, "submitting", !1);
777
- v(this, "visible", !1);
778
- v(this, "isEditMode", !1);
779
- v(this, "errors", []);
780
- v(this, "currentQuery", {});
1159
+ _(this, "formConfig", null);
1160
+ _(this, "formData", {});
1161
+ _(this, "loading", !1);
1162
+ _(this, "submitting", !1);
1163
+ _(this, "visible", !1);
1164
+ _(this, "isEditMode", !1);
1165
+ _(this, "errors", []);
1166
+ _(this, "currentQuery", {});
781
1167
  }
782
1168
  }
783
- let ht = class {
1169
+ let Vt = class {
784
1170
  constructor() {
785
1171
  // 响应式数据
786
- v(this, "data", q(new pt()));
1172
+ _(this, "data", z(new Tt()));
787
1173
  }
788
1174
  // 解析 query 字符串
789
1175
  parseQuery(t) {
790
1176
  if (!t) return {};
791
- const e = {}, l = t.split("&");
792
- for (const s of l) {
793
- const [d, o] = s.split("=");
794
- d && (e[d] = o || "");
1177
+ const e = {}, o = t.split("&");
1178
+ for (const c of o) {
1179
+ const [r, s] = c.split("=");
1180
+ r && (e[r] = s || "");
795
1181
  }
796
1182
  return e;
797
1183
  }
798
1184
  // 获取表单配置
799
1185
  async fetchFormConfig(t) {
800
- const e = await R.get(z.formCfgApi(t));
1186
+ const e = await A.get(N.formCfgApi(t));
801
1187
  if (e.status !== 200)
802
1188
  throw new Error(e.message || "获取表单配置失败");
803
1189
  return e.data;
804
1190
  }
805
1191
  // 获取表单数据
806
1192
  async fetchFormData(t, e) {
807
- const l = e ? `${t}?${e}` : t, s = await R.get(l);
808
- if (s.status !== 200)
809
- throw new Error(s.message || "获取表单数据失败");
810
- return s.data;
1193
+ const o = e ? `${t}?${e}` : t, c = await A.get(o);
1194
+ if (c.status !== 200)
1195
+ throw new Error(c.message || "获取表单数据失败");
1196
+ return c.data;
811
1197
  }
812
1198
  // 提交表单
813
1199
  async submitForm(t, e) {
814
- return await R.post(t, e);
1200
+ return await A.post(t, e);
815
1201
  }
816
1202
  // 构建字段初始值
817
1203
  buildInitialData(t) {
818
1204
  const e = {};
819
- for (const l of t)
820
- l.default !== void 0 ? e[l.field] = l.default : e[l.field] = null;
1205
+ for (const o of t)
1206
+ o.default !== void 0 ? e[o.field] = o.default : e[o.field] = null;
821
1207
  return e;
822
1208
  }
823
1209
  // 判断编辑模式
@@ -829,21 +1215,21 @@ let ht = class {
829
1215
  var e;
830
1216
  this.data.errors = [];
831
1217
  const t = ((e = this.data.formConfig) == null ? void 0 : e.fields) || [];
832
- for (const l of t) {
833
- const s = this.data.formData[l.field];
834
- if (l.required && (s == null || s === "")) {
1218
+ for (const o of t) {
1219
+ const c = this.data.formData[o.field];
1220
+ if (o.required && (c == null || c === "")) {
835
1221
  this.data.errors.push({
836
- field: l.field,
837
- message: `${l.label}为必填项`
1222
+ field: o.field,
1223
+ message: `${o.label}为必填项`
838
1224
  });
839
1225
  continue;
840
1226
  }
841
- if (l.rules && l.rules.length > 0 && s) {
842
- for (const d of l.rules)
843
- if (d.pattern && !new RegExp(d.pattern).test(s)) {
1227
+ if (o.rules && o.rules.length > 0 && c) {
1228
+ for (const r of o.rules)
1229
+ if (r.pattern && !new RegExp(r.pattern).test(c)) {
844
1230
  this.data.errors.push({
845
- field: l.field,
846
- message: d.message || `${l.label}格式不正确`
1231
+ field: o.field,
1232
+ message: r.message || `${o.label}格式不正确`
847
1233
  });
848
1234
  break;
849
1235
  }
@@ -853,7 +1239,7 @@ let ht = class {
853
1239
  }
854
1240
  // 获取字段错误信息
855
1241
  getFieldError(t) {
856
- const e = this.data.errors.find((l) => l.field === t);
1242
+ const e = this.data.errors.find((o) => o.field === t);
857
1243
  return e ? e.message : null;
858
1244
  }
859
1245
  // 清除错误
@@ -864,13 +1250,13 @@ let ht = class {
864
1250
  async openForm(t, e) {
865
1251
  this.data.loading = !0, this.data.visible = !0, this.clearErrors(), this.data.currentQuery = this.parseQuery(e || "");
866
1252
  try {
867
- const l = await this.fetchFormConfig(t);
868
- if (this.data.formConfig = l, this.data.isEditMode = this.checkIsEditMode(e || ""), this.data.formData = this.buildInitialData(l.fields), this.data.isEditMode && l.api.get && e) {
869
- const s = await this.fetchFormData(l.api.get, e), d = this.nestedToFlat(s);
870
- this.data.formData = { ...this.data.formData, ...d };
1253
+ const o = await this.fetchFormConfig(t);
1254
+ if (this.data.formConfig = o, this.data.isEditMode = this.checkIsEditMode(e || ""), this.data.formData = this.buildInitialData(o.fields), this.data.isEditMode && o.api.get && e) {
1255
+ const c = await this.fetchFormData(o.api.get, e), r = this.nestedToFlat(c);
1256
+ this.data.formData = { ...this.data.formData, ...r };
871
1257
  }
872
- } catch (l) {
873
- throw console.error("[FormRender] 打开表单失败:", l), this.data.visible = !1, l;
1258
+ } catch (o) {
1259
+ throw console.error("[FormRender] 打开表单失败:", o), this.data.visible = !1, o;
874
1260
  } finally {
875
1261
  this.data.loading = !1;
876
1262
  }
@@ -884,13 +1270,13 @@ let ht = class {
884
1270
  let e = this.data.isEditMode ? t.edit : t.add;
885
1271
  if (!e)
886
1272
  throw new Error("提交地址未配置");
887
- let l = { ...this.data.formData };
888
- l = this.flattenToNested(l), this.data.isEditMode && this.data.currentQuery.id && (l.id = Number(this.data.currentQuery.id)), this.data.submitting = !0;
1273
+ let o = { ...this.data.formData };
1274
+ o = this.flattenToNested(o), this.data.isEditMode && this.data.currentQuery.id && (o.id = Number(this.data.currentQuery.id)), this.data.submitting = !0;
889
1275
  try {
890
- const s = await this.submitForm(e, l);
891
- if (s.status === 200)
892
- return s.data;
893
- throw new Error(s.message || "提交失败");
1276
+ const c = await this.submitForm(e, o);
1277
+ if (c.status === 200)
1278
+ return c.data;
1279
+ throw new Error(c.message || "提交失败");
894
1280
  } finally {
895
1281
  this.data.submitting = !1;
896
1282
  }
@@ -902,81 +1288,46 @@ let ht = class {
902
1288
  // 扁平字段转嵌套对象(如 info.address -> { info: { address: xxx } })
903
1289
  flattenToNested(t) {
904
1290
  const e = {};
905
- for (const l in t) {
906
- const s = t[l];
907
- if (l.includes(".")) {
908
- const d = l.split(".");
909
- let o = e;
910
- for (let c = 0; c < d.length - 1; c++) {
911
- const n = d[c];
912
- o[n] || (o[n] = {}), o = o[n];
1291
+ for (const o in t) {
1292
+ const c = t[o];
1293
+ if (o.includes(".")) {
1294
+ const r = o.split(".");
1295
+ let s = e;
1296
+ for (let d = 0; d < r.length - 1; d++) {
1297
+ const a = r[d];
1298
+ s[a] || (s[a] = {}), s = s[a];
913
1299
  }
914
- o[d[d.length - 1]] = s;
1300
+ s[r[r.length - 1]] = c;
915
1301
  } else
916
- e[l] = s;
1302
+ e[o] = c;
917
1303
  }
918
1304
  return e;
919
1305
  }
920
1306
  // 嵌套对象展平为扁平字段(如 { info: { address: "xxx" } } -> { "info.address": "xxx" })
921
1307
  // 注意:只展平 YAML 中配置的点号分隔字段(如 info.address),不展平已经是对象的字段(如 dateRange: { from, to })
922
1308
  nestedToFlat(t, e = "") {
923
- const l = {};
924
- for (const s in t) {
925
- const d = t[s], o = e ? `${e}.${s}` : s;
926
- d && typeof d == "object" && !Array.isArray(d) ? Object.keys(d).length === 2 && "from" in d && "to" in d ? l[o] = d : Object.assign(l, this.nestedToFlat(d, o)) : l[o] = d;
1309
+ const o = {};
1310
+ for (const c in t) {
1311
+ const r = t[c], s = e ? `${e}.${c}` : c;
1312
+ r && typeof r == "object" && !Array.isArray(r) ? Object.keys(r).length === 2 && "from" in r && "to" in r ? o[s] = r : Object.assign(o, this.nestedToFlat(r, s)) : o[s] = r;
927
1313
  }
928
- return l;
1314
+ return o;
929
1315
  }
930
1316
  };
931
- function G(a, t = "info") {
932
- he({
933
- message: a,
934
- type: t,
935
- duration: 1e3,
936
- showClose: !1
937
- });
938
- }
939
- function B(a) {
940
- he({
941
- message: a,
942
- type: "error",
943
- duration: 2e3,
944
- showClose: !1
945
- });
946
- }
947
- function gt(a) {
948
- G(a, "success");
949
- }
950
- function yt(a) {
951
- G(a, "error");
952
- }
953
- function bt(a) {
954
- G(a, "warning");
955
- }
956
- function vt(a) {
957
- G(a, "info");
958
- }
959
- const W = {
960
- notify: G,
961
- success: gt,
962
- error: yt,
963
- warning: bt,
964
- info: vt,
965
- alertError: B
966
- }, wt = /* @__PURE__ */ S({
1317
+ const Pt = /* @__PURE__ */ V({
967
1318
  __name: "FormRender",
968
- setup(a, { expose: t }) {
969
- const e = new ht(), l = L(null), s = q({
1319
+ setup(l, { expose: t }) {
1320
+ const e = new Vt(), o = q(null), c = z({
970
1321
  currentQuery: {},
971
1322
  submitResolve: null
972
- }), d = g(() => {
973
- var y;
1323
+ }), r = y(() => {
1324
+ var g;
974
1325
  const m = {};
975
- if (!e.data.isEditMode || !s.currentQuery) return m;
976
- for (const w of ((y = e.data.formConfig) == null ? void 0 : y.fields) || [])
977
- s.currentQuery[w.field] !== void 0 && (m[w.field] = !0);
1326
+ if (!e.data.isEditMode || !c.currentQuery) return m;
1327
+ for (const b of ((g = e.data.formConfig) == null ? void 0 : g.fields) || [])
1328
+ c.currentQuery[b.field] !== void 0 && (m[b.field] = !0);
978
1329
  return m;
979
- }), o = g(() => {
1330
+ }), s = y(() => {
980
1331
  var m;
981
1332
  return ((m = e.data.formConfig) == null ? void 0 : m.layout) || {
982
1333
  open: "dialog",
@@ -984,35 +1335,35 @@ const W = {
984
1335
  labelPosition: "top",
985
1336
  buttonAlign: "right"
986
1337
  };
987
- }), c = g(() => {
1338
+ }), d = y(() => {
988
1339
  var m;
989
1340
  return ((m = e.data.formConfig) == null ? void 0 : m.fields) || [];
990
- }), n = g(() => {
991
- var m, y;
992
- return ((y = (m = e.data.formConfig) == null ? void 0 : m.meta) == null ? void 0 : y.title) || "表单";
993
- }), r = g(() => o.value.buttonAlign || "right"), i = g(() => o.value.open === "normal"), u = {
994
- async showForm(m, y) {
995
- s.currentQuery = e.parseQuery(y || "");
1341
+ }), a = y(() => {
1342
+ var m, g;
1343
+ return ((g = (m = e.data.formConfig) == null ? void 0 : m.meta) == null ? void 0 : g.title) || "表单";
1344
+ }), i = y(() => s.value.buttonAlign || "right"), n = y(() => s.value.open === "normal"), u = {
1345
+ async showForm(m, g) {
1346
+ c.currentQuery = e.parseQuery(g || "");
996
1347
  try {
997
- await e.openForm(m, y);
998
- } catch (w) {
999
- return B((w == null ? void 0 : w.message) || "打开表单失败"), null;
1348
+ await e.openForm(m, g);
1349
+ } catch (b) {
1350
+ return E((b == null ? void 0 : b.message) || "打开表单失败"), null;
1000
1351
  }
1001
- return new Promise((w) => {
1002
- s.submitResolve = w;
1352
+ return new Promise((b) => {
1353
+ c.submitResolve = b;
1003
1354
  });
1004
1355
  },
1005
1356
  async handleSubmit() {
1006
- var m, y;
1357
+ var m, g;
1007
1358
  try {
1008
- const w = await e.doSubmit(), h = ((y = (m = e.data.formConfig) == null ? void 0 : m.meta) == null ? void 0 : y.title) + "保存成功";
1009
- return W.success(h), s.submitResolve && (s.submitResolve(w), s.submitResolve = null), i.value || e.closeForm(), w;
1010
- } catch (w) {
1011
- return s.submitResolve && (s.submitResolve(null), s.submitResolve = null), w != null && w.message && w.message !== "请完善表单信息" && B(w.message), null;
1359
+ const b = await e.doSubmit(), p = ((g = (m = e.data.formConfig) == null ? void 0 : m.meta) == null ? void 0 : g.title) + "保存成功";
1360
+ return j.success(p), c.submitResolve && (c.submitResolve(b), c.submitResolve = null), n.value || e.closeForm(), b;
1361
+ } catch (b) {
1362
+ return c.submitResolve && (c.submitResolve(null), c.submitResolve = null), b != null && b.message && b.message !== "请完善表单信息" && E(b.message), null;
1012
1363
  }
1013
1364
  },
1014
1365
  handleCancel() {
1015
- i.value || e.closeForm();
1366
+ n.value || e.closeForm();
1016
1367
  },
1017
1368
  // 获取字段错误信息
1018
1369
  getFieldError(m) {
@@ -1024,60 +1375,60 @@ const W = {
1024
1375
  };
1025
1376
  return t({
1026
1377
  showForm: u.showForm
1027
- }), (m, y) => {
1028
- const w = Be, h = Q;
1029
- return f(), E(rt, {
1030
- visible: A(e).data.visible,
1031
- "onUpdate:visible": y[0] || (y[0] = (k) => A(e).data.visible = k),
1032
- layout: o.value,
1033
- title: n.value,
1034
- loading: A(e).data.loading,
1378
+ }), (m, g) => {
1379
+ const b = Le, p = Y;
1380
+ return f(), k(xt, {
1381
+ visible: R(e).data.visible,
1382
+ "onUpdate:visible": g[0] || (g[0] = (C) => R(e).data.visible = C),
1383
+ layout: s.value,
1384
+ title: a.value,
1385
+ loading: R(e).data.loading,
1035
1386
  onClose: u.handleClose
1036
1387
  }, {
1037
- actions: _(() => [
1038
- C("div", {
1039
- class: V(["form-actions", r.value === "right" ? "justify-end" : "justify-start"])
1388
+ actions: w(() => [
1389
+ x("div", {
1390
+ class: $(["form-actions", i.value === "right" ? "justify-end" : "justify-start"])
1040
1391
  }, [
1041
- x(h, {
1392
+ S(p, {
1042
1393
  onClick: u.handleCancel
1043
1394
  }, {
1044
- default: _(() => [...y[1] || (y[1] = [
1045
- U("取消", -1)
1395
+ default: w(() => [...g[1] || (g[1] = [
1396
+ B("取消", -1)
1046
1397
  ])]),
1047
1398
  _: 1
1048
1399
  }, 8, ["onClick"]),
1049
- x(h, {
1400
+ S(p, {
1050
1401
  type: "primary",
1051
- loading: A(e).data.submitting,
1402
+ loading: R(e).data.submitting,
1052
1403
  onClick: u.handleSubmit
1053
1404
  }, {
1054
- default: _(() => [...y[2] || (y[2] = [
1055
- U("提交", -1)
1405
+ default: w(() => [...g[2] || (g[2] = [
1406
+ B("提交", -1)
1056
1407
  ])]),
1057
1408
  _: 1
1058
1409
  }, 8, ["loading", "onClick"])
1059
1410
  ], 2)
1060
1411
  ]),
1061
- default: _(() => [
1062
- x(w, {
1412
+ default: w(() => [
1413
+ S(b, {
1063
1414
  ref_key: "formRef",
1064
- ref: l,
1415
+ ref: o,
1065
1416
  class: "form-render",
1066
1417
  "label-position": "top"
1067
1418
  }, {
1068
- default: _(() => [
1069
- x(ct, {
1070
- fields: c.value,
1071
- layout: o.value
1419
+ default: w(() => [
1420
+ S(_t, {
1421
+ fields: d.value,
1422
+ layout: s.value
1072
1423
  }, {
1073
- default: _(({ field: k }) => [
1074
- x(mt, {
1075
- modelValue: A(e).data.formData[k.field],
1076
- "onUpdate:modelValue": (b) => A(e).data.formData[k.field] = b,
1077
- field: k,
1078
- layout: o.value,
1079
- disabled: d.value[k.field],
1080
- error: u.getFieldError(k.field)
1424
+ default: w(({ field: C }) => [
1425
+ S(Dt, {
1426
+ modelValue: R(e).data.formData[C.field],
1427
+ "onUpdate:modelValue": (v) => R(e).data.formData[C.field] = v,
1428
+ field: C,
1429
+ layout: s.value,
1430
+ disabled: r.value[C.field],
1431
+ error: u.getFieldError(C.field)
1081
1432
  }, null, 8, ["modelValue", "onUpdate:modelValue", "field", "layout", "disabled", "error"])
1082
1433
  ]),
1083
1434
  _: 1
@@ -1090,8 +1441,8 @@ const W = {
1090
1441
  }, 8, ["visible", "layout", "title", "loading", "onClose"]);
1091
1442
  };
1092
1443
  }
1093
- }), _e = /* @__PURE__ */ D(wt, [["__scopeId", "data-v-378d04bd"]]);
1094
- class Ct {
1444
+ }), ke = /* @__PURE__ */ P(Pt, [["__scopeId", "data-v-378d04bd"]]);
1445
+ class $t {
1095
1446
  constructor(t) {
1096
1447
  this.config = t;
1097
1448
  }
@@ -1099,24 +1450,24 @@ class Ct {
1099
1450
  * 获取列表数据
1100
1451
  */
1101
1452
  async fetchList(t, e) {
1102
- const l = {
1453
+ const o = {
1103
1454
  page: e.page,
1104
1455
  pageSize: e.pageSize,
1105
1456
  ...t
1106
- }, s = {};
1107
- for (const n in l) {
1108
- const r = l[n];
1109
- r !== "" && r !== null && r !== void 0 && (s[n] = r);
1457
+ }, c = {};
1458
+ for (const a in o) {
1459
+ const i = o[a];
1460
+ i !== "" && i !== null && i !== void 0 && (c[a] = i);
1110
1461
  }
1111
- const d = new URLSearchParams();
1112
- for (const n in s)
1113
- d.append(n, String(s[n]));
1114
- const o = `${this.config.api.list}${d.toString() ? "?" + d.toString() : ""}`, c = await R.get(o);
1115
- if (c.status === 200) {
1116
- const n = c.data;
1117
- return Array.isArray(n) ? { rows: n, total: n.length } : n || { rows: [], total: 0 };
1462
+ const r = new URLSearchParams();
1463
+ for (const a in c)
1464
+ r.append(a, String(c[a]));
1465
+ const s = `${this.config.api.list}${r.toString() ? "?" + r.toString() : ""}`, d = await A.get(s);
1466
+ if (d.status === 200) {
1467
+ const a = d.data;
1468
+ return Array.isArray(a) ? { rows: a, total: a.length } : a || { rows: [], total: 0 };
1118
1469
  }
1119
- throw new Error(c.message || "获取列表数据失败");
1470
+ throw new Error(d.message || "获取列表数据失败");
1120
1471
  }
1121
1472
  /**
1122
1473
  * 删除单行
@@ -1124,9 +1475,9 @@ class Ct {
1124
1475
  async deleteRow(t) {
1125
1476
  if (!this.config.api.delete)
1126
1477
  throw new Error("未配置删除API");
1127
- const e = this.config.key || "id", l = t[e], s = `${this.config.api.delete}?id=${l}`, d = await R.post(s);
1128
- if (d.status !== 200)
1129
- throw new Error(d.message || "删除失败");
1478
+ const e = this.config.key || "id", o = t[e], c = `${this.config.api.delete}?id=${o}`, r = await A.post(c);
1479
+ if (r.status !== 200)
1480
+ throw new Error(r.message || "删除失败");
1130
1481
  }
1131
1482
  /**
1132
1483
  * 批量删除
@@ -1134,7 +1485,7 @@ class Ct {
1134
1485
  async batchDelete(t) {
1135
1486
  if (!this.config.api.delete)
1136
1487
  throw new Error("未配置删除API");
1137
- const e = await R.post(this.config.api.delete, t);
1488
+ const e = await A.post(this.config.api.delete, t);
1138
1489
  if (e.status !== 200)
1139
1490
  throw new Error(e.message || "批量删除失败");
1140
1491
  }
@@ -1144,10 +1495,10 @@ class Ct {
1144
1495
  async exportData(t) {
1145
1496
  if (!this.config.api.export)
1146
1497
  throw new Error("未配置导出API");
1147
- const l = (await R.post(this.config.api.export, t, {
1498
+ const o = (await A.post(this.config.api.export, t, {
1148
1499
  responseType: "blob"
1149
- })).data, s = window.URL.createObjectURL(l), d = document.createElement("a");
1150
- d.href = s, d.download = `export_${Date.now()}.xlsx`, d.click(), window.URL.revokeObjectURL(s);
1500
+ })).data, c = window.URL.createObjectURL(o), r = document.createElement("a");
1501
+ r.href = c, r.download = `export_${Date.now()}.xlsx`, r.click(), window.URL.revokeObjectURL(c);
1151
1502
  }
1152
1503
  /**
1153
1504
  * 下载导入模板
@@ -1155,10 +1506,10 @@ class Ct {
1155
1506
  async downloadTemplate() {
1156
1507
  if (!this.config.api.import)
1157
1508
  throw new Error("未配置导入API");
1158
- const e = (await R.get(`${this.config.api.import}/template`, {
1509
+ const e = (await A.get(`${this.config.api.import}/template`, {
1159
1510
  responseType: "blob"
1160
- })).data, l = window.URL.createObjectURL(e), s = document.createElement("a");
1161
- s.href = l, s.download = `template_${Date.now()}.xlsx`, s.click(), window.URL.revokeObjectURL(l);
1511
+ })).data, o = window.URL.createObjectURL(e), c = document.createElement("a");
1512
+ c.href = o, c.download = `template_${Date.now()}.xlsx`, c.click(), window.URL.revokeObjectURL(o);
1162
1513
  }
1163
1514
  /**
1164
1515
  * 导入数据
@@ -1168,61 +1519,61 @@ class Ct {
1168
1519
  throw new Error("未配置导入API");
1169
1520
  const e = new FormData();
1170
1521
  e.append("file", t);
1171
- const l = await R.post(this.config.api.import, e, {
1522
+ const o = await A.post(this.config.api.import, e, {
1172
1523
  headers: {
1173
1524
  "Content-Type": "multipart/form-data"
1174
1525
  }
1175
1526
  });
1176
- if (l.status !== 200)
1177
- throw new Error(l.message || "导入失败");
1178
- return l.data;
1527
+ if (o.status !== 200)
1528
+ throw new Error(o.message || "导入失败");
1529
+ return o.data;
1179
1530
  }
1180
1531
  }
1181
- class xt {
1532
+ class It {
1182
1533
  constructor() {
1183
- v(this, "tableConfig", null);
1184
- v(this, "rows", []);
1185
- v(this, "total", 0);
1186
- v(this, "loading", !1);
1187
- v(this, "searchParams", {});
1188
- v(this, "pagination", { page: 1, pageSize: 20 });
1189
- v(this, "selectedRows", []);
1190
- v(this, "detailVisible", !1);
1191
- v(this, "detailData", null);
1192
- v(this, "detailLoading", !1);
1534
+ _(this, "tableConfig", null);
1535
+ _(this, "rows", []);
1536
+ _(this, "total", 0);
1537
+ _(this, "loading", !1);
1538
+ _(this, "searchParams", {});
1539
+ _(this, "pagination", { page: 1, pageSize: 20 });
1540
+ _(this, "selectedRows", []);
1541
+ _(this, "detailVisible", !1);
1542
+ _(this, "detailData", null);
1543
+ _(this, "detailLoading", !1);
1193
1544
  }
1194
1545
  }
1195
- let _t = class {
1546
+ let Et = class {
1196
1547
  constructor() {
1197
1548
  // 响应式数据
1198
- v(this, "data", q(new xt()));
1549
+ _(this, "data", z(new It()));
1199
1550
  // 数据服务
1200
- v(this, "dataService", null);
1551
+ _(this, "dataService", null);
1201
1552
  }
1202
1553
  /**
1203
1554
  * 加载表格配置
1204
1555
  */
1205
1556
  async loadConfig(t) {
1206
- var s;
1207
- const e = z.formCfgApi(t);
1557
+ var c;
1558
+ const e = N.formCfgApi(t);
1208
1559
  console.log("load config url =", e);
1209
- const l = await R.get(e);
1210
- if (console.log("---"), l.status !== 200)
1211
- throw new Error(l.message || "获取表格配置失败");
1212
- this.data.tableConfig = l.data, this.dataService = new Ct(l.data), typeof console < "u" && console.log("[TableRender] loadConfig:", {
1560
+ const o = await A.get(e);
1561
+ if (console.log("---"), o.status !== 200)
1562
+ throw new Error(o.message || "获取表格配置失败");
1563
+ this.data.tableConfig = o.data, this.dataService = new $t(o.data), typeof console < "u" && console.log("[TableRender] loadConfig:", {
1213
1564
  tableId: t,
1214
1565
  hasDetail: this.hasDetail(),
1215
- detail: (s = this.data.tableConfig) == null ? void 0 : s.detail
1566
+ detail: (c = this.data.tableConfig) == null ? void 0 : c.detail
1216
1567
  }), this.initSearchParams();
1217
1568
  }
1218
1569
  /**
1219
1570
  * 初始化搜索参数
1220
1571
  */
1221
1572
  initSearchParams() {
1222
- var l;
1223
- const t = {}, e = ((l = this.data.tableConfig) == null ? void 0 : l.search) || [];
1224
- for (const s of e)
1225
- t[s.field] = "";
1573
+ var o;
1574
+ const t = {}, e = ((o = this.data.tableConfig) == null ? void 0 : o.search) || [];
1575
+ for (const c of e)
1576
+ t[c.field] = "";
1226
1577
  this.data.searchParams = t;
1227
1578
  }
1228
1579
  /**
@@ -1370,7 +1721,7 @@ let _t = class {
1370
1721
  var e;
1371
1722
  const t = (e = this.data.tableConfig) == null ? void 0 : e.toolbar;
1372
1723
  return t ? t.some(
1373
- (l) => l.type === "edit" || l.type === "delete"
1724
+ (o) => o.type === "edit" || o.type === "delete"
1374
1725
  ) : !1;
1375
1726
  }
1376
1727
  /**
@@ -1409,78 +1760,78 @@ let _t = class {
1409
1760
  return ((t = this.data.tableConfig) == null ? void 0 : t.pagination) || "page";
1410
1761
  }
1411
1762
  };
1412
- const St = { class: "table-search" }, Dt = { class: "search-fields" }, kt = { class: "search-actions" }, Tt = /* @__PURE__ */ S({
1763
+ const At = { class: "table-search" }, Bt = { class: "search-fields" }, Rt = { class: "search-actions" }, Ut = /* @__PURE__ */ V({
1413
1764
  __name: "TableSearch",
1414
1765
  props: {
1415
1766
  fields: {},
1416
1767
  modelValue: {}
1417
1768
  },
1418
1769
  emits: ["update:modelValue", "search", "reset"],
1419
- setup(a, { emit: t }) {
1420
- const e = a, l = t, s = {
1421
- input: Y,
1422
- dict: j,
1423
- dept: j,
1424
- role: j,
1425
- date: te,
1426
- daterange: te
1427
- }, d = {
1770
+ setup(l, { emit: t }) {
1771
+ const e = l, o = t, c = {
1772
+ input: K,
1773
+ dict: G,
1774
+ dept: G,
1775
+ role: G,
1776
+ date: oe,
1777
+ daterange: oe
1778
+ }, r = {
1428
1779
  // 组件映射
1429
- getComponent(o) {
1430
- return s[o] || Y;
1780
+ getComponent(s) {
1781
+ return c[s] || K;
1431
1782
  },
1432
1783
  // 更新搜索值
1433
- updateValue(o, c) {
1434
- const n = { ...e.modelValue, [o]: c };
1435
- l("update:modelValue", n);
1784
+ updateValue(s, d) {
1785
+ const a = { ...e.modelValue, [s]: d };
1786
+ o("update:modelValue", a);
1436
1787
  },
1437
1788
  // 搜索(查询字段值自动去除首尾空格)
1438
1789
  handleSearch() {
1439
- const o = {};
1440
- for (const c in e.modelValue) {
1441
- const n = e.modelValue[c];
1442
- o[c] = typeof n == "string" ? n.trim() : n;
1790
+ const s = {};
1791
+ for (const d in e.modelValue) {
1792
+ const a = e.modelValue[d];
1793
+ s[d] = typeof a == "string" ? a.trim() : a;
1443
1794
  }
1444
- l("update:modelValue", o), l("search");
1795
+ o("update:modelValue", s), o("search");
1445
1796
  },
1446
1797
  // 重置
1447
1798
  handleReset() {
1448
- l("reset");
1799
+ o("reset");
1449
1800
  }
1450
1801
  };
1451
- return (o, c) => {
1452
- const n = Q;
1453
- return f(), p("div", St, [
1454
- C("div", Dt, [
1455
- (f(!0), p($, null, F(e.fields, (r) => (f(), p("div", {
1456
- key: r.field,
1802
+ return (s, d) => {
1803
+ const a = Y;
1804
+ return f(), h("div", At, [
1805
+ x("div", Bt, [
1806
+ (f(!0), h(I, null, M(e.fields, (i) => (f(), h("div", {
1807
+ key: i.field,
1457
1808
  class: "search-field"
1458
1809
  }, [
1459
- (f(), E(ie(d.getComponent(r.type)), {
1460
- "model-value": e.modelValue[r.field],
1461
- "field-label": r.label,
1462
- "dict-type": r.dictType,
1463
- mode: r.type === "daterange" ? "range" : void 0,
1810
+ (f(), k(O(r.getComponent(i.type)), {
1811
+ "model-value": e.modelValue[i.field],
1812
+ "field-label": i.label,
1813
+ "dict-type": i.dictType,
1814
+ mode: i.type === "daterange" ? "range" : void 0,
1464
1815
  "label-position": "left",
1465
- "onUpdate:modelValue": (i) => d.updateValue(r.field, i)
1816
+ "onUpdate:modelValue": (n) => r.updateValue(i.field, n)
1466
1817
  }, null, 8, ["model-value", "field-label", "dict-type", "mode", "onUpdate:modelValue"]))
1467
1818
  ]))), 128))
1468
1819
  ]),
1469
- C("div", kt, [
1470
- x(n, {
1820
+ x("div", Rt, [
1821
+ S(a, {
1471
1822
  type: "primary",
1472
- onClick: d.handleSearch
1823
+ onClick: r.handleSearch
1473
1824
  }, {
1474
- default: _(() => [...c[0] || (c[0] = [
1475
- U("查询", -1)
1825
+ default: w(() => [...d[0] || (d[0] = [
1826
+ B("查询", -1)
1476
1827
  ])]),
1477
1828
  _: 1
1478
1829
  }, 8, ["onClick"]),
1479
- x(n, {
1480
- onClick: d.handleReset
1830
+ S(a, {
1831
+ onClick: r.handleReset
1481
1832
  }, {
1482
- default: _(() => [...c[1] || (c[1] = [
1483
- U("重置", -1)
1833
+ default: w(() => [...d[1] || (d[1] = [
1834
+ B("重置", -1)
1484
1835
  ])]),
1485
1836
  _: 1
1486
1837
  }, 8, ["onClick"])
@@ -1488,7 +1839,7 @@ const St = { class: "table-search" }, Dt = { class: "search-fields" }, kt = { cl
1488
1839
  ]);
1489
1840
  };
1490
1841
  }
1491
- }), Vt = /* @__PURE__ */ D(Tt, [["__scopeId", "data-v-68dd4c13"]]), Pt = { class: "table-toolbar" }, Et = { class: "toolbar-left" }, $t = /* @__PURE__ */ S({
1842
+ }), Mt = /* @__PURE__ */ P(Ut, [["__scopeId", "data-v-68dd4c13"]]), Lt = { class: "table-toolbar" }, Ft = { class: "toolbar-left" }, zt = /* @__PURE__ */ V({
1492
1843
  __name: "TableToolbar",
1493
1844
  props: {
1494
1845
  toolbar: {},
@@ -1498,58 +1849,58 @@ const St = { class: "table-search" }, Dt = { class: "search-fields" }, kt = { cl
1498
1849
  selectedCount: {}
1499
1850
  },
1500
1851
  emits: ["create", "import", "export", "batchEdit", "batchDelete", "custom"],
1501
- setup(a, { emit: t }) {
1502
- const e = a, l = t, s = g(() => ({
1852
+ setup(l, { emit: t }) {
1853
+ const e = l, o = t, c = y(() => ({
1503
1854
  // 显示编辑按钮
1504
1855
  showEdit: !!e.formId && (!e.actions || e.actions.edit !== !1),
1505
1856
  // 显示删除按钮
1506
1857
  showDelete: !!e.apiDelete && (!e.actions || e.actions.delete !== !1)
1507
- })), d = {
1858
+ })), r = {
1508
1859
  // 判断是否为内置按钮
1509
- isBuiltin(o) {
1510
- return typeof o == "string" || o.type !== void 0;
1860
+ isBuiltin(s) {
1861
+ return typeof s == "string" || s.type !== void 0;
1511
1862
  },
1512
1863
  // 获取按钮属性
1513
- getButtonProps(o) {
1514
- return typeof o == "string" ? { type: o } : o;
1864
+ getButtonProps(s) {
1865
+ return typeof s == "string" ? { type: s } : s;
1515
1866
  },
1516
1867
  // 按钮是否可用
1517
- isDisabled(o) {
1518
- const c = d.getButtonProps(o);
1519
- return c.type === "edit" || c.type === "delete" ? e.selectedCount === 0 : !1;
1868
+ isDisabled(s) {
1869
+ const d = r.getButtonProps(s);
1870
+ return d.type === "edit" || d.type === "delete" ? e.selectedCount === 0 : !1;
1520
1871
  },
1521
1872
  // 是否显示按钮
1522
- shouldShow(o) {
1523
- const c = d.getButtonProps(o);
1524
- return c.type === "create" && e.formId || c.type === "edit" && s.value.showEdit || c.type === "delete" && s.value.showDelete ? !0 : c.type === "import" || c.type === "export" ? !1 : !d.isBuiltin(o);
1873
+ shouldShow(s) {
1874
+ const d = r.getButtonProps(s);
1875
+ return d.type === "create" && e.formId || d.type === "edit" && c.value.showEdit || d.type === "delete" && c.value.showDelete ? !0 : d.type === "import" || d.type === "export" ? !1 : !r.isBuiltin(s);
1525
1876
  },
1526
1877
  // 处理按钮点击
1527
- handleClick(o) {
1528
- switch (d.getButtonProps(o).type) {
1878
+ handleClick(s) {
1879
+ switch (r.getButtonProps(s).type) {
1529
1880
  case "create":
1530
- l("create");
1881
+ o("create");
1531
1882
  break;
1532
1883
  case "import":
1533
- l("import");
1884
+ o("import");
1534
1885
  break;
1535
1886
  case "export":
1536
- l("export");
1887
+ o("export");
1537
1888
  break;
1538
1889
  case "edit":
1539
- l("batchEdit");
1890
+ o("batchEdit");
1540
1891
  break;
1541
1892
  case "delete":
1542
- l("batchDelete");
1893
+ o("batchDelete");
1543
1894
  break;
1544
1895
  default:
1545
- l("custom", o);
1896
+ o("custom", s);
1546
1897
  }
1547
1898
  },
1548
1899
  // 获取按钮文字
1549
- getButtonText(o) {
1550
- const c = d.getButtonProps(o);
1551
- if (c.text) return c.text;
1552
- switch (c.type) {
1900
+ getButtonText(s) {
1901
+ const d = r.getButtonProps(s);
1902
+ if (d.text) return d.text;
1903
+ switch (d.type) {
1553
1904
  case "create":
1554
1905
  return "新增";
1555
1906
  case "import":
@@ -1565,65 +1916,65 @@ const St = { class: "table-search" }, Dt = { class: "search-fields" }, kt = { cl
1565
1916
  }
1566
1917
  },
1567
1918
  // 获取按钮图标
1568
- getButtonIcon(o) {
1569
- return d.getButtonProps(o).icon;
1919
+ getButtonIcon(s) {
1920
+ return r.getButtonProps(s).icon;
1570
1921
  },
1571
1922
  // 是否为主按钮
1572
- isPrimary(o) {
1573
- return d.getButtonProps(o).primary === !0;
1923
+ isPrimary(s) {
1924
+ return r.getButtonProps(s).primary === !0;
1574
1925
  }
1575
1926
  };
1576
- return (o, c) => {
1577
- const n = Q;
1578
- return f(), p("div", Pt, [
1579
- C("div", Et, [
1580
- (f(!0), p($, null, F(e.toolbar, (r, i) => (f(), p($, { key: i }, [
1581
- d.shouldShow(r) ? (f(), E(n, {
1927
+ return (s, d) => {
1928
+ const a = Y;
1929
+ return f(), h("div", Lt, [
1930
+ x("div", Ft, [
1931
+ (f(!0), h(I, null, M(e.toolbar, (i, n) => (f(), h(I, { key: n }, [
1932
+ r.shouldShow(i) ? (f(), k(a, {
1582
1933
  key: 0,
1583
- type: d.isPrimary(r) ? "primary" : "default",
1584
- disabled: d.isDisabled(r),
1585
- onClick: (u) => d.handleClick(r)
1934
+ type: r.isPrimary(i) ? "primary" : "default",
1935
+ disabled: r.isDisabled(i),
1936
+ onClick: (u) => r.handleClick(i)
1586
1937
  }, {
1587
- default: _(() => [
1588
- U(P(d.getButtonText(r)), 1)
1938
+ default: w(() => [
1939
+ B(T(r.getButtonText(i)), 1)
1589
1940
  ]),
1590
1941
  _: 2
1591
- }, 1032, ["type", "disabled", "onClick"])) : T("", !0)
1942
+ }, 1032, ["type", "disabled", "onClick"])) : D("", !0)
1592
1943
  ], 64))), 128))
1593
1944
  ])
1594
1945
  ]);
1595
1946
  };
1596
1947
  }
1597
- }), Rt = /* @__PURE__ */ D($t, [["__scopeId", "data-v-a7c06f8c"]]), Ut = /* @__PURE__ */ S({
1948
+ }), qt = /* @__PURE__ */ P(zt, [["__scopeId", "data-v-a7c06f8c"]]), Nt = /* @__PURE__ */ V({
1598
1949
  __name: "UInputShow",
1599
1950
  props: {
1600
1951
  modelValue: {},
1601
1952
  multiline: { type: Boolean, default: !1 },
1602
1953
  maxLines: { default: 0 }
1603
1954
  },
1604
- setup(a) {
1605
- const t = a, e = g(() => t.modelValue === null || t.modelValue === void 0 ? "" : String(t.modelValue)), l = g(() => t.multiline || e.value.includes(`
1606
- `)), s = g(() => t.maxLines > 0 && l.value ? {
1955
+ setup(l) {
1956
+ const t = l, e = y(() => t.modelValue === null || t.modelValue === void 0 ? "" : String(t.modelValue)), o = y(() => t.multiline || e.value.includes(`
1957
+ `)), c = y(() => t.maxLines > 0 && o.value ? {
1607
1958
  display: "-webkit-box",
1608
1959
  WebkitLineClamp: t.maxLines,
1609
1960
  WebkitBoxOrient: "vertical",
1610
1961
  overflow: "hidden",
1611
1962
  textOverflow: "ellipsis"
1612
1963
  } : {});
1613
- return (d, o) => (f(), p("div", {
1614
- class: V(["u-input-show", { "u-input-multiline": l.value }]),
1615
- style: I(s.value)
1616
- }, P(e.value), 7));
1964
+ return (r, s) => (f(), h("div", {
1965
+ class: $(["u-input-show", { "u-input-multiline": o.value }]),
1966
+ style: U(c.value)
1967
+ }, T(e.value), 7));
1617
1968
  }
1618
- }), Bt = /* @__PURE__ */ D(Ut, [["__scopeId", "data-v-c78b151e"]]), At = /* @__PURE__ */ S({
1969
+ }), Wt = /* @__PURE__ */ P(Nt, [["__scopeId", "data-v-c78b151e"]]), jt = /* @__PURE__ */ V({
1619
1970
  __name: "UDictShow",
1620
1971
  props: {
1621
1972
  modelValue: {},
1622
1973
  dictType: {},
1623
1974
  defaultText: { default: "" }
1624
1975
  },
1625
- setup(a) {
1626
- const t = a, e = L(""), l = L(!1), s = async () => {
1976
+ setup(l) {
1977
+ const t = l, e = q(""), o = q(!1), c = async () => {
1627
1978
  if (t.modelValue === null || t.modelValue === void 0 || t.modelValue === "") {
1628
1979
  e.value = t.defaultText;
1629
1980
  return;
@@ -1632,25 +1983,25 @@ const St = { class: "table-search" }, Dt = { class: "search-fields" }, kt = { cl
1632
1983
  e.value = String(t.modelValue);
1633
1984
  return;
1634
1985
  }
1635
- l.value = !0;
1986
+ o.value = !0;
1636
1987
  try {
1637
- const d = await Ye(t.dictType, t.modelValue, t.defaultText);
1638
- e.value = d;
1639
- } catch (d) {
1640
- console.error("[UDictShow] 翻译失败:", d), e.value = String(t.modelValue);
1988
+ const r = await He(t.dictType, t.modelValue, t.defaultText);
1989
+ e.value = r;
1990
+ } catch (r) {
1991
+ console.error("[UDictShow] 翻译失败:", r), e.value = String(t.modelValue);
1641
1992
  } finally {
1642
- l.value = !1;
1993
+ o.value = !1;
1643
1994
  }
1644
1995
  };
1645
- return M(() => t.modelValue, s, { immediate: !0 }), M(() => t.dictType, () => {
1646
- t.dictType && ee(t.dictType).then(() => s());
1647
- }), Z(() => {
1648
- t.dictType ? ee(t.dictType).then(() => s()) : s();
1649
- }), (d, o) => (f(), p("div", {
1650
- class: V(["u-dict-show", { "u-dict-loading": l.value }])
1651
- }, P(e.value), 3));
1652
- }
1653
- }), It = /* @__PURE__ */ D(At, [["__scopeId", "data-v-908045c4"]]), Ft = /* @__PURE__ */ S({
1996
+ return F(() => t.modelValue, c, { immediate: !0 }), F(() => t.dictType, () => {
1997
+ t.dictType && ae(t.dictType).then(() => c());
1998
+ }), H(() => {
1999
+ t.dictType ? ae(t.dictType).then(() => c()) : c();
2000
+ }), (r, s) => (f(), h("div", {
2001
+ class: $(["u-dict-show", { "u-dict-loading": o.value }])
2002
+ }, T(e.value), 3));
2003
+ }
2004
+ }), Ot = /* @__PURE__ */ P(jt, [["__scopeId", "data-v-908045c4"]]), Yt = /* @__PURE__ */ V({
1654
2005
  __name: "UToggleShow",
1655
2006
  props: {
1656
2007
  modelValue: {},
@@ -1658,13 +2009,13 @@ const St = { class: "table-search" }, Dt = { class: "search-fields" }, kt = { cl
1658
2009
  falseText: { default: "关闭" },
1659
2010
  useYesNo: { type: Boolean, default: !1 }
1660
2011
  },
1661
- setup(a) {
1662
- const t = a, e = g(() => t.useYesNo ? "是" : t.trueText), l = g(() => t.useYesNo ? "否" : t.falseText), s = g(() => t.modelValue === !0 || t.modelValue === "true" ? e.value : t.modelValue === !1 || t.modelValue === "false" ? l.value : String(t.modelValue ?? "")), d = g(() => t.modelValue === !0 || t.modelValue === "true" ? "toggle-true" : t.modelValue === !1 || t.modelValue === "false" ? "toggle-false" : "toggle-default");
1663
- return (o, c) => (f(), p("div", {
1664
- class: V(["u-toggle-show", d.value])
1665
- }, P(s.value), 3));
2012
+ setup(l) {
2013
+ const t = l, e = y(() => t.useYesNo ? "是" : t.trueText), o = y(() => t.useYesNo ? "否" : t.falseText), c = y(() => t.modelValue === !0 || t.modelValue === "true" ? e.value : t.modelValue === !1 || t.modelValue === "false" ? o.value : String(t.modelValue ?? "")), r = y(() => t.modelValue === !0 || t.modelValue === "true" ? "toggle-true" : t.modelValue === !1 || t.modelValue === "false" ? "toggle-false" : "toggle-default");
2014
+ return (s, d) => (f(), h("div", {
2015
+ class: $(["u-toggle-show", r.value])
2016
+ }, T(c.value), 3));
1666
2017
  }
1667
- }), Lt = /* @__PURE__ */ D(Ft, [["__scopeId", "data-v-bac05efc"]]), qt = /* @__PURE__ */ S({
2018
+ }), Qt = /* @__PURE__ */ P(Yt, [["__scopeId", "data-v-bac05efc"]]), Gt = /* @__PURE__ */ V({
1668
2019
  __name: "UCascaderShow",
1669
2020
  props: {
1670
2021
  modelValue: {},
@@ -1672,36 +2023,36 @@ const St = { class: "table-search" }, Dt = { class: "search-fields" }, kt = { cl
1672
2023
  separator: { default: " / " },
1673
2024
  showRawValue: { type: Boolean, default: !0 }
1674
2025
  },
1675
- setup(a) {
1676
- const t = a, e = L(""), l = L(!1), s = async () => {
2026
+ setup(l) {
2027
+ const t = l, e = q(""), o = q(!1), c = async () => {
1677
2028
  if (!t.modelValue || !Array.isArray(t.modelValue)) {
1678
2029
  e.value = "";
1679
2030
  return;
1680
2031
  }
1681
- const d = t.modelValue;
2032
+ const r = t.modelValue;
1682
2033
  if (t.cascaderKey) {
1683
- l.value = !0;
2034
+ o.value = !0;
1684
2035
  try {
1685
- const o = await ee(t.cascaderKey), n = d.map((r) => {
1686
- const i = o.find((u) => u.value === r || String(u.value) === String(r));
1687
- return i ? i.label : t.showRawValue ? String(r) : "";
1688
- }).filter((r) => r !== "");
1689
- e.value = n.join(t.separator);
1690
- } catch (o) {
1691
- console.error("[UCascaderShow] 翻译失败:", o), e.value = t.showRawValue ? d.join(t.separator) : "";
2036
+ const s = await ae(t.cascaderKey), a = r.map((i) => {
2037
+ const n = s.find((u) => u.value === i || String(u.value) === String(i));
2038
+ return n ? n.label : t.showRawValue ? String(i) : "";
2039
+ }).filter((i) => i !== "");
2040
+ e.value = a.join(t.separator);
2041
+ } catch (s) {
2042
+ console.error("[UCascaderShow] 翻译失败:", s), e.value = t.showRawValue ? r.join(t.separator) : "";
1692
2043
  } finally {
1693
- l.value = !1;
2044
+ o.value = !1;
1694
2045
  }
1695
2046
  } else
1696
- e.value = d.join(t.separator);
2047
+ e.value = r.join(t.separator);
1697
2048
  };
1698
- return M(() => t.modelValue, s, { immediate: !0 }), Z(() => {
1699
- s();
1700
- }), (d, o) => (f(), p("div", {
1701
- class: V(["u-cascader-show", { "u-cascader-loading": l.value }])
1702
- }, P(e.value), 3));
2049
+ return F(() => t.modelValue, c, { immediate: !0 }), H(() => {
2050
+ c();
2051
+ }), (r, s) => (f(), h("div", {
2052
+ class: $(["u-cascader-show", { "u-cascader-loading": o.value }])
2053
+ }, T(e.value), 3));
1703
2054
  }
1704
- }), Mt = /* @__PURE__ */ D(qt, [["__scopeId", "data-v-5d84df67"]]), Wt = /* @__PURE__ */ S({
2055
+ }), Ht = /* @__PURE__ */ P(Gt, [["__scopeId", "data-v-5d84df67"]]), Kt = /* @__PURE__ */ V({
1705
2056
  __name: "UDateShow",
1706
2057
  props: {
1707
2058
  modelValue: {},
@@ -1711,20 +2062,20 @@ const St = { class: "table-search" }, Dt = { class: "search-fields" }, kt = { cl
1711
2062
  separator: { default: ", " },
1712
2063
  rangeSeparator: { default: " ~ " }
1713
2064
  },
1714
- setup(a) {
1715
- const t = a, e = g(() => t.locale === "en-US" ? t.mode === "range" ? " - " : ", " : t.mode === "range" ? t.rangeSeparator : t.separator), l = g(() => {
1716
- const o = t.modelValue;
1717
- return t.mode === "single" ? o ? s(o, t.format) : "" : t.mode === "multiple" ? o ? Array.isArray(o) ? o.map((c) => s(c, t.format)).join(e.value) : String(o) : "" : t.mode === "range" ? o ? typeof o == "object" && o.from && o.to ? `${s(o.from, t.format)}${e.value}${s(o.to, t.format)}` : Array.isArray(o) && o.length >= 2 ? `${s(o[0], t.format)}${e.value}${s(o[1], t.format)}` : String(o) : "" : String(o ?? "");
2065
+ setup(l) {
2066
+ const t = l, e = y(() => t.locale === "en-US" ? t.mode === "range" ? " - " : ", " : t.mode === "range" ? t.rangeSeparator : t.separator), o = y(() => {
2067
+ const s = t.modelValue;
2068
+ return t.mode === "single" ? s ? c(s, t.format) : "" : t.mode === "multiple" ? s ? Array.isArray(s) ? s.map((d) => c(d, t.format)).join(e.value) : String(s) : "" : t.mode === "range" ? s ? typeof s == "object" && s.from && s.to ? `${c(s.from, t.format)}${e.value}${c(s.to, t.format)}` : Array.isArray(s) && s.length >= 2 ? `${c(s[0], t.format)}${e.value}${c(s[1], t.format)}` : String(s) : "" : String(s ?? "");
1718
2069
  });
1719
- function s(o, c) {
1720
- return o || "";
2070
+ function c(s, d) {
2071
+ return s || "";
1721
2072
  }
1722
- const d = g(() => !l.value);
1723
- return (o, c) => (f(), p("div", {
1724
- class: V(["u-date-show", { "u-date-empty": d.value }])
1725
- }, P(l.value || (a.locale === "en-US" ? "Empty" : "暂无")), 3));
2073
+ const r = y(() => !o.value);
2074
+ return (s, d) => (f(), h("div", {
2075
+ class: $(["u-date-show", { "u-date-empty": r.value }])
2076
+ }, T(o.value || (l.locale === "en-US" ? "Empty" : "暂无")), 3));
1726
2077
  }
1727
- }), zt = /* @__PURE__ */ D(Wt, [["__scopeId", "data-v-930657df"]]), Nt = /* @__PURE__ */ S({
2078
+ }), Jt = /* @__PURE__ */ P(Kt, [["__scopeId", "data-v-930657df"]]), Xt = /* @__PURE__ */ V({
1728
2079
  __name: "UFieldView",
1729
2080
  props: {
1730
2081
  type: { default: "text" },
@@ -1741,21 +2092,21 @@ const St = { class: "table-search" }, Dt = { class: "search-fields" }, kt = { cl
1741
2092
  multiline: { type: Boolean },
1742
2093
  defaultText: { default: "" }
1743
2094
  },
1744
- setup(a) {
1745
- const t = a, e = g(() => {
2095
+ setup(l) {
2096
+ const t = l, e = y(() => {
1746
2097
  if (!t.text) return null;
1747
- const o = t.text.split("/");
1748
- return o.length >= 2 ? {
1749
- trueText: o[0].trim(),
1750
- falseText: o[1].trim()
2098
+ const s = t.text.split("/");
2099
+ return s.length >= 2 ? {
2100
+ trueText: s[0].trim(),
2101
+ falseText: s[1].trim()
1751
2102
  } : null;
1752
- }), l = g(() => {
1753
- var o;
1754
- return t.trueText || ((o = e.value) == null ? void 0 : o.trueText) || "开启";
1755
- }), s = g(() => {
1756
- var o;
1757
- return t.falseText || ((o = e.value) == null ? void 0 : o.falseText) || "关闭";
1758
- }), d = g(() => {
2103
+ }), o = y(() => {
2104
+ var s;
2105
+ return t.trueText || ((s = e.value) == null ? void 0 : s.trueText) || "开启";
2106
+ }), c = y(() => {
2107
+ var s;
2108
+ return t.falseText || ((s = e.value) == null ? void 0 : s.falseText) || "关闭";
2109
+ }), r = y(() => {
1759
2110
  switch (t.type) {
1760
2111
  case "dict":
1761
2112
  return "UDictShow";
@@ -1771,21 +2122,21 @@ const St = { class: "table-search" }, Dt = { class: "search-fields" }, kt = { cl
1771
2122
  return "UInputShow";
1772
2123
  }
1773
2124
  });
1774
- return (o, c) => (f(), E(ie(d.value === "UDictShow" ? It : d.value === "UToggleShow" ? Lt : d.value === "UCascaderShow" ? Mt : d.value === "UDateShow" ? zt : Bt), {
1775
- "model-value": a.modelValue,
1776
- "dict-type": a.type === "dict" ? a.dictType : void 0,
1777
- "cascader-key": a.type === "cascader" ? a.cascaderKey : void 0,
1778
- mode: a.type === "date" ? a.mode : void 0,
1779
- locale: a.type === "date" ? a.locale : void 0,
1780
- format: a.type === "date" ? a.format : void 0,
1781
- "true-text": a.type === "switch" ? l.value : void 0,
1782
- "false-text": a.type === "switch" ? s.value : void 0,
1783
- "use-yes-no": a.type === "switch" ? a.useYesNo : void 0,
1784
- multiline: a.type === "input" || a.type === "text" ? a.multiline : void 0,
1785
- "default-text": a.type === "dict" ? a.defaultText : void 0
2125
+ return (s, d) => (f(), k(O(r.value === "UDictShow" ? Ot : r.value === "UToggleShow" ? Qt : r.value === "UCascaderShow" ? Ht : r.value === "UDateShow" ? Jt : Wt), {
2126
+ "model-value": l.modelValue,
2127
+ "dict-type": l.type === "dict" ? l.dictType : void 0,
2128
+ "cascader-key": l.type === "cascader" ? l.cascaderKey : void 0,
2129
+ mode: l.type === "date" ? l.mode : void 0,
2130
+ locale: l.type === "date" ? l.locale : void 0,
2131
+ format: l.type === "date" ? l.format : void 0,
2132
+ "true-text": l.type === "switch" ? o.value : void 0,
2133
+ "false-text": l.type === "switch" ? c.value : void 0,
2134
+ "use-yes-no": l.type === "switch" ? l.useYesNo : void 0,
2135
+ multiline: l.type === "input" || l.type === "text" ? l.multiline : void 0,
2136
+ "default-text": l.type === "dict" ? l.defaultText : void 0
1786
2137
  }, null, 8, ["model-value", "dict-type", "cascader-key", "mode", "locale", "format", "true-text", "false-text", "use-yes-no", "multiline", "default-text"]));
1787
2138
  }
1788
- }), se = /* @__PURE__ */ D(Nt, [["__scopeId", "data-v-fedb54d7"]]), Ot = { class: "table-grid" }, jt = /* @__PURE__ */ S({
2139
+ }), de = /* @__PURE__ */ P(Xt, [["__scopeId", "data-v-fedb54d7"]]), Zt = { class: "table-grid" }, ea = /* @__PURE__ */ V({
1789
2140
  __name: "TableGrid",
1790
2141
  props: {
1791
2142
  rows: {},
@@ -1799,172 +2150,172 @@ const St = { class: "table-search" }, Dt = { class: "search-fields" }, kt = { cl
1799
2150
  dictData: {}
1800
2151
  },
1801
2152
  emits: ["selectionChange", "rowEdit", "rowDelete", "rowClick"],
1802
- setup(a, { emit: t }) {
1803
- const e = a, l = t, s = g(() => e.formId && (!e.actions || e.actions.edit !== !1)), d = g(() => e.apiDelete && (!e.actions || e.actions.delete !== !1)), o = g(() => {
1804
- var i;
1805
- return ((i = e.actions) == null ? void 0 : i.edit) || "编辑";
1806
- }), c = g(() => {
1807
- var i;
1808
- return ((i = e.actions) == null ? void 0 : i.delete) || "删除";
1809
- }), n = g(() => {
1810
- const i = e.columns.map((u) => {
2153
+ setup(l, { emit: t }) {
2154
+ const e = l, o = t, c = y(() => e.formId && (!e.actions || e.actions.edit !== !1)), r = y(() => e.apiDelete && (!e.actions || e.actions.delete !== !1)), s = y(() => {
2155
+ var n;
2156
+ return ((n = e.actions) == null ? void 0 : n.edit) || "编辑";
2157
+ }), d = y(() => {
2158
+ var n;
2159
+ return ((n = e.actions) == null ? void 0 : n.delete) || "删除";
2160
+ }), a = y(() => {
2161
+ const n = e.columns.map((u) => {
1811
2162
  const m = {
1812
2163
  prop: u.field,
1813
2164
  label: u.label
1814
2165
  };
1815
2166
  return typeof u.width == "number" && (m.width = u.width), m;
1816
2167
  });
1817
- return (s.value || d.value) && i.push({
2168
+ return (c.value || r.value) && n.push({
1818
2169
  prop: "actions",
1819
2170
  label: "操作",
1820
2171
  width: 120,
1821
2172
  fixed: "right"
1822
- }), i;
1823
- }), r = {
2173
+ }), n;
2174
+ }), i = {
1824
2175
  // 手机号脱敏
1825
- maskPhone(i) {
1826
- return !i || i.length < 7 ? i : i.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
2176
+ maskPhone(n) {
2177
+ return !n || n.length < 7 ? n : n.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
1827
2178
  },
1828
2179
  // 身份证脱敏
1829
- maskIdCard(i) {
1830
- return !i || i.length < 8 ? i : i.replace(/(\d{3})\d{11}(\d{4})/, "$1***********$2");
2180
+ maskIdCard(n) {
2181
+ return !n || n.length < 8 ? n : n.replace(/(\d{3})\d{11}(\d{4})/, "$1***********$2");
1831
2182
  },
1832
2183
  // 金额格式化
1833
- formatMoney(i) {
1834
- const u = Number(i);
1835
- return isNaN(u) ? String(i) : u.toLocaleString("zh-CN", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
2184
+ formatMoney(n) {
2185
+ const u = Number(n);
2186
+ return isNaN(u) ? String(n) : u.toLocaleString("zh-CN", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
1836
2187
  },
1837
2188
  // 根据 format 类型格式化
1838
- formatByType(i, u) {
1839
- if (!i)
2189
+ formatByType(n, u) {
2190
+ if (!n)
1840
2191
  return "";
1841
2192
  switch (u) {
1842
2193
  case "phone":
1843
- return r.maskPhone(i);
2194
+ return i.maskPhone(n);
1844
2195
  case "idcard":
1845
- return r.maskIdCard(i);
2196
+ return i.maskIdCard(n);
1846
2197
  case "money":
1847
- return r.formatMoney(i);
2198
+ return i.formatMoney(n);
1848
2199
  case "percent":
1849
- return String(i * 100) + "%";
2200
+ return String(n * 100) + "%";
1850
2201
  default:
1851
- return u && u.includes("{}") ? u.replace("{}", String(i)) : String(i);
2202
+ return u && u.includes("{}") ? u.replace("{}", String(n)) : String(n);
1852
2203
  }
1853
2204
  },
1854
2205
  // 获取嵌套字段值
1855
- getNestedValue(i, u) {
2206
+ getNestedValue(n, u) {
1856
2207
  if (!u.includes("."))
1857
- return i[u];
2208
+ return n[u];
1858
2209
  const m = u.split(".");
1859
- let y = i;
1860
- for (const w of m)
1861
- if (y && typeof y == "object" && w in y)
1862
- y = y[w];
2210
+ let g = n;
2211
+ for (const b of m)
2212
+ if (g && typeof g == "object" && b in g)
2213
+ g = g[b];
1863
2214
  else
1864
2215
  return;
1865
- return y;
2216
+ return g;
1866
2217
  },
1867
2218
  // 判断是否需要使用 UFieldView 组件
1868
- useFieldView(i) {
1869
- return i.type ? ["dict", "switch", "cascader", "date", "input", "text"].includes(i.type) : !1;
2219
+ useFieldView(n) {
2220
+ return n.type ? ["dict", "switch", "cascader", "date", "input", "text"].includes(n.type) : !1;
1870
2221
  },
1871
2222
  // 选择变化
1872
- onSelectionChange(i) {
1873
- l("selectionChange", i);
2223
+ onSelectionChange(n) {
2224
+ o("selectionChange", n);
1874
2225
  },
1875
2226
  // 行点击
1876
- onRowClick(i) {
1877
- l("rowClick", i);
2227
+ onRowClick(n) {
2228
+ o("rowClick", n);
1878
2229
  },
1879
2230
  // 编辑
1880
- onRowEdit(i) {
1881
- l("rowEdit", i);
2231
+ onRowEdit(n) {
2232
+ o("rowEdit", n);
1882
2233
  },
1883
2234
  // 删除
1884
- onRowDelete(i) {
1885
- l("rowDelete", i);
2235
+ onRowDelete(n) {
2236
+ o("rowDelete", n);
1886
2237
  }
1887
2238
  };
1888
- return (i, u) => {
1889
- const m = Ie, y = Q, w = Ae;
1890
- return f(), p("div", Ot, [
1891
- x(w, {
2239
+ return (n, u) => {
2240
+ const m = ze, g = Y, b = Fe;
2241
+ return f(), h("div", Zt, [
2242
+ S(b, {
1892
2243
  data: e.rows.length ? e.rows : [{}],
1893
2244
  loading: e.loading,
1894
2245
  "row-key": e.keyField || "id",
1895
- onSelectionChange: r.onSelectionChange,
1896
- onRowClick: u[0] || (u[0] = (h) => r.onRowClick(h)),
2246
+ onSelectionChange: i.onSelectionChange,
2247
+ onRowClick: u[0] || (u[0] = (p) => i.onRowClick(p)),
1897
2248
  stripe: "",
1898
2249
  border: ""
1899
2250
  }, {
1900
- empty: _(() => [...u[1] || (u[1] = [
1901
- C("div", { class: "no-data" }, "暂无数据", -1)
2251
+ empty: w(() => [...u[1] || (u[1] = [
2252
+ x("div", { class: "no-data" }, "暂无数据", -1)
1902
2253
  ])]),
1903
- default: _(() => [
1904
- e.selection ? (f(), E(m, {
2254
+ default: w(() => [
2255
+ e.selection ? (f(), k(m, {
1905
2256
  key: 0,
1906
2257
  type: "selection",
1907
2258
  width: "55"
1908
- })) : T("", !0),
1909
- (f(!0), p($, null, F(n.value, (h) => (f(), E(m, {
1910
- key: h.prop,
1911
- prop: h.prop,
1912
- label: h.label,
1913
- width: h.width,
1914
- fixed: h.fixed
2259
+ })) : D("", !0),
2260
+ (f(!0), h(I, null, M(a.value, (p) => (f(), k(m, {
2261
+ key: p.prop,
2262
+ prop: p.prop,
2263
+ label: p.label,
2264
+ width: p.width,
2265
+ fixed: p.fixed
1915
2266
  }, {
1916
- default: _(({ row: k }) => [
1917
- h.prop === "actions" ? (f(), p($, { key: 0 }, [
1918
- Object.keys(k).length > 0 ? (f(), p($, { key: 0 }, [
1919
- s.value ? (f(), E(y, {
2267
+ default: w(({ row: C }) => [
2268
+ p.prop === "actions" ? (f(), h(I, { key: 0 }, [
2269
+ Object.keys(C).length > 0 ? (f(), h(I, { key: 0 }, [
2270
+ c.value ? (f(), k(g, {
1920
2271
  key: 0,
1921
2272
  link: "",
1922
2273
  type: "primary",
1923
2274
  size: "small",
1924
- onClick: fe((b) => r.onRowEdit(k), ["stop"])
2275
+ onClick: me((v) => i.onRowEdit(C), ["stop"])
1925
2276
  }, {
1926
- default: _(() => [
1927
- U(P(o.value), 1)
2277
+ default: w(() => [
2278
+ B(T(s.value), 1)
1928
2279
  ]),
1929
2280
  _: 1
1930
- }, 8, ["onClick"])) : T("", !0),
1931
- d.value ? (f(), E(y, {
2281
+ }, 8, ["onClick"])) : D("", !0),
2282
+ r.value ? (f(), k(g, {
1932
2283
  key: 1,
1933
2284
  link: "",
1934
2285
  type: "danger",
1935
2286
  size: "small",
1936
- onClick: fe((b) => r.onRowDelete(k), ["stop"])
2287
+ onClick: me((v) => i.onRowDelete(C), ["stop"])
1937
2288
  }, {
1938
- default: _(() => [
1939
- U(P(c.value), 1)
2289
+ default: w(() => [
2290
+ B(T(d.value), 1)
1940
2291
  ]),
1941
2292
  _: 1
1942
- }, 8, ["onClick"])) : T("", !0)
1943
- ], 64)) : T("", !0)
1944
- ], 64)) : (f(), p($, { key: 1 }, [
1945
- Object.keys(k).length > 0 ? (f(!0), p($, { key: 0 }, F(e.columns, (b) => (f(), p($, {
1946
- key: b.field
2293
+ }, 8, ["onClick"])) : D("", !0)
2294
+ ], 64)) : D("", !0)
2295
+ ], 64)) : (f(), h(I, { key: 1 }, [
2296
+ Object.keys(C).length > 0 ? (f(!0), h(I, { key: 0 }, M(e.columns, (v) => (f(), h(I, {
2297
+ key: v.field
1947
2298
  }, [
1948
- b.field === h.prop && r.useFieldView(b) ? (f(), E(se, {
2299
+ v.field === p.prop && i.useFieldView(v) ? (f(), k(de, {
1949
2300
  key: 0,
1950
- type: b.type,
1951
- "model-value": r.getNestedValue(k, b.field),
1952
- "dict-type": b.dictType,
1953
- mode: b.mode,
1954
- locale: b.locale,
1955
- format: b.format,
1956
- text: b.text,
1957
- "true-text": b.trueText,
1958
- "false-text": b.falseText,
1959
- "use-yes-no": b.useYesNo,
1960
- "cascader-key": b.cascaderKey,
1961
- multiline: b.multiline,
1962
- "default-text": b.defaultText
1963
- }, null, 8, ["type", "model-value", "dict-type", "mode", "locale", "format", "text", "true-text", "false-text", "use-yes-no", "cascader-key", "multiline", "default-text"])) : b.field === h.prop ? (f(), p("span", {
2301
+ type: v.type,
2302
+ "model-value": i.getNestedValue(C, v.field),
2303
+ "dict-type": v.dictType,
2304
+ mode: v.mode,
2305
+ locale: v.locale,
2306
+ format: v.format,
2307
+ text: v.text,
2308
+ "true-text": v.trueText,
2309
+ "false-text": v.falseText,
2310
+ "use-yes-no": v.useYesNo,
2311
+ "cascader-key": v.cascaderKey,
2312
+ multiline: v.multiline,
2313
+ "default-text": v.defaultText
2314
+ }, null, 8, ["type", "model-value", "dict-type", "mode", "locale", "format", "text", "true-text", "false-text", "use-yes-no", "cascader-key", "multiline", "default-text"])) : v.field === p.prop ? (f(), h("span", {
1964
2315
  key: 1,
1965
- class: V({ "table-grid-format": b.format })
1966
- }, P(r.formatByType(r.getNestedValue(k, b.field), b.format || "")), 3)) : T("", !0)
1967
- ], 64))), 128)) : T("", !0)
2316
+ class: $({ "table-grid-format": v.format })
2317
+ }, T(i.formatByType(i.getNestedValue(C, v.field), v.format || "")), 3)) : D("", !0)
2318
+ ], 64))), 128)) : D("", !0)
1968
2319
  ], 64))
1969
2320
  ]),
1970
2321
  _: 2
@@ -1975,13 +2326,13 @@ const St = { class: "table-search" }, Dt = { class: "search-fields" }, kt = { cl
1975
2326
  ]);
1976
2327
  };
1977
2328
  }
1978
- }), Yt = /* @__PURE__ */ D(jt, [["__scopeId", "data-v-60cb7136"]]), Qt = { class: "table-pagination" }, Gt = { class: "page-size-select" }, Kt = { class: "total-text" }, Ht = {
2329
+ }), ta = /* @__PURE__ */ P(ea, [["__scopeId", "data-v-60cb7136"]]), aa = { class: "table-pagination" }, oa = { class: "page-size-select" }, la = { class: "total-text" }, na = {
1979
2330
  key: 1,
1980
2331
  class: "load-more"
1981
- }, Jt = {
2332
+ }, ia = {
1982
2333
  key: 2,
1983
2334
  class: "total-text"
1984
- }, Xt = /* @__PURE__ */ S({
2335
+ }, sa = /* @__PURE__ */ V({
1985
2336
  __name: "TablePagination",
1986
2337
  props: {
1987
2338
  page: {},
@@ -1990,86 +2341,86 @@ const St = { class: "table-search" }, Dt = { class: "search-fields" }, kt = { cl
1990
2341
  type: {}
1991
2342
  },
1992
2343
  emits: ["update:page", "update:pageSize"],
1993
- setup(a, { emit: t }) {
1994
- const e = a, l = t, s = g(() => ({
2344
+ setup(l, { emit: t }) {
2345
+ const e = l, o = t, c = y(() => ({
1995
2346
  // 总页数
1996
2347
  totalPages: Math.ceil(e.total / e.pageSize),
1997
2348
  // 是否显示分页
1998
2349
  showPagination: e.type === "page" && e.total > 0
1999
- })), d = {
2350
+ })), r = {
2000
2351
  // 页码变化
2001
- onPageChange: (o) => {
2002
- l("update:page", o);
2352
+ onPageChange: (s) => {
2353
+ o("update:page", s);
2003
2354
  },
2004
2355
  // 每页条数变化
2005
- onPageSizeChange: (o) => {
2006
- l("update:pageSize", o);
2356
+ onPageSizeChange: (s) => {
2357
+ o("update:pageSize", s);
2007
2358
  }
2008
2359
  };
2009
- return (o, c) => {
2010
- const n = Fe, r = oe, i = le, u = Q;
2011
- return f(), p("div", Qt, [
2012
- s.value.showPagination ? (f(), p($, { key: 0 }, [
2013
- x(n, {
2360
+ return (s, d) => {
2361
+ const a = qe, i = ie, n = ne, u = Y;
2362
+ return f(), h("div", aa, [
2363
+ c.value.showPagination ? (f(), h(I, { key: 0 }, [
2364
+ S(a, {
2014
2365
  "current-page": e.page,
2015
- "page-count": s.value.totalPages,
2366
+ "page-count": c.value.totalPages,
2016
2367
  "page-sizes": [10, 20, 50, 100],
2017
2368
  "page-size": e.pageSize,
2018
2369
  layout: "total, prev, pager, next, jumper",
2019
- onCurrentChange: d.onPageChange,
2020
- onSizeChange: d.onPageSizeChange
2370
+ onCurrentChange: r.onPageChange,
2371
+ onSizeChange: r.onPageSizeChange
2021
2372
  }, null, 8, ["current-page", "page-count", "page-size", "onCurrentChange", "onSizeChange"]),
2022
- C("div", Gt, [
2023
- x(i, {
2373
+ x("div", oa, [
2374
+ S(n, {
2024
2375
  "model-value": e.pageSize,
2025
2376
  style: { width: "100px" },
2026
- onChange: d.onPageSizeChange
2377
+ onChange: r.onPageSizeChange
2027
2378
  }, {
2028
- default: _(() => [
2029
- x(r, {
2379
+ default: w(() => [
2380
+ S(i, {
2030
2381
  value: 10,
2031
2382
  label: "10条/页"
2032
2383
  }),
2033
- x(r, {
2384
+ S(i, {
2034
2385
  value: 20,
2035
2386
  label: "20条/页"
2036
2387
  }),
2037
- x(r, {
2388
+ S(i, {
2038
2389
  value: 50,
2039
2390
  label: "50条/页"
2040
2391
  }),
2041
- x(r, {
2392
+ S(i, {
2042
2393
  value: 100,
2043
2394
  label: "100条/页"
2044
2395
  })
2045
2396
  ]),
2046
2397
  _: 1
2047
2398
  }, 8, ["model-value", "onChange"]),
2048
- C("span", Kt, "共 " + P(e.total) + " 条", 1)
2399
+ x("span", la, "共 " + T(e.total) + " 条", 1)
2049
2400
  ])
2050
- ], 64)) : e.type === "auto" ? (f(), p("div", Ht, [
2051
- x(u, {
2401
+ ], 64)) : e.type === "auto" ? (f(), h("div", na, [
2402
+ S(u, {
2052
2403
  disabled: e.page * e.pageSize >= e.total
2053
2404
  }, {
2054
- default: _(() => [...c[0] || (c[0] = [
2055
- U("加载更多", -1)
2405
+ default: w(() => [...d[0] || (d[0] = [
2406
+ B("加载更多", -1)
2056
2407
  ])]),
2057
2408
  _: 1
2058
2409
  }, 8, ["disabled"])
2059
- ])) : e.type === "all" ? (f(), p("div", Jt, "共 " + P(e.total) + " 条", 1)) : T("", !0)
2410
+ ])) : e.type === "all" ? (f(), h("div", ia, "共 " + T(e.total) + " 条", 1)) : D("", !0)
2060
2411
  ]);
2061
2412
  };
2062
2413
  }
2063
- }), Zt = /* @__PURE__ */ D(Xt, [["__scopeId", "data-v-53e593aa"]]), ea = { class: "detail-header" }, ta = { class: "detail-title" }, aa = { class: "table-detail" }, la = {
2414
+ }), ra = /* @__PURE__ */ P(sa, [["__scopeId", "data-v-53e593aa"]]), da = { class: "detail-header" }, ca = { class: "detail-title" }, ua = { class: "table-detail" }, fa = {
2064
2415
  key: 0,
2065
2416
  class: "loading"
2066
- }, oa = {
2417
+ }, ma = {
2067
2418
  key: 1,
2068
2419
  class: "detail-content"
2069
- }, ia = { class: "detail-label" }, na = { class: "detail-value" }, sa = {
2420
+ }, pa = { class: "detail-label" }, ha = { class: "detail-value" }, ga = {
2070
2421
  key: 2,
2071
2422
  class: "no-data"
2072
- }, ra = /* @__PURE__ */ S({
2423
+ }, ya = /* @__PURE__ */ V({
2073
2424
  __name: "TableDetail",
2074
2425
  props: {
2075
2426
  visible: { type: Boolean },
@@ -2080,82 +2431,82 @@ const St = { class: "table-search" }, Dt = { class: "search-fields" }, kt = { cl
2080
2431
  columns: {}
2081
2432
  },
2082
2433
  emits: ["close"],
2083
- setup(a, { emit: t }) {
2084
- const e = a, l = t, s = g(() => ({
2434
+ setup(l, { emit: t }) {
2435
+ const e = l, o = t, c = y(() => ({
2085
2436
  // el-drawer 位置
2086
2437
  direction: {
2087
2438
  left: "ltr",
2088
2439
  right: "rtl",
2089
2440
  top: "ttb"
2090
2441
  }[e.position || "right"] || "rtl"
2091
- })), d = (o, c) => {
2092
- if (!o || !c) return "";
2093
- if (!c.includes("."))
2094
- return o[c];
2095
- const n = c.split(".");
2096
- let r = o;
2097
- for (const i of n)
2098
- if (r && typeof r == "object" && i in r)
2099
- r = r[i];
2442
+ })), r = (s, d) => {
2443
+ if (!s || !d) return "";
2444
+ if (!d.includes("."))
2445
+ return s[d];
2446
+ const a = d.split(".");
2447
+ let i = s;
2448
+ for (const n of a)
2449
+ if (i && typeof i == "object" && n in i)
2450
+ i = i[n];
2100
2451
  else
2101
2452
  return "";
2102
- return r;
2453
+ return i;
2103
2454
  };
2104
- return (o, c) => {
2105
- const n = Le;
2106
- return f(), E(n, {
2455
+ return (s, d) => {
2456
+ const a = Ne;
2457
+ return f(), k(a, {
2107
2458
  "model-value": e.visible,
2108
- direction: s.value.direction,
2459
+ direction: c.value.direction,
2109
2460
  size: 400,
2110
2461
  "with-header": !0,
2111
2462
  "show-close": !0,
2112
- onClose: c[0] || (c[0] = (r) => l("close"))
2463
+ onClose: d[0] || (d[0] = (i) => o("close"))
2113
2464
  }, {
2114
- header: _(() => [
2115
- C("div", ea, [
2116
- C("div", ta, P(e.title || "详情"), 1)
2465
+ header: w(() => [
2466
+ x("div", da, [
2467
+ x("div", ca, T(e.title || "详情"), 1)
2117
2468
  ])
2118
2469
  ]),
2119
- default: _(() => [
2120
- C("div", aa, [
2121
- e.loading ? (f(), p("div", la, "加载中...")) : e.rowData ? (f(), p("div", oa, [
2122
- (f(!0), p($, null, F(e.columns, (r) => (f(), p("div", {
2123
- key: r.field,
2470
+ default: w(() => [
2471
+ x("div", ua, [
2472
+ e.loading ? (f(), h("div", fa, "加载中...")) : e.rowData ? (f(), h("div", ma, [
2473
+ (f(!0), h(I, null, M(e.columns, (i) => (f(), h("div", {
2474
+ key: i.field,
2124
2475
  class: "detail-item"
2125
2476
  }, [
2126
- C("div", ia, P(r.label), 1),
2127
- C("div", na, [
2128
- x(se, {
2129
- type: r.type,
2130
- "model-value": d(e.rowData, r.field),
2131
- "dict-type": r.dictType,
2132
- mode: r.mode,
2133
- locale: r.locale,
2134
- format: r.format,
2135
- text: r.text,
2136
- "true-text": r.trueText,
2137
- "false-text": r.falseText,
2138
- "use-yes-no": r.useYesNo,
2139
- "cascader-key": r.cascaderKey,
2140
- multiline: r.multiline,
2141
- "default-text": r.defaultText
2477
+ x("div", pa, T(i.label), 1),
2478
+ x("div", ha, [
2479
+ S(de, {
2480
+ type: i.type,
2481
+ "model-value": r(e.rowData, i.field),
2482
+ "dict-type": i.dictType,
2483
+ mode: i.mode,
2484
+ locale: i.locale,
2485
+ format: i.format,
2486
+ text: i.text,
2487
+ "true-text": i.trueText,
2488
+ "false-text": i.falseText,
2489
+ "use-yes-no": i.useYesNo,
2490
+ "cascader-key": i.cascaderKey,
2491
+ multiline: i.multiline,
2492
+ "default-text": i.defaultText
2142
2493
  }, null, 8, ["type", "model-value", "dict-type", "mode", "locale", "format", "text", "true-text", "false-text", "use-yes-no", "cascader-key", "multiline", "default-text"])
2143
2494
  ])
2144
2495
  ]))), 128))
2145
- ])) : (f(), p("div", sa, "暂无数据"))
2496
+ ])) : (f(), h("div", ga, "暂无数据"))
2146
2497
  ])
2147
2498
  ]),
2148
2499
  _: 1
2149
2500
  }, 8, ["model-value", "direction"]);
2150
2501
  };
2151
2502
  }
2152
- }), da = /* @__PURE__ */ D(ra, [["__scopeId", "data-v-ee569603"]]), ca = { class: "table-render" }, ua = { class: "table-body" }, fa = { class: "table-container" }, ma = /* @__PURE__ */ S({
2503
+ }), ba = /* @__PURE__ */ P(ya, [["__scopeId", "data-v-ee569603"]]), va = { class: "table-render" }, wa = { class: "table-body" }, xa = { class: "table-container" }, Ca = /* @__PURE__ */ V({
2153
2504
  __name: "TableRender",
2154
2505
  props: {
2155
2506
  formId: {}
2156
2507
  },
2157
- setup(a, { expose: t }) {
2158
- const e = a, l = new _t(), s = L(null), d = q({
2508
+ setup(l, { expose: t }) {
2509
+ const e = l, o = new Et(), c = q(null), r = z({
2159
2510
  // 内部搜索参数
2160
2511
  searchParams: {},
2161
2512
  // 选中行
@@ -2165,129 +2516,129 @@ const St = { class: "table-search" }, Dt = { class: "search-fields" }, kt = { cl
2165
2516
  // 字典数据缓存
2166
2517
  dictData: {}
2167
2518
  });
2168
- Z(async () => {
2169
- e.formId && await c.loadConfig(e.formId);
2519
+ H(async () => {
2520
+ e.formId && await d.loadConfig(e.formId);
2170
2521
  });
2171
- const o = g(() => ({
2522
+ const s = y(() => ({
2172
2523
  // 表格配置
2173
- tableConfig: l.data.tableConfig,
2524
+ tableConfig: o.data.tableConfig,
2174
2525
  // 表格数据
2175
- rows: l.data.rows,
2526
+ rows: o.data.rows,
2176
2527
  // 总数
2177
- total: l.data.total,
2528
+ total: o.data.total,
2178
2529
  // 加载状态
2179
- loading: l.data.loading,
2530
+ loading: o.data.loading,
2180
2531
  // 分页信息
2181
- pagination: l.data.pagination,
2532
+ pagination: o.data.pagination,
2182
2533
  // 选中行
2183
- selectedRows: l.data.selectedRows,
2534
+ selectedRows: o.data.selectedRows,
2184
2535
  // 搜索字段
2185
- searchFields: l.getSearchFields(),
2536
+ searchFields: o.getSearchFields(),
2186
2537
  // 列定义
2187
- columns: l.getColumns(),
2538
+ columns: o.getColumns(),
2188
2539
  // 工具栏
2189
- toolbar: l.getToolbar(),
2540
+ toolbar: o.getToolbar(),
2190
2541
  // 行操作
2191
- actions: l.getActions(),
2542
+ actions: o.getActions(),
2192
2543
  // 是否显示详情
2193
- showDetail: l.hasDetail(),
2544
+ showDetail: o.hasDetail(),
2194
2545
  // 详情可见
2195
- detailVisible: l.data.detailVisible,
2546
+ detailVisible: o.data.detailVisible,
2196
2547
  // 详情数据
2197
- detailData: l.data.detailData,
2548
+ detailData: o.data.detailData,
2198
2549
  // 详情加载状态
2199
- detailLoading: l.data.detailLoading,
2550
+ detailLoading: o.data.detailLoading,
2200
2551
  // 选择模式
2201
- selectionMode: l.showSelection() ? "multiple" : void 0,
2552
+ selectionMode: o.showSelection() ? "multiple" : void 0,
2202
2553
  // 字典数据
2203
- dictData: d.dictData
2204
- })), c = {
2554
+ dictData: r.dictData
2555
+ })), d = {
2205
2556
  // 加载配置
2206
- async loadConfig(n) {
2207
- console.log("loadConfig", n);
2557
+ async loadConfig(a) {
2558
+ console.log("loadConfig", a);
2208
2559
  try {
2209
- await l.loadConfig(n);
2210
- } catch (r) {
2211
- B((r == null ? void 0 : r.message) || "获取表格配置失败");
2560
+ await o.loadConfig(a);
2561
+ } catch (i) {
2562
+ E((i == null ? void 0 : i.message) || "获取表格配置失败");
2212
2563
  return;
2213
2564
  }
2214
- d.searchParams = { ...l.data.searchParams }, d.loaded = !0, await c.loadDictData(), await c.handleLoadData();
2565
+ r.searchParams = { ...o.data.searchParams }, r.loaded = !0, await d.loadDictData(), await d.handleLoadData();
2215
2566
  },
2216
2567
  // 加载表格数据(报错时提示框展示 message)
2217
2568
  async handleLoadData() {
2218
2569
  try {
2219
- await l.loadData();
2220
- } catch (n) {
2221
- B((n == null ? void 0 : n.message) || "加载数据失败");
2570
+ await o.loadData();
2571
+ } catch (a) {
2572
+ E((a == null ? void 0 : a.message) || "加载数据失败");
2222
2573
  }
2223
2574
  },
2224
2575
  // 加载字典数据
2225
2576
  async loadDictData() {
2226
- const n = l.getColumns(), r = /* @__PURE__ */ new Set();
2227
- for (const i of n)
2228
- i.type === "dict" && i.dictType && r.add(i.dictType);
2229
- for (const i of r)
2577
+ const a = o.getColumns(), i = /* @__PURE__ */ new Set();
2578
+ for (const n of a)
2579
+ n.type === "dict" && n.dictType && i.add(n.dictType);
2580
+ for (const n of i)
2230
2581
  try {
2231
- const u = await R.get(z.dictApi(i));
2232
- u.status === 200 && (d.dictData[i] = ne(u.data));
2582
+ const u = await A.get(N.dictApi(n));
2583
+ u.status === 200 && (r.dictData[n] = re(u.data));
2233
2584
  } catch (u) {
2234
- console.error(`[TableRender] 加载字典 ${i} 失败:`, u);
2585
+ console.error(`[TableRender] 加载字典 ${n} 失败:`, u);
2235
2586
  }
2236
2587
  },
2237
2588
  // 搜索
2238
2589
  async handleSearch() {
2239
- l.data.searchParams = { ...d.searchParams };
2590
+ o.data.searchParams = { ...r.searchParams };
2240
2591
  try {
2241
- await l.search();
2242
- } catch (n) {
2243
- B((n == null ? void 0 : n.message) || "查询失败");
2592
+ await o.search();
2593
+ } catch (a) {
2594
+ E((a == null ? void 0 : a.message) || "查询失败");
2244
2595
  }
2245
2596
  },
2246
2597
  // 重置
2247
2598
  async handleReset() {
2248
- d.searchParams = {};
2599
+ r.searchParams = {};
2249
2600
  try {
2250
- await l.reset();
2251
- } catch (n) {
2252
- B((n == null ? void 0 : n.message) || "重置失败");
2601
+ await o.reset();
2602
+ } catch (a) {
2603
+ E((a == null ? void 0 : a.message) || "重置失败");
2253
2604
  }
2254
2605
  },
2255
2606
  // 更新搜索参数
2256
- updateSearchParam(n, r) {
2257
- d.searchParams[n] = r;
2607
+ updateSearchParam(a, i) {
2608
+ r.searchParams[a] = i;
2258
2609
  },
2259
2610
  // 选择变化
2260
- handleSelectionChange(n) {
2261
- l.updateSelection(n);
2611
+ handleSelectionChange(a) {
2612
+ o.updateSelection(a);
2262
2613
  },
2263
2614
  // 新增
2264
2615
  async handleCreate() {
2265
- var r;
2266
- const n = l.getFormId();
2267
- n && s.value && await ((r = s.value) == null ? void 0 : r.showForm(n)) != null && await c.handleLoadData();
2616
+ var i;
2617
+ const a = o.getFormId();
2618
+ a && c.value && await ((i = c.value) == null ? void 0 : i.showForm(a)) != null && await d.handleLoadData();
2268
2619
  },
2269
2620
  // 编辑(批量)
2270
2621
  async handleBatchEdit() {
2271
- if (o.value.selectedRows.length !== 1) {
2272
- W.warning("请选择一行数据进行编辑");
2622
+ if (s.value.selectedRows.length !== 1) {
2623
+ j.warning("请选择一行数据进行编辑");
2273
2624
  return;
2274
2625
  }
2275
- await c.handleRowEdit(o.value.selectedRows[0]);
2626
+ await d.handleRowEdit(s.value.selectedRows[0]);
2276
2627
  },
2277
2628
  // 编辑(行)
2278
- async handleRowEdit(n) {
2279
- var i, u;
2280
- const r = l.getFormId();
2281
- if (r && s.value) {
2282
- const m = l.getKeyField();
2283
- await ((i = s.value) == null ? void 0 : i.showForm(r, `${m}=${n[m]}`)) != null && (await c.handleLoadData(), o.value.detailVisible && ((u = l.data.detailData) == null ? void 0 : u[m]) === n[m] && await l.openDetail(n));
2629
+ async handleRowEdit(a) {
2630
+ var n, u;
2631
+ const i = o.getFormId();
2632
+ if (i && c.value) {
2633
+ const m = o.getKeyField();
2634
+ await ((n = c.value) == null ? void 0 : n.showForm(i, `${m}=${a[m]}`)) != null && (await d.handleLoadData(), s.value.detailVisible && ((u = o.data.detailData) == null ? void 0 : u[m]) === a[m] && await o.openDetail(a));
2284
2635
  }
2285
2636
  },
2286
2637
  // 删除(批量)
2287
2638
  async handleBatchDelete() {
2288
2639
  try {
2289
- await ue.confirm(
2290
- `确定要删除选中的 ${o.value.selectedRows.length} 条数据吗?`,
2640
+ await fe.confirm(
2641
+ `确定要删除选中的 ${s.value.selectedRows.length} 条数据吗?`,
2291
2642
  "确认删除",
2292
2643
  {
2293
2644
  confirmButtonText: "确定",
@@ -2296,17 +2647,17 @@ const St = { class: "table-search" }, Dt = { class: "search-fields" }, kt = { cl
2296
2647
  }
2297
2648
  );
2298
2649
  try {
2299
- await l.batchDelete(), W.success("删除成功");
2300
- } catch (n) {
2301
- B((n == null ? void 0 : n.message) || "删除失败");
2650
+ await o.batchDelete(), j.success("删除成功");
2651
+ } catch (a) {
2652
+ E((a == null ? void 0 : a.message) || "删除失败");
2302
2653
  }
2303
2654
  } catch {
2304
2655
  }
2305
2656
  },
2306
2657
  // 删除(行)
2307
- async handleRowDelete(n) {
2658
+ async handleRowDelete(a) {
2308
2659
  try {
2309
- await ue.confirm(
2660
+ await fe.confirm(
2310
2661
  "确定要删除这条数据吗?",
2311
2662
  "确认删除",
2312
2663
  {
@@ -2316,9 +2667,9 @@ const St = { class: "table-search" }, Dt = { class: "search-fields" }, kt = { cl
2316
2667
  }
2317
2668
  );
2318
2669
  try {
2319
- await l.deleteRow(n), W.success("删除成功");
2320
- } catch (r) {
2321
- B((r == null ? void 0 : r.message) || "删除失败");
2670
+ await o.deleteRow(a), j.success("删除成功");
2671
+ } catch (i) {
2672
+ E((i == null ? void 0 : i.message) || "删除失败");
2322
2673
  }
2323
2674
  } catch {
2324
2675
  }
@@ -2326,119 +2677,119 @@ const St = { class: "table-search" }, Dt = { class: "search-fields" }, kt = { cl
2326
2677
  // 导出
2327
2678
  async handleExport() {
2328
2679
  try {
2329
- await l.exportData(), W.success("导出成功");
2330
- } catch (n) {
2331
- B((n == null ? void 0 : n.message) || "导出失败");
2680
+ await o.exportData(), j.success("导出成功");
2681
+ } catch (a) {
2682
+ E((a == null ? void 0 : a.message) || "导出失败");
2332
2683
  }
2333
2684
  },
2334
2685
  // 导入
2335
2686
  handleImport() {
2336
- W.info("导入功能开发中");
2687
+ j.info("导入功能开发中");
2337
2688
  },
2338
2689
  // 分页变化
2339
- async handlePageChange(n) {
2690
+ async handlePageChange(a) {
2340
2691
  try {
2341
- await l.changePage(n);
2342
- } catch (r) {
2343
- B((r == null ? void 0 : r.message) || "加载数据失败");
2692
+ await o.changePage(a);
2693
+ } catch (i) {
2694
+ E((i == null ? void 0 : i.message) || "加载数据失败");
2344
2695
  }
2345
2696
  },
2346
2697
  // 每页条数变化
2347
- async handlePageSizeChange(n) {
2698
+ async handlePageSizeChange(a) {
2348
2699
  try {
2349
- await l.changePageSize(n);
2350
- } catch (r) {
2351
- B((r == null ? void 0 : r.message) || "加载数据失败");
2700
+ await o.changePageSize(a);
2701
+ } catch (i) {
2702
+ E((i == null ? void 0 : i.message) || "加载数据失败");
2352
2703
  }
2353
2704
  },
2354
2705
  // 行点击(显示详情)
2355
- handleRowClick(n) {
2356
- o.value.showDetail && l.openDetail(n);
2706
+ handleRowClick(a) {
2707
+ s.value.showDetail && o.openDetail(a);
2357
2708
  },
2358
2709
  // 关闭详情
2359
2710
  handleDetailClose() {
2360
- l.closeDetail();
2711
+ o.closeDetail();
2361
2712
  }
2362
2713
  };
2363
- return Z(() => {
2714
+ return H(() => {
2364
2715
  }), t({
2365
- loadConfig: c.loadConfig
2366
- }), (n, r) => {
2367
- var i, u, m, y, w, h, k, b, re, de, ce;
2368
- return f(), p("div", ca, [
2369
- o.value.searchFields.length > 0 ? (f(), E(Vt, {
2716
+ loadConfig: d.loadConfig
2717
+ }), (a, i) => {
2718
+ var n, u, m, g, b, p, C, v, W, ce, ue;
2719
+ return f(), h("div", va, [
2720
+ s.value.searchFields.length > 0 ? (f(), k(Mt, {
2370
2721
  key: 0,
2371
- fields: o.value.searchFields,
2372
- modelValue: d.searchParams,
2373
- "onUpdate:modelValue": r[0] || (r[0] = (Se) => d.searchParams = Se),
2374
- onSearch: c.handleSearch,
2375
- onReset: c.handleReset
2376
- }, null, 8, ["fields", "modelValue", "onSearch", "onReset"])) : T("", !0),
2377
- C("div", ua, [
2378
- C("div", fa, [
2379
- x(Yt, {
2380
- rows: o.value.rows,
2381
- columns: o.value.columns,
2382
- loading: o.value.loading,
2383
- actions: o.value.actions,
2384
- "form-id": (i = o.value.tableConfig) == null ? void 0 : i.form,
2385
- "api-delete": (u = o.value.tableConfig) == null ? void 0 : u.api.delete,
2386
- "key-field": (m = o.value.tableConfig) == null ? void 0 : m.key,
2387
- selection: o.value.selectionMode,
2388
- "dict-data": o.value.dictData,
2389
- onSelectionChange: c.handleSelectionChange,
2390
- onRowEdit: c.handleRowEdit,
2391
- onRowDelete: c.handleRowDelete,
2392
- onRowClick: c.handleRowClick
2722
+ fields: s.value.searchFields,
2723
+ modelValue: r.searchParams,
2724
+ "onUpdate:modelValue": i[0] || (i[0] = (De) => r.searchParams = De),
2725
+ onSearch: d.handleSearch,
2726
+ onReset: d.handleReset
2727
+ }, null, 8, ["fields", "modelValue", "onSearch", "onReset"])) : D("", !0),
2728
+ x("div", wa, [
2729
+ x("div", xa, [
2730
+ S(ta, {
2731
+ rows: s.value.rows,
2732
+ columns: s.value.columns,
2733
+ loading: s.value.loading,
2734
+ actions: s.value.actions,
2735
+ "form-id": (n = s.value.tableConfig) == null ? void 0 : n.form,
2736
+ "api-delete": (u = s.value.tableConfig) == null ? void 0 : u.api.delete,
2737
+ "key-field": (m = s.value.tableConfig) == null ? void 0 : m.key,
2738
+ selection: s.value.selectionMode,
2739
+ "dict-data": s.value.dictData,
2740
+ onSelectionChange: d.handleSelectionChange,
2741
+ onRowEdit: d.handleRowEdit,
2742
+ onRowDelete: d.handleRowDelete,
2743
+ onRowClick: d.handleRowClick
2393
2744
  }, null, 8, ["rows", "columns", "loading", "actions", "form-id", "api-delete", "key-field", "selection", "dict-data", "onSelectionChange", "onRowEdit", "onRowDelete", "onRowClick"]),
2394
- x(Zt, {
2745
+ S(ra, {
2395
2746
  class: "table-pagination",
2396
- page: o.value.pagination.page,
2397
- "page-size": o.value.pagination.pageSize,
2398
- total: o.value.total,
2399
- type: (y = o.value.tableConfig) == null ? void 0 : y.pagination,
2400
- "onUpdate:page": c.handlePageChange,
2401
- "onUpdate:pageSize": c.handlePageSizeChange
2747
+ page: s.value.pagination.page,
2748
+ "page-size": s.value.pagination.pageSize,
2749
+ total: s.value.total,
2750
+ type: (g = s.value.tableConfig) == null ? void 0 : g.pagination,
2751
+ "onUpdate:page": d.handlePageChange,
2752
+ "onUpdate:pageSize": d.handlePageSizeChange
2402
2753
  }, null, 8, ["page", "page-size", "total", "type", "onUpdate:page", "onUpdate:pageSize"])
2403
2754
  ]),
2404
- o.value.showDetail ? (f(), E(da, {
2755
+ s.value.showDetail ? (f(), k(ba, {
2405
2756
  key: 0,
2406
- visible: o.value.detailVisible,
2407
- loading: o.value.detailLoading,
2408
- position: (h = (w = o.value.tableConfig) == null ? void 0 : w.detail) == null ? void 0 : h.position,
2409
- title: (b = (k = o.value.tableConfig) == null ? void 0 : k.meta) == null ? void 0 : b.title,
2410
- "row-data": o.value.detailData,
2411
- columns: o.value.columns,
2412
- onClose: c.handleDetailClose
2413
- }, null, 8, ["visible", "loading", "position", "title", "row-data", "columns", "onClose"])) : T("", !0)
2757
+ visible: s.value.detailVisible,
2758
+ loading: s.value.detailLoading,
2759
+ position: (p = (b = s.value.tableConfig) == null ? void 0 : b.detail) == null ? void 0 : p.position,
2760
+ title: (v = (C = s.value.tableConfig) == null ? void 0 : C.meta) == null ? void 0 : v.title,
2761
+ "row-data": s.value.detailData,
2762
+ columns: s.value.columns,
2763
+ onClose: d.handleDetailClose
2764
+ }, null, 8, ["visible", "loading", "position", "title", "row-data", "columns", "onClose"])) : D("", !0)
2414
2765
  ]),
2415
- o.value.toolbar.length > 0 || (re = o.value.tableConfig) != null && re.form ? (f(), E(Rt, {
2766
+ s.value.toolbar.length > 0 || (W = s.value.tableConfig) != null && W.form ? (f(), k(qt, {
2416
2767
  key: 1,
2417
2768
  class: "table-toolbar-bottom",
2418
- toolbar: o.value.toolbar,
2419
- actions: o.value.actions,
2420
- "form-id": (de = o.value.tableConfig) == null ? void 0 : de.form,
2421
- "api-delete": (ce = o.value.tableConfig) == null ? void 0 : ce.api.delete,
2422
- "selected-count": o.value.selectedRows.length,
2423
- onCreate: c.handleCreate,
2424
- onImport: c.handleImport,
2425
- onExport: c.handleExport,
2426
- onBatchEdit: c.handleBatchEdit,
2427
- onBatchDelete: c.handleBatchDelete
2428
- }, null, 8, ["toolbar", "actions", "form-id", "api-delete", "selected-count", "onCreate", "onImport", "onExport", "onBatchEdit", "onBatchDelete"])) : T("", !0),
2429
- x(_e, {
2769
+ toolbar: s.value.toolbar,
2770
+ actions: s.value.actions,
2771
+ "form-id": (ce = s.value.tableConfig) == null ? void 0 : ce.form,
2772
+ "api-delete": (ue = s.value.tableConfig) == null ? void 0 : ue.api.delete,
2773
+ "selected-count": s.value.selectedRows.length,
2774
+ onCreate: d.handleCreate,
2775
+ onImport: d.handleImport,
2776
+ onExport: d.handleExport,
2777
+ onBatchEdit: d.handleBatchEdit,
2778
+ onBatchDelete: d.handleBatchDelete
2779
+ }, null, 8, ["toolbar", "actions", "form-id", "api-delete", "selected-count", "onCreate", "onImport", "onExport", "onBatchEdit", "onBatchDelete"])) : D("", !0),
2780
+ S(ke, {
2430
2781
  ref_key: "formRef",
2431
- ref: s
2782
+ ref: c
2432
2783
  }, null, 512)
2433
2784
  ]);
2434
2785
  };
2435
2786
  }
2436
- }), pa = /* @__PURE__ */ D(ma, [["__scopeId", "data-v-91132dca"]]);
2437
- class ha {
2787
+ }), _a = /* @__PURE__ */ P(Ca, [["__scopeId", "data-v-91132dca"]]);
2788
+ class Sa {
2438
2789
  constructor(t) {
2439
- v(this, "axiosInstance");
2440
- v(this, "baseUrl", "");
2441
- this.axiosInstance = ye.create({
2790
+ _(this, "axiosInstance");
2791
+ _(this, "baseUrl", "");
2792
+ this.axiosInstance = we.create({
2442
2793
  timeout: 1e4,
2443
2794
  baseURL: ""
2444
2795
  }), this.axiosInstance.defaults.headers["Content-Type"] = "application/json;charset=utf-8", this.axiosInstance.interceptors.request.use(
@@ -2483,11 +2834,11 @@ class ha {
2483
2834
  });
2484
2835
  }
2485
2836
  }
2486
- class ga {
2837
+ class ka {
2487
2838
  //事件总线
2488
2839
  constructor() {
2489
- v(this, "emitter");
2490
- this.emitter = We();
2840
+ _(this, "emitter");
2841
+ this.emitter = je();
2491
2842
  }
2492
2843
  On(t, e) {
2493
2844
  this.emitter.on(t, e);
@@ -2499,10 +2850,10 @@ class ga {
2499
2850
  this.emitter.off(t, e);
2500
2851
  }
2501
2852
  }
2502
- class ya {
2853
+ class Da {
2503
2854
  constructor(t, e) {
2504
- v(this, "mqttClient", null);
2505
- v(this, "eventBus");
2855
+ _(this, "mqttClient", null);
2856
+ _(this, "eventBus");
2506
2857
  this.eventBus = t, this.connect(e).then();
2507
2858
  }
2508
2859
  async connect(t) {
@@ -2515,72 +2866,72 @@ class ya {
2515
2866
  connectTimeout: 5e3,
2516
2867
  reconnectPeriod: 5e3
2517
2868
  };
2518
- let l = t.mqttUrl || "ws://127.0.0.1:5002/ws";
2519
- if (console.log("connect to mqtt..."), this.mqttClient = ze.connect(l, e), !this.mqttClient) {
2869
+ let o = t.mqttUrl || "ws://127.0.0.1:5002/ws";
2870
+ if (console.log("connect to mqtt..."), this.mqttClient = Oe.connect(o, e), !this.mqttClient) {
2520
2871
  console.log("connect mqtt failed");
2521
2872
  return;
2522
2873
  }
2523
2874
  this.mqttClient.on("connect", () => {
2524
- console.log("=====> mqtt connect success!"), this.mqttClient.subscribe(ae, { qos: 0 }, (s) => {
2525
- console.log(s ? `mqtt subscribe [${ae}] failed` : `mqtt subscribe [${ae}] success`);
2875
+ console.log("=====> mqtt connect success!"), this.mqttClient.subscribe(le, { qos: 0 }, (c) => {
2876
+ console.log(c ? `mqtt subscribe [${le}] failed` : `mqtt subscribe [${le}] success`);
2526
2877
  });
2527
- }), this.mqttClient.on("message", (s, d) => {
2528
- const o = d.toString();
2529
- if (!o) {
2530
- console.error("Received empty message", s);
2878
+ }), this.mqttClient.on("message", (c, r) => {
2879
+ const s = r.toString();
2880
+ if (!s) {
2881
+ console.error("Received empty message", c);
2531
2882
  return;
2532
2883
  }
2533
- let c = null;
2884
+ let d = null;
2534
2885
  try {
2535
- c = JSON.parse(o);
2536
- } catch (n) {
2537
- console.error("Failed to parse message JSON", s, o, n);
2886
+ d = JSON.parse(s);
2887
+ } catch (a) {
2888
+ console.error("Failed to parse message JSON", c, s, a);
2538
2889
  return;
2539
2890
  }
2540
- if (!c || c.Content === void 0 || c.Content === null || !c.PType) {
2541
- console.log("parse notice failed!", o);
2891
+ if (!d || d.Content === void 0 || d.Content === null || !d.PType) {
2892
+ console.log("parse notice failed!", s);
2542
2893
  return;
2543
2894
  }
2544
- c.PType == ba && this.eventBus.Emit(c.Route, c.Content);
2545
- }), this.mqttClient.on(H.OffLine, () => {
2895
+ d.PType == Ta && this.eventBus.Emit(d.Route, d.Content);
2896
+ }), this.mqttClient.on(Z.OffLine, () => {
2546
2897
  console.log("mqtt offline...");
2547
- }), this.mqttClient.on(H.Reconnect, () => {
2898
+ }), this.mqttClient.on(Z.Reconnect, () => {
2548
2899
  console.log("mqtt reconnecting...");
2549
- }), this.mqttClient.on(H.Close, () => {
2900
+ }), this.mqttClient.on(Z.Close, () => {
2550
2901
  console.log("mqtt close");
2551
- }), this.mqttClient.on(H.Error, (s) => {
2902
+ }), this.mqttClient.on(Z.Error, (c) => {
2552
2903
  console.log("mqtt error");
2553
2904
  });
2554
2905
  }
2555
2906
  // 生成随机字符串
2556
2907
  randomStr(t) {
2557
2908
  const e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
2558
- let l = "";
2559
- for (let s = 0; s < t; s++)
2560
- l += e.charAt(Math.floor(Math.random() * e.length));
2561
- return l;
2909
+ let o = "";
2910
+ for (let c = 0; c < t; c++)
2911
+ o += e.charAt(Math.floor(Math.random() * e.length));
2912
+ return o;
2562
2913
  }
2563
2914
  }
2564
- const ae = "Notice", ba = "NOTICE", H = {
2915
+ const le = "Notice", Ta = "NOTICE", Z = {
2565
2916
  OffLine: "offline",
2566
2917
  Close: "close",
2567
2918
  Reconnect: "reconnect",
2568
2919
  Error: "error"
2569
2920
  };
2570
- let J;
2571
- const Qa = (a) => {
2572
- if (!a)
2921
+ let ee;
2922
+ const no = (l) => {
2923
+ if (!l)
2573
2924
  throw new Error("QfOptions is undefined");
2574
- if (!J && a && (J = new va(a)), !J)
2925
+ if (!ee && l && (ee = new Va(l)), !ee)
2575
2926
  throw new Error("Qf not initialized, please call GetQf(options) first");
2576
- return J;
2927
+ return ee;
2577
2928
  };
2578
- class va {
2929
+ class Va {
2579
2930
  constructor(t) {
2580
- v(this, "EventBus");
2581
- v(this, "WebApi");
2582
- v(this, "Mqtt");
2583
- v(this, "options");
2931
+ _(this, "EventBus");
2932
+ _(this, "WebApi");
2933
+ _(this, "Mqtt");
2934
+ _(this, "options");
2584
2935
  this.initQf(t);
2585
2936
  }
2586
2937
  /**
@@ -2589,7 +2940,7 @@ class va {
2589
2940
  initQf(t) {
2590
2941
  if (!t)
2591
2942
  throw new Error(`StartQf failed! options is ${t}`);
2592
- this.options = t, console.log("StartQf(), qfOptions=", t), this.EventBus = new ga(), this.WebApi = new ha(t), this.options.useMqtt && (this.Mqtt = new ya(this.EventBus, t));
2943
+ this.options = t, console.log("StartQf(), qfOptions=", t), this.EventBus = new ka(), this.WebApi = new Sa(t), this.options.useMqtt && (this.Mqtt = new Da(this.EventBus, t));
2593
2944
  }
2594
2945
  // ==================== EventBus 相关 ====================
2595
2946
  On(t, e) {
@@ -2622,35 +2973,37 @@ class va {
2622
2973
  this.EventBus.On(t, e);
2623
2974
  }
2624
2975
  }
2625
- const wa = {
2626
- UInput: Y,
2627
- UInputNumber: be,
2628
- UDict: j,
2629
- UToggle: Ce,
2630
- UCascader: xe,
2631
- UDate: te,
2632
- FormRender: _e,
2633
- TableRender: pa,
2634
- UFieldView: se
2635
- }, Ga = {
2636
- install(a) {
2637
- a.use(Te);
2638
- for (const [t, e] of Object.entries(wa))
2639
- a.component(t, e);
2976
+ const Pa = {
2977
+ UInput: K,
2978
+ UInputNumber: xe,
2979
+ UDict: G,
2980
+ UToggle: _e,
2981
+ UCascader: Se,
2982
+ UDate: oe,
2983
+ UMenu: mt,
2984
+ FormRender: ke,
2985
+ TableRender: _a,
2986
+ UFieldView: de
2987
+ }, io = {
2988
+ install(l) {
2989
+ l.use(Pe);
2990
+ for (const [t, e] of Object.entries(Pa))
2991
+ l.component(t, e);
2640
2992
  }
2641
2993
  };
2642
2994
  export {
2643
- _e as FormRender,
2644
- Qa as GetQf,
2645
- pa as TableRender,
2646
- xe as UCascader,
2647
- te as UDate,
2648
- j as UDict,
2649
- se as UFieldView,
2650
- Y as UInput,
2651
- be as UInputNumber,
2652
- Ce as UToggle,
2653
- Ga as default,
2654
- W as notify,
2655
- G as notifyUtil
2995
+ ke as FormRender,
2996
+ no as GetQf,
2997
+ _a as TableRender,
2998
+ Se as UCascader,
2999
+ oe as UDate,
3000
+ G as UDict,
3001
+ de as UFieldView,
3002
+ K as UInput,
3003
+ xe as UInputNumber,
3004
+ mt as UMenu,
3005
+ _e as UToggle,
3006
+ io as default,
3007
+ j as notify,
3008
+ J as notifyUtil
2656
3009
  };