var vms = Vue.component("amplify-gczljdagl", {
template: `
`,
props: {
projectid:{
type:Number
},
label:{
type:String
}
},
data() {
return {
projectId:JSON.parse(window.localStorage.getItem("data")).id,
show:false,
height:515,
data:{
label: [
{
label: '序号',
width: '50',
color:'',
type:'',
type_color:'',
data: 'sort'
},
{
label: '楼号名称',
width: '',
color:'#50a2eb',
type:'',
type_color:'',
data: 'dict_label'
},
{
label: '检验批类型',
width: '',
color:'',
type:'',
type_color:'',
data: 'ledgerType'
},
{
label: '检验次数',
width: '',
color:'',
type:'',
type_color:'',
data: 'num'
},
],
data: [{GCsort:'1',GCName:'****名称',GCNum:'2023-05-13',type:''},{GCsort:'1',GCName:'****名称',GCNum:'2023-05-13'},{GCsort:'1',GCName:'****名称',GCNum:'2023-05-13'},{GCsort:'1',GCName:'****名称',GCNum:'2023-05-13'},{GCsort:'1',GCName:'****名称',GCNum:'2023-05-13'},{GCsort:'1',GCName:'****名称',GCNum:'2023-05-13'},{GCsort:'1',GCName:'****名称',GCNum:'2023-05-13'},{GCsort:'1',GCName:'****名称',GCNum:'2023-05-13'},{GCsort:'1',GCName:'****名称',GCNum:'2023-05-13'},{GCsort:'1',GCName:'****名称',GCNum:'2023-05-13'},{GCsort:'1',GCName:'****名称',GCNum:'2023-05-13'}],
},
}
},
mounted(){
this.interval = setInterval(this.scroll, 50);
},
methods: {
openAmplify(){
this.show = true
this.gainFloorCheck()
},
closeAmplify(){
this.show = false
},
closeAmplifyAll(e){
if(e.target.className == 'amplify-fixed'){
this.show = false
}
},
gainFloorCheck() {
this.data.data = []
axios.post("/api/building/gainFloorCheck",{projectId:this.projectid}).then(res=>{
this.data.data = res.data.data
})
},
//左边信息表
scroll() {
let maxHeight = this.$refs.pxjy.$el.querySelectorAll('.el-table__body')[0].offsetHeight;
let clientHeight = this.$refs.pxjy.bodyWrapper.clientHeight;
if (Math.abs(this.$refs.pxjy.bodyWrapper.scrollTop - (maxHeight - clientHeight)) < 5) { //预留5像素误差
this.$refs.pxjy.bodyWrapper.scrollTop = 0;
} else {
this.$refs.pxjy.bodyWrapper.scrollTop += 1;//32是每一行表格的高度,每秒滚一行
}
}
,
MouseEnter() {//鼠标移入停止滚动
clearInterval(this.interval);
}
,
MouseLeave() {//鼠标离开继续滚动
this.interval = setInterval(this.scroll, 50);
},
onClickPoint(n) {
this.btnNav = n;
},
// 表格隔行变色
tableRowClassName({row, rowIndex}) {
if (rowIndex % 2 === 0) {
return 'warning-row' //这是类名
} else {
return ''
}
},
},
watch:{
projectId:function (n,o) {
this.openAmplify()
}
},
})