Commit 00e04a7a authored by 黄媛媛's avatar 黄媛媛
parents c077008d b67b3dd8
<style>
.other_Style{
color:#409EFF;
}
</style>
<template>
<div class="chooseMenu">
<el-tabs v-model="activeName" @tab-click="handleClick">
......@@ -16,8 +21,10 @@
<el-input placeholder="输入关键字进行过滤" style="width:99%;margin-bottom:10px;" v-model="filterText">
</el-input>
<el-tree :data="item.SubMenuList" node-key="PageId" ref="tree" :props="defaultProps" filter
:filter-node-method="filterNode" @check="handleCheck"
:check-strictly="true" show-checkbox>
:filter-node-method="filterNode" @check="handleCheck" :check-strictly="true" show-checkbox>
<span class="custom-tree-node" slot-scope="{ node, data }">
<span :class="{'other_Style':data.SubMenuList&&data.SubMenuList.length>0}">{{ data.PageName }}</span>
</span>
</el-tree>
</div>
</el-tab-pane>
......@@ -35,7 +42,7 @@
children: 'SubMenuList',
label: 'PageName'
},
checkedObj:{}
checkedObj: {}
};
},
created() {},
......@@ -66,15 +73,17 @@
PageUrl: "",
IsParameter: 0,
ParameterValue: "",
PageName: ""
PageName: "",
new_link_url:''
};
if(this.activeName!=6){
if (this.activeName != 6) {
if (this.dataList && this.dataList.length > 0) {
this.dataList.forEach(item => {
if (item.SubMenuList && item.SubMenuList.length > 0) {
item.SubMenuList.forEach(subItem => {
if (subItem.IsChecked) {
obj.PageUrl = subItem.PageUrl;
obj.new_link_url = subItem.PageUrl
obj.IsParameter = subItem.IsParameter;
obj.ParameterValue = subItem.ParameterValue;
obj.PageName = subItem.PageName;
......@@ -83,11 +92,12 @@
}
});
}
}else{
obj.PageUrl=this.checkedObj.PageUrl
obj.IsParameter=this.checkedObj.IsParameter
obj.ParameterValue=this.checkedObj.ParameterValue
obj.PageName=this.checkedObj.PageName;
} else {
obj.PageUrl = this.checkedObj.PageUrl
obj.new_link_url = this.checkedObj.PageUrl
obj.IsParameter = this.checkedObj.IsParameter
obj.ParameterValue = this.checkedObj.ParameterValue
obj.PageName = this.checkedObj.PageName;
}
return obj;
},
......@@ -117,11 +127,11 @@
return data.PageName.indexOf(value) !== -1;
},
//check单选
handleCheck (a, b) {
handleCheck(a, b) {
//a为传递给 data 属性的数组中该节点所对应的对象;b为树目前的选中状态对象
if (b.checkedKeys.length > 0) {
this.$refs.tree[0].setCheckedKeys([a.PageId]);
this.checkedObj=a;
this.checkedObj = a;
}
},
},
......
......@@ -718,6 +718,7 @@
this.rubData.data.list[this.rubik].link[0].IsParameter = obj.IsParameter;
this.rubData.data.list[this.rubik].link[0].ParameterValue = obj.ParameterValue;
this.rubData.data.list[this.rubik].link[0].PageName = obj.PageName;
this.rubData.data.list[this.rubik].link[0].new_link_url = obj.new_link_url;
this.isShowLink = false;
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment