| | |
| | | </el-breadcrumb> |
| | | |
| | | <div> |
| | | <el-button |
| | | <el-button v-if="menuStatus.update" |
| | | :disabled="itemdetail.pid == null ? true : false" |
| | | @click="setEditNode(1)" |
| | | type="info" |
| | | icon="el-icon-top" |
| | | size="small" |
| | | >向上移动</el-button> |
| | | <el-button |
| | | <el-button v-if="menuStatus.update" |
| | | :disabled="itemdetail.pid == null ? true : false" |
| | | @click="setEditNode(2)" |
| | | type="info" |
| | | icon="el-icon-bottom" |
| | | size="small" |
| | | >向下移动</el-button> |
| | | <el-button |
| | | <el-button v-if="menuStatus.insert" |
| | | :disabled="itemdetail.pid == null ? true : false" |
| | | @click="setNewNode(1)" |
| | | type="success" |
| | | icon="el-icon-plus" |
| | | size="small" |
| | | >新增同级</el-button> |
| | | <el-button |
| | | <el-button v-if="menuStatus.insert" |
| | | :disabled="itemdetail.pid == null ? true : false" |
| | | @click="setNewNode(2)" |
| | | type="success" |
| | | icon="el-icon-plus" |
| | | size="small" |
| | | >新增子级</el-button> |
| | | <el-button |
| | | <el-button v-if="menuStatus.delete" |
| | | @click="setDelNode()" |
| | | :disabled="itemdetail.pid == null ? true : false" |
| | | type="danger" |
| | |
| | | queryMaxId, |
| | | insertDep, |
| | | deleteDep, |
| | | getPerms |
| | | } from '../../api/api'; |
| | | export default { |
| | | //import引入的组件需要注入到对象中才能使用 |
| | |
| | | break; |
| | | } |
| | | }, |
| | | getPerms() { |
| | | var val = this.$store.state.currentPerms; |
| | | var permsEntity = this.$store.state.permsEntity; |
| | | |
| | | if (permsEntity.length == 0) { |
| | | getPerms().then((res) => { |
| | | if (res.code == 200) { |
| | | permsEntity = res.result; |
| | | } |
| | | }); |
| | | } |
| | | for (var i = 0; i < permsEntity.length; i++) { |
| | | if (permsEntity[i].perms == val) { |
| | | console.log(permsEntity[i]) |
| | | this.showPermsMenu(permsEntity[i]); |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.getMenuTree(); |
| | | this.getPerms(); |
| | | }, |
| | | created() { |
| | | var val = this.$store.state.currentPerms; |
| | | var permsEntity = this.$store.state.permsEntity; |
| | | for (var i = 0; i < permsEntity.length; i++) { |
| | | if (permsEntity[i].perms == val) { |
| | | this.showPermsMenu(permsEntity[i]); |
| | | } |
| | | } |
| | | // var val = this.$store.state.currentPerms; |
| | | // var permsEntity = this.$store.state.permsEntity; |
| | | // for (var i = 0; i < permsEntity.length; i++) { |
| | | // if (permsEntity[i].perms == val) { |
| | | // this.showPermsMenu(permsEntity[i]); |
| | | // } |
| | | // } |
| | | }, |
| | | }; |
| | | </script> |