Commit cce809d1 authored by 程卓's avatar 程卓

修复自定义columns,出现xxx.xxx时 选中与否表格展示错误

parent 827e18d6
......@@ -62,9 +62,9 @@ case 'huangpu-prod':
default: // 默认环境下(开发环境)
// BASE_URL = 'http://31.0.161.39/apiv2'
// BASE_URL = 'http://211.136.105.193/apiv2'
// BASE_URL = 'http://xuhui.hm.omniview.pro/api/v2'
BASE_URL = 'http://xuhui.hm.omniview.pro/api/v2'
// BASE_URL = 'http://pudong.hm.omniview.pro/api/v2'
BASE_URL = 'http://211.136.105.193/apiv2'
// BASE_URL = 'http://211.136.105.193/apiv2'
// MOCK_URL = 'https://yapi.omniview.pro/mock/278'
break
......
......@@ -83,11 +83,21 @@ export default {
this.$emit('selKeysNew', value)
this.changeColumnsList(value)
}
},
changeColumnsList(value){ // 表格展示的列
let newArr = []
value.forEach(col => {
if(col.indexOf('&') != -1){ // 如果有& 就取xx.xx
newArr.push(col.split('&')[0] +'.'+ col.split('&')[1] )
}else{
newArr.push( col)
}
})
const arr = []
this.columns.forEach(col => { // 判断在全部字段中 是否有当前字段(有些自定义可能会被删除,就不再显示了)
if (value.indexOf(col.key) !== -1) {
if (newArr.indexOf(col.key) !== -1) {
arr.push(col)
}
})
......@@ -99,6 +109,7 @@ export default {
customRender: 'action'
}
})
this.$emit('changeColumnsList', arr)
},
}
......
......@@ -191,6 +191,7 @@ export default {
dataIndex: col.key.split('&')[0] +'.'+ col.key.split('&')[1],
key: col.key.split('&')[0] +'.'+ col.key.split('&')[1]
}, )
}else{
this.newColumns.push( {
title: col.keyName,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment