diff --git a/lms/nladmin-ui/src/views/system/menu/index.vue b/lms/nladmin-ui/src/views/system/menu/index.vue index c131bea71..50891d74b 100644 --- a/lms/nladmin-ui/src/views/system/menu/index.vue +++ b/lms/nladmin-ui/src/views/system/menu/index.vue @@ -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" /> - + { - // 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)