|
@@ -38,7 +38,7 @@
|
|
|
<!-- 公告列表 -->
|
|
|
<div class="notice-list">
|
|
|
<i class="el-icon-tickets"> 公告列表</i>
|
|
|
- <el-button id="addBtn" size="small">添加</el-button>
|
|
|
+ <el-button id="addBtn" size="small" @click="addNoticce">添加</el-button>
|
|
|
</div>
|
|
|
<!-- 数据栏 -->
|
|
|
<div class="data-list">
|
|
@@ -48,7 +48,9 @@
|
|
|
<el-table-column prop="publishTime" label="发布时间"> </el-table-column>
|
|
|
<el-table-column prop="operation" label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button size="mini" type="text">查看详情</el-button>
|
|
|
+ <el-button size="mini" type="text" @click="viewDetails(scope.$index)"
|
|
|
+ >查看详情</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
id="deleteBtn"
|
|
|
size="mini"
|
|
@@ -181,16 +183,14 @@ export default {
|
|
|
mockNoticeList: [],
|
|
|
total: 0,
|
|
|
pageSize: 5,
|
|
|
- totalNum:"",
|
|
|
+ totalNum: "",
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
//获取总条目的id
|
|
|
- this.totalNum = document.querySelector('#dataNum');
|
|
|
+ this.totalNum = document.querySelector("#dataNum");
|
|
|
this.getMockNoticeList();
|
|
|
this.getTableList();
|
|
|
-
|
|
|
-
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
@@ -220,8 +220,23 @@ export default {
|
|
|
},
|
|
|
// 删除按钮
|
|
|
deleteBtn(row) {
|
|
|
- this.tableData.splice(this.tableData[row],1)
|
|
|
- // console.log(this.tableData[row].id)
|
|
|
+ this.tableData.splice(this.tableData[row], 1);
|
|
|
+ // console.log(this.tableData[row].title)
|
|
|
+ // console.log(this.tableData[row].publishTime)
|
|
|
+ },
|
|
|
+ //添加公告 点击按钮跳转到添加公告页面
|
|
|
+ addNoticce() {
|
|
|
+ this.$router.push("/noticeList/addNotice");
|
|
|
+ },
|
|
|
+ //查看详情按钮 点击按钮跳转到公告详情页面
|
|
|
+ viewDetails(row) {
|
|
|
+ this.$router.push({
|
|
|
+ name: "noticeDetails",
|
|
|
+ query:{
|
|
|
+ publishTime:'时间',
|
|
|
+ title:'标题'
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
},
|
|
|
};
|