Commit 1d06f28d by Sweet Zhang

地区选择框修改

parent 38fbbb9b
...@@ -10,13 +10,13 @@ export default { ...@@ -10,13 +10,13 @@ export default {
const model = { // 把后端返回过来的数据里面的键给替换成我想要的键 const model = { // 把后端返回过来的数据里面的键给替换成我想要的键
source: x, source: x,
text: x.provinceName ? x.provinceName : x.cityName, text: x.provinceName ? x.provinceName : x.cityName,
value: x.provinceId ? x.provinceId : x.cityId, value: x.cityId ? x.cityId: x.provinceId ,
}; };
const children = this.action(x.citys); // 子级数据 const children = this.action(x.citys); // 子级数据
if(children){ // 一直往下循环查找有没有children这个键,如果有就直接添加一个子级字段名,这个字段名就是存子级数据 if(children){ // 一直往下循环查找有没有children这个键,如果有就直接添加一个子级字段名,这个字段名就是存子级数据
model.children = children; model.children = children;
} }
return model; // 返回这个数据 return model; // 返回这个数据
}); });
} }
} }
\ No newline at end of file
...@@ -58,10 +58,10 @@ ...@@ -58,10 +58,10 @@
methods:{ methods:{
onchange(e) { onchange(e) {
const value = e.detail.value const value = e.detail.value
// console.log(e) console.log(e)
}, },
onnodeclick(node) { onnodeclick(node) {
// console.log(node) console.log(node)
}, },
resetParams(){ resetParams(){
this.editParamLists = JSON.parse(JSON.stringify(this.paramsLists)) this.editParamLists = JSON.parse(JSON.stringify(this.paramsLists))
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
console.log(res) console.log(res)
if(res['success']){ if(res['success']){
this.provinceList = common.action(res['data']['provinces']); this.provinceList = common.action(res['data']['provinces']);
console.log(this.provinceList)
} }
}) })
}, },
......
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