Guoxiaohuan 5 years ago
parent
commit
08a6a377eb

+ 8 - 12
src/api/appeal/appeal.js

@@ -4,15 +4,11 @@ export function deleteFile({
 }) {
     return httputils.postJson(`/image-service/common/files_delete?systemId=saas&secret=46f869eea8b31d14`, postParams)
 }
-// 可申诉的未执行策略
-export function queryAppeals({ postParams }) {
-    return httputils.postJson(`/duoduo-service/transfer/chiller/command/query?projectId=Pj4419000005`, postParams)
-}
-// 审核完成、超时未申诉
-export function queryAuditCompleted({ postParams }) {
-    return httputils.postJson(`/duoduo-service/transfer/chiller/command/query?projectId=Pj4419000005`, postParams)
-}
-// 申诉中
-export function queryInAudit({ postParams }) {
-    return httputils.postJson(`/duoduo-service/workflow/work/query?projectId=Pj4419000005`, postParams)
-}
+// 可申诉的未执行策略  // 审核完成、超时未申诉  // 申诉中
+export function queryWorkflow({ postParams }) {
+    return httputils.postJson(`/duoduo-service/workflow/work/query`, postParams)
+}
+// 查询冷站指令执行情况
+export function queryChillerExecuteInfo({ postParams }) {
+    return httputils.postJson(`/duoduo-service/transfer/chiller/command/queryChillerExecuteInfo?projectId=Pj4419000005`, postParams)
+}

+ 4 - 0
src/api/main/main.js

@@ -0,0 +1,4 @@
+import httputils from '@/api/httputils'
+export function queryWeather({ getParams }) {
+    return httputils.getJson(`/duoduo-service/transfer/chiller/command/queryWeather?projectId=Pj4419000005`, getParams)
+}

+ 40 - 45
src/components/uploadImg.vue

@@ -11,7 +11,6 @@
     <div class="Uploading" v-if="Uploading">
       <span>上传中</span>
       <div class="progress-box">
-        <!-- <div id="progressId" class="progress"></div> -->
         <el-progress :text-inside="true" :stroke-width="4" :percentage="percentage"></el-progress>
       </div>
       <i class="deleteImg2" @click="handleRemove(image,ind)"></i>
@@ -42,43 +41,58 @@ export default {
     return {
       showTrue: true,
       tempArr: [],
-      percentage: 30,
+      percentage: 0,
       Uploading: false, //上传中
       failImg: false //上传失败
     };
   },
   components: { zoomImage },
   props: ["souseArr"],
-  mounted() {},
+  mounted() {
+    console.log(this.souseArr);
+  },
   methods: {
     distinctFile(a) {
+      console.log(a)
       return Array.from(new Set(a));
     },
     getImage(event) {
       this.Uploading = true;
-      this.fileName = new Date().getTime() + "_" + event.name;
-      let url =
-        "/image-service/common/image_upload?systemId=saas&secret=46f869eea8b31d14&key=" +
-        this.fileName;
-      let that = this;
-      let reader = new FileReader();
-      reader.readAsArrayBuffer(event.raw);
-      reader.onload = function(e) {
-        var xhr = new XMLHttpRequest();
-        xhr.open("POST", url);
-        xhr.send(reader.result);
-        xhr.onreadystatechange = function() {
-          if (xhr.readyState == 4) {
-            if (xhr.status == 200) {
-              let src = that.getPreviewSrc(event.raw);
-              that.tempArr.push(that.fileName);
-              that.souseArr.push(that.fileName);
-              that.$emit("setPic", that.souseArr);
-              that.Uploading = false;
-            }
-          }
-        };
-      };
+      this.percentage = 0;
+      var percentage = this.percentage;
+      var test = setInterval(() => {
+        percentage = this.percentage;
+        if (percentage < 100) {
+          percentage += 10;
+          this.percentage = percentage;
+        }
+        if (percentage == 100) {
+          this.fileName = new Date().getTime() + "_" + event.name;
+          let url =
+            "/image-service/common/image_upload?systemId=saas&secret=46f869eea8b31d14&key=" +
+            this.fileName;
+          let that = this;
+          let reader = new FileReader();
+          reader.readAsArrayBuffer(event.raw);
+          reader.onload = function(e) {
+            var xhr = new XMLHttpRequest();
+            xhr.open("POST", url);
+            xhr.send(reader.result);
+            xhr.onreadystatechange = function() {
+              if (xhr.readyState == 4) {
+                if (xhr.status == 200) {
+                  let src = that.getPreviewSrc(event.raw);
+                  // that.tempArr.push(that.fileName);
+                  that.souseArr.push(that.fileName);
+                  that.$emit("setPic", that.souseArr);
+                  that.Uploading = false;
+                }
+              }
+            };
+          };
+          clearInterval(test);
+        }
+      }, 200);
     },
     getPreviewSrc(file) {
       if ("URL" in window) {
@@ -184,27 +198,8 @@ export default {
     .progress-box {
       width: 94px;
       height: 4px;
-      background: rgba(233, 233, 233, 1);
       border-radius: 2px;
       margin: 0 auto;
-      margin-top: 8px;
-      position: relative;
-      .progress {
-        width: 0px;
-        height: 4px;
-        background: rgba(0, 145, 255, 1);
-        border-radius: 2px;
-        position: absolute;
-        top: 0;
-        left: 0;
-        transition: all 2s;
-        -moz-transition: all 2s;
-        -webkit-transition: all 2s;
-        -o-transition: all 2s;
-      }
-      .progressHover {
-        width: 94px;
-      }
     }
   }
   .Uploading:hover .deleteImg2 {

+ 1 - 10
src/views/appeal/appealDetail.vue

@@ -61,16 +61,7 @@ export default {
         }
       ],
       value: "",
-      souseArr: [
-        "1576036336333_image.jpg",
-        "1576036135588_image.jpg",
-        "1576036336333_image.jpg",
-        "1576036135588_image.jpg",
-        "1576036336333_image.jpg",
-        "1576036135588_image.jpg",
-        "1576036336333_image.jpg",
-        "1576036135588_image.jpg"
-      ]
+      souseArr: ["1576036336333_image.jpg", "1576036135588_image.jpg"]
     };
   },
   components: {

+ 47 - 26
src/views/appeal/index.vue

@@ -75,11 +75,7 @@
 </template>
 <script>
 import Head from "../main/index";
-import {
-  queryAppeals,
-  queryAuditCompleted,
-  queryInAudit
-} from "@/api/appeal/appeal.js";
+import { queryWorkflow, queryChillerExecuteInfo } from "@/api/appeal/appeal.js";
 
 export default {
   data() {
@@ -204,57 +200,82 @@ export default {
     },
     init() {
       this.appealsIng();
-      this.auditCompletedIng();
-      this.InAuditIng();
+      // this.auditCompletedIng();
+      // this.InAuditIng();
     },
+    // 可申诉的未执行策略
     appealsIng() {
+      this.appealsArr = [];
       let params = {
         postParams: {
           criteria: {
-            projectId: "Pj4419000005",
-            date: {
-              $gte: "20200216"
-            },
-            isExecuted: false,
-            appealStatus: [1, 5]
-          }
+            projectId: "Pj1101080002",
+            trackerId: 3, //固定为3
+            status: [301, 305] //固定为未申诉和已驳回
+          },
+          withColumns: ["customAttribute"]
         }
       };
 
-      queryAppeals(params).then(res => {
-        this.appealsArr = res.content ? res.content : [];
+      queryWorkflow(params).then(res => {
+        console.log(res);
+        let appealsArr = [],
+          arr = [];
+        appealsArr = res.content ? res.content : [];
+        if (appealsArr.length > 0) {
+          appealsArr.forEach(item => {
+            arr.push(item.commandId);
+          });
+          this.queryExecute(arr);
+        }
       });
     },
+    queryExecute(id) {
+      let params = {
+        postParams: {
+          criteria: {
+            id: id
+          }
+        }
+      };
+      queryChillerExecuteInfo(params).then(res => {
+        console.log(res);
+      });
+    },
+    // 审核完成、超时未申诉
     auditCompletedIng() {
       this.appealsArr = [];
       let params = {
         postParams: {
           criteria: {
-            projectId: "Pj4419000005",
-            date: {
-              $gte: "20200216"
-            },
-            isExecuted: false,
-            appealStatus: [3, 4, 6]
-          }
+            projectId: "Pj1101080002",
+            trackerId: 3,
+            status: [303, 304, 306],
+            createTime: {
+              $gte: "20200216000000" //三天以内
+            }
+          },
+          withColumns: ["customAttribute"]
         }
       };
-      queryAuditCompleted(params).then(res => {
+      queryWorkflow(params).then(res => {
         this.auditCompletedArr = res.content ? res.content : [];
       });
     },
+
+    // 申诉中
     InAuditIng() {
       let params = {
         postParams: {
           criteria: {
             projectId: "Pj1101080002",
             trackerId: 3,
-            status: 301
+            status: 302
           },
           withColumns: ["customAttribute"]
         }
       };
-      queryInAudit(params).then(res => {
+      queryWorkflow(params).then(res => {
         this.InAuditArr = res.content ? res.content : [];
       });
     }

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

@@ -32,22 +32,22 @@
         <div class="head-right">
           <ul>
             <li>
-              <span class="head-text">2020.01.12 12:45</span>
+              <span class="head-text">{{dateNow||'--'}}</span>
             </li>
             <li>
               <span class="line"></span>
             </li>
             <li>
-              <span class="head-text MicrYaHei">天气:多云</span>
+              <span class="head-text MicrYaHei">天气:{{weather}}</span>
             </li>
             <li>
-              <span class="head-text MicrYaHei">25℃</span>
+              <span class="head-text MicrYaHei">{{temperatureOut}}℃</span>
             </li>
             <li>
               <span class="line"></span>
             </li>
             <li>
-              <span class="">{{$store.state.userInfo.username}}</span>
+              <span class>{{$store.state.userInfo.username}}</span>
             </li>
             <li>
               <div class="triangle_border_down"></div>
@@ -80,7 +80,11 @@
   </div>
 </template>
 <script>
-import store from '../../store'
+import store from "../../store";
+var moment = require("moment");
+import "moment/locale/zh-cn";
+import { queryWeather } from "@/api/main/main.js";
+
 export default {
   data() {
     return {
@@ -116,7 +120,11 @@ export default {
           label: "嘉铭东枫产业园"
         }
       ],
-      value: ""
+      value: "",
+      dateNow: new Date(),
+      weather: "",
+      temperatureIn: "", // 室内
+      temperatureOut: "" // 室外
     };
   },
   props: ["headText"],
@@ -126,10 +134,25 @@ export default {
     },
     navBlock() {
       document.getElementById("nav").className = "nav nav-hover";
+    },
+    // 查询当日天气
+    query() {
+      queryWeather({}).then(res => {
+        if (res.result == "success") {
+          this.weather = res.weather || "--";
+          this.temperatureIn = res.temperatureIn || "--";
+          this.temperatureOut = res.temperatureOut || "--";
+        }
+      });
     }
   },
-  mounted(){
-   
+  mounted() {
+    setInterval(() => {
+      this.dateNow = moment()
+        .locale("zh-cn")
+        .format("YYYY.MM.DD HH:mm");
+    }, 1000);
+    this.query();
   }
 };
 </script>
@@ -267,7 +290,6 @@ export default {
       display: flex;
       justify-content: flex-start;
       align-items: center;
-  
     }
   }
   .mainContainerTop {