@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
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { getAllBasicAirline as
|
|
1
|
+
import { getAllBasicAirline as O, getDictItemsByCodes as S, listChainByTypeAirportRegionLevel as A } from "../api/basicData.js";
|
|
2
2
|
import { queryAllRoles as L } from "../api/dataTypeContext.js";
|
|
3
3
|
import { fetchUserListOnce as I } from "./userListCache.js";
|
|
4
4
|
import { secondaryDropdownListLossReason as T, primaryDropdownListLossReason as R } from "../api/lossReason.js";
|
|
5
|
-
import {
|
|
5
|
+
import { fetchMissingPurchasePlaceOptions as _, listAllSupplierPurchase as P, listAllValidSupplierManage as h, getAllConfigListSupplierConfigManage as b } from "../api/supplier.js";
|
|
6
6
|
const o = {
|
|
7
7
|
AIRLINE: "airline",
|
|
8
8
|
CONTINENT: "continent",
|
|
@@ -45,7 +45,7 @@ const o = {
|
|
|
45
45
|
PINYIN: "pinyin",
|
|
46
46
|
/** 不分组,原样平铺 */
|
|
47
47
|
NONE: "none"
|
|
48
|
-
},
|
|
48
|
+
}, g = {
|
|
49
49
|
[d.CONTINENT]: { codeKey: "continentCode", nameKey: "continentName" },
|
|
50
50
|
[d.REGION]: { codeKey: "regionCode", nameKey: "regionName" },
|
|
51
51
|
[d.COUNTRY]: { codeKey: "countryCode", nameKey: "countryName" },
|
|
@@ -57,18 +57,18 @@ const o = {
|
|
|
57
57
|
labelMode: "name"
|
|
58
58
|
},
|
|
59
59
|
[d.AIRLINE_TYPE]: { codeKey: "airlineType", nameKey: "airlineTypeName", labelMode: "name" }
|
|
60
|
-
},
|
|
60
|
+
}, v = {
|
|
61
61
|
TICKETING: "出票",
|
|
62
62
|
REFUND: "退票",
|
|
63
63
|
REBOOK: "改签"
|
|
64
|
-
},
|
|
64
|
+
}, K = {
|
|
65
65
|
1: "境内",
|
|
66
66
|
2: "境外"
|
|
67
67
|
};
|
|
68
|
-
function
|
|
68
|
+
function Z(a, e) {
|
|
69
69
|
if (!Array.isArray(a) || !a.length) return a || [];
|
|
70
70
|
if (e === d.PINYIN || e === d.NONE) return a;
|
|
71
|
-
const l =
|
|
71
|
+
const l = g[e];
|
|
72
72
|
if (!l) return a;
|
|
73
73
|
const n = /* @__PURE__ */ new Map(), s = [], r = l.labelMode || "codeName";
|
|
74
74
|
return a.forEach((u) => {
|
|
@@ -86,7 +86,7 @@ function X(a, e) {
|
|
|
86
86
|
n.get(i).children.push(u);
|
|
87
87
|
}), s.map((u) => n.get(u));
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function ee(a) {
|
|
90
90
|
const e = /* @__PURE__ */ new Map();
|
|
91
91
|
return (Array.isArray(a) ? a : []).forEach((l) => {
|
|
92
92
|
const n = l.purchaseInfo || l, s = (n == null ? void 0 : n.supplierSubType) ?? "其他";
|
|
@@ -98,28 +98,28 @@ function Z(a) {
|
|
|
98
98
|
}, e.set(s, r)), r.children.push(l);
|
|
99
99
|
}), Array.from(e.values());
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function ae(a, e) {
|
|
102
102
|
return e || (a === o.CONTINENT || a === o.CURRENCY_CODE ? 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);
|
|
103
103
|
}
|
|
104
|
-
const
|
|
104
|
+
const Y = {
|
|
105
105
|
1: { codeKey: "continentCode", nameKey: "continentName", statusKey: "continentStatus" },
|
|
106
106
|
2: { codeKey: "regionCode", nameKey: "regionName", statusKey: "regionStatus" },
|
|
107
107
|
3: { codeKey: "countryCode", nameKey: "countryName", statusKey: "countryStatus" },
|
|
108
108
|
4: { codeKey: "cityCode", nameKey: "cityName", statusKey: "cityStatus" },
|
|
109
109
|
5: { codeKey: "airportCode", nameKey: "airportName", statusKey: "airportStatus" }
|
|
110
110
|
};
|
|
111
|
-
function
|
|
111
|
+
function M(a = []) {
|
|
112
112
|
return (Array.isArray(a) ? a : []).filter((e) => e == null ? void 0 : e.airlineCode).map((e) => {
|
|
113
113
|
const l = e.airlineType, n = l != null ? String(l) : "";
|
|
114
114
|
return {
|
|
115
115
|
...e,
|
|
116
|
-
airlineTypeName:
|
|
116
|
+
airlineTypeName: K[n] || n,
|
|
117
117
|
label: `${e.airlineCode}(${e.airlineNameCn || ""})`,
|
|
118
118
|
value: e.airlineCode
|
|
119
119
|
};
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function w(a) {
|
|
123
123
|
if (!a || typeof a != "object" || Array.isArray(a))
|
|
124
124
|
return a || {};
|
|
125
125
|
const e = a.continentCode || a.regionCode || a.countryCode || a.cityCode || a.airportCode, l = [1, 2, 3, 4, 5].some((u) => a[String(u)] || a[u]);
|
|
@@ -136,28 +136,28 @@ function M(a) {
|
|
|
136
136
|
for (const u of [1, 2, 3, 4, 5]) {
|
|
137
137
|
const t = a[String(u)] || a[u];
|
|
138
138
|
if (!t || typeof t != "object") continue;
|
|
139
|
-
const { codeKey: c, nameKey: i, statusKey: f } =
|
|
139
|
+
const { codeKey: c, nameKey: i, statusKey: f } = Y[u];
|
|
140
140
|
t.code !== void 0 && t.code !== null && t.code !== "" && (r[c] = t.code), t.name !== void 0 && (r[i] = t.name), t.status !== void 0 && (r[f] = t.status);
|
|
141
141
|
}
|
|
142
142
|
return r;
|
|
143
143
|
}
|
|
144
|
-
function
|
|
145
|
-
return (Array.isArray(a) ? a : []).map((l) =>
|
|
144
|
+
function U(a) {
|
|
145
|
+
return (Array.isArray(a) ? a : []).map((l) => w(l || {}));
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function D(a = [], e, l) {
|
|
148
148
|
return (Array.isArray(a) ? a : []).filter((n) => n == null ? void 0 : n[e]).map((n) => ({
|
|
149
149
|
...n,
|
|
150
150
|
label: `${n[e]}(${n[l] || ""})`,
|
|
151
151
|
value: n[e]
|
|
152
152
|
}));
|
|
153
153
|
}
|
|
154
|
-
const
|
|
154
|
+
const F = [o.CONTINENT, o.REGION, o.COUNTRY, o.CITY, o.AIRPORT], y = {
|
|
155
155
|
[o.CONTINENT]: 1,
|
|
156
156
|
[o.REGION]: 2,
|
|
157
157
|
[o.COUNTRY]: 3,
|
|
158
158
|
[o.CITY]: 4,
|
|
159
159
|
[o.AIRPORT]: 5
|
|
160
|
-
},
|
|
160
|
+
}, G = {
|
|
161
161
|
[o.CONTINENT]: { codeKey: "continentCode", nameKey: "continentName" },
|
|
162
162
|
[o.REGION]: { codeKey: "regionCode", nameKey: "regionName" },
|
|
163
163
|
[o.COUNTRY]: { codeKey: "countryCode", nameKey: "countryName" },
|
|
@@ -166,14 +166,14 @@ const D = [o.CONTINENT, o.REGION, o.COUNTRY, o.CITY, o.AIRPORT], y = {
|
|
|
166
166
|
};
|
|
167
167
|
o.CONTINENT, o.REGION, o.COUNTRY, o.CITY;
|
|
168
168
|
function N(a) {
|
|
169
|
-
return
|
|
169
|
+
return F.includes(a);
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function re(a, e) {
|
|
172
172
|
return !N(a) || !N(e) ? !1 : y[a] > y[e];
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function le(a, e) {
|
|
175
175
|
if (!N(e)) return [];
|
|
176
|
-
const { codeKey: l, nameKey: n } =
|
|
176
|
+
const { codeKey: l, nameKey: n } = G[e], s = /* @__PURE__ */ new Map();
|
|
177
177
|
return (Array.isArray(a) ? a : []).forEach((r) => {
|
|
178
178
|
const u = r == null ? void 0 : r[l];
|
|
179
179
|
if (u == null || u === "") return;
|
|
@@ -185,7 +185,7 @@ function re(a, e) {
|
|
|
185
185
|
});
|
|
186
186
|
}), Array.from(s.values());
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function ne(a) {
|
|
189
189
|
let e;
|
|
190
190
|
for (const l of a)
|
|
191
191
|
N(l) && (!e || y[l] > y[e]) && (e = l);
|
|
@@ -195,20 +195,20 @@ function p(a, e, l) {
|
|
|
195
195
|
return async () => {
|
|
196
196
|
try {
|
|
197
197
|
const n = await A({ type: a });
|
|
198
|
-
return U(
|
|
198
|
+
return D(U(n), e, l);
|
|
199
199
|
} catch {
|
|
200
200
|
return [];
|
|
201
201
|
}
|
|
202
202
|
};
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function m(a = []) {
|
|
205
205
|
return (Array.isArray(a) ? a : []).filter((e) => (e == null ? void 0 : e.itemCode) !== void 0 && (e == null ? void 0 : e.itemCode) !== null && (e == null ? void 0 : e.itemCode) !== "").map((e) => ({
|
|
206
206
|
...e,
|
|
207
207
|
label: e.itemName || "",
|
|
208
208
|
value: e.itemCode
|
|
209
209
|
}));
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function x(a = []) {
|
|
212
212
|
const e = Array.isArray(a) ? a : [], l = new Set(
|
|
213
213
|
e.map((r) => r.parentItemCode).filter((r) => r != null && String(r) !== "").map(String)
|
|
214
214
|
), n = new Set(
|
|
@@ -231,10 +231,10 @@ function m(a = []) {
|
|
|
231
231
|
});
|
|
232
232
|
}), s;
|
|
233
233
|
}
|
|
234
|
-
function C(a, e =
|
|
234
|
+
function C(a, e = m) {
|
|
235
235
|
return async (l) => {
|
|
236
236
|
try {
|
|
237
|
-
const n = await
|
|
237
|
+
const n = await S({
|
|
238
238
|
dictCodeList: [a],
|
|
239
239
|
permissionOnlyCode: l == null ? void 0 : l.permissionOnlyCode
|
|
240
240
|
}), s = (n == null ? void 0 : n[a]) || [];
|
|
@@ -244,32 +244,32 @@ function C(a, e = G) {
|
|
|
244
244
|
}
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function B(a = []) {
|
|
248
248
|
return (Array.isArray(a) ? a : []).filter((e) => (e == null ? void 0 : e.id) !== void 0 && (e == null ? void 0 : e.id) !== null).map((e) => ({
|
|
249
249
|
...e,
|
|
250
250
|
label: e.fullName || e.username || String(e.id),
|
|
251
251
|
value: e.id
|
|
252
252
|
}));
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function $(a = []) {
|
|
255
255
|
return (Array.isArray(a) ? a : []).filter((e) => (e == null ? void 0 : e.id) !== void 0 && (e == null ? void 0 : e.id) !== null).map((e) => ({
|
|
256
256
|
...e,
|
|
257
257
|
label: e.roleName || e.roleCode || String(e.id),
|
|
258
258
|
value: e.id
|
|
259
259
|
}));
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function V(a = []) {
|
|
262
262
|
return (Array.isArray(a) ? a : []).filter((e) => (e == null ? void 0 : e.id) !== void 0 && (e == null ? void 0 : e.id) !== null).map((e) => {
|
|
263
263
|
const l = e.businessType || "";
|
|
264
264
|
return {
|
|
265
265
|
...e,
|
|
266
|
-
businessTypeName:
|
|
266
|
+
businessTypeName: v[l] || l,
|
|
267
267
|
label: e.reasonName || "",
|
|
268
268
|
value: e.id
|
|
269
269
|
};
|
|
270
270
|
});
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function j(a = [], e = /* @__PURE__ */ new Map()) {
|
|
273
273
|
return (Array.isArray(a) ? a : []).filter((l) => (l == null ? void 0 : l.id) !== void 0 && (l == null ? void 0 : l.id) !== null).map((l) => {
|
|
274
274
|
const n = l.primaryReasonId, s = (n != null ? e.get(n) : void 0) || (n != null ? String(n) : "");
|
|
275
275
|
return {
|
|
@@ -280,21 +280,21 @@ function V(a = [], e = /* @__PURE__ */ new Map()) {
|
|
|
280
280
|
};
|
|
281
281
|
});
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function H(a = []) {
|
|
284
284
|
return (Array.isArray(a) ? a : []).filter((e) => e == null ? void 0 : e.supplierConfigPcc).map((e) => ({
|
|
285
285
|
...e,
|
|
286
286
|
label: e.supplierConfigPcc,
|
|
287
287
|
value: e.supplierConfigPcc
|
|
288
288
|
}));
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function k(a = []) {
|
|
291
291
|
return (Array.isArray(a) ? a : []).filter((e) => e == null ? void 0 : e.supplierCode).map((e) => ({
|
|
292
292
|
...e,
|
|
293
293
|
label: e.supplierName || e.supplierCode,
|
|
294
294
|
value: e.supplierCode
|
|
295
295
|
}));
|
|
296
296
|
}
|
|
297
|
-
function
|
|
297
|
+
function q(a = []) {
|
|
298
298
|
return (Array.isArray(a) ? a : []).filter((e) => e == null ? void 0 : e.purchasePlaceCode).map((e) => ({
|
|
299
299
|
...e,
|
|
300
300
|
label: e.purchasePlaceName || e.purchasePlaceCode,
|
|
@@ -306,7 +306,7 @@ function k(a = []) {
|
|
|
306
306
|
}
|
|
307
307
|
}));
|
|
308
308
|
}
|
|
309
|
-
const
|
|
309
|
+
const oe = {
|
|
310
310
|
[o.AIRLINE]: {
|
|
311
311
|
defaultFieldName: "airlineCodes",
|
|
312
312
|
defaultLabel: "航司",
|
|
@@ -315,8 +315,8 @@ const ne = {
|
|
|
315
315
|
defaultShowAll: !0,
|
|
316
316
|
async fetchOptions() {
|
|
317
317
|
try {
|
|
318
|
-
const a = await
|
|
319
|
-
return
|
|
318
|
+
const a = await O();
|
|
319
|
+
return M(a || []);
|
|
320
320
|
} catch {
|
|
321
321
|
return [];
|
|
322
322
|
}
|
|
@@ -375,7 +375,7 @@ const ne = {
|
|
|
375
375
|
valueField: "value",
|
|
376
376
|
parentField: "parentItemCode"
|
|
377
377
|
},
|
|
378
|
-
fetchOptions: C(o.SALES_ORDER_TYPE,
|
|
378
|
+
fetchOptions: C(o.SALES_ORDER_TYPE, x)
|
|
379
379
|
},
|
|
380
380
|
[o.SALES_ORDER_PRODUCT_TYPE]: {
|
|
381
381
|
defaultFieldName: "productType",
|
|
@@ -409,7 +409,7 @@ const ne = {
|
|
|
409
409
|
async fetchOptions() {
|
|
410
410
|
try {
|
|
411
411
|
const a = await I();
|
|
412
|
-
return
|
|
412
|
+
return B(a);
|
|
413
413
|
} catch {
|
|
414
414
|
return [];
|
|
415
415
|
}
|
|
@@ -424,7 +424,7 @@ const ne = {
|
|
|
424
424
|
async fetchOptions() {
|
|
425
425
|
try {
|
|
426
426
|
const a = await L();
|
|
427
|
-
return
|
|
427
|
+
return $(a || []);
|
|
428
428
|
} catch {
|
|
429
429
|
return [];
|
|
430
430
|
}
|
|
@@ -439,7 +439,7 @@ const ne = {
|
|
|
439
439
|
async fetchOptions() {
|
|
440
440
|
try {
|
|
441
441
|
const a = await R();
|
|
442
|
-
return
|
|
442
|
+
return V(a || []);
|
|
443
443
|
} catch {
|
|
444
444
|
return [];
|
|
445
445
|
}
|
|
@@ -459,7 +459,7 @@ const ne = {
|
|
|
459
459
|
]), l = /* @__PURE__ */ new Map();
|
|
460
460
|
return (e || []).forEach((n) => {
|
|
461
461
|
(n == null ? void 0 : n.id) !== void 0 && (n == null ? void 0 : n.id) !== null && l.set(n.id, n.reasonName || String(n.id));
|
|
462
|
-
}),
|
|
462
|
+
}), j(a || [], l);
|
|
463
463
|
} catch {
|
|
464
464
|
return [];
|
|
465
465
|
}
|
|
@@ -473,8 +473,8 @@ const ne = {
|
|
|
473
473
|
defaultShowAll: !1,
|
|
474
474
|
async fetchOptions() {
|
|
475
475
|
try {
|
|
476
|
-
const a = await
|
|
477
|
-
return
|
|
476
|
+
const a = await b({});
|
|
477
|
+
return H(a || []);
|
|
478
478
|
} catch {
|
|
479
479
|
return [];
|
|
480
480
|
}
|
|
@@ -488,8 +488,8 @@ const ne = {
|
|
|
488
488
|
defaultShowAll: !1,
|
|
489
489
|
async fetchOptions() {
|
|
490
490
|
try {
|
|
491
|
-
const a = await
|
|
492
|
-
return
|
|
491
|
+
const a = await h();
|
|
492
|
+
return k(a || []);
|
|
493
493
|
} catch {
|
|
494
494
|
return [];
|
|
495
495
|
}
|
|
@@ -504,24 +504,25 @@ const ne = {
|
|
|
504
504
|
defaultShowNav: !1,
|
|
505
505
|
async fetchOptions() {
|
|
506
506
|
try {
|
|
507
|
-
const a = await
|
|
508
|
-
return
|
|
507
|
+
const a = await P();
|
|
508
|
+
return q(a || []);
|
|
509
509
|
} catch {
|
|
510
510
|
return [];
|
|
511
511
|
}
|
|
512
|
-
}
|
|
512
|
+
},
|
|
513
|
+
fetchMissingOptions: _
|
|
513
514
|
}
|
|
514
515
|
};
|
|
515
516
|
export {
|
|
516
517
|
o as CODES,
|
|
517
|
-
|
|
518
|
-
|
|
518
|
+
oe as CODE_REGISTRY,
|
|
519
|
+
F as GEO_LEVEL_CODES,
|
|
519
520
|
d as GROUP_BY,
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
521
|
+
re as canDeriveGeoLevel,
|
|
522
|
+
le as deriveRegionLevelOptionsFromGeoSource,
|
|
523
|
+
Z as groupBasicDataOptions,
|
|
524
|
+
ee as groupPurchasePlaceOptions,
|
|
524
525
|
N as isGeoLevelCode,
|
|
525
|
-
|
|
526
|
-
|
|
526
|
+
ae as resolveDefaultGroupBy,
|
|
527
|
+
ne as resolveHighestGeoLevelCode
|
|
527
528
|
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { BasicDataCode, BasicDataOption } from './basicDataCodes';
|
|
2
|
+
/**
|
|
3
|
+
* PanelSelect 缺码 echo 节点:差集只扫 value/children。
|
|
4
|
+
* label 可缺省,兼容 `PanelSelectOption`(label?: string)。
|
|
5
|
+
*/
|
|
6
|
+
export type PanelMissingEchoOption = {
|
|
7
|
+
label?: string;
|
|
8
|
+
value?: string | number | null;
|
|
9
|
+
children?: PanelMissingEchoOption[];
|
|
10
|
+
deleted?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
};
|
|
14
|
+
/** PanelSelect 缺码 echo 默认作用域(业务可传 missingEchoKey 隔离) */
|
|
15
|
+
export declare const PANEL_MISSING_ECHO_DEFAULT_SCOPE = "__tt_panel_select__";
|
|
16
|
+
/** 供 dataSource / PanelSelect mergedOptions 订阅;写入 echo 后自增 */
|
|
17
|
+
export declare const missingOptionsEchoVersion: import('vue').Ref<number, number>;
|
|
18
|
+
/**
|
|
19
|
+
* 展开 values:数组项若为拼接串则拆开,去空、去重(保序)。
|
|
20
|
+
* 例:`["CGD0000316", "CGD0000030,CGD0000031"]` → `["CGD0000316", "CGD0000030", "CGD0000031"]`
|
|
21
|
+
*/
|
|
22
|
+
export declare function expandJoinedOptionValues(values?: Array<string | number>): Array<string | number>;
|
|
23
|
+
/** 读取某 CODE 已缓存的缺码 options(扁平) */
|
|
24
|
+
export declare function getEchoOptions(routePath: string, code: BasicDataCode): BasicDataOption[];
|
|
25
|
+
/**
|
|
26
|
+
* 主 options + echo 合并(按 value 去重,主列表优先)。
|
|
27
|
+
* label 保持原名;deleted 仅供 PanelSelect 高亮,CODE_TO_VALUE 读到的仍是原名。
|
|
28
|
+
*/
|
|
29
|
+
export declare function getMergedOptions(routePath: string, code: BasicDataCode, mainOptions?: BasicDataOption[]): BasicDataOption[];
|
|
30
|
+
/**
|
|
31
|
+
* 给缺码(deleted)项打上/去掉 disabled。
|
|
32
|
+
* list 放开、action 禁用;UPS 用 disableMissingOptions 控制。
|
|
33
|
+
*/
|
|
34
|
+
export declare function withMissingOptionDisabled(options: BasicDataOption[] | undefined, disabled: boolean): BasicDataOption[];
|
|
35
|
+
/**
|
|
36
|
+
* 差集补拉并写入路由级 echo 缓存。
|
|
37
|
+
* @returns 本次相关的 echo options(含缓存命中)
|
|
38
|
+
*/
|
|
39
|
+
export declare function ensureMissingOptions(routePath: string, code: BasicDataCode, values: Array<string | number>, mainOptions?: BasicDataOption[]): Promise<BasicDataOption[]>;
|
|
40
|
+
/** 读取 PanelSelect 作用域下已缓存的缺码 options(扁平) */
|
|
41
|
+
export declare function getPanelMissingEchoOptions(scopeKey?: string): PanelMissingEchoOption[];
|
|
42
|
+
/**
|
|
43
|
+
* 自定义 resolveMissingOptions 的差集补拉:全局 echo + 同缺码在途去重。
|
|
44
|
+
* 供 TtPanelSelect watch 调用;不依赖 CODE_REGISTRY。
|
|
45
|
+
* @returns 本次相关的 echo options(含缓存命中)
|
|
46
|
+
*/
|
|
47
|
+
export declare function ensurePanelResolveMissingOptions(scopeKey: string, values: Array<string | number>, mainOptions: PanelMissingEchoOption[] | undefined, fetchMissing: (codes: Array<string | number>) => Promise<PanelMissingEchoOption[]>): Promise<PanelMissingEchoOption[]>;
|
|
48
|
+
/** 仅根据主 options + 全局 panel echo 计算仍缺的码(不做请求) */
|
|
49
|
+
export declare function diffPanelMissingCodes(scopeKey: string, values: Array<string | number>, mainOptions?: PanelMissingEchoOption[]): Array<string | number>;
|
|
50
|
+
/** 清空某路由下全部 echo(可选,供调试 / 路由卸载) */
|
|
51
|
+
export declare function clearMissingOptionsEcho(routePath?: string): void;
|
|
52
|
+
/** 清空 PanelSelect 自定义 resolve 的全局 echo(可选,供调试) */
|
|
53
|
+
export declare function clearPanelMissingEcho(scopeKey?: string): void;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { ref as P } from "vue";
|
|
2
|
+
import { CODE_REGISTRY as k } from "./basicDataCodes.js";
|
|
3
|
+
const A = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), K = "__tt_panel_select__", _ = P(0);
|
|
4
|
+
function E(r, e) {
|
|
5
|
+
return `${r}::${e}`;
|
|
6
|
+
}
|
|
7
|
+
function f(r) {
|
|
8
|
+
return String(r);
|
|
9
|
+
}
|
|
10
|
+
const C = /[,,|/]/;
|
|
11
|
+
function R(r = []) {
|
|
12
|
+
const e = [], n = /* @__PURE__ */ new Set();
|
|
13
|
+
return (Array.isArray(r) ? r : []).forEach((o) => {
|
|
14
|
+
if (!(o == null || o === "")) {
|
|
15
|
+
if (typeof o == "number") {
|
|
16
|
+
const s = f(o);
|
|
17
|
+
if (n.has(s)) return;
|
|
18
|
+
n.add(s), e.push(o);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
String(o).split(C).map((s) => s.trim()).filter(Boolean).forEach((s) => {
|
|
22
|
+
n.has(s) || (n.add(s), e.push(s));
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}), e;
|
|
26
|
+
}
|
|
27
|
+
function O(r = []) {
|
|
28
|
+
const e = /* @__PURE__ */ new Set(), n = (o = []) => {
|
|
29
|
+
o.forEach((s) => {
|
|
30
|
+
var u;
|
|
31
|
+
if ((u = s.children) != null && u.length) {
|
|
32
|
+
n(s.children);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
s.value !== void 0 && s.value !== null && s.value !== "" && e.add(f(s.value));
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
return n(Array.isArray(r) ? r : []), e;
|
|
39
|
+
}
|
|
40
|
+
function $(r, e) {
|
|
41
|
+
const n = E(r, e);
|
|
42
|
+
let o = A.get(n);
|
|
43
|
+
return o || (o = /* @__PURE__ */ new Map(), A.set(n, o)), o;
|
|
44
|
+
}
|
|
45
|
+
function B(r, e) {
|
|
46
|
+
const n = A.get(E(r, e));
|
|
47
|
+
return n ? Array.from(n.values()) : [];
|
|
48
|
+
}
|
|
49
|
+
function x(r, e, n = []) {
|
|
50
|
+
const o = Array.isArray(n) ? n : [], s = B(r, e);
|
|
51
|
+
if (!s.length) return o;
|
|
52
|
+
const u = O(o), a = s.filter((t) => t.value !== void 0 && !u.has(f(t.value)));
|
|
53
|
+
return a.length ? [...o, ...a] : o;
|
|
54
|
+
}
|
|
55
|
+
function V(r = [], e) {
|
|
56
|
+
return !Array.isArray(r) || !r.length ? Array.isArray(r) ? r : [] : r.map((n) => {
|
|
57
|
+
var o;
|
|
58
|
+
return (o = n == null ? void 0 : n.children) != null && o.length ? { ...n, children: V(n.children, e) } : (n == null ? void 0 : n.deleted) === !0 ? { ...n, disabled: e } : n;
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function M(r, e, n) {
|
|
62
|
+
const o = O(e), s = [], u = /* @__PURE__ */ new Set();
|
|
63
|
+
return R(r).forEach((a) => {
|
|
64
|
+
const t = f(a);
|
|
65
|
+
u.has(t) || o.has(t) || n.has(t) || (u.add(t), s.push(a));
|
|
66
|
+
}), s;
|
|
67
|
+
}
|
|
68
|
+
async function L(r, e, n, o = []) {
|
|
69
|
+
const s = k[e], u = s == null ? void 0 : s.fetchMissingOptions, a = $(r, e);
|
|
70
|
+
if (!u)
|
|
71
|
+
return Array.from(a.values());
|
|
72
|
+
const t = M(n, o, a);
|
|
73
|
+
if (!t.length)
|
|
74
|
+
return Array.from(a.values());
|
|
75
|
+
const i = `${E(r, e)}::${t.map(f).sort().join(",")}`;
|
|
76
|
+
let h = p.get(i);
|
|
77
|
+
return h || (h = u(t).then((y) => {
|
|
78
|
+
const c = Array.isArray(y) ? y : [];
|
|
79
|
+
let g = !1;
|
|
80
|
+
return c.forEach((l) => {
|
|
81
|
+
if ((l == null ? void 0 : l.value) === void 0 || (l == null ? void 0 : l.value) === null || (l == null ? void 0 : l.value) === "") return;
|
|
82
|
+
const w = f(l.value);
|
|
83
|
+
a.has(w) || (a.set(w, l), g = !0);
|
|
84
|
+
}), g && (_.value += 1), Array.from(a.values());
|
|
85
|
+
}).finally(() => {
|
|
86
|
+
p.get(i) === h && p.delete(i);
|
|
87
|
+
}), p.set(i, h)), h;
|
|
88
|
+
}
|
|
89
|
+
function S(r) {
|
|
90
|
+
const e = r || K;
|
|
91
|
+
let n = v.get(e);
|
|
92
|
+
return n || (n = /* @__PURE__ */ new Map(), v.set(e, n)), n;
|
|
93
|
+
}
|
|
94
|
+
function N(r) {
|
|
95
|
+
const e = v.get(r);
|
|
96
|
+
return e ? Array.from(e.values()) : [];
|
|
97
|
+
}
|
|
98
|
+
async function T(r, e, n = [], o) {
|
|
99
|
+
const s = S(r);
|
|
100
|
+
if (!o)
|
|
101
|
+
return Array.from(s.values());
|
|
102
|
+
const u = M(e, n, s);
|
|
103
|
+
if (!u.length)
|
|
104
|
+
return Array.from(s.values());
|
|
105
|
+
const a = `${r}::${u.map(f).sort().join(",")}`;
|
|
106
|
+
let t = d.get(a);
|
|
107
|
+
return t || (t = Promise.resolve().then(() => o(u)).then((i) => {
|
|
108
|
+
const h = Array.isArray(i) ? i : [];
|
|
109
|
+
let y = !1;
|
|
110
|
+
return h.forEach((c) => {
|
|
111
|
+
if ((c == null ? void 0 : c.value) === void 0 || (c == null ? void 0 : c.value) === null || (c == null ? void 0 : c.value) === "") return;
|
|
112
|
+
const g = f(c.value);
|
|
113
|
+
s.has(g) || (s.set(g, c), y = !0);
|
|
114
|
+
}), y && (_.value += 1), Array.from(s.values());
|
|
115
|
+
}).finally(() => {
|
|
116
|
+
d.get(a) === t && d.delete(a);
|
|
117
|
+
}), d.set(a, t)), t;
|
|
118
|
+
}
|
|
119
|
+
function j(r, e, n = []) {
|
|
120
|
+
return M(e, n, S(r));
|
|
121
|
+
}
|
|
122
|
+
export {
|
|
123
|
+
K as PANEL_MISSING_ECHO_DEFAULT_SCOPE,
|
|
124
|
+
j as diffPanelMissingCodes,
|
|
125
|
+
L as ensureMissingOptions,
|
|
126
|
+
T as ensurePanelResolveMissingOptions,
|
|
127
|
+
R as expandJoinedOptionValues,
|
|
128
|
+
B as getEchoOptions,
|
|
129
|
+
x as getMergedOptions,
|
|
130
|
+
N as getPanelMissingEchoOptions,
|
|
131
|
+
_ as missingOptionsEchoVersion,
|
|
132
|
+
V as withMissingOptionDisabled
|
|
133
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BasicDataCode } from './basicDataCodes';
|
|
2
|
+
export type PanelSelectEchoField = {
|
|
3
|
+
code: BasicDataCode;
|
|
4
|
+
fieldName: string;
|
|
5
|
+
};
|
|
6
|
+
/** UPS 登记本页需为 CODE_TO_VALUE / 表格补缺的字段 */
|
|
7
|
+
export declare function registerPanelSelectEchoField(routePath: string, code: BasicDataCode, fieldName: string): void;
|
|
8
|
+
export declare function getRegisteredPanelSelectEchoFields(routePath: string): PanelSelectEchoField[];
|
|
9
|
+
/**
|
|
10
|
+
* 列表数据就绪后:按登记 fieldName 收集 value → ensureMissing,喂饱 dataSource 供 CODE_TO_VALUE。
|
|
11
|
+
*/
|
|
12
|
+
export declare function ensureMissingOptionsForTableRows(routePath: string, rows: Record<string, any>[]): Promise<void>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { CODES as l, CODE_REGISTRY as u } from "./basicDataCodes.js";
|
|
2
|
+
import { ensureMissingOptions as m, expandJoinedOptionValues as p } from "./missingOptionsCache.js";
|
|
3
|
+
import { getBasicDataMainOptions as E } from "./useBasicDataOptions.js";
|
|
4
|
+
import { awaitDataPermissionReady as y, getDataPermissionMainOptions as A } from "./useDataPermissionOptions.js";
|
|
5
|
+
const c = /* @__PURE__ */ new Map();
|
|
6
|
+
function M(n, i) {
|
|
7
|
+
return `${n}::${i}`;
|
|
8
|
+
}
|
|
9
|
+
function S(n, i, r) {
|
|
10
|
+
var t;
|
|
11
|
+
if (!((t = u[i]) != null && t.fetchMissingOptions) || !r) return;
|
|
12
|
+
let e = c.get(n);
|
|
13
|
+
e || (e = /* @__PURE__ */ new Map(), c.set(n, e)), e.set(M(i, r), { code: i, fieldName: r });
|
|
14
|
+
}
|
|
15
|
+
function d(n) {
|
|
16
|
+
const i = c.get(n);
|
|
17
|
+
return i ? Array.from(i.values()) : [];
|
|
18
|
+
}
|
|
19
|
+
function O(n) {
|
|
20
|
+
return Array.isArray(n) ? p(
|
|
21
|
+
n.filter((i) => i != null && i !== "")
|
|
22
|
+
) : n == null || n === "" ? [] : p([n]);
|
|
23
|
+
}
|
|
24
|
+
async function D(n, i) {
|
|
25
|
+
const r = d(n);
|
|
26
|
+
if (!r.length || !Array.isArray(i) || !i.length) return;
|
|
27
|
+
const e = /* @__PURE__ */ new Map();
|
|
28
|
+
r.forEach(({ code: t, fieldName: f }) => {
|
|
29
|
+
let s = e.get(t);
|
|
30
|
+
s || (s = /* @__PURE__ */ new Set(), e.set(t, s)), i.forEach((a) => {
|
|
31
|
+
O(a == null ? void 0 : a[f]).forEach((o) => s.add(o));
|
|
32
|
+
});
|
|
33
|
+
}), e.has(l.PURCHASE_PLACE) && await y(n, ["purchasePlaceId"]), await Promise.all(
|
|
34
|
+
[...e.entries()].map(([t, f]) => {
|
|
35
|
+
const s = [...f];
|
|
36
|
+
if (!s.length) return Promise.resolve([]);
|
|
37
|
+
const a = E(n, t), o = t === l.PURCHASE_PLACE ? A(n, "purchasePlaceId") : [], g = o.length ? [...a, ...o] : a;
|
|
38
|
+
return m(n, t, s, g);
|
|
39
|
+
})
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
D as ensureMissingOptionsForTableRows,
|
|
44
|
+
d as getRegisteredPanelSelectEchoFields,
|
|
45
|
+
S as registerPanelSelectEchoField
|
|
46
|
+
};
|
|
@@ -6,6 +6,8 @@ export interface UseBasicDataOptionsParams {
|
|
|
6
6
|
/** 外部数据源。未传时按 codes 走 CODE_REGISTRY 请求。 */
|
|
7
7
|
dataSource?: MaybeRef<BasicDataOptionsMap | undefined>;
|
|
8
8
|
}
|
|
9
|
+
/** 读取路由级主列表缓存(不含缺码 echo),供 ensureMissing 算差集 */
|
|
10
|
+
export declare function getBasicDataMainOptions(routePath: string, code: BasicDataCode): BasicDataOption[];
|
|
9
11
|
/**
|
|
10
12
|
* 按基础数据 code 拉取并缓存 options。
|
|
11
13
|
* 接口失败或返回非数组时兜底为空数组,不影响表单 schema 生成与渲染。
|