代码改造完成,加入多字典查询方式
This commit is contained in:
@@ -1,6 +1,25 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<eHeader :query="query" :dicts="dicts"/>
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.value" clearable placeholder="输入岗位名称搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
|
||||
<el-select v-model="query.enabled" clearable placeholder="状态" class="filter-item" style="width: 90px" @change="toQuery">
|
||||
<el-option v-for="item in enabledTypeOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
|
||||
</el-select>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||
<!-- 新增 -->
|
||||
<div v-permission="['ADMIN','USERJOB_ALL','USERJOB_CREATE']" style="display: inline-block;margin: 0px 2px;">
|
||||
<el-button
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="add">新增</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
<eForm ref="form" :is-add="isAdd" :dicts="dicts"/>
|
||||
<!--表格渲染-->
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||
<el-table-column prop="name" label="名称"/>
|
||||
@@ -28,7 +47,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column v-if="checkPermission(['ADMIN','USERJOB_ALL','USERJOB_EDIT','USERJOB_DELETE'])" label="操作" width="130px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<edit v-permission="['ADMIN','USERJOB_ALL','USERJOB_EDIT']" :dicts="dicts" :data="scope.row" :sup_this="sup_this"/>
|
||||
<el-button v-permission="['ADMIN','USERJOB_ALL','USERJOB_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
|
||||
<el-popover
|
||||
v-permission="['ADMIN','USERJOB_ALL','USERJOB_DELETE']"
|
||||
:ref="scope.row.id"
|
||||
@@ -61,14 +80,17 @@ import initData from '@/mixins/initData'
|
||||
import initDict from '@/mixins/initDict'
|
||||
import { del } from '@/api/job'
|
||||
import { parseTime } from '@/utils/index'
|
||||
import eHeader from './module/header'
|
||||
import edit from './module/edit'
|
||||
import eForm from './form'
|
||||
export default {
|
||||
components: { eHeader, edit },
|
||||
components: { eForm },
|
||||
mixins: [initData, initDict],
|
||||
data() {
|
||||
return {
|
||||
delLoading: false, sup_this: this
|
||||
delLoading: false,
|
||||
enabledTypeOptions: [
|
||||
{ key: 'true', display_name: '正常' },
|
||||
{ key: 'false', display_name: '禁用' }
|
||||
]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -109,6 +131,26 @@ export default {
|
||||
this.$refs[id].doClose()
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
add() {
|
||||
this.isAdd = true
|
||||
this.$refs.form.getDepts()
|
||||
this.$refs.form.dialog = true
|
||||
},
|
||||
edit(data) {
|
||||
this.isAdd = false
|
||||
const _this = this.$refs.form
|
||||
_this.getDepts()
|
||||
_this.form = {
|
||||
id: data.id,
|
||||
name: data.name,
|
||||
sort: data.sort,
|
||||
enabled: data.enabled.toString(),
|
||||
createTime: data.createTime,
|
||||
dept: { id: data.dept.id }
|
||||
}
|
||||
_this.deptId = data.dept.id
|
||||
_this.dialog = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user