|
@@ -6,6 +6,7 @@
|
|
|
<el-table-column prop="title" label="标题" width="180"></el-table-column>
|
|
|
<el-table-column prop="content" label="内容" width="180"></el-table-column>
|
|
|
<el-table-column prop="create_at" label="创建时间"></el-table-column>
|
|
|
+
|
|
|
<el-table-column label="操作">
|
|
|
<template slot-scope="scope" width="200px0">
|
|
|
<el-button type="primary" @click="reportDetailed(scope.row.id)">编辑</el-button>
|
|
@@ -21,6 +22,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
+ <!-- 分页 -->
|
|
|
<el-pagination
|
|
|
background
|
|
|
layout="total,prev, pager, next"
|
|
@@ -28,6 +30,7 @@
|
|
|
@current-change="handleSizeChange"
|
|
|
:total="reportTotal"
|
|
|
></el-pagination>
|
|
|
+ <!-- 子组件、提供弹窗新增、修改 -->
|
|
|
<add-or-up
|
|
|
ref="AddOrUpdate"
|
|
|
:visible.sync="addOrUpdateVisible"
|
|
@@ -60,6 +63,7 @@ export default {
|
|
|
this.getReport();
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 获取所有日报
|
|
|
getReport: function() {
|
|
|
console.log(reportList);
|
|
|
reportList(3, 0).then(res => {
|
|
@@ -68,11 +72,13 @@ export default {
|
|
|
console.log(res);
|
|
|
});
|
|
|
},
|
|
|
+ // 打开弹窗
|
|
|
reportDetailed: function(status) {
|
|
|
console.log(status);
|
|
|
this.addOrUpdateVisible = true;
|
|
|
this.id = status;
|
|
|
},
|
|
|
+ // 删除日报按钮
|
|
|
deleteReport: function(id) {
|
|
|
console.log("delete:" + id);
|
|
|
reportDelete(id).then(res => {
|
|
@@ -85,9 +91,11 @@ export default {
|
|
|
this.getReport();
|
|
|
});
|
|
|
},
|
|
|
+ // 关闭弹窗、给子组件触发
|
|
|
deClose: function() {
|
|
|
this.addOrUpdateVisible = false;
|
|
|
},
|
|
|
+ // 分页组件自动触发、修改分页大小时
|
|
|
handleSizeChange: function(val) {
|
|
|
reportList(this.limit, (val - 1) * this.limit).then(res => {
|
|
|
this.tableData = res.data.results;
|