浏览代码

控制配置

a1140836302 2 年之前
父节点
当前提交
9da5e89076

+ 2 - 2
src/layout/components/Navbar.vue

@@ -85,8 +85,8 @@ export default {
     //菜单路由
     menuList(){
       //console.log(this.permission_routes);
-      // this.PermissionList = this.permission_routes.slice(5, 11);
-      this.PermissionList = this.permission_routes.slice(5, 9);
+       this.PermissionList = this.permission_routes.slice(5, 11);
+      //this.PermissionList = this.permission_routes.slice(5, 9);
     },
     //当前时间
     timer() {

+ 1 - 1
src/router/index.js

@@ -188,7 +188,7 @@ export const asyncRoutes = [
     component: Layout,
     children: [
       {
-        path: 'index',
+        path: '',
         component: () => import('@/views/control-config/index'),
         name: 'ControlConfig',
         meta: { title: '控制配置', icon: 'kzpz', }

+ 7 - 71
src/styles/element-ui.scss

@@ -327,76 +327,6 @@
   }
 }
 
-/*修改导出弹窗*/
-.exportmanage{
-  .el-dialog{
-    background-color: rgb(10, 10,10, 1);
-    width: 530px;
-    margin-top: 28vh !important;
-    border-top-right-radius:20px;
-    border-bottom-left-radius:20px;
-    .el-input.is-disabled .el-input__inner{
-      background-color: #181e2e;
-      border: black solid 1px;
-    }
-    .el-input__inner{
-      width: 240px;
-      height:38px;
-      border: #263042 solid 1px;
-      background-color: #181e2e;
-    }
-    .el-textarea__inner{
-      width: 240px;
-      border: #263042 solid 1px;
-      background-color: #181e2e;
-      color: white;
-    }
-    .el-form-item{
-      margin-left: 25px;
-    }
-    .el-dialog__header{
-      background: url('../assets/roletop.png') no-repeat top;
-      border-bottom: #2d3448 solid 1px;
-      padding-left: 0px;
-      .el-dialog__title{
-        color: white;
-        width: 110px;
-        position: relative;
-        text-align: right;
-        border-bottom: white solid 3px;
-        padding-left: 15px;
-        padding-right: 15px;
-        padding-bottom: 11px;
-      }
-    }
-    .el-dialog__footer{
-      background: url('../assets/roleb.png') no-repeat bottom;
-    }
-    .el-dialog__headerbtn:focus .el-dialog__close, .el-dialog__headerbtn:hover .el-dialog__close{
-      color: white;
-    }
-    .el-dialog__headerbtn{
-      font-size: 20px;
-    }
-    .el-checkbox__label{
-      color: #fff;
-      font-size: 14px;
-    }
-    .is-checked .el-checkbox__inner{
-      background-color: #91fdb9;
-      border-color: #91fdb9;
-    }
-    .el-checkbox__inner{
-      border-color: #636c97;
-      background-color: rgb(10, 10,10, 1);
-    }
-  }
-  .words{
-    font-size:16px;
-    color: #00e19b;
-  }
-}
-
 //表格状态样式
 .disable{
   .el-badge__content{
@@ -447,7 +377,13 @@
     color: #4c5d71;
   }
 }
-
+//loading加载动画样式
+.el-loading-mask{
+  background-color:rgb(15, 17, 24,0.5)
+}
+.el-loading-spinner .path{
+  stroke:#91fdb9
+}
 //确认弹窗
 .el-message-box{
   border: none;

二进制
src/views/control-config/assets/c1.png


二进制
src/views/control-config/assets/c2.png


二进制
src/views/control-config/assets/c3.png


二进制
src/views/control-config/assets/c4.png


+ 91 - 0
src/views/control-config/components/ControlBox.vue

@@ -0,0 +1,91 @@
+<template>
+    <div class="control-box">
+        <div class="left">
+            <div class="title">
+                <img :src="require(`../assets/${img}.png`)" /><span>{{ title }}</span>
+            </div>
+            <div class="setspeed">
+                <div class="speed">速度: {{ speed }} m/s</div>
+                <el-button type="primary" class="set" @click="handleset">设置</el-button>
+            </div>
+        </div>
+        <div class="left">
+            <div class="setspeed" style="margin-top: 48px">
+                <div class="speed">位置: {{ position }} m/s</div>
+                <el-button type="primary" class="position" @click="handleset">设置</el-button>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script>
+export default {
+    name: 'ControlBox',
+    props: ['title', 'img', 'speed', 'position', 'unit'],
+    methods: {
+        handleset() {
+            this.$emit('handleset',this.img)
+        }
+    }
+};
+</script>
+
+<style lang="scss" scoped>
+.control-box {
+    width: 45%;
+    display: flex;
+    justify-content: space-between;
+    padding-bottom: 64px;
+
+    .left {
+        display: flex;
+        flex-direction: column;
+        color: #91fdb9;
+        font-weight: bold;
+
+        .title {
+            display: flex;
+            align-items: center;
+
+            span {
+                margin-left: 8px;
+                margin-top: 3px;
+                font-size: 18px;
+            }
+        }
+
+        .setspeed {
+            display: flex;
+            margin-top: 25px;
+            color: #4c5d71;
+            font-size: 16px;
+
+            .speed {
+                width: 265px;
+                height: 40px;
+                border: #263042 solid 1px;
+                box-sizing: border-box;
+                line-height: 40px;
+                padding-left: 18px;
+                margin-right: 10px;
+            }
+
+            .position {
+                background-color: #111827;
+                color: #fff;
+                border-color: #263042;
+                font-weight: 600;
+                letter-spacing: 1px;
+            }
+
+            .set {
+                background-color: #91fdb9;
+                color: #0b111d;
+                border-color: #91fdb9;
+                font-weight: 600;
+                letter-spacing: 1px;
+            }
+        }
+    }
+}
+</style>

+ 179 - 4
src/views/control-config/index.vue

@@ -1,13 +1,188 @@
 <template>
-  
+  <div class="charge-table">
+    <div class="charge-table-bottom">
+      <control-box
+        title="旋转轴"
+        img="c1"
+        :speed="plcResultDTO.rAxis"
+        :position="plcResultDTO.rDpmt"
+        @handleset="handleset"
+        unit="m/s"
+      ></control-box>
+      <control-box
+        title="伸缩轴"
+        img="c2"
+        :speed="plcResultDTO.yAxis"
+        :position="plcResultDTO.yDpmt"
+        @handleset="handleset"
+        unit="m/s"
+      ></control-box>
+      <control-box
+        title="行走轴"
+        img="c3"
+        :speed="plcResultDTO.xAxis"
+        :position="plcResultDTO.xDpmt"
+        @handleset="handleset"
+        unit="m/s"
+      ></control-box>
+      <control-box
+        title="举升轴"
+        img="c4"
+        :speed="plcResultDTO.zAxis"
+        :position="plcResultDTO.zDpmt"
+        @handleset="handleset"
+        unit="m/s"
+      ></control-box>
+    </div>
+    <!--设置弹窗-->
+    <div class="rolemanage chargeshow">
+      <el-dialog
+        title="设置旋转轴-速度"
+        :visible.sync="dialogConfigVisible"
+        :destroy-on-close="true"
+      >
+        <div class="setConfig">
+          <span>指令:</span>
+          <el-input v-model="input" placeholder="请输入指令"></el-input>
+          <el-button type="primary" class="set" @click="handleset"
+            >执行</el-button
+          >
+        </div>
+      </el-dialog>
+    </div>
+    <!--设置弹窗结束-->
+  </div>
 </template>
 
 <script>
+import wsUrl from "../../../vue.config.js"
+import { getToken } from '@/utils/auth'
+import ControlBox from './components/ControlBox.vue'
 export default {
-    name:'ControlConfig'
-}
+  name: "ControlConfig",
+  components:{
+    ControlBox
+  },
+  data() {
+    return {
+      ws: null,
+      dialogConfigVisible: false,
+      input: "",
+      plcResultDTO:{
+        xAxis:'— — —',
+        yAxis:'— — —',
+        zAxis:'— — —',
+        rAxis:'— — —',
+        xDpmt:'— — —',
+        yDpmt:'— — —',
+        zDpmt:'— — —',
+        rDpmt:'— — —',
+      }
+    };
+  },
+  mounted() {
+    if (getToken()) {
+      if (this.ws) {
+        this.ws.close();
+      }
+      this.websocketConnect();
+      // 检测websocket断开重连
+      this.detectWebsocketConnection();
+    }
+  },
+  destroyed() {
+    this.websocketOnClose();
+  },
+  methods: {
+    handleset(val) {
+      console.log(val)
+      this.dialogConfigVisible = true;
+    },
+    websocketOnOpen() {
+      console.log("socket连接成功");
+    },
+    websocketOnMessage(m) {
+      const d = JSON.parse(m.data)
+      console.log(d.plcResultDTO)
+      if(d.plcResultDTO){
+        this.plcResultDTO=d.plcResultDTO
+      }
+      
+    },
+    websocketOnError(e) {
+      console.log("socket错误", e);
+    },
+    websocketOnClose(e) {
+      console.log("socket断开", e);
+    },
+    detectWebsocketConnection() {
+      this.wsTimer = setInterval(() => {
+        if (this.ws.readyState != 1) {
+          this.ws.close();
+          this.websocketConnect();
+        }
+      }, 3000);
+    },
+    websocketConnect() {
+      const wstoken = getToken();
+      this.ws = new WebSocket(
+        wsUrl.devServer.proxy["/ws"].target + "/" + wstoken
+      );
+      this.ws.onopen = this.websocketOnOpen;
+      this.ws.onerror = this.websocketOnError;
+      this.ws.onmessage = this.websocketOnMessage;
+      this.ws.onclose = this.websocketOnClose;
+    },
+  },
+};
 </script>
 
-<style>
+<style lang="scss" scoped>
+.setConfig {
+  margin: 35px auto;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  padding-bottom: 45px;
+
+  span {
+    color: #fff;
+    font-size: 15px;
+    text-align: right;
+  }
 
+  .el-input {
+    width: 240px;
+    margin-right: 15px;
+  }
+}
+
+.set {
+  background-color: #91fdb9;
+  color: #0b111d;
+  border-color: #91fdb9;
+  font-weight: 600;
+  letter-spacing: 1px;
+}
+
+.charge-table {
+  padding: 50px;
+  background-color: #111827;
+  border: #192337 solid 1px;
+  min-height: 68vh;
+  margin: 35px;
+  display: flex;
+  flex-direction: column;
+
+  .charge-table-bottom {
+    width: 100%;
+    min-height: 100%;
+    background-color: #111827;
+    display: flex;
+    justify-content: space-between;
+    flex-wrap: wrap;
+
+    
+  }
+}
 </style>

+ 3 - 3
src/views/equipment-monitoring/components/SubTitle.vue

@@ -11,7 +11,7 @@
       <div v-if="step" class="exchange-store">
         <div class="store-list active" @click="changePower">开始换电</div>
         <div class="store-list" @click="FireControlStoreHouse">消防换仓</div>
-        <div class="store-list" @click="CheckStoreHouse">检修换仓</div>
+        <div class="store-list" @click="CheckStoreHouse">手动换仓</div>
         <div class="store-list">单步执行</div>
         <div class="store-list" @click="CheckCarOnLock">车辆解锁/上锁</div>
         <div class="store-list" @click="ResetStationControl">站控系统复位</div>
@@ -19,7 +19,7 @@
       </div>
     </div>
     <div class="rolemanage">
-      <el-dialog :title="dialogType === 'check' ? '检修换仓' : '消防换仓'" :visible.sync="dialogStoreVisible">
+      <el-dialog :title="dialogType === 'check' ? '手动换仓' : '消防换仓'" :visible.sync="dialogStoreVisible">
         <el-form ref="StoreForm" :model="StoreForm" :rules="rules">
           <el-form-item
             :label="dialogType === 'check' ? '检修仓:' : '故障仓:'"
@@ -39,7 +39,7 @@
               />
             </el-select>
           </el-form-item>
-          <el-form-item label="目标仓:" :label-width="formLabelWidth" prop="targetStore">
+          <el-form-item label="目标仓:" :label-width="formLabelWidth" prop="targetStore" v-show="dialogType === 'check'">
             <el-select v-model="StoreForm.targetStore" clearable placeholder="请选择目标仓">
               <el-option
                 v-for="item in StoreCodeList"

+ 49 - 53
src/views/manage-log/battery-charger.vue

@@ -72,36 +72,20 @@
             fit
             :height="tableheight"
             style="width: 100%"
-            :default-sort="{prop: 'deviceNo', order: 'descending'}"
-            @selection-change="handleSelectionChange"
+            ref="tblist"
+            v-loading="loading"
           >
           <el-table-column
-            type="selection"
-            width="55">
-          </el-table-column>
-          <af-table-column
             prop="time"
             label="发生时间"
             fixed
-            width="160">
-          </af-table-column>
-          <af-table-column
-            prop="plcTag"
-            label="日志编号"
-            fixed
-            width="120">
-          </af-table-column>
-          <af-table-column v-for="log in logheader" :key="log.alarmCode" :label="log.alarmName">
+            width="150">
+          </el-table-column>
+          <el-table-column v-for="log in logheader" :key="log.alarmCode" :label="log.alarmName" :render-header="labelHead">
             <template slot-scope="scope">
               {{ scope.row[log.alarmId] }}
             </template>
-          </af-table-column>
-  
-            <!-- <el-table-column label="时段明细" width="100" align="center" fixed="right">
-              <template slot-scope="scope">
-                <el-button type="primary" class="handle" size="small" @click="chargeShow(scope.row.interval)">明细</el-button>
-              </template>
-            </el-table-column> -->
+          </el-table-column>
           </el-table>
         </div>
         <div class="pageblock">
@@ -140,7 +124,6 @@
           page: 1, // 当前页
           pageSize: 10, // 每页条数
           deviceNo: undefined, // 充电机ID
-          deviceNo: undefined, 
           endTime: undefined, // 电池编号
           signals: undefined, // 排序字段
           startTime: undefined,// 排序方式
@@ -155,7 +138,8 @@
         robotValue:'',
         logOptions: [],
         logheader:[],
-        multipleSelection:[],
+        heightTimer:false,
+        loading: false,
       }
     },
     watch: {
@@ -176,9 +160,18 @@
       this.onLoadHeight()
       this.changeWindow()
       this.getLogModel()
-      this.getrobotList()
+      this.getchargerList()
     },
     methods: {
+      labelHead(h,{column,index}){
+        let l = column.label.length
+        let f = 20
+        if(l <= 2){
+          f = 30
+        }
+        column.minWidth = f*l 
+        return h('div',{class:'table-head',style:{minWidth:'100%'}},[column.label])
+      },
       /* 设置初始视窗高度*/
       onLoadHeight() {
         this.$nextTick(() => {
@@ -203,13 +196,12 @@
         if (this.robotValue.length < this.logOptions.length) {
           this.robotValue = [];
           this.logOptions.map((item) => {
-            this.robotValue.push(item.value);
+            this.robotValue.push(item.alarmCode);
           });
           this.robotValue.unshift("全选");
         } else {
           this.robotValue = [];
         }
-        this.$emit("SelectedData", this.robotValue);
       },
       changeSelect(val) {
         if (!val.includes("全选") && val.length === this.logOptions.length) {
@@ -219,24 +211,23 @@
             return item !== "全选";
           });
         }
-        this.$emit("SelectedData", this.robotValue);
       },
       removeTag(val) {
         if (val === "全选") {
           this.robotValue = [];
         }
-        this.$emit("SelectedData", this.robotValue);
-      },
-      //列表选择
-      handleSelectionChange(val) {
-        this.multipleSelection = val;
       },
       //获取充电机日志列表
-      getrobotList(){
+      getchargerList(){
+        this.loading=true;
         chargerList(this.queryParams).then( res =>{
           console.log(res)
           this.datalist= res.data.list
           this.total=res.data.total
+          this.$nextTick(()=>{
+            this.$refs.tblist.doLayout();
+          })
+          this.loading=false;
         })
       },
       //获取日志数据字典
@@ -244,7 +235,9 @@
         chargerModel().then( res =>{
           this.logOptions= res.data
           this.logheader=res.data
-          console.log(this.logOptions)
+          this.$nextTick(()=>{
+            this.$refs.tblist.doLayout();
+          })
         })
       },
       // 获取充电机ID
@@ -256,31 +249,34 @@
       /** 分页下一页 */
       handleSizeChange(val) {
         this.queryParams.pageSize = val
-        this.getrobotList()
+        this.getchargerList()
       },
       /** 分页选择页数 */
       handleCurrentChange(val) {
         this.queryParams.page = val
-        this.getrobotList()
+        this.getchargerList()
       },
       // 搜索
       handleQuery() {
-        if (this.dateTime) {
-          this.queryParams.startTime = this.$moment(this.dateTime[0]).format('YYYY-MM-DD HH:mm:ss')
-          this.queryParams.endTime = this.$moment(this.dateTime[1]).format('YYYY-MM-DD HH:mm:ss')
-        }
-        if(this.robotValue){
-          this.queryParams.signals=this.robotValue
-          // this.logheader.forEach((item)=>{
-          //   if(!this.robotValue.includes(item.alarmCode)){
-          //         this.logheader.splice(item.alarmCode,1)  
-          //   }
-          // })
-          let differenceABSet = Array.from(new Set([...this.logOptions].filter(x => this.robotValue.includes(x.alarmCode))));
-          this.logheader=differenceABSet
+        if(this.dateTime || this.robotValue.length > 0 || this.queryParams.deviceNo != undefined){
+          if (this.dateTime) {
+            this.queryParams.startTime = this.$moment(this.dateTime[0]).format('YYYY-MM-DD HH:mm:ss')
+            this.queryParams.endTime = this.$moment(this.dateTime[1]).format('YYYY-MM-DD HH:mm:ss')
+          }
+          if(this.robotValue.length > 0){
+            this.queryParams.signals=this.robotValue
+            let differenceABSet = Array.from(new Set([...this.logOptions].filter(x => this.robotValue.includes(x.alarmCode))));
+            this.logheader=differenceABSet
+          }
+          this.getchargerList()
+        }else{
+          this.$message({
+            message: "请选择查询条件!",
+            type: "warning",
+            duration: 1000,
+            offset: 20,
+          });
         }
-        this.getrobotList()
-        console.log(this.logheader)
       },
       // 搜索重置
       resetForm() {
@@ -288,7 +284,7 @@
         this.queryParams.endTime = undefined
         this.queryParams.signals = undefined
         this.queryParams.deviceNo = undefined
-        this.getrobotList()
+        this.getchargerList()
       },
       // 导出结果
       chargeExport() {

+ 46 - 50
src/views/manage-log/bms.vue

@@ -63,36 +63,19 @@
             fit
             :height="tableheight"
             style="width: 100%"
-            :default-sort="{prop: 'chargerId', order: 'descending'}"
-            @selection-change="handleSelectionChange"
+            ref="tblist"
           >
           <el-table-column
-            type="selection"
-            width="55">
-          </el-table-column>
-          <af-table-column
             prop="time"
             label="发生时间"
             fixed
             width="150">
-          </af-table-column>
-          <af-table-column
-            prop="plcTag"
-            label="日志编号"
-            fixed
-            width="120">
-          </af-table-column>
-          <af-table-column v-for="log in logheader" :key="log.alarmCode" :label="log.alarmName">
+          </el-table-column>
+          <el-table-column v-for="log in logheader" :key="log.alarmCode" :label="log.alarmName" :render-header="labelHead">
             <template slot-scope="scope">
               {{ scope.row[log.alarmId] }}
             </template>
-          </af-table-column>
-  
-            <!-- <el-table-column label="时段明细" width="100" align="center" fixed="right">
-              <template slot-scope="scope">
-                <el-button type="primary" class="handle" size="small" @click="chargeShow(scope.row.interval)">明细</el-button>
-              </template>
-            </el-table-column> -->
+          </el-table-column>
           </el-table>
         </div>
         <div class="pageblock">
@@ -113,7 +96,7 @@
   <script>
   import './log.scss'
   import { chargeExport, getChargeCode } from '@/api/records'
-  import { logModel,bmsList } from '@/api/log'
+  import { BmsModel,bmsList } from '@/api/log'
   import serverUrl from '../../../vue.config.js'
   export default {
     name: 'Bms',
@@ -131,7 +114,6 @@
           page: 1, // 当前页
           pageSize: 10, // 每页条数
           deviceNo: undefined, 
-          batteryNum:undefined,
           endTime: undefined, // 电池编号
           signals: undefined, // 排序字段
           startTime: undefined,// 排序方式
@@ -146,7 +128,8 @@
         robotValue:'',
         logOptions: [],
         logheader:[],
-        multipleSelection:[],
+        heightTimer:false,
+        loading: false,
       }
     },
     watch: {
@@ -170,6 +153,17 @@
       this.getrobotList()
     },
     methods: {
+      labelHead(h,{column,index}){
+        let l = column.label.length
+        let f = 20
+        if(l <= 3){
+          f = 30
+        }else if(l >= 14){
+          f = 15
+        }
+        column.minWidth = f*l 
+        return h('div',{class:'table-head',style:{minWidth:'100%'}},[column.label])
+      },
       /* 设置初始视窗高度*/
       onLoadHeight() {
         this.$nextTick(() => {
@@ -188,13 +182,12 @@
         if (this.robotValue.length < this.logOptions.length) {
           this.robotValue = [];
           this.logOptions.map((item) => {
-            this.robotValue.push(item.value);
+            this.robotValue.push(item.alarmCode);
           });
           this.robotValue.unshift("全选");
         } else {
           this.robotValue = [];
         }
-        this.$emit("SelectedData", this.robotValue);
       },
       changeSelect(val) {
         if (!val.includes("全选") && val.length === this.logOptions.length) {
@@ -204,32 +197,32 @@
             return item !== "全选";
           });
         }
-        this.$emit("SelectedData", this.robotValue);
       },
       removeTag(val) {
         if (val === "全选") {
           this.robotValue = [];
         }
-        this.$emit("SelectedData", this.robotValue);
-      },
-      //列表选择
-      handleSelectionChange(val) {
-        this.multipleSelection = val;
       },
       //获取BMS日志列表
       getrobotList(){
+        this.loading=true;
         bmsList(this.queryParams).then( res =>{
-          console.log(res)
           this.datalist= res.data.list
           this.total=res.data.total
+          this.$nextTick(()=>{
+            this.$refs.tblist.doLayout();
+          })
+          this.loading=false
         })
       },
       //获取日志数据字典
       getLogModel(){
-        logModel().then( res =>{
+        BmsModel().then( res =>{
           this.logOptions= res.data
           this.logheader=res.data
-          console.log(this.logOptions)
+          this.$nextTick(()=>{
+            this.$refs.tblist.doLayout();
+          })
         })
       },
       // 充电明细弹窗显示
@@ -255,22 +248,25 @@
       },
       // 搜索
       handleQuery() {
-        if (this.dateTime) {
-          this.queryParams.startTime = this.$moment(this.dateTime[0]).format('YYYY-MM-DD HH:mm:ss')
-          this.queryParams.endTime = this.$moment(this.dateTime[1]).format('YYYY-MM-DD HH:mm:ss')
-        }
-        if(this.robotValue){
-          this.queryParams.signals=this.robotValue
-          // this.logheader.forEach((item)=>{
-          //   if(!this.robotValue.includes(item.alarmCode)){
-          //         this.logheader.splice(item.alarmCode,1)  
-          //   }
-          // })
-          let differenceABSet = Array.from(new Set([...this.logOptions].filter(x => this.robotValue.includes(x.alarmCode))));
-          this.logheader=differenceABSet
+        if(this.dateTime || this.robotValue.length > 0){
+          if (this.dateTime) {
+            this.queryParams.startTime = this.$moment(this.dateTime[0]).format('YYYY-MM-DD HH:mm:ss')
+            this.queryParams.endTime = this.$moment(this.dateTime[1]).format('YYYY-MM-DD HH:mm:ss')
+          }
+          if(this.robotValue.length > 0){
+            this.queryParams.signals=this.robotValue
+            let differenceABSet = Array.from(new Set([...this.logOptions].filter(x => this.robotValue.includes(x.alarmCode))));
+            this.logheader=differenceABSet
+          }
+          this.getrobotList()
+        }else{
+          this.$message({
+            message: "请选择查询条件!",
+            type: "warning",
+            duration: 1000,
+            offset: 20,
+          });
         }
-        this.getrobotList()
-        console.log(this.logheader)
       },
       // 搜索重置
       resetForm() {

+ 247 - 309
src/views/manage-log/change-record.vue

@@ -1,143 +1,80 @@
 <template>
-    <div class="charge-box">
-      <div class="charge-tools">
-        <el-form :inline="true" :model="queryParams">
-          <el-form-item label="换电编号:" style="margin-left: 35px;">
-            <el-input v-model="queryParams.swapId" placeholder="请输入换电编号" clearable />
-          </el-form-item>
+  <div class="charge-box">
+    <div class="charge-tools">
+      <el-form :inline="true" :model="queryParams">
+        <el-form-item label="换电编号:" style="margin-left: 35px">
+          <el-input v-model="queryParams.swapId" placeholder="请输入换电编号" clearable />
+        </el-form-item>
 
-          <el-form-item label="车牌号:" style="margin-left: 50px;">
-            <el-input v-model="queryParams.vehiclePlate" placeholder="请输入车牌号" clearable />
-          </el-form-item>
+        <el-form-item label="车牌号:" style="margin-left: 50px">
+          <el-input v-model="queryParams.vehiclePlate" placeholder="请输入车牌号" clearable />
+        </el-form-item>
 
-          <el-form-item label="车辆识别码:" style="margin-left: 50px;">
-            <el-input v-model="queryParams.PlateCode" placeholder="请输入车牌号" clearable />
-          </el-form-item>
-  
-          <el-form-item label="时间范围:" style="margin-left: 50px">
-            <el-date-picker
-              v-model="dateTime"
-              class="times"
-              type="datetimerange"
-              range-separator="至"
-              start-placeholder="开始时间"
-              end-placeholder="结束时间"
-              format="yyyy-MM-dd HH:mm:ss"
-            />
-          </el-form-item>
-  
-          <el-form-item>
-            <el-button type="primary" class="serch actve" @click="handleQuery">查询</el-button>
-            <el-button type="primary" class="serch" @click="resetForm">重置</el-button>
-          </el-form-item>
-  
-        </el-form>
-      </div>
-  
-      <div class="charge-table">
-        <div class="charge-table-bottom">
-          <el-table
-            :data="datalist"
-            :header-cell-style="{
-              background: '#1d283e',
-              borderColor: '#2f3c86',
-              height: '36px',
-              lineHeight: '36px',
-              color:'white',
-              fontSize: '15px',
-            }"
-            stripe
-            fit
-            :height="tableheight"
-            style="width: 100%"
-            :default-sort="{prop: 'chargerId', order: 'descending'}"
-            @selection-change="handleSelectionChange"
-          >
-          <el-table-column
-            type="selection"
-            width="55">
-          </el-table-column>
-          <el-table-column
-            prop="index"
-            label="序号"
-          />
-          <af-table-column
-            prop="time"
-            label="换电编号"
-            fixed
-            width="140">
-          </af-table-column>
-          <af-table-column
-            prop="plcTag"
-            label="车牌号"
-            fixed
-            width="120">
-          </af-table-column>
-          <af-table-column
-            prop="plcTag"
-            label="车辆识别码"
-            fixed
-            width="120">
-          </af-table-column>
-          <af-table-column
-            prop="plcTag"
-            label="换电开始时间"
-            fixed
-            width="120">
-          </af-table-column>
-          <af-table-column
-            prop="plcTag"
-            label="换电结束时间"
-            fixed
-            width="120">
-          </af-table-column>
-          <af-table-column
-            prop="plcTag"
-            label="换电时长"
-            fixed
-            width="120">
-          </af-table-column>
-          <el-table-column label="操作" align="center" width="160">
+        <el-form-item label="车辆识别码:" style="margin-left: 50px">
+          <el-input v-model="queryParams.PlateCode" placeholder="请输入车牌号" clearable />
+        </el-form-item>
+
+        <el-form-item label="时间范围:" style="margin-left: 50px">
+          <el-date-picker v-model="dateTime" class="times" type="datetimerange" range-separator="至"
+            start-placeholder="开始时间" end-placeholder="结束时间" format="yyyy-MM-dd HH:mm:ss" />
+        </el-form-item>
+
+        <el-form-item>
+          <el-button type="primary" class="serch actve" @click="handleQuery">查询</el-button>
+          <el-button type="primary" class="serch" @click="resetForm">重置</el-button>
+        </el-form-item>
+      </el-form>
+    </div>
+
+    <div class="charge-table">
+      <div class="charge-table-bottom">
+        <el-table :data="datalist" :header-cell-style="{
+          background: '#1d283e',
+          borderColor: '#2f3c86',
+          height: '36px',
+          lineHeight: '36px',
+          color: 'white',
+          fontSize: '15px',
+        }" stripe fit :height="tableheight" style="width: 100%">
+          <el-table-column type="index" label="序号" width="55" />
+          <el-table-column prop="swapId" width="400" label="换电编号" />
+          <el-table-column prop="vehiclePlate" label="车牌号" />
+          <el-table-column prop="vehicleVin" label="车辆识别码" />
+          <el-table-column prop="swapBeginTime" label="换电开始时间" />
+          <el-table-column prop="swapEndTime" label="换电结束时间" />
+          <el-table-column prop="swapDuration" label="换电时长" />
+          <el-table-column label="操作" align="center" width="200">
             <template v-if="scope.row.userAccount !== 'admin'" slot-scope="scope">
               <el-button type="primary" class="handle" size="small" @click="handleEdit(scope.row)">日志查询</el-button>
-              <el-button type="primary" class="handle" size="small" @click="handleDelete(scope.$index,scope.row.id)">导出日志</el-button>
+              <el-button type="primary" class="handle" size="small"
+                @click="handleDelete(scope.$index, scope.row.id)">导出日志</el-button>
             </template>
           </el-table-column>
-          </el-table>
-        </div>
-        <div class="pageblock">
-          <el-pagination
-            :current-page="queryParams.page"
-            :page-sizes="[10, 20, 30, 40]"
-            :page-size="queryParams.pageSize"
-            layout="total, sizes, prev, pager, next, jumper"
-            :total="total"
-            @size-change="handleSizeChange"
-            @current-change="handleCurrentChange"
-          />
-        </div>
+        </el-table>
+      </div>
+      <div class="pageblock">
+        <el-pagination :current-page="queryParams.page" :page-sizes="[10, 20, 30, 40]" :page-size="queryParams.pageSize"
+          layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange"
+          @current-change="handleCurrentChange" />
       </div>
+    </div>
 
-      <!--新增账号弹窗-->
-    <div class="exportmanage">
-      <el-dialog
-        :title="dialogType==='find'?'查看数据范围':'导出数据范围'"
-        :visible.sync="dialogexportVisible"
-        :destroy-on-close="true"
-        @close="dialogClose"
-      >
-        <el-form
-          ref="ruleForm"
-          v-loading="loading"
-        >
+    <!--导出弹窗-->
+    <div class="rolemanage">
+      <el-dialog :title="dialogType === 'find' ? '查看数据范围' : '导出数据范围'" :visible.sync="dialogexportVisible"
+        :destroy-on-close="true" @close="dialogClose">
+        <el-form ref="ruleForm" v-loading="loading">
           <div class="checkFirst">
-            <div>范围:</div>
+            <div>日志范围:</div>
             <template>
-              <el-checkbox-group v-model="checkList">
-                <el-checkbox label="复选框 A"></el-checkbox>
-                <el-checkbox label="复选框 B"></el-checkbox>
-                <el-checkbox label="复选框 C"></el-checkbox>
-              </el-checkbox-group>
+              <el-form-item style="margin-left: 5px; margin-top: 20px">
+                <el-select multiple v-model="robotValue" filterable clearable placeholder="请选择" @change="changeSelect"
+                  collapse-tags @remove-tag="removeTag">
+                  <el-option label="全选" value="全选" @click.native="selectAll"></el-option>
+                  <el-option v-for="item in logOptions" :key="item.alarmCode" :label="item.alarmName"
+                    :value="item.alarmCode" />
+                </el-select>
+              </el-form-item>
             </template>
           </div>
         </el-form>
@@ -147,207 +84,208 @@
         </div>
       </el-dialog>
     </div>
-    <!--新增账号弹窗结束-->
+    <!--导出弹窗结束-->
+  </div>
+</template>
 
-    </div>
-  </template>
-  
-  <script>
-  import './log.scss'
-  import { chargeExport } from '@/api/records'
-  import { logModel,robotList } from '@/api/log'
-  import serverUrl from '../../../vue.config.js'
-  export default {
-    name: 'ChangeRecord',
-    components: {},
-    data() {
-      return {
-        // 查询时间数组
-        dateTime: '',
-        // 充电机ID下拉列表
-        chargerArr: null,
-        checkList: ['选中且禁用','复选框 A'],
-        // 数据列表
-        datalist: [],
-        dialogType: 'find', // 按钮类型(find、export)
-        // 查询参数
-        queryParams: {
-          page: 1, // 当前页
-          pageSize: 10, // 每页条数
-          deviceNo: undefined, 
-          endTime: undefined, // 电池编号
-          swapId: undefined, // 排序字段
-          vehiclePlate:undefined,
-          PlateCode:undefined, 
-          startTime: undefined,// 排序方式
-          sort:1
-        },
-        total: 0, // 总条数,
-        tableheight: 0, // 表格高度设置
-        dialogexportVisible: true, // 弹窗显示
-        chargeShowList: [],// 充电机明细弹窗列表
-        checked: false,
-        indeterminate: false,
-        robotValue:'',
-        logOptions: [],
-        logheader:[],
-        multipleSelection:[],
-        loading:false,
+<script>
+import "./log.scss";
+import { swapList } from "@/api/records";
+import { logModel } from "@/api/log";
+export default {
+  name: "ChangeRecord",
+  components: {},
+  data() {
+    return {
+      // 查询时间数组
+      dateTime: "",
+      // 充电机ID下拉列表
+      chargerArr: null,
+      // 数据列表
+      datalist: [],
+      dialogType: "find", // 按钮类型(find、export)
+      // 查询参数
+      queryParams: {
+        page: 1, // 当前页
+        pageSize: 10, // 每页条数
+        vehiclePlate: undefined, // 车牌号
+        swapId: undefined, // 换电编号
+        swapBeginTime: undefined,
+        swapEndTime: undefined,
+        orderByField: undefined, // 排序字段
+        orderByWays: 'desc'// 排序方式
+      },
+      total: 0, // 总条数,
+      tableheight: 0, // 表格高度设置
+      dialogexportVisible: false, // 弹窗显示
+      checked: false,
+      indeterminate: false,
+      robotValue: "",
+      logOptions: [],
+      logheader: [],
+      loading: false,
+      heightTimer: false
+    };
+  },
+  watch: {
+    tableheight(val) {
+      // 为了避免频繁触发resize函数导致页面卡顿,使用定时器
+      if (!this.heightTimer) {
+        // 一旦监听到的screenWidth值改变,就将其重新赋给data里的screenWidth
+        this.screenHeight = val;
+        this.heightTimer = true;
+        setTimeout(function () {
+          this.heightTimer = false;
+        }, 400);
       }
     },
-    watch: {
-      tableheight(val) {
-        // 为了避免频繁触发resize函数导致页面卡顿,使用定时器
-        if (!this.heightTimer) {
-          // 一旦监听到的screenWidth值改变,就将其重新赋给data里的screenWidth
-          this.screenHeight = val
-          this.heightTimer = true
-          setTimeout(function() {
-            this.heightTimer = false
-          }, 400)
-        }
+  },
+  mounted() {
+    this.onLoadHeight();
+    this.changeWindow();
+    this.getLogModel();
+    this.getswapList();
+  },
+  methods: {
+    /* 设置初始视窗高度*/
+    onLoadHeight() {
+      this.$nextTick(() => {
+        this.tableheight = document.body.clientHeight - 400;
+      });
+    },
+    /* 设置窗口变化高度*/
+    changeWindow() {
+      window.onresize = () => {
+        return (() => {
+          this.tableheight = document.body.clientHeight - 400;
+        })();
+      };
+    },
+    selectAll() {
+      if (this.robotValue.length < this.logOptions.length) {
+        this.robotValue = [];
+        this.logOptions.map((item) => {
+          this.robotValue.push(item.value);
+        });
+        this.robotValue.unshift("全选");
+      } else {
+        this.robotValue = [];
       }
+      this.$emit("SelectedData", this.robotValue);
     },
-    mounted() { 
-      this.onLoadHeight()
-      this.changeWindow()
-      this.getLogModel()
-      this.getrobotList()
+    changeSelect(val) {
+      if (!val.includes("全选") && val.length === this.logOptions.length) {
+        this.robotValue.unshift("全选");
+      } else if (
+        val.includes("全选") &&
+        val.length - 1 < this.logOptions.length
+      ) {
+        this.robotValue = this.robotValue.filter((item) => {
+          return item !== "全选";
+        });
+      }
+      this.$emit("SelectedData", this.robotValue);
     },
-    methods: {
-      /* 设置初始视窗高度*/
-      onLoadHeight() {
-        this.$nextTick(() => {
-          this.tableheight = document.body.clientHeight - 460
-        })
-      },
-      /* 设置窗口变化高度*/
-      changeWindow() {
-        window.onresize = () => {
-          return (() => {
-            this.tableheight = document.body.clientHeight - 460
-          })()
-        }
-      },
-      AddUserinfo() {
+    removeTag(val) {
+      if (val === "全选") {
+        this.robotValue = [];
+      }
+      this.$emit("SelectedData", this.robotValue);
+    },
+    AddUserinfo() {
       this.$refs.ruleForm.validate((valid) => {
         if (valid) {
           // 添加用户
-          if (this.dialogType === 'new') {
-            addUserinfo(this.formData).then(res => {
+          if (this.dialogType === "new") {
+            addUserinfo(this.formData).then((res) => {
               if (res.code === 0) {
-                this.loading = false
-                this.dialogUserVisible = false
+                this.loading = false;
+                this.dialogUserVisible = false;
                 this.$message({
-                  type: 'success',
-                  message: '操作成功!'
-                })
-                this.getUserlist()
+                  type: "success",
+                  message: "操作成功!",
+                });
+                this.getUserlist();
               } else {
-                this.loading = false
-                return this.$message.error(res.msg)
+                this.loading = false;
+                return this.$message.error(res.msg);
               }
-            })
+            });
           }
           // 修改用户
           else {
-            const updateFrom = this.formData
-            delete updateFrom.pwd
-            console.log(updateFrom)
-            updateUser(updateFrom).then(res => {
+            const updateFrom = this.formData;
+            delete updateFrom.pwd;
+            console.log(updateFrom);
+            updateUser(updateFrom).then((res) => {
               if (res.code === 0) {
-                this.loading = false
-                this.dialogUserVisible = false
+                this.loading = false;
+                this.dialogUserVisible = false;
                 this.$message({
-                  type: 'success',
-                  message: '操作成功!'
-                })
-                this.getUserlist()
+                  type: "success",
+                  message: "操作成功!",
+                });
+                this.getUserlist();
               } else {
-                this.loading = false
-                return this.$message.error(res.msg)
+                this.loading = false;
+                return this.$message.error(res.msg);
               }
-            })
+            });
           }
         }
-      })
+      });
     },
-      // 清空表单数据
-      dialogClose() {
-        
-      },
-      //获取机器人日志列表
-      getrobotList(){
-        robotList(this.queryParams).then( res =>{
-          console.log(res)
-          this.datalist= res.data.list
-          this.total=res.data.total
-        })
-      },
-      //获取日志数据字典
-      getLogModel(){
-        logModel().then( res =>{
-          this.logOptions= res.data
-          this.logheader=res.data
-          console.log(this.logOptions)
-        })
-      },
-      // 充电明细弹窗显示
-      chargeShow(list) {
-        this.dialogChargeVisible = true
-        this.chargeShowList = list
-      },
-      /** 分页下一页 */
-      handleSizeChange(val) {
-        this.queryParams.pageSize = val
-        this.getrobotList()
-      },
-      /** 分页选择页数 */
-      handleCurrentChange(val) {
-        this.queryParams.page = val
-        this.getrobotList()
-      },
-      // 搜索
-      handleQuery() {
-        if (this.dateTime) {
-          this.queryParams.startTime = this.$moment(this.dateTime[0]).format('YYYY-MM-DD HH:mm:ss')
-          this.queryParams.endTime = this.$moment(this.dateTime[1]).format('YYYY-MM-DD HH:mm:ss')
-        }
-        if(this.robotValue){
-          this.queryParams.signals=this.robotValue
-          // this.logheader.forEach((item)=>{
-          //   if(!this.robotValue.includes(item.alarmCode)){
-          //         this.logheader.splice(item.alarmCode,1)  
-          //   }
-          // })
-          let differenceABSet = Array.from(new Set([...this.logOptions].filter(x => this.robotValue.includes(x.alarmCode))));
-          this.logheader=differenceABSet
-        }
-        this.getrobotList()
-        console.log(this.logheader)
-      },
-      // 搜索重置
-      resetForm() {
-        this.queryParams.startTime = undefined
-        this.queryParams.endTime = undefined
-        this.queryParams.signals = undefined
-        this.getrobotList()
-      },
-      // 导出结果
-      chargeExport() {
-        this.$confirm('确认导出结果?', '导出结果', {
-          confirmButtonText: '确认',
-          cancelButtonText: '取消',
-          type: 'warning'
-        })
-        .then(async() => {
-            const res = await chargeExport(this.queryParams)
-            const execlUrl=serverUrl.devServer.proxy['/api'].target+'/excel/'+res.data
-            window.open(execlUrl,'_blank')
-          })
-        .catch(err => { console.error(err) })
+    // 清空表单数据
+    dialogClose() { },
+    //获取换电记录列表
+    getswapList() {
+      swapList(this.queryParams).then((res) => {
+        console.log(res);
+        this.datalist = res.data.records;
+        this.total = res.data.total;
+      });
+    },
+    //获取日志数据字典
+    getLogModel() {
+      logModel().then((res) => {
+        this.logOptions = res.data;
+        this.logheader = res.data;
+        console.log(this.logOptions);
+      });
+    },
+    // 充电明细弹窗显示
+    chargeShow(list) {
+      this.dialogChargeVisible = true;
+      this.chargeShowList = list;
+    },
+    /** 分页下一页 */
+    handleSizeChange(val) {
+      this.queryParams.pageSize = val;
+      this.getswapList();
+    },
+    /** 分页选择页数 */
+    handleCurrentChange(val) {
+      this.queryParams.page = val;
+      this.getswapList();
+    },
+    // 搜索
+    handleQuery() {
+      if (this.dateTime) {
+        this.queryParams.startTime = this.$moment(this.dateTime[0]).format(
+          "YYYY-MM-DD HH:mm:ss"
+        );
+        this.queryParams.endTime = this.$moment(this.dateTime[1]).format(
+          "YYYY-MM-DD HH:mm:ss"
+        );
       }
-    }
-  }
-  </script>
-  
+      this.getswapList();
+    },
+    // 搜索重置
+    resetForm() {
+      this.queryParams.startTime = undefined;
+      this.queryParams.endTime = undefined;
+      this.getswapList();
+    },
+  },
+};
+</script>

+ 0 - 13
src/views/manage-log/components/ErrorTestA.vue

@@ -1,13 +0,0 @@
-<template>
-  <div>
-    <!--error code-->
-    {{ a.a }}
-    <!--error code-->
-  </div>
-</template>
-
-<script>
-export default {
-  name: 'ErrorTestA'
-}
-</script>

+ 0 - 11
src/views/manage-log/components/ErrorTestB.vue

@@ -1,11 +0,0 @@
-<template>
-  <div />
-</template>
-
-<script>
-export default {
-  created() {
-    this.b = b // eslint-disable-line
-  }
-}
-</script>

+ 2 - 5
src/views/manage-log/log.scss

@@ -81,9 +81,6 @@
             width: 100%;
             min-height: 100%;
             background-color: #111827;
-            .el-table__body-wrapper{
-                height: calc(100% - 70px) !important;
-            }
         }
 
         .pageblock {
@@ -94,13 +91,13 @@
 }
 
 .checkFirst{
-    width: 485px;
     height: 40px;
     display: flex;
     align-items: center;
-    background-color: #191b20;
     padding: 0 12px;
     color: #fff;
     font-size: 15px;
     font-weight: 600;
+    margin: 0 auto;
+    justify-content: center;
 }

+ 54 - 59
src/views/manage-log/robot.vue

@@ -58,39 +58,22 @@
             fontSize: '15px',
           }"
           stripe
-          fit
           :height="tableheight"
-          style="width: 100%"
-          :default-sort="{prop: 'chargerId', order: 'descending'}"
-          @selection-change="handleSelectionChange"
+          v-loading="loading"
+          ref="tblist"
+          style="width:100%"
         >
-        <el-table-column
-          type="selection"
-          width="55">
-        </el-table-column>
-        <af-table-column
-          prop="time"
-          label="发生时间"
-          fixed
-          width="140">
-        </af-table-column>
-        <af-table-column
-          prop="plcTag"
-          label="日志编号"
-          fixed
-          width="120">
-        </af-table-column>
-        <af-table-column v-for="log in logheader" :key="log.alarmCode" :label="log.alarmName">
-          <template slot-scope="scope">
-            {{ scope.row[log.alarmId] }}
-          </template>
-        </af-table-column>
-
-          <!-- <el-table-column label="时段明细" width="100" align="center" fixed="right">
+          <el-table-column
+            prop="time"
+            label="发生时间"
+            fixed="left"
+            width="150">
+          </el-table-column>
+          <el-table-column v-for="log in logheader" :key="log.alarmCode" :label="log.alarmName" :render-header="labelHead">
             <template slot-scope="scope">
-              <el-button type="primary" class="handle" size="small" @click="chargeShow(scope.row.interval)">明细</el-button>
+              {{ scope.row[log.alarmId] }}
             </template>
-          </el-table-column> -->
+          </el-table-column>
         </el-table>
       </div>
       <div class="pageblock">
@@ -134,13 +117,14 @@ export default {
         sort:1
       },
       total: 0, // 总条数,
-      tableheight: 0, // 表格高度设置
+      tableheight:0, // 表格高度设置
       checked: false,
       indeterminate: false,
       robotValue:'',
       logOptions: [],
       logheader:[],
-      multipleSelection:[],
+      heightTimer:false,
+      loading: false,
     }
   },
   watch: {
@@ -157,12 +141,21 @@ export default {
     }
   },
   mounted() {
+    this.getrobotList()
+    this.getLogModel()
     this.onLoadHeight()
     this.changeWindow()
-    this.getLogModel()
-    this.getrobotList()
   },
   methods: {
+    labelHead(h,{column,index}){
+      let l = column.label.length
+      let f = 20
+      if(l <= 2){
+        f = 30
+      }
+      column.minWidth = f*l 
+      return h('div',{class:'table-head',style:{minWidth:'100%'}},[column.label])
+    },
     /* 设置初始视窗高度*/
     onLoadHeight() {
       this.$nextTick(() => {
@@ -181,13 +174,11 @@ export default {
       if (this.robotValue.length < this.logOptions.length) {
         this.robotValue = [];
         this.logOptions.map((item) => {
-          this.robotValue.push(item.value);
+          this.robotValue.push(item.alarmCode);
         });
-        this.robotValue.unshift("全选");
       } else {
         this.robotValue = [];
       }
-      this.$emit("SelectedData", this.robotValue);
     },
     changeSelect(val) {
       if (!val.includes("全选") && val.length === this.logOptions.length) {
@@ -197,24 +188,23 @@ export default {
           return item !== "全选";
         });
       }
-      this.$emit("SelectedData", this.robotValue);
     },
     removeTag(val) {
       if (val === "全选") {
         this.robotValue = [];
       }
-      this.$emit("SelectedData", this.robotValue);
-    },
-    //列表选择
-    handleSelectionChange(val) {
-      this.multipleSelection = val;
     },
     //获取机器人日志列表
     getrobotList(){
+      this.loading=true;
       robotList(this.queryParams).then( res =>{
-        console.log(res)
+        // console.log(res)
         this.datalist= res.data.list
         this.total=res.data.total
+        this.$nextTick(()=>{
+          this.$refs.tblist.doLayout()
+          this.loading=false
+        })
       })
     },
     //获取日志数据字典
@@ -222,7 +212,9 @@ export default {
       logModel().then( res =>{
         this.logOptions= res.data
         this.logheader=res.data
-        console.log(this.logOptions)
+        this.$nextTick(()=>{
+          this.$refs.tblist.doLayout()
+        })
       })
     },
     /** 分页下一页 */
@@ -237,22 +229,25 @@ export default {
     },
     // 搜索
     handleQuery() {
-      if (this.dateTime) {
-        this.queryParams.startTime = this.$moment(this.dateTime[0]).format('YYYY-MM-DD HH:mm:ss')
-        this.queryParams.endTime = this.$moment(this.dateTime[1]).format('YYYY-MM-DD HH:mm:ss')
-      }
-      if(this.robotValue){
-        this.queryParams.signals=this.robotValue
-        // this.logheader.forEach((item)=>{
-        //   if(!this.robotValue.includes(item.alarmCode)){
-        //         this.logheader.splice(item.alarmCode,1)  
-        //   }
-        // })
-        let differenceABSet = Array.from(new Set([...this.logOptions].filter(x => this.robotValue.includes(x.alarmCode))));
-        this.logheader=differenceABSet
+      if(this.dateTime || this.robotValue.length > 0){
+        if (this.dateTime) {
+          this.queryParams.startTime = this.$moment(this.dateTime[0]).format('YYYY-MM-DD HH:mm:ss')
+          this.queryParams.endTime = this.$moment(this.dateTime[1]).format('YYYY-MM-DD HH:mm:ss')
+        }
+        if(this.robotValue.length > 0){
+          this.queryParams.signals=this.robotValue
+          let differenceABSet = Array.from(new Set([...this.logOptions].filter(x => this.robotValue.includes(x.alarmCode))));
+          this.logheader=differenceABSet
+        }
+        this.getrobotList()
+      }else{
+        this.$message({
+          message: "请选择查询条件!",
+          type: "warning",
+          duration: 1000,
+          offset: 20,
+        });
       }
-      this.getrobotList()
-      console.log(this.logheader)
     },
     // 搜索重置
     resetForm() {

+ 0 - 1
src/views/power-change-monitoring/index.vue

@@ -503,7 +503,6 @@ export default {
         }
       }
       //换电时间
-      console.log(d.robotInfoVo)
       if (d.robotInfoVo) {
         this.swapTime = d.robotInfoVo.swapTime
       }

+ 5 - 5
vue.config.js

@@ -12,8 +12,8 @@ module.exports = {
   lintOnSave: false,
   productionSourceMap: false,
   devServer: {
-    host: 'localhost',
-    port: 8080,
+    host: '192.168.0.85',
+    port: 808,
     open: true,
     overlay: {
       warning: false,
@@ -21,19 +21,19 @@ module.exports = {
     },
     proxy: {
       '/api': {
-        target: `http://192.168.3.177:8080`,
+        target: `http://192.168.0.125:8080`,
         // target: `http://172.16.12.146:8080`,
         ws: true,
         changeOrigin: true,
       },
       '/ws': {
-         target: `ws://192.168.3.177:8080/ws`,
+         target: `ws://192.168.0.125:8080/ws`,
         // target: `ws://172.16.12.146:8080/ws`,
         ws: true,
         changeOrigin: true,
       },
       '/video':{
-        target: `ws://192.168.3.177:8082/`,
+        target: `ws://192.168.0.125:8082/`,
         // target: `ws://172.16.12.146:8080/ws`,
         ws: true,
         changeOrigin: true,