You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

509 lines
14 KiB

9 months ago
<template>
9 months ago
<view class="indexcontent">
<u-navbar :safeAreaInsetTop="false" @rightClick="rightClick" :autoBack="true"
9 months ago
:placeholder="true" leftIconColor="#ffffff">
<view class="u-nav-slot" slot="left" style="display:flex;align-items: center;">
<image src="@/static/images/goback.png" mode="" style="width: 20px;height: 20px;margin-right: 5px;"></image>
<span style="font-size: 15px;">{{ '驾驶舱'+navbarValue }}</span>
</view>
9 months ago
<view class="u-nav-slot" slot="right">
欢迎您审核员
</view>
</u-navbar>
<view class="indexcontent-tab">
<u-tabs :list="list1" :scrollable="false" lineWidth="30" @change="utabschange"
:current='tabscurrent'></u-tabs>
</view>
9 months ago
<scroll-view class="indexcontent-box" @scrolltolower="lowerBottom" scroll-y="true" :scroll-top="scrollTop"
@scroll="scroll">
9 months ago
<view class="indexcontent-bottom">
<u-search placeholder="请输入搜索内容" v-model="massEventsObj.title" @search="searchSou" @clear="qingkong" :searchIcon="searchImage"
9 months ago
showAction animation @custom="searchSou"></u-search>
9 months ago
<template class="" v-if="contentList.length !=0">
<view class="indexcontentbttom-item" v-for="item in contentList">
<view class="indexcontentbttom-item-left">
<view class="indexcontentbttom-item-left-1 indexcontentbttom-item-left-jiti">
<view class="indexcontentbttom-item-left-1-left">
{{item.msgTypeName}}
</view>
<view class="indexcontentbttom-item-left-1-right">
{{item.title}}
</view>
9 months ago
</view>
9 months ago
<view class="indexcontentbttom-item-left-2 indexcontentbttom-item-left-jiti">
<view class="indexcontentbttom-item-left-1-icon">
<!-- <u-icon name="map" size="18" color="#AEBAC8" class="icon"></u-icon> -->
<image src="@/static/images/address.png" mode="aspectFit" style="width: 15px;height: 15px;"></image>
9 months ago
</view>
<view class="smofontsiez">
{{item.warnFactor}}
</view>
9 months ago
</view>
9 months ago
<view class="indexcontentbttom-item-left-2 indexcontentbttom-item-left-jiti">
<view class="indexcontentbttom-item-left-1-icon ">
<!-- <u-icon name="clock" size="18" color="#AEBAC8" class="" class="icon"></u-icon> -->
<image src="@/static/images/time.png" mode="aspectFit" style="width: 15px;height: 15px;"></image>
9 months ago
</view>
<view class="smofontsiez">
{{item.firstWarnTimeDate}}
9 months ago
</view>
9 months ago
</view>
</view>
9 months ago
<view class="indexcontentbttom-item-rigth" @click="nextblack(item)">
{{tabscurrent==0?'审核':'查看'}}
9 months ago
</view>
</view>
9 months ago
</template>
<u-empty mode="list" v-else>
</u-empty>
9 months ago
</view>
9 months ago
9 months ago
<u-tabbar :value="tabValue" @change="change1" :fixed="true" :placeholder="true" :safeAreaInsetBottom="true">
<u-tabbar-item text="群体事件" name="群体事件-1" :badge="msgTypecount[0].count">
<image class="u-page__item__slot-icon" slot="active-icon" src="@/static/images/contimg/icon-0.png">
</image>
<image class="u-page__item__slot-icon" slot="inactive-icon"
src="@/static/images/contimg/icon-0-0.png"></image>
</u-tabbar-item>
<u-tabbar-item text="同人同诉" name="同人同诉-2" :badge="msgTypecount[1].count">
<image class="u-page__item__slot-icon" slot="active-icon" src="@/static/images/contimg/icon-3.png">
</image>
<image class="u-page__item__slot-icon" slot="inactive-icon"
src="@/static/images/contimg/icon-0-3.png"></image>
</u-tabbar-item>
<u-tabbar-item text="紧急事件" name="紧急事件-3" :badge="msgTypecount[2].count">
<image class="u-page__item__slot-icon" slot="active-icon" src="@/static/images/contimg/icon-1.png">
</image>
<image class="u-page__item__slot-icon" slot="inactive-icon"
src="@/static/images/contimg/icon-0-1.png"></image>
</u-tabbar-item>
<u-tabbar-item text="重点人员" name="重点人员-4" :badge="msgTypecount[3].count">
<image class="u-page__item__slot-icon" slot="active-icon" src="@/static/images/contimg/icon-4.png">
</image>
<image class="u-page__item__slot-icon" slot="inactive-icon"
src="@/static/images/contimg/icon-0-4.png"></image>
</u-tabbar-item>
<u-tabbar-item text="一人多诉" name="一人多诉-5" :badge="msgTypecount[4].count">
<image class="u-page__item__slot-icon" slot="active-icon" src="@/static/images/contimg/icon-2.png">
</image>
<image class="u-page__item__slot-icon" slot="inactive-icon"
src="@/static/images/contimg/icon-0-2.png"></image>
</u-tabbar-item>
</u-tabbar>
</scroll-view>
<!-- <audio id="myAudio" src="../static/dingdong.mp3" preload="auto" style="display: none;"></audio> -->
9 months ago
</view>
9 months ago
</template>
<script>
9 months ago
import {
massEventsList,
9 months ago
eventPageCount,
fiveEventCount,
login
9 months ago
} from '@/api/system/ApiList.js'
import { setToken } from '@/utils/auth'
9 months ago
export default {
data() {
return {
tabscurrent: 0,
navbarValue: "群体事件",
9 months ago
tabValue: "群体事件-1",
9 months ago
scrollTop: 0,
searchImage: require("@/static/images/search.png"),
9 months ago
list1: [{
9 months ago
name: '待审核',
9 months ago
badge: {
9 months ago
value: 0,
lable: 0,
9 months ago
}
}, {
9 months ago
name: '已上报',
9 months ago
badge: {
value: 0,
9 months ago
lable: 1,
9 months ago
}
}, {
name: '重训练',
badge: {
value: 0,
9 months ago
lable: 2,
}
},
// {
// name: '审核通过',
// badge: {
// value: 0,
// lable: 3,
// }
9 months ago
// },
],
9 months ago
massEventsObj: {
msgType: "1", //事件类型编码【群体事件】1【同人同诉】2【紧急事件】3【重点人员】4【一人多诉】5
isReport: null, //为未通过 2为已办结 3为作废
size: 10,
current: 1,
title: ""
},
pagesLogin: "",
9 months ago
contentList: [],
9 months ago
msgTypecount: [{
count: 0
}, {
count: 0
}, {
count: 0
}, {
count: 0
}, {
count: 0
}, ],
msgTypecountTwo: [{
count: 0
}, {
count: 0
}, {
count: 0
}, {
count: 0
}, {
count: 0
}, ],
innerAudioContext:null,
Time:null,
9 months ago
}
},
methods: {
// 顶部导航栏
utabschange(e) {
9 months ago
this.tabscurrent = e.badge.lable
9 months ago
this.massEventsObj.current = 1
this.massEventsObj.title = ""
this.getList()
clearInterval(this.Time)
this.Time = setInterval(()=>{
this.geteventPageCount()
},5000)
9 months ago
// console.log(e);
9 months ago
},
//搜索
searchSou() {
9 months ago
this.massEventsObj.current = 1
this.getList()
9 months ago
},
//清空
9 months ago
qingkong() {
this.massEventsObj.title = ""
this.getList()
},
9 months ago
// 跳转
nextblack(item) {
9 months ago
// console.log(item);
9 months ago
//navbarValue 头部标题
//tabscurrent 区分待审核0, 已上报1 重训练2
// item
clearInterval(this.Time)
this.Time = setInterval(()=>{
this.geteventPageCount()
},5000)
9 months ago
uni.navigateTo({
9 months ago
url: `/views/jiashicangshenhe/jiashicangshenhe?navbarValue=${this.navbarValue}&tabscurrent=${this.tabscurrent}&innerEventId=${item.innerEventId}`
9 months ago
})
},
//切换
9 months ago
async change1(e) {
9 months ago
this.navbarValue = e.split("-")[0]
// 标题
this.massEventsObj.title = ""
// 类型
this.massEventsObj.msgType = e.split("-")[1]
// 页码
this.massEventsObj.current = 1
// 头部类型
this.massEventsObj.isReport = null
// tab
this.tabValue = e
// 头部归位
9 months ago
this.tabscurrent = 0
9 months ago
this.geteventPageCount()
9 months ago
await this.getList();
this.goTop();
clearInterval(this.Time)
this.Time = setInterval(()=>{
this.geteventPageCount()
},5000)
9 months ago
},
scroll(e) {
//记录scroll 位置
this.oldScrollTop = e.detail.scrollTop
},
goTop(e) {
//视图会发生重新渲染
this.scrollTop = this.oldScrollTop
//当视图渲染结束 重新设置为0
this.$nextTick(() => {
9 months ago
this.scrollTop = 0
});
9 months ago
},
9 months ago
9 months ago
// 触底刷新
//触底加载
lowerBottom() {
9 months ago
// console.log("触底加载")
9 months ago
if (this.massEventsObj.current < this.pagesLogin) {
++this.massEventsObj.current
this.getList("触底")
} else {
9 months ago
// console.log("到底了");
9 months ago
uni.showToast({
title: '暂无更多',
icon: 'none',
duration: 1000
});
}
},
//获取list
getList(type) {
if (this.tabscurrent == 0) {
9 months ago
this.massEventsObj.isReport = 4
9 months ago
} else {
this.massEventsObj.isReport = this.tabscurrent
}
massEventsList(this.massEventsObj).then(res => {
if (type == "触底") {
this.contentList = this.contentList.concat(res.data.records)
this.pagesLogin = res.data.pages
} else {
this.contentList = res.data.records
this.pagesLogin = res.data.pages
}
})
},
// 获取待审核数量
9 months ago
geteventPageCount() {
eventPageCount({
msgType: this.massEventsObj.msgType
}).then(res => {
9 months ago
// console.log(res);
9 months ago
this.list1[0].badge.value = res.data
9 months ago
})
9 months ago
fiveEventCount().then(res => {
this.msgTypecount = [...res.data]
9 months ago
this.msgTypecount = this.msgTypecount.sort((a, b) => {
return a.msgType - b.msgType;
});
this.isDingdong()
9 months ago
})
},
isDingdong(){
if(this.msgTypecountTwo[0].count == 0) {
this.msgTypecountTwo = [...this.msgTypecount]
this.msgTypecountTwo = this.msgTypecountTwo.sort((a, b) => {
return a.msgType - b.msgType;
});
} else {
// console.log(this.msgTypecountTwo,"msgTypecountTwo");
// console.log(this.msgTypecount,"msgTypecount");
// const isDD = this.msgTypecount.some((obj1, index) => obj1.count !== this.msgTypecountTwo[index].count)
let arr = []
for (let i = 0; i < this.msgTypecount.length; i++) {
if (this.msgTypecount[i].count > this.msgTypecountTwo[i].count) {
arr.push({index:i})
}
}
if(arr.length > 0) {
this.msgTypecountTwo = [...this.msgTypecount]
this.msgTypecountTwo = this.msgTypecountTwo.sort((a, b) => {
return a.msgType - b.msgType;
});
this.innerAudioContext.play()
}
}
},
9 months ago
9 months ago
},
// onLoad: function() {
// login("admin","Suanfa@2024//**...").then(res=>{
// setToken(res.token)
// this.getList()
// this.geteventPageCount()
// this.$store.dispatch("Deletestate")
// })
// },
9 months ago
onShow() {
login("admin","Suanfa@2024//**...").then(res=>{
setToken(res.token);
let src = require("../static/dingdong.mp3")
this.innerAudioContext = uni.createInnerAudioContext();
this.innerAudioContext.autoplay = true;
this.innerAudioContext.src = require("../static/dingdong.mp3");
this.getList()
this.geteventPageCount()
this.$store.dispatch("Deletestate")
})
},
beforeDestroy() {
// 页面销毁时销毁音频上下文
if (this.innerAudioContext) {
this.innerAudioContext.destroy();
}
if(this.Time) {
clearInterval(this.Time)
}
},
9 months ago
}
9 months ago
</script>
9 months ago
<style lang="scss" scoped>
.indexcontent {
width: 100%;
.indexcontent-tab {
width: 100%;
height: 85rpx;
background: #ffffff;
position: sticky;
top: 0;
left: 0;
9 months ago
9 months ago
::v-deep .u-tabs__wrapper__nav__item {
position: relative;
9 months ago
9 months ago
.u-badge {
position: absolute;
9 months ago
right: -10rpx;
9 months ago
top: 30rpx;
}
9 months ago
9 months ago
}
9 months ago
}
.indexcontent-box {
padding: 20rpx 20rpx 0 20rpx;
9 months ago
height: 85vh;
9 months ago
.indexcontent-bottom {
width: 100%;
padding: 20rpx;
border-radius: 10rpx;
background: #ffffff;
.indexcontentbttom-item {
padding: 25rpx;
width: 100%;
background: #f7f7f7fa;
border-radius: 10rpx;
display: grid;
grid-template-columns: 85% 15%;
margin: 20rpx 0;
.indexcontentbttom-item-left {
.indexcontentbttom-item-left-jiti {
width: 100%;
display: grid;
grid-template-columns: 13% auto;
align-items: center;
/* 设置垂直居中对齐 */
margin-bottom: 10rpx;
.indexcontentbttom-item-left-1-icon {
width: 60rpx;
height: 40rpx;
display: flex;
align-items: center;
justify-content: center;
color: #AEBAC8;
}
.smofontsiez {
color: #AEBAC8;
font-size: 25rpx;
}
}
.indexcontentbttom-item-left-1 {
.indexcontentbttom-item-left-1-left {
width: 60rpx;
height: 60rpx;
padding-top: 6rpx;
border-radius: 6rpx;
font-weight: bold;
font-size: 25rpx;
color: #F43147;
background-color: #f4c9c5;
line-height: 27rpx;
text-align: center;
}
.indexcontentbttom-item-left-1-right {
text-align: left;
font-weight: 500;
font-size: 30rpx;
font-weight: bold;
color: #35393D;
9 months ago
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
9 months ago
}
}
}
.indexcontentbttom-item-rigth {
width: 85rpx;
height: 85rpx;
border-radius: 50%;
color: #ffffff;
text-align: center;
line-height: 85rpx;
background: #4379D6;
margin-top: 60rpx;
box-shadow: 0rpx 0rpx 19rpx 0rpx rgba(67, 121, 214, 0.3);
}
}
}
}
}
.u-nav-slot {
font-size: 22rpx;
}
.u-page__item__slot-icon {
width: 50rpx;
height: 50rpx;
}
/deep/.u-search__content {
.u-icon__img {
width: 15px !important;
height: 15px !important;
}
}
9 months ago
// /deep/.u-tabs__wrapper__nav__item {
// position: relative;
// .u-badge--not-dot {
// position: absolute;
// top: 10rpx;
// right: 50rpx;
// }
// }
9 months ago
/deep/.u-tabbar__content {
height: 120rpx;
}
9 months ago
</style>