提交 7baf82f9 编写于 作者: huangwensu's avatar huangwensu

系统消息接口调试

上级 585892a0
......@@ -51,9 +51,9 @@ export default {
vm.getToken()
},
mounted() {
setInterval(function(){
vm.pushMessage()
},60000)
// setInterval(function(){
// vm.pushMessage()
// },60000)
},
methods: {
// 解密token
......@@ -68,10 +68,12 @@ export default {
vm.token = paramMap["token"]
} else {
window.location.href = getLoginUrl() // 没有token返回登录页面
return
}
}else {
if(!localStorage.getItem('storageToken')) {
window.location.href = getLoginUrl() // 没有token返回登录页面
return
}
}
vm.changeToken(vm.token)
......@@ -92,7 +94,17 @@ export default {
]),
// 获取用户权限
getUserAuth(token) {
vm.GET('common/v1/role',{token: token}).then((res) => {
let req = null
if(localStorage.getItem('storageToken')) {
req = {
token: localStorage.getItem('storageToken')
}
} else {
req = {
token: token
}
}
vm.GET('common/v1/role',req).then((res) => {
if(res.code == '000000') {
vm.changeIdType(res.data.idType)
vm.idType = res.data.idType
......
<template>
<div class="home-wrap">
<bread-crumb :curmbFirst="curmbFirst"></bread-crumb>
<div class="message-content screenSet">
<div class="message-content">
<el-row>
<el-col class="visitor" :span="24">
<el-col class="visitor" :span="24" v-if="tableData.length > 0">
<div class="visitor-title">
<div class="title">今日随访:<span style="color:#449284;">10人</span></div>
<span class="visitor-more" @click="lookMore">查看更多</span>
......@@ -19,22 +19,24 @@
</el-table>
</div>
</el-col>
<el-col class="message" :span="24">
<div class="message-title">系统消息 <span>今日消息:3</span></div>
<div class="message-info" v-if="messageList">
<el-col class="message screenSet" :span="24">
<div class="message-title">系统消息 <span>今日消息:{{count}}</span></div>
<div class="message-info" v-if="messageList.length > 0">
<div class="message-item" v-for="(item,index) in messageList" :key="index">
<div class="text-top">
<i class="el-icon-error" v-if="item.type == 2" style="color:#FA5555"></i>
<i class="el-icon-success" v-if="item.type == 3" style="color:#67C23A"></i>
<i class="el-icon-warning" v-if="item.type == 1" style="color:#FAAD14"></i>
<span>{{item.status}}</span>
<span>{{item.date}}</span>
<span>{{item.menuName}}</span>
<span>{{item.portalTime}}</span>
</div>
<div class="text-bottom">{{item.info}}</div>
<div class="text-bottom">{{item.content}}</div>
</div>
</div>
<div v-else>
<div class="no-message" v-else>
<div>
<img src="../assets/image/noData.png"/>
</div>
</div>
</el-col>
</el-row>
......@@ -44,6 +46,7 @@
<script>
import BreadCrumb from '../components/breadcrumb.vue'
import { setTimeout, setInterval } from 'timers'
import { mapGetters } from 'vuex'
let vm = null
export default {
components: {
......@@ -54,50 +57,50 @@ export default {
curmbFirst: '数据总览',
spanFirstNum: 12,
spanSecondNum: 12,
tableData: [
{
date: '2016-05-02',
name: '王小虎',
style: '电话随访',
content: '糖尿病患者第20190228定期随访登记'
},{
date: '2016-05-02',
name: '王小虎',
style: '电话随访',
content: '糖尿病患者第20190228定期随访登记'
},{
date: '2016-05-02',
name: '王小虎',
style: '电话随访',
content: '糖尿病患者第20190228定期随访登记'
}
],
messageList:[{
status: '审核提醒',
type: 1,
date: '2019-01-02',
info: '王小波创建了"浙江省2019高血压第一季度考试"项目,提醒您审核。'
},{
status: '审核未通过',
type: 2,
date: '2019-01-02',
info: '王小波创建了"浙江省2019高血压第一季度考试"项目,提醒您审核。'
},{
status: '审核通过',
type: 3,
date: '2019-01-02',
info: '王小波创建了"浙江省2019高血压第一季度考试"项目,提醒您审核。'
}]
tableData: [],
count: 0,
messageList:[
// {
// menuName: '审核提醒',
// type: 1,
// portalTime: '2019-01-02',
// content: '王小波创建了"浙江省2019高血压第一季度考试"项目,提醒您审核。'
// },{
// menuName: '审核未通过',
// type: 2,
// portalTime: '2019-01-02',
// content: '王小波创建了"浙江省2019高血压第一季度考试"项目,提醒您审核。'
// },{
// menuName: '审核通过',
// type: 3,
// portalTime: '2019-01-02',
// content: '王小波创建了"浙江省2019高血压第一季度考试"项目,提醒您审核。'
// }
]
}
},
created() {
vm = this
vm.getSystemData()
},
computed: {
...mapGetters([
'_token'
])
},
methods: {
// 查看更多
lookMore() {
},
// 获取系统消息数据
getSystemData() {
vm.GET('portalMessage/queryPortalMessageInfo',{token: vm._token, pageNo: 1, pageSize: 15}).then((res) => {
if( res.code == '000000') {
vm.messageList = res.data.portalMessageModels
vm.count = res.data.count
}
})
}
}
}
......@@ -169,7 +172,13 @@ export default {
}
}
}
.no-message {
text-align: center;
img {
width: 100px;
margin-top: 17%;
}
}
}
}
</style>
......
......@@ -35,7 +35,7 @@ export default {
},
data() {
return {
name: 'hws',
name: '',
systemInfoList: []
}
},
......@@ -46,6 +46,7 @@ export default {
methods: {
handleCommand(command) {
if (command === 'logout') {
localStorage.removeItem('storageToken')
if(vm.idType == 1) { // 内部
window.location.href = getInnerLoginUrl()
} else {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册