Files
dvcp_v2_wxcp_app/library/apps/AppBroadcast/AppEquipment/AppEquipment.vue

175 lines
4.0 KiB
Vue
Raw Normal View History

2022-06-07 17:43:51 +08:00
<template>
<div class="AppEquipment">
<AiTopFixed>
<div class="currentLeft-top">
<div class="left">
<AiAreaPicker v-model="areaId" :areaId="user.areaId" @select="areaSelect" :name.sync="areaName" selectRoot>
<span class="label" v-if="areaName">{{ areaName }}</span>
<span v-else>请选择</span>
2023-05-08 10:54:28 +08:00
<u-icon name="arrow-down" color="#666" size="24" style="margin-left: 4px"/>
2022-06-07 17:43:51 +08:00
</AiAreaPicker>
</div>
2023-05-08 10:54:28 +08:00
<u-search v-model="keyword" :clearabled="true" placeholder="请输入设备名称" :show-action="false" bg-color="#F5F5F5" search-icon-color="#ccc" color="#666"
height="58" @search="getList" @clear="getListInit"></u-search>
2022-06-07 17:43:51 +08:00
</div>
</AiTopFixed>
<div class="record">
2022-06-10 11:34:03 +08:00
<div class="item" v-for="(item, index) in list" :key="index" @click="toDetail(item)">
2022-06-08 11:12:55 +08:00
<img src="../img/lb@2x.png" alt="" class="voice-img">
2022-06-07 17:43:51 +08:00
<div class="info">
<div class="text">
2023-05-08 10:54:28 +08:00
<p>{{ item.name }}</p>
<span>{{ item.areaName }}</span>
2022-06-07 17:43:51 +08:00
</div>
2022-06-11 11:42:53 +08:00
<div class="status">{{ $dict.getLabel('dlbDevStatus', item.devStatus) }}</div>
2022-06-07 17:43:51 +08:00
</div>
</div>
</div>
2022-06-11 14:38:37 +08:00
<AiEmpty v-if="!list.length"></AiEmpty>
2022-06-07 17:43:51 +08:00
</div>
</template>
<script>
2023-05-08 10:54:28 +08:00
import {mapState} from 'vuex'
2022-06-07 17:43:51 +08:00
export default {
name: "AppEquipment",
data() {
return {
2022-06-10 11:34:03 +08:00
current: 1,
2022-06-07 17:43:51 +08:00
areaId: '',
areaName: '',
2022-06-10 11:34:03 +08:00
keyword: '',
list: []
2022-06-07 17:43:51 +08:00
}
},
2023-05-08 10:54:28 +08:00
computed: {...mapState(['user'])},
2022-06-10 11:34:03 +08:00
onLoad() {
2022-06-07 17:43:51 +08:00
this.areaId = this.user.areaId
this.areaName = this.user.areaName
2022-06-11 11:42:53 +08:00
this.$dict.load(['dlbDevStatus']).then(() => {
this.getList()
})
2022-06-07 17:43:51 +08:00
},
2022-06-13 16:28:17 +08:00
onShow() {
document.title = '设备管理'
},
2022-06-07 17:43:51 +08:00
methods: {
areaSelect(e) {
this.areaId = e
2022-06-10 11:34:03 +08:00
this.getListInit()
},
getListInit() {
this.list = []
this.current = 1
this.getList()
},
2023-05-08 10:54:28 +08:00
getList() {
this.$http.post(`/app/appdlbquipment/list?current=1&size=20&name=${this.keyword}&areaId=${this.areaId}`).then((res) => {
2022-06-10 11:34:03 +08:00
if (res.code == 0) {
if (this.current > 1) {
this.list = [...this.list, ...res.data.records]
} else {
this.list = res.data.records
}
}
})
2022-06-07 17:43:51 +08:00
},
toDetail(item) {
2022-06-11 11:42:53 +08:00
uni.navigateTo({url: `./detail?id=${item.id}`})
2022-06-07 17:43:51 +08:00
}
2022-06-10 11:34:03 +08:00
},
onReachBottom() {
2023-01-06 14:16:25 +08:00
this.current++
this.getList()
2022-06-07 17:43:51 +08:00
}
}
</script>
<style lang="scss" scoped>
.AppEquipment {
.currentLeft-top {
display: flex;
align-items: center;
.left {
width: 200px;
display: flex;
align-items: center;
img {
width: 48px;
height: 48px;
}
}
}
2023-05-08 10:54:28 +08:00
2022-06-07 17:43:51 +08:00
.record {
margin-top: 8px;
padding-left: 32px;
background-color: #fff;
.item {
width: 100%;
display: flex;
2022-06-11 12:01:00 +08:00
align-items: center;
2023-05-08 10:54:28 +08:00
height: 110px;
2022-06-07 17:43:51 +08:00
border-bottom: 1px solid #ddd;
2022-06-11 12:01:00 +08:00
box-sizing: border-box;
&:last-child {
border: none;
}
2022-06-07 17:43:51 +08:00
.check-img {
width: 44px;
height: 44px;
2022-06-11 12:01:00 +08:00
margin-right: 32px;
2022-06-07 17:43:51 +08:00
}
.voice-img {
width: 48px;
height: 48px;
2022-06-11 12:01:00 +08:00
margin-right: 16px;
2022-06-07 17:43:51 +08:00
}
.info {
2022-06-11 12:01:00 +08:00
flex: 1;
2022-06-07 17:43:51 +08:00
font-size: 34px;
2022-06-11 12:01:00 +08:00
padding-right: 32px;
2022-06-07 17:43:51 +08:00
display: flex;
justify-content: space-between;
2022-06-11 12:01:00 +08:00
align-items: center;
box-sizing: border-box;
2022-06-07 17:43:51 +08:00
.text {
2022-06-11 12:01:00 +08:00
line-height: 1;
2022-06-07 17:43:51 +08:00
p {
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #333;
margin-bottom: 8px;
}
span {
font-size: 26px;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #999;
line-height: 36px;
}
}
.status {
font-size: 34px;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #4E8EEE;
line-height: 48px;
}
}
}
}
}
</style>