|  | @@ -0,0 +1,78 @@
 | 
	
		
			
				|  |  | +<template>
 | 
	
		
			
				|  |  | +  <div>
 | 
	
		
			
				|  |  | +    <el-button type="primary" @click="reportDetailed()">新增</el-button>
 | 
	
		
			
				|  |  | +    <el-table :data="tableData" border style="width:100%">
 | 
	
		
			
				|  |  | +      <el-table-column prop="id" label="序号" width="180"></el-table-column>
 | 
	
		
			
				|  |  | +      <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>
 | 
	
		
			
				|  |  | +          <el-button @click="deleteReport(scope.row.id)" type="danger">删除</el-button>
 | 
	
		
			
				|  |  | +          <!-- <el-popconfirm
 | 
	
		
			
				|  |  | +            okText="是"
 | 
	
		
			
				|  |  | +            cancelText="否"
 | 
	
		
			
				|  |  | +            @onConfirm="deleteReport(scope.row.id)"
 | 
	
		
			
				|  |  | +            title="确认要删除此条内容吗?"
 | 
	
		
			
				|  |  | +          >
 | 
	
		
			
				|  |  | +            <el-button type="danger">删除</el-button>
 | 
	
		
			
				|  |  | +          </el-popconfirm>-->
 | 
	
		
			
				|  |  | +        </template>
 | 
	
		
			
				|  |  | +      </el-table-column>
 | 
	
		
			
				|  |  | +    </el-table>
 | 
	
		
			
				|  |  | +    <add-or-up
 | 
	
		
			
				|  |  | +      ref="AddOrUpdate"
 | 
	
		
			
				|  |  | +      :visible.sync="addOrUpdateVisible"
 | 
	
		
			
				|  |  | +      :id="id"
 | 
	
		
			
				|  |  | +      @deClose="()=>{addOrUpdateVisible=false}"
 | 
	
		
			
				|  |  | +      @getReport="getReport"
 | 
	
		
			
				|  |  | +    />
 | 
	
		
			
				|  |  | +  </div>
 | 
	
		
			
				|  |  | +</template>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +<script>
 | 
	
		
			
				|  |  | +import { reportList, reportDelete } from "@/api/report";
 | 
	
		
			
				|  |  | +import addOrUp from "./reportDetailed";
 | 
	
		
			
				|  |  | +export default {
 | 
	
		
			
				|  |  | +  name: "report",
 | 
	
		
			
				|  |  | +  components: {
 | 
	
		
			
				|  |  | +    addOrUp
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  | +  data() {
 | 
	
		
			
				|  |  | +    return { tableData: [], addOrUpdateVisible: false, id: null };
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  | +  created() {
 | 
	
		
			
				|  |  | +    this.getReport();
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  | +  methods: {
 | 
	
		
			
				|  |  | +    getReport: function() {
 | 
	
		
			
				|  |  | +      console.log(reportList);
 | 
	
		
			
				|  |  | +      reportList().then(res => {
 | 
	
		
			
				|  |  | +        this.tableData = res.data.results;
 | 
	
		
			
				|  |  | +        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 => {
 | 
	
		
			
				|  |  | +        console.log("delete成功");
 | 
	
		
			
				|  |  | +        console.log(res);
 | 
	
		
			
				|  |  | +        this.$message({
 | 
	
		
			
				|  |  | +          message: "删除成功",
 | 
	
		
			
				|  |  | +          type: "warning"
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +        this.getReport();
 | 
	
		
			
				|  |  | +      });
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    deClose: function() {
 | 
	
		
			
				|  |  | +      this.addOrUpdateVisible = false;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +</script>
 |