@dazhicheng/ui 1.6.26 → 1.6.28
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/basicDataCodes.js +21 -20
- package/dist/hooks/useDataPermissionOptions.d.ts +24 -11
- package/dist/hooks/useDataPermissionOptions.js +85 -128
- package/dist/hooks/useFormSchemasLink.d.ts +48 -12
- package/dist/hooks/useFormSchemasLink.js +258 -200
- package/dist/hooks/useScreenshotOss.d.ts +5 -3
- package/dist/hooks/useScreenshotOss.js +57 -48
- package/dist/hooks/useSetup.js +16 -13
- package/dist/hooks/userListCache.js +5 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +102 -98
- package/package.json +3 -3
|
@@ -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 oe } 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,396 @@ 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 ne, set as P } from "lodash-es";
|
|
17
|
+
const j = "all", re = { label: "全部", value: j }, 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 D(r) {
|
|
41
|
+
return te(r) && r.toLowerCase() === j.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, g) {
|
|
50
|
+
return r ? K(r) ? r(i, c, g) : r : {};
|
|
54
51
|
}
|
|
55
|
-
function
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
52
|
+
function J(r, i, c, g) {
|
|
53
|
+
i == null || i(r);
|
|
54
|
+
const b = g(), N = d(b.values, b.fieldName);
|
|
55
|
+
c == null || c(N, b);
|
|
56
|
+
}
|
|
57
|
+
function W(r = {}, i = Q, c) {
|
|
58
|
+
const g = r.scene || "list", b = i.reduce(
|
|
59
|
+
(e, t) => {
|
|
60
|
+
if (t === "userId") return e;
|
|
61
|
+
const o = I(t), n = F(t) === "TtPanelSelect";
|
|
62
|
+
return e[t] = n ? !1 : o.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 f(
|
|
69
|
-
|
|
70
|
+
function f(e, t = r.basePath) {
|
|
71
|
+
const o = I(e).fieldName || se[e];
|
|
72
|
+
return ie(t, o);
|
|
70
73
|
}
|
|
71
|
-
function
|
|
72
|
-
return
|
|
74
|
+
function U(e) {
|
|
75
|
+
return I(e).rules;
|
|
73
76
|
}
|
|
74
|
-
function
|
|
75
|
-
return
|
|
77
|
+
function E(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 A(e) {
|
|
85
|
+
return I(e).showAllField ?? j;
|
|
83
86
|
}
|
|
84
|
-
function
|
|
85
|
-
const
|
|
86
|
-
if (!
|
|
87
|
-
if (!
|
|
88
|
-
const
|
|
89
|
-
...
|
|
90
|
-
...
|
|
87
|
+
function $(e, t) {
|
|
88
|
+
const o = I(e).dependencies;
|
|
89
|
+
if (!t) return o;
|
|
90
|
+
if (!o) return t;
|
|
91
|
+
const n = {
|
|
92
|
+
...t,
|
|
93
|
+
...o
|
|
91
94
|
};
|
|
92
|
-
if (
|
|
93
|
-
const l =
|
|
94
|
-
|
|
95
|
+
if (t && o) {
|
|
96
|
+
const l = t.triggerFields, s = o.triggerFields;
|
|
97
|
+
n.triggerFields = s ?? l;
|
|
95
98
|
}
|
|
96
|
-
return
|
|
99
|
+
return n;
|
|
97
100
|
}
|
|
98
|
-
function
|
|
99
|
-
return
|
|
101
|
+
function F(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((o) => {
|
|
113
|
+
const n = o.purchaseInfo, l = (n == null ? void 0 : n.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(o);
|
|
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((o) => {
|
|
125
|
+
const n = o.platformId;
|
|
126
|
+
if (n == null) return;
|
|
127
|
+
let l = t.get(n);
|
|
125
128
|
l || (l = {
|
|
126
|
-
label: String(
|
|
127
|
-
value:
|
|
129
|
+
label: String(o.platformName ?? o.platformId),
|
|
130
|
+
value: n,
|
|
128
131
|
children: []
|
|
129
|
-
},
|
|
130
|
-
}), Array.from(
|
|
132
|
+
}, t.set(n, l)), l.children.push(o);
|
|
133
|
+
}), Array.from(t.values());
|
|
131
134
|
}
|
|
132
|
-
function
|
|
133
|
-
return
|
|
134
|
-
const
|
|
135
|
-
return
|
|
135
|
+
function q(e) {
|
|
136
|
+
return e.flatMap((t) => {
|
|
137
|
+
const o = t.children;
|
|
138
|
+
return o != null && o.length ? q(o) : [t];
|
|
136
139
|
});
|
|
137
140
|
}
|
|
138
|
-
function
|
|
139
|
-
return
|
|
141
|
+
function Z(e, t) {
|
|
142
|
+
return V(e).some((o) => o === t || D(o));
|
|
140
143
|
}
|
|
141
|
-
function
|
|
142
|
-
const
|
|
143
|
-
if (
|
|
144
|
-
o
|
|
144
|
+
function H(e, t) {
|
|
145
|
+
const o = f("shopId"), n = M("shopId"), l = A("shopId");
|
|
146
|
+
if (g === "action" && L(t)) {
|
|
147
|
+
P(e, o, n ? [l] : l);
|
|
145
148
|
return;
|
|
146
149
|
}
|
|
147
|
-
o
|
|
150
|
+
P(e, o, n ? [] : void 0);
|
|
148
151
|
}
|
|
149
|
-
function
|
|
150
|
-
const
|
|
151
|
-
return
|
|
152
|
+
function L(e) {
|
|
153
|
+
const t = Z(e, A("platformId")), o = S(e) ? e.length > 1 : !1;
|
|
154
|
+
return g === "action" && (t || o);
|
|
152
155
|
}
|
|
153
|
-
function
|
|
154
|
-
const
|
|
155
|
-
if (!
|
|
156
|
-
return
|
|
157
|
-
if (
|
|
158
|
-
const
|
|
159
|
-
return !
|
|
156
|
+
function v(e) {
|
|
157
|
+
const t = R("shopId"), o = V(e);
|
|
158
|
+
if (!o.length)
|
|
159
|
+
return g === "action" ? [] : t;
|
|
160
|
+
if (L(e)) return [];
|
|
161
|
+
const n = t.filter((s) => o.includes(s.platformId));
|
|
162
|
+
return !n.some((s) => s.value === A("shopId") || D(s.value)) || n.length <= 1 ? n : ce(n.filter((s) => s.value !== A("shopId") && !D(s.value)));
|
|
160
163
|
}
|
|
161
|
-
function
|
|
162
|
-
const s = f(
|
|
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, o, n, l) {
|
|
165
|
+
const s = f(e), p = d(t, s), u = l ? n.filter((m) => S(p) && p.includes(m.value)) : n.find((m) => m.value === p);
|
|
166
166
|
return {
|
|
167
|
-
values:
|
|
168
|
-
actions:
|
|
167
|
+
values: t,
|
|
168
|
+
actions: o,
|
|
169
169
|
fieldName: s,
|
|
170
|
-
dataType:
|
|
171
|
-
options:
|
|
172
|
-
currentOption:
|
|
170
|
+
dataType: e,
|
|
171
|
+
options: n,
|
|
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 B(e, t, o, n, l) {
|
|
176
|
+
const s = I(e), p = ue(s.componentProps, t, o, n), u = M(e), { onChange: m, ...O } = p, h = K(s.customOptions) ? s.customOptions(t, n) : n, a = F(e) === "TtPanelSelect", w = a && e === "shopId" ? Y(h) : a && e === "purchasePlaceId" ? X(h) : h, C = a ? q(w) : h;
|
|
177
|
+
return a ? {
|
|
178
|
+
multiple: u,
|
|
179
|
+
showAll: s.showAll ?? (e === "shopId" && g === "action" ? V(d(t, f("platformId"))).length > 0 : !0),
|
|
180
|
+
showAllField: A(e),
|
|
181
|
+
showNav: e !== "platformId" && e !== "purchasePlaceId",
|
|
182
|
+
showOriginMode: e === "platformId",
|
|
183
|
+
showPinyinMode: e !== "shopId" && e !== "purchasePlaceId",
|
|
184
|
+
...O,
|
|
185
|
+
options: w,
|
|
186
|
+
onChange(k) {
|
|
187
|
+
const G = k !== void 0 ? k : d(t, f(e));
|
|
188
|
+
P(t, f(e), G), J(
|
|
189
|
+
G,
|
|
190
190
|
l,
|
|
191
191
|
s.onChange,
|
|
192
|
-
() =>
|
|
192
|
+
() => z(e, t, o, C, u)
|
|
193
193
|
);
|
|
194
194
|
}
|
|
195
195
|
} : {
|
|
196
|
-
multiple:
|
|
197
|
-
component:
|
|
196
|
+
multiple: u,
|
|
197
|
+
component: oe,
|
|
198
198
|
showOriginMode: !1,
|
|
199
199
|
showPinyinMode: !0,
|
|
200
|
-
...
|
|
201
|
-
options:
|
|
202
|
-
onChange(
|
|
203
|
-
|
|
204
|
-
|
|
200
|
+
...O,
|
|
201
|
+
options: h,
|
|
202
|
+
onChange(k) {
|
|
203
|
+
J(
|
|
204
|
+
k,
|
|
205
205
|
l,
|
|
206
206
|
s.onChange,
|
|
207
|
-
() =>
|
|
207
|
+
() => z(e, t, o, C, u)
|
|
208
208
|
);
|
|
209
209
|
}
|
|
210
210
|
};
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
const
|
|
212
|
+
function _(e) {
|
|
213
|
+
const t = f(e);
|
|
214
214
|
return {
|
|
215
|
-
component:
|
|
216
|
-
fieldName:
|
|
217
|
-
label:
|
|
218
|
-
rules:
|
|
219
|
-
dependencies:
|
|
220
|
-
componentProps: (
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
215
|
+
component: F(e),
|
|
216
|
+
fieldName: t,
|
|
217
|
+
label: E(e),
|
|
218
|
+
rules: U(e),
|
|
219
|
+
dependencies: $(e),
|
|
220
|
+
componentProps: (o, n) => {
|
|
221
|
+
const l = R(e), s = f(e), p = M(e), u = A(e), m = d(o, s), O = S(m) ? m.at(-1) !== u : !0;
|
|
222
|
+
return B(e, o, n, l, (h) => {
|
|
223
|
+
if (F(e) !== "TtPanelSelect") {
|
|
224
|
+
const a = d(o, s);
|
|
225
|
+
if (p)
|
|
226
|
+
if (O && V(h).at(-1) === u)
|
|
227
|
+
P(o, s, [u]);
|
|
228
|
+
else {
|
|
229
|
+
const w = S(a) ? a.filter((C) => C !== u) : [];
|
|
230
|
+
P(o, s, w);
|
|
231
|
+
}
|
|
227
232
|
}
|
|
228
233
|
});
|
|
229
234
|
}
|
|
230
235
|
};
|
|
231
236
|
}
|
|
232
|
-
const
|
|
237
|
+
const x = {
|
|
233
238
|
// 平台
|
|
234
239
|
platformId: {
|
|
235
|
-
component:
|
|
240
|
+
component: F("platformId"),
|
|
236
241
|
fieldName: f("platformId"),
|
|
237
|
-
label:
|
|
238
|
-
rules:
|
|
239
|
-
componentProps: (
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
242
|
+
label: E("platformId"),
|
|
243
|
+
rules: U("platformId"),
|
|
244
|
+
componentProps: (e, t) => {
|
|
245
|
+
const o = "platformId", n = f(o), l = M(o), s = R(o), p = A(o), u = d(e, n), m = S(u) ? u.at(-1) !== p : !0;
|
|
246
|
+
return B(o, e, t, s, (O) => {
|
|
247
|
+
if (F(o) !== "TtPanelSelect") {
|
|
248
|
+
const h = d(e, n);
|
|
249
|
+
if (l)
|
|
250
|
+
if (m && V(O).at(-1) === p)
|
|
251
|
+
P(e, n, [p]);
|
|
252
|
+
else {
|
|
253
|
+
const a = S(h) ? h.filter((w) => w !== p) : [];
|
|
254
|
+
P(e, n, a);
|
|
255
|
+
}
|
|
246
256
|
}
|
|
247
|
-
|
|
257
|
+
H(e, d(e, n));
|
|
248
258
|
});
|
|
249
259
|
}
|
|
250
260
|
},
|
|
251
261
|
// 店铺
|
|
252
262
|
shopId: {
|
|
253
|
-
component:
|
|
263
|
+
component: F("shopId"),
|
|
254
264
|
fieldName: f("shopId"),
|
|
255
|
-
label:
|
|
256
|
-
componentProps: (
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
265
|
+
label: E("shopId"),
|
|
266
|
+
componentProps: (e, t) => {
|
|
267
|
+
const o = "shopId", n = f(o), l = d(e, f("platformId")), s = v(l), p = M(o), u = A(o), m = d(e, n), O = S(m) ? m.at(-1) !== u : !0;
|
|
268
|
+
return B(o, e, t, s, (h) => {
|
|
269
|
+
if (F(o) !== "TtPanelSelect") {
|
|
270
|
+
const a = d(e, n);
|
|
271
|
+
if (p)
|
|
272
|
+
if (O && V(h).at(-1) === u)
|
|
273
|
+
P(e, n, [u]);
|
|
274
|
+
else {
|
|
275
|
+
const w = S(a) ? a.filter((C) => C !== u) : [];
|
|
276
|
+
P(e, n, w);
|
|
277
|
+
}
|
|
263
278
|
}
|
|
264
279
|
});
|
|
265
280
|
},
|
|
266
|
-
dependencies:
|
|
281
|
+
dependencies: $("shopId", {
|
|
267
282
|
triggerFields: [f("platformId")],
|
|
268
|
-
disabled(
|
|
269
|
-
return
|
|
283
|
+
disabled(e) {
|
|
284
|
+
return L(d(e, f("platformId")));
|
|
270
285
|
},
|
|
271
|
-
rules(
|
|
272
|
-
return
|
|
286
|
+
rules(e) {
|
|
287
|
+
return L(d(e, f("platformId"))) ? null : U("shopId") || null;
|
|
273
288
|
}
|
|
274
289
|
})
|
|
275
290
|
},
|
|
276
|
-
purchasePlaceId:
|
|
277
|
-
businessType:
|
|
278
|
-
lockUserId:
|
|
291
|
+
purchasePlaceId: _("purchasePlaceId"),
|
|
292
|
+
businessType: _("businessType"),
|
|
293
|
+
lockUserId: _("lockUserId")
|
|
279
294
|
};
|
|
280
|
-
function
|
|
281
|
-
return Object.keys(
|
|
282
|
-
(
|
|
295
|
+
function T() {
|
|
296
|
+
return Object.keys(x).reduce(
|
|
297
|
+
(e, t) => {
|
|
283
298
|
var l;
|
|
284
|
-
const
|
|
285
|
-
return
|
|
286
|
-
...
|
|
287
|
-
...
|
|
288
|
-
|
|
299
|
+
const o = x[t], n = (l = r.fieldConfigs) == null ? void 0 : l[t];
|
|
300
|
+
return e[t] = {
|
|
301
|
+
...o,
|
|
302
|
+
...ne(n, ["componentProps", "rules", "fieldName"]),
|
|
303
|
+
fieldName: o.fieldName
|
|
304
|
+
}, e;
|
|
305
|
+
},
|
|
306
|
+
{}
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
function y(e) {
|
|
310
|
+
const t = W(
|
|
311
|
+
{
|
|
312
|
+
...r,
|
|
313
|
+
basePath: e
|
|
289
314
|
},
|
|
315
|
+
i,
|
|
316
|
+
N
|
|
317
|
+
);
|
|
318
|
+
return Object.keys(x).reduce(
|
|
319
|
+
(o, n) => (o[n] = t[n], o),
|
|
290
320
|
{}
|
|
291
321
|
);
|
|
292
322
|
}
|
|
293
323
|
return {
|
|
294
|
-
...
|
|
295
|
-
dataSource:
|
|
324
|
+
...T(),
|
|
325
|
+
dataSource: N,
|
|
326
|
+
createRowSchemas: y
|
|
296
327
|
};
|
|
297
328
|
}
|
|
298
|
-
function
|
|
329
|
+
function Ve() {
|
|
299
330
|
const r = {
|
|
300
331
|
options: {},
|
|
301
|
-
codes: [...
|
|
302
|
-
},
|
|
332
|
+
codes: [...Q]
|
|
333
|
+
}, i = {
|
|
303
334
|
/**
|
|
304
335
|
* @description 渲染查询场景
|
|
305
336
|
*/
|
|
306
337
|
list() {
|
|
307
|
-
return r.options.scene = "list",
|
|
338
|
+
return r.options.scene = "list", i;
|
|
308
339
|
},
|
|
309
340
|
/**
|
|
310
341
|
* @description 渲染新增编辑场景
|
|
311
342
|
*/
|
|
312
343
|
action() {
|
|
313
|
-
return r.options.scene = "action",
|
|
344
|
+
return r.options.scene = "action", i;
|
|
314
345
|
},
|
|
315
346
|
/**
|
|
316
|
-
* @param scene
|
|
347
|
+
* @param scene - 场景值,list 为查询筛选,action 为新增编辑等操作
|
|
317
348
|
* @returns FormSchemasLinkBuilder
|
|
318
349
|
*/
|
|
319
350
|
scene(c) {
|
|
320
|
-
return r.options.scene = c,
|
|
351
|
+
return r.options.scene = c, i;
|
|
321
352
|
},
|
|
322
353
|
/**
|
|
323
|
-
* @param
|
|
354
|
+
* @param basePath - 字段路径前缀,例如 "items[0]" 或 "condition"
|
|
355
|
+
* @returns FormSchemasLinkBuilder
|
|
356
|
+
*/
|
|
357
|
+
basePath(c) {
|
|
358
|
+
return r.options.basePath = c, i;
|
|
359
|
+
},
|
|
360
|
+
/**
|
|
361
|
+
* @param codes - 接口请求所需要的数据权限维度 code 列表
|
|
324
362
|
* @returns FormSchemasLinkBuilder
|
|
325
363
|
*/
|
|
326
364
|
codes(c) {
|
|
327
|
-
return r.codes = [...c],
|
|
365
|
+
return r.codes = [...c], i;
|
|
328
366
|
},
|
|
367
|
+
/**
|
|
368
|
+
* @param dataSource - 外部自定义数据源
|
|
369
|
+
* @returns FormSchemasLinkBuilder
|
|
370
|
+
*/
|
|
329
371
|
dataSource(c) {
|
|
330
|
-
return r.options.dataSource = c,
|
|
372
|
+
return r.options.dataSource = c, i;
|
|
331
373
|
},
|
|
332
|
-
|
|
333
|
-
|
|
374
|
+
/**
|
|
375
|
+
* @param dataType - 待配置的数据类型维度
|
|
376
|
+
* @param config - 字段自定义配置
|
|
377
|
+
* @returns FormSchemasLinkBuilder
|
|
378
|
+
*/
|
|
379
|
+
field(c, g) {
|
|
380
|
+
var b;
|
|
334
381
|
return r.options.fieldConfigs = {
|
|
335
382
|
...r.options.fieldConfigs,
|
|
336
383
|
[c]: {
|
|
337
|
-
...((
|
|
338
|
-
...
|
|
384
|
+
...((b = r.options.fieldConfigs) == null ? void 0 : b[c]) || {},
|
|
385
|
+
...g
|
|
339
386
|
}
|
|
340
|
-
},
|
|
387
|
+
}, i;
|
|
341
388
|
},
|
|
389
|
+
/**
|
|
390
|
+
* @description 执行构建并返回字段 schema 映射及数据源
|
|
391
|
+
* @returns UseFormSchemasLinkResult
|
|
392
|
+
*/
|
|
342
393
|
build() {
|
|
343
|
-
return
|
|
394
|
+
return W(r.options, r.codes);
|
|
395
|
+
},
|
|
396
|
+
/**
|
|
397
|
+
* @param itemPath - 数组行路径(如 "tableData[0]")
|
|
398
|
+
* @returns 该行对应的表单 schema 映射
|
|
399
|
+
*/
|
|
400
|
+
createRowSchemas(c) {
|
|
401
|
+
return i.build().createRowSchemas(c);
|
|
344
402
|
}
|
|
345
403
|
};
|
|
346
|
-
return
|
|
404
|
+
return i;
|
|
347
405
|
}
|
|
348
406
|
export {
|
|
349
|
-
|
|
407
|
+
Ve as useFormSchemasLink
|
|
350
408
|
};
|
|
@@ -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;
|