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