|
@@ -1,31 +1,153 @@
|
|
|
<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="$router.push({ path: '/links/detail' })">添加</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="list">
|
|
|
+ <data-table
|
|
|
+ :fields="fields"
|
|
|
+ :opera="opera"
|
|
|
+ :data="list"
|
|
|
+ :total="total"
|
|
|
+ :toFormat="toFormat"
|
|
|
+ @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: talentRecruitment } = createNamespacedHelpers('talentRecruitment');
|
|
|
+const { mapActions: talentColumn } = 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: 'license', showTip: true },
|
|
|
+ { label: '招聘信息名称', prop: 'name', showTip: true, filter: 'input' },
|
|
|
+ { label: '所属栏目', prop: 'column_id', showTip: true, format: true },
|
|
|
+ { label: '职位月薪', prop: 'salary' },
|
|
|
+ {
|
|
|
+ label: '工作性质',
|
|
|
+ prop: 'job_nature',
|
|
|
+ format: item => {
|
|
|
+ return item === '0' ? '兼职' : '全职';
|
|
|
+ },
|
|
|
+ },
|
|
|
+ { label: '公司名称', prop: 'profession', showTip: true },
|
|
|
+ { label: '公司地址', prop: 'workplace', showTip: true },
|
|
|
+ { label: '工作经验', prop: 'workexp' },
|
|
|
+ { label: '学历', prop: 'education', showTip: true },
|
|
|
+ { label: '招聘人数', prop: 'people_number' },
|
|
|
+ ],
|
|
|
+ list: [],
|
|
|
+ total: 0,
|
|
|
+ // 栏目列表
|
|
|
+ column: [],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.searchcolumn();
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...talentRecruitment(['query', 'delete', 'fetch']),
|
|
|
+ ...talentColumn({ columnquery: 'query' }),
|
|
|
+ // 查询列表
|
|
|
+ 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);
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.errmsg,
|
|
|
+ type: 'error',
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 过滤栏目
|
|
|
+ toFormat({ model, value }) {
|
|
|
+ if (model == 'column_id') {
|
|
|
+ const res = this.column.find(f => f.id == value);
|
|
|
+ if (res) return res.name;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 修改
|
|
|
+ toEdit({ data }) {},
|
|
|
+ // 删除
|
|
|
+ async toDelete({ data }) {
|
|
|
+ const res = await this.delete(data.id);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$message({
|
|
|
+ message: '刪除成功',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ this.search();
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.errmsg,
|
|
|
+ type: 'error',
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 查询栏目
|
|
|
+ async searchcolumn() {
|
|
|
+ const res = await this.columnquery();
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `column`, res.data);
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.errmsg,
|
|
|
+ type: 'error',
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
- created() {},
|
|
|
- methods: {},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style lang="less" scoped></style>
|
|
|
+<style lang="less" scoped>
|
|
|
+.main {
|
|
|
+ .top {
|
|
|
+ text-align: right;
|
|
|
+ margin: 15px 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|