@dazhicheng/ui 1.5.249 → 1.5.251

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.
@@ -6,3 +6,7 @@ export declare function queryDataPermissionDetailDataTypeContext(params: IamAPI.
6
6
  export declare function pageUser(params: IamAPI.UserDTO, options?: {
7
7
  [key: string]: any;
8
8
  }): Promise<IamAPI.PageResultUserDTO>;
9
+ /** 查询全部角色 POST /iam/role/queryAllRoles */
10
+ export declare function queryAllRoles(params?: Record<string, any>, options?: {
11
+ [key: string]: any;
12
+ }): Promise<IamAPI.RoleDTO[]>;
@@ -1,17 +1,24 @@
1
- import { request as e } from "../utils/xhr.js";
2
- async function o(t, a) {
3
- return e.post({
1
+ import { request as t } from "../utils/xhr.js";
2
+ async function o(e, r) {
3
+ return t.post({
4
4
  url: "/iam/dataTypeContext/queryDataPermissionDetail",
5
- params: t
5
+ params: e
6
6
  });
7
7
  }
8
- async function n(t, a) {
9
- return e.post({
8
+ async function s(e, r) {
9
+ return t.post({
10
10
  url: "/iam/user/page",
11
- params: t
11
+ params: e
12
+ });
13
+ }
14
+ async function n(e, r) {
15
+ return t.post({
16
+ url: "/iam/role/queryAllRoles",
17
+ params: {}
12
18
  });
13
19
  }
14
20
  export {
15
- n as pageUser,
21
+ s as pageUser,
22
+ n as queryAllRoles,
16
23
  o as queryDataPermissionDetailDataTypeContext
17
24
  };
@@ -15,7 +15,7 @@ export type SupplierManageListItem = {
15
15
  };
16
16
  /**
17
17
  * 获取全部配置号列表
18
- * POST /supplier/supplierConfigManage/config/getAllConfigList
18
+ * POST /supplier/supplierConfigManage/getAllConfigList
19
19
  */
20
20
  export declare function getAllConfigListSupplierConfigManage(body?: Record<string, any>, options?: {
21
21
  [key: string]: any;
@@ -1,11 +1,11 @@
1
1
  import { request as l } from "../utils/xhr.js";
2
- async function p(i = {}, n) {
2
+ async function p(i = {}, e) {
3
3
  return l.post({
4
- url: "/supplier/supplierConfigManage/config/getAllConfigList",
4
+ url: "/supplier/supplierConfigManage/getAllConfigList",
5
5
  params: i
6
6
  });
7
7
  }
8
- async function r(i, n) {
8
+ async function r(i, e) {
9
9
  return l.get({
10
10
  url: "/supplier/supplierManage/listAllValid",
11
11
  params: i
@@ -16,11 +16,13 @@ export declare const CODES: {
16
16
  readonly SALES_ORDER_PRODUCT_TYPE: "SALES_ORDER_PRODUCT_TYPE";
17
17
  /** 用户(/iam/user/page) */
18
18
  readonly USER: "user";
19
+ /** 角色(/iam/role/queryAllRoles) */
20
+ readonly ROLE: "role";
19
21
  /** 亏损原因一级(/rule/lossReason/primaryDropdownList) */
20
22
  readonly LOSS_REASON: "lossReason";
21
23
  /** 亏损原因细类(/rule/lossReason/secondaryDropdownList) */
22
24
  readonly LOSS_REASON_SECONDARY: "lossReasonSecondary";
23
- /** 配置号(/supplier/supplierConfigManage/config/getAllConfigList) */
25
+ /** 配置号(/supplier/supplierConfigManage/getAllConfigList) */
24
26
  readonly SUPPLIER_CONFIG: "supplierConfig";
25
27
  /** 供应商(/supplier/supplierManage/listAllValid) */
26
28
  readonly SUPPLIER: "supplier";
@@ -1,7 +1,7 @@
1
- import { getAllBasicAirline as E, getDictItemsByCodes as C, listChainByTypeAirportRegionLevel as R } from "../api/basicData.js";
2
- import { pageUser as A } from "../api/dataTypeContext.js";
3
- import { secondaryDropdownListLossReason as O, primaryDropdownListLossReason as S } from "../api/lossReason.js";
4
- import { listAllValidSupplierManage as L, getAllConfigListSupplierConfigManage as _ } from "../api/supplier.js";
1
+ import { getAllBasicAirline as E, getDictItemsByCodes as R, listChainByTypeAirportRegionLevel as C } from "../api/basicData.js";
2
+ import { queryAllRoles as A, pageUser as O } from "../api/dataTypeContext.js";
3
+ import { secondaryDropdownListLossReason as L, primaryDropdownListLossReason as S } from "../api/lossReason.js";
4
+ import { listAllValidSupplierManage as _, getAllConfigListSupplierConfigManage as I } from "../api/supplier.js";
5
5
  const u = {
6
6
  AIRLINE: "airline",
7
7
  CONTINENT: "continent",
@@ -15,11 +15,13 @@ const u = {
15
15
  SALES_ORDER_PRODUCT_TYPE: "SALES_ORDER_PRODUCT_TYPE",
16
16
  /** 用户(/iam/user/page) */
17
17
  USER: "user",
18
+ /** 角色(/iam/role/queryAllRoles) */
19
+ ROLE: "role",
18
20
  /** 亏损原因一级(/rule/lossReason/primaryDropdownList) */
19
21
  LOSS_REASON: "lossReason",
20
22
  /** 亏损原因细类(/rule/lossReason/secondaryDropdownList) */
21
23
  LOSS_REASON_SECONDARY: "lossReasonSecondary",
22
- /** 配置号(/supplier/supplierConfigManage/config/getAllConfigList) */
24
+ /** 配置号(/supplier/supplierConfigManage/getAllConfigList) */
23
25
  SUPPLIER_CONFIG: "supplierConfig",
24
26
  /** 供应商(/supplier/supplierManage/listAllValid) */
25
27
  SUPPLIER: "supplier"
@@ -34,7 +36,7 @@ const u = {
34
36
  /** 按供应商名称(配置号) */
35
37
  SUPPLIER_MANAGE_NAME: "supplierManageName",
36
38
  PINYIN: "pinyin"
37
- }, I = {
39
+ }, b = {
38
40
  [d.CONTINENT]: { codeKey: "continentCode", nameKey: "continentName" },
39
41
  [d.REGION]: { codeKey: "regionCode", nameKey: "regionName" },
40
42
  [d.COUNTRY]: { codeKey: "countryCode", nameKey: "countryName" },
@@ -45,50 +47,50 @@ const u = {
45
47
  nameKey: "supplierManageName",
46
48
  labelMode: "name"
47
49
  }
48
- }, b = {
50
+ }, g = {
49
51
  TICKETING: "出票",
50
52
  REFUND: "退票",
51
53
  REBOOK: "改签"
52
54
  };
53
- function $(a, e) {
55
+ function k(a, e) {
54
56
  if (!Array.isArray(a) || !a.length) return a || [];
55
57
  if (e === d.PINYIN) return a;
56
- const n = I[e];
58
+ const n = b[e];
57
59
  if (!n) return a;
58
60
  const r = /* @__PURE__ */ new Map(), s = [], l = n.labelMode || "codeName";
59
61
  return a.forEach((t) => {
60
- const o = t[n.codeKey], f = o != null && o !== "", c = f ? String(o) : "__unknown__";
61
- if (!r.has(c)) {
62
- s.push(c);
63
- const i = t[n.nameKey];
62
+ const o = t[n.codeKey], f = o != null && o !== "", i = f ? String(o) : "__unknown__";
63
+ if (!r.has(i)) {
64
+ s.push(i);
65
+ const c = t[n.nameKey];
64
66
  let y = "未知";
65
- f && (l === "name" ? y = i != null && String(i) !== "" ? String(i) : String(o) : y = `${o}(${i || ""})`), r.set(c, {
67
+ f && (l === "name" ? y = c != null && String(c) !== "" ? String(c) : String(o) : y = `${o}(${c || ""})`), r.set(i, {
66
68
  label: y,
67
69
  value: f ? o : "__unknown__",
68
70
  children: []
69
71
  });
70
72
  }
71
- r.get(c).children.push(t);
73
+ r.get(i).children.push(t);
72
74
  }), s.map((t) => r.get(t));
73
75
  }
74
- function j(a, e) {
76
+ function V(a, e) {
75
77
  return e || (a === u.AIRPORT ? d.COUNTRY : a === u.LOSS_REASON ? d.BUSINESS_TYPE : a === u.LOSS_REASON_SECONDARY ? d.PRIMARY_REASON : a === u.SUPPLIER_CONFIG ? d.SUPPLIER_MANAGE_NAME : d.PINYIN);
76
78
  }
77
- const g = {
79
+ const P = {
78
80
  1: { codeKey: "continentCode", nameKey: "continentName", statusKey: "continentStatus" },
79
81
  2: { codeKey: "regionCode", nameKey: "regionName", statusKey: "regionStatus" },
80
82
  3: { codeKey: "countryCode", nameKey: "countryName", statusKey: "countryStatus" },
81
83
  4: { codeKey: "cityCode", nameKey: "cityName", statusKey: "cityStatus" },
82
84
  5: { codeKey: "airportCode", nameKey: "airportName", statusKey: "airportStatus" }
83
85
  };
84
- function P(a = []) {
86
+ function T(a = []) {
85
87
  return (Array.isArray(a) ? a : []).filter((e) => e == null ? void 0 : e.airlineCode).map((e) => ({
86
88
  ...e,
87
89
  label: `${e.airlineCode}(${e.airlineNameCn || ""})`,
88
90
  value: e.airlineCode
89
91
  }));
90
92
  }
91
- function T(a) {
93
+ function h(a) {
92
94
  if (!a || typeof a != "object" || Array.isArray(a))
93
95
  return a || {};
94
96
  const e = a.continentCode || a.regionCode || a.countryCode || a.cityCode || a.airportCode, n = [1, 2, 3, 4, 5].some((t) => a[String(t)] || a[t]);
@@ -105,15 +107,15 @@ function T(a) {
105
107
  for (const t of [1, 2, 3, 4, 5]) {
106
108
  const o = a[String(t)] || a[t];
107
109
  if (!o || typeof o != "object") continue;
108
- const { codeKey: f, nameKey: c, statusKey: i } = g[t];
109
- o.code !== void 0 && o.code !== null && o.code !== "" && (l[f] = o.code), o.name !== void 0 && (l[c] = o.name), o.status !== void 0 && (l[i] = o.status);
110
+ const { codeKey: f, nameKey: i, statusKey: c } = P[t];
111
+ o.code !== void 0 && o.code !== null && o.code !== "" && (l[f] = o.code), o.name !== void 0 && (l[i] = o.name), o.status !== void 0 && (l[c] = o.status);
110
112
  }
111
113
  return l;
112
114
  }
113
- function h(a) {
114
- return (Array.isArray(a) ? a : []).map((n) => T(n || {}));
115
+ function M(a) {
116
+ return (Array.isArray(a) ? a : []).map((n) => h(n || {}));
115
117
  }
116
- function M(a = [], e, n) {
118
+ function v(a = [], e, n) {
117
119
  return (Array.isArray(a) ? a : []).filter((r) => r == null ? void 0 : r[e]).map((r) => ({
118
120
  ...r,
119
121
  label: `${r[e]}(${r[n] || ""})`,
@@ -123,21 +125,21 @@ function M(a = [], e, n) {
123
125
  function p(a, e, n) {
124
126
  return async () => {
125
127
  try {
126
- const r = await R({ type: a });
127
- return M(h(r), e, n);
128
+ const r = await C({ type: a });
129
+ return v(M(r), e, n);
128
130
  } catch {
129
131
  return [];
130
132
  }
131
133
  };
132
134
  }
133
- function v(a = []) {
135
+ function w(a = []) {
134
136
  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) => ({
135
137
  ...e,
136
138
  label: e.itemName || "",
137
139
  value: e.itemCode
138
140
  }));
139
141
  }
140
- function w(a = []) {
142
+ function K(a = []) {
141
143
  const e = Array.isArray(a) ? a : [], n = new Set(
142
144
  e.map((l) => l.parentItemCode).filter((l) => l != null && String(l) !== "").map(String)
143
145
  ), r = new Set(
@@ -160,10 +162,10 @@ function w(a = []) {
160
162
  });
161
163
  }), s;
162
164
  }
163
- function N(a, e = v) {
165
+ function N(a, e = w) {
164
166
  return async (n) => {
165
167
  try {
166
- const r = await C({
168
+ const r = await R({
167
169
  dictCodeList: [a],
168
170
  permissionOnlyCode: n == null ? void 0 : n.permissionOnlyCode
169
171
  }), s = (r == null ? void 0 : r[a]) || [];
@@ -173,25 +175,32 @@ function N(a, e = v) {
173
175
  }
174
176
  };
175
177
  }
176
- function K(a = []) {
178
+ function Y(a = []) {
177
179
  return (Array.isArray(a) ? a : []).filter((e) => (e == null ? void 0 : e.id) !== void 0 && (e == null ? void 0 : e.id) !== null).map((e) => ({
178
180
  ...e,
179
181
  label: e.fullName || e.username || String(e.id),
180
182
  value: e.id
181
183
  }));
182
184
  }
183
- function Y(a = []) {
185
+ function F(a = []) {
186
+ return (Array.isArray(a) ? a : []).filter((e) => (e == null ? void 0 : e.id) !== void 0 && (e == null ? void 0 : e.id) !== null).map((e) => ({
187
+ ...e,
188
+ label: e.roleName || e.roleCode || String(e.id),
189
+ value: e.id
190
+ }));
191
+ }
192
+ function D(a = []) {
184
193
  return (Array.isArray(a) ? a : []).filter((e) => (e == null ? void 0 : e.id) !== void 0 && (e == null ? void 0 : e.id) !== null).map((e) => {
185
194
  const n = e.businessType || "";
186
195
  return {
187
196
  ...e,
188
- businessTypeName: b[n] || n,
197
+ businessTypeName: g[n] || n,
189
198
  label: e.reasonName || "",
190
199
  value: e.id
191
200
  };
192
201
  });
193
202
  }
194
- function D(a = [], e = /* @__PURE__ */ new Map()) {
203
+ function U(a = [], e = /* @__PURE__ */ new Map()) {
195
204
  return (Array.isArray(a) ? a : []).filter((n) => (n == null ? void 0 : n.id) !== void 0 && (n == null ? void 0 : n.id) !== null).map((n) => {
196
205
  const r = n.primaryReasonId, s = (r != null ? e.get(r) : void 0) || (r != null ? String(r) : "");
197
206
  return {
@@ -202,21 +211,21 @@ function D(a = [], e = /* @__PURE__ */ new Map()) {
202
211
  };
203
212
  });
204
213
  }
205
- function F(a = []) {
214
+ function G(a = []) {
206
215
  return (Array.isArray(a) ? a : []).filter((e) => e == null ? void 0 : e.supplierConfigPcc).map((e) => ({
207
216
  ...e,
208
217
  label: e.supplierConfigPcc,
209
218
  value: e.supplierConfigPcc
210
219
  }));
211
220
  }
212
- function U(a = []) {
221
+ function x(a = []) {
213
222
  return (Array.isArray(a) ? a : []).filter((e) => e == null ? void 0 : e.supplierCode).map((e) => ({
214
223
  ...e,
215
- label: e.supplierName ? `${e.supplierCode}(${e.supplierName})` : e.supplierCode,
224
+ label: e.supplierName || e.supplierCode,
216
225
  value: e.supplierCode
217
226
  }));
218
227
  }
219
- const k = {
228
+ const q = {
220
229
  [u.AIRLINE]: {
221
230
  defaultFieldName: "airlineCodes",
222
231
  defaultLabel: "航司",
@@ -226,7 +235,7 @@ const k = {
226
235
  async fetchOptions() {
227
236
  try {
228
237
  const a = await E();
229
- return P(a || []);
238
+ return T(a || []);
230
239
  } catch {
231
240
  return [];
232
241
  }
@@ -285,7 +294,7 @@ const k = {
285
294
  valueField: "value",
286
295
  parentField: "parentItemCode"
287
296
  },
288
- fetchOptions: N(u.SALES_ORDER_TYPE, w)
297
+ fetchOptions: N(u.SALES_ORDER_TYPE, K)
289
298
  },
290
299
  [u.SALES_ORDER_PRODUCT_TYPE]: {
291
300
  defaultFieldName: "productType",
@@ -309,8 +318,23 @@ const k = {
309
318
  defaultShowAll: !1,
310
319
  async fetchOptions() {
311
320
  try {
312
- const a = await A({ pageNo: 1, pageSize: 9999 });
313
- return K((a == null ? void 0 : a.records) || []);
321
+ const a = await O({ pageNo: 1, pageSize: 9999 });
322
+ return Y((a == null ? void 0 : a.records) || []);
323
+ } catch {
324
+ return [];
325
+ }
326
+ }
327
+ },
328
+ [u.ROLE]: {
329
+ defaultFieldName: "roleIds",
330
+ defaultLabel: "角色",
331
+ defaultExcludeLabel: "排除角色",
332
+ defaultMultiple: !0,
333
+ defaultShowAll: !1,
334
+ async fetchOptions() {
335
+ try {
336
+ const a = await A();
337
+ return F(a || []);
314
338
  } catch {
315
339
  return [];
316
340
  }
@@ -325,7 +349,7 @@ const k = {
325
349
  async fetchOptions() {
326
350
  try {
327
351
  const a = await S();
328
- return Y(a || []);
352
+ return D(a || []);
329
353
  } catch {
330
354
  return [];
331
355
  }
@@ -340,12 +364,12 @@ const k = {
340
364
  async fetchOptions() {
341
365
  try {
342
366
  const [a, e] = await Promise.all([
343
- O(),
367
+ L(),
344
368
  S()
345
369
  ]), n = /* @__PURE__ */ new Map();
346
370
  return (e || []).forEach((r) => {
347
371
  (r == null ? void 0 : r.id) !== void 0 && (r == null ? void 0 : r.id) !== null && n.set(r.id, r.reasonName || String(r.id));
348
- }), D(a || [], n);
372
+ }), U(a || [], n);
349
373
  } catch {
350
374
  return [];
351
375
  }
@@ -359,8 +383,8 @@ const k = {
359
383
  defaultShowAll: !1,
360
384
  async fetchOptions() {
361
385
  try {
362
- const a = await _({});
363
- return F(a || []);
386
+ const a = await I({});
387
+ return G(a || []);
364
388
  } catch {
365
389
  return [];
366
390
  }
@@ -374,8 +398,8 @@ const k = {
374
398
  defaultShowAll: !1,
375
399
  async fetchOptions() {
376
400
  try {
377
- const a = await L();
378
- return U(a || []);
401
+ const a = await _();
402
+ return x(a || []);
379
403
  } catch {
380
404
  return [];
381
405
  }
@@ -384,8 +408,8 @@ const k = {
384
408
  };
385
409
  export {
386
410
  u as CODES,
387
- k as CODE_REGISTRY,
411
+ q as CODE_REGISTRY,
388
412
  d as GROUP_BY,
389
- $ as groupBasicDataOptions,
390
- j as resolveDefaultGroupBy
413
+ k as groupBasicDataOptions,
414
+ V as resolveDefaultGroupBy
391
415
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dazhicheng/ui",
3
- "version": "1.5.249",
3
+ "version": "1.5.251",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",