80 lines
2.8 KiB
JavaScript
80 lines
2.8 KiB
JavaScript
Vue.component('security-check-skill', {
|
|
template:`
|
|
<div class="plan-max" ref="max" @mouseover="mouseEnter" @mouseout="mouseLeave">
|
|
<div class="plan-list-for" ref="min" v-for="(item,i) in data">
|
|
<div class="plan-list-min">
|
|
<div class="plan-list-title-max">
|
|
<div class="plan-list-title" @click="onWorkOrderTitle(item)">
|
|
<div class="xhz-order-number" v-cloak>{{i<10?'0'+(i+1):(i+1)}}</div>
|
|
<div class="xhz-job-number plan-list-name" v-cloak>{{item.project_name}}</div>
|
|
</div>
|
|
<div v-if="item.state == 1" class="warning-popup-color-red">未通过</div>
|
|
<div v-if="item.state == 2" class="people-info-action">通过</div>
|
|
</div>
|
|
<div style="padding: 10px;">
|
|
<div class="plan-list-con">变更名称:<span class="popup-color" v-cloak>{{item.change_name}}</span></div>
|
|
<div class="plan-list-flex">
|
|
<div class="plan-list-flex-title">变更内容:</div>
|
|
<div class="plan-list-flex-con warning-popup-color-silvery">{{item.change_content}}</div>
|
|
</div>
|
|
<div class="plan-list-con">变更发起时间:<span class="warning-popup-color-silvery" v-cloak>{{item.change_time}}</span></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`,
|
|
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);
|
|
}
|
|
},
|
|
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 = 1
|
|
}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()
|
|
}
|
|
}
|
|
}) |