|
@@ -58,7 +58,8 @@ async function getOpts(){
|
|
|
}
|
|
|
if(res.Ret!=200) return
|
|
|
const arr=res.Data.AllNodes||[]
|
|
|
- if([2,5,3,6,7,8,9].includes(props.source)){
|
|
|
+ opts.value=arr
|
|
|
+ /* if([2,5,3,6,7,8,9].includes(props.source)){
|
|
|
opts.value=arr
|
|
|
}else{
|
|
|
opts.value=arr.map(item=>{
|
|
@@ -73,13 +74,27 @@ async function getOpts(){
|
|
|
children:children
|
|
|
}
|
|
|
})
|
|
|
- }
|
|
|
-
|
|
|
+ } */
|
|
|
+}
|
|
|
|
|
|
+function getTreeData(topNode={}){
|
|
|
+ return topNode.Children.map(item=>{
|
|
|
+ const children=item.Children.map(e=>{
|
|
|
+ return {
|
|
|
+ text:e.ChartClassifyName,
|
|
|
+ id:e.ChartClassifyId
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return {
|
|
|
+ text:item.ChartClassifyName,
|
|
|
+ children:children
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
let activeIds=ref('')//选中的分类
|
|
|
const activeIndex=ref(0)
|
|
|
+let activeTab=ref(0)
|
|
|
|
|
|
|
|
|
async function handleConfirmSave(){
|
|
@@ -131,11 +146,26 @@ async function handleConfirmSave(){
|
|
|
</ul>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
- <van-tree-select
|
|
|
+ <!-- <van-tree-select
|
|
|
v-model:active-id="activeIds"
|
|
|
v-model:main-active-index="activeIndex"
|
|
|
:items="opts"
|
|
|
- />
|
|
|
+ /> -->
|
|
|
+ <!-- ETA图库目录改为三级,增加tab组件作为一级目录 -->
|
|
|
+ <div class="tag-box">
|
|
|
+ <van-tabs v-model:active="activeTab" shrink>
|
|
|
+ <van-tab v-for="catalog in opts" :key="catalog.UniqueCode"
|
|
|
+ :title="catalog.ChartClassifyName">
|
|
|
+ <div class="content">
|
|
|
+ <van-tree-select
|
|
|
+ v-model:active-id="activeIds"
|
|
|
+ v-model:main-active-index="activeIndex"
|
|
|
+ :items="getTreeData(catalog)"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </van-tab>
|
|
|
+ </van-tabs>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</div>
|
|
|
<div class="bot-btn-box" @click="handleConfirmSave">确定</div>
|
|
@@ -159,6 +189,11 @@ async function handleConfirmSave(){
|
|
|
color: $theme-color;
|
|
|
font-size: 32px;
|
|
|
}
|
|
|
+ :deep(.van-tabs__wrap){
|
|
|
+ position: relative;
|
|
|
+ z-index: 3;
|
|
|
+ box-shadow: 0px 6px 10px 0 #DCDFE6;
|
|
|
+ }
|
|
|
.content{
|
|
|
:deep(.van-tree-select__nav){
|
|
|
&::-webkit-scrollbar{
|
|
@@ -212,6 +247,9 @@ async function handleConfirmSave(){
|
|
|
line-height: 56px;
|
|
|
border-top-width: 8px;
|
|
|
}
|
|
|
+ :deep(.van-tabs__wrap){
|
|
|
+ box-shadow: 0px 3px 5px 0 #DCDFE6;
|
|
|
+ }
|
|
|
.content{
|
|
|
.list-box{
|
|
|
max-height: 500px;
|