|
@@ -20,6 +20,7 @@ const addr = {
|
|
selectCity: {},
|
|
selectCity: {},
|
|
selectDistrict: {},
|
|
selectDistrict: {},
|
|
selectStreet: {},
|
|
selectStreet: {},
|
|
|
|
+ selectAddr: '贵州省',
|
|
// 获取小班边界地图
|
|
// 获取小班边界地图
|
|
smallClassMapArr: []
|
|
smallClassMapArr: []
|
|
},
|
|
},
|
|
@@ -52,6 +53,30 @@ const addr = {
|
|
changeSelectStreet(state, streetData) {
|
|
changeSelectStreet(state, streetData) {
|
|
state.selectStreet = streetData;
|
|
state.selectStreet = streetData;
|
|
},
|
|
},
|
|
|
|
+ changeSelectAddr(state, mapLevel) {
|
|
|
|
+ console.log('mapLevelmapLevel', mapLevel);
|
|
|
|
+ switch (mapLevel) {
|
|
|
|
+ case 'province':
|
|
|
|
+ state.selectAddr = '贵州省';
|
|
|
|
+ break;
|
|
|
|
+ case 'city':
|
|
|
|
+ state.selectAddr = `贵州省 · ${state.selectCity.label}`;
|
|
|
|
+ break;
|
|
|
|
+
|
|
|
|
+ case 'district':
|
|
|
|
+ state.selectAddr = `贵州省 · ${state.selectCity.label} · ${state.selectDistrict.label}`;
|
|
|
|
+ break;
|
|
|
|
+
|
|
|
|
+ case 'treet':
|
|
|
|
+ state.selectAddr = `贵州省 · ${state.selectCity.label} · ${state.selectDistrict.label} · ${state.selectStreet.label}`;
|
|
|
|
+ break;
|
|
|
|
+
|
|
|
|
+ default:
|
|
|
|
+ state.selectAddr = '贵州省';
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ // state.selectAddr = streetData;
|
|
|
|
+ },
|
|
// 改变省市县级联选择获取数据
|
|
// 改变省市县级联选择获取数据
|
|
changeParentId(state, n) {
|
|
changeParentId(state, n) {
|
|
state.parentId = n.parentId;
|
|
state.parentId = n.parentId;
|
|
@@ -73,6 +98,7 @@ const addr = {
|
|
|
|
|
|
commit("changeSelectDistrict", {});
|
|
commit("changeSelectDistrict", {});
|
|
commit("changeSelectStreet", {});
|
|
commit("changeSelectStreet", {});
|
|
|
|
+
|
|
} else if (params.mapLevel == "district") {
|
|
} else if (params.mapLevel == "district") {
|
|
commit("changeStreetList", res.data);
|
|
commit("changeStreetList", res.data);
|
|
commit("changeSelectStreet", {});
|
|
commit("changeSelectStreet", {});
|
|
@@ -82,7 +108,8 @@ const addr = {
|
|
commit("changeSelectDistrict", {});
|
|
commit("changeSelectDistrict", {});
|
|
commit("changeSelectStreet", {});
|
|
commit("changeSelectStreet", {});
|
|
}
|
|
}
|
|
- commit("changeParentId", params)
|
|
|
|
|
|
+ commit("changeParentId", params);
|
|
|
|
+ commit("changeSelectAddr", params.mapLevel);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
// 获取小班边界
|
|
// 获取小班边界
|