|
@@ -20,9 +20,24 @@
|
|
|
@mouseenter.native="ind = item.id"
|
|
|
>
|
|
|
{{ item.name }}
|
|
|
+ <div class="hover" v-show="item.id === ind">
|
|
|
+ <i
|
|
|
+ class="el-icon-edit"
|
|
|
+ title="编辑"
|
|
|
+ v-if="limits.edit"
|
|
|
+ @click="editTab($event, item.id)"
|
|
|
+ ></i>
|
|
|
+ <i
|
|
|
+ class="el-icon-close"
|
|
|
+ title="删除"
|
|
|
+ v-if="item.id !== 1 && item.id !== 2 && item.id !== 3"
|
|
|
+ v-show="limits.del"
|
|
|
+ @click="deltTab($event, item.id)"
|
|
|
+ ></i>
|
|
|
+ </div>
|
|
|
</el-menu-item>
|
|
|
<!-- 鼠标移入的操作 -->
|
|
|
- <template v-for="(item, i) in menu">
|
|
|
+ <!-- <template v-for="(item, i) in menu">
|
|
|
<div
|
|
|
class="hover"
|
|
|
:key="item.id"
|
|
@@ -43,7 +58,7 @@
|
|
|
@click="$emit('deltTab', item.id)"
|
|
|
></i>
|
|
|
</div>
|
|
|
- </template>
|
|
|
+ </template> -->
|
|
|
</el-submenu>
|
|
|
</el-menu>
|
|
|
<!-- <div class="sousuo" @click="isCollapse = !isCollapse">
|
|
@@ -59,32 +74,42 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
// 权限的数据
|
|
|
- limits:{
|
|
|
- edit:true,
|
|
|
- del:true
|
|
|
+ limits: {
|
|
|
+ edit: true,
|
|
|
+ del: true,
|
|
|
},
|
|
|
// type: this.default,
|
|
|
ind: null,
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 点击编辑模块
|
|
|
+ editTab(e, id) {
|
|
|
+ this.$emit("editTab", id);
|
|
|
+ e.stopPropagation();
|
|
|
+ },
|
|
|
+ // 点击删除模块
|
|
|
+ deltTab(e, id) {
|
|
|
+ this.$emit("deltTab", id);
|
|
|
+ e.stopPropagation();
|
|
|
+ },
|
|
|
handleSelect(data) {
|
|
|
// console.log(998,data);
|
|
|
this.$emit("select", data);
|
|
|
},
|
|
|
},
|
|
|
- computed: {
|
|
|
- type () {
|
|
|
- return this.default
|
|
|
- }
|
|
|
+ computed: {
|
|
|
+ type() {
|
|
|
+ return this.default;
|
|
|
},
|
|
|
- async created(){
|
|
|
- //获取自定义模块的权限
|
|
|
- let temp = localStorage.getItem('XJ_limits_ZDY')
|
|
|
- temp =JSON.parse(temp)
|
|
|
- this.limits.edit=temp[0].authority
|
|
|
- this.limits.del=temp[1].authority
|
|
|
- }
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ //获取自定义模块的权限
|
|
|
+ let temp = localStorage.getItem("XJ_limits_ZDY");
|
|
|
+ temp = JSON.parse(temp);
|
|
|
+ this.limits.edit = temp[0].authority;
|
|
|
+ this.limits.del = temp[1].authority;
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|
|
@@ -109,8 +134,9 @@ export default {
|
|
|
position: absolute;
|
|
|
height: 50px;
|
|
|
top: 0;
|
|
|
- right: 0;
|
|
|
+ right: 6px;
|
|
|
& > i {
|
|
|
+ color: #909399;
|
|
|
margin-right: 2px;
|
|
|
width: 18px;
|
|
|
&:hover {
|