@94ai/nf-table 8.3.23 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +67 -154
- package/lib/nf-column-check-dialog.vue.d.ts +2 -2
- package/lib/nf-table.cjs.js +318 -182
- package/lib/nf-table.esm-bundler.js +320 -184
- package/lib/nf-table.vue.d.ts +12 -42
- package/lib/types.d.ts +3 -0
- package/package/nf-column-check-drawer.vue +9 -13
- package/package/nf-table.vue +303 -123
- package/package/types.ts +5 -0
- package/package.json +14 -14
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, getCurrentInstance, ref, computed, onMounted, onBeforeMount, nextTick, reactive, watch, set } from "vue-demi";
|
|
2
|
-
import { CachedManager, deepClone, resolveValue } from "@94ai/common-utils";
|
|
1
|
+
import { defineComponent, getCurrentInstance, ref, computed, onMounted, onBeforeMount, nextTick, reactive, watch, onBeforeUnmount, set } from "vue-demi";
|
|
2
|
+
import { CachedManager, deepClone, useLocale, resolveValue } from "@94ai/common-utils";
|
|
3
3
|
import { normalizeComponent as normalizeComponent$1 } from "@94ai/vue2-runtime-helpers";
|
|
4
4
|
import { Checkbox, Radio, TableColumn, Loading } from "element-ui";
|
|
5
5
|
import { getCurrentInstance as getCurrentInstance$1, effectScope, shallowReactive } from "vue";
|
|
@@ -2413,7 +2413,7 @@ var autoScroll = throttle$1(function(evt, options, rootEl2, isFallback) {
|
|
|
2413
2413
|
clearInterval(autoScrolls[layersOut].pid);
|
|
2414
2414
|
if (vx != 0 || vy != 0) {
|
|
2415
2415
|
scrollThisInstance = true;
|
|
2416
|
-
autoScrolls[layersOut].pid = setInterval(
|
|
2416
|
+
autoScrolls[layersOut].pid = setInterval(function() {
|
|
2417
2417
|
if (isFallback && this.layer === 0) {
|
|
2418
2418
|
Sortable.active._onTouchMove(touchEvt$1);
|
|
2419
2419
|
}
|
|
@@ -2425,7 +2425,7 @@ var autoScroll = throttle$1(function(evt, options, rootEl2, isFallback) {
|
|
|
2425
2425
|
}
|
|
2426
2426
|
}
|
|
2427
2427
|
scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
|
|
2428
|
-
}
|
|
2428
|
+
}.bind({
|
|
2429
2429
|
layer: layersOut
|
|
2430
2430
|
}), 24);
|
|
2431
2431
|
}
|
|
@@ -3130,9 +3130,9 @@ const require$$0 = /* @__PURE__ */ getAugmentedNamespace(sortable_esm);
|
|
|
3130
3130
|
});
|
|
3131
3131
|
if (mode & 2 && typeof value != "string")
|
|
3132
3132
|
for (var key in value)
|
|
3133
|
-
__webpack_require__.d(ns, key,
|
|
3133
|
+
__webpack_require__.d(ns, key, function(key2) {
|
|
3134
3134
|
return value[key2];
|
|
3135
|
-
}
|
|
3135
|
+
}.bind(null, key));
|
|
3136
3136
|
return ns;
|
|
3137
3137
|
};
|
|
3138
3138
|
__webpack_require__.n = function(module2) {
|
|
@@ -5412,16 +5412,12 @@ __sfc_main$1.setup = (__props, __ctx) => {
|
|
|
5412
5412
|
}
|
|
5413
5413
|
}
|
|
5414
5414
|
};
|
|
5415
|
-
const insertColumn = (column
|
|
5415
|
+
const insertColumn = (column) => {
|
|
5416
5416
|
if (!unChangedColumn.value.includes(column.prop)) {
|
|
5417
5417
|
const unFixedIndex = unFixedColumn.value.findIndex((item) => item.prop === column.prop);
|
|
5418
5418
|
const fixedIndex = fixedColumn.value.findIndex((item) => item.prop === column.prop);
|
|
5419
5419
|
if (unFixedIndex === -1 && fixedIndex === -1) {
|
|
5420
|
-
|
|
5421
|
-
(column.attr.fixed ? fixedColumn.value : unFixedColumn.value).push(column);
|
|
5422
|
-
} else {
|
|
5423
|
-
(column.attr.fixed ? fixedColumn.value : unFixedColumn.value).unshift(column);
|
|
5424
|
-
}
|
|
5420
|
+
(column.attr.fixed ? fixedColumn.value : unFixedColumn.value).push(column);
|
|
5425
5421
|
}
|
|
5426
5422
|
}
|
|
5427
5423
|
};
|
|
@@ -5473,13 +5469,17 @@ __sfc_main$1.setup = (__props, __ctx) => {
|
|
|
5473
5469
|
if (item) {
|
|
5474
5470
|
item.initHidden = false;
|
|
5475
5471
|
const cloneItem = deepClone(item);
|
|
5476
|
-
if (!cloneItem.attr) {
|
|
5477
|
-
cloneItem.attr = {};
|
|
5478
|
-
}
|
|
5479
5472
|
newColumns.push(cloneItem);
|
|
5480
5473
|
}
|
|
5481
5474
|
});
|
|
5482
5475
|
currentTable.value = newColumns;
|
|
5476
|
+
if (columnName.value) {
|
|
5477
|
+
searchValue = currentTable.value.filter((item) => {
|
|
5478
|
+
var _a2;
|
|
5479
|
+
return (_a2 = item.addLabel || item.label) == null ? void 0 : _a2.includes(columnName.value);
|
|
5480
|
+
});
|
|
5481
|
+
setFields(searchValue);
|
|
5482
|
+
}
|
|
5483
5483
|
currentTable.value.map((item) => {
|
|
5484
5484
|
if (!unChangedColumn.value.includes(item.prop)) {
|
|
5485
5485
|
if (item.attr.fixed) {
|
|
@@ -5498,7 +5498,7 @@ __sfc_main$1.setup = (__props, __ctx) => {
|
|
|
5498
5498
|
searchValue.map((item) => {
|
|
5499
5499
|
if (!unChangedColumn.value.includes(item.prop)) {
|
|
5500
5500
|
if (v) {
|
|
5501
|
-
insertColumn(item
|
|
5501
|
+
insertColumn(item);
|
|
5502
5502
|
} else {
|
|
5503
5503
|
pullAwayColumn(item);
|
|
5504
5504
|
}
|
|
@@ -5510,7 +5510,7 @@ __sfc_main$1.setup = (__props, __ctx) => {
|
|
|
5510
5510
|
currentTable.value.map((item) => {
|
|
5511
5511
|
if (!unChangedColumn.value.includes(item.prop)) {
|
|
5512
5512
|
if (v) {
|
|
5513
|
-
insertColumn(item
|
|
5513
|
+
insertColumn(item);
|
|
5514
5514
|
} else {
|
|
5515
5515
|
pullAwayColumn(item);
|
|
5516
5516
|
}
|
|
@@ -5527,7 +5527,7 @@ __sfc_main$1.setup = (__props, __ctx) => {
|
|
|
5527
5527
|
if (item.prop === prop) {
|
|
5528
5528
|
item.initHidden = !v;
|
|
5529
5529
|
v ? "" : item.attr.fixed = false;
|
|
5530
|
-
v ? insertColumn(item
|
|
5530
|
+
v ? insertColumn(item) : pullAwayColumn(item);
|
|
5531
5531
|
}
|
|
5532
5532
|
});
|
|
5533
5533
|
updateCheckStatus();
|
|
@@ -9100,8 +9100,7 @@ __sfc_main.props = {
|
|
|
9100
9100
|
selectEmptyWarningTips: {
|
|
9101
9101
|
key: "selectEmptyWarningTips",
|
|
9102
9102
|
required: false,
|
|
9103
|
-
type: String
|
|
9104
|
-
default: "请选择至少一个选项"
|
|
9103
|
+
type: String
|
|
9105
9104
|
},
|
|
9106
9105
|
columnDisplayBtnClass: {
|
|
9107
9106
|
key: "columnDisplayBtnClass",
|
|
@@ -9160,32 +9159,27 @@ __sfc_main.props = {
|
|
|
9160
9159
|
columnDisplayBtnText: {
|
|
9161
9160
|
key: "columnDisplayBtnText",
|
|
9162
9161
|
required: false,
|
|
9163
|
-
type: String
|
|
9164
|
-
default: "设置列表字段"
|
|
9162
|
+
type: String
|
|
9165
9163
|
},
|
|
9166
9164
|
columnCheckTitle: {
|
|
9167
9165
|
key: "columnCheckTitle",
|
|
9168
9166
|
required: false,
|
|
9169
|
-
type: String
|
|
9170
|
-
default: "设置显示字段"
|
|
9167
|
+
type: String
|
|
9171
9168
|
},
|
|
9172
9169
|
columnCheckCancelButtonText: {
|
|
9173
9170
|
key: "columnCheckCancelButtonText",
|
|
9174
9171
|
required: false,
|
|
9175
|
-
type: String
|
|
9176
|
-
default: "取消"
|
|
9172
|
+
type: String
|
|
9177
9173
|
},
|
|
9178
9174
|
columnCheckConfirmButtonText: {
|
|
9179
9175
|
key: "columnCheckConfirmButtonText",
|
|
9180
9176
|
required: false,
|
|
9181
|
-
type: String
|
|
9182
|
-
default: "确定"
|
|
9177
|
+
type: String
|
|
9183
9178
|
},
|
|
9184
9179
|
columnCheckBasicFieldDesc: {
|
|
9185
9180
|
key: "columnCheckBasicFieldDesc",
|
|
9186
9181
|
required: false,
|
|
9187
|
-
type: String
|
|
9188
|
-
default: "基础字段"
|
|
9182
|
+
type: String
|
|
9189
9183
|
},
|
|
9190
9184
|
columnCheckWidth: {
|
|
9191
9185
|
key: "columnCheckWidth",
|
|
@@ -9274,38 +9268,32 @@ __sfc_main.props = {
|
|
|
9274
9268
|
columnCheckSearchPlaceholder: {
|
|
9275
9269
|
key: "columnCheckSearchPlaceholder",
|
|
9276
9270
|
required: false,
|
|
9277
|
-
type: String
|
|
9278
|
-
default: "搜索"
|
|
9271
|
+
type: String
|
|
9279
9272
|
},
|
|
9280
9273
|
columnCheckFixedLeftDesc: {
|
|
9281
9274
|
key: "columnCheckFixedLeftDesc",
|
|
9282
9275
|
required: false,
|
|
9283
|
-
type: String
|
|
9284
|
-
default: "固定在左侧"
|
|
9276
|
+
type: String
|
|
9285
9277
|
},
|
|
9286
9278
|
columnCheckClearDesc: {
|
|
9287
9279
|
key: "columnCheckClearDesc",
|
|
9288
9280
|
required: false,
|
|
9289
|
-
type: String
|
|
9290
|
-
default: "清除"
|
|
9281
|
+
type: String
|
|
9291
9282
|
},
|
|
9292
9283
|
columnCheckNoFixedDesc: {
|
|
9293
9284
|
key: "columnCheckNoFixedDesc",
|
|
9294
9285
|
required: false,
|
|
9295
|
-
type: String
|
|
9296
|
-
default: "不固定"
|
|
9286
|
+
type: String
|
|
9297
9287
|
},
|
|
9298
9288
|
columnCheckGetCheckedLengthDesc: {
|
|
9299
9289
|
key: "columnCheckGetCheckedLengthDesc",
|
|
9300
9290
|
required: false,
|
|
9301
|
-
type: null
|
|
9302
|
-
default: (length) => (length2) => "已选(" + length2 + ")"
|
|
9291
|
+
type: null
|
|
9303
9292
|
},
|
|
9304
9293
|
columnCheckGetAllCheckDesc: {
|
|
9305
9294
|
key: "columnCheckGetAllCheckDesc",
|
|
9306
9295
|
required: false,
|
|
9307
|
-
type: null
|
|
9308
|
-
default: (length) => (length2) => "全选(" + length2 + ")"
|
|
9296
|
+
type: null
|
|
9309
9297
|
},
|
|
9310
9298
|
columnCheckTabs: {
|
|
9311
9299
|
key: "columnCheckTabs",
|
|
@@ -9427,7 +9415,7 @@ __sfc_main.props = {
|
|
|
9427
9415
|
}
|
|
9428
9416
|
};
|
|
9429
9417
|
__sfc_main.setup = (__props, __ctx) => {
|
|
9430
|
-
var _a;
|
|
9418
|
+
var _a, _b, _c;
|
|
9431
9419
|
const props = __props;
|
|
9432
9420
|
const emit = __ctx.emit;
|
|
9433
9421
|
const processedColumns = computed(() => {
|
|
@@ -9451,9 +9439,9 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
9451
9439
|
return {
|
|
9452
9440
|
...item.events || {},
|
|
9453
9441
|
click: (...args) => {
|
|
9454
|
-
var _a2,
|
|
9455
|
-
(_a2 = item.events) == null ? void 0 : _a2.click(args);
|
|
9456
|
-
(
|
|
9442
|
+
var _a2, _b2, _c2;
|
|
9443
|
+
(_b2 = (_a2 = item.events) == null ? void 0 : _a2.click) == null ? void 0 : _b2.call(_a2, args);
|
|
9444
|
+
(_c2 = item.onClick) == null ? void 0 : _c2.call(item, scope.row, scope);
|
|
9457
9445
|
}
|
|
9458
9446
|
};
|
|
9459
9447
|
};
|
|
@@ -9472,8 +9460,30 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
9472
9460
|
const elTableHeight = ref();
|
|
9473
9461
|
const nfColumCheckDialogVisible = ref(false);
|
|
9474
9462
|
const preSearchFormData = ref({});
|
|
9475
|
-
const cPageChangeSearchApi = ref(props.pageChangeSearchApi
|
|
9476
|
-
const cInitSearchApi = ref(props.initSearchApi
|
|
9463
|
+
const cPageChangeSearchApi = ref((_b = props.pageChangeSearchApi) != null ? _b : props.setEasyConf);
|
|
9464
|
+
const cInitSearchApi = ref((_c = props.initSearchApi) != null ? _c : props.setEasyConf);
|
|
9465
|
+
const {
|
|
9466
|
+
t
|
|
9467
|
+
} = useLocale();
|
|
9468
|
+
const localeText = computed(() => ({
|
|
9469
|
+
emptyText: props.emptyText || t("nf.table.emptyText"),
|
|
9470
|
+
columnDisplayBtnText: props.columnDisplayBtnText || t("nf.table.columnDisplayBtnText"),
|
|
9471
|
+
columnCheckTitle: props.columnCheckTitle || t("nf.table.columnCheckTitle"),
|
|
9472
|
+
columnCheckCancelButtonText: props.columnCheckCancelButtonText || t("nf.table.cancel"),
|
|
9473
|
+
columnCheckConfirmButtonText: props.columnCheckConfirmButtonText || t("nf.table.confirm"),
|
|
9474
|
+
columnCheckSearchPlaceholder: props.columnCheckSearchPlaceholder || t("nf.table.searchPlaceholder"),
|
|
9475
|
+
columnCheckFixedLeftDesc: props.columnCheckFixedLeftDesc || t("nf.table.fixedLeft"),
|
|
9476
|
+
columnCheckClearDesc: props.columnCheckClearDesc || t("nf.table.clear"),
|
|
9477
|
+
columnCheckNoFixedDesc: props.columnCheckNoFixedDesc || t("nf.table.noFixed"),
|
|
9478
|
+
columnCheckBasicFieldDesc: props.columnCheckBasicFieldDesc || t("nf.table.basicField"),
|
|
9479
|
+
selectEmptyWarningTips: props.selectEmptyWarningTips || t("nf.table.selectEmptyWarning"),
|
|
9480
|
+
columnCheckGetCheckedLengthDesc: props.columnCheckGetCheckedLengthDesc || ((length) => t("nf.table.checkedLength", {
|
|
9481
|
+
length
|
|
9482
|
+
})),
|
|
9483
|
+
columnCheckGetAllCheckDesc: props.columnCheckGetAllCheckDesc || ((length) => t("nf.table.allCheck", {
|
|
9484
|
+
length
|
|
9485
|
+
}))
|
|
9486
|
+
}));
|
|
9477
9487
|
const cStorageKey = computed(() => {
|
|
9478
9488
|
const key = props.storageKey || `nf-table-columns-cached-key-${routeName.value}`;
|
|
9479
9489
|
const userId = window.userId;
|
|
@@ -9482,52 +9492,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
9482
9492
|
}
|
|
9483
9493
|
return key;
|
|
9484
9494
|
});
|
|
9485
|
-
const cStorageKeyViewIdentity = computed(() => {
|
|
9486
|
-
return "nf-table-view-identity";
|
|
9487
|
-
});
|
|
9488
9495
|
const checkViewIdentityChange = async () => {
|
|
9489
|
-
const userId = window.userId;
|
|
9490
|
-
const viewField = window.viewField;
|
|
9491
|
-
if (props.viewIdentity && userId && viewField) {
|
|
9492
|
-
let viewIdentity = CachedManager.syncCachedGet(cStorageKeyViewIdentity.value);
|
|
9493
|
-
if (!viewIdentity) {
|
|
9494
|
-
viewIdentity = await CachedManager.asyncCachedGet(cStorageKeyViewIdentity.value);
|
|
9495
|
-
}
|
|
9496
|
-
if (!viewIdentity) {
|
|
9497
|
-
await CachedManager.asyncCachedSet(cStorageKeyViewIdentity.value, viewField);
|
|
9498
|
-
} else {
|
|
9499
|
-
const newViewIdentity = viewField.find((item) => item.viewIdentity === props.viewIdentity);
|
|
9500
|
-
const oldViewIdentity = viewIdentity.find((item) => item.viewIdentity === props.viewIdentity);
|
|
9501
|
-
if (newViewIdentity && !oldViewIdentity || !newViewIdentity && oldViewIdentity) {
|
|
9502
|
-
await clearColumnEditCached();
|
|
9503
|
-
await clearDragCached();
|
|
9504
|
-
} else if (newViewIdentity && oldViewIdentity) {
|
|
9505
|
-
let change = false;
|
|
9506
|
-
newViewIdentity.fieldList.every((item) => {
|
|
9507
|
-
if (!oldViewIdentity.fieldList.includes(item)) {
|
|
9508
|
-
change = true;
|
|
9509
|
-
return;
|
|
9510
|
-
}
|
|
9511
|
-
return true;
|
|
9512
|
-
});
|
|
9513
|
-
if (!change) {
|
|
9514
|
-
oldViewIdentity.fieldList.every((item) => {
|
|
9515
|
-
if (!newViewIdentity.fieldList.includes(item)) {
|
|
9516
|
-
change = true;
|
|
9517
|
-
return;
|
|
9518
|
-
}
|
|
9519
|
-
return true;
|
|
9520
|
-
});
|
|
9521
|
-
}
|
|
9522
|
-
if (change) {
|
|
9523
|
-
await clearColumnEditCached();
|
|
9524
|
-
await clearDragCached();
|
|
9525
|
-
oldViewIdentity.fieldList = newViewIdentity.fieldList;
|
|
9526
|
-
await CachedManager.asyncCachedSet(cStorageKeyViewIdentity.value, viewIdentity);
|
|
9527
|
-
}
|
|
9528
|
-
}
|
|
9529
|
-
}
|
|
9530
|
-
}
|
|
9531
9496
|
};
|
|
9532
9497
|
const cPageAttrs = reactive({
|
|
9533
9498
|
// 页码,没有props时 & 允许分页时;默认 = 1
|
|
@@ -9571,7 +9536,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
9571
9536
|
watch(() => {
|
|
9572
9537
|
return props.loading || tableLoading.value;
|
|
9573
9538
|
}, async () => {
|
|
9574
|
-
var _a2,
|
|
9539
|
+
var _a2, _b2;
|
|
9575
9540
|
if (props.loading || tableLoading.value) {
|
|
9576
9541
|
await nextTick();
|
|
9577
9542
|
const {
|
|
@@ -9593,7 +9558,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
9593
9558
|
customClass
|
|
9594
9559
|
});
|
|
9595
9560
|
} else {
|
|
9596
|
-
(
|
|
9561
|
+
(_b2 = loadingInstance.value) == null ? void 0 : _b2.close();
|
|
9597
9562
|
}
|
|
9598
9563
|
}, {
|
|
9599
9564
|
immediate: true
|
|
@@ -9603,9 +9568,9 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
9603
9568
|
props.columns._skip = true;
|
|
9604
9569
|
}
|
|
9605
9570
|
const result = processedColumns.value.filter((item) => {
|
|
9606
|
-
var _a2,
|
|
9571
|
+
var _a2, _b2;
|
|
9607
9572
|
const prop = item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop);
|
|
9608
|
-
if ((
|
|
9573
|
+
if ((_b2 = props.showColumn) == null ? void 0 : _b2.includes(prop)) {
|
|
9609
9574
|
item.initHidden = false;
|
|
9610
9575
|
}
|
|
9611
9576
|
return !item.initHidden;
|
|
@@ -9639,11 +9604,11 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
9639
9604
|
if (props.columnEdit) {
|
|
9640
9605
|
const columnState = {};
|
|
9641
9606
|
processedColumns.value.map((i, index2) => {
|
|
9642
|
-
var _a2,
|
|
9607
|
+
var _a2, _b2;
|
|
9643
9608
|
const prop = i.prop || ((_a2 = i.attr) == null ? void 0 : _a2.prop);
|
|
9644
9609
|
columnState[prop] = {
|
|
9645
9610
|
initHidden: i.initHidden || false,
|
|
9646
|
-
fixed: ((
|
|
9611
|
+
fixed: ((_b2 = i.attr) == null ? void 0 : _b2.fixed) || false,
|
|
9647
9612
|
prop,
|
|
9648
9613
|
index: index2
|
|
9649
9614
|
};
|
|
@@ -9654,9 +9619,9 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
9654
9619
|
const syncShowItemToInitHidden = () => {
|
|
9655
9620
|
props.columns._skip = true;
|
|
9656
9621
|
processedColumns.value.forEach((item) => {
|
|
9657
|
-
var _a2,
|
|
9622
|
+
var _a2, _b2;
|
|
9658
9623
|
const prop = item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop);
|
|
9659
|
-
if ((
|
|
9624
|
+
if ((_b2 = localShowColumn.value) == null ? void 0 : _b2.includes(prop)) {
|
|
9660
9625
|
item.initHidden = false;
|
|
9661
9626
|
} else {
|
|
9662
9627
|
item.initHidden = true;
|
|
@@ -9693,7 +9658,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
9693
9658
|
}
|
|
9694
9659
|
};
|
|
9695
9660
|
const initCachedData = async () => {
|
|
9696
|
-
var _a2,
|
|
9661
|
+
var _a2, _b2;
|
|
9697
9662
|
if (props.columnEdit) {
|
|
9698
9663
|
try {
|
|
9699
9664
|
await checkViewIdentityChange();
|
|
@@ -9704,7 +9669,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
9704
9669
|
const cachedPriority = props.priority === "cached";
|
|
9705
9670
|
if (cachedPriority ? cached : (_a2 = localShowColumn.value) == null ? void 0 : _a2.length) {
|
|
9706
9671
|
cachedPriority ? await syncCookiesToLocalShowColumn() : await syncLocalShowColumnToCookies();
|
|
9707
|
-
} else if (cachedPriority ? (
|
|
9672
|
+
} else if (cachedPriority ? (_b2 = localShowColumn.value) == null ? void 0 : _b2.length : cached) {
|
|
9708
9673
|
cachedPriority ? await syncLocalShowColumnToCookies() : await syncCookiesToLocalShowColumn();
|
|
9709
9674
|
}
|
|
9710
9675
|
} catch (e) {
|
|
@@ -9716,6 +9681,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
9716
9681
|
}
|
|
9717
9682
|
};
|
|
9718
9683
|
const getMinWidth = (column) => {
|
|
9684
|
+
var _a2, _b2;
|
|
9719
9685
|
const columnLabel = resolveValue(column.label);
|
|
9720
9686
|
if ((columnLabel == null ? void 0 : columnLabel.indexOf("$$")) === 0) {
|
|
9721
9687
|
const value = Number(columnLabel.replace("$$", ""));
|
|
@@ -9723,13 +9689,55 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
9723
9689
|
return value;
|
|
9724
9690
|
}
|
|
9725
9691
|
}
|
|
9726
|
-
const
|
|
9727
|
-
const
|
|
9728
|
-
const
|
|
9729
|
-
const
|
|
9730
|
-
const
|
|
9731
|
-
const
|
|
9732
|
-
return
|
|
9692
|
+
const label = columnLabel || "";
|
|
9693
|
+
const sortable = column.sortable || ((_a2 = column.attr) == null ? void 0 : _a2.sortable);
|
|
9694
|
+
const hasColumnCheckIcon = props.columnEdit && column.prop === props.operationPropKey && props.columnPosition === "embed";
|
|
9695
|
+
const labelWidth = (hasColumnCheckIcon ? measureText(` ${label} `, "600 14px") + 33 : measureText(sortable ? `${label} ` : label, "600 14px")) + CELL_PADDING + (sortable ? 24 : 0);
|
|
9696
|
+
const tags = [...getTagTexts(column), ...((_b2 = column.fit) == null ? void 0 : _b2.tags) || []];
|
|
9697
|
+
const tagWidth = Math.max(0, ...tags.map((tag) => measureText(` ${tag}`, "12px") + 26 + CELL_PADDING));
|
|
9698
|
+
return Math.ceil(Math.max(labelWidth, tagWidth, column.__contentWidth || 0));
|
|
9699
|
+
};
|
|
9700
|
+
const CELL_PADDING = 20;
|
|
9701
|
+
let measureContext = null;
|
|
9702
|
+
let fontFamily = "";
|
|
9703
|
+
const measureText = (text, font) => {
|
|
9704
|
+
measureContext = measureContext || document.createElement("canvas").getContext("2d");
|
|
9705
|
+
fontFamily = fontFamily || getComputedStyle(document.body).fontFamily;
|
|
9706
|
+
measureContext.font = `${font} ${fontFamily}`;
|
|
9707
|
+
return measureContext.measureText(String(text)).width;
|
|
9708
|
+
};
|
|
9709
|
+
const getTagTexts = (column) => {
|
|
9710
|
+
const tagMap = column.optionsTag || {};
|
|
9711
|
+
return Object.keys(tagMap).filter((key) => tagMap[key]).map((key) => {
|
|
9712
|
+
var _a2;
|
|
9713
|
+
return (_a2 = column.optionsEnum) == null ? void 0 : _a2[key];
|
|
9714
|
+
});
|
|
9715
|
+
};
|
|
9716
|
+
const applyColumnWidth = (item, dragProp) => {
|
|
9717
|
+
if (!item.label || item.type)
|
|
9718
|
+
return;
|
|
9719
|
+
const attr = item.attr;
|
|
9720
|
+
const raw = item.__rawWidth || (item.__rawWidth = {});
|
|
9721
|
+
const applied = item.__appliedWidth || {};
|
|
9722
|
+
if (attr.width !== applied.width)
|
|
9723
|
+
raw.width = attr.width;
|
|
9724
|
+
if (attr["min-width"] !== applied.minWidth)
|
|
9725
|
+
raw.minWidth = attr["min-width"];
|
|
9726
|
+
const need = getMinWidth(item);
|
|
9727
|
+
set(attr, "min-width", Math.max(parseFloat(raw.minWidth) || 0, need) + "px");
|
|
9728
|
+
if (raw.width) {
|
|
9729
|
+
set(attr, "width", Math.max(parseFloat(raw.width) || 0, need) + "px");
|
|
9730
|
+
}
|
|
9731
|
+
if (props.dragCached) {
|
|
9732
|
+
const columnWidth = CachedManager.syncCachedGet(`${cStorageKey.value}$drag-column-width`) || {};
|
|
9733
|
+
if (columnWidth[dragProp]) {
|
|
9734
|
+
set(attr, "width", columnWidth[dragProp]);
|
|
9735
|
+
}
|
|
9736
|
+
}
|
|
9737
|
+
item.__appliedWidth = {
|
|
9738
|
+
width: attr.width,
|
|
9739
|
+
minWidth: attr["min-width"]
|
|
9740
|
+
};
|
|
9733
9741
|
};
|
|
9734
9742
|
const tableColumns = ref([]);
|
|
9735
9743
|
const elTableRefKey = ref(Date.now());
|
|
@@ -9738,16 +9746,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
9738
9746
|
const columns = processedColumns.value.map((item, index2) => {
|
|
9739
9747
|
var _a2;
|
|
9740
9748
|
const attr = item.attr || {};
|
|
9741
|
-
|
|
9742
|
-
attr["min-width"] = String(getMinWidth(item)) + "px";
|
|
9743
|
-
}
|
|
9744
|
-
if (props.dragCached) {
|
|
9745
|
-
const prop = item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop);
|
|
9746
|
-
let columnWidth = CachedManager.syncCachedGet(`${cStorageKey.value}$drag-column-width`) || {};
|
|
9747
|
-
if (columnWidth[prop]) {
|
|
9748
|
-
attr.width = columnWidth[prop];
|
|
9749
|
-
}
|
|
9750
|
-
}
|
|
9749
|
+
const dragProp = item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop);
|
|
9751
9750
|
item.attr = {
|
|
9752
9751
|
...item.attr,
|
|
9753
9752
|
...attr
|
|
@@ -9766,6 +9765,11 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
9766
9765
|
item.optionsEnum[o.value] = o.label;
|
|
9767
9766
|
item.optionsTag[o.value] = o.tagType;
|
|
9768
9767
|
});
|
|
9768
|
+
props.columns._skip = true;
|
|
9769
|
+
applyColumnWidth(item, dragProp);
|
|
9770
|
+
nextTick(() => {
|
|
9771
|
+
props.columns._skip = false;
|
|
9772
|
+
});
|
|
9769
9773
|
});
|
|
9770
9774
|
} else if (item.options) {
|
|
9771
9775
|
set(item, "optionsEnum", {});
|
|
@@ -9774,6 +9778,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
9774
9778
|
item.optionsTag[o.value] = o.tagType;
|
|
9775
9779
|
});
|
|
9776
9780
|
}
|
|
9781
|
+
applyColumnWidth(item, dragProp);
|
|
9777
9782
|
return item;
|
|
9778
9783
|
});
|
|
9779
9784
|
if (readCached && props.columnEdit) {
|
|
@@ -9788,26 +9793,40 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
9788
9793
|
if (typeof columnState === "string") {
|
|
9789
9794
|
columnState = JSON.parse(columnState);
|
|
9790
9795
|
}
|
|
9796
|
+
let maxIndex = 0;
|
|
9791
9797
|
for (const key in columnState) {
|
|
9792
9798
|
const state = columnState[key];
|
|
9793
9799
|
columns.every((i) => {
|
|
9794
9800
|
if (i.prop === key) {
|
|
9795
9801
|
i.initHidden = state.initHidden;
|
|
9796
|
-
i.attr
|
|
9797
|
-
fixed: state.fixed
|
|
9798
|
-
};
|
|
9802
|
+
i.attr["fixed"] = state.fixed;
|
|
9799
9803
|
i._index = state.index;
|
|
9804
|
+
if (maxIndex < state.index) {
|
|
9805
|
+
maxIndex = state.index;
|
|
9806
|
+
}
|
|
9800
9807
|
return false;
|
|
9801
9808
|
}
|
|
9802
9809
|
return true;
|
|
9803
9810
|
});
|
|
9804
9811
|
}
|
|
9812
|
+
const columnStateKeys = Object.keys(columnState);
|
|
9813
|
+
columns.forEach((item) => {
|
|
9814
|
+
if (!columnStateKeys.includes(item.prop)) {
|
|
9815
|
+
maxIndex++;
|
|
9816
|
+
item._index = maxIndex;
|
|
9817
|
+
}
|
|
9818
|
+
});
|
|
9819
|
+
const optItem = columns.find((itemOpt) => itemOpt.prop === props.operationPropKey);
|
|
9820
|
+
if (optItem) {
|
|
9821
|
+
maxIndex++;
|
|
9822
|
+
optItem._index = maxIndex++;
|
|
9823
|
+
}
|
|
9805
9824
|
}
|
|
9806
9825
|
} catch (e) {
|
|
9807
9826
|
console.log(e);
|
|
9808
9827
|
}
|
|
9809
9828
|
}
|
|
9810
|
-
tableColumns.value = columns.sort((a, b) => a._index - b._index
|
|
9829
|
+
tableColumns.value = columns.sort((a, b) => a._index - b._index);
|
|
9811
9830
|
nextTick(() => {
|
|
9812
9831
|
props.columns._skip = false;
|
|
9813
9832
|
});
|
|
@@ -9892,7 +9911,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
9892
9911
|
}
|
|
9893
9912
|
};
|
|
9894
9913
|
const showPage = computed(() => {
|
|
9895
|
-
return
|
|
9914
|
+
return props.data.length > props.pageAttrs["page-size"];
|
|
9896
9915
|
});
|
|
9897
9916
|
const renderPage = computed(() => {
|
|
9898
9917
|
return props.alwaysShowPage || showPage.value;
|
|
@@ -9962,8 +9981,8 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
9962
9981
|
(_a2 = elTableRef.value) == null ? void 0 : _a2.clearFilter();
|
|
9963
9982
|
};
|
|
9964
9983
|
const doLayout = () => {
|
|
9965
|
-
var _a2,
|
|
9966
|
-
(
|
|
9984
|
+
var _a2, _b2;
|
|
9985
|
+
(_b2 = (_a2 = elTableRef.value) == null ? void 0 : _a2.doLayout) == null ? void 0 : _b2.call(_a2);
|
|
9967
9986
|
};
|
|
9968
9987
|
const sort2 = (prop, order) => {
|
|
9969
9988
|
var _a2;
|
|
@@ -9977,10 +9996,124 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
9977
9996
|
...item.style || {}
|
|
9978
9997
|
};
|
|
9979
9998
|
};
|
|
9999
|
+
const fitOperationColumn = () => {
|
|
10000
|
+
const table = elTableRef.value;
|
|
10001
|
+
const config = tableColumns.value.find((item) => item.prop === props.operationPropKey);
|
|
10002
|
+
if (!table || !config || !config.attr)
|
|
10003
|
+
return;
|
|
10004
|
+
const column = (table.store.states.columns || []).find((item) => item.property === props.operationPropKey);
|
|
10005
|
+
if (!column)
|
|
10006
|
+
return;
|
|
10007
|
+
const fixedWrapper = column.fixed === "left" || column.fixed === true ? ".el-table__fixed" : column.fixed === "right" ? ".el-table__fixed-right" : "";
|
|
10008
|
+
let cells = fixedWrapper ? [...table.$el.querySelectorAll(`${fixedWrapper} .el-table__fixed-body-wrapper td.${column.id} .cell`)] : [];
|
|
10009
|
+
if (!cells.length)
|
|
10010
|
+
cells = [...table.$el.querySelectorAll(`.el-table__body-wrapper td.${column.id} .cell`)];
|
|
10011
|
+
if (!cells.length)
|
|
10012
|
+
return;
|
|
10013
|
+
const origins = cells.map((cell) => [cell.style.whiteSpace, cell.style.width]);
|
|
10014
|
+
cells.forEach((cell) => {
|
|
10015
|
+
cell.style.whiteSpace = "nowrap";
|
|
10016
|
+
cell.style.width = "max-content";
|
|
10017
|
+
});
|
|
10018
|
+
const contentTags = ["BUTTON", "A", "I", "SVG", "IMG"];
|
|
10019
|
+
const range = document.createRange();
|
|
10020
|
+
const need = Math.max(...cells.map((cell) => {
|
|
10021
|
+
const rect = cell.getBoundingClientRect();
|
|
10022
|
+
let right = rect.left;
|
|
10023
|
+
cell.querySelectorAll("*").forEach((el) => {
|
|
10024
|
+
const tag = el.tagName.toUpperCase();
|
|
10025
|
+
if (!contentTags.includes(tag) && el.children.length)
|
|
10026
|
+
return;
|
|
10027
|
+
let box = el.getBoundingClientRect();
|
|
10028
|
+
if (!box.width)
|
|
10029
|
+
return;
|
|
10030
|
+
if (!contentTags.includes(tag) && !getComputedStyle(el).display.startsWith("inline")) {
|
|
10031
|
+
range.selectNodeContents(el);
|
|
10032
|
+
box = range.getBoundingClientRect();
|
|
10033
|
+
}
|
|
10034
|
+
right = Math.max(right, box.right);
|
|
10035
|
+
});
|
|
10036
|
+
return Math.ceil(right - rect.left + parseFloat(getComputedStyle(cell).paddingRight)) + 1;
|
|
10037
|
+
}));
|
|
10038
|
+
cells.forEach((cell, i) => {
|
|
10039
|
+
cell.style.whiteSpace = origins[i][0];
|
|
10040
|
+
cell.style.width = origins[i][1];
|
|
10041
|
+
});
|
|
10042
|
+
const current = parseFloat(config.attr.width) || column.realWidth || column.width || 0;
|
|
10043
|
+
if (need > current) {
|
|
10044
|
+
config.__contentWidth = need;
|
|
10045
|
+
props.columns._skip = true;
|
|
10046
|
+
set(config.attr, "width", need + "px");
|
|
10047
|
+
config.__appliedWidth = {
|
|
10048
|
+
...config.__appliedWidth,
|
|
10049
|
+
width: config.attr.width
|
|
10050
|
+
};
|
|
10051
|
+
nextTick(() => {
|
|
10052
|
+
props.columns._skip = false;
|
|
10053
|
+
doLayout();
|
|
10054
|
+
});
|
|
10055
|
+
}
|
|
10056
|
+
};
|
|
10057
|
+
let rowHeightObserver = null;
|
|
10058
|
+
let rowHeightFrame = 0;
|
|
10059
|
+
const syncRowHeights = () => {
|
|
10060
|
+
var _a2;
|
|
10061
|
+
rowHeightFrame = 0;
|
|
10062
|
+
const tableEl = (_a2 = elTableRef.value) == null ? void 0 : _a2.$el;
|
|
10063
|
+
if (!tableEl)
|
|
10064
|
+
return;
|
|
10065
|
+
const bodies = [tableEl.querySelector(".el-table__body-wrapper tbody"), ...tableEl.querySelectorAll(".el-table__fixed-body-wrapper tbody")].filter(Boolean);
|
|
10066
|
+
if (bodies.length < 2)
|
|
10067
|
+
return;
|
|
10068
|
+
const groups = bodies.map((body) => [...body.children].filter((tr) => tr.tagName === "TR"));
|
|
10069
|
+
if (groups.some((rows) => rows.length !== groups[0].length))
|
|
10070
|
+
return;
|
|
10071
|
+
groups.forEach((rows) => rows.forEach((tr) => {
|
|
10072
|
+
if (tr.dataset.nfRowHeight) {
|
|
10073
|
+
tr.style.height = tr.dataset.nfOriginHeight || "";
|
|
10074
|
+
delete tr.dataset.nfRowHeight;
|
|
10075
|
+
}
|
|
10076
|
+
}));
|
|
10077
|
+
const heights = groups.map((rows) => rows.map((tr) => tr.getBoundingClientRect().height));
|
|
10078
|
+
groups[0].forEach((_, i) => {
|
|
10079
|
+
const rowHeights = heights.map((list) => list[i]);
|
|
10080
|
+
const max = Math.max(...rowHeights);
|
|
10081
|
+
if (max - Math.min(...rowHeights) < 0.5)
|
|
10082
|
+
return;
|
|
10083
|
+
groups.forEach((rows) => {
|
|
10084
|
+
const tr = rows[i];
|
|
10085
|
+
tr.dataset.nfOriginHeight = tr.style.height;
|
|
10086
|
+
tr.dataset.nfRowHeight = "1";
|
|
10087
|
+
tr.style.height = max + "px";
|
|
10088
|
+
});
|
|
10089
|
+
});
|
|
10090
|
+
};
|
|
10091
|
+
const observeRowHeights = () => {
|
|
10092
|
+
var _a2;
|
|
10093
|
+
rowHeightObserver == null ? void 0 : rowHeightObserver.disconnect();
|
|
10094
|
+
rowHeightObserver = null;
|
|
10095
|
+
const tableEl = (_a2 = elTableRef.value) == null ? void 0 : _a2.$el;
|
|
10096
|
+
if (!tableEl || !window.ResizeObserver || !tableEl.querySelector(".el-table__fixed-body-wrapper"))
|
|
10097
|
+
return;
|
|
10098
|
+
rowHeightObserver = new ResizeObserver(() => {
|
|
10099
|
+
rowHeightFrame = rowHeightFrame || requestAnimationFrame(syncRowHeights);
|
|
10100
|
+
});
|
|
10101
|
+
tableEl.querySelectorAll(".el-table__body-wrapper td:not(.is-hidden) > .cell, .el-table__fixed-body-wrapper td:not(.is-hidden) > .cell").forEach((cell) => rowHeightObserver.observe(cell));
|
|
10102
|
+
};
|
|
10103
|
+
onBeforeUnmount(() => {
|
|
10104
|
+
rowHeightObserver == null ? void 0 : rowHeightObserver.disconnect();
|
|
10105
|
+
rowHeightFrame && cancelAnimationFrame(rowHeightFrame);
|
|
10106
|
+
});
|
|
10107
|
+
watch([() => props.data, elTableRefKey], () => {
|
|
10108
|
+
nextTick(() => requestAnimationFrame(() => {
|
|
10109
|
+
fitOperationColumn();
|
|
10110
|
+
observeRowHeights();
|
|
10111
|
+
}));
|
|
10112
|
+
});
|
|
9980
10113
|
const headerDragend = async (newWidth, oldWidth, column, event) => {
|
|
9981
|
-
var _a2,
|
|
10114
|
+
var _a2, _b2;
|
|
9982
10115
|
await nextTick();
|
|
9983
|
-
const minWidth = getMinWidth(column);
|
|
10116
|
+
const minWidth = getMinWidth(tableColumns.value.find((item) => item.prop === column.property) || column);
|
|
9984
10117
|
if (newWidth < minWidth) {
|
|
9985
10118
|
column.width = minWidth;
|
|
9986
10119
|
}
|
|
@@ -9990,11 +10123,15 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
9990
10123
|
await CachedManager.asyncCachedSet(`${cStorageKey.value}$drag-column-width`, columnCachedData);
|
|
9991
10124
|
}
|
|
9992
10125
|
resizeTable();
|
|
9993
|
-
await ((
|
|
10126
|
+
await ((_b2 = (_a2 = props.tableEvents)["header-dragend"]) == null ? void 0 : _b2.call(_a2, newWidth, oldWidth, column, event));
|
|
9994
10127
|
};
|
|
9995
10128
|
let opFixedRightCleanup = null;
|
|
10129
|
+
onBeforeUnmount(() => {
|
|
10130
|
+
opFixedRightCleanup == null ? void 0 : opFixedRightCleanup();
|
|
10131
|
+
opFixedRightCleanup = null;
|
|
10132
|
+
});
|
|
9996
10133
|
const initOpFixedRightResizer = async () => {
|
|
9997
|
-
var _a2,
|
|
10134
|
+
var _a2, _b2, _c2;
|
|
9998
10135
|
await nextTick();
|
|
9999
10136
|
opFixedRightCleanup == null ? void 0 : opFixedRightCleanup();
|
|
10000
10137
|
opFixedRightCleanup = null;
|
|
@@ -10008,7 +10145,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
10008
10145
|
var _a3;
|
|
10009
10146
|
return (col.prop || ((_a3 = col.attr) == null ? void 0 : _a3.prop)) === props.operationPropKey;
|
|
10010
10147
|
});
|
|
10011
|
-
if (!opCol || ((
|
|
10148
|
+
if (!opCol || ((_b2 = opCol == null ? void 0 : opCol.attr) == null ? void 0 : _b2.fixed) !== "right")
|
|
10012
10149
|
return;
|
|
10013
10150
|
const fixedRightHeader = tableEl.querySelector(".el-table__fixed-right .el-table__fixed-header-wrapper thead tr");
|
|
10014
10151
|
if (!fixedRightHeader)
|
|
@@ -10017,14 +10154,10 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
10017
10154
|
var _a3;
|
|
10018
10155
|
return ((_a3 = col == null ? void 0 : col.attr) == null ? void 0 : _a3.fixed) === "right";
|
|
10019
10156
|
});
|
|
10020
|
-
if (fixedIndex < 0)
|
|
10021
|
-
return;
|
|
10022
10157
|
const th = fixedRightHeader.querySelectorAll("th")[fixedIndex];
|
|
10023
10158
|
if (!th)
|
|
10024
10159
|
return;
|
|
10025
10160
|
const fixedRightRoot = tableEl.querySelector(".el-table__fixed-right");
|
|
10026
|
-
if (!fixedRightRoot)
|
|
10027
|
-
return;
|
|
10028
10161
|
const oldOverlay = fixedRightRoot.querySelector('[data-nf-fixed-right-overlay="true"]');
|
|
10029
10162
|
if (oldOverlay)
|
|
10030
10163
|
oldOverlay.remove();
|
|
@@ -10039,8 +10172,6 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
10039
10172
|
const mainHeader = tableEl.querySelector(".el-table__header-wrapper thead tr");
|
|
10040
10173
|
const cleanupHideAfter = [];
|
|
10041
10174
|
const hideNativeAfter = (el) => {
|
|
10042
|
-
if (!el)
|
|
10043
|
-
return;
|
|
10044
10175
|
el.classList.add("nf-table-hide-after");
|
|
10045
10176
|
cleanupHideAfter.push(el);
|
|
10046
10177
|
};
|
|
@@ -10064,7 +10195,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
10064
10195
|
handle.style.pointerEvents = "auto";
|
|
10065
10196
|
overlay.appendChild(handle);
|
|
10066
10197
|
let indicatorLine = null;
|
|
10067
|
-
const columnProp = opCol.prop || ((
|
|
10198
|
+
const columnProp = opCol.prop || ((_c2 = opCol.attr) == null ? void 0 : _c2.prop);
|
|
10068
10199
|
const createIndicatorLine = (rect) => {
|
|
10069
10200
|
const line = document.createElement("div");
|
|
10070
10201
|
line.id = "nf-fixed-right-indicator-line";
|
|
@@ -10086,6 +10217,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
10086
10217
|
return line;
|
|
10087
10218
|
};
|
|
10088
10219
|
let pending = false;
|
|
10220
|
+
let indicatorFrame = 0;
|
|
10089
10221
|
let cachedRect = null;
|
|
10090
10222
|
const onPointerMove = (e) => {
|
|
10091
10223
|
e.preventDefault();
|
|
@@ -10102,7 +10234,8 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
10102
10234
|
if (indicatorLine) {
|
|
10103
10235
|
if (!pending) {
|
|
10104
10236
|
pending = true;
|
|
10105
|
-
requestAnimationFrame(() => {
|
|
10237
|
+
indicatorFrame = requestAnimationFrame(() => {
|
|
10238
|
+
indicatorFrame = 0;
|
|
10106
10239
|
indicatorLine.style.display = "block";
|
|
10107
10240
|
indicatorLine.style.transform = `translateX(${dragX}px)`;
|
|
10108
10241
|
pending = false;
|
|
@@ -10110,7 +10243,11 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
10110
10243
|
}
|
|
10111
10244
|
}
|
|
10112
10245
|
};
|
|
10113
|
-
const
|
|
10246
|
+
const stopPointerDrag = () => {
|
|
10247
|
+
if (indicatorFrame)
|
|
10248
|
+
cancelAnimationFrame(indicatorFrame);
|
|
10249
|
+
indicatorFrame = 0;
|
|
10250
|
+
pending = false;
|
|
10114
10251
|
document.removeEventListener("pointermove", onPointerMove);
|
|
10115
10252
|
document.removeEventListener("pointerup", onPointerUp);
|
|
10116
10253
|
const dragMask = document.getElementById("nf-fixed-right-drag-mask");
|
|
@@ -10119,6 +10256,9 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
10119
10256
|
indicatorLine.remove();
|
|
10120
10257
|
indicatorLine = null;
|
|
10121
10258
|
}
|
|
10259
|
+
};
|
|
10260
|
+
const onPointerUp = async (e) => {
|
|
10261
|
+
stopPointerDrag();
|
|
10122
10262
|
try {
|
|
10123
10263
|
handle.releasePointerCapture && handle.releasePointerCapture(e.pointerId);
|
|
10124
10264
|
} catch {
|
|
@@ -10168,6 +10308,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
10168
10308
|
handle.addEventListener("pointerdown", onPointerDown);
|
|
10169
10309
|
opFixedRightCleanup = () => {
|
|
10170
10310
|
try {
|
|
10311
|
+
stopPointerDrag();
|
|
10171
10312
|
handle.removeEventListener("pointerdown", onPointerDown);
|
|
10172
10313
|
handle.remove();
|
|
10173
10314
|
cleanupHideAfter.forEach((el) => el.classList.remove("nf-table-hide-after"));
|
|
@@ -10222,7 +10363,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
10222
10363
|
}
|
|
10223
10364
|
};
|
|
10224
10365
|
const calcTableHeight = () => {
|
|
10225
|
-
var _a2,
|
|
10366
|
+
var _a2, _b2;
|
|
10226
10367
|
if (props.calHeight && nfTableContent.value) {
|
|
10227
10368
|
const tableContentH = (_a2 = nfTableContent.value) == null ? void 0 : _a2.offsetHeight;
|
|
10228
10369
|
const actionH = nfTableActionContainerRef.value.offsetHeight;
|
|
@@ -10231,13 +10372,13 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
10231
10372
|
elTableHeight.value = h;
|
|
10232
10373
|
}
|
|
10233
10374
|
} else {
|
|
10234
|
-
elTableHeight.value = (
|
|
10375
|
+
elTableHeight.value = (_b2 = props.tableAttrs) == null ? void 0 : _b2.height;
|
|
10235
10376
|
}
|
|
10236
10377
|
};
|
|
10237
10378
|
const searchApi = async (formData = {}, refresh = false) => {
|
|
10238
|
-
var _a2,
|
|
10239
|
-
(
|
|
10240
|
-
if (!((
|
|
10379
|
+
var _a2, _b2, _c2;
|
|
10380
|
+
(_b2 = (_a2 = props.searchFormEvents) == null ? void 0 : _a2["onSearch"]) == null ? void 0 : _b2.call(_a2, formData);
|
|
10381
|
+
if (!((_c2 = instance == null ? void 0 : instance.$listeners) == null ? void 0 : _c2.searchApi))
|
|
10241
10382
|
return;
|
|
10242
10383
|
tableLoading.value = true;
|
|
10243
10384
|
if (refresh || JSON.stringify(preSearchFormData.value) !== JSON.stringify(formData)) {
|
|
@@ -10315,15 +10456,9 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
10315
10456
|
initOpFixedRightResizer();
|
|
10316
10457
|
});
|
|
10317
10458
|
const nfTableBorder = window.nfTableBorder;
|
|
10318
|
-
const nfSearchFormModel = computed({
|
|
10319
|
-
|
|
10320
|
-
|
|
10321
|
-
return ((_a2 = nfSearchFormRef.value) == null ? void 0 : _a2.nfSearchFormModel) || {};
|
|
10322
|
-
},
|
|
10323
|
-
set: (formData) => {
|
|
10324
|
-
var _a2, _b;
|
|
10325
|
-
return (_b = (_a2 = nfSearchFormRef.value) == null ? void 0 : _a2.setNfSearchFormModel) == null ? void 0 : _b.call(_a2, formData);
|
|
10326
|
-
}
|
|
10459
|
+
const nfSearchFormModel = computed(() => {
|
|
10460
|
+
var _a2;
|
|
10461
|
+
return ((_a2 = nfSearchFormRef.value) == null ? void 0 : _a2.nfSearchFormModel) || {};
|
|
10327
10462
|
});
|
|
10328
10463
|
return Object.assign({
|
|
10329
10464
|
resolveValue,
|
|
@@ -10342,6 +10477,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
10342
10477
|
columnCheckNfDrawer,
|
|
10343
10478
|
elTableHeight,
|
|
10344
10479
|
nfColumCheckDialogVisible,
|
|
10480
|
+
localeText,
|
|
10345
10481
|
cStorageKey,
|
|
10346
10482
|
cPageAttrs,
|
|
10347
10483
|
handleSizeChange,
|
|
@@ -10517,7 +10653,7 @@ __sfc_main.components = Object.assign({
|
|
|
10517
10653
|
ColumnCheckDrawer
|
|
10518
10654
|
}, __sfc_main.components);
|
|
10519
10655
|
var _sfc_render = function render4() {
|
|
10520
|
-
var _a, _b, _c2, _d;
|
|
10656
|
+
var _a, _b, _c2, _d, _e, _f;
|
|
10521
10657
|
var _vm = this, _c = _vm._self._c;
|
|
10522
10658
|
_vm._self._setupProxy;
|
|
10523
10659
|
return _c("div", {
|
|
@@ -10531,7 +10667,7 @@ var _sfc_render = function render4() {
|
|
|
10531
10667
|
"onSearch": _vm.searchApi
|
|
10532
10668
|
}
|
|
10533
10669
|
}, "nf-search-form", _vm.searchFormAttrer, false), _vm.searchFormEvents), [_vm._l(((_a2 = _vm.nfSearchFormRef) == null ? void 0 : _a2.renderSearchFormItemOptions) || [], function(item) {
|
|
10534
|
-
var _a3, _b2, _c3, _d2,
|
|
10670
|
+
var _a3, _b2, _c3, _d2, _e2, _f2, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B;
|
|
10535
10671
|
return [((_a3 = item.tooltip) == null ? void 0 : _a3.slot) ? _vm._t(item.tooltip.slot, null, {
|
|
10536
10672
|
"slot": item.tooltip.slot
|
|
10537
10673
|
}) : _vm._e(), item.slot ? _vm._t(item.slot, null, {
|
|
@@ -10539,7 +10675,7 @@ var _sfc_render = function render4() {
|
|
|
10539
10675
|
"formData": _vm.nfSearchFormModel
|
|
10540
10676
|
}) : _vm._e(), ((_b2 = item.inputSlot) == null ? void 0 : _b2.prepend) ? _vm._t((_c3 = item.inputSlot) == null ? void 0 : _c3.prepend, null, {
|
|
10541
10677
|
"slot": (_d2 = item.inputSlot) == null ? void 0 : _d2.prepend
|
|
10542
|
-
}) : _vm._e(), ((
|
|
10678
|
+
}) : _vm._e(), ((_e2 = item.inputSlot) == null ? void 0 : _e2.append) ? _vm._t((_f2 = item.inputSlot) == null ? void 0 : _f2.append, null, {
|
|
10543
10679
|
"slot": (_g = item.inputSlot) == null ? void 0 : _g.append
|
|
10544
10680
|
}) : _vm._e(), ((_h = item.inputSlot) == null ? void 0 : _h.suffix) ? _vm._t((_i = item.inputSlot) == null ? void 0 : _i.suffix, null, {
|
|
10545
10681
|
"slot": (_j = item.inputSlot) == null ? void 0 : _j.suffix
|
|
@@ -10586,7 +10722,7 @@ var _sfc_render = function render4() {
|
|
|
10586
10722
|
_vm.nfColumCheckDialogVisible = true;
|
|
10587
10723
|
}
|
|
10588
10724
|
}
|
|
10589
|
-
}, [_vm._v(" " + _vm._s(_vm.columnDisplayBtnText) + " ")])];
|
|
10725
|
+
}, [_vm._v(" " + _vm._s(_vm.localeText.columnDisplayBtnText) + " ")])];
|
|
10590
10726
|
}) : _vm._e(), !_vm.virtualized ? _c("el-table", _vm._g(_vm._b({
|
|
10591
10727
|
key: _vm.elTableRefKey,
|
|
10592
10728
|
ref: "elTableRef",
|
|
@@ -10596,7 +10732,7 @@ var _sfc_render = function render4() {
|
|
|
10596
10732
|
},
|
|
10597
10733
|
attrs: {
|
|
10598
10734
|
"data": _vm.showData,
|
|
10599
|
-
"fit": ((_b = _vm.tableAttrer) == null ? void 0 : _b.fit)
|
|
10735
|
+
"fit": (_c2 = (_b = _vm.tableAttrer) == null ? void 0 : _b.fit) != null ? _c2 : true,
|
|
10600
10736
|
"height": _vm.elTableHeight
|
|
10601
10737
|
}
|
|
10602
10738
|
}, "el-table", _vm.tableAttrer, false), _vm.tableEventer), [_vm._l(_vm.tableColumns, function(column) {
|
|
@@ -10643,7 +10779,7 @@ var _sfc_render = function render4() {
|
|
|
10643
10779
|
"popper-class": "actionTooltipRef",
|
|
10644
10780
|
"placement": "top",
|
|
10645
10781
|
"effect": "dark",
|
|
10646
|
-
"content": _vm.columnDisplayBtnText
|
|
10782
|
+
"content": _vm.localeText.columnDisplayBtnText
|
|
10647
10783
|
}
|
|
10648
10784
|
}, [_c("i", {
|
|
10649
10785
|
staticClass: "iconfont icon-liebiao_xianshiliemu operation-icon-column-check",
|
|
@@ -10725,7 +10861,7 @@ var _sfc_render = function render4() {
|
|
|
10725
10861
|
attrs: {
|
|
10726
10862
|
"slot": "empty",
|
|
10727
10863
|
"image-size": _vm.emptyImageSize,
|
|
10728
|
-
"description": _vm.emptyText
|
|
10864
|
+
"description": _vm.localeText.emptyText
|
|
10729
10865
|
},
|
|
10730
10866
|
slot: "empty"
|
|
10731
10867
|
})];
|
|
@@ -10742,11 +10878,11 @@ var _sfc_render = function render4() {
|
|
|
10742
10878
|
ref: "elTableRef",
|
|
10743
10879
|
class: {
|
|
10744
10880
|
"nf-table-container": true,
|
|
10745
|
-
"nf-default-table-border": !_vm.nfTableBorder && !((
|
|
10881
|
+
"nf-default-table-border": !_vm.nfTableBorder && !((_d = _vm.tableAttrs) == null ? void 0 : _d.border)
|
|
10746
10882
|
},
|
|
10747
10883
|
attrs: {
|
|
10748
10884
|
"data": _vm.tableData,
|
|
10749
|
-
"fit": ((
|
|
10885
|
+
"fit": (_f = (_e = _vm.tableAttrer) == null ? void 0 : _e.fit) != null ? _f : true,
|
|
10750
10886
|
"height": _vm.elTableHeight
|
|
10751
10887
|
}
|
|
10752
10888
|
}, "el-table", _vm.tableAttrer, false), _vm.tableEventer), [_vm._l(_vm.tableColumns, function(column) {
|
|
@@ -10800,7 +10936,7 @@ var _sfc_render = function render4() {
|
|
|
10800
10936
|
"popper-class": "actionTooltipRef",
|
|
10801
10937
|
"placement": "top",
|
|
10802
10938
|
"effect": "dark",
|
|
10803
|
-
"content": _vm.columnDisplayBtnText
|
|
10939
|
+
"content": _vm.localeText.columnDisplayBtnText
|
|
10804
10940
|
}
|
|
10805
10941
|
}, [_c("i", {
|
|
10806
10942
|
staticClass: "iconfont icon-liebiao_xianshiliemu operation-icon-column-check",
|
|
@@ -10882,7 +11018,7 @@ var _sfc_render = function render4() {
|
|
|
10882
11018
|
attrs: {
|
|
10883
11019
|
"slot": "empty",
|
|
10884
11020
|
"image-size": _vm.emptyImageSize,
|
|
10885
|
-
"description": _vm.emptyText
|
|
11021
|
+
"description": _vm.localeText.emptyText
|
|
10886
11022
|
},
|
|
10887
11023
|
slot: "empty"
|
|
10888
11024
|
})];
|
|
@@ -10894,7 +11030,7 @@ var _sfc_render = function render4() {
|
|
|
10894
11030
|
}, [_vm._t("actionBar", function() {
|
|
10895
11031
|
var _a2;
|
|
10896
11032
|
return [((_a2 = _vm.actionBarOptList) == null ? void 0 : _a2.length) && !_vm.hasActionBarSlot ? [_vm._l(_vm.actionBarOptList, function(item, index2) {
|
|
10897
|
-
var _a3, _b2, _c3, _d2,
|
|
11033
|
+
var _a3, _b2, _c3, _d2, _e2, _f2, _g, _h, _i, _j;
|
|
10898
11034
|
return [item.element === "el-button" ? _c("nf-button", _vm._g({
|
|
10899
11035
|
key: item.key || index2,
|
|
10900
11036
|
class: _vm.resolveValue(item.class),
|
|
@@ -11169,9 +11305,9 @@ var _sfc_render = function render4() {
|
|
|
11169
11305
|
"slot": "prefix"
|
|
11170
11306
|
}) : _vm._e(), ((_d2 = item.slot) == null ? void 0 : _d2.suffix) ? _vm._t(item.slot.suffix, null, {
|
|
11171
11307
|
"slot": "suffix"
|
|
11172
|
-
}) : _vm._e(), ((
|
|
11308
|
+
}) : _vm._e(), ((_e2 = item.slot) == null ? void 0 : _e2.prepend) ? _vm._t(item.slot.prepend, null, {
|
|
11173
11309
|
"slot": "prepend"
|
|
11174
|
-
}) : _vm._e(), ((
|
|
11310
|
+
}) : _vm._e(), ((_f2 = item.slot) == null ? void 0 : _f2.append) ? _vm._t(item.slot.append, null, {
|
|
11175
11311
|
"slot": "append"
|
|
11176
11312
|
}) : _vm._e()], 2) : _vm._e(), item.element === "el-autocomplete" ? _c("el-autocomplete", _vm._g({
|
|
11177
11313
|
key: item.key || index2,
|
|
@@ -11282,10 +11418,10 @@ var _sfc_render = function render4() {
|
|
|
11282
11418
|
})], 2)], 2), _vm.nfColumCheckDialogVisible && _vm.checkMode === "dialog" ? _c("column-check-dialog", {
|
|
11283
11419
|
ref: "columnCheckDialog",
|
|
11284
11420
|
attrs: {
|
|
11285
|
-
"title": _vm.columnCheckTitle,
|
|
11286
|
-
"confirm-text": _vm.columnCheckConfirmButtonText,
|
|
11287
|
-
"cancel-text": _vm.columnCheckCancelButtonText,
|
|
11288
|
-
"basic-field-desc": _vm.columnCheckBasicFieldDesc,
|
|
11421
|
+
"title": _vm.localeText.columnCheckTitle,
|
|
11422
|
+
"confirm-text": _vm.localeText.columnCheckConfirmButtonText,
|
|
11423
|
+
"cancel-text": _vm.localeText.columnCheckCancelButtonText,
|
|
11424
|
+
"basic-field-desc": _vm.localeText.columnCheckBasicFieldDesc,
|
|
11289
11425
|
"show": _vm.nfColumCheckDialogVisible,
|
|
11290
11426
|
"table-columns": _vm.processedColumns,
|
|
11291
11427
|
"column-edit": _vm.columnEdit,
|
|
@@ -11319,9 +11455,9 @@ var _sfc_render = function render4() {
|
|
|
11319
11455
|
})], 2) : _vm._e(), _vm.checkMode === "drawer" ? _c("nf-drawer", _vm._b({
|
|
11320
11456
|
ref: "columnCheckNfDrawer",
|
|
11321
11457
|
attrs: {
|
|
11322
|
-
"title": _vm.columnCheckTitle,
|
|
11323
|
-
"cancel-button-text": _vm.columnCheckCancelButtonText,
|
|
11324
|
-
"confirm-button-text": _vm.columnCheckConfirmButtonText,
|
|
11458
|
+
"title": _vm.localeText.columnCheckTitle,
|
|
11459
|
+
"cancel-button-text": _vm.localeText.columnCheckCancelButtonText,
|
|
11460
|
+
"confirm-button-text": _vm.localeText.columnCheckConfirmButtonText,
|
|
11325
11461
|
"size": "680px",
|
|
11326
11462
|
"visible": _vm.nfColumCheckDialogVisible,
|
|
11327
11463
|
"tabs": _vm.columnCheckTabs,
|
|
@@ -11343,14 +11479,14 @@ var _sfc_render = function render4() {
|
|
|
11343
11479
|
}), _c("column-check-drawer", {
|
|
11344
11480
|
ref: "columnCheckDrawer",
|
|
11345
11481
|
attrs: {
|
|
11346
|
-
"search-placeholder": _vm.columnCheckSearchPlaceholder,
|
|
11347
|
-
"fixed-left-desc": _vm.columnCheckFixedLeftDesc,
|
|
11348
|
-
"clear-desc": _vm.columnCheckClearDesc,
|
|
11349
|
-
"no-fixed-desc": _vm.columnCheckNoFixedDesc,
|
|
11350
|
-
"basic-field-desc": _vm.columnCheckBasicFieldDesc,
|
|
11351
|
-
"select-empty-warning-tips": _vm.selectEmptyWarningTips,
|
|
11352
|
-
"get-checked-length-desc": _vm.columnCheckGetCheckedLengthDesc,
|
|
11353
|
-
"get-all-check-desc": _vm.columnCheckGetAllCheckDesc,
|
|
11482
|
+
"search-placeholder": _vm.localeText.columnCheckSearchPlaceholder,
|
|
11483
|
+
"fixed-left-desc": _vm.localeText.columnCheckFixedLeftDesc,
|
|
11484
|
+
"clear-desc": _vm.localeText.columnCheckClearDesc,
|
|
11485
|
+
"no-fixed-desc": _vm.localeText.columnCheckNoFixedDesc,
|
|
11486
|
+
"basic-field-desc": _vm.localeText.columnCheckBasicFieldDesc,
|
|
11487
|
+
"select-empty-warning-tips": _vm.localeText.selectEmptyWarningTips,
|
|
11488
|
+
"get-checked-length-desc": _vm.localeText.columnCheckGetCheckedLengthDesc,
|
|
11489
|
+
"get-all-check-desc": _vm.localeText.columnCheckGetAllCheckDesc,
|
|
11354
11490
|
"column-edit": _vm.columnEdit,
|
|
11355
11491
|
"operation-prop-key": _vm.operationPropKey,
|
|
11356
11492
|
"storage-key": _vm.cStorageKey,
|