提交 cf51533d 编写于 作者: laizhilong's avatar laizhilong

获取消息列表

上级 52c86c17
......@@ -21,7 +21,7 @@
</el-col>
<el-col :span="6" :draggable="false">
<el-tag :type="myTask.name.indexOf('驳回')!=-1?'danger':(myTask.name.indexOf('成功')!=-1?'success':(myTask.name.indexOf('取消')!=-1?'info':'-'))"
size="small" @click="handleTag(myTask.id)"
size="small" @click="handleTag(myTask)"
style="cursor: pointer;" :draggable="false">
{{myTask.name}}
</el-tag>
......@@ -45,7 +45,7 @@
</el-col>
<el-col :span="6" :draggable="false">
<el-tag :type="myMsg.name.indexOf('驳回')!=-1?'danger':(myMsg.name.indexOf('成功')!=-1?'success':(myMsg.name.indexOf('取消')!=-1?'info':'-'))"
size="small" @click="handleTag(myMsg.id)"
size="small" @click="handleTag(myMsg)"
style="cursor: pointer;" :draggable="false">
{{myMsg.name}}
</el-tag>
......@@ -113,23 +113,35 @@
const data: any = response.data;
if (data && data.length > 0) {
this.myTasks = data;
this.myMsgs = data;
this.showIsDot = true;
} else {
this.myTasks = [];
this.myMsgs = [];
}
// 获取消息列表
this.getMyMsgs();
}
}).catch((error: any) => {
this.$Notice.error({title: '错误', desc: error});
})
}
/**
* 获取消息列表
*/
public getMyMsgs(){
this.myMsgs = this.myTasks;
if (this.myMsgs.length > 0 && this.myTasks.length == 0) {
// 显示小圆点
this.showIsDot = true;
}
}
/**
* 点击标签事件
*/
public handleTag(data: any) {
alert("点击了" + data);
alert(JSON.stringify(data));
}
/**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册