|
|
@@ -28,62 +28,38 @@ |
|
|
|
<span class="title-content">合肥新能源工厂</span> |
|
|
|
</section> |
|
|
|
<section class="routes-area"> |
|
|
|
<ul class="root-routes"> |
|
|
|
<li class="parent-route"> |
|
|
|
<div class="route-title"> |
|
|
|
<div> |
|
|
|
<span class="menu-icon"> |
|
|
|
<span class="line" /> |
|
|
|
<span class="line" /> |
|
|
|
<span class="line" /> |
|
|
|
</span> |
|
|
|
<span>制造部</span> |
|
|
|
</div> |
|
|
|
<span class="arrow-icon rotate-down"> |
|
|
|
<span class="arrow-line1" /> |
|
|
|
<span class="arrow-line2" /> |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
<ul class="children-routes"> |
|
|
|
<li class="parent-route"> |
|
|
|
<div class="route-title" style="padding-left: 16px;"> |
|
|
|
<div> |
|
|
|
<span class="menu-icon"> |
|
|
|
<!-- level - 2 --> |
|
|
|
<span class="circle" /> |
|
|
|
</span> |
|
|
|
<span>人力资源</span> |
|
|
|
</div> |
|
|
|
<span class="arrow-icon"> |
|
|
|
<span class="arrow-line1" /> |
|
|
|
<span class="arrow-line2" /> |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
<ul class="children-routes"> |
|
|
|
<li class="leaf-route" style="padding-left: 32px;">小组1</li> |
|
|
|
<li class="leaf-route" style="padding-left: 32px;">小组2</li> |
|
|
|
</ul> |
|
|
|
</li> |
|
|
|
<li class="leaf-route" style="padding-left: 16px;">小组2</li> |
|
|
|
</ul> |
|
|
|
</li> |
|
|
|
<li class="leaf-route">财政部</li> |
|
|
|
</ul> |
|
|
|
<el-menu default-active="1-0-0" @select="handleSelect"> |
|
|
|
<template v-for="(menuItem, index) in testData"> |
|
|
|
<TestMenuItem :index="index" level="1" :menuItem="menuItem" /> |
|
|
|
</template> |
|
|
|
</el-menu> |
|
|
|
</section> |
|
|
|
<section class="footer-area" /> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import TestMenuItem from './TestMenuItem.vue' |
|
|
|
export default { |
|
|
|
name: 'TestTree', |
|
|
|
props: {}, |
|
|
|
components: { TestMenuItem }, |
|
|
|
data() { |
|
|
|
return {} |
|
|
|
return { |
|
|
|
testData: [ |
|
|
|
{ id: 0, label: '制造部', children: [{ label: '小组1' }, { label: '小组2' }] }, |
|
|
|
{ id: 1, label: '综合管理部' }, |
|
|
|
{ id: 2, label: '销售部' } |
|
|
|
] |
|
|
|
} |
|
|
|
}, |
|
|
|
created() {}, |
|
|
|
mounted() {}, |
|
|
|
methods: {} |
|
|
|
methods: { |
|
|
|
handleSelect(index, indexPath) { |
|
|
|
console.log('key, keyPath:', index, indexPath) |
|
|
|
this.$emit('getOrganization', { id, name: label }) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
@@ -91,7 +67,7 @@ export default { |
|
|
|
.test-tree { |
|
|
|
background: lightblue; |
|
|
|
height: 100%; |
|
|
|
padding: 24px; |
|
|
|
padding: 24px 0; |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
gap: 24px; |
|
|
@@ -101,6 +77,7 @@ export default { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
gap: 8px; |
|
|
|
padding: 0 24px; |
|
|
|
} |
|
|
|
|
|
|
|
.routes-area { |
|
|
@@ -120,113 +97,4 @@ export default { |
|
|
|
font-size: 16px; |
|
|
|
line-height: 1; |
|
|
|
} |
|
|
|
|
|
|
|
ul, |
|
|
|
li { |
|
|
|
margin: 0; |
|
|
|
padding: 0; |
|
|
|
list-style: none; |
|
|
|
} |
|
|
|
.parent-route div { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
|
|
|
|
.route-title { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: space-between; |
|
|
|
padding: 0 8px; |
|
|
|
} |
|
|
|
|
|
|
|
span.menu-icon { |
|
|
|
height: 14px; |
|
|
|
width: 14px; |
|
|
|
margin-right: 6px; |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
justify-content: space-around; |
|
|
|
} |
|
|
|
|
|
|
|
.line { |
|
|
|
width: 100%; |
|
|
|
height: 2px; |
|
|
|
border-radius: 2px; |
|
|
|
background-color: rgba(0, 0, 0, 0.508); |
|
|
|
} |
|
|
|
|
|
|
|
.arrow-icon { |
|
|
|
position: relative; |
|
|
|
width: 16px; |
|
|
|
height: 16px; |
|
|
|
} |
|
|
|
|
|
|
|
.arrow-line1, |
|
|
|
.arrow-line2 { |
|
|
|
position: absolute; |
|
|
|
display: inline-block; |
|
|
|
width: 1px; |
|
|
|
height: 8px; |
|
|
|
border-radius: 1px; |
|
|
|
background-color: #000a; |
|
|
|
transform-origin: top 50% left 0; |
|
|
|
} |
|
|
|
|
|
|
|
.arrow-line1 { |
|
|
|
top: 1px; |
|
|
|
left: 0; |
|
|
|
transform: rotateZ(-45deg); |
|
|
|
} |
|
|
|
|
|
|
|
.arrow-line2 { |
|
|
|
left: 0; |
|
|
|
bottom: 1px; |
|
|
|
transform: rotateZ(45deg); |
|
|
|
} |
|
|
|
|
|
|
|
.rotate-down { |
|
|
|
/* transform-origin: top 50%; */ |
|
|
|
transform: rotateZ(90deg); |
|
|
|
} |
|
|
|
.circle { |
|
|
|
width: 70%; |
|
|
|
height: 70%; |
|
|
|
background-color: #000c; |
|
|
|
border-radius: 50%; |
|
|
|
position: relative; |
|
|
|
} |
|
|
|
|
|
|
|
.circle::after { |
|
|
|
content: ''; |
|
|
|
position: absolute; |
|
|
|
width: 70%; |
|
|
|
height: 70%; |
|
|
|
border-radius: 50%; |
|
|
|
top: 15%; |
|
|
|
left: 15%; |
|
|
|
background-color: #fff; |
|
|
|
} |
|
|
|
|
|
|
|
/* span.arrow-icon { |
|
|
|
background: url('./right.png') 100% 100% / contain no-repeat; |
|
|
|
width: 12px; |
|
|
|
height: 12px; |
|
|
|
} */ |
|
|
|
|
|
|
|
li.parent-route { |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
/* background: lightpink; */ |
|
|
|
} |
|
|
|
|
|
|
|
li.leaf-route::before { |
|
|
|
content: '\25E6'; |
|
|
|
padding-right: 8px; |
|
|
|
} |
|
|
|
|
|
|
|
li.parent-route div.route-title:hover, |
|
|
|
li.parent-route div.route-title:hover .circle::after, |
|
|
|
li.leaf-route:hover { |
|
|
|
background: #ccc; |
|
|
|
} |
|
|
|
</style> |