Explorar o código

build: 看板图表样式bugfix

chaooo %!s(int64=2) %!d(string=hai) anos
pai
achega
c68742be68

+ 15 - 13
src/views/charts-components/RadarChart.vue

@@ -24,7 +24,8 @@ const props = defineProps({
     type: String,
     default: "300px",
   },
-  // dataSets:[[28,38,45,32,25],[78,88,65,82,65]]
+  // dataSets:[[训练后],[训练前]]
+  // dataSets:[[78,88,65,82,65],[28,38,45,32,25]]
   dataSets: {
     type: Array,
     default: [] as Array<number>,
@@ -41,14 +42,15 @@ const props = defineProps({
 });
 // 是否有对比数据
 const isCompare = props.dataSets?.length > 1;
-let defaultData;
-let beforeData;
-if (isCompare) {
-  defaultData = toRefs(props.dataSets?.[1]);
-  beforeData = toRefs(props.dataSets?.[0]);
-} else {
-  defaultData = toRefs(props.dataSets?.[0]);
-}
+
+// let defaultData;
+// let beforeData;
+// if (isCompare) {
+//   defaultData = props.dataSets?.[1];
+//   beforeData = props.dataSets?.[0];
+// } else {
+//   defaultData = props.dataSets?.[0];
+// }
 
 const globalColor = {
   default: "#ffb72d",
@@ -189,7 +191,7 @@ const options = {
         distance: 5,
       },
       lineStyle: { width: 0 },
-      data: positionFormatter(defaultData),
+      data: positionFormatter(props.dataSets?.[0]),
     },
     // 覆盖区域的样式
     {
@@ -198,7 +200,7 @@ const options = {
       symbolSize: 5,
       data: [
         {
-          value: defaultData,
+          value: props.dataSets?.[0],
           name: "训练后",
           lineStyle: { color: globalColor.default },
           itemStyle: { color: globalColor.default },
@@ -216,7 +218,7 @@ const getOptions = () => {
     options.color = [globalColor.before, globalColor.default];
     options.legend.show = true;
     options.series[1].data.unshift({
-      value: beforeData,
+      value: props.dataSets?.[1],
       name: "训练前",
       lineStyle: { color: globalColor.before },
       itemStyle: { color: globalColor.before },
@@ -236,7 +238,7 @@ const getOptions = () => {
         //distance: 5
       },
       lineStyle: { width: 0 },
-      data: positionFormatter(beforeData),
+      data: positionFormatter(props.dataSets?.[1]),
     });
   }
   return options;

+ 1 - 1
src/views/evaluation/index.vue

@@ -34,8 +34,8 @@ let studentInfo = ref("");
 const data = ref([78, 88, 65, 82, 65]);
 // 五维雷达图
 const radarData = ref([
-  [28, 38, 45, 32, 25],
   [78, 88, 65, 82, 65],
+  [28, 38, 45, 32, 25],
 ]);
 const radarStar = ref([1, 2, 3, 4, 5]);
 const radarTag = true;

+ 1 - 2
src/views/student/result.vue

@@ -17,11 +17,10 @@ watch(
     console.log(newValue, oldValue);
   }
 );
-
 // 五维雷达图
 const radarData = ref([
-  [28, 38, 45, 32, 25],
   [78, 88, 65, 82, 65],
+  [28, 38, 45, 32, 25],
 ]);
 // 专注力分布饼图
 const pieData = ref([12, 18, 20, 28, 22]);