fix: 测试计划-自定义表头,筛选功能会有问题
This commit is contained in:
parent
eac6d6491b
commit
38aa2cae2f
|
@ -293,7 +293,7 @@ import {
|
|||
_handleSelect,
|
||||
_handleSelectAll,
|
||||
_sort,
|
||||
buildBatchParam,
|
||||
buildBatchParam, deepClone,
|
||||
getLabel,
|
||||
getSelectDataCounts,
|
||||
initCondition,
|
||||
|
@ -429,7 +429,8 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
customHeader() {
|
||||
this.$refs.headerCustom.open(this.tableLabel)
|
||||
const list = deepClone(this.tableLabel);
|
||||
this.$refs.headerCustom.open(list);
|
||||
},
|
||||
|
||||
initTableData() {
|
||||
|
|
|
@ -176,4 +176,19 @@ export function buildBatchParam(vueObj) {
|
|||
return param;
|
||||
}
|
||||
|
||||
// 深拷贝
|
||||
export function deepClone(source) {
|
||||
if (!source && typeof source !== 'object') {
|
||||
throw new Error('error arguments', 'deepClone');
|
||||
}
|
||||
const targetObj = source.constructor === Array ? [] : {};
|
||||
Object.keys(source).forEach(keys => {
|
||||
if (source[keys] && typeof source[keys] === 'object') {
|
||||
targetObj[keys] = deepClone(source[keys]);
|
||||
} else {
|
||||
targetObj[keys] = source[keys];
|
||||
}
|
||||
});
|
||||
return targetObj;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue