fix: 处理额外子路由

fix: 处理额外子路由
This commit is contained in:
XieYongHong 2023-07-26 13:56:40 +08:00 committed by GitHub
parent 49cf7c5594
commit f2514fce8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 12 deletions

View File

@ -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
}))
}

View File

@ -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',

View File

@ -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(() => {

View File

@ -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'
},
],
];

View File

@ -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') &&