@done-coding/admin-core 0.5.0 → 0.5.1-alpha.1
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/bridge/index.mjs +30 -42
- package/es/components/app-layout/AppHeader.vue.mjs +2 -2
- package/es/components/app-layout/AppHeader.vue2.mjs +16 -19
- package/es/components/data-view/DataListView.vue.mjs +2 -2
- package/es/components/data-view/DataListView.vue2.mjs +64 -53
- package/es/components/data-view/utils.mjs +36 -0
- package/es/components/display/TabsHeader.vue.mjs +2 -2
- package/es/components/display/TabsMain.vue.mjs +1 -1
- package/es/components/list-page/ListPage.vue.mjs +2 -2
- package/es/components/list-page/ListPage.vue2.mjs +44 -44
- package/es/components/misc/ActionConfirm.vue2.mjs +16 -16
- package/es/components/modal/ConfirmModal.vue.mjs +2 -2
- package/es/components/modal/DetailModal.vue.mjs +10 -10
- package/es/components/table/TableMain.vue.mjs +3 -3
- package/es/components/table/TableMain.vue2.mjs +167 -177
- package/es/components/table/TableToolbar.vue.mjs +3 -3
- package/es/components/table/TableToolbar.vue2.mjs +8 -4
- package/es/index.mjs +150 -180
- package/es/style.css +1 -1
- package/package.json +6 -5
- package/types/bridge/index.d.ts +3 -6
- package/types/bridge/route.d.ts +0 -1
- package/types/components/app-layout/AppBody.vue.d.ts +14 -34
- package/types/components/app-layout/AppBreadcrumb.vue.d.ts +6 -19
- package/types/components/app-layout/AppFooter.vue.d.ts +1 -1
- package/types/components/app-layout/AppHeader.vue.d.ts +15 -39
- package/types/components/app-layout/AppLayout.vue.d.ts +17 -50
- package/types/components/app-layout/AppPage.vue.d.ts +14 -39
- package/types/components/app-layout/AppSidebar.vue.d.ts +15 -37
- package/types/components/app-layout/index.d.ts +1 -19
- package/types/components/app-layout/types.d.ts +0 -1
- package/types/components/data-view/DataListView.vue.d.ts +9 -9
- package/types/components/data-view/DataListViewItem.vue.d.ts +19 -17
- package/types/components/data-view/index.d.ts +0 -1
- package/types/components/data-view/types.d.ts +9 -18
- package/types/components/data-view/utils.d.ts +5 -0
- package/types/components/display/ActionBtnGroup.vue.d.ts +8 -6
- package/types/components/display/HeightProvider.vue.d.ts +15 -31
- package/types/components/display/TabsHeader.vue.d.ts +27 -34
- package/types/components/display/TabsMain.vue.d.ts +33 -73
- package/types/components/display/TabsNaturalFlow.vue.d.ts +11 -5
- package/types/components/display/TabsRefineFlow.vue.d.ts +13 -31
- package/types/components/display/WatchSize.vue.d.ts +20 -32
- package/types/components/display/index.d.ts +0 -3
- package/types/components/display/types.d.ts +1 -2
- package/types/components/form/FormItem.vue.d.ts +208 -33
- package/types/components/form/FormMain.vue.d.ts +6 -7
- package/types/components/form/FormRadioGroup.vue.d.ts +14 -31
- package/types/components/form/FormSearch.vue.d.ts +5 -6
- package/types/components/form/FormSelect.vue.d.ts +19 -40
- package/types/components/form/FormTree.vue.d.ts +2037 -32
- package/types/components/form/FormVerifyCode.vue.d.ts +6 -6
- package/types/components/form/FormVerifyImage.vue.d.ts +6 -6
- package/types/components/form/form-search-utils.d.ts +0 -1
- package/types/components/form/index.d.ts +0 -3
- package/types/components/form/types.d.ts +0 -1
- package/types/components/form/utils.d.ts +0 -1
- package/types/components/list-page/ListPage.vue.d.ts +32 -33
- package/types/components/list-page/index.d.ts +0 -3
- package/types/components/list-page/types.d.ts +0 -1
- package/types/components/menu/MenuItemSub.vue.d.ts +3 -15
- package/types/components/menu/MenuTree.vue.d.ts +117 -19
- package/types/components/menu/index.d.ts +0 -3
- package/types/components/misc/ActionBtn.vue.d.ts +10 -11
- package/types/components/misc/ActionConfirm.vue.d.ts +21 -60
- package/types/components/misc/AutoRefresh.vue.d.ts +18 -24
- package/types/components/misc/TriggerAutoImport.vue.d.ts +8 -2
- package/types/components/misc/index.d.ts +4 -14
- package/types/components/misc/types.d.ts +0 -1
- package/types/components/modal/ConfirmModal.vue.d.ts +26 -83
- package/types/components/modal/DetailModal.vue.d.ts +5 -6
- package/types/components/modal/ModalPorter.vue.d.ts +13 -18
- package/types/components/modal/ModalShelf.vue.d.ts +13 -18
- package/types/components/modal/index.d.ts +0 -4
- package/types/components/modal/modal-shelf-core.d.ts +0 -1
- package/types/components/modal/modal-shelf-hierarchy.d.ts +0 -1
- package/types/components/modal/modal-shelf-types.d.ts +0 -1
- package/types/components/modal/types.d.ts +0 -1
- package/types/components/panel/PanelEditSwitch.vue.d.ts +17 -20
- package/types/components/panel/PanelItem.vue.d.ts +7 -16
- package/types/components/panel/PanelMain.vue.d.ts +5 -6
- package/types/components/panel/index.d.ts +0 -4
- package/types/components/panel/types.d.ts +0 -1
- package/types/components/table/TableMain.vue.d.ts +12 -12
- package/types/components/table/TableToolbar.vue.d.ts +17 -108
- package/types/components/table/ToolbarButtons.vue.d.ts +15 -17
- package/types/components/table/index.d.ts +0 -3
- package/types/components/table/types.d.ts +59 -19
- package/types/config/list-model.d.ts +0 -1
- package/types/helpers/form.d.ts +0 -1
- package/types/helpers/index.d.ts +0 -10
- package/types/helpers/list-helper.d.ts +0 -1
- package/types/hooks/menus-dispatch.d.ts +0 -1
- package/types/hooks/use-channel-viewport-height.d.ts +0 -1
- package/types/index.d.ts +0 -13
- package/types/inject/key.d.ts +0 -1
- package/types/router/guard/index.d.ts +0 -1
- package/types/router/guard/login.d.ts +0 -1
- package/types/router/guard/permission.d.ts +0 -1
- package/types/router/guard/types.d.ts +0 -1
- package/types/store/app.d.ts +1 -2
- package/types/store/router-permission.d.ts +0 -1
- package/types/store/user.d.ts +0 -1
- package/types/types/route.d.ts +0 -1
- package/types/utils/export.d.ts +11 -10
- package/types/utils/router.d.ts +0 -1
- package/es/components/app-layout/index.mjs +0 -32
- package/es/components/display/index.mjs +0 -18
- package/es/components/form/index.mjs +0 -32
- package/es/components/list-page/index.mjs +0 -14
- package/es/components/menu/index.mjs +0 -12
- package/es/components/misc/ActionButton.vue.mjs +0 -52
- package/es/components/misc/ActionButton.vue2.mjs +0 -4
- package/es/components/misc/ActionButtonDanger.vue.mjs +0 -32
- package/es/components/misc/ActionButtonDanger.vue2.mjs +0 -4
- package/es/components/misc/ActionButtonWarn.vue.mjs +0 -32
- package/es/components/misc/ActionButtonWarn.vue2.mjs +0 -4
- package/es/components/misc/index.mjs +0 -32
- package/es/components/modal/index.mjs +0 -23
- package/es/components/panel/index.mjs +0 -20
- package/es/components/table/index.mjs +0 -14
- package/types/components/misc/ActionButton.vue.d.ts +0 -24
- package/types/components/misc/ActionButtonDanger.vue.d.ts +0 -19
- package/types/components/misc/ActionButtonWarn.vue.d.ts +0 -19
package/es/bridge/index.mjs
CHANGED
|
@@ -1,73 +1,58 @@
|
|
|
1
|
-
import { createStorageWithNamespace as
|
|
1
|
+
import { createStorageWithNamespace as U } from "./storage.mjs";
|
|
2
2
|
import { createUseState as a } from "./state.mjs";
|
|
3
|
-
import { createGenerateRouteMetaRawTree as
|
|
4
|
-
function
|
|
5
|
-
const
|
|
3
|
+
import { createGenerateRouteMetaRawTree as G } from "./route.mjs";
|
|
4
|
+
function L(e) {
|
|
5
|
+
const F = e.APP_CACHE_CONFIG.namespace;
|
|
6
6
|
let _;
|
|
7
|
-
|
|
7
|
+
F === "" ? (console.error(
|
|
8
8
|
"[adminBridge] APP_CACHE_CONFIG.namespace 为空,已兜底为 'ADMIN_CORE'"
|
|
9
|
-
), _ = "ADMIN_CORE") : _ =
|
|
10
|
-
let
|
|
11
|
-
const
|
|
9
|
+
), _ = "ADMIN_CORE") : _ = F, Object.freeze(e);
|
|
10
|
+
let g = U(_), C = e.routes, N = e.getUserInfoInitFn;
|
|
11
|
+
const i = a(_), u = G(
|
|
12
12
|
e.APP_ROUTER_META_DEFAULT_CONFIG
|
|
13
|
-
),
|
|
13
|
+
), R = Object.freeze({
|
|
14
14
|
header: e.APP_LAYOUT_HEADER_CONFIG,
|
|
15
15
|
footer: e.APP_LAYOUT_FOOTER_CONFIG,
|
|
16
16
|
sidebar: e.APP_LAYOUT_SIDEBAR_CONFIG,
|
|
17
17
|
breadcrumb: e.APP_LAYOUT_BREADCRUMB_CONFIG,
|
|
18
18
|
body: e.APP_LAYOUT_BODY_CONFIG
|
|
19
19
|
});
|
|
20
|
-
let P, O,
|
|
20
|
+
let t, P, O, n, T, I, f, E;
|
|
21
21
|
const A = (r) => `admin bridge: ${r} 未注册`;
|
|
22
22
|
return {
|
|
23
23
|
register(r) {
|
|
24
|
-
r.getToken && (
|
|
24
|
+
r.getToken && (t = r.getToken), r.goToLogin && (P = r.goToLogin), r.refreshToken && (O = r.refreshToken), r.refreshAuth && (n = r.refreshAuth), r.loginApi && (T = r.loginApi), r.logoutApi && (I = r.logoutApi), r.getUserInfoApi && (f = r.getUserInfoApi), r.refreshTokenApi && (E = r.refreshTokenApi);
|
|
25
25
|
},
|
|
26
26
|
// 已注册返回 undefined 是合法业务态不 throw
|
|
27
27
|
// v3 终锁 Δ8b:零参 facade(BR-1 ③ 终裁——core 对 UserInfo 不透明 + 拦截器无 info 源)
|
|
28
28
|
getToken() {
|
|
29
|
-
if (!
|
|
30
|
-
return
|
|
29
|
+
if (!t) throw new Error(A("getToken"));
|
|
30
|
+
return t();
|
|
31
31
|
},
|
|
32
32
|
goToLogin() {
|
|
33
|
-
if (!
|
|
34
|
-
|
|
33
|
+
if (!P) throw new Error(A("goToLogin"));
|
|
34
|
+
P();
|
|
35
35
|
},
|
|
36
36
|
// 异步对:未注册才返回 rejected Promise(既有降级语义保留)。
|
|
37
37
|
refreshToken() {
|
|
38
|
-
return
|
|
38
|
+
return O ? O().then(() => {
|
|
39
39
|
}) : Promise.reject(new Error(A("refreshToken")));
|
|
40
40
|
},
|
|
41
41
|
refreshAuth() {
|
|
42
|
-
return
|
|
42
|
+
return n ? n().then(() => {
|
|
43
43
|
}) : Promise.reject(new Error(A("refreshAuth")));
|
|
44
44
|
},
|
|
45
|
-
// #2.5 期 ADR-4 候选 b:getAppConfig facade 保留 + 内部从 12 readonly 属性组装聚合对象
|
|
46
|
-
// 每次调用产新对象(多次调用 !== 引用不等),与原 facade 返回 options.appConfig 引用语义不同;
|
|
47
|
-
// store/app.ts:18 解构后丢弃返回引用,引用相等性不被消费,行为对等 ✅
|
|
48
|
-
getAppConfig() {
|
|
49
|
-
return Object.freeze({
|
|
50
|
-
APP_BASE_INFO: e.APP_BASE_INFO,
|
|
51
|
-
APP_LAYOUT_HEADER_CONFIG: e.APP_LAYOUT_HEADER_CONFIG,
|
|
52
|
-
APP_LAYOUT_FOOTER_CONFIG: e.APP_LAYOUT_FOOTER_CONFIG,
|
|
53
|
-
APP_LAYOUT_SIDEBAR_CONFIG: e.APP_LAYOUT_SIDEBAR_CONFIG,
|
|
54
|
-
APP_LAYOUT_BODY_CONFIG: e.APP_LAYOUT_BODY_CONFIG,
|
|
55
|
-
APP_THEME_CONFIG: e.APP_THEME_CONFIG,
|
|
56
|
-
APP_ROUTER_META_DEFAULT_CONFIG: e.APP_ROUTER_META_DEFAULT_CONFIG,
|
|
57
|
-
APP_CACHE_CONFIG: e.APP_CACHE_CONFIG
|
|
58
|
-
});
|
|
59
|
-
},
|
|
60
45
|
getStorage() {
|
|
61
|
-
return
|
|
46
|
+
return g;
|
|
62
47
|
},
|
|
63
48
|
getRoutes() {
|
|
64
|
-
return
|
|
49
|
+
return C;
|
|
65
50
|
},
|
|
66
51
|
getUserInfoInitFn() {
|
|
67
|
-
return
|
|
52
|
+
return N;
|
|
68
53
|
},
|
|
69
|
-
useState:
|
|
70
|
-
generateRouteMetaRawTree:
|
|
54
|
+
useState: i,
|
|
55
|
+
generateRouteMetaRawTree: u,
|
|
71
56
|
// ============ #2.5 期 12 readonly 属性值挂载(per ADR-1 sibling pattern 复用 useState / generateRouteMetaRawTree) ============
|
|
72
57
|
/** 应用基础信息(per #2.5 期 REQ-1 直接挂载形态) */
|
|
73
58
|
APP_BASE_INFO: e.APP_BASE_INFO,
|
|
@@ -86,7 +71,7 @@ function l(e) {
|
|
|
86
71
|
/** 应用布局-页面主体配置(per #2.5 期 REQ-1) */
|
|
87
72
|
APP_LAYOUT_BODY_CONFIG: e.APP_LAYOUT_BODY_CONFIG,
|
|
88
73
|
/** 应用布局聚合配置(per #2.5 期 ADR-3 bridge 内部聚合派生) */
|
|
89
|
-
APP_LAYOUT_CONFIG:
|
|
74
|
+
APP_LAYOUT_CONFIG: R,
|
|
90
75
|
/** 应用路由元信息默认配置(per #2.5 期 REQ-1) */
|
|
91
76
|
APP_ROUTER_META_DEFAULT_CONFIG: e.APP_ROUTER_META_DEFAULT_CONFIG,
|
|
92
77
|
/** 应用路由配置(per #2.5 期 REQ-1) */
|
|
@@ -97,19 +82,22 @@ function l(e) {
|
|
|
97
82
|
APP_THEME_CONFIG: e.APP_THEME_CONFIG,
|
|
98
83
|
// 异步对:未注册返回 rejected 原生 Error(#4a-2 per-method 降级)
|
|
99
84
|
loginApi(r) {
|
|
100
|
-
return
|
|
85
|
+
return T ? T(r) : Promise.reject(new Error(A("loginApi")));
|
|
101
86
|
},
|
|
102
87
|
logoutApi() {
|
|
103
88
|
return I ? I() : Promise.reject(new Error(A("logoutApi")));
|
|
104
89
|
},
|
|
105
90
|
getUserInfoApi() {
|
|
106
|
-
return
|
|
91
|
+
return f ? f() : Promise.reject(new Error(A("getUserInfoApi")));
|
|
107
92
|
},
|
|
108
93
|
refreshTokenApi(r) {
|
|
109
|
-
return
|
|
94
|
+
return E ? E(r) : Promise.reject(new Error(A("refreshTokenApi")));
|
|
110
95
|
}
|
|
111
96
|
};
|
|
112
97
|
}
|
|
113
98
|
export {
|
|
114
|
-
|
|
99
|
+
L as createAdminBridge,
|
|
100
|
+
G as createGenerateRouteMetaRawTree,
|
|
101
|
+
U as createStorageWithNamespace,
|
|
102
|
+
a as createUseState
|
|
115
103
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./AppHeader.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import p from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const
|
|
4
|
+
const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-ef3cc8a6"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { ElIcon as
|
|
1
|
+
import { ElIcon as w, ElSwitch as E } from "element-plus/es";
|
|
2
2
|
import "element-plus/es/components/base/style/css";
|
|
3
3
|
import "element-plus/es/components/switch/style/css";
|
|
4
4
|
import "element-plus/es/components/icon/style/css";
|
|
5
|
-
import { defineComponent as
|
|
5
|
+
import { defineComponent as I, useCssVars as g, unref as o, inject as B, toRefs as P, computed as m, watch as V, nextTick as $, openBlock as r, createElementBlock as s, normalizeStyle as T, createElementVNode as d, renderSlot as v, normalizeClass as _, Fragment as b, renderList as x, createBlock as f, withCtx as A, resolveDynamicComponent as D, createCommentVNode as y, toDisplayString as L, createVNode as N } from "vue";
|
|
6
6
|
import { Sunny as R, Moon as q } from "@element-plus/icons-vue";
|
|
7
7
|
import { useRouter as z } from "vue-router";
|
|
8
8
|
import { APP_LAYOUT_APP_STORE_KEY as F } from "../../inject/key.mjs";
|
|
9
|
-
const O = { class: "app-header-shim" }, U = ["name", "onClick"], Y = {
|
|
10
|
-
class: "app-header-userInfo",
|
|
11
|
-
pl20: ""
|
|
12
|
-
}, ee = /* @__PURE__ */ w({
|
|
9
|
+
const O = { class: "app-header-shim" }, U = ["name", "onClick"], Y = { class: "app-header-userInfo" }, ee = /* @__PURE__ */ I({
|
|
13
10
|
__name: "AppHeader",
|
|
14
11
|
props: {
|
|
15
12
|
show: { type: Boolean },
|
|
@@ -19,9 +16,9 @@ const O = { class: "app-header-shim" }, U = ["name", "onClick"], Y = {
|
|
|
19
16
|
menuFlatList: {}
|
|
20
17
|
},
|
|
21
18
|
setup(p) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
g((e) => ({
|
|
20
|
+
v3dfae5bc: o(u).baseColor,
|
|
21
|
+
v158cd0d2: o(u).primaryColor
|
|
25
22
|
}));
|
|
26
23
|
const c = p, i = B(F), { theme: u } = P(i), S = m(() => i.headerStyle), k = z(), h = `app-header-module_${Math.random().toString(36).substring(2)}`, C = m(() => c.menus), l = m({
|
|
27
24
|
get() {
|
|
@@ -29,16 +26,16 @@ const O = { class: "app-header-shim" }, U = ["name", "onClick"], Y = {
|
|
|
29
26
|
return (e = c.activeModuleMenu) == null ? void 0 : e.path;
|
|
30
27
|
},
|
|
31
28
|
set(e) {
|
|
32
|
-
var
|
|
33
|
-
((
|
|
29
|
+
var a, n;
|
|
30
|
+
((n = (a = c.activeMenu) == null ? void 0 : a.parentPathList) == null ? void 0 : n[0]) !== e && k.push(e);
|
|
34
31
|
}
|
|
35
32
|
});
|
|
36
33
|
return V(
|
|
37
34
|
l,
|
|
38
35
|
(e) => {
|
|
39
36
|
e && $(() => {
|
|
40
|
-
var
|
|
41
|
-
(
|
|
37
|
+
var a, n;
|
|
38
|
+
(n = (a = document.querySelector(`.${h}`)) == null ? void 0 : a.querySelector(`[name="${e}"]`)) == null || n.scrollIntoView({
|
|
42
39
|
behavior: "smooth"
|
|
43
40
|
});
|
|
44
41
|
});
|
|
@@ -46,8 +43,8 @@ const O = { class: "app-header-shim" }, U = ["name", "onClick"], Y = {
|
|
|
46
43
|
{
|
|
47
44
|
immediate: !0
|
|
48
45
|
}
|
|
49
|
-
), (e,
|
|
50
|
-
const
|
|
46
|
+
), (e, a) => {
|
|
47
|
+
const n = w, M = E;
|
|
51
48
|
return r(), s("div", {
|
|
52
49
|
class: "app-header",
|
|
53
50
|
style: T(o(S))
|
|
@@ -67,9 +64,9 @@ const O = { class: "app-header-shim" }, U = ["name", "onClick"], Y = {
|
|
|
67
64
|
]),
|
|
68
65
|
onClick: (j) => l.value = t.path
|
|
69
66
|
}, [
|
|
70
|
-
t.menuIcon ? (r(), f(
|
|
67
|
+
t.menuIcon ? (r(), f(n, {
|
|
71
68
|
key: 0,
|
|
72
|
-
|
|
69
|
+
class: "app-header-module-item__icon"
|
|
73
70
|
}, {
|
|
74
71
|
default: A(() => [
|
|
75
72
|
(r(), f(D(t.menuIcon)))
|
|
@@ -82,10 +79,10 @@ const O = { class: "app-header-shim" }, U = ["name", "onClick"], Y = {
|
|
|
82
79
|
d("div", Y, [
|
|
83
80
|
N(M, {
|
|
84
81
|
"model-value": o(i).isDarkTheme,
|
|
85
|
-
|
|
82
|
+
class: "app-header-userInfo__theme-switch",
|
|
86
83
|
"active-action-icon": o(q),
|
|
87
84
|
"inactive-action-icon": o(R),
|
|
88
|
-
"onUpdate:modelValue":
|
|
85
|
+
"onUpdate:modelValue": a[0] || (a[0] = (t) => o(i).changeIsDarkTheme(!!t))
|
|
89
86
|
}, null, 8, ["model-value", "active-action-icon", "inactive-action-icon"]),
|
|
90
87
|
v(e.$slots, "right", {}, void 0, !0)
|
|
91
88
|
])
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./DataListView.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const m = /* @__PURE__ */
|
|
3
|
+
import a from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
+
const m = /* @__PURE__ */ a(t, [["__scopeId", "data-v-83a69ab1"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { defineComponent as v, computed as m, ref as F, watch as H, openBlock as s, createElementBlock as p, normalizeStyle as z, unref as f, Fragment as E, renderList as K, createBlock as R, withCtx as q, renderSlot as k, createVNode as I, markRaw as M, h as c } from "vue";
|
|
2
|
+
import { ElEmpty as N } from "element-plus";
|
|
3
|
+
import O from "./DataListViewItem.vue.mjs";
|
|
4
|
+
import { createDataListViewInstance as j } from "./utils.mjs";
|
|
5
|
+
const Y = {
|
|
6
|
+
key: 1,
|
|
7
|
+
class: "data-list-view-empty"
|
|
8
|
+
}, T = /* @__PURE__ */ v({
|
|
4
9
|
__name: "DataListView",
|
|
5
10
|
props: {
|
|
6
11
|
data: {},
|
|
@@ -10,31 +15,26 @@ const N = /* @__PURE__ */ x({
|
|
|
10
15
|
selectable: { type: Boolean, default: !1 }
|
|
11
16
|
},
|
|
12
17
|
emits: ["selectionChange"],
|
|
13
|
-
setup(
|
|
14
|
-
const o =
|
|
18
|
+
setup(r, { expose: C, emit: b }) {
|
|
19
|
+
const o = r, V = b, i = (t) => {
|
|
15
20
|
const e = o.rowKey;
|
|
16
21
|
return typeof e == "function" ? e(t) : String(t[e]);
|
|
17
|
-
},
|
|
22
|
+
}, D = m(
|
|
18
23
|
() => o.maxHeight ? { maxHeight: `${o.maxHeight}px`, overflowY: "auto" } : void 0
|
|
19
|
-
),
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
}, _ = (
|
|
24
|
-
o.selectable && (a.value = t ? new Set(o.data.map((e) => i(e))) : /* @__PURE__ */ new Set(), c());
|
|
25
|
-
}, B = (t) => {
|
|
24
|
+
), l = F(/* @__PURE__ */ new Set()), L = m(() => l.value.size === o.data.length), g = (t) => o.selectable && l.value.has(i(t)), d = () => {
|
|
25
|
+
V("selectionChange", y());
|
|
26
|
+
}, y = () => o.selectable ? o.data.filter((t) => l.value.has(i(t))) : [], w = () => {
|
|
27
|
+
l.value = /* @__PURE__ */ new Set(), d();
|
|
28
|
+
}, _ = () => {
|
|
26
29
|
if (!o.selectable) return;
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
()
|
|
32
|
-
()
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
);
|
|
36
|
-
const D = (t) => O(
|
|
37
|
-
x({
|
|
30
|
+
const t = !L.value;
|
|
31
|
+
l.value = t ? new Set(o.data.map((e) => i(e))) : /* @__PURE__ */ new Set(), d();
|
|
32
|
+
}, x = (t) => {
|
|
33
|
+
if (!o.selectable) return;
|
|
34
|
+
const e = i(t), n = new Set(l.value);
|
|
35
|
+
n.has(e) ? n.delete(e) : n.add(e), l.value = n, d();
|
|
36
|
+
}, $ = (t) => M(
|
|
37
|
+
v({
|
|
38
38
|
name: "DataViewField",
|
|
39
39
|
props: {
|
|
40
40
|
row: { type: Object, required: !0 },
|
|
@@ -44,32 +44,32 @@ const N = /* @__PURE__ */ x({
|
|
|
44
44
|
},
|
|
45
45
|
setup(e) {
|
|
46
46
|
return () => {
|
|
47
|
-
const { type: n, render:
|
|
47
|
+
const { type: n, render: a, prop: S } = t;
|
|
48
48
|
if (n === "index")
|
|
49
|
-
return
|
|
49
|
+
return c("span", String(e.index + 1));
|
|
50
50
|
if (n === "selection")
|
|
51
|
-
return
|
|
51
|
+
return c("input", {
|
|
52
52
|
type: "checkbox",
|
|
53
53
|
checked: e.selected,
|
|
54
54
|
onChange: () => {
|
|
55
|
-
var
|
|
56
|
-
return (
|
|
55
|
+
var h;
|
|
56
|
+
return (h = e.toggleSelect) == null ? void 0 : h.call(e);
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
|
-
if (typeof
|
|
60
|
-
return
|
|
59
|
+
if (typeof a == "function")
|
|
60
|
+
return a({
|
|
61
61
|
row: e.row,
|
|
62
62
|
index: e.index,
|
|
63
63
|
_index: e.index
|
|
64
64
|
});
|
|
65
|
-
if (
|
|
66
|
-
return
|
|
67
|
-
const
|
|
68
|
-
return
|
|
65
|
+
if (a)
|
|
66
|
+
return c(a);
|
|
67
|
+
const u = S ? e.row[S] : void 0;
|
|
68
|
+
return c("span", u == null ? "" : String(u));
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
})
|
|
72
|
-
),
|
|
72
|
+
), B = m(() => {
|
|
73
73
|
const t = {};
|
|
74
74
|
for (const e of o.columns) {
|
|
75
75
|
if (e.type === "expand") continue;
|
|
@@ -81,36 +81,47 @@ const N = /* @__PURE__ */ x({
|
|
|
81
81
|
);
|
|
82
82
|
continue;
|
|
83
83
|
}
|
|
84
|
-
t[n] && console.warn(`[DataListView] 列 key 重复 "${n}",后者覆盖前者`), t[n] =
|
|
84
|
+
t[n] && console.warn(`[DataListView] 列 key 重复 "${n}",后者覆盖前者`), t[n] = $(e);
|
|
85
85
|
}
|
|
86
86
|
return t;
|
|
87
|
+
}), A = j({
|
|
88
|
+
clearSelection: w,
|
|
89
|
+
getSelectionRows: y,
|
|
90
|
+
toggleRowSelection: x,
|
|
91
|
+
toggleAllSelection: _,
|
|
92
|
+
columns: o.columns
|
|
87
93
|
});
|
|
88
|
-
return
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
94
|
+
return C(A), H(
|
|
95
|
+
() => o.data,
|
|
96
|
+
() => {
|
|
97
|
+
l.value.size && w();
|
|
98
|
+
}
|
|
99
|
+
), (t, e) => (s(), p("div", {
|
|
93
100
|
class: "data-list-view",
|
|
94
|
-
style:
|
|
101
|
+
style: z(f(D))
|
|
95
102
|
}, [
|
|
96
|
-
(
|
|
103
|
+
r.data.length ? (s(!0), p(E, { key: 0 }, K(r.data, (n, a) => (s(), R(O, {
|
|
97
104
|
key: i(n),
|
|
98
|
-
selected:
|
|
105
|
+
selected: g(n)
|
|
99
106
|
}, {
|
|
100
|
-
default:
|
|
101
|
-
|
|
102
|
-
fieldComponentMap:
|
|
107
|
+
default: q(() => [
|
|
108
|
+
k(t.$slots, "item", {
|
|
109
|
+
fieldComponentMap: f(B),
|
|
103
110
|
row: n,
|
|
104
|
-
index:
|
|
105
|
-
selected:
|
|
106
|
-
toggleSelect: () =>
|
|
111
|
+
index: a,
|
|
112
|
+
selected: g(n),
|
|
113
|
+
toggleSelect: () => x(n)
|
|
107
114
|
}, void 0, !0)
|
|
108
115
|
]),
|
|
109
116
|
_: 2
|
|
110
|
-
}, 1032, ["selected"]))), 128))
|
|
117
|
+
}, 1032, ["selected"]))), 128)) : (s(), p("div", Y, [
|
|
118
|
+
k(t.$slots, "empty", {}, () => [
|
|
119
|
+
I(f(N))
|
|
120
|
+
], !0)
|
|
121
|
+
]))
|
|
111
122
|
], 4));
|
|
112
123
|
}
|
|
113
124
|
});
|
|
114
125
|
export {
|
|
115
|
-
|
|
126
|
+
T as default
|
|
116
127
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const o = (r) => ({
|
|
2
|
+
toggleRowExpansion: () => {
|
|
3
|
+
throw new Error("toggleRowExpansion not supported");
|
|
4
|
+
},
|
|
5
|
+
setCurrentRow: () => {
|
|
6
|
+
throw new Error("setCurrentRow not supported");
|
|
7
|
+
},
|
|
8
|
+
clearSort: () => {
|
|
9
|
+
throw new Error("clearSort not supported");
|
|
10
|
+
},
|
|
11
|
+
clearFilter: () => {
|
|
12
|
+
throw new Error("clearFilter not supported");
|
|
13
|
+
},
|
|
14
|
+
doLayout: () => {
|
|
15
|
+
throw new Error("doLayout not supported");
|
|
16
|
+
},
|
|
17
|
+
sort: () => {
|
|
18
|
+
throw new Error("sort not supported");
|
|
19
|
+
},
|
|
20
|
+
scrollTo: () => {
|
|
21
|
+
throw new Error("scrollTo not supported");
|
|
22
|
+
},
|
|
23
|
+
setScrollTop: () => {
|
|
24
|
+
throw new Error("setScrollTop not supported");
|
|
25
|
+
},
|
|
26
|
+
setScrollLeft: () => {
|
|
27
|
+
throw new Error("setScrollLeft not supported");
|
|
28
|
+
},
|
|
29
|
+
updateKeyChildren: () => {
|
|
30
|
+
throw new Error("updateKeyChildren not supported");
|
|
31
|
+
},
|
|
32
|
+
...r
|
|
33
|
+
});
|
|
34
|
+
export {
|
|
35
|
+
o as createDataListViewInstance
|
|
36
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./TabsHeader.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-d6937179"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ListPage.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8547b0b7"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|