|
@@ -19,19 +19,27 @@
|
|
|
<pannel-item :value="driverInfo.motorcade" />
|
|
|
</li>
|
|
|
<li>
|
|
|
- <UserItem title="车辆信息" name="VEHICLE INFORMATION" />
|
|
|
- <span>
|
|
|
- <label>车辆VIN码</label><label>{{ Carlink }}</label>
|
|
|
- </span>
|
|
|
+ <UserItem title="车辆信息" name="VEHICLE INFORMATION" @ShowCarline="ShowCarline" />
|
|
|
+ <div class="carVin">
|
|
|
+ <label>车辆VIN码</label>
|
|
|
+ <label class="linkeState" v-if="vehicleInfo.conState==1">
|
|
|
+ <div><img src="./assets/link.png"></div>
|
|
|
+ <div>{{ Carlink }}</div>
|
|
|
+ </label>
|
|
|
+ <label class="linkeState" v-else>
|
|
|
+ <div><img src="./assets/break.png"></div>
|
|
|
+ <div class="break">未链接{{ totalSecond?totalSecond+'s' :' '}}</div>
|
|
|
+ </label>
|
|
|
+ </div>
|
|
|
<pannel-item :value="vehicleInfo.vin" />
|
|
|
<div class="carinfo">
|
|
|
<p>
|
|
|
<label>车牌号</label>
|
|
|
- <pannel-item :value="vehicleInfo.plate" />
|
|
|
+ <pannel-item :value="vehicleInfo.plate" label="车牌号" @HandleEditPlate="HandleEditPlate" />
|
|
|
</p>
|
|
|
<p>
|
|
|
- <label>解锁状态</label>
|
|
|
- <pannel-item :value="Carlock" />
|
|
|
+ <label>到位状态</label>
|
|
|
+ <pannel-item :value="Carsensor" />
|
|
|
</p>
|
|
|
</div>
|
|
|
<div class="carinfo">
|
|
@@ -40,13 +48,20 @@
|
|
|
<pannel-item :value="vehicleInfo.mileage" />
|
|
|
</p>
|
|
|
<p>
|
|
|
- <label>上电状态</label>
|
|
|
- <pannel-item :value="Carbattery" />
|
|
|
+ <label>解锁状态</label>
|
|
|
+ <pannel-item :value="Carlock" />
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <div class="carinfo">
|
|
|
+ <p>
|
|
|
+ <label>累计换电 (次)</label>
|
|
|
+ <pannel-item :value="vehicleInfo.swap" />
|
|
|
+ </p>
|
|
|
+ <p>
|
|
|
+ <label>上电状态</label>
|
|
|
+ <pannel-item :value="Carbattery" />
|
|
|
</p>
|
|
|
</div>
|
|
|
-
|
|
|
- <label>累计换电 (次)</label>
|
|
|
- <pannel-item :value="vehicleInfo.swap" />
|
|
|
</li>
|
|
|
<li>
|
|
|
<UserItem title="电池信息" name="Battery INFORMATION" />
|
|
@@ -96,7 +111,11 @@
|
|
|
name="换电业务流程"
|
|
|
statement="power exchange business process"
|
|
|
:logInfo="swapProcess.logInfo"
|
|
|
+ swaplogInfo="1"
|
|
|
:swapTime="swapTime"
|
|
|
+ :robotState="robotInfoVo.robotState"
|
|
|
+ :plcpause="robotInfoVo.pause"
|
|
|
+ :forbidLockState="forbidLockState"
|
|
|
/>
|
|
|
<process-symbol
|
|
|
:processtext="processtext"
|
|
@@ -213,11 +232,110 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <!--实时车辆弹窗-->
|
|
|
+ <div class="onlineManage">
|
|
|
+ <el-dialog
|
|
|
+ title="实时车辆连接信息"
|
|
|
+ :visible.sync="dialogCarlineVisible"
|
|
|
+ :destroy-on-close="true"
|
|
|
+ width="1600px"
|
|
|
+ >
|
|
|
+ <div class="charge-table-bottom">
|
|
|
+ <el-table
|
|
|
+ :data="CarlineList"
|
|
|
+ :header-cell-style="{
|
|
|
+ background: '#1d283e',
|
|
|
+ borderColor: '#2f3c86',
|
|
|
+ height: '36px',
|
|
|
+ lineHeight: '36px',
|
|
|
+ color:'white',
|
|
|
+ fontSize: '16px',
|
|
|
+ }"
|
|
|
+ stripe
|
|
|
+ fit
|
|
|
+ :height="tableheight-80"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-table-column label="车牌号">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <div class="iscar">
|
|
|
+ <span>{{ row.vehiclePlate }}</span><img src="./assets/iscar.png" v-if="vehicleInfo.plate==row.vehiclePlate">
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="启动状态">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <span class="item" :class="{disable:row.state === 0}">{{ row.state === 0 ? '熄火' : '启动' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="vehicleVin"
|
|
|
+ label="VIN码"
|
|
|
+ width="160"
|
|
|
+ />
|
|
|
+ <!-- <el-table-column
|
|
|
+ prop="mileage"
|
|
|
+ label="行驶里程(KW)"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="sn"
|
|
|
+ label="电池编号"
|
|
|
+ width="220"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="Voltage"
|
|
|
+ label="电压(V)"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="Current"
|
|
|
+ label="电流(A)"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="swapSoc"
|
|
|
+ label="SOC"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="swapSoh"
|
|
|
+ label="SOH"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="driver"
|
|
|
+ label="司机"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="phone"
|
|
|
+ label="联系电话"
|
|
|
+ /> -->
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div class="pageblock">
|
|
|
+ 站内连接车辆数:<span>{{ CarlineList.length }}</span>
|
|
|
+ </div>
|
|
|
+ <div slot="footer" class="dialog-footer" />
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+ <!--实时车辆弹窗结束-->
|
|
|
+ <!--修改车牌号弹窗-->
|
|
|
+ <div class="rolemanage">
|
|
|
+ <el-dialog title="编辑车牌号" :visible.sync="dialogPlateVisible"
|
|
|
+ :destroy-on-close="true" @close="dialogClose">
|
|
|
+ <el-form :model="ruleForm" :rules="rules" ref="PlateForm" v-loading="loading">
|
|
|
+ <el-form-item label="编辑车牌号:" prop="plate">
|
|
|
+ <el-input v-model="ruleForm.plate" placeholder="请输入您的车牌号"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button class="exit" @click="dialogPlateVisible = false">取消</el-button>
|
|
|
+ <el-button type="primary" class="save" @click="handlePlate">确定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+ <!--修改车牌号弹窗结束-->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { swapInfo, swapRecord, alarmRecord } from '@/api/powerCharge'
|
|
|
+import { swapInfo, swapRecord, alarmRecord,CarOnline,EditPlate} from '@/api/powerCharge'
|
|
|
import wsUrl from '../../../vue.config.js'
|
|
|
import UserItem from './components/UserItem.vue'
|
|
|
import PannelItem from './components/PannelItem.vue'
|
|
@@ -228,6 +346,7 @@ import QuarterChange from './components/QuarterChange.vue'
|
|
|
import StatisticItem from './components/StatisticItem.vue'
|
|
|
import '../../utils/jsmpeg.min'
|
|
|
import { getToken } from '@/utils/auth'
|
|
|
+import { isLicensePlateNumberNER } from '@/utils'
|
|
|
export default {
|
|
|
name: 'PowerChangeMonitoring',
|
|
|
components: {
|
|
@@ -257,7 +376,8 @@ export default {
|
|
|
mileage: '—',
|
|
|
batteryState: '—',
|
|
|
swap: '—',
|
|
|
- conState: 0
|
|
|
+ conState: '—',//监控120秒,1已连接 0未连接
|
|
|
+ sensorState:'—',//车辆到位状态,1已到位 0未到位
|
|
|
},
|
|
|
batteryInfo: {
|
|
|
sn: '—',
|
|
@@ -334,7 +454,54 @@ export default {
|
|
|
carRecord: [],
|
|
|
// 告警记录
|
|
|
alarmRecordList: [],
|
|
|
- swapTime:null
|
|
|
+ swapTime:null,
|
|
|
+ totalSecond:120,//车辆倒计时
|
|
|
+ dialogCarlineVisible:false,//在线车辆弹窗
|
|
|
+ tableheight: 0, // 表格高度设置
|
|
|
+ CarlineList:[],//在线车辆列表
|
|
|
+ queryParams: {
|
|
|
+ page: 1, // 当前页
|
|
|
+ pageSize: 10, // 每页条数
|
|
|
+ orderByField: undefined, // 排序字段
|
|
|
+ orderByWays: 'desc'// 排序方式
|
|
|
+ },
|
|
|
+ dialogPlateVisible:false,//车牌号弹窗
|
|
|
+ loading: false,
|
|
|
+ heightTimer: false,
|
|
|
+ ruleForm:{
|
|
|
+ plate:undefined,
|
|
|
+ },
|
|
|
+ rules:{
|
|
|
+ plate: [
|
|
|
+ { required: true, message: '请输入车牌号', trigger: 'blur' },
|
|
|
+ { min: 6, max: 12, message: '格式错误', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ },//验证车牌号
|
|
|
+ cloundState:0,//云端连接状态
|
|
|
+ robotInfoVo:{},//机器人状态
|
|
|
+ forbidLockState:0,//机器人锁止状态
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ tableheight(val) {
|
|
|
+ // 为了避免频繁触发resize函数导致页面卡顿,使用定时器
|
|
|
+ if (!this.heightTimer) {
|
|
|
+ // 一旦监听到的screenWidth值改变,就将其重新赋给data里的screenWidth
|
|
|
+ this.screenHeight = val
|
|
|
+ this.heightTimer = true
|
|
|
+ setTimeout(function() {
|
|
|
+ this.heightTimer = false
|
|
|
+ }, 400)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ cloundState(val){
|
|
|
+ this.$bus.$emit('CloudState',val)
|
|
|
+ },
|
|
|
+ 'vehicleInfo.conState'(val){
|
|
|
+ if(val==0){
|
|
|
+ this.getTotalSecond()
|
|
|
+ this.totalSecond=120
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -361,6 +528,14 @@ export default {
|
|
|
} else {
|
|
|
return '—'
|
|
|
}
|
|
|
+ },
|
|
|
+ //车辆到位状态
|
|
|
+ Carsensor(){
|
|
|
+ if (this.vehicleInfo.sensorState != '—' && this.vehicleInfo.sensorState != null) {
|
|
|
+ return this.vehicleInfo.sensorState ? '已到位' : '未到位'
|
|
|
+ } else {
|
|
|
+ return '—'
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -383,12 +558,94 @@ export default {
|
|
|
// 开启定时器
|
|
|
this.setTimerList()
|
|
|
}
|
|
|
+ this.getTotalSecond()//倒计时
|
|
|
+ this.onLoadHeight()
|
|
|
+ this.changeWindow()
|
|
|
},
|
|
|
destroyed() {
|
|
|
this.websocketOnClose()
|
|
|
this.clearTimerList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ /** 分页下一页 */
|
|
|
+ handleSizeChange(val) {
|
|
|
+ this.queryParams.pageSize = val
|
|
|
+ },
|
|
|
+ /** 分页选择页数 */
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ this.queryParams.page = val
|
|
|
+ },
|
|
|
+ /* 设置初始视窗高度*/
|
|
|
+ onLoadHeight() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.tableheight = document.body.clientHeight - 460
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /* 设置窗口变化高度*/
|
|
|
+ changeWindow() {
|
|
|
+ window.onresize = () => {
|
|
|
+ return (() => {
|
|
|
+ this.tableheight = document.body.clientHeight - 460
|
|
|
+ })()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //修改车牌号提交
|
|
|
+ handlePlate(){
|
|
|
+ if(this.ruleForm.plate==this.vehicleInfo.plate){
|
|
|
+ // this.$message({
|
|
|
+ // type: 'warning',
|
|
|
+ // message: '提交成功!'
|
|
|
+ // })
|
|
|
+ this.dialogPlateVisible=false
|
|
|
+ }else{
|
|
|
+ if(!isLicensePlateNumberNER(this.ruleForm.plate)){
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请填写新能源车牌号!'
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ EditPlate(this.ruleForm.plate).then((rs) => {
|
|
|
+ if(rs.code==0){
|
|
|
+ this.dialogPlateVisible=false
|
|
|
+ this.vehicleInfo.plate=this.ruleForm.plate
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '修改成功!'
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: rs.msg
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => { console.error(err) })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 清空表单数据车牌号
|
|
|
+ dialogClose() { },
|
|
|
+ //编辑车牌号弹窗
|
|
|
+ HandleEditPlate(plate){
|
|
|
+ this.dialogPlateVisible=true
|
|
|
+ this.ruleForm.plate=plate
|
|
|
+ },
|
|
|
+ //实时车辆弹窗
|
|
|
+ ShowCarline(){
|
|
|
+ this.dialogCarlineVisible=true
|
|
|
+ this.getCarOnline()
|
|
|
+ },
|
|
|
+ //车辆倒计时
|
|
|
+ getTotalSecond() {
|
|
|
+ if(this.vehicleInfo.conState==0){
|
|
|
+ let clock = window.setInterval(() => {
|
|
|
+ this.totalSecond --;
|
|
|
+ if(this.totalSecond == 0 || this.vehicleInfo.conState==1){
|
|
|
+ window.clearInterval(clock);
|
|
|
+ }
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
+ },
|
|
|
// 定时器列表
|
|
|
setTimerList() {
|
|
|
this.exchargeInfo()
|
|
@@ -409,6 +666,12 @@ export default {
|
|
|
clearInterval(this.wsTimer)
|
|
|
}
|
|
|
},
|
|
|
+ //已连接站控车辆列表
|
|
|
+ getCarOnline(){
|
|
|
+ CarOnline().then((rs) => {
|
|
|
+ this.CarlineList = rs.data
|
|
|
+ })
|
|
|
+ },
|
|
|
// 换电信息
|
|
|
exchargeInfo() {
|
|
|
swapInfo().then((rs) => {
|
|
@@ -444,7 +707,14 @@ export default {
|
|
|
},
|
|
|
websocketOnMessage(m) {
|
|
|
const d = JSON.parse(m.data)
|
|
|
- // console.log(d)
|
|
|
+ console.log(d)
|
|
|
+ //云端连接状态
|
|
|
+ if(d.cloundState){
|
|
|
+ this.cloundState=d.cloundState
|
|
|
+ }
|
|
|
+ if(d.forbidLockState<=1){
|
|
|
+ this.forbidLockState=d.forbidLockState
|
|
|
+ }
|
|
|
//用户信息
|
|
|
if (d.driverInfoVo) {
|
|
|
this.driverInfo = d.driverInfoVo
|
|
@@ -457,6 +727,10 @@ export default {
|
|
|
if (d.batteryInfo) {
|
|
|
this.batteryInfo = d.batteryInfo
|
|
|
}
|
|
|
+ //机器人状态
|
|
|
+ if (d.robotInfoVo) {
|
|
|
+ this.robotInfoVo = d.robotInfoVo
|
|
|
+ }
|
|
|
// 换电流程动画
|
|
|
if (d.swapProcess) {
|
|
|
this.swapProcess = d.swapProcess
|
|
@@ -583,14 +857,23 @@ export default {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
justify-content: space-between;
|
|
|
- span {
|
|
|
+ .carVin {
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
justify-content: space-between;
|
|
|
+ margin: 0;
|
|
|
+ padding: 0;
|
|
|
+ label{
|
|
|
+ margin-bottom: 7px;
|
|
|
+ }
|
|
|
label:last-child {
|
|
|
text-align: right;
|
|
|
color: #86edab;
|
|
|
font-weight: 500;
|
|
|
+ margin-bottom: 0;
|
|
|
+ }
|
|
|
+ label:nth-child(2){
|
|
|
+ margin-bottom: 0;
|
|
|
}
|
|
|
}
|
|
|
label {
|
|
@@ -603,6 +886,20 @@ export default {
|
|
|
padding-left:12px;
|
|
|
margin: 10px 0;
|
|
|
}
|
|
|
+ .linkeState{
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+ align-items: center;
|
|
|
+ margin:0;
|
|
|
+ text-shadow: 0px 0px 4px rgba(39,69,201,0.5);
|
|
|
+ img{
|
|
|
+ padding-right: 3px;
|
|
|
+ }
|
|
|
+ .break{
|
|
|
+ color: #F53F3F;
|
|
|
+ font-weight: 500;
|
|
|
+ }
|
|
|
+ }
|
|
|
.carinfo {
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
@@ -804,4 +1101,36 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.charge-table-bottom {
|
|
|
+ width: 100%;
|
|
|
+ min-height: 100%;
|
|
|
+ background-color: #111827;
|
|
|
+ .item{
|
|
|
+ color: #86EDAB;
|
|
|
+ }
|
|
|
+ .disable{
|
|
|
+ color: #FF6E6E;
|
|
|
+ }
|
|
|
+ .iscar{
|
|
|
+ display: flex;
|
|
|
+ width: 100%;
|
|
|
+ align-items: center;
|
|
|
+ span{
|
|
|
+ padding-right: 8px;
|
|
|
+ }
|
|
|
+ img{
|
|
|
+ width: 20px;
|
|
|
+ height: 15px;
|
|
|
+ vertical-align: middle;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.pageblock {
|
|
|
+ padding: 15px 0px;
|
|
|
+ font-size:15px;
|
|
|
+ color: #C0C4CC;
|
|
|
+ span{
|
|
|
+ color: #86EDAB;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|