| | |
| | | <el-aside> |
| | | <basic-container> |
| | | <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"> |
| | | <avue-tree :key="refresh" ref="tree" :data="treeData" :option="treeOption" node-key="id" |
| | | @node-click="nodeClick"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="font-size: 15px"> |
| | | <i :class="data.icon"></i> |
| | |
| | | |
| | | <el-main> |
| | | <basic-container> |
| | | <div v-if="(form.childType || form.childType === 0) && !addStatus && !editStatus && form.category !== 1" class="btnBox"> |
| | | <el-button :disabled="(mangeShowBtn || form.childType === 0) ? false : !childTypeBtn" icon="el-icon-plus" plain |
| | | <div v-if="(form.childType || form.childType === 0) && !addStatus && !editStatus && form.category !== 1" |
| | | class="btnBox"> |
| | | <el-button :disabled="(mangeShowBtn || form.childType === 0) ? false : !childTypeBtn" icon="el-icon-plus" |
| | | plain |
| | | size="small" |
| | | type="primary" @click="addClickHandler">增加 |
| | | </el-button> |
| | |
| | | <el-button v-if="editStatus" icon="el-icon-check" plain size="small" |
| | | type="success" @click="editSaveClickHandler">保存 |
| | | </el-button> |
| | | <el-button icon="el-icon-close" plain size="small" |
| | | type="danger" @click="addStatus=false;editStatus=false;">取消 |
| | | <el-button icon="el-icon-close" plain size="small" |
| | | type="danger" @click="addStatus=false;editStatus=false;">取消 |
| | | </el-button> |
| | | </div> |
| | | <div v-if="form.category === 1" class="btnBox"> |
| | |
| | | addBtn: false, |
| | | menu: false, |
| | | height: 500, |
| | | header:false, |
| | | header: false, |
| | | column: [ |
| | | { |
| | | label: '操作分类', |
| | |
| | | addStatus: false, |
| | | editStatus: false, |
| | | nodeRow: {}, |
| | | currentClickNode:null, |
| | | currentClickNode: null, |
| | | form: {}, |
| | | treeData: [], |
| | | treeOption: { |
| | |
| | | id: item.id, |
| | | name: item.name, |
| | | leaf: !item.hasChildren, |
| | | icon: item.source || 'iconfont iconicon_work' |
| | | icon: item.source || 'el-icon-s-home' |
| | | } |
| | | })) |
| | | }) |
| | |
| | | }, |
| | | methods: { |
| | | // 树行点击 |
| | | nodeClick(row,node) { |
| | | nodeClick(row, node) { |
| | | this.form = {...row}; |
| | | this.nodeRow = {...row}; |
| | | this.currentClickNode=node; |
| | | this.currentClickNode = node; |
| | | this.addStatus = false; |
| | | this.editStatus = false; |
| | | }, |
| | |
| | | this.defalutName.forEach(key => { |
| | | this.form[key] = null; |
| | | }) |
| | | this.form.isValid = false; |
| | | this.form.isValid = true; |
| | | this.addStatus = true; |
| | | this.editStatus = false; |
| | | }, |
| | |
| | | addMethodsClickHandler() { |
| | | this.methodsLoading = true; |
| | | getSysModelTreeMenuByPID({parentId: 'operateNode'}).then(res => { |
| | | if (res.data.code === 200 && res.data.data.length>0) { |
| | | if (res.data.code === 200 && res.data.data.length > 0) { |
| | | this.methodsVisble = true; |
| | | const data = res.data.data; |
| | | this.methodsData = data; |
| | | this.methodsLoading = false; |
| | | }else { |
| | | } else { |
| | | this.$message.error('未找到可增加的操作类型'); |
| | | } |
| | | }) |
| | |
| | | operId: this.form.operId |
| | | } |
| | | delFuncOperation(params).then(res => { |
| | | console.log(res); |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.handleRefreshTree('del'); |
| | |
| | | upLoadClickHandler() { |
| | | this.$refs.upload.visible = true; |
| | | }, |
| | | |
| | | handleRefreshTree(type) { |
| | | //type:add\edit\del |
| | | if(type=="del"){ |
| | | if (type == "del") { |
| | | this.$refs.tree.remove(this.currentClickNode); |
| | | this.currentClickNode=null; |
| | | this.form={}; |
| | | }else{ |
| | | 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 { |
| | | } else { |
| | | this.refresh = Math.random(); // 刷新左侧树 |
| | | } |
| | | } |
| | |
| | | |
| | | .btnBox { |
| | | display: flex; |
| | | justify-content:left; |
| | | justify-content: left; |
| | | margin-bottom: 15px; |
| | | } |
| | | </style> |