|
@@ -38,15 +38,14 @@
|
|
|
<span class="action-text">{{ showMore ? '收起' : '更多' }}</span>
|
|
|
<span class="el-icon-arrow-down" :class="showMore ? 'rotate180' : ''"></span>
|
|
|
</span>
|
|
|
- <div
|
|
|
- v-for="(item, index) in industryListMap"
|
|
|
- :key="index"
|
|
|
- class="select-group-container"
|
|
|
- :class="{
|
|
|
- 'right-line': showMore
|
|
|
- }"
|
|
|
- >
|
|
|
- <div class="select-group-header">
|
|
|
+ <div class="select-group-container" >
|
|
|
+ <div class="select-group-header"
|
|
|
+ v-show="!showMore"
|
|
|
+ v-for="(item, index) in industryListMap"
|
|
|
+ :key="index+'A'"
|
|
|
+ :class="{
|
|
|
+ 'right-line': showMore
|
|
|
+ }">
|
|
|
<button
|
|
|
class="j-button-item"
|
|
|
:class="{
|
|
@@ -60,16 +59,25 @@
|
|
|
@click="changeIndustryState(item)"
|
|
|
>{{ item.name }}</button>
|
|
|
</div>
|
|
|
- <div class="select-group-main" v-show="showMore">
|
|
|
+ <div class="select-group-header"
|
|
|
+ v-show="showMore"
|
|
|
+ v-for="(item, index) in getIndustryListMap"
|
|
|
+ :key="index+'B'"
|
|
|
+ :class="{
|
|
|
+ 'right-line': showMore
|
|
|
+ }">
|
|
|
<button
|
|
|
- v-for="(iitem, iindex) in item.children" :key="999-iindex"
|
|
|
- class="j-button-item bgc-opacity button-level-2"
|
|
|
+ class="j-button-item"
|
|
|
:class="{
|
|
|
- active: iitem.selected,
|
|
|
- [iitem.id]: true
|
|
|
+ active: item.selected,
|
|
|
+ [item.id]: true,
|
|
|
+ 'button-level-0': item.level === 0,
|
|
|
+ 'button-level-1': item.level === 1,
|
|
|
+ 'all': item.level === 0,
|
|
|
+ 'bgc': item.level === 1
|
|
|
}"
|
|
|
- @click="changeIndustryState(iitem)"
|
|
|
- >{{ iitem.name }}</button>
|
|
|
+ @click="changeIndustryState(item)"
|
|
|
+ >{{ item.name }}</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -146,6 +154,23 @@ export default {
|
|
|
}
|
|
|
}, 300)
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ getIndustryListMap () {
|
|
|
+ const tempArr = []
|
|
|
+ this.industryListMap.forEach(v => {
|
|
|
+ const tempNode = v
|
|
|
+ tempNode.zindex = 1
|
|
|
+ tempArr.push(tempNode)
|
|
|
+ // eslint-disable-next-line no-unused-expressions
|
|
|
+ tempNode?.children.forEach(s => {
|
|
|
+ const tempS = s
|
|
|
+ tempS.zindex = 2
|
|
|
+ tempArr.push(tempS)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ return tempArr
|
|
|
+ }
|
|
|
+ },
|
|
|
created () {
|
|
|
this.initIndustryMap()
|
|
|
this.setIndustryState(this.initIndustry)
|