提交 aaad4877 编写于 作者: W wenyann 提交者: 刘瑞斌

fix: 测试计划-自定义表头,筛选功能会有问题

上级 0724f619
......@@ -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;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册