import Vue from 'vue' var vms = Vue.component("amplify-kjcx", { template: `
`, props: { }, data() { return { show:false, //科技创新 sciencelnnovateDataList:[], craftVideoIndex:0, craftInterval:'', } }, mounted(){ //科技创新 知道滚动 this.rollCraftInterval = setInterval(this.rollCraftCarousel,5000); }, methods: { openAmplify(){ this.show = true this.scienceInnovateData() }, closeAmplify(){ this.show = false }, closeAmplifyAll(e){ if(e.target.className == 'amplify-fixed'){ this.show = false } }, //科技创新 scienceInnovateData(){ axios.post("/system/scienceInnovateConfig/list1",{pageNum:1,pageSize:9999,projectId:this.projectId}).then(res=>{ let result = res.data let tempData = [] this.sciencelnnovateDataList = [] let tmp = {} if(result.code == 0){ result.rows.forEach(item=>{ if(!tmp[item.name]){ tmp[item.name] = { name:item.name, context:[] } } if(item.type == '0'){ name = '研究报告' }else if(item.type == '1'){ name = '知识产权' }else if(item.type == '2'){ name = '论文' }else{ name = '工法' } if(item.status =='0'){ status = '进行中' }else if(item.status =='1'){ status = '已完成' }else if(item.status =='4'){ status = '' }else{ status = '未开始' } tmp[item.name] .context.push({ name, status }) }) for(let k in tmp ){ this.sciencelnnovateDataList.push(tmp[k]) } } }) }, craftCarouselLeft(){ if(this.craftVideoIndex == 0){ this.craftVideoIndex = this.sciencelnnovateDataList.length - 1 }else { this.craftVideoIndex = this.craftVideoIndex - 1 } $(this.$refs.craftVollVideo).animate({scrollLeft:(760*this.craftVideoIndex)+'px'}) }, craftCarouselRight(){ if(this.craftVideoIndex == this.sciencelnnovateDataList.length - 1){ this.craftVideoIndex = 0 }else { this.craftVideoIndex = this.craftVideoIndex + 1 } $(this.$refs.craftVollVideo).animate({scrollLeft:(760*this.craftVideoIndex)+'px'}) }, rollCraftCarousel(){ if(this.craftDirection == 'right'){ if(this.craftVideoIndex == this.sciencelnnovateDataList.length - 1){ this.craftVideoIndex = 0 }else { this.craftVideoIndex = this.craftVideoIndex + 1 } }else{ if(this.craftVideoIndex == 0){ this.craftVideoIndex = this.sciencelnnovateDataList.length - 1 }else { this.craftVideoIndex = this.craftVideoIndex - 1 } this.craftDirection = 'right' } $(this.$refs.craftVollVideo).animate({scrollLeft:(760*this.craftVideoIndex)+'px'}) }, craftCostMouseout(){ clearInterval(this.rollCraftInterval); }, craftCostMouseover(){ this.rollCraftInterval = setInterval(this.rollCraftCarousel,5000); }, }, watch:{ }, })