表格少于十行用空白行填补

 

 

data(){
	return{
		url: {
        	query: "/pMonitorLedger/monitorList", //查询接口
		},
		treeData: [], //电站/线路/台区数据
		queryParams: {
        page: 1,
        limit: 10,
        name: undefined, //监测点编号/姓名
        province: undefined, //省公司
        city: undefined, //地市公司
        organizationId: undefined, //运维单位
        monitorType: undefined, //监测点类别
        powerStationId: undefined, //所属电站
        lineId: undefined, //所属线路
        platformId: undefined, //所属台区
        monitorObjectId: undefined, //监测对象编号
        monitorObjectName: undefined, //监测对象名称
        monitorCode: undefined, //监测点编号
        monitorName: undefined, //监测点名称
        voltageLevel: undefined, //监测点电压等级
        monitorStatus: undefined, //监测点状态
        createdDate: new Date().getFullYear()+'-'+((new Date().getMonth()+1)>=10?(new Date().getMonth()+1):('0'+(new Date().getMonth()+1)))+'-'+((new Date().getDate()-1)>=10?(new Date().getDate()-1):('0'+(new Date().getDate()-1)))//建档日期
      },
	}
}
methods:{
	//查询列表
    getList() {
      https(this.url.query, this.queryParams).then((res) => {
        this.tableData = res.data.list;
        console.log(this.tableData);
        this.total = res.data.total;
        this.tableData.forEach((item) => {
          item.monitorStatus =
            item.monitorStatus === "01"
              ? "运行"
              : item.monitorStatus === "02"
              ? "检修"
              : item.monitorStatus === "03"
              ? "调试"
              : "故障";
        });
        if (res.data.list.length >= 10) {
          return false;
        }
        let line = this.queryParams.limit - parseInt(res.data.list.length);
        for (var i = 0; i < line; i++) {
          this.tableData.push({});
        }
      });
    },
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值