@dazhicheng/ui 1.5.240 → 1.5.242
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/components/tt-area/TtArea.vue.js +1 -1
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue.js +2 -2
- package/dist/components/tt-form/src/form-render/FormField.vue2.js +37 -34
- package/dist/components/tt-form/src/hooks/useSelectCollapse.js +1 -1
- package/dist/components/tt-icon/index.vue.js +2 -2
- package/dist/components/tt-loading/src/loading.vue.js +2 -2
- package/dist/components/tt-panel-select/src/index.vue.js +90 -93
- package/dist/components/tt-select/src/Select.vue.d.ts +4 -4
- package/dist/components/tt-select/src/components/Table.vue.d.ts +4 -4
- package/dist/components/tt-table/index.d.ts +12 -12
- package/dist/components/tt-table/src/Table.vue.d.ts +4 -4
- package/dist/hooks/useDataPermissionOptions.js +83 -71
- package/dist/hooks/useFormSchemasLink.js +198 -155
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useDataPermissionOptions as
|
|
1
|
+
import { useDataPermissionOptions as Y } from "./useDataPermissionOptions.js";
|
|
2
2
|
import "axios";
|
|
3
|
-
import { ElSelectV2 as
|
|
4
|
-
import { isFunction as
|
|
3
|
+
import { ElSelectV2 as Z } from "element-plus";
|
|
4
|
+
import { isFunction as q } from "../packages/utils/src/is.js";
|
|
5
5
|
import "vue";
|
|
6
6
|
import "xe-utils";
|
|
7
7
|
import "dayjs";
|
|
@@ -12,288 +12,331 @@ 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
|
-
const
|
|
15
|
+
import { omit as $ } from "lodash-es";
|
|
16
|
+
const E = "all", v = { label: "全部", value: E }, z = [
|
|
17
17
|
"platformId",
|
|
18
18
|
"shopId",
|
|
19
19
|
"purchasePlaceId",
|
|
20
20
|
"businessType",
|
|
21
21
|
"lockUserId",
|
|
22
22
|
"userId"
|
|
23
|
-
],
|
|
23
|
+
], H = {
|
|
24
24
|
platformId: "platformIds",
|
|
25
25
|
shopId: "shopIds",
|
|
26
26
|
purchasePlaceId: "purchasePlaceId",
|
|
27
27
|
businessType: "businessType",
|
|
28
28
|
lockUserId: "lockUserId"
|
|
29
|
-
},
|
|
29
|
+
}, y = {
|
|
30
30
|
platformId: "平台",
|
|
31
31
|
shopId: "店铺",
|
|
32
32
|
purchasePlaceId: "采购地",
|
|
33
33
|
businessType: "业务线",
|
|
34
34
|
lockUserId: "锁单人"
|
|
35
35
|
};
|
|
36
|
-
function
|
|
37
|
-
return typeof
|
|
36
|
+
function U(r) {
|
|
37
|
+
return typeof r == "string" && r.toLowerCase() === E.toLowerCase();
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
return Array.isArray(
|
|
39
|
+
function F(r) {
|
|
40
|
+
return Array.isArray(r) ? r : r == null || r === "" ? [] : [r];
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
return [
|
|
42
|
+
function T(r = []) {
|
|
43
|
+
return [v].concat(r);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
return
|
|
45
|
+
function oo(r, u, c, A) {
|
|
46
|
+
return r ? q(r) ? r(u, c, A) : r : {};
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function j(r, u, c, A) {
|
|
49
49
|
var C;
|
|
50
|
-
|
|
51
|
-
const g = A(),
|
|
52
|
-
c == null || c(
|
|
50
|
+
u == null || u(r);
|
|
51
|
+
const g = A(), f = (C = g.values) == null ? void 0 : C[g.fieldName];
|
|
52
|
+
c == null || c(f, g);
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
const c =
|
|
56
|
-
(o,
|
|
57
|
-
if (
|
|
58
|
-
const
|
|
59
|
-
return o[
|
|
54
|
+
function no(r = {}, u = z) {
|
|
55
|
+
const c = r.scene || "list", A = u.reduce(
|
|
56
|
+
(o, e) => {
|
|
57
|
+
if (e === "userId") return o;
|
|
58
|
+
const n = I(e), t = S(e) === "TtPanelSelect";
|
|
59
|
+
return o[e] = t ? !1 : n.showAll ?? !1, o;
|
|
60
60
|
},
|
|
61
61
|
{}
|
|
62
|
-
), { dataSource: g } =
|
|
63
|
-
codes:
|
|
64
|
-
dataSource:
|
|
62
|
+
), { dataSource: g } = Y({
|
|
63
|
+
codes: u,
|
|
64
|
+
dataSource: r.dataSource,
|
|
65
65
|
showAll: A
|
|
66
66
|
});
|
|
67
|
-
function
|
|
68
|
-
return I(o).fieldName ||
|
|
67
|
+
function f(o) {
|
|
68
|
+
return I(o).fieldName || H[o];
|
|
69
69
|
}
|
|
70
70
|
function C(o) {
|
|
71
71
|
return I(o).rules;
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
return I(o).label ||
|
|
73
|
+
function M(o) {
|
|
74
|
+
return I(o).label || y[o];
|
|
75
75
|
}
|
|
76
76
|
function I(o) {
|
|
77
|
-
var
|
|
78
|
-
return ((
|
|
77
|
+
var e;
|
|
78
|
+
return ((e = r.fieldConfigs) == null ? void 0 : e[o]) || {};
|
|
79
79
|
}
|
|
80
80
|
function b(o) {
|
|
81
|
-
return I(o).showAllField ??
|
|
81
|
+
return I(o).showAllField ?? E;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
const
|
|
85
|
-
if (!
|
|
86
|
-
if (!
|
|
87
|
-
const
|
|
88
|
-
...
|
|
89
|
-
...
|
|
83
|
+
function _(o, e) {
|
|
84
|
+
const n = I(o).dependencies;
|
|
85
|
+
if (!e) return n;
|
|
86
|
+
if (!n) return e;
|
|
87
|
+
const t = {
|
|
88
|
+
...e,
|
|
89
|
+
...n
|
|
90
90
|
};
|
|
91
|
-
if (
|
|
92
|
-
const
|
|
93
|
-
|
|
91
|
+
if (e && n) {
|
|
92
|
+
const l = e.triggerFields, s = n.triggerFields;
|
|
93
|
+
t.triggerFields = s ?? l;
|
|
94
94
|
}
|
|
95
|
-
return
|
|
96
|
-
}
|
|
97
|
-
function O(o) {
|
|
98
|
-
return I(o).component || "TtApiComponent";
|
|
95
|
+
return t;
|
|
99
96
|
}
|
|
100
97
|
function S(o) {
|
|
98
|
+
return I(o).component || (o === "platformId" || o === "shopId" || o === "purchasePlaceId" ? "TtPanelSelect" : "TtApiComponent");
|
|
99
|
+
}
|
|
100
|
+
function O(o) {
|
|
101
101
|
return I(o).multiple ?? !0;
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function N(o) {
|
|
104
104
|
return g.value[o] || [];
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
|
|
106
|
+
function G(o) {
|
|
107
|
+
const e = /* @__PURE__ */ new Map();
|
|
108
|
+
return o.forEach((n) => {
|
|
109
|
+
const t = n.purchaseInfo, l = t == null ? void 0 : t.supplierSubType;
|
|
110
|
+
if (l == null) return;
|
|
111
|
+
let s = e.get(l);
|
|
112
|
+
s || (s = {
|
|
113
|
+
label: String(l),
|
|
114
|
+
value: l,
|
|
115
|
+
children: []
|
|
116
|
+
}, e.set(l, s)), s.children.push(n);
|
|
117
|
+
}), Array.from(e.values());
|
|
108
118
|
}
|
|
109
|
-
function
|
|
110
|
-
const
|
|
111
|
-
return
|
|
119
|
+
function J(o) {
|
|
120
|
+
const e = /* @__PURE__ */ new Map();
|
|
121
|
+
return o.forEach((n) => {
|
|
122
|
+
const t = n.platformId;
|
|
123
|
+
if (t == null) return;
|
|
124
|
+
let l = e.get(t);
|
|
125
|
+
l || (l = {
|
|
126
|
+
label: String(n.platformName ?? n.platformId),
|
|
127
|
+
value: t,
|
|
128
|
+
children: []
|
|
129
|
+
}, e.set(t, l)), l.children.push(n);
|
|
130
|
+
}), Array.from(e.values());
|
|
131
|
+
}
|
|
132
|
+
function D(o) {
|
|
133
|
+
return o.flatMap((e) => {
|
|
134
|
+
const n = e.children;
|
|
135
|
+
return n != null && n.length ? D(n) : [e];
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
function K(o, e) {
|
|
139
|
+
return F(o).some((n) => n === e || U(n));
|
|
140
|
+
}
|
|
141
|
+
function L(o) {
|
|
142
|
+
const e = K(o, b("platformId")), n = Array.isArray(o) ? o.length > 1 : !1;
|
|
143
|
+
return c === "action" && (e || n);
|
|
112
144
|
}
|
|
113
|
-
function
|
|
114
|
-
const
|
|
115
|
-
if (!
|
|
116
|
-
return c === "action" ? [] :
|
|
117
|
-
if (
|
|
118
|
-
const
|
|
119
|
-
return !
|
|
145
|
+
function Q(o) {
|
|
146
|
+
const e = N("shopId"), n = F(o);
|
|
147
|
+
if (!n.length)
|
|
148
|
+
return c === "action" ? [] : e;
|
|
149
|
+
if (L(o)) return [];
|
|
150
|
+
const t = e.filter((s) => n.includes(s.platformId));
|
|
151
|
+
return !t.some((s) => s.value === b("shopId") || U(s.value)) || t.length <= 1 ? t : T(t.filter((s) => s.value !== b("shopId") && !U(s.value)));
|
|
120
152
|
}
|
|
121
|
-
function
|
|
122
|
-
const
|
|
123
|
-
var
|
|
124
|
-
return (
|
|
125
|
-
}) || [] :
|
|
153
|
+
function x(o, e, n, t, l) {
|
|
154
|
+
const s = f(o), P = l ? t.filter((i) => {
|
|
155
|
+
var d;
|
|
156
|
+
return (d = e[s]) == null ? void 0 : d.includes(i.value);
|
|
157
|
+
}) || [] : t.find((i) => i.value === e[s]);
|
|
126
158
|
return {
|
|
127
|
-
values:
|
|
128
|
-
actions:
|
|
129
|
-
fieldName:
|
|
159
|
+
values: e,
|
|
160
|
+
actions: n,
|
|
161
|
+
fieldName: s,
|
|
130
162
|
dataType: o,
|
|
131
|
-
options:
|
|
163
|
+
options: t,
|
|
132
164
|
currentOption: P
|
|
133
165
|
};
|
|
134
166
|
}
|
|
135
|
-
function
|
|
136
|
-
const
|
|
137
|
-
return
|
|
167
|
+
function k(o, e, n, t, l) {
|
|
168
|
+
const s = I(o), P = oo(s.componentProps, e, n, t), i = O(o), { onChange: d, ...h } = P, m = q(s.customOptions) ? s.customOptions(e, t) : t, p = S(o) === "TtPanelSelect", a = p && o === "shopId" ? J(m) : p && o === "purchasePlaceId" ? G(m) : m, w = p ? D(a) : m;
|
|
169
|
+
return p ? {
|
|
138
170
|
multiple: i,
|
|
139
|
-
showAll:
|
|
171
|
+
showAll: s.showAll ?? !0,
|
|
140
172
|
showAllField: b(o),
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
173
|
+
showNav: o !== "platformId" && o !== "purchasePlaceId",
|
|
174
|
+
showOriginMode: o === "platformId",
|
|
175
|
+
showPinyinMode: o !== "shopId" && o !== "purchasePlaceId",
|
|
176
|
+
...h,
|
|
177
|
+
options: a,
|
|
178
|
+
onChange(R) {
|
|
179
|
+
const X = e[f(o)];
|
|
180
|
+
j(
|
|
181
|
+
X,
|
|
182
|
+
l,
|
|
183
|
+
s.onChange,
|
|
184
|
+
() => x(o, e, n, w, i)
|
|
149
185
|
);
|
|
150
186
|
}
|
|
151
187
|
} : {
|
|
152
188
|
multiple: i,
|
|
153
|
-
component:
|
|
189
|
+
component: Z,
|
|
154
190
|
showOriginMode: !1,
|
|
155
191
|
showPinyinMode: !0,
|
|
156
|
-
...
|
|
157
|
-
options:
|
|
158
|
-
onChange(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
() =>
|
|
192
|
+
...h,
|
|
193
|
+
options: m,
|
|
194
|
+
onChange(R) {
|
|
195
|
+
j(
|
|
196
|
+
R,
|
|
197
|
+
l,
|
|
198
|
+
s.onChange,
|
|
199
|
+
() => x(o, e, n, w, i)
|
|
164
200
|
);
|
|
165
201
|
}
|
|
166
202
|
};
|
|
167
203
|
}
|
|
168
|
-
function
|
|
169
|
-
const
|
|
204
|
+
function V(o) {
|
|
205
|
+
const e = f(o);
|
|
170
206
|
return {
|
|
171
|
-
component:
|
|
172
|
-
fieldName:
|
|
173
|
-
label:
|
|
207
|
+
component: S(o),
|
|
208
|
+
fieldName: e,
|
|
209
|
+
label: M(o),
|
|
174
210
|
rules: C(o),
|
|
175
|
-
dependencies:
|
|
176
|
-
componentProps: (
|
|
177
|
-
var
|
|
178
|
-
const
|
|
179
|
-
return
|
|
180
|
-
|
|
181
|
-
|
|
211
|
+
dependencies: _(o),
|
|
212
|
+
componentProps: (n, t) => {
|
|
213
|
+
var h;
|
|
214
|
+
const l = N(o), s = f(o), P = O(o), i = b(o), d = ((h = n[s]) == null ? void 0 : h.at(-1)) !== i;
|
|
215
|
+
return k(o, n, t, l, (m) => {
|
|
216
|
+
if (S(o) !== "TtPanelSelect") {
|
|
217
|
+
const p = n[s];
|
|
218
|
+
P && (d && F(m).at(-1) === i ? n[s] = [i] : n[s] = p == null ? void 0 : p.filter((a) => a !== i));
|
|
219
|
+
}
|
|
182
220
|
});
|
|
183
221
|
}
|
|
184
222
|
};
|
|
185
223
|
}
|
|
186
|
-
const
|
|
224
|
+
const B = {
|
|
187
225
|
// 平台
|
|
188
226
|
platformId: {
|
|
189
|
-
component:
|
|
190
|
-
fieldName:
|
|
191
|
-
label:
|
|
227
|
+
component: S("platformId"),
|
|
228
|
+
fieldName: f("platformId"),
|
|
229
|
+
label: M("platformId"),
|
|
192
230
|
rules: C("platformId"),
|
|
193
|
-
componentProps: (o,
|
|
194
|
-
var
|
|
195
|
-
const
|
|
196
|
-
return
|
|
197
|
-
|
|
198
|
-
|
|
231
|
+
componentProps: (o, e) => {
|
|
232
|
+
var m;
|
|
233
|
+
const n = "platformId", t = f(n), l = f("shopId"), s = O(n), P = O("shopId"), i = N(n), d = b(n), h = ((m = o[t]) == null ? void 0 : m.at(-1)) !== d;
|
|
234
|
+
return k(n, o, e, i, (p) => {
|
|
235
|
+
if (S(n) !== "TtPanelSelect") {
|
|
236
|
+
const a = o[t];
|
|
237
|
+
s && (h && F(p).at(-1) === d ? o[t] = [d] : o[t] = a == null ? void 0 : a.filter((w) => w !== d));
|
|
238
|
+
}
|
|
239
|
+
o[l] = P ? [] : void 0;
|
|
199
240
|
});
|
|
200
241
|
}
|
|
201
242
|
},
|
|
202
243
|
// 店铺
|
|
203
244
|
shopId: {
|
|
204
|
-
component:
|
|
205
|
-
fieldName:
|
|
206
|
-
label:
|
|
207
|
-
componentProps: (o,
|
|
208
|
-
var
|
|
209
|
-
const
|
|
210
|
-
return
|
|
211
|
-
|
|
212
|
-
|
|
245
|
+
component: S("shopId"),
|
|
246
|
+
fieldName: f("shopId"),
|
|
247
|
+
label: M("shopId"),
|
|
248
|
+
componentProps: (o, e) => {
|
|
249
|
+
var h;
|
|
250
|
+
const n = "shopId", t = f(n), l = o[f("platformId")], s = Q(l), P = O(n), i = b(n), d = ((h = o[t]) == null ? void 0 : h.at(-1)) !== i;
|
|
251
|
+
return k(n, o, e, s, (m) => {
|
|
252
|
+
if (S(n) !== "TtPanelSelect") {
|
|
253
|
+
const p = o[t];
|
|
254
|
+
P && (d && F(m).at(-1) === i ? o[t] = [i] : o[t] = p == null ? void 0 : p.filter((a) => a !== i));
|
|
255
|
+
}
|
|
213
256
|
});
|
|
214
257
|
},
|
|
215
|
-
dependencies:
|
|
216
|
-
triggerFields: [
|
|
258
|
+
dependencies: _("shopId", {
|
|
259
|
+
triggerFields: [f("platformId")],
|
|
217
260
|
disabled(o) {
|
|
218
|
-
return
|
|
261
|
+
return L(o[f("platformId")]);
|
|
219
262
|
},
|
|
220
263
|
rules(o) {
|
|
221
|
-
return
|
|
264
|
+
return L(o[f("platformId")]) ? null : C("shopId") || null;
|
|
222
265
|
}
|
|
223
266
|
})
|
|
224
267
|
},
|
|
225
|
-
purchasePlaceId:
|
|
226
|
-
businessType:
|
|
227
|
-
lockUserId:
|
|
268
|
+
purchasePlaceId: V("purchasePlaceId"),
|
|
269
|
+
businessType: V("businessType"),
|
|
270
|
+
lockUserId: V("lockUserId")
|
|
228
271
|
};
|
|
229
|
-
function
|
|
230
|
-
return Object.keys(
|
|
231
|
-
(o,
|
|
232
|
-
var
|
|
233
|
-
const
|
|
234
|
-
return o[
|
|
235
|
-
...
|
|
236
|
-
|
|
272
|
+
function W() {
|
|
273
|
+
return Object.keys(B).reduce(
|
|
274
|
+
(o, e) => {
|
|
275
|
+
var l;
|
|
276
|
+
const n = B[e], t = (l = r.fieldConfigs) == null ? void 0 : l[e];
|
|
277
|
+
return o[e] = {
|
|
278
|
+
...n,
|
|
279
|
+
...$(t, ["componentProps", "rules"])
|
|
237
280
|
}, o;
|
|
238
281
|
},
|
|
239
282
|
{}
|
|
240
283
|
);
|
|
241
284
|
}
|
|
242
285
|
return {
|
|
243
|
-
...
|
|
286
|
+
...W(),
|
|
244
287
|
dataSource: g
|
|
245
288
|
};
|
|
246
289
|
}
|
|
247
|
-
function
|
|
248
|
-
const
|
|
290
|
+
function Po() {
|
|
291
|
+
const r = {
|
|
249
292
|
options: {},
|
|
250
|
-
codes: [...
|
|
251
|
-
},
|
|
293
|
+
codes: [...z]
|
|
294
|
+
}, u = {
|
|
252
295
|
/**
|
|
253
296
|
* @description 渲染查询场景
|
|
254
297
|
*/
|
|
255
298
|
list() {
|
|
256
|
-
return
|
|
299
|
+
return r.options.scene = "list", u;
|
|
257
300
|
},
|
|
258
301
|
/**
|
|
259
302
|
* @description 渲染新增编辑场景
|
|
260
303
|
*/
|
|
261
304
|
action() {
|
|
262
|
-
return
|
|
305
|
+
return r.options.scene = "action", u;
|
|
263
306
|
},
|
|
264
307
|
/**
|
|
265
308
|
* @param scene 场景值 list为查询 action为新增编辑等操作
|
|
266
309
|
* @returns FormSchemasLinkBuilder
|
|
267
310
|
*/
|
|
268
311
|
scene(c) {
|
|
269
|
-
return
|
|
312
|
+
return r.options.scene = c, u;
|
|
270
313
|
},
|
|
271
314
|
/**
|
|
272
315
|
* @param codes 接口请求所需要的入参,需要什么数据源就传什么入参
|
|
273
316
|
* @returns FormSchemasLinkBuilder
|
|
274
317
|
*/
|
|
275
318
|
codes(c) {
|
|
276
|
-
return
|
|
319
|
+
return r.codes = [...c], u;
|
|
277
320
|
},
|
|
278
321
|
dataSource(c) {
|
|
279
|
-
return
|
|
322
|
+
return r.options.dataSource = c, u;
|
|
280
323
|
},
|
|
281
324
|
field(c, A) {
|
|
282
325
|
var g;
|
|
283
|
-
return
|
|
284
|
-
...
|
|
326
|
+
return r.options.fieldConfigs = {
|
|
327
|
+
...r.options.fieldConfigs,
|
|
285
328
|
[c]: {
|
|
286
|
-
...((g =
|
|
329
|
+
...((g = r.options.fieldConfigs) == null ? void 0 : g[c]) || {},
|
|
287
330
|
...A
|
|
288
331
|
}
|
|
289
|
-
},
|
|
332
|
+
}, u;
|
|
290
333
|
},
|
|
291
334
|
build() {
|
|
292
|
-
return
|
|
335
|
+
return no(r.options, r.codes);
|
|
293
336
|
}
|
|
294
337
|
};
|
|
295
|
-
return
|
|
338
|
+
return u;
|
|
296
339
|
}
|
|
297
340
|
export {
|
|
298
|
-
|
|
341
|
+
Po as useFormSchemasLink
|
|
299
342
|
};
|