urit-qf-ui 0.2.5 → 0.2.6

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,16 +1,16 @@
1
- var Me = Object.defineProperty;
2
- var Ee = (o, t, e) => t in o ? Me(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
3
- var x = (o, t, e) => Ee(o, typeof t != "symbol" ? t + "" : t, e);
4
- import Ue, { ElMessage as Te, ElMessageBox as De } from "element-plus";
1
+ var Ue = Object.defineProperty;
2
+ var Be = (o, t, e) => t in o ? Ue(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
3
+ var C = (o, t, e) => Be(o, typeof t != "symbol" ? t + "" : t, e);
4
+ import Fe, { ElMessage as Pe, ElMessageBox as Te } from "element-plus";
5
5
  import "element-plus/dist/index.css";
6
- import { ElInput as Be, ElInputNumber as Fe, ElSelect as pe, ElOption as he, ElSwitch as Le, ElDatePicker as ze, ElMenu as Ne, ElSubMenu as We, ElMenuItem as qe, ElIcon as ge, ElButton as J, ElDialog as je, ElForm as Oe, ElTable as Ye, ElTableColumn as Qe, ElPagination as Ke, ElDrawer as He } from "element-plus/es";
6
+ import { ElInput as Le, ElInputNumber as Ne, ElSelect as he, ElOption as ge, ElSwitch as We, ElDatePicker as ze, ElMenu as qe, ElSubMenu as Oe, ElMenuItem as je, ElIcon as ye, ElButton as J, ElDialog as Ye, ElForm as Qe, ElTable as Ke, ElTableColumn as He, ElPagination as Ge, ElDrawer as Je } 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 P, computed as v, openBlock as h, createElementBlock as y, normalizeClass as V, normalizeStyle as B, createTextVNode as F, toDisplayString as k, createElementVNode as C, createCommentVNode as D, createVNode as _, reactive as W, watch as L, withCtx as w, Fragment as I, renderList as E, createBlock as S, mergeProps as ce, ref as Q, markRaw as re, onMounted as oe, renderSlot as T, resolveDynamicComponent as H, toRefs as Ge, unref as N, useSlots as ye, createSlots as X, withModifiers as Je, normalizeProps as q, guardReactiveProps as j, useAttrs as Xe } from "vue";
9
+ import { defineComponent as P, computed as v, openBlock as g, createElementBlock as b, normalizeClass as V, normalizeStyle as B, createTextVNode as F, toDisplayString as T, createElementVNode as x, createCommentVNode as D, createVNode as _, reactive as z, watch as L, withCtx as w, Fragment as I, renderList as M, createBlock as S, mergeProps as ce, ref as Q, markRaw as re, onMounted as oe, renderSlot as k, resolveDynamicComponent as G, toRefs as Xe, unref as W, useSlots as be, createSlots as X, withModifiers as Ze, normalizeProps as q, guardReactiveProps as O, useAttrs as et } 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 Ve from "axios";
13
+ import $e 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";
@@ -20,14 +20,14 @@ import "element-plus/es/components/menu-item/style/css";
20
20
  import "element-plus/es/components/icon/style/css";
21
21
  import "element-plus/es/components/form/style/css";
22
22
  import "element-plus/es/components/dialog/style/css";
23
- import { Loading as ke } from "@element-plus/icons-vue";
23
+ import { Loading as Ve } from "@element-plus/icons-vue";
24
24
  import "element-plus/es/components/drawer/style/css";
25
25
  import "element-plus/es/components/table/style/css";
26
26
  import "element-plus/es/components/table-column/style/css";
27
27
  import "element-plus/es/components/pagination/style/css";
28
- import Ze from "mitt";
29
- import et from "mqtt";
30
- const tt = /* @__PURE__ */ P({
28
+ import tt from "mitt";
29
+ import at from "mqtt";
30
+ const ot = /* @__PURE__ */ P({
31
31
  __name: "UInput",
32
32
  props: {
33
33
  fieldLabel: {},
@@ -55,43 +55,43 @@ const tt = /* @__PURE__ */ P({
55
55
  },
56
56
  emits: ["update:modelValue"],
57
57
  setup(o, { emit: t }) {
58
- const e = o, l = t, d = v(() => {
59
- const s = {};
60
- return e.labelPosition === "left" && e.labelWidth && (s.width = typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth), e.labelAlign && (s.textAlign = e.labelAlign), s;
61
- }), r = v(() => ({
58
+ const e = o, i = t, r = v(() => {
59
+ const c = {};
60
+ return e.labelPosition === "left" && e.labelWidth && (c.width = typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth), e.labelAlign && (c.textAlign = e.labelAlign), c;
61
+ }), d = v(() => ({
62
62
  "u-input-label-left": e.labelPosition === "left",
63
63
  "u-input-label-top": e.labelPosition === "top"
64
- })), c = {
65
- onInput(s) {
66
- l("update:modelValue", s);
64
+ })), s = {
65
+ onInput(c) {
66
+ i("update:modelValue", c);
67
67
  }
68
68
  };
69
- return (s, a) => {
70
- const i = Be;
71
- return h(), y("div", {
72
- class: V(["u-input", r.value])
69
+ return (c, a) => {
70
+ const l = Le;
71
+ return g(), b("div", {
72
+ class: V(["u-input", d.value])
73
73
  }, [
74
- o.fieldLabel ? (h(), y("div", {
74
+ o.fieldLabel ? (g(), b("div", {
75
75
  key: 0,
76
76
  class: "u-input-label",
77
- style: B(d.value)
77
+ style: B(r.value)
78
78
  }, [
79
- F(k(o.fieldLabel) + " ", 1),
80
- C("span", {
79
+ F(T(o.fieldLabel) + " ", 1),
80
+ x("span", {
81
81
  class: V(["required-star", { "required-star--visible": o.required }])
82
82
  }, "*", 2)
83
83
  ], 4)) : D("", !0),
84
- C("div", {
84
+ x("div", {
85
85
  class: V(["u-input-field", { "u-input-field--top": o.labelPosition === "top" }])
86
86
  }, [
87
- _(i, {
87
+ _(l, {
88
88
  "model-value": o.modelValue,
89
89
  placeholder: o.placeholder,
90
90
  type: o.type,
91
91
  disabled: o.disable,
92
92
  readonly: o.readonly,
93
93
  maxlength: o.maxlength,
94
- "onUpdate:modelValue": c.onInput
94
+ "onUpdate:modelValue": s.onInput
95
95
  }, null, 8, ["model-value", "placeholder", "type", "disabled", "readonly", "maxlength", "onUpdate:modelValue"])
96
96
  ], 2)
97
97
  ], 2);
@@ -99,10 +99,10 @@ const tt = /* @__PURE__ */ P({
99
99
  }
100
100
  }), $ = (o, t) => {
101
101
  const e = o.__vccOpts || o;
102
- for (const [l, d] of t)
103
- e[l] = d;
102
+ for (const [i, r] of t)
103
+ e[i] = r;
104
104
  return e;
105
- }, te = /* @__PURE__ */ $(tt, [["__scopeId", "data-v-ecf5177c"]]), at = { class: "u-input-number-field" }, ot = /* @__PURE__ */ P({
105
+ }, te = /* @__PURE__ */ $(ot, [["__scopeId", "data-v-ecf5177c"]]), lt = { class: "u-input-number-field" }, nt = /* @__PURE__ */ P({
106
106
  __name: "UInputNumber",
107
107
  props: {
108
108
  fieldLabel: {},
@@ -130,34 +130,34 @@ const tt = /* @__PURE__ */ P({
130
130
  },
131
131
  emits: ["update:modelValue"],
132
132
  setup(o, { emit: t }) {
133
- const e = o, l = t, d = v(() => {
134
- const s = {};
135
- return e.labelPosition === "left" && e.labelWidth && (s.width = typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth), e.labelAlign && (s.textAlign = e.labelAlign), s;
136
- }), r = v(() => ({
133
+ const e = o, i = t, r = v(() => {
134
+ const c = {};
135
+ return e.labelPosition === "left" && e.labelWidth && (c.width = typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth), e.labelAlign && (c.textAlign = e.labelAlign), c;
136
+ }), d = v(() => ({
137
137
  "u-input-number-label-left": e.labelPosition === "left",
138
138
  "u-input-number-label-top": e.labelPosition === "top"
139
- })), c = {
140
- onUpdate(s) {
141
- l("update:modelValue", s === void 0 ? 0 : s);
139
+ })), s = {
140
+ onUpdate(c) {
141
+ i("update:modelValue", c === void 0 ? 0 : c);
142
142
  }
143
143
  };
144
- return (s, a) => {
145
- const i = Fe;
146
- return h(), y("div", {
147
- class: V(["u-input-number", r.value])
144
+ return (c, a) => {
145
+ const l = Ne;
146
+ return g(), b("div", {
147
+ class: V(["u-input-number", d.value])
148
148
  }, [
149
- o.fieldLabel ? (h(), y("div", {
149
+ o.fieldLabel ? (g(), b("div", {
150
150
  key: 0,
151
151
  class: "u-input-number-label",
152
- style: B(d.value)
152
+ style: B(r.value)
153
153
  }, [
154
- F(k(o.fieldLabel) + " ", 1),
155
- C("span", {
154
+ F(T(o.fieldLabel) + " ", 1),
155
+ x("span", {
156
156
  class: V(["required-star", { "required-star--visible": o.required }])
157
157
  }, "*", 2)
158
158
  ], 4)) : D("", !0),
159
- C("div", at, [
160
- _(i, {
159
+ x("div", lt, [
160
+ _(l, {
161
161
  "model-value": o.modelValue,
162
162
  placeholder: o.placeholder || "请输入数值",
163
163
  disabled: o.disable,
@@ -168,13 +168,13 @@ const tt = /* @__PURE__ */ P({
168
168
  controls: !0,
169
169
  "controls-position": "right",
170
170
  style: { width: "100%" },
171
- onChange: c.onUpdate
171
+ onChange: s.onUpdate
172
172
  }, null, 8, ["model-value", "placeholder", "disabled", "min", "max", "step", "precision", "onChange"])
173
173
  ])
174
174
  ], 2);
175
175
  };
176
176
  }
177
- }), Pe = /* @__PURE__ */ $(ot, [["__scopeId", "data-v-cb70bd5b"]]), Z = Ve.create({
177
+ }), Ae = /* @__PURE__ */ $(nt, [["__scopeId", "data-v-cb70bd5b"]]), Z = $e.create({
178
178
  timeout: 3e4,
179
179
  headers: {
180
180
  "Content-Type": "application/json"
@@ -192,8 +192,8 @@ Z.interceptors.response.use(
192
192
  const t = o.data;
193
193
  if (t && typeof t == "object" && !Array.isArray(t)) {
194
194
  if (t.status === void 0 && t.code !== void 0) {
195
- const e = t.code, l = e === 0 || e === 200 || Number(e) === 0 || Number(e) === 200;
196
- t.status = l ? 200 : Number(e);
195
+ const e = t.code, i = e === 0 || e === 200 || Number(e) === 0 || Number(e) === 200;
196
+ t.status = i ? 200 : Number(e);
197
197
  }
198
198
  if (t.status !== void 0 && t.status !== 200) {
199
199
  const e = t.message || "请求失败";
@@ -203,17 +203,17 @@ Z.interceptors.response.use(
203
203
  return o;
204
204
  },
205
205
  (o) => {
206
- var e, l;
207
- const t = ((l = (e = o.response) == null ? void 0 : e.data) == null ? void 0 : l.message) || o.message || "请求失败";
206
+ var e, i;
207
+ const t = ((i = (e = o.response) == null ? void 0 : e.data) == null ? void 0 : i.message) || o.message || "请求失败";
208
208
  return console.error("[HTTP Error]", t), Promise.reject(o);
209
209
  }
210
210
  );
211
- const M = {
211
+ const E = {
212
212
  get(o, t) {
213
213
  return Z.get(o, t).then((e) => e.data);
214
214
  },
215
215
  post(o, t, e) {
216
- return Z.post(o, t, e).then((l) => l.data);
216
+ return Z.post(o, t, e).then((i) => i.data);
217
217
  },
218
218
  // 原始 axios 实例,用于特殊需求
219
219
  instance: Z
@@ -242,8 +242,8 @@ const M = {
242
242
  cascaderApi(o, t = !0) {
243
243
  return `/api/dict/tree-list?dict_type=${o}&children=${t}`;
244
244
  }
245
- }, O = {}, ne = {};
246
- function be(o) {
245
+ }, j = {}, ne = {};
246
+ function ve(o) {
247
247
  const { children: t, ...e } = o;
248
248
  return {
249
249
  label: o.label ?? o.dict_value ?? String(o.value ?? ""),
@@ -251,23 +251,23 @@ function be(o) {
251
251
  ...e
252
252
  };
253
253
  }
254
- function ve(o) {
254
+ function we(o) {
255
255
  return Array.isArray(o) ? o.map((t) => {
256
256
  if (!t || typeof t != "object") return t;
257
- const e = be(t), l = t.children;
258
- return Array.isArray(l) && l.length > 0 && (e.children = ve(l)), e;
257
+ const e = ve(t), i = t.children;
258
+ return Array.isArray(i) && i.length > 0 && (e.children = we(i)), e;
259
259
  }) : [];
260
260
  }
261
- function we(o) {
262
- return Array.isArray(o) ? o.filter((t) => t && typeof t == "object").map((t) => be(t)) : [];
261
+ function Ce(o) {
262
+ return Array.isArray(o) ? o.filter((t) => t && typeof t == "object").map((t) => ve(t)) : [];
263
263
  }
264
- function po(o) {
264
+ function yo(o) {
265
265
  if (!Array.isArray(o)) return [];
266
- const t = [], e = (l) => {
267
- for (const d of l) {
268
- if (!d || typeof d != "object") continue;
269
- const r = d.children;
270
- t.push(be(d)), Array.isArray(r) && r.length > 0 && e(r);
266
+ const t = [], e = (i) => {
267
+ for (const r of i) {
268
+ if (!r || typeof r != "object") continue;
269
+ const d = r.children;
270
+ t.push(ve(r)), Array.isArray(d) && d.length > 0 && e(d);
271
271
  }
272
272
  };
273
273
  return e(o), t;
@@ -275,16 +275,16 @@ function po(o) {
275
275
  async function ae(o) {
276
276
  if (!o)
277
277
  return [];
278
- if (O[o])
279
- return O[o];
278
+ if (j[o])
279
+ return j[o];
280
280
  if (o in ne)
281
281
  return await ne[o];
282
282
  const t = (async () => {
283
283
  try {
284
- const e = await M.get(K.dictApi(o));
284
+ const e = await E.get(K.dictApi(o));
285
285
  if (e.status === 200) {
286
- const l = we(e.data);
287
- return O[o] = l, l;
286
+ const i = Ce(e.data);
287
+ return j[o] = i, i;
288
288
  }
289
289
  return [];
290
290
  } catch (e) {
@@ -295,39 +295,39 @@ async function ae(o) {
295
295
  })();
296
296
  return ne[o] = t, t;
297
297
  }
298
- async function lt(o, t, e = "") {
298
+ async function it(o, t, e = "") {
299
299
  if (t == null || t === "")
300
300
  return e;
301
- const l = O[o];
302
- if (l && l.length > 0)
303
- return me(l, t);
304
- const d = await ae(o);
305
- return d && d.length > 0 ? me(d, t) : e || String(t);
301
+ const i = j[o];
302
+ if (i && i.length > 0)
303
+ return pe(i, t);
304
+ const r = await ae(o);
305
+ return r && r.length > 0 ? pe(r, t) : e || String(t);
306
306
  }
307
- function me(o, t) {
307
+ function pe(o, t) {
308
308
  const e = o.find(
309
- (l) => l.value === t || String(l.value) === String(t)
309
+ (i) => i.value === t || String(i.value) === String(t)
310
310
  );
311
311
  return e ? e.label : String(t);
312
312
  }
313
- function ho(o, t, e = "") {
313
+ function bo(o, t, e = "") {
314
314
  if (t == null || t === "")
315
315
  return e;
316
- const l = O[o];
317
- return l && l.length > 0 ? me(l, t) : e || String(t);
316
+ const i = j[o];
317
+ return i && i.length > 0 ? pe(i, t) : e || String(t);
318
318
  }
319
- async function go(o) {
319
+ async function vo(o) {
320
320
  await Promise.all(o.map((t) => ae(t)));
321
321
  }
322
- function yo(o) {
323
- o ? delete O[o] : Object.keys(O).forEach((t) => {
324
- delete O[t];
322
+ function wo(o) {
323
+ o ? delete j[o] : Object.keys(j).forEach((t) => {
324
+ delete j[t];
325
325
  });
326
326
  }
327
- function bo(o, t) {
328
- O[o] = t;
327
+ function Co(o, t) {
328
+ j[o] = t;
329
329
  }
330
- const nt = { class: "u-dict-field" }, it = /* @__PURE__ */ P({
330
+ const st = { class: "u-dict-field" }, rt = /* @__PURE__ */ P({
331
331
  __name: "UDict",
332
332
  props: {
333
333
  fieldLabel: {},
@@ -352,66 +352,66 @@ const nt = { class: "u-dict-field" }, it = /* @__PURE__ */ P({
352
352
  },
353
353
  emits: ["update:modelValue"],
354
354
  setup(o, { emit: t }) {
355
- const e = o, l = t, d = W({
355
+ const e = o, i = t, r = z({
356
356
  excluded: ["fieldLabel", "labelPosition", "labelWidth", "labelAlign", "required", "modelValue", "dictType"],
357
357
  options: [],
358
358
  loading: !1
359
- }), r = async () => {
359
+ }), d = async () => {
360
360
  if (e.dictType) {
361
- d.loading = !0;
361
+ r.loading = !0;
362
362
  try {
363
- const i = await M.get(K.dictApi(e.dictType));
364
- i.status === 200 ? d.options = we(i.data) : (console.error("[UDict] 请求失败:", i.message), d.options = []);
365
- } catch (i) {
366
- console.error("[UDict] 加载字典失败:", i), d.options = [];
363
+ const l = await E.get(K.dictApi(e.dictType));
364
+ l.status === 200 ? r.options = Ce(l.data) : (console.error("[UDict] 请求失败:", l.message), r.options = []);
365
+ } catch (l) {
366
+ console.error("[UDict] 加载字典失败:", l), r.options = [];
367
367
  } finally {
368
- d.loading = !1;
368
+ r.loading = !1;
369
369
  }
370
370
  }
371
371
  };
372
372
  L(() => e.dictType, () => {
373
- r();
373
+ d();
374
374
  }, { immediate: !0 });
375
- const c = v(() => {
376
- const i = {};
377
- return e.labelPosition === "left" && e.labelWidth && (i.width = typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth), e.labelAlign && (i.textAlign = e.labelAlign), i;
378
- }), s = v(() => ({
375
+ const s = v(() => {
376
+ const l = {};
377
+ return e.labelPosition === "left" && e.labelWidth && (l.width = typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth), e.labelAlign && (l.textAlign = e.labelAlign), l;
378
+ }), c = v(() => ({
379
379
  "u-dict-label-left": e.labelPosition === "left",
380
380
  "u-dict-label-top": e.labelPosition === "top"
381
381
  })), a = {
382
- onUpdate(i) {
383
- l("update:modelValue", i);
382
+ onUpdate(l) {
383
+ i("update:modelValue", l);
384
384
  }
385
385
  };
386
- return (i, n) => {
387
- const f = he, m = pe;
388
- return h(), y("div", {
389
- class: V(["u-dict", s.value])
386
+ return (l, n) => {
387
+ const u = ge, m = he;
388
+ return g(), b("div", {
389
+ class: V(["u-dict", c.value])
390
390
  }, [
391
- o.fieldLabel ? (h(), y("div", {
391
+ o.fieldLabel ? (g(), b("div", {
392
392
  key: 0,
393
393
  class: "u-dict-label",
394
- style: B(c.value)
394
+ style: B(s.value)
395
395
  }, [
396
- F(k(o.fieldLabel) + " ", 1),
397
- C("span", {
396
+ F(T(o.fieldLabel) + " ", 1),
397
+ x("span", {
398
398
  class: V(["required-star", { "required-star--visible": o.required }])
399
399
  }, "*", 2)
400
400
  ], 4)) : D("", !0),
401
- C("div", nt, [
401
+ x("div", st, [
402
402
  _(m, {
403
403
  "model-value": o.modelValue,
404
404
  placeholder: o.placeholder || "请选择",
405
- loading: d.loading,
405
+ loading: r.loading,
406
406
  disabled: o.disable,
407
407
  style: { width: "100%" },
408
408
  onChange: a.onUpdate
409
409
  }, {
410
410
  default: w(() => [
411
- (h(!0), y(I, null, E(d.options, (u) => (h(), S(f, {
412
- key: u.value,
413
- label: u.label,
414
- value: u.value
411
+ (g(!0), b(I, null, M(r.options, (f) => (g(), S(u, {
412
+ key: f.value,
413
+ label: f.label,
414
+ value: f.value
415
415
  }, null, 8, ["label", "value"]))), 128))
416
416
  ]),
417
417
  _: 1
@@ -420,7 +420,7 @@ const nt = { class: "u-dict-field" }, it = /* @__PURE__ */ P({
420
420
  ], 2);
421
421
  };
422
422
  }
423
- }), ee = /* @__PURE__ */ $(it, [["__scopeId", "data-v-8bfd4dcf"]]), st = { class: "u-toggle-field" }, rt = /* @__PURE__ */ P({
423
+ }), ee = /* @__PURE__ */ $(rt, [["__scopeId", "data-v-8bfd4dcf"]]), dt = { class: "u-toggle-field" }, ct = /* @__PURE__ */ P({
424
424
  __name: "UToggle",
425
425
  props: {
426
426
  fieldLabel: {},
@@ -444,42 +444,42 @@ const nt = { class: "u-dict-field" }, it = /* @__PURE__ */ P({
444
444
  },
445
445
  emits: ["update:modelValue"],
446
446
  setup(o, { emit: t }) {
447
- const e = o, l = t, d = W({
447
+ const e = o, i = t, r = z({
448
448
  excluded: ["fieldLabel", "labelPosition", "labelWidth", "labelAlign", "required", "modelValue", "trueValue", "falseValue", "activeText", "inactiveText", "activeColor", "inactiveColor"]
449
- }), r = () => {
449
+ }), d = () => {
450
450
  const a = {};
451
451
  return e.labelPosition === "left" && e.labelWidth && (a.width = typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth), e.labelAlign && (a.textAlign = e.labelAlign), a;
452
- }, c = v({
452
+ }, s = v({
453
453
  get: () => e.modelValue === e.trueValue,
454
454
  set: (a) => {
455
- l("update:modelValue", a ? e.trueValue : e.falseValue);
455
+ i("update:modelValue", a ? e.trueValue : e.falseValue);
456
456
  }
457
- }), s = v(() => {
457
+ }), c = v(() => {
458
458
  const a = {};
459
- for (const i in e)
460
- !d.excluded.includes(i) && i !== "modelValue" && (a[i] = e[i]);
459
+ for (const l in e)
460
+ !r.excluded.includes(l) && l !== "modelValue" && (a[l] = e[l]);
461
461
  return a;
462
462
  });
463
- return (a, i) => {
464
- const n = Le;
465
- return h(), y("div", {
463
+ return (a, l) => {
464
+ const n = We;
465
+ return g(), b("div", {
466
466
  class: V(["u-toggle", { "u-toggle-label-left": o.labelPosition === "left" }])
467
467
  }, [
468
- o.fieldLabel ? (h(), y("div", {
468
+ o.fieldLabel ? (g(), b("div", {
469
469
  key: 0,
470
470
  class: "u-toggle-label",
471
- style: B(r())
471
+ style: B(d())
472
472
  }, [
473
- F(k(o.fieldLabel) + " ", 1),
474
- C("span", {
473
+ F(T(o.fieldLabel) + " ", 1),
474
+ x("span", {
475
475
  class: V(["required-star", { "required-star--visible": o.required }])
476
476
  }, "*", 2)
477
477
  ], 4)) : D("", !0),
478
- C("div", st, [
478
+ x("div", dt, [
479
479
  _(n, ce({
480
- modelValue: c.value,
481
- "onUpdate:modelValue": i[0] || (i[0] = (f) => c.value = f)
482
- }, s.value, {
480
+ modelValue: s.value,
481
+ "onUpdate:modelValue": l[0] || (l[0] = (u) => s.value = u)
482
+ }, c.value, {
483
483
  "active-text": o.activeText,
484
484
  "inactive-text": o.inactiveText,
485
485
  "active-color": o.activeColor,
@@ -489,7 +489,7 @@ const nt = { class: "u-dict-field" }, it = /* @__PURE__ */ P({
489
489
  ], 2);
490
490
  };
491
491
  }
492
- }), $e = /* @__PURE__ */ $(rt, [["__scopeId", "data-v-94c1fd38"]]), dt = { class: "u-cascader-levels" }, ct = /* @__PURE__ */ P({
492
+ }), Re = /* @__PURE__ */ $(ct, [["__scopeId", "data-v-94c1fd38"]]), ut = { class: "u-cascader-levels" }, ft = /* @__PURE__ */ P({
493
493
  __name: "UCascader",
494
494
  props: {
495
495
  fieldLabel: {},
@@ -503,63 +503,63 @@ const nt = { class: "u-dict-field" }, it = /* @__PURE__ */ P({
503
503
  },
504
504
  emits: ["update:modelValue"],
505
505
  setup(o, { emit: t }) {
506
- const e = o, l = t, d = () => {
506
+ const e = o, i = t, r = () => {
507
507
  const a = {};
508
508
  return e.labelPosition === "left" && e.labelWidth && (a.width = typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth), e.labelAlign && (a.textAlign = e.labelAlign), a;
509
- }, r = Q([]), c = v(() => {
509
+ }, d = Q([]), s = v(() => {
510
510
  const a = [];
511
- let i = e.options || [];
511
+ let l = e.options || [];
512
512
  for (let n = 0; n < e.depth; n++)
513
- if (a.push(i), r.value[n] !== void 0) {
514
- const f = i.find((m) => m.value === r.value[n]);
515
- f && f.children ? i = f.children : i = [];
513
+ if (a.push(l), d.value[n] !== void 0) {
514
+ const u = l.find((m) => m.value === d.value[n]);
515
+ u && u.children ? l = u.children : l = [];
516
516
  } else
517
- i = [];
517
+ l = [];
518
518
  return a;
519
519
  });
520
520
  L(() => e.modelValue, (a) => {
521
- a != null ? r.value = Array.isArray(a) ? a : [a] : r.value = [];
521
+ a != null ? d.value = Array.isArray(a) ? a : [a] : d.value = [];
522
522
  }, { immediate: !0 });
523
- const s = (a, i) => {
524
- r.value[a] = i;
525
- for (let f = a + 1; f < e.depth; f++)
526
- r.value[f] = void 0;
527
- const n = r.value.filter((f) => f !== void 0);
528
- l("update:modelValue", n);
523
+ const c = (a, l) => {
524
+ d.value[a] = l;
525
+ for (let u = a + 1; u < e.depth; u++)
526
+ d.value[u] = void 0;
527
+ const n = d.value.filter((u) => u !== void 0);
528
+ i("update:modelValue", n);
529
529
  };
530
- return (a, i) => {
531
- const n = he, f = pe;
532
- return h(), y("div", {
530
+ return (a, l) => {
531
+ const n = ge, u = he;
532
+ return g(), b("div", {
533
533
  class: V(["u-cascader", { "u-cascader-label-left": o.labelPosition === "left" }])
534
534
  }, [
535
- o.fieldLabel ? (h(), y("div", {
535
+ o.fieldLabel ? (g(), b("div", {
536
536
  key: 0,
537
537
  class: "u-cascader-label",
538
- style: B(d())
538
+ style: B(r())
539
539
  }, [
540
- F(k(o.fieldLabel) + " ", 1),
541
- C("span", {
540
+ F(T(o.fieldLabel) + " ", 1),
541
+ x("span", {
542
542
  class: V(["required-star", { "required-star--visible": o.required }])
543
543
  }, "*", 2)
544
544
  ], 4)) : D("", !0),
545
- C("div", dt, [
546
- (h(!0), y(I, null, E(o.depth, (m) => (h(), y("div", {
545
+ x("div", ut, [
546
+ (g(!0), b(I, null, M(o.depth, (m) => (g(), b("div", {
547
547
  key: m - 1,
548
548
  class: "u-cascader-level"
549
549
  }, [
550
- _(f, {
551
- "model-value": r.value[m - 1],
552
- options: c.value[m - 1] || [],
553
- disabled: m > 1 && r.value[m - 2] === void 0,
550
+ _(u, {
551
+ "model-value": d.value[m - 1],
552
+ options: s.value[m - 1] || [],
553
+ disabled: m > 1 && d.value[m - 2] === void 0,
554
554
  placeholder: `请选择${m}级`,
555
555
  style: { width: "100%" },
556
- onChange: (u) => s(m - 1, u)
556
+ onChange: (f) => c(m - 1, f)
557
557
  }, {
558
558
  default: w(() => [
559
- (h(!0), y(I, null, E(c.value[m - 1] || [], (u) => (h(), S(n, {
560
- key: u.value,
561
- label: u.label,
562
- value: u.value
559
+ (g(!0), b(I, null, M(s.value[m - 1] || [], (f) => (g(), S(n, {
560
+ key: f.value,
561
+ label: f.label,
562
+ value: f.value
563
563
  }, null, 8, ["label", "value"]))), 128))
564
564
  ]),
565
565
  _: 2
@@ -569,7 +569,7 @@ const nt = { class: "u-dict-field" }, it = /* @__PURE__ */ P({
569
569
  ], 2);
570
570
  };
571
571
  }
572
- }), Re = /* @__PURE__ */ $(ct, [["__scopeId", "data-v-d66c339c"]]), ut = { class: "u-date-field" }, ft = /* @__PURE__ */ P({
572
+ }), Ie = /* @__PURE__ */ $(ft, [["__scopeId", "data-v-d66c339c"]]), mt = { class: "u-date-field" }, pt = /* @__PURE__ */ P({
573
573
  __name: "UDate",
574
574
  props: {
575
575
  fieldLabel: {},
@@ -586,51 +586,51 @@ const nt = { class: "u-dict-field" }, it = /* @__PURE__ */ P({
586
586
  },
587
587
  emits: ["update:modelValue"],
588
588
  setup(o, { emit: t }) {
589
- const e = o, l = t, d = () => {
589
+ const e = o, i = t, r = () => {
590
590
  const a = {};
591
591
  return e.labelPosition === "left" && e.labelWidth && (a.width = typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth), e.labelAlign && (a.textAlign = e.labelAlign), a;
592
- }, r = Q("");
592
+ }, d = Q("");
593
593
  L(() => e.modelValue, (a) => {
594
- 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 = []);
594
+ e.mode === "single" ? d.value = a || "" : e.mode === "multiple" ? d.value = Array.isArray(a) ? a : a ? [a] : [] : e.mode === "range" && (a && typeof a == "object" && a.from && a.to ? d.value = [a.from, a.to] : d.value = []);
595
595
  }, { immediate: !0 });
596
- const c = (a) => {
597
- a && (e.mode === "single" || e.mode === "multiple" ? l("update:modelValue", a) : e.mode === "range" && a && a.length === 2 && l("update:modelValue", { from: a[0], to: a[1] }));
598
- }, s = v(() => e.mode === "range" ? "daterange" : e.mode === "multiple" ? "dates" : "date");
599
- return (a, i) => {
596
+ const s = (a) => {
597
+ a && (e.mode === "single" || e.mode === "multiple" ? i("update:modelValue", a) : e.mode === "range" && a && a.length === 2 && i("update:modelValue", { from: a[0], to: a[1] }));
598
+ }, c = v(() => e.mode === "range" ? "daterange" : e.mode === "multiple" ? "dates" : "date");
599
+ return (a, l) => {
600
600
  const n = ze;
601
- return h(), y("div", {
601
+ return g(), b("div", {
602
602
  class: V(["u-date", { "u-date-label-left": o.labelPosition === "left" }])
603
603
  }, [
604
- o.fieldLabel ? (h(), y("div", {
604
+ o.fieldLabel ? (g(), b("div", {
605
605
  key: 0,
606
606
  class: "u-date-label",
607
- style: B(d())
607
+ style: B(r())
608
608
  }, [
609
- F(k(o.fieldLabel) + " ", 1),
610
- C("span", {
609
+ F(T(o.fieldLabel) + " ", 1),
610
+ x("span", {
611
611
  class: V(["required-star", { "required-star--visible": o.required }])
612
612
  }, "*", 2)
613
613
  ], 4)) : D("", !0),
614
- C("div", ut, [
614
+ x("div", mt, [
615
615
  _(n, {
616
- modelValue: r.value,
617
- "onUpdate:modelValue": i[0] || (i[0] = (f) => r.value = f),
618
- type: s.value,
616
+ modelValue: d.value,
617
+ "onUpdate:modelValue": l[0] || (l[0] = (u) => d.value = u),
618
+ type: c.value,
619
619
  placeholder: o.locale === "en-US" ? "Select date" : "选择日期",
620
620
  "range-separator": o.locale === "en-US" ? "to" : "至",
621
621
  "start-placeholder": o.locale === "en-US" ? "Start date" : "开始日期",
622
622
  "end-placeholder": o.locale === "en-US" ? "End date" : "结束日期",
623
623
  format: o.mask.replace("YYYY", "YYYY").replace("MM", "MM").replace("DD", "DD"),
624
624
  "value-format": o.mask.replace("YYYY", "YYYY").replace("MM", "MM").replace("DD", "DD"),
625
- onChange: c
625
+ onChange: s
626
626
  }, null, 8, ["modelValue", "type", "placeholder", "range-separator", "start-placeholder", "end-placeholder", "format", "value-format"])
627
627
  ])
628
628
  ], 2);
629
629
  };
630
630
  }
631
- }), de = /* @__PURE__ */ $(ft, [["__scopeId", "data-v-9cd05064"]]);
631
+ }), de = /* @__PURE__ */ $(pt, [["__scopeId", "data-v-9cd05064"]]);
632
632
  function le(o, t = "info") {
633
- Te({
633
+ Pe({
634
634
  message: o,
635
635
  type: t,
636
636
  duration: 1e3,
@@ -638,39 +638,39 @@ function le(o, t = "info") {
638
638
  });
639
639
  }
640
640
  function U(o) {
641
- Te({
641
+ Pe({
642
642
  message: o,
643
643
  type: "error",
644
644
  duration: 2e3,
645
645
  showClose: !1
646
646
  });
647
647
  }
648
- function mt(o) {
648
+ function ht(o) {
649
649
  le(o, "success");
650
650
  }
651
- function pt(o) {
651
+ function gt(o) {
652
652
  le(o, "error");
653
653
  }
654
- function ht(o) {
654
+ function yt(o) {
655
655
  le(o, "warning");
656
656
  }
657
- function gt(o) {
657
+ function bt(o) {
658
658
  le(o, "info");
659
659
  }
660
- const z = {
660
+ const N = {
661
661
  notify: le,
662
- success: mt,
663
- error: pt,
664
- warning: ht,
665
- info: gt,
662
+ success: ht,
663
+ error: gt,
664
+ warning: yt,
665
+ info: bt,
666
666
  alertError: U
667
- }, yt = {
667
+ }, vt = {
668
668
  key: 0,
669
669
  class: "u-menu-brand"
670
- }, bt = ["src"], vt = { class: "u-menu-brand-text" }, wt = {
670
+ }, wt = ["src"], Ct = { class: "u-menu-brand-text" }, xt = {
671
671
  key: 1,
672
672
  class: "u-menu-logout"
673
- }, xt = /* @__PURE__ */ P({
673
+ }, _t = /* @__PURE__ */ P({
674
674
  __name: "UMenu",
675
675
  props: {
676
676
  menuId: { default: "menu" },
@@ -682,7 +682,7 @@ const z = {
682
682
  },
683
683
  emits: ["menu-click", "logout"],
684
684
  setup(o, { expose: t, emit: e }) {
685
- const l = o, d = e, r = W({
685
+ const i = o, r = e, d = z({
686
686
  // 菜单配置
687
687
  config: null,
688
688
  // 实际渲染的菜单列表(静态配置或字典菜单)
@@ -693,86 +693,86 @@ const z = {
693
693
  iconMap: {},
694
694
  // 图标是否已加载
695
695
  iconsLoaded: !1
696
- }), c = v(() => {
697
- var a, i, n, f, m, u, g, p;
696
+ }), s = v(() => {
697
+ var a, l, n, u, m, f, p, h;
698
698
  return {
699
699
  // 项目名称:为空则不显示
700
- projectName: l.projectName ?? ((a = r.config) == null ? void 0 : a.projectName) ?? "",
700
+ projectName: i.projectName ?? ((a = d.config) == null ? void 0 : a.projectName) ?? "",
701
701
  // 项目 logo
702
- logo: ((i = r.config) == null ? void 0 : i.logo) || "",
702
+ logo: ((l = d.config) == null ? void 0 : l.logo) || "",
703
703
  // 菜单模式
704
- mode: l.mode ?? ((n = r.config) == null ? void 0 : n.mode) ?? "sidebar",
704
+ mode: i.mode ?? ((n = d.config) == null ? void 0 : n.mode) ?? "sidebar",
705
705
  // 是否水平模式
706
- isHorizontal: (l.mode ?? ((f = r.config) == null ? void 0 : f.mode) ?? "sidebar") === "horizontal",
706
+ isHorizontal: (i.mode ?? ((u = d.config) == null ? void 0 : u.mode) ?? "sidebar") === "horizontal",
707
707
  // el-menu 的 mode
708
- elMode: (l.mode ?? ((m = r.config) == null ? void 0 : m.mode) ?? "sidebar") === "horizontal" ? "horizontal" : "vertical",
708
+ elMode: (i.mode ?? ((m = d.config) == null ? void 0 : m.mode) ?? "sidebar") === "horizontal" ? "horizontal" : "vertical",
709
709
  // 菜单宽度(仅 sidebar 生效)
710
- width: l.width ?? ((u = r.config) == null ? void 0 : u.width) ?? 220,
710
+ width: i.width ?? ((f = d.config) == null ? void 0 : f.width) ?? 220,
711
711
  // 菜单列表
712
- menus: r.menus,
712
+ menus: d.menus,
713
713
  // 当前激活项的 el-menu index
714
- activeIndex: s.getIndexByPath(r.activePath),
714
+ activeIndex: c.getIndexByPath(d.activePath),
715
715
  // 是否显示退出登录区域
716
- showLogout: ((g = r.config) == null ? void 0 : g.showLogout) !== !1,
716
+ showLogout: ((p = d.config) == null ? void 0 : p.showLogout) !== !1,
717
717
  // 退出登录按钮文本
718
- logoutText: ((p = r.config) == null ? void 0 : p.logoutText) || "退出登录",
718
+ logoutText: ((h = d.config) == null ? void 0 : h.logoutText) || "退出登录",
719
719
  // 图标映射
720
- iconMap: r.iconMap
720
+ iconMap: d.iconMap
721
721
  };
722
- }), s = {
722
+ }), c = {
723
723
  // 初始化
724
724
  async init() {
725
- await s.ensureIcons(), l.config ? (r.config = l.config, r.menus = s.normalizeMenus(l.config.menus)) : await s.loadConfig(l.menuId), r.activePath = l.activePath || r.activePath;
725
+ await c.ensureIcons(), i.config ? (d.config = i.config, d.menus = c.normalizeMenus(i.config.menus)) : await c.loadConfig(i.menuId), d.activePath = i.activePath || d.activePath;
726
726
  },
727
727
  // 加载菜单配置(与 UDict 一致:http + status === 200 判断)
728
728
  async loadConfig(a) {
729
729
  if (a)
730
730
  try {
731
- const i = await M.get(K.formCfgApi(a, "menus"));
732
- if (i.status !== 200) {
733
- U(i.message || "获取菜单配置失败");
731
+ const l = await E.get(K.formCfgApi(a, "menus"));
732
+ if (l.status !== 200) {
733
+ U(l.message || "获取菜单配置失败");
734
734
  return;
735
735
  }
736
- const n = i.data || {};
737
- r.config = n, n.dictType ? await s.loadDictMenus(n.dictType) : r.menus = s.normalizeMenus(n.menus);
738
- } catch (i) {
739
- U((i == null ? void 0 : i.message) || "获取菜单配置失败"), r.menus = [];
736
+ const n = l.data || {};
737
+ d.config = n, n.dictType ? await c.loadDictMenus(n.dictType) : d.menus = c.normalizeMenus(n.menus);
738
+ } catch (l) {
739
+ U((l == null ? void 0 : l.message) || "获取菜单配置失败"), d.menus = [];
740
740
  }
741
741
  },
742
742
  // 加载字典菜单(参考 UDict 的字典数据来源,字典树对应菜单的 1、2 级)
743
743
  async loadDictMenus(a) {
744
744
  try {
745
- const i = await M.get(K.cascaderApi(a));
746
- if (i.status !== 200) {
747
- U(i.message || "获取菜单字典失败");
745
+ const l = await E.get(K.cascaderApi(a));
746
+ if (l.status !== 200) {
747
+ U(l.message || "获取菜单字典失败");
748
748
  return;
749
749
  }
750
- r.menus = s.normalizeMenus(ve(i.data));
751
- } catch (i) {
752
- U((i == null ? void 0 : i.message) || "获取菜单字典失败"), r.menus = [];
750
+ d.menus = c.normalizeMenus(we(l.data));
751
+ } catch (l) {
752
+ U((l == null ? void 0 : l.message) || "获取菜单字典失败"), d.menus = [];
753
753
  }
754
754
  },
755
755
  // 规范化菜单列表(最多 2 级,第二级的 children 不再展开)
756
756
  normalizeMenus(a) {
757
- return Array.isArray(a) ? a.map((i) => s.normalizeMenuNode(i)).filter(Boolean) : [];
757
+ return Array.isArray(a) ? a.map((l) => c.normalizeMenuNode(l)).filter(Boolean) : [];
758
758
  },
759
759
  // 规范化单个菜单节点(兼容静态配置与字典节点两种结构)
760
760
  normalizeMenuNode(a) {
761
761
  if (!a || typeof a != "object") return null;
762
- const i = s.parseInfo(a.info), n = a.label ?? a.dict_value ?? a.name;
762
+ const l = c.parseInfo(a.info), n = a.label ?? a.dict_value ?? a.name;
763
763
  if (!n) return null;
764
- const f = i.path ?? a.path ?? a.dict_code ?? a.value ?? "", m = i.type ?? a.type ?? "route", u = {
764
+ const u = l.path ?? a.path ?? a.dict_code ?? a.value ?? "", m = l.type ?? a.type ?? "route", f = {
765
765
  ...a,
766
766
  label: String(n),
767
767
  type: m,
768
- path: String(f ?? ""),
769
- icon: i.icon ?? a.icon ?? ""
770
- }, g = i.id ?? a.id;
771
- g != null && g !== "" && (u.id = String(g));
772
- const p = i.open ?? a.open;
773
- (p === "new" || p === "self") && (u.open = p), delete u.children;
774
- const b = a.children;
775
- return Array.isArray(b) && b.length > 0 && (u.children = b.map((R) => s.normalizeMenuNode(R)).filter(Boolean)), u;
768
+ path: String(u ?? ""),
769
+ icon: l.icon ?? a.icon ?? ""
770
+ }, p = l.id ?? a.id;
771
+ p != null && p !== "" && (f.id = String(p));
772
+ const h = l.open ?? a.open;
773
+ (h === "new" || h === "self") && (f.open = h), delete f.children;
774
+ const y = a.children;
775
+ return Array.isArray(y) && y.length > 0 && (f.children = y.map((A) => c.normalizeMenuNode(A)).filter(Boolean)), f;
776
776
  },
777
777
  // 解析字典节点的 info(可能是 JSON 字符串,也可能是对象)
778
778
  parseInfo(a) {
@@ -780,20 +780,20 @@ const z = {
780
780
  if (typeof a == "object") return a;
781
781
  if (typeof a == "string")
782
782
  try {
783
- const i = JSON.parse(a);
784
- return i && typeof i == "object" ? i : {};
783
+ const l = JSON.parse(a);
784
+ return l && typeof l == "object" ? l : {};
785
785
  } catch {
786
786
  return { path: a };
787
787
  }
788
788
  return {};
789
789
  },
790
790
  // 生成 el-menu 的 index(一级)
791
- itemIndex(a, i) {
792
- return a.path || `menu-${i}`;
791
+ itemIndex(a, l) {
792
+ return a.path || `menu-${l}`;
793
793
  },
794
794
  // 生成 el-menu 的 index(二级)
795
- childIndex(a, i, n, f) {
796
- return n.path ? n.path : `${s.itemIndex(a, i)}-${f}`;
795
+ childIndex(a, l, n, u) {
796
+ return n.path ? n.path : `${c.itemIndex(a, l)}-${u}`;
797
797
  },
798
798
  // 是否有二级菜单(最多支持 2 级)
799
799
  hasChildren(a) {
@@ -802,67 +802,67 @@ const z = {
802
802
  // 根据跳转目标找到 el-menu index(用于 default-active)
803
803
  getIndexByPath(a) {
804
804
  if (!a) return "";
805
- for (let i = 0; i < r.menus.length; i++) {
806
- const n = r.menus[i];
807
- if (n.path === a) return s.itemIndex(n, i);
808
- const f = n.children || [];
809
- for (let m = 0; m < f.length; m++)
810
- if (f[m].path === a) return s.childIndex(n, i, f[m], m);
805
+ for (let l = 0; l < d.menus.length; l++) {
806
+ const n = d.menus[l];
807
+ if (n.path === a) return c.itemIndex(n, l);
808
+ const u = n.children || [];
809
+ for (let m = 0; m < u.length; m++)
810
+ if (u[m].path === a) return c.childIndex(n, l, u[m], m);
811
811
  }
812
812
  return "";
813
813
  },
814
814
  // 根据 el-menu index 找到菜单项
815
- findItemByIndex(a, i) {
816
- for (let n = 0; n < r.menus.length; n++) {
817
- const f = r.menus[n], m = s.itemIndex(f, n);
815
+ findItemByIndex(a, l) {
816
+ for (let n = 0; n < d.menus.length; n++) {
817
+ const u = d.menus[n], m = c.itemIndex(u, n);
818
818
  if (m === a)
819
- return { item: f, level: 1, indexPath: i || [m], index: a };
820
- const u = f.children || [];
821
- for (let g = 0; g < u.length; g++) {
822
- const p = u[g], b = s.childIndex(f, n, p, g);
823
- if (b === a)
824
- return { item: p, level: 2, indexPath: i || [m, b], index: a };
819
+ return { item: u, level: 1, indexPath: l || [m], index: a };
820
+ const f = u.children || [];
821
+ for (let p = 0; p < f.length; p++) {
822
+ const h = f[p], y = c.childIndex(u, n, h, p);
823
+ if (y === a)
824
+ return { item: h, level: 2, indexPath: l || [m, y], index: a };
825
825
  }
826
826
  }
827
827
  return null;
828
828
  },
829
829
  // 解析跳转目标:外部可直接通过 type 判断跳转类型
830
830
  resolveTarget(a) {
831
- const i = a.type || "route", n = a.path || "";
832
- return i === "url" ? { type: i, path: n, url: n, open: a.open || "new" } : i === "form" || i === "table" || i === "menu" ? { type: i, path: n, id: a.id || n } : { type: "route", path: n, route: n };
831
+ const l = a.type || "route", n = a.path || "";
832
+ return l === "url" ? { type: l, path: n, url: n, open: a.open || "new" } : l === "form" || l === "table" || l === "menu" ? { type: l, path: n, id: a.id || n } : { type: "route", path: n, route: n };
833
833
  },
834
834
  // 菜单点击
835
- handleSelect(a, i) {
836
- const n = s.findItemByIndex(a, i);
837
- if (!n || s.hasChildren(n.item)) return;
838
- const f = s.resolveTarget(n.item);
839
- r.activePath = n.item.path || a;
835
+ handleSelect(a, l) {
836
+ const n = c.findItemByIndex(a, l);
837
+ if (!n || c.hasChildren(n.item)) return;
838
+ const u = c.resolveTarget(n.item);
839
+ d.activePath = n.item.path || a;
840
840
  const m = {
841
- ...f,
841
+ ...u,
842
842
  item: n.item,
843
843
  level: n.level,
844
844
  indexPath: n.indexPath,
845
845
  index: a
846
846
  };
847
- d("menu-click", m);
847
+ r("menu-click", m);
848
848
  },
849
849
  // 退出登录
850
850
  handleLogout() {
851
- d("logout");
851
+ r("logout");
852
852
  },
853
853
  // 设置激活项
854
854
  setActivePath(a) {
855
- r.activePath = a;
855
+ d.activePath = a;
856
856
  },
857
857
  // 加载图标(按需 import,避免无图标时把整包图标打进产物)
858
858
  async ensureIcons() {
859
- if (!r.iconsLoaded) {
860
- r.iconsLoaded = !0;
859
+ if (!d.iconsLoaded) {
860
+ d.iconsLoaded = !0;
861
861
  try {
862
- const a = await import("@element-plus/icons-vue"), i = a != null && a.default ? { ...a.default, ...a } : { ...a }, n = {};
863
- for (const [f, m] of Object.entries(i))
864
- n[f] = re(m);
865
- r.iconMap = n;
862
+ const a = await import("@element-plus/icons-vue"), l = a != null && a.default ? { ...a.default, ...a } : { ...a }, n = {};
863
+ for (const [u, m] of Object.entries(l))
864
+ n[u] = re(m);
865
+ d.iconMap = n;
866
866
  } catch (a) {
867
867
  console.warn("[UMenu] @element-plus/icons-vue 不可用,菜单图标将被忽略", a);
868
868
  }
@@ -870,122 +870,122 @@ const z = {
870
870
  },
871
871
  // 取图标组件
872
872
  getIcon(a) {
873
- return a && r.iconMap[a] || null;
873
+ return a && d.iconMap[a] || null;
874
874
  }
875
875
  };
876
- return L(() => l.menuId, (a) => {
877
- l.config || s.loadConfig(a);
878
- }), L(() => l.activePath, (a) => {
879
- r.activePath = a || "";
880
- }), L(() => l.config, (a) => {
881
- a && (r.config = a, r.menus = s.normalizeMenus(a.menus));
876
+ return L(() => i.menuId, (a) => {
877
+ i.config || c.loadConfig(a);
878
+ }), L(() => i.activePath, (a) => {
879
+ d.activePath = a || "";
880
+ }), L(() => i.config, (a) => {
881
+ a && (d.config = a, d.menus = c.normalizeMenus(a.menus));
882
882
  }), oe(() => {
883
- s.init();
883
+ c.init();
884
884
  }), t({
885
- loadConfig: s.loadConfig,
886
- setActivePath: s.setActivePath
887
- }), (a, i) => {
888
- const n = ge, f = qe, m = We, u = Ne, g = J;
889
- return h(), y("div", {
890
- class: V(["u-menu", [`u-menu--${c.value.mode}`, { "u-menu--no-brand": !c.value.projectName }]]),
891
- style: B(c.value.isHorizontal ? {} : { width: c.value.width + "px" })
885
+ loadConfig: c.loadConfig,
886
+ setActivePath: c.setActivePath
887
+ }), (a, l) => {
888
+ const n = ye, u = je, m = Oe, f = qe, p = J;
889
+ return g(), b("div", {
890
+ class: V(["u-menu", [`u-menu--${s.value.mode}`, { "u-menu--no-brand": !s.value.projectName }]]),
891
+ style: B(s.value.isHorizontal ? {} : { width: s.value.width + "px" })
892
892
  }, [
893
- c.value.projectName ? (h(), y("div", yt, [
894
- T(a.$slots, "brand", {
895
- projectName: c.value.projectName,
896
- mode: c.value.mode
893
+ s.value.projectName ? (g(), b("div", vt, [
894
+ k(a.$slots, "brand", {
895
+ projectName: s.value.projectName,
896
+ mode: s.value.mode
897
897
  }, () => [
898
- c.value.logo ? (h(), y("img", {
898
+ s.value.logo ? (g(), b("img", {
899
899
  key: 0,
900
900
  class: "u-menu-logo",
901
- src: c.value.logo,
901
+ src: s.value.logo,
902
902
  alt: "logo"
903
- }, null, 8, bt)) : D("", !0),
904
- C("span", vt, k(c.value.projectName), 1)
903
+ }, null, 8, wt)) : D("", !0),
904
+ x("span", Ct, T(s.value.projectName), 1)
905
905
  ], !0)
906
906
  ])) : D("", !0),
907
- _(u, {
907
+ _(f, {
908
908
  class: "u-menu-list",
909
- mode: c.value.elMode,
910
- "default-active": c.value.activeIndex,
911
- "unique-opened": !c.value.isHorizontal,
912
- onSelect: s.handleSelect
909
+ mode: s.value.elMode,
910
+ "default-active": s.value.activeIndex,
911
+ "unique-opened": !s.value.isHorizontal,
912
+ onSelect: c.handleSelect
913
913
  }, {
914
914
  default: w(() => [
915
- (h(!0), y(I, null, E(c.value.menus, (p, b) => (h(), y(I, {
916
- key: s.itemIndex(p, b)
915
+ (g(!0), b(I, null, M(s.value.menus, (h, y) => (g(), b(I, {
916
+ key: c.itemIndex(h, y)
917
917
  }, [
918
- s.hasChildren(p) ? (h(), S(m, {
918
+ c.hasChildren(h) ? (g(), S(m, {
919
919
  key: 0,
920
- index: s.itemIndex(p, b)
920
+ index: c.itemIndex(h, y)
921
921
  }, {
922
922
  title: w(() => [
923
- T(a.$slots, "menu-title", {
924
- item: p,
923
+ k(a.$slots, "menu-title", {
924
+ item: h,
925
925
  level: 1,
926
- index: b
926
+ index: y
927
927
  }, () => [
928
- s.getIcon(p.icon) ? (h(), S(n, {
928
+ c.getIcon(h.icon) ? (g(), S(n, {
929
929
  key: 0,
930
930
  class: "u-menu-icon"
931
931
  }, {
932
932
  default: w(() => [
933
- (h(), S(H(s.getIcon(p.icon))))
933
+ (g(), S(G(c.getIcon(h.icon))))
934
934
  ]),
935
935
  _: 2
936
936
  }, 1024)) : D("", !0),
937
- C("span", null, k(p.label), 1)
937
+ x("span", null, T(h.label), 1)
938
938
  ], !0)
939
939
  ]),
940
940
  default: w(() => [
941
- (h(!0), y(I, null, E(p.children, (R, G) => (h(), S(f, {
942
- key: s.childIndex(p, b, R, G),
943
- index: s.childIndex(p, b, R, G)
941
+ (g(!0), b(I, null, M(h.children, (A, H) => (g(), S(u, {
942
+ key: c.childIndex(h, y, A, H),
943
+ index: c.childIndex(h, y, A, H)
944
944
  }, {
945
945
  default: w(() => [
946
- T(a.$slots, "menu-item", {
947
- item: R,
946
+ k(a.$slots, "menu-item", {
947
+ item: A,
948
948
  level: 2,
949
- index: G,
950
- parent: p
949
+ index: H,
950
+ parent: h
951
951
  }, () => [
952
- s.getIcon(R.icon) ? (h(), S(n, {
952
+ c.getIcon(A.icon) ? (g(), S(n, {
953
953
  key: 0,
954
954
  class: "u-menu-icon"
955
955
  }, {
956
956
  default: w(() => [
957
- (h(), S(H(s.getIcon(R.icon))))
957
+ (g(), S(G(c.getIcon(A.icon))))
958
958
  ]),
959
959
  _: 2
960
960
  }, 1024)) : D("", !0),
961
- C("span", null, k(R.label), 1)
961
+ x("span", null, T(A.label), 1)
962
962
  ], !0)
963
963
  ]),
964
964
  _: 2
965
965
  }, 1032, ["index"]))), 128))
966
966
  ]),
967
967
  _: 2
968
- }, 1032, ["index"])) : (h(), S(f, {
968
+ }, 1032, ["index"])) : (g(), S(u, {
969
969
  key: 1,
970
- index: s.itemIndex(p, b)
970
+ index: c.itemIndex(h, y)
971
971
  }, {
972
972
  default: w(() => [
973
- T(a.$slots, "menu-item", {
974
- item: p,
973
+ k(a.$slots, "menu-item", {
974
+ item: h,
975
975
  level: 1,
976
- index: b,
976
+ index: y,
977
977
  parent: null
978
978
  }, () => [
979
- s.getIcon(p.icon) ? (h(), S(n, {
979
+ c.getIcon(h.icon) ? (g(), S(n, {
980
980
  key: 0,
981
981
  class: "u-menu-icon"
982
982
  }, {
983
983
  default: w(() => [
984
- (h(), S(H(s.getIcon(p.icon))))
984
+ (g(), S(G(c.getIcon(h.icon))))
985
985
  ]),
986
986
  _: 2
987
987
  }, 1024)) : D("", !0),
988
- C("span", null, k(p.label), 1)
988
+ x("span", null, T(h.label), 1)
989
989
  ], !0)
990
990
  ]),
991
991
  _: 2
@@ -994,17 +994,17 @@ const z = {
994
994
  ]),
995
995
  _: 3
996
996
  }, 8, ["mode", "default-active", "unique-opened", "onSelect"]),
997
- c.value.showLogout ? (h(), y("div", wt, [
998
- T(a.$slots, "logout", {
999
- mode: c.value.mode
997
+ s.value.showLogout ? (g(), b("div", xt, [
998
+ k(a.$slots, "logout", {
999
+ mode: s.value.mode
1000
1000
  }, () => [
1001
- _(g, {
1001
+ _(p, {
1002
1002
  class: "u-menu-logout-btn",
1003
1003
  text: "",
1004
- onClick: s.handleLogout
1004
+ onClick: c.handleLogout
1005
1005
  }, {
1006
1006
  default: w(() => [
1007
- F(k(c.value.logoutText), 1)
1007
+ F(T(s.value.logoutText), 1)
1008
1008
  ]),
1009
1009
  _: 1
1010
1010
  }, 8, ["onClick"])
@@ -1013,16 +1013,16 @@ const z = {
1013
1013
  ], 6);
1014
1014
  };
1015
1015
  }
1016
- }), Ct = /* @__PURE__ */ $(xt, [["__scopeId", "data-v-fe63251c"]]), _t = { class: "form-content" }, St = {
1016
+ }), St = /* @__PURE__ */ $(_t, [["__scopeId", "data-v-fe63251c"]]), Dt = { class: "form-content" }, kt = {
1017
1017
  key: 1,
1018
1018
  class: "form-layout"
1019
- }, Dt = {
1019
+ }, Tt = {
1020
1020
  key: 0,
1021
1021
  class: "form-header"
1022
- }, kt = { class: "title" }, Tt = { class: "form-body" }, Vt = {
1022
+ }, Vt = { class: "title" }, Pt = { class: "form-body" }, $t = {
1023
1023
  key: 1,
1024
1024
  class: "form-footer"
1025
- }, Pt = /* @__PURE__ */ P({
1025
+ }, At = /* @__PURE__ */ P({
1026
1026
  __name: "FormContainer",
1027
1027
  props: {
1028
1028
  visible: { type: Boolean },
@@ -1032,98 +1032,98 @@ const z = {
1032
1032
  },
1033
1033
  emits: ["update:visible", "close", "closed"],
1034
1034
  setup(o, { emit: t }) {
1035
- const e = o, l = t, { visible: d } = Ge(e), r = v(() => e.layout.open === "normal"), c = v(() => e.layout.width || 400), s = {
1035
+ const e = o, i = t, { visible: r } = Xe(e), d = v(() => e.layout.open === "normal"), s = v(() => e.layout.width || 400), c = {
1036
1036
  handleClose() {
1037
- l("update:visible", !1), l("close");
1037
+ i("update:visible", !1), i("close");
1038
1038
  },
1039
1039
  handleClosed() {
1040
- l("closed");
1040
+ i("closed");
1041
1041
  },
1042
1042
  updateVisible(a) {
1043
- l("update:visible", a);
1043
+ i("update:visible", a);
1044
1044
  }
1045
1045
  };
1046
- return (a, i) => {
1047
- const n = ge, f = je;
1048
- return r.value ? N(d) ? (h(), y("div", St, [
1049
- o.title ? (h(), y("div", Dt, [
1050
- C("div", kt, k(o.title), 1)
1046
+ return (a, l) => {
1047
+ const n = ye, u = Ye;
1048
+ return d.value ? W(r) ? (g(), b("div", kt, [
1049
+ o.title ? (g(), b("div", Tt, [
1050
+ x("div", Vt, T(o.title), 1)
1051
1051
  ])) : D("", !0),
1052
- C("div", Tt, [
1053
- o.loading ? (h(), S(n, {
1052
+ x("div", Pt, [
1053
+ o.loading ? (g(), S(n, {
1054
1054
  key: 0,
1055
1055
  class: "is-loading",
1056
1056
  size: 40
1057
1057
  }, {
1058
1058
  default: w(() => [
1059
- _(N(ke))
1059
+ _(W(Ve))
1060
1060
  ]),
1061
1061
  _: 1
1062
- })) : T(a.$slots, "default", {}, void 0, !0, 1)
1062
+ })) : k(a.$slots, "default", {}, void 0, !0, 1)
1063
1063
  ]),
1064
- a.$slots.actions ? (h(), y("div", Vt, [
1065
- T(a.$slots, "actions", {}, void 0, !0)
1064
+ a.$slots.actions ? (g(), b("div", $t, [
1065
+ k(a.$slots, "actions", {}, void 0, !0)
1066
1066
  ])) : D("", !0)
1067
- ])) : D("", !0) : (h(), S(f, {
1067
+ ])) : D("", !0) : (g(), S(u, {
1068
1068
  key: 0,
1069
- "model-value": N(d),
1069
+ "model-value": W(r),
1070
1070
  title: o.title,
1071
- width: c.value,
1071
+ width: s.value,
1072
1072
  "close-on-click-modal": !1,
1073
- "onUpdate:modelValue": s.updateVisible,
1074
- onClose: s.handleClose,
1075
- onClosed: s.handleClosed
1073
+ "onUpdate:modelValue": c.updateVisible,
1074
+ onClose: c.handleClose,
1075
+ onClosed: c.handleClosed
1076
1076
  }, {
1077
1077
  footer: w(() => [
1078
- T(a.$slots, "actions", {}, void 0, !0)
1078
+ k(a.$slots, "actions", {}, void 0, !0)
1079
1079
  ]),
1080
1080
  default: w(() => [
1081
- C("div", _t, [
1082
- o.loading ? (h(), S(n, {
1081
+ x("div", Dt, [
1082
+ o.loading ? (g(), S(n, {
1083
1083
  key: 0,
1084
1084
  class: "is-loading",
1085
1085
  size: 40
1086
1086
  }, {
1087
1087
  default: w(() => [
1088
- _(N(ke))
1088
+ _(W(Ve))
1089
1089
  ]),
1090
1090
  _: 1
1091
- })) : T(a.$slots, "default", {}, void 0, !0, 1)
1091
+ })) : k(a.$slots, "default", {}, void 0, !0, 1)
1092
1092
  ])
1093
1093
  ]),
1094
1094
  _: 3
1095
1095
  }, 8, ["model-value", "title", "width", "onUpdate:modelValue", "onClose", "onClosed"]));
1096
1096
  };
1097
1097
  }
1098
- }), $t = /* @__PURE__ */ $(Pt, [["__scopeId", "data-v-83362259"]]), Rt = /* @__PURE__ */ P({
1098
+ }), Rt = /* @__PURE__ */ $(At, [["__scopeId", "data-v-83362259"]]), It = /* @__PURE__ */ P({
1099
1099
  __name: "FormGrid",
1100
1100
  props: {
1101
1101
  fields: {},
1102
1102
  layout: {}
1103
1103
  },
1104
1104
  setup(o) {
1105
- const t = o, e = W({
1105
+ const t = o, e = z({
1106
1106
  columns: v(() => t.layout.columns || 1)
1107
- }), l = {
1108
- getColSpan(d) {
1109
- const r = d.colSpan || 1;
1110
- return Math.min(r, e.columns);
1107
+ }), i = {
1108
+ getColSpan(r) {
1109
+ const d = r.colSpan || 1;
1110
+ return Math.min(d, e.columns);
1111
1111
  }
1112
1112
  };
1113
- return (d, r) => (h(), y("div", {
1113
+ return (r, d) => (g(), b("div", {
1114
1114
  class: "form-grid",
1115
1115
  style: B({ "--grid-columns": e.columns })
1116
1116
  }, [
1117
- (h(!0), y(I, null, E(o.fields, (c) => (h(), y("div", {
1118
- key: c.field,
1117
+ (g(!0), b(I, null, M(o.fields, (s) => (g(), b("div", {
1118
+ key: s.field,
1119
1119
  class: "form-grid-item",
1120
- style: B({ gridColumn: `span ${l.getColSpan(c)}` })
1120
+ style: B({ gridColumn: `span ${i.getColSpan(s)}` })
1121
1121
  }, [
1122
- T(d.$slots, "default", { field: c }, void 0, !0)
1122
+ k(r.$slots, "default", { field: s }, void 0, !0)
1123
1123
  ], 4))), 128))
1124
1124
  ], 4));
1125
1125
  }
1126
- }), At = /* @__PURE__ */ $(Rt, [["__scopeId", "data-v-90ed35a4"]]), It = { class: "form-field" }, Mt = /* @__PURE__ */ P({
1126
+ }), Et = /* @__PURE__ */ $(It, [["__scopeId", "data-v-90ed35a4"]]), Mt = { class: "form-field" }, Ut = /* @__PURE__ */ P({
1127
1127
  __name: "FormField",
1128
1128
  props: {
1129
1129
  field: {},
@@ -1134,112 +1134,112 @@ const z = {
1134
1134
  },
1135
1135
  emits: ["update:modelValue"],
1136
1136
  setup(o, { emit: t }) {
1137
- const e = o, l = t, d = W({
1137
+ const e = o, i = t, r = z({
1138
1138
  componentMap: re({
1139
1139
  input: te,
1140
- "input-number": Pe,
1140
+ "input-number": Ae,
1141
1141
  dict: ee,
1142
- switch: $e,
1143
- cascader: Re,
1142
+ switch: Re,
1143
+ cascader: Ie,
1144
1144
  date: de
1145
1145
  }),
1146
1146
  cascaderOptions: []
1147
1147
  });
1148
1148
  L(() => e.field.cascaderKey, () => {
1149
- e.field.cascaderKey && M.get(K.cascaderApi(e.field.cascaderKey)).then((n) => {
1150
- n.status === 200 && (d.cascaderOptions = ve(n.data));
1149
+ e.field.cascaderKey && E.get(K.cascaderApi(e.field.cascaderKey)).then((n) => {
1150
+ n.status === 200 && (r.cascaderOptions = we(n.data));
1151
1151
  });
1152
1152
  }, { immediate: !0 });
1153
- const c = v(() => d.componentMap[e.field.type] || te), s = v(() => {
1153
+ const s = v(() => r.componentMap[e.field.type] || te), c = v(() => {
1154
1154
  if ((e.layout.labelPosition || "top") === "left") {
1155
- const f = e.layout.labelWidth || 0, m = typeof f == "number" ? f + 4 : f;
1155
+ const u = e.layout.labelWidth || 0, m = typeof u == "number" ? u + 4 : u;
1156
1156
  return { marginLeft: typeof m == "number" ? `${m}px` : m };
1157
1157
  }
1158
1158
  return {};
1159
1159
  }), a = v(() => {
1160
- const { field: n, modelValue: f, layout: m, disabled: u } = e;
1161
- let g = f;
1162
- n.type === "switch" && f == null && (g = !1);
1163
- const p = {
1160
+ const { field: n, modelValue: u, layout: m, disabled: f } = e;
1161
+ let p = u;
1162
+ n.type === "switch" && u == null && (p = !1);
1163
+ const h = {
1164
1164
  fieldLabel: n.label,
1165
- modelValue: g,
1165
+ modelValue: p,
1166
1166
  labelPosition: m.labelPosition || "top",
1167
- disable: u,
1167
+ disable: f,
1168
1168
  name: n.field,
1169
1169
  required: n.required
1170
1170
  };
1171
- 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 = d.cascaderOptions, p.depth = n.cascaderDepth || 2), n.type === "date") {
1172
- n.mode && (p.mode = n.mode), n.locale && (p.locale = n.locale), n.format ? p.mask = n.format : n.mask && (p.mask = n.mask);
1173
- const b = n.dateMin ?? n.min, R = n.dateMax ?? n.max;
1174
- b != null && (p.min = b), R != null && (p.max = R);
1171
+ if (m.labelWidth && (h.labelWidth = m.labelWidth), m.labelAlign && (h.labelAlign = m.labelAlign), n.maxlength && (h.maxlength = n.maxlength), n.placeholder && (h.placeholder = n.placeholder), n.readonly && (h.readonly = n.readonly), n.lineCount && n.lineCount >= 2 ? (h.type = "textarea", h.rows = n.lineCount) : n.inputType && (h.type = n.inputType), n.type === "switch" && (n.activeText && (h.activeText = n.activeText), n.inactiveText && (h.inactiveText = n.inactiveText), n.activeColor && (h.activeColor = n.activeColor), n.inactiveColor && (h.inactiveColor = n.inactiveColor), n.trueValue !== void 0 && (h.trueValue = n.trueValue), n.falseValue !== void 0 && (h.falseValue = n.falseValue)), n.dictType && (h.dictType = n.dictType), n.cascaderKey && (h.options = r.cascaderOptions, h.depth = n.cascaderDepth || 2), n.type === "date") {
1172
+ n.mode && (h.mode = n.mode), n.locale && (h.locale = n.locale), n.format ? h.mask = n.format : n.mask && (h.mask = n.mask);
1173
+ const y = n.dateMin ?? n.min, A = n.dateMax ?? n.max;
1174
+ y != null && (h.min = y), A != null && (h.max = A);
1175
1175
  }
1176
- 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;
1177
- }), i = {
1176
+ return n.type === "input-number" && (n.min !== void 0 && (h.min = n.min), n.max !== void 0 && (h.max = n.max), n.step && (h.step = n.step), n.precision !== void 0 && (h.precision = n.precision)), h;
1177
+ }), l = {
1178
1178
  handleUpdate(n) {
1179
- l("update:modelValue", n);
1179
+ i("update:modelValue", n);
1180
1180
  }
1181
1181
  };
1182
- return (n, f) => (h(), y("div", It, [
1183
- (h(), S(H(c.value), ce(a.value, {
1184
- "onUpdate:modelValue": i.handleUpdate
1182
+ return (n, u) => (g(), b("div", Mt, [
1183
+ (g(), S(G(s.value), ce(a.value, {
1184
+ "onUpdate:modelValue": l.handleUpdate
1185
1185
  }), null, 16, ["onUpdate:modelValue"])),
1186
- C("div", {
1186
+ x("div", {
1187
1187
  class: V(["field-error", { "field-error--visible": o.error }]),
1188
- style: B(s.value)
1189
- }, k(o.error || ""), 7)
1188
+ style: B(c.value)
1189
+ }, T(o.error || ""), 7)
1190
1190
  ]));
1191
1191
  }
1192
- }), Et = /* @__PURE__ */ $(Mt, [["__scopeId", "data-v-10299c8d"]]);
1193
- class Ut {
1192
+ }), Bt = /* @__PURE__ */ $(Ut, [["__scopeId", "data-v-10299c8d"]]);
1193
+ class Ft {
1194
1194
  constructor() {
1195
- x(this, "formConfig", null);
1196
- x(this, "formData", {});
1197
- x(this, "loading", !1);
1198
- x(this, "submitting", !1);
1199
- x(this, "visible", !1);
1200
- x(this, "isEditMode", !1);
1201
- x(this, "errors", []);
1202
- x(this, "currentQuery", {});
1195
+ C(this, "formConfig", null);
1196
+ C(this, "formData", {});
1197
+ C(this, "loading", !1);
1198
+ C(this, "submitting", !1);
1199
+ C(this, "visible", !1);
1200
+ C(this, "isEditMode", !1);
1201
+ C(this, "errors", []);
1202
+ C(this, "currentQuery", {});
1203
1203
  }
1204
1204
  }
1205
- let Bt = class {
1205
+ let Lt = class {
1206
1206
  constructor() {
1207
1207
  // 响应式数据
1208
- x(this, "data", W(new Ut()));
1208
+ C(this, "data", z(new Ft()));
1209
1209
  }
1210
1210
  // 解析 query 字符串
1211
1211
  parseQuery(t) {
1212
1212
  if (!t) return {};
1213
- const e = {}, l = t.split("&");
1214
- for (const d of l) {
1215
- const [r, c] = d.split("=");
1216
- r && (e[r] = c || "");
1213
+ const e = {}, i = t.split("&");
1214
+ for (const r of i) {
1215
+ const [d, s] = r.split("=");
1216
+ d && (e[d] = s || "");
1217
1217
  }
1218
1218
  return e;
1219
1219
  }
1220
1220
  // 获取表单配置(type=forms,对应后端 config/forms/<formId>.yaml)
1221
1221
  async fetchFormConfig(t) {
1222
- const e = await M.get(K.formCfgApi(t, "forms"));
1222
+ const e = await E.get(K.formCfgApi(t, "forms"));
1223
1223
  if (e.status !== 200)
1224
1224
  throw new Error(e.message || "获取表单配置失败");
1225
1225
  return e.data;
1226
1226
  }
1227
1227
  // 获取表单数据
1228
1228
  async fetchFormData(t, e) {
1229
- const l = e ? `${t}?${e}` : t, d = await M.get(l);
1230
- if (d.status !== 200)
1231
- throw new Error(d.message || "获取表单数据失败");
1232
- return d.data;
1229
+ const i = e ? `${t}?${e}` : t, r = await E.get(i);
1230
+ if (r.status !== 200)
1231
+ throw new Error(r.message || "获取表单数据失败");
1232
+ return r.data;
1233
1233
  }
1234
1234
  // 提交表单
1235
1235
  async submitForm(t, e) {
1236
- return await M.post(t, e);
1236
+ return await E.post(t, e);
1237
1237
  }
1238
1238
  // 构建字段初始值
1239
1239
  buildInitialData(t) {
1240
1240
  const e = {};
1241
- for (const l of t)
1242
- l.default !== void 0 ? e[l.field] = l.default : e[l.field] = null;
1241
+ for (const i of t)
1242
+ i.default !== void 0 ? e[i.field] = i.default : e[i.field] = null;
1243
1243
  return e;
1244
1244
  }
1245
1245
  // 判断编辑模式
@@ -1251,21 +1251,21 @@ let Bt = class {
1251
1251
  var e;
1252
1252
  this.data.errors = [];
1253
1253
  const t = ((e = this.data.formConfig) == null ? void 0 : e.fields) || [];
1254
- for (const l of t) {
1255
- const d = this.data.formData[l.field];
1256
- if (l.required && (d == null || d === "")) {
1254
+ for (const i of t) {
1255
+ const r = this.data.formData[i.field];
1256
+ if (i.required && (r == null || r === "")) {
1257
1257
  this.data.errors.push({
1258
- field: l.field,
1259
- message: `${l.label}为必填项`
1258
+ field: i.field,
1259
+ message: `${i.label}为必填项`
1260
1260
  });
1261
1261
  continue;
1262
1262
  }
1263
- if (l.rules && l.rules.length > 0 && d) {
1264
- for (const r of l.rules)
1265
- if (r.pattern && !new RegExp(r.pattern).test(d)) {
1263
+ if (i.rules && i.rules.length > 0 && r) {
1264
+ for (const d of i.rules)
1265
+ if (d.pattern && !new RegExp(d.pattern).test(r)) {
1266
1266
  this.data.errors.push({
1267
- field: l.field,
1268
- message: r.message || `${l.label}格式不正确`
1267
+ field: i.field,
1268
+ message: d.message || `${i.label}格式不正确`
1269
1269
  });
1270
1270
  break;
1271
1271
  }
@@ -1275,7 +1275,7 @@ let Bt = class {
1275
1275
  }
1276
1276
  // 获取字段错误信息
1277
1277
  getFieldError(t) {
1278
- const e = this.data.errors.find((l) => l.field === t);
1278
+ const e = this.data.errors.find((i) => i.field === t);
1279
1279
  return e ? e.message : null;
1280
1280
  }
1281
1281
  // 清除错误
@@ -1286,13 +1286,13 @@ let Bt = class {
1286
1286
  async openForm(t, e) {
1287
1287
  this.data.loading = !0, this.data.visible = !0, this.clearErrors(), this.data.currentQuery = this.parseQuery(e || "");
1288
1288
  try {
1289
- const l = await this.fetchFormConfig(t);
1290
- 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) {
1291
- const d = await this.fetchFormData(l.api.get, e), r = this.nestedToFlat(d);
1292
- this.data.formData = { ...this.data.formData, ...r };
1289
+ const i = await this.fetchFormConfig(t);
1290
+ if (this.data.formConfig = i, this.data.isEditMode = this.checkIsEditMode(e || ""), this.data.formData = this.buildInitialData(i.fields), this.data.isEditMode && i.api.get && e) {
1291
+ const r = await this.fetchFormData(i.api.get, e), d = this.nestedToFlat(r);
1292
+ this.data.formData = { ...this.data.formData, ...d };
1293
1293
  }
1294
- } catch (l) {
1295
- throw console.error("[FormRender] 打开表单失败:", l), this.data.visible = !1, l;
1294
+ } catch (i) {
1295
+ throw console.error("[FormRender] 打开表单失败:", i), this.data.visible = !1, i;
1296
1296
  } finally {
1297
1297
  this.data.loading = !1;
1298
1298
  }
@@ -1306,13 +1306,13 @@ let Bt = class {
1306
1306
  let e = this.data.isEditMode ? t.edit : t.add;
1307
1307
  if (!e)
1308
1308
  throw new Error("提交地址未配置");
1309
- let l = { ...this.data.formData };
1310
- l = this.flattenToNested(l), this.data.isEditMode && this.data.currentQuery.id && (l.id = Number(this.data.currentQuery.id)), this.data.submitting = !0;
1309
+ let i = { ...this.data.formData };
1310
+ i = this.flattenToNested(i), this.data.isEditMode && this.data.currentQuery.id && (i.id = Number(this.data.currentQuery.id)), this.data.submitting = !0;
1311
1311
  try {
1312
- const d = await this.submitForm(e, l);
1313
- if (d.status === 200)
1314
- return d.data;
1315
- throw new Error(d.message || "提交失败");
1312
+ const r = await this.submitForm(e, i);
1313
+ if (r.status === 200)
1314
+ return r.data;
1315
+ throw new Error(r.message || "提交失败");
1316
1316
  } finally {
1317
1317
  this.data.submitting = !1;
1318
1318
  }
@@ -1335,46 +1335,46 @@ let Bt = class {
1335
1335
  // 扁平字段转嵌套对象(如 info.address -> { info: { address: xxx } })
1336
1336
  flattenToNested(t) {
1337
1337
  const e = {};
1338
- for (const l in t) {
1339
- const d = t[l];
1340
- if (l.includes(".")) {
1341
- const r = l.split(".");
1342
- let c = e;
1343
- for (let s = 0; s < r.length - 1; s++) {
1344
- const a = r[s];
1345
- c[a] || (c[a] = {}), c = c[a];
1338
+ for (const i in t) {
1339
+ const r = t[i];
1340
+ if (i.includes(".")) {
1341
+ const d = i.split(".");
1342
+ let s = e;
1343
+ for (let c = 0; c < d.length - 1; c++) {
1344
+ const a = d[c];
1345
+ s[a] || (s[a] = {}), s = s[a];
1346
1346
  }
1347
- c[r[r.length - 1]] = d;
1347
+ s[d[d.length - 1]] = r;
1348
1348
  } else
1349
- e[l] = d;
1349
+ e[i] = r;
1350
1350
  }
1351
1351
  return e;
1352
1352
  }
1353
1353
  // 嵌套对象展平为扁平字段(如 { info: { address: "xxx" } } -> { "info.address": "xxx" })
1354
1354
  // 注意:只展平 YAML 中配置的点号分隔字段(如 info.address),不展平已经是对象的字段(如 dateRange: { from, to })
1355
1355
  nestedToFlat(t, e = "") {
1356
- const l = {};
1357
- for (const d in t) {
1358
- const r = t[d], c = e ? `${e}.${d}` : d;
1359
- r && typeof r == "object" && !Array.isArray(r) ? Object.keys(r).length === 2 && "from" in r && "to" in r ? l[c] = r : Object.assign(l, this.nestedToFlat(r, c)) : l[c] = r;
1356
+ const i = {};
1357
+ for (const r in t) {
1358
+ const d = t[r], s = e ? `${e}.${r}` : r;
1359
+ d && typeof d == "object" && !Array.isArray(d) ? Object.keys(d).length === 2 && "from" in d && "to" in d ? i[s] = d : Object.assign(i, this.nestedToFlat(d, s)) : i[s] = d;
1360
1360
  }
1361
- return l;
1361
+ return i;
1362
1362
  }
1363
1363
  };
1364
- const Ft = /* @__PURE__ */ P({
1364
+ const Nt = /* @__PURE__ */ P({
1365
1365
  __name: "FormRender",
1366
1366
  setup(o, { expose: t }) {
1367
- const e = new Bt(), l = Q(null), d = W({
1367
+ const e = new Lt(), i = Q(null), r = z({
1368
1368
  currentQuery: {},
1369
1369
  submitResolve: null
1370
- }), r = v(() => {
1371
- var u;
1370
+ }), d = v(() => {
1371
+ var f;
1372
1372
  const m = {};
1373
- if (!e.data.isEditMode || !d.currentQuery) return m;
1374
- for (const g of ((u = e.data.formConfig) == null ? void 0 : u.fields) || [])
1375
- d.currentQuery[g.field] !== void 0 && (m[g.field] = !0);
1373
+ if (!e.data.isEditMode || !r.currentQuery) return m;
1374
+ for (const p of ((f = e.data.formConfig) == null ? void 0 : f.fields) || [])
1375
+ r.currentQuery[p.field] !== void 0 && (m[p.field] = !0);
1376
1376
  return m;
1377
- }), c = v(() => {
1377
+ }), s = v(() => {
1378
1378
  var m;
1379
1379
  return ((m = e.data.formConfig) == null ? void 0 : m.layout) || {
1380
1380
  open: "dialog",
@@ -1382,39 +1382,39 @@ const Ft = /* @__PURE__ */ P({
1382
1382
  labelPosition: "top",
1383
1383
  buttonAlign: "right"
1384
1384
  };
1385
- }), s = v(() => {
1385
+ }), c = v(() => {
1386
1386
  var m;
1387
1387
  return ((m = e.data.formConfig) == null ? void 0 : m.fields) || [];
1388
1388
  }), a = v(() => {
1389
- var m, u;
1390
- return ((u = (m = e.data.formConfig) == null ? void 0 : m.meta) == null ? void 0 : u.title) || "表单";
1391
- }), i = v(() => c.value.buttonAlign || "right"), n = v(() => c.value.open === "normal"), f = {
1392
- async showForm(m, u) {
1393
- d.currentQuery = e.parseQuery(u || "");
1389
+ var m, f;
1390
+ return ((f = (m = e.data.formConfig) == null ? void 0 : m.meta) == null ? void 0 : f.title) || "表单";
1391
+ }), l = v(() => s.value.buttonAlign || "right"), n = v(() => s.value.open === "normal"), u = {
1392
+ async showForm(m, f) {
1393
+ r.currentQuery = e.parseQuery(f || "");
1394
1394
  try {
1395
- await e.openForm(m, u);
1396
- } catch (g) {
1397
- return U((g == null ? void 0 : g.message) || "打开表单失败"), null;
1395
+ await e.openForm(m, f);
1396
+ } catch (p) {
1397
+ return U((p == null ? void 0 : p.message) || "打开表单失败"), null;
1398
1398
  }
1399
- return new Promise((g) => {
1400
- d.submitResolve = g;
1399
+ return new Promise((p) => {
1400
+ r.submitResolve = p;
1401
1401
  });
1402
1402
  },
1403
1403
  async handleSubmit() {
1404
- var m, u;
1404
+ var m, f;
1405
1405
  try {
1406
- const g = await e.doSubmit(), p = ((u = (m = e.data.formConfig) == null ? void 0 : m.meta) == null ? void 0 : u.title) + "保存成功";
1407
- return z.success(p), d.submitResolve && (d.submitResolve(g), d.submitResolve = null), n.value || e.closeForm(), g;
1408
- } catch (g) {
1409
- return d.submitResolve && (d.submitResolve(null), d.submitResolve = null), g != null && g.message && g.message !== "请完善表单信息" && U(g.message), null;
1406
+ const p = await e.doSubmit(), h = ((f = (m = e.data.formConfig) == null ? void 0 : m.meta) == null ? void 0 : f.title) + "保存成功";
1407
+ return N.success(h), r.submitResolve && (r.submitResolve(p), r.submitResolve = null), n.value || e.closeForm(), p;
1408
+ } catch (p) {
1409
+ return r.submitResolve && (r.submitResolve(null), r.submitResolve = null), p != null && p.message && p.message !== "请完善表单信息" && U(p.message), null;
1410
1410
  }
1411
1411
  },
1412
1412
  // 结束等待:把 submitResolve 以 null 收尾(取消/关闭时调用,避免 Promise 永远悬挂)
1413
1413
  resolvePending() {
1414
- d.submitResolve && (d.submitResolve(null), d.submitResolve = null);
1414
+ r.submitResolve && (r.submitResolve(null), r.submitResolve = null);
1415
1415
  },
1416
1416
  handleCancel() {
1417
- n.value || (f.resolvePending(), e.closeForm());
1417
+ n.value || (u.resolvePending(), e.closeForm());
1418
1418
  },
1419
1419
  // 获取字段错误信息
1420
1420
  getFieldError(m) {
@@ -1422,7 +1422,7 @@ const Ft = /* @__PURE__ */ P({
1422
1422
  },
1423
1423
  // 关闭(点右上角 X / 遮罩):同样以 null 收尾再关闭
1424
1424
  handleClose() {
1425
- f.resolvePending(), e.closeForm();
1425
+ u.resolvePending(), e.closeForm();
1426
1426
  },
1427
1427
  // 退出动画播完:这时才真正清空表单配置/数据(见 ts/form-render.ts closeForm 的说明)
1428
1428
  handleClosed() {
@@ -1430,36 +1430,36 @@ const Ft = /* @__PURE__ */ P({
1430
1430
  }
1431
1431
  };
1432
1432
  return t({
1433
- showForm: f.showForm
1434
- }), (m, u) => {
1435
- const g = Oe, p = J;
1436
- return h(), S($t, {
1437
- visible: N(e).data.visible,
1438
- "onUpdate:visible": u[0] || (u[0] = (b) => N(e).data.visible = b),
1439
- layout: c.value,
1433
+ showForm: u.showForm
1434
+ }), (m, f) => {
1435
+ const p = Qe, h = J;
1436
+ return g(), S(Rt, {
1437
+ visible: W(e).data.visible,
1438
+ "onUpdate:visible": f[0] || (f[0] = (y) => W(e).data.visible = y),
1439
+ layout: s.value,
1440
1440
  title: a.value,
1441
- loading: N(e).data.loading,
1442
- onClose: f.handleClose,
1443
- onClosed: f.handleClosed
1441
+ loading: W(e).data.loading,
1442
+ onClose: u.handleClose,
1443
+ onClosed: u.handleClosed
1444
1444
  }, {
1445
1445
  actions: w(() => [
1446
- C("div", {
1447
- class: V(["form-actions", i.value === "right" ? "justify-end" : "justify-start"])
1446
+ x("div", {
1447
+ class: V(["form-actions", l.value === "right" ? "justify-end" : "justify-start"])
1448
1448
  }, [
1449
- _(p, {
1450
- onClick: f.handleCancel
1449
+ _(h, {
1450
+ onClick: u.handleCancel
1451
1451
  }, {
1452
- default: w(() => [...u[1] || (u[1] = [
1452
+ default: w(() => [...f[1] || (f[1] = [
1453
1453
  F("取消", -1)
1454
1454
  ])]),
1455
1455
  _: 1
1456
1456
  }, 8, ["onClick"]),
1457
- _(p, {
1457
+ _(h, {
1458
1458
  type: "primary",
1459
- loading: N(e).data.submitting,
1460
- onClick: f.handleSubmit
1459
+ loading: W(e).data.submitting,
1460
+ onClick: u.handleSubmit
1461
1461
  }, {
1462
- default: w(() => [...u[2] || (u[2] = [
1462
+ default: w(() => [...f[2] || (f[2] = [
1463
1463
  F("提交", -1)
1464
1464
  ])]),
1465
1465
  _: 1
@@ -1467,25 +1467,25 @@ const Ft = /* @__PURE__ */ P({
1467
1467
  ], 2)
1468
1468
  ]),
1469
1469
  default: w(() => [
1470
- _(g, {
1470
+ _(p, {
1471
1471
  ref_key: "formRef",
1472
- ref: l,
1472
+ ref: i,
1473
1473
  class: "form-render",
1474
1474
  "label-position": "top"
1475
1475
  }, {
1476
1476
  default: w(() => [
1477
- _(At, {
1478
- fields: s.value,
1479
- layout: c.value
1477
+ _(Et, {
1478
+ fields: c.value,
1479
+ layout: s.value
1480
1480
  }, {
1481
- default: w(({ field: b }) => [
1482
- _(Et, {
1483
- modelValue: N(e).data.formData[b.field],
1484
- "onUpdate:modelValue": (R) => N(e).data.formData[b.field] = R,
1485
- field: b,
1486
- layout: c.value,
1487
- disabled: r.value[b.field],
1488
- error: f.getFieldError(b.field)
1481
+ default: w(({ field: y }) => [
1482
+ _(Bt, {
1483
+ modelValue: W(e).data.formData[y.field],
1484
+ "onUpdate:modelValue": (A) => W(e).data.formData[y.field] = A,
1485
+ field: y,
1486
+ layout: s.value,
1487
+ disabled: d.value[y.field],
1488
+ error: u.getFieldError(y.field)
1489
1489
  }, null, 8, ["modelValue", "onUpdate:modelValue", "field", "layout", "disabled", "error"])
1490
1490
  ]),
1491
1491
  _: 1
@@ -1498,8 +1498,8 @@ const Ft = /* @__PURE__ */ P({
1498
1498
  }, 8, ["visible", "layout", "title", "loading", "onClose", "onClosed"]);
1499
1499
  };
1500
1500
  }
1501
- }), Ae = /* @__PURE__ */ $(Ft, [["__scopeId", "data-v-b3267c00"]]);
1502
- class Lt {
1501
+ }), Ee = /* @__PURE__ */ $(Nt, [["__scopeId", "data-v-b3267c00"]]);
1502
+ class Wt {
1503
1503
  constructor(t) {
1504
1504
  this.config = t;
1505
1505
  }
@@ -1507,24 +1507,24 @@ class Lt {
1507
1507
  * 获取列表数据
1508
1508
  */
1509
1509
  async fetchList(t, e) {
1510
- const l = {
1510
+ const i = {
1511
1511
  page: e.page,
1512
1512
  pageSize: e.pageSize,
1513
1513
  ...t
1514
- }, d = {};
1515
- for (const a in l) {
1516
- const i = l[a];
1517
- i !== "" && i !== null && i !== void 0 && (d[a] = i);
1514
+ }, r = {};
1515
+ for (const a in i) {
1516
+ const l = i[a];
1517
+ l !== "" && l !== null && l !== void 0 && (r[a] = l);
1518
1518
  }
1519
- const r = new URLSearchParams();
1520
- for (const a in d)
1521
- r.append(a, String(d[a]));
1522
- const c = `${this.config.api.list}${r.toString() ? "?" + r.toString() : ""}`, s = await M.get(c);
1523
- if (s.status === 200) {
1524
- const a = s.data;
1519
+ const d = new URLSearchParams();
1520
+ for (const a in r)
1521
+ d.append(a, String(r[a]));
1522
+ const s = `${this.config.api.list}${d.toString() ? "?" + d.toString() : ""}`, c = await E.get(s);
1523
+ if (c.status === 200) {
1524
+ const a = c.data;
1525
1525
  return Array.isArray(a) ? { rows: a, total: a.length } : a || { rows: [], total: 0 };
1526
1526
  }
1527
- throw new Error(s.message || "获取列表数据失败");
1527
+ throw new Error(c.message || "获取列表数据失败");
1528
1528
  }
1529
1529
  /**
1530
1530
  * 删除单行
@@ -1532,9 +1532,9 @@ class Lt {
1532
1532
  async deleteRow(t) {
1533
1533
  if (!this.config.api.delete)
1534
1534
  throw new Error("未配置删除API");
1535
- const e = this.config.key || "id", l = t[e], d = `${this.config.api.delete}?${encodeURIComponent(e)}=${encodeURIComponent(String(l ?? ""))}`, r = await M.post(d);
1536
- if (r.status !== 200)
1537
- throw new Error(r.message || "删除失败");
1535
+ const e = this.config.key || "id", i = t[e], r = `${this.config.api.delete}?${encodeURIComponent(e)}=${encodeURIComponent(String(i ?? ""))}`, d = await E.post(r);
1536
+ if (d.status !== 200)
1537
+ throw new Error(d.message || "删除失败");
1538
1538
  }
1539
1539
  /**
1540
1540
  * 批量删除
@@ -1542,7 +1542,7 @@ class Lt {
1542
1542
  async batchDelete(t) {
1543
1543
  if (!this.config.api.delete)
1544
1544
  throw new Error("未配置删除API");
1545
- const e = await M.post(this.config.api.delete, t);
1545
+ const e = await E.post(this.config.api.delete, t);
1546
1546
  if (e.status !== 200)
1547
1547
  throw new Error(e.message || "批量删除失败");
1548
1548
  }
@@ -1552,10 +1552,10 @@ class Lt {
1552
1552
  async exportData(t) {
1553
1553
  if (!this.config.api.export)
1554
1554
  throw new Error("未配置导出API");
1555
- const l = (await M.post(this.config.api.export, t, {
1555
+ const i = (await E.post(this.config.api.export, t, {
1556
1556
  responseType: "blob"
1557
- })).data, d = window.URL.createObjectURL(l), r = document.createElement("a");
1558
- r.href = d, r.download = `export_${Date.now()}.xlsx`, r.click(), window.URL.revokeObjectURL(d);
1557
+ })).data, r = window.URL.createObjectURL(i), d = document.createElement("a");
1558
+ d.href = r, d.download = `export_${Date.now()}.xlsx`, d.click(), window.URL.revokeObjectURL(r);
1559
1559
  }
1560
1560
  /**
1561
1561
  * 下载导入模板
@@ -1563,10 +1563,10 @@ class Lt {
1563
1563
  async downloadTemplate() {
1564
1564
  if (!this.config.api.import)
1565
1565
  throw new Error("未配置导入API");
1566
- const e = (await M.get(`${this.config.api.import}/template`, {
1566
+ const e = (await E.get(`${this.config.api.import}/template`, {
1567
1567
  responseType: "blob"
1568
- })).data, l = window.URL.createObjectURL(e), d = document.createElement("a");
1569
- d.href = l, d.download = `template_${Date.now()}.xlsx`, d.click(), window.URL.revokeObjectURL(l);
1568
+ })).data, i = window.URL.createObjectURL(e), r = document.createElement("a");
1569
+ r.href = i, r.download = `template_${Date.now()}.xlsx`, r.click(), window.URL.revokeObjectURL(i);
1570
1570
  }
1571
1571
  /**
1572
1572
  * 导入数据
@@ -1576,70 +1576,70 @@ class Lt {
1576
1576
  throw new Error("未配置导入API");
1577
1577
  const e = new FormData();
1578
1578
  e.append("file", t);
1579
- const l = await M.post(this.config.api.import, e, {
1579
+ const i = await E.post(this.config.api.import, e, {
1580
1580
  headers: {
1581
1581
  "Content-Type": "multipart/form-data"
1582
1582
  }
1583
1583
  });
1584
- if (l.status !== 200)
1585
- throw new Error(l.message || "导入失败");
1586
- return l.data;
1584
+ if (i.status !== 200)
1585
+ throw new Error(i.message || "导入失败");
1586
+ return i.data;
1587
1587
  }
1588
1588
  }
1589
1589
  class zt {
1590
1590
  constructor() {
1591
- x(this, "tableConfig", null);
1592
- x(this, "rows", []);
1593
- x(this, "total", 0);
1594
- x(this, "loading", !1);
1595
- x(this, "searchParams", {});
1596
- x(this, "pagination", { page: 1, pageSize: 20 });
1591
+ C(this, "tableConfig", null);
1592
+ C(this, "rows", []);
1593
+ C(this, "total", 0);
1594
+ C(this, "loading", !1);
1595
+ C(this, "searchParams", {});
1596
+ C(this, "pagination", { page: 1, pageSize: 20 });
1597
1597
  // 当前行:点击某行后即为当前行,toolbar 上的 edit / delete / preview 作用于它
1598
- x(this, "currentRow", null);
1599
- x(this, "detailVisible", !1);
1600
- x(this, "detailData", null);
1601
- x(this, "detailLoading", !1);
1598
+ C(this, "currentRow", null);
1599
+ C(this, "detailVisible", !1);
1600
+ C(this, "detailData", null);
1601
+ C(this, "detailLoading", !1);
1602
1602
  // 预览抽屉(action: preview 触发,独立于 detail 配置)
1603
1603
  // previewVisible —— 显隐(交给 el-drawer 的 :model-value)
1604
1604
  // previewMounted —— 是否挂载。打开时置 true;退场动画播完(@closed)才置 false。
1605
1605
  // 为什么要两个:抽屉**只在打开时挂载**(省 DOM),但挂载开关不能跟着显隐一起变,
1606
1606
  // 否则关闭瞬间组件就被卸载,el-drawer 的退场动画没机会播(见 closePreview 注释)。
1607
- x(this, "previewVisible", !1);
1608
- x(this, "previewMounted", !1);
1609
- x(this, "previewRow", null);
1607
+ C(this, "previewVisible", !1);
1608
+ C(this, "previewMounted", !1);
1609
+ C(this, "previewRow", null);
1610
1610
  }
1611
1611
  }
1612
- let Nt = class {
1612
+ let qt = class {
1613
1613
  constructor() {
1614
1614
  // 响应式数据
1615
- x(this, "data", W(new zt()));
1615
+ C(this, "data", z(new zt()));
1616
1616
  // 数据服务
1617
- x(this, "dataService", null);
1617
+ C(this, "dataService", null);
1618
1618
  }
1619
1619
  /**
1620
1620
  * 加载表格配置
1621
1621
  */
1622
1622
  async loadConfig(t) {
1623
- var d;
1623
+ var r;
1624
1624
  const e = K.formCfgApi(t, "tables");
1625
1625
  console.log("load config url =", e);
1626
- const l = await M.get(e);
1627
- if (console.log("---"), l.status !== 200)
1628
- throw new Error(l.message || "获取表格配置失败");
1629
- this.data.tableConfig = l.data, this.dataService = new Lt(l.data), this.data.currentRow = null, this.data.detailVisible = !1, this.data.detailData = null, this.data.previewVisible = !1, this.data.previewMounted = !1, this.data.previewRow = null, typeof console < "u" && console.log("[TableRender] loadConfig:", {
1626
+ const i = await E.get(e);
1627
+ if (console.log("---"), i.status !== 200)
1628
+ throw new Error(i.message || "获取表格配置失败");
1629
+ this.data.tableConfig = i.data, this.dataService = new Wt(i.data), this.data.currentRow = null, this.data.detailVisible = !1, this.data.detailData = null, this.data.previewVisible = !1, this.data.previewMounted = !1, this.data.previewRow = null, typeof console < "u" && console.log("[TableRender] loadConfig:", {
1630
1630
  tableId: t,
1631
1631
  hasDetail: this.hasDetail(),
1632
- detail: (d = this.data.tableConfig) == null ? void 0 : d.detail
1632
+ detail: (r = this.data.tableConfig) == null ? void 0 : r.detail
1633
1633
  }), this.initSearchParams();
1634
1634
  }
1635
1635
  /**
1636
1636
  * 初始化搜索参数
1637
1637
  */
1638
1638
  initSearchParams() {
1639
- var l;
1640
- const t = {}, e = ((l = this.data.tableConfig) == null ? void 0 : l.search) || [];
1641
- for (const d of e)
1642
- t[d.field] = "";
1639
+ var i;
1640
+ const t = {}, e = ((i = this.data.tableConfig) == null ? void 0 : i.search) || [];
1641
+ for (const r of e)
1642
+ t[r.field] = "";
1643
1643
  this.data.searchParams = t;
1644
1644
  }
1645
1645
  /**
@@ -1666,8 +1666,8 @@ let Nt = class {
1666
1666
  syncRowRefs() {
1667
1667
  const { currentRow: t, detailData: e } = this.data;
1668
1668
  if (!t && !e) return;
1669
- const l = this.getKeyField(), d = (r) => r && this.data.rows.find((c) => c[l] === r[l]) || null;
1670
- this.data.currentRow = d(t), this.data.detailData && (this.data.detailData = d(this.data.detailData), this.data.detailData || (this.data.detailVisible = !1));
1669
+ const i = this.getKeyField(), r = (d) => d && this.data.rows.find((s) => s[i] === d[i]) || null;
1670
+ this.data.currentRow = r(t), this.data.detailData && (this.data.detailData = r(this.data.detailData), this.data.detailData || (this.data.detailVisible = !1));
1671
1671
  }
1672
1672
  /**
1673
1673
  * 搜索
@@ -1817,8 +1817,8 @@ let Nt = class {
1817
1817
  * 详情宽度:数字按 px 处理,字符串原样使用,默认 400px
1818
1818
  */
1819
1819
  getDetailWidth() {
1820
- var e, l;
1821
- const t = (l = (e = this.data.tableConfig) == null ? void 0 : e.detail) == null ? void 0 : l.width;
1820
+ var e, i;
1821
+ const t = (i = (e = this.data.tableConfig) == null ? void 0 : e.detail) == null ? void 0 : i.width;
1822
1822
  return typeof t == "number" && t > 0 ? `${t}px` : typeof t == "string" && t ? t : "400px";
1823
1823
  }
1824
1824
  /**
@@ -1949,7 +1949,7 @@ let Nt = class {
1949
1949
  return ((t = this.data.tableConfig) == null ? void 0 : t.pagination) || "page";
1950
1950
  }
1951
1951
  };
1952
- const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { class: "search-actions" }, Ot = /* @__PURE__ */ P({
1952
+ const Ot = { class: "table-search" }, jt = { class: "search-fields" }, Yt = { class: "search-actions" }, Qt = /* @__PURE__ */ P({
1953
1953
  __name: "TableSearch",
1954
1954
  props: {
1955
1955
  fields: {},
@@ -1957,87 +1957,87 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
1957
1957
  },
1958
1958
  emits: ["update:modelValue", "search", "reset"],
1959
1959
  setup(o, { emit: t }) {
1960
- const e = o, l = t, d = {
1960
+ const e = o, i = t, r = {
1961
1961
  input: te,
1962
1962
  dict: ee,
1963
1963
  dept: ee,
1964
1964
  role: ee,
1965
1965
  date: de,
1966
1966
  daterange: de
1967
- }, r = {
1967
+ }, d = {
1968
1968
  // 组件映射
1969
- getComponent(c) {
1970
- return d[c] || te;
1969
+ getComponent(s) {
1970
+ return r[s] || te;
1971
1971
  },
1972
1972
  // 更新搜索值
1973
- updateValue(c, s) {
1974
- const a = { ...e.modelValue, [c]: s };
1975
- l("update:modelValue", a);
1973
+ updateValue(s, c) {
1974
+ const a = { ...e.modelValue, [s]: c };
1975
+ i("update:modelValue", a);
1976
1976
  },
1977
1977
  // 搜索(查询字段值自动去除首尾空格)
1978
1978
  handleSearch() {
1979
- const c = {};
1980
- for (const s in e.modelValue) {
1981
- const a = e.modelValue[s];
1982
- c[s] = typeof a == "string" ? a.trim() : a;
1979
+ const s = {};
1980
+ for (const c in e.modelValue) {
1981
+ const a = e.modelValue[c];
1982
+ s[c] = typeof a == "string" ? a.trim() : a;
1983
1983
  }
1984
- l("update:modelValue", c), l("search");
1984
+ i("update:modelValue", s), i("search");
1985
1985
  },
1986
1986
  // 重置
1987
1987
  handleReset() {
1988
- l("reset");
1988
+ i("reset");
1989
1989
  }
1990
1990
  };
1991
- return (c, s) => {
1991
+ return (s, c) => {
1992
1992
  const a = J;
1993
- return h(), y("div", Wt, [
1994
- C("div", qt, [
1995
- (h(!0), y(I, null, E(e.fields, (i) => (h(), y("div", {
1996
- key: i.field,
1993
+ return g(), b("div", Ot, [
1994
+ x("div", jt, [
1995
+ (g(!0), b(I, null, M(e.fields, (l) => (g(), b("div", {
1996
+ key: l.field,
1997
1997
  class: "search-field"
1998
1998
  }, [
1999
- (h(), S(H(r.getComponent(i.type)), {
2000
- "model-value": e.modelValue[i.field],
2001
- "field-label": i.label,
2002
- "dict-type": i.dictType,
2003
- mode: i.type === "daterange" ? "range" : void 0,
1999
+ (g(), S(G(d.getComponent(l.type)), {
2000
+ "model-value": e.modelValue[l.field],
2001
+ "field-label": l.label,
2002
+ "dict-type": l.dictType,
2003
+ mode: l.type === "daterange" ? "range" : void 0,
2004
2004
  "label-position": "left",
2005
- "onUpdate:modelValue": (n) => r.updateValue(i.field, n)
2005
+ "onUpdate:modelValue": (n) => d.updateValue(l.field, n)
2006
2006
  }, null, 8, ["model-value", "field-label", "dict-type", "mode", "onUpdate:modelValue"]))
2007
2007
  ]))), 128)),
2008
- T(c.$slots, "search-extra", {
2008
+ k(s.$slots, "search-extra", {
2009
2009
  params: e.modelValue,
2010
- update: r.updateValue
2010
+ update: d.updateValue
2011
2011
  }, void 0, !0)
2012
2012
  ]),
2013
- C("div", jt, [
2013
+ x("div", Yt, [
2014
2014
  _(a, {
2015
2015
  type: "primary",
2016
- onClick: r.handleSearch
2016
+ onClick: d.handleSearch
2017
2017
  }, {
2018
- default: w(() => [...s[0] || (s[0] = [
2018
+ default: w(() => [...c[0] || (c[0] = [
2019
2019
  F("查询", -1)
2020
2020
  ])]),
2021
2021
  _: 1
2022
2022
  }, 8, ["onClick"]),
2023
2023
  _(a, {
2024
- onClick: r.handleReset
2024
+ onClick: d.handleReset
2025
2025
  }, {
2026
- default: w(() => [...s[1] || (s[1] = [
2026
+ default: w(() => [...c[1] || (c[1] = [
2027
2027
  F("重置", -1)
2028
2028
  ])]),
2029
2029
  _: 1
2030
2030
  }, 8, ["onClick"]),
2031
- T(c.$slots, "search-actions", {
2031
+ k(s.$slots, "search-actions", {
2032
2032
  params: e.modelValue,
2033
- search: r.handleSearch,
2034
- reset: r.handleReset
2033
+ search: d.handleSearch,
2034
+ reset: d.handleReset
2035
2035
  }, void 0, !0)
2036
2036
  ])
2037
2037
  ]);
2038
2038
  };
2039
2039
  }
2040
- }), Yt = /* @__PURE__ */ $(Ot, [["__scopeId", "data-v-09e61a77"]]), Qt = { class: "table-toolbar" }, Kt = { class: "toolbar-items" }, Ht = { key: 1 }, Gt = /* @__PURE__ */ P({
2040
+ }), Kt = /* @__PURE__ */ $(Qt, [["__scopeId", "data-v-0281d2ce"]]), Ht = { class: "table-toolbar" }, Gt = { class: "toolbar-items" }, Jt = { key: 1 }, Xt = /* @__PURE__ */ P({
2041
2041
  __name: "TableToolbar",
2042
2042
  props: {
2043
2043
  items: {},
@@ -2045,99 +2045,99 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2045
2045
  },
2046
2046
  emits: ["action"],
2047
2047
  setup(o, { emit: t }) {
2048
- const e = o, l = t, d = W({
2048
+ const e = o, i = t, r = z({
2049
2049
  // 图标组件缓存(@element-plus/icons-vue 按需加载)
2050
2050
  iconMap: {}
2051
- }), r = v(() => ({
2051
+ }), d = v(() => ({
2052
2052
  // 是否有当前行
2053
2053
  hasCurrentRow: !!e.currentRow
2054
- })), c = {
2054
+ })), s = {
2055
2055
  // 需要目标行的动作
2056
- needRow(s) {
2057
- return s === "edit" || s === "delete" || s === "preview";
2056
+ needRow(c) {
2057
+ return c === "edit" || c === "delete" || c === "preview";
2058
2058
  },
2059
2059
  // 按钮文字:不写按 action 取默认
2060
- getText(s) {
2061
- return s.text ? s.text : {
2060
+ getText(c) {
2061
+ return c.text ? c.text : {
2062
2062
  add: "新增",
2063
2063
  edit: "编辑",
2064
2064
  delete: "删除",
2065
2065
  preview: "预览",
2066
2066
  back: "返回"
2067
- }[s.action] || "";
2067
+ }[c.action] || "";
2068
2068
  },
2069
2069
  // 按钮样式:直接作为 el-button 的 type
2070
- getButtonType(s) {
2071
- return s.style ? s.style === "default" ? "" : s.style : {
2070
+ getButtonType(c) {
2071
+ return c.style ? c.style === "default" ? "" : c.style : {
2072
2072
  add: "primary",
2073
2073
  edit: "primary",
2074
2074
  delete: "danger",
2075
2075
  preview: "primary",
2076
2076
  back: "primary"
2077
- }[s.action] || "";
2077
+ }[c.action] || "";
2078
2078
  },
2079
2079
  // 是否禁用
2080
- isDisabled(s) {
2081
- return s.disabled ? !0 : c.needRow(s.action) && !r.value.hasCurrentRow;
2080
+ isDisabled(c) {
2081
+ return c.disabled ? !0 : s.needRow(c.action) && !d.value.hasCurrentRow;
2082
2082
  },
2083
2083
  // 图标组件
2084
- getIcon(s) {
2085
- return s.icon ? d.iconMap[s.icon] : null;
2084
+ getIcon(c) {
2085
+ return c.icon ? r.iconMap[c.icon] : null;
2086
2086
  },
2087
2087
  // 点击按钮:把 action 抛给父组件
2088
- handleClick(s) {
2089
- l("action", {
2090
- action: s.action,
2091
- item: s,
2088
+ handleClick(c) {
2089
+ i("action", {
2090
+ action: c.action,
2091
+ item: c,
2092
2092
  row: e.currentRow
2093
2093
  });
2094
2094
  },
2095
2095
  // 按需加载图标(避免整包图标进产物)
2096
2096
  async ensureIcons() {
2097
- const s = [...new Set(e.items.map((n) => n.icon).filter(Boolean))];
2098
- if (s.length === 0) return;
2099
- const a = await import("@element-plus/icons-vue"), i = { ...d.iconMap };
2100
- for (const n of s)
2101
- a[n] && (i[n] = re(a[n]));
2102
- d.iconMap = re(i);
2097
+ const c = [...new Set(e.items.map((n) => n.icon).filter(Boolean))];
2098
+ if (c.length === 0) return;
2099
+ const a = await import("@element-plus/icons-vue"), l = { ...r.iconMap };
2100
+ for (const n of c)
2101
+ a[n] && (l[n] = re(a[n]));
2102
+ r.iconMap = re(l);
2103
2103
  }
2104
2104
  };
2105
2105
  return oe(() => {
2106
- c.ensureIcons();
2106
+ s.ensureIcons();
2107
2107
  }), L(() => e.items, () => {
2108
- c.ensureIcons();
2109
- }), (s, a) => {
2110
- const i = ge, n = J;
2111
- return h(), y("div", Qt, [
2112
- T(s.$slots, "toolbar-left", {
2108
+ s.ensureIcons();
2109
+ }), (c, a) => {
2110
+ const l = ye, n = J;
2111
+ return g(), b("div", Ht, [
2112
+ k(c.$slots, "toolbar-left", {
2113
2113
  currentRow: e.currentRow
2114
2114
  }, void 0, !0),
2115
- C("div", Kt, [
2116
- (h(!0), y(I, null, E(e.items, (f, m) => (h(), S(n, {
2115
+ x("div", Gt, [
2116
+ (g(!0), b(I, null, M(e.items, (u, m) => (g(), S(n, {
2117
2117
  key: m,
2118
- type: c.getButtonType(f),
2119
- disabled: c.isDisabled(f),
2120
- onClick: (u) => c.handleClick(f)
2118
+ type: s.getButtonType(u),
2119
+ disabled: s.isDisabled(u),
2120
+ onClick: (f) => s.handleClick(u)
2121
2121
  }, {
2122
2122
  default: w(() => [
2123
- c.getIcon(f) ? (h(), S(i, { key: 0 }, {
2123
+ s.getIcon(u) ? (g(), S(l, { key: 0 }, {
2124
2124
  default: w(() => [
2125
- (h(), S(H(c.getIcon(f))))
2125
+ (g(), S(G(s.getIcon(u))))
2126
2126
  ]),
2127
2127
  _: 2
2128
2128
  }, 1024)) : D("", !0),
2129
- c.getText(f) ? (h(), y("span", Ht, k(c.getText(f)), 1)) : D("", !0)
2129
+ s.getText(u) ? (g(), b("span", Jt, T(s.getText(u)), 1)) : D("", !0)
2130
2130
  ]),
2131
2131
  _: 2
2132
2132
  }, 1032, ["type", "disabled", "onClick"]))), 128))
2133
2133
  ]),
2134
- T(s.$slots, "toolbar-extra", {
2134
+ k(c.$slots, "toolbar-extra", {
2135
2135
  currentRow: e.currentRow
2136
2136
  }, void 0, !0)
2137
2137
  ]);
2138
2138
  };
2139
2139
  }
2140
- }), Jt = /* @__PURE__ */ $(Gt, [["__scopeId", "data-v-8f722515"]]), Xt = /* @__PURE__ */ P({
2140
+ }), Zt = /* @__PURE__ */ $(Xt, [["__scopeId", "data-v-0538c013"]]), ea = /* @__PURE__ */ P({
2141
2141
  __name: "UInputShow",
2142
2142
  props: {
2143
2143
  modelValue: {},
@@ -2145,20 +2145,20 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2145
2145
  maxLines: { default: 0 }
2146
2146
  },
2147
2147
  setup(o) {
2148
- const t = o, e = v(() => t.modelValue === null || t.modelValue === void 0 ? "" : String(t.modelValue)), l = v(() => t.multiline || e.value.includes(`
2149
- `)), d = v(() => t.maxLines > 0 && l.value ? {
2148
+ const t = o, e = v(() => t.modelValue === null || t.modelValue === void 0 ? "" : String(t.modelValue)), i = v(() => t.multiline || e.value.includes(`
2149
+ `)), r = v(() => t.maxLines > 0 && i.value ? {
2150
2150
  display: "-webkit-box",
2151
2151
  WebkitLineClamp: t.maxLines,
2152
2152
  WebkitBoxOrient: "vertical",
2153
2153
  overflow: "hidden",
2154
2154
  textOverflow: "ellipsis"
2155
2155
  } : {});
2156
- return (r, c) => (h(), y("div", {
2157
- class: V(["u-input-show", { "u-input-multiline": l.value }]),
2158
- style: B(d.value)
2159
- }, k(e.value), 7));
2156
+ return (d, s) => (g(), b("div", {
2157
+ class: V(["u-input-show", { "u-input-multiline": i.value }]),
2158
+ style: B(r.value)
2159
+ }, T(e.value), 7));
2160
2160
  }
2161
- }), Zt = /* @__PURE__ */ $(Xt, [["__scopeId", "data-v-c78b151e"]]), ea = /* @__PURE__ */ P({
2161
+ }), ta = /* @__PURE__ */ $(ea, [["__scopeId", "data-v-c78b151e"]]), aa = /* @__PURE__ */ P({
2162
2162
  __name: "UDictShow",
2163
2163
  props: {
2164
2164
  modelValue: {},
@@ -2166,7 +2166,7 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2166
2166
  defaultText: { default: "" }
2167
2167
  },
2168
2168
  setup(o) {
2169
- const t = o, e = Q(""), l = Q(!1), d = async () => {
2169
+ const t = o, e = Q(""), i = Q(!1), r = async () => {
2170
2170
  if (t.modelValue === null || t.modelValue === void 0 || t.modelValue === "") {
2171
2171
  e.value = t.defaultText;
2172
2172
  return;
@@ -2175,25 +2175,25 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2175
2175
  e.value = String(t.modelValue);
2176
2176
  return;
2177
2177
  }
2178
- l.value = !0;
2178
+ i.value = !0;
2179
2179
  try {
2180
- const r = await lt(t.dictType, t.modelValue, t.defaultText);
2181
- e.value = r;
2182
- } catch (r) {
2183
- console.error("[UDictShow] 翻译失败:", r), e.value = String(t.modelValue);
2180
+ const d = await it(t.dictType, t.modelValue, t.defaultText);
2181
+ e.value = d;
2182
+ } catch (d) {
2183
+ console.error("[UDictShow] 翻译失败:", d), e.value = String(t.modelValue);
2184
2184
  } finally {
2185
- l.value = !1;
2185
+ i.value = !1;
2186
2186
  }
2187
2187
  };
2188
- return L(() => t.modelValue, d, { immediate: !0 }), L(() => t.dictType, () => {
2189
- t.dictType && ae(t.dictType).then(() => d());
2188
+ return L(() => t.modelValue, r, { immediate: !0 }), L(() => t.dictType, () => {
2189
+ t.dictType && ae(t.dictType).then(() => r());
2190
2190
  }), oe(() => {
2191
- t.dictType ? ae(t.dictType).then(() => d()) : d();
2192
- }), (r, c) => (h(), y("div", {
2193
- class: V(["u-dict-show", { "u-dict-loading": l.value }])
2194
- }, k(e.value), 3));
2191
+ t.dictType ? ae(t.dictType).then(() => r()) : r();
2192
+ }), (d, s) => (g(), b("div", {
2193
+ class: V(["u-dict-show", { "u-dict-loading": i.value }])
2194
+ }, T(e.value), 3));
2195
2195
  }
2196
- }), ta = /* @__PURE__ */ $(ea, [["__scopeId", "data-v-908045c4"]]), aa = /* @__PURE__ */ P({
2196
+ }), oa = /* @__PURE__ */ $(aa, [["__scopeId", "data-v-908045c4"]]), la = /* @__PURE__ */ P({
2197
2197
  __name: "UToggleShow",
2198
2198
  props: {
2199
2199
  modelValue: {},
@@ -2202,12 +2202,12 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2202
2202
  useYesNo: { type: Boolean, default: !1 }
2203
2203
  },
2204
2204
  setup(o) {
2205
- const t = o, e = v(() => t.useYesNo ? "是" : t.trueText), l = v(() => t.useYesNo ? "否" : t.falseText), d = v(() => t.modelValue === !0 || t.modelValue === "true" ? e.value : t.modelValue === !1 || t.modelValue === "false" ? l.value : String(t.modelValue ?? "")), r = v(() => t.modelValue === !0 || t.modelValue === "true" ? "toggle-true" : t.modelValue === !1 || t.modelValue === "false" ? "toggle-false" : "toggle-default");
2206
- return (c, s) => (h(), y("div", {
2207
- class: V(["u-toggle-show", r.value])
2208
- }, k(d.value), 3));
2205
+ const t = o, e = v(() => t.useYesNo ? "是" : t.trueText), i = v(() => t.useYesNo ? "否" : t.falseText), r = v(() => t.modelValue === !0 || t.modelValue === "true" ? e.value : t.modelValue === !1 || t.modelValue === "false" ? i.value : String(t.modelValue ?? "")), d = v(() => t.modelValue === !0 || t.modelValue === "true" ? "toggle-true" : t.modelValue === !1 || t.modelValue === "false" ? "toggle-false" : "toggle-default");
2206
+ return (s, c) => (g(), b("div", {
2207
+ class: V(["u-toggle-show", d.value])
2208
+ }, T(r.value), 3));
2209
2209
  }
2210
- }), oa = /* @__PURE__ */ $(aa, [["__scopeId", "data-v-bac05efc"]]), la = /* @__PURE__ */ P({
2210
+ }), na = /* @__PURE__ */ $(la, [["__scopeId", "data-v-bac05efc"]]), ia = /* @__PURE__ */ P({
2211
2211
  __name: "UCascaderShow",
2212
2212
  props: {
2213
2213
  modelValue: {},
@@ -2216,35 +2216,35 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2216
2216
  showRawValue: { type: Boolean, default: !0 }
2217
2217
  },
2218
2218
  setup(o) {
2219
- const t = o, e = Q(""), l = Q(!1), d = async () => {
2219
+ const t = o, e = Q(""), i = Q(!1), r = async () => {
2220
2220
  if (!t.modelValue || !Array.isArray(t.modelValue)) {
2221
2221
  e.value = "";
2222
2222
  return;
2223
2223
  }
2224
- const r = t.modelValue;
2224
+ const d = t.modelValue;
2225
2225
  if (t.cascaderKey) {
2226
- l.value = !0;
2226
+ i.value = !0;
2227
2227
  try {
2228
- const c = await ae(t.cascaderKey), a = r.map((i) => {
2229
- const n = c.find((f) => f.value === i || String(f.value) === String(i));
2230
- return n ? n.label : t.showRawValue ? String(i) : "";
2231
- }).filter((i) => i !== "");
2228
+ const s = await ae(t.cascaderKey), a = d.map((l) => {
2229
+ const n = s.find((u) => u.value === l || String(u.value) === String(l));
2230
+ return n ? n.label : t.showRawValue ? String(l) : "";
2231
+ }).filter((l) => l !== "");
2232
2232
  e.value = a.join(t.separator);
2233
- } catch (c) {
2234
- console.error("[UCascaderShow] 翻译失败:", c), e.value = t.showRawValue ? r.join(t.separator) : "";
2233
+ } catch (s) {
2234
+ console.error("[UCascaderShow] 翻译失败:", s), e.value = t.showRawValue ? d.join(t.separator) : "";
2235
2235
  } finally {
2236
- l.value = !1;
2236
+ i.value = !1;
2237
2237
  }
2238
2238
  } else
2239
- e.value = r.join(t.separator);
2239
+ e.value = d.join(t.separator);
2240
2240
  };
2241
- return L(() => t.modelValue, d, { immediate: !0 }), oe(() => {
2242
- d();
2243
- }), (r, c) => (h(), y("div", {
2244
- class: V(["u-cascader-show", { "u-cascader-loading": l.value }])
2245
- }, k(e.value), 3));
2241
+ return L(() => t.modelValue, r, { immediate: !0 }), oe(() => {
2242
+ r();
2243
+ }), (d, s) => (g(), b("div", {
2244
+ class: V(["u-cascader-show", { "u-cascader-loading": i.value }])
2245
+ }, T(e.value), 3));
2246
2246
  }
2247
- }), na = /* @__PURE__ */ $(la, [["__scopeId", "data-v-5d84df67"]]), ia = /* @__PURE__ */ P({
2247
+ }), sa = /* @__PURE__ */ $(ia, [["__scopeId", "data-v-5d84df67"]]), ra = /* @__PURE__ */ P({
2248
2248
  __name: "UDateShow",
2249
2249
  props: {
2250
2250
  modelValue: {},
@@ -2255,19 +2255,19 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2255
2255
  rangeSeparator: { default: " ~ " }
2256
2256
  },
2257
2257
  setup(o) {
2258
- const t = o, e = v(() => t.locale === "en-US" ? t.mode === "range" ? " - " : ", " : t.mode === "range" ? t.rangeSeparator : t.separator), l = v(() => {
2259
- const c = t.modelValue;
2260
- return t.mode === "single" ? c ? d(c, t.format) : "" : t.mode === "multiple" ? c ? Array.isArray(c) ? c.map((s) => d(s, t.format)).join(e.value) : String(c) : "" : t.mode === "range" ? c ? typeof c == "object" && c.from && c.to ? `${d(c.from, t.format)}${e.value}${d(c.to, t.format)}` : Array.isArray(c) && c.length >= 2 ? `${d(c[0], t.format)}${e.value}${d(c[1], t.format)}` : String(c) : "" : String(c ?? "");
2258
+ const t = o, e = v(() => t.locale === "en-US" ? t.mode === "range" ? " - " : ", " : t.mode === "range" ? t.rangeSeparator : t.separator), i = v(() => {
2259
+ const s = t.modelValue;
2260
+ return t.mode === "single" ? s ? r(s, t.format) : "" : t.mode === "multiple" ? s ? Array.isArray(s) ? s.map((c) => r(c, t.format)).join(e.value) : String(s) : "" : t.mode === "range" ? s ? typeof s == "object" && s.from && s.to ? `${r(s.from, t.format)}${e.value}${r(s.to, t.format)}` : Array.isArray(s) && s.length >= 2 ? `${r(s[0], t.format)}${e.value}${r(s[1], t.format)}` : String(s) : "" : String(s ?? "");
2261
2261
  });
2262
- function d(c, s) {
2263
- return c || "";
2262
+ function r(s, c) {
2263
+ return s || "";
2264
2264
  }
2265
- const r = v(() => !l.value);
2266
- return (c, s) => (h(), y("div", {
2267
- class: V(["u-date-show", { "u-date-empty": r.value }])
2268
- }, k(l.value || (o.locale === "en-US" ? "Empty" : "暂无")), 3));
2265
+ const d = v(() => !i.value);
2266
+ return (s, c) => (g(), b("div", {
2267
+ class: V(["u-date-show", { "u-date-empty": d.value }])
2268
+ }, T(i.value || (o.locale === "en-US" ? "Empty" : "暂无")), 3));
2269
2269
  }
2270
- }), sa = /* @__PURE__ */ $(ia, [["__scopeId", "data-v-930657df"]]), ra = /* @__PURE__ */ P({
2270
+ }), da = /* @__PURE__ */ $(ra, [["__scopeId", "data-v-930657df"]]), ca = /* @__PURE__ */ P({
2271
2271
  __name: "UFieldView",
2272
2272
  props: {
2273
2273
  type: { default: "text" },
@@ -2287,18 +2287,18 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2287
2287
  setup(o) {
2288
2288
  const t = o, e = v(() => {
2289
2289
  if (!t.text) return null;
2290
- const c = t.text.split("/");
2291
- return c.length >= 2 ? {
2292
- trueText: c[0].trim(),
2293
- falseText: c[1].trim()
2290
+ const s = t.text.split("/");
2291
+ return s.length >= 2 ? {
2292
+ trueText: s[0].trim(),
2293
+ falseText: s[1].trim()
2294
2294
  } : null;
2295
- }), l = v(() => {
2296
- var c;
2297
- return t.trueText || ((c = e.value) == null ? void 0 : c.trueText) || "开启";
2298
- }), d = v(() => {
2299
- var c;
2300
- return t.falseText || ((c = e.value) == null ? void 0 : c.falseText) || "关闭";
2295
+ }), i = v(() => {
2296
+ var s;
2297
+ return t.trueText || ((s = e.value) == null ? void 0 : s.trueText) || "开启";
2301
2298
  }), r = v(() => {
2299
+ var s;
2300
+ return t.falseText || ((s = e.value) == null ? void 0 : s.falseText) || "关闭";
2301
+ }), d = v(() => {
2302
2302
  switch (t.type) {
2303
2303
  case "dict":
2304
2304
  return "UDictShow";
@@ -2314,21 +2314,21 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2314
2314
  return "UInputShow";
2315
2315
  }
2316
2316
  });
2317
- return (c, s) => (h(), S(H(r.value === "UDictShow" ? ta : r.value === "UToggleShow" ? oa : r.value === "UCascaderShow" ? na : r.value === "UDateShow" ? sa : Zt), {
2317
+ return (s, c) => (g(), S(G(d.value === "UDictShow" ? oa : d.value === "UToggleShow" ? na : d.value === "UCascaderShow" ? sa : d.value === "UDateShow" ? da : ta), {
2318
2318
  "model-value": o.modelValue,
2319
2319
  "dict-type": o.type === "dict" ? o.dictType : void 0,
2320
2320
  "cascader-key": o.type === "cascader" ? o.cascaderKey : void 0,
2321
2321
  mode: o.type === "date" ? o.mode : void 0,
2322
2322
  locale: o.type === "date" ? o.locale : void 0,
2323
2323
  format: o.type === "date" ? o.format : void 0,
2324
- "true-text": o.type === "switch" ? l.value : void 0,
2325
- "false-text": o.type === "switch" ? d.value : void 0,
2324
+ "true-text": o.type === "switch" ? i.value : void 0,
2325
+ "false-text": o.type === "switch" ? r.value : void 0,
2326
2326
  "use-yes-no": o.type === "switch" ? o.useYesNo : void 0,
2327
2327
  multiline: o.type === "input" || o.type === "text" ? o.multiline : void 0,
2328
2328
  "default-text": o.type === "dict" ? o.defaultText : void 0
2329
2329
  }, null, 8, ["model-value", "dict-type", "cascader-key", "mode", "locale", "format", "true-text", "false-text", "use-yes-no", "multiline", "default-text"]));
2330
2330
  }
2331
- }), xe = /* @__PURE__ */ $(ra, [["__scopeId", "data-v-fedb54d7"]]), da = { class: "table-grid" }, ca = /* @__PURE__ */ P({
2331
+ }), xe = /* @__PURE__ */ $(ca, [["__scopeId", "data-v-05ef52d9"]]), ua = { class: "table-grid" }, ue = "col-", fa = 160, ma = /* @__PURE__ */ P({
2332
2332
  // 属性/事件手动透传给 el-table,不再自动落到根节点
2333
2333
  inheritAttrs: !1,
2334
2334
  __name: "TableGrid",
@@ -2337,6 +2337,7 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2337
2337
  columns: {},
2338
2338
  loading: { type: Boolean },
2339
2339
  actions: {},
2340
+ actionsWidth: {},
2340
2341
  keyField: {},
2341
2342
  selection: { type: [String, Boolean] },
2342
2343
  dictData: {},
@@ -2344,206 +2345,240 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2344
2345
  },
2345
2346
  emits: ["rowAction", "rowClick", "selectionChange"],
2346
2347
  setup(o, { emit: t }) {
2347
- const e = o, l = ye(), d = t, r = v(() => ({
2348
- // 行操作按钮
2349
- actionList: e.actions || [],
2350
- // 操作列宽度:按按钮文字估算
2351
- actionColumnWidth: s.getActionColumnWidth(),
2352
- // 用户自己提供了 empty 插槽就用用户的,否则用内置空状态
2353
- hasUserEmpty: !!l.empty,
2354
- // 透传给 el-table 的插槽(default 由 <slot name="default"/> 单独渲染)
2355
- forwardSlots: Object.keys(l).filter((a) => a !== "default")
2356
- })), c = v(() => {
2357
- const a = e.columns.map((i) => {
2358
- const n = {
2359
- prop: i.field,
2360
- label: i.label
2348
+ const e = o, i = be(), r = t;
2349
+ function d(l) {
2350
+ return l === "actions" || l === "actions-extra" || l.startsWith(ue);
2351
+ }
2352
+ const s = v(() => {
2353
+ var l, n;
2354
+ return {
2355
+ // 行操作按钮
2356
+ actionList: e.actions || [],
2357
+ // 操作列宽度:
2358
+ // 1) 显式配了 actionsWidth 就用它(插槽接管操作列时用得上,见文件头)
2359
+ // 2) 否则按 yaml actions 的文字长度估算
2360
+ // 3) yaml 没配 actions、只有插槽时给个兜底宽度,不然列会被挤成一条缝
2361
+ actionColumnWidth: e.actionsWidth ?? ((l = e.actions) != null && l.length ? a.getActionColumnWidth() : fa),
2362
+ // 用户自己提供了 empty 插槽就用用户的,否则用内置空状态
2363
+ hasUserEmpty: !!i.empty,
2364
+ // 透传给 el-table 的插槽(default 由 <slot name="default"/> 单独渲染,列插槽自己消费)
2365
+ forwardSlots: Object.keys(i).filter((u) => u !== "default" && !d(u)),
2366
+ // 使用方开了哪些列插槽(列名 = col-<field>)
2367
+ colSlots: Object.keys(i).filter((u) => u.startsWith(ue)),
2368
+ // 操作列是否被使用方接管(接管 = 替换 yaml 的那几个按钮)
2369
+ hasActionsSlot: !!i.actions,
2370
+ // 是否要在 yaml 按钮后面追加按钮
2371
+ hasActionsExtra: !!i["actions-extra"],
2372
+ // 操作列要不要出现:yaml 配了 actions、或使用方开了插槽
2373
+ showActionColumn: (((n = e.actions) == null ? void 0 : n.length) || 0) > 0 || !!i.actions || !!i["actions-extra"]
2374
+ };
2375
+ }), c = v(() => {
2376
+ const l = e.columns.map((n) => {
2377
+ const u = {
2378
+ prop: n.field,
2379
+ label: n.label
2361
2380
  };
2362
- return typeof i.width == "number" && (n.width = i.width), n;
2381
+ return typeof n.width == "number" && (u.width = n.width), u;
2363
2382
  });
2364
- return r.value.actionList.length > 0 && a.push({
2383
+ return s.value.showActionColumn && l.push({
2365
2384
  prop: "actions",
2366
2385
  label: "操作",
2367
- width: r.value.actionColumnWidth,
2386
+ width: s.value.actionColumnWidth,
2368
2387
  fixed: "right"
2369
- }), a;
2370
- }), s = {
2388
+ }), l;
2389
+ }), a = {
2390
+ /** field → 列插槽名(`login_id` → `col-login_id`,点号原样保留) */
2391
+ colSlotName(l) {
2392
+ return ue + l;
2393
+ },
2394
+ /** 该列是否被使用方的插槽接管 */
2395
+ hasColSlot(l) {
2396
+ return s.value.colSlots.includes(a.colSlotName(l));
2397
+ },
2371
2398
  // 行操作按钮文字
2372
- actionText(a) {
2373
- return a.text ? a.text : {
2399
+ actionText(l) {
2400
+ return l.text ? l.text : {
2374
2401
  add: "新增",
2375
2402
  edit: "编辑",
2376
2403
  delete: "删除",
2377
2404
  preview: "预览",
2378
2405
  back: "返回"
2379
- }[a.action] || "";
2406
+ }[l.action] || "";
2380
2407
  },
2381
2408
  // 行操作按钮样式(操作列里统一用 link 按钮,只换颜色)
2382
- actionType(a) {
2383
- return a.style ? a.style === "default" ? "" : a.style : {
2409
+ actionType(l) {
2410
+ return l.style ? l.style === "default" ? "" : l.style : {
2384
2411
  add: "primary",
2385
2412
  edit: "primary",
2386
2413
  delete: "danger",
2387
2414
  preview: "primary",
2388
2415
  back: "primary"
2389
- }[a.action] || "primary";
2416
+ }[l.action] || "primary";
2390
2417
  },
2391
2418
  // 操作列宽度:按各按钮文字长度估算
2392
2419
  getActionColumnWidth() {
2393
- const i = (e.actions || []).reduce((n, f) => n + Math.max(52, s.actionText(f).length * 16 + 12), 0);
2394
- return Math.max(80, Math.ceil(i) + 16);
2420
+ const n = (e.actions || []).reduce((u, m) => u + Math.max(52, a.actionText(m).length * 16 + 12), 0);
2421
+ return Math.max(80, Math.ceil(n) + 16);
2395
2422
  },
2396
2423
  // 手机号脱敏
2397
- maskPhone(a) {
2398
- return !a || a.length < 7 ? a : a.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
2424
+ maskPhone(l) {
2425
+ return !l || l.length < 7 ? l : l.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
2399
2426
  },
2400
2427
  // 身份证脱敏
2401
- maskIdCard(a) {
2402
- return !a || a.length < 8 ? a : a.replace(/(\d{3})\d{11}(\d{4})/, "$1***********$2");
2428
+ maskIdCard(l) {
2429
+ return !l || l.length < 8 ? l : l.replace(/(\d{3})\d{11}(\d{4})/, "$1***********$2");
2403
2430
  },
2404
2431
  // 金额格式化
2405
- formatMoney(a) {
2406
- const i = Number(a);
2407
- return isNaN(i) ? String(a) : i.toLocaleString("zh-CN", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
2432
+ formatMoney(l) {
2433
+ const n = Number(l);
2434
+ return isNaN(n) ? String(l) : n.toLocaleString("zh-CN", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
2408
2435
  },
2409
2436
  // 根据 format 类型格式化
2410
- formatByType(a, i) {
2411
- if (!a)
2437
+ formatByType(l, n) {
2438
+ if (!l)
2412
2439
  return "";
2413
- switch (i) {
2440
+ switch (n) {
2414
2441
  case "phone":
2415
- return s.maskPhone(a);
2442
+ return a.maskPhone(l);
2416
2443
  case "idcard":
2417
- return s.maskIdCard(a);
2444
+ return a.maskIdCard(l);
2418
2445
  case "money":
2419
- return s.formatMoney(a);
2446
+ return a.formatMoney(l);
2420
2447
  case "percent":
2421
- return String(a * 100) + "%";
2448
+ return String(l * 100) + "%";
2422
2449
  default:
2423
- return i && i.includes("{}") ? i.replace("{}", String(a)) : String(a);
2450
+ return n && n.includes("{}") ? n.replace("{}", String(l)) : String(l);
2424
2451
  }
2425
2452
  },
2426
2453
  // 获取嵌套字段值
2427
- getNestedValue(a, i) {
2428
- if (!i.includes("."))
2429
- return a[i];
2430
- const n = i.split(".");
2431
- let f = a;
2432
- for (const m of n)
2433
- if (f && typeof f == "object" && m in f)
2434
- f = f[m];
2454
+ getNestedValue(l, n) {
2455
+ if (!n.includes("."))
2456
+ return l[n];
2457
+ const u = n.split(".");
2458
+ let m = l;
2459
+ for (const f of u)
2460
+ if (m && typeof m == "object" && f in m)
2461
+ m = m[f];
2435
2462
  else
2436
2463
  return;
2437
- return f;
2464
+ return m;
2438
2465
  },
2439
2466
  // 判断是否需要使用 UFieldView 组件
2440
- useFieldView(a) {
2441
- return a.type ? ["dict", "switch", "cascader", "date", "input", "text"].includes(a.type) : !1;
2467
+ useFieldView(l) {
2468
+ return l.type ? ["dict", "switch", "cascader", "date", "input", "text"].includes(l.type) : !1;
2442
2469
  },
2443
2470
  // 当前行高亮(与详情/预览对应)
2444
- rowClassName({ row: a }) {
2445
- if (!a || e.activeKey === void 0 || e.activeKey === null) return "";
2446
- const i = e.keyField || "id";
2447
- return a[i] === e.activeKey ? "table-grid-active-row" : "";
2471
+ rowClassName({ row: l }) {
2472
+ if (!l || e.activeKey === void 0 || e.activeKey === null) return "";
2473
+ const n = e.keyField || "id";
2474
+ return l[n] === e.activeKey ? "table-grid-active-row" : "";
2448
2475
  },
2449
2476
  // 选择变化
2450
- onSelectionChange(a) {
2451
- d("selectionChange", a);
2477
+ onSelectionChange(l) {
2478
+ r("selectionChange", l);
2452
2479
  },
2453
2480
  // 行点击
2454
- onRowClick(a) {
2455
- d("rowClick", a);
2481
+ onRowClick(l) {
2482
+ r("rowClick", l);
2456
2483
  },
2457
2484
  // 行操作按钮点击
2458
- onRowAction(a, i) {
2459
- d("rowAction", {
2460
- action: a.action,
2461
- item: a,
2462
- row: i
2485
+ onRowAction(l, n) {
2486
+ r("rowAction", {
2487
+ action: l.action,
2488
+ item: l,
2489
+ row: n
2463
2490
  });
2464
2491
  }
2465
2492
  };
2466
- return (a, i) => {
2467
- const n = Qe, f = J, m = Ye;
2468
- return h(), y("div", da, [
2469
- _(m, ce({ stripe: !0, border: !0, ...a.$attrs }, {
2493
+ return (l, n) => {
2494
+ const u = He, m = J, f = Ke;
2495
+ return g(), b("div", ua, [
2496
+ _(f, ce({ stripe: !0, border: !0, ...l.$attrs }, {
2470
2497
  data: e.rows.length ? e.rows : [{}],
2471
2498
  loading: e.loading,
2472
2499
  "row-key": e.keyField || "id",
2473
- "row-class-name": s.rowClassName,
2474
- onSelectionChange: s.onSelectionChange,
2475
- onRowClick: i[0] || (i[0] = (u) => s.onRowClick(u))
2500
+ "row-class-name": a.rowClassName,
2501
+ onSelectionChange: a.onSelectionChange,
2502
+ onRowClick: n[0] || (n[0] = (p) => a.onRowClick(p))
2476
2503
  }), X({
2477
2504
  default: w(() => [
2478
- e.selection ? (h(), S(n, {
2505
+ e.selection ? (g(), S(u, {
2479
2506
  key: 0,
2480
2507
  type: "selection",
2481
2508
  width: "55"
2482
2509
  })) : D("", !0),
2483
- (h(!0), y(I, null, E(c.value, (u) => (h(), S(n, {
2484
- key: u.prop,
2485
- prop: u.prop,
2486
- label: u.label,
2487
- width: u.width,
2488
- fixed: u.fixed
2510
+ (g(!0), b(I, null, M(c.value, (p) => (g(), S(u, {
2511
+ key: p.prop,
2512
+ prop: p.prop,
2513
+ label: p.label,
2514
+ width: p.width,
2515
+ fixed: p.fixed
2489
2516
  }, {
2490
- default: w(({ row: g }) => [
2491
- u.prop === "actions" ? (h(), y(I, { key: 0 }, [
2492
- Object.keys(g).length > 0 ? (h(!0), y(I, { key: 0 }, E(r.value.actionList, (p, b) => (h(), S(f, {
2493
- key: b,
2494
- link: "",
2495
- type: s.actionType(p),
2496
- disabled: p.disabled === !0,
2497
- size: "small",
2498
- onClick: Je((R) => s.onRowAction(p, g), ["stop"])
2499
- }, {
2500
- default: w(() => [
2501
- F(k(s.actionText(p)), 1)
2502
- ]),
2503
- _: 2
2504
- }, 1032, ["type", "disabled", "onClick"]))), 128)) : D("", !0)
2505
- ], 64)) : (h(), y(I, { key: 1 }, [
2506
- Object.keys(g).length > 0 ? (h(!0), y(I, { key: 0 }, E(e.columns, (p) => (h(), y(I, {
2507
- key: p.field
2517
+ default: w(({ row: h }) => [
2518
+ Object.keys(h).length > 0 ? (g(), b(I, { key: 0 }, [
2519
+ p.prop === "actions" ? (g(), b(I, { key: 0 }, [
2520
+ s.value.hasActionsSlot ? k(l.$slots, "actions", {
2521
+ row: h,
2522
+ actions: s.value.actionList
2523
+ }, void 0, !0, 1) : (g(!0), b(I, { key: 0 }, M(s.value.actionList, (y, A) => (g(), S(m, {
2524
+ key: A,
2525
+ link: "",
2526
+ type: a.actionType(y),
2527
+ disabled: y.disabled === !0,
2528
+ size: "small",
2529
+ onClick: Ze((H) => a.onRowAction(y, h), ["stop"])
2530
+ }, {
2531
+ default: w(() => [
2532
+ F(T(a.actionText(y)), 1)
2533
+ ]),
2534
+ _: 2
2535
+ }, 1032, ["type", "disabled", "onClick"]))), 128)),
2536
+ k(l.$slots, "actions-extra", { row: h }, void 0, !0)
2537
+ ], 64)) : a.hasColSlot(p.prop) ? k(l.$slots, a.colSlotName(p.prop), {
2538
+ row: h,
2539
+ value: a.getNestedValue(h, p.prop),
2540
+ column: p
2541
+ }, void 0, !0, 1) : (g(!0), b(I, { key: 2 }, M(e.columns, (y) => (g(), b(I, {
2542
+ key: y.field
2508
2543
  }, [
2509
- p.field === u.prop && s.useFieldView(p) ? (h(), S(xe, {
2544
+ y.field === p.prop && a.useFieldView(y) ? (g(), S(xe, {
2510
2545
  key: 0,
2511
- type: p.type,
2512
- "model-value": s.getNestedValue(g, p.field),
2513
- "dict-type": p.dictType,
2514
- mode: p.mode,
2515
- locale: p.locale,
2516
- format: p.format,
2517
- text: p.text,
2518
- "true-text": p.trueText,
2519
- "false-text": p.falseText,
2520
- "use-yes-no": p.useYesNo,
2521
- "cascader-key": p.cascaderKey,
2522
- multiline: p.multiline,
2523
- "default-text": p.defaultText
2524
- }, null, 8, ["type", "model-value", "dict-type", "mode", "locale", "format", "text", "true-text", "false-text", "use-yes-no", "cascader-key", "multiline", "default-text"])) : p.field === u.prop ? (h(), y("span", {
2546
+ type: y.type,
2547
+ "model-value": a.getNestedValue(h, y.field),
2548
+ "dict-type": y.dictType,
2549
+ mode: y.mode,
2550
+ locale: y.locale,
2551
+ format: y.format,
2552
+ text: y.text,
2553
+ "true-text": y.trueText,
2554
+ "false-text": y.falseText,
2555
+ "use-yes-no": y.useYesNo,
2556
+ "cascader-key": y.cascaderKey,
2557
+ multiline: y.multiline,
2558
+ "default-text": y.defaultText
2559
+ }, null, 8, ["type", "model-value", "dict-type", "mode", "locale", "format", "text", "true-text", "false-text", "use-yes-no", "cascader-key", "multiline", "default-text"])) : y.field === p.prop ? (g(), b("span", {
2525
2560
  key: 1,
2526
- class: V({ "table-grid-format": p.format })
2527
- }, k(s.formatByType(s.getNestedValue(g, p.field), p.format || "")), 3)) : D("", !0)
2528
- ], 64))), 128)) : D("", !0)
2529
- ], 64))
2561
+ class: V({ "table-grid-format": y.format })
2562
+ }, T(a.formatByType(a.getNestedValue(h, y.field), y.format || "")), 3)) : D("", !0)
2563
+ ], 64))), 128))
2564
+ ], 64)) : D("", !0)
2530
2565
  ]),
2531
2566
  _: 2
2532
2567
  }, 1032, ["prop", "label", "width", "fixed"]))), 128)),
2533
- T(a.$slots, "default", {}, void 0, !0)
2568
+ k(l.$slots, "default", {}, void 0, !0)
2534
2569
  ]),
2535
2570
  _: 2
2536
2571
  }, [
2537
- E(r.value.forwardSlots, (u) => ({
2538
- name: u,
2539
- fn: w((g) => [
2540
- T(a.$slots, u, q(j(g || {})), void 0, !0)
2572
+ M(s.value.forwardSlots, (p) => ({
2573
+ name: p,
2574
+ fn: w((h) => [
2575
+ k(l.$slots, p, q(O(h || {})), void 0, !0)
2541
2576
  ])
2542
2577
  })),
2543
- r.value.hasUserEmpty ? void 0 : {
2578
+ s.value.hasUserEmpty ? void 0 : {
2544
2579
  name: "empty",
2545
2580
  fn: w(() => [
2546
- i[1] || (i[1] = C("div", { class: "no-data" }, "暂无数据", -1))
2581
+ n[1] || (n[1] = x("div", { class: "no-data" }, "暂无数据", -1))
2547
2582
  ]),
2548
2583
  key: "0"
2549
2584
  }
@@ -2551,13 +2586,13 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2551
2586
  ]);
2552
2587
  };
2553
2588
  }
2554
- }), ua = /* @__PURE__ */ $(ca, [["__scopeId", "data-v-ca606e7b"]]), fa = { class: "table-pagination" }, ma = { class: "page-size-select" }, pa = { class: "total-text" }, ha = {
2589
+ }), pa = /* @__PURE__ */ $(ma, [["__scopeId", "data-v-d3eed11d"]]), ha = { class: "table-pagination" }, ga = { class: "page-size-select" }, ya = { class: "total-text" }, ba = {
2555
2590
  key: 1,
2556
2591
  class: "load-more"
2557
- }, ga = {
2592
+ }, va = {
2558
2593
  key: 2,
2559
2594
  class: "total-text"
2560
- }, ya = /* @__PURE__ */ P({
2595
+ }, wa = /* @__PURE__ */ P({
2561
2596
  __name: "TablePagination",
2562
2597
  props: {
2563
2598
  page: {},
@@ -2567,88 +2602,88 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2567
2602
  },
2568
2603
  emits: ["update:page", "update:pageSize"],
2569
2604
  setup(o, { emit: t }) {
2570
- const e = o, l = t, d = v(() => ({
2605
+ const e = o, i = t, r = v(() => ({
2571
2606
  // 总页数
2572
2607
  totalPages: Math.ceil(e.total / e.pageSize),
2573
2608
  // 是否显示分页
2574
2609
  showPagination: e.type === "page" && e.total > 0
2575
- })), r = {
2610
+ })), d = {
2576
2611
  // 页码变化
2577
- onPageChange: (c) => {
2578
- l("update:page", c);
2612
+ onPageChange: (s) => {
2613
+ i("update:page", s);
2579
2614
  },
2580
2615
  // 每页条数变化
2581
- onPageSizeChange: (c) => {
2582
- l("update:pageSize", c);
2616
+ onPageSizeChange: (s) => {
2617
+ i("update:pageSize", s);
2583
2618
  }
2584
2619
  };
2585
- return (c, s) => {
2586
- const a = Ke, i = he, n = pe, f = J;
2587
- return h(), y("div", fa, [
2588
- d.value.showPagination ? (h(), y(I, { key: 0 }, [
2620
+ return (s, c) => {
2621
+ const a = Ge, l = ge, n = he, u = J;
2622
+ return g(), b("div", ha, [
2623
+ r.value.showPagination ? (g(), b(I, { key: 0 }, [
2589
2624
  _(a, {
2590
2625
  "current-page": e.page,
2591
- "page-count": d.value.totalPages,
2626
+ "page-count": r.value.totalPages,
2592
2627
  "page-sizes": [10, 20, 50, 100],
2593
2628
  "page-size": e.pageSize,
2594
2629
  layout: "total, prev, pager, next, jumper",
2595
- onCurrentChange: r.onPageChange,
2596
- onSizeChange: r.onPageSizeChange
2630
+ onCurrentChange: d.onPageChange,
2631
+ onSizeChange: d.onPageSizeChange
2597
2632
  }, null, 8, ["current-page", "page-count", "page-size", "onCurrentChange", "onSizeChange"]),
2598
- C("div", ma, [
2633
+ x("div", ga, [
2599
2634
  _(n, {
2600
2635
  "model-value": e.pageSize,
2601
2636
  style: { width: "100px" },
2602
- onChange: r.onPageSizeChange
2637
+ onChange: d.onPageSizeChange
2603
2638
  }, {
2604
2639
  default: w(() => [
2605
- _(i, {
2640
+ _(l, {
2606
2641
  value: 10,
2607
2642
  label: "10条/页"
2608
2643
  }),
2609
- _(i, {
2644
+ _(l, {
2610
2645
  value: 20,
2611
2646
  label: "20条/页"
2612
2647
  }),
2613
- _(i, {
2648
+ _(l, {
2614
2649
  value: 50,
2615
2650
  label: "50条/页"
2616
2651
  }),
2617
- _(i, {
2652
+ _(l, {
2618
2653
  value: 100,
2619
2654
  label: "100条/页"
2620
2655
  })
2621
2656
  ]),
2622
2657
  _: 1
2623
2658
  }, 8, ["model-value", "onChange"]),
2624
- C("span", pa, "共 " + k(e.total) + " 条", 1)
2659
+ x("span", ya, "共 " + T(e.total) + " 条", 1)
2625
2660
  ])
2626
- ], 64)) : e.type === "auto" ? (h(), y("div", ha, [
2627
- _(f, {
2661
+ ], 64)) : e.type === "auto" ? (g(), b("div", ba, [
2662
+ _(u, {
2628
2663
  disabled: e.page * e.pageSize >= e.total
2629
2664
  }, {
2630
- default: w(() => [...s[0] || (s[0] = [
2665
+ default: w(() => [...c[0] || (c[0] = [
2631
2666
  F("加载更多", -1)
2632
2667
  ])]),
2633
2668
  _: 1
2634
2669
  }, 8, ["disabled"])
2635
- ])) : e.type === "all" ? (h(), y("div", ga, "共 " + k(e.total) + " 条", 1)) : D("", !0)
2670
+ ])) : e.type === "all" ? (g(), b("div", va, "共 " + T(e.total) + " 条", 1)) : D("", !0)
2636
2671
  ]);
2637
2672
  };
2638
2673
  }
2639
- }), ba = /* @__PURE__ */ $(ya, [["__scopeId", "data-v-53e593aa"]]), va = { class: "table-detail" }, wa = {
2674
+ }), Ca = /* @__PURE__ */ $(wa, [["__scopeId", "data-v-2ca77d18"]]), xa = { class: "table-detail" }, _a = {
2640
2675
  key: 0,
2641
2676
  class: "detail-header"
2642
- }, xa = { class: "detail-title" }, Ca = { class: "detail-body" }, _a = {
2677
+ }, Sa = { class: "detail-title" }, Da = { class: "detail-body" }, ka = {
2643
2678
  key: 0,
2644
2679
  class: "detail-status"
2645
- }, Sa = {
2680
+ }, Ta = {
2646
2681
  key: 1,
2647
2682
  class: "detail-content"
2648
- }, Da = { class: "detail-label" }, ka = { class: "detail-value" }, Ta = {
2683
+ }, Va = { class: "detail-label" }, Pa = { class: "detail-value" }, $a = {
2649
2684
  key: 2,
2650
2685
  class: "detail-status"
2651
- }, Va = /* @__PURE__ */ P({
2686
+ }, Aa = /* @__PURE__ */ P({
2652
2687
  __name: "TableDetail",
2653
2688
  props: {
2654
2689
  showHeader: { type: Boolean },
@@ -2660,7 +2695,7 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2660
2695
  extraMode: {}
2661
2696
  },
2662
2697
  setup(o) {
2663
- const t = o, e = ye(), l = v(() => !!e["detail-extra"]), d = v(() => l.value), r = v(() => !l.value || t.extraMode === "append"), c = v(() => ({
2698
+ const t = o, e = be(), i = v(() => !!e["detail-extra"]), r = v(() => i.value), d = v(() => !i.value || t.extraMode === "append"), s = v(() => ({
2664
2699
  // 标题栏
2665
2700
  showHeader: t.showHeader !== !1,
2666
2701
  // 面板标题
@@ -2669,38 +2704,38 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2669
2704
  emptyText: t.emptyText || "暂无数据",
2670
2705
  // 是否有记录可展示
2671
2706
  hasRow: !!t.rowData
2672
- })), s = {
2707
+ })), c = {
2673
2708
  // 获取嵌套字段值
2674
- getNestedValue(a, i) {
2675
- if (!a || !i) return "";
2676
- if (!i.includes("."))
2677
- return a[i];
2678
- const n = i.split(".");
2679
- let f = a;
2709
+ getNestedValue(a, l) {
2710
+ if (!a || !l) return "";
2711
+ if (!l.includes("."))
2712
+ return a[l];
2713
+ const n = l.split(".");
2714
+ let u = a;
2680
2715
  for (const m of n)
2681
- if (f && typeof f == "object" && m in f)
2682
- f = f[m];
2716
+ if (u && typeof u == "object" && m in u)
2717
+ u = u[m];
2683
2718
  else
2684
2719
  return "";
2685
- return f;
2720
+ return u;
2686
2721
  }
2687
2722
  };
2688
- return (a, i) => (h(), y("div", va, [
2689
- c.value.showHeader ? (h(), y("div", wa, [
2690
- C("div", xa, k(c.value.title), 1)
2723
+ return (a, l) => (g(), b("div", xa, [
2724
+ s.value.showHeader ? (g(), b("div", _a, [
2725
+ x("div", Sa, T(s.value.title), 1)
2691
2726
  ])) : D("", !0),
2692
- C("div", Ca, [
2693
- r.value ? (h(), y(I, { key: 0 }, [
2694
- t.loading ? (h(), y("div", _a, "加载中...")) : c.value.hasRow ? (h(), y("div", Sa, [
2695
- (h(!0), y(I, null, E(t.columns, (n) => (h(), y("div", {
2727
+ x("div", Da, [
2728
+ d.value ? (g(), b(I, { key: 0 }, [
2729
+ t.loading ? (g(), b("div", ka, "加载中...")) : s.value.hasRow ? (g(), b("div", Ta, [
2730
+ (g(!0), b(I, null, M(t.columns, (n) => (g(), b("div", {
2696
2731
  key: n.field,
2697
2732
  class: "detail-item"
2698
2733
  }, [
2699
- C("div", Da, k(n.label), 1),
2700
- C("div", ka, [
2734
+ x("div", Va, T(n.label), 1),
2735
+ x("div", Pa, [
2701
2736
  _(xe, {
2702
2737
  type: n.type,
2703
- "model-value": s.getNestedValue(t.rowData, n.field),
2738
+ "model-value": c.getNestedValue(t.rowData, n.field),
2704
2739
  "dict-type": n.dictType,
2705
2740
  mode: n.mode,
2706
2741
  locale: n.locale,
@@ -2715,16 +2750,16 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2715
2750
  }, null, 8, ["type", "model-value", "dict-type", "mode", "locale", "format", "text", "true-text", "false-text", "use-yes-no", "cascader-key", "multiline", "default-text"])
2716
2751
  ])
2717
2752
  ]))), 128))
2718
- ])) : (h(), y("div", Ta, k(c.value.emptyText), 1))
2753
+ ])) : (g(), b("div", $a, T(s.value.emptyText), 1))
2719
2754
  ], 64)) : D("", !0),
2720
- d.value ? T(a.$slots, "detail-extra", {
2755
+ r.value ? k(a.$slots, "detail-extra", {
2721
2756
  rowData: t.rowData,
2722
2757
  columns: t.columns
2723
2758
  }, void 0, !0, 1) : D("", !0)
2724
2759
  ])
2725
2760
  ]));
2726
2761
  }
2727
- }), ue = /* @__PURE__ */ $(Va, [["__scopeId", "data-v-3314a22f"]]), Pa = { class: "table-body" }, $a = { class: "table-container" }, Ra = /* @__PURE__ */ P({
2762
+ }), fe = /* @__PURE__ */ $(Aa, [["__scopeId", "data-v-7e47b0ba"]]), Ra = { class: "table-body" }, Ia = { class: "table-container" }, Ea = /* @__PURE__ */ P({
2728
2763
  // 属性/事件手动处理:class/style 留根节点,其余透传给 el-table
2729
2764
  inheritAttrs: !1,
2730
2765
  __name: "TableRender",
@@ -2734,7 +2769,7 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2734
2769
  },
2735
2770
  emits: ["back", "toolbar-action", "row-action"],
2736
2771
  setup(o, { expose: t, emit: e }) {
2737
- const l = ["search-extra", "search-actions", "toolbar-left", "toolbar-extra", "detail-extra"], d = o, r = Xe(), c = ye(), s = e, a = new Nt(), i = Q(null), n = W({
2772
+ const i = ["search-extra", "search-actions", "toolbar-left", "toolbar-extra", "detail-extra"], r = o, d = et(), s = be(), c = e, a = new qt(), l = Q(null), n = z({
2738
2773
  // 内部搜索参数
2739
2774
  searchParams: {},
2740
2775
  // 是否已加载配置
@@ -2743,9 +2778,9 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2743
2778
  dictData: {}
2744
2779
  });
2745
2780
  oe(async () => {
2746
- d.formId && await m.loadConfig(d.formId);
2781
+ r.formId && await m.loadConfig(r.formId);
2747
2782
  });
2748
- const f = v(() => ({
2783
+ const u = v(() => ({
2749
2784
  // 表格配置
2750
2785
  tableConfig: a.data.tableConfig,
2751
2786
  // 表格数据
@@ -2797,15 +2832,15 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2797
2832
  // ============ 透传相关 ============
2798
2833
  // 透传给 el-table 的属性/事件(class、style 留在本组件根节点)
2799
2834
  getTableAttrs() {
2800
- const { class: u, style: g, ...p } = r;
2801
- return p;
2835
+ const { class: f, style: p, ...h } = d;
2836
+ return h;
2802
2837
  },
2803
2838
  // 透传给 el-table 的插槽(本组件自己消费的插槽除外)
2804
2839
  getTableSlots() {
2805
- const u = {};
2806
- for (const g of Object.keys(c))
2807
- l.includes(g) || (u[g] = !0);
2808
- return u;
2840
+ const f = {};
2841
+ for (const p of Object.keys(s))
2842
+ i.includes(p) || (f[p] = !0);
2843
+ return f;
2809
2844
  },
2810
2845
  // 转发给 TableDetail 的插槽:**页面真的给了才转发**。
2811
2846
  // 为什么必须判断:TableDetail 用「有没有 detail-extra 插槽」决定要不要渲染默认的
@@ -2813,19 +2848,19 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2813
2848
  // 认为「有插槽」→ replace 模式下详情区会变成空白。
2814
2849
  // (返回类型必须显式写:否则与 slots 互相推导会触发 TS7022/TS7023)
2815
2850
  getDetailSlots() {
2816
- return c["detail-extra"] ? ["detail-extra"] : [];
2851
+ return s["detail-extra"] ? ["detail-extra"] : [];
2817
2852
  },
2818
2853
  // 传给 TableDetail 的插槽/默认内容关系(页面没给插槽时无所谓,给了才生效)
2819
2854
  getDetailExtraMode() {
2820
- return d.detailExtraMode === "append" ? "append" : "replace";
2855
+ return r.detailExtraMode === "append" ? "append" : "replace";
2821
2856
  },
2822
2857
  // ============ 配置与数据 ============
2823
2858
  // 加载配置
2824
- async loadConfig(u) {
2859
+ async loadConfig(f) {
2825
2860
  try {
2826
- await a.loadConfig(u);
2827
- } catch (g) {
2828
- U((g == null ? void 0 : g.message) || "获取表格配置失败");
2861
+ await a.loadConfig(f);
2862
+ } catch (p) {
2863
+ U((p == null ? void 0 : p.message) || "获取表格配置失败");
2829
2864
  return;
2830
2865
  }
2831
2866
  n.searchParams = { ...a.data.searchParams }, n.loaded = !0, await m.loadDictData(), await m.handleLoadData();
@@ -2834,21 +2869,21 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2834
2869
  async handleLoadData() {
2835
2870
  try {
2836
2871
  await a.loadData();
2837
- } catch (u) {
2838
- U((u == null ? void 0 : u.message) || "加载数据失败");
2872
+ } catch (f) {
2873
+ U((f == null ? void 0 : f.message) || "加载数据失败");
2839
2874
  }
2840
2875
  },
2841
2876
  // 加载字典数据
2842
2877
  async loadDictData() {
2843
- const u = a.getColumns(), g = /* @__PURE__ */ new Set();
2844
- for (const p of u)
2845
- p.type === "dict" && p.dictType && g.add(p.dictType);
2846
- for (const p of g)
2878
+ const f = a.getColumns(), p = /* @__PURE__ */ new Set();
2879
+ for (const h of f)
2880
+ h.type === "dict" && h.dictType && p.add(h.dictType);
2881
+ for (const h of p)
2847
2882
  try {
2848
- const b = await M.get(K.dictApi(p));
2849
- b.status === 200 && (n.dictData[p] = we(b.data));
2850
- } catch (b) {
2851
- console.error(`[TableRender] 加载字典 ${p} 失败:`, b);
2883
+ const y = await E.get(K.dictApi(h));
2884
+ y.status === 200 && (n.dictData[h] = Ce(y.data));
2885
+ } catch (y) {
2886
+ console.error(`[TableRender] 加载字典 ${h} 失败:`, y);
2852
2887
  }
2853
2888
  },
2854
2889
  // 搜索
@@ -2856,8 +2891,8 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2856
2891
  a.data.searchParams = { ...n.searchParams };
2857
2892
  try {
2858
2893
  await a.search();
2859
- } catch (u) {
2860
- U((u == null ? void 0 : u.message) || "查询失败");
2894
+ } catch (f) {
2895
+ U((f == null ? void 0 : f.message) || "查询失败");
2861
2896
  }
2862
2897
  },
2863
2898
  // 重置
@@ -2865,34 +2900,34 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2865
2900
  n.searchParams = {};
2866
2901
  try {
2867
2902
  await a.reset();
2868
- } catch (u) {
2869
- U((u == null ? void 0 : u.message) || "重置失败");
2903
+ } catch (f) {
2904
+ U((f == null ? void 0 : f.message) || "重置失败");
2870
2905
  }
2871
2906
  },
2872
2907
  // 更新搜索参数
2873
- updateSearchParam(u, g) {
2874
- n.searchParams[u] = g;
2908
+ updateSearchParam(f, p) {
2909
+ n.searchParams[f] = p;
2875
2910
  },
2876
2911
  // 分页变化
2877
- async handlePageChange(u) {
2912
+ async handlePageChange(f) {
2878
2913
  try {
2879
- await a.changePage(u);
2880
- } catch (g) {
2881
- U((g == null ? void 0 : g.message) || "加载数据失败");
2914
+ await a.changePage(f);
2915
+ } catch (p) {
2916
+ U((p == null ? void 0 : p.message) || "加载数据失败");
2882
2917
  }
2883
2918
  },
2884
2919
  // 每页条数变化
2885
- async handlePageSizeChange(u) {
2920
+ async handlePageSizeChange(f) {
2886
2921
  try {
2887
- await a.changePageSize(u);
2888
- } catch (g) {
2889
- U((g == null ? void 0 : g.message) || "加载数据失败");
2922
+ await a.changePageSize(f);
2923
+ } catch (p) {
2924
+ U((p == null ? void 0 : p.message) || "加载数据失败");
2890
2925
  }
2891
2926
  },
2892
2927
  // ============ 行 / 详情 / 预览 ============
2893
2928
  // 行点击:设为当前行(配置了 detail 时同时刷新详情区)
2894
- handleRowClick(u) {
2895
- a.setCurrentRow(u);
2929
+ handleRowClick(f) {
2930
+ a.setCurrentRow(f);
2896
2931
  },
2897
2932
  // 关闭详情
2898
2933
  handleDetailClose() {
@@ -2911,81 +2946,81 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2911
2946
  a.resetPreview();
2912
2947
  },
2913
2948
  // 预览一行(只读,用抽屉展示)
2914
- handlePreview(u) {
2915
- if (!u) {
2916
- z.warning("请先点击表格中的一行数据");
2949
+ handlePreview(f) {
2950
+ if (!f) {
2951
+ N.warning("请先点击表格中的一行数据");
2917
2952
  return;
2918
2953
  }
2919
- a.openPreview(u);
2954
+ a.openPreview(f);
2920
2955
  },
2921
2956
  // ============ 按钮动作分发 ============
2922
2957
  // 工具栏按钮点击
2923
- handleToolbarAction(u) {
2924
- s("toolbar-action", u), m.dispatchAction(u);
2958
+ handleToolbarAction(f) {
2959
+ c("toolbar-action", f), m.dispatchAction(f);
2925
2960
  },
2926
2961
  // 行操作按钮点击
2927
- handleRowAction(u) {
2928
- s("row-action", u), m.dispatchAction(u);
2962
+ handleRowAction(f) {
2963
+ c("row-action", f), m.dispatchAction(f);
2929
2964
  },
2930
2965
  // 按 action 分发
2931
- async dispatchAction(u) {
2932
- switch (u.action) {
2966
+ async dispatchAction(f) {
2967
+ switch (f.action) {
2933
2968
  case "add":
2934
- await m.handleAdd(u.item);
2969
+ await m.handleAdd(f.item);
2935
2970
  break;
2936
2971
  case "edit":
2937
- await m.handleEdit(u.row, u.item);
2972
+ await m.handleEdit(f.row, f.item);
2938
2973
  break;
2939
2974
  case "delete":
2940
- await m.handleDelete(u.row, u.item);
2975
+ await m.handleDelete(f.row, f.item);
2941
2976
  break;
2942
2977
  case "preview":
2943
- m.handlePreview(u.row);
2978
+ m.handlePreview(f.row);
2944
2979
  break;
2945
2980
  case "back":
2946
- s("back", u);
2981
+ c("back", f);
2947
2982
  break;
2948
2983
  case "export":
2949
2984
  await m.handleExport();
2950
2985
  break;
2951
2986
  default:
2952
- await m.handleCustomAction(u);
2987
+ await m.handleCustomAction(f);
2953
2988
  }
2954
2989
  },
2955
2990
  // 新增:打开表单(表单 id 优先取按钮自己的 form)
2956
- async handleAdd(u) {
2957
- const g = u ? a.getButtonFormId(u) : a.getFormId();
2958
- if (!g) {
2959
- z.warning("未配置表单,无法新增");
2991
+ async handleAdd(f) {
2992
+ const p = f ? a.getButtonFormId(f) : a.getFormId();
2993
+ if (!p) {
2994
+ N.warning("未配置表单,无法新增");
2960
2995
  return;
2961
2996
  }
2962
- if (!i.value) return;
2963
- await i.value.showForm(g) != null && await m.handleLoadData();
2997
+ if (!l.value) return;
2998
+ await l.value.showForm(p) != null && await m.handleLoadData();
2964
2999
  },
2965
3000
  // 编辑:打开表单并回显目标行
2966
- async handleEdit(u, g) {
2967
- if (!u) {
2968
- z.warning("请先点击表格中的一行数据");
3001
+ async handleEdit(f, p) {
3002
+ if (!f) {
3003
+ N.warning("请先点击表格中的一行数据");
2969
3004
  return;
2970
3005
  }
2971
- const p = g ? a.getButtonFormId(g) : a.getFormId();
2972
- if (!p) {
2973
- z.warning("未配置表单,无法编辑");
3006
+ const h = p ? a.getButtonFormId(p) : a.getFormId();
3007
+ if (!h) {
3008
+ N.warning("未配置表单,无法编辑");
2974
3009
  return;
2975
3010
  }
2976
- if (!i.value) return;
2977
- const b = a.getKeyField();
2978
- await i.value.showForm(p, `${b}=${u[b]}`) != null && await m.handleLoadData();
3011
+ if (!l.value) return;
3012
+ const y = a.getKeyField();
3013
+ await l.value.showForm(h, `${y}=${f[y]}`) != null && await m.handleLoadData();
2979
3014
  },
2980
3015
  // 删除:二次确认后删除目标行
2981
- async handleDelete(u, g) {
2982
- if (!u) {
2983
- z.warning("请先点击表格中的一行数据");
3016
+ async handleDelete(f, p) {
3017
+ if (!f) {
3018
+ N.warning("请先点击表格中的一行数据");
2984
3019
  return;
2985
3020
  }
2986
3021
  try {
2987
- await De.confirm(
2988
- (g == null ? void 0 : g.confirm) || "确定要删除这条数据吗?",
3022
+ await Te.confirm(
3023
+ (p == null ? void 0 : p.confirm) || "确定要删除这条数据吗?",
2989
3024
  "确认删除",
2990
3025
  {
2991
3026
  confirmButtonText: "确定",
@@ -2997,28 +3032,28 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
2997
3032
  return;
2998
3033
  }
2999
3034
  try {
3000
- await a.deleteRow(u), z.success("删除成功");
3001
- } catch (p) {
3002
- U((p == null ? void 0 : p.message) || "删除失败");
3035
+ await a.deleteRow(f), N.success("删除成功");
3036
+ } catch (h) {
3037
+ U((h == null ? void 0 : h.message) || "删除失败");
3003
3038
  }
3004
3039
  },
3005
3040
  // 导出(需要配置 api.export)
3006
3041
  async handleExport() {
3007
3042
  try {
3008
- await a.exportData(), z.success("导出成功");
3009
- } catch (u) {
3010
- U((u == null ? void 0 : u.message) || "导出失败");
3043
+ await a.exportData(), N.success("导出成功");
3044
+ } catch (f) {
3045
+ U((f == null ? void 0 : f.message) || "导出失败");
3011
3046
  }
3012
3047
  },
3013
3048
  // 自定义动作:按钮配了 url 就 POST 该地址(body = 目标行)
3014
- async handleCustomAction(u) {
3015
- const { item: g, row: p } = u;
3016
- if (!(g != null && g.url)) {
3017
- z.warning(`未识别的按钮动作:${u.action}`);
3049
+ async handleCustomAction(f) {
3050
+ const { item: p, row: h } = f;
3051
+ if (!(p != null && p.url)) {
3052
+ N.warning(`未识别的按钮动作:${f.action}`);
3018
3053
  return;
3019
3054
  }
3020
3055
  try {
3021
- await De.confirm(g.confirm || "确定执行该操作吗?", "确认", {
3056
+ await Te.confirm(p.confirm || "确定执行该操作吗?", "确认", {
3022
3057
  confirmButtonText: "确定",
3023
3058
  cancelButtonText: "取消",
3024
3059
  type: "warning"
@@ -3027,166 +3062,167 @@ const Wt = { class: "table-search" }, qt = { class: "search-fields" }, jt = { cl
3027
3062
  return;
3028
3063
  }
3029
3064
  try {
3030
- const b = await M.post(g.url, p || {});
3031
- if (b.status !== 200)
3032
- throw new Error(b.message || "操作失败");
3033
- z.success(b.message || "操作成功"), await m.handleLoadData();
3034
- } catch (b) {
3035
- U((b == null ? void 0 : b.message) || "操作失败");
3065
+ const y = await E.post(p.url, h || {});
3066
+ if (y.status !== 200)
3067
+ throw new Error(y.message || "操作失败");
3068
+ N.success(y.message || "操作成功"), await m.handleLoadData();
3069
+ } catch (y) {
3070
+ U((y == null ? void 0 : y.message) || "操作失败");
3036
3071
  }
3037
3072
  }
3038
3073
  };
3039
3074
  return t({
3040
3075
  loadConfig: m.loadConfig
3041
- }), (u, g) => {
3042
- var b, R, G, Ce, _e, Se;
3043
- const p = He;
3044
- return h(), y("div", {
3045
- class: V(["table-render", u.$attrs.class]),
3046
- style: B(u.$attrs.style)
3076
+ }), (f, p) => {
3077
+ var y, A, H, _e, Se, De, ke;
3078
+ const h = Je;
3079
+ return g(), b("div", {
3080
+ class: V(["table-render", f.$attrs.class]),
3081
+ style: B(f.$attrs.style)
3047
3082
  }, [
3048
- f.value.hasSearch ? (h(), S(Yt, {
3083
+ u.value.hasSearch ? (g(), S(Kt, {
3049
3084
  key: 0,
3050
- fields: f.value.searchFields,
3085
+ fields: u.value.searchFields,
3051
3086
  modelValue: n.searchParams,
3052
- "onUpdate:modelValue": g[0] || (g[0] = (A) => n.searchParams = A),
3087
+ "onUpdate:modelValue": p[0] || (p[0] = (R) => n.searchParams = R),
3053
3088
  onSearch: m.handleSearch,
3054
3089
  onReset: m.handleReset
3055
3090
  }, {
3056
- "search-extra": w((A) => [
3057
- T(u.$slots, "search-extra", q(j(A || {})), void 0, !0)
3091
+ "search-extra": w((R) => [
3092
+ k(f.$slots, "search-extra", q(O(R || {})), void 0, !0)
3058
3093
  ]),
3059
- "search-actions": w((A) => [
3060
- T(u.$slots, "search-actions", q(j(A || {})), void 0, !0)
3094
+ "search-actions": w((R) => [
3095
+ k(f.$slots, "search-actions", q(O(R || {})), void 0, !0)
3061
3096
  ]),
3062
3097
  _: 3
3063
3098
  }, 8, ["fields", "modelValue", "onSearch", "onReset"])) : D("", !0),
3064
- C("div", Pa, [
3065
- C("div", $a, [
3066
- _(ua, ce(m.getTableAttrs(), {
3067
- rows: f.value.rows,
3068
- columns: f.value.columns,
3069
- loading: f.value.loading,
3070
- actions: f.value.actions,
3071
- "key-field": (b = f.value.tableConfig) == null ? void 0 : b.key,
3072
- "dict-data": f.value.dictData,
3073
- "active-key": f.value.currentKey,
3099
+ x("div", Ra, [
3100
+ x("div", Ia, [
3101
+ _(pa, ce(m.getTableAttrs(), {
3102
+ rows: u.value.rows,
3103
+ columns: u.value.columns,
3104
+ loading: u.value.loading,
3105
+ actions: u.value.actions,
3106
+ "actions-width": (y = u.value.tableConfig) == null ? void 0 : y.actionsWidth,
3107
+ "key-field": (A = u.value.tableConfig) == null ? void 0 : A.key,
3108
+ "dict-data": u.value.dictData,
3109
+ "active-key": u.value.currentKey,
3074
3110
  onRowAction: m.handleRowAction,
3075
3111
  onRowClick: m.handleRowClick
3076
3112
  }), X({ _: 2 }, [
3077
- E(m.getTableSlots(), (A, Y) => ({
3113
+ M(m.getTableSlots(), (R, Y) => ({
3078
3114
  name: Y,
3079
- fn: w((Ie) => [
3080
- T(u.$slots, Y, q(j(Ie || {})), void 0, !0)
3115
+ fn: w((Me) => [
3116
+ k(f.$slots, Y, q(O(Me || {})), void 0, !0)
3081
3117
  ])
3082
3118
  }))
3083
- ]), 1040, ["rows", "columns", "loading", "actions", "key-field", "dict-data", "active-key", "onRowAction", "onRowClick"]),
3084
- _(ba, {
3119
+ ]), 1040, ["rows", "columns", "loading", "actions", "actions-width", "key-field", "dict-data", "active-key", "onRowAction", "onRowClick"]),
3120
+ _(Ca, {
3085
3121
  class: "table-pagination",
3086
- page: f.value.pagination.page,
3087
- "page-size": f.value.pagination.pageSize,
3088
- total: f.value.total,
3089
- type: (R = f.value.tableConfig) == null ? void 0 : R.pagination,
3122
+ page: u.value.pagination.page,
3123
+ "page-size": u.value.pagination.pageSize,
3124
+ total: u.value.total,
3125
+ type: (H = u.value.tableConfig) == null ? void 0 : H.pagination,
3090
3126
  "onUpdate:page": m.handlePageChange,
3091
3127
  "onUpdate:pageSize": m.handlePageSizeChange
3092
3128
  }, null, 8, ["page", "page-size", "total", "type", "onUpdate:page", "onUpdate:pageSize"])
3093
3129
  ]),
3094
- f.value.showDetail && f.value.detailMode === "inline" ? (h(), S(ue, {
3130
+ u.value.showDetail && u.value.detailMode === "inline" ? (g(), S(fe, {
3095
3131
  key: 0,
3096
- class: V(["table-detail-inline", `table-detail-inline-${f.value.detailSide}`]),
3097
- style: B({ width: f.value.detailWidth }),
3098
- title: (Ce = (G = f.value.tableConfig) == null ? void 0 : G.meta) == null ? void 0 : Ce.title,
3099
- loading: f.value.detailLoading,
3100
- "row-data": f.value.detailData,
3101
- columns: f.value.columns,
3102
- "empty-text": f.value.detailSide === "left" ? "请点击右侧表格行查看详情" : "请点击左侧表格行查看详情",
3132
+ class: V(["table-detail-inline", `table-detail-inline-${u.value.detailSide}`]),
3133
+ style: B({ width: u.value.detailWidth }),
3134
+ title: (Se = (_e = u.value.tableConfig) == null ? void 0 : _e.meta) == null ? void 0 : Se.title,
3135
+ loading: u.value.detailLoading,
3136
+ "row-data": u.value.detailData,
3137
+ columns: u.value.columns,
3138
+ "empty-text": u.value.detailSide === "left" ? "请点击右侧表格行查看详情" : "请点击左侧表格行查看详情",
3103
3139
  "extra-mode": m.getDetailExtraMode()
3104
3140
  }, X({ _: 2 }, [
3105
- E(m.getDetailSlots(), (A) => ({
3106
- name: A,
3141
+ M(m.getDetailSlots(), (R) => ({
3142
+ name: R,
3107
3143
  fn: w((Y) => [
3108
- T(u.$slots, A, q(j(Y || {})), void 0, !0)
3144
+ k(f.$slots, R, q(O(Y || {})), void 0, !0)
3109
3145
  ])
3110
3146
  }))
3111
3147
  ]), 1032, ["class", "style", "title", "loading", "row-data", "columns", "empty-text", "extra-mode"])) : D("", !0)
3112
3148
  ]),
3113
- f.value.showDetail && f.value.detailMode === "drawer" ? (h(), S(p, {
3149
+ u.value.showDetail && u.value.detailMode === "drawer" ? (g(), S(h, {
3114
3150
  key: 1,
3115
- "model-value": f.value.detailVisible,
3116
- direction: f.value.detailDirection,
3117
- size: f.value.detailWidth,
3118
- title: ((Se = (_e = f.value.tableConfig) == null ? void 0 : _e.meta) == null ? void 0 : Se.title) || "详情",
3151
+ "model-value": u.value.detailVisible,
3152
+ direction: u.value.detailDirection,
3153
+ size: u.value.detailWidth,
3154
+ title: ((ke = (De = u.value.tableConfig) == null ? void 0 : De.meta) == null ? void 0 : ke.title) || "详情",
3119
3155
  onClose: m.handleDetailClose,
3120
3156
  onClosed: m.handleDetailClosed
3121
3157
  }, {
3122
3158
  default: w(() => [
3123
- _(ue, {
3159
+ _(fe, {
3124
3160
  "show-header": !1,
3125
- loading: f.value.detailLoading,
3126
- "row-data": f.value.detailData,
3127
- columns: f.value.columns,
3161
+ loading: u.value.detailLoading,
3162
+ "row-data": u.value.detailData,
3163
+ columns: u.value.columns,
3128
3164
  "extra-mode": m.getDetailExtraMode()
3129
3165
  }, X({ _: 2 }, [
3130
- E(m.getDetailSlots(), (A) => ({
3131
- name: A,
3166
+ M(m.getDetailSlots(), (R) => ({
3167
+ name: R,
3132
3168
  fn: w((Y) => [
3133
- T(u.$slots, A, q(j(Y || {})), void 0, !0)
3169
+ k(f.$slots, R, q(O(Y || {})), void 0, !0)
3134
3170
  ])
3135
3171
  }))
3136
3172
  ]), 1032, ["loading", "row-data", "columns", "extra-mode"])
3137
3173
  ]),
3138
3174
  _: 3
3139
3175
  }, 8, ["model-value", "direction", "size", "title", "onClose", "onClosed"])) : D("", !0),
3140
- f.value.previewMounted ? (h(), S(p, {
3176
+ u.value.previewMounted ? (g(), S(h, {
3141
3177
  key: 2,
3142
- "model-value": f.value.previewVisible,
3143
- direction: f.value.detailDirection,
3144
- size: f.value.detailWidth,
3178
+ "model-value": u.value.previewVisible,
3179
+ direction: u.value.detailDirection,
3180
+ size: u.value.detailWidth,
3145
3181
  title: "详情",
3146
3182
  onClose: m.handlePreviewClose,
3147
3183
  onClosed: m.handlePreviewClosed
3148
3184
  }, {
3149
3185
  default: w(() => [
3150
- _(ue, {
3186
+ _(fe, {
3151
3187
  "show-header": !1,
3152
- "row-data": f.value.previewRow,
3153
- columns: f.value.columns,
3188
+ "row-data": u.value.previewRow,
3189
+ columns: u.value.columns,
3154
3190
  "extra-mode": m.getDetailExtraMode()
3155
3191
  }, X({ _: 2 }, [
3156
- E(m.getDetailSlots(), (A) => ({
3157
- name: A,
3192
+ M(m.getDetailSlots(), (R) => ({
3193
+ name: R,
3158
3194
  fn: w((Y) => [
3159
- T(u.$slots, A, q(j(Y || {})), void 0, !0)
3195
+ k(f.$slots, R, q(O(Y || {})), void 0, !0)
3160
3196
  ])
3161
3197
  }))
3162
3198
  ]), 1032, ["row-data", "columns", "extra-mode"])
3163
3199
  ]),
3164
3200
  _: 3
3165
3201
  }, 8, ["model-value", "direction", "size", "onClose", "onClosed"])) : D("", !0),
3166
- f.value.hasToolbar ? (h(), S(Jt, {
3202
+ u.value.hasToolbar ? (g(), S(Zt, {
3167
3203
  key: 3,
3168
3204
  class: "table-toolbar-bottom",
3169
- items: f.value.toolbar,
3170
- "current-row": f.value.currentRow,
3205
+ items: u.value.toolbar,
3206
+ "current-row": u.value.currentRow,
3171
3207
  onAction: m.handleToolbarAction
3172
3208
  }, {
3173
- "toolbar-left": w((A) => [
3174
- T(u.$slots, "toolbar-left", q(j(A || {})), void 0, !0)
3209
+ "toolbar-left": w((R) => [
3210
+ k(f.$slots, "toolbar-left", q(O(R || {})), void 0, !0)
3175
3211
  ]),
3176
- "toolbar-extra": w((A) => [
3177
- T(u.$slots, "toolbar-extra", q(j(A || {})), void 0, !0)
3212
+ "toolbar-extra": w((R) => [
3213
+ k(f.$slots, "toolbar-extra", q(O(R || {})), void 0, !0)
3178
3214
  ]),
3179
3215
  _: 3
3180
3216
  }, 8, ["items", "current-row", "onAction"])) : D("", !0),
3181
- _(Ae, {
3217
+ _(Ee, {
3182
3218
  ref_key: "formRef",
3183
- ref: i
3219
+ ref: l
3184
3220
  }, null, 512)
3185
3221
  ], 6);
3186
3222
  };
3187
3223
  }
3188
- }), Aa = /* @__PURE__ */ $(Ra, [["__scopeId", "data-v-00444d8c"]]);
3189
- function Ia() {
3224
+ }), Ma = /* @__PURE__ */ $(Ea, [["__scopeId", "data-v-5d8fe268"]]);
3225
+ function Ua() {
3190
3226
  var o, t;
3191
3227
  try {
3192
3228
  if (typeof document < "u" && document.baseURI) {
@@ -3202,16 +3238,16 @@ function Ia() {
3202
3238
  }
3203
3239
  return typeof window < "u" ? window.location.origin : "";
3204
3240
  }
3205
- class Ma {
3241
+ class Ba {
3206
3242
  constructor(t) {
3207
- x(this, "axiosInstance");
3243
+ C(this, "axiosInstance");
3208
3244
  // 免配基地址:只解析一次并缓存(一个页面生命周期内不会变)
3209
- x(this, "baseUrl", "");
3210
- this.axiosInstance = Ve.create({
3245
+ C(this, "baseUrl", "");
3246
+ this.axiosInstance = $e.create({
3211
3247
  timeout: 1e4,
3212
3248
  baseURL: ""
3213
3249
  }), this.axiosInstance.defaults.headers["Content-Type"] = "application/json;charset=utf-8", this.axiosInstance.interceptors.request.use(
3214
- (e) => (e.headers.token = localStorage.getItem("token"), t.baseUrl ? e.baseURL = t.baseUrl : (this.baseUrl || (this.baseUrl = Ia()), e.baseURL = this.baseUrl), e),
3250
+ (e) => (e.headers.token = localStorage.getItem("token"), t.baseUrl ? e.baseURL = t.baseUrl : (this.baseUrl || (this.baseUrl = Ua()), e.baseURL = this.baseUrl), e),
3215
3251
  (e) => Promise.reject(e)
3216
3252
  ), this.axiosInstance.interceptors.response.use(
3217
3253
  (e) => e.config.responseType === "blob" ? e : e.data,
@@ -3252,11 +3288,11 @@ class Ma {
3252
3288
  });
3253
3289
  }
3254
3290
  }
3255
- class Ea {
3291
+ class Fa {
3256
3292
  //事件总线
3257
3293
  constructor() {
3258
- x(this, "emitter");
3259
- this.emitter = Ze();
3294
+ C(this, "emitter");
3295
+ this.emitter = tt();
3260
3296
  }
3261
3297
  On(t, e) {
3262
3298
  this.emitter.on(t, e);
@@ -3268,10 +3304,10 @@ class Ea {
3268
3304
  this.emitter.off(t, e);
3269
3305
  }
3270
3306
  }
3271
- class Ua {
3307
+ class La {
3272
3308
  constructor(t, e) {
3273
- x(this, "mqttClient", null);
3274
- x(this, "eventBus");
3309
+ C(this, "mqttClient", null);
3310
+ C(this, "eventBus");
3275
3311
  this.eventBus = t, this.connect(e).then();
3276
3312
  }
3277
3313
  async connect(t) {
@@ -3284,72 +3320,72 @@ class Ua {
3284
3320
  connectTimeout: 5e3,
3285
3321
  reconnectPeriod: 5e3
3286
3322
  };
3287
- let l = t.mqttUrl || "ws://127.0.0.1:5002/ws";
3288
- if (console.log("connect to mqtt..."), this.mqttClient = et.connect(l, e), !this.mqttClient) {
3323
+ let i = t.mqttUrl || "ws://127.0.0.1:5002/ws";
3324
+ if (console.log("connect to mqtt..."), this.mqttClient = at.connect(i, e), !this.mqttClient) {
3289
3325
  console.log("connect mqtt failed");
3290
3326
  return;
3291
3327
  }
3292
3328
  this.mqttClient.on("connect", () => {
3293
- console.log("=====> mqtt connect success!"), this.mqttClient.subscribe(fe, { qos: 0 }, (d) => {
3294
- console.log(d ? `mqtt subscribe [${fe}] failed` : `mqtt subscribe [${fe}] success`);
3329
+ console.log("=====> mqtt connect success!"), this.mqttClient.subscribe(me, { qos: 0 }, (r) => {
3330
+ console.log(r ? `mqtt subscribe [${me}] failed` : `mqtt subscribe [${me}] success`);
3295
3331
  });
3296
- }), this.mqttClient.on("message", (d, r) => {
3297
- const c = r.toString();
3298
- if (!c) {
3299
- console.error("Received empty message", d);
3332
+ }), this.mqttClient.on("message", (r, d) => {
3333
+ const s = d.toString();
3334
+ if (!s) {
3335
+ console.error("Received empty message", r);
3300
3336
  return;
3301
3337
  }
3302
- let s = null;
3338
+ let c = null;
3303
3339
  try {
3304
- s = JSON.parse(c);
3340
+ c = JSON.parse(s);
3305
3341
  } catch (a) {
3306
- console.error("Failed to parse message JSON", d, c, a);
3342
+ console.error("Failed to parse message JSON", r, s, a);
3307
3343
  return;
3308
3344
  }
3309
- if (!s || s.Content === void 0 || s.Content === null || !s.PType) {
3310
- console.log("parse notice failed!", c);
3345
+ if (!c || c.Content === void 0 || c.Content === null || !c.PType) {
3346
+ console.log("parse notice failed!", s);
3311
3347
  return;
3312
3348
  }
3313
- s.PType == Ba && this.eventBus.Emit(s.Route, s.Content);
3349
+ c.PType == Na && this.eventBus.Emit(c.Route, c.Content);
3314
3350
  }), this.mqttClient.on(ie.OffLine, () => {
3315
3351
  console.log("mqtt offline...");
3316
3352
  }), this.mqttClient.on(ie.Reconnect, () => {
3317
3353
  console.log("mqtt reconnecting...");
3318
3354
  }), this.mqttClient.on(ie.Close, () => {
3319
3355
  console.log("mqtt close");
3320
- }), this.mqttClient.on(ie.Error, (d) => {
3356
+ }), this.mqttClient.on(ie.Error, (r) => {
3321
3357
  console.log("mqtt error");
3322
3358
  });
3323
3359
  }
3324
3360
  // 生成随机字符串
3325
3361
  randomStr(t) {
3326
3362
  const e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
3327
- let l = "";
3328
- for (let d = 0; d < t; d++)
3329
- l += e.charAt(Math.floor(Math.random() * e.length));
3330
- return l;
3363
+ let i = "";
3364
+ for (let r = 0; r < t; r++)
3365
+ i += e.charAt(Math.floor(Math.random() * e.length));
3366
+ return i;
3331
3367
  }
3332
3368
  }
3333
- const fe = "Notice", Ba = "NOTICE", ie = {
3369
+ const me = "Notice", Na = "NOTICE", ie = {
3334
3370
  OffLine: "offline",
3335
3371
  Close: "close",
3336
3372
  Reconnect: "reconnect",
3337
3373
  Error: "error"
3338
3374
  };
3339
3375
  let se;
3340
- const xo = (o) => {
3376
+ const So = (o) => {
3341
3377
  if (!o)
3342
3378
  throw new Error("QfOptions is undefined");
3343
- if (!se && o && (se = new Fa(o)), !se)
3379
+ if (!se && o && (se = new Wa(o)), !se)
3344
3380
  throw new Error("Qf not initialized, please call GetQf(options) first");
3345
3381
  return se;
3346
3382
  };
3347
- class Fa {
3383
+ class Wa {
3348
3384
  constructor(t) {
3349
- x(this, "EventBus");
3350
- x(this, "WebApi");
3351
- x(this, "Mqtt");
3352
- x(this, "options");
3385
+ C(this, "EventBus");
3386
+ C(this, "WebApi");
3387
+ C(this, "Mqtt");
3388
+ C(this, "options");
3353
3389
  this.initQf(t);
3354
3390
  }
3355
3391
  /**
@@ -3358,7 +3394,7 @@ class Fa {
3358
3394
  initQf(t) {
3359
3395
  if (!t)
3360
3396
  throw new Error(`StartQf failed! options is ${t}`);
3361
- this.options = t, console.log("StartQf(), qfOptions=", t), this.EventBus = new Ea(), this.WebApi = new Ma(t), this.options.useMqtt && (this.Mqtt = new Ua(this.EventBus, t));
3397
+ this.options = t, console.log("StartQf(), qfOptions=", t), this.EventBus = new Fa(), this.WebApi = new Ba(t), this.options.useMqtt && (this.Mqtt = new La(this.EventBus, t));
3362
3398
  }
3363
3399
  // ==================== EventBus 相关 ====================
3364
3400
  On(t, e) {
@@ -3391,49 +3427,49 @@ class Fa {
3391
3427
  this.EventBus.On(t, e);
3392
3428
  }
3393
3429
  }
3394
- const La = {
3430
+ const za = {
3395
3431
  UInput: te,
3396
- UInputNumber: Pe,
3432
+ UInputNumber: Ae,
3397
3433
  UDict: ee,
3398
- UToggle: $e,
3399
- UCascader: Re,
3434
+ UToggle: Re,
3435
+ UCascader: Ie,
3400
3436
  UDate: de,
3401
- UMenu: Ct,
3402
- FormRender: Ae,
3403
- TableRender: Aa,
3437
+ UMenu: St,
3438
+ FormRender: Ee,
3439
+ TableRender: Ma,
3404
3440
  UFieldView: xe
3405
- }, Co = {
3441
+ }, Do = {
3406
3442
  install(o) {
3407
- o.use(Ue);
3408
- for (const [t, e] of Object.entries(La))
3443
+ o.use(Fe);
3444
+ for (const [t, e] of Object.entries(za))
3409
3445
  o.component(t, e);
3410
3446
  }
3411
3447
  };
3412
3448
  export {
3413
- Ae as FormRender,
3414
- xo as GetQf,
3415
- Aa as TableRender,
3416
- Re as UCascader,
3449
+ Ee as FormRender,
3450
+ So as GetQf,
3451
+ Ma as TableRender,
3452
+ Ie as UCascader,
3417
3453
  de as UDate,
3418
3454
  ee as UDict,
3419
3455
  xe as UFieldView,
3420
3456
  te as UInput,
3421
- Pe as UInputNumber,
3422
- Ct as UMenu,
3423
- $e as UToggle,
3457
+ Ae as UInputNumber,
3458
+ St as UMenu,
3459
+ Re as UToggle,
3424
3460
  K as apis,
3425
- yo as clearDictCache,
3426
- Co as default,
3427
- po as flattenDictTree,
3461
+ wo as clearDictCache,
3462
+ Do as default,
3463
+ yo as flattenDictTree,
3428
3464
  ae as getDict,
3429
- ve as mapDictTree,
3430
- be as normalizeDictNode,
3431
- z as notify,
3465
+ we as mapDictTree,
3466
+ ve as normalizeDictNode,
3467
+ N as notify,
3432
3468
  le as notifyUtil,
3433
- go as preloadDicts,
3434
- Ia as resolveBaseUrl,
3435
- bo as setDictCache,
3436
- we as toDictOptions,
3437
- lt as translateDict,
3438
- ho as translateDictSync
3469
+ vo as preloadDicts,
3470
+ Ua as resolveBaseUrl,
3471
+ Co as setDictCache,
3472
+ Ce as toDictOptions,
3473
+ it as translateDict,
3474
+ bo as translateDictSync
3439
3475
  };