Browse Source

修改 没有能耗值隐藏第三屏

zhaojijng 2 years ago
parent
commit
f7e310e472

File diff suppressed because it is too large
+ 1 - 1
dist/sgdaping/assets/background.2115cf27.css


File diff suppressed because it is too large
+ 4 - 4
dist/sgdaping/assets/background.21413b6a.js


File diff suppressed because it is too large
+ 1 - 0
dist/sgdaping/assets/index.07ca2d8f.css


File diff suppressed because it is too large
+ 0 - 1
dist/sgdaping/assets/index.1db1177c.css


File diff suppressed because it is too large
+ 1 - 0
dist/sgdaping/assets/index.2878d725.js


File diff suppressed because it is too large
+ 3 - 3
dist/sgdaping/assets/index.ae7b42cd.js


+ 1 - 0
dist/sgdaping/assets/index.61907fb1.js

@@ -0,0 +1 @@
+import{i as e,r as n,o,l as t,_ as s,a as r,g as a}from"./index.28963bb2.js";const c=e({setup(){return t(),n({}),o(()=>{}),{}}});function u(p,i,_,l,d,f){return a(),r("h2",null,"login\u9875\u9762")}const x=s(c,[["render",u]]);export{x as default};

File diff suppressed because it is too large
+ 1 - 0
dist/sgdaping/assets/index.67c83266.js


File diff suppressed because it is too large
+ 1 - 1
dist/sgdaping/assets/index.4f0b5577.css


File diff suppressed because it is too large
+ 0 - 1
dist/sgdaping/assets/index.ad240cf6.js


File diff suppressed because it is too large
+ 0 - 1
dist/sgdaping/assets/index.aed949d3.css


File diff suppressed because it is too large
+ 1 - 0
dist/sgdaping/assets/index.bf57d7bd.css


File diff suppressed because it is too large
+ 0 - 1
dist/sgdaping/assets/index.c0409636.js


+ 0 - 1
dist/sgdaping/assets/index.e35a04cd.js

@@ -1 +0,0 @@
-import{h as e,r as n,o,k as t,_ as s,c as r,f as a}from"./index.ae7b42cd.js";const c=e({setup(){return t(),n({}),o(()=>{}),{}}});function u(p,_,f,i,d,l){return a(),r("h2",null,"login\u9875\u9762")}const x=s(c,[["render",u]]);export{x as default};

+ 2 - 2
dist/sgdaping/index.html

@@ -5,8 +5,8 @@
     <link rel="icon" type="image/svg+xml" href="/sgdaping/vite.svg" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title>daping</title>
-    <script type="module" crossorigin src="/sgdaping/assets/index.ae7b42cd.js"></script>
-    <link rel="stylesheet" href="/sgdaping/assets/index.4f0b5577.css">
+    <script type="module" crossorigin src="/sgdaping/assets/index.28963bb2.js"></script>
+    <link rel="stylesheet" href="/sgdaping/assets/index.9a8b1835.css">
   </head>
   <body>
     <div id="app"></div>

+ 2 - 0
src/App.vue

@@ -6,6 +6,8 @@ export default defineComponent({
     setup() {
         const projectStore = useProjectStore();
         onMounted(() => {
+             projectStore.setLastAllEnergy();
+             
             //这两个请求不能写在这里 router.beforeEach 发生在后面,其中有 改变projectId的方法
             // projectStore.setWeather();
             // projectStore.setProjectObj();

+ 5 - 3
src/components/LastAllEnergy.vue

@@ -73,15 +73,17 @@ export default defineComponent({
                     : lastAllEnergy.energyCompare,
             };
             allData.compareBase = lastAllEnergy.energyCompare * 100 + "%";
+            allData.widthBase = "100%";
             return lastObj;
         });
         projectStore.$subscribe((mutation, state) => {
-            console.log("state", state);
-            allData.widthBase = "100%";
+            //debugger; 这个不走 改变projectStore 的方法都App.vue 中
+            //allData.widthBase = "100%";
             //allData.compareBase = state.lastAllEnergy.energyCompare * 100 + "%";
         });
         onMounted(() => {
-            projectStore.setLastAllEnergy();
+            //debugger;
+           //projectStore.setLastAllEnergy();
         });
         return { ...toRefs(allData), lastAllComputed, projectStore };
     },

+ 3 - 2
src/components/LastSaveEnergy.vue

@@ -44,7 +44,6 @@
                     <canvas
                         id="circleCanvas1"
                         class="circleCanvas1"
-                     
                     ></canvas>
                     <div class="outOval outOvalCo2">
                         <div class="outCircle">
@@ -153,6 +152,7 @@ export default defineComponent({
         let uniformSpeed = 1;
         function circleMove(circtx) {
             window.requestAnimationFrame(() => {
+                //这是一个循环执行的方法
                 circleMove(circtx);
             });
             circtx.clearRect(0, 0, 800, 300);
@@ -198,7 +198,7 @@ export default defineComponent({
             circtx.fill();
             // circtx.restore();
         }
-
+        //不断改变 x y坐标
         function getPath(startp, middlep, endp) {
             if (point1p.x > middlep.x && point1p.x <= startp.x) {
                 point1p.x = point1p.x - 1;
@@ -216,6 +216,7 @@ export default defineComponent({
                 point1p = startp;
             }
         }
+        //不断改变 x y坐标
         function getPath2(pointp, startp, middlep, endp) {
             if (pointp.x >= startp.x && pointp.x < middlep.x) {
                 pointp.x = pointp.x + 1;

+ 2 - 2
src/components/airSwitchHor.vue

@@ -41,12 +41,12 @@ export default defineComponent({
         });
         watch(airValue, (newValue, oldValue) => {
             initChart();
-            console.log("allData.watch");
+            //console.log("allData.watch");
         });
         onUnmounted(() => {
             if (allData.achart) {
                 allData.achart.destroy();
-                console.log("allData.achart222", allData.achart);
+                //console.log("allData.achart222", allData.achart);
             }
         });
         const initChart = () => {

+ 6 - 1
src/components/lastEnergyChart.vue

@@ -79,7 +79,12 @@ export default defineComponent({
                             ).toFixed(0)
                         );
                     });
-
+                    if (resdata.length == 0) {
+                        setTimeout(() => {
+                            contx.emit("donethreepage");
+                        }, 6000);
+                        return;
+                    }
                     allData.lastChart = allData.cInitChart(resdata);
                     //console.log("contx,contx", contx, contx.emit);
                     allData.setChartInterval();

+ 1 - 1
src/store/useProjectStore.ts

@@ -44,7 +44,7 @@ const useProjectStore = defineStore({
         async setLastAllEnergy() {
             try {
                 var res = await queryLastEnergy();
-
+                //debugger;
                 var resdata = (res.data.content || [])[0] || {};
                 this.lastAllEnergy = resdata;
             } catch (err) {}

+ 28 - 4
src/views/horiScreen/index.vue

@@ -64,7 +64,7 @@
     </div>
 </template>
 <script lang="ts">
-import { ref, reactive, toRefs, onMounted } from "vue";
+import { ref, reactive, toRefs, onMounted, computed } from "vue";
 import pageHead from "@/components/pageHead.vue";
 import NowData from "@/components/NowData.vue";
 import LastMonthData from "@/components/LastMonthData.vue";
@@ -93,14 +93,38 @@ export default {
         LastSaveEnergy: LastSaveEnergy,
     },
     setup() {
+        const projectStore = useProjectStore();
+        var showAllPage = computed(() => {
+            console.log(
+                "lastAllEnergy",
+                projectStore.lastAllEnergy.energyTotal
+            );
+            if (
+                projectStore.lastAllEnergy.energyTotal === undefined &&
+                projectStore.lastAllEnergy.energyCompare === undefined
+            ) {
+                return 2;
+            } else {
+                return 3;
+            }
+        });
+        // projectStore.$subscribe((mutation, state) => {
+        //     console.log(
+        //         "projectStore--state",
+        //         state,
+        //         state.lastAllEnergy.energySaving
+        //     );
+        // });
+
         const allData = reactive({
             nowPage: 1,
-            showAllPage: 3,
+            //showAllPage: 3,
             doneTowPage() {
+                //debugger;
                 //第二屏刷新结束 通知
-                if (allData.showAllPage == 3) {
+                if (showAllPage.value == 3) {
                     allData.nowPage = 3;
-                } else if (allData.showAllPage == 2) {
+                } else if (showAllPage.value == 2) {
                     allData.nowPage = 1;
                 }
                 allData.timePageShow();

+ 29 - 4
src/views/verScreen/index.vue

@@ -49,7 +49,15 @@
     </div>
 </template>
 <script lang="ts">
-import { ref, defineComponent, reactive, toRefs, watch, onMounted } from "vue";
+import {
+    ref,
+    defineComponent,
+    reactive,
+    toRefs,
+    watch,
+    onMounted,
+    computed,
+} from "vue";
 import { storeToRefs } from "pinia";
 import useProjectStore from "@/store/useProjectStore";
 
@@ -78,19 +86,36 @@ export default defineComponent({
         LastSaveEnergy: LastSaveEnergy,
     },
     setup() {
+        const projectStore = useProjectStore();
+        var showAllPage = computed(() => {
+            console.log(
+                "lastAllEnergy",
+                projectStore.lastAllEnergy.energyTotal
+            );
+            if (
+                projectStore.lastAllEnergy.energyTotal === undefined &&
+                projectStore.lastAllEnergy.energyCompare === undefined
+            ) {
+                return 2;
+            } else {
+                return 3;
+            }
+        });
+
         const allData = reactive({
             nowPage: 1,
-            showAllPage: 3,
+            //showAllPage: 3,
             doneThreePage() {
                 //第三屏刷新结束 通知
                 allData.nowPage = 1;
                 allData.timePageShow(); //1屏变2屏
             },
             doneTowPage() {
+                //debugger;
                 //第二屏刷新结束 通知
-                if (allData.showAllPage == 3) {
+                if (showAllPage.value == 3) {
                     allData.nowPage = 3;
-                } else if (allData.showAllPage == 2) {
+                } else if (showAllPage.value == 2) {
                     allData.nowPage = 1;
                     allData.timePageShow(); //1屏变2屏
                 }