v1.6 版本发布 ,详情查看版本说明
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<eHeader :roles="roles" :menus="menus" :query="query"/>
|
||||
<eHeader :menus="menus" :query="query"/>
|
||||
<!--表格渲染-->
|
||||
<tree-table v-loading="loading" :data="data" :expand-all="true" :columns="columns" border size="small">
|
||||
<el-table-column prop="icon" label="图标" align="center" width="80px">
|
||||
@@ -28,7 +28,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<edit v-if="checkPermission(['ADMIN','MENU_ALL','MENU_EDIT'])" :roles="roles" :menus="menus" :data="scope.row" :sup_this="sup_this"/>
|
||||
<edit v-if="checkPermission(['ADMIN','MENU_ALL','MENU_EDIT'])" :menus="menus" :data="scope.row" :sup_this="sup_this"/>
|
||||
<el-popover
|
||||
v-if="checkPermission(['ADMIN','MENU_ALL','MENU_DELETE'])"
|
||||
:ref="scope.row.id"
|
||||
@@ -49,7 +49,6 @@
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission' // 权限判断函数
|
||||
import { getRoleTree } from '@/api/role'
|
||||
import treeTable from '@/components/TreeTable'
|
||||
import initData from '@/mixins/initData'
|
||||
import { del, getMenusTree } from '@/api/menu'
|
||||
@@ -67,11 +66,10 @@ export default {
|
||||
value: 'name'
|
||||
}
|
||||
],
|
||||
delLoading: false, sup_this: this, menus: [], roles: []
|
||||
delLoading: false, sup_this: this, menus: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getRoles()
|
||||
this.getMenus()
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
@@ -113,12 +111,6 @@ export default {
|
||||
menu.children = res
|
||||
this.menus.push(menu)
|
||||
})
|
||||
},
|
||||
getRoles() {
|
||||
this.roles = []
|
||||
getRoleTree().then(res => {
|
||||
this.roles = res
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-button size="mini" type="success" @click="to">编辑</el-button>
|
||||
<eForm ref="form" :roles="roles" :menus="menus" :sup_this="sup_this" :is-add="false"/>
|
||||
<eForm ref="form" :menus="menus" :sup_this="sup_this" :is-add="false"/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@@ -20,20 +20,12 @@ export default {
|
||||
menus: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
roles: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
to() {
|
||||
const _this = this.$refs.form
|
||||
_this.roleIds = []
|
||||
_this.form = { id: this.data.id, component: this.data.component, name: this.data.name, sort: this.data.sort, pid: this.data.pid, path: this.data.path, iframe: this.data.iframe.toString(), roles: [], icon: this.data.icon }
|
||||
this.data.roles.forEach(function(data, index) {
|
||||
_this.roleIds.push(data.id)
|
||||
})
|
||||
_this.dialog = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,9 +33,6 @@
|
||||
<el-form-item label="上级类目">
|
||||
<treeselect v-model="form.pid" :options="menus" style="width: 460px;" placeholder="选择上级类目" />
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-top: -10px;margin-bottom: 0px;" label="选择角色">
|
||||
<treeselect v-model="roleIds" :multiple="true" :options="roles" style="width: 460px;" placeholder="请选择角色" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="cancel">取消</el-button>
|
||||
@@ -56,10 +53,6 @@ export default {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
roles: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
@@ -72,7 +65,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false, dialog: false,
|
||||
form: { name: '', sort: 999, path: '', component: '', iframe: 'false', roles: [], pid: 0, icon: '' }, roleIds: [],
|
||||
form: { name: '', sort: 999, path: '', component: '', iframe: 'false', roles: [], pid: 0, icon: '' },
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入名称', trigger: 'blur' }
|
||||
@@ -94,12 +87,6 @@ export default {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
this.form.roles = []
|
||||
const _this = this
|
||||
this.roleIds.forEach(function(data, index) {
|
||||
const role = { id: data }
|
||||
_this.form.roles.push(role)
|
||||
})
|
||||
if (this.isAdd) {
|
||||
this.doAdd()
|
||||
} else this.doEdit()
|
||||
@@ -144,7 +131,6 @@ export default {
|
||||
this.dialog = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.form = { name: '', sort: 999, path: '', component: '', iframe: 'false', roles: [], pid: 0, icon: '' }
|
||||
this.roleIds = []
|
||||
},
|
||||
selected(name) {
|
||||
this.form.icon = name
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="$refs.form.dialog = true">新增</el-button>
|
||||
<eForm ref="form" :roles="roles" :menus="menus" :is-add="true"/>
|
||||
<eForm ref="form" :menus="menus" :is-add="true"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -30,10 +30,6 @@ export default {
|
||||
menus: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
roles: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -44,7 +40,6 @@ export default {
|
||||
methods: {
|
||||
checkPermission,
|
||||
toQuery() {
|
||||
console.log(this.query)
|
||||
this.$parent.page = 0
|
||||
this.$parent.init()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user