fix: 16771、16774、16719
This commit is contained in:
parent
66640fae5b
commit
02b367561b
|
@ -83,6 +83,9 @@ const handleOptions = (x = [], y = []) => {
|
||||||
const chart: any = chartRef.value;
|
const chart: any = chartRef.value;
|
||||||
if (chart) {
|
if (chart) {
|
||||||
const myChart = echarts.init(chart);
|
const myChart = echarts.init(chart);
|
||||||
|
const maxY: number = y.sort((a,b)=>{
|
||||||
|
return b-a
|
||||||
|
})?.[0]
|
||||||
const options = {
|
const options = {
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
|
@ -93,8 +96,8 @@ const handleOptions = (x = [], y = []) => {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
left: '80px',
|
left: maxY < 1000 ? 60 : maxY.toString().length * 10,
|
||||||
right: '50px',
|
right: '60px',
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
/>
|
/>
|
||||||
</j-col>
|
</j-col>
|
||||||
</j-row>
|
</j-row>
|
||||||
<j-row :gutter="24">
|
<j-row :gutter="24" style="margin-top: 24px;">
|
||||||
<j-col :span="24">
|
<j-col :span="24">
|
||||||
<Card />
|
<Card />
|
||||||
</j-col>
|
</j-col>
|
||||||
|
@ -26,14 +26,19 @@ import Card from './components/Card.vue';
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage } from '@/utils/comm';
|
||||||
import { queryCount } from '@/api/data-collect/dashboard';
|
import { queryCount } from '@/api/data-collect/dashboard';
|
||||||
import { defaultParams, statusData } from './tool';
|
import { defaultParams, statusData } from './tool';
|
||||||
|
import { useMenuStore } from '@/store/menu';
|
||||||
|
|
||||||
|
const menuPermission = useMenuStore().hasMenu;
|
||||||
|
|
||||||
const StatusData = ref(statusData);
|
const StatusData = ref(statusData);
|
||||||
const getNumberData = () => {
|
const getNumberData = () => {
|
||||||
StatusData.value.forEach(async (item: any) => {
|
StatusData.value.forEach(async (item: any) => {
|
||||||
const res = await queryCount(item[0].type, {});
|
if(menuPermission(item[0]?.permission)) {
|
||||||
const resp = await queryCount(item[0].type, defaultParams);
|
const res = await queryCount(item[0].type, {});
|
||||||
item[0].total = res?.result;
|
const resp = await queryCount(item[0].type, defaultParams);
|
||||||
item[0].value = resp?.result;
|
item[0].total = res?.result;
|
||||||
|
item[0].value = resp?.result;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
|
@ -39,13 +39,13 @@ const getParams = (dt: any) => {
|
||||||
};
|
};
|
||||||
} else if (time > days && time <= days * 7) {
|
} else if (time > days && time <= days * 7) {
|
||||||
return {
|
return {
|
||||||
limit: Math.abs(Math.ceil(time / days / 7)) + 1,
|
limit: Math.abs(Math.ceil(time / days)) + 1,
|
||||||
interval: '1d',
|
interval: '1d',
|
||||||
format: 'YYYY-MM-dd HH:mm',
|
format: 'YYYY-MM-dd HH:mm',
|
||||||
};
|
};
|
||||||
} else if (time >= year) {
|
} else if (time > days*90) {
|
||||||
return {
|
return {
|
||||||
limit: Math.abs(Math.ceil(time / days / 31)) + 1,
|
limit: Math.abs(Math.ceil(time / days / 30)) + 1,
|
||||||
interval: '1M',
|
interval: '1M',
|
||||||
format: 'YYYY-MM-dd HH:mm',
|
format: 'YYYY-MM-dd HH:mm',
|
||||||
};
|
};
|
||||||
|
@ -137,6 +137,7 @@ export const statusData = [
|
||||||
label: '通道数量',
|
label: '通道数量',
|
||||||
value: 0,
|
value: 0,
|
||||||
total: 0,
|
total: 0,
|
||||||
|
permission: 'DataCollect/Channel'
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@ -147,6 +148,7 @@ export const statusData = [
|
||||||
label: '采集器数量',
|
label: '采集器数量',
|
||||||
value: 0,
|
value: 0,
|
||||||
total: 0,
|
total: 0,
|
||||||
|
permission: 'DataCollect/Collector'
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@ -157,6 +159,7 @@ export const statusData = [
|
||||||
label: '采集点位',
|
label: '采集点位',
|
||||||
value: 0,
|
value: 0,
|
||||||
total: 0,
|
total: 0,
|
||||||
|
permission: 'DataCollect/Collector'
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
|
@ -26,7 +26,7 @@ const { jumpPage } = useMenuStore();
|
||||||
const projectNum = ref(0);
|
const projectNum = ref(0);
|
||||||
const deviceNum = ref(0);
|
const deviceNum = ref(0);
|
||||||
|
|
||||||
const menuPermission = useMenuStore().hasPermission;
|
const menuPermission = useMenuStore().hasMenu;
|
||||||
const getData = () => {
|
const getData = () => {
|
||||||
// 有产品菜单权限则获取数据
|
// 有产品菜单权限则获取数据
|
||||||
menuPermission('device/Product') &&
|
menuPermission('device/Product') &&
|
||||||
|
|
Loading…
Reference in New Issue