Ver Fonte

pc端显示fix

jwyu há 2 anos atrás
pai
commit
cc3dcce666

+ 6 - 4
src/views/hzyb/chart/positionAnalysis/Index.vue

@@ -10,6 +10,8 @@ const route=useRoute()
 const router=useRouter()
 localStorage.setItem('hzyb-token',route.query.token)
 
+// 是否为pc端展示
+const isPcShow=ref(route.query.showType||'')
 
 // 选择时间
 let showDate=ref(false)
@@ -229,7 +231,7 @@ window.addEventListener('message',e=>{
 
 <template>
     <PullRefresh v-model="isRefresh" @refresh="onRefresh">
-    <div class="chart-position-analysis-page" v-if="!pageLoading">
+    <div :class="['chart-position-analysis-page',isPcShow?'chart-position-analysis-page-pc':'']" v-if="!pageLoading">
         <div class="top-sticky-wrap">
             <div class="notice-box">如无法滑动,请在左侧空白处尝试</div>
             <div class="action-box">
@@ -373,8 +375,8 @@ window.addEventListener('message',e=>{
     padding-top: 300px;
 }
 
-@media (min-width: 600px){
-    .chart-position-analysis-page{
+// @media (min-width: 600px){
+    .chart-position-analysis-page-pc{
         padding: 0;
         .top-sticky-wrap{
             display: none;
@@ -398,5 +400,5 @@ window.addEventListener('message',e=>{
             }
         }
     }
-}
+// }
 </style>

+ 8 - 2
src/views/hzyb/chart/positionAnalysis/components/ChartBox.vue

@@ -4,9 +4,15 @@ import { Popup } from 'vant';
 import Highcharts from 'highcharts';
 import HighchartsMore from 'highcharts/highcharts-more'
 import HighchartszhCN  from '../../../utils/highcahrts-zh_CN'
+import { useRoute } from 'vue-router';
 HighchartszhCN(Highcharts)
 HighchartsMore(Highcharts)
 
+const route=useRoute()
+
+// 是否为pc端展示
+const isPcShow=ref(route.query.showType||'')
+
 const props=defineProps({
     keyVal:String,
     data:Object
@@ -172,7 +178,7 @@ onMounted(()=>{
 </script>
 
 <template>
-    <div class="chart-render-box">
+    <div :class="['chart-render-box',isPcShow?'chart-render-box-pc':'']">
         <div class="label-box">
             <div>
                 <span class="color-box" :style="{background:colorMap.get(keyVal)[0]}"></span>
@@ -303,7 +309,7 @@ onMounted(()=>{
     }
 }
 @media (min-width: 600px){
-    .chart-render-box{
+    .chart-render-box-pc{
         .label-box{
             display: flex;
             justify-content: center;