Compare commits

..

No commits in common. "93477fc638f15d6f8d264638723c0cd23a7ff876" and "412cda72c3bce996a5e958184e1d5abd314dab44" have entirely different histories.

9 changed files with 1811 additions and 699 deletions

View File

@ -37,9 +37,7 @@ provide('reload', reload)
<template> <template>
<section <section
v-if=" v-if="currentRoute.name === 'editMapPageRealTimeMap'"
currentRoute.name === 'editMapPageRealTimeMap' || currentRoute.name === 'MapPageRealTimeMap'
"
:class="[ :class="[
'w-full bg-[var(--app-content-bg-color)] dark:bg-[var(--el-bg-color)]', 'w-full bg-[var(--app-content-bg-color)] dark:bg-[var(--el-bg-color)]',
{ {

View File

@ -33,13 +33,12 @@
--top-header-hover-color: #215bd8; --top-header-hover-color: #215bd8;
/* --top-tool-height: var(--logo-height); */ --top-tool-height: var(--logo-height);
--top-tool-height: 60px;
--top-tool-p-x: 0; --top-tool-p-x: 0;
/* --tags-view-height: 35px; 开启面包屑时 */ /* --tags-view-height: 35px; 开启面包屑时 */
--tags-view-height: 0px; --tags-view-height: 16px;
/* header start */ /* header start */
/* tab menu start */ /* tab menu start */

View File

@ -152,7 +152,7 @@
/> />
</div> </div>
<div style="width: 100%; padding-bottom: 120px" class="map-box-allBoard"> <div style="width: 100%; padding-bottom: 120px" class="map-box-allBoard">
<indexPage ref="indexPageRef" :isAllBoard="true" :isFullScreen="true" /> <indexPage ref="indexPageRef" :isAllBoard="true" />
</div> </div>
<div <div
style="position: fixed; bottom: 20px" style="position: fixed; bottom: 20px"
@ -314,9 +314,8 @@ import { ref, reactive, onMounted, onBeforeUnmount } from 'vue'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import * as ChartsApi from '@/api/boardCharts' import * as ChartsApi from '@/api/boardCharts'
import { DICT_TYPE, getIntDictOptions, getDictOptions } from '@/utils/dict' import { DICT_TYPE, getIntDictOptions, getDictOptions } from '@/utils/dict'
import indexPage from '../../mapPage/realTimeMap/components/indexPage.vue' import indexPage from './indexPage.vue'
import * as MapApi from '@/api/map/map' import * as MapApi from '@/api/map/map'
const router = useRouter() // const router = useRouter() //
const indexPageRef = ref(null) const indexPageRef = ref(null)
const typeList = ref([]) const typeList = ref([])

File diff suppressed because it is too large Load Diff

View File

@ -36,7 +36,7 @@
class="!w-240px" class="!w-240px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="线库名称" prop="laneName"> <el-form-item label="线库" prop="laneName">
<el-input <el-input
v-model="queryParams.laneName" v-model="queryParams.laneName"
placeholder="请输入" placeholder="请输入"
@ -45,7 +45,7 @@
class="!w-240px" class="!w-240px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="区域名称" prop="areaName"> <el-form-item label="区域" prop="areaName">
<el-input <el-input
v-model="queryParams.areaName" v-model="queryParams.areaName"
placeholder="请输入" placeholder="请输入"
@ -83,8 +83,8 @@
> >
<el-table-column label="序号" type="index" align="center" width="60" /> <el-table-column label="序号" type="index" align="center" width="60" />
<el-table-column label="库位号" align="center" prop="locationNo" /> <el-table-column label="库位号" align="center" prop="locationNo" />
<el-table-column label="线库名称" prop="laneName" align="center" /> <el-table-column label="线库" prop="laneName" align="center" />
<el-table-column label="区域名称" prop="areaName" align="center" /> <el-table-column label="区域" prop="areaName" align="center" />
<el-table-column label="物料信息" prop="skuInfo" align="center" show-overflow-tooltip /> <el-table-column label="物料信息" prop="skuInfo" align="center" show-overflow-tooltip />
<el-table-column label="状态" prop="locationUseStatus" align="center"> <el-table-column label="状态" prop="locationUseStatus" align="center">
<template #default="scope"> <template #default="scope">

View File

@ -92,7 +92,6 @@ const submitForm = async (formEl) => {
message.success('设置成功') message.success('设置成功')
emit('itemAreaSettingSubmitSuccess', { emit('itemAreaSettingSubmitSuccess', {
...res, ...res,
skuInfo: form.value.skuInfo,
mapItemIds: form.value.mapItemIds mapItemIds: form.value.mapItemIds
}) })
} }

File diff suppressed because it is too large Load Diff

View File

@ -351,7 +351,7 @@
所属线库{{ item.laneName }} 所属线库{{ item.laneName }}
</div> </div>
<div class="item-tooltip-name" v-if="item.areaId && item.areaName"> <div class="item-tooltip-name" v-if="item.areaId && item.areaName">
所属区域{{ item.areaName }} 所属线库{{ item.areaName }}
</div> </div>
</div> </div>
<div v-else-if="item.type === 3"> <div v-else-if="item.type === 3">
@ -1987,8 +1987,6 @@ const clickDrawSelectionArea = () => {
// //
state.allDrawSelectionAreaBox = [] state.allDrawSelectionAreaBox = []
//
state.drawSelectionPointList = deduplicateArrayById(state.drawSelectionPointList)
// //
let binLocation = state.drawSelectionPointList.filter((item) => item.type === 2) let binLocation = state.drawSelectionPointList.filter((item) => item.type === 2)
// //
@ -2147,17 +2145,6 @@ const GenerateStraightLinesSubmit = (pointList, form) => {
}) })
addEditHistory() addEditHistory()
} }
//
const deduplicateArrayById = (arr) => {
const idSet = new Set()
return arr.filter((item) => {
if (idSet.has(item.id)) {
return false
}
idSet.add(item.id)
return true
})
}
// 线 // 线
const mapPointsToLine = (points, startPointId, endPointId) => { const mapPointsToLine = (points, startPointId, endPointId) => {
@ -2169,61 +2156,35 @@ const mapPointsToLine = (points, startPointId, endPointId) => {
return return
} }
const dx = endPoint.locationX - startPoint.locationX const dx = startPoint.locationX - endPoint.locationX
const dy = endPoint.locationY - startPoint.locationY const dy = startPoint.locationY - endPoint.locationY
const length = Math.sqrt(dx * dx + dy * dy)
// 线
if (dx === 0) {
return points.map((point) => { return points.map((point) => {
if (point.id === startPointId || point.id === endPointId) { if (point === endPoint || point === startPoint) {
return point return point
} }
const vx = point.locationX - startPoint.locationX
const vy = point.locationY - startPoint.locationY
const dotProduct = vx * dx + vy * dy
const projectionLength = dotProduct / length
const t = Math.max(0, Math.min(1, projectionLength / length))
const newX = startPoint.locationX + t * dx
const newY = startPoint.locationY + t * dy
return { return {
...point, ...point,
locationX: newX, locationX: endPoint.locationX
}
})
}
const slope = dy / dx
const intercept = endPoint.locationY - slope * endPoint.locationX
return points.map((point) => {
if (point === endPoint || point === startPoint) {
return point
}
const newY = slope * point.locationX + intercept
return {
...point,
locationY: newY locationY: newY
} }
}) })
// const dx = startPoint.locationX - endPoint.locationX
// const dy = startPoint.locationY - endPoint.locationY
// // 线
// if (dx === 0) {
// return points.map((point) => {
// if (point === endPoint || point === startPoint) {
// return point
// }
// return {
// ...point,
// locationX: endPoint.locationX
// }
// })
// }
// const slope = dy / dx
// const intercept = endPoint.locationY - slope * endPoint.locationX
// return points.map((point) => {
// if (point === endPoint || point === startPoint) {
// return point
// }
// const newY = slope * point.locationX + intercept
// return {
// ...point,
// locationY: newY
// }
// })
} }
//线 //线
@ -2760,7 +2721,6 @@ const itemAreaSettingSubmitSuccess = (obj) => {
item.areaId = obj.id item.areaId = obj.id
item.dataList.forEach((node) => { item.dataList.forEach((node) => {
node.areaName = obj.areaName node.areaName = obj.areaName
node.skuInfo = obj.skuInfo
node.areaId = obj.id node.areaId = obj.id
}) })
} }
@ -2772,6 +2732,7 @@ const lineLibraryManagementDelete = (mapItemIds) => {
if (mapItemIds.includes(item.id)) { if (mapItemIds.includes(item.id)) {
item.laneId = undefined item.laneId = undefined
item.dataList.forEach((node) => { item.dataList.forEach((node) => {
;``
node.laneName = undefined node.laneName = undefined
node.laneId = undefined node.laneId = undefined
}) })
@ -2785,7 +2746,6 @@ const itemAreaManagementDelete = (mapItemIds) => {
item.areaId = undefined item.areaId = undefined
item.dataList.forEach((node) => { item.dataList.forEach((node) => {
node.areaName = undefined node.areaName = undefined
node.skuInfo = undefined
node.areaId = undefined node.areaId = undefined
}) })
} }
@ -2812,7 +2772,6 @@ const itemAreaManagementEdit = (obj) => {
item.areaId = obj.id item.areaId = obj.id
item.dataList.forEach((node) => { item.dataList.forEach((node) => {
node.areaName = obj.areaName node.areaName = obj.areaName
node.skuInfo = obj.skuInfo
node.areaId = obj.id node.areaId = obj.id
}) })
} }
@ -2993,15 +2952,13 @@ const handleWheel = (event) => {
if (state.imageChangeMultiple < 4) { if (state.imageChangeMultiple < 4) {
state.imageChangeMultiple += 0.2 state.imageChangeMultiple += 0.2
} else { } else {
state.imageChangeMultiple = 3.8
message.warning('不能在放大了') message.warning('不能在放大了')
} }
} else { } else {
// //
if (state.imageChangeMultiple > 0.4) { if (state.imageChangeMultiple > 0.2) {
state.imageChangeMultiple -= 0.1 state.imageChangeMultiple -= 0.2
} else { } else {
state.imageChangeMultiple = 0.3
message.warning('不能在缩小了') message.warning('不能在缩小了')
} }
} }
@ -3071,7 +3028,8 @@ onUnmounted(() => {
} }
.top-tool { .top-tool {
margin-bottom: 2px; margin-top: 5px;
margin-bottom: 3px;
.top-tool-list { .top-tool-list {
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -1,31 +1,29 @@
<template> <template>
<div class="page"> <ContentWrap>
<div class="top-div"> <div style="display: flex; align-items: center">
<el-cascader <el-cascader
v-model="mapValue" v-model="mapValue"
:options="list" :options="list"
@change="handleChangeMap" @change="handleChangeMap"
style="width: 160px" style="width: 160px"
/> />
<div class="line"></div> <div style="width: 1px; height: 25px; background: #e5e5e5; margin: 0 16px"></div>
<el-button @click="createTask" icon="CirclePlus" style="color: #536387"> 新建任务 </el-button> <el-button @click="createTask" :icon="'CirclePlus'" style="color: #536387"
<el-button @click="editMap" icon="EditPen" style="color: #536387">地图编辑</el-button> >新建任务</el-button
<el-button type="danger" @click="emergencyStop" icon="Remove">一键急停</el-button> >
<el-button @click="editMap" :icon="'EditPen'" style="color: #536387">地图编辑</el-button>
<el-button type="danger" @click="emergencyStop" :icon="'Remove'">一键急停</el-button>
</div> </div>
</ContentWrap>
<div class="main-content"> <div class="main-content">
<!-- <div @click="downAgv">导出zip</div> --> <!-- <div @click="downAgv">导出zip</div> -->
<!-- 首页 --> <!-- 首页 -->
<indexPage ref="indexPageRef" :isFullScreen="false" /> <indexPage ref="indexPageRef" />
</div> </div>
<!-- 新建任务的弹窗 --> <!-- 新建任务的弹窗 -->
<createTaskDialog <createTaskDialog v-if="mapValue.length" ref="createTaskDialogRef" :positionMapId="mapValue[1]" />
v-if="mapValue.length"
ref="createTaskDialogRef"
:positionMapId="mapValue[1]"
/>
</div>
</template> </template>
<script setup> <script setup>
@ -130,6 +128,7 @@ const getList = async () => {
const handleChangeMap = async (e) => { const handleChangeMap = async (e) => {
let item = findChildrenByValues(list.value, e) let item = findChildrenByValues(list.value, e)
indexPageRef.value.getMapData(item) indexPageRef.value.getMapData(item)
console.log(item)
router.replace({ router.replace({
name: 'MapPageRealTimeMap', name: 'MapPageRealTimeMap',
query: { query: {
@ -192,33 +191,7 @@ onMounted(() => {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.page {
position: absolute;
width: 100%;
.top-div {
display: flex;
align-items: center;
padding: 0 12px;
height: 60px;
box-shadow: rgba(0, 0, 0, 0.06) 0px 2px 3px;
background-color: #fff;
position: absolute;
z-index: 999;
top: 0;
left: 0;
right: 0;
.line {
width: 1px;
height: 25px;
background: #e5e5e5;
margin: 0 16px;
}
}
.main-content { .main-content {
margin-top: 62px; // background-color: #fff;
}
} }
</style> </style>