hbchen 2 лет назад
Родитель
Сommit
9041c1d9be

+ 11 - 10
src/views/priceDriven/detail.vue

@@ -27,7 +27,7 @@ const classifyList = ref([]);
 const select_classify_first = ref(""); //选中的品种
 const select_classify_sub = ref(""); //选中的分类
 const select_classify_subtitle = ref(""); //选中分类名称
-const isSlideClassify = ref(false);
+// const isSlideClassify = ref(false);
 /* 获取分类 */
 const getClassify = async () => {
   const { code, data } = await priceApi.tabList();
@@ -68,7 +68,7 @@ const changeClassify = (item,type='') => {
   const { id, list } = item;
   select_classify_first.value = id;
   classifyList.value = list.filter(_ => _.pirce_driven_state);
-  isSlideClassify.value = false;
+  // isSlideClassify.value = false;
 
   //分享进入的默认品种
   if (type === 'share') {
@@ -102,6 +102,7 @@ const errorLinkHandle = () => {
 //详情信息
 const showData = ref(false);
 const headerWidth = ref("");
+const headerHeight = ref("");
 const info = ref({});
 /* 获取详情 */
 const getDetail = async () => {
@@ -237,6 +238,7 @@ const getQrCodeHandle = async () => {
 /* 重绘固定头宽度 */
 const resetHeaderWidthHandle = () => {
   headerWidth.value = document.getElementsByClassName("content-box")[0].offsetWidth;
+  headerHeight.value = document.getElementsByClassName("classify-cont")[0].offsetHeight;
 }
 
 let preViewImgs = ref([]);
@@ -291,21 +293,20 @@ onUnmounted(() => {
         </ul>
         <ul
           class="classsify-sub"
-          :style="isSlideClassify ? 'height: auto' : 'height: 25px'"
         >
           <li
             :class="[
               'classify-sub-item',
               { act: select_classify_sub === item.tag_id },
             ]"
-            v-for="item in classifyList.slice(0,6)"
+            v-for="item in classifyList"
             :key="item.tag_id"
             @click="changeSubClassify(item)"
           >
             {{ item.tag_name }}
           </li>
 
-          <el-popover
+          <!-- <el-popover
             :width="500"
             trigger="click"
           >
@@ -322,7 +323,7 @@ onUnmounted(() => {
                 >{{item.tag_name}}</div>
               </div>
             </template>
-          </el-popover>
+          </el-popover> -->
           <!-- <div
             class="slide"
             v-if="!isSlideClassify"
@@ -338,7 +339,7 @@ onUnmounted(() => {
 
       <template v-if="showData">
         <!-- 内容 -->
-        <div class="richtext-container" v-if="info.core_content">
+        <div class="richtext-container" :style="`margin-top:${headerHeight}px`" v-if="info.core_content">
           <div class="section">
             <h3>更新时间:</h3>
             <p class="time">
@@ -514,8 +515,8 @@ onUnmounted(() => {
       flex-wrap: wrap;
       align-items: center;
       position: relative;
-      height: 25px;
-      overflow-y: hidden;
+      // height: 25px;
+      // overflow-y: hidden;
       .classify-sub-item {
         flex-shrink: 0;
         position: relative;
@@ -535,7 +536,7 @@ onUnmounted(() => {
     }
   }
   .richtext-container {
-    margin-top: 140px;
+    // margin-top: 140px;
     .section {
       padding: 0 20px;
       border-bottom: 2px solid #f1f1f1;

+ 5 - 4
src/views/question/List.vue

@@ -362,11 +362,11 @@ onActivated(()=>{
             <div class="sec-nav-box" v-show="question.secondGroupList.length>0">
                 <span
                     :class="['sec-item',item.tag_id==question.selectedGroupId_second?'active':'']"
-                    v-for="item in question.secondGroupList.slice(0,6)"
+                    v-for="item in question.secondGroupList"
                     :key="item.tag_id"
                     @click="ChangeSecGroup(item)"
                 >{{item.tag_name}}</span>
-                <el-popover
+                <!-- <el-popover
                     :width="560"
                     trigger="click"
                 >
@@ -383,7 +383,7 @@ onActivated(()=>{
                             >{{item.tag_name}}</div>
                         </div>
                     </template>
-                </el-popover>
+                </el-popover> -->
             </div>
         </div>
         <SelfList 
@@ -593,9 +593,10 @@ onActivated(()=>{
     }
     .sec-nav-box{
         margin-top: 30px;
+        margin-left: -30px;
         .sec-item{
             color: #666;
-            margin-right: 30px;
+            margin-left: 30px;
             cursor: pointer;
             display: inline-block;
         }

+ 30 - 9
src/views/report/Index.vue

@@ -5,7 +5,7 @@ import {
   apiReportIndexNewbanner,
   apiLatestNews 
 } from '@/api/report'
-import { onActivated, onMounted, reactive, ref } from "vue"
+import { onActivated, onMounted,onUnmounted, reactive, ref,nextTick} from "vue"
 import Search from "@/components/Search.vue"
 import SelfList from '@/components/SelfList.vue'
 import { onBeforeRouteLeave , useRouter } from "vue-router"
@@ -15,6 +15,11 @@ import 'moment/dist/locale/zh-cn'
 moment.locale('zh-cn')
 
 const router=useRouter()
+// 实现头部的适配
+const contentRef=ref('')
+const headerRef=ref('')
+let contentWidth=ref('')
+let headerHight=ref('')
 
 // 向小程序发送数据
 const handleDataToXcx=()=>{
@@ -125,6 +130,9 @@ const clickFirstType = (item) => {
   subTypeList.value = item.list
   // clickSubType({props:{label:item.list[0].chart_permission_name,name:item.list[0].chart_permission_id}})
   clickSubType(item.list[0])
+  nextTick(() => {
+    resetHeaderWidthHandle();
+  });
 }
 //点击二级分类
 // const clickSubType = ({props}) => {
@@ -231,12 +239,23 @@ const handleGoReportDetail=(item)=>{
   
 } 
 
+/* 重绘固定头宽度 */
+const resetHeaderWidthHandle = () => {
+  contentWidth.value = contentRef.value.offsetWidth+'px'
+  headerHight.value = headerRef.value.offsetHeight-10+'px'
+}
+
 let isMounted = ref(false);
 onMounted(() => {
   isMounted.value = true;
   handleDataToXcx()
+  window.addEventListener('resize',resetHeaderWidthHandle)
 });
 
+onUnmounted(() => {
+  window.removeEventListener('resize',resetHeaderWidthHandle)
+})
+
 // 格式化列表日期
 const formatDate=(e)=>{
   const isSameYear=moment(e).isSame(new Date(), 'year');
@@ -267,11 +286,11 @@ onActivated(()=>{
     </teleport>
   </template>
   <div class="hasrightaside-box report-index-page">
-    <div class="content-box report-main">
-      <div class="top-nav-wrap">
+    <div class="content-box report-main" ref="contentRef">
+      <div class="top-nav-wrap" ref="headerRef" :style="{'width':contentWidth}">
         <div class="flex first-nav">
-          <div class="nav-move-box move-left"></div>
-          <div class="nav-move-box move-right"></div>
+          <!-- <div class="nav-move-box move-left"></div>
+          <div class="nav-move-box move-right"></div> -->
           <div 
             :class="['item', item.classify_name == selectFirstType && 'item-active']" 
             v-for="item in firstTypeList" 
@@ -284,11 +303,11 @@ onActivated(()=>{
         <div class="sub-nav">
             <span 
               :class="['sub-item', item.chart_permission_id == selectSubType && 'sub-active']" 
-              v-for="item in subTypeList.slice(0,6)" 
+              v-for="item in subTypeList" 
               :key="item.chart_permission_id" 
               @click="clickSubType(item)"
             >{{ item.chart_permission_name }}</span>
-            <el-popover
+            <!-- <el-popover
               :width="500"
               trigger="click"
             >
@@ -305,7 +324,7 @@ onActivated(()=>{
                   >{{item.chart_permission_name}}</div>
                 </div>
               </template>
-            </el-popover>
+            </el-popover> -->
           <!-- <el-tabs v-model="selectSubType" class="tabs-wrap" @tab-click="clickSubType">
             <el-tab-pane 
                 :label="item.chart_permission_name" 
@@ -324,7 +343,7 @@ onActivated(()=>{
         :count="reportState.list.length"
         @listOnload="onLoad"
       >
-        <div class="report-list-wrap">
+        <div class="report-list-wrap" :style="{'margin-top':headerHight}">
           <div class="item" v-for="item in reportState.list" :key="item.date">
             <div class="item-time">{{ formatDate(item.date) }}</div>
             <div class="content-list">
@@ -495,6 +514,7 @@ onActivated(()=>{
         overflow-y: hidden;
         display: flex;
         align-items: center;
+        flex-wrap: wrap;
         // &::-webkit-scrollbar {
         //   display: none;
         // }
@@ -503,6 +523,7 @@ onActivated(()=>{
           flex-shrink: 0;
           margin-right: 30px;
           font-size: 16px;
+          margin-bottom: 8px;
           color: #666666;
           cursor: pointer;
         }

+ 8 - 4
src/views/report/reportForVariety/List.vue

@@ -220,11 +220,11 @@ const posterParams=computed(()=>{
             <div class="sec-nav-box">
                 <span 
                     :class="['item',item.chart_permission_id===permissionList.secPerId?'active':'']"
-                    v-for="item in permissionList.secList.slice(0,6)" 
+                    v-for="item in permissionList.secList" 
                     :key="item.chart_permission_id"
                     @click="handleSelectSecVariety(item)"
                 >{{item.chart_permission_name}}</span>
-                <el-popover
+                <!-- <el-popover
                     :width="500"
                     trigger="click"
                 >
@@ -241,7 +241,7 @@ const posterParams=computed(()=>{
                         >{{item.chart_permission_name}}</div>
                         </div>
                     </template>
-                </el-popover>
+                </el-popover> -->
             </div>
         </div>
         <SelfList 
@@ -356,12 +356,16 @@ const posterParams=computed(()=>{
         }
         .sec-nav-box{
             margin-top: 30px;
+            display: flex;
+            flex-wrap: wrap;
+            margin-left: -30px;
             .item{
                 flex-shrink: 0;
-                margin-right: 30px;
+                margin-left: 30px;
                 font-size: 16px;
                 color: #666666;
                 cursor: pointer;
+                margin-bottom: 8px;
             }
             .active{
                 color: #F3A52F;

+ 6 - 4
src/views/roadShow/video/List.vue

@@ -322,11 +322,11 @@ onActivated(()=>{
             <div class="sec-nav-box" v-show="permissionState.secNavList.length>0">
                 <span
                     :class="['sec-item',item.PermissionId==permissionState.sSecond?'active':'']"
-                    v-for="item in permissionState.secNavList.slice(0,6)"
+                    v-for="item in permissionState.secNavList"
                     :key="item.PermissionId"
                     @click="handleChangeSecNav(item)"
                 >{{item.PermissionName}}</span>
-                <el-popover
+                <!-- <el-popover
                     :width="500"
                     trigger="click"
                 >
@@ -343,7 +343,7 @@ onActivated(()=>{
                             >{{item.PermissionName}}</div>
                         </div>
                     </template>
-                </el-popover>
+                </el-popover> -->
             </div>
         </div>
         <SelfList 
@@ -479,11 +479,13 @@ onActivated(()=>{
         }
         .sec-nav-box{
             margin-top: 30px;
+            margin-left: -30px;
             .sec-item{
                 color: #666;
-                margin-right: 30px;
+                margin-left: 30px;
                 cursor: pointer;
                 display: inline-block;
+                margin-bottom: 8px;
             }
             .active{
                 color: #F3A52F;

+ 6 - 4
src/views/sandBox/List.vue

@@ -446,11 +446,11 @@ onActivated(()=>{
             <div class="sec-nav-box" v-show="sandBox.secondClassifyList.length>0">
                 <span
                     :class="['sec-item',item.chart_permission_id==sandBox.selectedSecondId?'active':'']"
-                    v-for="item in sandBox.secondClassifyList.slice(0,6)"
+                    v-for="item in sandBox.secondClassifyList"
                     :key="item.chart_permission_id"
                     @click="selectSecondClassify(item)"
                 >{{item.chart_permission_name}}</span>
-                <el-popover
+                <!-- <el-popover
                     :width="500"
                     trigger="click"
                 >
@@ -467,7 +467,7 @@ onActivated(()=>{
                             >{{item.chart_permission_name}}</div>
                         </div>
                     </template>
-                </el-popover>
+                </el-popover> -->
             </div>
         </div>
         <SelfList
@@ -634,10 +634,12 @@ onActivated(()=>{
             }
             .sec-nav-box{
                 margin-top: 30px;
+                margin-left: -30px;
                 .sec-item{
                     color: #666;
-                    margin-right: 30px;
+                    margin-left: 30px;
                     cursor: pointer;
+                    margin-bottom: 8px;
                     display: inline-block;
                 }
                 .active{

+ 6 - 4
src/views/video/List.vue

@@ -325,11 +325,11 @@ onActivated(()=>{
             <div class="sec-nav-box" v-show="permissionState.secNavList.length>0">
                 <span
                     :class="['sec-item',item.PermissionId==permissionState.sSecond?'active':'']"
-                    v-for="item in permissionState.secNavList.slice(0,6)"
+                    v-for="item in permissionState.secNavList"
                     :key="item.PermissionId"
                     @click="handleChangeSecNav(item)"
                 >{{item.PermissionName}}</span>
-                <el-popover
+                <!-- <el-popover
                     :width="500"
                     trigger="click"
                 >
@@ -346,7 +346,7 @@ onActivated(()=>{
                             >{{item.PermissionName}}</div>
                         </div>
                     </template>
-                </el-popover>
+                </el-popover> -->
             </div>
         </div>
         <SelfList 
@@ -490,9 +490,11 @@ onActivated(()=>{
         }
         .sec-nav-box{
             margin-top: 30px;
+            margin-left: -30px;
             .sec-item{
                 color: #666;
-                margin-right: 30px;
+                margin-left: 30px;
+                margin-bottom: 8px;
                 cursor: pointer;
                 display: inline-block;
             }