@dazhicheng/ui 1.5.261 → 1.5.263

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/components/tt-api-component/index.vue2.js +41 -40
  2. package/dist/components/tt-button/index.vue2.js +10 -9
  3. package/dist/components/tt-drawer/src/RenderDrawer.vue.js +16 -15
  4. package/dist/components/tt-drawer/src/components/DrawerFooter.vue.js +3 -2
  5. package/dist/components/tt-drawer/src/components/DrawerHeader.vue2.js +3 -2
  6. package/dist/components/tt-drawer/src/props.js +3 -2
  7. package/dist/components/tt-form/index.js +7 -6
  8. package/dist/components/tt-form/src/components/FormActions.vue2.js +3 -2
  9. package/dist/components/tt-form/src/form-render/form.vue2.js +3 -2
  10. package/dist/components/tt-form/src/group-form/GroupForm.vue2.js +3 -2
  11. package/dist/components/tt-form/src/group-form/GroupSection.vue2.js +26 -25
  12. package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +3 -2
  13. package/dist/components/tt-form/src/hooks/useSelectCollapse.js +82 -64
  14. package/dist/components/tt-form/src/index.vue2.js +3 -2
  15. package/dist/components/tt-log/index.vue.js +5 -4
  16. package/dist/components/tt-modal/src/RenderModal.vue.js +3 -2
  17. package/dist/components/tt-modal/src/components/ModalHeader.vue2.js +7 -6
  18. package/dist/components/tt-modal/src/components/ModalWrapper.vue.js +3 -2
  19. package/dist/components/tt-modal/src/props.js +3 -2
  20. package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue.js +3 -2
  21. package/dist/components/tt-panel-select/src/components/PanelLeft.vue.js +29 -23
  22. package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.js +89 -81
  23. package/dist/components/tt-panel-select/src/components/PanelRight.vue.js +49 -43
  24. package/dist/components/tt-panel-select/src/hooks/usePanelData.js +56 -49
  25. package/dist/components/tt-panel-select/src/hooks/usePanelSelection.d.ts +3 -0
  26. package/dist/components/tt-panel-select/src/hooks/usePanelSelection.js +94 -61
  27. package/dist/components/tt-panel-select/src/index.vue.d.ts +1 -1
  28. package/dist/components/tt-panel-select/src/index.vue.js +205 -190
  29. package/dist/components/tt-radio-group/index.vue.js +11 -10
  30. package/dist/components/tt-select/src/Select.vue.js +3 -2
  31. package/dist/components/tt-select/src/components/SelectTable.vue.js +3 -2
  32. package/dist/components/tt-select/src/components/Table.vue.js +3 -2
  33. package/dist/components/tt-table/index.js +1 -1
  34. package/dist/components/tt-table/src/Table.vue.js +45 -44
  35. package/dist/components/tt-table/src/TableForm.vue.js +1 -1
  36. package/dist/components/tt-table/src/components/TableAction.vue.js +12 -11
  37. package/dist/components/tt-table/src/components/TableButtons.js +3 -2
  38. package/dist/components/tt-table/src/components/TableColumnModal.vue2.js +34 -33
  39. package/dist/components/tt-table/src/props.js +5 -4
  40. package/dist/components/tt-upload/src/TtUpload.vue.js +15 -14
  41. package/dist/hooks/basicDataCodes.d.ts +4 -1
  42. package/dist/hooks/basicDataCodes.js +35 -33
  43. package/dist/hooks/usePanelSelectSchemas.d.ts +3 -2
  44. package/dist/hooks/usePanelSelectSchemas.js +62 -62
  45. package/dist/hooks/useScreenshotOss.js +3 -2
  46. package/dist/plugins/vxeTable/switchStatus.js +3 -2
  47. package/dist/style.css +1 -1
  48. package/package.json +3 -3
@@ -8,7 +8,7 @@ import { TtButton as te } from "../../../tt-button/index.js";
8
8
  import "../../../../node_modules/.pnpm/vue-types@5.1.3_vue@3.5.21_typescript@5.9.3_/node_modules/vue-types/shim/index.modern.js";
9
9
  import { useDesign as oe } from "../../../../packages/hooks/src/useDesign.js";
10
10
  import "axios";
11
- import { ElScrollbar as B, ElCheckbox as N, ElCheckboxGroup as ne, ElTooltip as ie } from "element-plus";
11
+ import { ElScrollbar as B, ElCheckbox as N, ElCheckboxGroup as ie, ElTooltip as ne } from "element-plus";
12
12
  import "dayjs";
13
13
  import "xe-utils";
14
14
  import "dayjs/plugin/utc";
@@ -19,9 +19,10 @@ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/en
19
19
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
20
20
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
21
21
  import "lodash-es";
22
+ import "vue-router";
22
23
  import ae from "sortablejs";
23
24
  import { useModalRender as se } from "../../../tt-modal/src/hooks/useModalRender.js";
24
- const re = ["aria-label", "onClick"], Pe = /* @__PURE__ */ Q({
25
+ const re = ["aria-label", "onClick"], Be = /* @__PURE__ */ Q({
25
26
  __name: "TableColumnModal",
26
27
  props: {
27
28
  openColumn: { type: Function },
@@ -29,26 +30,26 @@ const re = ["aria-label", "onClick"], Pe = /* @__PURE__ */ Q({
29
30
  },
30
31
  emits: ["on-submit"],
31
32
  setup(z, { expose: A, emit: I }) {
32
- const m = z, D = I, { prefixCls: i } = oe("table-column-modal"), [L, g] = se(), u = x([]), n = x([]), y = x(!1);
33
+ const m = z, D = I, { prefixCls: n } = oe("table-column-modal"), [L, g] = se(), u = x([]), i = x([]), y = x(!1);
33
34
  let p = null;
34
35
  const E = b(
35
- () => n.value.map((t) => u.value.find((l) => l.field === t)).filter(Boolean)
36
- ), R = b(() => u.value.filter((t) => !t.locked)), G = b(() => n.value.filter((t) => !M(t))), S = b(() => G.value.length === R.value.length), O = b(() => n.value.length > 0 && !S.value);
36
+ () => i.value.map((t) => u.value.find((l) => l.field === t)).filter(Boolean)
37
+ ), R = b(() => u.value.filter((t) => !t.locked)), G = b(() => i.value.filter((t) => !M(t))), S = b(() => G.value.length === R.value.length), O = b(() => i.value.length > 0 && !S.value);
37
38
  function M(t) {
38
39
  return u.value.some((l) => l.field === t && l.locked);
39
40
  }
40
41
  function U(t) {
41
- n.value = u.value.filter((l) => l.locked ? n.value.includes(l.field) : !!t).map((l) => l.field);
42
+ i.value = u.value.filter((l) => l.locked ? i.value.includes(l.field) : !!t).map((l) => l.field);
42
43
  }
43
44
  function j(t) {
44
- n.value = n.value.filter((l) => l !== t);
45
+ i.value = i.value.filter((l) => l !== t);
45
46
  }
46
47
  function q() {
47
- n.value = n.value.filter(M);
48
+ i.value = i.value.filter(M);
48
49
  }
49
50
  function _() {
50
51
  D("on-submit", {
51
- checkedModel: [...n.value],
52
+ checkedModel: [...i.value],
52
53
  modalApi: g,
53
54
  isExport: y.value
54
55
  });
@@ -56,7 +57,7 @@ const re = ["aria-label", "onClick"], Pe = /* @__PURE__ */ Q({
56
57
  function H({ columns: t, displayFields: l = [], disabledColumnField: o, isExport: v }) {
57
58
  y.value = v ?? !1, u.value = t.filter((d) => d.field).map((d) => ({ ...d, locked: o.includes(d.field) }));
58
59
  const k = new Set(u.value.map((d) => d.field));
59
- n.value = [...new Set(l.filter((d) => k.has(d)))], g.openModal();
60
+ i.value = [...new Set(l.filter((d) => k.has(d)))], g.openModal();
60
61
  }
61
62
  function J(t) {
62
63
  p == null || p.destroy(), p = null, t && (p = ae.create(t, {
@@ -66,8 +67,8 @@ const re = ["aria-label", "onClick"], Pe = /* @__PURE__ */ Q({
66
67
  l.item.style.opacity = "1";
67
68
  const { oldIndex: o, newIndex: v } = l;
68
69
  if (o == null || v == null) return;
69
- const k = [...n.value];
70
- k.splice(v, 0, ...k.splice(o, 1)), n.value = k;
70
+ const k = [...i.value];
71
+ k.splice(v, 0, ...k.splice(o, 1)), i.value = k;
71
72
  }
72
73
  }));
73
74
  }
@@ -83,12 +84,12 @@ const re = ["aria-label", "onClick"], Pe = /* @__PURE__ */ Q({
83
84
  }
84
85
  }), (t, l) => (f(), F(e(L), {
85
86
  width: "720",
86
- class: a(e(i)),
87
+ class: a(e(n)),
87
88
  onOk: _
88
89
  }, W({
89
90
  beforeFooter: s(() => [
90
91
  c("div", {
91
- class: a(`${e(i)}-footer-left`)
92
+ class: a(`${e(n)}-footer-left`)
92
93
  }, [
93
94
  r(e(te), { onClick: K }, {
94
95
  default: s(() => [...l[1] || (l[1] = [
@@ -101,27 +102,27 @@ const re = ["aria-label", "onClick"], Pe = /* @__PURE__ */ Q({
101
102
  ]),
102
103
  default: s(() => [
103
104
  c("div", {
104
- class: a(`${e(i)}-body`)
105
+ class: a(`${e(n)}-body`)
105
106
  }, [
106
107
  r(e(B), {
107
- class: a(`${e(i)}-source`)
108
+ class: a(`${e(n)}-source`)
108
109
  }, {
109
110
  default: s(() => [
110
111
  r(e(N), {
111
- class: a(`${e(i)}-all`),
112
+ class: a(`${e(n)}-all`),
112
113
  "model-value": S.value,
113
114
  indeterminate: O.value,
114
115
  onChange: U
115
116
  }, {
116
117
  default: s(() => [
117
- h(" 全部(" + $(n.value.length) + "/" + $(u.value.length) + ") ", 1)
118
+ h(" 全部(" + $(i.value.length) + "/" + $(u.value.length) + ") ", 1)
118
119
  ]),
119
120
  _: 1
120
121
  }, 8, ["class", "model-value", "indeterminate"]),
121
- r(e(ne), {
122
- modelValue: n.value,
123
- "onUpdate:modelValue": l[0] || (l[0] = (o) => n.value = o),
124
- class: a(`${e(i)}-group`)
122
+ r(e(ie), {
123
+ modelValue: i.value,
124
+ "onUpdate:modelValue": l[0] || (l[0] = (o) => i.value = o),
125
+ class: a(`${e(n)}-group`)
125
126
  }, {
126
127
  default: s(() => [
127
128
  (f(!0), C(w, null, T(u.value, (o) => (f(), F(e(N), {
@@ -130,7 +131,7 @@ const re = ["aria-label", "onClick"], Pe = /* @__PURE__ */ Q({
130
131
  disabled: o.locked
131
132
  }, {
132
133
  default: s(() => [
133
- r(e(ie), {
134
+ r(e(ne), {
134
135
  content: o.title || "",
135
136
  "show-after": 400,
136
137
  placement: "top"
@@ -150,14 +151,14 @@ const re = ["aria-label", "onClick"], Pe = /* @__PURE__ */ Q({
150
151
  _: 1
151
152
  }, 8, ["class"]),
152
153
  c("div", {
153
- class: a(`${e(i)}-picked`)
154
+ class: a(`${e(n)}-picked`)
154
155
  }, [
155
156
  c("header", {
156
- class: a(`${e(i)}-picked-head`)
157
+ class: a(`${e(n)}-picked-head`)
157
158
  }, [
158
159
  c("span", null, "已选 " + $(E.value.length) + " 列", 1),
159
160
  c("span", {
160
- class: a(`${e(i)}-clear`),
161
+ class: a(`${e(n)}-clear`),
161
162
  onClick: q
162
163
  }, "清空", 2)
163
164
  ], 2),
@@ -165,24 +166,24 @@ const re = ["aria-label", "onClick"], Pe = /* @__PURE__ */ Q({
165
166
  default: s(() => [
166
167
  c("ul", {
167
168
  ref: J,
168
- class: a(`${e(i)}-list`)
169
+ class: a(`${e(n)}-list`)
169
170
  }, [
170
171
  (f(!0), C(w, null, T(E.value, (o) => (f(), C("li", {
171
172
  key: o.field,
172
- class: a(`${e(i)}-item`)
173
+ class: a(`${e(n)}-item`)
173
174
  }, [
174
175
  c("span", {
175
- class: a(`${e(i)}-item-main`)
176
+ class: a(`${e(n)}-item-main`)
176
177
  }, [
177
178
  r(e(P), {
178
- class: a(`${e(i)}-item-drag`),
179
+ class: a(`${e(n)}-item-drag`),
179
180
  size: 14,
180
181
  icon: e(ee),
181
182
  "is-custom-svg": ""
182
183
  }, null, 8, ["class", "icon"]),
183
184
  r(e(le), {
184
185
  "tool-tip": !1,
185
- class: a(`${e(i)}-item-title`)
186
+ class: a(`${e(n)}-item-title`)
186
187
  }, {
187
188
  default: s(() => [
188
189
  h($(o.title || ""), 1)
@@ -193,7 +194,7 @@ const re = ["aria-label", "onClick"], Pe = /* @__PURE__ */ Q({
193
194
  o.locked ? X("", !0) : (f(), C("button", {
194
195
  key: 0,
195
196
  type: "button",
196
- class: a(`${e(i)}-item-remove`),
197
+ class: a(`${e(n)}-item-remove`),
197
198
  "aria-label": `移除${o.title || ""}`,
198
199
  onClick: Y((v) => j(o.field), ["stop"])
199
200
  }, [
@@ -223,5 +224,5 @@ const re = ["aria-label", "onClick"], Pe = /* @__PURE__ */ Q({
223
224
  }
224
225
  });
225
226
  export {
226
- Pe as default
227
+ Be as default
227
228
  };
@@ -13,6 +13,7 @@ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-
13
13
  import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
14
14
  import "lodash-es";
15
15
  import { propTypes as t } from "../../../packages/hooks/src/propTypes.js";
16
+ import "vue-router";
16
17
  import { GlobalConfig as o } from "../../../hooks/useSetup.js";
17
18
  const f = {
18
19
  /** 是否显示分页 */
@@ -372,7 +373,7 @@ const f = {
372
373
  d(l.default) ? e[r] = l.default() : e[r] = l.default;
373
374
  }
374
375
  return e;
375
- }, {}), B = {
376
+ }, {}), R = {
376
377
  tableData: {
377
378
  type: Array,
378
379
  default: () => []
@@ -421,7 +422,7 @@ const f = {
421
422
  tableFormApi: {
422
423
  type: Object
423
424
  }
424
- }, R = {
425
+ }, k = {
425
426
  /** 列配置 */
426
427
  columns: {
427
428
  type: Array,
@@ -488,8 +489,8 @@ const f = {
488
489
  ...b
489
490
  };
490
491
  export {
491
- B as tableFormProps,
492
- R as tableOtherProps,
492
+ R as tableFormProps,
493
+ k as tableOtherProps,
493
494
  b as tableProProps,
494
495
  p as tableProps
495
496
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as de, mergeModels as z, useModel as ce, useSlots as fe, ref as b, computed as m, createBlock as pe, openBlock as me, createVNode as a, mergeProps as we, createTextVNode as w } from "vue";
1
+ import { defineComponent as de, mergeModels as z, useModel as ce, useSlots as pe, ref as b, computed as m, createBlock as fe, openBlock as me, createVNode as a, mergeProps as we, createTextVNode as w } from "vue";
2
2
  import ve from "../../../assets/svg/exportSvg.svg.js";
3
3
  import A from "../../../assets/svg/fileSvg.svg.js";
4
4
  import { TtButton as $ } from "../../tt-button/index.js";
@@ -7,7 +7,7 @@ import "../../tt-modal/index.js";
7
7
  import "../../../node_modules/.pnpm/vue-types@5.1.3_vue@3.5.21_typescript@5.9.3_/node_modules/vue-types/shim/index.modern.js";
8
8
  import { useDesign as ge } from "../../../packages/hooks/src/useDesign.js";
9
9
  import "axios";
10
- import { ElMessage as f, ElImageViewer as _e, ElUpload as he } from "element-plus";
10
+ import { ElMessage as p, ElImageViewer as _e, ElUpload as he } from "element-plus";
11
11
  import { isString as ye, isNumber as Ue } from "../../../packages/utils/src/is.js";
12
12
  import "xe-utils";
13
13
  import "dayjs";
@@ -19,12 +19,13 @@ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-u
19
19
  import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
20
20
  import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
21
21
  import { omit as be, isFunction as R } from "lodash-es";
22
+ import "vue-router";
22
23
  import { TtText as V } from "../../tt-text/index.js";
23
24
  /* empty css */
24
25
  import { ttUploadProps as $e } from "./typing.js";
25
26
  import { GlobalConfig as F } from "../../../hooks/useSetup.js";
26
27
  import { useModalRender as Se } from "../../tt-modal/src/hooks/useModalRender.js";
27
- const Je = /* @__PURE__ */ de({
28
+ const Qe = /* @__PURE__ */ de({
28
29
  name: "TtUpload",
29
30
  __name: "TtUpload",
30
31
  props: /* @__PURE__ */ z($e, {
@@ -48,9 +49,9 @@ const Je = /* @__PURE__ */ de({
48
49
  var u;
49
50
  if (!(t != null && t.trim())) return !0;
50
51
  const l = e.includes(".") ? ((u = e.split(".").pop()) == null ? void 0 : u.toLowerCase()) ?? "" : "";
51
- return t.split(",").map((p) => p.trim()).filter(Boolean).some((p) => p.startsWith(".") ? l === p.slice(1).toLowerCase() : p.endsWith("/*") ? o.startsWith(p.slice(0, -1)) : o === p);
52
+ return t.split(",").map((f) => f.trim()).filter(Boolean).some((f) => f.startsWith(".") ? l === f.slice(1).toLowerCase() : f.endsWith("/*") ? o.startsWith(f.slice(0, -1)) : o === f);
52
53
  }
53
- const i = C, c = P, s = ce(C, "modelValue"), d = fe(), {
54
+ const i = C, c = P, s = ce(C, "modelValue"), d = pe(), {
54
55
  prefixCls: n
55
56
  } = ge("upload"), x = b(), y = b(!1), k = b([]), [j, v] = Se({
56
57
  onOk() {
@@ -106,7 +107,7 @@ const Je = /* @__PURE__ */ de({
106
107
  };
107
108
  return s.value = [...s.value, r], c("afterUpload", r), e.onSuccess(r), r;
108
109
  } catch (t) {
109
- f.warning((t == null ? void 0 : t.message) ?? "上传失败"), T(t, e);
110
+ p.warning((t == null ? void 0 : t.message) ?? "上传失败"), T(t, e);
110
111
  }
111
112
  }
112
113
  async function Y(e) {
@@ -122,9 +123,9 @@ const Je = /* @__PURE__ */ de({
122
123
  file: e.file,
123
124
  uid: e.file.uid
124
125
  };
125
- s.value = [...s.value, u], f.success("上传成功"), c("afterUpload", u), e.onSuccess(l);
126
+ s.value = [...s.value, u], p.success("上传成功"), c("afterUpload", u), e.onSuccess(l);
126
127
  } catch (l) {
127
- f.warning((l == null ? void 0 : l.message) ?? "上传失败"), T(l, e);
128
+ p.warning((l == null ? void 0 : l.message) ?? "上传失败"), T(l, e);
128
129
  }
129
130
  }
130
131
  function H(e, o, t) {
@@ -143,12 +144,12 @@ const Je = /* @__PURE__ */ de({
143
144
  }));
144
145
  function Q(e) {
145
146
  if (!K(e.name, e.type, i.accept))
146
- return f.warning(`文件格式不支持,仅支持:${i.accept}`), !1;
147
+ return p.warning(`文件格式不支持,仅支持:${i.accept}`), !1;
147
148
  const o = s.value.map((t) => ye(t.fileSize) || Ue(t.fileSize) ? +t.fileSize : 0).reduce((t, l) => t + l, 0);
148
- return i.maxSize && (e.size + o) / 1024 / 1024 > i.maxSize ? (f.warning(`文件大小不能超过 ${i.maxSize}MB`), !1) : g.value > 0 && s.value.length >= g.value ? (f.warning("已超过上传数量"), !1) : R(i.beforeUpload) ? i.beforeUpload(e) : !0;
149
+ return i.maxSize && (e.size + o) / 1024 / 1024 > i.maxSize ? (p.warning(`文件大小不能超过 ${i.maxSize}MB`), !1) : g.value > 0 && s.value.length >= g.value ? (p.warning("已超过上传数量"), !1) : R(i.beforeUpload) ? i.beforeUpload(e) : !0;
149
150
  }
150
151
  function Z() {
151
- f.warning("已超过上传数量");
152
+ p.warning("已超过上传数量");
152
153
  }
153
154
  function h(e) {
154
155
  return e.ossKey ? e.ossKey : e.uid != null ? e.uid : e.fileName;
@@ -171,7 +172,7 @@ const Je = /* @__PURE__ */ de({
171
172
  })).find((u) => u.fileName === e.ossKey)) == null ? void 0 : t.fileUrl;
172
173
  return e.url = r, r;
173
174
  } catch (l) {
174
- f.warning((l == null ? void 0 : l.message) ?? "获取文件地址失败");
175
+ p.warning((l == null ? void 0 : l.message) ?? "获取文件地址失败");
175
176
  return;
176
177
  }
177
178
  }
@@ -309,9 +310,9 @@ const Je = /* @__PURE__ */ de({
309
310
  }, ue = () => i.modal ? a(j, null, {
310
311
  default: () => M()
311
312
  }) : M();
312
- return (e, o) => (me(), pe(ue));
313
+ return (e, o) => (me(), fe(ue));
313
314
  }
314
315
  });
315
316
  export {
316
- Je as default
317
+ Qe as default
317
318
  };
@@ -39,6 +39,7 @@ export type BasicDataOption = {
39
39
  * - continent / region / country:按洲 / 区域 / 国家树形分组
40
40
  * - businessType / primaryReason / supplierManageName:按业务字段树形分组
41
41
  * - pinyin:按拼音首字母分组(TtPanelSelect showPinyinMode)
42
+ * - none:不分组,原样平铺(TtPanelSelect showOriginMode)
42
43
  */
43
44
  export declare const GROUP_BY: {
44
45
  readonly CONTINENT: "continent";
@@ -51,11 +52,13 @@ export declare const GROUP_BY: {
51
52
  /** 按供应商名称(配置号) */
52
53
  readonly SUPPLIER_MANAGE_NAME: "supplierManageName";
53
54
  readonly PINYIN: "pinyin";
55
+ /** 不分组,原样平铺 */
56
+ readonly NONE: "none";
54
57
  };
55
58
  export type PanelSelectGroupBy = (typeof GROUP_BY)[keyof typeof GROUP_BY];
56
59
  /**
57
60
  * 将扁平 options 按分组字段转为树形(父节点 + children)。
58
- * `pinyin` 或不支持的分组原样返回,交由组件拼音模式处理。
61
+ * `pinyin` / `none` 或不支持的分组原样返回,交由组件拼音/平铺模式处理。
59
62
  */
60
63
  export declare function groupBasicDataOptions(options: BasicDataOption[], groupBy: PanelSelectGroupBy): BasicDataOption[];
61
64
  /** 各 code 默认分组;未特殊指定时为拼音 */
@@ -1,7 +1,7 @@
1
- import { getAllBasicAirline as R, getDictItemsByCodes as O, listChainByTypeAirportRegionLevel as A } from "../api/basicData.js";
1
+ import { getAllBasicAirline as O, getDictItemsByCodes as R, listChainByTypeAirportRegionLevel as A } from "../api/basicData.js";
2
2
  import { queryAllRoles as L, pageUser as I } from "../api/dataTypeContext.js";
3
- import { secondaryDropdownListLossReason as _, primaryDropdownListLossReason as S } from "../api/lossReason.js";
4
- import { listAllValidSupplierManage as T, getAllConfigListSupplierConfigManage as b } from "../api/supplier.js";
3
+ import { secondaryDropdownListLossReason as T, primaryDropdownListLossReason as C } from "../api/lossReason.js";
4
+ import { listAllValidSupplierManage as _, getAllConfigListSupplierConfigManage as b } from "../api/supplier.js";
5
5
  const o = {
6
6
  AIRLINE: "airline",
7
7
  CONTINENT: "continent",
@@ -35,7 +35,9 @@ const o = {
35
35
  PRIMARY_REASON: "primaryReason",
36
36
  /** 按供应商名称(配置号) */
37
37
  SUPPLIER_MANAGE_NAME: "supplierManageName",
38
- PINYIN: "pinyin"
38
+ PINYIN: "pinyin",
39
+ /** 不分组,原样平铺 */
40
+ NONE: "none"
39
41
  }, g = {
40
42
  [d.CONTINENT]: { codeKey: "continentCode", nameKey: "continentName" },
41
43
  [d.REGION]: { codeKey: "regionCode", nameKey: "regionName" },
@@ -54,19 +56,19 @@ const o = {
54
56
  };
55
57
  function H(a, e) {
56
58
  if (!Array.isArray(a) || !a.length) return a || [];
57
- if (e === d.PINYIN) return a;
59
+ if (e === d.PINYIN || e === d.NONE) return a;
58
60
  const r = g[e];
59
61
  if (!r) return a;
60
62
  const l = /* @__PURE__ */ new Map(), s = [], n = r.labelMode || "codeName";
61
63
  return a.forEach((u) => {
62
- const t = u[r.codeKey], c = t != null && t !== "", i = c ? String(t) : "__unknown__";
64
+ const t = u[r.codeKey], f = t != null && t !== "", i = f ? String(t) : "__unknown__";
63
65
  if (!l.has(i)) {
64
66
  s.push(i);
65
- const f = u[r.nameKey];
67
+ const c = u[r.nameKey];
66
68
  let E = "未知";
67
- c && (n === "name" ? E = f != null && String(f) !== "" ? String(f) : String(t) : E = `${t}(${f || ""})`), l.set(i, {
69
+ f && (n === "name" ? E = c != null && String(c) !== "" ? String(c) : String(t) : E = `${t}(${c || ""})`), l.set(i, {
68
70
  label: E,
69
- value: c ? t : "__unknown__",
71
+ value: f ? t : "__unknown__",
70
72
  children: []
71
73
  });
72
74
  }
@@ -74,7 +76,7 @@ function H(a, e) {
74
76
  }), s.map((u) => l.get(u));
75
77
  }
76
78
  function W(a, e) {
77
- return e || (a === o.AIRPORT ? d.COUNTRY : a === o.LOSS_REASON ? d.BUSINESS_TYPE : a === o.LOSS_REASON_SECONDARY ? d.PRIMARY_REASON : a === o.SUPPLIER_CONFIG ? d.SUPPLIER_MANAGE_NAME : d.PINYIN);
79
+ return e || (a === o.CONTINENT ? d.NONE : a === o.AIRPORT || a === o.CITY ? d.COUNTRY : a === o.COUNTRY || a === o.REGION ? d.CONTINENT : a === o.LOSS_REASON ? d.BUSINESS_TYPE : a === o.LOSS_REASON_SECONDARY ? d.PRIMARY_REASON : a === o.SUPPLIER_CONFIG ? d.SUPPLIER_MANAGE_NAME : d.PINYIN);
78
80
  }
79
81
  const h = {
80
82
  1: { codeKey: "continentCode", nameKey: "continentName", statusKey: "continentStatus" },
@@ -100,29 +102,29 @@ function K(a) {
100
102
  for (const u of [1, 2, 3, 4, 5]) {
101
103
  const t = a[String(u)] || a[u];
102
104
  if (!t || typeof t != "object") continue;
103
- const c = Number(t.type ?? u);
104
- c >= s && (s = c, l = t);
105
+ const f = Number(t.type ?? u);
106
+ f >= s && (s = f, l = t);
105
107
  }
106
108
  const n = { ...l };
107
109
  for (const u of [1, 2, 3, 4, 5]) {
108
110
  const t = a[String(u)] || a[u];
109
111
  if (!t || typeof t != "object") continue;
110
- const { codeKey: c, nameKey: i, statusKey: f } = h[u];
111
- t.code !== void 0 && t.code !== null && t.code !== "" && (n[c] = t.code), t.name !== void 0 && (n[i] = t.name), t.status !== void 0 && (n[f] = t.status);
112
+ const { codeKey: f, nameKey: i, statusKey: c } = h[u];
113
+ t.code !== void 0 && t.code !== null && t.code !== "" && (n[f] = t.code), t.name !== void 0 && (n[i] = t.name), t.status !== void 0 && (n[c] = t.status);
112
114
  }
113
115
  return n;
114
116
  }
115
117
  function M(a) {
116
118
  return (Array.isArray(a) ? a : []).map((r) => K(r || {}));
117
119
  }
118
- function w(a = [], e, r) {
120
+ function Y(a = [], e, r) {
119
121
  return (Array.isArray(a) ? a : []).filter((l) => l == null ? void 0 : l[e]).map((l) => ({
120
122
  ...l,
121
123
  label: `${l[e]}(${l[r] || ""})`,
122
124
  value: l[e]
123
125
  }));
124
126
  }
125
- const Y = [o.CONTINENT, o.REGION, o.COUNTRY, o.CITY, o.AIRPORT], y = {
127
+ const w = [o.CONTINENT, o.REGION, o.COUNTRY, o.CITY, o.AIRPORT], N = {
126
128
  [o.CONTINENT]: 1,
127
129
  [o.REGION]: 2,
128
130
  [o.COUNTRY]: 3,
@@ -136,14 +138,14 @@ const Y = [o.CONTINENT, o.REGION, o.COUNTRY, o.CITY, o.AIRPORT], y = {
136
138
  [o.AIRPORT]: { codeKey: "airportCode", nameKey: "airportName" }
137
139
  };
138
140
  o.CONTINENT, o.REGION, o.COUNTRY, o.CITY;
139
- function N(a) {
140
- return Y.includes(a);
141
+ function y(a) {
142
+ return w.includes(a);
141
143
  }
142
144
  function J(a, e) {
143
- return !N(a) || !N(e) ? !1 : y[a] > y[e];
145
+ return !y(a) || !y(e) ? !1 : N[a] > N[e];
144
146
  }
145
147
  function Q(a, e) {
146
- if (!N(e)) return [];
148
+ if (!y(e)) return [];
147
149
  const { codeKey: r, nameKey: l } = U[e], s = /* @__PURE__ */ new Map();
148
150
  return (Array.isArray(a) ? a : []).forEach((n) => {
149
151
  const u = n == null ? void 0 : n[r];
@@ -159,14 +161,14 @@ function Q(a, e) {
159
161
  function X(a) {
160
162
  let e;
161
163
  for (const r of a)
162
- N(r) && (!e || y[r] > y[e]) && (e = r);
164
+ y(r) && (!e || N[r] > N[e]) && (e = r);
163
165
  return e;
164
166
  }
165
167
  function p(a, e, r) {
166
168
  return async () => {
167
169
  try {
168
170
  const l = await A({ type: a });
169
- return w(M(l), e, r);
171
+ return Y(M(l), e, r);
170
172
  } catch {
171
173
  return [];
172
174
  }
@@ -202,10 +204,10 @@ function F(a = []) {
202
204
  });
203
205
  }), s;
204
206
  }
205
- function C(a, e = D) {
207
+ function S(a, e = D) {
206
208
  return async (r) => {
207
209
  try {
208
- const l = await O({
210
+ const l = await R({
209
211
  dictCodeList: [a],
210
212
  permissionOnlyCode: r == null ? void 0 : r.permissionOnlyCode
211
213
  }), s = (l == null ? void 0 : l[a]) || [];
@@ -274,7 +276,7 @@ const Z = {
274
276
  defaultShowAll: !0,
275
277
  async fetchOptions() {
276
278
  try {
277
- const a = await R();
279
+ const a = await O();
278
280
  return v(a || []);
279
281
  } catch {
280
282
  return [];
@@ -334,7 +336,7 @@ const Z = {
334
336
  valueField: "value",
335
337
  parentField: "parentItemCode"
336
338
  },
337
- fetchOptions: C(o.SALES_ORDER_TYPE, F)
339
+ fetchOptions: S(o.SALES_ORDER_TYPE, F)
338
340
  },
339
341
  [o.SALES_ORDER_PRODUCT_TYPE]: {
340
342
  defaultFieldName: "productType",
@@ -348,7 +350,7 @@ const Z = {
348
350
  valueField: "itemCode",
349
351
  parentField: "parentItemCode"
350
352
  },
351
- fetchOptions: C(o.SALES_ORDER_PRODUCT_TYPE)
353
+ fetchOptions: S(o.SALES_ORDER_PRODUCT_TYPE)
352
354
  },
353
355
  [o.USER]: {
354
356
  defaultFieldName: "userIds",
@@ -388,7 +390,7 @@ const Z = {
388
390
  defaultShowAll: !1,
389
391
  async fetchOptions() {
390
392
  try {
391
- const a = await S();
393
+ const a = await C();
392
394
  return x(a || []);
393
395
  } catch {
394
396
  return [];
@@ -404,8 +406,8 @@ const Z = {
404
406
  async fetchOptions() {
405
407
  try {
406
408
  const [a, e] = await Promise.all([
407
- _(),
408
- S()
409
+ T(),
410
+ C()
409
411
  ]), r = /* @__PURE__ */ new Map();
410
412
  return (e || []).forEach((l) => {
411
413
  (l == null ? void 0 : l.id) !== void 0 && (l == null ? void 0 : l.id) !== null && r.set(l.id, l.reasonName || String(l.id));
@@ -438,7 +440,7 @@ const Z = {
438
440
  defaultShowAll: !1,
439
441
  async fetchOptions() {
440
442
  try {
441
- const a = await T();
443
+ const a = await _();
442
444
  return V(a || []);
443
445
  } catch {
444
446
  return [];
@@ -449,12 +451,12 @@ const Z = {
449
451
  export {
450
452
  o as CODES,
451
453
  Z as CODE_REGISTRY,
452
- Y as GEO_LEVEL_CODES,
454
+ w as GEO_LEVEL_CODES,
453
455
  d as GROUP_BY,
454
456
  J as canDeriveGeoLevel,
455
457
  Q as deriveRegionLevelOptionsFromGeoSource,
456
458
  H as groupBasicDataOptions,
457
- N as isGeoLevelCode,
459
+ y as isGeoLevelCode,
458
460
  W as resolveDefaultGroupBy,
459
461
  X as resolveHighestGeoLevelCode
460
462
  };
@@ -52,8 +52,9 @@ export interface PanelSelectFieldConfig {
52
52
  exclude?: PanelSelectExcludeConfig;
53
53
  /**
54
54
  * 分组方式。
55
- * - 机场默认 `country`;亏损原因默认 `businessType`;细类默认 `primaryReason`;配置号默认 `supplierManageName`
56
- * - 可传 `continent` / `region` / `country` / `businessType` / `primaryReason` / `supplierManageName` / `pinyin`
55
+ * - 洲默认 `none`;机场/城市默认 `country`;国家/区域默认 `continent`
56
+ * - 亏损原因默认 `businessType`;细类默认 `primaryReason`;配置号默认 `supplierManageName`
57
+ * - 可传 `continent` / `region` / `country` / `businessType` / `primaryReason` / `supplierManageName` / `pinyin` / `none`
57
58
  * - 也可用 `GROUP_BY.CONTINENT` 等常量
58
59
  */
59
60
  groupBy?: PanelSelectGroupBy;