|
@@ -1,17 +1,18 @@
|
|
|
<template>
|
|
|
<el-dialog
|
|
|
- :title="'任务列表'"
|
|
|
+ :title="'消息列表'"
|
|
|
:visible.sync="dialogVisible"
|
|
|
class="notice-pop"
|
|
|
@opened="popOpen"
|
|
|
width="50%">
|
|
|
<div class="np-bd">
|
|
|
- <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
|
|
|
- <el-tab-pane label="已处理" name="0">
|
|
|
- <noticePoplist ref="noticeDid" :getList="getListDid"></noticePoplist>
|
|
|
+ <el-tabs class="np-tabs" v-model="activeName" type="card" @tab-click="handleClick">
|
|
|
+ <el-tab-pane label="" name="0">
|
|
|
+ <span class="np-tabs-my-item" slot="label">未阅读<i v-if="noReadNum">{{noReadNum}}</i></span>
|
|
|
+ <taskPoplist ref="taskUndid" @update="getNoReadNum"></taskPoplist>
|
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane label="未处理" name="1">
|
|
|
- <noticePoplist ref="noticeUndid" :getList="getListDid"></noticePoplist>
|
|
|
+ <el-tab-pane label="已阅读" name="1">
|
|
|
+ <taskPoplist ref="taskDid"></taskPoplist>
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</div>
|
|
@@ -19,10 +20,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import noticePoplist from './notice-pop-list'
|
|
|
+import taskPoplist from './task-pop-list'
|
|
|
export default {
|
|
|
components: {
|
|
|
- noticePoplist
|
|
|
+ taskPoplist
|
|
|
},
|
|
|
props: {
|
|
|
|
|
@@ -35,20 +36,32 @@ export default {
|
|
|
firstPop: true,
|
|
|
dialogVisible: false,
|
|
|
activeName: '',
|
|
|
- tabsFirst: [false, false]
|
|
|
+ tabsFirst: [false, false],
|
|
|
+ noReadNum: ''
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
|
},
|
|
|
methods: {
|
|
|
+ getNoReadNum (num) {
|
|
|
+ if (num > 0) {
|
|
|
+ if (num > 9) {
|
|
|
+ this.noReadNum = '9+'
|
|
|
+ }
|
|
|
+
|
|
|
+ this.noReadNum = num + ''
|
|
|
+ } else {
|
|
|
+ this.noReadNum = ''
|
|
|
+ }
|
|
|
+ },
|
|
|
getListData () {
|
|
|
let noGet = this.tabsFirst[this.activeName]
|
|
|
if (!noGet) {
|
|
|
this.tabsFirst[this.activeName] = true
|
|
|
if (this.activeName === '0') {
|
|
|
- this.$refs.noticeDid.getData()
|
|
|
+ this.$refs.taskUndid.getList(0)
|
|
|
} else {
|
|
|
- this.$refs.noticeUndid.getData()
|
|
|
+ this.$refs.taskDid.getList(1)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -67,37 +80,6 @@ export default {
|
|
|
},
|
|
|
closePop () {
|
|
|
this.dialogVisible = false
|
|
|
- },
|
|
|
- getListDid (pageConfig, cb) {
|
|
|
- let config = {
|
|
|
- isDid: true
|
|
|
- }
|
|
|
- this.getList(config, pageConfig, cb)
|
|
|
- },
|
|
|
- ceshi (pageConfig, cb) {
|
|
|
- pageConfig.totalNum = 14
|
|
|
- let d = [{
|
|
|
- title: '常常的标题补平常',
|
|
|
- time: '2020-09-09 08:09:09'
|
|
|
- }]
|
|
|
- d = d.concat(d)
|
|
|
- d = d.concat(d)
|
|
|
- d = d.concat(d)
|
|
|
- cb(d)
|
|
|
- },
|
|
|
- getList (config, pageConfig, cb) {
|
|
|
- this.ceshi(pageConfig, cb)
|
|
|
- return
|
|
|
- this.$http.get('/monitor/selectBkSearchInfo', { params: { queryParam: config } }).then(({ data: res }) => {
|
|
|
- if (res.code !== '0') {
|
|
|
- return this.$message.error(res.msg)
|
|
|
- }
|
|
|
- let data = res.list
|
|
|
- pageConfig.totalNum = res.total
|
|
|
- cb(data)
|
|
|
- }).catch(() => {
|
|
|
-
|
|
|
- })
|
|
|
}
|
|
|
}
|
|
|
}
|