Files
dvcp_v2_wxcp_app/src/apps/AppHandSnapshot/List.vue

277 lines
6.1 KiB
Vue
Raw Normal View History

2022-01-05 16:16:45 +08:00
<template>
<div class="list">
2022-01-05 16:53:11 +08:00
<AiTopFixed>
2022-06-13 09:57:52 +08:00
<u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" bg-color="#3975C6" inactive-color="#fff" active-color="#fff"
@change="change"></u-tabs>
2022-01-05 16:53:11 +08:00
<div class="select-top">
2022-06-13 09:57:52 +08:00
<div class="tab-item">
2022-06-13 10:04:44 +08:00
<AiPagePicker type="gird" v-model="searchGrid" @change="confirm" valueObj nodeKey="id" formType="2">
2022-06-13 09:57:52 +08:00
<AiMore v-model="searchGrid.girdName" icon="arrow-down" placeholder="所属网格"/>
</AiPagePicker>
2022-01-05 16:53:11 +08:00
</div>
2022-01-06 14:35:07 +08:00
<div class="tab-item" @click="showType = true">
2022-06-13 09:57:52 +08:00
<AiMore v-model="eventStatusText" icon="arrow-down" placeholder="办件状态"/>
2022-01-05 16:53:11 +08:00
</div>
2022-01-06 14:35:07 +08:00
<u-select v-model="showType" :list="listType" value-name="dictValue" label-name="dictName" @confirm="confirm"></u-select>
2022-01-05 16:53:11 +08:00
</div>
</AiTopFixed>
2022-06-13 09:57:52 +08:00
<template>
2022-01-05 16:16:45 +08:00
<AiCard v-for="(item, i) in datas" :key="i" @click.native="goDetail(item, 1)">
<template #custom>
<div class="card-top">
2022-01-06 17:46:23 +08:00
<div class="titles">{{ item.content }}</div>
2022-01-05 16:16:45 +08:00
<div class="types">
<span>事件类型</span>
2022-01-06 14:35:07 +08:00
<span class="types-right">{{ item.groupName }}</span>
2022-01-05 16:16:45 +08:00
</div>
<div class="gards">
<span>所属网格</span>
2022-01-06 14:35:07 +08:00
<span class="gards-right">{{ item.girdName }}</span>
2022-01-05 16:16:45 +08:00
</div>
</div>
2022-06-13 09:57:52 +08:00
<div class="status" :class="item.eventStatus == 0 ? 'status0' : item.eventStatus == 1 ? 'status1' : item.eventStatus == 2 ? 'status2' : 'status3'"
v-if="item.eventStatus">
2022-01-05 16:16:45 +08:00
<span class="icon"></span>
2022-01-06 14:35:07 +08:00
<span>
{{ $dict.getLabel('clapEventStatus', item.eventStatus) }}
</span>
2022-01-05 16:16:45 +08:00
</div>
</template>
</AiCard>
2022-01-05 16:53:11 +08:00
<AiEmpty v-if="!datas.length"></AiEmpty>
2022-01-05 16:16:45 +08:00
</template>
<div class="pad-b120" v-if="datas.length"></div>
</div>
</template>
<script>
2022-06-13 09:57:52 +08:00
import {mapState} from 'vuex'
2022-01-06 17:46:23 +08:00
2022-01-05 16:16:45 +08:00
export default {
props: {},
data() {
return {
datas: [],
tabList: [
{
name: '全部待办',
},
{
name: '办件历史',
},
],
currentTabs: 0,
current: 1,
pages: 0,
2022-06-13 09:57:52 +08:00
searchGrid: {},
2022-01-06 14:35:07 +08:00
showType: false,
eventStatus: '',
2022-06-13 09:57:52 +08:00
eventStatusText: '',
2022-01-05 16:16:45 +08:00
}
},
computed: {
2022-01-06 17:46:23 +08:00
...mapState(['user']),
2022-06-13 09:57:52 +08:00
listType() {
return this.$dict.getDict(this.currentTabs == 0 ? 'clapEventStatusAll' : 'clapEventStatusHistory')
}
2022-01-05 16:16:45 +08:00
},
2022-06-13 09:57:52 +08:00
onLoad() {
uni.$on('nextList', () => {
this.current++
2022-01-07 09:20:50 +08:00
this.getList()
})
2022-06-13 09:57:52 +08:00
uni.$on('getListInit', () => {
2022-01-07 13:58:07 +08:00
this.current = 1
this.getList()
})
2022-01-14 14:54:04 +08:00
2022-01-06 19:42:27 +08:00
},
2022-01-21 14:03:03 +08:00
onShow() {
document.title = '随手拍'
},
2022-01-06 19:42:27 +08:00
created() {
2022-01-07 18:56:21 +08:00
this.$dict.load('clapEventStatus', 'clapEventStatusAll', 'clapEventStatusHistory').then(() => {
2022-01-06 14:35:07 +08:00
this.getList()
})
2022-01-05 16:16:45 +08:00
},
methods: {
getList() {
2022-06-13 09:57:52 +08:00
let {current, eventStatus, searchGrid: {id: girdId}} = this
this.$http.post(`/app/appclapeventinfo/listByGirdMember`, null, {
2022-01-07 09:20:50 +08:00
params: {
2022-06-13 09:57:52 +08:00
size: 10,
current, searchType: this.currentTabs == 1 ? '1' : '0',
eventStatus, girdId
2022-01-07 09:20:50 +08:00
},
})
.then((res) => {
if (res.code == 0) {
2022-06-13 09:57:52 +08:00
this.datas = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records
this.pages = res.data.pages
this.$forceUpdate()
2022-01-07 09:20:50 +08:00
}
})
2022-01-05 16:16:45 +08:00
},
2022-01-06 14:35:07 +08:00
confirm(e) {
if (this.showType) {
this.eventStatus = e[0].value
2022-01-07 09:20:50 +08:00
this.eventStatusText = e[0].label
2022-01-06 14:35:07 +08:00
}
2022-01-07 09:20:50 +08:00
this.current = 1
this.getList()
2022-01-06 14:35:07 +08:00
},
2022-01-05 16:16:45 +08:00
goDetail(item) {
2022-06-13 09:57:52 +08:00
uni.navigateTo({url: `./Detail?id=${item.id}`})
2022-01-05 16:16:45 +08:00
},
change(index) {
2022-01-06 14:35:07 +08:00
this.current = 1
this.datas = []
2022-01-06 17:46:23 +08:00
this.eventStatus = ''
2022-01-05 16:16:45 +08:00
this.currentTabs = index
this.getList()
},
2022-01-06 14:35:07 +08:00
2022-01-05 16:16:45 +08:00
linkTo(url) {
2022-06-13 09:57:52 +08:00
uni.navigateTo({url})
2022-01-06 14:35:07 +08:00
},
2022-01-05 16:16:45 +08:00
},
}
</script>
<style scoped lang="scss">
.list {
height: 100%;
2022-08-25 16:31:29 +08:00
padding: 0;
width: 100vw;
2022-06-13 09:57:52 +08:00
2022-01-05 16:16:45 +08:00
.select-top {
background: #fff;
display: flex;
2022-01-05 16:53:11 +08:00
padding: 24px 0;
2022-06-13 09:57:52 +08:00
2022-01-06 14:35:07 +08:00
.tab-item {
2022-01-05 16:53:11 +08:00
flex: 1;
text-align: center;
line-height: 48px;
font-size: 26px;
font-family: PingFangSC-Regular, PingFang SC;
color: #666;
2022-06-13 09:57:52 +08:00
2022-01-06 14:35:07 +08:00
img {
2022-01-05 16:53:11 +08:00
width: 32px;
height: 32px;
margin-left: 8px;
vertical-align: middle;
}
2022-01-05 16:16:45 +08:00
}
2022-06-13 09:57:52 +08:00
2022-01-05 16:53:11 +08:00
.tab-item:nth-of-type(1) {
border-right: 1px solid #eee;
}
}
2022-06-13 09:57:52 +08:00
2022-01-06 14:35:07 +08:00
::v-deep .AiTopFixed .content {
2022-01-05 16:53:11 +08:00
padding: 0;
2022-01-05 16:16:45 +08:00
}
2022-06-13 09:57:52 +08:00
2022-01-05 16:16:45 +08:00
::v-deep .AiCard {
background: #f3f6f9;
padding: 24px 40px 0 32px;
2022-06-13 09:57:52 +08:00
2022-01-05 16:16:45 +08:00
.start {
background: #fff;
border-radius: 16px;
2022-06-13 09:57:52 +08:00
2022-01-05 16:16:45 +08:00
.card-top {
padding: 32px;
2022-06-13 09:57:52 +08:00
2022-01-05 16:16:45 +08:00
.titles {
margin-bottom: 34px;
font-size: 32px;
font-weight: 500;
color: #333333;
line-height: 1.4;
word-break: break-all;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
2022-06-13 09:57:52 +08:00
2022-01-05 16:16:45 +08:00
.types,
.gards {
margin-top: 8px;
font-size: 26px;
2022-06-13 09:57:52 +08:00
2022-01-05 16:16:45 +08:00
.types-right,
.gards-right {
margin-left: 32px;
color: #333333;
}
}
}
.status {
padding: 32px;
border-top: 1px solid #dddddd;
2022-06-13 09:57:52 +08:00
2022-01-05 16:16:45 +08:00
.icon {
display: inline-block;
width: 8px;
height: 8px;
vertical-align: middle;
margin-right: 8px;
}
}
.status0 {
color: #ff883c;
2022-06-13 09:57:52 +08:00
2022-01-05 16:16:45 +08:00
.icon {
background: #ff883c;
}
}
.status1 {
color: #1aaaff;
2022-06-13 09:57:52 +08:00
2022-01-05 16:16:45 +08:00
.icon {
background: #1aaaff;
}
}
.status2 {
color: #42d784;
2022-06-13 09:57:52 +08:00
2022-01-05 16:16:45 +08:00
.icon {
background: #42d784;
}
}
.status3 {
color: #ff4466;
2022-06-13 09:57:52 +08:00
2022-01-05 16:16:45 +08:00
.icon {
background: #ff4466;
}
}
}
}
2022-06-13 09:57:52 +08:00
2022-01-05 16:16:45 +08:00
// ::v-deep .AiCard:last-child {
// padding-bottom: 24px;
// }
2022-01-06 14:35:07 +08:00
.pad-b120 {
2022-01-05 16:16:45 +08:00
background-color: #f3f6f9;
padding-bottom: 120px;
}
}
</style>