From 0d7720a29208770acf42f58fb12a49ea0e8060db Mon Sep 17 00:00:00 2001 From: dai <851733175@qq.com> Date: Fri, 6 May 2022 17:38:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=B8=AA=E4=BA=BA=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E8=B7=B3=E8=BD=AC=E9=80=BB=E8=BE=91=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/visual/basicinfo/people.vue | 575 +++++++++++------- .../modules/visual/basicinfo/peopleSearch.vue | 10 +- .../visual/basicinfo/personCategory/index.vue | 13 +- src/views/modules/visual/cpts/tb.vue | 6 +- 4 files changed, 363 insertions(+), 241 deletions(-) diff --git a/src/views/modules/visual/basicinfo/people.vue b/src/views/modules/visual/basicinfo/people.vue index ef34596d..c754ff01 100644 --- a/src/views/modules/visual/basicinfo/people.vue +++ b/src/views/modules/visual/basicinfo/people.vue @@ -1,16 +1,18 @@ @@ -409,7 +524,7 @@ import cptTb from "@/views/modules/visual/cpts/tb"; export default { name: "HomeMap", - data () { + data() { return { breadList: [], showedMoreInfo: false, @@ -530,68 +645,73 @@ export default { topicInfo, }, beforeRouteEnter(to, from, next) { - const arr = [ {...from }, { ...to, meta: { title: '人员图谱'}}] - next((vm) =>{ - vm.breadList = [ ...arr ] - }) + console.log("让我看看", to); + if (from) { + const arr = [{ ...from }, { ...to, meta: { title: "个人详情" } }]; + next((vm) => { + vm.breadList = [...arr]; + }); + } else { + next(); + } }, watch: { - uid (id) { + uid(id) { this.userId = id; }, - userId () { + userId() { this.getApiData(); window.scrollTo(0, 0); }, $route(route) { // if you go to the redirect page, do not update the breadcrumbs - if (route.path.startsWith('/redirect/')) { - return + if (route.path.startsWith("/redirect/")) { + return; } // this.getBreadcrumb() }, }, - async mounted () { + async mounted() { this.userId = this.uid; + console.log(this.$router); this.getApiData(); }, deactivated() { - this.breadList = [] - console.log('breadList-----', this.breadList) + this.breadList = []; + console.log("breadList-----", this.breadList); }, destroyed() { - - this.breadList = [] - console.log('breadList-----', this.breadList) + this.breadList = []; + console.log("breadList-----", this.breadList); }, methods: { getBreadcrumb() { // only show routes with meta.title - console.log('routest----', this.$route) + console.log("routest----", this.$route); let matched = this.$route.matched.filter( (item) => item.meta && item.meta.title - ) - const first = matched[0] + ); + const first = matched[0]; if (!this.isDashboard(first)) { - matched = [{ path: '/home', meta: { title: '首页' } }].concat(matched) + matched = [{ path: "/home", meta: { title: "首页" } }].concat(matched); } this.breadList = matched.filter( (item) => item.meta && item.meta.title && item.meta.breadcrumb !== false - ) + ); }, isDashboard(route) { - const name = route && route.name + const name = route && route.name; if (!name) { - return false + return false; } - return name.trim().toLocaleLowerCase() === 'Home'.toLocaleLowerCase() + return name.trim().toLocaleLowerCase() === "Home".toLocaleLowerCase(); }, - handleSearch () { }, + handleSearch() {}, - async getApiData () { + async getApiData() { await this.getInfo(); this.getHouseInfo(); this.getDemandData(); @@ -600,12 +720,12 @@ export default { this.getPointData(); }, - toUserInfo (uid) { + toUserInfo(uid) { this.$router.push({ path: `/main-shuju/visual-basicinfo-people/${uid}` }); }, //加载组织数据 - async getInfo () { + async getInfo() { const url = "/epmetuser/icresiuser/persondata"; let params = { userId: this.userId, @@ -621,7 +741,7 @@ export default { }, //加载组织数据 - async getHouseInfo () { + async getHouseInfo() { const url = "/epmetuser/icresiuser/ownerrelation"; let params = { userId: this.userId, @@ -636,12 +756,12 @@ export default { } }, - handlePageNoChangeDemand (val) { + handlePageNoChangeDemand(val) { this.demand.pageNo = val; this.getDemandData(); }, - handleOperateDemandList (index, type) { + handleOperateDemandList(index, type) { if (type == "查看") { this.showedDemandInfo = true; this.demand.currentIndex = index; @@ -649,7 +769,7 @@ export default { }, //加载组织数据 - async getDemandData () { + async getDemandData() { const url = "/heart/userdemand/mydemand"; let params = { epmetUserIdList: this.info.epmetUserIdList, @@ -679,18 +799,18 @@ export default { } }, - handlePageNoChangeIncident (val) { + handlePageNoChangeIncident(val) { this.incident.pageNo = val; this.getIncidentData(); }, - handleClickIncident (index) { + handleClickIncident(index) { this.incident.showedInfo = true; this.incident.currentIndex = index; }, //加载组织数据 - async getIncidentData () { + async getIncidentData() { const url = "/gov/project/resievent/pageuserreported"; let params = { epmetUserIdList: this.info.epmetUserIdList, @@ -710,18 +830,18 @@ export default { } }, - handlePageNoChangeTopic (val) { + handlePageNoChangeTopic(val) { this.topic.pageNo = val; this.getTopicData(); }, - handleClickTopic (index) { + handleClickTopic(index) { this.topic.showedInfo = true; this.topic.currentIndex = index; }, //加载组织数据 - async getTopicData () { + async getTopicData() { const url = "/data/aggregator/resigroup/pageusertopic"; let params = { epmetUserIdList: this.info.epmetUserIdList, @@ -741,18 +861,18 @@ export default { } }, - handlePageNoChangePoint (val) { + handlePageNoChangePoint(val) { this.point.pageNo = val; this.getPointData(); }, - handleClickPoint (index) { + handleClickPoint(index) { this.point.showedInfo = true; this.point.currentIndex = index; }, //加载组织数据 - async getPointData () { + async getPointData() { const url = "/point/resi/point/pageuserpoint"; let params = { epmetUserIdList: this.info.epmetUserIdList, @@ -778,24 +898,21 @@ export default { - + +} + diff --git a/src/views/modules/visual/basicinfo/peopleSearch.vue b/src/views/modules/visual/basicinfo/peopleSearch.vue index 4f9503e5..c28c2cf3 100644 --- a/src/views/modules/visual/basicinfo/peopleSearch.vue +++ b/src/views/modules/visual/basicinfo/peopleSearch.vue @@ -130,8 +130,8 @@ export default { }, activated () { - this.searchName = '' - this.tableData = [] + // this.searchName = '' + // this.tableData = [] }, @@ -180,8 +180,10 @@ export default { async toSubAgency (type, userId) { - this.orgLevel = 'people' - this.selUserId = userId + + return this.$router.push({ path: `/main-shuju/visual-basicinfo-people/${userId}` }); + // this.orgLevel = 'people' + // this.selUserId = userId }, diff --git a/src/views/modules/visual/basicinfo/personCategory/index.vue b/src/views/modules/visual/basicinfo/personCategory/index.vue index f164545b..fb48e03e 100644 --- a/src/views/modules/visual/basicinfo/personCategory/index.vue +++ b/src/views/modules/visual/basicinfo/personCategory/index.vue @@ -14,7 +14,7 @@ -
@@ -254,7 +254,9 @@ export default { }, async handleChangeAgency (value) { - let selAgency = this.$refs["myCascader"].getCheckedNodes()[0].data + let arr = this.$refs["myCascader"].getCheckedNodes(); + if(!Array.isArray(arr) || arr.length==0) return; + let selAgency = arr[0].data // this.agencyName = this.$refs["myCascader"].getCheckedNodes()[0].label this.agencyName = selAgency.name this.agencyId = selAgency.agencyId @@ -266,9 +268,10 @@ export default { //下钻到下一级 type点击的类型:polygon 点击多边形(分为点击组织/小区) people 点击详情 async toSubAgency (userId) { - - this.selUserId = userId - this.orgLevel = 'people' + + return this.$router.push({ path: `/main-shuju/visual-basicinfo-people/${userId}` }); + // this.selUserId = userId + // this.orgLevel = 'people' }, //返回所选组织 diff --git a/src/views/modules/visual/cpts/tb.vue b/src/views/modules/visual/cpts/tb.vue index 4a278830..317f438f 100644 --- a/src/views/modules/visual/cpts/tb.vue +++ b/src/views/modules/visual/cpts/tb.vue @@ -21,7 +21,7 @@
{{ item }}
-
+
{{ index + 1 }}
{{ btn }} {{ item.name }}