@dazhicheng/ui 1.5.244 → 1.5.246
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 +40 -5
- package/dist/api/basicData.js +16 -9
- package/dist/hooks/basicDataCodes.d.ts +48 -1
- package/dist/hooks/basicDataCodes.js +214 -24
- package/dist/hooks/useBasicDataOptions.d.ts +1 -0
- package/dist/hooks/useBasicDataOptions.js +76 -55
- package/dist/hooks/usePanelSelectSchemas.d.ts +15 -6
- package/dist/hooks/usePanelSelectSchemas.js +113 -102
- package/dist/index.d.ts +1 -1
- package/dist/index.js +46 -45
- package/package.json +3 -3
package/dist/api/basicData.d.ts
CHANGED
|
@@ -4,8 +4,16 @@ export type BasicAirlineItem = {
|
|
|
4
4
|
airlineNameCn?: string;
|
|
5
5
|
[key: string]: any;
|
|
6
6
|
};
|
|
7
|
-
/**
|
|
7
|
+
/** 机场区域完整信息(洲/区域/国家/城市/机场) */
|
|
8
8
|
export type AirportRegionItem = {
|
|
9
|
+
continentCode?: string;
|
|
10
|
+
continentName?: string;
|
|
11
|
+
regionCode?: string;
|
|
12
|
+
regionName?: string;
|
|
13
|
+
countryCode?: string;
|
|
14
|
+
countryName?: string;
|
|
15
|
+
cityCode?: string;
|
|
16
|
+
cityName?: string;
|
|
9
17
|
airportCode?: string;
|
|
10
18
|
airportName?: string;
|
|
11
19
|
[key: string]: any;
|
|
@@ -14,10 +22,37 @@ export type AirportRegionItem = {
|
|
|
14
22
|
export declare function getAllBasicAirline(options?: {
|
|
15
23
|
[key: string]: any;
|
|
16
24
|
}): Promise<BasicAirlineItem[]>;
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
/**
|
|
26
|
+
* 按类型查询区域机场链路列表 GET /airportRegionLevel/listChainByType
|
|
27
|
+
* type:1-洲,2-区域,3-国家,4-城市,5-机场
|
|
28
|
+
*/
|
|
29
|
+
export declare function listChainByTypeAirportRegionLevel(params: {
|
|
30
|
+
type: number;
|
|
21
31
|
}, options?: {
|
|
22
32
|
[key: string]: any;
|
|
23
33
|
}): Promise<AirportRegionItem[]>;
|
|
34
|
+
/** 系统字典项 */
|
|
35
|
+
export type SysDictItem = {
|
|
36
|
+
id?: number;
|
|
37
|
+
dictCode?: string;
|
|
38
|
+
itemCode?: string;
|
|
39
|
+
itemName?: string;
|
|
40
|
+
itemOrder?: number;
|
|
41
|
+
parentItemCode?: string;
|
|
42
|
+
status?: number;
|
|
43
|
+
remark?: string;
|
|
44
|
+
[key: string]: any;
|
|
45
|
+
};
|
|
46
|
+
/** 按字典编码批量查询字典项入参 */
|
|
47
|
+
export type SysDictItemByCodesQry = {
|
|
48
|
+
permissionOnlyCode?: string;
|
|
49
|
+
dictCodeList?: string[];
|
|
50
|
+
status?: number;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* 根据权限编码和多个字典编码获取系统字典枚举项
|
|
54
|
+
* POST /sysDictItem/getDictItemsByCodes
|
|
55
|
+
*/
|
|
56
|
+
export declare function getDictItemsByCodes(body: SysDictItemByCodesQry, options?: {
|
|
57
|
+
[key: string]: any;
|
|
58
|
+
}): Promise<Record<string, SysDictItem[]>>;
|
package/dist/api/basicData.js
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
|
-
import { request as
|
|
2
|
-
async function
|
|
3
|
-
return
|
|
1
|
+
import { request as e } from "../utils/xhr.js";
|
|
2
|
+
async function n(t) {
|
|
3
|
+
return e.get({
|
|
4
4
|
url: "/basic/basicAirline/getAll"
|
|
5
5
|
});
|
|
6
6
|
}
|
|
7
|
-
async function
|
|
8
|
-
return
|
|
9
|
-
url: "/basic/airportRegionLevel/
|
|
10
|
-
|
|
7
|
+
async function r(t, i) {
|
|
8
|
+
return e.get({
|
|
9
|
+
url: "/basic/airportRegionLevel/listChainByType",
|
|
10
|
+
params: t
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
async function o(t, i) {
|
|
14
|
+
return e.post({
|
|
15
|
+
url: "/basic/sysDictItem/getDictItemsByCodes",
|
|
16
|
+
params: t
|
|
11
17
|
});
|
|
12
18
|
}
|
|
13
19
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
n as getAllBasicAirline,
|
|
21
|
+
o as getDictItemsByCodes,
|
|
22
|
+
r as listChainByTypeAirportRegionLevel
|
|
16
23
|
};
|
|
@@ -1,16 +1,59 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 基础数据 code 常量,页面传入 hooks 时使用。
|
|
3
|
+
* 区域层级 type:1-洲,2-区域,3-国家,4-城市,5-机场
|
|
4
|
+
* 字典类:SALES_ORDER_TYPE / SALES_ORDER_PRODUCT_TYPE 对应 sysDictItem 字典编码
|
|
3
5
|
*/
|
|
4
6
|
export declare const CODES: {
|
|
5
7
|
readonly AIRLINE: "airline";
|
|
8
|
+
readonly CONTINENT: "continent";
|
|
9
|
+
readonly REGION: "region";
|
|
10
|
+
readonly COUNTRY: "country";
|
|
11
|
+
readonly CITY: "city";
|
|
6
12
|
readonly AIRPORT: "airport";
|
|
13
|
+
/** 订单类型(字典 SALES_ORDER_TYPE) */
|
|
14
|
+
readonly SALES_ORDER_TYPE: "SALES_ORDER_TYPE";
|
|
15
|
+
/** 产品类型(字典 SALES_ORDER_PRODUCT_TYPE) */
|
|
16
|
+
readonly SALES_ORDER_PRODUCT_TYPE: "SALES_ORDER_PRODUCT_TYPE";
|
|
7
17
|
};
|
|
8
18
|
export type BasicDataCode = (typeof CODES)[keyof typeof CODES];
|
|
9
19
|
export type BasicDataOption = {
|
|
10
20
|
label: string;
|
|
11
21
|
value: string | number;
|
|
22
|
+
children?: BasicDataOption[];
|
|
12
23
|
[key: string]: any;
|
|
13
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* PanelSelect 分组方式。
|
|
27
|
+
* - continent / region / country:按洲 / 区域 / 国家树形分组
|
|
28
|
+
* - pinyin:按拼音首字母分组(TtPanelSelect showPinyinMode)
|
|
29
|
+
*/
|
|
30
|
+
export declare const GROUP_BY: {
|
|
31
|
+
readonly CONTINENT: "continent";
|
|
32
|
+
readonly REGION: "region";
|
|
33
|
+
readonly COUNTRY: "country";
|
|
34
|
+
readonly PINYIN: "pinyin";
|
|
35
|
+
};
|
|
36
|
+
export type PanelSelectGroupBy = (typeof GROUP_BY)[keyof typeof GROUP_BY];
|
|
37
|
+
/**
|
|
38
|
+
* 将扁平 options 按洲/区域/国家转为树形(父节点 + children)。
|
|
39
|
+
* `pinyin` 或不支持的分组原样返回,交由组件拼音模式处理。
|
|
40
|
+
*/
|
|
41
|
+
export declare function groupBasicDataOptions(options: BasicDataOption[], groupBy: PanelSelectGroupBy): BasicDataOption[];
|
|
42
|
+
/** 机场默认按国家分组;其余默认拼音 */
|
|
43
|
+
export declare function resolveDefaultGroupBy(code: BasicDataCode, groupBy?: PanelSelectGroupBy): PanelSelectGroupBy;
|
|
44
|
+
export type BasicDataFetchContext = {
|
|
45
|
+
/** 当前路由 permissionOnlyCode,字典接口按权限过滤时使用 */
|
|
46
|
+
permissionOnlyCode?: string;
|
|
47
|
+
};
|
|
48
|
+
export type BasicDataTreeConfig = {
|
|
49
|
+
transform?: boolean;
|
|
50
|
+
labelField?: string;
|
|
51
|
+
valueField?: string;
|
|
52
|
+
parentField?: string;
|
|
53
|
+
childrenField?: string;
|
|
54
|
+
disabledField?: string;
|
|
55
|
+
rootParentValue?: string | number | null;
|
|
56
|
+
};
|
|
14
57
|
export type BasicDataCodeRegistryItem = {
|
|
15
58
|
/** 默认表单字段名 */
|
|
16
59
|
defaultFieldName: string;
|
|
@@ -22,8 +65,12 @@ export type BasicDataCodeRegistryItem = {
|
|
|
22
65
|
defaultMultiple: boolean;
|
|
23
66
|
/** 默认是否展示「全部」 */
|
|
24
67
|
defaultShowAll: boolean;
|
|
68
|
+
/** 默认是否展示左侧导航 */
|
|
69
|
+
defaultShowNav?: boolean;
|
|
70
|
+
/** 默认树配置(如产品类型父子字典);有值时关闭拼音分组 */
|
|
71
|
+
defaultTreeConfig?: BasicDataTreeConfig;
|
|
25
72
|
/** 拉取并归一化为 label/value 选项 */
|
|
26
|
-
fetchOptions: () => Promise<BasicDataOption[]>;
|
|
73
|
+
fetchOptions: (ctx?: BasicDataFetchContext) => Promise<BasicDataOption[]>;
|
|
27
74
|
};
|
|
28
75
|
/**
|
|
29
76
|
* code → 接口与默认展示配置。
|
|
@@ -1,47 +1,237 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
1
|
+
import { getAllBasicAirline as p, getDictItemsByCodes as N, listChainByTypeAirportRegionLevel as E } from "../api/basicData.js";
|
|
2
|
+
const u = {
|
|
3
3
|
AIRLINE: "airline",
|
|
4
|
-
|
|
4
|
+
CONTINENT: "continent",
|
|
5
|
+
REGION: "region",
|
|
6
|
+
COUNTRY: "country",
|
|
7
|
+
CITY: "city",
|
|
8
|
+
AIRPORT: "airport",
|
|
9
|
+
/** 订单类型(字典 SALES_ORDER_TYPE) */
|
|
10
|
+
SALES_ORDER_TYPE: "SALES_ORDER_TYPE",
|
|
11
|
+
/** 产品类型(字典 SALES_ORDER_PRODUCT_TYPE) */
|
|
12
|
+
SALES_ORDER_PRODUCT_TYPE: "SALES_ORDER_PRODUCT_TYPE"
|
|
13
|
+
}, i = {
|
|
14
|
+
CONTINENT: "continent",
|
|
15
|
+
REGION: "region",
|
|
16
|
+
COUNTRY: "country",
|
|
17
|
+
PINYIN: "pinyin"
|
|
18
|
+
}, O = {
|
|
19
|
+
[i.CONTINENT]: { codeKey: "continentCode", nameKey: "continentName" },
|
|
20
|
+
[i.REGION]: { codeKey: "regionCode", nameKey: "regionName" },
|
|
21
|
+
[i.COUNTRY]: { codeKey: "countryCode", nameKey: "countryName" }
|
|
22
|
+
};
|
|
23
|
+
function g(t, a) {
|
|
24
|
+
if (!Array.isArray(t) || !t.length) return t || [];
|
|
25
|
+
if (a === i.PINYIN) return t;
|
|
26
|
+
const r = O[a];
|
|
27
|
+
if (!r) return t;
|
|
28
|
+
const n = /* @__PURE__ */ new Map(), d = [];
|
|
29
|
+
return t.forEach((e) => {
|
|
30
|
+
const l = e[r.codeKey], o = l != null && l !== "", s = o ? String(l) : "__unknown__";
|
|
31
|
+
if (!n.has(s)) {
|
|
32
|
+
d.push(s);
|
|
33
|
+
const c = e[r.nameKey];
|
|
34
|
+
n.set(s, {
|
|
35
|
+
label: o ? `${l}(${c || ""})` : "未知",
|
|
36
|
+
value: o ? l : "__unknown__",
|
|
37
|
+
children: []
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
n.get(s).children.push(e);
|
|
41
|
+
}), d.map((e) => n.get(e));
|
|
42
|
+
}
|
|
43
|
+
function h(t, a) {
|
|
44
|
+
return a || (t === u.AIRPORT ? i.COUNTRY : i.PINYIN);
|
|
45
|
+
}
|
|
46
|
+
const R = {
|
|
47
|
+
1: { codeKey: "continentCode", nameKey: "continentName", statusKey: "continentStatus" },
|
|
48
|
+
2: { codeKey: "regionCode", nameKey: "regionName", statusKey: "regionStatus" },
|
|
49
|
+
3: { codeKey: "countryCode", nameKey: "countryName", statusKey: "countryStatus" },
|
|
50
|
+
4: { codeKey: "cityCode", nameKey: "cityName", statusKey: "cityStatus" },
|
|
51
|
+
5: { codeKey: "airportCode", nameKey: "airportName", statusKey: "airportStatus" }
|
|
5
52
|
};
|
|
6
|
-
function
|
|
7
|
-
return (
|
|
8
|
-
...
|
|
9
|
-
label: `${
|
|
10
|
-
value:
|
|
53
|
+
function S(t = []) {
|
|
54
|
+
return (Array.isArray(t) ? t : []).filter((a) => a == null ? void 0 : a.airlineCode).map((a) => ({
|
|
55
|
+
...a,
|
|
56
|
+
label: `${a.airlineCode}(${a.airlineNameCn || ""})`,
|
|
57
|
+
value: a.airlineCode
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
function A(t) {
|
|
61
|
+
if (!t || typeof t != "object" || Array.isArray(t))
|
|
62
|
+
return t || {};
|
|
63
|
+
const a = t.continentCode || t.regionCode || t.countryCode || t.cityCode || t.airportCode, r = [1, 2, 3, 4, 5].some((l) => t[String(l)] || t[l]);
|
|
64
|
+
if (a && !r)
|
|
65
|
+
return t;
|
|
66
|
+
let n = {}, d = 0;
|
|
67
|
+
for (const l of [1, 2, 3, 4, 5]) {
|
|
68
|
+
const o = t[String(l)] || t[l];
|
|
69
|
+
if (!o || typeof o != "object") continue;
|
|
70
|
+
const s = Number(o.type ?? l);
|
|
71
|
+
s >= d && (d = s, n = o);
|
|
72
|
+
}
|
|
73
|
+
const e = { ...n };
|
|
74
|
+
for (const l of [1, 2, 3, 4, 5]) {
|
|
75
|
+
const o = t[String(l)] || t[l];
|
|
76
|
+
if (!o || typeof o != "object") continue;
|
|
77
|
+
const { codeKey: s, nameKey: c, statusKey: C } = R[l];
|
|
78
|
+
o.code !== void 0 && o.code !== null && o.code !== "" && (e[s] = o.code), o.name !== void 0 && (e[c] = o.name), o.status !== void 0 && (e[C] = o.status);
|
|
79
|
+
}
|
|
80
|
+
return e;
|
|
81
|
+
}
|
|
82
|
+
function T(t) {
|
|
83
|
+
return (Array.isArray(t) ? t : []).map((r) => A(r || {}));
|
|
84
|
+
}
|
|
85
|
+
function L(t = [], a, r) {
|
|
86
|
+
return (Array.isArray(t) ? t : []).filter((n) => n == null ? void 0 : n[a]).map((n) => ({
|
|
87
|
+
...n,
|
|
88
|
+
label: `${n[a]}(${n[r] || ""})`,
|
|
89
|
+
value: n[a]
|
|
11
90
|
}));
|
|
12
91
|
}
|
|
13
|
-
function
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
92
|
+
function f(t, a, r) {
|
|
93
|
+
return async () => {
|
|
94
|
+
try {
|
|
95
|
+
const n = await E({ type: t });
|
|
96
|
+
return L(T(n), a, r);
|
|
97
|
+
} catch {
|
|
98
|
+
return [];
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function _(t = []) {
|
|
103
|
+
return (Array.isArray(t) ? t : []).filter((a) => (a == null ? void 0 : a.itemCode) !== void 0 && (a == null ? void 0 : a.itemCode) !== null && (a == null ? void 0 : a.itemCode) !== "").map((a) => ({
|
|
104
|
+
...a,
|
|
105
|
+
label: a.itemName || "",
|
|
106
|
+
value: a.itemCode
|
|
18
107
|
}));
|
|
19
108
|
}
|
|
20
|
-
|
|
21
|
-
|
|
109
|
+
function I(t = []) {
|
|
110
|
+
const a = Array.isArray(t) ? t : [], r = new Set(
|
|
111
|
+
a.map((e) => e.parentItemCode).filter((e) => e != null && String(e) !== "").map(String)
|
|
112
|
+
), n = new Set(
|
|
113
|
+
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) => String(e.itemCode))
|
|
114
|
+
), d = 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) => {
|
|
115
|
+
const l = String(e.itemCode), o = e.itemName || "";
|
|
116
|
+
return {
|
|
117
|
+
...e,
|
|
118
|
+
label: r.has(l) ? `${l}(${o})` : o,
|
|
119
|
+
value: l
|
|
120
|
+
};
|
|
121
|
+
});
|
|
122
|
+
return r.forEach((e) => {
|
|
123
|
+
n.has(e) || d.push({
|
|
124
|
+
itemCode: e,
|
|
125
|
+
itemName: e,
|
|
126
|
+
label: e,
|
|
127
|
+
value: e,
|
|
128
|
+
parentItemCode: null
|
|
129
|
+
});
|
|
130
|
+
}), d;
|
|
131
|
+
}
|
|
132
|
+
function y(t, a = _) {
|
|
133
|
+
return async (r) => {
|
|
134
|
+
try {
|
|
135
|
+
const n = await N({
|
|
136
|
+
dictCodeList: [t],
|
|
137
|
+
permissionOnlyCode: r == null ? void 0 : r.permissionOnlyCode
|
|
138
|
+
}), d = (n == null ? void 0 : n[t]) || [];
|
|
139
|
+
return a(d);
|
|
140
|
+
} catch {
|
|
141
|
+
return [];
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
const m = {
|
|
146
|
+
[u.AIRLINE]: {
|
|
22
147
|
defaultFieldName: "airlineCodes",
|
|
23
148
|
defaultLabel: "航司",
|
|
24
149
|
defaultExcludeLabel: "排除航司",
|
|
25
150
|
defaultMultiple: !0,
|
|
26
151
|
defaultShowAll: !0,
|
|
27
152
|
async fetchOptions() {
|
|
28
|
-
|
|
29
|
-
|
|
153
|
+
try {
|
|
154
|
+
const t = await p();
|
|
155
|
+
return S(t || []);
|
|
156
|
+
} catch {
|
|
157
|
+
return [];
|
|
158
|
+
}
|
|
30
159
|
}
|
|
31
160
|
},
|
|
32
|
-
[
|
|
161
|
+
[u.CONTINENT]: {
|
|
162
|
+
defaultFieldName: "continentCodes",
|
|
163
|
+
defaultLabel: "洲",
|
|
164
|
+
defaultExcludeLabel: "排除洲",
|
|
165
|
+
defaultMultiple: !0,
|
|
166
|
+
defaultShowAll: !1,
|
|
167
|
+
fetchOptions: f(1, "continentCode", "continentName")
|
|
168
|
+
},
|
|
169
|
+
[u.REGION]: {
|
|
170
|
+
defaultFieldName: "regionCodes",
|
|
171
|
+
defaultLabel: "区域",
|
|
172
|
+
defaultExcludeLabel: "排除区域",
|
|
173
|
+
defaultMultiple: !0,
|
|
174
|
+
defaultShowAll: !1,
|
|
175
|
+
fetchOptions: f(2, "regionCode", "regionName")
|
|
176
|
+
},
|
|
177
|
+
[u.COUNTRY]: {
|
|
178
|
+
defaultFieldName: "countryCodes",
|
|
179
|
+
defaultLabel: "国家",
|
|
180
|
+
defaultExcludeLabel: "排除国家",
|
|
181
|
+
defaultMultiple: !0,
|
|
182
|
+
defaultShowAll: !1,
|
|
183
|
+
fetchOptions: f(3, "countryCode", "countryName")
|
|
184
|
+
},
|
|
185
|
+
[u.CITY]: {
|
|
186
|
+
defaultFieldName: "cityCodes",
|
|
187
|
+
defaultLabel: "城市",
|
|
188
|
+
defaultExcludeLabel: "排除城市",
|
|
189
|
+
defaultMultiple: !0,
|
|
190
|
+
defaultShowAll: !1,
|
|
191
|
+
fetchOptions: f(4, "cityCode", "cityName")
|
|
192
|
+
},
|
|
193
|
+
[u.AIRPORT]: {
|
|
33
194
|
defaultFieldName: "airportCodes",
|
|
34
195
|
defaultLabel: "机场",
|
|
35
196
|
defaultExcludeLabel: "排除机场",
|
|
36
197
|
defaultMultiple: !0,
|
|
37
198
|
defaultShowAll: !1,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
199
|
+
fetchOptions: f(5, "airportCode", "airportName")
|
|
200
|
+
},
|
|
201
|
+
[u.SALES_ORDER_TYPE]: {
|
|
202
|
+
defaultFieldName: "orderType",
|
|
203
|
+
defaultLabel: "订单类型",
|
|
204
|
+
defaultExcludeLabel: "排除订单类型",
|
|
205
|
+
defaultMultiple: !1,
|
|
206
|
+
defaultShowAll: !1,
|
|
207
|
+
defaultShowNav: !0,
|
|
208
|
+
defaultTreeConfig: {
|
|
209
|
+
transform: !0,
|
|
210
|
+
labelField: "label",
|
|
211
|
+
valueField: "value",
|
|
212
|
+
parentField: "parentItemCode"
|
|
213
|
+
},
|
|
214
|
+
fetchOptions: y(u.SALES_ORDER_TYPE, I)
|
|
215
|
+
},
|
|
216
|
+
[u.SALES_ORDER_PRODUCT_TYPE]: {
|
|
217
|
+
defaultFieldName: "productType",
|
|
218
|
+
defaultLabel: "产品类型",
|
|
219
|
+
defaultExcludeLabel: "排除产品类型",
|
|
220
|
+
defaultMultiple: !1,
|
|
221
|
+
defaultShowAll: !1,
|
|
222
|
+
defaultTreeConfig: {
|
|
223
|
+
transform: !0,
|
|
224
|
+
labelField: "itemName",
|
|
225
|
+
valueField: "itemCode",
|
|
226
|
+
parentField: "parentItemCode"
|
|
227
|
+
},
|
|
228
|
+
fetchOptions: y(u.SALES_ORDER_PRODUCT_TYPE)
|
|
42
229
|
}
|
|
43
230
|
};
|
|
44
231
|
export {
|
|
45
|
-
|
|
46
|
-
|
|
232
|
+
u as CODES,
|
|
233
|
+
m as CODE_REGISTRY,
|
|
234
|
+
i as GROUP_BY,
|
|
235
|
+
g as groupBasicDataOptions,
|
|
236
|
+
h as resolveDefaultGroupBy
|
|
47
237
|
};
|
|
@@ -1,82 +1,103 @@
|
|
|
1
|
-
import { ref as P, watchEffect as R, unref as D, watch as q, computed as
|
|
2
|
-
import { useRoute as
|
|
3
|
-
import { CODE_REGISTRY as
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
|
|
1
|
+
import { ref as P, watchEffect as R, unref as D, watch as q, computed as x } from "vue";
|
|
2
|
+
import { useRoute as M } from "vue-router";
|
|
3
|
+
import { CODE_REGISTRY as b } from "./basicDataCodes.js";
|
|
4
|
+
const n = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
|
|
5
|
+
function p(c) {
|
|
6
|
+
return Array.isArray(c) ? c : [];
|
|
7
|
+
}
|
|
8
|
+
function E(c) {
|
|
9
|
+
return c.reduce((u, y) => (u[y] = [], u), {});
|
|
10
|
+
}
|
|
11
|
+
function _(c) {
|
|
12
|
+
const u = M(), y = P({});
|
|
7
13
|
function i(r = {}) {
|
|
8
|
-
y.value =
|
|
9
|
-
(e, t) => (e[t] = r[t]
|
|
14
|
+
y.value = c.codes.reduce(
|
|
15
|
+
(e, t) => (e[t] = p(r[t]), e),
|
|
10
16
|
{}
|
|
11
17
|
);
|
|
12
18
|
}
|
|
13
|
-
|
|
19
|
+
i();
|
|
20
|
+
async function O(r) {
|
|
21
|
+
var s;
|
|
22
|
+
const e = (s = u.meta) == null ? void 0 : s.permissionOnlyCode;
|
|
14
23
|
return (await Promise.allSettled(
|
|
15
|
-
r.map(async (
|
|
16
|
-
|
|
17
|
-
|
|
24
|
+
r.map(async (a) => {
|
|
25
|
+
try {
|
|
26
|
+
const f = await b[a].fetchOptions({ permissionOnlyCode: e });
|
|
27
|
+
return [a, p(f)];
|
|
28
|
+
} catch {
|
|
29
|
+
return [a, []];
|
|
30
|
+
}
|
|
18
31
|
})
|
|
19
|
-
)).reduce((
|
|
20
|
-
const l = r[
|
|
21
|
-
return
|
|
32
|
+
)).reduce((a, o, f) => {
|
|
33
|
+
const l = r[f];
|
|
34
|
+
return o.status === "fulfilled" ? a[o.value[0]] = p(o.value[1]) : a[l] = [], a;
|
|
22
35
|
}, {});
|
|
23
36
|
}
|
|
24
|
-
async function
|
|
25
|
-
const e =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
let a = r ? [...s.codes] : s.codes.filter((u) => !Object.prototype.hasOwnProperty.call(n, u));
|
|
33
|
-
if (!a.length) {
|
|
34
|
-
i(n);
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
const l = r ? void 0 : h.get(e);
|
|
38
|
-
if (l) {
|
|
39
|
-
const u = await l, o = { ...c.get(e) || {}, ...u };
|
|
40
|
-
if (c.set(e, o), a = s.codes.filter((O) => !Object.prototype.hasOwnProperty.call(o, O)), !a.length) {
|
|
41
|
-
i(o);
|
|
37
|
+
async function w(r = !1) {
|
|
38
|
+
const e = u.path;
|
|
39
|
+
let t = [];
|
|
40
|
+
try {
|
|
41
|
+
const s = D(c.dataSource);
|
|
42
|
+
if (s) {
|
|
43
|
+
const m = { ...n.get(e) || {}, ...s };
|
|
44
|
+
n.set(e, m), i(m);
|
|
42
45
|
return;
|
|
43
46
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
const a = n.get(e) || {};
|
|
48
|
+
if (t = r ? [...c.codes] : c.codes.filter((d) => !Object.prototype.hasOwnProperty.call(a, d)), !t.length) {
|
|
49
|
+
i(a);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const o = r ? void 0 : C.get(e);
|
|
53
|
+
if (o)
|
|
54
|
+
try {
|
|
55
|
+
const d = await o, h = { ...n.get(e) || {}, ...d };
|
|
56
|
+
if (n.set(e, h), t = c.codes.filter((v) => !Object.prototype.hasOwnProperty.call(h, v)), !t.length) {
|
|
57
|
+
i(h);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
} catch {
|
|
61
|
+
}
|
|
62
|
+
const f = O(t), l = (g.get(e) || 0) + 1;
|
|
63
|
+
g.set(e, l), C.set(e, f);
|
|
64
|
+
try {
|
|
65
|
+
const d = await f;
|
|
66
|
+
if (g.get(e) !== l) return;
|
|
67
|
+
const h = { ...n.get(e) || {}, ...d };
|
|
68
|
+
n.set(e, h), i(h);
|
|
69
|
+
} finally {
|
|
70
|
+
g.get(e) === l && C.delete(e);
|
|
71
|
+
}
|
|
72
|
+
} catch {
|
|
73
|
+
const s = E(t.length ? t : c.codes), o = { ...n.get(e) || {}, ...s };
|
|
74
|
+
n.set(e, o), i(o);
|
|
54
75
|
}
|
|
55
76
|
}
|
|
56
77
|
async function S() {
|
|
57
|
-
const r =
|
|
58
|
-
|
|
78
|
+
const r = u.path;
|
|
79
|
+
C.clear(), n.clear(), g.clear(), n.delete(r), await w(!0);
|
|
59
80
|
}
|
|
60
81
|
return R(() => {
|
|
61
|
-
const r = D(
|
|
82
|
+
const r = D(c.dataSource);
|
|
62
83
|
if (!r) return;
|
|
63
|
-
const e =
|
|
64
|
-
|
|
84
|
+
const e = u.path, s = { ...n.get(e) || {}, ...r };
|
|
85
|
+
n.set(e, s), i(s);
|
|
65
86
|
}), q(
|
|
66
|
-
() =>
|
|
87
|
+
() => u.path,
|
|
67
88
|
() => {
|
|
68
|
-
|
|
89
|
+
w();
|
|
69
90
|
},
|
|
70
91
|
{ immediate: !0 }
|
|
71
92
|
), {
|
|
72
|
-
dataSource:
|
|
73
|
-
const r =
|
|
74
|
-
(e, t) => (e[t] = y.value[t]
|
|
93
|
+
dataSource: x(() => {
|
|
94
|
+
const r = c.codes.reduce(
|
|
95
|
+
(e, t) => (e[t] = p(y.value[t]), e),
|
|
75
96
|
{}
|
|
76
97
|
);
|
|
77
98
|
return new Proxy(r, {
|
|
78
99
|
get(e, t) {
|
|
79
|
-
return typeof t != "string" ? [] : r[t]
|
|
100
|
+
return typeof t != "string" ? [] : p(r[t]);
|
|
80
101
|
},
|
|
81
102
|
set() {
|
|
82
103
|
return !1;
|
|
@@ -87,5 +108,5 @@ function V(s) {
|
|
|
87
108
|
};
|
|
88
109
|
}
|
|
89
110
|
export {
|
|
90
|
-
|
|
111
|
+
_ as useBasicDataOptions
|
|
91
112
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TtFormSchema } from '../components/tt-form';
|
|
2
2
|
import { Recordable } from '../../../utils/src';
|
|
3
3
|
import { MaybeRef, Ref } from 'vue';
|
|
4
|
-
import { BasicDataCode, BasicDataOption } from './basicDataCodes';
|
|
4
|
+
import { BasicDataCode, BasicDataOption, PanelSelectGroupBy } from './basicDataCodes';
|
|
5
5
|
import { BasicDataOptionsMap } from './useBasicDataOptions';
|
|
6
6
|
type FieldComponentProps = Recordable | ((values: Recordable, actions: any, options: BasicDataOption[]) => Recordable);
|
|
7
7
|
export interface PanelSelectFieldOnChangeContext {
|
|
@@ -30,7 +30,10 @@ export interface PanelSelectExcludeConfig {
|
|
|
30
30
|
}
|
|
31
31
|
export interface PanelSelectFieldConfig {
|
|
32
32
|
code: BasicDataCode;
|
|
33
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* 返回解构名。
|
|
35
|
+
* 默认:唯一 code 用 code;同 code 多字段时用 fieldName(缺省则用 registry 默认 fieldName)。
|
|
36
|
+
*/
|
|
34
37
|
key?: string;
|
|
35
38
|
fieldName?: string;
|
|
36
39
|
label?: string;
|
|
@@ -45,7 +48,14 @@ export interface PanelSelectFieldConfig {
|
|
|
45
48
|
mutexWith?: string;
|
|
46
49
|
/** 同 code 数据源的排除字段联动 */
|
|
47
50
|
exclude?: PanelSelectExcludeConfig;
|
|
48
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* 分组方式。
|
|
53
|
+
* - 机场默认 `country`(按国家)
|
|
54
|
+
* - 可传 `continent` / `region` / `country` / `pinyin`
|
|
55
|
+
* - 也可用 `GROUP_BY.CONTINENT` 等常量
|
|
56
|
+
*/
|
|
57
|
+
groupBy?: PanelSelectGroupBy;
|
|
58
|
+
/** 自定义过滤完整 options(过滤在分组前执行,入参为扁平 options) */
|
|
49
59
|
customOptions?: (values: Recordable, options: BasicDataOption[]) => BasicDataOption[];
|
|
50
60
|
}
|
|
51
61
|
export interface UsePanelSelectSchemasOptions {
|
|
@@ -54,9 +64,10 @@ export interface UsePanelSelectSchemasOptions {
|
|
|
54
64
|
/**
|
|
55
65
|
* 基础数据 PanelSelect schema hooks。
|
|
56
66
|
*
|
|
57
|
-
* - 按 CODES 拉取 options
|
|
67
|
+
* - 按 CODES 拉取 options;接口失败时兜底空数组,不影响 schema 生成
|
|
58
68
|
* - 默认组件 TtPanelSelect
|
|
59
69
|
* - 支持 exclude 排除联动、mutexWith 互斥过滤
|
|
70
|
+
* - 同 code 多字段时自动用 fieldName 作为返回解构名,避免互相覆盖
|
|
60
71
|
*
|
|
61
72
|
* @example
|
|
62
73
|
* ```ts
|
|
@@ -68,14 +79,12 @@ export interface UsePanelSelectSchemasOptions {
|
|
|
68
79
|
* },
|
|
69
80
|
* {
|
|
70
81
|
* code: CODES.AIRPORT,
|
|
71
|
-
* key: 'depAirport',
|
|
72
82
|
* fieldName: 'depAirport',
|
|
73
83
|
* label: '出发',
|
|
74
84
|
* mutexWith: 'arrAirport',
|
|
75
85
|
* },
|
|
76
86
|
* {
|
|
77
87
|
* code: CODES.AIRPORT,
|
|
78
|
-
* key: 'arrAirport',
|
|
79
88
|
* fieldName: 'arrAirport',
|
|
80
89
|
* label: '到达',
|
|
81
90
|
* mutexWith: 'depAirport',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "axios";
|
|
2
2
|
import "element-plus";
|
|
3
|
-
import { isFunction as
|
|
3
|
+
import { isFunction as H } from "../packages/utils/src/is.js";
|
|
4
4
|
import "vue";
|
|
5
5
|
import "xe-utils";
|
|
6
6
|
import "dayjs";
|
|
@@ -11,111 +11,120 @@ import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
|
11
11
|
import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
12
12
|
import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
13
13
|
import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
14
|
-
import { omit as
|
|
15
|
-
import { CODE_REGISTRY as
|
|
16
|
-
import { useBasicDataOptions as
|
|
17
|
-
const
|
|
18
|
-
function
|
|
14
|
+
import { omit as L } from "lodash-es";
|
|
15
|
+
import { CODE_REGISTRY as ne, resolveDefaultGroupBy as oe, GROUP_BY as re, groupBasicDataOptions as $ } from "./basicDataCodes.js";
|
|
16
|
+
import { useBasicDataOptions as se } from "./useBasicDataOptions.js";
|
|
17
|
+
const b = "all";
|
|
18
|
+
function d(t) {
|
|
19
19
|
return Array.isArray(t) ? t : t == null || t === "" ? [] : [t];
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function ce(t, n = b) {
|
|
22
22
|
return t === n ? !0 : typeof t == "string" && typeof n == "string" && t.toLowerCase() === String(n).toLowerCase();
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
24
|
+
function le(t, n = b) {
|
|
25
|
+
return d(t).some((r) => ce(r, n));
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function pe(t) {
|
|
28
28
|
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("");
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
return t ?
|
|
30
|
+
function z(t, n, r, c) {
|
|
31
|
+
return t ? H(t) ? t(n, r, c) : t : {};
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
36
|
-
const
|
|
37
|
-
(
|
|
33
|
+
function K(t, n, r, c) {
|
|
34
|
+
const p = new Set(r.map((e) => e.value)), l = t[n];
|
|
35
|
+
if (c) {
|
|
36
|
+
const e = d(l).filter((u) => p.has(u)), s = d(l);
|
|
37
|
+
(e.length !== s.length || e.some((u, g) => u !== s[g])) && (t[n] = e);
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
l == null || l === "" || p.has(l) || (t[n] = void 0);
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
const
|
|
42
|
+
function V(t, n, r, c, p, l) {
|
|
43
|
+
const e = l ? p.filter((s) => d(r[n]).includes(s.value)) : p.find((s) => s.value === r[n]);
|
|
44
44
|
return {
|
|
45
45
|
values: r,
|
|
46
|
-
actions:
|
|
46
|
+
actions: c,
|
|
47
47
|
fieldName: n,
|
|
48
48
|
code: t,
|
|
49
|
-
options:
|
|
50
|
-
currentOption:
|
|
49
|
+
options: p,
|
|
50
|
+
currentOption: e
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
const
|
|
55
|
-
if (!
|
|
56
|
-
if (
|
|
57
|
-
const
|
|
58
|
-
return n.filter((
|
|
53
|
+
function j(t, n, r) {
|
|
54
|
+
const c = d(t);
|
|
55
|
+
if (!c.length) return [];
|
|
56
|
+
if (le(t, r)) return n;
|
|
57
|
+
const p = new Set(c);
|
|
58
|
+
return n.filter((l) => p.has(l.value));
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
const r = new Set(
|
|
62
|
-
return r.size ? n.filter((
|
|
60
|
+
function q(t, n) {
|
|
61
|
+
const r = new Set(d(t));
|
|
62
|
+
return r.size ? n.filter((c) => !r.has(c.value)) : n;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
|
|
64
|
+
function Z(t, n) {
|
|
65
|
+
var c;
|
|
66
|
+
const r = (c = t.value) == null ? void 0 : c[n];
|
|
67
|
+
return Array.isArray(r) ? r : [];
|
|
68
|
+
}
|
|
69
|
+
function Ee(t, n = {}) {
|
|
70
|
+
const r = [...new Set(t.map((e) => e.code))], c = t.reduce(
|
|
71
|
+
(e, s) => (e[s.code] = (e[s.code] || 0) + 1, e),
|
|
72
|
+
{}
|
|
73
|
+
), { dataSource: p } = se({
|
|
66
74
|
codes: r,
|
|
67
75
|
dataSource: n.dataSource
|
|
68
76
|
}), l = {};
|
|
69
77
|
return t.forEach((e) => {
|
|
70
|
-
var
|
|
71
|
-
const
|
|
72
|
-
...
|
|
73
|
-
...((
|
|
74
|
-
],
|
|
75
|
-
...
|
|
76
|
-
triggerFields:
|
|
77
|
-
} : e.dependencies,
|
|
78
|
+
var U;
|
|
79
|
+
const s = ne[e.code], u = e.fieldName || s.defaultFieldName, g = e.key || ((c[e.code] || 0) > 1 ? u : e.code), _ = e.label || s.defaultLabel, k = e.multiple ?? s.defaultMultiple, J = e.showAll ?? s.defaultShowAll, E = e.showAllField ?? b, m = e.mutexWith, T = oe(e.code, e.groupBy), F = T !== re.PINYIN, P = s.defaultTreeConfig, G = !!P, I = s.defaultShowNav ?? !1, Q = [
|
|
80
|
+
...m ? [m] : [],
|
|
81
|
+
...((U = e.dependencies) == null ? void 0 : U.triggerFields) || []
|
|
82
|
+
], R = [...new Set(Q)], X = L(e.dependencies || {}, ["triggerFields"]), v = R.length ? {
|
|
83
|
+
...X,
|
|
84
|
+
triggerFields: R
|
|
85
|
+
} : e.dependencies, M = {
|
|
78
86
|
component: "TtPanelSelect",
|
|
79
|
-
fieldName:
|
|
80
|
-
label:
|
|
87
|
+
fieldName: u,
|
|
88
|
+
label: _,
|
|
81
89
|
rules: e.rules,
|
|
82
|
-
dependencies:
|
|
83
|
-
componentProps: (o,
|
|
84
|
-
const A =
|
|
85
|
-
let a =
|
|
86
|
-
|
|
87
|
-
const
|
|
90
|
+
dependencies: v,
|
|
91
|
+
componentProps: (o, x) => {
|
|
92
|
+
const A = Z(p, e.code);
|
|
93
|
+
let a = m ? q(o[m], A) : A;
|
|
94
|
+
H(e.customOptions) && (a = e.customOptions(o, a) || []);
|
|
95
|
+
const O = F ? $(a, T) : a, B = z(e.componentProps, o, x, a), { onChange: W, ...S } = B;
|
|
88
96
|
return {
|
|
89
|
-
multiple:
|
|
90
|
-
showAll:
|
|
91
|
-
showAllField:
|
|
92
|
-
showNav:
|
|
97
|
+
multiple: k,
|
|
98
|
+
showAll: J,
|
|
99
|
+
showAllField: E,
|
|
100
|
+
showNav: I,
|
|
93
101
|
showOriginMode: !1,
|
|
94
|
-
showPinyinMode: !
|
|
95
|
-
...
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
+
showPinyinMode: G ? !1 : !F,
|
|
103
|
+
...P ? { treeConfig: P } : {},
|
|
104
|
+
...S,
|
|
105
|
+
options: O,
|
|
106
|
+
onChange(w) {
|
|
107
|
+
var y;
|
|
108
|
+
if (m) {
|
|
109
|
+
const i = Array.isArray(o[m]), h = q(w, A);
|
|
110
|
+
K(o, m, h, i);
|
|
102
111
|
}
|
|
103
112
|
if (e.exclude) {
|
|
104
|
-
const
|
|
105
|
-
|
|
113
|
+
const i = e.exclude.fieldName, h = e.exclude.multiple ?? !0, D = j(w, A, E);
|
|
114
|
+
d(w).length ? K(o, i, D, h) : o[i] = h ? [] : void 0;
|
|
106
115
|
}
|
|
107
|
-
(
|
|
116
|
+
(y = e.onChange) == null || y.call(
|
|
108
117
|
e,
|
|
109
|
-
|
|
110
|
-
|
|
118
|
+
w,
|
|
119
|
+
V(e.code, u, o, x, a, k)
|
|
111
120
|
);
|
|
112
121
|
}
|
|
113
122
|
};
|
|
114
123
|
}
|
|
115
124
|
};
|
|
116
|
-
if (l[
|
|
117
|
-
...
|
|
118
|
-
...
|
|
125
|
+
if (l[g] = {
|
|
126
|
+
...M,
|
|
127
|
+
...L(e, [
|
|
119
128
|
"code",
|
|
120
129
|
"key",
|
|
121
130
|
"fieldName",
|
|
@@ -129,50 +138,52 @@ function xe(t, n = {}) {
|
|
|
129
138
|
"rules",
|
|
130
139
|
"mutexWith",
|
|
131
140
|
"exclude",
|
|
141
|
+
"groupBy",
|
|
132
142
|
"customOptions"
|
|
133
143
|
]),
|
|
134
|
-
fieldName:
|
|
135
|
-
label:
|
|
144
|
+
fieldName: u,
|
|
145
|
+
label: _,
|
|
136
146
|
rules: e.rules,
|
|
137
|
-
dependencies:
|
|
138
|
-
componentProps:
|
|
147
|
+
dependencies: M.dependencies,
|
|
148
|
+
componentProps: M.componentProps,
|
|
139
149
|
component: "TtPanelSelect"
|
|
140
150
|
}, e.exclude) {
|
|
141
|
-
const o = e.exclude,
|
|
142
|
-
...
|
|
143
|
-
triggerFields:
|
|
144
|
-
if:
|
|
145
|
-
},
|
|
151
|
+
const o = e.exclude, x = o.fieldName, A = o.key || `exclude${pe(g)}`, a = o.label || s.defaultExcludeLabel, O = o.multiple ?? !0, B = o.showAll ?? !1, W = o.showAllField ?? b, S = o.dependencies || {}, w = {
|
|
152
|
+
...S,
|
|
153
|
+
triggerFields: S.triggerFields ?? [u],
|
|
154
|
+
if: S.if ?? ((i) => d(i[u]).length > 0)
|
|
155
|
+
}, y = {
|
|
146
156
|
component: "TtPanelSelect",
|
|
147
|
-
fieldName:
|
|
157
|
+
fieldName: x,
|
|
148
158
|
label: a,
|
|
149
159
|
rules: o.rules,
|
|
150
|
-
dependencies:
|
|
151
|
-
componentProps: (i,
|
|
152
|
-
const
|
|
160
|
+
dependencies: w,
|
|
161
|
+
componentProps: (i, h) => {
|
|
162
|
+
const D = Z(p, e.code), N = j(i[u], D, E), f = F ? $(N, T) : N, C = z(o.componentProps, i, h, N), { onChange: ue, ...ee } = C;
|
|
153
163
|
return {
|
|
154
|
-
multiple:
|
|
155
|
-
showAll:
|
|
156
|
-
showAllField:
|
|
157
|
-
showNav:
|
|
164
|
+
multiple: O,
|
|
165
|
+
showAll: B,
|
|
166
|
+
showAllField: W,
|
|
167
|
+
showNav: I,
|
|
158
168
|
showOriginMode: !1,
|
|
159
|
-
showPinyinMode: !
|
|
160
|
-
...
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
169
|
+
showPinyinMode: G ? !1 : !F,
|
|
170
|
+
...P ? { treeConfig: P } : {},
|
|
171
|
+
...ee,
|
|
172
|
+
options: f,
|
|
173
|
+
onChange(te) {
|
|
174
|
+
var Y;
|
|
175
|
+
(Y = o.onChange) == null || Y.call(
|
|
165
176
|
o,
|
|
166
|
-
|
|
167
|
-
|
|
177
|
+
te,
|
|
178
|
+
V(e.code, x, i, h, N, O)
|
|
168
179
|
);
|
|
169
180
|
}
|
|
170
181
|
};
|
|
171
182
|
}
|
|
172
183
|
};
|
|
173
184
|
l[A] = {
|
|
174
|
-
...
|
|
175
|
-
...
|
|
185
|
+
...y,
|
|
186
|
+
...L(o, [
|
|
176
187
|
"fieldName",
|
|
177
188
|
"label",
|
|
178
189
|
"key",
|
|
@@ -184,19 +195,19 @@ function xe(t, n = {}) {
|
|
|
184
195
|
"onChange",
|
|
185
196
|
"rules"
|
|
186
197
|
]),
|
|
187
|
-
fieldName:
|
|
198
|
+
fieldName: x,
|
|
188
199
|
label: a,
|
|
189
200
|
rules: o.rules,
|
|
190
|
-
dependencies:
|
|
191
|
-
componentProps:
|
|
201
|
+
dependencies: y.dependencies,
|
|
202
|
+
componentProps: y.componentProps,
|
|
192
203
|
component: "TtPanelSelect"
|
|
193
204
|
};
|
|
194
205
|
}
|
|
195
206
|
}), {
|
|
196
207
|
...l,
|
|
197
|
-
dataSource:
|
|
208
|
+
dataSource: p
|
|
198
209
|
};
|
|
199
210
|
}
|
|
200
211
|
export {
|
|
201
|
-
|
|
212
|
+
Ee as usePanelSelectSchemas
|
|
202
213
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export { useFormSchemasLink } from './hooks/useFormSchemasLink';
|
|
|
26
26
|
export { useDataPermissionOptions } from './hooks/useDataPermissionOptions';
|
|
27
27
|
export { useBasicDataOptions } from './hooks/useBasicDataOptions';
|
|
28
28
|
export { usePanelSelectSchemas, type PanelSelectFieldConfig, type PanelSelectExcludeConfig, } from './hooks/usePanelSelectSchemas';
|
|
29
|
-
export { CODES, type BasicDataCode } from './hooks/basicDataCodes';
|
|
29
|
+
export { CODES, GROUP_BY, type BasicDataCode, type PanelSelectGroupBy } from './hooks/basicDataCodes';
|
|
30
30
|
export { useFormat } from './hooks/useFormat';
|
|
31
31
|
export { useLoading } from './hooks/useLoading';
|
|
32
32
|
export { useScreenshotOss, type ScreenshotOssComponentOptions, type ScreenshotOssDataUrlResult, type ScreenshotOssOptions, type ScreenshotOssResult, } from './hooks/useScreenshotOss';
|
package/dist/index.js
CHANGED
|
@@ -11,8 +11,8 @@ import { RenderModal as c } from "./components/tt-modal/index.js";
|
|
|
11
11
|
import { TtModal as pr } from "./components/tt-modal/index.js";
|
|
12
12
|
import { TtSelect as b } from "./components/tt-select/index.js";
|
|
13
13
|
import { TtText as w } from "./components/tt-text/index.js";
|
|
14
|
-
import { TtUpload as
|
|
15
|
-
import { TtNavAnchor as
|
|
14
|
+
import { TtUpload as R } from "./components/tt-upload/index.js";
|
|
15
|
+
import { TtNavAnchor as h } from "./components/tt-nav-anchor/index.js";
|
|
16
16
|
import { TtApiComponent as g } from "./components/tt-api-component/index.js";
|
|
17
17
|
import * as e from "./directives/index.js";
|
|
18
18
|
import { setup as M } from "./hooks/useSetup.js";
|
|
@@ -27,36 +27,36 @@ import { setXHR as ir } from "./utils/xhr.js";
|
|
|
27
27
|
import { default as xr } from "./components/tt-area/TtArea.vue.js";
|
|
28
28
|
import { useModalForm as ur } from "./components/tt-modal-form/useModalForm.js";
|
|
29
29
|
import { TtLoading as nr } from "./components/tt-loading/index.js";
|
|
30
|
-
import { TtTable as br, TtTableAction as wr, TtTableButton as
|
|
30
|
+
import { TtTable as br, TtTableAction as wr, TtTableButton as Rr } from "./components/tt-table/index.js";
|
|
31
31
|
import { useFormSchemasLink as gr } from "./hooks/useFormSchemasLink.js";
|
|
32
32
|
import { useDataPermissionOptions as Sr } from "./hooks/useDataPermissionOptions.js";
|
|
33
33
|
import { useBasicDataOptions as Cr } from "./hooks/useBasicDataOptions.js";
|
|
34
34
|
import { usePanelSelectSchemas as Fr } from "./hooks/usePanelSelectSchemas.js";
|
|
35
|
-
import { CODES as
|
|
36
|
-
import { useFormat as
|
|
35
|
+
import { CODES as Pr, GROUP_BY as Lr } from "./hooks/basicDataCodes.js";
|
|
36
|
+
import { useFormat as Ir } from "./hooks/useFormat.js";
|
|
37
37
|
import { useLoading as vr } from "./hooks/useLoading.js";
|
|
38
|
-
import { useScreenshotOss as
|
|
38
|
+
import { useScreenshotOss as Nr } from "./hooks/useScreenshotOss.js";
|
|
39
39
|
import { setupDrawer as D } from "./components/tt-drawer/src/index.js";
|
|
40
|
-
import { useShowDrawer as
|
|
40
|
+
import { useShowDrawer as Ur } from "./components/tt-drawer/src/index.js";
|
|
41
41
|
import { setupModal as F } from "./components/tt-modal/src/index.js";
|
|
42
|
-
import { useShowModal as
|
|
42
|
+
import { useShowModal as _r } from "./components/tt-modal/src/index.js";
|
|
43
43
|
import { default as jr } from "./directives/disabled-tip/index.js";
|
|
44
44
|
import { default as Hr } from "./directives/auto-tip/index.js";
|
|
45
|
-
import { showTtDrawer as Xr, useDrawerRender as
|
|
45
|
+
import { showTtDrawer as Xr, useDrawerRender as Yr } from "./components/tt-drawer/src/hooks/useDrawerRender.js";
|
|
46
46
|
import { useDrawerResizable as qr } from "./components/tt-drawer/src/hooks/useResizable.js";
|
|
47
47
|
import { showTtModal as Kr, useModalRender as Qr } from "./components/tt-modal/src/hooks/useModalRender.js";
|
|
48
|
-
import { default as
|
|
48
|
+
import { default as ro } from "./directives/dialog-resize/index.js";
|
|
49
49
|
import * as rr from "zod";
|
|
50
|
-
import { useGroupForm as
|
|
51
|
-
import { COMPONENT_MAP as
|
|
52
|
-
import { useForm as
|
|
53
|
-
import { TtImageViewer as
|
|
54
|
-
import { vTtLoading as
|
|
55
|
-
import { Loading as
|
|
56
|
-
import { useTableContext as
|
|
57
|
-
import { useTableFormRender as
|
|
58
|
-
import { ttUploadProps as
|
|
59
|
-
const
|
|
50
|
+
import { useGroupForm as eo } from "./components/tt-form/src/group-form/useGroupForm.js";
|
|
51
|
+
import { COMPONENT_MAP as mo } from "./components/tt-form/src/config.js";
|
|
52
|
+
import { useForm as fo } from "./components/tt-form/src/useForm.js";
|
|
53
|
+
import { TtImageViewer as so } from "./components/tt-image/src/components/ImageViewer.js";
|
|
54
|
+
import { vTtLoading as xo } from "./components/tt-loading/src/directive.js";
|
|
55
|
+
import { Loading as uo } from "./components/tt-loading/src/service.js";
|
|
56
|
+
import { useTableContext as no, useTableFormContext as co } from "./components/tt-table/src/hooks/useTableContext.js";
|
|
57
|
+
import { useTableFormRender as wo, useTableRender as Ro } from "./components/tt-table/src/hooks/useTableRender.js";
|
|
58
|
+
import { ttUploadProps as go } from "./components/tt-upload/src/typing.js";
|
|
59
|
+
const O = [
|
|
60
60
|
a,
|
|
61
61
|
n,
|
|
62
62
|
c,
|
|
@@ -67,16 +67,16 @@ const L = [
|
|
|
67
67
|
f,
|
|
68
68
|
d,
|
|
69
69
|
l,
|
|
70
|
-
h,
|
|
71
70
|
R,
|
|
71
|
+
h,
|
|
72
72
|
T,
|
|
73
73
|
u,
|
|
74
74
|
g,
|
|
75
75
|
S,
|
|
76
76
|
A,
|
|
77
77
|
C
|
|
78
|
-
],
|
|
79
|
-
|
|
78
|
+
], P = (r) => {
|
|
79
|
+
O.forEach((o) => r.use(o)), Object.keys(e).forEach((o) => {
|
|
80
80
|
const t = e[o], m = o.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
81
81
|
r.directive(m, t);
|
|
82
82
|
}), D(r), F(r);
|
|
@@ -89,7 +89,7 @@ const er = {
|
|
|
89
89
|
* 安装组件
|
|
90
90
|
* @param app Vue 应用实例
|
|
91
91
|
*/
|
|
92
|
-
install:
|
|
92
|
+
install: P,
|
|
93
93
|
/**
|
|
94
94
|
* 全局参数设置
|
|
95
95
|
* @param options 全局参数
|
|
@@ -98,9 +98,10 @@ const er = {
|
|
|
98
98
|
setup: M
|
|
99
99
|
};
|
|
100
100
|
export {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
Pr as CODES,
|
|
102
|
+
mo as COMPONENT_MAP,
|
|
103
|
+
Lr as GROUP_BY,
|
|
104
|
+
uo as Loading,
|
|
104
105
|
n as RenderDrawer,
|
|
105
106
|
c as RenderModal,
|
|
106
107
|
ar as TtAddButton,
|
|
@@ -112,24 +113,24 @@ export {
|
|
|
112
113
|
p as TtEmpty,
|
|
113
114
|
x as TtIcon,
|
|
114
115
|
l as TtImage,
|
|
115
|
-
|
|
116
|
+
so as TtImageViewer,
|
|
116
117
|
nr as TtLoading,
|
|
117
118
|
S as TtLog,
|
|
118
119
|
pr as TtModal,
|
|
119
|
-
|
|
120
|
+
h as TtNavAnchor,
|
|
120
121
|
A as TtPanelSelect,
|
|
121
122
|
C as TtRadioGroup,
|
|
122
123
|
b as TtSelect,
|
|
123
124
|
u as TtSubIcon,
|
|
124
125
|
br as TtTable,
|
|
125
126
|
wr as TtTableAction,
|
|
126
|
-
|
|
127
|
+
Rr as TtTableButton,
|
|
127
128
|
w as TtText,
|
|
128
|
-
|
|
129
|
+
R as TtUpload,
|
|
129
130
|
s as addComponent,
|
|
130
131
|
Hr as autoTip,
|
|
131
132
|
er as default,
|
|
132
|
-
|
|
133
|
+
ro as dialogResize,
|
|
133
134
|
jr as disabledTip,
|
|
134
135
|
or as formAdapter,
|
|
135
136
|
i as setConfig,
|
|
@@ -138,26 +139,26 @@ export {
|
|
|
138
139
|
F as setupModal,
|
|
139
140
|
Xr as showTtDrawer,
|
|
140
141
|
Kr as showTtModal,
|
|
141
|
-
|
|
142
|
+
go as ttUploadProps,
|
|
142
143
|
Cr as useBasicDataOptions,
|
|
143
144
|
Sr as useDataPermissionOptions,
|
|
144
|
-
|
|
145
|
+
Yr as useDrawerRender,
|
|
145
146
|
qr as useDrawerResizable,
|
|
146
|
-
|
|
147
|
+
fo as useForm,
|
|
147
148
|
gr as useFormSchemasLink,
|
|
148
|
-
|
|
149
|
-
|
|
149
|
+
Ir as useFormat,
|
|
150
|
+
eo as useGroupForm,
|
|
150
151
|
vr as useLoading,
|
|
151
152
|
ur as useModalForm,
|
|
152
153
|
Qr as useModalRender,
|
|
153
154
|
Fr as usePanelSelectSchemas,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
155
|
+
Nr as useScreenshotOss,
|
|
156
|
+
Ur as useShowDrawer,
|
|
157
|
+
_r as useShowModal,
|
|
158
|
+
no as useTableContext,
|
|
159
|
+
co as useTableFormContext,
|
|
160
|
+
wo as useTableFormRender,
|
|
161
|
+
Ro as useTableRender,
|
|
162
|
+
xo as vTtLoading,
|
|
162
163
|
rr as z
|
|
163
164
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dazhicheng/ui",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.246",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
"vue-router": "^5.0.2",
|
|
68
68
|
"vxe-pc-ui": "^4.12.36",
|
|
69
69
|
"vxe-table": "^4.17.48",
|
|
70
|
-
"@dazhicheng/
|
|
71
|
-
"@dazhicheng/
|
|
70
|
+
"@dazhicheng/utils": "1.3.43",
|
|
71
|
+
"@dazhicheng/hooks": "1.4.46"
|
|
72
72
|
},
|
|
73
73
|
"files": [
|
|
74
74
|
"dist"
|