Compare commits
2 Commits
4b54062344
...
9cc9c1f7d1
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9cc9c1f7d1 | ||
![]() |
f84aa678a6 |
@ -37,6 +37,9 @@
|
|||||||
>
|
>
|
||||||
<el-input-number v-model="form.layersNumber" :min="1" :max="3" />
|
<el-input-number v-model="form.layersNumber" :min="1" :max="3" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="排序" prop="locationNumber" v-if="form.type === 2" required>
|
||||||
|
<el-input-number v-model="form.locationNumber" :min="1" :max="10000000" />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="编号"
|
label="编号"
|
||||||
prop="deviceId"
|
prop="deviceId"
|
||||||
@ -236,7 +239,6 @@ const submit = async (formEl) => {
|
|||||||
|
|
||||||
const equipmentList = ref([]) //用过的设备列表
|
const equipmentList = ref([]) //用过的设备列表
|
||||||
const open = (item, list) => {
|
const open = (item, list) => {
|
||||||
console.log(item)
|
|
||||||
form.value = item
|
form.value = item
|
||||||
form.value.layersNumber = item.dataList.length || ''
|
form.value.layersNumber = item.dataList.length || ''
|
||||||
form.value.deviceId = item?.deviceId || item?.dataObj?.id || ''
|
form.value.deviceId = item?.deviceId || item?.dataObj?.id || ''
|
||||||
@ -273,6 +275,10 @@ const typeChange = () => {
|
|||||||
form.value.locationDeep = 30
|
form.value.locationDeep = 30
|
||||||
form.value.locationWide = 30
|
form.value.locationWide = 30
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (form.value.type !== 2) {
|
||||||
|
form.value.locationNumber = null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//设备切换
|
//设备切换
|
||||||
const deviceChange = (deviceId) => {
|
const deviceChange = (deviceId) => {
|
||||||
|
@ -493,7 +493,7 @@
|
|||||||
textAlign: 'center'
|
textAlign: 'center'
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
距离:{{ state.measureDistancesNum.toFixed(2) }}</div
|
距离:{{ state.measureDistancesNum.toFixed(2) }}米</div
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -687,6 +687,8 @@ const activatedHandle = (item, index) => {
|
|||||||
if (toolbarSwitchType.value === 'editNode') {
|
if (toolbarSwitchType.value === 'editNode') {
|
||||||
let list = state.allMapPointInfo.filter((item) => item.type === 3)
|
let list = state.allMapPointInfo.filter((item) => item.type === 3)
|
||||||
editNodePropertiesRef.value.open(JSON.parse(JSON.stringify(item)), list)
|
editNodePropertiesRef.value.open(JSON.parse(JSON.stringify(item)), list)
|
||||||
|
//取消监听键盘事件
|
||||||
|
window.removeEventListener('keydown', handleKeyDown)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//非选中
|
//非选中
|
||||||
@ -848,6 +850,8 @@ const submitNodeSuccess = (form) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
addEditHistory()
|
addEditHistory()
|
||||||
|
//重新监听键盘事件
|
||||||
|
window.addEventListener('keydown', handleKeyDown)
|
||||||
}
|
}
|
||||||
|
|
||||||
//工具栏点击
|
//工具栏点击
|
||||||
@ -1770,6 +1774,8 @@ const handleEditRoute = (item, index) => {
|
|||||||
state.currentDragTarget.index = index
|
state.currentDragTarget.index = index
|
||||||
state.selectedCurve = item
|
state.selectedCurve = item
|
||||||
editMapRouteDialogRef.value.open(JSON.parse(JSON.stringify(item)))
|
editMapRouteDialogRef.value.open(JSON.parse(JSON.stringify(item)))
|
||||||
|
//取消监听键盘事件
|
||||||
|
window.removeEventListener('keydown', handleKeyDown)
|
||||||
}
|
}
|
||||||
//单击 选中
|
//单击 选中
|
||||||
const handleChooseRoute = (item, index) => {
|
const handleChooseRoute = (item, index) => {
|
||||||
@ -1819,9 +1825,9 @@ const editMapRouteDialogSubmit = (form) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
//增加一条历史记录
|
//增加一条历史记录
|
||||||
addEditHistory()
|
addEditHistory() //重新监听键盘事件
|
||||||
|
window.addEventListener('keydown', handleKeyDown)
|
||||||
}
|
}
|
||||||
|
|
||||||
//测距相关
|
//测距相关
|
||||||
// 计算两点之间的距离
|
// 计算两点之间的距离
|
||||||
const calculateDistance = (point1, point2) => {
|
const calculateDistance = (point1, point2) => {
|
||||||
@ -1829,7 +1835,6 @@ const calculateDistance = (point1, point2) => {
|
|||||||
const dy = point2.y - point1.y
|
const dy = point2.y - point1.y
|
||||||
return Math.sqrt(dx * dx + dy * dy)
|
return Math.sqrt(dx * dx + dy * dy)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算连线的角度
|
// 计算连线的角度
|
||||||
const computedLineAngle = computed(() => {
|
const computedLineAngle = computed(() => {
|
||||||
if (state.measureDistancesPoints.length === 2) {
|
if (state.measureDistancesPoints.length === 2) {
|
||||||
@ -1867,10 +1872,11 @@ const measureDistancesClick = (event) => {
|
|||||||
state.measureDistancesPoints.push({ x: offsetX, y: offsetY })
|
state.measureDistancesPoints.push({ x: offsetX, y: offsetY })
|
||||||
if (state.measureDistancesPoints.length === 2) {
|
if (state.measureDistancesPoints.length === 2) {
|
||||||
// 计算两点之间的距离
|
// 计算两点之间的距离
|
||||||
state.measureDistancesNum = calculateDistance(
|
let distancesNum = calculateDistance(
|
||||||
state.measureDistancesPoints[0],
|
state.measureDistancesPoints[0],
|
||||||
state.measureDistancesPoints[1]
|
state.measureDistancesPoints[1]
|
||||||
)
|
)
|
||||||
|
state.measureDistancesNum = distancesNum * 0.05
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2129,27 +2135,27 @@ window.document.oncontextmenu = function () {
|
|||||||
//监听键盘事件
|
//监听键盘事件
|
||||||
const handleKeyDown = (event) => {
|
const handleKeyDown = (event) => {
|
||||||
if (event.ctrlKey) {
|
if (event.ctrlKey) {
|
||||||
// if (event.key === 'c') {
|
if (event.key === 'c') {
|
||||||
// //复制
|
//复制
|
||||||
// if (state.currentItemIndex === -1) {
|
if (state.currentItemIndex === -1) {
|
||||||
// message.warning('请先选择要操作的对象')
|
message.warning('请先选择要操作的对象')
|
||||||
// return
|
return
|
||||||
// }
|
}
|
||||||
// replicationNode()
|
replicationNode()
|
||||||
// } else if (event.key === 'v') {
|
} else if (event.key === 'v') {
|
||||||
// //粘贴
|
//粘贴
|
||||||
// if (!state.copyMapItem) {
|
if (!state.copyMapItem) {
|
||||||
// message.warning('请先复制对象')
|
message.warning('请先复制对象')
|
||||||
// return
|
return
|
||||||
// }
|
}
|
||||||
// pasteNode()
|
pasteNode()
|
||||||
// } else if (event.key === 'z') {
|
} else if (event.key === 'z') {
|
||||||
// //撤回
|
//撤回
|
||||||
// backPreviousStep()
|
backPreviousStep()
|
||||||
// } else if (event.key === 'y') {
|
} else if (event.key === 'y') {
|
||||||
// //重写
|
//重写
|
||||||
// backNextStep()
|
backNextStep()
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user