dse-edit-table 0.0.2 → 1.1.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/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +311 -257
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { ref as j, h as Ee, defineComponent as Me, getCurrentInstance as Te, computed as X, watch as Re, onMounted as ye, nextTick as _e, resolveComponent as Oe, openBlock as q, createElementBlock as G, createVNode as se, Transition as xe, withCtx as ae, mergeProps as Ae, createSlots as we, renderList as Le, renderSlot as ve, normalizeProps as Se, guardReactiveProps as Pe, Fragment as re, createElementVNode as ie, toDisplayString as Q, createCommentVNode as Ie } from "vue";
|
|
2
|
+
import F from "vxe-pc-ui";
|
|
3
|
+
import fe from "vxe-table";
|
|
4
4
|
import p from "xe-utils";
|
|
5
5
|
import { useResizeObserver as De } from "@vueuse/core";
|
|
6
|
-
var
|
|
7
|
-
Object.defineProperty(
|
|
6
|
+
var oe = {};
|
|
7
|
+
Object.defineProperty(oe, "__esModule", {
|
|
8
8
|
value: !0
|
|
9
9
|
});
|
|
10
|
-
var ge =
|
|
11
|
-
ge =
|
|
10
|
+
var ge = oe.default = void 0;
|
|
11
|
+
ge = oe.default = {
|
|
12
12
|
vxe: {
|
|
13
13
|
base: {
|
|
14
14
|
pleaseInput: "请输入",
|
|
@@ -841,8 +841,8 @@ ge = le.default = {
|
|
|
841
841
|
}
|
|
842
842
|
};
|
|
843
843
|
let M, z;
|
|
844
|
-
const
|
|
845
|
-
function
|
|
844
|
+
const ee = (n, r) => p.findIndexOf(n, (o) => o.id === r.id), te = (n, r, o) => n.findRowIndexOf(r, o);
|
|
845
|
+
function Z(n) {
|
|
846
846
|
return {
|
|
847
847
|
tableMenuMethod(r) {
|
|
848
848
|
const { $table: o, column: e } = r;
|
|
@@ -852,7 +852,7 @@ function ee(n) {
|
|
|
852
852
|
}
|
|
853
853
|
};
|
|
854
854
|
}
|
|
855
|
-
function
|
|
855
|
+
function le() {
|
|
856
856
|
const n = M.globalStore;
|
|
857
857
|
if (n)
|
|
858
858
|
return n.clipboard || "";
|
|
@@ -863,38 +863,38 @@ function Fe(n) {
|
|
|
863
863
|
const r = M.globalStore;
|
|
864
864
|
r ? r.clipboard = n : M.config && (M.config.clipboard = n);
|
|
865
865
|
}
|
|
866
|
-
let
|
|
866
|
+
let A;
|
|
867
867
|
function $e(n) {
|
|
868
|
-
if (!
|
|
869
|
-
|
|
870
|
-
const r =
|
|
871
|
-
r.width = "48px", r.height = "24px", r.position = "fixed", r.zIndex = "0", r.left = "-500px", r.top = "-500px", document.body.appendChild(
|
|
868
|
+
if (!A) {
|
|
869
|
+
A = document.createElement("textarea"), A.id = "$XECopy";
|
|
870
|
+
const r = A.style;
|
|
871
|
+
r.width = "48px", r.height = "24px", r.position = "fixed", r.zIndex = "0", r.left = "-500px", r.top = "-500px", document.body.appendChild(A);
|
|
872
872
|
}
|
|
873
|
-
|
|
873
|
+
A.value = n == null ? "" : "" + n;
|
|
874
874
|
}
|
|
875
875
|
function Ce(n) {
|
|
876
876
|
let r = !1;
|
|
877
877
|
try {
|
|
878
|
-
$e(n),
|
|
878
|
+
$e(n), A.select(), A.setSelectionRange(0, A.value.length), r = document.execCommand("copy"), A.blur();
|
|
879
879
|
} catch {
|
|
880
880
|
}
|
|
881
881
|
return r;
|
|
882
882
|
}
|
|
883
|
-
function
|
|
883
|
+
function ce(n, r) {
|
|
884
884
|
const { $event: o, $table: e, row: t, column: l } = n;
|
|
885
885
|
if (t && l) {
|
|
886
886
|
const s = e.props, { mouseConfig: a } = s, { computeMouseOpts: c } = e.getComputeMaps(), i = c.value;
|
|
887
887
|
let u = "";
|
|
888
888
|
if (a && i.area) {
|
|
889
889
|
r ? e.triggerCutCellAreaEvent(o) : e.triggerCopyCellAreaEvent(o);
|
|
890
|
-
const d =
|
|
890
|
+
const d = le();
|
|
891
891
|
u = d ? d.text : "";
|
|
892
892
|
} else
|
|
893
893
|
u = p.toValueString(p.get(t, l.field)), Fe({ text: u, html: "" });
|
|
894
894
|
p.isFunction(z) ? z(u) : Ce(u);
|
|
895
895
|
}
|
|
896
896
|
}
|
|
897
|
-
function
|
|
897
|
+
function V(n) {
|
|
898
898
|
return function(r) {
|
|
899
899
|
const { $grid: o } = r;
|
|
900
900
|
o && o.commitProxy(n);
|
|
@@ -904,10 +904,10 @@ function ke(n, r) {
|
|
|
904
904
|
const { $table: o } = n, { visibleData: e } = o.getTableData(), { visibleColumn: t } = o.getTableColumn(), l = {};
|
|
905
905
|
for (let s = 0, a = r.length; s < a; s++) {
|
|
906
906
|
const c = r[s], { rows: i, cols: u } = c;
|
|
907
|
-
for (let d = 0,
|
|
908
|
-
const T = i[d], R =
|
|
909
|
-
for (let y = 0,
|
|
910
|
-
const
|
|
907
|
+
for (let d = 0, m = i.length; d < m; d++) {
|
|
908
|
+
const T = i[d], R = te(o, e, T);
|
|
909
|
+
for (let y = 0, S = u.length; y < S; y++) {
|
|
910
|
+
const P = u[y], f = ee(t, P), g = R + ":" + f;
|
|
911
911
|
if (l[g])
|
|
912
912
|
return !1;
|
|
913
913
|
l[g] = !0;
|
|
@@ -916,18 +916,18 @@ function ke(n, r) {
|
|
|
916
916
|
}
|
|
917
917
|
return !0;
|
|
918
918
|
}
|
|
919
|
-
function
|
|
919
|
+
function ne(n) {
|
|
920
920
|
const { $table: r } = n, o = r.props, { mouseConfig: e } = o, { computeMouseOpts: t } = r.getComputeMaps(), l = t.value, { visibleData: s } = r.getTableData(), { visibleColumn: a } = r.getTableColumn(), c = e && l.area ? r.getCellAreas() : [];
|
|
921
|
-
return r.getMergeCells().filter(({ row: u, col: d, rowspan:
|
|
922
|
-
const { rows: y, cols:
|
|
923
|
-
return u >=
|
|
921
|
+
return r.getMergeCells().filter(({ row: u, col: d, rowspan: m, colspan: T }) => c.some((R) => {
|
|
922
|
+
const { rows: y, cols: S } = R, P = te(r, s, y[0]), f = te(r, s, y[y.length - 1]), g = ee(a, S[0]), E = ee(a, S[S.length - 1]);
|
|
923
|
+
return u >= P && u + m - 1 <= f && d >= g && d + T - 1 <= E;
|
|
924
924
|
}));
|
|
925
925
|
}
|
|
926
|
-
function
|
|
927
|
-
const { $table: r } = n, o =
|
|
926
|
+
function ue(n) {
|
|
927
|
+
const { $table: r } = n, o = ne(n);
|
|
928
928
|
return o.length && r.removeMergeCells(o), o;
|
|
929
929
|
}
|
|
930
|
-
function
|
|
930
|
+
function de(n, r) {
|
|
931
931
|
const { code: o } = n, { $table: e, $grid: t, row: l, column: s, type: a } = r, c = e.props, { editConfig: i, mouseConfig: u } = c;
|
|
932
932
|
switch (o) {
|
|
933
933
|
case "CLEAR_ALL_SORT": {
|
|
@@ -941,12 +941,12 @@ function pe(n, r) {
|
|
|
941
941
|
break;
|
|
942
942
|
}
|
|
943
943
|
case "CLEAR_ALL_MERGE": {
|
|
944
|
-
const d = e.getMergeCells(),
|
|
945
|
-
n.disabled = !d.length && !
|
|
944
|
+
const d = e.getMergeCells(), m = e.getMergeFooterItems();
|
|
945
|
+
n.disabled = !d.length && !m.length;
|
|
946
946
|
break;
|
|
947
947
|
}
|
|
948
948
|
case "CLEAR_MERGE_CELL": {
|
|
949
|
-
const d =
|
|
949
|
+
const d = ne(r);
|
|
950
950
|
n.disabled = !d.length;
|
|
951
951
|
break;
|
|
952
952
|
}
|
|
@@ -955,8 +955,8 @@ function pe(n, r) {
|
|
|
955
955
|
break;
|
|
956
956
|
}
|
|
957
957
|
case "SELECT_ALL_AREA": {
|
|
958
|
-
const { visibleData: d } = e.getTableData(), { visibleColumn:
|
|
959
|
-
n.disabled = !d.length || !
|
|
958
|
+
const { visibleData: d } = e.getTableData(), { visibleColumn: m } = e.getTableColumn();
|
|
959
|
+
n.disabled = !d.length || !m.length;
|
|
960
960
|
break;
|
|
961
961
|
}
|
|
962
962
|
case "SELECT_AREA_TO_LEFT":
|
|
@@ -996,7 +996,7 @@ function pe(n, r) {
|
|
|
996
996
|
case "FIXED_RIGHT_COLUMN":
|
|
997
997
|
case "CLEAR_FIXED_COLUMN": {
|
|
998
998
|
if (n.disabled = !s, s) {
|
|
999
|
-
const { computeMouseOpts: d } = e.getComputeMaps(),
|
|
999
|
+
const { computeMouseOpts: d } = e.getComputeMaps(), m = d.value, T = !!s.parentId;
|
|
1000
1000
|
switch (o) {
|
|
1001
1001
|
case "CLEAR_SORT": {
|
|
1002
1002
|
n.disabled = !s.sortable || !s.order;
|
|
@@ -1025,7 +1025,7 @@ function pe(n, r) {
|
|
|
1025
1025
|
}
|
|
1026
1026
|
case "OPEN_FIND":
|
|
1027
1027
|
case "OPEN_REPLACE": {
|
|
1028
|
-
n.disabled = !(u &&
|
|
1028
|
+
n.disabled = !(u && m.area);
|
|
1029
1029
|
break;
|
|
1030
1030
|
}
|
|
1031
1031
|
case "EDIT_CELL": {
|
|
@@ -1035,11 +1035,11 @@ function pe(n, r) {
|
|
|
1035
1035
|
case "COPY_CELL":
|
|
1036
1036
|
case "CUT_CELL":
|
|
1037
1037
|
case "PASTE_CELL": {
|
|
1038
|
-
const R = u &&
|
|
1038
|
+
const R = u && m.area ? e.getCellAreas() : [];
|
|
1039
1039
|
if (n.disabled = R.length > 1, !n.disabled)
|
|
1040
1040
|
switch (o) {
|
|
1041
1041
|
case "PASTE_CELL": {
|
|
1042
|
-
const y =
|
|
1042
|
+
const y = le();
|
|
1043
1043
|
n.disabled = !y || !y.text;
|
|
1044
1044
|
break;
|
|
1045
1045
|
}
|
|
@@ -1048,7 +1048,7 @@ function pe(n, r) {
|
|
|
1048
1048
|
}
|
|
1049
1049
|
case "MERGE_OR_CLEAR":
|
|
1050
1050
|
case "MERGE_CELL": {
|
|
1051
|
-
const R = u &&
|
|
1051
|
+
const R = u && m.area ? e.getCellAreas() : [];
|
|
1052
1052
|
n.disabled = !R.length || R.length === 1 && R[0].rows.length === 1 && R[0].cols.length === 1 || !ke(r, R);
|
|
1053
1053
|
break;
|
|
1054
1054
|
}
|
|
@@ -1078,8 +1078,8 @@ function pe(n, r) {
|
|
|
1078
1078
|
function Ne(n) {
|
|
1079
1079
|
return n.options.forEach((r) => {
|
|
1080
1080
|
r.forEach((o) => {
|
|
1081
|
-
|
|
1082
|
-
|
|
1081
|
+
de(o, n), o.children && o.children.forEach((e) => {
|
|
1082
|
+
de(e, n);
|
|
1083
1083
|
});
|
|
1084
1084
|
});
|
|
1085
1085
|
}), !0;
|
|
@@ -1089,7 +1089,7 @@ function Y() {
|
|
|
1089
1089
|
if (M.modal) {
|
|
1090
1090
|
const r = M.getComponent("VxeNumberInput");
|
|
1091
1091
|
if (r) {
|
|
1092
|
-
const o =
|
|
1092
|
+
const o = j(1);
|
|
1093
1093
|
M.modal.alert({
|
|
1094
1094
|
title: "请输入行数",
|
|
1095
1095
|
width: 220,
|
|
@@ -1131,26 +1131,36 @@ function Y() {
|
|
|
1131
1131
|
});
|
|
1132
1132
|
});
|
|
1133
1133
|
}
|
|
1134
|
-
function
|
|
1134
|
+
function H() {
|
|
1135
1135
|
location.reload();
|
|
1136
1136
|
}
|
|
1137
|
-
function
|
|
1137
|
+
function B() {
|
|
1138
1138
|
history.forward();
|
|
1139
1139
|
}
|
|
1140
|
-
function
|
|
1140
|
+
function W() {
|
|
1141
1141
|
history.back();
|
|
1142
1142
|
}
|
|
1143
|
-
function
|
|
1143
|
+
function pe(n) {
|
|
1144
1144
|
n && n.copy && (z = n.copy);
|
|
1145
1145
|
}
|
|
1146
1146
|
const be = {
|
|
1147
|
-
setConfig:
|
|
1147
|
+
setConfig: pe,
|
|
1148
1148
|
install(n, r) {
|
|
1149
|
-
M = n, M.checkVersion ? M.checkVersion(M.tableVersion, 4, 11) || console.error(`[@vxe-ui/plugin-menu 4.3.1] ${M.getI18n("vxe.error.errorVersion", [`vxe-table@${M.tableVersion || "?"}`, "vxe-table v4.11+"])} https://vxeui.com/other4/#/plugin-menu/install`) : /^(4)\./.test(M.uiVersion || M.tableVersion) || console.error("[@vxe-ui/plugin-menu 4.3.1] Requires vxe-table 4.7.0+ version. https://vxeui.com/other4/#/plugin-menu/install"),
|
|
1149
|
+
M = n, M.checkVersion ? M.checkVersion(M.tableVersion, 4, 11) || console.error(`[@vxe-ui/plugin-menu 4.3.1] ${M.getI18n("vxe.error.errorVersion", [`vxe-table@${M.tableVersion || "?"}`, "vxe-table v4.11+"])} https://vxeui.com/other4/#/plugin-menu/install`) : /^(4)\./.test(M.uiVersion || M.tableVersion) || console.error("[@vxe-ui/plugin-menu 4.3.1] Requires vxe-table 4.7.0+ version. https://vxeui.com/other4/#/plugin-menu/install"), pe(r), M.menus.mixin({
|
|
1150
1150
|
/**
|
|
1151
1151
|
* 浏览器-刷新页面(对应按键F5)
|
|
1152
1152
|
*/
|
|
1153
1153
|
SYSTEM_PAGE_REFRESH: {
|
|
1154
|
+
tableMenuMethod: H,
|
|
1155
|
+
treeMenuMethod: H,
|
|
1156
|
+
calendarMenuMethod: H,
|
|
1157
|
+
menuMenuMethod: H,
|
|
1158
|
+
formDesignMenuMethod: H
|
|
1159
|
+
},
|
|
1160
|
+
/**
|
|
1161
|
+
* 浏览器-前进
|
|
1162
|
+
*/
|
|
1163
|
+
SYSTEM_PAGE_FORWARD: {
|
|
1154
1164
|
tableMenuMethod: B,
|
|
1155
1165
|
treeMenuMethod: B,
|
|
1156
1166
|
calendarMenuMethod: B,
|
|
@@ -1158,25 +1168,15 @@ const be = {
|
|
|
1158
1168
|
formDesignMenuMethod: B
|
|
1159
1169
|
},
|
|
1160
1170
|
/**
|
|
1161
|
-
*
|
|
1171
|
+
* 浏览器-后退
|
|
1162
1172
|
*/
|
|
1163
|
-
|
|
1173
|
+
SYSTEM_PAGE_BACK: {
|
|
1164
1174
|
tableMenuMethod: W,
|
|
1165
1175
|
treeMenuMethod: W,
|
|
1166
1176
|
calendarMenuMethod: W,
|
|
1167
1177
|
menuMenuMethod: W,
|
|
1168
1178
|
formDesignMenuMethod: W
|
|
1169
1179
|
},
|
|
1170
|
-
/**
|
|
1171
|
-
* 浏览器-后退
|
|
1172
|
-
*/
|
|
1173
|
-
SYSTEM_PAGE_BACK: {
|
|
1174
|
-
tableMenuMethod: U,
|
|
1175
|
-
treeMenuMethod: U,
|
|
1176
|
-
calendarMenuMethod: U,
|
|
1177
|
-
menuMenuMethod: U,
|
|
1178
|
-
formDesignMenuMethod: U
|
|
1179
|
-
},
|
|
1180
1180
|
/**
|
|
1181
1181
|
* 清除单元格数据的值;如果启用 mouse-config.area 功能,则清除区域范围内的单元格数据
|
|
1182
1182
|
*/
|
|
@@ -1188,9 +1188,9 @@ const be = {
|
|
|
1188
1188
|
if (a && i.area) {
|
|
1189
1189
|
const u = e.getCellAreas();
|
|
1190
1190
|
u && u.length && u.forEach((d) => {
|
|
1191
|
-
const { rows:
|
|
1191
|
+
const { rows: m, cols: T } = d;
|
|
1192
1192
|
T.forEach((R) => {
|
|
1193
|
-
|
|
1193
|
+
m.forEach((y) => {
|
|
1194
1194
|
e.clearData(y, R.field);
|
|
1195
1195
|
});
|
|
1196
1196
|
});
|
|
@@ -1225,8 +1225,8 @@ const be = {
|
|
|
1225
1225
|
tableMenuMethod(o) {
|
|
1226
1226
|
const { $table: e, row: t, column: l } = o, s = e.props, { mouseConfig: a } = s, { computeMouseOpts: c } = e.getComputeMaps(), i = c.value;
|
|
1227
1227
|
a && i.area ? (a && i.area ? e.getCellAreas() : []).forEach((d) => {
|
|
1228
|
-
const { rows:
|
|
1229
|
-
e.clearData(
|
|
1228
|
+
const { rows: m } = d;
|
|
1229
|
+
e.clearData(m);
|
|
1230
1230
|
}) : t && l && e.clearData(t);
|
|
1231
1231
|
}
|
|
1232
1232
|
},
|
|
@@ -1265,12 +1265,12 @@ const be = {
|
|
|
1265
1265
|
if (t && l && a && i.area) {
|
|
1266
1266
|
const { visibleColumn: u } = e.getTableColumn(), d = e.getCellAreas();
|
|
1267
1267
|
if (d.length === 1) {
|
|
1268
|
-
const
|
|
1268
|
+
const m = d[0];
|
|
1269
1269
|
e.setCellAreas([{
|
|
1270
|
-
startRow: p.first(
|
|
1271
|
-
endRow: p.last(
|
|
1270
|
+
startRow: p.first(m.rows),
|
|
1271
|
+
endRow: p.last(m.rows),
|
|
1272
1272
|
startColumn: p.first(u),
|
|
1273
|
-
endColumn: p.last(
|
|
1273
|
+
endColumn: p.last(m.cols)
|
|
1274
1274
|
}], { column: l, row: t });
|
|
1275
1275
|
} else
|
|
1276
1276
|
e.setCellAreas([{
|
|
@@ -1291,11 +1291,11 @@ const be = {
|
|
|
1291
1291
|
if (t && l && a && i.area) {
|
|
1292
1292
|
const { visibleColumn: u } = e.getTableColumn(), d = e.getCellAreas();
|
|
1293
1293
|
if (d.length === 1) {
|
|
1294
|
-
const
|
|
1294
|
+
const m = d[0];
|
|
1295
1295
|
e.setCellAreas([{
|
|
1296
|
-
startRow: p.first(
|
|
1297
|
-
endRow: p.last(
|
|
1298
|
-
startColumn: p.first(
|
|
1296
|
+
startRow: p.first(m.rows),
|
|
1297
|
+
endRow: p.last(m.rows),
|
|
1298
|
+
startColumn: p.first(m.cols),
|
|
1299
1299
|
endColumn: p.last(u)
|
|
1300
1300
|
}], { column: l, row: t });
|
|
1301
1301
|
} else
|
|
@@ -1317,12 +1317,12 @@ const be = {
|
|
|
1317
1317
|
if (t && l && a && i.area) {
|
|
1318
1318
|
const { visibleData: u } = e.getTableData(), d = e.getCellAreas();
|
|
1319
1319
|
if (d.length === 1) {
|
|
1320
|
-
const
|
|
1320
|
+
const m = d[0];
|
|
1321
1321
|
e.setCellAreas([{
|
|
1322
1322
|
startRow: p.first(u),
|
|
1323
|
-
endRow: p.last(
|
|
1324
|
-
startColumn: p.first(
|
|
1325
|
-
endColumn: p.last(
|
|
1323
|
+
endRow: p.last(m.rows),
|
|
1324
|
+
startColumn: p.first(m.cols),
|
|
1325
|
+
endColumn: p.last(m.cols)
|
|
1326
1326
|
}], { column: l, row: t });
|
|
1327
1327
|
} else
|
|
1328
1328
|
e.setCellAreas([{
|
|
@@ -1343,12 +1343,12 @@ const be = {
|
|
|
1343
1343
|
if (t && l && a && i.area) {
|
|
1344
1344
|
const { visibleData: u } = e.getTableData(), d = e.getCellAreas();
|
|
1345
1345
|
if (d.length === 1) {
|
|
1346
|
-
const
|
|
1346
|
+
const m = d[0];
|
|
1347
1347
|
e.setCellAreas([{
|
|
1348
|
-
startRow: p.first(
|
|
1348
|
+
startRow: p.first(m.rows),
|
|
1349
1349
|
endRow: p.last(u),
|
|
1350
|
-
startColumn: p.first(
|
|
1351
|
-
endColumn: p.last(
|
|
1350
|
+
startColumn: p.first(m.cols),
|
|
1351
|
+
endColumn: p.last(m.cols)
|
|
1352
1352
|
}], { column: l, row: t });
|
|
1353
1353
|
} else
|
|
1354
1354
|
e.setCellAreas([{
|
|
@@ -1371,9 +1371,9 @@ const be = {
|
|
|
1371
1371
|
if (a && i.area) {
|
|
1372
1372
|
const u = e.getCellAreas();
|
|
1373
1373
|
u && u.length && u.forEach((d) => {
|
|
1374
|
-
const { rows:
|
|
1374
|
+
const { rows: m, cols: T } = d;
|
|
1375
1375
|
T.forEach((R) => {
|
|
1376
|
-
|
|
1376
|
+
m.forEach((y) => {
|
|
1377
1377
|
e.revertData(y, R.field);
|
|
1378
1378
|
});
|
|
1379
1379
|
});
|
|
@@ -1424,7 +1424,7 @@ const be = {
|
|
|
1424
1424
|
*/
|
|
1425
1425
|
COPY_CELL: {
|
|
1426
1426
|
tableMenuMethod(o) {
|
|
1427
|
-
|
|
1427
|
+
ce(o);
|
|
1428
1428
|
}
|
|
1429
1429
|
},
|
|
1430
1430
|
/**
|
|
@@ -1432,7 +1432,7 @@ const be = {
|
|
|
1432
1432
|
*/
|
|
1433
1433
|
CUT_CELL: {
|
|
1434
1434
|
tableMenuMethod(o) {
|
|
1435
|
-
|
|
1435
|
+
ce(o, !0);
|
|
1436
1436
|
}
|
|
1437
1437
|
},
|
|
1438
1438
|
/**
|
|
@@ -1444,7 +1444,7 @@ const be = {
|
|
|
1444
1444
|
if (c && u.area)
|
|
1445
1445
|
t.triggerPasteCellAreaEvent(e);
|
|
1446
1446
|
else {
|
|
1447
|
-
const d =
|
|
1447
|
+
const d = le();
|
|
1448
1448
|
d && d.text && p.set(l, s.field, d.text);
|
|
1449
1449
|
}
|
|
1450
1450
|
}
|
|
@@ -1454,7 +1454,7 @@ const be = {
|
|
|
1454
1454
|
*/
|
|
1455
1455
|
MERGE_OR_CLEAR: {
|
|
1456
1456
|
tableMenuMethod(o) {
|
|
1457
|
-
const { $event: e, $table: t } = o, l = t.getCellAreas(), s =
|
|
1457
|
+
const { $event: e, $table: t } = o, l = t.getCellAreas(), s = ne(o);
|
|
1458
1458
|
let a = !1;
|
|
1459
1459
|
s.length ? t.removeMergeCells(s) : (a = !0, t.setMergeCells(l.map(({ rows: i, cols: u }) => ({
|
|
1460
1460
|
row: i[0],
|
|
@@ -1472,7 +1472,7 @@ const be = {
|
|
|
1472
1472
|
MERGE_CELL: {
|
|
1473
1473
|
tableMenuMethod(o) {
|
|
1474
1474
|
const { $event: e, $table: t } = o, { visibleData: l } = t.getTableData(), { visibleColumn: s } = t.getTableColumn(), a = t.getCellAreas();
|
|
1475
|
-
if (
|
|
1475
|
+
if (ue(o), a.some(({ rows: i, cols: u }) => i.length === l.length || u.length === s.length)) {
|
|
1476
1476
|
M.modal && M.modal.message({ content: M.getI18n("vxe.pro.area.mergeErr"), status: "error", id: "operErr" });
|
|
1477
1477
|
return;
|
|
1478
1478
|
}
|
|
@@ -1491,7 +1491,7 @@ const be = {
|
|
|
1491
1491
|
*/
|
|
1492
1492
|
CLEAR_MERGE_CELL: {
|
|
1493
1493
|
tableMenuMethod(o) {
|
|
1494
|
-
const { $event: e, $table: t } = o, l =
|
|
1494
|
+
const { $event: e, $table: t } = o, l = ue(o);
|
|
1495
1495
|
l.length && t.dispatchEvent("clear-cell-area-merge", { mergeCells: l }, e);
|
|
1496
1496
|
}
|
|
1497
1497
|
},
|
|
@@ -1556,8 +1556,8 @@ const be = {
|
|
|
1556
1556
|
const { $table: e, menu: t, row: l, column: s } = o, a = e.props, { mouseConfig: c } = a, { computeMouseOpts: i } = e.getComputeMaps(), u = i.value;
|
|
1557
1557
|
Y().then(({ size: d }) => {
|
|
1558
1558
|
if (d) {
|
|
1559
|
-
const
|
|
1560
|
-
(l ? e.insertAt(
|
|
1559
|
+
const m = p.range(0, d).map(() => Object.assign({}, t.params));
|
|
1560
|
+
(l ? e.insertAt(m, l) : e.insert(m)).then(({ rows: T }) => {
|
|
1561
1561
|
s && c && u.area && e.setCellAreas([
|
|
1562
1562
|
{ startRow: p.first(T), endRow: p.last(T), startColumn: s, endColumn: s }
|
|
1563
1563
|
]);
|
|
@@ -1587,8 +1587,8 @@ const be = {
|
|
|
1587
1587
|
const { $table: e, menu: t, row: l, column: s } = o, a = e.props, { mouseConfig: c } = a, { computeMouseOpts: i } = e.getComputeMaps(), u = i.value;
|
|
1588
1588
|
Y().then(({ size: d }) => {
|
|
1589
1589
|
if (d) {
|
|
1590
|
-
const
|
|
1591
|
-
(l ? e.insertNextAt(
|
|
1590
|
+
const m = p.range(0, d).map(() => Object.assign({}, t.params));
|
|
1591
|
+
(l ? e.insertNextAt(m, l) : e.insert(m)).then(({ rows: T }) => {
|
|
1592
1592
|
s && c && u.area && e.setCellAreas([
|
|
1593
1593
|
{ startRow: p.first(T), endRow: p.last(T), startColumn: s, endColumn: s }
|
|
1594
1594
|
]);
|
|
@@ -1872,15 +1872,15 @@ const be = {
|
|
|
1872
1872
|
/**
|
|
1873
1873
|
* 将列固定到左侧
|
|
1874
1874
|
*/
|
|
1875
|
-
FIXED_LEFT_COLUMN:
|
|
1875
|
+
FIXED_LEFT_COLUMN: Z("left"),
|
|
1876
1876
|
/**
|
|
1877
1877
|
* 将列固定到右侧
|
|
1878
1878
|
*/
|
|
1879
|
-
FIXED_RIGHT_COLUMN:
|
|
1879
|
+
FIXED_RIGHT_COLUMN: Z("right"),
|
|
1880
1880
|
/**
|
|
1881
1881
|
* 清除固定列
|
|
1882
1882
|
*/
|
|
1883
|
-
CLEAR_FIXED_COLUMN:
|
|
1883
|
+
CLEAR_FIXED_COLUMN: Z(null),
|
|
1884
1884
|
/**
|
|
1885
1885
|
* 重置列的可视状态
|
|
1886
1886
|
*/
|
|
@@ -1912,48 +1912,48 @@ const be = {
|
|
|
1912
1912
|
* 用于 proxy-config,重新初始化,恢复到初始状态,触发对应的 ajax.query
|
|
1913
1913
|
*/
|
|
1914
1914
|
COMMIT_PROXY_INITIAL: {
|
|
1915
|
-
tableMenuMethod:
|
|
1915
|
+
tableMenuMethod: V("initial")
|
|
1916
1916
|
},
|
|
1917
1917
|
/**
|
|
1918
1918
|
* 用于 proxy-config,重新加载,如果有分页,返回第一页,触发对应的 ajax.query
|
|
1919
1919
|
*/
|
|
1920
1920
|
COMMIT_PROXY_QUERY: {
|
|
1921
|
-
tableMenuMethod:
|
|
1921
|
+
tableMenuMethod: V("query")
|
|
1922
1922
|
},
|
|
1923
1923
|
/**
|
|
1924
1924
|
* 用于 proxy-config,刷新当前页,触发对应的 ajax.quer
|
|
1925
1925
|
*/
|
|
1926
1926
|
COMMIT_PROXY_RELOAD: {
|
|
1927
|
-
tableMenuMethod:
|
|
1927
|
+
tableMenuMethod: V("reload")
|
|
1928
1928
|
},
|
|
1929
1929
|
/**
|
|
1930
1930
|
* 用于 proxy-config,直接删除,触发对应的 ajax.delete
|
|
1931
1931
|
*/
|
|
1932
1932
|
COMMIT_PROXY_DELETE: {
|
|
1933
|
-
tableMenuMethod:
|
|
1933
|
+
tableMenuMethod: V("delete")
|
|
1934
1934
|
},
|
|
1935
1935
|
/**
|
|
1936
1936
|
* 用于 proxy-config,保存数据,触发对应的 ajax.save
|
|
1937
1937
|
*/
|
|
1938
1938
|
COMMIT_PROXY_SAVE: {
|
|
1939
|
-
tableMenuMethod:
|
|
1939
|
+
tableMenuMethod: V("save")
|
|
1940
1940
|
}
|
|
1941
1941
|
}), M.interceptor.add("event.showMenu", Ne);
|
|
1942
1942
|
}
|
|
1943
1943
|
};
|
|
1944
1944
|
typeof window < "u" && window.VxeUI && window.VxeUI.use && window.VxeUI.use(be);
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1945
|
+
F.setI18n("zh-CN", ge);
|
|
1946
|
+
F.use(be);
|
|
1947
|
+
F.setIcon({
|
|
1948
1948
|
TABLE_EDIT: ""
|
|
1949
1949
|
});
|
|
1950
|
-
|
|
1950
|
+
F.setConfig({
|
|
1951
1951
|
authId: "wmtxlrzz9kdguq7j"
|
|
1952
1952
|
});
|
|
1953
|
-
|
|
1954
|
-
const et =
|
|
1953
|
+
F.setLanguage("zh-CN");
|
|
1954
|
+
const et = F, tt = fe;
|
|
1955
1955
|
function he(n) {
|
|
1956
|
-
n.use(
|
|
1956
|
+
n.use(F), n.use(fe);
|
|
1957
1957
|
}
|
|
1958
1958
|
function Ve(n) {
|
|
1959
1959
|
for (let r = 1, o = arguments.length; r < o; r++) {
|
|
@@ -1966,7 +1966,7 @@ function Ve(n) {
|
|
|
1966
1966
|
}
|
|
1967
1967
|
return n;
|
|
1968
1968
|
}
|
|
1969
|
-
function
|
|
1969
|
+
function K(n) {
|
|
1970
1970
|
const r = (t) => t && Object.prototype.toString.call(t) === "[object Object]", o = (t) => Array.isArray(t), e = (t, l) => {
|
|
1971
1971
|
if (!o(t) || !o(l))
|
|
1972
1972
|
return l || t;
|
|
@@ -1983,14 +1983,14 @@ function J(n) {
|
|
|
1983
1983
|
const i = s.findIndex(
|
|
1984
1984
|
(u) => (u == null ? void 0 : u.code) === a.code
|
|
1985
1985
|
);
|
|
1986
|
-
i > -1 ? s[i] =
|
|
1986
|
+
i > -1 ? s[i] = K(
|
|
1987
1987
|
{},
|
|
1988
1988
|
s[i],
|
|
1989
1989
|
a
|
|
1990
1990
|
) : s.push(a);
|
|
1991
1991
|
} else if (r(a)) {
|
|
1992
1992
|
const i = s[c];
|
|
1993
|
-
s[c] = i ?
|
|
1993
|
+
s[c] = i ? K({}, i, a) : a;
|
|
1994
1994
|
} else
|
|
1995
1995
|
s[c] = a;
|
|
1996
1996
|
}), s;
|
|
@@ -2002,7 +2002,7 @@ function J(n) {
|
|
|
2002
2002
|
const c = n[a], i = s[a];
|
|
2003
2003
|
if (i === void 0)
|
|
2004
2004
|
continue;
|
|
2005
|
-
r(i) && r(c) ? n[a] =
|
|
2005
|
+
r(i) && r(c) ? n[a] = K({}, c, i) : o(i) && o(c) ? n[a] = e(c, i) : (r(i) || o(i), n[a] = i);
|
|
2006
2006
|
}
|
|
2007
2007
|
}
|
|
2008
2008
|
return n;
|
|
@@ -2124,7 +2124,7 @@ const He = () => ({
|
|
|
2124
2124
|
});
|
|
2125
2125
|
};
|
|
2126
2126
|
return e(o, r), o;
|
|
2127
|
-
},
|
|
2127
|
+
}, me = He(), ze = Me({
|
|
2128
2128
|
name: "DseTable",
|
|
2129
2129
|
emits: [
|
|
2130
2130
|
"menu-click",
|
|
@@ -2135,8 +2135,107 @@ const He = () => ({
|
|
|
2135
2135
|
],
|
|
2136
2136
|
props: {
|
|
2137
2137
|
menuConfig: {
|
|
2138
|
-
|
|
2139
|
-
|
|
2138
|
+
// header: {
|
|
2139
|
+
// options: [
|
|
2140
|
+
// [
|
|
2141
|
+
// {
|
|
2142
|
+
// code: 'ADD_COLUMN',
|
|
2143
|
+
// name: '添加列',
|
|
2144
|
+
// prefixIcon: 'vxe-icon-add'
|
|
2145
|
+
// },
|
|
2146
|
+
// {
|
|
2147
|
+
// code: 'DELETE_COLUMN',
|
|
2148
|
+
// name: '删除列',
|
|
2149
|
+
// prefixIcon: 'vxe-icon-delete'
|
|
2150
|
+
// },
|
|
2151
|
+
// {
|
|
2152
|
+
// code: 'EDIT_COLUMN',
|
|
2153
|
+
// name: '编辑列',
|
|
2154
|
+
// prefixIcon: 'vxe-icon-edit'
|
|
2155
|
+
// }
|
|
2156
|
+
// ]
|
|
2157
|
+
// ]
|
|
2158
|
+
// },
|
|
2159
|
+
// body: {
|
|
2160
|
+
// options: [
|
|
2161
|
+
// [
|
|
2162
|
+
// { code: 'CLEAR_ROW', name: '清空选中行', prefixIcon: 'vxe-icon-delete' },
|
|
2163
|
+
// {
|
|
2164
|
+
// name: '新增行',
|
|
2165
|
+
// prefixIcon: 'vxe-icon-add',
|
|
2166
|
+
// children: [
|
|
2167
|
+
// { code: 'INSERT_AT_ROW', name: '新增1行', prefixIcon: 'vxe-icon-add' },
|
|
2168
|
+
// { code: 'INSERT_AT_ROW10', name: '新增10行', prefixIcon: 'vxe-icon-add' }
|
|
2169
|
+
// ]
|
|
2170
|
+
// },
|
|
2171
|
+
// { code: 'COPY_CELL', name: '复制', prefixIcon: 'vxe-icon-copy' },
|
|
2172
|
+
// { code: 'PASTE_CELL', name: '粘贴', prefixIcon: 'vxe-icon-paste' },
|
|
2173
|
+
// { code: 'CUT_CELL', name: '剪切', prefixIcon: 'vxe-icon-cut' },
|
|
2174
|
+
// { code: 'DELETE', name: '删除行', prefixIcon: 'vxe-icon-delete' }
|
|
2175
|
+
// ]
|
|
2176
|
+
// ]
|
|
2177
|
+
// },
|
|
2178
|
+
// focusIndex: 0
|
|
2179
|
+
},
|
|
2180
|
+
editConfig: {
|
|
2181
|
+
enabled: !0,
|
|
2182
|
+
trigger: "dblclick",
|
|
2183
|
+
mode: "cell",
|
|
2184
|
+
showStatus: !0
|
|
2185
|
+
},
|
|
2186
|
+
exportConfig: {
|
|
2187
|
+
type: "xlsx"
|
|
2188
|
+
},
|
|
2189
|
+
columnConfig: {
|
|
2190
|
+
resizable: !0
|
|
2191
|
+
},
|
|
2192
|
+
sortConfig: {
|
|
2193
|
+
trigger: "cell",
|
|
2194
|
+
remote: !0
|
|
2195
|
+
},
|
|
2196
|
+
virtualYConfig: {
|
|
2197
|
+
enabled: !0,
|
|
2198
|
+
gt: 1e4
|
|
2199
|
+
},
|
|
2200
|
+
clipConfig: {
|
|
2201
|
+
isCopy: !0,
|
|
2202
|
+
isCut: !0,
|
|
2203
|
+
isPaste: !0,
|
|
2204
|
+
isFillPaste: !0,
|
|
2205
|
+
isRowIncrement: !0,
|
|
2206
|
+
isColumnIncrement: !1
|
|
2207
|
+
},
|
|
2208
|
+
areaConfig: {
|
|
2209
|
+
extendByCopy: !0,
|
|
2210
|
+
multiple: !0,
|
|
2211
|
+
selectCellByHeader: !1,
|
|
2212
|
+
excludeFields: ["tm"]
|
|
2213
|
+
},
|
|
2214
|
+
mouseConfig: {
|
|
2215
|
+
area: !0,
|
|
2216
|
+
extension: !0
|
|
2217
|
+
},
|
|
2218
|
+
keyboardConfig: {
|
|
2219
|
+
isClip: !0,
|
|
2220
|
+
isEdit: !0,
|
|
2221
|
+
isTab: !0,
|
|
2222
|
+
isArrow: !0,
|
|
2223
|
+
isDel: !0,
|
|
2224
|
+
isEnter: !0,
|
|
2225
|
+
isMerge: !0,
|
|
2226
|
+
isFNR: !0,
|
|
2227
|
+
isChecked: !0,
|
|
2228
|
+
isLastEnterAppendRow: !0,
|
|
2229
|
+
enterToTab: !1
|
|
2230
|
+
},
|
|
2231
|
+
rowConfig: {
|
|
2232
|
+
resizable: !0
|
|
2233
|
+
},
|
|
2234
|
+
toolbarConfig: {
|
|
2235
|
+
slots: {
|
|
2236
|
+
buttons: "toolbarButtons"
|
|
2237
|
+
},
|
|
2238
|
+
export: !1
|
|
2140
2239
|
},
|
|
2141
2240
|
autoResize: {
|
|
2142
2241
|
type: Boolean,
|
|
@@ -2184,10 +2283,6 @@ const He = () => ({
|
|
|
2184
2283
|
type: [Function, Object],
|
|
2185
2284
|
default: () => ({ background: "#0080FF1F" })
|
|
2186
2285
|
},
|
|
2187
|
-
data: {
|
|
2188
|
-
type: Array,
|
|
2189
|
-
default: () => []
|
|
2190
|
-
},
|
|
2191
2286
|
height: {
|
|
2192
2287
|
type: Number,
|
|
2193
2288
|
default: 0
|
|
@@ -2204,50 +2299,10 @@ const He = () => ({
|
|
|
2204
2299
|
type: Number,
|
|
2205
2300
|
default: 0
|
|
2206
2301
|
},
|
|
2207
|
-
editConfig: {
|
|
2208
|
-
type: Object,
|
|
2209
|
-
default: () => _.editConfig
|
|
2210
|
-
},
|
|
2211
|
-
exportConfig: {
|
|
2212
|
-
type: Object,
|
|
2213
|
-
default: () => _.exportConfig
|
|
2214
|
-
},
|
|
2215
2302
|
align: {
|
|
2216
2303
|
type: String,
|
|
2217
2304
|
default: "center"
|
|
2218
2305
|
},
|
|
2219
|
-
columnConfig: {
|
|
2220
|
-
type: Object,
|
|
2221
|
-
default: () => _.columnConfig
|
|
2222
|
-
},
|
|
2223
|
-
sortConfig: {
|
|
2224
|
-
type: Object,
|
|
2225
|
-
default: () => _.sortConfig
|
|
2226
|
-
},
|
|
2227
|
-
virtualYConfig: {
|
|
2228
|
-
type: Object,
|
|
2229
|
-
default: () => _.virtualYConfig
|
|
2230
|
-
},
|
|
2231
|
-
clipConfig: {
|
|
2232
|
-
type: Object,
|
|
2233
|
-
default: () => _.clipConfig
|
|
2234
|
-
},
|
|
2235
|
-
areaConfig: {
|
|
2236
|
-
type: Object,
|
|
2237
|
-
default: () => _.areaConfig
|
|
2238
|
-
},
|
|
2239
|
-
mouseConfig: {
|
|
2240
|
-
type: Object,
|
|
2241
|
-
default: () => _.mouseConfig
|
|
2242
|
-
},
|
|
2243
|
-
keyboardConfig: {
|
|
2244
|
-
type: Object,
|
|
2245
|
-
default: () => _.keyboardConfig
|
|
2246
|
-
},
|
|
2247
|
-
rowConfig: {
|
|
2248
|
-
type: Object,
|
|
2249
|
-
default: () => _.rowConfig
|
|
2250
|
-
},
|
|
2251
2306
|
mergeCells: {
|
|
2252
2307
|
type: Array,
|
|
2253
2308
|
default: () => []
|
|
@@ -2260,15 +2315,15 @@ const He = () => ({
|
|
|
2260
2315
|
setup(n, { emit: r, expose: o }) {
|
|
2261
2316
|
const e = Te();
|
|
2262
2317
|
e && e.proxy && e.proxy.appContext && e.proxy.appContext.app && he(e.proxy.appContext.app);
|
|
2263
|
-
const t =
|
|
2318
|
+
const t = X(
|
|
2264
2319
|
() => typeof n.width == "number" ? `${n.width}px` : n.width
|
|
2265
|
-
), l =
|
|
2266
|
-
const
|
|
2320
|
+
), l = j(), s = j(0), a = j("dse-table-grid"), c = X(() => We("children", n.columns)), i = X(() => {
|
|
2321
|
+
const f = [];
|
|
2267
2322
|
return c.value.forEach((g) => {
|
|
2268
|
-
g.slots && (g.slots.default &&
|
|
2269
|
-
}),
|
|
2270
|
-
}), u =
|
|
2271
|
-
const
|
|
2323
|
+
g.slots && (g.slots.default && f.push({ name: g.slots.default, type: "default", item: g }), g.slots.edit && f.push({ name: g.slots.edit, type: "edit", item: g }), g.slots.header && f.push({ name: g.slots.header, type: "header", item: g }));
|
|
2324
|
+
}), f;
|
|
2325
|
+
}), u = X(() => {
|
|
2326
|
+
const f = ["menuConfig"], g = [
|
|
2272
2327
|
"editConfig",
|
|
2273
2328
|
"exportConfig",
|
|
2274
2329
|
"columnConfig",
|
|
@@ -2281,42 +2336,42 @@ const He = () => ({
|
|
|
2281
2336
|
"rowConfig",
|
|
2282
2337
|
"toolbarConfig"
|
|
2283
2338
|
], E = {};
|
|
2284
|
-
return
|
|
2285
|
-
E[C] =
|
|
2339
|
+
return f.forEach((C) => {
|
|
2340
|
+
E[C] = K({}, me[C], n[C] || {});
|
|
2286
2341
|
}), g.forEach((C) => {
|
|
2287
|
-
E[C] = Ve({},
|
|
2342
|
+
E[C] = Ve({}, me[C], n[C] || {});
|
|
2288
2343
|
}), E;
|
|
2289
2344
|
}), d = ({
|
|
2290
|
-
menu:
|
|
2345
|
+
menu: f,
|
|
2291
2346
|
type: g,
|
|
2292
2347
|
row: E,
|
|
2293
2348
|
rowIndex: C,
|
|
2294
|
-
column:
|
|
2295
|
-
columnIndex:
|
|
2296
|
-
$event:
|
|
2349
|
+
column: O,
|
|
2350
|
+
columnIndex: w,
|
|
2351
|
+
$event: $
|
|
2297
2352
|
}) => {
|
|
2298
|
-
var
|
|
2299
|
-
|
|
2353
|
+
var _;
|
|
2354
|
+
f.code === "DELETE_COLUMN" && (n.columns.splice(w, 1), (_ = l.value) == null || _.refreshColumn());
|
|
2300
2355
|
const b = n.data, x = {
|
|
2301
2356
|
CLEAR_ROW: () => {
|
|
2302
|
-
var L,
|
|
2303
|
-
const h = (
|
|
2357
|
+
var L, v, k, N;
|
|
2358
|
+
const h = (k = (v = (L = l.value) == null ? void 0 : L.getCellAreas()) == null ? void 0 : v[0]) == null ? void 0 : k.rows;
|
|
2304
2359
|
if (h != null && h.length) {
|
|
2305
|
-
for (let
|
|
2306
|
-
h.includes(b[
|
|
2307
|
-
r("update:data", b), (
|
|
2360
|
+
for (let I = 0; I < b.length; I++)
|
|
2361
|
+
h.includes(b[I]) && (b[I] = {});
|
|
2362
|
+
r("update:data", b), (N = l.value) == null || N.reloadData(b), r("menu-clear-delete", b);
|
|
2308
2363
|
}
|
|
2309
2364
|
},
|
|
2310
2365
|
DELETE: () => {
|
|
2311
|
-
var
|
|
2312
|
-
const h = (
|
|
2366
|
+
var v, k, N, I;
|
|
2367
|
+
const h = (N = (k = (v = l.value) == null ? void 0 : v.getCellAreas()) == null ? void 0 : k[0]) == null ? void 0 : N.rows;
|
|
2313
2368
|
if (!(h != null && h.length)) return;
|
|
2314
|
-
h.map((
|
|
2315
|
-
var
|
|
2316
|
-
return (
|
|
2317
|
-
}).sort((
|
|
2318
|
-
(
|
|
2319
|
-
}), r("update:data", b), (
|
|
2369
|
+
h.map((D) => {
|
|
2370
|
+
var U;
|
|
2371
|
+
return (U = l.value) == null ? void 0 : U.getRowIndex(D);
|
|
2372
|
+
}).sort((D, U) => U - D).forEach((D) => {
|
|
2373
|
+
(D || D === 0) && b.splice(D, 1);
|
|
2374
|
+
}), r("update:data", b), (I = l.value) == null || I.reloadData(b), r("menu-clear-delete", b);
|
|
2320
2375
|
},
|
|
2321
2376
|
INSERT_AT_ROW: () => {
|
|
2322
2377
|
var h, L;
|
|
@@ -2327,88 +2382,88 @@ const He = () => ({
|
|
|
2327
2382
|
r("update:data", b.splice(C + 1, 0, {})), (L = l.value) == null || L.reloadData(b);
|
|
2328
2383
|
},
|
|
2329
2384
|
INSERT_AT_ROW10: () => {
|
|
2330
|
-
var L,
|
|
2385
|
+
var L, v;
|
|
2331
2386
|
const h = Array.from({ length: 10 }, () => ({}));
|
|
2332
2387
|
if (!C && C !== 0) {
|
|
2333
2388
|
r("update:data", b.push(...h)), (L = l.value) == null || L.reloadData(b);
|
|
2334
2389
|
return;
|
|
2335
2390
|
}
|
|
2336
|
-
r("update:data", b.splice(C + 1, 0, ...h)), (
|
|
2391
|
+
r("update:data", b.splice(C + 1, 0, ...h)), (v = l.value) == null || v.reloadData(b);
|
|
2337
2392
|
}
|
|
2338
2393
|
};
|
|
2339
|
-
x[
|
|
2394
|
+
x[f.code] ? x[f.code]() : r(
|
|
2340
2395
|
"menu-click",
|
|
2341
|
-
|
|
2396
|
+
f,
|
|
2342
2397
|
g,
|
|
2343
2398
|
E,
|
|
2344
2399
|
C,
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2400
|
+
O,
|
|
2401
|
+
w,
|
|
2402
|
+
$
|
|
2348
2403
|
);
|
|
2349
|
-
},
|
|
2350
|
-
var C,
|
|
2351
|
-
const g = ((C =
|
|
2404
|
+
}, m = ({ targetAreas: f }) => {
|
|
2405
|
+
var C, O;
|
|
2406
|
+
const g = ((C = f == null ? void 0 : f[0]) == null ? void 0 : C.rows) || [], E = ((O = l.value) == null ? void 0 : O.getInsertRecords()) || [];
|
|
2352
2407
|
r("update:data", [...E, ...g]);
|
|
2353
2408
|
}, T = () => {
|
|
2354
2409
|
var E, C;
|
|
2355
|
-
const
|
|
2356
|
-
|
|
2410
|
+
const f = n.data, g = ((E = f.at(-1)) == null ? void 0 : E._X_ROW_KEY) ?? 0;
|
|
2411
|
+
f.push({ _X_ROW_KEY: g + 1 }), r("update:data", f), (C = l.value) == null || C.reloadData(f);
|
|
2357
2412
|
};
|
|
2358
|
-
function R(
|
|
2413
|
+
function R(f) {
|
|
2359
2414
|
const g = [];
|
|
2360
2415
|
function E(C) {
|
|
2361
|
-
var
|
|
2362
|
-
for (const
|
|
2363
|
-
|
|
2416
|
+
var O;
|
|
2417
|
+
for (const w of C)
|
|
2418
|
+
w.field && g.push(w.field), (O = w.children) != null && O.length && E(w.children);
|
|
2364
2419
|
}
|
|
2365
|
-
return E(
|
|
2420
|
+
return E(f), g;
|
|
2366
2421
|
}
|
|
2367
|
-
const y = ["tm", "updateTime", "startTime", "endTime"],
|
|
2368
|
-
const
|
|
2369
|
-
for (let
|
|
2370
|
-
const
|
|
2422
|
+
const y = ["tm", "updateTime", "startTime", "endTime"], S = () => {
|
|
2423
|
+
const f = [], g = R(n.columns), E = n.data, C = Object.keys(E);
|
|
2424
|
+
for (let O = 0; O < C.length; O++) {
|
|
2425
|
+
const w = C[O], $ = E[w], b = [];
|
|
2371
2426
|
for (let x = 0; x < g.length; x++) {
|
|
2372
|
-
const
|
|
2373
|
-
l.value.isUpdateByRow(
|
|
2427
|
+
const _ = g[x];
|
|
2428
|
+
l.value.isUpdateByRow($, _) && b.push(_);
|
|
2374
2429
|
}
|
|
2375
2430
|
if (b.length > 0) {
|
|
2376
2431
|
const x = {};
|
|
2377
|
-
for (let
|
|
2378
|
-
const h = b[
|
|
2379
|
-
x[h] =
|
|
2432
|
+
for (let _ = 0; _ < b.length; _++) {
|
|
2433
|
+
const h = b[_];
|
|
2434
|
+
x[h] = $[h];
|
|
2380
2435
|
}
|
|
2381
|
-
for (let
|
|
2382
|
-
const h = y[
|
|
2383
|
-
|
|
2436
|
+
for (let _ = 0; _ < y.length; _++) {
|
|
2437
|
+
const h = y[_];
|
|
2438
|
+
$[h] !== void 0 && (x[h] = $[h]);
|
|
2384
2439
|
}
|
|
2385
|
-
|
|
2440
|
+
f.push(x);
|
|
2386
2441
|
}
|
|
2387
2442
|
}
|
|
2388
|
-
return
|
|
2389
|
-
},
|
|
2390
|
-
n.height ? s.value = n.height :
|
|
2443
|
+
return f;
|
|
2444
|
+
}, P = () => {
|
|
2445
|
+
n.height ? s.value = n.height : _e(() => {
|
|
2391
2446
|
var g, E;
|
|
2392
|
-
const
|
|
2393
|
-
s.value =
|
|
2447
|
+
const f = window.innerHeight - 100 - ((E = (g = document.querySelector(`#${a.value}`)) == null ? void 0 : g.getBoundingClientRect()) == null ? void 0 : E.top);
|
|
2448
|
+
s.value = f;
|
|
2394
2449
|
});
|
|
2395
2450
|
};
|
|
2396
2451
|
return Re(
|
|
2397
2452
|
() => n.height,
|
|
2398
2453
|
() => {
|
|
2399
|
-
|
|
2454
|
+
P();
|
|
2400
2455
|
}
|
|
2401
2456
|
), ye(() => {
|
|
2402
2457
|
console.log(n.data, "props.data");
|
|
2403
|
-
const
|
|
2404
|
-
a.value = "_gridRef" + Math.round(Math.random() * (g -
|
|
2458
|
+
const f = 0, g = 2e4;
|
|
2459
|
+
a.value = "_gridRef" + Math.round(Math.random() * (g - f)) + f, [".app-main"].map(
|
|
2405
2460
|
(C) => document.querySelector(C)
|
|
2406
2461
|
).forEach((C) => {
|
|
2407
2462
|
C && De(C, () => {
|
|
2408
|
-
|
|
2463
|
+
P();
|
|
2409
2464
|
});
|
|
2410
|
-
}),
|
|
2411
|
-
}), o({ xGrid: l, getUpdateCellData:
|
|
2465
|
+
}), P();
|
|
2466
|
+
}), o({ xGrid: l, getUpdateCellData: S }), {
|
|
2412
2467
|
gridWidth: t,
|
|
2413
2468
|
xGrid: l,
|
|
2414
2469
|
gridId: a,
|
|
@@ -2417,20 +2472,20 @@ const He = () => ({
|
|
|
2417
2472
|
allSlots: i,
|
|
2418
2473
|
mergedConfigs: u,
|
|
2419
2474
|
handleMenu: d,
|
|
2420
|
-
cellAreaPaste:
|
|
2475
|
+
cellAreaPaste: m,
|
|
2421
2476
|
enterAppendRow: T
|
|
2422
2477
|
};
|
|
2423
2478
|
}
|
|
2424
|
-
}),
|
|
2425
|
-
function
|
|
2426
|
-
const s =
|
|
2479
|
+
}), Ue = ["id"], Xe = { key: 1 };
|
|
2480
|
+
function qe(n, r, o, e, t, l) {
|
|
2481
|
+
const s = Oe("vxe-grid");
|
|
2427
2482
|
return q(), G("div", {
|
|
2428
2483
|
id: n.gridId,
|
|
2429
2484
|
ref: n.gridId
|
|
2430
2485
|
}, [
|
|
2431
|
-
|
|
2432
|
-
default:
|
|
2433
|
-
|
|
2486
|
+
se(xe, null, {
|
|
2487
|
+
default: ae(() => [
|
|
2488
|
+
se(s, Ae(n.$attrs, {
|
|
2434
2489
|
class: "hydGrid",
|
|
2435
2490
|
ref: "xGrid",
|
|
2436
2491
|
size: "small",
|
|
@@ -2442,7 +2497,6 @@ function je(n, r, o, e, t, l) {
|
|
|
2442
2497
|
"clip-config": n.mergedConfigs.clipConfig,
|
|
2443
2498
|
"column-config": n.mergedConfigs.columnConfig,
|
|
2444
2499
|
columns: n.columns,
|
|
2445
|
-
data: n.data,
|
|
2446
2500
|
height: n.tableHeight,
|
|
2447
2501
|
"max-height": n.tableHeight,
|
|
2448
2502
|
"edit-config": n.mergedConfigs.editConfig,
|
|
@@ -2466,39 +2520,39 @@ function je(n, r, o, e, t, l) {
|
|
|
2466
2520
|
onCellAreaPaste: n.cellAreaPaste,
|
|
2467
2521
|
onEnterAppendRow: n.enterAppendRow
|
|
2468
2522
|
}), we({ _: 2 }, [
|
|
2469
|
-
|
|
2523
|
+
Le(n.allSlots, (a) => ({
|
|
2470
2524
|
name: a.name,
|
|
2471
|
-
fn:
|
|
2472
|
-
|
|
2473
|
-
a.type === "header" ? (q(), G(
|
|
2474
|
-
a.item.unit ? (q(), G(
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
], 64)) : (q(), G("span", Xe,
|
|
2525
|
+
fn: ae((c) => [
|
|
2526
|
+
ve(n.$slots, a.name, Se(Pe(c)), () => [
|
|
2527
|
+
a.type === "header" ? (q(), G(re, { key: 0 }, [
|
|
2528
|
+
a.item.unit ? (q(), G(re, { key: 0 }, [
|
|
2529
|
+
ie("span", null, Q(a.item.title), 1),
|
|
2530
|
+
ie("div", null, "(" + Q(a.item.unit) + ")", 1)
|
|
2531
|
+
], 64)) : (q(), G("span", Xe, Q(a.item.title), 1))
|
|
2478
2532
|
], 64)) : Ie("", !0)
|
|
2479
2533
|
])
|
|
2480
2534
|
])
|
|
2481
2535
|
}))
|
|
2482
|
-
]), 1040, ["align", "area-config", "auto-resize", "border", "cell-style", "clip-config", "column-config", "columns", "
|
|
2536
|
+
]), 1040, ["align", "area-config", "auto-resize", "border", "cell-style", "clip-config", "column-config", "columns", "height", "max-height", "edit-config", "export-config", "header-row-style", "keep-source", "keyboard-config", "menu-config", "merge-cells", "mouse-config", "row-config", "row-style", "show-footer", "show-header", "show-header-overflow", "show-overflow", "sort-config", "style", "virtual-y-config", "onMenuClick", "onCellAreaPaste", "onEnterAppendRow"])
|
|
2483
2537
|
]),
|
|
2484
2538
|
_: 3
|
|
2485
2539
|
})
|
|
2486
|
-
], 8,
|
|
2540
|
+
], 8, Ue);
|
|
2487
2541
|
}
|
|
2488
|
-
const
|
|
2489
|
-
|
|
2490
|
-
n.component(
|
|
2542
|
+
const J = /* @__PURE__ */ Be(ze, [["render", qe]]);
|
|
2543
|
+
J.install = (n) => {
|
|
2544
|
+
n.component(J.name || "DseTable", J);
|
|
2491
2545
|
};
|
|
2492
|
-
const
|
|
2546
|
+
const Ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2493
2547
|
__proto__: null,
|
|
2494
|
-
DseTable:
|
|
2495
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2496
|
-
he(n), Object.values(
|
|
2548
|
+
DseTable: J
|
|
2549
|
+
}, Symbol.toStringTag, { value: "Module" })), Ye = (n) => {
|
|
2550
|
+
he(n), Object.values(Ge).forEach((r) => {
|
|
2497
2551
|
r.install ? r.install(n) : r.name && n.component(r.name, r);
|
|
2498
2552
|
});
|
|
2499
|
-
}, ot = { install:
|
|
2553
|
+
}, ot = { install: Ye };
|
|
2500
2554
|
export {
|
|
2501
|
-
|
|
2555
|
+
J as DseTable,
|
|
2502
2556
|
tt as VxeTable,
|
|
2503
2557
|
et as VxeUI,
|
|
2504
2558
|
ot as default,
|