Vue.component('security-check-node', {
template:`
{{i<10?'0'+(i+1):(i+1)}}
{{item.project_name}}
节点名称:
计划完成时间:
剩余天数:
{{item.node_days}}
`,
props: {
data:{
type:Array
}
},
data() {
return {
srcList:[],
index:0,
interval:'',
};
},
mounted(){
this.init()
},
created() {
},
methods: {
init(){
if(this.data.length > 3){
this.interval = setInterval(this.scrollRoll, 5000);
this.index = 0
}
},
imagesAmplify(arr){
this.srcList = arr
},
scrollRoll(){
var height = this.$refs.min[0].clientHeight;
if(this.index == this.data.length - 2){
this.$refs.max.scrollTop = 0
this.index = 0
}else{
this.index+=1
}
$(this.$refs.max).animate({scrollTop:(height * this.index)+'px'})
},
mouseEnter() {//鼠标移入停止滚动
clearInterval(this.interval);
},
mouseLeave() {//鼠标离开继续滚动
if(this.data.length > 3) {
this.interval = setInterval(this.scrollRoll, 5000);
}
},
onWorkOrderTitle(e){
this.$emit('item',e);
}
},
watch:{
data:function () {
this.init()
}
}
})