Răsfoiți Sursa

Merge branch 'master' of http://8.136.199.33:3000/jwyu/hongze_yb_pc

hbchen 2 ani în urmă
părinte
comite
390662398a
2 a modificat fișierele cu 66 adăugiri și 6 ștergeri
  1. 8 0
      src/api/report.js
  2. 58 6
      src/views/report/List.vue

+ 8 - 0
src/api/report.js

@@ -241,4 +241,12 @@ export const apiGoodsPermissionList=params=>{
  */
 export const apiReportListForVariety=params=>{
     return get('/report/variety/list',params)
+}
+
+/**
+ * 获取列表类型报告中的子目录数据
+ * @param classify_id
+ */
+export const apiReportClassifyMenuList=params=>{
+    return get('/classify/menu/list',params)
 }

+ 58 - 6
src/views/report/List.vue

@@ -1,7 +1,7 @@
 <script setup>
 import {ref,onMounted, reactive, onActivated,computed} from 'vue'
 import moment from 'moment';
-import { apiSubClassifyList , apiReportList } from '@/api/report'
+import { apiSubClassifyList , apiReportList,apiReportClassifyMenuList } from '@/api/report'
 import Search from '@/components/Search.vue'
 import SelfList from '@/components/SelfList.vue'
 import SharePoster from '@/components/SharePoster.vue'
@@ -40,10 +40,12 @@ const getFilterList=async ()=>{
         filterList.value=res.data||[]
     }
 }
-getFilterList()
+// getFilterList()
 
 // 获取报告列表
 let reportState=reactive({
+    menuList:[],
+    menuId:0,
     list:[],
     page:1,
     pageSize:20,
@@ -58,7 +60,8 @@ const getReportList=async ()=>{
         classify_id_second:Number(selectSubClassifyId.value),
         key_word:reportState.searchVal,
         current_index:reportState.page,
-        page_size:reportState.pageSize
+        page_size:reportState.pageSize,
+        classify_menu_id:Number(reportState.menuId),
     })
     reportState.loading=false
     if(reportState.page==1){
@@ -74,6 +77,15 @@ const getReportList=async ()=>{
 }
 getReportList()
 
+// 获取子目录
+const getMenuList=async ()=>{
+    const res=await apiReportClassifyMenuList({classify_id:Number(classifyId.value)})
+    if(res.code===200){
+        reportState.menuList=res.data||[]
+    }
+}
+getMenuList()
+
 // 加载更多列表数据
 const onLoad=()=>{
     reportState.page++
@@ -93,6 +105,15 @@ const handleClickFilterItem=(item)=>{
     getReportList()
 }
 
+const handleClickMenuItem=(item)=>{
+    reportState.list=[]
+    reportState.page=1
+    reportState.searchVal=''
+    reportState.menuId=item.menu_id
+    reportState.finished=false
+    getReportList()
+}
+
 // 搜索
 const handleSearch=(e)=>{
     reportState.list=[]
@@ -151,12 +172,15 @@ onActivated(()=>{
         classifyId.value=temClassifyId
         reportState.list=[]
         reportState.page=1
+        reportState.menuId=0
         reportState.finished=false
         reportState.searchVal=''
         filterList.value=[]
         selectSubClassifyId.value=0
         getReportList()
-        getFilterList()
+        getMenuList()
+        // getFilterList()
+        getMenuList()
     }
     handleDataToXcx()
 })
@@ -209,7 +233,7 @@ const posterParams=computed(()=>{
                     @search="handleSearch"
                     @clean="handleSearch"
                 ></Search>
-                <template v-if="filterList.length>0">
+                <!-- <template v-if="filterList.length>0">
                 <el-popover 
                     :width="580"
                     trigger="click"
@@ -230,11 +254,21 @@ const posterParams=computed(()=>{
                         </div>
                     </template>
                 </el-popover>
-                </template>
+                </template> -->
             </div>
         </teleport>
     </template>
     <div class="report-list-page">
+        <div class="top-tabs-box" v-if="reportState.menuList.length>0">
+            <span :class="['item',0===reportState.menuId?'active':'']" @click="handleClickMenuItem({menu_id:0,menu_name:'全部'})">全部</span>
+            <span 
+                :class="['item',item.menu_id===reportState.menuId?'active':'']"
+                v-for="item in reportState.menuList"
+                :key="item.menu_id"
+                @click="handleClickMenuItem(item)"
+            >{{item.menu_name}}</span>
+            
+        </div>
         <SelfList 
             :finished="reportState.finished" 
             :isEmpty="reportState.list.length === 0 && reportState.finished" 
@@ -321,6 +355,24 @@ const posterParams=computed(()=>{
     }
 }
 .report-list-page{
+    .top-tabs-box{
+        position: sticky;
+        top: 60px;
+        z-index: 10;
+        padding-top: 20px;
+        margin-top: -20px;
+        background-color: #fff;
+        .item{
+            margin-right: 50px;
+            font-size: 16px;
+            display: inline-block;
+            margin-bottom: 20px;
+            cursor: pointer;
+            &.active{
+                color: #F3A52F;
+            }
+        }
+    }
     .list-wrap{
         flex-wrap: wrap;
         justify-content: center;