fix: 修改hfqc的大屏页面

This commit is contained in:
Vce 2024-03-30 20:38:43 +08:00
parent 87bb410c27
commit dfe940feb7
5 changed files with 43 additions and 21 deletions

View File

@ -436,12 +436,17 @@ const getEnterpriseInfoList = async () => {
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10
}); });
console.log("获取劳务班组公司数据1", res); if(res.result.total !== '0'){
noiseList.value = res.result.records; console.log("获取劳务班组公司数据1", res);
valueName.value = res.result.records[0].enterpriseName; noiseList.value = res.result.records;
enterpriseId.value = res.result.records[0].id; valueName.value = res.result.records[0].enterpriseName;
getList(enterpriseId.value); enterpriseId.value = res.result.records[0].id;
mitts.emit("enterpriseId", enterpriseId.value); getList(enterpriseId.value);
mitts.emit("enterpriseId", enterpriseId.value);
}else{
mitts.emit("enterpriseId", '无数据');
}
}; };
// //
const realTimeMonitor = val => { const realTimeMonitor = val => {

View File

@ -221,20 +221,26 @@ const getList = async val => {
} }
} else { } else {
console.log("没有数据"); console.log("没有数据");
xData.value = []; xData.value = [0];
yData.value = []; yData.value = [0];
} }
// console.log("2", res); // console.log("2", res);
horizontalChart(); horizontalChart();
}; };
onMounted(async () => { onMounted(async () => {
mitts.on("enterpriseId", e => { mitts.on("enterpriseId", e => {
// horizontalEcharts = echarts.init(document.getElementById('chart-view')) if(e !== '无数据' ){
// // horizontalEcharts = echarts.init(document.getElementById('chart-view'))
xData.value = []; //
yData.value = []; xData.value = [];
getList(e); yData.value = [];
}); getList(e);
}else{
xData.value = [0];
yData.value = [0];
horizontalChart();
}
})
}); });
// //
onBeforeUnmount(async () => { onBeforeUnmount(async () => {

View File

@ -191,7 +191,8 @@ async function getProjectWorkerList() {
let res = await getComapnyWorkTotalListApi({ let res = await getComapnyWorkTotalListApi({
projectSn: store.sn projectSn: store.sn
}); });
if (res.result) { if(res.result.length !== 0){
if (res.result) {
res.result.forEach((item: any) => { res.result.forEach((item: any) => {
companyWorkTotalData.value.push(item); companyWorkTotalData.value.push(item);
xData.value.push(item.enterpriseName); xData.value.push(item.enterpriseName);
@ -199,6 +200,12 @@ async function getProjectWorkerList() {
}); });
getNowData(1); getNowData(1);
} }
} else {
companyWorkTotalData.value.push(0);
xData.value.push('无数据');
yData.value.push(0);
draw(xData.value, yData.value)
}
} }
</script> </script>

View File

@ -37,9 +37,11 @@
</div> </div>
</div> </div>
</div> </div>
<div class="notoDta" v-else> <div class="content" v-else>
<img src="@/assets/images/noData.png" alt="" /> <div class="notoDta" >
<p>暂无数据</p> <img src="@/assets/images/noData.png" alt="" />
<p>暂无数据</p>
</div>
</div> </div>
</div> </div>
</template> </template>

View File

@ -37,9 +37,11 @@
</div> </div>
</div> </div>
</div> </div>
<div class="notoDta" v-else> <div class="content" v-else>
<img src="@/assets/images/noData.png" alt="" /> <div class="notoDta" >
<p>暂无数据</p> <img src="@/assets/images/noData.png" alt="" />
<p>暂无数据</p>
</div>
</div> </div>
</div> </div>
</template> </template>