Browse Source

更改个人详情跳转逻辑等

shibei_master
dai 3 years ago
parent
commit
0d7720a292
  1. 495
      src/views/modules/visual/basicinfo/people.vue
  2. 10
      src/views/modules/visual/basicinfo/peopleSearch.vue
  3. 11
      src/views/modules/visual/basicinfo/personCategory/index.vue
  4. 6
      src/views/modules/visual/cpts/tb.vue

495
src/views/modules/visual/basicinfo/people.vue

@ -1,16 +1,18 @@
<template>
<div class="g-wrr">
<div class="g-bread">
<div class="g-bread" v-if="breadList.length > 1">
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item v-for="item in breadList" :key="item.path" :to="{ path: item.path }">
<el-breadcrumb-item
v-for="item in breadList"
:key="item.path"
:to="{ path: item.path }"
>
{{ item.meta.title }}
</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div class="g-cpt">
<div class="g-l">
<div class="m-people">
<cpt-card>
@ -18,11 +20,9 @@
<img src="@/assets/img/shuju/title-tip.png" />
<span>人员情况</span>
</div>
<div class="more"
@click="showedMoreInfo = true">查看更多</div>
<div class="more" @click="showedMoreInfo = true">查看更多</div>
<div class="ren">
<img class="pic-ren"
src="@/assets/img/shuju/people/ren.png" />
<img class="pic-ren" src="@/assets/img/shuju/people/ren.png" />
<div class="ren-name">
<span>{{ info.name }}</span>
<img src="@/assets/img/shuju/people/arrow.png" />
@ -119,11 +119,13 @@
</cpt-card>
</div>
<people-more v-show="showedMoreInfo"
<people-more
v-show="showedMoreInfo"
v-if="userId"
:userId="userId"
:gridName="info.gridName"
@close="showedMoreInfo = false" />
@close="showedMoreInfo = false"
/>
<div class="m-relation">
<cpt-card>
@ -133,95 +135,177 @@
</div>
<div class="info">
<div class="huzhu">
<img class="huzhu-bg"
src="@/assets/img/shuju/people/huzhu.png" />
<img class="huzhu-ico"
src="@/assets/img/shuju/people/huzhu-home.png" />
<div class="huzhu-name">{{ houseInfo&&houseInfo.ownerName?houseInfo.ownerName:'暂不清楚' }}</div>
<img
class="huzhu-bg"
src="@/assets/img/shuju/people/huzhu.png"
/>
<img
class="huzhu-ico"
src="@/assets/img/shuju/people/huzhu-home.png"
/>
<div class="huzhu-name">
{{
houseInfo && houseInfo.ownerName
? houseInfo.ownerName
: "暂不清楚"
}}
</div>
<p>户主</p>
</div>
<div class="rel z-zuo-2"
<div
class="rel z-zuo-2"
@click="toUserInfo(houseInfo.userList[0].userId)"
v-if="houseInfo.userList[0]">
<img class="rel-bg"
src="@/assets/img/shuju/people/huzhu-kuang-zuo.png" />
<img class="rel-line"
src="@/assets/img/shuju/people/huzhu-line/zuo2.png" />
<div class="rel-text"
:class="houseInfo.userList[0].isSelf == '1' ? 'z-on' : ''">
<div class="rel-call">{{ houseInfo.userList[0].relation }}</div>
<div class="rel-name">{{ houseInfo.userList[0].userName }}</div>
</div>
</div>
<div class="rel z-you-2"
v-if="houseInfo.userList[0]"
>
<img
class="rel-bg"
src="@/assets/img/shuju/people/huzhu-kuang-zuo.png"
/>
<img
class="rel-line"
src="@/assets/img/shuju/people/huzhu-line/zuo2.png"
/>
<div
class="rel-text"
:class="houseInfo.userList[0].isSelf == '1' ? 'z-on' : ''"
>
<div class="rel-call">
{{ houseInfo.userList[0].relation }}
</div>
<div class="rel-name">
{{ houseInfo.userList[0].userName }}
</div>
</div>
</div>
<div
class="rel z-you-2"
@click="toUserInfo(houseInfo.userList[1].userId)"
v-if="houseInfo.userList[1]">
<img class="rel-bg"
src="@/assets/img/shuju/people/huzhu-kuang-you.png" />
<img class="rel-line"
src="@/assets/img/shuju/people/huzhu-line/you2.png" />
<div class="rel-text"
:class="houseInfo.userList[1].isSelf == '1' ? 'z-on' : ''">
<div class="rel-call">{{ houseInfo.userList[1].relation }}</div>
<div class="rel-name">{{ houseInfo.userList[1].userName }}</div>
</div>
</div>
<div class="rel z-zuo-1"
v-if="houseInfo.userList[1]"
>
<img
class="rel-bg"
src="@/assets/img/shuju/people/huzhu-kuang-you.png"
/>
<img
class="rel-line"
src="@/assets/img/shuju/people/huzhu-line/you2.png"
/>
<div
class="rel-text"
:class="houseInfo.userList[1].isSelf == '1' ? 'z-on' : ''"
>
<div class="rel-call">
{{ houseInfo.userList[1].relation }}
</div>
<div class="rel-name">
{{ houseInfo.userList[1].userName }}
</div>
</div>
</div>
<div
class="rel z-zuo-1"
@click="toUserInfo(houseInfo.userList[2].userId)"
v-if="houseInfo.userList[2]">
<img class="rel-bg"
src="@/assets/img/shuju/people/huzhu-kuang-zuo.png" />
<img class="rel-line"
src="@/assets/img/shuju/people/huzhu-line/zuo1.png" />
<div class="rel-text"
:class="houseInfo.userList[2].isSelf == '1' ? 'z-on' : ''">
<div class="rel-call">{{ houseInfo.userList[2].relation }}</div>
<div class="rel-name">{{ houseInfo.userList[2].userName }}</div>
</div>
</div>
<div class="rel z-you-1"
v-if="houseInfo.userList[2]"
>
<img
class="rel-bg"
src="@/assets/img/shuju/people/huzhu-kuang-zuo.png"
/>
<img
class="rel-line"
src="@/assets/img/shuju/people/huzhu-line/zuo1.png"
/>
<div
class="rel-text"
:class="houseInfo.userList[2].isSelf == '1' ? 'z-on' : ''"
>
<div class="rel-call">
{{ houseInfo.userList[2].relation }}
</div>
<div class="rel-name">
{{ houseInfo.userList[2].userName }}
</div>
</div>
</div>
<div
class="rel z-you-1"
@click="toUserInfo(houseInfo.userList[3].userId)"
v-if="houseInfo.userList[3]">
<img class="rel-bg"
src="@/assets/img/shuju/people/huzhu-kuang-you.png" />
<img class="rel-line"
src="@/assets/img/shuju/people/huzhu-line/you1.png" />
<div class="rel-text"
:class="houseInfo.userList[3].isSelf == '1' ? 'z-on' : ''">
<div class="rel-call">{{ houseInfo.userList[3].relation }}</div>
<span class="rel-name">{{ houseInfo.userList[3].userName }}</span>
</div>
</div>
<div class="rel z-zuo-3"
v-if="houseInfo.userList[3]"
>
<img
class="rel-bg"
src="@/assets/img/shuju/people/huzhu-kuang-you.png"
/>
<img
class="rel-line"
src="@/assets/img/shuju/people/huzhu-line/you1.png"
/>
<div
class="rel-text"
:class="houseInfo.userList[3].isSelf == '1' ? 'z-on' : ''"
>
<div class="rel-call">
{{ houseInfo.userList[3].relation }}
</div>
<span class="rel-name">{{
houseInfo.userList[3].userName
}}</span>
</div>
</div>
<div
class="rel z-zuo-3"
@click="toUserInfo(houseInfo.userList[4].userId)"
v-if="houseInfo.userList[4]">
<img class="rel-bg"
src="@/assets/img/shuju/people/huzhu-kuang-zuo.png" />
<img class="rel-line"
src="@/assets/img/shuju/people/huzhu-line/zuo3.png" />
<div class="rel-text"
:class="houseInfo.userList[4].isSelf == '1' ? 'z-on' : ''">
<div class="rel-call">{{ houseInfo.userList[4].relation }}</div>
<div class="rel-name">{{ houseInfo.userList[4].userName }}</div>
v-if="houseInfo.userList[4]"
>
<img
class="rel-bg"
src="@/assets/img/shuju/people/huzhu-kuang-zuo.png"
/>
<img
class="rel-line"
src="@/assets/img/shuju/people/huzhu-line/zuo3.png"
/>
<div
class="rel-text"
:class="houseInfo.userList[4].isSelf == '1' ? 'z-on' : ''"
>
<div class="rel-call">
{{ houseInfo.userList[4].relation }}
</div>
<div class="rel-name">
{{ houseInfo.userList[4].userName }}
</div>
</div>
</div>
<div
class="rel z-you-3"
@click="toUserInfo(houseInfo.userList[5].userId)"
v-if="houseInfo.userList[5]"
>
<img
class="rel-bg"
src="@/assets/img/shuju/people/huzhu-kuang-you.png"
/>
<img
class="rel-line"
src="@/assets/img/shuju/people/huzhu-line/you3.png"
/>
<div
class="rel-text"
:class="houseInfo.userList[5].isSelf == '1' ? 'z-on' : ''"
>
<div class="rel-call">
{{ houseInfo.userList[5].relation }}
</div>
<div class="rel-name">
{{ houseInfo.userList[5].userName }}
</div>
<div class="rel z-you-3"
@click="toUserInfo(houseInfo.userList[5].userId)"
v-if="houseInfo.userList[5]">
<img class="rel-bg"
src="@/assets/img/shuju/people/huzhu-kuang-you.png" />
<img class="rel-line"
src="@/assets/img/shuju/people/huzhu-line/you3.png" />
<div class="rel-text"
:class="houseInfo.userList[5].isSelf == '1' ? 'z-on' : ''">
<div class="rel-call">{{ houseInfo.userList[5].relation }}</div>
<div class="rel-name">{{ houseInfo.userList[5].userName }}</div>
</div>
</div>
</div>
@ -237,20 +321,23 @@
</div>
<div class="tb">
<cpt-tb :col-list="demand.colList"
<cpt-tb
:col-list="demand.colList"
:loading="demand.loading"
:header="demand.header"
:list="demand.list"
@operate="handleOperateDemandList"></cpt-tb>
@operate="handleOperateDemandList"
></cpt-tb>
<div class="m-pagination"
v-if="demand.total > demand.pageSize">
<el-pagination :current-page="demand.pageNo"
<div class="m-pagination" v-if="demand.total > demand.pageSize">
<el-pagination
:current-page="demand.pageNo"
:page-size="demand.pageSize"
:total="demand.total"
background
layout="prev, pager, next"
@current-change="handlePageNoChangeDemand">
@current-change="handlePageNoChangeDemand"
>
</el-pagination>
</div>
</div>
@ -262,68 +349,86 @@
<cpt-card>
<div class="title">
<img src="@/assets/img/shuju/title-tip.png" />
<a :class="{ 'z-on': showedIncidentOrTopic == 'incident' }"
@click="showedIncidentOrTopic = 'incident'">上报事件</a>
<a :class="{ 'z-on': showedIncidentOrTopic == 'topic' }"
@click="showedIncidentOrTopic = 'topic'">发布话题</a>
</div>
<div class="list-wrap"
v-show="showedIncidentOrTopic == 'incident'">
<a
:class="{ 'z-on': showedIncidentOrTopic == 'incident' }"
@click="showedIncidentOrTopic = 'incident'"
>上报事件</a
>
<a
:class="{ 'z-on': showedIncidentOrTopic == 'topic' }"
@click="showedIncidentOrTopic = 'topic'"
>发布话题</a
>
</div>
<div
class="list-wrap"
v-show="showedIncidentOrTopic == 'incident'"
>
<div class="list">
<div class="item"
<div
class="item"
:key="'incident' + index"
v-for="(item, index) in incident.list"
@click="handleClickIncident(index)">
@click="handleClickIncident(index)"
>
<div class="item-title">{{ item.eventContent }}</div>
<div class="item-date">{{ item.reportTime }}</div>
</div>
</div>
<div class="m-pagination"
v-if="incident.total > incident.pageSize">
<el-pagination :current-page="incident.pageNo"
<div
class="m-pagination"
v-if="incident.total > incident.pageSize"
>
<el-pagination
:current-page="incident.pageNo"
:page-size="incident.pageSize"
:total="incident.total"
background
layout="prev, pager, next"
@current-change="handlePageNoChangeIncident">
@current-change="handlePageNoChangeIncident"
>
</el-pagination>
</div>
<div v-if="incident.list.length == 0"
class="m-hint">
<img src="@/assets/img/modules/visual/noData.png"
class="no-data-img" />
<div v-if="incident.list.length == 0" class="m-hint">
<img
src="@/assets/img/modules/visual/noData.png"
class="no-data-img"
/>
</div>
</div>
<div class="list-wrap"
v-show="showedIncidentOrTopic == 'topic'">
<div class="list-wrap" v-show="showedIncidentOrTopic == 'topic'">
<div class="list">
<div class="item"
<div
class="item"
:key="'topic' + index"
v-for="(item, index) in topic.list"
@click="handleClickTopic(index)">
@click="handleClickTopic(index)"
>
<div class="item-title">{{ item.topicContent }}</div>
<div class="item-date">{{ item.releaseTime }}</div>
</div>
</div>
<div class="m-pagination"
v-if="topic.total > topic.pageSize">
<el-pagination :current-page="topic.pageNo"
<div class="m-pagination" v-if="topic.total > topic.pageSize">
<el-pagination
:current-page="topic.pageNo"
:page-size="topic.pageSize"
:total="topic.total"
background
layout="prev, pager, next"
@current-change="handlePageNoChangeTopic">
@current-change="handlePageNoChangeTopic"
>
</el-pagination>
</div>
<div v-if="topic.list.length == 0"
class="m-hint">
<img src="@/assets/img/modules/visual/noData.png"
class="no-data-img" />
<div v-if="topic.list.length == 0" class="m-hint">
<img
src="@/assets/img/modules/visual/noData.png"
class="no-data-img"
/>
</div>
</div>
</cpt-card>
@ -338,10 +443,12 @@
<div class="list-wrap">
<div class="list">
<div class="item"
<div
class="item"
:key="'point' + index"
v-for="(item, index) in point.list"
@click="handleClickPoint(index)">
@click="handleClickPoint(index)"
>
<div class="item-row">
<div class="item-l">
<div class="item-point">{{ item.point }}</div>
@ -354,21 +461,23 @@
</div>
</div>
<div class="m-pagination"
v-if="point.total > point.pageSize">
<el-pagination :current-page="point.pageNo"
<div class="m-pagination" v-if="point.total > point.pageSize">
<el-pagination
:current-page="point.pageNo"
:page-size="point.pageSize"
:total="point.total"
background
layout="prev, pager, next"
@current-change="handlePageNoChangePoint">
@current-change="handlePageNoChangePoint"
>
</el-pagination>
</div>
<div v-if="point.list.length == 0"
class="m-hint">
<img src="@/assets/img/modules/visual/noData.png"
class="no-data-img" />
<div v-if="point.list.length == 0" class="m-hint">
<img
src="@/assets/img/modules/visual/noData.png"
class="no-data-img"
/>
</div>
</div>
</cpt-card>
@ -376,23 +485,29 @@
</div>
</div>
<demand-info v-if="demand.list.length > 0 && showedDemandInfo"
<demand-info
v-if="demand.list.length > 0 && showedDemandInfo"
:userId="userId"
queryOrigin="personal-data"
:demandId="demand.srcList[demand.currentIndex].demandRecId"
@close="showedDemandInfo = false" />
@close="showedDemandInfo = false"
/>
<incident-info v-if="incident.list.length > 0 && incident.showedInfo"
<incident-info
v-if="incident.list.length > 0 && incident.showedInfo"
:resiEventId="incident.list[incident.currentIndex].resiEventId"
:epmetUserIdList="info.epmetUserIdList"
:icResiUserId="userId"
@close="incident.showedInfo = false" />
@close="incident.showedInfo = false"
/>
<topic-info v-if="topic.list.length > 0 && topic.showedInfo"
<topic-info
v-if="topic.list.length > 0 && topic.showedInfo"
:topicId="topic.list[topic.currentIndex].topicId"
:epmetUserIdList="info.epmetUserIdList"
:icResiUserId="userId"
@close="topic.showedInfo = false" />
@close="topic.showedInfo = false"
/>
</div>
</div>
</template>
@ -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,12 +898,10 @@ export default {
<style
lang="scss"
src="@/assets/scss/modules/visual/people.scss"
scoped>
</style>
<style
lang="scss"
scoped>
.g-bread {
scoped
></style>
<style lang="scss" scoped>
.g-bread {
padding: 10px 20px;
::v-deep .el-breadcrumb__item {
font-size: 16px;
@ -796,6 +914,5 @@ export default {
color: #a0c3d9;
}
}
}
</style>
}
</style>

10
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
},

11
src/views/modules/visual/basicinfo/personCategory/index.vue

@ -14,7 +14,7 @@
</div>
</div>
</div>
<div v-if="orgLevel!=='people'"
<div v-show="orgLevel!=='people'"
@click="hiddenTypeList()"
class="warning-box">
<cpt-card>
@ -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
@ -267,8 +269,9 @@ 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'
},
//

6
src/views/modules/visual/cpts/tb.vue

@ -21,7 +21,7 @@
<div v-if="typeof item === 'string' || typeof item === 'number'">
{{ item }}
</div>
<div v-if="typeof item === 'object' && item.type == 'index'">
<div v-if="typeof item === 'object' && item && item.type == 'index'">
<img
v-if="highlightTop3 && index == 0"
src="@/assets/img/shuju/top/1.png"
@ -40,14 +40,14 @@
<span v-else>{{ index + 1 }}</span>
</div>
<a
v-else-if="typeof item === 'object' && item.type == 'operate'"
v-else-if="typeof item === 'object' && item && item.type == 'operate'"
v-for="btn in item.list"
:key="'operate' + index + btn"
@click="handleClickBtn(index, btn)"
>{{ btn }}</a
>
<a
v-else-if="typeof item === 'object' && item.type == 'people'"
v-else-if="typeof item === 'object' && item && item.type == 'people'"
@click="handleClickPeople(item)"
>{{ item.name }}</a
>

Loading…
Cancel
Save