fix: 产品仪表盘和上传bug

This commit is contained in:
leiqiaochu 2023-03-15 17:09:38 +08:00
parent c830357640
commit 27cd241bee
2 changed files with 13 additions and 7 deletions

View File

@ -22,12 +22,8 @@
><TopCard
title="当前在线"
:footer="onlineFooter"
:value="onlineToday"
:value="deviceOnline"
>
<!-- <BarChart
:chartXData="barChartXData"
:chartYData="barChartYData"
></BarChart> -->
<Charts :options="onlineOptions"></Charts> </TopCard
></j-col>
<j-col :span="6"
@ -140,6 +136,9 @@ const quickBtnList = [
{ label: '近一月', value: 'month' },
{ label: '近一年', value: 'year' },
];
/**
* 获取产品数量
*/
const getProductData = () => {
if (menuStore.hasMenu('device/Product')) {
productCount().then((res) => {
@ -174,6 +173,9 @@ const getProductData = () => {
}
};
getProductData();
/**
* 获取设备数量
*/
const getDeviceData = () => {
if (menuStore.hasMenu('device/Instance')) {
deviceCount().then((res) => {
@ -197,6 +199,9 @@ const getDeviceData = () => {
}
};
getDeviceData();
/**
* 获取在线数量
*/
const getOnline = () => {
dashboard([
{
@ -222,7 +227,8 @@ const getOnline = () => {
const onlineYdata = y;
onlineYdata.reverse();
setOnlineChartOpition(x, onlineYdata);
deviceFooter.value[0].value = y?.[1];
onlineFooter.value[0].value = y?.[1];
console.log(res.result);
}
});
};

View File

@ -23,7 +23,7 @@
<j-row type="flex">
<j-col flex="180px">
<j-form-item name="photoUrl">
<JUpload v-model="form.photoUrl" />
<Upload v-model="form.photoUrl" />
</j-form-item>
<!-- <j-form-item>
<div class="upload-image-warp-logo">