|
@@ -10,7 +10,7 @@
|
|
|
<view class="tab-item" :class="activeTab===3?'active':''" @click="tabChange(-1,3)">已撤销</view>
|
|
|
</view>
|
|
|
<view class="part-cont">
|
|
|
- <view class="item" v-for="item in taskList" :key="item.taskId">
|
|
|
+ <view class="item" v-for="item in items" :key="item.taskId">
|
|
|
<view class="title">
|
|
|
<view class="name">{{item.taskTitle}}</view>
|
|
|
<view class="state">{{taskStatus(item.status)}}</view>
|
|
@@ -35,6 +35,36 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="part" v-if="type==='warn'">
|
|
|
+ <view class="tab">
|
|
|
+ <view class="tab-item" :class="activeTab===1?'active':''" @click="tabChange(0,1)">待处理</view>
|
|
|
+ <view class="tab-item" :class="activeTab===2?'active':''" @click="tabChange(1,2)">已处理</view>
|
|
|
+ <view class="tab-item" :class="activeTab===3?'active':''" @click="tabChange(-1,3)">已撤销</view>
|
|
|
+ </view>
|
|
|
+ <view class="part-cont">
|
|
|
+ <view class="item" v-for="item in items" :key="item.warnId">
|
|
|
+ <view class="title">
|
|
|
+ <view class="name">{{item.warnTitle}}</view>
|
|
|
+ <view class="state">{{warningStatus(item.status)}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="tags">
|
|
|
+ <text class="tag">{{alertLevel(item.warnLevel)}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="time">
|
|
|
+ 发生时间:{{item.warnTime}}
|
|
|
+ </view>
|
|
|
+ <view class="bottom" v-if="item.handleAccountName">
|
|
|
+ <view class="user">
|
|
|
+ <image class="avatar" src="/static/index/user.png" mode="widthFix"></image>
|
|
|
+ 处理人:{{item.handleAccountName}}
|
|
|
+ </view>
|
|
|
+ <view class="hand-time">
|
|
|
+ {{item.handleTime}}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<view class="part" v-if="type==='alert'">
|
|
|
<view class="tab">
|
|
|
<view class="tab-item" :class="activeTab===1?'active':''" @click="tabChange(0,1)">待处理</view>
|
|
@@ -42,7 +72,7 @@
|
|
|
<view class="tab-item" :class="activeTab===3?'active':''" @click="tabChange(-1,3)">已撤销</view>
|
|
|
</view>
|
|
|
<view class="part-cont">
|
|
|
- <view class="item" v-for="item in alertList" :key="item.alertId">
|
|
|
+ <view class="item" v-for="item in items" :key="item.alertId">
|
|
|
<view class="title">
|
|
|
<view class="name">{{item.alertTitle}}</view>
|
|
|
<view class="state">{{alertStatus(item.status)}}</view>
|
|
@@ -51,15 +81,15 @@
|
|
|
<text class="tag">{{alertLevel(item.alertLevel)}}</text>
|
|
|
</view>
|
|
|
<view class="time">
|
|
|
- 发生时间:{{item.alertTime}}
|
|
|
+ 发生时间:{{item.warnTime}}
|
|
|
</view>
|
|
|
- <view class="bottom">
|
|
|
+ <view class="bottom" v-if="item.handleAccountName">
|
|
|
<view class="user">
|
|
|
<image class="avatar" src="/static/index/user.png" mode="widthFix"></image>
|
|
|
处理人:{{item.handleAccountName}}
|
|
|
</view>
|
|
|
<view class="hand-time">
|
|
|
- {{item.handleTime}}
|
|
|
+ {{item.warnTime}}
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -73,7 +103,7 @@
|
|
|
<view class="tab-item" :class="activeTab===4?'active':''" @click="tabChange(-1,4)">我撤销</view>
|
|
|
</view>
|
|
|
<view class="part-cont">
|
|
|
- <view class="item" v-for="item in dangerList" :key="item.dangerId">
|
|
|
+ <view class="item" v-for="item in items" :key="item.dangerId">
|
|
|
<view class="title">
|
|
|
<view class="name">{{item.dangerTitle}}</view>
|
|
|
<view class="state">{{dangerStatus(item.status)}}</view>
|
|
@@ -111,10 +141,12 @@
|
|
|
import { getAlertByPage } from '@/api/aqpt/alertApi.js';
|
|
|
import { getDangerByPage } from '@/api/aqpt/dangerApi.js';
|
|
|
import { getTaskByPage } from '@/api/aqpt/taskApi.js';
|
|
|
+ import { getWarningByPage } from '@/api/aqpt/warning.js';
|
|
|
import{
|
|
|
taskStatus,taskPriority,taskType,
|
|
|
alertLevel,alertStatus,
|
|
|
dangerStatus,dangerLevel,
|
|
|
+ warningLevel,warningStatus
|
|
|
} from '@/libs/enum.js';
|
|
|
export default {
|
|
|
data() {
|
|
@@ -128,9 +160,7 @@
|
|
|
status:0
|
|
|
},
|
|
|
total:0,
|
|
|
- alertList:[],
|
|
|
- dangerList:[],
|
|
|
- taskList:[]
|
|
|
+ items:[]
|
|
|
}
|
|
|
},
|
|
|
onLoad({type,name}) {
|
|
@@ -146,6 +176,7 @@
|
|
|
taskStatus,taskPriority,taskType,
|
|
|
alertLevel,alertStatus,
|
|
|
dangerStatus,dangerLevel,
|
|
|
+ warningLevel,warningStatus,
|
|
|
getData(){
|
|
|
if(this.type==='task'){
|
|
|
this.getTaskByPage()
|
|
@@ -157,28 +188,45 @@
|
|
|
if(this.type==='alert'){
|
|
|
this.getAlertByPage()
|
|
|
}
|
|
|
+ if(this.type==='warn'){
|
|
|
+ this.getWarningByPage()
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ getWarningByPage(){
|
|
|
+ let items=JSON.parse(JSON.stringify(this.items))
|
|
|
+ getWarningByPage(this.conditions).then((res)=>{
|
|
|
+ this.items=items.concat(res.data)
|
|
|
+ this.total=res.total
|
|
|
+ })
|
|
|
},
|
|
|
getAlertByPage(){
|
|
|
+ let items=JSON.parse(JSON.stringify(this.items))
|
|
|
getAlertByPage(this.conditions).then((res)=>{
|
|
|
- this.alertList=res.data
|
|
|
+ this.items=items.concat(res.data)
|
|
|
this.total=res.total
|
|
|
})
|
|
|
},
|
|
|
getDangerByPage(){
|
|
|
+ let items=JSON.parse(JSON.stringify(this.items))
|
|
|
getDangerByPage(this.conditions).then((res)=>{
|
|
|
- this.dangerList=res.data
|
|
|
+ this.items=items.concat(res.data)
|
|
|
this.total=res.total
|
|
|
})
|
|
|
},
|
|
|
getTaskByPage(){
|
|
|
+ let items=JSON.parse(JSON.stringify(this.items))
|
|
|
getTaskByPage(this.conditions).then((res)=>{
|
|
|
- this.taskList=res.data
|
|
|
+ this.items=items.concat(res.data)
|
|
|
this.total=res.total
|
|
|
})
|
|
|
},
|
|
|
tabChange(value,index){
|
|
|
this.activeTab=index
|
|
|
- if(this.type==='task'){
|
|
|
+ this.total=0,
|
|
|
+ this.items=[]
|
|
|
+ this.conditions= {page: 1,limit: 10}
|
|
|
+ if(this.type==='task'||this.type==='alert'||this.type==='warn'){
|
|
|
this.conditions.status=value
|
|
|
}
|
|
|
if(this.type==='danger'){
|
|
@@ -192,19 +240,14 @@
|
|
|
this.conditions.submitAccountId = this.user.userId
|
|
|
this.conditions.status = -1
|
|
|
}
|
|
|
- }
|
|
|
- if(this.type==='alert'){
|
|
|
- this.conditions.status=value
|
|
|
- }
|
|
|
+ }
|
|
|
this.getData()
|
|
|
},
|
|
|
onPullDownRefresh() {
|
|
|
this.activeTab=1,
|
|
|
this.conditions= {page: 1,limit: 10},
|
|
|
this.total=0,
|
|
|
- this.alertList=[]
|
|
|
- this.dangerList=[]
|
|
|
- this.taskList=[]
|
|
|
+ this.items=[]
|
|
|
this.getData()
|
|
|
uni.stopPullDownRefresh()
|
|
|
},
|
|
@@ -284,7 +327,7 @@
|
|
|
}
|
|
|
}
|
|
|
.time{
|
|
|
- padding-top: 20rpx;
|
|
|
+ padding-top: 20rpx;
|
|
|
font-size: 28rpx;
|
|
|
color:rgba(241, 57, 57, 0.8);
|
|
|
}
|