Files
dvcp_v2_wxcp_app/library/apps/AppWarningMonitoring/AppWarningMonitoring.vue

225 lines
5.8 KiB
Vue
Raw Normal View History

2022-03-24 10:40:30 +08:00
<template>
<div class="AppWarningMonitoring">
2022-03-26 16:55:23 +08:00
<AiTopFixed>
<div class="tab-select">
<div class="item" :class="tabIndex == index ? 'active' : ''" v-for="(item, index) in tabs" :key="index" @click="tabClick(index)">{{item}}<span></span></div>
</div>
<div class="search-box">
<div class="area-select">
2022-03-28 17:05:40 +08:00
<AiAreaPicker v-model="areaId" :areaId="user.areaId" :name.sync="areaName" @select="areaSelect" select-root>
2022-03-28 10:33:11 +08:00
<div style="display: flex;">
<u-icon name="map-fill" size="18px" color="#FFF" style="width:18px;display:inline-block;margin-top: 18px"></u-icon>
<span v-if="areaName" style="color:#FFF;fontSize: 14px;" class="areaName">{{ areaName }}</span>
<span v-else :style="{color:areaName? '#FFF': '#E2E8F1'}" class="areaName">请选择</span>
<u-icon name="arrow-down" color="#FFF" size="24" style="margin-left: 4px;width: 14px;display:inline-block;margin-top:22px"></u-icon>
</div>
2022-03-26 16:55:23 +08:00
</AiAreaPicker>
</div>
<div class="search">
2022-03-29 11:12:43 +08:00
<u-search placeholder="请输入姓名" v-model.trim="name" bg-color="#1F5CAF" search-icon-color="#E2E8F1"
2022-03-26 16:55:23 +08:00
placeholder-style="color: #E2E8F1;" :show-action="false" @search="searchHandler" @clear="name='',getList()"></u-search>
</div>
</div>
</AiTopFixed>
<div class="card-list" v-if="list.length">
<div class="item" v-for="(item, index) in list" :key="index" @click="toDetail(item.id)">
<div class="top">
<div class="name-type">
<span class="name">{{ item.name }}</span>
<span class="type" :style="{color: item.status==0? '#FFBB00':item.status==1? '#FF8822':item.status==2? '#FF4466':'#2EA222'}">
{{ $dict.getLabel('fpRiskPersonStatus',item.status) }}
</span>
</div>
<div class="address">{{ item.areaName }}</div>
</div>
<div class="bottom">{{ $dict.getLabel('fpRiskType',item.riskType) }}</div>
</div>
</div>
<AiEmpty v-else/>
2022-03-24 10:40:30 +08:00
</div>
</template>
<script>
2022-03-26 16:55:23 +08:00
import { mapState } from 'vuex'
2022-03-24 10:40:30 +08:00
export default {
name: 'AppWarningMonitoring',
appName: '预警监控',
data() {
return {
2022-03-26 16:55:23 +08:00
tabs: ['待处理','历史信息'],
tabIndex: 0,
areaName: '',
areaId: '',
name: '',
current: 1,
list: [],
2022-03-24 10:40:30 +08:00
}
},
2022-03-26 16:55:23 +08:00
computed: {
...mapState(['user'])
},
onLoad() {
this.$dict.load('fpRiskPersonStatus','fpRiskType').then(()=>{
this.areaId = this.user.areaId
this.areaName = this.user.areaName
uni.$on('update',()=>{
this.current = 1
this.getList()
})
this.getList()
})
},
2022-03-24 10:40:30 +08:00
methods: {
2022-03-26 16:55:23 +08:00
tabClick(index) {
2022-03-28 09:32:41 +08:00
this.list = []
this.current = 1
2022-03-26 16:55:23 +08:00
this.tabIndex = index,
this.getList()
},
areaSelect(v) {
this.areaId = v
this.current = 1
this.getList()
},
searchHandler() {
this.list = []
this.current = 1
this.getList()
2022-03-24 10:40:30 +08:00
},
2022-03-26 16:55:23 +08:00
getList() {
this.$http.post('/app/apppreventionreturntopovertyriskperson/list-wx',null,{params:{
current: this.current,
queryType: this.tabIndex,
name: this.name,
areaId: this.areaId,
}}).then(res=>{
if(res?.data) {
this.list = this.current==1? res.data.records: [...this.list,...res.data.records]
}
2022-03-24 10:40:30 +08:00
})
2022-03-26 16:55:23 +08:00
},
toDetail(id) {
uni.navigateTo({url:`./detail?id=${id}&tabIndex=${this.tabIndex}`})
2022-03-24 10:40:30 +08:00
}
},
2022-03-26 16:55:23 +08:00
onReachBottom() {
this.current ++
this.getList()
},
onShow() {
document.title = "风险预警"
},
2022-03-24 10:40:30 +08:00
}
</script>
<style lang="scss" scoped>
2022-03-26 16:55:23 +08:00
.AppWarningMonitoring {
background: #f3f4f5;
::v-deep .AiTopFixed .content {
padding: 0;
}
::v-deep .AiTopFixed .search {
margin-bottom: 0;
}
.tab-select {
width: 100%;
height: 96px;
line-height: 96px;
background: #3975C6;
display: flex;
.item{
flex: 1;
text-align: center;
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #CDDCF0;
}
.active{
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
position: relative;
color: #fff;
span{
width: 48px;
height: 4px;
background: #FFF;
position: absolute;
bottom: 14px;
left: 50%;
margin-left: -24px;
}
}
}
.search-box {
display: flex;
width: 100%;
height: 112px;
line-height: 112px;
background: #3975C6;
padding: 0 32px;
box-sizing: border-box;
.area-select {
display: flex;
width: 240px;
2022-03-28 10:33:11 +08:00
justify-content: space-between;
::v-deep .AiAreaPicker {
display: flex;
.areaName {
display: inline-block;
max-width: 160px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
}
}
2022-03-26 16:55:23 +08:00
}
.search {
width: calc(100% - 240px);
::v-deep .uni-input-input {
color: #fff;
}
}
}
.card-list {
box-sizing: border-box;
padding: 32px;
.item {
background: #FFFFFF;
border-radius: 16px;
margin-bottom: 16px;
box-sizing: border-box;
width: 100%;
height: 100%;
.top {
padding: 32px 32px;
.name-type {
display: flex;
justify-content: space-between;
.name {
color: #333333;
font-size: 32px;
font-weight: 500;
}
}
.address {
margin-top: 16px;
color: #999999;
font-size: 26px;
}
}
.bottom {
padding: 0 32px;
border-top: 1px solid #DDDDDD;
height: 94px;
line-height: 94px;
color: #3975C6;
font-size: 26px;
}
}
}
2022-03-24 10:40:30 +08:00
}
2022-03-26 16:55:23 +08:00
</style>