chenrui  3 年之前
父節點
當前提交
8731972c35

+ 18 - 0
src/App.vue

@@ -25,6 +25,8 @@ export default {
   },
   created() {},
   mounted() {
+    // this.resize();
+    // window.onresize = this.resize;
     setInterval(() => {
       //实时更新数据
       this.alarmList();
@@ -42,6 +44,22 @@ export default {
     },
   },
   methods: {
+    resize() {
+      let windowW = window.innerWidth;
+      let windowH = window.innerHeight;
+      let root = document.getElementById("app");
+      let scaleX = windowW / 1920;
+      let scaleY = windowH / 937;
+      if (windowW === 1920) {
+        root.style.height = "937px";
+        root.style.transform = "scale(" + 1 + "," + 1 + ") translateZ(0)";
+      } else {
+        root.style.height = "930px";
+        root.style.transform =
+          "scale(" + scaleX + "," + scaleY + ") translateZ(0)";
+        root.style.transformOrigin = "0 0";
+      }
+    },
     //告警声音
     linhear() {
       AlarmSon().then((item) => {

+ 12 - 9
src/api/request.js

@@ -1,3 +1,4 @@
+import { data } from 'jquery'
 import { Service } from './Service.js'
 export function getVehicles(data) {//获取车辆信息
   return Service({
@@ -80,7 +81,7 @@ export function setVehicleStatus(data) {//设置车辆
 export function Getorders(data) {//
   if (data.filter_by_state) {
     return Service({
-      url: '/Framework/IDSInfo/OrdersInfo?page=' + data.page + "&perpage=" + data.filter_by_state + '&perpage=10',
+      url: '/Framework/IDSInfo/OrdersInfo?page=' + data.page + "&filter_by_state=" + data.filter_by_state + '&perpage=10',
       method: 'get',
       data: data
     })
@@ -156,7 +157,7 @@ export function homedeleteuser(data) {//删除用户
 
 export function Reboot() {//系统重启
   return Service({
-    url: '/reboot',
+    url: '/framwork/reboot/reboot',
     method: 'post'
   })
 }
@@ -380,7 +381,7 @@ export function carUPlist(data) {//车辆接口
 }
 export function TemplateOrder() {//地图模板下单
   return Service({
-    url: '/Framework/IDSInfo/TemplatesInfo?page=1',
+    url: '/Framework/IDSInfo/TemplatesInfo?page=-1',
     method: 'get',
   })
 }
@@ -415,12 +416,14 @@ export function AlarmSon(data) {//告警声音
     data: data
   })
 }
-// export function getAllAndroidPlugins() {
-//   return Service({
-//     url: '/manager/getAndroidPlugin ',
-//     method: 'get'
-//   })
-// }
+
+export function AlarmD(data) {
+  return Service({
+    url: '/Framework/ExportExcel/ExportAlarmPlc?filename=' + data.filename,
+    method: 'get',
+    data: data
+  })
+}
 // export function addNewAndroidPlugin(data) {
 //   return Service({
 //     url: '/manager/addAndroidPlguin',

二進制
src/assets/img/blue4.png


+ 1 - 1
src/main.js

@@ -67,7 +67,7 @@ Vue.use(mixin)
 //     if (getCodeToken()) {
 //       next()
 //     } else {
-//       next({ path: '/404' })
+//       next({ path: '/' })
 //     }
 //   } else {
 //     next()

+ 25 - 21
src/pages/Alarm/RealTime/index.vue

@@ -109,7 +109,7 @@ export default {
         type: "warning",
       })
         .then(() => {
-          this.downFile();
+          this.AlarmD();
           this.$message({
             type: "success",
             message: "导出成功!",
@@ -122,6 +122,30 @@ export default {
           });
         });
     },
+    AlarmD() {
+      let xhr = new XMLHttpRequest();
+      xhr.open(
+        "get",
+        window.g.url + "/Framework/ExportExcel/ExportAlarmPlc?filename=告警信息"
+      );
+      xhr.responseType = "blob";
+      // xhr.setRequestHeader("token", res.resultMsg);
+      xhr.onload = function () {
+        var blob = this.response;
+        let a = document.createElement("a");
+        let url = window.URL.createObjectURL(blob);
+        a.href = url;
+        a.download = "告警.xlsx";
+        a.click();
+        window.URL.revokeObjectURL(url);
+      };
+      xhr.send();
+      // let a = document.createElement("a");
+      // a.href =
+      //   window.g.url +
+      //   "/Framework/ExportExcel/ExportAlarmPlc?filename=告警信息";
+      // a.click();
+    },
     downFile() {
       var wb = XLSX.utils.table_to_book(
         document.querySelector("#userTableData")
@@ -201,26 +225,6 @@ export default {
     goTo() {
       this.$router.push("/Alarm/History");
     },
-    downlodTable() {
-      this.$confirm("是否需要导出xlsx文档, 是否继续?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.downFile();
-          this.$message({
-            type: "success",
-            message: "导出成功!",
-          });
-        })
-        .catch(() => {
-          this.$message({
-            type: "info",
-            message: "已取消导出",
-          });
-        });
-    },
     downFile() {
       var wb = XLSX.utils.table_to_book(
         document.querySelector("#userTableData")

+ 17 - 60
src/pages/ArmManage/index.vue

@@ -29,109 +29,66 @@
             />
             <img
               src="../../assets/img/blue.png"
-              v-if="
-                (item.load_state == 0 &&
-                  item.ifOnline == 1 &&
-                  item.move_state == 'MT_NA' &&
-                  item.emergency_state == 'OK') ||
-                (item.move_state == 'MT_FINISHED' && item.load_state == 0)
-              "
+              v-if="item.sys_state == 'IDLE'"
               class="left_center_img"
               alt=""
             />
             <img
               src="../../assets/img/blue2.png"
-              v-if="
-                (item.load_state > 0 &&
-                  item.ifOnline == 1 &&
-                  item.move_state == 'MT_NA' &&
-                  item.emergency_state == 'OK') ||
-                (item.move_state == 'MT_FINISHED' && item.load_state > 0)
-              "
+              v-if="item.load_state > 0 && item.sys_state == 'IDLE'"
               class="left_center_img"
               alt=""
             />
 
             <img
               src="../../assets/img/green.png"
-              v-if="
-                item.load_state == 0 &&
-                item.ifOnline == 1 &&
-                item.move_state == 'MT_RUNNING' &&
-                item.emergency_state == 'OK'
-              "
+              v-if="item.sys_state == 'EXECUTING'"
               class="left_center_img"
               alt=""
             />
             <img
               src="../../assets/img/green2.png"
-              v-if="
-                item.load_state > 0 &&
-                item.ifOnline == 1 &&
-                item.move_state == 'MT_RUNNING' &&
-                item.emergency_state == 'OK'
-              "
+              v-if="item.sys_state == 'EXECUTING' && item.load_state > 0"
               class="left_center_img"
               alt=""
             />
 
             <img
               src="../../assets/img/yellow.png"
-              v-if="
-                (item.load_state == 0 &&
-                  item.ifOnline == 1 &&
-                  item.move_state == 'MT_PAUSED_OBSTACLE') ||
-                (item.move_state == 'MT_PAUSED' &&
-                  item.load_state == 0 &&
-                  item.ifOnline == 1) ||
-                (item.move_state == 'MT_WAIT_FOR_CHECKPOINT' &&
-                  item.load_state == 0 &&
-                  item.ifOnline == 1)
-              "
+              v-if="item.sys_state == 'PAUSE'"
               class="left_center_img"
               alt=""
             />
             <img
               src="../../assets/img/yellow2.png"
-              v-if="
-                (item.load_state > 0 &&
-                  item.ifOnline == 1 &&
-                  item.move_state == 'MT_PAUSED_OBSTACLE') ||
-                (item.move_state == 'MT_PAUSED' &&
-                  item.load_state > 0 &&
-                  item.ifOnline == 1) ||
-                (item.move_state == 'MT_WAIT_FOR_CHECKPOINT' &&
-                  item.load_state > 0 &&
-                  item.ifOnline == 1)
-              "
+              v-if="item.sys_state == 'PAUSE' && item.load_state > 0"
               class="left_center_img"
               alt=""
             />
 
             <img
               src="../../assets/img/red.png"
-              v-if="
-                item.load_state == 0 &&
-                item.ifOnline == 1 &&
-                item.emergency_state != 'OK'
-              "
+              v-if="item.sys_state == 'ERROR'"
               class="left_center_img"
               alt=""
             />
             <img
               src="../../assets/img/red2.png"
-              v-if="
-                item.load_state > 0 &&
-                item.ifOnline == 1 &&
-                item.emergency_state != 'OK'
-              "
+              v-if="item.load_state > 0 && item.sys_state == 'ERROR'"
+              class="left_center_img"
+              alt=""
+            />
+            <img
+              src="../../assets/img/blue4.png"
+              v-if="item.sys_state == 'CHARGING'"
               class="left_center_img"
               alt=""
             />
-
             <img
               src="../../assets/img/grey.png"
-              v-if="item.ifOnline == 0"
+              v-if="
+                item.sys_state == 'UNKNOWN' || item.sys_state == 'UNAVAILABLE'
+              "
               class="left_center_img"
               alt=""
             />

+ 44 - 1
src/pages/Baggage/index/index.vue

@@ -19,7 +19,7 @@
         >
       </div>
       <div class="bag_box_header_right">
-        <div class="downlodTable">导出</div>
+        <div class="downlodTable" @click="downlodTable">导出</div>
       </div>
     </div>
     <el-table
@@ -63,6 +63,8 @@
 </template>
 <script>
 import { BaggageInquiry } from "@/api/request.js";
+import FileSaver from "file-saver";
+import XLSX from "xlsx";
 export default {
   data() {
     return {
@@ -77,6 +79,47 @@ export default {
     this.BaggageInquiryList();
   },
   methods: {
+    downlodTable() {
+      this.$confirm("是否需要导出xlsx文档, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          this.downFile();
+          this.$message({
+            type: "success",
+            message: "导出成功!",
+          });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消导出",
+          });
+        });
+    },
+    downFile() {
+      var wb = XLSX.utils.table_to_book(
+        document.querySelector("#userTableData")
+      );
+      var wbout = XLSX.write(wb, {
+        bookType: "xlsx",
+        bookSST: true,
+        type: "array",
+      });
+      try {
+        FileSaver.saveAs(
+          new Blob([wbout], {
+            type: "application/octet-stream",
+          }),
+          "行李信息查询.xlsx"
+        );
+      } catch (e) {
+        if (typeof console !== "undefined") console.log(e, wbout);
+      }
+      return wbout;
+    },
     changePage(e) {
       this.pageSize = e;
       this.getData();

+ 14 - 4
src/pages/Common/home.vue

@@ -65,7 +65,7 @@
               width="100%"
               frameborder="0"
               scrolling="yes"
-              height="100%"
+              height="95%"
               id="map_iframe"
               :src="mapurl"
             ></iframe>
@@ -299,16 +299,24 @@
                     <!-- <el-button class="Colorbutton_blue" @click="showDetial(scope.row.Id)">详情信息</el-button> -->
                     <el-button
                       class="Colorbutton"
+                      v-if="scope.row.order_state == 'EXECUTING'"
                       @click="thisOrderStop(scope.row.Id)"
                       >暂停</el-button
                     >
                     <el-button
                       class="Colorbutton"
+                      v-if="scope.row.order_state == 'HELD'"
                       @click="thisOrderRun(scope.row.Id)"
                       >继续</el-button
                     >
                     <el-button
                       class="Colorbutton_blue"
+                      v-if="
+                        scope.row.order_state != 'CANCELLED' &&
+                        scope.row.order_state != 'FAILED' &&
+                        scope.row.order_state != 'DELETED' &&
+                        scope.row.order_state != 'SUCCESS'
+                      "
                       @click="thisOrderClres(scope.row.Id)"
                       >取消</el-button
                     >
@@ -840,9 +848,9 @@ export default {
   components: {
     OrdersInfo,
   },
-  created() {
-    this.getmapurl();
-  },
+  // created() {
+  //   this.getmapurl();
+  // },
   mounted() {
     clearInterval(this.sj);
     this.TemplateOrderList();
@@ -855,6 +863,7 @@ export default {
       that.Getorder();
       that.getbuttonstats();
       that.alarmList();
+      this.getmapurl();
     }, 3000);
   },
   beforeRouteLeave(to, from, next) {
@@ -910,6 +919,7 @@ export default {
       getbuttonstat().then((res) => {
         // console.log(res)
         if (res.resultData) {
+          this.number = res.resultData[0].online_number;
           if (res.resultData[0].mission_boutton == 1) {
             this.isopen1 == true;
             this.carbtn[0].btn_icon = 1;

+ 16 - 5
src/pages/ReportStatistics/index.vue

@@ -55,7 +55,7 @@
       >
       </el-table-column>
       <el-table-column
-        prop="work_order_count"
+        prop="work_completion_count"
         align="center"
         label="执行订单数"
       >
@@ -414,10 +414,21 @@ export default {
           let data = this.reqData;
           data.export = "1";
           Dborder(data).then((res) => {
-            this.$message({
-              type: "success",
-              message: "导出成功!",
-            });
+            let xhr = new XMLHttpRequest();
+            // debugger;
+            xhr.open("get", res.resultData);
+            xhr.responseType = "blob";
+            xhr.setRequestHeader("token", res.resultMsg);
+            xhr.onload = function () {
+              var blob = this.response;
+              let a = document.createElement("a");
+              let url = window.URL.createObjectURL(blob);
+              a.href = url;
+              a.download = "报表统计.xlsx";
+              a.click();
+              window.URL.revokeObjectURL(url);
+            };
+            xhr.send();
           });
         })
         .catch(() => {

+ 7 - 0
src/pages/admin.vue

@@ -486,7 +486,14 @@ export default {
 .home_body_padding {
   padding: 6px 32px 6px 6px;
   width: 100%;
+  // min-height: 100vh;
   overflow: hidden;
+  // overflow-x: auto;
+}
+.scrollBar {
+  .el-scrollbar__wrap {
+    overflow-x: auto;
+  }
 }
 .home_title_body {
   width: 100%;

+ 21 - 0
src/utilts/utilts.js

@@ -18,4 +18,25 @@ export const Format = (fmt, date) => {
     if (new RegExp('(' + k + ')').test(fmt)) { fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length))) }
   }
   return fmt
+}
+
+//导出方法
+export function exportMethod(url, name) {
+  let xhr = new XMLHttpRequest();
+  xhr.open(
+    "get",
+    url
+  );
+  xhr.responseType = "blob";
+  // xhr.setRequestHeader("token", res.resultMsg);
+  xhr.onload = function () {
+    var blob = this.response;
+    let a = document.createElement("a");
+    let url = window.URL.createObjectURL(blob);
+    a.href = url;
+    a.download = name + ".xlsx";
+    a.click();
+    window.URL.revokeObjectURL(url);
+  };
+  xhr.send();
 }

+ 2 - 2
static/serve.js

@@ -1,5 +1,5 @@
 window.g = {
-  // url: `http://192.168.30.249:3420`,// 配置服务器地址
-  url: `http://139.198.181.133:5000`,// 配置服务器地址
+  url: `http://192.168.30.249:3420`,// 配置服务器地址
+  // url: `http://139.198.181.133:5000`,// 配置服务器地址
   mapURL: `http://192.168.30.250:3420/api` // 地图地址
 }