@aplus-frontend/ui 0.6.0-beta.13 → 0.6.0-beta.15
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-grid/editable/form-item.vue.mjs +38 -35
- package/es/src/ap-grid/editable/index.vue.mjs +13 -10
- package/es/src/ap-grid/hooks/use-row-selection.d.ts +100 -0
- package/es/src/ap-grid/hooks/use-row-selection.mjs +122 -0
- package/es/src/ap-grid/index.vue.mjs +271 -222
- package/es/src/ap-grid/interface.d.ts +16 -0
- package/es/src/ap-grid/utils/table.mjs +15 -15
- package/es/src/ap-table/hooks/use-table-paging-ng.d.ts +6 -1
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +99 -96
- package/es/src/business/ap-copy/ApCopy.mjs +43 -43
- package/es/src/business/ap-label/group/ApLabelGroup.mjs +15 -16
- package/es/src/business/ap-label/interface.d.ts +2 -3
- package/es/src/business/ap-product-info/ApProductInfo.mjs +23 -24
- package/es/src/business/ap-table-modal/table-modal.vue2.mjs +43 -42
- package/es/src/business/ap-view/ap-view.vue.d.ts +4 -1
- package/es/src/business/ap-view/ap-view.vue2.mjs +96 -84
- package/es/src/business/ap-view/index.d.ts +12 -3
- package/es/src/business/ap-view/interface.d.ts +7 -0
- package/es/src/business/hooks/usePageListApGrid.mjs +17 -20
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ap-grid/editable/index.vue.js +1 -1
- package/lib/src/ap-grid/hooks/use-row-selection.d.ts +100 -0
- package/lib/src/ap-grid/hooks/use-row-selection.js +1 -0
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +16 -0
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.d.ts +6 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/business/ap-copy/ApCopy.js +1 -1
- package/lib/src/business/ap-label/group/ApLabelGroup.js +1 -1
- package/lib/src/business/ap-label/interface.d.ts +2 -3
- package/lib/src/business/ap-product-info/ApProductInfo.js +1 -1
- package/lib/src/business/ap-table-modal/table-modal.vue2.js +1 -1
- package/lib/src/business/ap-view/ap-view.vue.d.ts +4 -1
- package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
- package/lib/src/business/ap-view/index.d.ts +12 -3
- package/lib/src/business/ap-view/interface.d.ts +7 -0
- package/lib/src/business/hooks/usePageListApGrid.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +4 -3
- package/theme/ap-copy/ap-copy.css +2 -0
- package/theme/ap-copy/ap-copy.less +2 -0
- package/theme/ap-table-modal/index.css +15 -13
- package/theme/ap-table-modal/index.less +15 -13
- package/theme/index.css +17 -13
|
@@ -1,55 +1,54 @@
|
|
|
1
1
|
import { defineComponent as v, h as f, createVNode as l, createTextVNode as p } from "vue";
|
|
2
|
-
import { ApProductInfoProps as
|
|
2
|
+
import { ApProductInfoProps as m } from "./constans.mjs";
|
|
3
3
|
import "../../config-provider/index.mjs";
|
|
4
|
-
import { ApImage as
|
|
5
|
-
import { ApCopy as
|
|
4
|
+
import { ApImage as y } from "../ap-image/index.mjs";
|
|
5
|
+
import { ApCopy as a } from "../ap-copy/index.mjs";
|
|
6
6
|
import { useNamespace as b } from "../../config-provider/hooks/use-namespace.mjs";
|
|
7
|
-
import { useGlobalConfig as
|
|
7
|
+
import { useGlobalConfig as g } from "../../config-provider/hooks/use-global-config.mjs";
|
|
8
8
|
const N = /* @__PURE__ */ v({
|
|
9
9
|
name: "ApProductInfo",
|
|
10
|
-
props:
|
|
11
|
-
setup(
|
|
10
|
+
props: m(),
|
|
11
|
+
setup(i) {
|
|
12
12
|
const {
|
|
13
|
-
b:
|
|
13
|
+
b: n,
|
|
14
14
|
e: o,
|
|
15
15
|
m: r
|
|
16
|
-
} = b("ap-product-info"),
|
|
16
|
+
} = b("ap-product-info"), s = (e) => typeof e.value == "function" ? e.value() : f(a, {
|
|
17
17
|
text: e.value,
|
|
18
18
|
textStyle: e.link ? "link" : "minor",
|
|
19
19
|
link: e.link,
|
|
20
|
-
disableCopy:
|
|
21
|
-
}, e.value),
|
|
20
|
+
disableCopy: i.disableCopy
|
|
21
|
+
}, e.value), d = g("uiMode");
|
|
22
22
|
return () => l("div", {
|
|
23
|
-
class: [
|
|
23
|
+
class: [n(), `${r(d.value)}`]
|
|
24
24
|
}, [l("div", {
|
|
25
25
|
class: o("img")
|
|
26
|
-
}, [l(
|
|
27
|
-
src:
|
|
26
|
+
}, [l(y, {
|
|
27
|
+
src: i.imgSrc,
|
|
28
28
|
width: 44,
|
|
29
29
|
height: 44,
|
|
30
|
-
preview:
|
|
30
|
+
preview: i.preview
|
|
31
31
|
}, null)]), l("div", {
|
|
32
32
|
class: [o("content")]
|
|
33
|
-
}, [l(
|
|
34
|
-
disableCopy:
|
|
33
|
+
}, [l(a, {
|
|
34
|
+
disableCopy: i.disableCopy
|
|
35
35
|
}, {
|
|
36
|
-
default: () => [
|
|
36
|
+
default: () => [i.title]
|
|
37
37
|
}), l("div", {
|
|
38
38
|
class: o("row-container")
|
|
39
|
-
}, [
|
|
40
|
-
const
|
|
39
|
+
}, [i.values.map((e, u) => {
|
|
40
|
+
const t = e.col === 2, c = e.col !== 2 && u % 2 === 0;
|
|
41
41
|
return l("div", {
|
|
42
|
-
key:
|
|
43
|
-
class: [o("row-item"), r(
|
|
42
|
+
key: JSON.stringify(e),
|
|
43
|
+
class: [o("row-item"), r(t ? "full" : "half")]
|
|
44
44
|
}, [l("div", {
|
|
45
|
-
key: t,
|
|
46
45
|
class: [o("item")]
|
|
47
46
|
}, [e.label && l("div", {
|
|
48
47
|
class: o("label")
|
|
49
48
|
}, [e.label, l("span", null, [p(":")])]), l("div", {
|
|
50
|
-
class: [o("value"), !
|
|
49
|
+
class: [o("value"), !t && r("overflow")],
|
|
51
50
|
title: typeof e.value != "function" ? String(e.value || "") : ""
|
|
52
|
-
}, [
|
|
51
|
+
}, [s(e)])]), c && l("div", {
|
|
53
52
|
class: o("divider"),
|
|
54
53
|
style: {
|
|
55
54
|
right: 0
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { message as
|
|
1
|
+
import { defineComponent as H, ref as m, unref as s, computed as U, h as q, createBlock as k, openBlock as T, mergeProps as y, withCtx as h, createCommentVNode as V, createVNode as S, resolveDynamicComponent as $ } from "vue";
|
|
2
|
+
import { message as R, Modal as z } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../../config-provider/index.mjs";
|
|
4
|
-
import { ApTable as
|
|
5
|
-
import { cloneDeep as J, omit as
|
|
4
|
+
import { ApTable as W } from "../../ap-table/index.mjs";
|
|
5
|
+
import { cloneDeep as J, omit as B } from "lodash-unified";
|
|
6
6
|
import { transformTableParams as Q } from "@aplus-frontend/utils";
|
|
7
7
|
import "./modal-title.vue.mjs";
|
|
8
8
|
import { AsyncOpenResultError as b } from "./interface.mjs";
|
|
9
9
|
import "./table-layout/index.vue.mjs";
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
const pe = /* @__PURE__ */ U({
|
|
10
|
+
import { useLocale as X } from "../../config-provider/hooks/use-locale.mjs";
|
|
11
|
+
import Y from "./modal-title.vue2.mjs";
|
|
12
|
+
import Z from "./table-layout/index.vue2.mjs";
|
|
13
|
+
const ce = /* @__PURE__ */ H({
|
|
15
14
|
__name: "table-modal",
|
|
16
15
|
props: {
|
|
17
16
|
columns: {},
|
|
@@ -62,10 +61,10 @@ const pe = /* @__PURE__ */ U({
|
|
|
62
61
|
mousePosition: {}
|
|
63
62
|
},
|
|
64
63
|
emits: ["finish"],
|
|
65
|
-
setup(
|
|
66
|
-
const e =
|
|
64
|
+
setup(P, { expose: M, emit: K }) {
|
|
65
|
+
const e = P, _ = K, i = m(!1), x = m({}), d = m(null), a = m([]), C = m();
|
|
67
66
|
let c = null, n = null;
|
|
68
|
-
const
|
|
67
|
+
const { t: g } = X(), I = async (o = [], t = {}) => {
|
|
69
68
|
var l, r, u;
|
|
70
69
|
switch (a.value = [...o], i.value = !0, x.value = t == null ? void 0 : t.extraParams, C.value = t.apTableDataSources || ((l = e.apTableProps) == null ? void 0 : l.dataSource), t.refreshMode || "reset") {
|
|
71
70
|
case "reset":
|
|
@@ -82,7 +81,7 @@ const pe = /* @__PURE__ */ U({
|
|
|
82
81
|
});
|
|
83
82
|
}, w = () => {
|
|
84
83
|
i.value = !1, c = null, n == null || n(b.ModalCancel), n = null;
|
|
85
|
-
},
|
|
84
|
+
}, D = async (o) => {
|
|
86
85
|
o = Q({
|
|
87
86
|
...o,
|
|
88
87
|
...x.value
|
|
@@ -92,7 +91,7 @@ const pe = /* @__PURE__ */ U({
|
|
|
92
91
|
data: l,
|
|
93
92
|
total: r
|
|
94
93
|
};
|
|
95
|
-
},
|
|
94
|
+
}, L = () => {
|
|
96
95
|
if (a.value.length > e.maxCount) {
|
|
97
96
|
n == null || n(b.ExceedMaxCount);
|
|
98
97
|
return;
|
|
@@ -105,7 +104,7 @@ const pe = /* @__PURE__ */ U({
|
|
|
105
104
|
return;
|
|
106
105
|
}
|
|
107
106
|
i.value = !1;
|
|
108
|
-
},
|
|
107
|
+
}, N = U(() => {
|
|
109
108
|
if (!e.getRowKey) return;
|
|
110
109
|
const o = e.getRowKey;
|
|
111
110
|
return {
|
|
@@ -116,7 +115,7 @@ const pe = /* @__PURE__ */ U({
|
|
|
116
115
|
onSelectAll(t, l) {
|
|
117
116
|
var u, p;
|
|
118
117
|
if (l.length > e.maxCount) {
|
|
119
|
-
|
|
118
|
+
R.warning(
|
|
120
119
|
g("ap.apTableModal.messageMaxCount", {
|
|
121
120
|
maxCount: e.maxCount
|
|
122
121
|
})
|
|
@@ -125,7 +124,7 @@ const pe = /* @__PURE__ */ U({
|
|
|
125
124
|
}
|
|
126
125
|
const r = (u = d.value) == null ? void 0 : u.dataSource;
|
|
127
126
|
if (t) {
|
|
128
|
-
const f = s(r).filter((v) => !a.value.some((
|
|
127
|
+
const f = s(r).filter((v) => !a.value.some((G) => o(G) === o(v)));
|
|
129
128
|
a.value = a.value.concat(f);
|
|
130
129
|
} else
|
|
131
130
|
a.value = (p = a.value) == null ? void 0 : p.filter((f) => !r.some((v) => o(v) === o(f)));
|
|
@@ -133,7 +132,7 @@ const pe = /* @__PURE__ */ U({
|
|
|
133
132
|
onSelect(t, l) {
|
|
134
133
|
if (l) {
|
|
135
134
|
if (a.value.length >= e.maxCount) {
|
|
136
|
-
|
|
135
|
+
R.warning(
|
|
137
136
|
g("ap.apTableModal.messageMaxCount", {
|
|
138
137
|
maxCount: e.maxCount
|
|
139
138
|
})
|
|
@@ -154,8 +153,8 @@ const pe = /* @__PURE__ */ U({
|
|
|
154
153
|
}),
|
|
155
154
|
...e.rowSelection || {}
|
|
156
155
|
};
|
|
157
|
-
}),
|
|
158
|
-
|
|
156
|
+
}), A = () => e.isRenderModalTitleSuffix ? q(
|
|
157
|
+
Y,
|
|
159
158
|
{
|
|
160
159
|
title: e.title,
|
|
161
160
|
count: a.value.length || 0,
|
|
@@ -164,9 +163,9 @@ const pe = /* @__PURE__ */ U({
|
|
|
164
163
|
{
|
|
165
164
|
default: e.renderModalTitleSuffix ?? void 0
|
|
166
165
|
}
|
|
167
|
-
) : e.title,
|
|
166
|
+
) : e.title, O = () => d.value, E = () => {
|
|
168
167
|
a.value = [];
|
|
169
|
-
},
|
|
168
|
+
}, F = (o) => {
|
|
170
169
|
const t = e.getRowKey;
|
|
171
170
|
if (!t) return;
|
|
172
171
|
const l = a.value.findIndex(
|
|
@@ -174,16 +173,16 @@ const pe = /* @__PURE__ */ U({
|
|
|
174
173
|
);
|
|
175
174
|
a.value.splice(l, 1);
|
|
176
175
|
};
|
|
177
|
-
return
|
|
178
|
-
open:
|
|
176
|
+
return M({
|
|
177
|
+
open: I,
|
|
179
178
|
close: w,
|
|
180
|
-
getApTableInstance:
|
|
181
|
-
}), (o, t) => (T(), k(s(
|
|
179
|
+
getApTableInstance: O
|
|
180
|
+
}), (o, t) => (T(), k(s(z), y(
|
|
182
181
|
{
|
|
183
182
|
open: i.value,
|
|
184
183
|
"onUpdate:open": t[0] || (t[0] = (l) => i.value = l)
|
|
185
184
|
},
|
|
186
|
-
s(
|
|
185
|
+
s(B)(e, [
|
|
187
186
|
"api",
|
|
188
187
|
"getRowKey",
|
|
189
188
|
"centered",
|
|
@@ -198,33 +197,35 @@ const pe = /* @__PURE__ */ U({
|
|
|
198
197
|
"tableLayoutConfig"
|
|
199
198
|
]),
|
|
200
199
|
{
|
|
201
|
-
title:
|
|
202
|
-
"body-style": { maxHeight: "calc(100vh - 205px)", overflowY: "scroll" },
|
|
200
|
+
title: A(),
|
|
203
201
|
centered: e.centered ?? !0,
|
|
204
|
-
onOk:
|
|
202
|
+
onOk: L,
|
|
205
203
|
onCancel: w
|
|
206
204
|
}
|
|
207
205
|
), {
|
|
208
206
|
default: h(() => [
|
|
209
|
-
e.renderHeader ? (T(), k(
|
|
210
|
-
S(
|
|
207
|
+
e.renderHeader ? (T(), k($(e.renderHeader), { key: 0 })) : V("", !0),
|
|
208
|
+
S(Z, y(e.tableLayoutConfig || {}, {
|
|
211
209
|
"selected-list": a.value,
|
|
212
|
-
onClear:
|
|
213
|
-
onDeleteItem:
|
|
210
|
+
onClear: E,
|
|
211
|
+
onDeleteItem: F
|
|
214
212
|
}), {
|
|
215
213
|
default: h(() => [
|
|
216
|
-
S(s(
|
|
214
|
+
S(s(W), y({
|
|
217
215
|
ref_key: "apTableRef",
|
|
218
216
|
ref: d,
|
|
219
|
-
scroll: { y:
|
|
217
|
+
scroll: { y: 450 },
|
|
220
218
|
style: { padding: "0px" },
|
|
221
219
|
columns: o.columns,
|
|
222
|
-
request:
|
|
220
|
+
request: D,
|
|
223
221
|
"row-key": o.getRowKey,
|
|
224
|
-
"row-selection":
|
|
225
|
-
|
|
226
|
-
"
|
|
227
|
-
|
|
222
|
+
"row-selection": N.value,
|
|
223
|
+
"data-source": C.value,
|
|
224
|
+
"search-form": {
|
|
225
|
+
sortable: !1,
|
|
226
|
+
countPerRow: 2
|
|
227
|
+
}
|
|
228
|
+
}, s(B)(e.apTableProps, "dataSource")), null, 16, ["columns", "row-key", "row-selection", "data-source"])
|
|
228
229
|
]),
|
|
229
230
|
_: 1
|
|
230
231
|
}, 16, ["selected-list"])
|
|
@@ -234,5 +235,5 @@ const pe = /* @__PURE__ */ U({
|
|
|
234
235
|
}
|
|
235
236
|
});
|
|
236
237
|
export {
|
|
237
|
-
|
|
238
|
+
ce as default
|
|
238
239
|
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { ApViewProps } from './interface';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
-
declare const _default: DefineComponent<ApViewProps, {
|
|
3
|
+
declare const _default: DefineComponent<ApViewProps, {
|
|
4
|
+
setFirstDefaultSystemView: (value: boolean) => void;
|
|
5
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApViewProps> & Readonly<{}>, {
|
|
4
6
|
maxViewNum: number;
|
|
5
7
|
isDefaultSystemView: boolean;
|
|
8
|
+
isFirstDefaultSystemView: boolean;
|
|
6
9
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
7
10
|
export default _default;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as M, computed as B, ref as v, createVNode as _, watch as W, createBlock as h, openBlock as q, unref as K, mergeProps as H, withCtx as J, createElementVNode as Q, normalizeClass as X } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
|
-
import
|
|
4
|
-
import { ApBatchActionGroup as
|
|
3
|
+
import Z from "./icons/line-down.vue.mjs";
|
|
4
|
+
import { ApBatchActionGroup as U } from "../ap-batch-action-group/index.mjs";
|
|
5
5
|
import "./components/main-button-content.vue.mjs";
|
|
6
6
|
import "./components/menu-list-content.vue.mjs";
|
|
7
|
-
import { useViewProvide as
|
|
8
|
-
import { useInjectApTable as
|
|
7
|
+
import { useViewProvide as R } from "./hooks/use-view-provide.mjs";
|
|
8
|
+
import { useInjectApTable as S } from "../../ap-table/context.mjs";
|
|
9
9
|
import { SYSTEM_VIEW_KEY as y } from "./utils/enum.mjs";
|
|
10
|
-
import { isValid as
|
|
11
|
-
import { useGlobalConfig as
|
|
10
|
+
import { isValid as C } from "@aplus-frontend/utils";
|
|
11
|
+
import { useGlobalConfig as D } from "../../config-provider/hooks/use-global-config.mjs";
|
|
12
12
|
import { useNamespace as O } from "../../config-provider/hooks/use-namespace.mjs";
|
|
13
|
-
import { useLocale as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
const
|
|
13
|
+
import { useLocale as ee } from "../../config-provider/hooks/use-locale.mjs";
|
|
14
|
+
import te from "./components/main-button-content.vue2.mjs";
|
|
15
|
+
import ie from "./components/menu-list-content.vue2.mjs";
|
|
16
|
+
const ve = /* @__PURE__ */ M({
|
|
17
17
|
name: "ApView",
|
|
18
18
|
__name: "ap-view",
|
|
19
19
|
props: {
|
|
@@ -26,83 +26,91 @@ const Ve = /* @__PURE__ */ Y({
|
|
|
26
26
|
isDefaultSystemView: {
|
|
27
27
|
type: Boolean,
|
|
28
28
|
default: !1
|
|
29
|
+
},
|
|
30
|
+
isFirstDefaultSystemView: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !1
|
|
29
33
|
}
|
|
30
34
|
},
|
|
31
|
-
setup(
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
setup(E, {
|
|
36
|
+
expose: k
|
|
37
|
+
}) {
|
|
38
|
+
const f = E, A = D("viewCacheOption"), {
|
|
39
|
+
b
|
|
34
40
|
} = O("ap-view"), {
|
|
35
|
-
t:
|
|
36
|
-
} =
|
|
41
|
+
t: L
|
|
42
|
+
} = ee(), g = B(() => ({
|
|
37
43
|
viewKey: y,
|
|
38
|
-
viewName:
|
|
44
|
+
viewName: L("ap.apView.systemView")
|
|
39
45
|
})), {
|
|
40
|
-
getSearchFormValues:
|
|
41
|
-
setSearchFormValues:
|
|
42
|
-
submit:
|
|
43
|
-
reset:
|
|
44
|
-
} =
|
|
45
|
-
let
|
|
46
|
-
const
|
|
46
|
+
getSearchFormValues: P,
|
|
47
|
+
setSearchFormValues: T,
|
|
48
|
+
submit: j,
|
|
49
|
+
reset: G
|
|
50
|
+
} = S(), $ = v(!1), N = v(!1), V = v("");
|
|
51
|
+
let d = !1, F = !1;
|
|
52
|
+
const I = {
|
|
47
53
|
dropdownType: "dropdown",
|
|
48
|
-
content: _(
|
|
54
|
+
content: _(te, {
|
|
49
55
|
maxViewNum: f.maxViewNum
|
|
50
56
|
}, null)
|
|
51
|
-
}, o =
|
|
57
|
+
}, o = v([g.value]), Y = B(() => o.value.map((t) => ({
|
|
52
58
|
id: t.viewKey,
|
|
53
|
-
content: _(
|
|
59
|
+
content: _(ie, {
|
|
54
60
|
view: t
|
|
55
61
|
}, null)
|
|
56
62
|
}))), e = {
|
|
57
|
-
getSearchFormValues:
|
|
58
|
-
setSearchFormValues:
|
|
59
|
-
submit:
|
|
60
|
-
reset:
|
|
63
|
+
getSearchFormValues: P,
|
|
64
|
+
setSearchFormValues: T,
|
|
65
|
+
submit: j,
|
|
66
|
+
reset: G,
|
|
61
67
|
...f.saveDataSource
|
|
62
68
|
}, i = {
|
|
63
|
-
...
|
|
69
|
+
...A.value,
|
|
64
70
|
...f.viewCacheOption
|
|
65
71
|
}, x = () => {
|
|
66
72
|
if (f.isDefaultSystemView)
|
|
67
73
|
return y;
|
|
68
|
-
|
|
74
|
+
if ((f.isFirstDefaultSystemView || F) && d)
|
|
75
|
+
return y;
|
|
76
|
+
const t = o.value.find((s) => s.isDefault);
|
|
69
77
|
return (t == null ? void 0 : t.viewKey) ?? y;
|
|
70
78
|
}, p = (t) => {
|
|
71
79
|
V.value = t;
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
var
|
|
75
|
-
|
|
76
|
-
...Object.fromEntries(Object.keys(((m = e == null ? void 0 : e.getSearchFormValues) == null ? void 0 : m.call(e)) ?? {}).map((
|
|
77
|
-
...((a =
|
|
78
|
-
}), (u = e == null ? void 0 : e.submit) == null || u.call(e)),
|
|
80
|
+
const s = o.value.find((l) => l.viewKey === V.value);
|
|
81
|
+
s && setTimeout(() => {
|
|
82
|
+
var l, n, m, a, r, u;
|
|
83
|
+
s.viewKey === y ? d ? (l = e == null ? void 0 : e.submit) == null || l.call(e) : (n = e == null ? void 0 : e.reset) == null || n.call(e) : ((r = e == null ? void 0 : e.setSearchFormValues) == null || r.call(e, {
|
|
84
|
+
...Object.fromEntries(Object.keys(((m = e == null ? void 0 : e.getSearchFormValues) == null ? void 0 : m.call(e)) ?? {}).map((c) => [c, void 0])) ?? {},
|
|
85
|
+
...((a = s.viewConfig) == null ? void 0 : a.searchForm) ?? {}
|
|
86
|
+
}), (u = e == null ? void 0 : e.submit) == null || u.call(e)), d = !1;
|
|
79
87
|
});
|
|
80
|
-
},
|
|
88
|
+
}, w = {
|
|
81
89
|
getViewList: async (t) => {
|
|
82
|
-
var
|
|
90
|
+
var s;
|
|
83
91
|
try {
|
|
84
92
|
const {
|
|
85
|
-
tableKey:
|
|
86
|
-
} = t, n = await ((
|
|
87
|
-
tableKey:
|
|
93
|
+
tableKey: l
|
|
94
|
+
} = t, n = await ((s = i == null ? void 0 : i.getViewList) == null ? void 0 : s.call(i, {
|
|
95
|
+
tableKey: l
|
|
88
96
|
}));
|
|
89
|
-
return o.value = [
|
|
97
|
+
return o.value = [g.value, ...n ?? []], p(x()), o.value;
|
|
90
98
|
} catch {
|
|
91
|
-
return o.value = [
|
|
99
|
+
return o.value = [g.value], p(y), o.value;
|
|
92
100
|
}
|
|
93
101
|
},
|
|
94
102
|
addView: async (t) => {
|
|
95
103
|
var r;
|
|
96
104
|
const {
|
|
97
|
-
tableKey:
|
|
98
|
-
viewKey:
|
|
105
|
+
tableKey: s,
|
|
106
|
+
viewKey: l,
|
|
99
107
|
viewName: n,
|
|
100
108
|
isDefault: m,
|
|
101
109
|
viewConfig: a
|
|
102
110
|
} = t;
|
|
103
111
|
await ((r = i == null ? void 0 : i.addView) == null ? void 0 : r.call(i, {
|
|
104
|
-
tableKey:
|
|
105
|
-
viewKey:
|
|
112
|
+
tableKey: s,
|
|
113
|
+
viewKey: l,
|
|
106
114
|
viewName: n,
|
|
107
115
|
isDefault: m,
|
|
108
116
|
viewConfig: a
|
|
@@ -110,81 +118,85 @@ const Ve = /* @__PURE__ */ Y({
|
|
|
110
118
|
...u,
|
|
111
119
|
isDefault: !1
|
|
112
120
|
}))), o.value = [...o.value, {
|
|
113
|
-
viewKey:
|
|
121
|
+
viewKey: l,
|
|
114
122
|
viewName: n,
|
|
115
123
|
isDefault: m,
|
|
116
124
|
viewConfig: a
|
|
117
|
-
}], p(
|
|
125
|
+
}], p(l);
|
|
118
126
|
},
|
|
119
127
|
changeView: async (t) => {
|
|
120
128
|
var u;
|
|
121
129
|
const {
|
|
122
|
-
tableKey:
|
|
123
|
-
viewKey:
|
|
130
|
+
tableKey: s,
|
|
131
|
+
viewKey: l,
|
|
124
132
|
viewName: n,
|
|
125
133
|
isDefault: m,
|
|
126
134
|
viewConfig: a
|
|
127
135
|
} = t;
|
|
128
136
|
await ((u = i == null ? void 0 : i.changeView) == null ? void 0 : u.call(i, {
|
|
129
|
-
tableKey:
|
|
130
|
-
viewKey:
|
|
137
|
+
tableKey: s,
|
|
138
|
+
viewKey: l,
|
|
131
139
|
viewName: n,
|
|
132
140
|
isDefault: m,
|
|
133
141
|
viewConfig: a
|
|
134
|
-
})), m && (o.value = o.value.map((
|
|
135
|
-
...
|
|
142
|
+
})), m && (o.value = o.value.map((c) => ({
|
|
143
|
+
...c,
|
|
136
144
|
isDefault: !1
|
|
137
145
|
})));
|
|
138
|
-
const r = o.value.find((
|
|
139
|
-
r && (r.viewName = n, r.isDefault = m, r.viewConfig = a), p(
|
|
146
|
+
const r = o.value.find((c) => c.viewKey === l);
|
|
147
|
+
r && (r.viewName = n, r.isDefault = m, r.viewConfig = a), p(l);
|
|
140
148
|
},
|
|
141
149
|
removeView: async (t) => {
|
|
142
150
|
var n;
|
|
143
151
|
const {
|
|
144
|
-
tableKey:
|
|
145
|
-
viewKey:
|
|
152
|
+
tableKey: s,
|
|
153
|
+
viewKey: l
|
|
146
154
|
} = t;
|
|
147
155
|
await ((n = i == null ? void 0 : i.removeView) == null ? void 0 : n.call(i, {
|
|
148
|
-
tableKey:
|
|
149
|
-
viewKey:
|
|
150
|
-
})), o.value = o.value.filter((m) => m.viewKey !==
|
|
156
|
+
tableKey: s,
|
|
157
|
+
viewKey: l
|
|
158
|
+
})), o.value = o.value.filter((m) => m.viewKey !== l), l === V.value && p(x());
|
|
151
159
|
}
|
|
152
|
-
},
|
|
160
|
+
}, z = {
|
|
153
161
|
tableKey: f.tableKey,
|
|
154
162
|
currentViewKey: V,
|
|
155
163
|
changeCurrentViewKey: p,
|
|
156
|
-
popoverOpen:
|
|
157
|
-
menuOpen:
|
|
164
|
+
popoverOpen: $,
|
|
165
|
+
menuOpen: N,
|
|
158
166
|
viewList: o,
|
|
159
|
-
viewListCRUD:
|
|
167
|
+
viewListCRUD: w,
|
|
160
168
|
saveDataSource: e
|
|
161
169
|
};
|
|
162
|
-
return
|
|
163
|
-
var
|
|
164
|
-
|
|
170
|
+
return R(z), W(() => f.tableKey, (t) => {
|
|
171
|
+
var s;
|
|
172
|
+
C(t) && (d = !0, (s = w == null ? void 0 : w.getViewList) == null || s.call(w, {
|
|
165
173
|
tableKey: t
|
|
166
174
|
}));
|
|
167
175
|
}, {
|
|
168
176
|
immediate: !0
|
|
169
|
-
}), (
|
|
177
|
+
}), k({
|
|
178
|
+
setFirstDefaultSystemView: (t) => {
|
|
179
|
+
F = t;
|
|
180
|
+
}
|
|
181
|
+
}), (t, s) => (q(), h(K(U), H({
|
|
170
182
|
...t.$attrs
|
|
171
183
|
}, {
|
|
172
|
-
open:
|
|
173
|
-
"onUpdate:open":
|
|
174
|
-
class: [
|
|
175
|
-
"button-props":
|
|
176
|
-
"menu-list":
|
|
177
|
-
"overlay-class-name": [
|
|
184
|
+
open: N.value,
|
|
185
|
+
"onUpdate:open": s[0] || (s[0] = (l) => N.value = l),
|
|
186
|
+
class: [K(b)()],
|
|
187
|
+
"button-props": I,
|
|
188
|
+
"menu-list": Y.value,
|
|
189
|
+
"overlay-class-name": [K(b)("overlay")],
|
|
178
190
|
trigger: "click",
|
|
179
191
|
placement: "bottom"
|
|
180
192
|
}), {
|
|
181
|
-
icon:
|
|
182
|
-
class:
|
|
183
|
-
}, [_(
|
|
193
|
+
icon: J(() => [Q("div", {
|
|
194
|
+
class: X([K(b)("icon")])
|
|
195
|
+
}, [_(Z)], 2)]),
|
|
184
196
|
_: 1
|
|
185
197
|
}, 16, ["open", "class", "menu-list", "overlay-class-name"]));
|
|
186
198
|
}
|
|
187
199
|
});
|
|
188
200
|
export {
|
|
189
|
-
|
|
201
|
+
ve as default
|
|
190
202
|
};
|
|
@@ -2,9 +2,12 @@ import { CreateComponentPublicInstanceWithMixins, ComponentOptionsMixin, PublicP
|
|
|
2
2
|
import { ApViewProps } from './interface';
|
|
3
3
|
export * from './interface';
|
|
4
4
|
declare const ApView: {
|
|
5
|
-
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< ApViewProps> & Readonly<{}>, {
|
|
5
|
+
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< ApViewProps> & Readonly<{}>, {
|
|
6
|
+
setFirstDefaultSystemView: (value: boolean) => void;
|
|
7
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
|
|
6
8
|
maxViewNum: number;
|
|
7
9
|
isDefaultSystemView: boolean;
|
|
10
|
+
isFirstDefaultSystemView: boolean;
|
|
8
11
|
}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
|
9
12
|
P: {};
|
|
10
13
|
B: {};
|
|
@@ -12,16 +15,22 @@ declare const ApView: {
|
|
|
12
15
|
C: {};
|
|
13
16
|
M: {};
|
|
14
17
|
Defaults: {};
|
|
15
|
-
}, Readonly< ApViewProps> & Readonly<{}>, {
|
|
18
|
+
}, Readonly< ApViewProps> & Readonly<{}>, {
|
|
19
|
+
setFirstDefaultSystemView: (value: boolean) => void;
|
|
20
|
+
}, {}, {}, {}, {
|
|
16
21
|
maxViewNum: number;
|
|
17
22
|
isDefaultSystemView: boolean;
|
|
23
|
+
isFirstDefaultSystemView: boolean;
|
|
18
24
|
}>;
|
|
19
25
|
__isFragment?: never;
|
|
20
26
|
__isTeleport?: never;
|
|
21
27
|
__isSuspense?: never;
|
|
22
|
-
} & ComponentOptionsBase<Readonly< ApViewProps> & Readonly<{}>, {
|
|
28
|
+
} & ComponentOptionsBase<Readonly< ApViewProps> & Readonly<{}>, {
|
|
29
|
+
setFirstDefaultSystemView: (value: boolean) => void;
|
|
30
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
|
|
23
31
|
maxViewNum: number;
|
|
24
32
|
isDefaultSystemView: boolean;
|
|
33
|
+
isFirstDefaultSystemView: boolean;
|
|
25
34
|
}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & ( Plugin & (new (...args: any[]) => {
|
|
26
35
|
$props: {
|
|
27
36
|
onClick?: () => void;
|
|
@@ -59,4 +59,11 @@ export interface ApViewProps {
|
|
|
59
59
|
* 指定默认视图为系统视图
|
|
60
60
|
*/
|
|
61
61
|
isDefaultSystemView?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* 指定初始化默认视图为系统视图(仅初始化生效)
|
|
64
|
+
*/
|
|
65
|
+
isFirstDefaultSystemView?: boolean;
|
|
66
|
+
}
|
|
67
|
+
export interface ApViewExpose {
|
|
68
|
+
setFirstDefaultSystemView: (value: boolean) => void;
|
|
62
69
|
}
|