@aplus-frontend/ui 0.6.0-beta.13 → 0.6.0-beta.14
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/index.vue.mjs +110 -95
- package/es/src/ap-grid/interface.d.ts +10 -0
- package/es/src/ap-grid/utils/table.mjs +15 -14
- package/es/src/business/ap-copy/ApCopy.mjs +43 -43
- package/es/src/business/ap-product-info/ApProductInfo.mjs +23 -24
- 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/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +10 -0
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/business/ap-copy/ApCopy.js +1 -1
- package/lib/src/business/ap-product-info/ApProductInfo.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/index.css +2 -0
|
@@ -239,6 +239,10 @@ export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
|
|
|
239
239
|
* 作为表单项时内部传递,请勿使用
|
|
240
240
|
*/
|
|
241
241
|
value?: any;
|
|
242
|
+
/**
|
|
243
|
+
* 行是否可以被高亮(传入函数可以获取当前被选中的行)
|
|
244
|
+
*/
|
|
245
|
+
rowHighlightable?: boolean | ((current: RecordType) => void);
|
|
242
246
|
};
|
|
243
247
|
export type ApGridVirtualConfig = {
|
|
244
248
|
x?: false | number;
|
|
@@ -303,4 +307,10 @@ export type ApGridExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
|
303
307
|
* @returns
|
|
304
308
|
*/
|
|
305
309
|
getDataSource: () => RecordType[];
|
|
310
|
+
/**
|
|
311
|
+
* 设置某一行被选中
|
|
312
|
+
* @param nextRow
|
|
313
|
+
* @returns
|
|
314
|
+
*/
|
|
315
|
+
setCurrentRow: (nextRow: Partial<RecordType>) => void;
|
|
306
316
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { omit as
|
|
1
|
+
import { omit as s, isUndefined as u, isFunction as h, isNumber as m } from "lodash-unified";
|
|
2
2
|
import { isDef as w } from "../../utils/index.mjs";
|
|
3
|
-
const
|
|
3
|
+
const C = 20, b = 50, y = (e) => e.some((t) => !!t.html);
|
|
4
4
|
function v(e) {
|
|
5
5
|
var i;
|
|
6
6
|
const t = {
|
|
7
|
-
...
|
|
7
|
+
...s(e, [
|
|
8
8
|
"columns",
|
|
9
9
|
"request",
|
|
10
10
|
"searchForm",
|
|
@@ -16,8 +16,9 @@ function v(e) {
|
|
|
16
16
|
};
|
|
17
17
|
if (t.rowConfig = {
|
|
18
18
|
isHover: !0,
|
|
19
|
-
keyField: e.rowKey
|
|
20
|
-
|
|
19
|
+
keyField: e.rowKey,
|
|
20
|
+
isCurrent: !!e.rowHighlightable
|
|
21
|
+
}, t.columnConfig = {}, y(e.columns || []) && (t.rowConfig.useKey = !0, t.columnConfig.useKey = !0), e.adaptive && (t.autoResize = !0, t.height = "100%"), e.columnResizable && (t.columnConfig.resizable = !0), e.rowSelection) {
|
|
21
22
|
const o = e.rowSelection === !0 ? {} : e.rowSelection;
|
|
22
23
|
o.type === "radio" ? t.radioConfig = {
|
|
23
24
|
highlight: !0,
|
|
@@ -28,7 +29,7 @@ function v(e) {
|
|
|
28
29
|
return o.shown ? o.shown(r) : !0;
|
|
29
30
|
},
|
|
30
31
|
checkRowKey: (i = o.defaultSelectedRowKeys) == null ? void 0 : i[0],
|
|
31
|
-
reserve:
|
|
32
|
+
reserve: u(o.preserveSelectedRowKeys) ? !0 : o.preserveSelectedRowKeys
|
|
32
33
|
} : t.checkboxConfig = {
|
|
33
34
|
highlight: !0,
|
|
34
35
|
checkMethod({ row: r }) {
|
|
@@ -38,11 +39,11 @@ function v(e) {
|
|
|
38
39
|
return o.shown ? o.shown(r) : !0;
|
|
39
40
|
},
|
|
40
41
|
checkRowKeys: o.defaultSelectedRowKeys,
|
|
41
|
-
reserve:
|
|
42
|
+
reserve: u(o.preserveSelectedRowKeys) ? !0 : o.preserveSelectedRowKeys,
|
|
42
43
|
range: o.range || !1
|
|
43
44
|
};
|
|
44
45
|
}
|
|
45
|
-
return t.border = e.bordered === !1 ? "inner" : !0, e.expandable && (t.expandConfig =
|
|
46
|
+
return t.border = e.bordered === !1 ? "inner" : !0, e.expandable && (t.expandConfig = s(e.expandable, [
|
|
46
47
|
"renderContent",
|
|
47
48
|
"width",
|
|
48
49
|
"title"
|
|
@@ -50,22 +51,22 @@ function v(e) {
|
|
|
50
51
|
enabled: !1
|
|
51
52
|
}, t.virtualYConfig = {
|
|
52
53
|
enabled: !1
|
|
53
|
-
}) : (
|
|
54
|
+
}) : (a(t, "X", e.virtual), a(t, "Y", e.virtual)), t.round = w(e.round) ? e.round : !e.card, t;
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
-
const i = t === "X", o = i ? "x" : "y", r = i ? "virtualXConfig" : "virtualYConfig", d = n == null ? void 0 : n[o],
|
|
56
|
+
function a(e, t, n) {
|
|
57
|
+
const i = t === "X", o = i ? "x" : "y", r = i ? "virtualXConfig" : "virtualYConfig", d = n == null ? void 0 : n[o], f = d !== !1, l = i ? C : b, c = m(d) && d >= 0 ? d : l;
|
|
57
58
|
e[r] = {
|
|
58
|
-
enabled:
|
|
59
|
+
enabled: f,
|
|
59
60
|
gt: c,
|
|
60
61
|
oSize: (n == null ? void 0 : n.oSize) || 0
|
|
61
62
|
};
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
+
function g(e) {
|
|
64
65
|
return e === !0 ? "left" : e;
|
|
65
66
|
}
|
|
66
67
|
function K(e, t) {
|
|
67
68
|
const n = e === !0 || !e.type ? "checkbox" : e.type, i = e === !0 ? 60 : e.columnWidth || 60;
|
|
68
|
-
let o = e === !0 ? void 0 :
|
|
69
|
+
let o = e === !0 ? void 0 : g(e.fixed);
|
|
69
70
|
return o || (o === !1 ? o = void 0 : o = t.some(
|
|
70
71
|
(r) => r.fixed === "left" || r.fixed === !0
|
|
71
72
|
) ? "left" : void 0), {
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { defineComponent as T, Text as
|
|
2
|
-
import { ApCopyProps as
|
|
1
|
+
import { defineComponent as T, Text as p, isVNode as y, computed as m, createVNode as n, Fragment as b } from "vue";
|
|
2
|
+
import { ApCopyProps as h } from "./constans.mjs";
|
|
3
3
|
import { IconApAdLineCopy as k } from "@aplus-frontend/icon";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
|
-
import { message as
|
|
6
|
-
import { isNull as
|
|
7
|
-
import { useNamespace as
|
|
8
|
-
import { useLocale as
|
|
9
|
-
const
|
|
5
|
+
import { message as d } from "@aplus-frontend/antdv";
|
|
6
|
+
import { isNull as P, isUndefined as j } from "lodash-unified";
|
|
7
|
+
import { useNamespace as A } from "../../config-provider/hooks/use-namespace.mjs";
|
|
8
|
+
import { useLocale as N } from "../../config-provider/hooks/use-locale.mjs";
|
|
9
|
+
const D = /* @__PURE__ */ T({
|
|
10
10
|
name: "CopyBtn",
|
|
11
|
-
props:
|
|
12
|
-
setup(
|
|
13
|
-
slots:
|
|
11
|
+
props: h(),
|
|
12
|
+
setup(r, {
|
|
13
|
+
slots: a
|
|
14
14
|
}) {
|
|
15
15
|
const {
|
|
16
|
-
b:
|
|
17
|
-
e:
|
|
18
|
-
m:
|
|
19
|
-
} =
|
|
20
|
-
t:
|
|
21
|
-
} =
|
|
22
|
-
navigator.clipboard.writeText(
|
|
23
|
-
|
|
16
|
+
b: x,
|
|
17
|
+
e: l,
|
|
18
|
+
m: g
|
|
19
|
+
} = A("ap-copy"), {
|
|
20
|
+
t: u
|
|
21
|
+
} = N(), v = (t) => {
|
|
22
|
+
t.stopPropagation(), t.preventDefault(), t.stopImmediatePropagation(), navigator.clipboard.writeText(r.text || c() || "").then(() => {
|
|
23
|
+
d.success(u("ap.apCopy.copySuccess"));
|
|
24
24
|
}).catch(() => {
|
|
25
|
-
|
|
25
|
+
d.error(u("ap.apCopy.copyError"));
|
|
26
26
|
});
|
|
27
27
|
}, S = (t) => {
|
|
28
28
|
if (t.length === 1) {
|
|
29
29
|
const e = t[0];
|
|
30
|
-
if (e.type ===
|
|
30
|
+
if (e.type === p || e.type.toString() === "Symbol(Text)" || y(e) && typeof e.children == "string")
|
|
31
31
|
return !0;
|
|
32
32
|
}
|
|
33
33
|
return !1;
|
|
34
34
|
}, C = (t) => {
|
|
35
35
|
if (!t.length) return "";
|
|
36
36
|
const e = t[0];
|
|
37
|
-
return e.type ===
|
|
38
|
-
},
|
|
37
|
+
return e.type === p || e.type.toString() === "Symbol(Text)" ? String(e.children) : y(e) && typeof e.children == "string" ? e.children : "";
|
|
38
|
+
}, c = () => {
|
|
39
39
|
var f;
|
|
40
|
-
const t = (f =
|
|
40
|
+
const t = (f = a.default) == null ? void 0 : f.call(a);
|
|
41
41
|
return t && S(t) ? C(t) : null;
|
|
42
|
-
}, s = (t) => !(
|
|
43
|
-
if (typeof
|
|
44
|
-
switch (
|
|
42
|
+
}, s = (t) => !(P(t) || j(t) || typeof t == "string" && t === ""), o = m(() => {
|
|
43
|
+
if (typeof r.textStyle == "string")
|
|
44
|
+
switch (r.textStyle) {
|
|
45
45
|
case "link":
|
|
46
46
|
return "text-link";
|
|
47
47
|
case "minor":
|
|
@@ -51,29 +51,29 @@ const I = /* @__PURE__ */ T({
|
|
|
51
51
|
default:
|
|
52
52
|
return "text-major";
|
|
53
53
|
}
|
|
54
|
-
else if (typeof
|
|
54
|
+
else if (typeof r.textStyle == "object")
|
|
55
55
|
return {
|
|
56
|
-
...
|
|
56
|
+
...r.textStyle
|
|
57
57
|
};
|
|
58
58
|
return {};
|
|
59
|
-
}),
|
|
60
|
-
return () =>
|
|
61
|
-
class: [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
href: n.link,
|
|
59
|
+
}), i = m(() => c() || r.text || "");
|
|
60
|
+
return () => n(b, null, [n("div", {
|
|
61
|
+
class: [x()]
|
|
62
|
+
}, [n("div", {
|
|
63
|
+
class: [l("text"), typeof o.value == "string" && g(o.value)],
|
|
64
|
+
style: typeof o.value != "string" && o.value,
|
|
65
|
+
title: typeof o.value == "string" ? i.value : ""
|
|
66
|
+
}, [s(i.value) ? r.link ? n("a", {
|
|
67
|
+
href: r.link,
|
|
69
68
|
target: "_blank"
|
|
70
|
-
}, [
|
|
71
|
-
class: [
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
}, [i.value]) : i.value : "--"]), s(i.value) && !r.disableCopy && n("div", {
|
|
70
|
+
class: [l("copy-btn"), "copy-btn"],
|
|
71
|
+
onClick: r.disableCopy ? void 0 : v
|
|
72
|
+
}, [n(k, {
|
|
73
|
+
size: r.size
|
|
74
74
|
}, null)])])]);
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
export {
|
|
78
|
-
|
|
78
|
+
D as default
|
|
79
79
|
};
|
|
@@ -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,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
|
}
|