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