| | |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | | ref="crud" |
| | | v-model="form" |
| | | :permission="permissionList" |
| | |
| | | @row-save="rowSave" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @row-click="clickRowChange" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | |
| | | :before-open="beforeOpenScope" |
| | | @search-change="searchChangeScope" |
| | | @search-reset="searchResetScope" |
| | | @row-click="clickRowChangeScope" |
| | | @selection-change="selectionChangeScope" |
| | | @current-change="currentChangeScope" |
| | | @size-change="sizeChangeScope" |
| | |
| | | watchMode: true, |
| | | option: { |
| | | lazy: true, |
| | | columnBtn:false, |
| | | tip: false, |
| | | simplePage: true, |
| | | // simplePage: true, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | dialogWidth: "60%", |
| | |
| | | delBtn: false, |
| | | menuWidth: 150, |
| | | dialogClickModal: false, |
| | | highlightCurrentRow: true, //行选中时高亮 |
| | | column: [ |
| | | { |
| | | label: "菜单名称", |
| | |
| | | menuWidth: 200, |
| | | dialogWidth: 900, |
| | | dialogClickModal: false, |
| | | highlightCurrentRow: true, //行选中时高亮 |
| | | column: [ |
| | | { |
| | | label: "权限名称", |
| | |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | clickRowChange(row){ |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = row; |
| | | this.$refs.crud.setCurrentRow(row); |
| | | this.$refs.crud.toggleRowSelection(row); //选中当前行 |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.$refs.crud.setCurrentRow(this.selectionList[list.length-1]); |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | getLazyMenuList(this.parentId, Object.assign(params, this.query)).then(res => { |
| | | this.data = res.data.data; |
| | | getLazyMenuList(this.parentId, Object.assign(params, this.query), page.currentPage, page.pageSize).then(res => { |
| | | const data = res.data.data; |
| | | this.data = data.records; |
| | | this.page.total = data.total; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | |
| | | treeLoad(tree, treeNode, resolve) { |
| | | const parentId = tree.id; |
| | | getLazyMenuList(parentId).then(res => { |
| | | resolve(res.data.data); |
| | | resolve(res.data.data.records); |
| | | }); |
| | | }, |
| | | // 数据权限模块 |
| | |
| | | this.onLoadScope(this.pageScope, params); |
| | | done(); |
| | | }, |
| | | clickRowChangeScope(row){ |
| | | this.$refs.crudScope.toggleSelection(); |
| | | this.selectionList = row; |
| | | this.$refs.crudScope.setCurrentRow(row); |
| | | this.$refs.crudScope.toggleRowSelection(row); //选中当前行 |
| | | }, |
| | | selectionChangeScope(list) { |
| | | this.selectionListScope = list; |
| | | this.$refs.crudScope.setCurrentRow(this.selectionList[list.length-1]); |
| | | }, |
| | | currentChangeScope(currentPage) { |
| | | this.pageScope.currentPage = currentPage; |