diff --git a/.env.local b/.env.local index a3752946..731be2fa 100644 --- a/.env.local +++ b/.env.local @@ -4,8 +4,9 @@ NODE_ENV=development VITE_DEV=true # 请求路径 -VITE_BASE_URL='http://192.168.0.74:48080' +# VITE_BASE_URL='http://192.168.0.74:48080' # VITE_BASE_URL='http://192.168.0.189:48080' +VITE_BASE_URL='http://192.168.0.45:48080' # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务 VITE_UPLOAD_TYPE=server diff --git a/src/views/mapPage/realTimeMap/components-tool/equipmentToolDialog.vue b/src/views/mapPage/realTimeMap/components-tool/equipmentToolDialog.vue index 10e4c45b..165090f2 100644 --- a/src/views/mapPage/realTimeMap/components-tool/equipmentToolDialog.vue +++ b/src/views/mapPage/realTimeMap/components-tool/equipmentToolDialog.vue @@ -23,8 +23,8 @@ - - + + - + { }) } //新增表单新增 +const ruleFormRef = ref() +const rules = reactive({ + deviceType: [{ required: true, message: '请选择设备类型', trigger: 'change' }], + deviceInfoId: [{ required: true, message: '请选择设备类型', trigger: 'change' }] +}) const submitAddForm = async () => { - deviceInfo.value.positionMapId = props.positionMapId - await MapApi.mapBindDeviceInfo(deviceInfo.value) - message.success('新增成功') - addDeviceVisible.value = false - getDeviceList() + await ruleFormRef.value.validate(async (valid, fields) => { + if (!valid) return + deviceInfo.value.positionMapId = props.positionMapId + await MapApi.mapBindDeviceInfo(deviceInfo.value) + message.success('新增成功') + addDeviceVisible.value = false + getDeviceList() + }) } const equipmentList = ref([]) diff --git a/src/views/mapPage/realTimeMap/editMap.vue b/src/views/mapPage/realTimeMap/editMap.vue index 238f2ff0..3cb2d597 100644 --- a/src/views/mapPage/realTimeMap/editMap.vue +++ b/src/views/mapPage/realTimeMap/editMap.vue @@ -395,8 +395,6 @@ v-if="item.type === 7 && item.layerSelectionShow" :style="{ position: 'absolute', - left: item.locationX + 'px', - top: item.locationY + 'px', color: item.fontColor, fontSize: item.fontSize + 'px', fontFamily: item.fontFamily, @@ -1352,6 +1350,7 @@ const toolbarClick = async (item) => { break case 'move': //移动 + console.log(state.allMapPointInfo[state.currentItemIndex]) state.moveForm.locationX = Number(state.allMapPointInfo[state.currentItemIndex].locationX) state.moveForm.locationY = Number(state.allMapPointInfo[state.currentItemIndex].locationY) break @@ -1701,25 +1700,24 @@ const startFromPoint = (index, event) => { //开始框选绘制 const startDrawSelection = (event) => { if ( - toolbarSwitchType.value !== 'createLineLibrary' && - toolbarSwitchType.value !== 'createRegion' && - toolbarSwitchType.value !== 'drawRoute' && - toolbarSwitchType.value !== 'generateLine' - ) - return + toolbarSwitchType.value === 'createLineLibrary' || + toolbarSwitchType.value === 'createRegion' || + toolbarSwitchType.value === 'drawRoute' || + toolbarSwitchType.value == 'generateLine' + ) { + const backgroundRect = mapBackgroundRef.value.getBoundingClientRect() - const backgroundRect = mapBackgroundRef.value.getBoundingClientRect() + const x = disposeEventPoints(event).x + const y = disposeEventPoints(event).y - const x = disposeEventPoints(event).x - const y = disposeEventPoints(event).y - - // 确保点击在背景区域内 - if (x >= 0 && x <= backgroundRect.width && y >= 0 && y <= backgroundRect.height) { - state.drawSelectionAreaShow = true - state.drawSelectionStartPoint = { x: x, y: y } - state.drawSelectionAreaBox = { x: x, y: y, width: 0, height: 0 } + // 确保点击在背景区域内 + if (x >= 0 && x <= backgroundRect.width && y >= 0 && y <= backgroundRect.height) { + state.drawSelectionAreaShow = true + state.drawSelectionStartPoint = { x: x, y: y } + state.drawSelectionAreaBox = { x: x, y: y, width: 0, height: 0 } + } + event.preventDefault() // 阻止默认行为(避免选中图片或文本) } - event.preventDefault() // 阻止默认行为(避免选中图片或文本) } // 更新框选区域 const updateDrawSelection = (event) => { @@ -1741,7 +1739,6 @@ const updateDrawSelection = (event) => { } } event.preventDefault() // 阻止默认行为(避免选中图片或文本) - return } if (toolbarSwitchType.value === 'clickDrawRoute') { // 实时绘制 @@ -1753,7 +1750,6 @@ const updateDrawSelection = (event) => { state.currentDrawY = y } event.preventDefault() // 阻止默认行为(避免选中图片或文本) - return } } //结束框选绘制 @@ -2473,6 +2469,8 @@ const getAllNodeList = async () => { item.resizable = false item.rotatable = true item.lockAspectRatio = true + item.locationDeep = 10 + item.locationWide = 10 } //要将实际的cm改成px