@dazhicheng/ui 1.6.10 → 1.6.12
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-form/src/useFormContext.js +1 -1
- package/dist/components/tt-table/index.js +4 -5
- package/dist/components/tt-table/src/TableForm.vue.js +2 -3
- package/dist/hooks/useBasicDataOptions.js +111 -96
- package/dist/hooks/useDataPermissionOptions.js +83 -85
- package/dist/hooks/useOwnerRoutePath.d.ts +5 -0
- package/dist/hooks/useOwnerRoutePath.js +7 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +115 -129
- package/dist/packages/utils/src/is.js +37 -46
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/components/tt-vtable/index.js +0 -54
- package/dist/components/tt-vtable/src/components/TtVTable.vue.d.ts +0 -188
- package/dist/components/tt-vtable/src/components/TtVTable.vue.js +0 -227
- package/dist/components/tt-vtable/src/components/TtVTable.vue2.js +0 -4
- package/dist/components/tt-vtable/src/components/TtVTableForm.vue.d.ts +0 -32
- package/dist/components/tt-vtable/src/components/TtVTableForm.vue.js +0 -121
- package/dist/components/tt-vtable/src/components/TtVTableForm.vue2.js +0 -4
- package/dist/components/tt-vtable/src/components/VTableEmpty.vue.d.ts +0 -64
- package/dist/components/tt-vtable/src/components/VTableEmpty.vue.js +0 -97
- package/dist/components/tt-vtable/src/components/VTableEmpty.vue2.js +0 -4
- package/dist/components/tt-vtable/src/components/VTablePagination.vue.d.ts +0 -53
- package/dist/components/tt-vtable/src/components/VTablePagination.vue.js +0 -52
- package/dist/components/tt-vtable/src/components/VTablePagination.vue2.js +0 -4
- package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue.d.ts +0 -35
- package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue.js +0 -50
- package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue2.js +0 -4
- package/dist/components/tt-vtable/src/components/VTableToolbar.vue.d.ts +0 -63
- package/dist/components/tt-vtable/src/components/VTableToolbar.vue.js +0 -126
- package/dist/components/tt-vtable/src/components/VTableToolbar.vue2.js +0 -4
- package/dist/components/tt-vtable/src/components/VTableViewport.vue.js +0 -133
- package/dist/components/tt-vtable/src/components/VTableViewport.vue2.js +0 -4
- package/dist/components/tt-vtable/src/composables/useVTable.d.ts +0 -41
- package/dist/components/tt-vtable/src/composables/useVTable.js +0 -25
- package/dist/components/tt-vtable/src/composables/useVTableFormRender.d.ts +0 -13
- package/dist/components/tt-vtable/src/composables/useVTableFormRender.js +0 -92
- package/dist/components/tt-vtable/src/composables/useVTableRender.d.ts +0 -13
- package/dist/components/tt-vtable/src/composables/useVTableRender.js +0 -13
- package/dist/components/tt-vtable/src/engine/visactor/createListTable.d.ts +0 -10
- package/dist/components/tt-vtable/src/engine/visactor/createListTable.js +0 -63
- package/dist/components/tt-vtable/src/engine/visactor/createVueCellLayout.d.ts +0 -37
- package/dist/components/tt-vtable/src/engine/visactor/createVueCellLayout.js +0 -133
- package/dist/components/tt-vtable/src/engine/visactor/index.d.ts +0 -8
- package/dist/components/tt-vtable/src/engine/visactor/native-boundaries.d.ts +0 -23
- package/dist/components/tt-vtable/src/engine/visactor/native-boundaries.js +0 -70
- package/dist/components/tt-vtable/src/engine/visactor/record-adapter.d.ts +0 -38
- package/dist/components/tt-vtable/src/engine/visactor/record-adapter.js +0 -41
- package/dist/components/tt-vtable/src/engine/visactor/toColumnDefinitions.d.ts +0 -45
- package/dist/components/tt-vtable/src/engine/visactor/toColumnDefinitions.js +0 -73
- package/dist/components/tt-vtable/src/engine/visactor/toListTableOptions.d.ts +0 -25
- package/dist/components/tt-vtable/src/engine/visactor/toListTableOptions.js +0 -25
- package/dist/components/tt-vtable/src/engine/visactor/types.d.ts +0 -29
- package/dist/components/tt-vtable/src/features/column-preferences/column-preference-storage.d.ts +0 -5
- package/dist/components/tt-vtable/src/features/column-preferences/column-preference-storage.js +0 -52
- package/dist/components/tt-vtable/src/features/column-preferences/useColumnPreferences.d.ts +0 -74
- package/dist/components/tt-vtable/src/features/column-preferences/useColumnPreferences.js +0 -232
- package/dist/components/tt-vtable/src/features/editing/useCellEditing.d.ts +0 -48
- package/dist/components/tt-vtable/src/features/editing/useCellEditing.js +0 -102
- package/dist/components/tt-vtable/src/features/form-integration/useVTableForm.d.ts +0 -51
- package/dist/components/tt-vtable/src/features/pagination/useTablePagination.d.ts +0 -40
- package/dist/components/tt-vtable/src/features/pagination/useTablePagination.js +0 -51
- package/dist/components/tt-vtable/src/features/querying/useRecordQuery.d.ts +0 -38
- package/dist/components/tt-vtable/src/features/querying/useRecordQuery.js +0 -57
- package/dist/components/tt-vtable/src/features/records/index.d.ts +0 -3
- package/dist/components/tt-vtable/src/features/records/record-index.d.ts +0 -122
- package/dist/components/tt-vtable/src/features/records/record-index.js +0 -209
- package/dist/components/tt-vtable/src/features/records/useRecordSource.d.ts +0 -41
- package/dist/components/tt-vtable/src/features/records/useRecordSource.js +0 -249
- package/dist/components/tt-vtable/src/features/selection/useRowSelection.d.ts +0 -65
- package/dist/components/tt-vtable/src/features/selection/useRowSelection.js +0 -129
- package/dist/components/tt-vtable/src/features/tree/useTreeRecords.d.ts +0 -60
- package/dist/components/tt-vtable/src/features/tree/useTreeRecords.js +0 -125
- package/dist/components/tt-vtable/src/public/column-preferences.d.ts +0 -32
- package/dist/components/tt-vtable/src/public/index.d.ts +0 -8
- package/dist/components/tt-vtable/src/public/table-api.d.ts +0 -215
- package/dist/components/tt-vtable/src/public/table-column.d.ts +0 -123
- package/dist/components/tt-vtable/src/public/table-errors.d.ts +0 -26
- package/dist/components/tt-vtable/src/public/table-errors.js +0 -26
- package/dist/components/tt-vtable/src/public/table-events.d.ts +0 -69
- package/dist/components/tt-vtable/src/public/table-props.d.ts +0 -216
- package/dist/components/tt-vtable/src/public/table-slots.d.ts +0 -37
- package/dist/components/tt-vtable/src/runtime/createVTableController.d.ts +0 -12
- package/dist/components/tt-vtable/src/runtime/createVTableController.js +0 -238
- package/dist/components/tt-vtable/src/runtime/createVTableRuntime.d.ts +0 -79
- package/dist/components/tt-vtable/src/runtime/createVTableRuntime.js +0 -380
|
@@ -13,7 +13,7 @@ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.j
|
|
|
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 { get as R,
|
|
16
|
+
import { get as R, cloneDeep as v, has as C } from "lodash-es";
|
|
17
17
|
import { childArrayPath as w, normalizeArrayFieldPath as h } from "./utils/array-path.js";
|
|
18
18
|
import { set as g } from "es-toolkit/compat";
|
|
19
19
|
import { createContext as x } from "./shared/createContext.js";
|
|
@@ -54,7 +54,6 @@ import "../tt-drawer/index.js";
|
|
|
54
54
|
import "../tt-modal/index.js";
|
|
55
55
|
import "../../directives/disabled-tip/index.js";
|
|
56
56
|
import "../tt-log/index.js";
|
|
57
|
-
import "../tt-vtable/index.js";
|
|
58
57
|
/* empty css */
|
|
59
58
|
/* empty css */
|
|
60
59
|
/* empty css */
|
|
@@ -69,9 +68,9 @@ import "./src/emits.js";
|
|
|
69
68
|
import "./src/props.js";
|
|
70
69
|
import "./src/table-mutation-events.js";
|
|
71
70
|
import "./src/utils/context.js";
|
|
72
|
-
const
|
|
71
|
+
const xt = t(o), At = t(r), Ct = t(m);
|
|
73
72
|
export {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
Ct as TtTable,
|
|
74
|
+
xt as TtTableAction,
|
|
75
|
+
At as TtTableButton
|
|
77
76
|
};
|
|
@@ -52,7 +52,6 @@ import "../../tt-text/index.js";
|
|
|
52
52
|
import "../../../directives/disabled-tip/index.js";
|
|
53
53
|
import { GlobalConfig as Qe } from "../../../hooks/useSetup.js";
|
|
54
54
|
import "../../tt-log/index.js";
|
|
55
|
-
import "../../tt-vtable/index.js";
|
|
56
55
|
/* empty css */
|
|
57
56
|
/* empty css */
|
|
58
57
|
/* empty css */
|
|
@@ -77,7 +76,7 @@ import it from "./Table.vue.js";
|
|
|
77
76
|
import { forwardedEventEntries as st } from "./table-mutation-events.js";
|
|
78
77
|
import { TableFormApi as at } from "./utils/table-form-api.js";
|
|
79
78
|
import { provideFormActionTestIds as nt } from "./utils/context.js";
|
|
80
|
-
const lt = ["data-testid"], mt = ["data-testid"],
|
|
79
|
+
const lt = ["data-testid"], mt = ["data-testid"], Vo = /* @__PURE__ */ _e({
|
|
81
80
|
name: "TtTableForm",
|
|
82
81
|
__name: "TableForm",
|
|
83
82
|
props: rt,
|
|
@@ -376,5 +375,5 @@ const lt = ["data-testid"], mt = ["data-testid"], Ko = /* @__PURE__ */ _e({
|
|
|
376
375
|
}
|
|
377
376
|
});
|
|
378
377
|
export {
|
|
379
|
-
|
|
378
|
+
Vo as default
|
|
380
379
|
};
|
|
@@ -1,147 +1,162 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { useRoute as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { ref as j, watchEffect as B, unref as q, computed as H } from "vue";
|
|
2
|
+
import { useRoute as I } from "vue-router";
|
|
3
|
+
import { useOwnerRoutePath as Y } from "./useOwnerRoutePath.js";
|
|
4
|
+
import { GEO_LEVEL_CODES as M, canDeriveGeoLevel as x, deriveRegionLevelOptionsFromGeoSource as k, resolveHighestGeoLevelCode as A, isGeoLevelCode as L, CODE_REGISTRY as J } from "./basicDataCodes.js";
|
|
5
|
+
const c = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map();
|
|
6
|
+
function v(n) {
|
|
7
|
+
return Array.isArray(n) ? n : [];
|
|
7
8
|
}
|
|
8
|
-
function
|
|
9
|
-
return
|
|
9
|
+
function N(n) {
|
|
10
|
+
return n.reduce((u, a) => (u[a] = [], u), {});
|
|
10
11
|
}
|
|
11
|
-
function
|
|
12
|
-
return Object.prototype.hasOwnProperty.call(
|
|
12
|
+
function w(n, u) {
|
|
13
|
+
return Object.prototype.hasOwnProperty.call(n, u);
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
-
return
|
|
15
|
+
function F(n) {
|
|
16
|
+
return A(M.filter((u) => w(n, u)));
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
-
const
|
|
19
|
-
if (!
|
|
20
|
-
const
|
|
21
|
-
if (!Array.isArray(
|
|
22
|
-
const
|
|
23
|
-
let
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
}),
|
|
18
|
+
function C(n) {
|
|
19
|
+
const u = F(n);
|
|
20
|
+
if (!u) return n;
|
|
21
|
+
const a = n[u];
|
|
22
|
+
if (!Array.isArray(a)) return n;
|
|
23
|
+
const h = { ...n };
|
|
24
|
+
let s = !1;
|
|
25
|
+
return M.forEach((f) => {
|
|
26
|
+
x(u, f) && (w(h, f) || (h[f] = k(a, f), s = !0));
|
|
27
|
+
}), s ? h : n;
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
-
const
|
|
30
|
-
return
|
|
29
|
+
function Q(n, u) {
|
|
30
|
+
const a = F(u), h = n.filter(L), s = a || A(h) || void 0;
|
|
31
|
+
return s ? n.filter((f) => L(f) ? !(x(s, f) || f === s && w(u, s)) : !0) : n;
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
-
const
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
(e, r) => (e[r] = v(
|
|
33
|
+
function K(n) {
|
|
34
|
+
const u = I(), a = Y(), h = j({});
|
|
35
|
+
function s(t = {}) {
|
|
36
|
+
h.value = n.codes.reduce(
|
|
37
|
+
(e, r) => (e[r] = v(t[r]), e),
|
|
37
38
|
{}
|
|
38
39
|
);
|
|
39
40
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
s();
|
|
42
|
+
function f(t) {
|
|
43
|
+
c.delete(t), y.delete(t);
|
|
44
|
+
}
|
|
45
|
+
function _(t) {
|
|
46
|
+
const e = m.get(t) || /* @__PURE__ */ new Set(), r = e.size;
|
|
47
|
+
n.codes.forEach((d) => e.add(d)), m.set(t, e), e.size !== r && (y.delete(t), E(t));
|
|
48
|
+
}
|
|
49
|
+
function z(t) {
|
|
50
|
+
s(c.get(t));
|
|
51
|
+
}
|
|
52
|
+
function E(t) {
|
|
53
|
+
const e = y.get(t);
|
|
54
|
+
if (e) return e;
|
|
55
|
+
const r = Promise.resolve().then(() => R());
|
|
56
|
+
return y.set(t, r), r.finally(() => {
|
|
57
|
+
y.get(t) === r && y.delete(t);
|
|
58
|
+
}), r;
|
|
59
|
+
}
|
|
60
|
+
async function T(t) {
|
|
61
|
+
var d;
|
|
62
|
+
const e = (d = u.meta) == null ? void 0 : d.permissionOnlyCode;
|
|
44
63
|
return (await Promise.allSettled(
|
|
45
|
-
|
|
64
|
+
t.map(async (o) => {
|
|
46
65
|
try {
|
|
47
|
-
const
|
|
48
|
-
return [
|
|
66
|
+
const g = await J[o].fetchOptions({ permissionOnlyCode: e });
|
|
67
|
+
return [o, v(g)];
|
|
49
68
|
} catch {
|
|
50
|
-
return [
|
|
69
|
+
return [o, []];
|
|
51
70
|
}
|
|
52
71
|
})
|
|
53
|
-
)).reduce((
|
|
54
|
-
const
|
|
55
|
-
return
|
|
72
|
+
)).reduce((o, l, g) => {
|
|
73
|
+
const O = t[g];
|
|
74
|
+
return l.status === "fulfilled" ? o[l.value[0]] = v(l.value[1]) : o[O] = [], o;
|
|
56
75
|
}, {});
|
|
57
76
|
}
|
|
58
|
-
async function
|
|
59
|
-
const e =
|
|
77
|
+
async function R(t = !1) {
|
|
78
|
+
const e = a;
|
|
60
79
|
let r = [];
|
|
61
80
|
try {
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
64
|
-
let
|
|
65
|
-
|
|
81
|
+
const d = q(n.dataSource);
|
|
82
|
+
if (d) {
|
|
83
|
+
let i = { ...c.get(e) || {}, ...d };
|
|
84
|
+
i = C(i), c.set(e, i), s(i);
|
|
66
85
|
return;
|
|
67
86
|
}
|
|
68
|
-
let
|
|
69
|
-
|
|
70
|
-
|
|
87
|
+
let o = C(c.get(e) || {});
|
|
88
|
+
o !== (c.get(e) || {}) && c.set(e, o);
|
|
89
|
+
const l = [...m.get(e) || n.codes];
|
|
90
|
+
if (r = t ? l : l.filter((i) => !w(o, i)), !r.length) {
|
|
91
|
+
s(o);
|
|
71
92
|
return;
|
|
72
93
|
}
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
94
|
+
const g = t ? void 0 : D.get(e);
|
|
95
|
+
if (g)
|
|
75
96
|
try {
|
|
76
|
-
const
|
|
77
|
-
...
|
|
78
|
-
...
|
|
97
|
+
const i = await g, p = C({
|
|
98
|
+
...c.get(e) || {},
|
|
99
|
+
...i
|
|
79
100
|
});
|
|
80
|
-
if (
|
|
81
|
-
|
|
101
|
+
if (c.set(e, p), r = l.filter((b) => !w(p, b)), !r.length) {
|
|
102
|
+
s(p);
|
|
82
103
|
return;
|
|
83
104
|
}
|
|
84
|
-
|
|
105
|
+
o = p;
|
|
85
106
|
} catch {
|
|
86
107
|
}
|
|
87
|
-
const
|
|
88
|
-
if (!
|
|
89
|
-
const
|
|
90
|
-
|
|
108
|
+
const O = Q(r, o);
|
|
109
|
+
if (!O.length) {
|
|
110
|
+
const i = C(o);
|
|
111
|
+
c.set(e, i), s(i);
|
|
91
112
|
return;
|
|
92
113
|
}
|
|
93
|
-
const
|
|
94
|
-
|
|
114
|
+
const G = T(O), P = (S.get(e) || 0) + 1;
|
|
115
|
+
S.set(e, P), D.set(e, G);
|
|
95
116
|
try {
|
|
96
|
-
const
|
|
97
|
-
if (
|
|
98
|
-
let
|
|
99
|
-
...
|
|
100
|
-
...
|
|
117
|
+
const i = await G;
|
|
118
|
+
if (S.get(e) !== P) return;
|
|
119
|
+
let p = {
|
|
120
|
+
...c.get(e) || {},
|
|
121
|
+
...i
|
|
101
122
|
};
|
|
102
|
-
|
|
123
|
+
p = C(p), c.set(e, p), s(p);
|
|
103
124
|
} finally {
|
|
104
|
-
|
|
125
|
+
S.get(e) === P && D.delete(e);
|
|
105
126
|
}
|
|
106
127
|
} catch {
|
|
107
|
-
const
|
|
108
|
-
|
|
128
|
+
const d = [...m.get(e) || n.codes], o = N(r.length ? r : d), g = { ...c.get(e) || {}, ...o };
|
|
129
|
+
c.set(e, g), s(g);
|
|
109
130
|
}
|
|
110
131
|
}
|
|
111
|
-
async function
|
|
112
|
-
const
|
|
113
|
-
D.clear(),
|
|
132
|
+
async function V() {
|
|
133
|
+
const t = a, e = new Set(m.get(t) || n.codes);
|
|
134
|
+
D.clear(), y.clear(), c.clear(), m.clear(), S.clear(), m.set(t, e), f(t), await R(!0);
|
|
114
135
|
}
|
|
115
|
-
return
|
|
116
|
-
const
|
|
117
|
-
if (!
|
|
118
|
-
const e =
|
|
119
|
-
let r = { ...
|
|
120
|
-
r =
|
|
121
|
-
}), _(
|
|
122
|
-
() =>
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
},
|
|
126
|
-
{ immediate: !0 }
|
|
127
|
-
), {
|
|
128
|
-
dataSource: F(() => {
|
|
129
|
-
const s = t.codes.reduce(
|
|
130
|
-
(e, r) => (e[r] = v(l.value[r]), e),
|
|
136
|
+
return B(() => {
|
|
137
|
+
const t = q(n.dataSource);
|
|
138
|
+
if (!t) return;
|
|
139
|
+
const e = a;
|
|
140
|
+
let r = { ...c.get(e) || {}, ...t };
|
|
141
|
+
r = C(r), c.set(e, r), s(r);
|
|
142
|
+
}), _(a), E(a).then(() => z(a)), R(), {
|
|
143
|
+
dataSource: H(() => {
|
|
144
|
+
const t = n.codes.reduce(
|
|
145
|
+
(e, r) => (e[r] = v(h.value[r]), e),
|
|
131
146
|
{}
|
|
132
147
|
);
|
|
133
|
-
return new Proxy(
|
|
148
|
+
return new Proxy(t, {
|
|
134
149
|
get(e, r) {
|
|
135
|
-
return typeof r != "string" ? [] : v(
|
|
150
|
+
return typeof r != "string" ? [] : v(t[r]);
|
|
136
151
|
},
|
|
137
152
|
set() {
|
|
138
153
|
return !1;
|
|
139
154
|
}
|
|
140
155
|
});
|
|
141
156
|
}),
|
|
142
|
-
reload:
|
|
157
|
+
reload: V
|
|
143
158
|
};
|
|
144
159
|
}
|
|
145
160
|
export {
|
|
146
|
-
|
|
161
|
+
K as useBasicDataOptions
|
|
147
162
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { queryDataPermissionDetailDataTypeContext as
|
|
2
|
-
import { ref as
|
|
3
|
-
import {
|
|
4
|
-
const c = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(),
|
|
5
|
-
let v,
|
|
6
|
-
const
|
|
1
|
+
import { queryDataPermissionDetailDataTypeContext as _, pageUser as j } from "../api/dataTypeContext.js";
|
|
2
|
+
import { ref as k, watchEffect as B, unref as b, computed as F } from "vue";
|
|
3
|
+
import { useOwnerRoutePath as W } from "./useOwnerRoutePath.js";
|
|
4
|
+
const c = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map();
|
|
5
|
+
let v, p;
|
|
6
|
+
const G = "all", H = { label: "全部", value: G }, U = /* @__PURE__ */ new WeakMap(), J = {
|
|
7
7
|
platformId: ["platformName", "platformId"],
|
|
8
8
|
shopId: ["shopName", "shopId"],
|
|
9
9
|
purchasePlaceId: ["purchasePlaceName", "purchasePlaceCode"],
|
|
@@ -11,132 +11,130 @@ const H = "all", J = { label: "全部", value: H }, Q = {
|
|
|
11
11
|
lockUserId: ["userName", "userId"],
|
|
12
12
|
userId: ["fullName", "id"]
|
|
13
13
|
};
|
|
14
|
-
async function
|
|
14
|
+
async function Q() {
|
|
15
15
|
if (v) return v;
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
return v =
|
|
16
|
+
if (p) return p;
|
|
17
|
+
p = j({ pageNo: 1, pageSize: 9999 }).then((n) => {
|
|
18
|
+
const s = n.records || [];
|
|
19
|
+
return v = s, s;
|
|
20
20
|
});
|
|
21
21
|
try {
|
|
22
|
-
return await
|
|
22
|
+
return await p;
|
|
23
23
|
} finally {
|
|
24
|
-
|
|
24
|
+
p = void 0;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
27
|
+
function X(n, s = []) {
|
|
28
|
+
const g = U.get(s) || /* @__PURE__ */ new Map(), u = g.get(n);
|
|
29
|
+
if (u) return u.slice();
|
|
30
|
+
const [S, q] = J[n], P = s.map((m) => {
|
|
31
|
+
const l = n === "purchasePlaceId" ? m.purchaseInfo || {} : m;
|
|
32
|
+
return {
|
|
33
|
+
...m,
|
|
34
|
+
label: l == null ? void 0 : l[S],
|
|
35
|
+
value: l == null ? void 0 : l[q]
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
return g.set(n, P), U.set(s, g), P.slice();
|
|
39
|
+
}
|
|
40
|
+
function ee(n) {
|
|
41
|
+
const s = W(), g = k({});
|
|
42
|
+
function u(t = {}) {
|
|
43
|
+
g.value = n.codes.reduce(
|
|
44
|
+
(e, r) => (e[r] = X(r, t[r]), e),
|
|
42
45
|
{}
|
|
43
46
|
);
|
|
44
47
|
}
|
|
45
|
-
function
|
|
48
|
+
function S(t) {
|
|
46
49
|
var e;
|
|
47
|
-
return typeof
|
|
50
|
+
return typeof n.showAll == "boolean" ? n.showAll : ((e = n.showAll) == null ? void 0 : e[t]) ?? !1;
|
|
48
51
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
52
|
+
function q() {
|
|
53
|
+
I.clear(), h.clear(), c.clear(), f.clear(), w.clear(), v = void 0, p = void 0;
|
|
51
54
|
}
|
|
52
|
-
function
|
|
55
|
+
function P(t) {
|
|
53
56
|
c.delete(t), f.delete(t), h.delete(t);
|
|
54
57
|
}
|
|
55
|
-
function
|
|
58
|
+
function m(t) {
|
|
56
59
|
const e = f.get(t) || /* @__PURE__ */ new Set(), r = e.size;
|
|
57
|
-
|
|
60
|
+
n.codes.forEach((o) => e.add(o)), f.set(t, e), e.size !== r && (h.delete(t), M(t));
|
|
58
61
|
}
|
|
59
|
-
async function
|
|
60
|
-
const e =
|
|
62
|
+
async function l(t = !1) {
|
|
63
|
+
const e = s, r = b(n.dataSource);
|
|
61
64
|
if (r) {
|
|
62
65
|
const i = { ...c.get(e) || {}, ...r };
|
|
63
|
-
c.set(e, i),
|
|
66
|
+
c.set(e, i), u(i);
|
|
64
67
|
return;
|
|
65
68
|
}
|
|
66
|
-
const
|
|
67
|
-
let
|
|
68
|
-
if (!
|
|
69
|
-
|
|
69
|
+
const o = c.get(e) || {}, O = [...f.get(e) || n.codes];
|
|
70
|
+
let C = t ? O : O.filter((a) => !Object.prototype.hasOwnProperty.call(o, a));
|
|
71
|
+
if (!C.length) {
|
|
72
|
+
u(o);
|
|
70
73
|
return;
|
|
71
74
|
}
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
74
|
-
const
|
|
75
|
-
if (c.set(e,
|
|
76
|
-
|
|
75
|
+
const R = t ? void 0 : I.get(e);
|
|
76
|
+
if (R) {
|
|
77
|
+
const a = await R, d = { ...c.get(e) || {}, ...a };
|
|
78
|
+
if (c.set(e, d), C = O.filter((y) => !Object.prototype.hasOwnProperty.call(d, y)), !C.length) {
|
|
79
|
+
u(d);
|
|
77
80
|
return;
|
|
78
81
|
}
|
|
79
82
|
}
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
(
|
|
83
|
+
const x = C.filter((a) => a !== "userId"), V = C.includes("userId"), L = Promise.allSettled([
|
|
84
|
+
x.length ? _({ dataTypeName: x }).then(
|
|
85
|
+
(a) => a
|
|
83
86
|
) : Promise.resolve([]),
|
|
84
|
-
|
|
85
|
-
]).then(([
|
|
86
|
-
const
|
|
87
|
+
V ? Q() : Promise.resolve(void 0)
|
|
88
|
+
]).then(([a, i]) => {
|
|
89
|
+
const d = a.status === "fulfilled" ? a.value : [], y = i.status === "fulfilled" ? i.value : void 0;
|
|
87
90
|
return {
|
|
88
|
-
...
|
|
89
|
-
...
|
|
90
|
-
const
|
|
91
|
-
return
|
|
91
|
+
...y ? { userId: y } : {},
|
|
92
|
+
...d.reduce((A, D) => {
|
|
93
|
+
const T = D == null ? void 0 : D.dataTypeCode;
|
|
94
|
+
return T && (A[T] = D.originalItems || []), A;
|
|
92
95
|
}, {})
|
|
93
96
|
};
|
|
94
|
-
}),
|
|
95
|
-
w.set(e,
|
|
97
|
+
}), N = (w.get(e) || 0) + 1;
|
|
98
|
+
w.set(e, N), I.set(e, L);
|
|
96
99
|
try {
|
|
97
|
-
const
|
|
98
|
-
if (w.get(e) !==
|
|
99
|
-
const
|
|
100
|
-
c.set(e,
|
|
100
|
+
const a = await L;
|
|
101
|
+
if (w.get(e) !== N) return;
|
|
102
|
+
const d = { ...c.get(e) || {}, ...a };
|
|
103
|
+
c.set(e, d), u(d);
|
|
101
104
|
} finally {
|
|
102
|
-
w.get(e) ===
|
|
105
|
+
w.get(e) === N && I.delete(e);
|
|
103
106
|
}
|
|
104
107
|
}
|
|
105
108
|
async function z() {
|
|
106
|
-
const t =
|
|
107
|
-
|
|
109
|
+
const t = s, e = new Set(f.get(t) || n.codes);
|
|
110
|
+
q(), f.set(t, e), P(t), await l(!0);
|
|
108
111
|
}
|
|
109
|
-
function
|
|
112
|
+
function M(t) {
|
|
110
113
|
const e = h.get(t);
|
|
111
114
|
if (e) return e;
|
|
112
|
-
const r = Promise.resolve().then(() =>
|
|
115
|
+
const r = Promise.resolve().then(() => l());
|
|
113
116
|
return h.set(t, r), r.finally(() => {
|
|
114
117
|
h.get(t) === r && h.delete(t);
|
|
115
118
|
}), r;
|
|
116
119
|
}
|
|
117
|
-
|
|
118
|
-
const t =
|
|
120
|
+
B(() => {
|
|
121
|
+
const t = b(n.dataSource);
|
|
119
122
|
if (!t) return;
|
|
120
|
-
const e =
|
|
121
|
-
c.set(e,
|
|
123
|
+
const e = s, o = { ...c.get(e) || {}, ...t };
|
|
124
|
+
c.set(e, o), u(o);
|
|
122
125
|
});
|
|
123
|
-
function
|
|
124
|
-
|
|
126
|
+
function E(t) {
|
|
127
|
+
u(c.get(t));
|
|
125
128
|
}
|
|
126
|
-
return
|
|
127
|
-
() => o.path,
|
|
128
|
-
(t) => {
|
|
129
|
-
O(t), y(t).then(() => R(t));
|
|
130
|
-
}
|
|
131
|
-
), {
|
|
129
|
+
return m(s), M(s).then(() => E(s)), {
|
|
132
130
|
/**
|
|
133
131
|
* 数据源
|
|
134
132
|
*/
|
|
135
|
-
dataSource:
|
|
136
|
-
const t =
|
|
133
|
+
dataSource: F(() => {
|
|
134
|
+
const t = n.codes.reduce(
|
|
137
135
|
(e, r) => {
|
|
138
|
-
const
|
|
139
|
-
return e[r] =
|
|
136
|
+
const o = g.value[r] || [];
|
|
137
|
+
return e[r] = S(r) ? [H, ...o] : o, e;
|
|
140
138
|
},
|
|
141
139
|
{}
|
|
142
140
|
);
|
|
@@ -156,5 +154,5 @@ function K(s) {
|
|
|
156
154
|
};
|
|
157
155
|
}
|
|
158
156
|
export {
|
|
159
|
-
|
|
157
|
+
ee as useDataPermissionOptions
|
|
160
158
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,6 @@ export * from './components/tt-modal-form';
|
|
|
16
16
|
export * from './components/tt-image';
|
|
17
17
|
export * from './components/tt-loading';
|
|
18
18
|
export * from './components/tt-table';
|
|
19
|
-
export * from './components/tt-vtable';
|
|
20
19
|
export * from './components/tt-upload';
|
|
21
20
|
export * from './components/tt-nav-anchor';
|
|
22
21
|
export * from './components/tt-api-component';
|