设备添加bug修改
This commit is contained in:
parent
6ea7dfb634
commit
12739441d6
@ -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
|
||||||
|
@ -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([])
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
//要将实际的cm改成px
|
//要将实际的cm改成px
|
||||||
|
Loading…
Reference in New Issue
Block a user