@dazhicheng/ui 1.6.74 → 1.6.75
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/basicData.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export type BasicDataOption = {
|
|
|
39
39
|
/**
|
|
40
40
|
* PanelSelect 分组方式。
|
|
41
41
|
* - continent / region / country:按洲 / 区域 / 国家树形分组
|
|
42
|
-
* - businessType / primaryReason / supplierManageName:按业务字段树形分组
|
|
42
|
+
* - businessType / primaryReason / supplierManageName / airlineType:按业务字段树形分组
|
|
43
43
|
* - pinyin:按拼音首字母分组(TtPanelSelect showPinyinMode)
|
|
44
44
|
* - none:不分组,原样平铺(TtPanelSelect showOriginMode)
|
|
45
45
|
*/
|
|
@@ -53,6 +53,8 @@ export declare const GROUP_BY: {
|
|
|
53
53
|
readonly PRIMARY_REASON: "primaryReason";
|
|
54
54
|
/** 按供应商名称(配置号) */
|
|
55
55
|
readonly SUPPLIER_MANAGE_NAME: "supplierManageName";
|
|
56
|
+
/** 按航司类型:1-境内 / 2-境外 */
|
|
57
|
+
readonly AIRLINE_TYPE: "airlineType";
|
|
56
58
|
readonly PINYIN: "pinyin";
|
|
57
59
|
/** 不分组,原样平铺 */
|
|
58
60
|
readonly NONE: "none";
|
|
@@ -38,6 +38,8 @@ const o = {
|
|
|
38
38
|
PRIMARY_REASON: "primaryReason",
|
|
39
39
|
/** 按供应商名称(配置号) */
|
|
40
40
|
SUPPLIER_MANAGE_NAME: "supplierManageName",
|
|
41
|
+
/** 按航司类型:1-境内 / 2-境外 */
|
|
42
|
+
AIRLINE_TYPE: "airlineType",
|
|
41
43
|
PINYIN: "pinyin",
|
|
42
44
|
/** 不分组,原样平铺 */
|
|
43
45
|
NONE: "none"
|
|
@@ -51,13 +53,17 @@ const o = {
|
|
|
51
53
|
codeKey: "supplierManageName",
|
|
52
54
|
nameKey: "supplierManageName",
|
|
53
55
|
labelMode: "name"
|
|
54
|
-
}
|
|
56
|
+
},
|
|
57
|
+
[d.AIRLINE_TYPE]: { codeKey: "airlineType", nameKey: "airlineTypeName", labelMode: "name" }
|
|
55
58
|
}, g = {
|
|
56
59
|
TICKETING: "出票",
|
|
57
60
|
REFUND: "退票",
|
|
58
61
|
REBOOK: "改签"
|
|
62
|
+
}, v = {
|
|
63
|
+
1: "境内",
|
|
64
|
+
2: "境外"
|
|
59
65
|
};
|
|
60
|
-
function
|
|
66
|
+
function X(a, e) {
|
|
61
67
|
if (!Array.isArray(a) || !a.length) return a || [];
|
|
62
68
|
if (e === d.PINYIN || e === d.NONE) return a;
|
|
63
69
|
const l = b[e];
|
|
@@ -78,7 +84,7 @@ function Q(a, e) {
|
|
|
78
84
|
n.get(i).children.push(u);
|
|
79
85
|
}), s.map((u) => n.get(u));
|
|
80
86
|
}
|
|
81
|
-
function
|
|
87
|
+
function Z(a) {
|
|
82
88
|
const e = /* @__PURE__ */ new Map();
|
|
83
89
|
return (Array.isArray(a) ? a : []).forEach((l) => {
|
|
84
90
|
const n = l.purchaseInfo || l, s = (n == null ? void 0 : n.supplierSubType) ?? "其他";
|
|
@@ -90,24 +96,28 @@ function X(a) {
|
|
|
90
96
|
}, e.set(s, r)), r.children.push(l);
|
|
91
97
|
}), Array.from(e.values());
|
|
92
98
|
}
|
|
93
|
-
function
|
|
99
|
+
function ee(a, e) {
|
|
94
100
|
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);
|
|
95
101
|
}
|
|
96
|
-
const
|
|
102
|
+
const K = {
|
|
97
103
|
1: { codeKey: "continentCode", nameKey: "continentName", statusKey: "continentStatus" },
|
|
98
104
|
2: { codeKey: "regionCode", nameKey: "regionName", statusKey: "regionStatus" },
|
|
99
105
|
3: { codeKey: "countryCode", nameKey: "countryName", statusKey: "countryStatus" },
|
|
100
106
|
4: { codeKey: "cityCode", nameKey: "cityName", statusKey: "cityStatus" },
|
|
101
107
|
5: { codeKey: "airportCode", nameKey: "airportName", statusKey: "airportStatus" }
|
|
102
108
|
};
|
|
103
|
-
function
|
|
104
|
-
return (Array.isArray(a) ? a : []).filter((e) => e == null ? void 0 : e.airlineCode).map((e) =>
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
function M(a = []) {
|
|
110
|
+
return (Array.isArray(a) ? a : []).filter((e) => e == null ? void 0 : e.airlineCode).map((e) => {
|
|
111
|
+
const l = e.airlineType, n = l != null ? String(l) : "";
|
|
112
|
+
return {
|
|
113
|
+
...e,
|
|
114
|
+
airlineTypeName: v[n] || n,
|
|
115
|
+
label: `${e.airlineCode}(${e.airlineNameCn || ""})`,
|
|
116
|
+
value: e.airlineCode
|
|
117
|
+
};
|
|
118
|
+
});
|
|
109
119
|
}
|
|
110
|
-
function
|
|
120
|
+
function Y(a) {
|
|
111
121
|
if (!a || typeof a != "object" || Array.isArray(a))
|
|
112
122
|
return a || {};
|
|
113
123
|
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]);
|
|
@@ -124,28 +134,28 @@ function M(a) {
|
|
|
124
134
|
for (const u of [1, 2, 3, 4, 5]) {
|
|
125
135
|
const t = a[String(u)] || a[u];
|
|
126
136
|
if (!t || typeof t != "object") continue;
|
|
127
|
-
const { codeKey: c, nameKey: i, statusKey: f } =
|
|
137
|
+
const { codeKey: c, nameKey: i, statusKey: f } = K[u];
|
|
128
138
|
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);
|
|
129
139
|
}
|
|
130
140
|
return r;
|
|
131
141
|
}
|
|
132
142
|
function w(a) {
|
|
133
|
-
return (Array.isArray(a) ? a : []).map((l) =>
|
|
143
|
+
return (Array.isArray(a) ? a : []).map((l) => Y(l || {}));
|
|
134
144
|
}
|
|
135
|
-
function
|
|
145
|
+
function U(a = [], e, l) {
|
|
136
146
|
return (Array.isArray(a) ? a : []).filter((n) => n == null ? void 0 : n[e]).map((n) => ({
|
|
137
147
|
...n,
|
|
138
148
|
label: `${n[e]}(${n[l] || ""})`,
|
|
139
149
|
value: n[e]
|
|
140
150
|
}));
|
|
141
151
|
}
|
|
142
|
-
const
|
|
152
|
+
const F = [o.CONTINENT, o.REGION, o.COUNTRY, o.CITY, o.AIRPORT], y = {
|
|
143
153
|
[o.CONTINENT]: 1,
|
|
144
154
|
[o.REGION]: 2,
|
|
145
155
|
[o.COUNTRY]: 3,
|
|
146
156
|
[o.CITY]: 4,
|
|
147
157
|
[o.AIRPORT]: 5
|
|
148
|
-
},
|
|
158
|
+
}, D = {
|
|
149
159
|
[o.CONTINENT]: { codeKey: "continentCode", nameKey: "continentName" },
|
|
150
160
|
[o.REGION]: { codeKey: "regionCode", nameKey: "regionName" },
|
|
151
161
|
[o.COUNTRY]: { codeKey: "countryCode", nameKey: "countryName" },
|
|
@@ -154,14 +164,14 @@ const U = [o.CONTINENT, o.REGION, o.COUNTRY, o.CITY, o.AIRPORT], y = {
|
|
|
154
164
|
};
|
|
155
165
|
o.CONTINENT, o.REGION, o.COUNTRY, o.CITY;
|
|
156
166
|
function N(a) {
|
|
157
|
-
return
|
|
167
|
+
return F.includes(a);
|
|
158
168
|
}
|
|
159
|
-
function
|
|
169
|
+
function ae(a, e) {
|
|
160
170
|
return !N(a) || !N(e) ? !1 : y[a] > y[e];
|
|
161
171
|
}
|
|
162
|
-
function
|
|
172
|
+
function re(a, e) {
|
|
163
173
|
if (!N(e)) return [];
|
|
164
|
-
const { codeKey: l, nameKey: n } =
|
|
174
|
+
const { codeKey: l, nameKey: n } = D[e], s = /* @__PURE__ */ new Map();
|
|
165
175
|
return (Array.isArray(a) ? a : []).forEach((r) => {
|
|
166
176
|
const u = r == null ? void 0 : r[l];
|
|
167
177
|
if (u == null || u === "") return;
|
|
@@ -173,7 +183,7 @@ function ae(a, e) {
|
|
|
173
183
|
});
|
|
174
184
|
}), Array.from(s.values());
|
|
175
185
|
}
|
|
176
|
-
function
|
|
186
|
+
function le(a) {
|
|
177
187
|
let e;
|
|
178
188
|
for (const l of a)
|
|
179
189
|
N(l) && (!e || y[l] > y[e]) && (e = l);
|
|
@@ -183,20 +193,20 @@ function p(a, e, l) {
|
|
|
183
193
|
return async () => {
|
|
184
194
|
try {
|
|
185
195
|
const n = await A({ type: a });
|
|
186
|
-
return
|
|
196
|
+
return U(w(n), e, l);
|
|
187
197
|
} catch {
|
|
188
198
|
return [];
|
|
189
199
|
}
|
|
190
200
|
};
|
|
191
201
|
}
|
|
192
|
-
function
|
|
202
|
+
function G(a = []) {
|
|
193
203
|
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) => ({
|
|
194
204
|
...e,
|
|
195
205
|
label: e.itemName || "",
|
|
196
206
|
value: e.itemCode
|
|
197
207
|
}));
|
|
198
208
|
}
|
|
199
|
-
function
|
|
209
|
+
function m(a = []) {
|
|
200
210
|
const e = Array.isArray(a) ? a : [], l = new Set(
|
|
201
211
|
e.map((r) => r.parentItemCode).filter((r) => r != null && String(r) !== "").map(String)
|
|
202
212
|
), n = new Set(
|
|
@@ -219,7 +229,7 @@ function G(a = []) {
|
|
|
219
229
|
});
|
|
220
230
|
}), s;
|
|
221
231
|
}
|
|
222
|
-
function S(a, e =
|
|
232
|
+
function S(a, e = G) {
|
|
223
233
|
return async (l) => {
|
|
224
234
|
try {
|
|
225
235
|
const n = await R({
|
|
@@ -232,21 +242,21 @@ function S(a, e = D) {
|
|
|
232
242
|
}
|
|
233
243
|
};
|
|
234
244
|
}
|
|
235
|
-
function
|
|
245
|
+
function x(a = []) {
|
|
236
246
|
return (Array.isArray(a) ? a : []).filter((e) => (e == null ? void 0 : e.id) !== void 0 && (e == null ? void 0 : e.id) !== null).map((e) => ({
|
|
237
247
|
...e,
|
|
238
248
|
label: e.fullName || e.username || String(e.id),
|
|
239
249
|
value: e.id
|
|
240
250
|
}));
|
|
241
251
|
}
|
|
242
|
-
function
|
|
252
|
+
function B(a = []) {
|
|
243
253
|
return (Array.isArray(a) ? a : []).filter((e) => (e == null ? void 0 : e.id) !== void 0 && (e == null ? void 0 : e.id) !== null).map((e) => ({
|
|
244
254
|
...e,
|
|
245
255
|
label: e.roleName || e.roleCode || String(e.id),
|
|
246
256
|
value: e.id
|
|
247
257
|
}));
|
|
248
258
|
}
|
|
249
|
-
function
|
|
259
|
+
function $(a = []) {
|
|
250
260
|
return (Array.isArray(a) ? a : []).filter((e) => (e == null ? void 0 : e.id) !== void 0 && (e == null ? void 0 : e.id) !== null).map((e) => {
|
|
251
261
|
const l = e.businessType || "";
|
|
252
262
|
return {
|
|
@@ -257,7 +267,7 @@ function B(a = []) {
|
|
|
257
267
|
};
|
|
258
268
|
});
|
|
259
269
|
}
|
|
260
|
-
function
|
|
270
|
+
function V(a = [], e = /* @__PURE__ */ new Map()) {
|
|
261
271
|
return (Array.isArray(a) ? a : []).filter((l) => (l == null ? void 0 : l.id) !== void 0 && (l == null ? void 0 : l.id) !== null).map((l) => {
|
|
262
272
|
const n = l.primaryReasonId, s = (n != null ? e.get(n) : void 0) || (n != null ? String(n) : "");
|
|
263
273
|
return {
|
|
@@ -268,21 +278,21 @@ function $(a = [], e = /* @__PURE__ */ new Map()) {
|
|
|
268
278
|
};
|
|
269
279
|
});
|
|
270
280
|
}
|
|
271
|
-
function
|
|
281
|
+
function j(a = []) {
|
|
272
282
|
return (Array.isArray(a) ? a : []).filter((e) => e == null ? void 0 : e.supplierConfigPcc).map((e) => ({
|
|
273
283
|
...e,
|
|
274
284
|
label: e.supplierConfigPcc,
|
|
275
285
|
value: e.supplierConfigPcc
|
|
276
286
|
}));
|
|
277
287
|
}
|
|
278
|
-
function
|
|
288
|
+
function H(a = []) {
|
|
279
289
|
return (Array.isArray(a) ? a : []).filter((e) => e == null ? void 0 : e.supplierCode).map((e) => ({
|
|
280
290
|
...e,
|
|
281
291
|
label: e.supplierName || e.supplierCode,
|
|
282
292
|
value: e.supplierCode
|
|
283
293
|
}));
|
|
284
294
|
}
|
|
285
|
-
function
|
|
295
|
+
function k(a = []) {
|
|
286
296
|
return (Array.isArray(a) ? a : []).filter((e) => e == null ? void 0 : e.purchasePlaceCode).map((e) => ({
|
|
287
297
|
...e,
|
|
288
298
|
label: e.purchasePlaceName || e.purchasePlaceCode,
|
|
@@ -294,7 +304,7 @@ function H(a = []) {
|
|
|
294
304
|
}
|
|
295
305
|
}));
|
|
296
306
|
}
|
|
297
|
-
const
|
|
307
|
+
const ne = {
|
|
298
308
|
[o.AIRLINE]: {
|
|
299
309
|
defaultFieldName: "airlineCodes",
|
|
300
310
|
defaultLabel: "航司",
|
|
@@ -304,7 +314,7 @@ const le = {
|
|
|
304
314
|
async fetchOptions() {
|
|
305
315
|
try {
|
|
306
316
|
const a = await O();
|
|
307
|
-
return
|
|
317
|
+
return M(a || []);
|
|
308
318
|
} catch {
|
|
309
319
|
return [];
|
|
310
320
|
}
|
|
@@ -363,7 +373,7 @@ const le = {
|
|
|
363
373
|
valueField: "value",
|
|
364
374
|
parentField: "parentItemCode"
|
|
365
375
|
},
|
|
366
|
-
fetchOptions: S(o.SALES_ORDER_TYPE,
|
|
376
|
+
fetchOptions: S(o.SALES_ORDER_TYPE, m)
|
|
367
377
|
},
|
|
368
378
|
[o.SALES_ORDER_PRODUCT_TYPE]: {
|
|
369
379
|
defaultFieldName: "productType",
|
|
@@ -388,7 +398,7 @@ const le = {
|
|
|
388
398
|
async fetchOptions() {
|
|
389
399
|
try {
|
|
390
400
|
const a = await I();
|
|
391
|
-
return
|
|
401
|
+
return x(a);
|
|
392
402
|
} catch {
|
|
393
403
|
return [];
|
|
394
404
|
}
|
|
@@ -403,7 +413,7 @@ const le = {
|
|
|
403
413
|
async fetchOptions() {
|
|
404
414
|
try {
|
|
405
415
|
const a = await L();
|
|
406
|
-
return
|
|
416
|
+
return B(a || []);
|
|
407
417
|
} catch {
|
|
408
418
|
return [];
|
|
409
419
|
}
|
|
@@ -418,7 +428,7 @@ const le = {
|
|
|
418
428
|
async fetchOptions() {
|
|
419
429
|
try {
|
|
420
430
|
const a = await C();
|
|
421
|
-
return
|
|
431
|
+
return $(a || []);
|
|
422
432
|
} catch {
|
|
423
433
|
return [];
|
|
424
434
|
}
|
|
@@ -438,7 +448,7 @@ const le = {
|
|
|
438
448
|
]), l = /* @__PURE__ */ new Map();
|
|
439
449
|
return (e || []).forEach((n) => {
|
|
440
450
|
(n == null ? void 0 : n.id) !== void 0 && (n == null ? void 0 : n.id) !== null && l.set(n.id, n.reasonName || String(n.id));
|
|
441
|
-
}),
|
|
451
|
+
}), V(a || [], l);
|
|
442
452
|
} catch {
|
|
443
453
|
return [];
|
|
444
454
|
}
|
|
@@ -453,7 +463,7 @@ const le = {
|
|
|
453
463
|
async fetchOptions() {
|
|
454
464
|
try {
|
|
455
465
|
const a = await h({});
|
|
456
|
-
return
|
|
466
|
+
return j(a || []);
|
|
457
467
|
} catch {
|
|
458
468
|
return [];
|
|
459
469
|
}
|
|
@@ -468,7 +478,7 @@ const le = {
|
|
|
468
478
|
async fetchOptions() {
|
|
469
479
|
try {
|
|
470
480
|
const a = await _();
|
|
471
|
-
return
|
|
481
|
+
return H(a || []);
|
|
472
482
|
} catch {
|
|
473
483
|
return [];
|
|
474
484
|
}
|
|
@@ -484,7 +494,7 @@ const le = {
|
|
|
484
494
|
async fetchOptions() {
|
|
485
495
|
try {
|
|
486
496
|
const a = await P();
|
|
487
|
-
return
|
|
497
|
+
return k(a || []);
|
|
488
498
|
} catch {
|
|
489
499
|
return [];
|
|
490
500
|
}
|
|
@@ -493,14 +503,14 @@ const le = {
|
|
|
493
503
|
};
|
|
494
504
|
export {
|
|
495
505
|
o as CODES,
|
|
496
|
-
|
|
497
|
-
|
|
506
|
+
ne as CODE_REGISTRY,
|
|
507
|
+
F as GEO_LEVEL_CODES,
|
|
498
508
|
d as GROUP_BY,
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
509
|
+
ae as canDeriveGeoLevel,
|
|
510
|
+
re as deriveRegionLevelOptionsFromGeoSource,
|
|
511
|
+
X as groupBasicDataOptions,
|
|
512
|
+
Z as groupPurchasePlaceOptions,
|
|
503
513
|
N as isGeoLevelCode,
|
|
504
|
-
|
|
505
|
-
|
|
514
|
+
ee as resolveDefaultGroupBy,
|
|
515
|
+
le as resolveHighestGeoLevelCode
|
|
506
516
|
};
|
|
@@ -54,8 +54,9 @@ export interface PanelSelectFieldConfig<TValues extends Recordable = Recordable>
|
|
|
54
54
|
* 分组方式。
|
|
55
55
|
* - 洲默认 `none`;机场/城市默认 `country`;国家/区域默认 `continent`
|
|
56
56
|
* - 亏损原因默认 `businessType`;细类默认 `primaryReason`;配置号默认 `supplierManageName`
|
|
57
|
-
* -
|
|
58
|
-
* -
|
|
57
|
+
* - 航司可传 `airlineType`(1-境内 / 2-境外);默认仍为 `pinyin`
|
|
58
|
+
* - 可传 `continent` / `region` / `country` / `businessType` / `primaryReason` / `supplierManageName` / `airlineType` / `pinyin` / `none`
|
|
59
|
+
* - 也可用 `GROUP_BY.CONTINENT` / `GROUP_BY.AIRLINE_TYPE` 等常量
|
|
59
60
|
*/
|
|
60
61
|
groupBy?: PanelSelectGroupBy;
|
|
61
62
|
/** 自定义过滤完整 options(过滤在分组前执行,入参为扁平 options) */
|