@94ai/nf-table 100.1.8 → 100.1.15
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 +136 -136
- package/lib/nf-column-check-dialog.vue.d.ts +28 -19
- package/lib/nf-column-check-drawer.vue.d.ts +37 -29
- package/lib/nf-table.cjs.js +183 -109
- package/lib/nf-table.esm-bundler.js +184 -110
- package/lib/nf-table.vue.d.ts +50 -50
- package/package/index.ts +0 -7
- package/package/nf-column-check-dialog.vue +31 -10
- package/package/nf-column-check-drawer.vue +11 -6
- package/package/nf-table.vue +85 -57
- package/package.json +8 -8
package/lib/nf-table.cjs.js
CHANGED
|
@@ -1,15 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const vueDemi = require("vue-demi");
|
|
4
|
-
const commonUtils = require("@94ai/common-utils");
|
|
5
4
|
const vue2RuntimeHelpers = require("@94ai/vue2-runtime-helpers");
|
|
5
|
+
const commonUtils = require("@94ai/common-utils");
|
|
6
6
|
const elementUi = require("element-ui");
|
|
7
|
-
const VueCookies = require("vue-cookies");
|
|
8
7
|
const NfMessage = require("@94ai/nf-message");
|
|
8
|
+
function promisifyRequest(request) {
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
|
+
request.oncomplete = request.onsuccess = () => resolve(request.result);
|
|
11
|
+
request.onabort = request.onerror = () => reject(request.error);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function createStore(dbName, storeName) {
|
|
15
|
+
const request = indexedDB.open(dbName);
|
|
16
|
+
request.onupgradeneeded = () => request.result.createObjectStore(storeName);
|
|
17
|
+
const dbp = promisifyRequest(request);
|
|
18
|
+
return (txMode, callback) => dbp.then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));
|
|
19
|
+
}
|
|
20
|
+
let defaultGetStoreFunc;
|
|
21
|
+
function defaultGetStore() {
|
|
22
|
+
if (!defaultGetStoreFunc) {
|
|
23
|
+
defaultGetStoreFunc = createStore("keyval-store", "keyval");
|
|
24
|
+
}
|
|
25
|
+
return defaultGetStoreFunc;
|
|
26
|
+
}
|
|
27
|
+
function get(key, customStore = defaultGetStore()) {
|
|
28
|
+
return customStore("readonly", (store) => promisifyRequest(store.get(key)));
|
|
29
|
+
}
|
|
30
|
+
function set(key, value, customStore = defaultGetStore()) {
|
|
31
|
+
return customStore("readwrite", (store) => {
|
|
32
|
+
store.put(value, key);
|
|
33
|
+
return promisifyRequest(store.transaction);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function del(key, customStore = defaultGetStore()) {
|
|
37
|
+
return customStore("readwrite", (store) => {
|
|
38
|
+
store.delete(key);
|
|
39
|
+
return promisifyRequest(store.transaction);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
9
42
|
const __sfc_main$2 = vueDemi.defineComponent({
|
|
10
43
|
name: "NfColumnCheckDialog"
|
|
11
44
|
});
|
|
12
45
|
__sfc_main$2.props = {
|
|
46
|
+
columnEdit: {
|
|
47
|
+
key: "columnEdit",
|
|
48
|
+
required: false,
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false
|
|
51
|
+
},
|
|
52
|
+
operationPropKey: {
|
|
53
|
+
key: "operationPropKey",
|
|
54
|
+
required: false,
|
|
55
|
+
type: String,
|
|
56
|
+
default: "operation"
|
|
57
|
+
},
|
|
13
58
|
storageKey: {
|
|
14
59
|
key: "storageKey",
|
|
15
60
|
required: false,
|
|
@@ -52,12 +97,6 @@ __sfc_main$2.props = {
|
|
|
52
97
|
type: Array,
|
|
53
98
|
default: () => []
|
|
54
99
|
},
|
|
55
|
-
showColumn: {
|
|
56
|
-
key: "showColumn",
|
|
57
|
-
required: false,
|
|
58
|
-
type: Array,
|
|
59
|
-
default: void 0
|
|
60
|
-
},
|
|
61
100
|
modalAppendToBody: {
|
|
62
101
|
key: "modalAppendToBody",
|
|
63
102
|
required: false,
|
|
@@ -141,8 +180,9 @@ __sfc_main$2.setup = (__props, __ctx) => {
|
|
|
141
180
|
var _a;
|
|
142
181
|
const props = __props;
|
|
143
182
|
const emit = __ctx.emit;
|
|
144
|
-
|
|
183
|
+
(_a = vueDemi.getCurrentInstance()) == null ? void 0 : _a.proxy;
|
|
145
184
|
const tableData = vueDemi.ref({});
|
|
185
|
+
const unChangedColumn = vueDemi.ref([]);
|
|
146
186
|
const visible = vueDemi.computed({
|
|
147
187
|
get() {
|
|
148
188
|
return props.show;
|
|
@@ -153,7 +193,7 @@ __sfc_main$2.setup = (__props, __ctx) => {
|
|
|
153
193
|
});
|
|
154
194
|
const fields = vueDemi.computed(() => {
|
|
155
195
|
const obj = {};
|
|
156
|
-
|
|
196
|
+
props.tableColumns.filter((item) => !item.destory).map((item) => {
|
|
157
197
|
if (!item.type) {
|
|
158
198
|
const key = item.category || "基础字段";
|
|
159
199
|
if (!obj[key]) {
|
|
@@ -171,36 +211,45 @@ __sfc_main$2.setup = (__props, __ctx) => {
|
|
|
171
211
|
}
|
|
172
212
|
return fields2;
|
|
173
213
|
});
|
|
174
|
-
const submit = () => {
|
|
175
|
-
var _a2, _b;
|
|
214
|
+
const submit = async () => {
|
|
176
215
|
visible.value = false;
|
|
177
216
|
const columnState = {};
|
|
178
217
|
props.tableColumns.map((i, index2) => {
|
|
179
|
-
var
|
|
218
|
+
var _a2;
|
|
180
219
|
columnState[i.prop] = {
|
|
181
220
|
initHidden: !tableData.value[i.prop] || false,
|
|
182
|
-
fixed: ((
|
|
221
|
+
fixed: ((_a2 = i.attr) == null ? void 0 : _a2.fixed) || false,
|
|
183
222
|
prop: i.prop,
|
|
184
223
|
index: index2
|
|
185
224
|
};
|
|
186
225
|
});
|
|
187
|
-
(_a2 = instance == null ? void 0 : instance.$cookies) == null ? void 0 : _a2.remove(props.storageKey);
|
|
188
|
-
(_b = instance == null ? void 0 : instance.$cookies) == null ? void 0 : _b.set(props.storageKey, JSON.stringify(columnState), -1, "/xxxx/xxxx/xxxx");
|
|
189
226
|
emit("save", tableData.value);
|
|
227
|
+
if (props.columnEdit) {
|
|
228
|
+
await set(props.storageKey, columnState);
|
|
229
|
+
}
|
|
190
230
|
};
|
|
191
231
|
const addInitValue = () => {
|
|
192
232
|
const obj = {};
|
|
193
233
|
props.tableColumns.forEach((v) => {
|
|
194
|
-
|
|
195
|
-
obj[v.prop] = ((_a2 = props.showColumn) == null ? void 0 : _a2.length) ? (props.showColumn || []).includes(v.prop) : true;
|
|
234
|
+
obj[v.prop] = !v.initHidden;
|
|
196
235
|
});
|
|
197
236
|
tableData.value = obj;
|
|
237
|
+
if (props.tableColumns.findIndex((item) => !!item.type) > -1) {
|
|
238
|
+
unChangedColumn.value.push("selection");
|
|
239
|
+
}
|
|
240
|
+
if (props.tableColumns.findIndex((item) => {
|
|
241
|
+
var _a2;
|
|
242
|
+
return (item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop)) === props.operationPropKey;
|
|
243
|
+
}) > -1) {
|
|
244
|
+
unChangedColumn.value.push(props.operationPropKey);
|
|
245
|
+
}
|
|
198
246
|
};
|
|
199
247
|
vueDemi.onMounted(() => {
|
|
200
248
|
addInitValue();
|
|
201
249
|
});
|
|
202
250
|
return {
|
|
203
251
|
tableData,
|
|
252
|
+
unChangedColumn,
|
|
204
253
|
visible,
|
|
205
254
|
fields,
|
|
206
255
|
submit
|
|
@@ -260,7 +309,8 @@ var _sfc_render$3 = function render() {
|
|
|
260
309
|
key: obj.prop,
|
|
261
310
|
staticClass: "nf-check-box",
|
|
262
311
|
attrs: {
|
|
263
|
-
"label": obj.prop
|
|
312
|
+
"label": obj.prop,
|
|
313
|
+
"disabled": _vm.unChangedColumn.includes(obj.prop)
|
|
264
314
|
},
|
|
265
315
|
model: {
|
|
266
316
|
value: _vm.tableData[obj.prop],
|
|
@@ -5258,6 +5308,12 @@ __sfc_main$1.props = {
|
|
|
5258
5308
|
type: String,
|
|
5259
5309
|
default: "operation"
|
|
5260
5310
|
},
|
|
5311
|
+
columnEdit: {
|
|
5312
|
+
key: "columnEdit",
|
|
5313
|
+
required: false,
|
|
5314
|
+
type: Boolean,
|
|
5315
|
+
default: false
|
|
5316
|
+
},
|
|
5261
5317
|
searchPlaceholder: {
|
|
5262
5318
|
key: "searchPlaceholder",
|
|
5263
5319
|
required: false,
|
|
@@ -5421,11 +5477,11 @@ __sfc_main$1.setup = (__props, __ctx) => {
|
|
|
5421
5477
|
}
|
|
5422
5478
|
updateColumn();
|
|
5423
5479
|
};
|
|
5424
|
-
const syncTableColumnsToCookies = () => {
|
|
5425
|
-
var _a2
|
|
5480
|
+
const syncTableColumnsToCookies = async () => {
|
|
5481
|
+
var _a2;
|
|
5426
5482
|
const newTableColumns = [...fixedColumn.value, ...unFixedColumn.value];
|
|
5427
5483
|
if (newTableColumns.filter((item) => !item.type && item.prop !== props.operationPropKey && !item.initHidden).length === 0) {
|
|
5428
|
-
instance == null ? void 0 : instance.$openMessage.warning({
|
|
5484
|
+
(_a2 = instance == null ? void 0 : instance.$openMessage) == null ? void 0 : _a2.warning({
|
|
5429
5485
|
message: props.selectEmptyWarningTips,
|
|
5430
5486
|
duration: 2e3
|
|
5431
5487
|
});
|
|
@@ -5454,8 +5510,9 @@ __sfc_main$1.setup = (__props, __ctx) => {
|
|
|
5454
5510
|
};
|
|
5455
5511
|
obj[i.prop] = !columnState[i.prop].initHidden;
|
|
5456
5512
|
});
|
|
5457
|
-
|
|
5458
|
-
|
|
5513
|
+
if (props.columnEdit) {
|
|
5514
|
+
await set(props.storageKey, columnState);
|
|
5515
|
+
}
|
|
5459
5516
|
return obj;
|
|
5460
5517
|
};
|
|
5461
5518
|
const drag = vueDemi.ref(false);
|
|
@@ -6138,7 +6195,7 @@ __sfc_main.props = {
|
|
|
6138
6195
|
}
|
|
6139
6196
|
};
|
|
6140
6197
|
__sfc_main.setup = (__props, __ctx) => {
|
|
6141
|
-
var _a
|
|
6198
|
+
var _a;
|
|
6142
6199
|
const props = __props;
|
|
6143
6200
|
const emit = __ctx.emit;
|
|
6144
6201
|
const instance = (_a = vueDemi.getCurrentInstance()) == null ? void 0 : _a.proxy;
|
|
@@ -6176,7 +6233,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6176
6233
|
vueDemi.watch(() => {
|
|
6177
6234
|
return props.loading;
|
|
6178
6235
|
}, async () => {
|
|
6179
|
-
var _a2,
|
|
6236
|
+
var _a2, _b;
|
|
6180
6237
|
if (props.loading) {
|
|
6181
6238
|
await vueDemi.nextTick();
|
|
6182
6239
|
const {
|
|
@@ -6198,7 +6255,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6198
6255
|
customClass
|
|
6199
6256
|
});
|
|
6200
6257
|
} else {
|
|
6201
|
-
(
|
|
6258
|
+
(_b = loadingInstance.value) == null ? void 0 : _b.close();
|
|
6202
6259
|
}
|
|
6203
6260
|
}, {
|
|
6204
6261
|
immediate: true
|
|
@@ -6206,9 +6263,9 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6206
6263
|
const initLocalShow = () => {
|
|
6207
6264
|
props.columns._skip = true;
|
|
6208
6265
|
const result = props.columns.filter((item) => {
|
|
6209
|
-
var _a2,
|
|
6266
|
+
var _a2, _b;
|
|
6210
6267
|
const prop = item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop);
|
|
6211
|
-
if ((
|
|
6268
|
+
if ((_b = props.showColumn) == null ? void 0 : _b.includes(prop)) {
|
|
6212
6269
|
item.initHidden = false;
|
|
6213
6270
|
}
|
|
6214
6271
|
return !item.initHidden;
|
|
@@ -6216,7 +6273,9 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6216
6273
|
var _a2;
|
|
6217
6274
|
return item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop);
|
|
6218
6275
|
});
|
|
6219
|
-
|
|
6276
|
+
vueDemi.nextTick(() => {
|
|
6277
|
+
props.columns._skip = false;
|
|
6278
|
+
});
|
|
6220
6279
|
if (result.length) {
|
|
6221
6280
|
return result;
|
|
6222
6281
|
}
|
|
@@ -6234,73 +6293,84 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6234
6293
|
}, {
|
|
6235
6294
|
immediate: true
|
|
6236
6295
|
});
|
|
6237
|
-
const syncLocalShowColumnToCookies = () => {
|
|
6238
|
-
var _a2, _b2;
|
|
6296
|
+
const syncLocalShowColumnToCookies = async () => {
|
|
6239
6297
|
if (props.columnEdit) {
|
|
6240
6298
|
const columnState = {};
|
|
6241
6299
|
props.columns.map((i, index2) => {
|
|
6242
|
-
var
|
|
6243
|
-
const prop = i.prop || ((
|
|
6300
|
+
var _a2, _b;
|
|
6301
|
+
const prop = i.prop || ((_a2 = i.attr) == null ? void 0 : _a2.prop);
|
|
6244
6302
|
columnState[prop] = {
|
|
6245
6303
|
initHidden: i.initHidden || false,
|
|
6246
|
-
fixed: ((
|
|
6304
|
+
fixed: ((_b = i.attr) == null ? void 0 : _b.fixed) || false,
|
|
6247
6305
|
prop,
|
|
6248
6306
|
index: index2
|
|
6249
6307
|
};
|
|
6250
6308
|
});
|
|
6251
|
-
|
|
6252
|
-
(_b2 = instance == null ? void 0 : instance.$cookies) == null ? void 0 : _b2.set(props.storageKey, JSON.stringify(columnState), -1, "/xxxx/xxxx/xxxx");
|
|
6309
|
+
await set(props.storageKey, columnState);
|
|
6253
6310
|
}
|
|
6254
6311
|
};
|
|
6255
6312
|
const syncShowItemToInitHidden = () => {
|
|
6256
6313
|
props.columns._skip = true;
|
|
6257
6314
|
props.columns.forEach((item) => {
|
|
6258
|
-
var _a2,
|
|
6315
|
+
var _a2, _b;
|
|
6259
6316
|
const prop = item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop);
|
|
6260
|
-
if ((
|
|
6317
|
+
if ((_b = localShowColumn.value) == null ? void 0 : _b.includes(prop)) {
|
|
6261
6318
|
item.initHidden = false;
|
|
6262
6319
|
} else {
|
|
6263
6320
|
item.initHidden = true;
|
|
6264
6321
|
}
|
|
6265
6322
|
});
|
|
6266
|
-
|
|
6323
|
+
vueDemi.nextTick(() => {
|
|
6324
|
+
props.columns._skip = false;
|
|
6325
|
+
});
|
|
6267
6326
|
};
|
|
6268
|
-
const syncCookiesToLocalShowColumn = () => {
|
|
6269
|
-
var _a2;
|
|
6327
|
+
const syncCookiesToLocalShowColumn = async () => {
|
|
6270
6328
|
if (props.columnEdit) {
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
if (
|
|
6274
|
-
columnState
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6329
|
+
try {
|
|
6330
|
+
let columnState = await get(props.storageKey);
|
|
6331
|
+
if (columnState) {
|
|
6332
|
+
if (typeof columnState === "string") {
|
|
6333
|
+
columnState = JSON.parse(columnState);
|
|
6334
|
+
}
|
|
6335
|
+
const showColumnItems = [];
|
|
6336
|
+
for (const key in columnState) {
|
|
6337
|
+
if (!columnState[key].initHidden) {
|
|
6338
|
+
showColumnItems.push(columnState[key].prop);
|
|
6339
|
+
}
|
|
6280
6340
|
}
|
|
6341
|
+
localShowColumn.value = showColumnItems;
|
|
6342
|
+
syncShowItemToInitHidden();
|
|
6281
6343
|
}
|
|
6282
|
-
|
|
6283
|
-
|
|
6344
|
+
} catch (e) {
|
|
6345
|
+
console.log(e);
|
|
6284
6346
|
}
|
|
6285
6347
|
}
|
|
6286
6348
|
};
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
|
|
6349
|
+
const initCachedData = async () => {
|
|
6350
|
+
var _a2, _b;
|
|
6351
|
+
if (props.columnEdit) {
|
|
6352
|
+
try {
|
|
6353
|
+
const cached = await get(props.storageKey);
|
|
6354
|
+
const cachedPriority = props.priority === "cached";
|
|
6355
|
+
if (cachedPriority ? cached : (_a2 = localShowColumn.value) == null ? void 0 : _a2.length) {
|
|
6356
|
+
cachedPriority ? await syncCookiesToLocalShowColumn() : await syncLocalShowColumnToCookies();
|
|
6357
|
+
} else if (cachedPriority ? (_b = localShowColumn.value) == null ? void 0 : _b.length : cached) {
|
|
6358
|
+
cachedPriority ? await syncLocalShowColumnToCookies() : await syncCookiesToLocalShowColumn();
|
|
6359
|
+
}
|
|
6360
|
+
} catch (e) {
|
|
6361
|
+
console.log(e);
|
|
6362
|
+
await del(props.storageKey);
|
|
6363
|
+
}
|
|
6294
6364
|
}
|
|
6295
|
-
}
|
|
6365
|
+
};
|
|
6366
|
+
initCachedData();
|
|
6296
6367
|
const tableColumns = vueDemi.ref([]);
|
|
6297
6368
|
const elTableRefKey = vueDemi.ref(Date.now());
|
|
6298
|
-
const syncCookiesToTableColumn = (readCached = true) => {
|
|
6299
|
-
var _a2;
|
|
6369
|
+
const syncCookiesToTableColumn = async (readCached = true) => {
|
|
6300
6370
|
props.columns._skip = true;
|
|
6301
6371
|
const columns = props.columns.map((item, index2) => {
|
|
6302
|
-
var
|
|
6303
|
-
((
|
|
6372
|
+
var _a2;
|
|
6373
|
+
((_a2 = item.label) == null ? void 0 : _a2.length) || 0;
|
|
6304
6374
|
const attr = item.attr || {};
|
|
6305
6375
|
if (!attr["min-width"] && item.label) {
|
|
6306
6376
|
const fs = 14;
|
|
@@ -6319,31 +6389,40 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6319
6389
|
delete item.attr.prop;
|
|
6320
6390
|
delete item.attr.label;
|
|
6321
6391
|
item._index = index2;
|
|
6392
|
+
vueDemi.set(item, "initHidden", item.initHidden);
|
|
6393
|
+
vueDemi.set(item, "destory", item.destory);
|
|
6322
6394
|
item.__index = index2;
|
|
6323
6395
|
return item;
|
|
6324
6396
|
});
|
|
6325
6397
|
if (readCached && props.columnEdit) {
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6398
|
+
try {
|
|
6399
|
+
let columnState = await get(props.storageKey);
|
|
6400
|
+
props.columns._skip = true;
|
|
6401
|
+
if (columnState) {
|
|
6402
|
+
if (typeof columnState === "string") {
|
|
6403
|
+
columnState = JSON.parse(columnState);
|
|
6404
|
+
}
|
|
6405
|
+
for (const key in columnState) {
|
|
6406
|
+
const state = columnState[key];
|
|
6407
|
+
columns.every((i) => {
|
|
6408
|
+
if (i.prop === key) {
|
|
6409
|
+
i.initHidden = state.initHidden;
|
|
6410
|
+
i.attr ? i.attr["fixed"] = state.fixed : i.attr = {
|
|
6411
|
+
fixed: state.fixed
|
|
6412
|
+
};
|
|
6413
|
+
i._index = state.index;
|
|
6414
|
+
return false;
|
|
6415
|
+
}
|
|
6416
|
+
return true;
|
|
6417
|
+
});
|
|
6418
|
+
}
|
|
6344
6419
|
}
|
|
6420
|
+
} catch (e) {
|
|
6421
|
+
console.log(e);
|
|
6422
|
+
await del(props.storageKey);
|
|
6345
6423
|
}
|
|
6346
6424
|
}
|
|
6425
|
+
await vueDemi.nextTick();
|
|
6347
6426
|
props.columns._skip = true;
|
|
6348
6427
|
tableColumns.value = columns.sort((a, b) => a._index - b._index < 0 ? -1 : a._index - b._index > 0 ? 1 : 0);
|
|
6349
6428
|
elTableRefKey.value = Date.now();
|
|
@@ -6352,11 +6431,12 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6352
6431
|
vueDemi.onBeforeMount(() => {
|
|
6353
6432
|
vueDemi.watch(() => {
|
|
6354
6433
|
return props.columns;
|
|
6355
|
-
}, () => {
|
|
6434
|
+
}, async () => {
|
|
6356
6435
|
if (props.columns._skip) {
|
|
6357
6436
|
return;
|
|
6358
6437
|
}
|
|
6359
|
-
|
|
6438
|
+
localShowColumn.value = initLocalShow();
|
|
6439
|
+
await syncCookiesToTableColumn(false);
|
|
6360
6440
|
}, {
|
|
6361
6441
|
deep: true
|
|
6362
6442
|
});
|
|
@@ -6412,14 +6492,10 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6412
6492
|
};
|
|
6413
6493
|
});
|
|
6414
6494
|
const isShow = (row) => {
|
|
6415
|
-
var _a2;
|
|
6416
6495
|
if (row.type) {
|
|
6417
6496
|
return true;
|
|
6418
6497
|
}
|
|
6419
|
-
|
|
6420
|
-
return !row.initHidden && !row.destory;
|
|
6421
|
-
}
|
|
6422
|
-
return localShowColumn.value.includes(row.prop) && !row.initHidden && !row.destory;
|
|
6498
|
+
return !row.initHidden && !row.destory;
|
|
6423
6499
|
};
|
|
6424
6500
|
const resetNfSearchFormModel = () => {
|
|
6425
6501
|
var _a2;
|
|
@@ -6466,20 +6542,20 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6466
6542
|
(_a2 = elTableRef.value) == null ? void 0 : _a2.clearFilter();
|
|
6467
6543
|
};
|
|
6468
6544
|
const doLayout = () => {
|
|
6469
|
-
var _a2,
|
|
6470
|
-
(
|
|
6545
|
+
var _a2, _b;
|
|
6546
|
+
(_b = (_a2 = elTableRef.value) == null ? void 0 : _a2.doLayout) == null ? void 0 : _b.call(_a2);
|
|
6471
6547
|
};
|
|
6472
6548
|
const sort2 = (prop, order) => {
|
|
6473
6549
|
var _a2;
|
|
6474
6550
|
(_a2 = elTableRef.value) == null ? void 0 : _a2.sort(prop, order);
|
|
6475
6551
|
};
|
|
6476
6552
|
const headerDragend = async (newWidth, oldWidth, column, event) => {
|
|
6477
|
-
var _a2,
|
|
6553
|
+
var _a2, _b;
|
|
6478
6554
|
await vueDemi.nextTick();
|
|
6479
6555
|
if (newWidth < column.minWidth) {
|
|
6480
6556
|
column.width = column.minWidth;
|
|
6481
6557
|
}
|
|
6482
|
-
await ((
|
|
6558
|
+
await ((_b = (_a2 = props.tableEvents)["header-dragend"]) == null ? void 0 : _b.call(_a2, newWidth, oldWidth, column, event));
|
|
6483
6559
|
};
|
|
6484
6560
|
const columnCheckConfirmFeedback = (value) => {
|
|
6485
6561
|
if (!props.columnEdit) {
|
|
@@ -6493,18 +6569,18 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6493
6569
|
syncShowItemToInitHidden();
|
|
6494
6570
|
}
|
|
6495
6571
|
};
|
|
6496
|
-
const fieldsConfirm = (value) => {
|
|
6572
|
+
const fieldsConfirm = async (value) => {
|
|
6497
6573
|
columnCheckConfirmFeedback(value);
|
|
6498
|
-
syncCookiesToLocalShowColumn();
|
|
6499
|
-
syncCookiesToTableColumn();
|
|
6574
|
+
await syncCookiesToLocalShowColumn();
|
|
6575
|
+
await syncCookiesToTableColumn();
|
|
6500
6576
|
emit("fieldsChange", localShowColumn.value);
|
|
6501
6577
|
};
|
|
6502
|
-
const columnCheckConfirm = (cb, error) => {
|
|
6578
|
+
const columnCheckConfirm = async (cb, error) => {
|
|
6503
6579
|
try {
|
|
6504
|
-
const value = columnCheckDrawer.value.syncTableColumnsToCookies();
|
|
6580
|
+
const value = await columnCheckDrawer.value.syncTableColumnsToCookies();
|
|
6505
6581
|
columnCheckConfirmFeedback(value);
|
|
6506
|
-
syncCookiesToLocalShowColumn();
|
|
6507
|
-
syncCookiesToTableColumn();
|
|
6582
|
+
await syncCookiesToLocalShowColumn();
|
|
6583
|
+
await syncCookiesToTableColumn();
|
|
6508
6584
|
emit("fieldsChange", localShowColumn.value);
|
|
6509
6585
|
cb();
|
|
6510
6586
|
} catch (e) {
|
|
@@ -6513,7 +6589,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6513
6589
|
}
|
|
6514
6590
|
};
|
|
6515
6591
|
vueDemi.onMounted(() => {
|
|
6516
|
-
var _a2,
|
|
6592
|
+
var _a2, _b;
|
|
6517
6593
|
if (props.calHeight && nfTableContent.value) {
|
|
6518
6594
|
const tableContentH = (_a2 = nfTableContent.value) == null ? void 0 : _a2.offsetHeight;
|
|
6519
6595
|
const actionH = nfTableActionContainerRef.value.offsetHeight;
|
|
@@ -6522,7 +6598,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6522
6598
|
elTableHeight.value = h;
|
|
6523
6599
|
}
|
|
6524
6600
|
} else {
|
|
6525
|
-
elTableHeight.value = (
|
|
6601
|
+
elTableHeight.value = (_b = props.tableAttrs) == null ? void 0 : _b.height;
|
|
6526
6602
|
}
|
|
6527
6603
|
});
|
|
6528
6604
|
return Object.assign({
|
|
@@ -6541,7 +6617,6 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6541
6617
|
showData,
|
|
6542
6618
|
hasOperationSlot,
|
|
6543
6619
|
hasActionBarSlot,
|
|
6544
|
-
localShowColumn,
|
|
6545
6620
|
tableColumns,
|
|
6546
6621
|
elTableRefKey,
|
|
6547
6622
|
tableAttrer,
|
|
@@ -7289,7 +7364,7 @@ var _sfc_render = function render3() {
|
|
|
7289
7364
|
attrs: {
|
|
7290
7365
|
"show": _vm.nfColumCheckDialogVisible,
|
|
7291
7366
|
"table-columns": _vm.columns,
|
|
7292
|
-
"
|
|
7367
|
+
"column-edit": _vm.columnEdit,
|
|
7293
7368
|
"storage-key": _vm.storageKey,
|
|
7294
7369
|
"title": _vm.columnCheckTitle,
|
|
7295
7370
|
"width": _vm.columnCheckWidth,
|
|
@@ -7307,7 +7382,8 @@ var _sfc_render = function render3() {
|
|
|
7307
7382
|
"show-close": _vm.columnCheckShowClose,
|
|
7308
7383
|
"before-close": _vm.columnCheckBeforeClose,
|
|
7309
7384
|
"center": _vm.columnCheckCenter,
|
|
7310
|
-
"destroy-on-close": _vm.columnCheckDestroyOnClose
|
|
7385
|
+
"destroy-on-close": _vm.columnCheckDestroyOnClose,
|
|
7386
|
+
"operation-prop-key": _vm.operationPropKey
|
|
7311
7387
|
},
|
|
7312
7388
|
on: {
|
|
7313
7389
|
"update:show": function($event) {
|
|
@@ -7350,6 +7426,7 @@ var _sfc_render = function render3() {
|
|
|
7350
7426
|
"fixed-left-desc": _vm.columnCheckFixedLeftDesc,
|
|
7351
7427
|
"clear-desc": _vm.columnCheckClearDesc,
|
|
7352
7428
|
"no-fixed-desc": _vm.columnCheckNoFixedDesc,
|
|
7429
|
+
"column-edit": _vm.columnEdit,
|
|
7353
7430
|
"get-checked-length-desc": _vm.columnCheckGetCheckedLengthDesc,
|
|
7354
7431
|
"get-all-check-desc": _vm.columnCheckGetAllCheckDesc,
|
|
7355
7432
|
"operation-prop-key": _vm.operationPropKey,
|
|
@@ -7363,9 +7440,6 @@ var _sfc_staticRenderFns = [];
|
|
|
7363
7440
|
var __component__ = /* @__PURE__ */ vue2RuntimeHelpers.normalizeComponent(__sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, null, null, null);
|
|
7364
7441
|
const NfTable = __component__.exports;
|
|
7365
7442
|
NfTable.install = (app) => {
|
|
7366
|
-
if (!app.$cookies) {
|
|
7367
|
-
app.use(VueCookies);
|
|
7368
|
-
}
|
|
7369
7443
|
if (!app.$openMessage) {
|
|
7370
7444
|
app.use(NfMessage);
|
|
7371
7445
|
}
|