@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.
Files changed (48) 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/hooks/use-row-selection.d.ts +100 -0
  4. package/es/src/ap-grid/hooks/use-row-selection.mjs +122 -0
  5. package/es/src/ap-grid/index.vue.mjs +271 -222
  6. package/es/src/ap-grid/interface.d.ts +16 -0
  7. package/es/src/ap-grid/utils/table.mjs +15 -15
  8. package/es/src/ap-table/hooks/use-table-paging-ng.d.ts +6 -1
  9. package/es/src/ap-table/hooks/use-table-paging-ng.mjs +99 -96
  10. package/es/src/business/ap-copy/ApCopy.mjs +43 -43
  11. package/es/src/business/ap-label/group/ApLabelGroup.mjs +15 -16
  12. package/es/src/business/ap-label/interface.d.ts +2 -3
  13. package/es/src/business/ap-product-info/ApProductInfo.mjs +23 -24
  14. package/es/src/business/ap-table-modal/table-modal.vue2.mjs +43 -42
  15. package/es/src/business/ap-view/ap-view.vue.d.ts +4 -1
  16. package/es/src/business/ap-view/ap-view.vue2.mjs +96 -84
  17. package/es/src/business/ap-view/index.d.ts +12 -3
  18. package/es/src/business/ap-view/interface.d.ts +7 -0
  19. package/es/src/business/hooks/usePageListApGrid.mjs +17 -20
  20. package/es/src/version.d.ts +1 -1
  21. package/es/src/version.mjs +1 -1
  22. package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
  23. package/lib/src/ap-grid/editable/index.vue.js +1 -1
  24. package/lib/src/ap-grid/hooks/use-row-selection.d.ts +100 -0
  25. package/lib/src/ap-grid/hooks/use-row-selection.js +1 -0
  26. package/lib/src/ap-grid/index.vue.js +1 -1
  27. package/lib/src/ap-grid/interface.d.ts +16 -0
  28. package/lib/src/ap-grid/utils/table.js +1 -1
  29. package/lib/src/ap-table/hooks/use-table-paging-ng.d.ts +6 -1
  30. package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
  31. package/lib/src/business/ap-copy/ApCopy.js +1 -1
  32. package/lib/src/business/ap-label/group/ApLabelGroup.js +1 -1
  33. package/lib/src/business/ap-label/interface.d.ts +2 -3
  34. package/lib/src/business/ap-product-info/ApProductInfo.js +1 -1
  35. package/lib/src/business/ap-table-modal/table-modal.vue2.js +1 -1
  36. package/lib/src/business/ap-view/ap-view.vue.d.ts +4 -1
  37. package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
  38. package/lib/src/business/ap-view/index.d.ts +12 -3
  39. package/lib/src/business/ap-view/interface.d.ts +7 -0
  40. package/lib/src/business/hooks/usePageListApGrid.js +1 -1
  41. package/lib/src/version.d.ts +1 -1
  42. package/lib/src/version.js +1 -1
  43. package/package.json +4 -3
  44. package/theme/ap-copy/ap-copy.css +2 -0
  45. package/theme/ap-copy/ap-copy.less +2 -0
  46. package/theme/ap-table-modal/index.css +15 -13
  47. package/theme/ap-table-modal/index.less +15 -13
  48. 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 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,17 +1,16 @@
1
- import { defineComponent as U, ref as m, unref as s, computed as q, h as V, createBlock as k, openBlock as T, mergeProps as y, withCtx as h, createCommentVNode as $, createVNode as S, resolveDynamicComponent as z } from "vue";
2
- import { message as B, Modal as W } from "@aplus-frontend/antdv";
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 Y } from "../../ap-table/index.mjs";
5
- import { cloneDeep as J, omit as R } from "lodash-unified";
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 { useGlobalConfig as X } from "../../config-provider/hooks/use-global-config.mjs";
11
- import { useLocale as Z } from "../../config-provider/hooks/use-locale.mjs";
12
- import j from "./modal-title.vue2.mjs";
13
- import ee from "./table-layout/index.vue2.mjs";
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(M, { expose: P, emit: K }) {
66
- const e = M, _ = K, i = m(!1), x = m({}), d = m(null), a = m([]), C = m();
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 I = X("uiMode", "admin"), { t: g } = Z(), D = async (o = [], t = {}) => {
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
- }, L = async (o) => {
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
- }, N = () => {
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
- }, A = q(() => {
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
- B.warning(
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((F) => o(F) === o(v)));
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
- B.warning(
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
- }), O = () => e.isRenderModalTitleSuffix ? V(
158
- j,
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, G = () => d.value, H = () => {
166
+ ) : e.title, O = () => d.value, E = () => {
168
167
  a.value = [];
169
- }, E = (o) => {
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 P({
178
- open: D,
176
+ return M({
177
+ open: I,
179
178
  close: w,
180
- getApTableInstance: G
181
- }), (o, t) => (T(), k(s(W), y(
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(R)(e, [
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: O(),
202
- "body-style": { maxHeight: "calc(100vh - 205px)", overflowY: "scroll" },
200
+ title: A(),
203
201
  centered: e.centered ?? !0,
204
- onOk: N,
202
+ onOk: L,
205
203
  onCancel: w
206
204
  }
207
205
  ), {
208
206
  default: h(() => [
209
- e.renderHeader ? (T(), k(z(e.renderHeader), { key: 0 })) : $("", !0),
210
- S(ee, y(e.tableLayoutConfig || {}, {
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: H,
213
- onDeleteItem: E
210
+ onClear: E,
211
+ onDeleteItem: F
214
212
  }), {
215
213
  default: h(() => [
216
- S(s(Y), y({
214
+ S(s(W), y({
217
215
  ref_key: "apTableRef",
218
216
  ref: d,
219
- scroll: { y: "100%" },
217
+ scroll: { y: 450 },
220
218
  style: { padding: "0px" },
221
219
  columns: o.columns,
222
- request: L,
220
+ request: D,
223
221
  "row-key": o.getRowKey,
224
- "row-selection": A.value,
225
- bordered: s(I) === "admin",
226
- "data-source": C.value
227
- }, s(R)(e.apTableProps, "dataSource")), null, 16, ["columns", "row-key", "row-selection", "bordered", "data-source"])
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
- pe as default
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, {}, {}, {}, {}, 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
  }