代码改造完成,加入多字典查询方式
This commit is contained in:
@@ -1,6 +1,31 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<eHeader :query="query"/>
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.value" clearable placeholder="输入名称搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||
<!-- 新增 -->
|
||||
<div v-permission="['ADMIN','PERMISSION_ALL','PERMISSION_CREATE']" style="display: inline-block;margin: 0px 2px 0px">
|
||||
<el-button
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="add">新增</el-button>
|
||||
</div>
|
||||
<div style="display: inline-block;">
|
||||
<el-button
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="warning"
|
||||
icon="el-icon-more"
|
||||
@click="changeExpand">{{ $parent.expand ? '折叠' : '展开' }}</el-button>
|
||||
<eForm ref="form" :is-add="true"/>
|
||||
</div>
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
<eForm ref="form" :is-add="isAdd"/>
|
||||
<!--表格渲染-->
|
||||
<tree-table v-loading="loading" :data="data" :expand-all="expand" :columns="columns" size="small">
|
||||
<el-table-column prop="createTime" label="创建日期">
|
||||
@@ -10,7 +35,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column v-if="checkPermission(['ADMIN','PERMISSION_ALL','PERMISSION_EDIT','PERMISSION_DELETE'])" label="操作" width="130px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<edit v-permission="['ADMIN','PERMISSION_ALL','PERMISSION_EDIT']" :data="scope.row" :sup_this="sup_this"/>
|
||||
<el-button v-permission="['ADMIN','PERMISSION_ALL','PERMISSION_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
|
||||
<el-popover
|
||||
v-permission="['ADMIN','PERMISSION_ALL','PERMISSION_DELETE']"
|
||||
:ref="scope.row.id"
|
||||
@@ -35,10 +60,9 @@ import treeTable from '@/components/TreeTable'
|
||||
import initData from '@/mixins/initData'
|
||||
import { del } from '@/api/permission'
|
||||
import { parseTime } from '@/utils/index'
|
||||
import eHeader from './module/header'
|
||||
import edit from './module/edit'
|
||||
import eForm from './form'
|
||||
export default {
|
||||
components: { eHeader, edit, treeTable },
|
||||
components: { treeTable, eForm },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
@@ -52,7 +76,7 @@ export default {
|
||||
value: 'alias'
|
||||
}
|
||||
],
|
||||
delLoading: false, sup_this: this, expand: true
|
||||
delLoading: false, expand: true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -88,6 +112,22 @@ export default {
|
||||
this.$refs[id].doClose()
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
add() {
|
||||
this.isAdd = true
|
||||
this.$refs.form.getPermissions()
|
||||
this.$refs.form.dialog = true
|
||||
},
|
||||
edit(data) {
|
||||
this.isAdd = false
|
||||
const _this = this.$refs.form
|
||||
_this.getPermissions()
|
||||
_this.form = { id: data.id, name: data.name, alias: data.alias, pid: data.pid }
|
||||
_this.dialog = true
|
||||
},
|
||||
changeExpand() {
|
||||
this.expand = !this.expand
|
||||
this.init()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user