| | |
| | | <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" |
| | |
| | | @on-load="onLoad" |
| | | @tree-load="treeLoad"> |
| | | <template slot-scope="{row}" slot="menu"> |
| | | <el-button type="text" |
| | | <el-button v-if="permissionList.settingBtn" |
| | | type="text" |
| | | icon="el-icon-setting" |
| | | size="small" |
| | | v-if="permission.data_scope_setting" |
| | | plain |
| | | style="border: 0;background-color: transparent !important;" |
| | | @click.stop="handleDataScope(row)">权限配置 |
| | |
| | | :before-open="beforeOpenScope" |
| | | @search-change="searchChangeScope" |
| | | @search-reset="searchResetScope" |
| | | @row-click="clickRowChangeScope" |
| | | @selection-change="selectionChangeScope" |
| | | @current-change="currentChangeScope" |
| | | @size-change="sizeChangeScope" |
| | | @on-load="onLoadScope"> |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | <el-button v-if="permissionList.delBtn" |
| | | type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | |
| | | 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: "菜单名称", |
| | |
| | | label: "上级菜单", |
| | | prop: "parentId", |
| | | type: "tree", |
| | | dicUrl: "/api/blade-system/menu/tree", |
| | | dicUrl: "/api/ubcs-system/menu/tree", |
| | | hide: true, |
| | | props: { |
| | | label: "title" |
| | |
| | | menuWidth: 200, |
| | | dialogWidth: 900, |
| | | dialogClickModal: false, |
| | | highlightCurrentRow: true, //行选中时高亮 |
| | | column: [ |
| | | { |
| | | label: "权限名称", |
| | |
| | | { |
| | | label: "规则类型", |
| | | type: "select", |
| | | dicUrl: "/api/blade-system/dict/dictionary?code=data_scope_type", |
| | | dicUrl: "/api/ubcs-system/dict/dictionary?code=data_scope_type", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey" |
| | |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.menu_add, false), |
| | | viewBtn: this.vaildData(this.permission.menu_view, false), |
| | | delBtn: this.vaildData(this.permission.menu_delete, false), |
| | | editBtn: this.vaildData(this.permission.menu_edit, false) |
| | | addBtn: this.vaildData(this.permission.data_scope.data_scope_add, false), |
| | | viewBtn: this.vaildData(this.permission.data_scope.data_scope_view, false), |
| | | delBtn: this.vaildData(this.permission.data_scope.data_scope_delete, false), |
| | | editBtn: this.vaildData(this.permission.data_scope.data_scope_edit, false), |
| | | settingBtn: this.vaildData(this.permission.data_scope.data_scope_setting,false), |
| | | }; |
| | | }, |
| | | ids() { |
| | |
| | | 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; |