@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.
@@ -1,7 +1,7 @@
1
- import { useDataPermissionOptions as Z } from "./useDataPermissionOptions.js";
1
+ import { useDataPermissionOptions as ee } from "./useDataPermissionOptions.js";
2
2
  import "axios";
3
- import { ElSelectV2 as $ } from "element-plus";
4
- import { isFunction as q } from "../packages/utils/src/is.js";
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 v } from "lodash-es";
17
- const U = "all", H = { label: "全部", value: U }, z = [
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
- ], y = {
24
+ ], se = {
25
25
  platformId: "platformIds",
26
26
  shopId: "shopIds",
27
27
  purchasePlaceId: "purchasePlaceId",
28
28
  businessType: "businessType",
29
29
  lockUserId: "lockUserId"
30
- }, T = {
30
+ }, le = {
31
31
  platformId: "平台",
32
32
  shopId: "店铺",
33
33
  purchasePlaceId: "采购地",
34
34
  businessType: "业务线",
35
35
  lockUserId: "锁单人"
36
36
  };
37
- function k(r) {
38
- return typeof r == "string" && r.toLowerCase() === U.toLowerCase();
37
+ function ie(r, i) {
38
+ return i ? r ? `${r}.${i}` : i : "";
39
39
  }
40
- function O(r) {
41
- return Array.isArray(r) ? r : r == null || r === "" ? [] : [r];
40
+ function x(r) {
41
+ return te(r) && r.toLowerCase() === D.toLowerCase();
42
42
  }
43
- function oo(r = []) {
44
- return [H].concat(r);
43
+ function V(r) {
44
+ return S(r) ? r : r == null || r === "" ? [] : [r];
45
45
  }
46
- function no(r, u, c, A) {
47
- return r ? q(r) ? r(u, c, A) : r : {};
46
+ function ce(r = []) {
47
+ return [re].concat(r);
48
48
  }
49
- function j(r, u, c, A) {
50
- var b;
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 eo(r = {}, u = z) {
56
- const c = r.scene || "list", A = u.reduce(
57
- (o, e) => {
58
- if (e === "userId") return o;
59
- const n = g(e), t = S(e) === "TtPanelSelect";
60
- return o[e] = t ? !1 : n.showAll ?? !1, o;
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: I } = Z({
64
- codes: u,
65
+ ), { dataSource: N } = c ? { dataSource: c } : ee({
66
+ codes: i,
65
67
  dataSource: r.dataSource,
66
- showAll: A
68
+ showAll: b
67
69
  });
68
- function f(o) {
69
- return g(o).fieldName || y[o];
70
+ function p(e, t = r.basePath) {
71
+ const n = I(e).fieldName || se[e];
72
+ return ie(t, n);
70
73
  }
71
- function b(o) {
72
- return g(o).rules;
74
+ function E(e) {
75
+ return I(e).rules;
73
76
  }
74
- function M(o) {
75
- return g(o).label || T[o];
77
+ function U(e) {
78
+ return I(e).label || le[e];
76
79
  }
77
- function g(o) {
78
- var e;
79
- return ((e = r.fieldConfigs) == null ? void 0 : e[o]) || {};
80
+ function I(e) {
81
+ var t;
82
+ return ((t = r.fieldConfigs) == null ? void 0 : t[e]) || {};
80
83
  }
81
- function P(o) {
82
- return g(o).showAllField ?? U;
84
+ function C(e) {
85
+ return I(e).showAllField ?? D;
83
86
  }
84
- function E(o, e) {
85
- const n = g(o).dependencies;
86
- if (!e) return n;
87
- if (!n) return e;
88
- const t = {
89
- ...e,
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 (e && n) {
93
- const l = e.triggerFields, s = n.triggerFields;
94
- t.triggerFields = s ?? l;
95
+ if (t && n) {
96
+ const l = t.triggerFields, s = n.triggerFields;
97
+ o.triggerFields = s ?? l;
95
98
  }
96
- return t;
99
+ return o;
97
100
  }
98
- function S(o) {
99
- return g(o).component || (o === "platformId" || o === "shopId" || o === "purchasePlaceId" ? "TtPanelSelect" : "TtApiComponent");
101
+ function O(e) {
102
+ return I(e).component || (e === "platformId" || e === "shopId" || e === "purchasePlaceId" ? "TtPanelSelect" : "TtApiComponent");
100
103
  }
101
- function F(o) {
102
- return g(o).multiple ?? !0;
104
+ function M(e) {
105
+ return I(e).multiple ?? !0;
103
106
  }
104
- function N(o) {
105
- return I.value[o] || [];
107
+ function R(e) {
108
+ return N.value[e] || [];
106
109
  }
107
- function G(o) {
108
- const e = /* @__PURE__ */ new Map();
109
- return o.forEach((n) => {
110
- const t = n.purchaseInfo, l = (t == null ? void 0 : t.supplierSubType) ?? "其他";
111
- let s = e.get(l);
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
- }, e.set(l, s)), s.children.push(n);
117
- }), Array.from(e.values());
119
+ }, t.set(l, s)), s.children.push(n);
120
+ }), Array.from(t.values());
118
121
  }
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);
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: t,
130
+ value: o,
128
131
  children: []
129
- }, e.set(t, l)), l.children.push(n);
130
- }), Array.from(e.values());
132
+ }, t.set(o, l)), l.children.push(n);
133
+ }), Array.from(t.values());
131
134
  }
132
- function _(o) {
133
- return o.flatMap((e) => {
134
- const n = e.children;
135
- return n != null && n.length ? _(n) : [e];
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 K(o, e) {
139
- return O(o).some((n) => n === e || k(n));
141
+ function Z(e, t) {
142
+ return V(e).some((n) => n === t || x(n));
140
143
  }
141
- function Q(o, e) {
142
- const n = f("shopId"), t = F("shopId"), l = P("shopId");
143
- if (c === "action" && w(e)) {
144
- o[n] = t ? [l] : l;
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
- o[n] = t ? [] : void 0;
150
+ P(e, n, o ? [] : void 0);
148
151
  }
149
- function w(o) {
150
- const e = K(o, P("platformId")), n = Array.isArray(o) ? o.length > 1 : !1;
151
- return c === "action" && (e || n);
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 W(o) {
154
- const e = N("shopId"), n = O(o);
156
+ function v(e) {
157
+ const t = R("shopId"), n = V(e);
155
158
  if (!n.length)
156
- return c === "action" ? [] : e;
157
- if (w(o)) return [];
158
- const t = e.filter((s) => n.includes(s.platformId));
159
- return !t.some((s) => s.value === P("shopId") || k(s.value)) || t.length <= 1 ? t : oo(t.filter((s) => s.value !== P("shopId") && !k(s.value)));
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 B(o, e, n, t, l) {
162
- const s = f(o), d = l ? t.filter((i) => {
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: e,
167
+ values: t,
168
168
  actions: n,
169
169
  fieldName: s,
170
- dataType: o,
171
- options: t,
172
- currentOption: d
170
+ dataType: e,
171
+ options: o,
172
+ currentOption: u
173
173
  };
174
174
  }
175
- function L(o, e, n, t, l) {
176
- const s = g(o), d = no(s.componentProps, e, n, t), i = F(o), { onChange: h, ...a } = d, m = q(s.customOptions) ? s.customOptions(e, t) : t, p = S(o) === "TtPanelSelect", C = p && o === "shopId" ? J(m) : p && o === "purchasePlaceId" ? G(m) : m, x = p ? _(C) : m;
177
- return p ? {
178
- multiple: i,
179
- showAll: s.showAll ?? (o === "shopId" && c === "action" ? O(e[f("platformId")]).length > 0 : !0),
180
- showAllField: P(o),
181
- showNav: o !== "platformId" && o !== "purchasePlaceId",
182
- showOriginMode: o === "platformId",
183
- showPinyinMode: o !== "shopId" && o !== "purchasePlaceId",
184
- ...a,
185
- options: C,
186
- onChange(R) {
187
- const Y = e[f(o)];
188
- j(
189
- Y,
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
- () => B(o, e, n, x, i)
192
+ () => z(e, t, n, w, u)
193
193
  );
194
194
  }
195
195
  } : {
196
- multiple: i,
197
- component: $,
196
+ multiple: u,
197
+ component: ne,
198
198
  showOriginMode: !1,
199
199
  showPinyinMode: !0,
200
- ...a,
201
- options: m,
202
- onChange(R) {
203
- j(
204
- R,
200
+ ...A,
201
+ options: a,
202
+ onChange(k) {
203
+ J(
204
+ k,
205
205
  l,
206
206
  s.onChange,
207
- () => B(o, e, n, x, i)
207
+ () => z(e, t, n, w, u)
208
208
  );
209
209
  }
210
210
  };
211
211
  }
212
- function V(o) {
213
- const e = f(o);
212
+ function B(e) {
213
+ const t = p(e);
214
214
  return {
215
- component: S(o),
216
- fieldName: e,
217
- label: M(o),
218
- rules: b(o),
219
- dependencies: E(o),
220
- componentProps: (n, t) => {
221
- var a;
222
- const l = N(o), s = f(o), d = F(o), i = P(o), h = ((a = n[s]) == null ? void 0 : a.at(-1)) !== i;
223
- return L(o, n, t, l, (m) => {
224
- if (S(o) !== "TtPanelSelect") {
225
- const p = n[s];
226
- d && (h && O(m).at(-1) === i ? n[s] = [i] : n[s] = p == null ? void 0 : p.filter((C) => C !== i));
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 D = {
237
+ const _ = {
233
238
  // 平台
234
239
  platformId: {
235
- component: S("platformId"),
236
- fieldName: f("platformId"),
237
- label: M("platformId"),
238
- rules: b("platformId"),
239
- componentProps: (o, e) => {
240
- var h;
241
- const n = "platformId", t = f(n), l = F(n), s = N(n), d = P(n), i = ((h = o[t]) == null ? void 0 : h.at(-1)) !== d;
242
- return L(n, o, e, s, (a) => {
243
- if (S(n) !== "TtPanelSelect") {
244
- const m = o[t];
245
- l && (i && O(a).at(-1) === d ? o[t] = [d] : o[t] = m == null ? void 0 : m.filter((p) => p !== d));
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
- Q(o, o[t]);
257
+ H(e, d(e, o));
248
258
  });
249
259
  }
250
260
  },
251
261
  // 店铺
252
262
  shopId: {
253
- component: S("shopId"),
254
- fieldName: f("shopId"),
255
- label: M("shopId"),
256
- componentProps: (o, e) => {
257
- var a;
258
- const n = "shopId", t = f(n), l = o[f("platformId")], s = W(l), d = F(n), i = P(n), h = ((a = o[t]) == null ? void 0 : a.at(-1)) !== i;
259
- return L(n, o, e, s, (m) => {
260
- if (S(n) !== "TtPanelSelect") {
261
- const p = o[t];
262
- d && (h && O(m).at(-1) === i ? o[t] = [i] : o[t] = p == null ? void 0 : p.filter((C) => C !== i));
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: E("shopId", {
267
- triggerFields: [f("platformId")],
268
- disabled(o) {
269
- return w(o[f("platformId")]);
281
+ dependencies: $("shopId", {
282
+ triggerFields: [p("platformId")],
283
+ disabled(e) {
284
+ return L(d(e, p("platformId")));
270
285
  },
271
- rules(o) {
272
- return w(o[f("platformId")]) ? null : b("shopId") || null;
286
+ rules(e) {
287
+ return L(d(e, p("platformId"))) ? null : E("shopId") || null;
273
288
  }
274
289
  })
275
290
  },
276
- purchasePlaceId: V("purchasePlaceId"),
277
- businessType: V("businessType"),
278
- lockUserId: V("lockUserId")
291
+ purchasePlaceId: B("purchasePlaceId"),
292
+ businessType: B("businessType"),
293
+ lockUserId: B("lockUserId")
279
294
  };
280
- function X() {
281
- return Object.keys(D).reduce(
282
- (o, e) => {
295
+ function T() {
296
+ return Object.keys(_).reduce(
297
+ (e, t) => {
283
298
  var l;
284
- const n = D[e], t = (l = r.fieldConfigs) == null ? void 0 : l[e];
285
- return o[e] = {
299
+ const n = _[t], o = (l = r.fieldConfigs) == null ? void 0 : l[t];
300
+ return e[t] = {
286
301
  ...n,
287
- ...v(t, ["componentProps", "rules"])
288
- }, o;
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
- ...X(),
295
- dataSource: I
336
+ ...T(),
337
+ dataSource: N,
338
+ createRowSchemas: y
296
339
  };
297
340
  }
298
- function Ao() {
341
+ function Ve() {
299
342
  const r = {
300
343
  options: {},
301
- codes: [...z]
302
- }, u = {
344
+ codes: [...Q]
345
+ }, i = {
303
346
  /**
304
347
  * @description 渲染查询场景
305
348
  */
306
349
  list() {
307
- return r.options.scene = "list", u;
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", u;
356
+ return r.options.scene = "action", i;
314
357
  },
315
358
  /**
316
- * @param scene 场景值 list为查询 action为新增编辑等操作
359
+ * @param scene - 场景值,list 为查询筛选,action 为新增编辑等操作
317
360
  * @returns FormSchemasLinkBuilder
318
361
  */
319
362
  scene(c) {
320
- return r.options.scene = c, u;
363
+ return r.options.scene = c, i;
321
364
  },
322
365
  /**
323
- * @param codes 接口请求所需要的入参,需要什么数据源就传什么入参
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], u;
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, u;
384
+ return r.options.dataSource = c, i;
331
385
  },
332
- field(c, A) {
333
- var I;
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
- ...((I = r.options.fieldConfigs) == null ? void 0 : I[c]) || {},
338
- ...A
396
+ ...((b = r.options.fieldConfigs) == null ? void 0 : b[c]) || {},
397
+ ...m
339
398
  }
340
- }, u;
399
+ }, i;
341
400
  },
401
+ /**
402
+ * @description 执行构建并返回字段 schema 映射及数据源
403
+ * @returns UseFormSchemasLinkResult
404
+ */
342
405
  build() {
343
- return eo(r.options, r.codes);
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 u;
417
+ return i;
347
418
  }
348
419
  export {
349
- Ao as useFormSchemasLink
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 { OssSignatureResult } from '../components/tt-upload/src/typing';
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: File) => Promise<OssSignatureResult>;
11
+ /** 获取 OSS 签名,不传则使用全局 setup 的 uploadOssApi 或默认华为云签名接口 */
12
+ uploadOssApi?: (file?: any) => Promise<UnifiedOssSignatureResult | any>;
11
13
  }
12
14
  export interface ScreenshotOssResult {
13
15
  blob: Blob;