|
@@ -1,14 +1,7 @@
|
|
|
<template>
|
|
|
<view class="situationsCenter-page">
|
|
|
<view class="calender-remind" @click="toMessagePage">
|
|
|
- <image
|
|
|
- :src="
|
|
|
- messageType
|
|
|
- ? '/static/message-unread.png'
|
|
|
- : '/static/message-read.png'
|
|
|
- "
|
|
|
- mode=""
|
|
|
- ></image>
|
|
|
+ <image :src="`/static/message-${messageType? 'unread':'read'}.png`"></image>
|
|
|
</view>
|
|
|
<view class="situation-list">
|
|
|
<view class="search-box">
|
|
@@ -46,7 +39,7 @@
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
- <view class="situaions-add" @click="gotoCreate">
|
|
|
+ <view v-if="nowPermission == 1" class="situaions-add" @click="gotoCreate">
|
|
|
<image class="add-pic" src="/static/situation-add.png"></image>
|
|
|
</view>
|
|
|
<tm-tabbar :permission="nowPermission" />
|
|
@@ -116,30 +109,38 @@
|
|
|
url: `/pages/situationDetail/situationDetail?situationId=${id}`
|
|
|
});
|
|
|
},
|
|
|
- searchByKeywords(event){
|
|
|
- console.log(event);
|
|
|
+ getSituationList(data, callback) {
|
|
|
this.$store.dispatch({
|
|
|
type: 'situationsCenter/commActions',
|
|
|
payload: {
|
|
|
- key: 'situationList',
|
|
|
- data:{
|
|
|
- pageNum:1,
|
|
|
- pageSize:10,
|
|
|
- keyword:event.target.value,
|
|
|
- }
|
|
|
- }
|
|
|
- }).then((data)=>{
|
|
|
- if (data) {
|
|
|
- this.situationList=data.list.map((item,index)=>{
|
|
|
- return{
|
|
|
- name:item.name,
|
|
|
- checkStatus:item.checkStatus,
|
|
|
- nextCheckTime:item.nextCheckTime,
|
|
|
- checkGroupName:item.checkGroupName,
|
|
|
- topic:item.topic==0?true:false,
|
|
|
- }
|
|
|
- });
|
|
|
+ data,
|
|
|
+ key: 'situationList'
|
|
|
}
|
|
|
+ }).then((data)=> {
|
|
|
+ if(data) callback(data);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ searchByKeywords(event){
|
|
|
+ let data = {
|
|
|
+ pageNum:1,
|
|
|
+ pageSize:10,
|
|
|
+ keyword:event.target.value,
|
|
|
+ };
|
|
|
+ this.getSituationList(data,(data)=>{
|
|
|
+ this.situationList = [];
|
|
|
+ this.createSituationList(data.list);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ createSituationList(list=[]) {
|
|
|
+ list.map((item,index)=>{
|
|
|
+ this.situationList.push({
|
|
|
+ name:item.name,
|
|
|
+ checkStatus:item.checkStatus,
|
|
|
+ nextCheckTime:item.nextCheckTime,
|
|
|
+ checkGroupName:item.checkGroupName,
|
|
|
+ topic:item.topic==0?true:false,
|
|
|
+ situationID:item.id,
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
toLower(){
|
|
@@ -151,35 +152,18 @@
|
|
|
let count=this.situationList.length;
|
|
|
if(this.totalCount!=count){
|
|
|
this.page++;
|
|
|
- this.$store.dispatch({
|
|
|
- type: 'situationsCenter/commActions',
|
|
|
- payload: {
|
|
|
- key: 'situationList',
|
|
|
- data:{
|
|
|
- pageNum:this.page,
|
|
|
- pageSize:10
|
|
|
- }
|
|
|
- }
|
|
|
- }).then((data) => {
|
|
|
- if (data) {
|
|
|
- this.situationList=data.list.map((item,index)=>{
|
|
|
- return{
|
|
|
- name:item.name,
|
|
|
- checkStatus:item.checkStatus,
|
|
|
- nextCheckTime:item.nextCheckTime,
|
|
|
- checkGroupName:item.checkGroupName,
|
|
|
- topic:item.topic==0?true:false,
|
|
|
- situationID:item.id,
|
|
|
- }
|
|
|
- });
|
|
|
- let hiId = uni.getStorageSync("hiId");
|
|
|
- let user = uni.getStorageSync("id");
|
|
|
- let permission = uni.getStorageSync("nowPermission");
|
|
|
- this.isInitWs && this.initWebsocket(hiId, user, permission);
|
|
|
- }
|
|
|
+ let data = {
|
|
|
+ pageNum:this.page,
|
|
|
+ pageSize:10
|
|
|
+ };
|
|
|
+ this.getSituationList(data,(data)=>{
|
|
|
+ this.createSituationList(data.list);
|
|
|
+ let hiId = uni.getStorageSync("hiId");
|
|
|
+ let user = uni.getStorageSync("id");
|
|
|
+ let permission = uni.getStorageSync("nowPermission");
|
|
|
+ this.isInitWs && this.initWebsocket(hiId, user, permission);
|
|
|
});
|
|
|
- }
|
|
|
- else{
|
|
|
+ } else {
|
|
|
uni.showToast({
|
|
|
title:'没有更多数据了',
|
|
|
icon:'none',
|
|
@@ -193,10 +177,9 @@
|
|
|
url: `/pages/messages/messages`,
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
init(isInitWs) {
|
|
|
this.isInitWs = isInitWs;
|
|
|
- this.getSituationList();
|
|
|
+ this.initSituationList();
|
|
|
},
|
|
|
initWebsocket(hiId, user, permission) {
|
|
|
websocket.url = `ws://192.168.1.45:8088/imed/pfm/websocket/${hiId}/${user}/${permission}`;
|
|
@@ -214,34 +197,18 @@
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
|
- getSituationList(){
|
|
|
- this.$store.dispatch({
|
|
|
- type: 'situationsCenter/commActions',
|
|
|
- payload: {
|
|
|
- key: 'situationList',
|
|
|
- data:{
|
|
|
- pageNum:1,
|
|
|
- pageSize:10
|
|
|
- }
|
|
|
- }
|
|
|
- }).then((data) => {
|
|
|
- if (data) {
|
|
|
- this.totalCount=data.totalCount;
|
|
|
- this.situationList=data.list.map((item,index)=>{
|
|
|
- return{
|
|
|
- name:item.name,
|
|
|
- checkStatus:item.checkStatus,
|
|
|
- nextCheckTime:item.nextCheckTime,
|
|
|
- checkGroupName:item.checkGroupName,
|
|
|
- topic:item.topic==0?true:false,
|
|
|
- situationID:item.id,
|
|
|
- }
|
|
|
- });
|
|
|
- let hiId = uni.getStorageSync("hiId");
|
|
|
- let user = uni.getStorageSync("id");
|
|
|
- let permission = uni.getStorageSync("nowPermission");
|
|
|
- this.isInitWs && this.initWebsocket(hiId, user, permission);
|
|
|
- }
|
|
|
+ initSituationList(){
|
|
|
+ let data = {
|
|
|
+ pageNum:1,
|
|
|
+ pageSize:10
|
|
|
+ };
|
|
|
+ this.getSituationList(data, (data)=>{
|
|
|
+ this.totalCount=data.totalCount;
|
|
|
+ this.createSituationList(data.list);
|
|
|
+ let hiId = uni.getStorageSync("hiId");
|
|
|
+ let user = uni.getStorageSync("id");
|
|
|
+ let permission = uni.getStorageSync("nowPermission");
|
|
|
+ this.isInitWs && this.initWebsocket(hiId, user, permission);
|
|
|
});
|
|
|
},
|
|
|
messStatus(){
|
|
@@ -294,12 +261,10 @@
|
|
|
}
|
|
|
}
|
|
|
.situation-list{
|
|
|
- // display: flex;
|
|
|
- // flex-flow: row wrap;
|
|
|
- // margin-top: 12.5rpx;
|
|
|
position: relative;
|
|
|
+ height: 100%;
|
|
|
.search-box{
|
|
|
- position: absolute;
|
|
|
+ position: fixed;
|
|
|
left: 25rpx;
|
|
|
top: 0rpx;
|
|
|
z-index: 2;
|
|
@@ -369,12 +334,12 @@
|
|
|
}
|
|
|
|
|
|
.scroll-box{
|
|
|
- height: 1072.5rpx;
|
|
|
- width: 750rpx;
|
|
|
- // margin-top: 25rpx;
|
|
|
+ width: 100%;
|
|
|
+ height: calc(100% - 87.5rpx);
|
|
|
.content{
|
|
|
display: flex;
|
|
|
flex-flow: row wrap;
|
|
|
+ padding-bottom: 25rpx;
|
|
|
.situation{
|
|
|
height: 187.5rpx;
|
|
|
width: 337.5rpx;
|
|
@@ -447,7 +412,7 @@
|
|
|
|
|
|
}
|
|
|
.situaions-add{
|
|
|
- position: absolute;
|
|
|
+ position: fixed;
|
|
|
right: 25rpx;
|
|
|
bottom: 130rpx;
|
|
|
.add-pic{
|