mooho-base-admin-plus 2.10.41 → 2.10.43
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
CHANGED
|
@@ -90,14 +90,14 @@
|
|
|
90
90
|
:parent-data="data"
|
|
91
91
|
@on-change="(row, sender, selected) => onDataChange(column, null, row, sender, selected)"
|
|
92
92
|
>
|
|
93
|
-
<template #
|
|
93
|
+
<template #top>
|
|
94
94
|
<!--
|
|
95
95
|
@slot 内嵌表格筛选栏按钮
|
|
96
96
|
@binding {object} table 表格对象
|
|
97
97
|
@binding {object} tableColumn 表格列对象
|
|
98
98
|
@binding {string} tableCode 表格列代码
|
|
99
99
|
-->
|
|
100
|
-
<slot name="
|
|
100
|
+
<slot name="excelTableTop" :tableColumn="column" :tableCode="column.code"></slot>
|
|
101
101
|
</template>
|
|
102
102
|
</view-table-excel>
|
|
103
103
|
</div>
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
autoWrapCol: true,
|
|
61
61
|
autoWrapRow: true,
|
|
62
62
|
manualColumnResize: true,
|
|
63
|
+
readOnly: this.readonly,
|
|
63
64
|
// columnSummary: [
|
|
64
65
|
// {
|
|
65
66
|
// sourceColumn: 2,
|
|
@@ -69,7 +70,7 @@
|
|
|
69
70
|
// }
|
|
70
71
|
// ],
|
|
71
72
|
// minSpareRows: 1,
|
|
72
|
-
contextMenu: { items: {} },
|
|
73
|
+
contextMenu: this.readonly ? false : { items: {} },
|
|
73
74
|
licenseKey: 'non-commercial-and-evaluation'
|
|
74
75
|
},
|
|
75
76
|
coords: {},
|
|
@@ -221,9 +222,7 @@
|
|
|
221
222
|
controlType: item.controlType
|
|
222
223
|
};
|
|
223
224
|
|
|
224
|
-
if (this.readonly) {
|
|
225
|
-
column.readOnly = true;
|
|
226
|
-
} else {
|
|
225
|
+
if (!this.readonly) {
|
|
227
226
|
if (item.controlType === 'Label' || item.isReadonly == true) {
|
|
228
227
|
column.readOnly = true;
|
|
229
228
|
} else if (item.controlType === 'NumberInput') {
|
|
@@ -433,85 +432,87 @@
|
|
|
433
432
|
// });
|
|
434
433
|
// }
|
|
435
434
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
this.
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
435
|
+
if (!this.readonly) {
|
|
436
|
+
// 右键菜单 新增
|
|
437
|
+
if (this.tableView.createEnable) {
|
|
438
|
+
this.hotSetting.contextMenu.items.row_above = { name: '上方插入行' };
|
|
439
|
+
this.hotSetting.contextMenu.items.row_below = { name: '下方插入行' };
|
|
440
|
+
this.hotSetting.contextMenu.items.separator1 = ContextMenu.SEPARATOR;
|
|
441
|
+
}
|
|
442
442
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
443
|
+
// 右键菜单 调整
|
|
444
|
+
if (this.tableView.adjustEnable) {
|
|
445
|
+
this.hotSetting.contextMenu.items.move_up = {
|
|
446
|
+
name: '整行上移',
|
|
447
|
+
callback: (key, selection, clickEvent) => {
|
|
448
|
+
let index = selection[0].start.row;
|
|
449
|
+
if (index > 0) {
|
|
450
|
+
let data = this.$refs.table.hotInstance.getSourceData();
|
|
451
|
+
let delRows = data.splice(index, 1);
|
|
452
|
+
data.splice(index - 1, 0, delRows[0]);
|
|
453
|
+
this.$refs.table.hotInstance.loadData(data);
|
|
454
|
+
}
|
|
454
455
|
}
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
456
|
+
};
|
|
457
|
+
this.hotSetting.contextMenu.items.move_down = {
|
|
458
|
+
name: '整行下移',
|
|
459
|
+
callback: (key, selection, clickEvent) => {
|
|
460
|
+
let index = selection[0].start.row;
|
|
461
|
+
let data = this.$refs.table.hotInstance.getSourceData();
|
|
462
|
+
if (index < data.length - 1) {
|
|
463
|
+
let delRows = data.splice(index, 1);
|
|
464
|
+
data.splice(index + 1, 0, delRows[0]);
|
|
465
|
+
this.$refs.table.hotInstance.loadData(data);
|
|
466
|
+
}
|
|
466
467
|
}
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
}
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
470
|
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
471
|
+
// 右键菜单 删除
|
|
472
|
+
if (this.tableView.removeEnable) {
|
|
473
|
+
this.hotSetting.contextMenu.items.remove_row = {
|
|
474
|
+
name: '整行删除',
|
|
475
|
+
callback: (key, selection, clickEvent) => {
|
|
476
|
+
let delArr = [];
|
|
477
|
+
let ids = [];
|
|
478
|
+
let rows = [];
|
|
479
479
|
|
|
480
|
-
|
|
480
|
+
let data = this.$refs.table.hotInstance.getSourceData();
|
|
481
481
|
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
482
|
+
for (const sels of selection) {
|
|
483
|
+
let startRowIndex = sels.start.row;
|
|
484
|
+
let endRowIndex = sels.end.row;
|
|
485
485
|
|
|
486
|
-
|
|
486
|
+
delArr.push([startRowIndex, endRowIndex - startRowIndex + 1]);
|
|
487
487
|
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
488
|
+
for (let i = startRowIndex; i <= endRowIndex; i++) {
|
|
489
|
+
rows.push(i);
|
|
490
|
+
}
|
|
491
491
|
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
492
|
+
for (let i = startRowIndex; i < endRowIndex; i++) {
|
|
493
|
+
if (data[i].id) {
|
|
494
|
+
ids.push(data[i].id);
|
|
495
|
+
}
|
|
495
496
|
}
|
|
496
497
|
}
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
this.confirm('确定要删除该行吗?', async () => {
|
|
500
|
-
// if (ids.length > 0) {
|
|
501
|
-
// await modelApi.delete(this.viewCode, ids);
|
|
502
|
-
// }
|
|
503
|
-
let b = true;
|
|
504
498
|
|
|
505
|
-
this
|
|
506
|
-
|
|
499
|
+
this.confirm('确定要删除该行吗?', async () => {
|
|
500
|
+
// if (ids.length > 0) {
|
|
501
|
+
// await modelApi.delete(this.viewCode, ids);
|
|
502
|
+
// }
|
|
503
|
+
let b = true;
|
|
504
|
+
|
|
505
|
+
this.$emit('on-remove', rows, val => {
|
|
506
|
+
b = val;
|
|
507
|
+
});
|
|
508
|
+
console.log(b);
|
|
509
|
+
if (b) {
|
|
510
|
+
this.$refs.table.hotInstance.alter('remove_row', delArr);
|
|
511
|
+
}
|
|
507
512
|
});
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
}
|
|
512
|
-
});
|
|
513
|
-
}
|
|
514
|
-
};
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
}
|
|
515
516
|
}
|
|
516
517
|
|
|
517
518
|
// 变更事件
|
|
@@ -633,14 +634,8 @@
|
|
|
633
634
|
let column = this.columns[j];
|
|
634
635
|
let value = this.parseData(row, column.code);
|
|
635
636
|
|
|
636
|
-
if (column.slot != 'normal') {
|
|
637
|
-
continue;
|
|
638
|
-
}
|
|
639
|
-
|
|
640
637
|
// 不显示的不验证
|
|
641
|
-
if (
|
|
642
|
-
continue;
|
|
643
|
-
} else if (column.isShow == false) {
|
|
638
|
+
if (column.isShow == false) {
|
|
644
639
|
continue;
|
|
645
640
|
}
|
|
646
641
|
|