@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.
Files changed (32) hide show
  1. package/es/src/ap-grid/editable/form-item.vue.mjs +38 -35
  2. package/es/src/ap-grid/editable/index.vue.mjs +13 -10
  3. package/es/src/ap-grid/index.vue.mjs +110 -95
  4. package/es/src/ap-grid/interface.d.ts +10 -0
  5. package/es/src/ap-grid/utils/table.mjs +15 -14
  6. package/es/src/business/ap-copy/ApCopy.mjs +43 -43
  7. package/es/src/business/ap-product-info/ApProductInfo.mjs +23 -24
  8. package/es/src/business/ap-view/ap-view.vue.d.ts +4 -1
  9. package/es/src/business/ap-view/ap-view.vue2.mjs +96 -84
  10. package/es/src/business/ap-view/index.d.ts +12 -3
  11. package/es/src/business/ap-view/interface.d.ts +7 -0
  12. package/es/src/business/hooks/usePageListApGrid.mjs +17 -20
  13. package/es/src/version.d.ts +1 -1
  14. package/es/src/version.mjs +1 -1
  15. package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
  16. package/lib/src/ap-grid/editable/index.vue.js +1 -1
  17. package/lib/src/ap-grid/index.vue.js +1 -1
  18. package/lib/src/ap-grid/interface.d.ts +10 -0
  19. package/lib/src/ap-grid/utils/table.js +1 -1
  20. package/lib/src/business/ap-copy/ApCopy.js +1 -1
  21. package/lib/src/business/ap-product-info/ApProductInfo.js +1 -1
  22. package/lib/src/business/ap-view/ap-view.vue.d.ts +4 -1
  23. package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
  24. package/lib/src/business/ap-view/index.d.ts +12 -3
  25. package/lib/src/business/ap-view/interface.d.ts +7 -0
  26. package/lib/src/business/hooks/usePageListApGrid.js +1 -1
  27. package/lib/src/version.d.ts +1 -1
  28. package/lib/src/version.js +1 -1
  29. package/package.json +4 -3
  30. package/theme/ap-copy/ap-copy.css +2 -0
  31. package/theme/ap-copy/ap-copy.less +2 -0
  32. 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 u, isUndefined as l, isFunction as h, isNumber as m } from "lodash-unified";
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 y = 20, C = 50, b = (e) => e.some((t) => !!t.html);
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
- ...u(e, [
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
- }, t.columnConfig = {}, b(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) {
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: l(o.preserveSelectedRowKeys) ? !0 : o.preserveSelectedRowKeys
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: l(o.preserveSelectedRowKeys) ? !0 : o.preserveSelectedRowKeys,
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 = u(e.expandable, [
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
- }) : (f(t, "X", e.virtual), f(t, "Y", e.virtual)), t.round = w(e.round) ? e.round : !e.card, t;
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 f(e, t, n) {
56
- const i = t === "X", o = i ? "x" : "y", r = i ? "virtualXConfig" : "virtualYConfig", d = n == null ? void 0 : n[o], a = d !== !1, s = i ? y : C, c = m(d) && d >= 0 ? d : s;
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: a,
59
+ enabled: f,
59
60
  gt: c,
60
61
  oSize: (n == null ? void 0 : n.oSize) || 0
61
62
  };
62
63
  }
63
- function x(e) {
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 : x(e.fixed);
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 y, isVNode as p, computed as b, createVNode as r, Fragment as h } from "vue";
2
- import { ApCopyProps as v } from "./constans.mjs";
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 m } from "@aplus-frontend/antdv";
6
- import { isNull as j, isUndefined as A } from "lodash-unified";
7
- import { useNamespace as N } from "../../config-provider/hooks/use-namespace.mjs";
8
- import { useLocale as P } from "../../config-provider/hooks/use-locale.mjs";
9
- const I = /* @__PURE__ */ T({
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: v(),
12
- setup(n, {
13
- slots: l
11
+ props: h(),
12
+ setup(r, {
13
+ slots: a
14
14
  }) {
15
15
  const {
16
- b: d,
17
- e: a,
18
- m: x
19
- } = N("ap-copy"), {
20
- t: c
21
- } = P(), g = () => {
22
- navigator.clipboard.writeText(n.text || u() || "").then(() => {
23
- m.success(c("ap.apCopy.copySuccess"));
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
- m.error(c("ap.apCopy.copyError"));
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 === y || e.type.toString() === "Symbol(Text)" || p(e) && typeof e.children == "string")
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 === y || e.type.toString() === "Symbol(Text)" ? String(e.children) : p(e) && typeof e.children == "string" ? e.children : "";
38
- }, u = () => {
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 = l.default) == null ? void 0 : f.call(l);
40
+ const t = (f = a.default) == null ? void 0 : f.call(a);
41
41
  return t && S(t) ? C(t) : null;
42
- }, s = (t) => !(j(t) || A(t) || typeof t == "string" && t === ""), i = b(() => {
43
- if (typeof n.textStyle == "string")
44
- switch (n.textStyle) {
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 n.textStyle == "object")
54
+ else if (typeof r.textStyle == "object")
55
55
  return {
56
- ...n.textStyle
56
+ ...r.textStyle
57
57
  };
58
58
  return {};
59
- }), o = u() || n.text || "";
60
- return () => r(h, null, [r("div", {
61
- class: [d()],
62
- onClick: n.disableCopy ? void 0 : g
63
- }, [r("div", {
64
- class: [a("text"), typeof i.value == "string" && x(i.value)],
65
- style: typeof i.value != "string" && i.value,
66
- title: typeof i.value == "string" ? o : ""
67
- }, [s(o) ? n.link ? r("a", {
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
- }, [o]) : o : "--"]), s(o) && !n.disableCopy && r("div", {
71
- class: [a("copy-btn"), "copy-btn"]
72
- }, [r(k, {
73
- size: n.size
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
- I as default
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 y } from "./constans.mjs";
2
+ import { ApProductInfoProps as m } from "./constans.mjs";
3
3
  import "../../config-provider/index.mjs";
4
- import { ApImage as m } from "../ap-image/index.mjs";
5
- import { ApCopy as n } from "../ap-copy/index.mjs";
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 h } from "../../config-provider/hooks/use-global-config.mjs";
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: y(),
11
- setup(a) {
10
+ props: m(),
11
+ setup(i) {
12
12
  const {
13
- b: s,
13
+ b: n,
14
14
  e: o,
15
15
  m: r
16
- } = b("ap-product-info"), u = (e) => typeof e.value == "function" ? e.value() : f(n, {
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: a.disableCopy
21
- }, e.value), c = h("uiMode");
20
+ disableCopy: i.disableCopy
21
+ }, e.value), d = g("uiMode");
22
22
  return () => l("div", {
23
- class: [s(), `${r(c.value)}`]
23
+ class: [n(), `${r(d.value)}`]
24
24
  }, [l("div", {
25
25
  class: o("img")
26
- }, [l(m, {
27
- src: a.imgSrc,
26
+ }, [l(y, {
27
+ src: i.imgSrc,
28
28
  width: 44,
29
29
  height: 44,
30
- preview: a.preview
30
+ preview: i.preview
31
31
  }, null)]), l("div", {
32
32
  class: [o("content")]
33
- }, [l(n, {
34
- disableCopy: a.disableCopy
33
+ }, [l(a, {
34
+ disableCopy: i.disableCopy
35
35
  }, {
36
- default: () => [a.title]
36
+ default: () => [i.title]
37
37
  }), l("div", {
38
38
  class: o("row-container")
39
- }, [a.values.map((e, t) => {
40
- const i = e.col === 2, d = e.col !== 2 && t % 2 === 0;
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: t,
43
- class: [o("row-item"), r(i ? "full" : "half")]
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"), !i && r("overflow")],
49
+ class: [o("value"), !t && r("overflow")],
51
50
  title: typeof e.value != "function" ? String(e.value || "") : ""
52
- }, [typeof e.value == "function" ? e.value() : u(e)])]), d && l("div", {
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, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApViewProps> & Readonly<{}>, {
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 Y, computed as E, ref as d, createVNode as _, watch as z, createBlock as M, openBlock as W, unref as v, mergeProps as h, withCtx as q, createElementVNode as H, normalizeClass as J } from "vue";
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 Q from "./icons/line-down.vue.mjs";
4
- import { ApBatchActionGroup as X } from "../ap-batch-action-group/index.mjs";
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 Z } from "./hooks/use-view-provide.mjs";
8
- import { useInjectApTable as U } from "../../ap-table/context.mjs";
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 R } from "@aplus-frontend/utils";
11
- import { useGlobalConfig as C } from "../../config-provider/hooks/use-global-config.mjs";
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 S } from "../../config-provider/hooks/use-locale.mjs";
14
- import D from "./components/main-button-content.vue2.mjs";
15
- import ee from "./components/menu-list-content.vue2.mjs";
16
- const Ve = /* @__PURE__ */ Y({
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(F) {
32
- const f = F, k = C("viewCacheOption"), {
33
- b: K
35
+ setup(E, {
36
+ expose: k
37
+ }) {
38
+ const f = E, A = D("viewCacheOption"), {
39
+ b
34
40
  } = O("ap-view"), {
35
- t: A
36
- } = S(), b = E(() => ({
41
+ t: L
42
+ } = ee(), g = B(() => ({
37
43
  viewKey: y,
38
- viewName: A("ap.apView.systemView")
44
+ viewName: L("ap.apView.systemView")
39
45
  })), {
40
- getSearchFormValues: B,
41
- setSearchFormValues: L,
42
- submit: P,
43
- reset: T
44
- } = U(), j = d(!1), g = d(!1), V = d("");
45
- let N = !1;
46
- const G = {
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: _(D, {
54
+ content: _(te, {
49
55
  maxViewNum: f.maxViewNum
50
56
  }, null)
51
- }, o = d([b.value]), $ = E(() => o.value.map((t) => ({
57
+ }, o = v([g.value]), Y = B(() => o.value.map((t) => ({
52
58
  id: t.viewKey,
53
- content: _(ee, {
59
+ content: _(ie, {
54
60
  view: t
55
61
  }, null)
56
62
  }))), e = {
57
- getSearchFormValues: B,
58
- setSearchFormValues: L,
59
- submit: P,
60
- reset: T,
63
+ getSearchFormValues: P,
64
+ setSearchFormValues: T,
65
+ submit: j,
66
+ reset: G,
61
67
  ...f.saveDataSource
62
68
  }, i = {
63
- ...k.value,
69
+ ...A.value,
64
70
  ...f.viewCacheOption
65
71
  }, x = () => {
66
72
  if (f.isDefaultSystemView)
67
73
  return y;
68
- const t = o.value.find((l) => l.isDefault);
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 l = o.value.find((s) => s.viewKey === V.value);
73
- l && setTimeout(() => {
74
- var s, n, m, a, r, u;
75
- l.viewKey === y ? N ? (s = e == null ? void 0 : e.submit) == null || s.call(e) : (n = e == null ? void 0 : e.reset) == null || n.call(e) : ((r = e == null ? void 0 : e.setSearchFormValues) == null || r.call(e, {
76
- ...Object.fromEntries(Object.keys(((m = e == null ? void 0 : e.getSearchFormValues) == null ? void 0 : m.call(e)) ?? {}).map((w) => [w, void 0])) ?? {},
77
- ...((a = l.viewConfig) == null ? void 0 : a.searchForm) ?? {}
78
- }), (u = e == null ? void 0 : e.submit) == null || u.call(e)), N = !1;
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
- }, c = {
88
+ }, w = {
81
89
  getViewList: async (t) => {
82
- var l;
90
+ var s;
83
91
  try {
84
92
  const {
85
- tableKey: s
86
- } = t, n = await ((l = i == null ? void 0 : i.getViewList) == null ? void 0 : l.call(i, {
87
- tableKey: s
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 = [b.value, ...n ?? []], p(x()), o.value;
97
+ return o.value = [g.value, ...n ?? []], p(x()), o.value;
90
98
  } catch {
91
- return o.value = [b.value], p(y), 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: l,
98
- viewKey: s,
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: l,
105
- viewKey: s,
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: s,
121
+ viewKey: l,
114
122
  viewName: n,
115
123
  isDefault: m,
116
124
  viewConfig: a
117
- }], p(s);
125
+ }], p(l);
118
126
  },
119
127
  changeView: async (t) => {
120
128
  var u;
121
129
  const {
122
- tableKey: l,
123
- viewKey: s,
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: l,
130
- viewKey: s,
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((w) => ({
135
- ...w,
142
+ })), m && (o.value = o.value.map((c) => ({
143
+ ...c,
136
144
  isDefault: !1
137
145
  })));
138
- const r = o.value.find((w) => w.viewKey === s);
139
- r && (r.viewName = n, r.isDefault = m, r.viewConfig = a), p(s);
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: l,
145
- viewKey: s
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: l,
149
- viewKey: s
150
- })), o.value = o.value.filter((m) => m.viewKey !== s), s === V.value && p(x());
156
+ tableKey: s,
157
+ viewKey: l
158
+ })), o.value = o.value.filter((m) => m.viewKey !== l), l === V.value && p(x());
151
159
  }
152
- }, I = {
160
+ }, z = {
153
161
  tableKey: f.tableKey,
154
162
  currentViewKey: V,
155
163
  changeCurrentViewKey: p,
156
- popoverOpen: j,
157
- menuOpen: g,
164
+ popoverOpen: $,
165
+ menuOpen: N,
158
166
  viewList: o,
159
- viewListCRUD: c,
167
+ viewListCRUD: w,
160
168
  saveDataSource: e
161
169
  };
162
- return Z(I), z(() => f.tableKey, (t) => {
163
- var l;
164
- R(t) && (N = !0, (l = c == null ? void 0 : c.getViewList) == null || l.call(c, {
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
- }), (t, l) => (W(), M(v(X), h({
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: g.value,
173
- "onUpdate:open": l[0] || (l[0] = (s) => g.value = s),
174
- class: [v(K)()],
175
- "button-props": G,
176
- "menu-list": $.value,
177
- "overlay-class-name": [v(K)("overlay")],
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: q(() => [H("div", {
182
- class: J([v(K)("icon")])
183
- }, [_(Q)], 2)]),
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
- Ve as default
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<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
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<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
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
  }