agilebuilder-ui 1.1.65-tmp23 → 1.1.65-tmp24
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/dist/index.full.min.js +462 -281
- package/dist/style.css +181 -175
- package/es/chat-embed/src/chat-sender.vue.mjs +1 -1
- package/es/chat-embed/src/chat-sender.vue2.mjs +26 -28
- package/es/chat-embed/src/index.vue.mjs +1 -1
- package/es/chat-embed/src/index.vue2.mjs +29 -29
- package/es/department-tree-mobile/src/department-tree-inline-app.vue.mjs +68 -68
- package/es/department-tree-mobile/src/department-tree-service.mjs +20 -18
- package/es/department-tree-mobile/src/dept-result.vue.mjs +12 -11
- package/es/department-user-tree-inline/src/department-user-single-tree-inline.vue.mjs +3 -3
- package/es/department-user-tree-inline/src/department-user-tree-inline.vue.mjs +6 -6
- package/es/department-user-tree-inline/src/department-user-tree-single-service.mjs +1 -1
- package/es/fs-preview/src/fs-preview.vue.mjs +26 -18
- package/es/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue.mjs +1 -1
- package/es/fs-upload-new/src/file-upload-mobile/file-upload-input.vue.mjs +1 -1
- package/es/index.mjs +2 -1
- package/es/src/components/Card/index.mjs +34 -31
- package/es/src/components/Scrollbar/index.vue.mjs +6 -6
- package/es/src/i18n/langs/cn.mjs +1 -1
- package/es/src/i18n/langs/en.mjs +1 -1
- package/es/src/utils/common-util.mjs +47 -39
- package/es/style.css +738 -732
- package/es/super-grid/src/apis.mjs +199 -173
- package/es/super-grid/src/components/mobile-table-card.mjs +53 -53
- package/es/super-grid/src/normal-column-content.vue.mjs +12 -12
- package/es/super-grid/src/normal-column.vue.mjs +4 -5
- package/es/super-grid/src/search-button.vue.mjs +4 -2
- package/es/super-grid/src/search-form-dialog.vue.mjs +22 -11
- package/es/super-grid/src/search-form-item.vue.mjs +5 -5
- package/es/super-grid/src/search-form-mobile.vue.mjs +19 -19
- package/es/super-grid/src/search-form-open.vue.mjs +5 -3
- package/es/super-grid/src/search-form-ordinarySearch.vue.mjs +3 -1
- package/es/super-grid/src/search-form.vue.mjs +19 -13
- package/es/super-grid/src/super-grid.vue.mjs +271 -209
- package/es/super-grid/src/utils.mjs +346 -300
- package/es/utils/organization.mjs +24 -11
- package/lib/chat-embed/src/chat-sender.vue.cjs +1 -1
- package/lib/chat-embed/src/chat-sender.vue2.cjs +44 -46
- package/lib/chat-embed/src/index.vue.cjs +1 -1
- package/lib/chat-embed/src/index.vue2.cjs +14 -14
- package/lib/department-tree-mobile/src/department-tree-inline-app.vue.cjs +58 -58
- package/lib/department-tree-mobile/src/department-tree-service.cjs +10 -8
- package/lib/department-tree-mobile/src/dept-result.vue.cjs +10 -10
- package/lib/department-user-tree-inline/src/department-user-single-tree-inline.vue.cjs +16 -16
- package/lib/department-user-tree-inline/src/department-user-tree-inline.vue.cjs +5 -5
- package/lib/department-user-tree-inline/src/department-user-tree-single-service.cjs +1 -1
- package/lib/fs-preview/src/fs-preview.vue.cjs +13 -5
- package/lib/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue.cjs +1 -1
- package/lib/fs-upload-new/src/file-upload-mobile/file-upload-input.vue.cjs +13 -13
- package/lib/index.cjs +7 -7
- package/lib/src/components/Card/index.cjs +14 -11
- package/lib/src/components/Scrollbar/index.vue.cjs +2 -2
- package/lib/src/i18n/langs/cn.cjs +1 -1
- package/lib/src/i18n/langs/en.cjs +1 -1
- package/lib/src/utils/common-util.cjs +24 -17
- package/lib/style.css +665 -659
- package/lib/super-grid/src/apis.cjs +190 -164
- package/lib/super-grid/src/components/mobile-table-card.cjs +37 -37
- package/lib/super-grid/src/normal-column-content.vue.cjs +2 -2
- package/lib/super-grid/src/normal-column.vue.cjs +10 -11
- package/lib/super-grid/src/search-button.vue.cjs +3 -1
- package/lib/super-grid/src/search-form-dialog.vue.cjs +19 -8
- package/lib/super-grid/src/search-form-item.vue.cjs +2 -2
- package/lib/super-grid/src/search-form-mobile.vue.cjs +7 -7
- package/lib/super-grid/src/search-form-open.vue.cjs +7 -5
- package/lib/super-grid/src/search-form-ordinarySearch.vue.cjs +3 -1
- package/lib/super-grid/src/search-form.vue.cjs +15 -10
- package/lib/super-grid/src/super-grid.vue.cjs +220 -158
- package/lib/super-grid/src/utils.cjs +349 -274
- package/lib/utils/organization.cjs +35 -24
- package/package.json +1 -1
- package/src/components/Card/index.jsx +12 -2
- package/src/components/Scrollbar/index.vue +165 -154
- package/src/i18n/langs/cn.js +10 -2
- package/src/i18n/langs/en.js +10 -2
- package/src/styles/index.scss +9 -2
- package/src/styles/theme/default.scss +18 -13
- package/src/styles/theme/tiffany-blue-mobile/home.scss +44 -1
- package/src/utils/auth-api.js +1 -0
- package/src/utils/common-util.js +13 -0
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { $emit as e } from "../../utils/gogocodeTransfer.mjs";
|
|
2
2
|
import t from "./store.mjs";
|
|
3
|
-
import { isEditOptionFunction as
|
|
3
|
+
import { isEditOptionFunction as a, isLastEditRowSave as i, parseSubTableActionCondition as o, scrollYToBottom as s, isHasEditOption as n, getAdditionalParamMap as l, setCurrentRow as r, isDynamicDataSourceSource as d } from "./utils.mjs";
|
|
4
4
|
import g from "./formValidatorUtil.mjs";
|
|
5
5
|
import "vue";
|
|
6
|
-
import { setEntityFieldValue as p, getI18n as u, getEntityFieldValue as c, getPropValueNew as h, getPropValue as
|
|
7
|
-
import
|
|
8
|
-
import { isPromise as
|
|
9
|
-
import { updateWithPageValue as
|
|
10
|
-
import { getGuId as
|
|
11
|
-
import { ElMessageBox as
|
|
12
|
-
const
|
|
13
|
-
return this.toolbarFieldParam =
|
|
14
|
-
}, refresh(e2,
|
|
15
|
-
return new Promise((
|
|
6
|
+
import { setEntityFieldValue as p, getI18n as u, getEntityFieldValue as c, getPropValueNew as h, getPropValue as b } from "../../src/utils/util.mjs";
|
|
7
|
+
import w from "./eventBus.mjs";
|
|
8
|
+
import { isPromise as f, isMobileBrowser as m } from "../../src/utils/common-util.mjs";
|
|
9
|
+
import { updateWithPageValue as S } from "../../src/utils/jump-page-utils.mjs";
|
|
10
|
+
import { getGuId as D } from "../../src/utils/guid.mjs";
|
|
11
|
+
import { ElMessageBox as v } from "element-plus";
|
|
12
|
+
const C = { toolbarRefresh(e2, t2, a2, i2) {
|
|
13
|
+
return this.toolbarFieldParam = a2, this.refresh(e2, t2, a2, i2);
|
|
14
|
+
}, refresh(e2, a2, i2, o2) {
|
|
15
|
+
return new Promise((a3, s2) => {
|
|
16
16
|
if (o2) {
|
|
17
17
|
t.get(this.code).options.subTableData = null;
|
|
18
18
|
}
|
|
19
|
-
if (!
|
|
19
|
+
if (!i2 && this.toolbarFieldParam && (i2 = this.toolbarFieldParam), this.$refs)
|
|
20
20
|
if (null != e2 && e2 instanceof Array && e2.length > 0)
|
|
21
21
|
if (this.$refs.sf) {
|
|
22
22
|
let t2 = this.$refs.sf.packageSearchParam();
|
|
23
|
-
t2 && t2.length > 0 ?
|
|
23
|
+
t2 && t2.length > 0 ? i2 && i2.length > 0 && (1 === t2.length && (t2[0].leftBracket = "(", t2[0].rightBracket = ")"), "or" === t2[t2.length - 1].joinSign && (t2[t2.length - 1].joinSign = "and"), Array.prototype.push.apply(t2, i2)) : i2 && (t2 = [], t2 = i2), this.search(t2, false, e2).then(() => a3()).catch((e3) => s2(e3));
|
|
24
24
|
} else
|
|
25
|
-
this.search(
|
|
25
|
+
this.search(i2, false, e2).then(() => a3()).catch((e3) => s2(e3));
|
|
26
26
|
else if (this.$refs.sf) {
|
|
27
27
|
let e3 = this.$refs.sf.packageSearchParam();
|
|
28
|
-
e3 && e3.length > 0 ?
|
|
28
|
+
e3 && e3.length > 0 ? i2 && i2.length > 0 && (1 === e3.length && (e3[0].leftBracket = "(", e3[0].rightBracket = ")"), "or" === e3[e3.length - 1].joinSign && (e3[e3.length - 1].joinSign = "and"), Array.prototype.push.apply(e3, i2)) : i2 && (e3 = [], e3 = i2), this.search(e3, false).then(() => a3()).catch((e4) => s2(e4));
|
|
29
29
|
} else
|
|
30
|
-
this.search(
|
|
30
|
+
this.search(i2, false).then(() => a3()).catch((e3) => s2(e3));
|
|
31
31
|
else
|
|
32
|
-
|
|
32
|
+
a3();
|
|
33
33
|
});
|
|
34
34
|
}, showSearchForm() {
|
|
35
35
|
this.showSearch = true, e(this, "showSearch");
|
|
@@ -43,23 +43,23 @@ const v = { toolbarRefresh(e2, t2, i2, a2) {
|
|
|
43
43
|
return d2 && d2.rowIndex > -1 && (g2 = d2.rowIndex + 1), new Promise((d3, c2) => {
|
|
44
44
|
var _a, _b, _c;
|
|
45
45
|
n2 || (n2 = t.get("_list_code"));
|
|
46
|
-
const h2 = t.get(n2),
|
|
46
|
+
const h2 = t.get(n2), b2 = h2.gridData;
|
|
47
47
|
if ((_b = (_a = h2.superGrid) == null ? void 0 : _a.clearSort) == null ? void 0 : _b.call(_a), h2.lineEdit && h2.lineEdit.editable && void 0 !== h2.loaded && true === h2.loaded) {
|
|
48
48
|
let t2 = true;
|
|
49
|
-
if (
|
|
50
|
-
const e2 = h2.isSubTableShowPage,
|
|
51
|
-
t2 = h2.pageContext ? h2.options.lineEditOptions.beforeInsertRow.call(this, { gridData: e2 ? h2.subTableData : h2.gridData, rowIndex: h2.$rowIndex, isMobile:
|
|
49
|
+
if (a("beforeInsertRow", n2)) {
|
|
50
|
+
const e2 = h2.isSubTableShowPage, a2 = h2.pagination && h2.pagination.pageSize, i2 = this.isMobile;
|
|
51
|
+
t2 = h2.pageContext ? h2.options.lineEditOptions.beforeInsertRow.call(this, { gridData: e2 ? h2.subTableData : h2.gridData, rowIndex: h2.$rowIndex, isMobile: i2, baseURL: this.baseURL, totalData: e2 ? h2.gridData : null, pageSize: a2, additionalParamMap: h2.additionalParamMap, row: l2, pageContext: h2.pageContext, configureObj: h2.configureObj }) : h2.options.lineEditOptions.beforeInsertRow.call(this, e2 ? h2.subTableData : h2.gridData, h2.$rowIndex, i2, this.baseURL, e2 ? h2.gridData : null, a2, h2.additionalParamMap, l2);
|
|
52
52
|
}
|
|
53
53
|
if (void 0 === t2 || true === t2) {
|
|
54
54
|
if (h2.options && h2.options.isFormSubTable) {
|
|
55
55
|
let t4 = h2.gridData;
|
|
56
56
|
void 0 !== h2.isSubTableShowPage && true === h2.isSubTableShowPage && (t4 = h2.subTableData);
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
p(t5, "$editing", false), e(
|
|
57
|
+
const a2 = t4.filter((e2) => void 0 !== e2.$editing && true === e2.$editing);
|
|
58
|
+
a2 && a2.length > 0 && a2.forEach((t5) => {
|
|
59
|
+
p(t5, "$editing", false), e(w, "un-edit", { row: t5 });
|
|
60
60
|
}), h2.isEditRow = false;
|
|
61
61
|
} else {
|
|
62
|
-
if (!
|
|
62
|
+
if (!i(n2) || void 0 !== h2.isCreateRow && true === h2.isCreateRow)
|
|
63
63
|
return window.$vueApp.config.globalProperties.$message({ showClose: true, message: u().t("superGrid.pleaseSaveLine", { row: h2.$rowIndex + 1 }), type: "warning" }), void c2(new Error("please save line"));
|
|
64
64
|
if (void 0 !== h2.$rowIndex && null !== h2.$rowIndex && h2.$rowIndex < h2.gridData.length) {
|
|
65
65
|
const e2 = h2.gridData[h2.$rowIndex];
|
|
@@ -69,25 +69,28 @@ const v = { toolbarRefresh(e2, t2, i2, a2) {
|
|
|
69
69
|
if (false === o(h2, this.parentFormData, {}, (_c = h2.options.actionPermission) == null ? void 0 : _c.addCondition))
|
|
70
70
|
return window.$vueApp.config.globalProperties.$message({ showClose: true, message: u().t("superGrid.canntAddTip"), type: "warning" }), void c2(new Error("can not create"));
|
|
71
71
|
if (l2 = this.getNewRow(h2.defaultValueColumns, h2.additionalParamMap, h2.contextParameter, l2, n2, r2 ? r2.getDefaultValueFunc : null), p(l2, "$editing", true), h2.isEditRow = true, h2.options && h2.options.isFormSubTable) {
|
|
72
|
-
if (void 0 !== h2.isSubTableShowPage && true === h2.isSubTableShowPage)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
if (void 0 !== h2.isSubTableShowPage && true === h2.isSubTableShowPage ? h2.isChangePage = true : h2.isAddRow = true, g2 >= 0) {
|
|
73
|
+
const e2 = (this.currentPage - 1) * this.pageSize + g2;
|
|
74
|
+
h2.addRowIndex = e2 + 1, h2.isSubSearch && h2.subTableDataSearch ? (h2.subTableDataSearch.splice(e2, 0, l2), h2.subTableData.splice(e2, 0, l2)) : h2.subTableData.splice(e2, 0, l2);
|
|
75
|
+
} else {
|
|
76
|
+
if (h2.isSubSearch && h2.subTableDataSearch) {
|
|
77
|
+
let e2 = h2.subTableDataSearch.length;
|
|
78
|
+
e2 <= 0 && (e2 = -1), h2.subTableDataSearch.splice(e2, 0, l2), h2.subTableData.splice(e2, 0, l2);
|
|
76
79
|
} else {
|
|
77
80
|
let e2 = h2.subTableData.length;
|
|
78
|
-
e2 <= 0 && (e2 = -1), h2.subTableData.splice(e2, 0, l2)
|
|
81
|
+
e2 <= 0 && (e2 = -1), h2.subTableData.splice(e2, 0, l2);
|
|
79
82
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
h2.$rowIndex =
|
|
83
|
+
h2.addRowIndex = h2.subTableData.length;
|
|
84
|
+
}
|
|
85
|
+
h2.$rowIndex = b2.length, this.isMobile || this.$nextTick(() => {
|
|
83
86
|
s(n2);
|
|
84
87
|
});
|
|
85
88
|
} else
|
|
86
|
-
|
|
89
|
+
b2.splice(0, 0, l2), h2.lineEdit.editingCell && (h2.lineEdit.editingCell.row = 0), h2.$rowIndex = 0;
|
|
87
90
|
const t3 = Object.assign({}, l2);
|
|
88
|
-
if (g2 >= 0 ? h2.orgGridData.splice(g2, 0, t3) : h2.orgGridData.splice(0, 0, t3), h2.lineEdit.editingCell || (h2.lineEdit.editingCell = {}, h2.lineEdit.validateErrorField = ""),
|
|
89
|
-
const e2 = h2.isSubTableShowPage, t4 = h2.pagination && h2.pagination.pageSize,
|
|
90
|
-
h2.pageContext ? h2.options.lineEditOptions.afterInsertRow.call(this, { gridData: e2 ? h2.subTableData : h2.gridData, rowIndex: h2.$rowIndex, isMobile:
|
|
91
|
+
if (g2 >= 0 ? h2.orgGridData.splice(g2, 0, t3) : h2.orgGridData.splice(0, 0, t3), h2.lineEdit.editingCell || (h2.lineEdit.editingCell = {}, h2.lineEdit.validateErrorField = ""), a("afterInsertRow", n2)) {
|
|
92
|
+
const e2 = h2.isSubTableShowPage, t4 = h2.pagination && h2.pagination.pageSize, a2 = this.isMobile;
|
|
93
|
+
h2.pageContext ? h2.options.lineEditOptions.afterInsertRow.call(this, { gridData: e2 ? h2.subTableData : h2.gridData, rowIndex: h2.$rowIndex, isMobile: a2, baseURL: this.baseURL, totalData: e2 ? h2.gridData : null, pageSize: t4, additionalParamMap: h2.additionalParamMap, pageContext: h2.pageContext, configureObj: h2.configureObj }) : h2.options.lineEditOptions.afterInsertRow.call(this, e2 ? h2.subTableData : h2.gridData, h2.$rowIndex, a2, this.baseURL, e2 ? h2.gridData : null, t4, h2.additionalParamMap);
|
|
91
94
|
}
|
|
92
95
|
h2.isCreateRow = true, d3(l2);
|
|
93
96
|
} else
|
|
@@ -95,7 +98,7 @@ const v = { toolbarRefresh(e2, t2, i2, a2) {
|
|
|
95
98
|
} else
|
|
96
99
|
c2(new Error("list not editable or data not loaded completely"));
|
|
97
100
|
});
|
|
98
|
-
}, getNewRow(e2,
|
|
101
|
+
}, getNewRow(e2, a2, i2, o2, s2, n2) {
|
|
99
102
|
o2 || (o2 = {}), s2 || (s2 = t.get("_list_code"));
|
|
100
103
|
const l2 = t.get(s2);
|
|
101
104
|
if (l2 && l2.allColumns && this.setColumnsDefaultValue(l2.allColumns, o2, l2, n2), e2 && e2.length > 0)
|
|
@@ -105,41 +108,49 @@ const v = { toolbarRefresh(e2, t2, i2, a2) {
|
|
|
105
108
|
const e3 = c(o2, t2.prop);
|
|
106
109
|
if ("$selection" !== t2.prop && "$index" !== t2.prop && t2.defaultValue && "" !== t2.defaultValue && (void 0 === e3 || "" === e3 || null === e3)) {
|
|
107
110
|
let e4;
|
|
108
|
-
e4 = l2.pageContext ? h(t2.defaultValue, l2.pageContext) :
|
|
111
|
+
e4 = l2.pageContext ? h(t2.defaultValue, l2.pageContext) : b(t2.defaultValue, o2, a2, i2), p(o2, t2.prop, e4);
|
|
109
112
|
}
|
|
110
113
|
}
|
|
111
114
|
}
|
|
112
|
-
return { $rowDataGuId:
|
|
113
|
-
}, setColumnsDefaultValue(e2, t2,
|
|
115
|
+
return { $rowDataGuId: D(), ...o2 };
|
|
116
|
+
}, setColumnsDefaultValue(e2, t2, a2, i2) {
|
|
114
117
|
for (let o2 = 0; o2 < e2.length; o2++) {
|
|
115
118
|
const s2 = e2[o2], n2 = s2.prop;
|
|
116
119
|
if ("$index" !== n2 && "$selection" !== n2 && "operation" !== n2) {
|
|
117
120
|
if (s2.hasOwnProperty("children"))
|
|
118
|
-
this.setChildrenColumnsDefaultValue(s2.children, t2);
|
|
121
|
+
this.setChildrenColumnsDefaultValue(s2.children, t2, a2, i2);
|
|
119
122
|
else if (void 0 === t2[n2]) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
a2 && (o3 = a2(i2.pageContext, e3, null, null), void 0 === o3 && (o3 = null)), p(t2, n2, o3);
|
|
123
|
+
let e3 = this.getColumnDefaultValue(s2, a2, i2);
|
|
124
|
+
p(t2, n2, e3);
|
|
123
125
|
}
|
|
124
126
|
}
|
|
125
127
|
}
|
|
126
128
|
p(t2, "$editing", false);
|
|
127
|
-
}, setChildrenColumnsDefaultValue(e2, t2) {
|
|
128
|
-
for (let
|
|
129
|
-
const
|
|
130
|
-
|
|
129
|
+
}, setChildrenColumnsDefaultValue(e2, t2, a2, i2) {
|
|
130
|
+
for (let o2 = 0; o2 < e2.length; o2++) {
|
|
131
|
+
const s2 = e2[o2], n2 = s2.prop;
|
|
132
|
+
if (s2.hasOwnProperty("children"))
|
|
133
|
+
this.setChildrenColumnsDefaultValue(s2.children, t2, a2, i2);
|
|
134
|
+
else if (void 0 === t2[n2] && "operation" !== n2) {
|
|
135
|
+
let e3 = this.getColumnDefaultValue(s2, a2, i2);
|
|
136
|
+
p(t2, n2, e3);
|
|
137
|
+
}
|
|
131
138
|
}
|
|
139
|
+
}, getColumnDefaultValue(e2, t2, a2) {
|
|
140
|
+
const i2 = e2.defaultValue;
|
|
141
|
+
let o2 = null;
|
|
142
|
+
return a2 && (o2 = a2(t2.pageContext, i2, null, null), void 0 === o2 && (o2 = null)), o2;
|
|
132
143
|
}, isLastEditRowSaveMessage(e2) {
|
|
133
144
|
e2 || (e2 = t.get("_list_code"));
|
|
134
|
-
const
|
|
135
|
-
return !!
|
|
136
|
-
}, confirmBeforeSwitchingRow(e2,
|
|
145
|
+
const a2 = t.get(e2);
|
|
146
|
+
return !!i(e2) || (window.$vueApp.config.globalProperties.$message({ showClose: true, message: u().t("superGrid.pleaseSaveLine", { row: a2.$rowIndex + 1 }), type: "warning" }), false);
|
|
147
|
+
}, confirmBeforeSwitchingRow(e2, a2) {
|
|
137
148
|
e2 || (e2 = t.get("_list_code"));
|
|
138
149
|
const { t: o2 } = u(), s2 = t.get(e2).$rowIndex;
|
|
139
|
-
|
|
150
|
+
i(e2) || v.confirm(o2("superGrid.rowEditMessageBox.content"), o2("superGrid.rowEditMessageBox.title"), { distinguishCancelAndClose: true, confirmButtonText: o2("superGrid.rowEditMessageBox.confirmButton"), cancelButtonText: o2("superGrid.rowEditMessageBox.cancelButton"), showClose: true, beforeClose: (t2, i2, o3) => {
|
|
140
151
|
"confirm" === t2 ? this.saveRow(s2, e2).then((e3) => {
|
|
141
|
-
|
|
142
|
-
}) : "cancel" === t2 ? (this.restoreCurrentRow(s2, e2),
|
|
152
|
+
a2 == null ? void 0 : a2("confirm"), o3();
|
|
153
|
+
}) : "cancel" === t2 ? (this.restoreCurrentRow(s2, e2), a2 == null ? void 0 : a2("cancel"), o3()) : "close" === t2 && o3();
|
|
143
154
|
} });
|
|
144
155
|
}, editRow(e2, o2, s2, r2) {
|
|
145
156
|
o2 || (o2 = t.get("_list_code"));
|
|
@@ -151,15 +162,15 @@ const v = { toolbarRefresh(e2, t2, i2, a2) {
|
|
|
151
162
|
return void this.saveRow(d2.$rowIndex, o2).then((t3) => {
|
|
152
163
|
this.editRow(e2, o2, true);
|
|
153
164
|
});
|
|
154
|
-
} else if (!
|
|
165
|
+
} else if (!i(o2))
|
|
155
166
|
return void window.$vueApp.config.globalProperties.$message({ showClose: true, message: u().t("superGrid.pleaseSaveLine", { row: d2.$rowIndex + 1 }), type: "warning" });
|
|
156
167
|
}
|
|
157
168
|
let t2 = true;
|
|
158
|
-
if (!r2 &&
|
|
159
|
-
const
|
|
160
|
-
t2 = d2.options.lineEditOptions.beforeEdit.call(this, { gridData:
|
|
169
|
+
if (!r2 && a("beforeEdit", o2)) {
|
|
170
|
+
const a2 = d2.isSubTableShowPage, i2 = d2.pagination && d2.pagination.pageSize;
|
|
171
|
+
t2 = d2.options.lineEditOptions.beforeEdit.call(this, { gridData: a2 ? d2.subTableData : d2.gridData, listCode: o2, entity: d2.gridData[e2], row: d2.gridData[e2], rowIndex: e2, columns: d2.columns, isMobile: false, pageGridData: a2 ? d2.gridData : null, pageSize: i2, additionalParamMap: l(d2), pageContext: d2.pageContext, configureObj: d2.configureObj });
|
|
161
172
|
}
|
|
162
|
-
|
|
173
|
+
f(t2) ? t2.then((t3) => {
|
|
163
174
|
void 0 !== t3 && true !== t3 || this.doEditRow(d2, e2);
|
|
164
175
|
}) : void 0 !== t2 && true !== t2 || this.doEditRow(d2, e2);
|
|
165
176
|
}
|
|
@@ -168,14 +179,14 @@ const v = { toolbarRefresh(e2, t2, i2, a2) {
|
|
|
168
179
|
const t3 = e2.gridData[e2.$rowIndex];
|
|
169
180
|
p(t3, "$editing", false), e2.isEditRow = false;
|
|
170
181
|
}
|
|
171
|
-
const
|
|
172
|
-
p(
|
|
182
|
+
const a2 = e2.gridData[t2];
|
|
183
|
+
p(a2, "$editing", true), e2.$lastSaveRowIndex = null, e2.$rowIndex = t2, e2.isEditRow = true, e2.lineEdit.editingCell && (e2.lineEdit.editingCell.row = t2);
|
|
173
184
|
}, saveRow(e2, t2) {
|
|
174
|
-
return new Promise((
|
|
185
|
+
return new Promise((a2, i2) => {
|
|
175
186
|
const o2 = this;
|
|
176
187
|
setTimeout(function() {
|
|
177
188
|
o2.saveCurrentRow(e2, t2).then((e3) => {
|
|
178
|
-
|
|
189
|
+
a2(e3);
|
|
179
190
|
});
|
|
180
191
|
}, 100);
|
|
181
192
|
});
|
|
@@ -186,9 +197,9 @@ const v = { toolbarRefresh(e2, t2, i2, a2) {
|
|
|
186
197
|
if (p2.lineEdit && p2.lineEdit.editable) {
|
|
187
198
|
if (void 0 === p2.gridData[o2].$editing || false === p2.gridData[o2].$editing)
|
|
188
199
|
return void window.$vueApp.config.globalProperties.$message({ showClose: true, message: u().t("superGrid.noNeedToSaveRow", { row: o2 + 1 }), type: "warning" });
|
|
189
|
-
if (p2.$rowIndex !== o2 && !
|
|
200
|
+
if (p2.$rowIndex !== o2 && !i(s2))
|
|
190
201
|
return void window.$vueApp.config.globalProperties.$message({ showClose: true, message: u().t("superGrid.pleaseSaveLine", { row: p2.$rowIndex + 1 }), type: "warning" });
|
|
191
|
-
if (p2.$lastSaveRowIndex = null, void 0 !== p2.isHasDynamic && false === p2.isHasDynamic && !p2.lineEdit.urlToSaveRow && !n("urlToSaveRow", s2) && !
|
|
202
|
+
if (p2.$lastSaveRowIndex = null, void 0 !== p2.isHasDynamic && false === p2.isHasDynamic && !p2.lineEdit.urlToSaveRow && !n("urlToSaveRow", s2) && !a("saveRow", s2))
|
|
192
203
|
return void window.$vueApp.config.globalProperties.$message({ showClose: true, message: u().t("superGrid.pleaseSetURLToSaveRowInformation"), type: "warning" });
|
|
193
204
|
if (!p2.canSaveRow)
|
|
194
205
|
return;
|
|
@@ -198,18 +209,18 @@ const v = { toolbarRefresh(e2, t2, i2, a2) {
|
|
|
198
209
|
n("isEnableValidate", s2) && (c2 = p2.options.lineEditOptions.isEnableValidate);
|
|
199
210
|
let h2 = true;
|
|
200
211
|
if (true === c2 && (h2 = g.validator(t2, s2, o2)), true === h2) {
|
|
201
|
-
let
|
|
202
|
-
if (
|
|
203
|
-
e(
|
|
204
|
-
const
|
|
212
|
+
let i2 = true;
|
|
213
|
+
if (a("beforeSave", s2) && (i2 = p2.pageContext ? p2.options.lineEditOptions.beforeSave.call(this, { row: t2, columns: p2.columns, additionalParamMap: p2.additionalParamMap, pageContext: p2.pageContext, configureObj: p2.configureObj }) : p2.options.lineEditOptions.beforeSave.call(this, t2, p2.columns, p2.additionalParamMap)), void 0 === i2 || true === i2) {
|
|
214
|
+
e(w, "un-edit", { row: t2 });
|
|
215
|
+
const i3 = l(p2);
|
|
205
216
|
let g2;
|
|
206
|
-
if (
|
|
217
|
+
if (a("saveRow", s2) && (g2 = p2.pageContext ? p2.options.lineEditOptions.saveRow.call(this, { row: t2, columns: p2.columns, dataTypeMap: p2.$dataTypeMap, dynamicColumnInfo: p2.dynamicColumnInfo, additionalParamMap: i3, mainDefaultValueColumns: p2.mainDefaultValueColumns, pageContext: p2.pageContext, configureObj: p2.configureObj }) : p2.options.lineEditOptions.saveRow.call(this, t2, p2.columns, p2.$dataTypeMap, p2.dynamicColumnInfo, i3, p2.mainDefaultValueColumns)), !g2 && p2.lineEdit && p2.lineEdit.urlToSaveRow) {
|
|
207
218
|
let e2 = p2.lineEdit.urlToSaveRow;
|
|
208
219
|
n("urlToSaveRow", s2) && (e2 = p2.options.lineEditOptions.urlToSaveRow), g2 = window.$vueApp.config.globalProperties.$http.post(window.$vueApp.config.globalProperties.baseURL + e2, t2);
|
|
209
220
|
}
|
|
210
221
|
if (void 0 !== p2.isHasDynamic && true === p2.isHasDynamic && !g2) {
|
|
211
|
-
const e2 = "/common/dynamic-values",
|
|
212
|
-
g2 = window.$vueApp.config.globalProperties.$http.post(window.$vueApp.config.globalProperties.baseURL + e2,
|
|
222
|
+
const e2 = "/common/dynamic-values", a2 = { mainTableName: p2.basicInfo && p2.basicInfo.tableName ? p2.basicInfo.tableName : "", row: t2, dynamicColumnInfo: p2.dynamicColumnInfo, additionalParamMap: i3, dataTypeMap: p2.$dataTypeMap, dynamicServiceName: p2.dynamicServiceName, mainDefaultValueColumns: p2.mainDefaultValueColumns };
|
|
223
|
+
g2 = window.$vueApp.config.globalProperties.$http.post(window.$vueApp.config.globalProperties.baseURL + e2, a2);
|
|
213
224
|
}
|
|
214
225
|
g2 ? g2.then((e2) => {
|
|
215
226
|
this.afterSave(p2, o2, s2, e2, t2).then((e3) => {
|
|
@@ -218,7 +229,7 @@ const v = { toolbarRefresh(e2, t2, i2, a2) {
|
|
|
218
229
|
d2(e3);
|
|
219
230
|
});
|
|
220
231
|
}).catch((e2) => {
|
|
221
|
-
p2.canSaveRow = true,
|
|
232
|
+
p2.canSaveRow = true, a("saveError", s2) && p2.options.lineEditOptions.saveError.call(this, t2, p2.columns, o2, e2), d2(e2);
|
|
222
233
|
}) : (p2.canSaveRow = true, d2(u().t("saveRowRequest is undefined")));
|
|
223
234
|
} else
|
|
224
235
|
p2.canSaveRow = true, d2(u().t("superGrid.theReturnValueOfTheBeforesaveCallbackMethodIsFalse"));
|
|
@@ -226,36 +237,36 @@ const v = { toolbarRefresh(e2, t2, i2, a2) {
|
|
|
226
237
|
p2.canSaveRow = true, d2(u().t("imatrixUIMessage.validationFailed"));
|
|
227
238
|
}
|
|
228
239
|
});
|
|
229
|
-
}, afterSave(e2, t2,
|
|
240
|
+
}, afterSave(e2, t2, i2, o2, s2) {
|
|
230
241
|
return new Promise((l2, r2) => {
|
|
231
|
-
e2.isCreateRow = false, e2.canSaveRow = true, e2.$rowIndex = null, e2.isEditRow = false, e2.$lastSaveRowIndex = t2, window.$vueApp.config.globalProperties.$message({ showClose: true, message: u().t("superGrid.lineSavedSuccessfully", { row: t2 + 1 }), type: "success" }), (void 0 === e2.options.lineEditOptions.aftersaveIsCancelEditState || n("aftersaveIsCancelEditState",
|
|
232
|
-
(void 0 === e2.options.lineEditOptions.aftersaveIsCreateRow || e2.options.lineEditOptions.aftersaveIsCreateRow) && this.createRow(
|
|
242
|
+
e2.isCreateRow = false, e2.canSaveRow = true, e2.$rowIndex = null, e2.isEditRow = false, e2.$lastSaveRowIndex = t2, window.$vueApp.config.globalProperties.$message({ showClose: true, message: u().t("superGrid.lineSavedSuccessfully", { row: t2 + 1 }), type: "success" }), (void 0 === e2.options.lineEditOptions.aftersaveIsCancelEditState || n("aftersaveIsCancelEditState", i2) && true === e2.options.lineEditOptions.aftersaveIsCancelEditState) && (p(s2, "$editing", false), e2.isEditRow = false), a("saveSuccess", i2) && (e2.pageContext ? e2.options.lineEditOptions.saveSuccess.call(this, { data: o2, columns: e2.columns, rowIndex: t2, row: s2, additionalParamMap: e2.additionalParamMap, pageContext: e2.pageContext, configureObj: e2.configureObj }) : e2.options.lineEditOptions.saveSuccess.call(this, o2, e2.columns, t2, s2, e2.additionalParamMap), e2.options.lineEditOptions.saveSuccess.call(this, o2, e2.columns, t2, s2, e2.additionalParamMap)), Object.assign(e2.orgGridData[t2], o2), Object.assign(e2.gridData[t2], o2), this.refresh(false, true).then(() => {
|
|
243
|
+
(void 0 === e2.options.lineEditOptions.aftersaveIsCreateRow || e2.options.lineEditOptions.aftersaveIsCreateRow) && this.createRow(i2), l2({ rowIndex: t2, listCode: i2 });
|
|
233
244
|
}).catch((e3) => r2(e3));
|
|
234
245
|
});
|
|
235
246
|
}, restoreRow(e2, t2) {
|
|
236
|
-
return new Promise((
|
|
237
|
-
this.restoreCurrentRow(e2, t2),
|
|
247
|
+
return new Promise((a2, i2) => {
|
|
248
|
+
this.restoreCurrentRow(e2, t2), a2();
|
|
238
249
|
});
|
|
239
250
|
}, restoreCurrentRow(e2, o2) {
|
|
240
251
|
o2 || (o2 = t.get("_list_code"));
|
|
241
252
|
const s2 = t.get(o2);
|
|
242
253
|
if (s2.lineEdit && s2.lineEdit.editable) {
|
|
243
|
-
if (null !== s2.$rowIndex && s2.$rowIndex !== e2 && !
|
|
254
|
+
if (null !== s2.$rowIndex && s2.$rowIndex !== e2 && !i(o2))
|
|
244
255
|
return void window.$vueApp.config.globalProperties.$message({ showClose: true, message: u().t("superGrid.pleaseSaveLine", { row: s2.$rowIndex + 1 }), type: "warning" });
|
|
245
256
|
const t2 = null !== s2.$lastSaveRowIndex && s2.$lastSaveRowIndex === e2 && void 0 !== s2.gridData[e2].id;
|
|
246
257
|
let l2 = true;
|
|
247
|
-
if (
|
|
248
|
-
const
|
|
249
|
-
l2 = s2.options.lineEditOptions.beforeRestoreValidate.call(this, { rowIndex: e2, gridData:
|
|
258
|
+
if (a("beforeRestoreValidate", o2)) {
|
|
259
|
+
const a2 = s2.isSubTableShowPage, i2 = s2.pagination && s2.pagination.pageSize, o3 = this.isMobile;
|
|
260
|
+
l2 = s2.options.lineEditOptions.beforeRestoreValidate.call(this, { rowIndex: e2, gridData: a2 ? s2.subTableData : s2.gridData, entity: s2.gridData[e2], isMobile: o3, baseURL: this.baseURL, isEditing: !t2, pageGridData: a2 ? s2.gridData : null, pageSize: i2, additionalParamMap: s2.additionalParamMap, pageContext: s2.pageContext, configureObj: s2.configureObj });
|
|
250
261
|
}
|
|
251
262
|
if (void 0 !== l2 && true !== l2)
|
|
252
263
|
return;
|
|
253
264
|
if (true === t2)
|
|
254
265
|
return void window.$vueApp.config.globalProperties.$message({ showClose: true, message: u().t("superGrid.lineNoNeedToUndoEdit", { row: e2 + 1 }), type: "warning" });
|
|
255
266
|
let r2 = true;
|
|
256
|
-
if (
|
|
257
|
-
const
|
|
258
|
-
r2 = s2.options.lineEditOptions.beforeRestore.call(this, { rowIndex: e2, gridData:
|
|
267
|
+
if (a("beforeRestore", o2)) {
|
|
268
|
+
const a2 = s2.isSubTableShowPage, i2 = s2.pagination && s2.pagination.pageSize, o3 = this.isMobile;
|
|
269
|
+
r2 = s2.options.lineEditOptions.beforeRestore.call(this, { rowIndex: e2, gridData: a2 ? s2.subTableData : s2.gridData, entity: s2.gridData[e2], isMobile: o3, baseURL: window.$vueApp.config.globalProperties.baseURL, isEditing: !t2, pageGridData: a2 ? s2.gridData : null, pageSize: i2, additionalParamMap: s2.additionalParamMap, pageContext: s2.pageContext, configureObj: s2.configureObj });
|
|
259
270
|
}
|
|
260
271
|
if (void 0 === r2 || true === r2) {
|
|
261
272
|
if (s2.orgGridData[e2].id || s2.orgGridData[e2].ID) {
|
|
@@ -269,78 +280,84 @@ const v = { toolbarRefresh(e2, t2, i2, a2) {
|
|
|
269
280
|
}, 100);
|
|
270
281
|
} else
|
|
271
282
|
this.deleteRow(e2, o2, true);
|
|
272
|
-
s2.$rowIndex = null, s2.isCreateRow = false,
|
|
283
|
+
s2.$rowIndex = null, s2.isCreateRow = false, a("afterRestore", o2) && (s2.pageContext ? s2.options.lineEditOptions.afterRestore.call(this, { rowIndex: e2, row: s2.orgGridData[e2], additionalParamMap: s2.additionalParamMap, pageContext: s2.pageContext, configureObj: s2.configureObj }) : s2.options.lineEditOptions.afterRestore.call(this, e2, s2.orgGridData[e2], s2.additionalParamMap));
|
|
273
284
|
}
|
|
274
285
|
}
|
|
275
|
-
}, deleteRow(e2,
|
|
286
|
+
}, deleteRow(e2, i2, o2) {
|
|
276
287
|
return new Promise((s2, n2) => {
|
|
277
288
|
var _a, _b;
|
|
278
|
-
|
|
279
|
-
const l2 = t.get(
|
|
289
|
+
i2 || (i2 = t.get("_list_code"));
|
|
290
|
+
const l2 = t.get(i2);
|
|
280
291
|
let r2 = true;
|
|
281
|
-
if (
|
|
282
|
-
const t2 = l2.isSubTableShowPage,
|
|
283
|
-
r2 = l2.pageContext ? l2.options.lineEditOptions.beforeDelete.call(this, { rowIndex: e2, row: l2.gridData[e2], gridData:
|
|
292
|
+
if (a("beforeDelete", i2)) {
|
|
293
|
+
const t2 = l2.isSubTableShowPage, a2 = l2.pagination && l2.pagination.pageSize, i3 = t2 ? l2.subTableData : l2.gridData, o3 = this.isMobile;
|
|
294
|
+
r2 = l2.pageContext ? l2.options.lineEditOptions.beforeDelete.call(this, { rowIndex: e2, row: l2.gridData[e2], gridData: i3, isMobile: o3, baseURL: this.baseURL, totalData: t2 ? l2.gridData : null, pageSize: a2, additionalParamMap: l2.additionalParamMap, pageContext: l2.pageContext, configureObj: l2.configureObj }) : l2.options.lineEditOptions.beforeDelete.call(this, e2, l2.gridData[e2], i3, o3, this.baseURL, t2 ? l2.gridData : null, a2, l2.additionalParamMap);
|
|
284
295
|
}
|
|
285
296
|
if (void 0 === r2 || true === r2) {
|
|
286
297
|
if (!this.wfSubTableDeleteRowConditionParse(l2, this.parentFormData, l2.gridData[e2]))
|
|
287
298
|
return;
|
|
288
|
-
if (
|
|
299
|
+
if (l2.options && l2.options.isFormSubTable) {
|
|
289
300
|
l2.isDelete = true;
|
|
290
|
-
|
|
291
|
-
|
|
301
|
+
let t2 = e2;
|
|
302
|
+
if (this.isMobile || (t2 = (this.currentPage - 1) * this.pageSize + e2), l2.isSubSearch && l2.subTableDataSearch) {
|
|
303
|
+
const e3 = l2.subTableDataSearch[t2];
|
|
304
|
+
l2.subTableDataSearch.splice(t2, 1);
|
|
305
|
+
const a2 = l2.subTableData.findIndex((t3) => e3.$rowDataGuId && t3.$rowDataGuId && e3.$rowDataGuId === t3.$rowDataGuId);
|
|
306
|
+
-1 !== a2 && l2.subTableData.splice(a2, 1);
|
|
307
|
+
} else
|
|
308
|
+
l2.subTableData.splice(t2, 1);
|
|
292
309
|
} else
|
|
293
310
|
l2.gridData.splice(e2, 1), l2.orgGridData.splice(e2, 1);
|
|
294
|
-
if (l2.$lastSaveRowIndex = null, l2.$rowIndex = null, l2.isEditRow = false, window.$vueApp.config.globalProperties.$message({ showClose: true, message: u().t("superGrid.deleteSuccessful"), type: "success" }), 0 === l2.gridData.length && l2.options && null !== l2.options.isDefaultShowEdit && void 0 !== l2.options.isDefaultShowEdit && true === l2.options.isDefaultShowEdit && this.createRow(
|
|
295
|
-
const t2 = l2.isSubTableShowPage,
|
|
296
|
-
l2.pageContext ? l2.options.lineEditOptions.afterDelete.call(this, { rowIndex: e2, row: l2.orgGridData[e2], gridData: t2 ? l2.subTableData : l2.gridData, isMobile:
|
|
311
|
+
if (l2.$lastSaveRowIndex = null, l2.$rowIndex = null, l2.isEditRow = false, window.$vueApp.config.globalProperties.$message({ showClose: true, message: u().t("superGrid.deleteSuccessful"), type: "success" }), 0 === l2.gridData.length && l2.options && null !== l2.options.isDefaultShowEdit && void 0 !== l2.options.isDefaultShowEdit && true === l2.options.isDefaultShowEdit && this.createRow(i2), l2.isMulitiSelect && ((_b = (_a = l2.superGrid) == null ? void 0 : _a.clearSelection) == null ? void 0 : _b.call(_a)), l2.isCreateRow = false, (void 0 === o2 || !o2) && a("afterDelete", i2)) {
|
|
312
|
+
const t2 = l2.isSubTableShowPage, a2 = l2.pagination && l2.pagination.pageSize, i3 = this.isMobile;
|
|
313
|
+
l2.pageContext ? l2.options.lineEditOptions.afterDelete.call(this, { rowIndex: e2, row: l2.orgGridData[e2], gridData: t2 ? l2.subTableData : l2.gridData, isMobile: i3, baseURL: this.baseURL, totalData: t2 ? l2.gridData : null, pageSize: a2, additionalParamMap: l2.additionalParamMap, pageContext: l2.pageContext, configureObj: l2.configureObj }) : l2.options.lineEditOptions.afterDelete.call(this, e2, l2.orgGridData[e2], t2 ? l2.subTableData : l2.gridData, i3, this.baseURL, t2 ? l2.gridData : null, a2, l2.additionalParamMap);
|
|
297
314
|
}
|
|
298
315
|
}
|
|
299
316
|
s2();
|
|
300
317
|
});
|
|
301
|
-
}, getDeleteIndexes(e2, t2,
|
|
302
|
-
const
|
|
318
|
+
}, getDeleteIndexes(e2, t2, a2) {
|
|
319
|
+
const i2 = [];
|
|
303
320
|
return e2.forEach((e3, o2) => {
|
|
304
|
-
if (
|
|
321
|
+
if (i2.length !== t2.length) {
|
|
305
322
|
for (const s2 of t2)
|
|
306
|
-
if (e3[
|
|
307
|
-
|
|
323
|
+
if (e3[a2] === s2[a2]) {
|
|
324
|
+
i2.push(o2);
|
|
308
325
|
break;
|
|
309
326
|
}
|
|
310
327
|
}
|
|
311
|
-
}),
|
|
312
|
-
}, batchDeleteSubTableRowApi(e2,
|
|
328
|
+
}), i2.sort((e3, t3) => t3 - e3);
|
|
329
|
+
}, batchDeleteSubTableRowApi(e2, i2, o2) {
|
|
313
330
|
return new Promise((s2, n2) => {
|
|
314
331
|
var _a, _b;
|
|
315
|
-
if (!(
|
|
332
|
+
if (!(i2 = i2 || []).length)
|
|
316
333
|
return window.$vueApp.config.globalProperties.$message({ showClose: true, message: u().t("imatrixUIMessage.pleaseSelectDeleteData"), type: "warning" }), void s2();
|
|
317
334
|
e2 = e2 || t.get("_list_code");
|
|
318
335
|
const l2 = t.get(e2);
|
|
319
336
|
let r2 = true;
|
|
320
|
-
if (
|
|
321
|
-
const e3 = l2.isSubTableShowPage, t2 = l2.pagination && l2.pagination.pageSize,
|
|
322
|
-
r2 = l2.pageContext ? l2.options.lineEditOptions.beforeDelete.call(this, { deleteRows:
|
|
337
|
+
if (a("beforeDelete", e2)) {
|
|
338
|
+
const e3 = l2.isSubTableShowPage, t2 = l2.pagination && l2.pagination.pageSize, a2 = e3 ? l2.subTableData : l2.gridData, o3 = this.isMobile;
|
|
339
|
+
r2 = l2.pageContext ? l2.options.lineEditOptions.beforeDelete.call(this, { deleteRows: i2, gridData: a2, isMobile: o3, baseURL: this.baseURL, totalData: e3 ? l2.gridData : null, pageSize: t2, additionalParamMap: l2.additionalParamMap, pageContext: l2.pageContext, configureObj: l2.configureObj }) : l2.options.lineEditOptions.beforeDelete.call(this, i2, a2, o3, this.baseURL, e3 ? l2.gridData : null, t2, l2.additionalParamMap);
|
|
323
340
|
}
|
|
324
341
|
if (void 0 === r2 || true === r2) {
|
|
325
342
|
let t2 = [];
|
|
326
343
|
if (void 0 !== l2.isSubTableShowPage && true === l2.isSubTableShowPage) {
|
|
327
|
-
l2.isDelete = true, t2 = this.getDeleteIndexes(l2.subTableData,
|
|
344
|
+
l2.isDelete = true, t2 = this.getDeleteIndexes(l2.subTableData, i2, o2);
|
|
328
345
|
for (const e3 of t2) {
|
|
329
346
|
if (!this.wfSubTableDeleteRowConditionParse(l2, this.parentFormData, l2.subTableData[e3]))
|
|
330
347
|
return;
|
|
331
348
|
l2.subTableData.splice(e3, 1);
|
|
332
349
|
}
|
|
333
350
|
} else {
|
|
334
|
-
t2 = this.getDeleteIndexes(l2.gridData,
|
|
351
|
+
t2 = this.getDeleteIndexes(l2.gridData, i2, o2);
|
|
335
352
|
for (const e3 of t2) {
|
|
336
353
|
if (!this.wfSubTableDeleteRowConditionParse(l2, this.parentFormData, l2.gridData[e3]))
|
|
337
354
|
return;
|
|
338
355
|
l2.gridData.splice(e3, 1), l2.orgGridData.splice(e3, 1);
|
|
339
356
|
}
|
|
340
357
|
}
|
|
341
|
-
if (l2.$lastSaveRowIndex = null, l2.$rowIndex = null, l2.isEditRow = false, window.$vueApp.config.globalProperties.$message({ showClose: true, message: u().t("superGrid.deleteSuccessful"), type: "success" }), 0 === l2.gridData.length && l2.options && null !== l2.options.isDefaultShowEdit && void 0 !== l2.options.isDefaultShowEdit && true === l2.options.isDefaultShowEdit && this.createRow(e2), l2.isMulitiSelect && ((_b = (_a = l2.superGrid) == null ? void 0 : _a.clearSelection) == null ? void 0 : _b.call(_a)), l2.isCreateRow = false, (void 0 === isRestore || !isRestore) &&
|
|
342
|
-
const e3 = l2.isSubTableShowPage, t3 = l2.pagination && l2.pagination.pageSize,
|
|
343
|
-
l2.pageContext ? l2.options.lineEditOptions.afterDelete.call(this, { deleteRows:
|
|
358
|
+
if (l2.$lastSaveRowIndex = null, l2.$rowIndex = null, l2.isEditRow = false, window.$vueApp.config.globalProperties.$message({ showClose: true, message: u().t("superGrid.deleteSuccessful"), type: "success" }), 0 === l2.gridData.length && l2.options && null !== l2.options.isDefaultShowEdit && void 0 !== l2.options.isDefaultShowEdit && true === l2.options.isDefaultShowEdit && this.createRow(e2), l2.isMulitiSelect && ((_b = (_a = l2.superGrid) == null ? void 0 : _a.clearSelection) == null ? void 0 : _b.call(_a)), l2.isCreateRow = false, (void 0 === isRestore || !isRestore) && a("afterDelete", e2)) {
|
|
359
|
+
const e3 = l2.isSubTableShowPage, t3 = l2.pagination && l2.pagination.pageSize, a2 = this.isMobile;
|
|
360
|
+
l2.pageContext ? l2.options.lineEditOptions.afterDelete.call(this, { deleteRows: i2, gridData: e3 ? l2.subTableData : l2.gridData, isMobile: a2, baseURL: this.baseURL, totalData: e3 ? l2.gridData : null, pageSize: t3, additionalParamMap: l2.additionalParamMap, pageContext: l2.pageContext, configureObj: l2.configureObj }) : l2.options.lineEditOptions.afterDelete.call(this, i2, e3 ? l2.subTableData : l2.gridData, a2, this.baseURL, e3 ? l2.gridData : null, t3, l2.additionalParamMap);
|
|
344
361
|
}
|
|
345
362
|
}
|
|
346
363
|
s2();
|
|
@@ -349,8 +366,8 @@ const v = { toolbarRefresh(e2, t2, i2, a2) {
|
|
|
349
366
|
r(e2, t2);
|
|
350
367
|
}, getGridData(e2) {
|
|
351
368
|
e2 || (e2 = t.get("_list_code"));
|
|
352
|
-
const
|
|
353
|
-
return
|
|
369
|
+
const a2 = t.get(e2);
|
|
370
|
+
return a2.options && a2.options.isFormSubTable ? a2.subTableData : a2.gridData;
|
|
354
371
|
}, getColumns(e2) {
|
|
355
372
|
e2 || (e2 = t.get("_list_code"));
|
|
356
373
|
return t.get(e2).columns;
|
|
@@ -358,39 +375,39 @@ const v = { toolbarRefresh(e2, t2, i2, a2) {
|
|
|
358
375
|
e2 || (e2 = t.get("_list_code"));
|
|
359
376
|
return t.get(e2).pagination;
|
|
360
377
|
}, getOptionsValueSet(e2) {
|
|
361
|
-
const
|
|
378
|
+
const a2 = {};
|
|
362
379
|
e2 || (e2 = t.get("_list_code"));
|
|
363
380
|
return t.get(e2).columns.forEach((e3) => {
|
|
364
381
|
const t2 = e3.prop;
|
|
365
|
-
!d(e3) && e3.valueSet && e3.valueSet.length > 0 && (
|
|
366
|
-
}),
|
|
382
|
+
!d(e3) && e3.valueSet && e3.valueSet.length > 0 && (a2[t2] = e3.valueSet);
|
|
383
|
+
}), a2;
|
|
367
384
|
}, getTableSelectOptions(e2) {
|
|
368
|
-
const
|
|
385
|
+
const a2 = {};
|
|
369
386
|
e2 || (e2 = t.get("_list_code"));
|
|
370
387
|
return t.get(e2).columns.forEach((e3) => {
|
|
371
388
|
const t2 = e3.prop;
|
|
372
|
-
!d(e3) && e3.valueSet && e3.valueSet.length > 0 && (
|
|
373
|
-
}),
|
|
374
|
-
}, restoreGridEdit(
|
|
375
|
-
|
|
376
|
-
const
|
|
377
|
-
if (
|
|
389
|
+
!d(e3) && e3.valueSet && e3.valueSet.length > 0 && (a2[t2] = { options: e3.valueSet, column: e3 });
|
|
390
|
+
}), a2;
|
|
391
|
+
}, restoreGridEdit(a2) {
|
|
392
|
+
a2 || (a2 = t.get("_list_code"));
|
|
393
|
+
const i2 = t.get(a2);
|
|
394
|
+
if (i2.options && i2.options.isFormSubTable) {
|
|
378
395
|
let t2 = [];
|
|
379
|
-
if (t2 =
|
|
380
|
-
for (let
|
|
381
|
-
const
|
|
382
|
-
if (void 0 !==
|
|
383
|
-
p(
|
|
396
|
+
if (t2 = i2.isSubTableShowPage ? i2.subTableData : i2.gridData, t2 && t2.length > 0)
|
|
397
|
+
for (let a3 = 0; a3 < t2.length; a3++) {
|
|
398
|
+
const i3 = t2[a3];
|
|
399
|
+
if (void 0 !== i3.$editing && true === i3.$editing) {
|
|
400
|
+
p(i3, "$editing", false), e(w, "un-edit", { row: i3 });
|
|
384
401
|
break;
|
|
385
402
|
}
|
|
386
403
|
}
|
|
387
404
|
}
|
|
388
405
|
}, closePageDialog(e2) {
|
|
389
406
|
if (this.jumpPageSetting, this.jumpPageSetting) {
|
|
390
|
-
const
|
|
407
|
+
const a2 = t.get(this.code), i2 = this.jumpPageSetting.closeEvent, o2 = this.jumpPageSetting.row;
|
|
391
408
|
let s2;
|
|
392
|
-
if (
|
|
393
|
-
const t2 = { params:
|
|
409
|
+
if (a2.options.eventCallBack && i2 && null !== i2 && a2.options.eventCallBack[i2] && (s2 = a2.options.eventCallBack[i2]), s2) {
|
|
410
|
+
const t2 = { params: a2.additionalParamMap, additionalParamMap: a2.additionalParamMap, entity: o2 };
|
|
394
411
|
e2 && (t2.eventParams = { popEntity: e2.entity, popPageCode: e2.pageCode, pageCode: this.pageCode }), s2.call(this, t2), e2.jumpInfo && "closeWindowAndRefresh" === e2.jumpInfo.successOperation && this.refresh();
|
|
395
412
|
}
|
|
396
413
|
const n2 = this.jumpPageSetting.isRefreshWhenClosePopup;
|
|
@@ -400,59 +417,68 @@ const v = { toolbarRefresh(e2, t2, i2, a2) {
|
|
|
400
417
|
}
|
|
401
418
|
}
|
|
402
419
|
this.isShowPageDialog = false, this.jumpPageSetting = null;
|
|
403
|
-
}, updateValues(e2,
|
|
404
|
-
const o2 = t.get(this.code), s2 =
|
|
420
|
+
}, updateValues(e2, a2, i2) {
|
|
421
|
+
const o2 = t.get(this.code), s2 = i2;
|
|
405
422
|
if (null != s2 && s2 < this.gridData.length) {
|
|
406
|
-
const t2 = false === this.isSql || o2.options && (void 0 !== o2.options.isAdministerListView && true === o2.options.isAdministerListView || void 0 !== o2.options.isFormSubTable && true === o2.options.isFormSubTable),
|
|
407
|
-
|
|
423
|
+
const t2 = false === this.isSql || o2.options && (void 0 !== o2.options.isAdministerListView && true === o2.options.isAdministerListView || void 0 !== o2.options.isFormSubTable && true === o2.options.isFormSubTable), i3 = this.tableName;
|
|
424
|
+
S(e2, a2, this.jumpPageSetting, this.gridData[s2], i3, !t2);
|
|
408
425
|
const n2 = this.jumpPageSetting && this.jumpPageSetting.updateValueEvent ? this.jumpPageSetting.updateValueEvent : null;
|
|
409
426
|
let l2;
|
|
410
|
-
o2.options.eventCallBack && n2 && null !== n2 && o2.options.eventCallBack[n2] && (l2 = o2.options.eventCallBack[n2]), l2 && l2.call(this, { sourceModel: e2, sourceTableName:
|
|
427
|
+
o2.options.eventCallBack && n2 && null !== n2 && o2.options.eventCallBack[n2] && (l2 = o2.options.eventCallBack[n2]), l2 && l2.call(this, { sourceModel: e2, sourceTableName: a2, jumpPageSetting: this.jumpPageSetting, entity: this.gridData[s2], targetTableName: i3, isNeedReplaceFieldName: !t2, additionalParamMap: o2.additionalParamMap });
|
|
411
428
|
}
|
|
412
|
-
}, refreshChildData(e2,
|
|
413
|
-
|
|
414
|
-
null == a2 || false === a2 ? (o2.gridData = i2, this.gridData = i2) : (o2.subTableData = i2, this.subTableData = i2);
|
|
429
|
+
}, refreshChildData(e2, a2, i2) {
|
|
430
|
+
t.get(e2).subTableData = a2, this.subTableData = a2;
|
|
415
431
|
}, getDefaultValueColumns(e2) {
|
|
416
|
-
const
|
|
417
|
-
return
|
|
418
|
-
|
|
419
|
-
}),
|
|
432
|
+
const a2 = {}, i2 = t.get(e2).defaultValueColumns;
|
|
433
|
+
return i2 && i2.length > 0 && i2.forEach((e3) => {
|
|
434
|
+
a2[e3.prop] = e3.defaultValue;
|
|
435
|
+
}), a2;
|
|
420
436
|
}, reloadSubTableData(e2) {
|
|
421
437
|
t.get(e2).options.subTableData = null, this.fetchListData();
|
|
422
|
-
}, dynamicControlTableEdit(e2,
|
|
423
|
-
const o2 = t.get(
|
|
424
|
-
if (!
|
|
438
|
+
}, dynamicControlTableEdit(e2, a2, i2) {
|
|
439
|
+
const o2 = t.get(i2);
|
|
440
|
+
if (!a2)
|
|
425
441
|
return;
|
|
426
442
|
let s2 = {};
|
|
427
|
-
o2.options.customRules && (s2 = JSON.parse(JSON.stringify(o2.options.customRules))),
|
|
428
|
-
const t2 = JSON.parse(JSON.stringify(e3)),
|
|
429
|
-
let
|
|
430
|
-
s2[
|
|
443
|
+
o2.options.customRules && (s2 = JSON.parse(JSON.stringify(o2.options.customRules))), a2.forEach((e3) => {
|
|
444
|
+
const t2 = JSON.parse(JSON.stringify(e3)), a3 = e3.name;
|
|
445
|
+
let i3;
|
|
446
|
+
s2[a3] || (s2[a3] = {}), i3 = s2[a3].rules, t2.rules && (i3 || (i3 = []), i3 = i3.concat(t2.rules)), t2.rules = i3, o2.options.customRules || (o2.options.customRules = {}), t2.beforeValidate = e3.beforeValidate, o2.options.customRules[a3] = t2;
|
|
431
447
|
});
|
|
432
|
-
}, doLayout(e2,
|
|
433
|
-
|
|
434
|
-
|
|
448
|
+
}, doLayout(e2, a2) {
|
|
449
|
+
a2 || (a2 = this.code);
|
|
450
|
+
let i2 = false;
|
|
451
|
+
const o2 = t.get(a2).hiddenColumns;
|
|
435
452
|
if (e2 && e2.length > 0) {
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
453
|
+
const t2 = e2[0];
|
|
454
|
+
let a3;
|
|
455
|
+
t2 && "string" == typeof t2 && (i2 = true), i2 ? (a3 = [], e2.forEach((e3) => {
|
|
456
|
+
if (e3 && "string" == typeof e3) {
|
|
457
|
+
let t3 = { prop: e3, show: false };
|
|
458
|
+
a3.push(t3);
|
|
459
|
+
}
|
|
460
|
+
})) : a3 = e2, this.options.updateColumnsInfo = a3;
|
|
461
|
+
} else {
|
|
462
|
+
let e3;
|
|
463
|
+
o2 && (e3 = [], o2.forEach((t2) => {
|
|
464
|
+
let a3 = { prop: t2, show: false };
|
|
465
|
+
e3.push(a3);
|
|
466
|
+
})), this.options.updateColumnsInfo = e3;
|
|
467
|
+
}
|
|
442
468
|
this.$refs && this.$refs.superGrid && this.$refs.superGrid.doLayout();
|
|
443
469
|
}, getCustomFunc(e2) {
|
|
444
470
|
window.$PageUtil.getCustomFunc(this.pageContext, e2);
|
|
445
|
-
}, addRequiredClass(e2,
|
|
446
|
-
const s2 = t.get(
|
|
447
|
-
this.isFormSubTable && this.isSubTableShowPage && (
|
|
471
|
+
}, addRequiredClass(e2, a2, i2, o2) {
|
|
472
|
+
const s2 = t.get(a2);
|
|
473
|
+
this.isFormSubTable && this.isSubTableShowPage && (i2 -= 1, o2 !== this.currentPage && (this.currentPage = o2, this.changePage(o2))), s2.gridData[i2].validateErrorField = e2;
|
|
448
474
|
}, handleSearch(e2, t2) {
|
|
449
|
-
const
|
|
450
|
-
this.doSearch(
|
|
451
|
-
}, wfSubTableDeleteRowConditionParse: (e2, t2,
|
|
475
|
+
const a2 = this.packageSearchParamNormalType(e2, t2);
|
|
476
|
+
this.doSearch(a2);
|
|
477
|
+
}, wfSubTableDeleteRowConditionParse: (e2, t2, a2) => {
|
|
452
478
|
var _a;
|
|
453
|
-
return false !== o(e2, t2,
|
|
454
|
-
} },
|
|
479
|
+
return false !== o(e2, t2, a2, (_a = e2.options.actionPermission) == null ? void 0 : _a.deleteCondition) || (window.$vueApp.config.globalProperties.$message({ showClose: true, message: u().t("superGrid.rowCanntDeleteTip"), type: "warning" }), false);
|
|
480
|
+
} }, R = { data: () => ({ toolbarFieldParam: null, showSearch: false, isMobile: m(), baseURL: "", currentPage: 1, pageSize: 10, code: "", pageCode: "", jumpPageSetting: null, isShowPageDialog: false, gridData: [], subTableData: [], searchForm: [], options: {}, lineEdit: null, loaded: false, configureObj: {}, additionalParamMap: {}, basicInfo: {}, dynamicColumnInfo: {}, $dataTypeMap: {}, mainDefaultValueColumns: [], dynamicServiceName: "", isHasDynamic: false, isMulitiSelect: false, sql: false, restoreCurrentRowTimer: null }), methods: { ...C } };
|
|
455
481
|
export {
|
|
456
|
-
|
|
457
|
-
|
|
482
|
+
R as apisMixin,
|
|
483
|
+
C as default
|
|
458
484
|
};
|