@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.
- package/dist/api/supplier.d.ts +16 -0
- package/dist/api/supplier.js +39 -12
- package/dist/assets/svg/download.svg.js +1 -1
- package/dist/components/tt-area/TtArea.vue.js +1 -1
- package/dist/components/tt-button/index.d.ts +28 -28
- package/dist/components/tt-button/index.vue.d.ts +16 -16
- package/dist/components/tt-custom-export-modal/src/assets/search.svg.js +5 -5
- package/dist/components/tt-custom-export-modal/src/assets/star.svg.js +3 -3
- package/dist/components/tt-custom-export-modal/src/assets/trash.svg.js +7 -7
- package/dist/components/tt-custom-export-modal/src/components/FieldGridSection.vue.js +1 -1
- package/dist/components/tt-drawer/index.d.ts +109 -109
- package/dist/components/tt-drawer/src/RenderDrawer.vue.d.ts +60 -60
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue.js +2 -2
- package/dist/components/tt-empty/index.d.ts +4 -4
- package/dist/components/tt-form/src/components/FormElInput.vue.d.ts +10 -10
- package/dist/components/tt-icon/index.vue.js +2 -2
- package/dist/components/tt-image/index.d.ts +29 -29
- package/dist/components/tt-image/src/components/ImageViewer.d.ts +20 -20
- package/dist/components/tt-image/tt-image.d.ts +29 -29
- package/dist/components/tt-input-textarea/index.vue.d.ts +40 -40
- package/dist/components/tt-loading/src/loading.vue.js +2 -2
- package/dist/components/tt-modal/index.d.ts +150 -150
- package/dist/components/tt-modal/src/RenderModal.vue.d.ts +42 -42
- package/dist/components/tt-modal/src/hooks/useModalRender.d.ts +17 -17
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.d.ts +5 -5
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.js +133 -122
- package/dist/components/tt-panel-select/src/components/PanelRight.vue.js +77 -66
- package/dist/components/tt-panel-select/src/hooks/usePanelData.d.ts +2 -0
- package/dist/components/tt-panel-select/src/hooks/usePanelData.js +14 -14
- package/dist/components/tt-panel-select/src/index.vue.d.ts +7 -5
- package/dist/components/tt-panel-select/src/index.vue.js +300 -219
- package/dist/components/tt-panel-select/src/types.d.ts +12 -0
- package/dist/components/tt-table/index.js +6 -5
- package/dist/components/tt-table/src/TableForm.vue.js +3 -2
- package/dist/components/tt-table/src/hooks/useQuery.js +52 -50
- package/dist/components/tt-upload/index.d.ts +60 -60
- package/dist/components/tt-upload/src/TtUpload.vue.d.ts +37 -37
- package/dist/components/tt-upload/src/typing.d.ts +17 -17
- package/dist/hooks/basicDataCodes.d.ts +5 -0
- package/dist/hooks/basicDataCodes.js +61 -60
- package/dist/hooks/missingOptionsCache.d.ts +53 -0
- package/dist/hooks/missingOptionsCache.js +133 -0
- package/dist/hooks/panelSelectEchoFields.d.ts +12 -0
- package/dist/hooks/panelSelectEchoFields.js +46 -0
- package/dist/hooks/useBasicDataOptions.d.ts +2 -0
- package/dist/hooks/useBasicDataOptions.js +85 -78
- package/dist/hooks/useDataPermissionOptions.d.ts +10 -0
- package/dist/hooks/useDataPermissionOptions.js +83 -66
- package/dist/hooks/useFormSchemasLink.js +240 -194
- package/dist/hooks/usePanelSelectSchemas.d.ts +11 -0
- package/dist/hooks/usePanelSelectSchemas.js +158 -122
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -61,9 +61,20 @@ export interface PanelSelectFieldConfig<TValues extends Recordable = Recordable>
|
|
|
61
61
|
groupBy?: PanelSelectGroupBy;
|
|
62
62
|
/** 自定义过滤完整 options(过滤在分组前执行,入参为扁平 options) */
|
|
63
63
|
customOptions?: (values: TValues, options: BasicDataOption[]) => BasicDataOption[];
|
|
64
|
+
/**
|
|
65
|
+
* 缺码(deleted)项是否 disabled。
|
|
66
|
+
* 默认跟随 `UsePanelSelectSchemasOptions.disableMissingOptions`(再默认 false 放开)。
|
|
67
|
+
* 新增编辑需禁用时传 true。
|
|
68
|
+
*/
|
|
69
|
+
disableMissingOptions?: boolean;
|
|
64
70
|
}
|
|
65
71
|
export interface UsePanelSelectSchemasOptions {
|
|
66
72
|
dataSource?: MaybeRef<BasicDataOptionsMap | undefined>;
|
|
73
|
+
/**
|
|
74
|
+
* 缺码项是否 disabled,默认 false(放开可选)。
|
|
75
|
+
* 新增/编辑表单传 true;字段级 `disableMissingOptions` 可覆盖。
|
|
76
|
+
*/
|
|
77
|
+
disableMissingOptions?: boolean;
|
|
67
78
|
}
|
|
68
79
|
/**
|
|
69
80
|
* 基础数据 PanelSelect schema hooks。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "axios";
|
|
2
2
|
import "element-plus";
|
|
3
|
-
import { isFunction as
|
|
3
|
+
import { isFunction as re } from "../packages/utils/src/is.js";
|
|
4
4
|
import "vue";
|
|
5
5
|
import "dayjs";
|
|
6
6
|
import "numeral";
|
|
@@ -13,124 +13,145 @@ import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
|
13
13
|
import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
14
14
|
import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
15
15
|
import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
16
|
-
import { omit as
|
|
17
|
-
import { CODE_REGISTRY as
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
import { omit as Y } from "lodash-es";
|
|
17
|
+
import { CODE_REGISTRY as he, resolveDefaultGroupBy as Oe, CODES as Pe, GROUP_BY as X, groupPurchasePlaceOptions as we, groupBasicDataOptions as xe } from "./basicDataCodes.js";
|
|
18
|
+
import { ensureMissingOptions as f, withMissingOptionDisabled as $ } from "./missingOptionsCache.js";
|
|
19
|
+
import { registerPanelSelectEchoField as C } from "./panelSelectEchoFields.js";
|
|
20
|
+
import { useBasicDataOptions as Ae } from "./useBasicDataOptions.js";
|
|
21
|
+
import { useOwnerRoutePath as ye } from "./useOwnerRoutePath.js";
|
|
22
|
+
const T = "all";
|
|
23
|
+
function P(t) {
|
|
21
24
|
return Array.isArray(t) ? t : t == null || t === "" ? [] : [t];
|
|
22
25
|
}
|
|
23
|
-
function
|
|
26
|
+
function Se(t, n = T) {
|
|
24
27
|
return t === n ? !0 : typeof t == "string" && typeof n == "string" && t.toLowerCase() === String(n).toLowerCase();
|
|
25
28
|
}
|
|
26
|
-
function
|
|
27
|
-
return
|
|
29
|
+
function ge(t, n = T) {
|
|
30
|
+
return P(t).some((s) => Se(s, n));
|
|
28
31
|
}
|
|
29
|
-
function
|
|
32
|
+
function Me(t) {
|
|
30
33
|
return t.replace(/[-_]+/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").split(/\s+/).filter(Boolean).map((n) => n.charAt(0).toUpperCase() + n.slice(1)).join("");
|
|
31
34
|
}
|
|
32
|
-
function
|
|
33
|
-
return t ?
|
|
35
|
+
function ee(t, n, s, c) {
|
|
36
|
+
return t ? re(t) ? t(n, s, c) : t : {};
|
|
34
37
|
}
|
|
35
|
-
function
|
|
36
|
-
const
|
|
38
|
+
function te(t, n, s, c) {
|
|
39
|
+
const l = new Set(s.map((m) => m.value)), r = t[n];
|
|
37
40
|
if (c) {
|
|
38
|
-
const
|
|
39
|
-
(
|
|
41
|
+
const m = P(r).filter((e) => l.has(e)), p = P(r);
|
|
42
|
+
(m.length !== p.length || m.some((e, i) => e !== p[i])) && (t[n] = m);
|
|
40
43
|
return;
|
|
41
44
|
}
|
|
42
|
-
|
|
45
|
+
r == null || r === "" || l.has(r) || (t[n] = void 0);
|
|
43
46
|
}
|
|
44
|
-
function
|
|
45
|
-
const
|
|
47
|
+
function ne(t, n, s, c, l, r) {
|
|
48
|
+
const m = r ? l.filter((p) => P(s[n]).includes(p.value)) : l.find((p) => p.value === s[n]);
|
|
46
49
|
return {
|
|
47
|
-
values:
|
|
50
|
+
values: s,
|
|
48
51
|
actions: c,
|
|
49
52
|
fieldName: n,
|
|
50
53
|
code: t,
|
|
51
|
-
options:
|
|
52
|
-
currentOption:
|
|
54
|
+
options: l,
|
|
55
|
+
currentOption: m
|
|
53
56
|
};
|
|
54
57
|
}
|
|
55
|
-
function
|
|
56
|
-
const c =
|
|
58
|
+
function oe(t, n, s) {
|
|
59
|
+
const c = P(t);
|
|
57
60
|
if (!c.length) return [];
|
|
58
|
-
if (
|
|
59
|
-
const
|
|
60
|
-
return n.filter((
|
|
61
|
+
if (ge(t, s)) return n;
|
|
62
|
+
const l = new Set(c);
|
|
63
|
+
return n.filter((r) => l.has(r.value));
|
|
61
64
|
}
|
|
62
|
-
function
|
|
63
|
-
const
|
|
64
|
-
return
|
|
65
|
+
function se(t, n) {
|
|
66
|
+
const s = new Set(P(t));
|
|
67
|
+
return s.size ? n.filter((c) => !s.has(c.value)) : n;
|
|
65
68
|
}
|
|
66
|
-
function
|
|
69
|
+
function D(t, n) {
|
|
67
70
|
var c;
|
|
68
|
-
const
|
|
69
|
-
return Array.isArray(
|
|
71
|
+
const s = (c = t.value) == null ? void 0 : c[n];
|
|
72
|
+
return Array.isArray(s) ? s : [];
|
|
70
73
|
}
|
|
71
|
-
function
|
|
72
|
-
const
|
|
73
|
-
(e,
|
|
74
|
+
function He(t, n = {}) {
|
|
75
|
+
const s = [...new Set(t.map((e) => e.code))], c = t.reduce(
|
|
76
|
+
(e, i) => (e[i.code] = (e[i.code] || 0) + 1, e),
|
|
74
77
|
{}
|
|
75
|
-
), { dataSource:
|
|
76
|
-
codes:
|
|
78
|
+
), l = ye(), { dataSource: r } = Ae({
|
|
79
|
+
codes: s,
|
|
77
80
|
dataSource: n.dataSource
|
|
78
|
-
}),
|
|
81
|
+
}), m = n.disableMissingOptions ?? !1, p = {};
|
|
79
82
|
return t.forEach((e) => {
|
|
80
|
-
var
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
var Z, J;
|
|
84
|
+
const i = he[e.code], h = e.fieldName || i.defaultFieldName, F = !!i.fetchMissingOptions, L = e.disableMissingOptions ?? m;
|
|
85
|
+
F && (C(l, e.code, h), (Z = e.exclude) != null && Z.fieldName && C(l, e.code, e.exclude.fieldName));
|
|
86
|
+
const v = e.key || ((c[e.code] || 0) > 1 ? h : e.code), z = e.label || i.defaultLabel, K = e.multiple ?? i.defaultMultiple, ce = e.showAll ?? i.defaultShowAll, _ = e.showAllField ?? T, w = e.mutexWith, B = Oe(e.code, e.groupBy), S = e.code === Pe.PURCHASE_PLACE, G = B === X.NONE, R = B === X.PINYIN, le = !S && !G && !R, g = i.defaultTreeConfig, V = !!g, j = S ? !1 : i.defaultShowNav ?? !1;
|
|
87
|
+
function q(o) {
|
|
88
|
+
const u = F ? $(o, L) : o;
|
|
89
|
+
return S ? we(u) : le ? xe(u, B) : u;
|
|
84
90
|
}
|
|
85
|
-
const
|
|
86
|
-
...
|
|
87
|
-
...((
|
|
88
|
-
],
|
|
89
|
-
...
|
|
90
|
-
triggerFields:
|
|
91
|
-
} : e.dependencies,
|
|
91
|
+
const ie = [
|
|
92
|
+
...w ? [w] : [],
|
|
93
|
+
...((J = e.dependencies) == null ? void 0 : J.triggerFields) || []
|
|
94
|
+
], H = [...new Set(ie)], pe = Y(e.dependencies || {}, ["triggerFields"]), ue = H.length ? {
|
|
95
|
+
...pe,
|
|
96
|
+
triggerFields: H
|
|
97
|
+
} : e.dependencies, k = {
|
|
92
98
|
component: "TtPanelSelect",
|
|
93
|
-
fieldName:
|
|
94
|
-
label:
|
|
99
|
+
fieldName: h,
|
|
100
|
+
label: z,
|
|
95
101
|
rules: e.rules,
|
|
96
|
-
dependencies:
|
|
97
|
-
componentProps: (o,
|
|
98
|
-
const
|
|
99
|
-
let
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
+
dependencies: ue,
|
|
103
|
+
componentProps: (o, u) => {
|
|
104
|
+
const A = D(r, e.code);
|
|
105
|
+
let O = w ? se(o[w], A) : A;
|
|
106
|
+
re(e.customOptions) && (O = e.customOptions(o, O) || []);
|
|
107
|
+
const b = q(O), U = ee(e.componentProps, o, u, O), {
|
|
108
|
+
onChange: Q,
|
|
109
|
+
resolveMissingOptions: E,
|
|
110
|
+
...I
|
|
111
|
+
} = U;
|
|
102
112
|
return {
|
|
103
|
-
multiple:
|
|
104
|
-
showAll:
|
|
105
|
-
showAllField:
|
|
106
|
-
showNav:
|
|
107
|
-
showOriginMode:
|
|
108
|
-
showPinyinMode:
|
|
109
|
-
...
|
|
110
|
-
...
|
|
111
|
-
options:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
multiple: K,
|
|
114
|
+
showAll: ce,
|
|
115
|
+
showAllField: _,
|
|
116
|
+
showNav: j,
|
|
117
|
+
showOriginMode: G,
|
|
118
|
+
showPinyinMode: V || S ? !1 : R,
|
|
119
|
+
...g ? { treeConfig: g } : {},
|
|
120
|
+
...I,
|
|
121
|
+
options: b,
|
|
122
|
+
...F ? {
|
|
123
|
+
resolveMissingOptions: async (a) => {
|
|
124
|
+
const d = await f(
|
|
125
|
+
l,
|
|
126
|
+
e.code,
|
|
127
|
+
a,
|
|
128
|
+
D(r, e.code)
|
|
129
|
+
);
|
|
130
|
+
return $(d, L);
|
|
131
|
+
}
|
|
132
|
+
} : {},
|
|
133
|
+
onChange(a) {
|
|
134
|
+
var d;
|
|
135
|
+
if (w) {
|
|
136
|
+
const x = Array.isArray(o[w]), y = se(a, A);
|
|
137
|
+
te(o, w, y, x);
|
|
117
138
|
}
|
|
118
139
|
if (e.exclude) {
|
|
119
|
-
const
|
|
120
|
-
|
|
140
|
+
const x = e.exclude.fieldName, y = e.exclude.multiple ?? !0, M = oe(a, A, _);
|
|
141
|
+
P(a).length ? te(o, x, M, y) : o[x] = y ? [] : void 0;
|
|
121
142
|
}
|
|
122
|
-
(
|
|
143
|
+
(d = e.onChange) == null || d.call(
|
|
123
144
|
e,
|
|
124
|
-
|
|
125
|
-
|
|
145
|
+
a,
|
|
146
|
+
ne(e.code, h, o, u, O, K)
|
|
126
147
|
);
|
|
127
148
|
}
|
|
128
149
|
};
|
|
129
150
|
}
|
|
130
151
|
};
|
|
131
|
-
if (
|
|
132
|
-
...
|
|
133
|
-
...
|
|
152
|
+
if (p[v] = {
|
|
153
|
+
...k,
|
|
154
|
+
...Y(e, [
|
|
134
155
|
"code",
|
|
135
156
|
"key",
|
|
136
157
|
"fieldName",
|
|
@@ -147,57 +168,72 @@ function ke(t, n = {}) {
|
|
|
147
168
|
"groupBy",
|
|
148
169
|
"customOptions"
|
|
149
170
|
]),
|
|
150
|
-
fieldName:
|
|
151
|
-
label:
|
|
171
|
+
fieldName: h,
|
|
172
|
+
label: z,
|
|
152
173
|
rules: e.rules,
|
|
153
174
|
description: e.description,
|
|
154
|
-
dependencies:
|
|
155
|
-
componentProps:
|
|
175
|
+
dependencies: k.dependencies,
|
|
176
|
+
componentProps: k.componentProps,
|
|
156
177
|
component: "TtPanelSelect"
|
|
157
178
|
}, e.exclude) {
|
|
158
|
-
const o = e.exclude,
|
|
159
|
-
...
|
|
160
|
-
triggerFields:
|
|
161
|
-
if:
|
|
162
|
-
},
|
|
179
|
+
const o = e.exclude, u = o.fieldName, A = o.key || `exclude${Me(v)}`, O = o.label || i.defaultExcludeLabel, b = o.multiple ?? !0, U = o.showAll ?? !1, Q = o.showAllField ?? T, E = o.dependencies || {}, I = {
|
|
180
|
+
...E,
|
|
181
|
+
triggerFields: E.triggerFields ?? [h],
|
|
182
|
+
if: E.if ?? ((d) => P(d[h]).length > 0)
|
|
183
|
+
}, a = {
|
|
163
184
|
component: "TtPanelSelect",
|
|
164
|
-
fieldName:
|
|
165
|
-
label:
|
|
185
|
+
fieldName: u,
|
|
186
|
+
label: O,
|
|
166
187
|
rules: o.rules,
|
|
167
|
-
dependencies:
|
|
168
|
-
componentProps: (
|
|
169
|
-
const
|
|
188
|
+
dependencies: I,
|
|
189
|
+
componentProps: (d, x) => {
|
|
190
|
+
const y = D(r, e.code), M = oe(d[h], y, _), ae = q(M), de = ee(o.componentProps, d, x, M), {
|
|
191
|
+
onChange: Fe,
|
|
192
|
+
resolveMissingOptions: be,
|
|
193
|
+
...me
|
|
194
|
+
} = de;
|
|
170
195
|
return {
|
|
171
|
-
multiple:
|
|
172
|
-
showAll:
|
|
173
|
-
showAllField:
|
|
174
|
-
showNav:
|
|
175
|
-
showOriginMode:
|
|
176
|
-
showPinyinMode:
|
|
177
|
-
...
|
|
178
|
-
...
|
|
179
|
-
options:
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
196
|
+
multiple: b,
|
|
197
|
+
showAll: U,
|
|
198
|
+
showAllField: Q,
|
|
199
|
+
showNav: j,
|
|
200
|
+
showOriginMode: G,
|
|
201
|
+
showPinyinMode: V || S ? !1 : R,
|
|
202
|
+
...g ? { treeConfig: g } : {},
|
|
203
|
+
...me,
|
|
204
|
+
options: ae,
|
|
205
|
+
...F ? {
|
|
206
|
+
resolveMissingOptions: async (W) => {
|
|
207
|
+
const N = await f(
|
|
208
|
+
l,
|
|
209
|
+
e.code,
|
|
210
|
+
W,
|
|
211
|
+
D(r, e.code)
|
|
212
|
+
);
|
|
213
|
+
return $(N, L);
|
|
214
|
+
}
|
|
215
|
+
} : {},
|
|
216
|
+
onChange(W) {
|
|
217
|
+
var N;
|
|
218
|
+
(N = o.onChange) == null || N.call(
|
|
183
219
|
o,
|
|
184
|
-
|
|
185
|
-
|
|
220
|
+
W,
|
|
221
|
+
ne(
|
|
186
222
|
e.code,
|
|
223
|
+
u,
|
|
224
|
+
d,
|
|
187
225
|
x,
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
G,
|
|
191
|
-
F
|
|
226
|
+
M,
|
|
227
|
+
b
|
|
192
228
|
)
|
|
193
229
|
);
|
|
194
230
|
}
|
|
195
231
|
};
|
|
196
232
|
}
|
|
197
233
|
};
|
|
198
|
-
|
|
199
|
-
...
|
|
200
|
-
...
|
|
234
|
+
p[A] = {
|
|
235
|
+
...a,
|
|
236
|
+
...Y(o, [
|
|
201
237
|
"fieldName",
|
|
202
238
|
"label",
|
|
203
239
|
"key",
|
|
@@ -209,19 +245,19 @@ function ke(t, n = {}) {
|
|
|
209
245
|
"onChange",
|
|
210
246
|
"rules"
|
|
211
247
|
]),
|
|
212
|
-
fieldName:
|
|
213
|
-
label:
|
|
248
|
+
fieldName: u,
|
|
249
|
+
label: O,
|
|
214
250
|
rules: o.rules,
|
|
215
|
-
dependencies:
|
|
216
|
-
componentProps:
|
|
251
|
+
dependencies: a.dependencies,
|
|
252
|
+
componentProps: a.componentProps,
|
|
217
253
|
component: "TtPanelSelect"
|
|
218
254
|
};
|
|
219
255
|
}
|
|
220
256
|
}), {
|
|
221
|
-
...
|
|
222
|
-
dataSource:
|
|
257
|
+
...p,
|
|
258
|
+
dataSource: r
|
|
223
259
|
};
|
|
224
260
|
}
|
|
225
261
|
export {
|
|
226
|
-
|
|
262
|
+
He as usePanelSelectSchemas
|
|
227
263
|
};
|