wkjp-list-page 1.0.20 → 1.0.22
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/package.json +1 -1
- package/src/components/CommonListPage.vue +434 -52
package/package.json
CHANGED
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
:type="item.type || 'date'"
|
|
61
61
|
:unlink-panels="resolveSearchUnlinkPanels(item)"
|
|
62
62
|
:editable="item.editable === true"
|
|
63
|
+
:clearable="item.clearable !== false"
|
|
63
64
|
:range-separator="item.rangeSeparator || '至'"
|
|
64
65
|
:style="{ width: `${item.width || (item.type === 'daterange' || item.type === 'datetimerange' ? 300 : 150)}px` }"
|
|
65
66
|
:label="floatingLabelFor(item)"
|
|
@@ -194,7 +195,11 @@
|
|
|
194
195
|
<div class="column-config-panel__body">
|
|
195
196
|
<div class="column-config-panel__section">
|
|
196
197
|
<div class="column-config-panel__section-title">显示字段</div>
|
|
197
|
-
<ul
|
|
198
|
+
<ul
|
|
199
|
+
v-if="visibleConfigIndexes.length"
|
|
200
|
+
ref="columnConfigSortableList"
|
|
201
|
+
class="column-config-panel__list column-config-panel__list--sortable"
|
|
202
|
+
>
|
|
198
203
|
<li
|
|
199
204
|
v-for="idx in visibleConfigIndexes"
|
|
200
205
|
:key="configColumns[idx]._configKey"
|
|
@@ -202,21 +207,27 @@
|
|
|
202
207
|
class="column-config-panel__item"
|
|
203
208
|
:class="{
|
|
204
209
|
'column-config-panel__item--fixed': isFixedColumn(configColumns[idx]),
|
|
205
|
-
'column-config-panel__item--dragging':
|
|
206
|
-
'column-config-panel__item--
|
|
210
|
+
'column-config-panel__item--dragging': isColumnDragRow(configColumns[idx]),
|
|
211
|
+
'column-config-panel__item--shift': !!columnDragKey && !isColumnDragRow(configColumns[idx])
|
|
207
212
|
}"
|
|
213
|
+
:style="getColumnDragShiftStyle(idx)"
|
|
214
|
+
@mousedown="onColumnRowMouseDown(idx, $event)"
|
|
208
215
|
>
|
|
209
216
|
<span
|
|
210
217
|
v-if="isFixedColumn(configColumns[idx])"
|
|
211
218
|
class="column-config-panel__fixed-tag"
|
|
212
219
|
>{{ columnConfigFixedText }}</span>
|
|
213
|
-
<
|
|
220
|
+
<span
|
|
214
221
|
v-else
|
|
215
|
-
class="column-config-panel__drag
|
|
216
|
-
|
|
217
|
-
|
|
222
|
+
class="column-config-panel__drag"
|
|
223
|
+
title="拖动排序"
|
|
224
|
+
@mousedown.prevent.stop="onDragMouseDown(idx, $event)"
|
|
225
|
+
>
|
|
226
|
+
<i v-for="dot in 6" :key="'dot-' + idx + '-' + dot"></i>
|
|
227
|
+
</span>
|
|
218
228
|
<span class="column-config-panel__label">{{ columnConfigLabel(configColumns[idx]) }}</span>
|
|
219
229
|
<el-switch
|
|
230
|
+
class="column-config-panel__switch"
|
|
220
231
|
:value="configColumns[idx]._visible !== false"
|
|
221
232
|
:disabled="isFixedColumn(configColumns[idx])"
|
|
222
233
|
@input="(val) => setColumnVisible(idx, val)"
|
|
@@ -248,6 +259,20 @@
|
|
|
248
259
|
<el-button size="small" @click="cancelColumnConfig">{{ columnConfigCancelText }}</el-button>
|
|
249
260
|
<el-button type="primary" size="small" @click="confirmColumnConfig">{{ columnConfigConfirmText }}</el-button>
|
|
250
261
|
</div>
|
|
262
|
+
<div
|
|
263
|
+
v-show="!!columnDragKey"
|
|
264
|
+
class="column-config-panel__row-ghost"
|
|
265
|
+
:style="columnDragGhostStyle"
|
|
266
|
+
>
|
|
267
|
+
<span class="column-config-panel__drag column-config-panel__drag--ghost">
|
|
268
|
+
<i v-for="dot in 6" :key="'ghost-dot-' + dot"></i>
|
|
269
|
+
</span>
|
|
270
|
+
<span class="column-config-panel__label">{{ columnDragGhostLabel }}</span>
|
|
271
|
+
<span
|
|
272
|
+
class="column-config-panel__ghost-switch"
|
|
273
|
+
:class="{ 'is-on': columnDragGhostSwitchOn }"
|
|
274
|
+
></span>
|
|
275
|
+
</div>
|
|
251
276
|
</div>
|
|
252
277
|
</el-popover>
|
|
253
278
|
|
|
@@ -397,8 +422,21 @@ export default {
|
|
|
397
422
|
},
|
|
398
423
|
columnConfigVisible: false,
|
|
399
424
|
columnConfigKeyword: "",
|
|
400
|
-
|
|
425
|
+
/** 正在被拖起的列(用 _configKey 跟踪,拖动中会实时换位) */
|
|
426
|
+
columnDragKey: "",
|
|
401
427
|
dragOverIndex: -1,
|
|
428
|
+
columnDragGhostLabel: "",
|
|
429
|
+
columnDragGhostSwitchOn: true,
|
|
430
|
+
columnDragGhostX: 0,
|
|
431
|
+
columnDragGhostY: 0,
|
|
432
|
+
columnDragGhostWidth: 0,
|
|
433
|
+
columnDragGhostOffsetX: 0,
|
|
434
|
+
columnDragGhostOffsetY: 0,
|
|
435
|
+
/** 拖动开始时在可拖列表中的序号 */
|
|
436
|
+
columnDragStartOrderIndex: -1,
|
|
437
|
+
/** 当前插入槽位(0 ~ 可拖项数量) */
|
|
438
|
+
columnDragInsertAt: -1,
|
|
439
|
+
columnDragRowHeight: 42,
|
|
402
440
|
columnConfigPanelMaxHeight: null,
|
|
403
441
|
configColumns: [],
|
|
404
442
|
appliedColumns: [],
|
|
@@ -459,6 +497,13 @@ export default {
|
|
|
459
497
|
columnConfigSearchActive() {
|
|
460
498
|
return String(this.columnConfigKeyword || "").trim() !== "";
|
|
461
499
|
},
|
|
500
|
+
columnDragGhostStyle() {
|
|
501
|
+
return {
|
|
502
|
+
width: this.columnDragGhostWidth > 0 ? this.columnDragGhostWidth + "px" : "auto",
|
|
503
|
+
transform:
|
|
504
|
+
"translate3d(" + this.columnDragGhostX + "px," + this.columnDragGhostY + "px,0)"
|
|
505
|
+
};
|
|
506
|
+
},
|
|
462
507
|
mergedHeaderCellStyle() {
|
|
463
508
|
const baseBg = this.tableHeaderBg || "#e5e9f2";
|
|
464
509
|
const base = { backgroundColor: baseBg };
|
|
@@ -978,8 +1023,12 @@ export default {
|
|
|
978
1023
|
closeColumnConfigPopover() {
|
|
979
1024
|
this.columnConfigVisible = false;
|
|
980
1025
|
this.columnConfigKeyword = "";
|
|
981
|
-
this.
|
|
1026
|
+
this.columnDragKey = "";
|
|
1027
|
+
this.columnDragStartOrderIndex = -1;
|
|
1028
|
+
this.columnDragInsertAt = -1;
|
|
982
1029
|
this.dragOverIndex = -1;
|
|
1030
|
+
this.columnDragGhostLabel = "";
|
|
1031
|
+
this.columnDragGhostWidth = 0;
|
|
983
1032
|
this.columnConfigPanelMaxHeight = null;
|
|
984
1033
|
this.removeColumnDragListeners();
|
|
985
1034
|
this.unbindColumnConfigResize();
|
|
@@ -1018,7 +1067,9 @@ export default {
|
|
|
1018
1067
|
},
|
|
1019
1068
|
onColumnConfigShow() {
|
|
1020
1069
|
this.columnConfigKeyword = "";
|
|
1021
|
-
this.
|
|
1070
|
+
this.columnDragKey = "";
|
|
1071
|
+
this.columnDragStartOrderIndex = -1;
|
|
1072
|
+
this.columnDragInsertAt = -1;
|
|
1022
1073
|
this.dragOverIndex = -1;
|
|
1023
1074
|
this.configColumns = this.cloneConfigColumnsFrom(this.appliedColumns);
|
|
1024
1075
|
},
|
|
@@ -1097,44 +1148,227 @@ export default {
|
|
|
1097
1148
|
document.removeEventListener("mouseup", this._columnDragUpHandler);
|
|
1098
1149
|
this._columnDragUpHandler = null;
|
|
1099
1150
|
}
|
|
1151
|
+
if (this._columnDragRaf && typeof window !== "undefined" && window.cancelAnimationFrame) {
|
|
1152
|
+
window.cancelAnimationFrame(this._columnDragRaf);
|
|
1153
|
+
this._columnDragRaf = null;
|
|
1154
|
+
}
|
|
1155
|
+
this._columnDragLastEvent = null;
|
|
1156
|
+
if (typeof document !== "undefined") {
|
|
1157
|
+
document.body.classList.remove("wkjp-column-dragging");
|
|
1158
|
+
document.body.style.cursor = "";
|
|
1159
|
+
document.body.style.userSelect = "";
|
|
1160
|
+
}
|
|
1100
1161
|
},
|
|
1101
|
-
|
|
1162
|
+
getVisibleDraggableOrder() {
|
|
1163
|
+
const order = [];
|
|
1164
|
+
for (let i = 0; i < this.visibleConfigIndexes.length; i++) {
|
|
1165
|
+
const idx = this.visibleConfigIndexes[i];
|
|
1166
|
+
if (this.canDragConfigIndex(idx)) order.push(idx);
|
|
1167
|
+
}
|
|
1168
|
+
return order;
|
|
1169
|
+
},
|
|
1170
|
+
getConfigIndexAfterVisibleDraggable(lastIdx) {
|
|
1171
|
+
for (let i = lastIdx + 1; i <= this.configColumns.length; i++) {
|
|
1172
|
+
if (i >= this.configColumns.length) return this.configColumns.length;
|
|
1173
|
+
const col = this.configColumns[i];
|
|
1174
|
+
if (!col) return i;
|
|
1175
|
+
if (this.isColumnDragRow(col)) return i;
|
|
1176
|
+
if (this.isFixedColumn(col)) return i;
|
|
1177
|
+
if (col._visible === false) continue;
|
|
1178
|
+
return i;
|
|
1179
|
+
}
|
|
1180
|
+
return lastIdx + 1;
|
|
1181
|
+
},
|
|
1182
|
+
/** 拖动中:计算插入槽位(order 下标 0~length,不在此阶段改 configColumns) */
|
|
1183
|
+
resolveConfigDragInsertOrderIndex(e) {
|
|
1184
|
+
const order = this.getVisibleDraggableOrder();
|
|
1185
|
+
if (!order.length) return 0;
|
|
1186
|
+
const from = this.getColumnDragCurrentIndex();
|
|
1187
|
+
const without = from >= 0 ? order.filter((idx) => idx !== from) : order.slice();
|
|
1188
|
+
if (!without.length) return 0;
|
|
1189
|
+
|
|
1190
|
+
const listEl = this.getColumnConfigSortableListEl();
|
|
1191
|
+
if (!listEl) return this.columnDragStartOrderIndex >= 0 ? this.columnDragStartOrderIndex : 0;
|
|
1192
|
+
|
|
1193
|
+
const y = e.clientY;
|
|
1194
|
+
let slotInWithout = without.length;
|
|
1195
|
+
for (let i = 0; i < without.length; i++) {
|
|
1196
|
+
const row = listEl.querySelector('[data-config-idx="' + without[i] + '"]');
|
|
1197
|
+
if (!row) continue;
|
|
1198
|
+
const rect = row.getBoundingClientRect();
|
|
1199
|
+
if (y < rect.top + rect.height / 2) {
|
|
1200
|
+
slotInWithout = i;
|
|
1201
|
+
break;
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
if (slotInWithout >= without.length) return order.length;
|
|
1206
|
+
return order.indexOf(without[slotInWithout]);
|
|
1207
|
+
},
|
|
1208
|
+
resolveConfigDragTargetIndexFromInsert(insertOrderIndex) {
|
|
1209
|
+
const order = this.getVisibleDraggableOrder();
|
|
1210
|
+
if (!order.length) return -1;
|
|
1211
|
+
const from = this.getColumnDragCurrentIndex();
|
|
1212
|
+
if (from < 0) return -1;
|
|
1213
|
+
if (insertOrderIndex >= order.length) {
|
|
1214
|
+
return this.getConfigIndexAfterVisibleDraggable(order[order.length - 1]);
|
|
1215
|
+
}
|
|
1216
|
+
return order[insertOrderIndex];
|
|
1217
|
+
},
|
|
1218
|
+
getColumnDragShiftStyle(idx) {
|
|
1219
|
+
if (!this.columnDragKey || this.columnDragInsertAt < 0) return {};
|
|
1220
|
+
const col = this.configColumns[idx];
|
|
1221
|
+
if (!col || this.isColumnDragRow(col) || !this.canDragConfigIndex(idx)) return {};
|
|
1222
|
+
|
|
1223
|
+
const order = this.getVisibleDraggableOrder();
|
|
1224
|
+
const orderIndex = order.indexOf(idx);
|
|
1225
|
+
if (orderIndex < 0) return {};
|
|
1226
|
+
|
|
1227
|
+
const dragStart = this.columnDragStartOrderIndex;
|
|
1228
|
+
const insertAt = this.columnDragInsertAt;
|
|
1229
|
+
const h = this.columnDragRowHeight || 42;
|
|
1230
|
+
let translateY = 0;
|
|
1231
|
+
|
|
1232
|
+
if (dragStart < insertAt) {
|
|
1233
|
+
if (orderIndex > dragStart && orderIndex < insertAt) translateY = -h;
|
|
1234
|
+
} else if (dragStart > insertAt) {
|
|
1235
|
+
if (orderIndex >= insertAt && orderIndex < dragStart) translateY = h;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
if (!translateY) return {};
|
|
1239
|
+
return {
|
|
1240
|
+
transform: "translate3d(0," + translateY + "px,0)"
|
|
1241
|
+
};
|
|
1242
|
+
},
|
|
1243
|
+
getColumnConfigPopperRoot() {
|
|
1244
|
+
const pop = this.$refs.columnConfigPopover;
|
|
1245
|
+
return pop && pop.popperElm ? pop.popperElm : null;
|
|
1246
|
+
},
|
|
1247
|
+
getColumnConfigSortableListEl() {
|
|
1248
|
+
const root = this.getColumnConfigPopperRoot();
|
|
1249
|
+
if (root) {
|
|
1250
|
+
return root.querySelector(".column-config-panel__list--sortable");
|
|
1251
|
+
}
|
|
1252
|
+
const ref = this.$refs.columnConfigSortableList;
|
|
1253
|
+
return ref || null;
|
|
1254
|
+
},
|
|
1255
|
+
isColumnDragRow(col) {
|
|
1256
|
+
return !!(col && this.columnDragKey && col._configKey === this.columnDragKey);
|
|
1257
|
+
},
|
|
1258
|
+
getColumnDragCurrentIndex() {
|
|
1259
|
+
if (!this.columnDragKey) return -1;
|
|
1260
|
+
for (let i = 0; i < this.configColumns.length; i++) {
|
|
1261
|
+
if (this.configColumns[i]._configKey === this.columnDragKey) return i;
|
|
1262
|
+
}
|
|
1263
|
+
return -1;
|
|
1264
|
+
},
|
|
1265
|
+
updateColumnDragGhostPosition(e) {
|
|
1266
|
+
if (!e) return;
|
|
1267
|
+
this.columnDragGhostX = e.clientX - this.columnDragGhostOffsetX;
|
|
1268
|
+
this.columnDragGhostY = e.clientY - this.columnDragGhostOffsetY;
|
|
1269
|
+
},
|
|
1270
|
+
onColumnRowMouseDown(idx, e) {
|
|
1271
|
+
if (!e || e.button !== 0) return;
|
|
1272
|
+
if (e.target.closest(".el-switch") || e.target.closest(".column-config-panel__drag")) return;
|
|
1273
|
+
if (!this.canDragConfigIndex(idx)) return;
|
|
1274
|
+
e.preventDefault();
|
|
1275
|
+
this.onDragMouseDown(idx, e);
|
|
1276
|
+
},
|
|
1277
|
+
onDragMouseDown(idx, e) {
|
|
1102
1278
|
if (!this.canDragConfigIndex(idx)) return;
|
|
1103
|
-
|
|
1279
|
+
const rowEl =
|
|
1280
|
+
e && e.currentTarget
|
|
1281
|
+
? e.currentTarget.closest("[data-config-idx]")
|
|
1282
|
+
: null;
|
|
1283
|
+
if (rowEl) {
|
|
1284
|
+
const rect = rowEl.getBoundingClientRect();
|
|
1285
|
+
this.columnDragGhostWidth = rect.width;
|
|
1286
|
+
this.columnDragGhostOffsetX = e.clientX - rect.left;
|
|
1287
|
+
this.columnDragGhostOffsetY = e.clientY - rect.top;
|
|
1288
|
+
} else {
|
|
1289
|
+
this.columnDragGhostWidth = 0;
|
|
1290
|
+
this.columnDragGhostOffsetX = 12;
|
|
1291
|
+
this.columnDragGhostOffsetY = 20;
|
|
1292
|
+
}
|
|
1293
|
+
const listEl = this.getColumnConfigSortableListEl();
|
|
1294
|
+
const listRect = listEl ? listEl.getBoundingClientRect() : null;
|
|
1295
|
+
if (listRect && listRect.width > 0) {
|
|
1296
|
+
this.columnDragGhostWidth = listRect.width;
|
|
1297
|
+
}
|
|
1298
|
+
const col = this.configColumns[idx];
|
|
1299
|
+
const order = this.getVisibleDraggableOrder();
|
|
1300
|
+
const startOrder = order.indexOf(idx);
|
|
1301
|
+
this.columnDragKey = col._configKey || "";
|
|
1302
|
+
this.columnDragStartOrderIndex = startOrder;
|
|
1303
|
+
this.columnDragInsertAt = startOrder >= 0 ? startOrder : 0;
|
|
1304
|
+
if (rowEl) {
|
|
1305
|
+
const rh = rowEl.offsetHeight || rowEl.getBoundingClientRect().height;
|
|
1306
|
+
if (rh > 0) this.columnDragRowHeight = Math.round(rh);
|
|
1307
|
+
}
|
|
1104
1308
|
this.dragOverIndex = idx;
|
|
1105
|
-
this.
|
|
1309
|
+
this.columnDragGhostLabel = this.columnConfigLabel(col);
|
|
1310
|
+
this.columnDragGhostSwitchOn = col && col._visible !== false;
|
|
1311
|
+
this.updateColumnDragGhostPosition(e);
|
|
1312
|
+
if (typeof document !== "undefined") {
|
|
1313
|
+
document.body.classList.add("wkjp-column-dragging");
|
|
1314
|
+
document.body.style.cursor = "grabbing";
|
|
1315
|
+
document.body.style.userSelect = "none";
|
|
1316
|
+
}
|
|
1317
|
+
this._columnDragMoveHandler = (ev) => this.onDragMouseMove(ev);
|
|
1106
1318
|
this._columnDragUpHandler = () => this.onDragMouseUp();
|
|
1107
1319
|
document.addEventListener("mousemove", this._columnDragMoveHandler);
|
|
1108
1320
|
document.addEventListener("mouseup", this._columnDragUpHandler);
|
|
1109
1321
|
},
|
|
1322
|
+
handleDragMouseMove(e) {
|
|
1323
|
+
if (!this.columnDragKey || !e) return;
|
|
1324
|
+
this.updateColumnDragGhostPosition(e);
|
|
1325
|
+
const insertOrder = this.resolveConfigDragInsertOrderIndex(e);
|
|
1326
|
+
if (insertOrder >= 0 && insertOrder !== this.columnDragInsertAt) {
|
|
1327
|
+
this.columnDragInsertAt = insertOrder;
|
|
1328
|
+
}
|
|
1329
|
+
},
|
|
1110
1330
|
onDragMouseMove(e) {
|
|
1111
|
-
if (this.
|
|
1112
|
-
|
|
1113
|
-
if (
|
|
1114
|
-
const
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1331
|
+
if (!this.columnDragKey) return;
|
|
1332
|
+
this._columnDragLastEvent = e;
|
|
1333
|
+
if (this._columnDragRaf) return;
|
|
1334
|
+
const schedule =
|
|
1335
|
+
typeof window !== "undefined" && window.requestAnimationFrame
|
|
1336
|
+
? window.requestAnimationFrame.bind(window)
|
|
1337
|
+
: function (fn) {
|
|
1338
|
+
return setTimeout(fn, 16);
|
|
1339
|
+
};
|
|
1340
|
+
this._columnDragRaf = schedule(() => {
|
|
1341
|
+
this._columnDragRaf = null;
|
|
1342
|
+
this.handleDragMouseMove(this._columnDragLastEvent);
|
|
1343
|
+
});
|
|
1119
1344
|
},
|
|
1120
1345
|
onDragMouseUp() {
|
|
1346
|
+
const from = this.getColumnDragCurrentIndex();
|
|
1347
|
+
const insertOrder = this.columnDragInsertAt;
|
|
1348
|
+
const targetIdx =
|
|
1349
|
+
insertOrder >= 0 ? this.resolveConfigDragTargetIndexFromInsert(insertOrder) : -1;
|
|
1121
1350
|
this.removeColumnDragListeners();
|
|
1122
|
-
if (
|
|
1123
|
-
this.
|
|
1124
|
-
this.dragOverIndex >= 0 &&
|
|
1125
|
-
this.dragFromIndex !== this.dragOverIndex
|
|
1126
|
-
) {
|
|
1127
|
-
this.moveConfigColumnByIndex(this.dragFromIndex, this.dragOverIndex);
|
|
1351
|
+
if (from >= 0 && targetIdx >= 0 && targetIdx !== from) {
|
|
1352
|
+
this.moveConfigColumnByIndex(from, targetIdx);
|
|
1128
1353
|
}
|
|
1129
|
-
this.
|
|
1354
|
+
this.columnDragKey = "";
|
|
1355
|
+
this.columnDragStartOrderIndex = -1;
|
|
1356
|
+
this.columnDragInsertAt = -1;
|
|
1130
1357
|
this.dragOverIndex = -1;
|
|
1358
|
+
this.columnDragGhostLabel = "";
|
|
1359
|
+
this.columnDragGhostWidth = 0;
|
|
1131
1360
|
},
|
|
1132
1361
|
moveConfigColumnByIndex(from, to) {
|
|
1362
|
+
if (from === to) return;
|
|
1133
1363
|
const cols = this.configColumns.slice();
|
|
1134
|
-
if (
|
|
1364
|
+
if (!cols[from] || this.isFixedColumn(cols[from])) return;
|
|
1135
1365
|
const moving = cols[from];
|
|
1136
1366
|
cols.splice(from, 1);
|
|
1137
|
-
|
|
1367
|
+
let insertAt = to;
|
|
1368
|
+
if (from < to) insertAt = to - 1;
|
|
1369
|
+
if (insertAt < 0) insertAt = 0;
|
|
1370
|
+
if (insertAt > cols.length) insertAt = cols.length;
|
|
1371
|
+
cols.splice(insertAt, 0, moving);
|
|
1138
1372
|
this.configColumns = cols;
|
|
1139
1373
|
},
|
|
1140
1374
|
applyColumnConfig() {
|
|
@@ -1418,11 +1652,15 @@ export default {
|
|
|
1418
1652
|
color: #409eff;
|
|
1419
1653
|
}
|
|
1420
1654
|
|
|
1421
|
-
/* ----------
|
|
1655
|
+
/* ---------- 列表表格(浅表头、细横线;空数据用极细外框,不用 border 网格) ---------- */
|
|
1422
1656
|
.common-list-page /deep/ .el-table {
|
|
1423
1657
|
overflow: hidden;
|
|
1424
1658
|
font-size: 12px;
|
|
1425
1659
|
color: #606266;
|
|
1660
|
+
border: none;
|
|
1661
|
+
border-radius: 2px;
|
|
1662
|
+
outline: 1px solid #ebeef5;
|
|
1663
|
+
outline-offset: -1px;
|
|
1426
1664
|
}
|
|
1427
1665
|
|
|
1428
1666
|
.common-list-page /deep/ .el-table::before,
|
|
@@ -1431,6 +1669,25 @@ export default {
|
|
|
1431
1669
|
display: none;
|
|
1432
1670
|
}
|
|
1433
1671
|
|
|
1672
|
+
.common-list-page /deep/ .el-table__empty-block {
|
|
1673
|
+
min-height: 120px;
|
|
1674
|
+
width: 100% !important;
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
.common-list-page /deep/ .el-table__fixed-right-patch {
|
|
1678
|
+
border-bottom: 1px solid #ebeef5;
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
.common-list-page /deep/ .el-table__fixed::before,
|
|
1682
|
+
.common-list-page /deep/ .el-table__fixed-right::before {
|
|
1683
|
+
background-color: #ebeef5;
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
.common-list-page /deep/ .el-table__fixed .el-table__body tr td.el-table__cell,
|
|
1687
|
+
.common-list-page /deep/ .el-table__fixed-right .el-table__body tr td.el-table__cell {
|
|
1688
|
+
border-bottom: 1px solid #f0f2f5 !important;
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1434
1691
|
.common-list-page /deep/ .el-table th.el-table__cell,
|
|
1435
1692
|
.common-list-page /deep/ .el-table td.el-table__cell {
|
|
1436
1693
|
border-right: none !important;
|
|
@@ -1441,7 +1698,7 @@ export default {
|
|
|
1441
1698
|
font-weight: 600;
|
|
1442
1699
|
font-size: 12px;
|
|
1443
1700
|
padding: 10px 12px;
|
|
1444
|
-
border-bottom: 1px solid #
|
|
1701
|
+
border-bottom: 1px solid #ebeef5 !important;
|
|
1445
1702
|
}
|
|
1446
1703
|
|
|
1447
1704
|
.common-list-page /deep/ .el-table td.el-table__cell {
|
|
@@ -1452,7 +1709,7 @@ export default {
|
|
|
1452
1709
|
}
|
|
1453
1710
|
|
|
1454
1711
|
.common-list-page /deep/ .el-table__body tr:last-child td.el-table__cell {
|
|
1455
|
-
border-bottom:
|
|
1712
|
+
border-bottom: 1px solid #f0f2f5 !important;
|
|
1456
1713
|
}
|
|
1457
1714
|
|
|
1458
1715
|
.common-list-page /deep/ .el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell {
|
|
@@ -1586,10 +1843,10 @@ export default {
|
|
|
1586
1843
|
|
|
1587
1844
|
.column-config-panel__body {
|
|
1588
1845
|
flex: 1;
|
|
1846
|
+
min-width: 0;
|
|
1589
1847
|
min-height: 0;
|
|
1848
|
+
overflow-x: hidden;
|
|
1590
1849
|
overflow-y: auto;
|
|
1591
|
-
margin-right: -4px;
|
|
1592
|
-
padding-right: 4px;
|
|
1593
1850
|
}
|
|
1594
1851
|
|
|
1595
1852
|
.column-config-panel__head {
|
|
@@ -1637,48 +1894,153 @@ export default {
|
|
|
1637
1894
|
margin: 0;
|
|
1638
1895
|
padding: 0;
|
|
1639
1896
|
list-style: none;
|
|
1897
|
+
min-width: 0;
|
|
1898
|
+
max-width: 100%;
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
.column-config-panel__list--sortable {
|
|
1902
|
+
min-width: 0;
|
|
1903
|
+
}
|
|
1904
|
+
|
|
1905
|
+
.column-config-panel__list--sortable .column-config-panel__item {
|
|
1906
|
+
transition: background-color 0.15s ease;
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
.column-config-panel__list--sortable .column-config-panel__item--shift {
|
|
1910
|
+
transition: transform 0.22s cubic-bezier(0.2, 0, 0.2, 1), background-color 0.15s ease;
|
|
1911
|
+
will-change: transform;
|
|
1640
1912
|
}
|
|
1641
1913
|
|
|
1642
1914
|
.column-config-panel__item {
|
|
1915
|
+
position: relative;
|
|
1643
1916
|
display: flex;
|
|
1644
1917
|
align-items: center;
|
|
1645
|
-
gap:
|
|
1646
|
-
min-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1918
|
+
gap: 10px;
|
|
1919
|
+
min-width: 0;
|
|
1920
|
+
max-width: 100%;
|
|
1921
|
+
min-height: 40px;
|
|
1922
|
+
padding: 0 10px;
|
|
1923
|
+
margin-bottom: 2px;
|
|
1924
|
+
border-radius: 6px;
|
|
1925
|
+
box-sizing: border-box;
|
|
1926
|
+
background: transparent;
|
|
1653
1927
|
}
|
|
1654
1928
|
|
|
1655
|
-
.column-config-panel__item--
|
|
1656
|
-
background: #
|
|
1929
|
+
.column-config-panel__item:not(.column-config-panel__item--fixed):not(.column-config-panel__item--dragging):hover {
|
|
1930
|
+
background: #f5f8fc;
|
|
1657
1931
|
}
|
|
1658
1932
|
|
|
1659
|
-
.column-config-panel__item
|
|
1660
|
-
|
|
1933
|
+
.column-config-panel__item--dragging {
|
|
1934
|
+
visibility: hidden;
|
|
1661
1935
|
}
|
|
1662
1936
|
|
|
1663
1937
|
.column-config-panel__item--fixed {
|
|
1664
1938
|
cursor: default;
|
|
1665
1939
|
}
|
|
1666
1940
|
|
|
1941
|
+
.column-config-panel__item--hidden {
|
|
1942
|
+
opacity: 0.85;
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1667
1945
|
.column-config-panel__drag {
|
|
1668
1946
|
flex-shrink: 0;
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1947
|
+
display: grid;
|
|
1948
|
+
grid-template-columns: repeat(2, 2px);
|
|
1949
|
+
grid-template-rows: repeat(3, 2px);
|
|
1950
|
+
gap: 3px;
|
|
1951
|
+
width: 7px;
|
|
1952
|
+
padding: 6px 8px 6px 2px;
|
|
1672
1953
|
cursor: grab;
|
|
1673
1954
|
touch-action: none;
|
|
1955
|
+
user-select: none;
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
.column-config-panel__drag i {
|
|
1959
|
+
display: block;
|
|
1960
|
+
width: 2px;
|
|
1961
|
+
height: 2px;
|
|
1962
|
+
border-radius: 50%;
|
|
1963
|
+
background: #b8bcc4;
|
|
1964
|
+
transition: background-color 0.15s ease;
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1967
|
+
.column-config-panel__item:hover .column-config-panel__drag i,
|
|
1968
|
+
.column-config-panel__drag:hover i {
|
|
1969
|
+
background: #909399;
|
|
1674
1970
|
}
|
|
1675
1971
|
|
|
1676
1972
|
.column-config-panel__drag:active {
|
|
1677
1973
|
cursor: grabbing;
|
|
1678
1974
|
}
|
|
1679
1975
|
|
|
1976
|
+
.column-config-panel__row-ghost {
|
|
1977
|
+
position: fixed;
|
|
1978
|
+
left: 0;
|
|
1979
|
+
top: 0;
|
|
1980
|
+
z-index: 4000;
|
|
1981
|
+
display: flex;
|
|
1982
|
+
align-items: center;
|
|
1983
|
+
gap: 10px;
|
|
1984
|
+
min-height: 40px;
|
|
1985
|
+
padding: 0 10px;
|
|
1986
|
+
box-sizing: border-box;
|
|
1987
|
+
font-size: 13px;
|
|
1988
|
+
color: #303133;
|
|
1989
|
+
background: #fff;
|
|
1990
|
+
border-radius: 6px;
|
|
1991
|
+
border: 1px solid #e8ecf2;
|
|
1992
|
+
box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
|
|
1993
|
+
pointer-events: none;
|
|
1994
|
+
cursor: grabbing;
|
|
1995
|
+
will-change: transform;
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
.column-config-panel__drag--ghost {
|
|
1999
|
+
cursor: grabbing;
|
|
2000
|
+
}
|
|
2001
|
+
|
|
2002
|
+
.column-config-panel__row-ghost .column-config-panel__label {
|
|
2003
|
+
flex: 1;
|
|
2004
|
+
min-width: 0;
|
|
2005
|
+
overflow: hidden;
|
|
2006
|
+
text-overflow: ellipsis;
|
|
2007
|
+
white-space: nowrap;
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
.column-config-panel__ghost-switch {
|
|
2011
|
+
flex-shrink: 0;
|
|
2012
|
+
position: relative;
|
|
2013
|
+
width: 36px;
|
|
2014
|
+
height: 20px;
|
|
2015
|
+
border-radius: 10px;
|
|
2016
|
+
background: #dcdfe6;
|
|
2017
|
+
transition: background-color 0.15s ease;
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
.column-config-panel__ghost-switch::after {
|
|
2021
|
+
content: "";
|
|
2022
|
+
position: absolute;
|
|
2023
|
+
top: 2px;
|
|
2024
|
+
left: 2px;
|
|
2025
|
+
width: 16px;
|
|
2026
|
+
height: 16px;
|
|
2027
|
+
border-radius: 50%;
|
|
2028
|
+
background: #fff;
|
|
2029
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
|
|
2030
|
+
transition: transform 0.15s ease;
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
.column-config-panel__ghost-switch.is-on {
|
|
2034
|
+
background: #409eff;
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
.column-config-panel__ghost-switch.is-on::after {
|
|
2038
|
+
transform: translateX(16px);
|
|
2039
|
+
}
|
|
2040
|
+
|
|
1680
2041
|
.column-config-panel__drag--placeholder {
|
|
1681
2042
|
visibility: hidden;
|
|
2043
|
+
pointer-events: none;
|
|
1682
2044
|
}
|
|
1683
2045
|
|
|
1684
2046
|
.column-config-panel__fixed-tag {
|
|
@@ -1721,14 +2083,25 @@ export default {
|
|
|
1721
2083
|
|
|
1722
2084
|
<style>
|
|
1723
2085
|
.common-list-page-column-config-popper {
|
|
1724
|
-
padding:
|
|
1725
|
-
|
|
2086
|
+
padding: 14px 16px !important;
|
|
2087
|
+
border-radius: 8px !important;
|
|
2088
|
+
box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12) !important;
|
|
1726
2089
|
z-index: 3000 !important;
|
|
1727
2090
|
overflow: hidden !important;
|
|
2091
|
+
overflow-x: hidden !important;
|
|
1728
2092
|
margin: 0 !important;
|
|
1729
2093
|
box-sizing: border-box !important;
|
|
1730
2094
|
}
|
|
1731
2095
|
|
|
2096
|
+
.common-list-page-column-config-popper .column-config-panel__row-ghost {
|
|
2097
|
+
max-width: calc(100vw - 32px);
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
.common-list-page-column-config-popper .column-config-panel__switch.el-switch {
|
|
2101
|
+
transform: scale(0.92);
|
|
2102
|
+
transform-origin: center right;
|
|
2103
|
+
}
|
|
2104
|
+
|
|
1732
2105
|
.common-list-page-column-config-popper .el-switch {
|
|
1733
2106
|
pointer-events: auto !important;
|
|
1734
2107
|
}
|
|
@@ -1743,4 +2116,13 @@ export default {
|
|
|
1743
2116
|
.common-list-page-column-config-popper .column-config-panel__switch .el-switch {
|
|
1744
2117
|
pointer-events: auto;
|
|
1745
2118
|
}
|
|
2119
|
+
|
|
2120
|
+
body.wkjp-column-dragging {
|
|
2121
|
+
cursor: grabbing !important;
|
|
2122
|
+
user-select: none !important;
|
|
2123
|
+
}
|
|
2124
|
+
|
|
2125
|
+
body.wkjp-column-dragging .column-config-panel__item--dragging {
|
|
2126
|
+
visibility: hidden !important;
|
|
2127
|
+
}
|
|
1746
2128
|
</style>
|