urit-qf-ui 0.2.0 → 0.2.3

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