feat:【antd】【erp 系统】home 界面的代码优化
This commit is contained in:
@@ -5,8 +5,8 @@ import { DocAlert, Page } from '@vben/common-ui';
|
|||||||
|
|
||||||
import { Col, Row, Spin } from 'ant-design-vue';
|
import { Col, Row, Spin } from 'ant-design-vue';
|
||||||
|
|
||||||
import SummaryCard from './components/SummaryCard.vue';
|
import SummaryCard from './modules/SummaryCard.vue';
|
||||||
import TimeSummaryChart from './components/TimeSummaryChart.vue';
|
import TimeSummaryChart from './modules/TimeSummaryChart.vue';
|
||||||
|
|
||||||
/** ERP首页 */
|
/** ERP首页 */
|
||||||
defineOptions({ name: 'ErpHome' });
|
defineOptions({ name: 'ErpHome' });
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ const props = withDefaults(defineProps<Props>(), {
|
|||||||
});
|
});
|
||||||
|
|
||||||
/** 概览数据 */
|
/** 概览数据 */
|
||||||
// TODO @nehc:应该是有 8 个小卡片,少了 4 个?
|
|
||||||
const overviewItems = computed<AnalysisOverviewItem[]>(() => [
|
const overviewItems = computed<AnalysisOverviewItem[]>(() => [
|
||||||
{
|
{
|
||||||
icon: SvgCardIcon,
|
icon: SvgCardIcon,
|
||||||
@@ -123,11 +123,9 @@ watch(
|
|||||||
if (!val || val.length === 0) {
|
if (!val || val.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新图表数据
|
// 更新图表数据
|
||||||
const xAxisData = val.map((item) => item.time);
|
const xAxisData = val.map((item) => item.time);
|
||||||
const seriesData = val.map((item) => item.price);
|
const seriesData = val.map((item) => item.price);
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
...lineChartOptions,
|
...lineChartOptions,
|
||||||
xAxis: {
|
xAxis: {
|
||||||
@@ -141,7 +139,6 @@ watch(
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
renderEcharts(options);
|
renderEcharts(options);
|
||||||
},
|
},
|
||||||
{ immediate: true },
|
{ immediate: true },
|
||||||
@@ -151,14 +148,6 @@ watch(
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
initData();
|
initData();
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 暴露数据给父组件使用 */
|
|
||||||
defineExpose({
|
|
||||||
saleSummary,
|
|
||||||
purchaseSummary,
|
|
||||||
saleTimeSummaryList,
|
|
||||||
purchaseTimeSummaryList,
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
Reference in New Issue
Block a user