Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
makeColumns () {
let columns = deepCopy(this.columns);
let left = [];
let right = [];
let center = [];
columns.forEach((column, index) => {
column._index = index;
column._columnKey = columnKey++;
column._width = column.width ? column.width : ''; // update in handleResize()
column._sortType = 'normal';
column._filterVisible = false;
column._isFiltered = false;
column._filterChecked = [];
if ('filterMultiple' in column) {
column._filterMultiple = column.filterMultiple;
} else {
return {
ready: false,
tableWidth: 0,
columnsWidth: {},
prefixCls: prefixCls,
compiledUids: [],
objData: this.makeObjData(), // checkbox or highlight-row
rebuildData: [], // for sort or filter
cloneColumns: this.makeColumns(),
showSlotHeader: true,
showSlotFooter: true,
bodyHeight: 0,
bodyRealHeight: 0,
scrollBarWidth: getScrollBarSize(),
currentContext: this.context,
cloneData: deepCopy(this.data), // when Cell has a button to delete row data, clickCurrentRow will throw an error, so clone a data
isShowResizeBorder:false,
fixedTableStyle: {},
fixedRightTableStyle: {}
};
},
computed: {
this.data.forEach((row, index) => {
const newRow = deepCopy(row);// todo 直接替换
newRow._isHover = false;
if (newRow._disabled) {
newRow._isDisabled = newRow._disabled;
} else {
newRow._isDisabled = false;
}
if (newRow._checked) {
newRow._isChecked = newRow._checked;
} else {
newRow._isChecked = false;
}
if (newRow._expanded) {
newRow._isExpanded = newRow._expanded;
} else {
newRow._isExpanded = false;
}
setTimeout(() => {
this.cloneData = deepCopy(this.data);
}, 0);
},
makeData () {
let data = deepCopy(this.data);
data.forEach((row, index) => {
row._index = index;
row._rowKey = rowKey++;
});
return data;
},
makeDataWithSort () {