修复社区具备两个及以上的账号登录问题

master
许宏杰 6 months ago
parent 745deb4b0e
commit 615165f276

@ -39,7 +39,7 @@ export default {
}; };
}, },
mounted() { mounted() {
this.getPie("house"); // this.getPie("house");
}, },
watch: { watch: {
queryParamsIndex: { queryParamsIndex: {
@ -48,6 +48,7 @@ export default {
this.getPie(); this.getPie();
}, },
deep: true, deep: true,
// immediate: true,
}, },
}, },
methods: { methods: {

@ -19,10 +19,18 @@ export default {
return; return;
} }
if (this.$auth.hasRole("xiaoqu")) { if (this.$auth.hasRole("xiaoqu")) {
this.$router.replace({ if (this.dept.parentId == 238) {
path: "/xiaoqu", this.$router.replace({
query: { xiaoquId: this.dept.deptId }, path: "/shequ",
}); query: { deptId: this.dept.parentId },
});
} else {
this.$router.replace({
path: "/xiaoqu",
query: { xiaoquId: this.dept.deptId },
});
}
return; return;
} }
}, },

@ -21,6 +21,9 @@
:key="dict.dept_id" :key="dict.dept_id"
:label="dict.dept_name" :label="dict.dept_name"
:value="dict.dept_id" :value="dict.dept_id"
v-show="
$route.query.deptId ? dict.dept_id == $route.query.deptId : true
"
> >
</el-option> </el-option>
</el-select> </el-select>
@ -126,20 +129,19 @@ export default {
}; };
}, },
created() { created() {},
this.getCommunity();
this.getData();
},
methods: { methods: {
getData() { getData() {
this.$store.commit("SET_QUERY_PARAMS", { this.$store.commit("SET_QUERY_PARAMS", { shequId: "", xiaoquId: "1" });
shequId: "", if (this.$route.query.deptId) {
xiaoquId: undefined, this.community = parseInt(this.$route.query.deptId);
}); this.handleChange(this.community);
this.$store.dispatch("GetYjtotal"); } else {
this.$store.dispatch("GetXiaoquInfo", this.dept.deptId); this.$store.dispatch("GetYjtotal");
this.$store.dispatch("getThreeCell"); this.$store.dispatch("GetXiaoquInfo", this.dept.deptId);
this.$store.dispatch("GetcolorList"); this.$store.dispatch("getThreeCell");
this.$store.dispatch("GetcolorList");
}
}, },
clickReset() { clickReset() {
this.community = 100; this.community = 100;
@ -186,6 +188,10 @@ export default {
this.addXiaoqu(); this.addXiaoqu();
this.addRoad(); this.addRoad();
this.addRiver(); this.addRiver();
setTimeout(() => {
this.getCommunity();
}, 1000);
}, },
zoomChange() { zoomChange() {
let level = this.map.level; let level = this.map.level;
@ -311,6 +317,13 @@ export default {
const arr = mars3d.Util.geoJsonToGraphics(res); const arr = mars3d.Util.geoJsonToGraphics(res);
arr.map((item, index) => { arr.map((item, index) => {
let id = item.attr.Id; let id = item.attr.Id;
if (
this.$route.query.deptId &&
this.$route.query.deptId != item.attr.FID
)
return;
if ( if (
id == 245 || id == 245 ||
id == 251 || id == 251 ||
@ -473,7 +486,7 @@ export default {
shequItem.centerPoint._lat shequItem.centerPoint._lat
), ),
{ {
radius: 2776.4, radius: 5500,
duration: 1, duration: 1,
complete: function () { complete: function () {
if (_this.xiaoquList.length == 0) { if (_this.xiaoquList.length == 0) {
@ -503,10 +516,14 @@ export default {
getCommunity() { getCommunity() {
let community = new Promise((resolve, reject) => { let community = new Promise((resolve, reject) => {
getCommunitylist().then((res) => { getCommunitylist().then((res) => {
res.data["社区list集合"].unshift({ if (this.$route.query.deptId) {
dept_name: "全部社区", } else {
dept_id: this.dept.deptId, res.data["社区list集合"].unshift({
}); dept_name: "全部社区",
dept_id: this.dept.deptId,
});
}
resolve(res.data["社区list集合"]); resolve(res.data["社区list集合"]);
}); });
}); });
@ -525,6 +542,7 @@ export default {
}); });
return item; return item;
}); });
this.getData();
}); });
}, },
}, },

Loading…
Cancel
Save