智慧农业大数据平台
xiebin
2022-11-16 3dc278f10a4c3e3db7ce3a445bed710bdc88916e
src/components/timeLine/index.vue
@@ -468,10 +468,8 @@
    watch: {
        currentInd: {
            handler (newName, oldName) {
                if (newName == 0) {
                    this.$refs.TimePointer.style.left = 0 + 14 + 'px'
                    this.$refs.TextPopup.style.left = 0 - 38 + 'px'
                }
                this.$refs.TimePointer.style.left = parseInt(newName)*48+2 + 14 + 'px'
                this.$refs.TextPopup.style.left = parseInt(newName)*48+2 - 38 + 'px'
            }
        }
    },
@@ -544,11 +542,12 @@
            this.currentObj = item
            this.currentInd = index
            if (parseInt(this.$refs.mytimeline.style.left) < 0) {
                this.$refs.TimePointer.style.left = e.target.offsetLeft + parseInt(this.$refs.mytimeline.style.left) + 14 + 'px'
                this.$refs.TextPopup.style.left = e.target.offsetLeft + parseInt(this.$refs.mytimeline.style.left) - 38 + 'px'
            } else {
                if (e.target.offsetLeft <= 480) {
                    this.$refs.TimePointer.style.left = e.target.offsetLeft + 14 + 'px'
                    this.$refs.TextPopup.style.left = e.target.offsetLeft - 38 + 'px'