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({});
}
});
},
}