This commit is contained in:
2025-08-13 18:06:35 +08:00
parent 98e21918a5
commit a59955e8f6
8 changed files with 95 additions and 76 deletions

View File

@@ -2,7 +2,7 @@
export const queryStation = () => { export const queryStation = () => {
let res = { let res = {
message: 'ok', message: 'ok',
data: [{station_code: 'B1', station_name: 'B1', x: '10', Y: '10', angle: '90'}, {station_code: 'B2', station_name: 'B2', x: '10', Y: '10', angle: '90'}, {station_code: 'B3', station_name: 'B3', x: '10', Y: '10', angle: '90'}] data: [{station_code: 'B1', station_name: 'B1', x: '10', Y: '10', angle: '90'}, {station_code: 'B2', station_name: 'B2', x: '10', Y: '10', angle: '90'}, {station_code: 'B3', station_name: 'B3', x: '10', Y: '10', angle: '90'}, {station_code: 'B1', station_name: 'B1', x: '10', Y: '10', angle: '90'}, {station_code: 'B2', station_name: 'B2', x: '10', Y: '10', angle: '90'}, {station_code: 'B3', station_name: 'B3', x: '10', Y: '10', angle: '90'}, {station_code: 'B1', station_name: 'B1', x: '10', Y: '10', angle: '90'}, {station_code: 'B2', station_name: 'B2', x: '10', Y: '10', angle: '90'}, {station_code: 'B3', station_name: 'B3', x: '10', Y: '10', angle: '90'}, {station_code: 'B1', station_name: 'B1', x: '10', Y: '10', angle: '90'}, {station_code: 'B2', station_name: 'B2', x: '10', Y: '10', angle: '90'}, {station_code: 'B3', station_name: 'B3', x: '10', Y: '10', angle: '90'}, {station_code: 'B1', station_name: 'B1', x: '10', Y: '10', angle: '90'}, {station_code: 'B2', station_name: 'B2', x: '10', Y: '10', angle: '90'}, {station_code: 'B3', station_name: 'B3', x: '10', Y: '10', angle: '90'}, {station_code: 'B1', station_name: 'B1', x: '10', Y: '10', angle: '90'}, {station_code: 'B2', station_name: 'B2', x: '10', Y: '10', angle: '90'}, {station_code: 'B3', station_name: 'B3', x: '10', Y: '10', angle: '90'}]
} }
return res return res
} }
@@ -35,7 +35,7 @@ export const queryMapAllStation = () => {
"station_id": 2, "station_id": 2,
"station_code": "B1", "station_code": "B1",
"station_name": "B1", "station_name": "B1",
"station_type": "STATION", "station_type": "Charge",
"action_type": "Customize", "action_type": "Customize",
"x": -3.30318, "x": -3.30318,
"y": 0.123685, "y": 0.123685,

View File

@@ -1,12 +1,15 @@
<template> <template>
<div class="page_container"> <div class="page_container">
<gl-map ref="glMap"/>
<el-row type="flex" justify="space-between"> <el-row type="flex" justify="space-between">
<el-col :span="10"><button class="button_control" :disabled="disabled" @click="addPoint"><p>打点</p></button></el-col> <el-col :span="10"><button class="button_control" :disabled="disabled" @click="addPoint"><p>打点</p></button></el-col>
</el-row> <el-col :span="14">
<gl-map ref="glMap"/> <el-row type="flex" justify="end">
<el-row type="flex" justify="end"> <button class="button_control" @click="$router.push('/index/home')"><p>放弃建图</p></button>
<button class="button_control" @click="$router.push('/index/home')"><p>放弃建图</p></button> <button class="button_control" style="margin-left: 10px" :disabled="disabled" @click="stopMappingConfirm"><p>结束建图</p></button>
<button class="button_control" style="margin-left: 10px" :disabled="disabled" @click="stopMappingConfirm"><p>结束建图</p></button> </el-row>
</el-col>
</el-row> </el-row>
<el-dialog <el-dialog
title="设置站点" title="设置站点"

View File

@@ -1,38 +1,38 @@
<template> <template>
<div class="page_container"> <div class="page_container">
<div class="t_box"> <el-row type="flex" class="t_box" justify="space-between">
<el-tabs tab-position="left" v-model="activeName" @tab-click="tabClick"> <el-col :span="20">
<el-tab-pane label="自定义" name="zdy"> <div style="height: calc(100% - 1rem);overflow: hidden;">
<el-row type="flex" class="r_box"> <el-tabs v-model="activeName" @tab-click="tabClick" style="height: 100%;">
<el-col class="point_item" v-for="(e, i) in dataList" :key="'zdy' + i"> <el-tab-pane label="自定义" name="zdy">
<el-popover <el-row type="flex" class="r_box">
placement="bottom" <el-col class="point_item" v-for="(e, i) in dataList" :key="'zdy' + i">
trigger="manual" <el-popover
:ref="`popover-${i}`"> placement="bottom"
<el-row type="flex" justify="space-between" align="middle" style="margin-bottom: .1rem"> trigger="manual"
<el-col :span="18"><el-input placeholder="修改名称" v-model="stationName" @focus="show" data-layout="normal"></el-input></el-col> :ref="`popover-${i}`">
<el-button type="success" icon="el-icon-check" size="mini" style="height: .3rem" :disabled="disabled" @click="_updateStation(e, i)"></el-button> <el-row type="flex" justify="space-between" align="middle" style="margin-bottom: .1rem">
</el-row> <el-col :span="18"><el-input placeholder="修改名称" v-model="stationName" @focus="show" data-layout="normal"></el-input></el-col>
<el-row type="flex" justify="space-between"> <el-button type="success" icon="el-icon-check" size="mini" style="height: .3rem" :disabled="disabled" @click="_updateStation(e, i)"></el-button>
<el-button class="task_button" :class="{'task_checked': e.action_type === el.value}" v-for="el in radioOption" :key="el.value" @click="radioInput(e, i, el.value)">{{ el.label }}</el-button> </el-row>
</el-row> <el-row type="flex" justify="space-between">
<div slot="reference" class="zbox point_item_i" @click="openPopover(i)"><p>{{ e.station_name }}</p></div> <el-button class="task_button" :class="{'task_checked': e.action_type === el.value}" v-for="el in radioOption" :key="el.value" @click="radioInput(e, i, el.value)">{{ el.label }}</el-button>
</el-popover> </el-row>
</el-col> <div slot="reference" class="zbox point_item_i" @click="openPopover(i)"><p>{{ e.station_name }}</p></div>
</el-row> </el-popover>
</el-tab-pane> </el-col>
<el-tab-pane label="任务链" name="rwl"> </el-row>
<el-row type="flex" class="r_box"> </el-tab-pane>
<el-col class="point_item" v-for="(e, i) in linkData" :key="'rwl' + i"> <el-tab-pane label="任务链" name="rwl">
<div class="zbox point_item_i" @click="handleLinkCheck(e)"><p>{{ e.chain_name }}</p></div> <el-row type="flex" class="r_box">
</el-col> <el-col class="point_item" v-for="(e, i) in linkData" :key="'rwl' + i">
</el-row> <div class="zbox point_item_i" @click="handleLinkCheck(e)"><p>{{ e.chain_name }}</p></div>
</el-tab-pane> </el-col>
</el-tabs> </el-row>
</div> </el-tab-pane>
<el-row type="flex" class="result_w" justify="space-between" align="middle"> </el-tabs>
<el-col :span="15" class="result_items_w"> </div>
<el-row type="flex" class="result_items" justify="start" align="top"> <el-row type="flex" class="result_w" justify="start" align="top">
<el-col class="pp_item" v-for="(e, i) in newData" :key="'new' + i"> <el-col class="pp_item" v-for="(e, i) in newData" :key="'new' + i">
<el-row type="flex" align="middle"> <el-row type="flex" align="middle">
<div class="point_item point_checked"> <div class="point_item point_checked">
@@ -48,13 +48,13 @@
</el-col> </el-col>
</el-row> </el-row>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="4" style="padding: 0 .1rem;">
<el-row type="flex" justify="space-between" style="flex-wrap: wrap" > <el-row type="flex" justify="center" style="flex-wrap: wrap;height: 100%;align-content: flex-end;">
<el-col v-if="activeName === 'rwl'" :span="11" style="margin-bottom: .08rem"><button class="button_control" :class="{'button_control_disabled': !chainId}" :disabled="disabled" @click="_deleteTaskChain"><p>删除任务链</p></button></el-col> <el-col v-if="activeName === 'rwl'" :span="24" class="button_box"><button class="button_control" :class="{'button_control_disabled': !chainId}" :disabled="disabled" @click="_deleteTaskChain"><p style="font-size: .28rem">删除任务链</p></button></el-col>
<el-col v-if="activeName === 'zdy'" :span="11" style="margin-bottom: .08rem"><button class="button_control" :class="{'button_control_disabled': !newData.length}" @click="newData = []"><p>清空</p></button></el-col> <el-col v-if="activeName === 'zdy'" :span="24" class="button_box"><button class="button_control" :class="{'button_control_disabled': !newData.length}" @click="newData = []"><p>清空</p></button></el-col>
<el-col :span="11" style="margin-bottom: .08rem"><button class="button_control" :disabled="disabled" @click="_cancelTask"><p>取消任务</p></button></el-col> <el-col :span="24" class="button_box"><button class="button_control" :disabled="disabled" @click="_cancelTask"><p>取消任务</p></button></el-col>
<el-col v-if="activeName === 'zdy'" :span="11"><button class="button_control" :class="{'button_control_disabled': !newData.length}" :disabled="disabled" @click="_saveTask"><p>保存任务</p></button></el-col> <el-col v-if="activeName === 'zdy'" :span="24" class="button_box"><button class="button_control" :class="{'button_control_disabled': !newData.length}" :disabled="disabled" @click="_saveTask"><p>保存任务</p></button></el-col>
<el-col :span="11"><button class="button_control" :class="{'button_control_disabled': !newData.length}" :disabled="disabled" @click="_sendTask"><p>发送任务</p></button></el-col> <el-col :span="24" class="button_box"><button class="button_control" :class="{'button_control_disabled': !newData.length}" :disabled="disabled" @click="_sendTask"><p>发送任务</p></button></el-col>
</el-row> </el-row>
</el-col> </el-col>
</el-row> </el-row>
@@ -65,6 +65,7 @@
<script> <script>
import SaveChain from './save-chain.vue' import SaveChain from './save-chain.vue'
// import { queryStation, queryTaskChain } from '../../config/mork.js'
import { queryStation, queryTaskChain, queryTaskChainDtl, sendTask, saveTask, cancelTask, deleteTaskChain, updateStation } from '../../config/getData.js' import { queryStation, queryTaskChain, queryTaskChainDtl, sendTask, saveTask, cancelTask, deleteTaskChain, updateStation } from '../../config/getData.js'
export default { export default {
name: 'ModuleDevice', name: 'ModuleDevice',
@@ -395,8 +396,7 @@ export default {
<style lang="stylus" scoped> <style lang="stylus" scoped>
.t_box .t_box
height calc(100% - 1.1rem) height 100%
margin-bottom 0.1rem
background-color rgba(0, 19, 48, 70%) background-color rgba(0, 19, 48, 70%)
box-shadow inset 1px 1px 7px 2px #4d9bcd box-shadow inset 1px 1px 7px 2px #4d9bcd
padding .1rem padding .1rem
@@ -446,9 +446,6 @@ export default {
font-size .2rem font-size .2rem
color #fff color #fff
line-height .4rem line-height .4rem
.result_items_w
height .8rem
overflow hidden
.result_items .result_items
flex-wrap wrap flex-wrap wrap
align-content flex-start align-content flex-start
@@ -482,4 +479,14 @@ export default {
border-color #409EFF border-color #409EFF
&:first-child &:first-child
border-left-color #409EFF border-left-color #409EFF
.button_box
height 20%
margin-bottom .16rem
text-align center
&:last-child
margin-bottom 0
.button_control
height 100%
p
font-size .3rem
</style> </style>

View File

@@ -457,8 +457,8 @@ export default {
.point-cloud-map .point-cloud-map
position relative position relative
width 100% width 100%
height calc(100% - 1rem - 6px) height calc(100% - .5rem)
margin .14rem 0 margin-bottom .14rem
background-color rgba(4, 33, 58, 70%) background-color rgba(4, 33, 58, 70%)
box-shadow inset 1px 1px 7px 2px #4d9bcd box-shadow inset 1px 1px 7px 2px #4d9bcd
overflow hidden overflow hidden

View File

@@ -54,7 +54,7 @@ export default {
flex-wrap wrap flex-wrap wrap
align-content center align-content center
.nav_item .nav_item
height 35% height 90%
padding 1.5% padding 1.5%
color #fff color #fff
font-size .2rem font-size .2rem
@@ -74,7 +74,7 @@ export default {
border-left 2px solid #62b2f0 border-left 2px solid #62b2f0
box-shadow inset 0 0px 12px 8px rgba(98, 180, 243, 50%) box-shadow inset 0 0px 12px 8px rgba(98, 180, 243, 50%)
p p
font-size .3rem font-size .4rem
line-height 1 line-height 1
color #F6F9FE color #F6F9FE
font-family 'YouSheBiaoTiHei' font-family 'YouSheBiaoTiHei'

View File

@@ -332,10 +332,12 @@ export default {
) )
} }
// 绘制点位名称(文字大小随缩放变化) // 绘制点位名称(文字大小随缩放变化)
this.ctx.font = '12px Arial' if (point.station_type === 'Station') {
this.ctx.fillStyle = 'white' this.ctx.font = '12px Arial'
this.ctx.textAlign = 'center' this.ctx.fillStyle = 'white'
this.ctx.fillText(point.station_name, x, y + 18) this.ctx.textAlign = 'center'
this.ctx.fillText(point.station_name, x, y + 18)
}
}) })
}, },
drawCar () { drawCar () {
@@ -347,10 +349,10 @@ export default {
this.ctx.rotate(-this.carPosition.angle) this.ctx.rotate(-this.carPosition.angle)
this.ctx.drawImage( this.ctx.drawImage(
this.cachedImages.car, this.cachedImages.car,
-25, -10,
-25, -10,
50, 20,
50 20
) )
// this.ctx.restore() // this.ctx.restore()
}, },

View File

@@ -30,12 +30,12 @@
<div class="error-tips-t">错误提示{{ exception }}</div> <div class="error-tips-t">错误提示{{ exception }}</div>
</div> </div>
</div> </div>
<el-row type="flex" class="relative main-conatiner" :style="{'paddingTop': exception !== '' ? '.3rem' : '0'}"> <el-row type="flex" class="relative main-conatiner" :style="{'paddingTop': exception !== '' ? '.3rem' : '0', 'paddingBottom': taskSeq.length > 0 ? '.6rem': '0'}">
<div class="absolute hud_left"></div> <div class="absolute hud_left"></div>
<div class="absolute hud_left hud_right"></div> <div class="absolute hud_left hud_right"></div>
<router-view></router-view> <router-view></router-view>
</el-row> </el-row>
<div v-if="JSON.stringify(topInfo) !== '{}'" class="task_wraper"> <div v-if="taskSeq.length > 0" class="task_wraper">
<div class="task_content"> <div class="task_content">
<div class="step_item" v-for="(e, i) in taskSeq" :key="i" :class="{'step_active': currentStep === i, 'step_actived': i < currentStep}"> <div class="step_item" v-for="(e, i) in taskSeq" :key="i" :class="{'step_active': currentStep === i, 'step_actived': i < currentStep}">
<div class="step_name">{{ e }}</div> <div class="step_name">{{ e }}</div>
@@ -83,8 +83,8 @@ export default {
task_seq: '工作点1-工作点2-工作点3', task_seq: '工作点1-工作点2-工作点3',
task_point: '工作点2' task_point: '工作点2'
}, },
taskSeq: '', taskSeq: [],
currentStep: 0, currentStep: null,
loginVisible: false, loginVisible: false,
configVisible: false configVisible: false
} }
@@ -165,8 +165,10 @@ export default {
this.websocket.onerror = (error) => { this.websocket.onerror = (error) => {
this.$message.error('WebSocket连接错误:', error) this.$message.error('WebSocket连接错误:', error)
} }
this.websocket.onclose = (event) => { this.websocket.onclose = () => {
console.log(`WebSocket连接关闭: 代码=${event.code}, 原因=${event.reason}`) this.topInfo = {}
this.taskSeq = []
this.currentStep = null
this.reconnectWebSocket() this.reconnectWebSocket()
} }
}, },
@@ -207,14 +209,14 @@ export default {
background linear-gradient(0deg, #E64F29, rgba(230, 79, 41, 0.5)) background linear-gradient(0deg, #E64F29, rgba(230, 79, 41, 0.5))
border-color rgba(230, 79, 41, 0.7) border-color rgba(230, 79, 41, 0.7)
.state-item .state-item
_wh(.72rem, .25rem) _wh(1rem, .3rem)
_font(.14rem,.25rem,#fff,,center) _font(.18rem,.3rem,#fff,,center)
font-family 'Adobe Heiti Std' font-family 'Adobe Heiti Std'
margin-right .08rem margin-right .08rem
background center / 100% 100% url(../../images/new/state-item_bg.png) no-repeat background center / 100% 100% url(../../images/new/state-item_bg.png) no-repeat
box-shadow inset 0px 0px 3px 2px rgb(149, 221, 253, 70%) box-shadow inset 0px 0px 3px 2px rgb(149, 221, 253, 70%)
.elec-qty-wrap .elec-qty-wrap
_wh(.5rem, .25rem) _wh(.6rem, .3rem)
margin-right .08rem margin-right .08rem
background center / 100% 100% url(../../images/new/elec.png) no-repeat background center / 100% 100% url(../../images/new/elec.png) no-repeat
border 1px solid #5ADFBC border 1px solid #5ADFBC
@@ -236,7 +238,7 @@ export default {
.elec-txt .elec-txt
position relative position relative
z-index 153 z-index 153
_font(.15rem, .25rem, #fff,,center) _font(.18rem, .3rem, #fff,,center)
font-family 'Adobe Heiti Std' font-family 'Adobe Heiti Std'
.icon-user .icon-user
font-size .24rem font-size .24rem

View File

@@ -81,7 +81,7 @@
font-size .24rem font-size .24rem
color #fff color #fff
.el-button .el-button
font-size .16rem font-size .2rem
padding-top 0 padding-top 0
padding-bottom 0 padding-bottom 0
height .32rem height .32rem
@@ -161,6 +161,8 @@
background: rgba(31,46,73,0.5); background: rgba(31,46,73,0.5);
.el-table--enable-row-hover .el-table__body tr:hover>td .el-table--enable-row-hover .el-table__body tr:hover>td
background: rgba(63,106,202,0.3); background: rgba(63,106,202,0.3);
.el-tabs__header
margin 0 0 .1rem
.el-tabs__nav-wrap::after .el-tabs__nav-wrap::after
background-color #192B47 background-color #192B47
.el-tabs--left .el-tabs__header.is-left .el-tabs--left .el-tabs__header.is-left
@@ -169,11 +171,14 @@
padding 0 .2rem padding 0 .2rem
height .4rem height .4rem
line-height .4rem line-height .4rem
font-size .18rem font-size .22rem
color #c9c9c9 color #c9c9c9
.el-tabs__item.is-active .el-tabs__item.is-active
color #3CC1FF color #3CC1FF
font-weight 700 font-weight 700
.el-tabs__content
height calc(100% - 0.5rem)
overflow-y auto
.el-popover .el-popover
background rgba(7,31,62,0.95) background rgba(7,31,62,0.95)
min-width 150px min-width 150px