Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jz_electricity
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhengke
jz_electricity
Commits
8cc3e86a
Commit
8cc3e86a
authored
May 31, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
e940a35e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
8 deletions
+27
-8
chooseMenu.vue
src/components/common/chooseMenu.vue
+27
-8
No files found.
src/components/common/chooseMenu.vue
View file @
8cc3e86a
<
style
>
<
style
>
.other_Style
{
.other_Style
{
color
:
#409EFF
;
color
:
#409EFF
;
}
}
</
style
>
</
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"
>
<el-tab-pane
v-for=
"(item,index) in dataList"
:label=
"item.PageTypeName"
:name=
"item.PageTypeId+''"
:key=
"index"
>
<el-tab-pane
v-for=
"(item,index) in dataList"
:label=
"item.PageTypeName"
:name=
"item.PageTypeId+''"
:key=
"index"
>
<div
style=
"height:450px;overflow:scroll;line-height:normal;"
v-if=
"item.PageTypeId!=6"
>
<div
style=
"height:450px;overflow:scroll;line-height:normal;"
v-if=
"item.PageTypeId!=6
&&item.PageTypeId!=8
"
>
<template
v-for=
"(subItem,subIndex) in item.SubMenuList"
>
<template
v-for=
"(subItem,subIndex) in item.SubMenuList"
>
<div
:key=
"subIndex"
style=
"margin-bottom:10px;"
>
<div
:key=
"subIndex"
style=
"margin-bottom:10px;"
>
<el-checkbox
v-model=
"subItem.IsChecked"
:key=
"subIndex"
@
change=
"checkMenuChange(subItem)"
>
<el-checkbox
v-model=
"subItem.IsChecked"
:key=
"subIndex"
@
change=
"checkMenuChange(subItem)"
>
...
@@ -17,11 +18,23 @@
...
@@ -17,11 +18,23 @@
</div>
</div>
</
template
>
</
template
>
</div>
</div>
<div
style=
"height:450px;overflow:scroll"
v-else
>
<div
style=
"height:450px;overflow:scroll"
v-else
-if=
"item.PageTypeId==6"
>
<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"
:check-strictly=
"true"
show-checkbox
:check-on-click-node=
"true"
>
:filter-node-method=
"filterNode"
@
check=
"handleCheck"
:check-strictly=
"true"
show-checkbox
:check-on-click-node=
"true"
>
<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>
<div
style=
"height:450px;overflow:scroll"
v-else-if=
"item.PageTypeId==8"
>
<el-input
placeholder=
"输入关键字进行过滤"
style=
"width:99%;margin-bottom:10px;"
v-model=
"filterText2"
>
</el-input>
<el-tree
:data=
"item.SubMenuList"
node-key=
"PageId"
ref=
"tree_dmc"
:props=
"defaultProps"
filter
:filter-node-method=
"filterNode2"
@
check=
"handleCheck"
:check-strictly=
"true"
show-checkbox
:check-on-click-node=
"true"
>
<span
class=
"custom-tree-node"
slot-scope=
"{ node, data }"
>
<span
class=
"custom-tree-node"
slot-scope=
"{ node, data }"
>
<span
:class=
"{'other_Style':data.SubMenuList&&data.SubMenuList.length>0}"
>
{{ data.PageName }}
</span>
<span
:class=
"{'other_Style':data.SubMenuList&&data.SubMenuList.length>0}"
>
{{ data.PageName }}
</span>
</span>
</span>
...
@@ -38,6 +51,7 @@
...
@@ -38,6 +51,7 @@
dataList
:
[],
dataList
:
[],
activeName
:
"1"
,
activeName
:
"1"
,
filterText
:
''
,
filterText
:
''
,
filterText2
:
''
,
defaultProps
:
{
defaultProps
:
{
children
:
'SubMenuList'
,
children
:
'SubMenuList'
,
label
:
'PageName'
label
:
'PageName'
...
@@ -49,6 +63,9 @@
...
@@ -49,6 +63,9 @@
watch
:
{
watch
:
{
filterText
(
val
)
{
filterText
(
val
)
{
this
.
$refs
.
tree
[
0
].
filter
(
val
.
trim
());
this
.
$refs
.
tree
[
0
].
filter
(
val
.
trim
());
},
filterText2
(
val
)
{
this
.
$refs
.
tree_dmc
[
0
].
filter
(
val
.
trim
());
}
}
},
},
methods
:
{
methods
:
{
...
@@ -61,8 +78,6 @@
...
@@ -61,8 +78,6 @@
subItem
.
IsChecked
=
false
;
subItem
.
IsChecked
=
false
;
})
})
}
}
//清空商品选择
// this.$refs.tree[0].setCheckedKeys([]);
});
});
}
}
subItem
.
IsChecked
=
!
subItem
.
IsChecked
;
subItem
.
IsChecked
=
!
subItem
.
IsChecked
;
...
@@ -74,7 +89,7 @@
...
@@ -74,7 +89,7 @@
IsParameter
:
0
,
IsParameter
:
0
,
ParameterValue
:
""
,
ParameterValue
:
""
,
PageName
:
""
,
PageName
:
""
,
new_link_url
:
''
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
)
{
...
@@ -126,6 +141,10 @@
...
@@ -126,6 +141,10 @@
if
(
!
value
)
return
true
;
if
(
!
value
)
return
true
;
return
data
.
PageName
.
indexOf
(
value
)
!==
-
1
;
return
data
.
PageName
.
indexOf
(
value
)
!==
-
1
;
},
},
filterNode2
(
value
,
data
)
{
if
(
!
value
)
return
true
;
return
data
.
PageName
.
indexOf
(
value
)
!==
-
1
;
},
//check单选
//check单选
handleCheck
(
a
,
b
)
{
handleCheck
(
a
,
b
)
{
//a为传递给 data 属性的数组中该节点所对应的对象;b为树目前的选中状态对象
//a为传递给 data 属性的数组中该节点所对应的对象;b为树目前的选中状态对象
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment