|
@@ -41,7 +41,14 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="row2">
|
|
|
- <div class="card"></div>
|
|
|
+ <div class="card">
|
|
|
+ <div class="title">
|
|
|
+ <span class="label">项目燃尽图</span>
|
|
|
+ </div>
|
|
|
+ <div class="chart-wrap">
|
|
|
+ <my-chart :options="options4"></my-chart>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -51,8 +58,16 @@
|
|
|
<script setup name="ProjectAnalysis">
|
|
|
import { ref, computed, onMounted, watch } from 'vue';
|
|
|
import { useRequest } from 'vue-request';
|
|
|
-import { createCakePieOption, createPercentBarOption } from '@/utils/chart';
|
|
|
-import { serviceServiceList, projectStageAnalysis } from '@/api/report';
|
|
|
+import {
|
|
|
+ createCakePieOption,
|
|
|
+ createPercentBarOption,
|
|
|
+ createLineOption,
|
|
|
+} from '@/utils/chart';
|
|
|
+import {
|
|
|
+ serviceServiceList,
|
|
|
+ projectStageAnalysis,
|
|
|
+ projectProcessAnalysis,
|
|
|
+} from '@/api/report';
|
|
|
const curTimeRange = ref([]);
|
|
|
const timeParams = computed(() => {
|
|
|
return {
|
|
@@ -85,10 +100,39 @@ const {
|
|
|
loading: loading3,
|
|
|
run: run3,
|
|
|
} = useRequest(projectStageAnalysis);
|
|
|
+const {
|
|
|
+ data: result4,
|
|
|
+ loading: loading4,
|
|
|
+ run: run4,
|
|
|
+} = useRequest(projectProcessAnalysis);
|
|
|
+const options4 = computed(() => {
|
|
|
+ let actual = result4?.actual || [];
|
|
|
+ let plan = result4?.plan || [];
|
|
|
+ let xData = Array.from(
|
|
|
+ new Set([
|
|
|
+ ...actual.filter((item) => item.datetime),
|
|
|
+ ...plan.filter((item) => item.datetime),
|
|
|
+ ])
|
|
|
+ );
|
|
|
+ xData.sort();
|
|
|
+ let data1 = actual.map((item) => {
|
|
|
+ return xData.includes(item.datetime) ? item.count : 0;
|
|
|
+ });
|
|
|
+ let data2 = plan.map((item) => {
|
|
|
+ return xData.includes(item.datetime) ? item.count : 0;
|
|
|
+ });
|
|
|
+ let sData = [
|
|
|
+ { name: '实际', data: data1 },
|
|
|
+ { name: '计划', data: data2 },
|
|
|
+ ];
|
|
|
+ return createLineOption({ xData, sData });
|
|
|
+});
|
|
|
+
|
|
|
watch(serviceId, (serviceId) => {
|
|
|
run1({ serviceId, group: 'REGION' });
|
|
|
run2({ serviceId, group: 'POPULATION' });
|
|
|
run3({ serviceId, group: 'SUPPLIER' });
|
|
|
+ run4({ serviceId });
|
|
|
});
|
|
|
const options1 = computed(() => {
|
|
|
let res = result1.value || {};
|
|
@@ -153,7 +197,7 @@ const options3 = computed(() => {
|
|
|
min-height: 600px;
|
|
|
min-width: 1000px;
|
|
|
.row1 {
|
|
|
- height: calc((100% - 16px) / 2);
|
|
|
+ height: calc(60% - 16px);
|
|
|
.card {
|
|
|
width: calc((100% - 30px) / 3);
|
|
|
height: 100%;
|
|
@@ -164,7 +208,7 @@ const options3 = computed(() => {
|
|
|
}
|
|
|
.row2 {
|
|
|
margin-top: 15px;
|
|
|
- height: calc((100% - 16px) / 2);
|
|
|
+ height: 40%;
|
|
|
.card {
|
|
|
height: 100%;
|
|
|
}
|