瀏覽代碼

My ETA另存为组件支持三级

cxmo 1 年之前
父節點
當前提交
b80ee61496
共有 2 個文件被更改,包括 44 次插入6 次删除
  1. 1 1
      .env.development
  2. 43 5
      src/views/myETA/components/ChartSaveOther.vue

+ 1 - 1
.env.development

@@ -1,5 +1,5 @@
 # 接口地址http://8.136.199.33:8610/v1   https://rddptest.hzinsights.com/adminapi
-VITE_APP_API_URL="https://rddptest.hzinsights.com/adminapi"
+VITE_APP_API_URL="http://8.136.199.33:8610/v1"
 # 路由根地址
 VITE_APP_BASE_URL="/"
 # 打包输入文件名

+ 43 - 5
src/views/myETA/components/ChartSaveOther.vue

@@ -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;