设备添加bug修改
This commit is contained in:
parent
6ea7dfb634
commit
12739441d6
@ -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
|
||||
|
@ -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([])
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user