|
@@ -246,10 +246,6 @@ export default {
|
|
|
this.tableData = res.Content;
|
|
|
this.copyMain = tools.deepCopy(this.tableData);
|
|
|
this.page.total = res.Total;
|
|
|
- if (this.hot) {
|
|
|
- this.hot.destroy();
|
|
|
- this.hot = null;
|
|
|
- }
|
|
|
if (this.tableData && this.tableData.length) {
|
|
|
if (this.onlyRead) {
|
|
|
this.getBatch(this.tableData)
|
|
@@ -425,6 +421,10 @@ export default {
|
|
|
initTable() {
|
|
|
var container = document.getElementById("handsontable");
|
|
|
let winHeight = document.documentElement.clientHeight;
|
|
|
+ if (this.hot) {
|
|
|
+ this.hot.destroy();
|
|
|
+ this.hot = null;
|
|
|
+ }
|
|
|
this.hot = new Handsontable(container, {
|
|
|
data: this.tableData,
|
|
|
fixedColumnsLeft: 6,
|
|
@@ -457,8 +457,7 @@ export default {
|
|
|
afterChange: this.handleUpdataTable, //修改后
|
|
|
afterFilter: this.trimmedRows, //排序前
|
|
|
afterRemoveRow: this.handleDeleteTableRow, //右键删除
|
|
|
- afterOnCellMouseDown: this.eventClick, //鼠标点击
|
|
|
- // beforeColumnSort: this.sort
|
|
|
+ afterOnCellMouseDown: this.eventClick //鼠标点击
|
|
|
});
|
|
|
let pro = document.getElementById("hot-display-license-info");
|
|
|
if (!!pro) {
|
|
@@ -466,17 +465,6 @@ export default {
|
|
|
}
|
|
|
this.isLoading = false;
|
|
|
},
|
|
|
- // sort(currentSortConfig, destinationSortConfigs){
|
|
|
- // const columnSortPlugin = this.hot.getPlugin('columnSorting');
|
|
|
- // debugger
|
|
|
- // columnSortPlugin.setSortConfig(destinationSortConfigs);
|
|
|
- // debugger
|
|
|
- // // const newData = ... // Calculated data set, ie. from an AJAX call.
|
|
|
-
|
|
|
- // // this.loadData(newData);
|
|
|
-
|
|
|
- // return false; // The blockade for the default sort action.
|
|
|
- // },
|
|
|
//表格中的点击
|
|
|
eventClick(el, rowArr) {
|
|
|
//点击的是表头
|