|
@@ -29,7 +29,7 @@
|
|
import { fetchSbPosition } from '@/api/sb/position'
|
|
import { fetchSbPosition } from '@/api/sb/position'
|
|
export default {
|
|
export default {
|
|
name: 'PointModal',
|
|
name: 'PointModal',
|
|
- data() {
|
|
|
|
|
|
+ data () {
|
|
return {
|
|
return {
|
|
confirmLoading: false,
|
|
confirmLoading: false,
|
|
modalTitle: null,
|
|
modalTitle: null,
|
|
@@ -37,15 +37,15 @@ export default {
|
|
y: null,
|
|
y: null,
|
|
visible: false,
|
|
visible: false,
|
|
record: {},
|
|
record: {},
|
|
- url: null,
|
|
|
|
|
|
+ url: null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
props: {},
|
|
props: {},
|
|
- created() {
|
|
|
|
|
|
+ created () {
|
|
// 下拉框map
|
|
// 下拉框map
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- base(record) {
|
|
|
|
|
|
+ base (record) {
|
|
this.visible = true
|
|
this.visible = true
|
|
// 如果是空标识添加
|
|
// 如果是空标识添加
|
|
this.modalTitle = '选择点位'
|
|
this.modalTitle = '选择点位'
|
|
@@ -53,35 +53,35 @@ export default {
|
|
this.y = record.jbdh
|
|
this.y = record.jbdh
|
|
this.record = record
|
|
this.record = record
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
- this.$refs.point.style.left = this.x + 'px'
|
|
|
|
- this.$refs.point.style.top = this.y + 'px'
|
|
|
|
|
|
+ this.$refs.point.style.left = `calc(${this.x}% - 5px)`
|
|
|
|
+ this.$refs.point.style.top = `calc(${this.y}% - 5px)`
|
|
fetchSbPosition({ id: record.positionId }).then((res) => {
|
|
fetchSbPosition({ id: record.positionId }).then((res) => {
|
|
this.url = res.data.opcImg
|
|
this.url = res.data.opcImg
|
|
})
|
|
})
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- save() {
|
|
|
|
|
|
+ save () {
|
|
this.$emit('ok', {
|
|
this.$emit('ok', {
|
|
zjm: this.x,
|
|
zjm: this.x,
|
|
- jbdh: this.y,
|
|
|
|
|
|
+ jbdh: this.y
|
|
})
|
|
})
|
|
this.visible = false
|
|
this.visible = false
|
|
},
|
|
},
|
|
- handleSelectPoint(e) {
|
|
|
|
- this.x = e.layerX
|
|
|
|
- this.y = e.layerY
|
|
|
|
- this.$refs.point.style.left = this.x + 'px'
|
|
|
|
- this.$refs.point.style.top = this.y + 'px'
|
|
|
|
|
|
+ handleSelectPoint (e) {
|
|
|
|
+ this.x = +(e.offsetX * 100 / e.target.width).toFixed(2)
|
|
|
|
+ this.y = +(e.offsetY * 100 / e.target.height).toFixed(2)
|
|
|
|
+ this.$refs.point.style.left = e.offsetX - 5 + 'px'
|
|
|
|
+ this.$refs.point.style.top = e.offsetY - 5 + 'px'
|
|
},
|
|
},
|
|
- handleCancel(values) {
|
|
|
|
|
|
+ handleCancel (values) {
|
|
this.visible = false
|
|
this.visible = false
|
|
this.$emit('ok')
|
|
this.$emit('ok')
|
|
this.x = null
|
|
this.x = null
|
|
this.y = null
|
|
this.y = null
|
|
this.record = null
|
|
this.record = null
|
|
this.confirmLoading = false
|
|
this.confirmLoading = false
|
|
- },
|
|
|
|
- },
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|