@dazhicheng/ui 1.6.79 → 1.6.81

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 (53) hide show
  1. package/dist/api/supplier.d.ts +16 -0
  2. package/dist/api/supplier.js +39 -12
  3. package/dist/assets/svg/download.svg.js +1 -1
  4. package/dist/components/tt-area/TtArea.vue.js +1 -1
  5. package/dist/components/tt-button/index.d.ts +28 -28
  6. package/dist/components/tt-button/index.vue.d.ts +16 -16
  7. package/dist/components/tt-custom-export-modal/src/assets/search.svg.js +5 -5
  8. package/dist/components/tt-custom-export-modal/src/assets/star.svg.js +3 -3
  9. package/dist/components/tt-custom-export-modal/src/assets/trash.svg.js +7 -7
  10. package/dist/components/tt-custom-export-modal/src/components/FieldGridSection.vue.js +1 -1
  11. package/dist/components/tt-drawer/index.d.ts +109 -109
  12. package/dist/components/tt-drawer/src/RenderDrawer.vue.d.ts +60 -60
  13. package/dist/components/tt-drawer/src/components/DrawerHeader.vue.js +2 -2
  14. package/dist/components/tt-empty/index.d.ts +4 -4
  15. package/dist/components/tt-form/src/components/FormElInput.vue.d.ts +10 -10
  16. package/dist/components/tt-icon/index.vue.js +2 -2
  17. package/dist/components/tt-image/index.d.ts +29 -29
  18. package/dist/components/tt-image/src/components/ImageViewer.d.ts +20 -20
  19. package/dist/components/tt-image/tt-image.d.ts +29 -29
  20. package/dist/components/tt-input-textarea/index.vue.d.ts +40 -40
  21. package/dist/components/tt-loading/src/loading.vue.js +2 -2
  22. package/dist/components/tt-modal/index.d.ts +150 -150
  23. package/dist/components/tt-modal/src/RenderModal.vue.d.ts +42 -42
  24. package/dist/components/tt-modal/src/hooks/useModalRender.d.ts +17 -17
  25. package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.d.ts +5 -5
  26. package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.js +133 -122
  27. package/dist/components/tt-panel-select/src/components/PanelRight.vue.js +77 -66
  28. package/dist/components/tt-panel-select/src/hooks/usePanelData.d.ts +2 -0
  29. package/dist/components/tt-panel-select/src/hooks/usePanelData.js +14 -14
  30. package/dist/components/tt-panel-select/src/index.vue.d.ts +7 -5
  31. package/dist/components/tt-panel-select/src/index.vue.js +300 -219
  32. package/dist/components/tt-panel-select/src/types.d.ts +12 -0
  33. package/dist/components/tt-table/index.js +6 -5
  34. package/dist/components/tt-table/src/TableForm.vue.js +3 -2
  35. package/dist/components/tt-table/src/hooks/useQuery.js +52 -50
  36. package/dist/components/tt-upload/index.d.ts +60 -60
  37. package/dist/components/tt-upload/src/TtUpload.vue.d.ts +37 -37
  38. package/dist/components/tt-upload/src/typing.d.ts +17 -17
  39. package/dist/hooks/basicDataCodes.d.ts +5 -0
  40. package/dist/hooks/basicDataCodes.js +61 -60
  41. package/dist/hooks/missingOptionsCache.d.ts +53 -0
  42. package/dist/hooks/missingOptionsCache.js +133 -0
  43. package/dist/hooks/panelSelectEchoFields.d.ts +12 -0
  44. package/dist/hooks/panelSelectEchoFields.js +46 -0
  45. package/dist/hooks/useBasicDataOptions.d.ts +2 -0
  46. package/dist/hooks/useBasicDataOptions.js +85 -78
  47. package/dist/hooks/useDataPermissionOptions.d.ts +10 -0
  48. package/dist/hooks/useDataPermissionOptions.js +83 -66
  49. package/dist/hooks/useFormSchemasLink.js +240 -194
  50. package/dist/hooks/usePanelSelectSchemas.d.ts +11 -0
  51. package/dist/hooks/usePanelSelectSchemas.js +158 -122
  52. package/dist/style.css +1 -1
  53. package/package.json +1 -1
@@ -81,6 +81,18 @@ export interface PanelContainerProps {
81
81
  resultField?: string;
82
82
  /** 本地数据源,支持树形或平铺结构 */
83
83
  options?: PanelSelectOption[];
84
+ /**
85
+ * 主 options 缺码时按 value 补拉(选中态回显)。
86
+ * 由 usePanelSelectSchemas 在 CODE 声明了 fetchMissingOptions 时注入;组件内 watch modelValue 调用。
87
+ * 结果写入全局 panel echo(按 missingEchoKey 隔离),跨实例 / 重挂复用,同缺码在途去重。
88
+ */
89
+ resolveMissingOptions?: (codes: Array<string | number>) => Promise<PanelSelectOption[]>;
90
+ /**
91
+ * 自定义 resolveMissingOptions 的全局 echo 作用域。
92
+ * 同作用域内按 value 共享缺码回显;不同业务含义请传不同 key。
93
+ * @default '__tt_panel_select__'
94
+ */
95
+ missingEchoKey?: string;
84
96
  /** 树转换与字段映射配置 */
85
97
  treeConfig?: PanelSelectTreeConfig;
86
98
  /** 是否在组件初始化时立即请求 */
@@ -69,16 +69,17 @@ import "../tt-custom-export-panel/index.js";
69
69
  /* empty css */
70
70
  import "../tt-loading/index.js";
71
71
  import "../../hooks/basicDataCodes.js";
72
+ import "../../hooks/missingOptionsCache.js";
72
73
  import "sortablejs";
73
74
  /* empty css */
74
75
  import "./src/emits.js";
75
76
  import "./src/props.js";
76
77
  import "./src/table-mutation-events.js";
77
78
  import "./src/utils/context.js";
78
- const jt = t(o), kt = t(r), qt = t(m), vt = t(i);
79
+ const kt = t(o), qt = t(r), vt = t(m), yt = t(i);
79
80
  export {
80
- vt as TtTable,
81
- jt as TtTableAction,
82
- kt as TtTableButton,
83
- qt as TtTableExportButton
81
+ yt as TtTable,
82
+ kt as TtTableAction,
83
+ qt as TtTableButton,
84
+ vt as TtTableExportButton
84
85
  };
@@ -67,6 +67,7 @@ import "../../tt-custom-export-panel/index.js";
67
67
  import "../../tt-loading/index.js";
68
68
  import "../index.js";
69
69
  import "../../../hooks/basicDataCodes.js";
70
+ import "../../../hooks/missingOptionsCache.js";
70
71
  import { useTemplateSlot as de } from "../../../hooks/useTemplateSlot.js";
71
72
  import nt from "./components/TableColumnModal.vue2.js";
72
73
  /* empty css */
@@ -82,7 +83,7 @@ import bt from "./Table.vue.js";
82
83
  import { forwardedEventEntries as gt } from "./table-mutation-events.js";
83
84
  import { TableFormApi as ht } from "./utils/table-form-api.js";
84
85
  import { provideFormActionTestIds as wt } from "./utils/context.js";
85
- const St = ["data-testid"], Ct = ["data-testid"], Yo = /* @__PURE__ */ je({
86
+ const St = ["data-testid"], Ct = ["data-testid"], Zo = /* @__PURE__ */ je({
86
87
  name: "TtTableForm",
87
88
  __name: "TableForm",
88
89
  props: dt,
@@ -437,5 +438,5 @@ const St = ["data-testid"], Ct = ["data-testid"], Yo = /* @__PURE__ */ je({
437
438
  }
438
439
  });
439
440
  export {
440
- Yo as default
441
+ Zo as default
441
442
  };
@@ -1,8 +1,10 @@
1
- import { GlobalConfig as k } from "../../../../hooks/useSetup.js";
1
+ import { GlobalConfig as I } from "../../../../hooks/useSetup.js";
2
+ import { ensureMissingOptionsForTableRows as ne } from "../../../../hooks/panelSelectEchoFields.js";
3
+ import { useOwnerRoutePath as se } from "../../../../hooks/useOwnerRoutePath.js";
2
4
  import "axios";
3
5
  import "element-plus";
4
- import { isFunction as b, isObject as ae, isUndefined as ne, isArray as se } from "../../../../packages/utils/src/is.js";
5
- import { shallowRef as K, computed as oe, unref as t, watch as ce, onMounted as le, nextTick as ue, onScopeDispose as fe } from "vue";
6
+ import { isFunction as b, isObject as oe, isUndefined as ce, isArray as le } from "../../../../packages/utils/src/is.js";
7
+ import { shallowRef as J, computed as ue, unref as t, watch as fe, onMounted as me, nextTick as de, onScopeDispose as Pe } from "vue";
6
8
  import "dayjs";
7
9
  import "numeral";
8
10
  import "xe-utils";
@@ -14,103 +16,103 @@ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/ae
14
16
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
15
17
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
16
18
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
17
- import { omit as me, set as R, get as p } from "lodash-es";
18
- function qe(s, W, x) {
19
- const { grid: u, pagination: f, paginationInfo: d, setPagination: O, setLoading: q, resetSelectionAfterFetch: T, rows: X, applyRows: j } = W, P = K({ currentPage: 1 }), y = K(!1);
20
- let w = !0, D = !1, S = !1, g;
21
- const L = oe(() => {
19
+ import { omit as ge, set as K, get as O } from "lodash-es";
20
+ function Le(s, W, k) {
21
+ const { grid: u, pagination: f, paginationInfo: d, setPagination: x, setLoading: T, resetSelectionAfterFetch: q, rows: X, applyRows: M } = W, Y = se(), P = J({ currentPage: 1 }), y = J(!1);
22
+ let w = !0, j = !1, S = !1, g;
23
+ const D = ue(() => {
22
24
  const { showPager: e, isScrollFetch: r } = t(s);
23
25
  return !!(e || r);
24
- }), M = () => {
26
+ }), L = () => {
25
27
  var e;
26
28
  return !!((e = t(s).filterConfig) != null && e.remote);
27
29
  };
28
30
  function A(e) {
29
31
  return { currentPage: (e == null ? void 0 : e.currentPage) || 1, pageSize: e == null ? void 0 : e.pageSize };
30
32
  }
31
- function Y(e) {
33
+ function Z(e) {
32
34
  const r = t(s);
33
35
  return g === e && !S && r.api === e.api && r.filterApi === e.filterApi;
34
36
  }
35
37
  function N(e, r) {
36
38
  return ((e == null ? void 0 : e.currentPage) || 1) !== (r == null ? void 0 : r.currentPage) || (e == null ? void 0 : e.pageSize) !== (r == null ? void 0 : r.pageSize);
37
39
  }
38
- function Z(e) {
39
- const { currentPageField: r, pageSizeField: i } = t(s), o = {};
40
- return R(o, r, e.currentPage || 1), R(o, i, e.pageSize), o;
41
- }
42
40
  function _(e) {
43
- return { ...t(d) || t(f), ...ae(e) ? e : {} };
41
+ const { currentPageField: r, pageSizeField: i } = t(s), o = {};
42
+ return K(o, r, e.currentPage || 1), K(o, i, e.pageSize), o;
44
43
  }
45
44
  function $(e) {
46
- const r = se(e), i = r ? 0 : p(e, t(s).totalField);
45
+ return { ...t(d) || t(f), ...oe(e) ? e : {} };
46
+ }
47
+ function ee(e) {
48
+ const r = le(e), i = r ? 0 : O(e, t(s).totalField);
47
49
  return {
48
- items: r ? e : p(e, t(s).dataField),
49
- total: ne(i) ? 0 : Number(i)
50
+ items: r ? e : O(e, t(s).dataField),
51
+ total: ce(i) ? 0 : Number(i)
50
52
  };
51
53
  }
52
- async function ee(e, r, i) {
54
+ async function te(e, r, i) {
53
55
  var n;
54
- const { isScrollFetch: o, currentPageField: l = "" } = t(s), c = t(s).afterFetch ?? ((n = k.table) == null ? void 0 : n.afterFetch);
56
+ const { isScrollFetch: o, currentPageField: l = "" } = t(s), c = t(s).afterFetch ?? ((n = I.table) == null ? void 0 : n.afterFetch);
55
57
  let a = e;
56
- return b(c) && (a = await c(a, i) || a), o && p(r, l, 1) !== 1 && (a = [...t(X), ...a]), a;
58
+ return b(c) && (a = await c(a, i) || a), o && O(r, l, 1) !== 1 && (a = [...t(X), ...a]), a;
57
59
  }
58
60
  async function h(e) {
59
- var G, U, B;
61
+ var R, G, U;
60
62
  const { api: r, filterApi: i, searchInfo: o, useSearchForm: l, formApi: c } = t(s);
61
63
  if (S || !b(r)) return;
62
64
  const a = { api: r, filterApi: i };
63
- D = !0, g = a;
64
- const n = () => Y(a);
65
+ j = !0, g = a;
66
+ const n = () => Z(a);
65
67
  try {
66
- q(!0), t(s).immediate || (w = !1);
67
- const m = _(e == null ? void 0 : e.tablePage), v = m.currentPage || 1, z = Z(m), te = c && l ? await c.getValues() : {};
68
+ T(!0), t(s).immediate || (w = !1);
69
+ const m = $(e == null ? void 0 : e.tablePage), z = m.currentPage || 1, p = _(m), re = c && l ? await c.getValues() : {};
68
70
  if (!n()) return;
69
71
  let F;
70
72
  if (e.serverFilterParams && b(i))
71
- F = await i({ ...e.serverFilterParams, ...t(L) ? z : {} });
73
+ F = await i({ ...e.serverFilterParams, ...t(D) ? p : {} });
72
74
  else {
73
- b(i) && ((G = t(u)) == null || G.clearSort(), (U = t(u)) == null || U.clearFilter());
74
- let C = {
75
- ...te,
75
+ b(i) && ((R = t(u)) == null || R.clearSort(), (G = t(u)) == null || G.clearFilter());
76
+ let v = {
77
+ ...re,
76
78
  ...o,
77
79
  ...e.searchInfo,
78
- ...t(L) ? z : {}
80
+ ...t(D) ? p : {}
79
81
  };
80
- const J = t(s).beforeFetch ?? ((B = k.table) == null ? void 0 : B.beforeFetch);
81
- if (b(J) && (C = await J(C) || C), !n()) return;
82
- F = await r(C);
82
+ const H = t(s).beforeFetch ?? ((U = I.table) == null ? void 0 : U.beforeFetch);
83
+ if (b(H) && (v = await H(v) || v), !n()) return;
84
+ F = await r(v);
83
85
  }
84
86
  if (!n()) return;
85
- const { items: re, total: E } = $(F), I = await ee(re || [], z, F);
87
+ const { items: ie, total: B } = ee(F), C = await te(ie || [], p, F);
86
88
  if (!n()) return;
87
- const H = E || I.length || 0, ie = Math.max(1, Math.ceil(H / m.pageSize));
88
- if (v > ie) {
89
+ const E = B || C.length || 0, ae = Math.max(1, Math.ceil(E / m.pageSize));
90
+ if (z > ae) {
89
91
  await Q({ tablePage: { currentPage: 1, pageSize: m.pageSize } });
90
92
  return;
91
93
  }
92
- if (!await j(I, n) || !n() || (O({ total: H, currentPage: v }), P.value = A(t(d)), x("fetch-success", { items: I, total: E, rawDataSource: F }), !n()) || (T(), !n())) return;
94
+ if (!await M(C, n) || !n() || (x({ total: E, currentPage: z }), P.value = A(t(d)), ne(Y, C), k("fetch-success", { items: C, total: B, rawDataSource: F }), !n()) || (q(), !n())) return;
93
95
  y.value = !0;
94
96
  } catch (m) {
95
- if (!n() || (x("fetch-error", m), !n()) || !await j([], n) || !n() || (O({ total: 0 }), P.value = A(t(d)), T(), !n())) return;
97
+ if (!n() || (k("fetch-error", m), !n()) || !await M([], n) || !n() || (x({ total: 0 }), P.value = A(t(d)), q(), !n())) return;
96
98
  y.value = !0;
97
99
  } finally {
98
- g === a && (g = void 0, q(!1));
100
+ g === a && (g = void 0, T(!1));
99
101
  }
100
102
  }
101
103
  async function Q(e) {
102
104
  var i;
103
105
  const r = { ...t(f) };
104
- (i = k.table) != null && i.isReloadResetToFirstPage && (r.currentPage = 1), await h(
106
+ (i = I.table) != null && i.isReloadResetToFirstPage && (r.currentPage = 1), await h(
105
107
  e ? {
106
108
  tablePage: Object.hasOwn(e, "tablePage") ? e.tablePage : r,
107
- searchInfo: Object.hasOwn(e, "searchInfo") ? e.searchInfo : me(e, ["tablePage", "serverFilterParams"])
109
+ searchInfo: Object.hasOwn(e, "searchInfo") ? e.searchInfo : ge(e, ["tablePage", "serverFilterParams"])
108
110
  } : { tablePage: r }
109
111
  ), t(s).immediate || (w = !1);
110
112
  }
111
113
  async function V(e) {
112
114
  var l, c;
113
- if (!M()) return;
115
+ if (!L()) return;
114
116
  const r = { ...t(f) };
115
117
  e !== "page" && (r.currentPage = 1);
116
118
  const i = (((l = t(u)) == null ? void 0 : l.getCheckedFilters()) || []).map((a) => ({
@@ -124,7 +126,7 @@ function qe(s, W, x) {
124
126
  }));
125
127
  await h({ serverFilterParams: { filterConditions: i, sortConditions: o }, tablePage: r });
126
128
  }
127
- return ce([() => t(f).currentPage, () => t(f).pageSize], ([e, r]) => {
129
+ return fe([() => t(f).currentPage, () => t(f).pageSize], ([e, r]) => {
128
130
  var l, c;
129
131
  const i = { ...t(f), currentPage: e, pageSize: r };
130
132
  if (!N(i, t(P))) return;
@@ -133,17 +135,17 @@ function qe(s, W, x) {
133
135
  return;
134
136
  }
135
137
  const o = (((l = t(u)) == null ? void 0 : l.getSortColumns()) || []).length > 0 || (((c = t(u)) == null ? void 0 : c.getCheckedFilters()) || []).length > 0;
136
- M() && o ? V("page") : h({ tablePage: { ...i } });
137
- }), le(() => {
138
- P.value = A(t(d)), ue(() => {
139
- if (S || D) return;
138
+ L() && o ? V("page") : h({ tablePage: { ...i } });
139
+ }), me(() => {
140
+ P.value = A(t(d)), de(() => {
141
+ if (S || j) return;
140
142
  const { immediate: e, pagerConfig: r } = t(s);
141
143
  e && (!r || !N(r, t(P))) && h({ tablePage: t(d) });
142
144
  });
143
- }), fe(() => {
145
+ }), Pe(() => {
144
146
  S = !0, g = void 0;
145
147
  }), { query: h, reload: Q, reloadFilter: V, isLoaded: y };
146
148
  }
147
149
  export {
148
- qe as useQuery
150
+ Le as useQuery
149
151
  };