/**
* 顶部header
*/
Vue.component("tower-crane-value-1", {
template: `
`,
props: {
value:{
type:Object
},
width:{
type:Number
},
height:{
type:Number
},
top:{
type:Number
},
left:{
type:Number
},
tHeight:{
type:String
},
tLoad:{
type:String
},
tRotation:{
type:String
},
tRange:{
type:String
},
tLeanAngleX:{
type:String
},
tLeanAngleY:{
type:String
},
tLoadPercent:{
type:String
},
tMomentPercent:{
type:String
},
},
data() {
return {
}
},
mounted(){
//this.animation()
},
methods: {
animation(){
var leftValue = this.tRange //幅度
var brachium = this.value.frontBrachium //臂长 //定制
leftValue = leftValue < 0 ? 0 : leftValue
var left = leftValue / brachium * 100
var heightValue = this.tHeight //高度
var towerHeight = this.towerBodyHeight //塔身高度
var height = (towerHeight - heightValue) * this.height / towerHeight
height = height > this.height ? this.height : height
var value = Number(this.tLeanAngleX) //角度
var degValue = -value
setTimeout(function () {
$("#slider").animate({left:left+'%'},1000);
$("#dot").animate({left:left+'%'},1000);
$("#needle").css("transform","rotate("+degValue+"deg)")
setTimeout(function () {
$("#towrope").animate({height:height+'px'},1000);
},1000)
},1000)
},
},
watch:{
value:function () {
this.animation()
},
tHeight:function () {
this.animation()
},
tLoad:function () {
this.animation()
},
tRotation:function () {
this.animation()
},
tRange:function () {
this.animation()
},
tLeanAngleX:function () {
this.animation()
},
tLeanAngleY:function () {
this.animation()
},
tLoadPercent:function () {
this.animation()
},
tMomentPercent:function () {
this.animation()
},
}
})