|
@@ -1,31 +1,93 @@
|
|
|
<template>
|
|
|
<div id="index">
|
|
|
<el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <p>index</p>
|
|
|
+ <el-col :span="24" class="main">
|
|
|
+ <breadcrumb :breadcrumbTitle="this.$route.meta.title"></breadcrumb>
|
|
|
+ <el-col :span="24" class="container">
|
|
|
+ <el-col :span="24" class="top">
|
|
|
+ <el-button type="primary" size="mini" @click="dialog = true">添加</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="list">
|
|
|
+ <data-table :fields="fields" :opera="opera" :data="list" :total="total" @edit="toEdit" @delete="toDelete" @query="search"></data-table>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import breadcrumb from '@c/common/breadcrumb.vue';
|
|
|
+import dataTable from '@/components/frame/filter-page-table.vue';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: mapColumn } = createNamespacedHelpers('talentColumn');
|
|
|
export default {
|
|
|
metaInfo() {
|
|
|
return { title: this.$route.meta.title };
|
|
|
},
|
|
|
name: 'index',
|
|
|
props: {},
|
|
|
- components: {},
|
|
|
+ components: {
|
|
|
+ breadcrumb,
|
|
|
+ dataTable,
|
|
|
+ },
|
|
|
data: function() {
|
|
|
- return {};
|
|
|
+ return {
|
|
|
+ opera: [
|
|
|
+ {
|
|
|
+ label: '修改',
|
|
|
+ icon: 'el-icon-edit',
|
|
|
+ method: 'edit',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '删除',
|
|
|
+ icon: 'el-icon-delete',
|
|
|
+ method: 'delete',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ fields: [{ label: '名称', prop: 'name' }],
|
|
|
+ list: [],
|
|
|
+ total: 0,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...mapColumn(['query', 'delete']),
|
|
|
+ // 查询列表
|
|
|
+ async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
+ const res = await this.query({ skip, limit, ...info });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 修改
|
|
|
+ toEdit({ data }) {},
|
|
|
+ // 删除
|
|
|
+ async toDelete({ data }) {
|
|
|
+ const res = await this.delete(data.id);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$message({
|
|
|
+ message: '刪除成功',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ this.search();
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
- created() {},
|
|
|
- methods: {},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style lang="less" scoped></style>
|
|
|
+<style lang="less" scoped>
|
|
|
+.main {
|
|
|
+ .top {
|
|
|
+ text-align: right;
|
|
|
+ margin: 15px 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|