|
@@ -1,7 +1,15 @@
|
|
|
<template>
|
|
|
<div id="index">
|
|
|
<el-row>
|
|
|
- <el-col :span="24" class="main animate__animated animate__backInRight"> test </el-col>
|
|
|
+ <el-col :span="24" class="main animate__animated animate__backInRight">
|
|
|
+ <el-col :span="24" class="one">
|
|
|
+ <data-table :fields="fields" :opera="opera" :data="list" :total="total" @query="search" @edit="toEdit" @delete="toDelete">
|
|
|
+ <template #selfbtn>
|
|
|
+ <el-button type="primary" size="mini" @click="toAdd">添加</el-button>
|
|
|
+ </template>
|
|
|
+ </data-table>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -13,10 +21,37 @@ export default {
|
|
|
props: {},
|
|
|
components: {},
|
|
|
data: function () {
|
|
|
- return {};
|
|
|
+ return {
|
|
|
+ list: [],
|
|
|
+ total: 0,
|
|
|
+ opera: [
|
|
|
+ { label: '修改', method: 'edit' },
|
|
|
+ { label: '删除', method: 'delete', type: 'danger' },
|
|
|
+ ],
|
|
|
+ fields: [
|
|
|
+ { label: '标题', prop: 'title', filter: 'input' },
|
|
|
+ { label: '信息', prop: 'content' },
|
|
|
+ ],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async search({ skip = 0, limit = 10, ...info } = {}) {},
|
|
|
+ // 添加
|
|
|
+ toAdd() {
|
|
|
+ this.$router.push({ path: '/user/detail' });
|
|
|
+ },
|
|
|
+ // 修改
|
|
|
+ toEdit({ data }) {
|
|
|
+ this.$router.push({ path: '/user/detail', query: { id: data.id } });
|
|
|
+ },
|
|
|
+ // 删除
|
|
|
+ async toDelete({ data }) {
|
|
|
+ console.log(data);
|
|
|
+ },
|
|
|
},
|
|
|
- created() {},
|
|
|
- methods: {},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|
|
|
},
|