fix:部门管理前端页面
This commit is contained in:
@@ -9,15 +9,15 @@
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="模糊搜索"
|
||||
style="width: 200px;"
|
||||
style="width: 200px;margin-bottom: 10px"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
@keyup.enter.native="queryBlurry"
|
||||
/>
|
||||
<el-select
|
||||
style="width: 100px; height: 35px;top: -5px;"
|
||||
v-model="query.system_type"
|
||||
style="width: 150px"
|
||||
placeholder="请选择系统"
|
||||
@change="crud.toQuery"
|
||||
placeholder="切换系统"
|
||||
@change="changetype"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.system_type"
|
||||
@@ -27,7 +27,7 @@
|
||||
</el-select>
|
||||
<rrOperation />
|
||||
</div>
|
||||
<crudOperation :permission="permission" />
|
||||
<crudOperation :permission="permission"/>
|
||||
</div>
|
||||
<!--表单渲染-->
|
||||
<el-dialog
|
||||
@@ -217,6 +217,7 @@ import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
import crudDictDetail from '@/api/system/dictDetail'
|
||||
import Dict from "../../../components/Dict/Dict";
|
||||
|
||||
// crud交由presenter持有
|
||||
const defaultForm = {
|
||||
@@ -255,13 +256,6 @@ export default {
|
||||
edit: ['admin', 'menu:edit'],
|
||||
del: ['admin', 'menu:del']
|
||||
},
|
||||
normalizer(node) {
|
||||
return {
|
||||
id: node.menu_id,
|
||||
label: node.title,
|
||||
children: node.children
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
title: [
|
||||
{ required: true, message: '请输入标题', trigger: 'blur' }
|
||||
@@ -272,20 +266,29 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeMount() {
|
||||
// const _this=this
|
||||
// crudDictDetail.get('system_type').then(data => {
|
||||
// if (data.content.length > 0) {
|
||||
// const shift = data.content.shift()
|
||||
// _this.defaultType = shift.para1
|
||||
// }
|
||||
// })
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
if (this.crud.query.system_type == null) {
|
||||
this.crud.query.system_type = '1'
|
||||
normalizer(node) {
|
||||
return {
|
||||
id: node.menu_id,
|
||||
label: node.title,
|
||||
children: node.children
|
||||
}
|
||||
},
|
||||
queryBlurry() {
|
||||
if (this.query.blurry) {
|
||||
this.query.pid = null
|
||||
}
|
||||
this.crud.toQuery()
|
||||
},
|
||||
changetype() {
|
||||
const sysType = this.dict.dict.system_type[this.query.system_type]
|
||||
this.query.pid = sysType.para1
|
||||
this.crud.toQuery()
|
||||
},
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
// if (this.crud.query.system_type == null) {
|
||||
// this.crud.query.system_type = '1'
|
||||
// }
|
||||
return true
|
||||
},
|
||||
// 新增与编辑前做的操作
|
||||
@@ -301,8 +304,26 @@ export default {
|
||||
this.menus.push({ menu_id: 0, title: '顶级类目', children: null })
|
||||
}
|
||||
},
|
||||
[CRUD.HOOK.afterSubmit](crud, form) {
|
||||
if (this.$options.dicts instanceof Array) {
|
||||
new Dict(this.dict).init(this.$options.dicts, () => {
|
||||
this.$nextTick(() => {
|
||||
this.$emit('dictReady')
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
[CRUD.HOOK.afterDelete](crud, form) {
|
||||
if (this.$options.dicts instanceof Array) {
|
||||
new Dict(this.dict).init(this.$options.dicts, () => {
|
||||
this.$nextTick(() => {
|
||||
this.$emit('dictReady')
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
getMenus(tree, treeNode, resolve) {
|
||||
const params = { pid: tree.menu_id }
|
||||
const params = { pid: tree.menu_id, system_type: tree.system_type }
|
||||
setTimeout(() => {
|
||||
crudMenu.getMenus(params).then(res => {
|
||||
resolve(res.content)
|
||||
|
||||
Reference in New Issue
Block a user