lilei пре 1 година
родитељ
комит
b706987305

+ 7 - 5
src/bigScreenComponents/scale-screen/scale-screen.vue

@@ -74,6 +74,7 @@ export default {
       originalHeight: 0,
       onResize: null,
       observer: null,
+      isInnerPage: false
     };
   },
   watch: {
@@ -94,10 +95,11 @@ export default {
   },
   methods: {
     initSize() {
+      this.isInnerPage = this.$route.path.indexOf("bigStatistics")>=0
       return new Promise((resolve, reject) => {
         // console.log("初始化样式");
         //给父元素设置 overflow:hidden
-        this.screenWrapper.parentNode.style.overflow = "hidden";
+        this.screenWrapper.parentNode.style.overflow = !this.isInnerPage ? "hidden" : 'auto';
         this.screenWrapper.parentNode.scrollLeft = 0;
         this.screenWrapper.parentNode.scrollTop = 0;
 
@@ -135,8 +137,8 @@ export default {
       const screenWrapper = this.screenWrapper;
       const domWidth = screenWrapper.clientWidth;
       const domHeight = screenWrapper.clientHeight;
-      const currentWidth = document.body.clientWidth;
-      const currentHeight = document.body.clientHeight;
+      const currentWidth = !this.isInnerPage ? document.body.clientWidth : screenWrapper.parentNode.clientWidth;
+      const currentHeight = !this.isInnerPage ? document.body.clientHeight : screenWrapper.parentNode.clientHeight;
       screenWrapper.style.transform = `scale(${scale},${scale}) `;
       let mx = Math.max((currentWidth - domWidth * scale) / 2, 0);
       let my = Math.max((currentHeight - domHeight * scale) / 2, 0);
@@ -160,8 +162,8 @@ export default {
     updateScale() {
       const screenWrapper = this.screenWrapper;
       // 获取真实视口尺寸
-      const currentWidth = document.body.clientWidth;
-      const currentHeight = document.body.clientHeight;
+      const currentWidth = !this.isInnerPage ? document.body.clientWidth : screenWrapper.parentNode.clientWidth;
+      const currentHeight = !this.isInnerPage ? document.body.clientHeight : screenWrapper.parentNode.clientHeight;
       // 获取大屏最终的宽高onResize
       const realWidth = this.currentWidth || this.originalWidth;
       const realHeight = this.currentHeight || this.originalHeight;

+ 57 - 0
src/config/router.config.js

@@ -3390,6 +3390,63 @@ export const asyncRouterMap = [
           }
         ]
       },
+      // 大屏数据
+      {
+        path: '/bigStatistics',
+        redirect: '/bigStatistics/realTimeSalesReport',
+        component: PageView,
+        meta: {
+          title: '大屏数据统计',
+          icon: 'desktop',
+          // permission: 'M_bigScreenStatistics'
+        },
+        children: [
+          {
+            path: '/bigStatistics/realTimeSalesReport',
+            redirect: '/bigStatistics/realTimeSalesReport/index',
+            name: 'bigRealTimeSalesReport',
+            component: BigScreen,
+            meta: {
+              title: '实时销售看板',
+              icon: 'deployment-unit',
+              // permission: 'M_realTimeSalesReportIndex'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'index',
+                name: 'realTimeSalesReportIndex',
+                component: () => import(/* webpackChunkName: "bigScreen" */ '@/views/bigScreen/realTimeSalesReport/index'),
+                meta: {
+                  title: '实时销售看板'
+                }
+              },
+            ]
+          },
+          {
+            path: '/bigStatistics/fPanalysisReport',
+            redirect: '/bigStatistics/fPanalysisReport/index',
+            name: 'bigfPanalysisReport',
+            component: BigScreen,
+            meta: {
+              title: '加盟商/产品分析',
+              icon: 'interaction',
+              // permission: 'M_fPanalysisReportIndex'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'index',
+                name: 'fPanalysisReportIndex',
+                component: () => import(/* webpackChunkName: "bigScreen" */ '@/views/bigScreen/fPanalysisReport/index'),
+                meta: {
+                  title: '加盟商/产品分析'
+                }
+              }
+            ]
+          }
+        ]
+      },
       // 基础设置
       {
         path: '/basicData',

+ 4 - 5
src/layouts/BigScreen.vue

@@ -57,7 +57,6 @@ export default {
   mounted () {
     this.timeFn()
     this.cancelLoading()
-    console.log(this.$route.meta.title)
   },
   beforeDestroy () {
     clearInterval(this.timing)
@@ -204,10 +203,10 @@ export default {
               margin-right: 20px;
               background: linear-gradient(to right, rgba(39, 180, 255, 0.5), rgba(76, 245, 255, 0.1));
   			cursor: pointer;
-  			&:hover,&:active{
-  				color: #f1f1f1;
-  				background: linear-gradient(to right, rgba(39, 180, 255, 0.7), rgba(76, 245, 255, 0.3));
-  			}
+            &:hover,&:active{
+              color: #f1f1f1;
+              background: linear-gradient(to right, rgba(39, 180, 255, 0.7), rgba(76, 245, 255, 0.3));
+            }
           }
   		.focus{
   			transform: scale(1.1);

+ 24 - 6
src/views/bigScreen/fPanalysisReport/index.vue

@@ -1,8 +1,15 @@
 <template>
   <div class="contents">
     <div class="contetn_left">
-      <div class="pagetab">
-        <div class="item" ref="myDiv" v-focusable @click="toPage">﹤实时销售看板</div>
+      <div class="pagetab" v-if="!isInnerPage">
+        <div class="item" ref="myDiv" v-focusable @click="toPage">
+          ﹤实时销售看板
+        </div>
+      </div>
+      <div class="pagetab" v-else>
+        <div class="item" :class="item == curYear ? 'focus': ''" style="width: 100px;margin-right:10px" v-focusable v-for="item in yearArr" :key="item" @click="toPage(item)">
+          {{item}} 年
+        </div>
       </div>
       <ItemWrap class="contetn_left-top contetn_lr-aitem" title="加盟商分布">
         <LeftBottom />
@@ -75,7 +82,9 @@ export default {
       curTab: 1,
       jmsTotal: 0,
       cpTotal: 0,
-      curYear: ''
+      curYear: '',
+      isInnerPage: false,
+      yearArr: []
     }
   },
   filters: {
@@ -89,11 +98,20 @@ export default {
 	  })
     const year = location.href.split('?')[1]
     this.curYear = year ? year.split('=')[1] : new Date().getFullYear()
+    this.isInnerPage = this.$route.path.indexOf("bigStatistics")>=0
+  },
+  mounted () {
+    const toYeay = new Date().getFullYear()
+    this.yearArr = [toYeay-3,toYeay-2,toYeay-1,toYeay]
   },
-  mounted () {},
   methods: {
-    toPage () {
-      this.$router.push({ name: 'realTimeSalesReport', query: { year: this.curYear } })
+    toPage (curYear) {
+      if(!this.isInnerPage){
+        this.$router.push({ name: 'realTimeSalesReport', query: { year: this.curYear } })
+      }else{
+        this.curYear = curYear
+        this.$router.replace({ name: 'bigfPanalysisReport', query: { year: curYear } })
+      }
     },
     setJmsTotal (val) {
       this.jmsTotal = val

+ 3 - 0
src/views/bigScreen/fPanalysisReport/right-bottom.vue

@@ -75,6 +75,9 @@ export default {
     })
   },
   watch: {
+    curYear (a,b){
+      this.getData()
+    },
   	curTab (newValue, oldValue) {
       this.queryType = newValue == 1 ? 'qty' : 'amount'
   		this.getData()

+ 5 - 1
src/views/bigScreen/fPanalysisReport/right-top.vue

@@ -65,7 +65,11 @@ export default {
   created () {
     this.getData()
   },
-  mounted () { },
+  watch:{
+    curYear (a,b){
+      this.getData()
+    }
+  },
   beforeDestroy () {
     this.clearData()
   },

+ 5 - 0
src/views/bigScreen/realTimeSalesReport/center-bottom.vue

@@ -30,6 +30,11 @@ export default {
   mounted () {
     this.getData()
   },
+  watch:{
+    curYear (a,b){
+      this.getData()
+    }
+  },
   beforeDestroy () {
     this.clearData()
   },

+ 5 - 1
src/views/bigScreen/realTimeSalesReport/center-map.vue

@@ -37,7 +37,11 @@ export default {
       loading: false
     }
   },
-  created () {},
+  watch:{
+    curYear (a,b){
+      this.getData('china')
+    }
+  },
   mounted () {
     this.getData('china')
   },

+ 3 - 2
src/views/bigScreen/realTimeSalesReport/center-top.vue

@@ -34,9 +34,10 @@ export default {
       config1: null
     }
   },
-  mounted () {
-  },
   watch: {
+    curYear (a,b){
+      this.getData()
+    },
     totalNums (newValue, oldValue) {
       console.log(newValue)
       this.config = {

+ 21 - 5
src/views/bigScreen/realTimeSalesReport/index.vue

@@ -1,11 +1,16 @@
 <template>
   <div class="contents">
     <div class="contetn_left">
-      <div class="pagetab">
+      <div class="pagetab" v-if="!isInnerPage">
         <div class="item" ref="myDiv" v-focusable @click="toPage">
           ﹤加盟商/产品分析
         </div>
       </div>
+      <div class="pagetab" v-else>
+        <div class="item" :class="item == curYear ? 'focus': ''" style="width: 100px;margin-right:10px" v-focusable v-for="item in yearArr" :key="item" @click="toPage(item)">
+          {{item}} 年
+        </div>
+      </div>
       <ItemWrap class="contetn_left-top contetn_lr-item" :title="'区域销售金额占比'">
         <LeftTop :curYear="curYear" />
       </ItemWrap>
@@ -68,7 +73,9 @@ export default {
     return {
       yearTotalNums: 0,
       yearTotalAmount: 0,
-      curYear: ''
+      curYear: '',
+      isInnerPage: false,
+      yearArr: []
     }
   },
   filters: {
@@ -82,11 +89,20 @@ export default {
 	  })
     const year = location.href.split('?')[1]
     this.curYear = year ? year.split('=')[1] : new Date().getFullYear()
+    this.isInnerPage = this.$route.path.indexOf("bigStatistics")>=0
+  },
+  mounted () { 
+    const toYeay = new Date().getFullYear()
+    this.yearArr = [toYeay-3,toYeay-2,toYeay-1,toYeay]
   },
-  mounted () { },
   methods: {
-    toPage () {
-      this.$router.push({ name: 'fPanalysisReport', query: { year: this.curYear } })
+    toPage (curYear) {
+      if(!this.isInnerPage){
+        this.$router.push({ name: 'fPanalysisReport', query: { year: this.curYear } })
+      }else{
+        this.curYear = curYear
+        this.$router.replace({ name: 'bigRealTimeSalesReport', query: { year: curYear } })
+      }
     },
     setYearData (data) {
       console.log(data)

+ 4 - 1
src/views/bigScreen/realTimeSalesReport/left-bottom.vue

@@ -30,7 +30,10 @@ export default {
   created () {
     this.getData()
   },
-  computed: {
+  watch:{
+    curYear (a,b){
+      this.getData()
+    }
   },
   mounted () { },
   beforeDestroy () {

+ 4 - 1
src/views/bigScreen/realTimeSalesReport/left-top.vue

@@ -29,7 +29,10 @@ export default {
   created () {
     this.getData()
   },
-  mounted () {
+  watch:{
+    curYear (a,b){
+      this.getData()
+    }
   },
   beforeDestroy () {
     this.clearData()

+ 5 - 0
src/views/bigScreen/realTimeSalesReport/right-top.vue

@@ -36,6 +36,11 @@ export default {
   mounted () {
     this.getData()
   },
+  watch:{
+    curYear (a,b){
+      this.getData()
+    }
+  },
   beforeDestroy () {
     this.clearData()
   },

+ 2 - 2
vue.config.js

@@ -108,9 +108,9 @@ const vueConfig = {
     // If you want to turn on the proxy, please remosve the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://192.168.2.103:8602/ocs-admin',
+        // target: 'http://192.168.2.103:8602/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
-        // target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
+        target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,
         changeOrigin: true,
         pathRewrite: {