设备添加bug修改

This commit is contained in:
yyy 2025-03-18 16:42:50 +08:00
parent 6ea7dfb634
commit 12739441d6
3 changed files with 36 additions and 29 deletions

View File

@ -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

View File

@ -23,8 +23,8 @@
<!-- 新增设备 -->
<Dialog v-model="addDeviceVisible" title="设备" width="586" class="equipment-form-dialog">
<el-form :model="deviceInfo" label-width="90">
<el-form-item label="设备类型" required>
<el-form :model="deviceInfo" label-width="90" ref="ruleFormRef" :rules="rules">
<el-form-item prop="deviceType" label="设备类型" required>
<el-select
v-model="deviceInfo.deviceType"
class="!w-400px"
@ -40,7 +40,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="设备编号" required>
<el-form-item prop="deviceInfoId" label="设备编号" required>
<el-select
v-model="deviceInfo.deviceInfoId"
class="!w-400px"
@ -136,12 +136,20 @@ const getAllDeviceList = async () => {
})
}
//
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([])

View File

@ -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
}
//cmpx