zhulizhen 5 éve
szülő
commit
435a597882
3 módosított fájl, 16 hozzáadás és 13 törlés
  1. 4 3
      src/api/strategy/strategy.js
  2. 11 9
      src/views/main/index.vue
  3. 1 1
      src/views/strategy/index.vue

+ 4 - 3
src/api/strategy/strategy.js

@@ -1,13 +1,14 @@
 import httputils from '@/api/httputils'
+import store from '@/store'
 //查询当前运行策略
 export function queryCommand({getParams}) {
-    return httputils.getJson(`/duoduo-service/transfer/chiller/command/queryData?projectId=Pj4413030001`, getParams)
+    return httputils.getJson(`/duoduo-service/transfer/chiller/command/queryData?projectId=${store.state.projectId}`, getParams)
 }
 //查询当日运行策略列表
 export function getCommand({postParams}) {
-    return httputils.postJson(`/duoduo-service/transfer/chiller/command/query?projectId=Pj4413030001`, postParams)
+    return httputils.postJson(`/duoduo-service/transfer/chiller/command/query?projectId=${store.state.projectId}`, postParams)
 }
 //修改策略备注
 export function updateCommand({postParams}) {
-    return httputils.postJson(`/duoduo-service/transfer/chiller/command/update?projectId=Pj4413030001`, postParams)
+    return httputils.postJson(`/duoduo-service/transfer/chiller/command/update?projectId=${store.state.projectId}`, postParams)
 }

+ 11 - 9
src/views/main/index.vue

@@ -87,7 +87,6 @@ import store from "../../store";
 var moment = require("moment");
 import "moment/locale/zh-cn";
 import { queryWeather } from "@/api/main/main.js";
-
 export default {
   data() {
     return {
@@ -114,14 +113,6 @@ export default {
         }
       ],
       options: [
-        {
-          value: "Pj4419000005",
-          label: "嘉铭东枫产业园产业园"
-        },
-        {
-          value: "Pj1101010002",
-          label: "嘉铭东枫产业园"
-        }
       ],
       dateNow: new Date(),
       weather: "",
@@ -131,6 +122,9 @@ export default {
     };
   },
   props: ["headText"],
+  computed:{
+ 
+  },
   methods: {
     navNone() {
       document.getElementById("nav").className = "nav";
@@ -150,6 +144,14 @@ export default {
     }
   },
   mounted() {
+    console.log(this.$store.state.projects.projects)
+    let projects = this.$store.state.projects.projects
+    projects.forEach(el=>{
+      this.options.push({
+        label:el.localName,
+        value:el.id
+      })
+    })
     setInterval(() => {
       this.dateNow = moment()
         .locale("zh-cn")

+ 1 - 1
src/views/strategy/index.vue

@@ -118,7 +118,7 @@ export default {
         }
       };
       getCommand(params).then(res => {
-        this.tableData = res.content ? res.data.content : [];
+        this.tableData = res.content ? res.content : [];
       });
     }
   },