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