@dazhicheng/ui 1.6.27 → 1.6.29
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/oss.d.ts +10 -0
- package/dist/api/oss.js +26 -0
- package/dist/components/tt-upload/index.d.ts +38 -23
- package/dist/components/tt-upload/src/TtUpload.vue.d.ts +19 -10
- package/dist/components/tt-upload/src/TtUpload.vue.js +185 -169
- package/dist/components/tt-upload/src/typing.d.ts +33 -2
- package/dist/components/tt-upload/src/typing.js +5 -0
- package/dist/components/types.d.ts +6 -4
- package/dist/hooks/useFormSchemasLink.d.ts +46 -8
- package/dist/hooks/useFormSchemasLink.js +269 -198
- package/dist/hooks/useScreenshotOss.d.ts +5 -3
- package/dist/hooks/useScreenshotOss.js +57 -48
- package/dist/hooks/useSetup.js +16 -13
- package/dist/index.d.ts +1 -0
- package/dist/index.js +102 -98
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useDataPermissionOptions as
|
|
1
|
+
import { useDataPermissionOptions as ee } from "./useDataPermissionOptions.js";
|
|
2
2
|
import "axios";
|
|
3
|
-
import { ElSelectV2 as
|
|
4
|
-
import { isFunction as
|
|
3
|
+
import { ElSelectV2 as ne } from "element-plus";
|
|
4
|
+
import { isArray as S, isFunction as K, isString as te } from "../packages/utils/src/is.js";
|
|
5
5
|
import "vue";
|
|
6
6
|
import "dayjs";
|
|
7
7
|
import "numeral";
|
|
@@ -13,338 +13,409 @@ import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
|
13
13
|
import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
14
14
|
import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
15
15
|
import "../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
16
|
-
import { omit as
|
|
17
|
-
const
|
|
16
|
+
import { get as d, omit as oe, set as P } from "lodash-es";
|
|
17
|
+
const D = "all", re = { label: "全部", value: D }, Q = [
|
|
18
18
|
"platformId",
|
|
19
19
|
"shopId",
|
|
20
20
|
"purchasePlaceId",
|
|
21
21
|
"businessType",
|
|
22
22
|
"lockUserId",
|
|
23
23
|
"userId"
|
|
24
|
-
],
|
|
24
|
+
], se = {
|
|
25
25
|
platformId: "platformIds",
|
|
26
26
|
shopId: "shopIds",
|
|
27
27
|
purchasePlaceId: "purchasePlaceId",
|
|
28
28
|
businessType: "businessType",
|
|
29
29
|
lockUserId: "lockUserId"
|
|
30
|
-
},
|
|
30
|
+
}, le = {
|
|
31
31
|
platformId: "平台",
|
|
32
32
|
shopId: "店铺",
|
|
33
33
|
purchasePlaceId: "采购地",
|
|
34
34
|
businessType: "业务线",
|
|
35
35
|
lockUserId: "锁单人"
|
|
36
36
|
};
|
|
37
|
-
function
|
|
38
|
-
return
|
|
37
|
+
function ie(r, i) {
|
|
38
|
+
return i ? r ? `${r}.${i}` : i : "";
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
return
|
|
40
|
+
function x(r) {
|
|
41
|
+
return te(r) && r.toLowerCase() === D.toLowerCase();
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
return [
|
|
43
|
+
function V(r) {
|
|
44
|
+
return S(r) ? r : r == null || r === "" ? [] : [r];
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
return
|
|
46
|
+
function ce(r = []) {
|
|
47
|
+
return [re].concat(r);
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
51
|
-
u == null || u(r);
|
|
52
|
-
const I = A(), f = (b = I.values) == null ? void 0 : b[I.fieldName];
|
|
53
|
-
c == null || c(f, I);
|
|
49
|
+
function ue(r, i, c, m) {
|
|
50
|
+
return r ? K(r) ? r(i, c, m) : r : {};
|
|
54
51
|
}
|
|
55
|
-
function
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
52
|
+
function J(r, i, c, m) {
|
|
53
|
+
i == null || i(r);
|
|
54
|
+
const b = m(), N = d(b.values, b.fieldName);
|
|
55
|
+
c == null || c(N, b);
|
|
56
|
+
}
|
|
57
|
+
function W(r = {}, i = Q, c) {
|
|
58
|
+
const m = r.scene || "list", b = i.reduce(
|
|
59
|
+
(e, t) => {
|
|
60
|
+
if (t === "userId") return e;
|
|
61
|
+
const n = I(t), o = O(t) === "TtPanelSelect";
|
|
62
|
+
return e[t] = o ? !1 : n.showAll ?? !1, e;
|
|
61
63
|
},
|
|
62
64
|
{}
|
|
63
|
-
), { dataSource:
|
|
64
|
-
codes:
|
|
65
|
+
), { dataSource: N } = c ? { dataSource: c } : ee({
|
|
66
|
+
codes: i,
|
|
65
67
|
dataSource: r.dataSource,
|
|
66
|
-
showAll:
|
|
68
|
+
showAll: b
|
|
67
69
|
});
|
|
68
|
-
function
|
|
69
|
-
|
|
70
|
+
function p(e, t = r.basePath) {
|
|
71
|
+
const n = I(e).fieldName || se[e];
|
|
72
|
+
return ie(t, n);
|
|
70
73
|
}
|
|
71
|
-
function
|
|
72
|
-
return
|
|
74
|
+
function E(e) {
|
|
75
|
+
return I(e).rules;
|
|
73
76
|
}
|
|
74
|
-
function
|
|
75
|
-
return
|
|
77
|
+
function U(e) {
|
|
78
|
+
return I(e).label || le[e];
|
|
76
79
|
}
|
|
77
|
-
function
|
|
78
|
-
var
|
|
79
|
-
return ((
|
|
80
|
+
function I(e) {
|
|
81
|
+
var t;
|
|
82
|
+
return ((t = r.fieldConfigs) == null ? void 0 : t[e]) || {};
|
|
80
83
|
}
|
|
81
|
-
function
|
|
82
|
-
return
|
|
84
|
+
function C(e) {
|
|
85
|
+
return I(e).showAllField ?? D;
|
|
83
86
|
}
|
|
84
|
-
function
|
|
85
|
-
const n =
|
|
86
|
-
if (!
|
|
87
|
-
if (!n) return
|
|
88
|
-
const
|
|
89
|
-
...
|
|
87
|
+
function $(e, t) {
|
|
88
|
+
const n = I(e).dependencies;
|
|
89
|
+
if (!t) return n;
|
|
90
|
+
if (!n) return t;
|
|
91
|
+
const o = {
|
|
92
|
+
...t,
|
|
90
93
|
...n
|
|
91
94
|
};
|
|
92
|
-
if (
|
|
93
|
-
const l =
|
|
94
|
-
|
|
95
|
+
if (t && n) {
|
|
96
|
+
const l = t.triggerFields, s = n.triggerFields;
|
|
97
|
+
o.triggerFields = s ?? l;
|
|
95
98
|
}
|
|
96
|
-
return
|
|
99
|
+
return o;
|
|
97
100
|
}
|
|
98
|
-
function
|
|
99
|
-
return
|
|
101
|
+
function O(e) {
|
|
102
|
+
return I(e).component || (e === "platformId" || e === "shopId" || e === "purchasePlaceId" ? "TtPanelSelect" : "TtApiComponent");
|
|
100
103
|
}
|
|
101
|
-
function
|
|
102
|
-
return
|
|
104
|
+
function M(e) {
|
|
105
|
+
return I(e).multiple ?? !0;
|
|
103
106
|
}
|
|
104
|
-
function
|
|
105
|
-
return
|
|
107
|
+
function R(e) {
|
|
108
|
+
return N.value[e] || [];
|
|
106
109
|
}
|
|
107
|
-
function
|
|
108
|
-
const
|
|
109
|
-
return
|
|
110
|
-
const
|
|
111
|
-
let s =
|
|
110
|
+
function X(e) {
|
|
111
|
+
const t = /* @__PURE__ */ new Map();
|
|
112
|
+
return e.forEach((n) => {
|
|
113
|
+
const o = n.purchaseInfo, l = (o == null ? void 0 : o.supplierSubType) ?? "其他";
|
|
114
|
+
let s = t.get(l);
|
|
112
115
|
s || (s = {
|
|
113
116
|
label: String(l),
|
|
114
117
|
value: l,
|
|
115
118
|
children: []
|
|
116
|
-
},
|
|
117
|
-
}), Array.from(
|
|
119
|
+
}, t.set(l, s)), s.children.push(n);
|
|
120
|
+
}), Array.from(t.values());
|
|
118
121
|
}
|
|
119
|
-
function
|
|
120
|
-
const
|
|
121
|
-
return
|
|
122
|
-
const
|
|
123
|
-
if (
|
|
124
|
-
let l =
|
|
122
|
+
function Y(e) {
|
|
123
|
+
const t = /* @__PURE__ */ new Map();
|
|
124
|
+
return e.forEach((n) => {
|
|
125
|
+
const o = n.platformId;
|
|
126
|
+
if (o == null) return;
|
|
127
|
+
let l = t.get(o);
|
|
125
128
|
l || (l = {
|
|
126
129
|
label: String(n.platformName ?? n.platformId),
|
|
127
|
-
value:
|
|
130
|
+
value: o,
|
|
128
131
|
children: []
|
|
129
|
-
},
|
|
130
|
-
}), Array.from(
|
|
132
|
+
}, t.set(o, l)), l.children.push(n);
|
|
133
|
+
}), Array.from(t.values());
|
|
131
134
|
}
|
|
132
|
-
function
|
|
133
|
-
return
|
|
134
|
-
const n =
|
|
135
|
-
return n != null && n.length ?
|
|
135
|
+
function q(e) {
|
|
136
|
+
return e.flatMap((t) => {
|
|
137
|
+
const n = t.children;
|
|
138
|
+
return n != null && n.length ? q(n) : [t];
|
|
136
139
|
});
|
|
137
140
|
}
|
|
138
|
-
function
|
|
139
|
-
return
|
|
141
|
+
function Z(e, t) {
|
|
142
|
+
return V(e).some((n) => n === t || x(n));
|
|
140
143
|
}
|
|
141
|
-
function
|
|
142
|
-
const n =
|
|
143
|
-
if (
|
|
144
|
-
|
|
144
|
+
function H(e, t) {
|
|
145
|
+
const n = p("shopId"), o = M("shopId"), l = C("shopId");
|
|
146
|
+
if (m === "action" && L(t)) {
|
|
147
|
+
P(e, n, o ? [l] : l);
|
|
145
148
|
return;
|
|
146
149
|
}
|
|
147
|
-
|
|
150
|
+
P(e, n, o ? [] : void 0);
|
|
148
151
|
}
|
|
149
|
-
function
|
|
150
|
-
const
|
|
151
|
-
return
|
|
152
|
+
function L(e) {
|
|
153
|
+
const t = Z(e, C("platformId")), n = S(e) ? e.length > 1 : !1;
|
|
154
|
+
return m === "action" && (t || n);
|
|
152
155
|
}
|
|
153
|
-
function
|
|
154
|
-
const
|
|
156
|
+
function v(e) {
|
|
157
|
+
const t = R("shopId"), n = V(e);
|
|
155
158
|
if (!n.length)
|
|
156
|
-
return
|
|
157
|
-
if (
|
|
158
|
-
const
|
|
159
|
-
return !
|
|
159
|
+
return m === "action" ? [] : t;
|
|
160
|
+
if (L(e)) return [];
|
|
161
|
+
const o = t.filter((s) => n.includes(s.platformId));
|
|
162
|
+
return !o.some((s) => s.value === C("shopId") || x(s.value)) || o.length <= 1 ? o : ce(o.filter((s) => s.value !== C("shopId") && !x(s.value)));
|
|
160
163
|
}
|
|
161
|
-
function
|
|
162
|
-
const s =
|
|
163
|
-
var h;
|
|
164
|
-
return (h = e[s]) == null ? void 0 : h.includes(i.value);
|
|
165
|
-
}) || [] : t.find((i) => i.value === e[s]);
|
|
164
|
+
function z(e, t, n, o, l) {
|
|
165
|
+
const s = p(e), f = d(t, s), u = l ? o.filter((h) => S(f) && f.includes(h.value)) : o.find((h) => h.value === f);
|
|
166
166
|
return {
|
|
167
|
-
values:
|
|
167
|
+
values: t,
|
|
168
168
|
actions: n,
|
|
169
169
|
fieldName: s,
|
|
170
|
-
dataType:
|
|
171
|
-
options:
|
|
172
|
-
currentOption:
|
|
170
|
+
dataType: e,
|
|
171
|
+
options: o,
|
|
172
|
+
currentOption: u
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
|
-
function
|
|
176
|
-
const s =
|
|
177
|
-
return
|
|
178
|
-
multiple:
|
|
179
|
-
showAll: s.showAll ?? (
|
|
180
|
-
showAllField:
|
|
181
|
-
showNav:
|
|
182
|
-
showOriginMode:
|
|
183
|
-
showPinyinMode:
|
|
184
|
-
...
|
|
185
|
-
options:
|
|
186
|
-
onChange(
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
175
|
+
function j(e, t, n, o, l) {
|
|
176
|
+
const s = I(e), f = ue(s.componentProps, t, n, o), u = M(e), { onChange: h, ...A } = f, a = K(s.customOptions) ? s.customOptions(t, o) : o, g = O(e) === "TtPanelSelect", F = g && e === "shopId" ? Y(a) : g && e === "purchasePlaceId" ? X(a) : a, w = g ? q(F) : a;
|
|
177
|
+
return g ? {
|
|
178
|
+
multiple: u,
|
|
179
|
+
showAll: s.showAll ?? (e === "shopId" && m === "action" ? V(d(t, p("platformId"))).length > 0 : !0),
|
|
180
|
+
showAllField: C(e),
|
|
181
|
+
showNav: e !== "platformId" && e !== "purchasePlaceId",
|
|
182
|
+
showOriginMode: e === "platformId",
|
|
183
|
+
showPinyinMode: e !== "shopId" && e !== "purchasePlaceId",
|
|
184
|
+
...A,
|
|
185
|
+
options: F,
|
|
186
|
+
onChange(k) {
|
|
187
|
+
const G = k !== void 0 ? k : d(t, p(e));
|
|
188
|
+
P(t, p(e), G), J(
|
|
189
|
+
G,
|
|
190
190
|
l,
|
|
191
191
|
s.onChange,
|
|
192
|
-
() =>
|
|
192
|
+
() => z(e, t, n, w, u)
|
|
193
193
|
);
|
|
194
194
|
}
|
|
195
195
|
} : {
|
|
196
|
-
multiple:
|
|
197
|
-
component:
|
|
196
|
+
multiple: u,
|
|
197
|
+
component: ne,
|
|
198
198
|
showOriginMode: !1,
|
|
199
199
|
showPinyinMode: !0,
|
|
200
|
-
...
|
|
201
|
-
options:
|
|
202
|
-
onChange(
|
|
203
|
-
|
|
204
|
-
|
|
200
|
+
...A,
|
|
201
|
+
options: a,
|
|
202
|
+
onChange(k) {
|
|
203
|
+
J(
|
|
204
|
+
k,
|
|
205
205
|
l,
|
|
206
206
|
s.onChange,
|
|
207
|
-
() =>
|
|
207
|
+
() => z(e, t, n, w, u)
|
|
208
208
|
);
|
|
209
209
|
}
|
|
210
210
|
};
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
const
|
|
212
|
+
function B(e) {
|
|
213
|
+
const t = p(e);
|
|
214
214
|
return {
|
|
215
|
-
component:
|
|
216
|
-
fieldName:
|
|
217
|
-
label:
|
|
218
|
-
rules:
|
|
219
|
-
dependencies:
|
|
220
|
-
componentProps: (n,
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
215
|
+
component: O(e),
|
|
216
|
+
fieldName: t,
|
|
217
|
+
label: U(e),
|
|
218
|
+
rules: E(e),
|
|
219
|
+
dependencies: $(e),
|
|
220
|
+
componentProps: (n, o) => {
|
|
221
|
+
const l = R(e), s = p(e), f = M(e), u = C(e), h = d(n, s), A = S(h) ? h.at(-1) !== u : !0;
|
|
222
|
+
return j(e, n, o, l, (a) => {
|
|
223
|
+
if (O(e) !== "TtPanelSelect") {
|
|
224
|
+
const g = d(n, s);
|
|
225
|
+
if (f)
|
|
226
|
+
if (A && V(a).at(-1) === u)
|
|
227
|
+
P(n, s, [u]);
|
|
228
|
+
else {
|
|
229
|
+
const F = S(g) ? g.filter((w) => w !== u) : [];
|
|
230
|
+
P(n, s, F);
|
|
231
|
+
}
|
|
227
232
|
}
|
|
228
233
|
});
|
|
229
234
|
}
|
|
230
235
|
};
|
|
231
236
|
}
|
|
232
|
-
const
|
|
237
|
+
const _ = {
|
|
233
238
|
// 平台
|
|
234
239
|
platformId: {
|
|
235
|
-
component:
|
|
236
|
-
fieldName:
|
|
237
|
-
label:
|
|
238
|
-
rules:
|
|
239
|
-
componentProps: (
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
240
|
+
component: O("platformId"),
|
|
241
|
+
fieldName: p("platformId"),
|
|
242
|
+
label: U("platformId"),
|
|
243
|
+
rules: E("platformId"),
|
|
244
|
+
componentProps: (e, t) => {
|
|
245
|
+
const n = "platformId", o = p(n), l = M(n), s = R(n), f = C(n), u = d(e, o), h = S(u) ? u.at(-1) !== f : !0;
|
|
246
|
+
return j(n, e, t, s, (A) => {
|
|
247
|
+
if (O(n) !== "TtPanelSelect") {
|
|
248
|
+
const a = d(e, o);
|
|
249
|
+
if (l)
|
|
250
|
+
if (h && V(A).at(-1) === f)
|
|
251
|
+
P(e, o, [f]);
|
|
252
|
+
else {
|
|
253
|
+
const g = S(a) ? a.filter((F) => F !== f) : [];
|
|
254
|
+
P(e, o, g);
|
|
255
|
+
}
|
|
246
256
|
}
|
|
247
|
-
|
|
257
|
+
H(e, d(e, o));
|
|
248
258
|
});
|
|
249
259
|
}
|
|
250
260
|
},
|
|
251
261
|
// 店铺
|
|
252
262
|
shopId: {
|
|
253
|
-
component:
|
|
254
|
-
fieldName:
|
|
255
|
-
label:
|
|
256
|
-
componentProps: (
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
+
component: O("shopId"),
|
|
264
|
+
fieldName: p("shopId"),
|
|
265
|
+
label: U("shopId"),
|
|
266
|
+
componentProps: (e, t) => {
|
|
267
|
+
const n = "shopId", o = p(n), l = d(e, p("platformId")), s = v(l), f = M(n), u = C(n), h = d(e, o), A = S(h) ? h.at(-1) !== u : !0;
|
|
268
|
+
return j(n, e, t, s, (a) => {
|
|
269
|
+
if (O(n) !== "TtPanelSelect") {
|
|
270
|
+
const g = d(e, o);
|
|
271
|
+
if (f)
|
|
272
|
+
if (A && V(a).at(-1) === u)
|
|
273
|
+
P(e, o, [u]);
|
|
274
|
+
else {
|
|
275
|
+
const F = S(g) ? g.filter((w) => w !== u) : [];
|
|
276
|
+
P(e, o, F);
|
|
277
|
+
}
|
|
263
278
|
}
|
|
264
279
|
});
|
|
265
280
|
},
|
|
266
|
-
dependencies:
|
|
267
|
-
triggerFields: [
|
|
268
|
-
disabled(
|
|
269
|
-
return
|
|
281
|
+
dependencies: $("shopId", {
|
|
282
|
+
triggerFields: [p("platformId")],
|
|
283
|
+
disabled(e) {
|
|
284
|
+
return L(d(e, p("platformId")));
|
|
270
285
|
},
|
|
271
|
-
rules(
|
|
272
|
-
return
|
|
286
|
+
rules(e) {
|
|
287
|
+
return L(d(e, p("platformId"))) ? null : E("shopId") || null;
|
|
273
288
|
}
|
|
274
289
|
})
|
|
275
290
|
},
|
|
276
|
-
purchasePlaceId:
|
|
277
|
-
businessType:
|
|
278
|
-
lockUserId:
|
|
291
|
+
purchasePlaceId: B("purchasePlaceId"),
|
|
292
|
+
businessType: B("businessType"),
|
|
293
|
+
lockUserId: B("lockUserId")
|
|
279
294
|
};
|
|
280
|
-
function
|
|
281
|
-
return Object.keys(
|
|
282
|
-
(
|
|
295
|
+
function T() {
|
|
296
|
+
return Object.keys(_).reduce(
|
|
297
|
+
(e, t) => {
|
|
283
298
|
var l;
|
|
284
|
-
const n =
|
|
285
|
-
return
|
|
299
|
+
const n = _[t], o = (l = r.fieldConfigs) == null ? void 0 : l[t];
|
|
300
|
+
return e[t] = {
|
|
286
301
|
...n,
|
|
287
|
-
...
|
|
288
|
-
|
|
302
|
+
...oe(o, ["componentProps", "rules", "fieldName", "dependencies"]),
|
|
303
|
+
fieldName: n.fieldName
|
|
304
|
+
}, e;
|
|
305
|
+
},
|
|
306
|
+
{}
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
function y(e, t) {
|
|
310
|
+
const n = t ? {
|
|
311
|
+
...r.fieldConfigs,
|
|
312
|
+
...Object.fromEntries(
|
|
313
|
+
Object.entries(t).map(([l, s]) => {
|
|
314
|
+
var f;
|
|
315
|
+
return [
|
|
316
|
+
l,
|
|
317
|
+
{ ...((f = r.fieldConfigs) == null ? void 0 : f[l]) || {}, ...s }
|
|
318
|
+
];
|
|
319
|
+
})
|
|
320
|
+
)
|
|
321
|
+
} : r.fieldConfigs, o = W(
|
|
322
|
+
{
|
|
323
|
+
...r,
|
|
324
|
+
basePath: e,
|
|
325
|
+
fieldConfigs: n
|
|
289
326
|
},
|
|
327
|
+
i,
|
|
328
|
+
N
|
|
329
|
+
);
|
|
330
|
+
return Object.keys(_).reduce(
|
|
331
|
+
(l, s) => (l[s] = o[s], l),
|
|
290
332
|
{}
|
|
291
333
|
);
|
|
292
334
|
}
|
|
293
335
|
return {
|
|
294
|
-
...
|
|
295
|
-
dataSource:
|
|
336
|
+
...T(),
|
|
337
|
+
dataSource: N,
|
|
338
|
+
createRowSchemas: y
|
|
296
339
|
};
|
|
297
340
|
}
|
|
298
|
-
function
|
|
341
|
+
function Ve() {
|
|
299
342
|
const r = {
|
|
300
343
|
options: {},
|
|
301
|
-
codes: [...
|
|
302
|
-
},
|
|
344
|
+
codes: [...Q]
|
|
345
|
+
}, i = {
|
|
303
346
|
/**
|
|
304
347
|
* @description 渲染查询场景
|
|
305
348
|
*/
|
|
306
349
|
list() {
|
|
307
|
-
return r.options.scene = "list",
|
|
350
|
+
return r.options.scene = "list", i;
|
|
308
351
|
},
|
|
309
352
|
/**
|
|
310
353
|
* @description 渲染新增编辑场景
|
|
311
354
|
*/
|
|
312
355
|
action() {
|
|
313
|
-
return r.options.scene = "action",
|
|
356
|
+
return r.options.scene = "action", i;
|
|
314
357
|
},
|
|
315
358
|
/**
|
|
316
|
-
* @param scene
|
|
359
|
+
* @param scene - 场景值,list 为查询筛选,action 为新增编辑等操作
|
|
317
360
|
* @returns FormSchemasLinkBuilder
|
|
318
361
|
*/
|
|
319
362
|
scene(c) {
|
|
320
|
-
return r.options.scene = c,
|
|
363
|
+
return r.options.scene = c, i;
|
|
321
364
|
},
|
|
322
365
|
/**
|
|
323
|
-
* @param
|
|
366
|
+
* @param basePath - 字段路径前缀,例如 "items[0]" 或 "condition"
|
|
367
|
+
* @returns FormSchemasLinkBuilder
|
|
368
|
+
*/
|
|
369
|
+
basePath(c) {
|
|
370
|
+
return r.options.basePath = c, i;
|
|
371
|
+
},
|
|
372
|
+
/**
|
|
373
|
+
* @param codes - 接口请求所需要的数据权限维度 code 列表
|
|
324
374
|
* @returns FormSchemasLinkBuilder
|
|
325
375
|
*/
|
|
326
376
|
codes(c) {
|
|
327
|
-
return r.codes = [...c],
|
|
377
|
+
return r.codes = [...c], i;
|
|
328
378
|
},
|
|
379
|
+
/**
|
|
380
|
+
* @param dataSource - 外部自定义数据源
|
|
381
|
+
* @returns FormSchemasLinkBuilder
|
|
382
|
+
*/
|
|
329
383
|
dataSource(c) {
|
|
330
|
-
return r.options.dataSource = c,
|
|
384
|
+
return r.options.dataSource = c, i;
|
|
331
385
|
},
|
|
332
|
-
|
|
333
|
-
|
|
386
|
+
/**
|
|
387
|
+
* @param dataType - 待配置的数据类型维度
|
|
388
|
+
* @param config - 字段自定义配置
|
|
389
|
+
* @returns FormSchemasLinkBuilder
|
|
390
|
+
*/
|
|
391
|
+
field(c, m) {
|
|
392
|
+
var b;
|
|
334
393
|
return r.options.fieldConfigs = {
|
|
335
394
|
...r.options.fieldConfigs,
|
|
336
395
|
[c]: {
|
|
337
|
-
...((
|
|
338
|
-
...
|
|
396
|
+
...((b = r.options.fieldConfigs) == null ? void 0 : b[c]) || {},
|
|
397
|
+
...m
|
|
339
398
|
}
|
|
340
|
-
},
|
|
399
|
+
}, i;
|
|
341
400
|
},
|
|
401
|
+
/**
|
|
402
|
+
* @description 执行构建并返回字段 schema 映射及数据源
|
|
403
|
+
* @returns UseFormSchemasLinkResult
|
|
404
|
+
*/
|
|
342
405
|
build() {
|
|
343
|
-
return
|
|
406
|
+
return W(r.options, r.codes);
|
|
407
|
+
},
|
|
408
|
+
/**
|
|
409
|
+
* @param itemPath - 数组行路径(如 "tableData[0]")
|
|
410
|
+
* @param rowFieldConfigs - 可选,针对当前行的字段覆盖配置
|
|
411
|
+
* @returns 该行对应的表单 schema 映射
|
|
412
|
+
*/
|
|
413
|
+
createRowSchemas(c, m) {
|
|
414
|
+
return i.build().createRowSchemas(c, m);
|
|
344
415
|
}
|
|
345
416
|
};
|
|
346
|
-
return
|
|
417
|
+
return i;
|
|
347
418
|
}
|
|
348
419
|
export {
|
|
349
|
-
|
|
420
|
+
Ve as useFormSchemasLink
|
|
350
421
|
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { Component, VNode, MaybeRefOrGetter } from 'vue';
|
|
2
2
|
import { ComponentCaptureOptions, ElementScreenshotOptions, ScreenshotTarget } from '../../../hooks/src';
|
|
3
|
-
import {
|
|
3
|
+
import { OssType, UnifiedOssSignatureResult } from '../components/tt-upload/src/typing';
|
|
4
4
|
export interface ScreenshotOssOptions extends ElementScreenshotOptions {
|
|
5
|
+
/** 云存储类型,默认 huawei */
|
|
6
|
+
ossType?: OssType;
|
|
5
7
|
/** OSS 目录前缀,不传则使用签名接口返回的 dir 或 notice */
|
|
6
8
|
ossDir?: string;
|
|
7
9
|
/** 上传文件名,默认 screenshot-{timestamp}.png / .jpg */
|
|
8
10
|
fileName?: string;
|
|
9
|
-
/** 获取 OSS 签名,不传则使用全局 setup 的 uploadOssApi */
|
|
10
|
-
uploadOssApi?: (file
|
|
11
|
+
/** 获取 OSS 签名,不传则使用全局 setup 的 uploadOssApi 或默认华为云签名接口 */
|
|
12
|
+
uploadOssApi?: (file?: any) => Promise<UnifiedOssSignatureResult | any>;
|
|
11
13
|
}
|
|
12
14
|
export interface ScreenshotOssResult {
|
|
13
15
|
blob: Blob;
|