Просмотр исходного кода

Merge branch 'yx' of http://61.161.152.110:10101/r/electronic-map into yx

chenminghua 3 лет назад
Родитель
Сommit
54bf7f11b3
3 измененных файлов с 78 добавлено и 45 удалено
  1. 1 1
      src/router/index.js
  2. 0 2
      src/views/Home/Home.vue
  3. 77 42
      src/views/Home/components/power-review.vue

+ 1 - 1
src/router/index.js

@@ -384,7 +384,7 @@ const routes = [{
 		import( /* webpackChunkName: "health8" */ "../views/HealthControl/Health8.vue"),
 },
 {
-	path: "/sandtable",
+	path: "/sandtable", // 沙盘
 	name: "sandtable",
 	component: () =>
 		import( /* webpackChunkName: "sandtable" */ "../views/SandTable/SandTable.vue"),

+ 0 - 2
src/views/Home/Home.vue

@@ -1005,8 +1005,6 @@ export default {
 
     // 点击地图展示类型
     changeShowType(wpId, planBtnName) {
-      console.log('changeShowType wpId: ' + wpId)
-      console.log('changeShowType planBtnName: ' + planBtnName)
       this.wpName = planBtnName;
       this.planBtnName = planBtnName;
       this.jczbmap = {};

+ 77 - 42
src/views/Home/components/power-review.vue

@@ -3,7 +3,20 @@
     <Row type="flex" justify="center" :align="'middle'">
       <!-- 功率复核 PowerLoad -->
       <Col v-for="item in PowerLoad" :key="item" :span="6">
-        <dash-pie-chart :title="item.title" :value="item.value" :max="item.max" height="10vh" @click="openDialog(item.dialogTitle, item.subUrl, item.targetName, item.dialogType)" />
+        <dash-pie-chart
+          :title="item.title"
+          :value="item.value"
+          :max="item.max"
+          height="10vh"
+          @click="
+            openDialog(
+              item.dialogTitle,
+              item.subUrl,
+              item.targetName,
+              item.dialogType
+            )
+          "
+        />
       </Col>
     </Row>
   </div>
@@ -21,76 +34,98 @@ export default {
     DashPieChart,
   },
 
-  data () {
+  data() {
     return {
       // 功率复核数据
       PowerLoad: [],
-      wpId:""
+      wpId: "",
     };
   },
 
   props: {
     data: {
       type: Array,
-      default: () => []
+      default: () => [],
+    },
+    id: {
+      type: String,
+      defaylt: "",
     },
-    id:{
-      type:String,
-      defaylt:""
-    }
   },
 
-  mounted () {
+  mounted() {
     this.PowerLoad = this.data;
     this.wpId = this.id;
   },
 
-  methods:{
-    openDialog(dialogTitle, subUrl, targetName, dialogType){
+  methods: {
+    openDialog(dialogTitle, subUrl, targetName, dialogType) {
       let that = this;
       that.API.requestData({
-          method: "POST",
-          subUrl,
-          data: {
-            id:that.wpId,
-            targetName
-          },
-          success (res) {
-            let powerLineChartData = {
-              // 图表所用单位
-              units: [""],
-              value: [],
-            };
+        method: "POST",
+        subUrl,
+        data: {
+          id: that.wpId,
+          targetName,
+        },
+        success(res) {
+          // let powerLineChartData = {
+          //   // 图表所用单位
+          //   units: [""],
+          //   value: [],
+          // };
 
-            res.data.forEach((pEle,pIndex)=>{
-              powerLineChartData.value.push({
-                title: pEle[0].name,
-                yAxisIndex: 0,
-                value: [],
-              });
+          // res.data.forEach((pEle, pIndex) => {
+          //   powerLineChartData.value.push({
+          //     title: pEle[0].name,
+          //     yAxisIndex: 0,
+          //     smooth: true,
+          //     value: [],
+          //   });
 
-              pEle.forEach(cEle=>{
-                powerLineChartData.value[pIndex].value.push({
-                  text: new Date(cEle.time).formatDate("hh:mm:ss"),
-                  value: cEle.value1
-                });
+          //   pEle.forEach((cEle) => {
+          //     powerLineChartData.value[pIndex].value.push({
+          //       text: new Date(cEle.time).formatDate("hh:mm:ss"),
+          //       value: cEle.value1,
+          //     });
+          //   });
+          // });
+
+          let powerLineChartData = [];
+
+          res.data.forEach((pEle, pIndex) => {
+            powerLineChartData.push({
+              title: pEle[0].name,
+              smooth: true,
+              value: [],
+            });
+
+            pEle.forEach((cEle) => {
+              powerLineChartData[pIndex].value.push({
+                text: new Date(cEle.time).formatDate("hh:mm:ss"),
+                value: cEle.value1,
               });
             });
+          });
 
-            that.$emit("chartClick", { dialogTitle, dialogType, data: powerLineChartData });
-          }
-        });
-    }
+          that.$emit("chartClick", {
+            dialogTitle,
+            dialogType,
+            data: powerLineChartData,
+          });
+        },
+      });
+    },
   },
 
   watch: {
-    data (res) {
+    data(res) {
       this.PowerLoad = res;
     },
-    id(res){
+    id(res) {
       this.wpId = res;
-    }
-  }
+    },
+  },
 };
 </script>