设备添加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_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.189:48080'
VITE_BASE_URL='http://192.168.0.45:48080'
# 文件上传类型server - 后端上传, client - 前端直连上传,仅支持 S3 服务 # 文件上传类型server - 后端上传, client - 前端直连上传,仅支持 S3 服务
VITE_UPLOAD_TYPE=server VITE_UPLOAD_TYPE=server

View File

@ -23,8 +23,8 @@
<!-- 新增设备 --> <!-- 新增设备 -->
<Dialog v-model="addDeviceVisible" title="设备" width="586" class="equipment-form-dialog"> <Dialog v-model="addDeviceVisible" title="设备" width="586" class="equipment-form-dialog">
<el-form :model="deviceInfo" label-width="90"> <el-form :model="deviceInfo" label-width="90" ref="ruleFormRef" :rules="rules">
<el-form-item label="设备类型" required> <el-form-item prop="deviceType" label="设备类型" required>
<el-select <el-select
v-model="deviceInfo.deviceType" v-model="deviceInfo.deviceType"
class="!w-400px" class="!w-400px"
@ -40,7 +40,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备编号" required> <el-form-item prop="deviceInfoId" label="设备编号" required>
<el-select <el-select
v-model="deviceInfo.deviceInfoId" v-model="deviceInfo.deviceInfoId"
class="!w-400px" 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 () => { const submitAddForm = async () => {
deviceInfo.value.positionMapId = props.positionMapId await ruleFormRef.value.validate(async (valid, fields) => {
await MapApi.mapBindDeviceInfo(deviceInfo.value) if (!valid) return
message.success('新增成功') deviceInfo.value.positionMapId = props.positionMapId
addDeviceVisible.value = false await MapApi.mapBindDeviceInfo(deviceInfo.value)
getDeviceList() message.success('新增成功')
addDeviceVisible.value = false
getDeviceList()
})
} }
const equipmentList = ref([]) const equipmentList = ref([])

View File

@ -395,8 +395,6 @@
v-if="item.type === 7 && item.layerSelectionShow" v-if="item.type === 7 && item.layerSelectionShow"
:style="{ :style="{
position: 'absolute', position: 'absolute',
left: item.locationX + 'px',
top: item.locationY + 'px',
color: item.fontColor, color: item.fontColor,
fontSize: item.fontSize + 'px', fontSize: item.fontSize + 'px',
fontFamily: item.fontFamily, fontFamily: item.fontFamily,
@ -1352,6 +1350,7 @@ const toolbarClick = async (item) => {
break break
case 'move': case 'move':
// //
console.log(state.allMapPointInfo[state.currentItemIndex])
state.moveForm.locationX = Number(state.allMapPointInfo[state.currentItemIndex].locationX) state.moveForm.locationX = Number(state.allMapPointInfo[state.currentItemIndex].locationX)
state.moveForm.locationY = Number(state.allMapPointInfo[state.currentItemIndex].locationY) state.moveForm.locationY = Number(state.allMapPointInfo[state.currentItemIndex].locationY)
break break
@ -1701,25 +1700,24 @@ const startFromPoint = (index, event) => {
// //
const startDrawSelection = (event) => { const startDrawSelection = (event) => {
if ( if (
toolbarSwitchType.value !== 'createLineLibrary' && toolbarSwitchType.value === 'createLineLibrary' ||
toolbarSwitchType.value !== 'createRegion' && toolbarSwitchType.value === 'createRegion' ||
toolbarSwitchType.value !== 'drawRoute' && toolbarSwitchType.value === 'drawRoute' ||
toolbarSwitchType.value !== 'generateLine' toolbarSwitchType.value == 'generateLine'
) ) {
return 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 }
if (x >= 0 && x <= backgroundRect.width && y >= 0 && y <= backgroundRect.height) { state.drawSelectionAreaBox = { x: x, y: y, width: 0, height: 0 }
state.drawSelectionAreaShow = true }
state.drawSelectionStartPoint = { x: x, y: y } event.preventDefault() //
state.drawSelectionAreaBox = { x: x, y: y, width: 0, height: 0 }
} }
event.preventDefault() //
} }
// //
const updateDrawSelection = (event) => { const updateDrawSelection = (event) => {
@ -1741,7 +1739,6 @@ const updateDrawSelection = (event) => {
} }
} }
event.preventDefault() // event.preventDefault() //
return
} }
if (toolbarSwitchType.value === 'clickDrawRoute') { if (toolbarSwitchType.value === 'clickDrawRoute') {
// //
@ -1753,7 +1750,6 @@ const updateDrawSelection = (event) => {
state.currentDrawY = y state.currentDrawY = y
} }
event.preventDefault() // event.preventDefault() //
return
} }
} }
// //
@ -2473,6 +2469,8 @@ const getAllNodeList = async () => {
item.resizable = false item.resizable = false
item.rotatable = true item.rotatable = true
item.lockAspectRatio = true item.lockAspectRatio = true
item.locationDeep = 10
item.locationWide = 10
} }
//cmpx //cmpx