Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
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
周远喜
mes-ui
Commits
7d0b08b0
Commit
7d0b08b0
authored
Nov 09, 2020
by
renjintao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
productTree
parent
fa7ccddd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
154 additions
and
148 deletions
+154
-148
productTree.vue
components/page/productTree.vue
+154
-148
No files found.
components/page/productTree.vue
View file @
7d0b08b0
<
template
>
<div
class=
"flex fd tree-menu"
>
<div
class=
"flex fd tree-menu"
>
<h3>
产品结构
<div
class=
"fr mr10 mt10"
>
<ButtonGroup
class=
"fr"
size=
"small"
>
<Button
:icon=
"expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'"
@
click=
"toggle"
title=
"展开/合并"
></Button>
<Button
:icon=
"expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'"
@
click=
"toggle"
title=
"展开/合并"
></Button>
<Button
icon=
"md-refresh"
title=
"刷新"
@
click=
"loadTree"
></Button>
<Button
icon=
"md-rewind"
title=
"收起"
@
click=
"hide"
></Button>
</ButtonGroup>
...
...
@@ -22,7 +18,7 @@
<Tree
:data=
"data"
:render=
"renderContent"
ref=
"tree"
@
on-select-change=
"change"
></Tree>
</div>
</div>
</div>
</div>
</
template
>
<
script
>
...
...
@@ -44,11 +40,12 @@ export default {
.
get
(
`
${
technologyUrl
}
productlevel/getproducttreenew`
)
.
then
(
r
=>
{
setTree
(
r
.
result
);
function
setTree
(
data
)
{
data
.
map
(
u
=>
{
u
.
title
=
u
.
name
;
u
.
value
=
u
.
id
;
//
u.expand = true;
u
.
expand
=
true
;
// u.selected = false;
// u.checked = false;
if
(
u
.
children
)
{
...
...
@@ -63,7 +60,11 @@ export default {
toggle
()
{
this
.
expand
=
!
this
.
expand
;
},
renderContent
(
h
,
{
root
,
node
,
data
})
{
renderContent
(
h
,
{
root
,
node
,
data
})
{
let
type
=
"md-folder"
;
if
(
data
.
isProduct
!=
0
)
{
type
=
"ios-image"
;
...
...
@@ -78,8 +79,7 @@ export default {
}
}),
h
(
"span"
,
{
"span"
,
{
style
:
{
color
:
data
.
isProduct
==
0
?
"#000"
:
"rgba(38, 128, 235, 1)"
}
...
...
@@ -98,6 +98,7 @@ export default {
productIds
.
push
(
b
.
value
);
if
(
b
.
children
)
{
addId
(
b
.
children
);
function
addId
(
data
)
{
data
.
map
(
u
=>
{
if
(
u
.
bomId
!==
0
)
{
...
...
@@ -122,6 +123,7 @@ export default {
let
expand
=
this
.
expand
;
let
result
=
[];
search
(
this
.
keys
,
items
);
function
search
(
keys
,
data
)
{
data
.
map
(
u
=>
{
if
(
keys
.
length
<
2
)
{
...
...
@@ -145,6 +147,7 @@ export default {
<
style
lang=
"less"
>
@import "../../assets/css/custom.less";
.tree-menu {
h3 {
height: 50px;
...
...
@@ -157,16 +160,19 @@ export default {
opacity: 1;
padding-left: 10px;
}
.search {
height: 50px;
padding: 5px 10px;
}
.fg {
flex: none;
// height:0;
overflow: auto;
padding-left: 10px;
}
.tree {
height: calc(100vh - 215px);
overflow: auto;
...
...
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