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
......
......@@ -58,7 +58,7 @@ export default {
}
},
methods: {
validateMax(rule, value, callback) { // 验证多选个数最大值
validateMax(rule, value, callback) { // 验证多选个数最大值
if (value.length > this.maxLength){
this.formTab.setFieldsValue({
'chooseList': this.selKeysList,
......@@ -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)
},
}
......
......@@ -44,7 +44,7 @@
</a-menu-item>
<a-menu-item key="3" v-if="$route.name == 'propertyInfo'">
<a @click="$parent.toList(record.cspId)"> 小区列表 </a>
</a-menu-item>
</a-menu-item>
<a-menu-item key="4" v-if="customKeyEnable == 'true'">
<a @click="showModal(record)"> 拓展信息维护</a>
</a-menu-item>
......@@ -132,7 +132,7 @@ export default {
this.$com.saveColumnsCookie(this.tbl, this.selKeysList, this.allKeys)
},
onSelectChange(selectedRowKeys) { // 被勾选的数据
onSelectChange(selectedRowKeys) { // 被勾选的数据
this.selectedRowKeys = selectedRowKeys
},
......@@ -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,
......@@ -211,7 +212,7 @@ export default {
this.newColumns.forEach(col => {
if(col.key == 'addrFrst'){
col.width = '30%'
}
}
})
}
})
......
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