agilebuilder-ui 1.1.13-tmp3 → 1.1.13-tmp5
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/lib/401-1e79cd95.js +11 -0
- package/lib/404-afa1bc45.js +8 -0
- package/lib/authredirect-294d14ef.js +7 -0
- package/lib/iframe-page-61a1b570.js +12 -0
- package/lib/index-1cc4db24.js +8 -0
- package/lib/index-e8b65d1a.js +72062 -0
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.js +39 -69076
- package/lib/super-ui.umd.cjs +119 -87
- package/lib/tab-content-iframe-index-e32d4b3f.js +12 -0
- package/lib/tab-content-index-5f743a94.js +115 -0
- package/lib/tache-subprocess-history-344d409e.js +12 -0
- package/package.json +1 -1
- package/packages/super-grid/src/apis.js +46 -3
- package/packages/super-grid/src/components/mobile-table-card.jsx +180 -125
- package/packages/super-grid/src/dynamic-input.vue +1 -1
- package/packages/super-grid/src/super-grid.vue +114 -80
- package/packages/super-grid/src/utils.js +1 -1
- package/{packages/super-grid/src/components/card-view.jsx → src/components/Card/index.jsx} +54 -11
- package/src/components/Scrollbar/index.vue +197 -0
- package/src/store/getters.js +3 -0
- package/src/store/modules/app.js +33 -18
- package/src/styles/display-layout.scss +98 -1
- package/src/views/layout/tab-content-index.vue +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { openBlock as r, createElementBlock as t, createCommentVNode as o } from "vue";
|
|
2
|
+
import { _ as s } from "./index-e8b65d1a.js";
|
|
3
|
+
const u = ["src"], f = s({ data: () => ({ src: null }), watch: { $route(n, c) {
|
|
4
|
+
this.src = this.$route.query.src;
|
|
5
|
+
} }, mounted() {
|
|
6
|
+
this.src = this.$route.query.src;
|
|
7
|
+
} }, [["render", function(n, c, a, l, e, m) {
|
|
8
|
+
return r(), t("div", null, [e.src && e.src !== null ? (r(), t("iframe", { key: 0, ref: "menuContent", src: e.src, name: "menu-content", title: "Main content", frameborder: "0" }, null, 8, u)) : o("", !0)]);
|
|
9
|
+
}], ["__scopeId", "data-v-20dccb82"]]);
|
|
10
|
+
export {
|
|
11
|
+
f as default
|
|
12
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { _ as v, c as $, g as x, b as P, s as h, m as M, M as O, i as I } from "./index-e8b65d1a.js";
|
|
2
|
+
import { resolveComponent as m, openBlock as l, createBlock as b, withCtx as g, createVNode as w, TransitionGroup as L, createElementBlock as p, Fragment as T, renderList as C, createElementVNode as u, toDisplayString as y, createCommentVNode as f, normalizeClass as S } from "vue";
|
|
3
|
+
const A = { class: "no-redirect" }, k = v({ name: "Breadcrumb", data: () => ({ levelList: null }), computed: { levelListWithTitle() {
|
|
4
|
+
return this.levelList.filter((e) => e.meta.title !== void 0 && e.meta.title !== null);
|
|
5
|
+
} }, watch: { $route() {
|
|
6
|
+
this.getBreadcrumb();
|
|
7
|
+
} }, created() {
|
|
8
|
+
this.getBreadcrumb();
|
|
9
|
+
}, methods: { getBreadcrumb() {
|
|
10
|
+
const { params: e } = this.$route;
|
|
11
|
+
let t = this.$route.matched.filter((a) => {
|
|
12
|
+
if (a.name) {
|
|
13
|
+
var r = $(a.path);
|
|
14
|
+
return a.path = r(e), !0;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
if (t) {
|
|
18
|
+
let a;
|
|
19
|
+
const r = x(), o = window.$vueApp.config.globalProperties.systemNameObj;
|
|
20
|
+
o && (a = o[r]), t = [{ path: "/", redirect: "noredirect", meta: { title: a } }].concat(t);
|
|
21
|
+
const s = P.get("selectMenu"), d = window.$vueApp.config.globalProperties._selectMenu;
|
|
22
|
+
let n;
|
|
23
|
+
if (d ? n = d : s && (n = s), n) {
|
|
24
|
+
const i = n.substring(0, n.indexOf("~~")), c = n.substring(n.indexOf("~~") + 2);
|
|
25
|
+
if (t && t.length > 0) {
|
|
26
|
+
const _ = t[t.length - 1];
|
|
27
|
+
this.isShouldConcatLastMenu(c, i, _) && t.push({ path: i, meta: { title: c } });
|
|
28
|
+
} else
|
|
29
|
+
t.push({ path: i, meta: { title: c } });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
this.levelList = t;
|
|
33
|
+
}, isShouldConcatLastMenu(e, t, a) {
|
|
34
|
+
return !(!this.isTitleNotEqual(e, a) || !this.isPathNotEqual(t, a));
|
|
35
|
+
}, isTitleNotEqual(e, t) {
|
|
36
|
+
return !(!e || !t.meta || e === t.meta.title || e === this.$t(t.meta.title));
|
|
37
|
+
}, isPathNotEqual: (e, t) => !(!e || !t.path || e === t.path) } }, [["render", function(e, t, a, r, o, s) {
|
|
38
|
+
const d = m("el-breadcrumb-item"), n = m("el-breadcrumb");
|
|
39
|
+
return l(), b(n, { class: "app-breadcrumb", separator: ">" }, { default: g(() => [w(L, { name: "breadcrumb", tag: "span" }, { default: g(() => [(l(!0), p(T, null, C(s.levelListWithTitle, (i, c) => (l(), b(d, { key: i.path + "-" + c }, { default: g(() => [u("span", A, y(e.$t(i.meta.title)), 1)]), _: 2 }, 1024))), 128))]), _: 1 })]), _: 1 });
|
|
40
|
+
}], ["__scopeId", "data-v-768a430c"]]), { body: B } = document, E = { watch: { $route(e) {
|
|
41
|
+
this.device === "mobile" && this.sidebar.opened && h.dispatch("closeSidebar", { withoutAnimation: !1 });
|
|
42
|
+
} }, beforeMount() {
|
|
43
|
+
window.addEventListener("resize", this.resizeHandler);
|
|
44
|
+
}, mounted() {
|
|
45
|
+
this.isMobile() && (h.dispatch("toggelDevice", "mobile"), h.dispatch("closeSidebar", { withoutAnimation: !0 }));
|
|
46
|
+
}, methods: { isMobile: () => B.getBoundingClientRect().width - 3 < 1024, resizeHandler() {
|
|
47
|
+
if (!document.hidden) {
|
|
48
|
+
const e = this.isMobile();
|
|
49
|
+
h.dispatch("toggelDevice", e ? "mobile" : "desktop"), e && h.dispatch("closeSidebar", { withoutAnimation: !0 });
|
|
50
|
+
}
|
|
51
|
+
} } }, N = { name: "TabContent", data() {
|
|
52
|
+
let e = window.$vueApp.config.globalProperties.defaultPageTip;
|
|
53
|
+
e || (e = "欢迎访问Agile Builder/Welcome to Agile Builder");
|
|
54
|
+
let t, a = e;
|
|
55
|
+
return e && e.indexOf("/") > 0 && (a = e.substring(0, e.lastIndexOf("/")), t = e.substring(e.lastIndexOf("/") + 1)), { defaultPageTipCn: a, defaultPageTipEn: t };
|
|
56
|
+
}, computed: { ...M(["openTab"]), activeIndex: { get() {
|
|
57
|
+
return this.$store.state.tabContent.activeIndex;
|
|
58
|
+
}, set(e) {
|
|
59
|
+
this.$store.commit("set_active_index", e);
|
|
60
|
+
} } }, created() {
|
|
61
|
+
window.addEventListener("message", this.recieveMessage);
|
|
62
|
+
}, mounted() {
|
|
63
|
+
}, unmounted() {
|
|
64
|
+
window.removeEventListener("message", this.recieveMessage);
|
|
65
|
+
}, methods: { closeSelectedTag(e) {
|
|
66
|
+
const t = this.$store.state.tabContent.openTab.findIndex((r) => r.code === e), a = this.$store.state.tabContent.openTab[t];
|
|
67
|
+
this.$store.commit("delete_tabs", a), e === this.activeIndex && this.toLastView(this.$store.state.tabContent.openTab, t > 0 ? t - 1 : 0);
|
|
68
|
+
}, toLastView(e, t) {
|
|
69
|
+
if (e && e.length > 0 && e.length > t) {
|
|
70
|
+
const a = e[t];
|
|
71
|
+
a && this.$store.commit("set_active_index", a.code);
|
|
72
|
+
}
|
|
73
|
+
}, getFullPath(e) {
|
|
74
|
+
let t = "";
|
|
75
|
+
if (e.routePath === "/iframe-page/page") {
|
|
76
|
+
let a, r = "";
|
|
77
|
+
if (e.routeQuery)
|
|
78
|
+
for (const o in e.routeQuery)
|
|
79
|
+
o === "src" ? a = e.routeQuery[o] : r += o + "=" + e.routeQuery[o] + "&";
|
|
80
|
+
a && (t = a), r && (t += "?" + r);
|
|
81
|
+
} else if (e.routePath.indexOf("http:") < 0 && e.routePath.indexOf("https:") < 0 && (t = "#"), t = e.routePath.indexOf("?") >= 0 ? t + e.routePath + "&" : t + e.routePath + "?", e.routeQuery)
|
|
82
|
+
for (const a in e.routeQuery)
|
|
83
|
+
t += a + "=" + e.routeQuery[a] + "&";
|
|
84
|
+
return t && t.length > 0 && t.lastIndexOf("&") === t.length - 1 && (t = t.substring(0, t.lastIndexOf("&"))), t;
|
|
85
|
+
}, recieveMessage(e) {
|
|
86
|
+
if (e && typeof e.data == "string" && e.data === "refreshTabContent")
|
|
87
|
+
window.location.reload();
|
|
88
|
+
else if (e && typeof e.data == "string" && e.data.indexOf("loginTimeout") >= 0)
|
|
89
|
+
window.parent.postMessage(e.data, "*");
|
|
90
|
+
else if (e && typeof e.data == "string" && e.data === "return-to-system-list") {
|
|
91
|
+
this.$store.commit("clear_tabs");
|
|
92
|
+
let t = "_IS_APP_LIST";
|
|
93
|
+
const a = window.sessionStorage.getItem(t);
|
|
94
|
+
a !== void 0 && a === "true" ? this.$router.push({ path: "/mms/apps/list" }) : this.$router.push({ path: "/mms/systems/list" });
|
|
95
|
+
}
|
|
96
|
+
} } }, V = ["src"], Q = { class: "default-page-tip" }, R = { class: "default-page-tip-msg" }, q = { class: "default-page-tip-item" }, z = { class: "default-page-tip-item" }, j = { class: "main-container" }, W = v({ name: "Layout", components: { Menubar: O, Breadcrumb: k, TabContent: v(N, [["render", function(e, t, a, r, o, s) {
|
|
97
|
+
const d = m("el-tab-pane"), n = m("el-tabs");
|
|
98
|
+
return l(), p("div", null, [e.openTab && e.openTab.length > 0 ? (l(), b(n, { key: 0, modelValue: s.activeIndex, "onUpdate:modelValue": t[0] || (t[0] = (i) => s.activeIndex = i), class: "nav-tab menu-tab-container", closable: "", onTabRemove: s.closeSelectedTag }, { default: g(() => [(l(!0), p(T, null, C(e.openTab, (i) => (l(), b(d, { key: i.code, label: i.name, name: i.code }, { default: g(() => [u("iframe", { ref_for: !0, ref: "tabMainContent", src: s.getFullPath(i), class: "tab-main-content", name: "tab-main-content", frameborder: "0" }, null, 8, V)]), _: 2 }, 1032, ["label", "name"]))), 128))]), _: 1 }, 8, ["modelValue", "onTabRemove"])) : f("", !0), u("div", Q, [u("div", R, [u("div", q, y(o.defaultPageTipCn), 1), u("div", z, y(o.defaultPageTipEn), 1)])])]);
|
|
99
|
+
}], ["__scopeId", "data-v-acb71e42"]]) }, mixins: [E], data: () => ({ showMenuRoute: I(), systemCode: null }), computed: { sidebar() {
|
|
100
|
+
return this.$store.state.app.sidebar;
|
|
101
|
+
}, device() {
|
|
102
|
+
return this.$store.state.app.device;
|
|
103
|
+
}, classObj() {
|
|
104
|
+
return { hideSidebar: !this.sidebar.opened, openSidebar: this.sidebar.opened, withoutAnimation: this.sidebar.withoutAnimation, mobile: this.device === "mobile" };
|
|
105
|
+
} }, created() {
|
|
106
|
+
this.systemCode = window.$vueApp.config.globalProperties.customSystem;
|
|
107
|
+
}, methods: { handleClickOutside() {
|
|
108
|
+
this.$store.dispatch("closeSidebar", { withoutAnimation: !1 });
|
|
109
|
+
} } }, [["render", function(e, t, a, r, o, s) {
|
|
110
|
+
const d = m("menubar"), n = m("breadcrumb"), i = m("tab-content");
|
|
111
|
+
return l(), p("div", { class: S([s.classObj, "app-wrapper"]) }, [s.device === "mobile" && s.sidebar.opened ? (l(), p("div", { key: 0, class: "drawer-bg", onClick: t[0] || (t[0] = (...c) => s.handleClickOutside && s.handleClickOutside(...c)) })) : f("", !0), w(d, { "system-code": o.systemCode, collapse: !0, class: "sidebar-container" }, null, 8, ["system-code"]), u("div", j, [o.showMenuRoute ? (l(), b(n, { key: 0 })) : f("", !0), w(i)])], 2);
|
|
112
|
+
}], ["__scopeId", "data-v-5c0a6bf6"]]);
|
|
113
|
+
export {
|
|
114
|
+
W as default
|
|
115
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { resolveComponent as t, openBlock as a, createElementBlock as s, createElementVNode as y, createVNode as l, withCtx as r, createTextVNode as n, toDisplayString as p, createCommentVNode as c, createBlock as h } from "vue";
|
|
2
|
+
import { _ as I } from "./index-e8b65d1a.js";
|
|
3
|
+
const g = { style: { "padding-bottom": "10px" } }, k = { key: 0, class: "graphDiv" }, N = I({ name: "TacheSubprocessHistory", data: () => ({ type: "graph", workflowId: null }), created() {
|
|
4
|
+
const o = this.$route.query.workflowId;
|
|
5
|
+
o && (this.workflowId = parseInt(o));
|
|
6
|
+
} }, [["render", function(o, d, V, b, e, v) {
|
|
7
|
+
const i = t("el-radio-button"), w = t("el-radio-group"), u = t("workflow-history"), m = t("workflow-history-list");
|
|
8
|
+
return a(), s("div", null, [y("div", g, [l(w, { modelValue: e.type, "onUpdate:modelValue": d[0] || (d[0] = (f) => e.type = f) }, { default: r(() => [l(i, { label: "graph" }, { default: r(() => [n(p(o.$t("imatrixUIPublicModel.graphView")), 1)]), _: 1 }), l(i, { label: "list" }, { default: r(() => [n(p(o.$t("imatrixUIPublicModel.listView")), 1)]), _: 1 })]), _: 1 }, 8, ["modelValue"])]), e.type === "graph" ? (a(), s("div", k, [l(u, { id: e.workflowId }, null, 8, ["id"])])) : c("", !0), e.type === "list" ? (a(), h(m, { key: 1, "workflow-id": e.workflowId }, null, 8, ["workflow-id"])) : c("", !0)]);
|
|
9
|
+
}], ["__scopeId", "data-v-a936569d"]]);
|
|
10
|
+
export {
|
|
11
|
+
N as default
|
|
12
|
+
};
|
package/package.json
CHANGED
|
@@ -21,6 +21,8 @@ import {
|
|
|
21
21
|
import eventBus from './eventBus'
|
|
22
22
|
import { isPromise } from '../../../src/utils/common-util'
|
|
23
23
|
import { updateWithPageValue } from '../../../src/utils/jump-page-utils'
|
|
24
|
+
import { getGuId } from '../../../src/utils/guid.js';
|
|
25
|
+
|
|
24
26
|
const apis = {
|
|
25
27
|
// 列表工具栏控件刷新列表数据。添加该方法解决工具栏值清空后,列表内容没有还原问题
|
|
26
28
|
toolbarRefresh(parentRowIds, isLineEdit, toolbarFieldParam, isDeleteSubTableData) {
|
|
@@ -133,12 +135,13 @@ const apis = {
|
|
|
133
135
|
// 新建行
|
|
134
136
|
createRow(listCode, row, options) {
|
|
135
137
|
return new Promise((resolve, reject) => {
|
|
138
|
+
debugger;
|
|
136
139
|
if (!listCode) {
|
|
137
140
|
listCode = store.get('_list_code')
|
|
138
141
|
}
|
|
139
142
|
const gridParams = store.get(listCode)
|
|
140
143
|
const gridData = gridParams.gridData
|
|
141
|
-
gridParams.superGrid
|
|
144
|
+
gridParams.superGrid?.clearSort?.()
|
|
142
145
|
// console.log('创建行记录的条件1', gridParams.lineEdit)
|
|
143
146
|
// console.log('创建行记录的条件2', gridParams.lineEdit.editable)
|
|
144
147
|
// console.log('创建行记录的条件3', gridParams.loaded)
|
|
@@ -364,7 +367,10 @@ const apis = {
|
|
|
364
367
|
}
|
|
365
368
|
}
|
|
366
369
|
}
|
|
367
|
-
return
|
|
370
|
+
return {
|
|
371
|
+
$rowDataGuId: getGuId(),
|
|
372
|
+
...row,
|
|
373
|
+
}
|
|
368
374
|
},
|
|
369
375
|
// 设置默认值null
|
|
370
376
|
setColumnsDefaultValue(allColumns, row, gridParams, getDefaultValueFunc) {
|
|
@@ -1005,7 +1011,7 @@ const apis = {
|
|
|
1005
1011
|
}
|
|
1006
1012
|
}
|
|
1007
1013
|
if (gridParams.isMulitiSelect) {
|
|
1008
|
-
gridParams.superGrid
|
|
1014
|
+
gridParams.superGrid?.clearSelection?.()
|
|
1009
1015
|
}
|
|
1010
1016
|
gridParams.isCreateRow = false
|
|
1011
1017
|
if (isRestore === undefined || !isRestore) {
|
|
@@ -1382,3 +1388,40 @@ const apis = {
|
|
|
1382
1388
|
}
|
|
1383
1389
|
}
|
|
1384
1390
|
export default apis
|
|
1391
|
+
|
|
1392
|
+
export const apisMixin = {
|
|
1393
|
+
data() {
|
|
1394
|
+
return {
|
|
1395
|
+
toolbarFieldParam: null,
|
|
1396
|
+
showSearch: false,
|
|
1397
|
+
isMobile: false,
|
|
1398
|
+
baseURL: '',
|
|
1399
|
+
currentPage: 1,
|
|
1400
|
+
pageSize: 10,
|
|
1401
|
+
code: '',
|
|
1402
|
+
pageCode: '',
|
|
1403
|
+
jumpPageSetting: null,
|
|
1404
|
+
isShowPageDialog: false,
|
|
1405
|
+
gridData: [],
|
|
1406
|
+
subTableData: [],
|
|
1407
|
+
searchForm: [],
|
|
1408
|
+
options: {},
|
|
1409
|
+
lineEdit: null,
|
|
1410
|
+
loaded: false,
|
|
1411
|
+
configureObj: {},
|
|
1412
|
+
additionalParamMap: {},
|
|
1413
|
+
basicInfo: {},
|
|
1414
|
+
dynamicColumnInfo: {},
|
|
1415
|
+
$dataTypeMap: {},
|
|
1416
|
+
mainDefaultValueColumns: [],
|
|
1417
|
+
dynamicServiceName: '',
|
|
1418
|
+
isHasDynamic: false,
|
|
1419
|
+
isMulitiSelect: false,
|
|
1420
|
+
sql: false,
|
|
1421
|
+
restoreCurrentRowTimer: null
|
|
1422
|
+
};
|
|
1423
|
+
},
|
|
1424
|
+
methods: {
|
|
1425
|
+
...apis
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
@@ -2,18 +2,22 @@
|
|
|
2
2
|
import { defineComponent, ref, computed, watch, defineEmits } from 'vue';
|
|
3
3
|
import { ElCard, ElDrawer, ElTag,ElDescriptions, ElDescriptionsItem, ElButton, ElIcon, ElCheckbox, ElCheckboxGroup, ElBreadcrumb, ElLink, ElEmpty, ElDivider } from 'element-plus';
|
|
4
4
|
import NormalColumnContent from '../normal-column-content.vue';
|
|
5
|
-
import CardView from '
|
|
5
|
+
import CardView from '../../../../src/components/Card';
|
|
6
|
+
import Scrollbar from '../../../../src/components/Scrollbar';
|
|
6
7
|
import store from '../store';
|
|
8
|
+
import { apisMixin } from '../apis'
|
|
7
9
|
|
|
8
|
-
import { ArrowLeft, Bottom, Loading, Tickets } from '@element-plus/icons-vue';
|
|
10
|
+
import { ArrowLeft, Bottom, CirclePlus, Loading, Tickets } from '@element-plus/icons-vue';
|
|
9
11
|
// import { $emit, $off, $on } from '@/utils/gogocodeTransfer'
|
|
10
12
|
|
|
11
13
|
export default defineComponent({
|
|
12
14
|
name: 'MobileTableCard',
|
|
13
15
|
components: {
|
|
14
16
|
NormalColumnContent,
|
|
15
|
-
CardView
|
|
17
|
+
CardView,
|
|
18
|
+
Scrollbar
|
|
16
19
|
},
|
|
20
|
+
mixins: [apisMixin],
|
|
17
21
|
props: {
|
|
18
22
|
// 展示字段限制
|
|
19
23
|
showFieldCount: {
|
|
@@ -59,8 +63,9 @@ export default defineComponent({
|
|
|
59
63
|
setup(props, setupData) {
|
|
60
64
|
const $emits = defineEmits(['currentChange', 'update:current-page', 'select']);
|
|
61
65
|
|
|
62
|
-
const { attrs, emit } = setupData
|
|
63
|
-
|
|
66
|
+
const { attrs, emit, expose } = setupData
|
|
67
|
+
|
|
68
|
+
console.log('*mobile-table-card.JSX**********************************************=>', props, attrs, setupData, expose)
|
|
64
69
|
|
|
65
70
|
// 分页加载状态
|
|
66
71
|
const isPaginationLoading = ref(false)
|
|
@@ -68,10 +73,10 @@ export default defineComponent({
|
|
|
68
73
|
const paginationList = ref([])
|
|
69
74
|
// 选中数据
|
|
70
75
|
const checkedList = ref([]);
|
|
76
|
+
// 当前勾选ID
|
|
77
|
+
const checkedClickId = ref(undefined);
|
|
71
78
|
// 当前选中数据
|
|
72
79
|
const isCheckedIndex = ref(undefined);
|
|
73
|
-
// 展开更多字段
|
|
74
|
-
const isColumnExpandMore = ref(undefined);
|
|
75
80
|
|
|
76
81
|
// 是否打开子表弹窗
|
|
77
82
|
const isChildrenDrawer = ref(false);
|
|
@@ -90,6 +95,15 @@ export default defineComponent({
|
|
|
90
95
|
|
|
91
96
|
setPaginationList(props.data)
|
|
92
97
|
|
|
98
|
+
const addColumnBtn = computed(() => {
|
|
99
|
+
const gridParams = store.get(attrs.listCode)
|
|
100
|
+
const showOperationButton = gridParams?.options?.showOperationButton ?? false
|
|
101
|
+
const isFormSubTable = gridParams?.options?.isFormSubTable ?? false
|
|
102
|
+
const subTableCanAdd = gridParams?.options?.subTableCanAdd ?? false
|
|
103
|
+
const isOperation = componentDatas.value?.some(({ prop }) => ['operation'].includes(prop))
|
|
104
|
+
return showOperationButton && isFormSubTable && subTableCanAdd && isOperation
|
|
105
|
+
})
|
|
106
|
+
|
|
93
107
|
// 列表数据
|
|
94
108
|
const dataList = computed(() => {
|
|
95
109
|
if (props.isStackingPaginatedData) {
|
|
@@ -99,6 +113,14 @@ export default defineComponent({
|
|
|
99
113
|
}
|
|
100
114
|
});
|
|
101
115
|
|
|
116
|
+
const isLoadPaginationData = computed(() => {
|
|
117
|
+
if (props.isStackingPaginatedData) {
|
|
118
|
+
return (paginationList.value[props.currentPage - 1]?.length ?? 0) > 0
|
|
119
|
+
} else {
|
|
120
|
+
return dataList.value.length < props.pageSize * props.currentPage && pagesNumber.value >= props.currentPage
|
|
121
|
+
}
|
|
122
|
+
})
|
|
123
|
+
|
|
102
124
|
// 面包屑数据
|
|
103
125
|
const childrenList = computed(() => {
|
|
104
126
|
return childrenBreadcrumbData.value[childrenBreadcrumbData.value.length - 1]?.children ?? []
|
|
@@ -179,6 +201,7 @@ export default defineComponent({
|
|
|
179
201
|
} else {
|
|
180
202
|
checkedList.value = [...new Set([...checkedList.value, value])]
|
|
181
203
|
}
|
|
204
|
+
checkedClickId.value = value
|
|
182
205
|
}
|
|
183
206
|
|
|
184
207
|
/**
|
|
@@ -205,9 +228,8 @@ export default defineComponent({
|
|
|
205
228
|
const onAttrs = {
|
|
206
229
|
...Object.fromEntries(Object.keys($on).map(key => [`on${key.charAt(0).toUpperCase()}${key.slice(1).replace(/-([a-z])/g, (match, letter) => letter.toUpperCase())}`, $on[key]]))
|
|
207
230
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
</div>
|
|
231
|
+
|
|
232
|
+
return <NormalColumnContent isContentViewText={isViewText} {...attrs} {...onAttrs} />
|
|
211
233
|
}
|
|
212
234
|
|
|
213
235
|
/**
|
|
@@ -219,6 +241,7 @@ export default defineComponent({
|
|
|
219
241
|
* @returns .filter((_, index) => !props.showFieldCount || props.showFieldCount > index + 1)
|
|
220
242
|
*/
|
|
221
243
|
const getElDescriptions = (layoutDatas, columnFormData = detailsFormData.value, columnIndex = isCheckedIndex.value, showFieldCount = undefined) => {
|
|
244
|
+
// const propertyData = columnData?.find(({ property }) => property)
|
|
222
245
|
return <ElDescriptions column={1} label-width={maxLabelWidth.value} align="right" direction="horizontal" layout='form'>
|
|
223
246
|
{(showFieldCount ? layoutDatas?.slice?.(0, showFieldCount) : layoutDatas)?.map((columnCol, index) => (
|
|
224
247
|
<ElDescriptionsItem
|
|
@@ -228,6 +251,12 @@ export default defineComponent({
|
|
|
228
251
|
label: () => <div v-html={columnCol.label ? `${columnCol.label}:` : ''} />
|
|
229
252
|
}
|
|
230
253
|
}
|
|
254
|
+
// onRowDblclick={(event) => {
|
|
255
|
+
// console.log('我双击了', columnCol?.property )
|
|
256
|
+
// // if (isViewText) return
|
|
257
|
+
// event.stopPropagation()
|
|
258
|
+
// // emit('rowDblclick', columnFormData, columnData, event)
|
|
259
|
+
// }}
|
|
231
260
|
>
|
|
232
261
|
{columnViewDom(columnCol, columnFormData, columnIndex) || '-'}
|
|
233
262
|
</ElDescriptionsItem>
|
|
@@ -241,13 +270,23 @@ export default defineComponent({
|
|
|
241
270
|
}, { deep: true });
|
|
242
271
|
|
|
243
272
|
// 勾选监听
|
|
244
|
-
watch(checkedList, (newValue) => {
|
|
273
|
+
watch(checkedList, (newValue , oldValue) => {
|
|
274
|
+
console.log(newValue , oldValue)
|
|
245
275
|
if (attrs.selection.length === newValue.length) {
|
|
246
276
|
if (attrs.selection.every(({ $rowDataGuId }) => newValue.includes($rowDataGuId ) )) return
|
|
247
277
|
}
|
|
248
278
|
const selectData = dataList.value.filter(({ $rowDataGuId }) => newValue?.includes($rowDataGuId))
|
|
249
|
-
|
|
279
|
+
const findData = checkedClickId.value ? dataList.value.find(({ $rowDataGuId }) => checkedClickId.value === $rowDataGuId) : undefined
|
|
280
|
+
// 新增选中
|
|
281
|
+
if (newValue.length > oldValue?.length && findData) {
|
|
282
|
+
emit('select', selectData, findData)
|
|
283
|
+
}
|
|
284
|
+
// 移除选中
|
|
285
|
+
if (newValue.length < oldValue?.length && findData) {
|
|
286
|
+
emit('select', selectData, findData)
|
|
287
|
+
}
|
|
250
288
|
emit('selectionChange', selectData)
|
|
289
|
+
checkedClickId.value = undefined
|
|
251
290
|
}, { deep: true });
|
|
252
291
|
|
|
253
292
|
// 滚动数据加载监听
|
|
@@ -276,119 +315,135 @@ export default defineComponent({
|
|
|
276
315
|
}
|
|
277
316
|
}
|
|
278
317
|
|
|
279
|
-
const
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
// 开启编辑后禁止选中
|
|
311
|
-
const onChecked = () => !columnFormData.$editing && setCheckedList(columnFormData.$rowDataGuId)
|
|
312
|
-
|
|
313
|
-
// 是否选中
|
|
314
|
-
const isChecked = checkedList.value.includes(columnFormData.$rowDataGuId)
|
|
315
|
-
|
|
316
|
-
// 是否有子表
|
|
317
|
-
const isSubTable = !!((columnFormData?.children?.length ?? 0) > 0)
|
|
318
|
-
|
|
319
|
-
return (<CardView
|
|
320
|
-
form={columnFormData}
|
|
321
|
-
no={ isIndex ? columnIndex + 1 : undefined}
|
|
322
|
-
isChecked={isChecked}
|
|
323
|
-
isSubTable={isSubTable}
|
|
324
|
-
isCheck={isCheck.value}
|
|
325
|
-
isShowDetailsMore={isShowDetailsMore.value && !columnFormData.$editing}
|
|
326
|
-
onChecked={onChecked}
|
|
327
|
-
onShowSubTable={() => {
|
|
328
|
-
childrenBreadcrumbData.value =[...childrenBreadcrumbData.value, columnFormData];
|
|
329
|
-
}}
|
|
330
|
-
v-slots={{
|
|
331
|
-
titleSlot: layoutData.value.header && layoutData.value.header?.map((columnCol) => columnViewDom(columnCol, columnFormData, columnIndex, true)),
|
|
332
|
-
children: ({ isMore }) => getElDescriptions(layoutData.value.content, columnFormData, columnIndex, !isMore ? undefined : props.showFieldCount),
|
|
333
|
-
footerSlot: isShowFooter.value && (<div class="yx-flex-wrap" wrap style={{gap: '15px'}}>
|
|
334
|
-
{layoutData.value.footer?.map((columnCol) => columnViewDom(columnCol, columnFormData, columnIndex))}
|
|
335
|
-
</div>)
|
|
336
|
-
}}
|
|
337
|
-
/>)
|
|
338
|
-
}) }
|
|
339
|
-
</div>
|
|
340
|
-
</ElScrollbar>
|
|
341
|
-
</div>
|
|
342
|
-
</ElDrawer>)}
|
|
343
|
-
<div
|
|
344
|
-
class="yx-flex-wrap"
|
|
345
|
-
vertical
|
|
346
|
-
style="overflow: auto; gap: 15px;"
|
|
347
|
-
onInfiniteScroll={load}
|
|
348
|
-
>
|
|
349
|
-
{dataList.value.length === 0 && <ElEmpty />}
|
|
318
|
+
const getAddBtn = (Fun) => addColumnBtn.value && <ElButton type="primary" plain icon={<CirclePlus />} onClick={() => Fun?.(attrs.listCode)}>Add</ElButton>
|
|
319
|
+
|
|
320
|
+
return {
|
|
321
|
+
getAddBtn,
|
|
322
|
+
renderDom: (AddBtn) => (
|
|
323
|
+
<Scrollbar onScrollToBottom={scrollLoad} set-max-height={data => {
|
|
324
|
+
if (data?.windowHeight) {
|
|
325
|
+
const height = data?.windowHeight - 160
|
|
326
|
+
return height > 400 ? height : 400
|
|
327
|
+
}
|
|
328
|
+
}}>
|
|
329
|
+
{(<ElDrawer v-model={isChildrenDrawer.value} modal-class='yx-drawer yx-scrollbar-body' with-header={true} direction="btt" append-to-body size='90vh' v-slots={{
|
|
330
|
+
header: () => (<div class="yx-flex-wrap" style={{gap: '10px'}}>
|
|
331
|
+
{layoutData.value.header[0] && `${layoutData.value.header[0].label}: `}
|
|
332
|
+
<ElBreadcrumb separator-icon={<ArrowRight></ArrowRight>}>
|
|
333
|
+
{childrenBreadcrumbData.value.map((columnFormData, i) => {
|
|
334
|
+
const label = columnViewDom(layoutData.value.header[0], columnFormData, undefined, true)
|
|
335
|
+
return (
|
|
336
|
+
<ElBreadcrumbItem>
|
|
337
|
+
{
|
|
338
|
+
childrenBreadcrumbData.value.length - 1 === i ? label : <ElLink onClick={() => childrenBreadcrumbData.value = childrenBreadcrumbData.value.slice(0, i + 1)}>{ label }</ElLink>
|
|
339
|
+
}
|
|
340
|
+
</ElBreadcrumbItem>
|
|
341
|
+
)
|
|
342
|
+
|
|
343
|
+
})}
|
|
344
|
+
</ElBreadcrumb>
|
|
345
|
+
</div>)
|
|
346
|
+
}}
|
|
347
|
+
onClosed={() => childrenBreadcrumbData.value = []}
|
|
348
|
+
>
|
|
350
349
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
</
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
350
|
+
<Scrollbar scrollable-main max-height='100%' style={{ 'flex': '1 1 auto'}}>
|
|
351
|
+
<div class="yx-flex-wrap" vertical style={{ gap: '15px'}}>
|
|
352
|
+
{ childrenList.value.map((columnFormData, columnIndex) => {
|
|
353
|
+
// 开启编辑后禁止选中
|
|
354
|
+
const onChecked = () => !columnFormData.$editing && setCheckedList(columnFormData.$rowDataGuId)
|
|
355
|
+
|
|
356
|
+
// 是否选中
|
|
357
|
+
const isChecked = checkedList.value.includes(columnFormData.$rowDataGuId)
|
|
358
|
+
|
|
359
|
+
// 是否有子表
|
|
360
|
+
const isSubTable = !!((columnFormData?.children?.length ?? 0) > 0)
|
|
361
|
+
|
|
362
|
+
const clickPropertyData = layoutData.value.content?.find(({ property }) => property) ?? layoutData.value.content[0]
|
|
363
|
+
|
|
364
|
+
return (<CardView
|
|
365
|
+
form={columnFormData}
|
|
366
|
+
no={ isIndex ? columnIndex + 1 : undefined}
|
|
367
|
+
isChecked={isChecked}
|
|
368
|
+
isSubTable={isSubTable}
|
|
369
|
+
isCheck={isCheck.value}
|
|
370
|
+
isShowDetailsMore={isShowDetailsMore.value && !columnFormData.$editing}
|
|
371
|
+
onChecked={onChecked}
|
|
372
|
+
onShowSubTable={() => {
|
|
373
|
+
childrenBreadcrumbData.value =[...childrenBreadcrumbData.value, columnFormData];
|
|
374
|
+
}}
|
|
375
|
+
onRowClick={(event) => emit('rowClick', columnFormData, clickPropertyData, event)}
|
|
376
|
+
onRowDblclick={(event) => emit('rowDblclick', columnFormData, clickPropertyData, event)}
|
|
377
|
+
v-slots={{
|
|
378
|
+
titleSlot: layoutData.value.header && layoutData.value.header?.map((columnCol) => columnViewDom(columnCol, columnFormData, columnIndex, true)),
|
|
379
|
+
children: ({ isMore }) => getElDescriptions(layoutData.value.content, columnFormData, columnIndex, !isMore ? undefined : props.showFieldCount),
|
|
380
|
+
footerSlot: isShowFooter.value && (<div class="yx-flex-wrap" wrap style={{gap: '15px'}}>
|
|
381
|
+
{layoutData.value.footer?.map((columnCol) => columnViewDom(columnCol, columnFormData, columnIndex))}
|
|
382
|
+
</div>)
|
|
383
|
+
}}
|
|
384
|
+
/>)
|
|
385
|
+
}) }
|
|
386
|
+
</div>
|
|
387
|
+
</Scrollbar>
|
|
388
|
+
</ElDrawer>)}
|
|
389
|
+
<div
|
|
390
|
+
class="yx-flex-wrap"
|
|
391
|
+
vertical
|
|
392
|
+
style="overflow: auto; gap: 15px;"
|
|
393
|
+
>
|
|
394
|
+
{dataList.value.length === 0 && <ElEmpty>{AddBtn}</ElEmpty>}
|
|
395
|
+
|
|
396
|
+
{dataList.value.map((columnFormData, columnIndex) => {
|
|
397
|
+
|
|
398
|
+
// 开启编辑后禁止选中
|
|
399
|
+
const onChecked = () => !columnFormData.$editing && setCheckedList(columnFormData.$rowDataGuId)
|
|
400
|
+
|
|
401
|
+
// 是否选中
|
|
402
|
+
const isChecked = checkedList.value.includes(columnFormData.$rowDataGuId)
|
|
403
|
+
|
|
404
|
+
// 是否有子表
|
|
405
|
+
const isSubTable = !!(columnFormData?.children?.length ?? false)
|
|
406
|
+
|
|
407
|
+
const clickPropertyData = layoutData.value.content?.find(({ property }) => property) ?? layoutData.value.content[0]
|
|
408
|
+
|
|
409
|
+
return (<CardView
|
|
410
|
+
form={columnFormData}
|
|
411
|
+
no={ isIndex ? columnIndex + 1 : undefined}
|
|
412
|
+
isChecked={isChecked}
|
|
413
|
+
isSubTable={isSubTable}
|
|
414
|
+
isCheck={isCheck.value}
|
|
415
|
+
isShowDetailsMore={isShowDetailsMore.value && !columnFormData.$editing}
|
|
416
|
+
onChecked={onChecked}
|
|
417
|
+
onShowSubTable={() => {
|
|
418
|
+
childrenBreadcrumbData.value =[columnFormData];
|
|
419
|
+
isChildrenDrawer.value = true
|
|
420
|
+
}}
|
|
421
|
+
onRowClick={(event) => emit('rowClick', columnFormData, clickPropertyData, event)}
|
|
422
|
+
onRowDblclick={(event) => emit('rowDblclick', columnFormData, clickPropertyData, event)}
|
|
423
|
+
v-slots={{
|
|
424
|
+
titleSlot: layoutData.value.header && layoutData.value.header?.map((columnCol) => columnViewDom(columnCol, columnFormData, columnIndex, true)),
|
|
425
|
+
children: ({ isMore }) => getElDescriptions(layoutData.value.content, columnFormData, columnIndex, !isMore ? undefined : props.showFieldCount),
|
|
426
|
+
footerSlot: isShowFooter.value && (<div class="yx-flex-wrap" wrap style={{gap: '15px'}}>
|
|
427
|
+
{layoutData.value.footer?.map((columnCol) => columnViewDom(columnCol, columnFormData, columnIndex))}
|
|
428
|
+
</div>)
|
|
429
|
+
}}
|
|
430
|
+
/>)
|
|
431
|
+
})}
|
|
432
|
+
|
|
433
|
+
{dataList.value.length > 0 && AddBtn}
|
|
434
|
+
|
|
435
|
+
{
|
|
436
|
+
dataList.value.length > 0 && pagesNumber.value > 1 && (<ElDivider>
|
|
437
|
+
{ (pagesNumber.value > props.currentPage || isPaginationLoading.value) ? (<ElIcon loading-rotate size={25} color="#409eff" style={{ margin: '15px auto' }}><Loading></Loading></ElIcon>) : (pagesNumber.value <= props.currentPage && isLoadPaginationData.value) && 'END' }
|
|
438
|
+
</ElDivider>)
|
|
439
|
+
}
|
|
440
|
+
</div>
|
|
441
|
+
</Scrollbar>
|
|
442
|
+
)
|
|
443
|
+
};
|
|
444
|
+
},
|
|
445
|
+
render() {
|
|
446
|
+
// 为了 能兼容 使用 mixins 参数
|
|
447
|
+
return this.renderDom(this.getAddBtn(this.createRow))
|
|
393
448
|
}
|
|
394
449
|
});
|