@dazhicheng/ui 1.6.13 → 1.6.15
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
CHANGED
|
@@ -26,3 +26,7 @@ export declare function listAllValidSupplierManage(params?: {
|
|
|
26
26
|
}, options?: {
|
|
27
27
|
[key: string]: any;
|
|
28
28
|
}): Promise<SupplierManageListItem[]>;
|
|
29
|
+
/** 获取全量采购地数据 GET /supplier/supplierPurchase/listAll */
|
|
30
|
+
export declare function listAllSupplierPurchase(options?: {
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
}): Promise<SupplierAPI.SupplierPurchaseListCO[]>;
|
package/dist/api/supplier.js
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import { request as
|
|
2
|
-
async function
|
|
3
|
-
return
|
|
1
|
+
import { request as i } from "../utils/xhr.js";
|
|
2
|
+
async function r(l = {}, e) {
|
|
3
|
+
return i.post({
|
|
4
4
|
url: "/supplier/supplierConfigManage/getAllConfigList",
|
|
5
|
-
params:
|
|
5
|
+
params: l
|
|
6
6
|
});
|
|
7
7
|
}
|
|
8
|
-
async function
|
|
9
|
-
return
|
|
8
|
+
async function n(l, e) {
|
|
9
|
+
return i.get({
|
|
10
10
|
url: "/supplier/supplierManage/listAllValid",
|
|
11
|
-
params:
|
|
11
|
+
params: l
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
async function s(l) {
|
|
15
|
+
return i.get({
|
|
16
|
+
url: "/supplier/supplierPurchase/listAll"
|
|
12
17
|
});
|
|
13
18
|
}
|
|
14
19
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
r as getAllConfigListSupplierConfigManage,
|
|
21
|
+
s as listAllSupplierPurchase,
|
|
22
|
+
n as listAllValidSupplierManage
|
|
17
23
|
};
|
|
@@ -26,6 +26,8 @@ export declare const CODES: {
|
|
|
26
26
|
readonly SUPPLIER_CONFIG: "supplierConfig";
|
|
27
27
|
/** 供应商(/supplier/supplierManage/listAllValid) */
|
|
28
28
|
readonly SUPPLIER: "supplier";
|
|
29
|
+
/** 采购地(/supplier/supplierPurchase/listAll) */
|
|
30
|
+
readonly PURCHASE_PLACE: "purchasePlace";
|
|
29
31
|
};
|
|
30
32
|
export type BasicDataCode = (typeof CODES)[keyof typeof CODES];
|
|
31
33
|
export type BasicDataOption = {
|
|
@@ -61,6 +63,11 @@ export type PanelSelectGroupBy = (typeof GROUP_BY)[keyof typeof GROUP_BY];
|
|
|
61
63
|
* `pinyin` / `none` 或不支持的分组原样返回,交由组件拼音/平铺模式处理。
|
|
62
64
|
*/
|
|
63
65
|
export declare function groupBasicDataOptions(options: BasicDataOption[], groupBy: PanelSelectGroupBy): BasicDataOption[];
|
|
66
|
+
/**
|
|
67
|
+
* 采购地 options 按 supplierSubType 分组为树形结构。
|
|
68
|
+
* 兼容 purchaseInfo 嵌套(数据权限)与 listAll 扁平字段。
|
|
69
|
+
*/
|
|
70
|
+
export declare function groupPurchasePlaceOptions(options: BasicDataOption[]): BasicDataOption[];
|
|
64
71
|
/** 各 code 默认分组;未特殊指定时为拼音 */
|
|
65
72
|
export declare function resolveDefaultGroupBy(code: BasicDataCode, groupBy?: PanelSelectGroupBy): PanelSelectGroupBy;
|
|
66
73
|
export type BasicDataFetchContext = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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
3
|
import { secondaryDropdownListLossReason as T, primaryDropdownListLossReason as C } from "../api/lossReason.js";
|
|
4
|
-
import { listAllValidSupplierManage as _, getAllConfigListSupplierConfigManage as
|
|
4
|
+
import { listAllSupplierPurchase as P, listAllValidSupplierManage as _, getAllConfigListSupplierConfigManage as h } from "../api/supplier.js";
|
|
5
5
|
const o = {
|
|
6
6
|
AIRLINE: "airline",
|
|
7
7
|
CONTINENT: "continent",
|
|
@@ -24,7 +24,9 @@ const o = {
|
|
|
24
24
|
/** 配置号(/supplier/supplierConfigManage/getAllConfigList) */
|
|
25
25
|
SUPPLIER_CONFIG: "supplierConfig",
|
|
26
26
|
/** 供应商(/supplier/supplierManage/listAllValid) */
|
|
27
|
-
SUPPLIER: "supplier"
|
|
27
|
+
SUPPLIER: "supplier",
|
|
28
|
+
/** 采购地(/supplier/supplierPurchase/listAll) */
|
|
29
|
+
PURCHASE_PLACE: "purchasePlace"
|
|
28
30
|
}, d = {
|
|
29
31
|
CONTINENT: "continent",
|
|
30
32
|
REGION: "region",
|
|
@@ -38,7 +40,7 @@ const o = {
|
|
|
38
40
|
PINYIN: "pinyin",
|
|
39
41
|
/** 不分组,原样平铺 */
|
|
40
42
|
NONE: "none"
|
|
41
|
-
},
|
|
43
|
+
}, b = {
|
|
42
44
|
[d.CONTINENT]: { codeKey: "continentCode", nameKey: "continentName" },
|
|
43
45
|
[d.REGION]: { codeKey: "regionCode", nameKey: "regionName" },
|
|
44
46
|
[d.COUNTRY]: { codeKey: "countryCode", nameKey: "countryName" },
|
|
@@ -49,88 +51,100 @@ const o = {
|
|
|
49
51
|
nameKey: "supplierManageName",
|
|
50
52
|
labelMode: "name"
|
|
51
53
|
}
|
|
52
|
-
},
|
|
54
|
+
}, g = {
|
|
53
55
|
TICKETING: "出票",
|
|
54
56
|
REFUND: "退票",
|
|
55
57
|
REBOOK: "改签"
|
|
56
58
|
};
|
|
57
|
-
function
|
|
59
|
+
function J(a, e) {
|
|
58
60
|
if (!Array.isArray(a) || !a.length) return a || [];
|
|
59
61
|
if (e === d.PINYIN || e === d.NONE) return a;
|
|
60
|
-
const
|
|
61
|
-
if (!
|
|
62
|
-
const
|
|
62
|
+
const l = b[e];
|
|
63
|
+
if (!l) return a;
|
|
64
|
+
const n = /* @__PURE__ */ new Map(), s = [], r = l.labelMode || "codeName";
|
|
63
65
|
return a.forEach((u) => {
|
|
64
|
-
const t = u[
|
|
65
|
-
if (!
|
|
66
|
+
const t = u[l.codeKey], c = t != null && t !== "", i = c ? String(t) : "__unknown__";
|
|
67
|
+
if (!n.has(i)) {
|
|
66
68
|
s.push(i);
|
|
67
|
-
const
|
|
69
|
+
const f = u[l.nameKey];
|
|
68
70
|
let E = "未知";
|
|
69
|
-
|
|
71
|
+
c && (r === "name" ? E = f != null && String(f) !== "" ? String(f) : String(t) : E = `${t}(${f || ""})`), n.set(i, {
|
|
70
72
|
label: E,
|
|
71
|
-
value:
|
|
73
|
+
value: c ? t : "__unknown__",
|
|
72
74
|
children: []
|
|
73
75
|
});
|
|
74
76
|
}
|
|
75
|
-
|
|
76
|
-
}), s.map((u) =>
|
|
77
|
+
n.get(i).children.push(u);
|
|
78
|
+
}), s.map((u) => n.get(u));
|
|
79
|
+
}
|
|
80
|
+
function Q(a) {
|
|
81
|
+
const e = /* @__PURE__ */ new Map();
|
|
82
|
+
return (Array.isArray(a) ? a : []).forEach((l) => {
|
|
83
|
+
const n = l.purchaseInfo || l, s = (n == null ? void 0 : n.supplierSubType) ?? "其他";
|
|
84
|
+
let r = e.get(s);
|
|
85
|
+
r || (r = {
|
|
86
|
+
label: String(s),
|
|
87
|
+
value: s,
|
|
88
|
+
children: []
|
|
89
|
+
}, e.set(s, r)), r.children.push(l);
|
|
90
|
+
}), Array.from(e.values());
|
|
77
91
|
}
|
|
78
|
-
function
|
|
92
|
+
function X(a, e) {
|
|
79
93
|
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);
|
|
80
94
|
}
|
|
81
|
-
const
|
|
95
|
+
const v = {
|
|
82
96
|
1: { codeKey: "continentCode", nameKey: "continentName", statusKey: "continentStatus" },
|
|
83
97
|
2: { codeKey: "regionCode", nameKey: "regionName", statusKey: "regionStatus" },
|
|
84
98
|
3: { codeKey: "countryCode", nameKey: "countryName", statusKey: "countryStatus" },
|
|
85
99
|
4: { codeKey: "cityCode", nameKey: "cityName", statusKey: "cityStatus" },
|
|
86
100
|
5: { codeKey: "airportCode", nameKey: "airportName", statusKey: "airportStatus" }
|
|
87
101
|
};
|
|
88
|
-
function
|
|
102
|
+
function K(a = []) {
|
|
89
103
|
return (Array.isArray(a) ? a : []).filter((e) => e == null ? void 0 : e.airlineCode).map((e) => ({
|
|
90
104
|
...e,
|
|
91
105
|
label: `${e.airlineCode}(${e.airlineNameCn || ""})`,
|
|
92
106
|
value: e.airlineCode
|
|
93
107
|
}));
|
|
94
108
|
}
|
|
95
|
-
function
|
|
109
|
+
function M(a) {
|
|
96
110
|
if (!a || typeof a != "object" || Array.isArray(a))
|
|
97
111
|
return a || {};
|
|
98
|
-
const e = a.continentCode || a.regionCode || a.countryCode || a.cityCode || a.airportCode,
|
|
99
|
-
if (e && !
|
|
112
|
+
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]);
|
|
113
|
+
if (e && !l)
|
|
100
114
|
return a;
|
|
101
|
-
let
|
|
115
|
+
let n = {}, s = 0;
|
|
102
116
|
for (const u of [1, 2, 3, 4, 5]) {
|
|
103
117
|
const t = a[String(u)] || a[u];
|
|
104
118
|
if (!t || typeof t != "object") continue;
|
|
105
|
-
const
|
|
106
|
-
|
|
119
|
+
const c = Number(t.type ?? u);
|
|
120
|
+
c >= s && (s = c, n = t);
|
|
107
121
|
}
|
|
108
|
-
const
|
|
122
|
+
const r = { ...n };
|
|
109
123
|
for (const u of [1, 2, 3, 4, 5]) {
|
|
110
124
|
const t = a[String(u)] || a[u];
|
|
111
125
|
if (!t || typeof t != "object") continue;
|
|
112
|
-
const { codeKey:
|
|
113
|
-
t.code !== void 0 && t.code !== null && t.code !== "" && (
|
|
126
|
+
const { codeKey: c, nameKey: i, statusKey: f } = v[u];
|
|
127
|
+
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);
|
|
114
128
|
}
|
|
115
|
-
return
|
|
129
|
+
return r;
|
|
116
130
|
}
|
|
117
|
-
function
|
|
118
|
-
return (Array.isArray(a) ? a : []).map((
|
|
131
|
+
function w(a) {
|
|
132
|
+
return (Array.isArray(a) ? a : []).map((l) => M(l || {}));
|
|
119
133
|
}
|
|
120
|
-
function Y(a = [], e,
|
|
121
|
-
return (Array.isArray(a) ? a : []).filter((
|
|
122
|
-
...
|
|
123
|
-
label: `${
|
|
124
|
-
value:
|
|
134
|
+
function Y(a = [], e, l) {
|
|
135
|
+
return (Array.isArray(a) ? a : []).filter((n) => n == null ? void 0 : n[e]).map((n) => ({
|
|
136
|
+
...n,
|
|
137
|
+
label: `${n[e]}(${n[l] || ""})`,
|
|
138
|
+
value: n[e]
|
|
125
139
|
}));
|
|
126
140
|
}
|
|
127
|
-
const
|
|
141
|
+
const U = [o.CONTINENT, o.REGION, o.COUNTRY, o.CITY, o.AIRPORT], y = {
|
|
128
142
|
[o.CONTINENT]: 1,
|
|
129
143
|
[o.REGION]: 2,
|
|
130
144
|
[o.COUNTRY]: 3,
|
|
131
145
|
[o.CITY]: 4,
|
|
132
146
|
[o.AIRPORT]: 5
|
|
133
|
-
},
|
|
147
|
+
}, F = {
|
|
134
148
|
[o.CONTINENT]: { codeKey: "continentCode", nameKey: "continentName" },
|
|
135
149
|
[o.REGION]: { codeKey: "regionCode", nameKey: "regionName" },
|
|
136
150
|
[o.COUNTRY]: { codeKey: "countryCode", nameKey: "countryName" },
|
|
@@ -138,37 +152,37 @@ const w = [o.CONTINENT, o.REGION, o.COUNTRY, o.CITY, o.AIRPORT], N = {
|
|
|
138
152
|
[o.AIRPORT]: { codeKey: "airportCode", nameKey: "airportName" }
|
|
139
153
|
};
|
|
140
154
|
o.CONTINENT, o.REGION, o.COUNTRY, o.CITY;
|
|
141
|
-
function
|
|
142
|
-
return
|
|
155
|
+
function N(a) {
|
|
156
|
+
return U.includes(a);
|
|
143
157
|
}
|
|
144
|
-
function
|
|
145
|
-
return !
|
|
158
|
+
function Z(a, e) {
|
|
159
|
+
return !N(a) || !N(e) ? !1 : y[a] > y[e];
|
|
146
160
|
}
|
|
147
|
-
function
|
|
148
|
-
if (!
|
|
149
|
-
const { codeKey:
|
|
150
|
-
return (Array.isArray(a) ? a : []).forEach((
|
|
151
|
-
const u =
|
|
161
|
+
function ee(a, e) {
|
|
162
|
+
if (!N(e)) return [];
|
|
163
|
+
const { codeKey: l, nameKey: n } = F[e], s = /* @__PURE__ */ new Map();
|
|
164
|
+
return (Array.isArray(a) ? a : []).forEach((r) => {
|
|
165
|
+
const u = r == null ? void 0 : r[l];
|
|
152
166
|
if (u == null || u === "") return;
|
|
153
167
|
const t = String(u);
|
|
154
168
|
s.has(t) || s.set(t, {
|
|
155
|
-
...
|
|
156
|
-
label: `${u}(${n
|
|
169
|
+
...r,
|
|
170
|
+
label: `${u}(${r[n] || ""})`,
|
|
157
171
|
value: u
|
|
158
172
|
});
|
|
159
173
|
}), Array.from(s.values());
|
|
160
174
|
}
|
|
161
|
-
function
|
|
175
|
+
function ae(a) {
|
|
162
176
|
let e;
|
|
163
|
-
for (const
|
|
164
|
-
|
|
177
|
+
for (const l of a)
|
|
178
|
+
N(l) && (!e || y[l] > y[e]) && (e = l);
|
|
165
179
|
return e;
|
|
166
180
|
}
|
|
167
|
-
function p(a, e,
|
|
181
|
+
function p(a, e, l) {
|
|
168
182
|
return async () => {
|
|
169
183
|
try {
|
|
170
|
-
const
|
|
171
|
-
return Y(
|
|
184
|
+
const n = await A({ type: a });
|
|
185
|
+
return Y(w(n), e, l);
|
|
172
186
|
} catch {
|
|
173
187
|
return [];
|
|
174
188
|
}
|
|
@@ -181,43 +195,43 @@ function D(a = []) {
|
|
|
181
195
|
value: e.itemCode
|
|
182
196
|
}));
|
|
183
197
|
}
|
|
184
|
-
function
|
|
185
|
-
const e = Array.isArray(a) ? a : [],
|
|
186
|
-
e.map((
|
|
187
|
-
),
|
|
188
|
-
e.filter((
|
|
189
|
-
), s = e.filter((
|
|
190
|
-
const u = String(
|
|
198
|
+
function G(a = []) {
|
|
199
|
+
const e = Array.isArray(a) ? a : [], l = new Set(
|
|
200
|
+
e.map((r) => r.parentItemCode).filter((r) => r != null && String(r) !== "").map(String)
|
|
201
|
+
), n = new Set(
|
|
202
|
+
e.filter((r) => (r == null ? void 0 : r.itemCode) !== void 0 && (r == null ? void 0 : r.itemCode) !== null && (r == null ? void 0 : r.itemCode) !== "").map((r) => String(r.itemCode))
|
|
203
|
+
), s = e.filter((r) => (r == null ? void 0 : r.itemCode) !== void 0 && (r == null ? void 0 : r.itemCode) !== null && (r == null ? void 0 : r.itemCode) !== "").map((r) => {
|
|
204
|
+
const u = String(r.itemCode), t = r.itemName || "";
|
|
191
205
|
return {
|
|
192
|
-
...
|
|
193
|
-
label:
|
|
206
|
+
...r,
|
|
207
|
+
label: l.has(u) ? `${u}(${t})` : t,
|
|
194
208
|
value: u
|
|
195
209
|
};
|
|
196
210
|
});
|
|
197
|
-
return
|
|
198
|
-
|
|
199
|
-
itemCode:
|
|
200
|
-
itemName:
|
|
201
|
-
label:
|
|
202
|
-
value:
|
|
211
|
+
return l.forEach((r) => {
|
|
212
|
+
n.has(r) || s.push({
|
|
213
|
+
itemCode: r,
|
|
214
|
+
itemName: r,
|
|
215
|
+
label: r,
|
|
216
|
+
value: r,
|
|
203
217
|
parentItemCode: null
|
|
204
218
|
});
|
|
205
219
|
}), s;
|
|
206
220
|
}
|
|
207
221
|
function S(a, e = D) {
|
|
208
|
-
return async (
|
|
222
|
+
return async (l) => {
|
|
209
223
|
try {
|
|
210
|
-
const
|
|
224
|
+
const n = await R({
|
|
211
225
|
dictCodeList: [a],
|
|
212
|
-
permissionOnlyCode:
|
|
213
|
-
}), s = (
|
|
226
|
+
permissionOnlyCode: l == null ? void 0 : l.permissionOnlyCode
|
|
227
|
+
}), s = (n == null ? void 0 : n[a]) || [];
|
|
214
228
|
return e(s);
|
|
215
229
|
} catch {
|
|
216
230
|
return [];
|
|
217
231
|
}
|
|
218
232
|
};
|
|
219
233
|
}
|
|
220
|
-
function
|
|
234
|
+
function x(a = []) {
|
|
221
235
|
return (Array.isArray(a) ? a : []).filter((e) => (e == null ? void 0 : e.id) !== void 0 && (e == null ? void 0 : e.id) !== null).map((e) => ({
|
|
222
236
|
...e,
|
|
223
237
|
label: e.fullName || e.username || String(e.id),
|
|
@@ -231,43 +245,55 @@ function m(a = []) {
|
|
|
231
245
|
value: e.id
|
|
232
246
|
}));
|
|
233
247
|
}
|
|
234
|
-
function
|
|
248
|
+
function B(a = []) {
|
|
235
249
|
return (Array.isArray(a) ? a : []).filter((e) => (e == null ? void 0 : e.id) !== void 0 && (e == null ? void 0 : e.id) !== null).map((e) => {
|
|
236
|
-
const
|
|
250
|
+
const l = e.businessType || "";
|
|
237
251
|
return {
|
|
238
252
|
...e,
|
|
239
|
-
businessTypeName:
|
|
253
|
+
businessTypeName: g[l] || l,
|
|
240
254
|
label: e.reasonName || "",
|
|
241
255
|
value: e.id
|
|
242
256
|
};
|
|
243
257
|
});
|
|
244
258
|
}
|
|
245
|
-
function
|
|
246
|
-
return (Array.isArray(a) ? a : []).filter((
|
|
247
|
-
const
|
|
259
|
+
function $(a = [], e = /* @__PURE__ */ new Map()) {
|
|
260
|
+
return (Array.isArray(a) ? a : []).filter((l) => (l == null ? void 0 : l.id) !== void 0 && (l == null ? void 0 : l.id) !== null).map((l) => {
|
|
261
|
+
const n = l.primaryReasonId, s = (n != null ? e.get(n) : void 0) || (n != null ? String(n) : "");
|
|
248
262
|
return {
|
|
249
|
-
...
|
|
263
|
+
...l,
|
|
250
264
|
primaryReasonName: s,
|
|
251
|
-
label:
|
|
252
|
-
value:
|
|
265
|
+
label: l.reasonName || "",
|
|
266
|
+
value: l.id
|
|
253
267
|
};
|
|
254
268
|
});
|
|
255
269
|
}
|
|
256
|
-
function
|
|
270
|
+
function V(a = []) {
|
|
257
271
|
return (Array.isArray(a) ? a : []).filter((e) => e == null ? void 0 : e.supplierConfigPcc).map((e) => ({
|
|
258
272
|
...e,
|
|
259
273
|
label: e.supplierConfigPcc,
|
|
260
274
|
value: e.supplierConfigPcc
|
|
261
275
|
}));
|
|
262
276
|
}
|
|
263
|
-
function
|
|
277
|
+
function j(a = []) {
|
|
264
278
|
return (Array.isArray(a) ? a : []).filter((e) => e == null ? void 0 : e.supplierCode).map((e) => ({
|
|
265
279
|
...e,
|
|
266
280
|
label: e.supplierName || e.supplierCode,
|
|
267
281
|
value: e.supplierCode
|
|
268
282
|
}));
|
|
269
283
|
}
|
|
270
|
-
|
|
284
|
+
function H(a = []) {
|
|
285
|
+
return (Array.isArray(a) ? a : []).filter((e) => e == null ? void 0 : e.purchasePlaceCode).map((e) => ({
|
|
286
|
+
...e,
|
|
287
|
+
label: e.purchasePlaceName || e.purchasePlaceCode,
|
|
288
|
+
value: e.purchasePlaceCode,
|
|
289
|
+
purchaseInfo: {
|
|
290
|
+
purchasePlaceCode: e.purchasePlaceCode,
|
|
291
|
+
purchasePlaceName: e.purchasePlaceName,
|
|
292
|
+
supplierSubType: e.supplierSubType
|
|
293
|
+
}
|
|
294
|
+
}));
|
|
295
|
+
}
|
|
296
|
+
const re = {
|
|
271
297
|
[o.AIRLINE]: {
|
|
272
298
|
defaultFieldName: "airlineCodes",
|
|
273
299
|
defaultLabel: "航司",
|
|
@@ -277,7 +303,7 @@ const Z = {
|
|
|
277
303
|
async fetchOptions() {
|
|
278
304
|
try {
|
|
279
305
|
const a = await O();
|
|
280
|
-
return
|
|
306
|
+
return K(a || []);
|
|
281
307
|
} catch {
|
|
282
308
|
return [];
|
|
283
309
|
}
|
|
@@ -336,7 +362,7 @@ const Z = {
|
|
|
336
362
|
valueField: "value",
|
|
337
363
|
parentField: "parentItemCode"
|
|
338
364
|
},
|
|
339
|
-
fetchOptions: S(o.SALES_ORDER_TYPE,
|
|
365
|
+
fetchOptions: S(o.SALES_ORDER_TYPE, G)
|
|
340
366
|
},
|
|
341
367
|
[o.SALES_ORDER_PRODUCT_TYPE]: {
|
|
342
368
|
defaultFieldName: "productType",
|
|
@@ -361,7 +387,7 @@ const Z = {
|
|
|
361
387
|
async fetchOptions() {
|
|
362
388
|
try {
|
|
363
389
|
const a = await I({ pageNo: 1, pageSize: 9999 });
|
|
364
|
-
return
|
|
390
|
+
return x((a == null ? void 0 : a.records) || []);
|
|
365
391
|
} catch {
|
|
366
392
|
return [];
|
|
367
393
|
}
|
|
@@ -391,7 +417,7 @@ const Z = {
|
|
|
391
417
|
async fetchOptions() {
|
|
392
418
|
try {
|
|
393
419
|
const a = await C();
|
|
394
|
-
return
|
|
420
|
+
return B(a || []);
|
|
395
421
|
} catch {
|
|
396
422
|
return [];
|
|
397
423
|
}
|
|
@@ -408,10 +434,10 @@ const Z = {
|
|
|
408
434
|
const [a, e] = await Promise.all([
|
|
409
435
|
T(),
|
|
410
436
|
C()
|
|
411
|
-
]),
|
|
412
|
-
return (e || []).forEach((
|
|
413
|
-
(
|
|
414
|
-
}),
|
|
437
|
+
]), l = /* @__PURE__ */ new Map();
|
|
438
|
+
return (e || []).forEach((n) => {
|
|
439
|
+
(n == null ? void 0 : n.id) !== void 0 && (n == null ? void 0 : n.id) !== null && l.set(n.id, n.reasonName || String(n.id));
|
|
440
|
+
}), $(a || [], l);
|
|
415
441
|
} catch {
|
|
416
442
|
return [];
|
|
417
443
|
}
|
|
@@ -425,8 +451,8 @@ const Z = {
|
|
|
425
451
|
defaultShowAll: !1,
|
|
426
452
|
async fetchOptions() {
|
|
427
453
|
try {
|
|
428
|
-
const a = await
|
|
429
|
-
return
|
|
454
|
+
const a = await h({});
|
|
455
|
+
return V(a || []);
|
|
430
456
|
} catch {
|
|
431
457
|
return [];
|
|
432
458
|
}
|
|
@@ -441,7 +467,23 @@ const Z = {
|
|
|
441
467
|
async fetchOptions() {
|
|
442
468
|
try {
|
|
443
469
|
const a = await _();
|
|
444
|
-
return
|
|
470
|
+
return j(a || []);
|
|
471
|
+
} catch {
|
|
472
|
+
return [];
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
[o.PURCHASE_PLACE]: {
|
|
477
|
+
defaultFieldName: "purchasePlaceId",
|
|
478
|
+
defaultLabel: "采购地",
|
|
479
|
+
defaultExcludeLabel: "排除采购地",
|
|
480
|
+
defaultMultiple: !0,
|
|
481
|
+
defaultShowAll: !1,
|
|
482
|
+
defaultShowNav: !1,
|
|
483
|
+
async fetchOptions() {
|
|
484
|
+
try {
|
|
485
|
+
const a = await P();
|
|
486
|
+
return H(a || []);
|
|
445
487
|
} catch {
|
|
446
488
|
return [];
|
|
447
489
|
}
|
|
@@ -450,13 +492,14 @@ const Z = {
|
|
|
450
492
|
};
|
|
451
493
|
export {
|
|
452
494
|
o as CODES,
|
|
453
|
-
|
|
454
|
-
|
|
495
|
+
re as CODE_REGISTRY,
|
|
496
|
+
U as GEO_LEVEL_CODES,
|
|
455
497
|
d as GROUP_BY,
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
X as
|
|
498
|
+
Z as canDeriveGeoLevel,
|
|
499
|
+
ee as deriveRegionLevelOptionsFromGeoSource,
|
|
500
|
+
J as groupBasicDataOptions,
|
|
501
|
+
Q as groupPurchasePlaceOptions,
|
|
502
|
+
N as isGeoLevelCode,
|
|
503
|
+
X as resolveDefaultGroupBy,
|
|
504
|
+
ae as resolveHighestGeoLevelCode
|
|
462
505
|
};
|
|
@@ -20,20 +20,20 @@ function S(r) {
|
|
|
20
20
|
if (!c) return r;
|
|
21
21
|
const a = r[c];
|
|
22
22
|
if (!Array.isArray(a)) return r;
|
|
23
|
-
const
|
|
23
|
+
const l = { ...r };
|
|
24
24
|
let o = !1;
|
|
25
25
|
return M.forEach((f) => {
|
|
26
|
-
x(c, f) && (D(
|
|
27
|
-
}), o ?
|
|
26
|
+
x(c, f) && (D(l, f) || (l[f] = Y(a, f), o = !0));
|
|
27
|
+
}), o ? l : r;
|
|
28
28
|
}
|
|
29
29
|
function N(r, c) {
|
|
30
|
-
const a = F(c),
|
|
30
|
+
const a = F(c), l = r.filter(L), o = a || A(l) || void 0;
|
|
31
31
|
return o ? r.filter((f) => L(f) ? !(x(o, f) || f === o && D(c, o)) : !0) : r;
|
|
32
32
|
}
|
|
33
33
|
function $(r) {
|
|
34
|
-
const c = H(), a = I(),
|
|
34
|
+
const c = H(), a = I(), l = b({});
|
|
35
35
|
function o(t = {}) {
|
|
36
|
-
|
|
36
|
+
l.value = r.codes.reduce(
|
|
37
37
|
(e, n) => (e[n] = C(t[n]), e),
|
|
38
38
|
{}
|
|
39
39
|
);
|
|
@@ -69,9 +69,9 @@ function $(r) {
|
|
|
69
69
|
return [i, []];
|
|
70
70
|
}
|
|
71
71
|
})
|
|
72
|
-
)).reduce((i,
|
|
72
|
+
)).reduce((i, d, h) => {
|
|
73
73
|
const w = t[h];
|
|
74
|
-
return
|
|
74
|
+
return d.status === "fulfilled" ? i[d.value[0]] = C(d.value[1]) : i[w] = [], i;
|
|
75
75
|
}, {});
|
|
76
76
|
}
|
|
77
77
|
async function E(t = !1) {
|
|
@@ -84,10 +84,10 @@ function $(r) {
|
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
86
|
for (; ; ) {
|
|
87
|
-
|
|
87
|
+
const s = S(u.get(e) || {});
|
|
88
88
|
s !== (u.get(e) || {}) && u.set(e, s);
|
|
89
|
-
const i = [...g.get(e) || r.codes],
|
|
90
|
-
if (t = !1, !
|
|
89
|
+
const i = [...g.get(e) || r.codes], d = t ? i : i.filter((p) => !D(s, p));
|
|
90
|
+
if (t = !1, !d.length) {
|
|
91
91
|
o(s);
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
@@ -98,7 +98,7 @@ function $(r) {
|
|
|
98
98
|
continue;
|
|
99
99
|
} catch {
|
|
100
100
|
}
|
|
101
|
-
const w = N(
|
|
101
|
+
const w = N(d, s);
|
|
102
102
|
if (!w.length) {
|
|
103
103
|
const p = S(s);
|
|
104
104
|
u.set(e, p), o(p);
|
|
@@ -120,8 +120,8 @@ function $(r) {
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
} catch {
|
|
123
|
-
const n = [...g.get(e) || r.codes], s = J(n),
|
|
124
|
-
u.set(e,
|
|
123
|
+
const n = [...g.get(e) || r.codes], s = J(n), d = { ...u.get(e) || {}, ...s };
|
|
124
|
+
u.set(e, d), o(d);
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
async function V() {
|
|
@@ -137,7 +137,7 @@ function $(r) {
|
|
|
137
137
|
}), _(a), P(a).then(() => z(a)), {
|
|
138
138
|
dataSource: B(() => {
|
|
139
139
|
const t = r.codes.reduce(
|
|
140
|
-
(e, n) => (e[n] = C(
|
|
140
|
+
(e, n) => (e[n] = C(l.value[n]), e),
|
|
141
141
|
{}
|
|
142
142
|
);
|
|
143
143
|
return new Proxy(t, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "axios";
|
|
2
2
|
import "element-plus";
|
|
3
|
-
import { isFunction as
|
|
3
|
+
import { isFunction as v } from "../packages/utils/src/is.js";
|
|
4
4
|
import "vue";
|
|
5
5
|
import "dayjs";
|
|
6
6
|
import "numeral";
|
|
@@ -12,34 +12,34 @@ import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
|
12
12
|
import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
13
13
|
import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
14
14
|
import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
15
|
-
import { omit as
|
|
16
|
-
import { CODE_REGISTRY as
|
|
17
|
-
import { useBasicDataOptions as
|
|
18
|
-
const
|
|
15
|
+
import { omit as $ } from "lodash-es";
|
|
16
|
+
import { CODE_REGISTRY as le, resolveDefaultGroupBy as pe, CODES as ue, GROUP_BY as j, groupPurchasePlaceOptions as ie, groupBasicDataOptions as ae } from "./basicDataCodes.js";
|
|
17
|
+
import { useBasicDataOptions as de } from "./useBasicDataOptions.js";
|
|
18
|
+
const E = "all";
|
|
19
19
|
function d(t) {
|
|
20
20
|
return Array.isArray(t) ? t : t == null || t === "" ? [] : [t];
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function me(t, n = E) {
|
|
23
23
|
return t === n ? !0 : typeof t == "string" && typeof n == "string" && t.toLowerCase() === String(n).toLowerCase();
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
return d(t).some((r) =>
|
|
25
|
+
function he(t, n = E) {
|
|
26
|
+
return d(t).some((r) => me(r, n));
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function xe(t) {
|
|
29
29
|
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("");
|
|
30
30
|
}
|
|
31
31
|
function q(t, n) {
|
|
32
32
|
const r = "支持多选和全选", s = typeof t == "string" && t.trim() ? t.trim().replace(/[,,]\s*$/, "") : "请选择";
|
|
33
33
|
return s.includes(r) ? s : `${s},${r}`;
|
|
34
34
|
}
|
|
35
|
-
function Z(t, n, r, s) {
|
|
36
|
-
return t ? f(t) ? t(n, r, s) : t : {};
|
|
37
|
-
}
|
|
38
35
|
function H(t, n, r, s) {
|
|
36
|
+
return t ? v(t) ? t(n, r, s) : t : {};
|
|
37
|
+
}
|
|
38
|
+
function Z(t, n, r, s) {
|
|
39
39
|
const p = new Set(r.map((e) => e.value)), l = t[n];
|
|
40
40
|
if (s) {
|
|
41
41
|
const e = d(l).filter((u) => p.has(u)), c = d(l);
|
|
42
|
-
(e.length !== c.length || e.some((u,
|
|
42
|
+
(e.length !== c.length || e.some((u, F) => u !== c[F])) && (t[n] = e);
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
l == null || l === "" || p.has(l) || (t[n] = void 0);
|
|
@@ -58,7 +58,7 @@ function J(t, n, r, s, p, l) {
|
|
|
58
58
|
function Q(t, n, r) {
|
|
59
59
|
const s = d(t);
|
|
60
60
|
if (!s.length) return [];
|
|
61
|
-
if (
|
|
61
|
+
if (he(t, r)) return n;
|
|
62
62
|
const p = new Set(s);
|
|
63
63
|
return n.filter((l) => p.has(l.value));
|
|
64
64
|
}
|
|
@@ -66,71 +66,75 @@ function X(t, n) {
|
|
|
66
66
|
const r = new Set(d(t));
|
|
67
67
|
return r.size ? n.filter((s) => !r.has(s.value)) : n;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function f(t, n) {
|
|
70
70
|
var s;
|
|
71
71
|
const r = (s = t.value) == null ? void 0 : s[n];
|
|
72
72
|
return Array.isArray(r) ? r : [];
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function $e(t, n = {}) {
|
|
75
75
|
const r = [...new Set(t.map((e) => e.code))], s = t.reduce(
|
|
76
76
|
(e, c) => (e[c.code] = (e[c.code] || 0) + 1, e),
|
|
77
77
|
{}
|
|
78
|
-
), { dataSource: p } =
|
|
78
|
+
), { dataSource: p } = de({
|
|
79
79
|
codes: r,
|
|
80
80
|
dataSource: n.dataSource
|
|
81
81
|
}), l = {};
|
|
82
82
|
return t.forEach((e) => {
|
|
83
|
-
var
|
|
84
|
-
const c =
|
|
83
|
+
var Y;
|
|
84
|
+
const c = le[e.code], u = e.fieldName || c.defaultFieldName, F = e.key || ((s[e.code] || 0) > 1 ? u : e.code), k = e.label || c.defaultLabel, N = e.multiple ?? c.defaultMultiple, C = e.showAll ?? c.defaultShowAll, b = e.showAllField ?? E, m = e.mutexWith, D = pe(e.code, e.groupBy), S = e.code === ue.PURCHASE_PLACE, M = D === j.NONE, T = D === j.PINYIN, ee = !S && !M && !T, O = c.defaultTreeConfig, R = !!O, U = S ? !1 : c.defaultShowNav ?? !1;
|
|
85
|
+
function I(o) {
|
|
86
|
+
return S ? ie(o) : ee ? ae(o, D) : o;
|
|
87
|
+
}
|
|
88
|
+
const te = [
|
|
85
89
|
...m ? [m] : [],
|
|
86
|
-
...((
|
|
87
|
-
],
|
|
88
|
-
...
|
|
89
|
-
triggerFields:
|
|
90
|
-
} : e.dependencies,
|
|
90
|
+
...((Y = e.dependencies) == null ? void 0 : Y.triggerFields) || []
|
|
91
|
+
], W = [...new Set(te)], ne = $(e.dependencies || {}, ["triggerFields"]), oe = W.length ? {
|
|
92
|
+
...ne,
|
|
93
|
+
triggerFields: W
|
|
94
|
+
} : e.dependencies, L = {
|
|
91
95
|
component: "TtPanelSelect",
|
|
92
96
|
fieldName: u,
|
|
93
|
-
label:
|
|
97
|
+
label: k,
|
|
94
98
|
rules: e.rules,
|
|
95
|
-
dependencies:
|
|
99
|
+
dependencies: oe,
|
|
96
100
|
componentProps: (o, x) => {
|
|
97
|
-
const
|
|
98
|
-
let a = m ? X(o[m],
|
|
99
|
-
|
|
100
|
-
const g =
|
|
101
|
+
const P = f(p, e.code);
|
|
102
|
+
let a = m ? X(o[m], P) : P;
|
|
103
|
+
v(e.customOptions) && (a = e.customOptions(o, a) || []);
|
|
104
|
+
const g = I(a), B = H(e.componentProps, o, x, a), { onChange: z, ...A } = B;
|
|
101
105
|
return {
|
|
102
|
-
multiple:
|
|
106
|
+
multiple: N,
|
|
103
107
|
showAll: C,
|
|
104
|
-
showAllField:
|
|
105
|
-
showNav:
|
|
106
|
-
showOriginMode:
|
|
107
|
-
showPinyinMode:
|
|
108
|
-
...
|
|
109
|
-
...
|
|
110
|
-
...
|
|
108
|
+
showAllField: b,
|
|
109
|
+
showNav: U,
|
|
110
|
+
showOriginMode: M,
|
|
111
|
+
showPinyinMode: R || S ? !1 : T,
|
|
112
|
+
...O ? { treeConfig: O } : {},
|
|
113
|
+
...A,
|
|
114
|
+
...N ? { placeholder: q(A.placeholder) } : {},
|
|
111
115
|
options: g,
|
|
112
|
-
onChange(
|
|
113
|
-
var
|
|
116
|
+
onChange(w) {
|
|
117
|
+
var y;
|
|
114
118
|
if (m) {
|
|
115
|
-
const i = Array.isArray(o[m]), h = X(
|
|
116
|
-
|
|
119
|
+
const i = Array.isArray(o[m]), h = X(w, P);
|
|
120
|
+
Z(o, m, h, i);
|
|
117
121
|
}
|
|
118
122
|
if (e.exclude) {
|
|
119
|
-
const i = e.exclude.fieldName, h = e.exclude.multiple ?? !0, G = Q(
|
|
120
|
-
d(
|
|
123
|
+
const i = e.exclude.fieldName, h = e.exclude.multiple ?? !0, G = Q(w, P, b);
|
|
124
|
+
d(w).length ? Z(o, i, G, h) : o[i] = h ? [] : void 0;
|
|
121
125
|
}
|
|
122
|
-
(
|
|
126
|
+
(y = e.onChange) == null || y.call(
|
|
123
127
|
e,
|
|
124
|
-
|
|
125
|
-
J(e.code, u, o, x, a,
|
|
128
|
+
w,
|
|
129
|
+
J(e.code, u, o, x, a, N)
|
|
126
130
|
);
|
|
127
131
|
}
|
|
128
132
|
};
|
|
129
133
|
}
|
|
130
134
|
};
|
|
131
|
-
if (l[
|
|
132
|
-
...
|
|
133
|
-
|
|
135
|
+
if (l[F] = {
|
|
136
|
+
...L,
|
|
137
|
+
...$(e, [
|
|
134
138
|
"code",
|
|
135
139
|
"key",
|
|
136
140
|
"fieldName",
|
|
@@ -148,50 +152,50 @@ function De(t, n = {}) {
|
|
|
148
152
|
"customOptions"
|
|
149
153
|
]),
|
|
150
154
|
fieldName: u,
|
|
151
|
-
label:
|
|
155
|
+
label: k,
|
|
152
156
|
rules: e.rules,
|
|
153
157
|
description: e.description,
|
|
154
|
-
dependencies:
|
|
155
|
-
componentProps:
|
|
158
|
+
dependencies: L.dependencies,
|
|
159
|
+
componentProps: L.componentProps,
|
|
156
160
|
component: "TtPanelSelect"
|
|
157
161
|
}, e.exclude) {
|
|
158
|
-
const o = e.exclude, x = o.fieldName,
|
|
159
|
-
...
|
|
160
|
-
triggerFields:
|
|
161
|
-
if:
|
|
162
|
-
},
|
|
162
|
+
const o = e.exclude, x = o.fieldName, P = o.key || `exclude${xe(F)}`, a = o.label || c.defaultExcludeLabel, g = o.multiple ?? !0, B = o.showAll ?? !1, z = o.showAllField ?? E, A = o.dependencies || {}, w = {
|
|
163
|
+
...A,
|
|
164
|
+
triggerFields: A.triggerFields ?? [u],
|
|
165
|
+
if: A.if ?? ((i) => d(i[u]).length > 0)
|
|
166
|
+
}, y = {
|
|
163
167
|
component: "TtPanelSelect",
|
|
164
168
|
fieldName: x,
|
|
165
169
|
label: a,
|
|
166
170
|
rules: o.rules,
|
|
167
|
-
dependencies:
|
|
171
|
+
dependencies: w,
|
|
168
172
|
componentProps: (i, h) => {
|
|
169
|
-
const G =
|
|
173
|
+
const G = f(p, e.code), _ = Q(i[u], G, b), re = I(_), se = H(o.componentProps, i, h, _), { onChange: Pe, ...K } = se;
|
|
170
174
|
return {
|
|
171
175
|
multiple: g,
|
|
172
|
-
showAll:
|
|
173
|
-
showAllField:
|
|
174
|
-
showNav:
|
|
175
|
-
showOriginMode:
|
|
176
|
-
showPinyinMode:
|
|
177
|
-
...
|
|
178
|
-
...
|
|
179
|
-
...g ? { placeholder: q(
|
|
180
|
-
options:
|
|
181
|
-
onChange(
|
|
182
|
-
var
|
|
183
|
-
(
|
|
176
|
+
showAll: B,
|
|
177
|
+
showAllField: z,
|
|
178
|
+
showNav: U,
|
|
179
|
+
showOriginMode: M,
|
|
180
|
+
showPinyinMode: R || S ? !1 : T,
|
|
181
|
+
...O ? { treeConfig: O } : {},
|
|
182
|
+
...K,
|
|
183
|
+
...g ? { placeholder: q(K.placeholder) } : {},
|
|
184
|
+
options: re,
|
|
185
|
+
onChange(ce) {
|
|
186
|
+
var V;
|
|
187
|
+
(V = o.onChange) == null || V.call(
|
|
184
188
|
o,
|
|
185
|
-
|
|
186
|
-
J(e.code, x, i, h,
|
|
189
|
+
ce,
|
|
190
|
+
J(e.code, x, i, h, _, g)
|
|
187
191
|
);
|
|
188
192
|
}
|
|
189
193
|
};
|
|
190
194
|
}
|
|
191
195
|
};
|
|
192
|
-
l[
|
|
193
|
-
...
|
|
194
|
-
|
|
196
|
+
l[P] = {
|
|
197
|
+
...y,
|
|
198
|
+
...$(o, [
|
|
195
199
|
"fieldName",
|
|
196
200
|
"label",
|
|
197
201
|
"key",
|
|
@@ -206,8 +210,8 @@ function De(t, n = {}) {
|
|
|
206
210
|
fieldName: x,
|
|
207
211
|
label: a,
|
|
208
212
|
rules: o.rules,
|
|
209
|
-
dependencies:
|
|
210
|
-
componentProps:
|
|
213
|
+
dependencies: y.dependencies,
|
|
214
|
+
componentProps: y.componentProps,
|
|
211
215
|
component: "TtPanelSelect"
|
|
212
216
|
};
|
|
213
217
|
}
|
|
@@ -217,5 +221,5 @@ function De(t, n = {}) {
|
|
|
217
221
|
};
|
|
218
222
|
}
|
|
219
223
|
export {
|
|
220
|
-
|
|
224
|
+
$e as usePanelSelectSchemas
|
|
221
225
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dazhicheng/ui",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.15",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"vue-router": "^5.0.2",
|
|
70
70
|
"vxe-pc-ui": "^4.14.15",
|
|
71
71
|
"vxe-table": "^4.18.13",
|
|
72
|
-
"@dazhicheng/
|
|
73
|
-
"@dazhicheng/
|
|
72
|
+
"@dazhicheng/utils": "1.3.53",
|
|
73
|
+
"@dazhicheng/hooks": "1.4.56"
|
|
74
74
|
},
|
|
75
75
|
"files": [
|
|
76
76
|
"dist"
|