@aplus-frontend/ui 0.1.27 → 0.1.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/es/src/ap-download/ap-download.vue.d.ts +6 -2
- package/es/src/ap-download/ap-download.vue.mjs +48 -28
- package/es/src/ap-download/interface.d.ts +3 -2
- package/es/src/ap-download/style/ap-download.css +3 -0
- package/es/src/ap-field/date-range/index.vue.mjs +154 -109
- package/es/src/ap-field/interface.d.ts +4 -0
- package/es/src/ap-field/select/index.vue.mjs +67 -63
- package/es/src/ap-form/style/ap-form-item.css +2 -0
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +72 -97
- package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +37 -33
- package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +91 -87
- package/es/src/ap-table/components/setting/utils.d.ts +7 -1
- package/es/src/ap-table/components/setting/utils.mjs +37 -22
- package/es/src/ap-table/constants.d.ts +12 -0
- package/es/src/ap-table/hooks/use-table-column-state.d.ts +6 -2
- package/es/src/ap-table/hooks/use-table-column-state.mjs +101 -33
- package/es/src/ap-table/interface.d.ts +8 -1
- package/es/src/business/ap-attachment/ApAttachment.mjs +79 -59
- package/es/src/business/ap-attachment/interface.d.ts +1 -1
- package/es/src/business/ap-attachment/style.css +4 -0
- package/es/src/business/ap-input-radio/interface.d.ts +1 -1
- package/es/src/business/index.d.ts +0 -2
- package/es/src/editable-table/form-item.vue.d.ts +1 -0
- package/es/src/editable-table/form-item.vue.mjs +63 -59
- package/es/src/editable-table/index.vue.d.ts +1 -0
- package/es/src/editable-table/index.vue.mjs +77 -72
- package/es/src/editable-table/interface.d.ts +6 -0
- package/es/src/theme/ap-attachment/ap-attachment.css +4 -0
- package/es/src/theme/ap-download/ap-download.css +3 -0
- package/es/src/theme/ap-form/ap-form-item.css +2 -0
- package/lib/src/ap-download/ap-download.vue.d.ts +6 -2
- package/lib/src/ap-download/ap-download.vue.js +1 -1
- package/lib/src/ap-download/interface.d.ts +3 -2
- package/lib/src/ap-download/style/ap-download.css +3 -0
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/interface.d.ts +4 -0
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-form/style/ap-form-item.css +2 -0
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/select-group/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/sorter/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/utils.d.ts +7 -1
- package/lib/src/ap-table/components/setting/utils.js +1 -1
- package/lib/src/ap-table/constants.d.ts +12 -0
- package/lib/src/ap-table/hooks/use-table-column-state.d.ts +6 -2
- package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
- package/lib/src/ap-table/interface.d.ts +8 -1
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/lib/src/business/ap-attachment/interface.d.ts +1 -1
- package/lib/src/business/ap-attachment/style.css +4 -0
- package/lib/src/business/ap-input-radio/interface.d.ts +1 -1
- package/lib/src/business/index.d.ts +0 -2
- package/lib/src/editable-table/form-item.vue.d.ts +1 -0
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/index.vue.d.ts +1 -0
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/editable-table/interface.d.ts +6 -0
- package/lib/src/theme/ap-attachment/ap-attachment.css +4 -0
- package/lib/src/theme/ap-download/ap-download.css +3 -0
- package/lib/src/theme/ap-form/ap-form-item.css +2 -0
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Flex as
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as O, ref as x, unref as n, computed as $, watch as q, onMounted as G, openBlock as i, createElementBlock as _, normalizeClass as f, createVNode as N, withCtx as h, createElementVNode as g, toDisplayString as k, createTextVNode as H, createBlock as p, createCommentVNode as s } from "vue";
|
|
2
|
+
import { Flex as J, Button as K, Divider as P } from "ant-design-vue";
|
|
3
|
+
import M from "vuedraggable";
|
|
4
4
|
import "../sortable/index.vue.mjs";
|
|
5
5
|
import "../../../../config-provider/index.mjs";
|
|
6
6
|
import "../../style/setting/sorter.css";
|
|
7
|
-
import { useProvideSorterMethods as
|
|
8
|
-
import { useNamespace as
|
|
9
|
-
import { useLocale as
|
|
7
|
+
import { useProvideSorterMethods as Q } from "./context.mjs";
|
|
8
|
+
import { useNamespace as W } from "../../../../config-provider/hooks/use-namespace.mjs";
|
|
9
|
+
import { useLocale as X } from "../../../../config-provider/hooks/use-locale.mjs";
|
|
10
10
|
import R from "../sortable/index.vue2.mjs";
|
|
11
|
-
const
|
|
11
|
+
const Y = { key: 0 }, Z = { key: 1 }, ee = { key: 2 }, fe = /* @__PURE__ */ O({
|
|
12
12
|
__name: "index",
|
|
13
13
|
props: {
|
|
14
14
|
value: {},
|
|
@@ -16,11 +16,11 @@ const W = { key: 0 }, X = { key: 1 }, Y = { key: 2 }, ce = /* @__PURE__ */ A({
|
|
|
16
16
|
},
|
|
17
17
|
emits: ["update:value"],
|
|
18
18
|
setup(V, { emit: B }) {
|
|
19
|
-
const
|
|
20
|
-
|
|
19
|
+
const u = x([]), r = x([]), c = x([]), y = x(!1), { b: d } = W("column-setting-sorter"), { t: v } = X(), C = V, S = B;
|
|
20
|
+
Q({
|
|
21
21
|
fixedToLeft: I,
|
|
22
|
-
fixedToRight:
|
|
23
|
-
unFixed:
|
|
22
|
+
fixedToRight: U,
|
|
23
|
+
unFixed: z
|
|
24
24
|
});
|
|
25
25
|
function F(e, t) {
|
|
26
26
|
const o = t[0].findIndex(
|
|
@@ -35,8 +35,8 @@ const W = { key: 0 }, X = { key: 1 }, Y = { key: 2 }, ce = /* @__PURE__ */ A({
|
|
|
35
35
|
t[1].splice(a, 1);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
const o = [...n(
|
|
38
|
+
function T(e, t) {
|
|
39
|
+
const o = [...n(u.value)], a = [...n(c.value)], l = [...n(r.value)], b = {
|
|
40
40
|
left: {
|
|
41
41
|
target: o,
|
|
42
42
|
search: [l, a]
|
|
@@ -50,150 +50,154 @@ const W = { key: 0 }, X = { key: 1 }, Y = { key: 2 }, ce = /* @__PURE__ */ A({
|
|
|
50
50
|
search: [o, a]
|
|
51
51
|
}
|
|
52
52
|
}[t];
|
|
53
|
-
return t === "right" ?
|
|
53
|
+
return t === "right" ? b.target.unshift(e) : b.target.push(e), F(
|
|
54
54
|
e,
|
|
55
|
-
|
|
55
|
+
b.search
|
|
56
56
|
), [...o, ...l, ...a];
|
|
57
57
|
}
|
|
58
58
|
function I(e) {
|
|
59
|
-
const t =
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
function M(e) {
|
|
63
|
-
const t = _(e, "right");
|
|
64
|
-
f(t);
|
|
59
|
+
const t = T(e, "left");
|
|
60
|
+
m(t);
|
|
65
61
|
}
|
|
66
62
|
function U(e) {
|
|
67
|
-
const t =
|
|
68
|
-
|
|
63
|
+
const t = T(e, "right");
|
|
64
|
+
m(t);
|
|
69
65
|
}
|
|
70
|
-
function
|
|
66
|
+
function z(e) {
|
|
67
|
+
const t = T(e, "normal");
|
|
68
|
+
m(t);
|
|
69
|
+
}
|
|
70
|
+
function w(e) {
|
|
71
71
|
var t;
|
|
72
72
|
return (t = e.children) != null && t.length ? e.children.some((o) => o.show) : e.show;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function L(e, t) {
|
|
75
75
|
e.value ? e.value.push(t) : e.value = [t];
|
|
76
76
|
}
|
|
77
|
-
const
|
|
77
|
+
const D = $(() => {
|
|
78
78
|
let e = 0;
|
|
79
79
|
function t(o) {
|
|
80
80
|
var a;
|
|
81
81
|
for (const l of o)
|
|
82
82
|
(a = l.children) != null && a.length ? t(l.children) : l.show && (e += 1);
|
|
83
83
|
}
|
|
84
|
-
return t(
|
|
84
|
+
return t(C.value), e;
|
|
85
85
|
});
|
|
86
|
-
function D(e) {
|
|
87
|
-
f([...e, ...n(s), ...n(r)]);
|
|
88
|
-
}
|
|
89
86
|
function E(e) {
|
|
90
|
-
|
|
87
|
+
m([...e, ...n(r), ...n(c)]);
|
|
91
88
|
}
|
|
92
89
|
function j(e) {
|
|
93
|
-
|
|
90
|
+
m([...n(u), ...e, ...n(c)]);
|
|
91
|
+
}
|
|
92
|
+
function A(e) {
|
|
93
|
+
m([...n(u), ...n(r), ...e]);
|
|
94
|
+
}
|
|
95
|
+
function m(e) {
|
|
96
|
+
S("update:value", e);
|
|
94
97
|
}
|
|
95
|
-
|
|
96
|
-
() =>
|
|
98
|
+
return q(
|
|
99
|
+
() => C.value,
|
|
97
100
|
(e) => {
|
|
98
101
|
if (e) {
|
|
99
|
-
|
|
102
|
+
u.value = [], r.value = [], c.value = [];
|
|
100
103
|
for (const t of e)
|
|
101
|
-
t.fixed === "left" ?
|
|
104
|
+
t.fixed === "left" ? L(u, t) : t.fixed === "right" ? L(c, t) : L(r, t);
|
|
102
105
|
}
|
|
103
106
|
},
|
|
104
107
|
{ immediate: !0 }
|
|
105
|
-
)
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
return (e, t) => (c(), y("div", {
|
|
110
|
-
class: d(n(u)())
|
|
108
|
+
), G(() => {
|
|
109
|
+
y.value = !0;
|
|
110
|
+
}), (e, t) => (i(), _("div", {
|
|
111
|
+
class: f(n(d)())
|
|
111
112
|
}, [
|
|
112
|
-
|
|
113
|
-
class:
|
|
113
|
+
N(n(J), {
|
|
114
|
+
class: f(n(d)("header")),
|
|
114
115
|
align: "center",
|
|
115
116
|
justify: "space-between"
|
|
116
117
|
}, {
|
|
117
|
-
default:
|
|
118
|
+
default: h(() => [
|
|
118
119
|
g("span", {
|
|
119
|
-
class:
|
|
120
|
-
}, k(n(
|
|
121
|
-
|
|
120
|
+
class: f(n(d)("header-title"))
|
|
121
|
+
}, k(n(v)("ap.apTable.setting.selectCount", { count: D.value })), 3),
|
|
122
|
+
N(n(K), {
|
|
122
123
|
type: "link",
|
|
123
124
|
size: "small",
|
|
124
125
|
style: { padding: "0" },
|
|
125
|
-
onClick:
|
|
126
|
+
onClick: C.onReset
|
|
126
127
|
}, {
|
|
127
|
-
default:
|
|
128
|
-
|
|
128
|
+
default: h(() => [
|
|
129
|
+
H(k(n(v)("ap.apTable.setting.reset")), 1)
|
|
129
130
|
]),
|
|
130
131
|
_: 1
|
|
131
132
|
}, 8, ["onClick"])
|
|
132
133
|
]),
|
|
133
134
|
_: 1
|
|
134
135
|
}, 8, ["class"]),
|
|
135
|
-
|
|
136
|
+
N(n(P), { style: { margin: "0px" } }),
|
|
136
137
|
g("div", {
|
|
137
|
-
class:
|
|
138
|
+
class: f(n(d)("content"))
|
|
138
139
|
}, [
|
|
139
|
-
|
|
140
|
+
u.value.length ? (i(), _("div", Y, [
|
|
140
141
|
g("span", {
|
|
141
|
-
class:
|
|
142
|
-
}, k(n(
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
"
|
|
142
|
+
class: f(n(d)("section-title"))
|
|
143
|
+
}, k(n(v)("ap.apTable.setting.fixToLeft")), 3),
|
|
144
|
+
y.value ? (i(), p(n(M), {
|
|
145
|
+
key: 0,
|
|
146
|
+
"model-value": u.value,
|
|
147
|
+
"onUpdate:modelValue": E,
|
|
146
148
|
"item-key": "key"
|
|
147
149
|
}, {
|
|
148
|
-
item:
|
|
149
|
-
|
|
150
|
+
item: h(({ element: o }) => [
|
|
151
|
+
w(o) ? (i(), p(R, {
|
|
150
152
|
key: 0,
|
|
151
153
|
value: o
|
|
152
|
-
}, null, 8, ["value"])) :
|
|
154
|
+
}, null, 8, ["value"])) : s("", !0)
|
|
153
155
|
]),
|
|
154
156
|
_: 1
|
|
155
|
-
}, 8, ["model-value"])
|
|
156
|
-
])) :
|
|
157
|
-
|
|
157
|
+
}, 8, ["model-value"])) : s("", !0)
|
|
158
|
+
])) : s("", !0),
|
|
159
|
+
r.value.length ? (i(), _("div", Z, [
|
|
158
160
|
g("span", {
|
|
159
|
-
class:
|
|
160
|
-
}, k(n(
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
"
|
|
161
|
+
class: f(n(d)("section-title"))
|
|
162
|
+
}, k(n(v)("ap.apTable.setting.unFixed")), 3),
|
|
163
|
+
y.value ? (i(), p(n(M), {
|
|
164
|
+
key: 0,
|
|
165
|
+
"model-value": r.value,
|
|
166
|
+
"onUpdate:modelValue": j,
|
|
164
167
|
"item-key": "key"
|
|
165
168
|
}, {
|
|
166
|
-
item:
|
|
167
|
-
|
|
169
|
+
item: h(({ element: o }) => [
|
|
170
|
+
w(o) ? (i(), p(R, {
|
|
168
171
|
key: 0,
|
|
169
172
|
value: o
|
|
170
|
-
}, null, 8, ["value"])) :
|
|
173
|
+
}, null, 8, ["value"])) : s("", !0)
|
|
171
174
|
]),
|
|
172
175
|
_: 1
|
|
173
|
-
}, 8, ["model-value"])
|
|
174
|
-
])) :
|
|
175
|
-
|
|
176
|
+
}, 8, ["model-value"])) : s("", !0)
|
|
177
|
+
])) : s("", !0),
|
|
178
|
+
c.value.length ? (i(), _("div", ee, [
|
|
176
179
|
g("span", {
|
|
177
|
-
class:
|
|
178
|
-
}, k(n(
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
"
|
|
180
|
+
class: f(n(d)("section-title"))
|
|
181
|
+
}, k(n(v)("ap.apTable.setting.fixToRight")), 3),
|
|
182
|
+
y.value ? (i(), p(n(M), {
|
|
183
|
+
key: 0,
|
|
184
|
+
"model-value": c.value,
|
|
185
|
+
"onUpdate:modelValue": A,
|
|
182
186
|
"item-key": "key"
|
|
183
187
|
}, {
|
|
184
|
-
item:
|
|
185
|
-
|
|
188
|
+
item: h(({ element: o }) => [
|
|
189
|
+
w(o) ? (i(), p(R, {
|
|
186
190
|
key: 0,
|
|
187
191
|
value: o
|
|
188
|
-
}, null, 8, ["value"])) :
|
|
192
|
+
}, null, 8, ["value"])) : s("", !0)
|
|
189
193
|
]),
|
|
190
194
|
_: 1
|
|
191
|
-
}, 8, ["model-value"])
|
|
192
|
-
])) :
|
|
195
|
+
}, 8, ["model-value"])) : s("", !0)
|
|
196
|
+
])) : s("", !0)
|
|
193
197
|
], 2)
|
|
194
198
|
], 2));
|
|
195
199
|
}
|
|
196
200
|
});
|
|
197
201
|
export {
|
|
198
|
-
|
|
202
|
+
fe as default
|
|
199
203
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ColumnsType } from 'ant-design-vue/es/table';
|
|
2
|
-
import { ApColumnState } from '../../interface';
|
|
2
|
+
import { ApColumnState, ApTableSettingDefaultValueType } from '../../interface';
|
|
3
3
|
/**
|
|
4
4
|
* 根据列状态重新生成表格列配置
|
|
5
5
|
* @param columns 表格列数组
|
|
@@ -15,3 +15,9 @@ export declare function customCloneColumnStates<T extends ApColumnState | ApColu
|
|
|
15
15
|
* @returns
|
|
16
16
|
*/
|
|
17
17
|
export declare function cloneLabelNode(node: any): any;
|
|
18
|
+
/**
|
|
19
|
+
* 生成可用于缓存的列状态对象
|
|
20
|
+
* @param columnStates
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
export declare function getColumnStateString(columnStates: ApColumnState[]): ApTableSettingDefaultValueType;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { cloneDeepWith as s } from "lodash-unified";
|
|
2
|
-
import { isVNode as
|
|
3
|
-
function
|
|
4
|
-
var
|
|
1
|
+
import { cloneDeepWith as s, omit as u } from "lodash-unified";
|
|
2
|
+
import { isVNode as c, cloneVNode as f } from "vue";
|
|
3
|
+
function d(t, o) {
|
|
4
|
+
var i;
|
|
5
5
|
const n = [];
|
|
6
|
-
for (const
|
|
7
|
-
const l =
|
|
8
|
-
if ((
|
|
9
|
-
const
|
|
6
|
+
for (const e of o) {
|
|
7
|
+
const l = t.find((r) => r.key === e.key);
|
|
8
|
+
if ((i = e.children) != null && i.length) {
|
|
9
|
+
const r = d(
|
|
10
10
|
l.children,
|
|
11
|
-
|
|
11
|
+
e.children
|
|
12
12
|
);
|
|
13
|
-
|
|
13
|
+
r.length && n.push({
|
|
14
14
|
...l,
|
|
15
|
-
fixed:
|
|
16
|
-
children:
|
|
15
|
+
fixed: e.fixed,
|
|
16
|
+
children: r
|
|
17
17
|
});
|
|
18
18
|
} else {
|
|
19
|
-
if (!
|
|
19
|
+
if (!e.show)
|
|
20
20
|
continue;
|
|
21
|
-
n.push({ ...l, fixed:
|
|
21
|
+
n.push({ ...l, fixed: e.fixed });
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
return n;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
return s(
|
|
26
|
+
function p(t) {
|
|
27
|
+
return s(t, (o, n) => {
|
|
28
28
|
if (n === "label")
|
|
29
|
-
return
|
|
29
|
+
return o;
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
const a = {
|
|
@@ -38,11 +38,26 @@ const a = {
|
|
|
38
38
|
"white-space": "unset",
|
|
39
39
|
wordBreak: "unset"
|
|
40
40
|
};
|
|
41
|
-
function
|
|
42
|
-
return
|
|
41
|
+
function y(t) {
|
|
42
|
+
return c(t) ? f(t, { style: a }) : t;
|
|
43
|
+
}
|
|
44
|
+
function b(t) {
|
|
45
|
+
function o(n) {
|
|
46
|
+
const i = {};
|
|
47
|
+
return n.forEach((e, l) => {
|
|
48
|
+
var r;
|
|
49
|
+
i[e.key] = {
|
|
50
|
+
...u(e, ["label", "key", "children"]),
|
|
51
|
+
order: l,
|
|
52
|
+
children: (r = e.children) != null && r.length ? o(e.children) : void 0
|
|
53
|
+
};
|
|
54
|
+
}), i;
|
|
55
|
+
}
|
|
56
|
+
return o(t);
|
|
43
57
|
}
|
|
44
58
|
export {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
59
|
+
y as cloneLabelNode,
|
|
60
|
+
p as customCloneColumnStates,
|
|
61
|
+
d as default,
|
|
62
|
+
b as getColumnStateString
|
|
48
63
|
};
|
|
@@ -9528,6 +9528,9 @@ export declare const apTableRenderItemMap: {
|
|
|
9528
9528
|
timezone: {
|
|
9529
9529
|
type: PropType<"RJ" | "PR" | "VD" | "CP" | "BS" | "MS" | "SP" | "DB" | "NY" | "KR" | "CG" | "TM" | "DV" | "SU" | "LA" | "SH" | "ALS">;
|
|
9530
9530
|
};
|
|
9531
|
+
readModeSeparator: {
|
|
9532
|
+
type: PropType<any>;
|
|
9533
|
+
};
|
|
9531
9534
|
}>> & {
|
|
9532
9535
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
9533
9536
|
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
@@ -9741,6 +9744,9 @@ export declare const apTableRenderItemMap: {
|
|
|
9741
9744
|
timezone: {
|
|
9742
9745
|
type: PropType<"RJ" | "PR" | "VD" | "CP" | "BS" | "MS" | "SP" | "DB" | "NY" | "KR" | "CG" | "TM" | "DV" | "SU" | "LA" | "SH" | "ALS">;
|
|
9743
9746
|
};
|
|
9747
|
+
readModeSeparator: {
|
|
9748
|
+
type: PropType<any>;
|
|
9749
|
+
};
|
|
9744
9750
|
}>> & {
|
|
9745
9751
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
9746
9752
|
}, {
|
|
@@ -9991,6 +9997,9 @@ export declare const apTableRenderItemMap: {
|
|
|
9991
9997
|
timezone: {
|
|
9992
9998
|
type: PropType<"RJ" | "PR" | "VD" | "CP" | "BS" | "MS" | "SP" | "DB" | "NY" | "KR" | "CG" | "TM" | "DV" | "SU" | "LA" | "SH" | "ALS">;
|
|
9993
9999
|
};
|
|
10000
|
+
readModeSeparator: {
|
|
10001
|
+
type: PropType<any>;
|
|
10002
|
+
};
|
|
9994
10003
|
}>> & {
|
|
9995
10004
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
9996
10005
|
}, {}, {}, {}, {}, {
|
|
@@ -10238,6 +10247,9 @@ export declare const apTableRenderItemMap: {
|
|
|
10238
10247
|
timezone: {
|
|
10239
10248
|
type: PropType<"RJ" | "PR" | "VD" | "CP" | "BS" | "MS" | "SP" | "DB" | "NY" | "KR" | "CG" | "TM" | "DV" | "SU" | "LA" | "SH" | "ALS">;
|
|
10240
10249
|
};
|
|
10250
|
+
readModeSeparator: {
|
|
10251
|
+
type: PropType<any>;
|
|
10252
|
+
};
|
|
10241
10253
|
}>> & {
|
|
10242
10254
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
10243
10255
|
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ApColumnState } from '../interface';
|
|
1
|
+
import { ApColumnState, ApTableSettingType } from '../interface';
|
|
2
2
|
import { Ref, ComputedRef } from 'vue';
|
|
3
|
-
export declare const useTableColumnState: (initialColumnState: ApColumnState[]) => {
|
|
3
|
+
export declare const useTableColumnState: (columnSetting: ApTableSettingType, initialColumnState: ApColumnState[]) => {
|
|
4
4
|
columnState: Ref<{
|
|
5
5
|
key: string | number;
|
|
6
6
|
show?: boolean | undefined;
|
|
@@ -8,6 +8,7 @@ export declare const useTableColumnState: (initialColumnState: ApColumnState[])
|
|
|
8
8
|
disabled?: boolean | undefined;
|
|
9
9
|
label?: any;
|
|
10
10
|
children?: any[] | undefined;
|
|
11
|
+
order?: number | undefined;
|
|
11
12
|
}[]>;
|
|
12
13
|
selectAll: () => void;
|
|
13
14
|
unSelectAll: () => void;
|
|
@@ -15,4 +16,7 @@ export declare const useTableColumnState: (initialColumnState: ApColumnState[])
|
|
|
15
16
|
setColumnState: (nextColumnState: ApColumnState[]) => void;
|
|
16
17
|
isAllSelected: ComputedRef<boolean>;
|
|
17
18
|
toggleSelectAll: () => void;
|
|
19
|
+
columnStateBackup: ApColumnState[];
|
|
20
|
+
setColumnStateBackup: (nextBackup: ApColumnState[]) => void;
|
|
21
|
+
cacheColumnStateIfNeeded: (nextColumnState: ApColumnState[]) => void;
|
|
18
22
|
};
|
|
@@ -1,46 +1,114 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { isDef as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { ref as _, unref as i, computed as j, watchEffect as z } from "vue";
|
|
2
|
+
import { isDef as D } from "../../utils/index.mjs";
|
|
3
|
+
import G, { customCloneColumnStates as k, getColumnStateString as R } from "../components/setting/utils.mjs";
|
|
4
|
+
import { useInjectApTable as W } from "../context.mjs";
|
|
5
|
+
import { isObject as v, mergeWith as E, isBoolean as X, omit as q, isNumber as N } from "lodash-unified";
|
|
6
|
+
function f(r, o) {
|
|
7
|
+
r.forEach((t) => {
|
|
8
|
+
var c;
|
|
9
|
+
o(t), (c = t.children) != null && c.length && f(t.children, o);
|
|
7
10
|
});
|
|
8
11
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
function H(r, o) {
|
|
13
|
+
if (!o)
|
|
14
|
+
return {};
|
|
15
|
+
const t = r.getItem(o);
|
|
16
|
+
return t ? JSON.parse(t) : {};
|
|
17
|
+
}
|
|
18
|
+
function I(r, o) {
|
|
19
|
+
if (v(r) && v(o))
|
|
20
|
+
return E({}, r, o, I);
|
|
21
|
+
}
|
|
22
|
+
const B = Number.MAX_SAFE_INTEGER, Z = (r, o) => {
|
|
23
|
+
const t = _(o);
|
|
24
|
+
let c = k(o);
|
|
25
|
+
const { columnsBackup: h, updateColumns: u } = W(), T = r.persistenceType || "localStorage", S = window[T];
|
|
26
|
+
function F() {
|
|
27
|
+
const e = H(
|
|
28
|
+
S,
|
|
29
|
+
r.persistenceKey
|
|
30
|
+
), n = E(
|
|
31
|
+
{},
|
|
32
|
+
r.defaultValue || {},
|
|
33
|
+
e,
|
|
34
|
+
I
|
|
35
|
+
), l = i(h);
|
|
36
|
+
function b(M, d, x) {
|
|
37
|
+
return M.map((s) => {
|
|
38
|
+
var A;
|
|
39
|
+
const a = (d == null ? void 0 : d[s.key]) || {}, m = {
|
|
40
|
+
key: s.key,
|
|
41
|
+
label: s.title,
|
|
42
|
+
show: !0,
|
|
43
|
+
fixed: x ? x.fixed : X(s.fixed) ? s.fixed ? "left" : void 0 : s.fixed,
|
|
44
|
+
disabled: !1,
|
|
45
|
+
...q(a, "children")
|
|
46
|
+
};
|
|
47
|
+
return m.children = (A = s.children) != null && A.length ? b(
|
|
48
|
+
s.children,
|
|
49
|
+
a.children,
|
|
50
|
+
m
|
|
51
|
+
) : void 0, m;
|
|
52
|
+
}).sort(
|
|
53
|
+
(s, a) => (N(s.order) ? s.order : B) - (N(a.order) ? a.order : B)
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
return b(l || [], n);
|
|
57
|
+
}
|
|
58
|
+
const g = j(() => i(t).every((e) => e.show));
|
|
59
|
+
function p() {
|
|
60
|
+
const e = i(t);
|
|
61
|
+
f(e, (n) => {
|
|
62
|
+
!n.disabled && (n.show = !0);
|
|
15
63
|
});
|
|
16
64
|
}
|
|
17
|
-
function
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
!
|
|
65
|
+
function C() {
|
|
66
|
+
const e = i(t);
|
|
67
|
+
f(e, (n) => {
|
|
68
|
+
!n.disabled && (n.show = !1);
|
|
21
69
|
});
|
|
22
70
|
}
|
|
23
|
-
function
|
|
24
|
-
|
|
71
|
+
function O() {
|
|
72
|
+
i(g) ? C() : p();
|
|
25
73
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
74
|
+
function K(e, n) {
|
|
75
|
+
f(i(t), (l) => {
|
|
76
|
+
l.key === e && (l.show = D(n) ? n : !l.show);
|
|
29
77
|
});
|
|
30
78
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
79
|
+
function w(e) {
|
|
80
|
+
t.value = e;
|
|
81
|
+
}
|
|
82
|
+
function J(e) {
|
|
83
|
+
c = e;
|
|
84
|
+
}
|
|
85
|
+
function y(e) {
|
|
86
|
+
if (r.persistenceKey) {
|
|
87
|
+
const n = R(e);
|
|
88
|
+
S.setItem(r.persistenceKey, JSON.stringify(n));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return z(() => {
|
|
92
|
+
const e = F();
|
|
93
|
+
w(e), u == null || u(
|
|
94
|
+
G(
|
|
95
|
+
i(h),
|
|
96
|
+
i(e)
|
|
97
|
+
)
|
|
98
|
+
), c = k(e), y(e);
|
|
99
|
+
}), {
|
|
100
|
+
columnState: t,
|
|
101
|
+
selectAll: p,
|
|
102
|
+
unSelectAll: C,
|
|
103
|
+
toggleSelect: K,
|
|
104
|
+
setColumnState: w,
|
|
105
|
+
isAllSelected: g,
|
|
106
|
+
toggleSelectAll: O,
|
|
107
|
+
columnStateBackup: c,
|
|
108
|
+
setColumnStateBackup: J,
|
|
109
|
+
cacheColumnStateIfNeeded: y
|
|
42
110
|
};
|
|
43
111
|
};
|
|
44
112
|
export {
|
|
45
|
-
|
|
113
|
+
Z as useTableColumnState
|
|
46
114
|
};
|
|
@@ -84,7 +84,7 @@ export type ApTableSettingType = {
|
|
|
84
84
|
/**
|
|
85
85
|
* 列的默认状态
|
|
86
86
|
*/
|
|
87
|
-
defaultValue?:
|
|
87
|
+
defaultValue?: ApTableSettingDefaultValueType;
|
|
88
88
|
/**
|
|
89
89
|
* 列状态变更时的回调(注意,返回的是全量状态)
|
|
90
90
|
* @param val
|
|
@@ -92,6 +92,9 @@ export type ApTableSettingType = {
|
|
|
92
92
|
*/
|
|
93
93
|
onChange?: (val: ApColumnState[]) => void;
|
|
94
94
|
};
|
|
95
|
+
export type ApTableSettingDefaultValueType = Recordable<Omit<ApColumnState, 'label' | 'key' | 'children'> & {
|
|
96
|
+
children?: ApTableSettingDefaultValueType;
|
|
97
|
+
}>;
|
|
95
98
|
export type ApColumnState = {
|
|
96
99
|
/**
|
|
97
100
|
* 列的唯一标识
|
|
@@ -117,6 +120,10 @@ export type ApColumnState = {
|
|
|
117
120
|
* 子节点状态
|
|
118
121
|
*/
|
|
119
122
|
children?: ApColumnState[];
|
|
123
|
+
/**
|
|
124
|
+
* 字段排序(和其同级的表头排序)
|
|
125
|
+
*/
|
|
126
|
+
order?: number;
|
|
120
127
|
};
|
|
121
128
|
export type FieldPropsType<ReturnType, RecordType, ExtraValueType, ValueType extends ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType> = ReturnType | ((opt: Partial<{
|
|
122
129
|
value: any;
|