<template lang="html">
|
<div class="public-bounced map-background" v-drag v-show="flag">
|
<div class="public-bounced-title panel-title" ref="publicBounced">
|
<span>{{options.title}}</span>
|
<i class="el-icon-circle-close" @click="closePopup"></i>
|
</div>
|
<div class="public-bounced-content">
|
{{options.content}}
|
</div>
|
</div>
|
</template>
|
|
<script>
|
export default {
|
data () {
|
return {
|
moveLeft: 0, // 左移的距离
|
moveTop: 0, // 上移的距离
|
ismove: false
|
}
|
},
|
props: {
|
options: {
|
type: Object,
|
default: function () {
|
return {}
|
}
|
}
|
},
|
computed: {},
|
mounted () { },
|
methods: {
|
close: function (event) {
|
const mask = event.target.getAttribute('class')
|
if (mask && mask.indexOf('notify-mask') > -1) {
|
this.options.layer.close(this.options.id)
|
}
|
},
|
moveStart: function (event) {
|
this.options.offset = this.options.offset === 'auto' ? [] : this.options.offset
|
if (this.options.offset.length === 0) {
|
this.options.offset.push(document.getElementById(this.options.id + '_alert').offsetLeft)
|
this.options.offset.push(document.getElementById(this.options.id + '_alert').offsetTop)
|
this.options.offset.push(0)
|
}
|
if (this.options.offset.length === 2) {
|
this.options.offset.push(0)
|
}
|
this.options.offset[0] = (document.getElementById(this.options.id + '_alert').offsetLeft)
|
this.options.offset[1] = (document.getElementById(this.options.id + '_alert').offsetTop)
|
this.moveLeft = event.clientX
|
this.moveTop = event.clientY
|
this.ismove = true
|
},
|
move: function (event) {
|
if (this.ismove) {
|
const o = document.getElementById(this.options.id + '_alert')
|
o.style.left = this.options.offset[0] + (event.clientX - this.moveLeft) + 'px'
|
o.style.top = this.options.offset[1] + (event.clientY - this.moveTop) + 'px'
|
}
|
},
|
moveEnd: function () {
|
this.ismove = false
|
}
|
},
|
watch: {
|
|
},
|
components: {
|
|
}
|
}
|
</script>
|