| | |
| | | <el-container v-loading="createdLoading"> |
| | | <el-aside> |
| | | <basic-container> |
| | | <div style="max-height: calc(100vh - 170px);overflow: auto"> |
| | | <avue-tree :key="refresh" ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <div style="max-height: calc(100vh - 150px);overflow: auto"> |
| | | <avue-tree :key="refresh" node-key="id" ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="font-size: 15px"> |
| | | <i class="el-icon-s-promotion"></i> |
| | |
| | | |
| | | <el-main> |
| | | <basic-container> |
| | | <el-form ref="form" :model="form" label-width="85px" style="height: 79vh"> |
| | | <el-form ref="form" :model="form" label-width="85px" style="max-height: calc(100vh - 180px);overflow: auto;"> |
| | | <span v-if="form.childType !== 0"> |
| | | <el-form-item label="模块名:"> |
| | | <el-input v-model="form.name" placeholder="请输入模块名"></el-input> |
| | |
| | | addStatus: false, |
| | | editStatus: false, |
| | | nodeRow: {}, |
| | | currentClickNode:null, |
| | | form: {}, |
| | | treeData: [], |
| | | treeOption: { |
| | |
| | | }, |
| | | methods: { |
| | | // 树行点击 |
| | | nodeClick(row) { |
| | | nodeClick(row,node) { |
| | | console.log(row.childType); |
| | | this.form = {...row}; |
| | | this.nodeRow = {...row}; |
| | | this.currentClickNode = node; |
| | | this.addStatus = false; |
| | | this.editStatus = false; |
| | | }, |
| | |
| | | this.addStatus = false; |
| | | // this.resetFormValue(); |
| | | this.form.childType = null; |
| | | this.refresh = Math.random(); // 刷新左侧树 |
| | | this.handleRefreshTree('add') |
| | | } |
| | | }) |
| | | }, |
| | |
| | | this.editStatus = false; |
| | | // this.resetFormValue(); |
| | | this.form.childType = null; |
| | | this.refresh = Math.random(); // 刷新左侧树 |
| | | this.handleRefreshTree('edit') |
| | | } |
| | | }) |
| | | }, |
| | |
| | | delModule(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.resetFormValue(); |
| | | this.handleRefreshTree('del') |
| | | this.addStatus = false; |
| | | this.editStatus = false; |
| | | } |
| | |
| | | updateAlias(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.refresh = Math.random(); // 刷新左侧树 |
| | | this.handleRefreshTree('edit') |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 删除模块下关联的操作类型 |
| | | deleteOperationClickHandler() { |
| | | console.log(this.form); |
| | | const params = { |
| | | funcId: this.form.funcId, |
| | | operId: this.form.operId |
| | | } |
| | | delFuncOperation(params).then(res => { |
| | | console.log(res); |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.resetFormValue(); |
| | | this.handleRefreshTree('del'); |
| | | } |
| | | }) |
| | | }, |
| | |
| | | func.downloadFileByBlobHandler(res); |
| | | this.createdLoading = false |
| | | this.$message.success('导出成功'); |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }) |
| | | }, |
| | | |
| | | // 导入 |
| | | upLoadClickHandler() { |
| | | this.$refs.upload.visible = true; |
| | | }, |
| | | handleRefreshTree(type) { |
| | | //type:add\edit\del |
| | | if(type=="del"){ |
| | | this.$refs.tree.remove(this.currentClickNode); |
| | | this.currentClickNode=null; |
| | | this.form={}; |
| | | }else{ |
| | | if (this.currentClickNode) { |
| | | let node = this.currentClickNode.parent; |
| | | node.loaded = false; |
| | | node.expand(); |
| | | this.$refs.tree.setCurrentNode(this.currentClickNode); |
| | | }else { |
| | | this.refresh = Math.random(); // 刷新左侧树 |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |