|
@@ -104,12 +104,17 @@ export default {
|
|
const res = await requirementStatisticsRadar({
|
|
const res = await requirementStatisticsRadar({
|
|
cultureProgramId: this.rowData.cultureProgramId,
|
|
cultureProgramId: this.rowData.cultureProgramId,
|
|
});
|
|
});
|
|
- this.dataList = res.obeRequirements || [];
|
|
|
|
|
|
+ this.dataList = res?.obeRequirements || [];
|
|
this.updateChartOption();
|
|
this.updateChartOption();
|
|
},
|
|
},
|
|
updateChartOption() {
|
|
updateChartOption() {
|
|
|
|
+ if (!this.dataList.length) {
|
|
|
|
+ this.chartOption = null;
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
const vals = this.dataList
|
|
const vals = this.dataList
|
|
- .map((item) => [item.expectValue, item.matrixDegree])
|
|
|
|
|
|
+ .map((item) => [item.expectValue || 0, item.matrixDegree || 0])
|
|
.flat();
|
|
.flat();
|
|
const maxVal = Math.min(maxNum(vals) * 1.2, 1);
|
|
const maxVal = Math.min(maxNum(vals) * 1.2, 1);
|
|
const option = {
|
|
const option = {
|
|
@@ -145,11 +150,11 @@ export default {
|
|
type: "radar",
|
|
type: "radar",
|
|
data: [
|
|
data: [
|
|
{
|
|
{
|
|
- value: this.dataList.map((item) => item.expectValue),
|
|
|
|
|
|
+ value: this.dataList.map((item) => item.expectValue || 0),
|
|
name: "预期值",
|
|
name: "预期值",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- value: this.dataList.map((item) => item.matrixDegree),
|
|
|
|
|
|
+ value: this.dataList.map((item) => item.matrixDegree || 0),
|
|
name: "实际值",
|
|
name: "实际值",
|
|
},
|
|
},
|
|
],
|
|
],
|