Pārlūkot izejas kodu

图表组件修改

liurongli 1 mēnesi atpakaļ
vecāks
revīzija
c0058826f3

+ 2 - 2
src/components/QuestionPoint.vue

@@ -49,8 +49,8 @@ interface ImageInfo {
 // Props
 const props = defineProps<{
   drawData: DrawDataItem[];
-  isSetPoint: boolean;
-  usedCardType: number;
+  // isSetPoint: boolean;
+  // usedCardType: number;
   paperImage: PaperImageItem[];
 }>();
 

+ 21 - 21
src/components/echarts/barChart.vue

@@ -25,29 +25,29 @@ interface BarChartProps {
   datax: (string | number)[]
   datay: (string | number)[]
   color: string
-  height: number
+  height?: number
   unit: string
-  showNuitY: boolean
-  showSplitArea: boolean
-  showTooltip: boolean
-  tooltipData: TooltipDataItem[]
+  showNuitY?: boolean
+  showSplitArea?: boolean
+  showTooltip?: boolean
+  tooltipData?: TooltipDataItem[]
   typeName: string
-  average: string | number | (string | number)[]
-  markLineData: MarkLineDataItem[]
-  isShowMarkLine: boolean
-  showMarkPoint: boolean
-  isClick: boolean
-  answerValue: string
-  unitX: string
-  fullMark: string | number
-  gridLeft: number
-  gridRight: number
-  gridTop: number
-  fontSize: string | number
-  fontColor: string
-  showDataZoom: boolean
-  barMaxWidth: number
-  barMinWidth: number
+  average?: string | number | (string | number)[]
+  markLineData?: MarkLineDataItem[]
+  isShowMarkLine?: boolean
+  showMarkPoint?: boolean
+  isClick?: boolean
+  answerValue?: string
+  unitX?: string
+  fullMark?: string | number
+  gridLeft?: number
+  gridRight?: number
+  gridTop?: number
+  fontSize?: string | number
+  fontColor?: string
+  showDataZoom?: boolean
+  barMaxWidth?: number
+  barMinWidth?: number
 }
 
 interface BarChartEmits {

+ 2 - 2
src/components/echarts/barLineCharts.vue

@@ -285,7 +285,7 @@ async function LoadEchart() {
       type: "value",
       axisLabel: {
         formatter: "{value}%",
-        textStyle: { fontSize: 14, color: "#666", fontWeight: 400 },
+        fontSize: 14, color: "#666", fontWeight: 400
       },
     },
     xAxis: {
@@ -293,7 +293,7 @@ async function LoadEchart() {
       axisLabel: {
         interval: 0,
         rotate: totalWidth / dataxCount < 80 ? 45 : 0,
-        textStyle: { fontSize: 14, color: "#666", fontWeight: 400 },
+        fontSize: 14, color: "#666", fontWeight: 400,
         formatter: (value: string) => {
           const singleSeriesWidth = totalWidth / dataxCount;
           const valueWidth = value.length * 16;

+ 4 - 4
src/components/echarts/barScoringRate_vertical.vue

@@ -36,10 +36,10 @@ interface BarScoringRateVerticalProps {
   datax: string[]
   datay: (string | number)[][]
   color: string[]
-  height: number
-  unit: string
-  showNuitY: boolean
-  showTooltip: boolean
+  height?: number
+  unit?: string
+  showNuitY?: boolean
+  showTooltip?: boolean
   tooltipData: TooltipDataItem[]
   typeName: string
   average: string | number | (string | number)[]

+ 3 - 5
src/components/echarts/barStackChart_horzontal.vue

@@ -200,11 +200,9 @@ const LoadEchart = () => {
       axisLabel: {
         formatter: '{value}%',
         interval: 0,
-        textStyle: {
-          fontSize: 14,
-          color: '#666',
-          fontWeight: 400,
-        },
+        fontSize: 14,
+        color: '#666',
+        fontWeight: 400,
       },
       axisTick: {
         lineStyle: {

+ 2 - 2
src/components/echarts/barsCharts.vue

@@ -347,7 +347,7 @@ const LoadEchart = () => {
             : Number(value.toFixed(1));
           return unit == "%" ? value + unit : value;
         },
-        textStyle: { fontSize: 14, color: "#666", fontWeight: 400 },
+        fontSize: 14, color: "#666", fontWeight: 400
       },
       splitArea: { show: true, areaStyle: { color: ["#fafafa", "#ffffff"] } },
       min: props.yInverse ? dataMin : null,
@@ -360,7 +360,7 @@ const LoadEchart = () => {
       axisLabel: {
         interval: 0,
         rotate: singleSeriesWidth < 80 ? 45 : 0,
-        textStyle: { fontSize: 14, color: "#666", fontWeight: 400 },
+        fontSize: 14, color: "#666", fontWeight: 400,
         formatter: function (value: any) {
           let newData = dataset.source.slice(1);
           let xAxisName = newData[value]?.[0];

+ 9 - 9
src/components/echarts/differenceChart.vue

@@ -24,19 +24,19 @@ interface TooltipDataItem {
 interface DifferenceChartProps {
   datax: string[]
   datay: (string | number)[]
-  tooltipData: TooltipDataItem[]
+  tooltipData?: TooltipDataItem[]
   title: string
   rate: number | string
   unit: string
   type: string
-  isClick: boolean
-  color: string[]
-  gridLeft: number
-  gridRight: number
-  gridTop: number
-  fontSize: number | string
-  fontColor: string
-  showDataZoom: boolean
+  isClick?: boolean
+  color?: string[]
+  gridLeft?: number
+  gridRight?: number
+  gridTop?: number
+  fontSize?: number | string
+  fontColor?: string
+  showDataZoom?: boolean
 }
 
 /** y轴最大最小值返回结构 */

+ 4 - 2
src/components/echarts/lineBarChart.vue

@@ -262,7 +262,8 @@ const LoadEchart = () => {
             axisLabel: {
                 interval: 0,
                 rotate: singleSeriesWidth < 80 ? 45 : 0,
-                textStyle: { fontSize: 14, color: "#333" },
+                fontSize: 14, 
+                color: "#333",
                 formatter: (val: string) => {
                     const w = val.length * 10;
                     if (w > singleSeriesWidth) return val.slice(0, 6) + "...";
@@ -344,7 +345,8 @@ const LoadEchart = () => {
                 interval: 0,
                 hideOverlap: props.hideOverlap,
                 rotate: totalWidth / props.datax.length < 80 ? 45 : 0,
-                textStyle: { fontSize: 14, color: "#333" },
+                fontSize: 14,
+                color: "#333",
                 formatter: (val: string) => {
                     const w = val.length * 10;
                     if (w > singleSeriesWidth) return val.slice(0, 6) + "...";

+ 2 - 4
src/components/echarts/radarCharts.vue

@@ -105,10 +105,8 @@ const initChart = () => {
       axisLabel: props.showRadiusAxis && index === 0 ? {
         show: true,
         formatter: (val: number) => `${val}${props.unit}`,
-        textStyle: {
-          fontSize: props.fontSize ? props.fontSize : 12,
-          color: '#666'
-        }
+        fontSize: props.fontSize ? props.fontSize : 12,
+        color: '#666'
       } : {
         show: false
       },

+ 6 - 0
src/styles/element.scss

@@ -42,6 +42,12 @@
 }
 .el-button--text:not(.is-disabled):hover, .el-button--text:not(.is-disabled):focus {
   color: rgb(87.8, 131, 251);
+}
+.el-button.is-text{
+  color: #2e64fa;
+}
+.el-button.is-text:not(.is-disabled):hover, .el-button.is-text:not(.is-disabled):focus {
+  color: rgb(87.8, 131, 251);
 }    
 .el-button {
 

+ 1 - 1
src/views/analysis/groupAnalysis.vue

@@ -378,7 +378,7 @@
           ></el-table-column>
           <el-table-column align="center" label="操作">
             <template #default="scope">
-              <el-button type="text" @click.stop="handleClick(scope.row as any)"
+              <el-button text @click.stop="handleClick(scope.row as any)"
                 >查看答题卡</el-button
               >
             </template>

+ 1 - 1
src/views/analysis/questionAnalysis.vue

@@ -283,7 +283,7 @@
           ></el-table-column>
           <el-table-column align="center" label="操作">
             <template #default="scope">
-              <el-button type="text" @click.stop="handleClick(scope.row)"
+              <el-button text @click.stop="handleClick(scope.row)"
                 >查看答题卡</el-button
               >
             </template>

+ 10 - 2
src/views/analysis/score.vue

@@ -212,7 +212,7 @@ const getExamName = computed(() => {
 
 const state = reactive<State>({
   keyWord: "",
-  checkList: ["group"],
+  checkList: [],
   tableHeight: 1000, //表格高度
   tableData: [],
   staticHeaderData: [],
@@ -257,6 +257,14 @@ const GetStudentTranscriptTitle = async () => {
         res.data?.title?.dynamicsHeaderData?.groupDataTitle || [];
       state.scoreDataTitleData =
         res.data?.title?.dynamicsHeaderData?.scoreDataTitle || [];
+      let checkList = [];  
+      if(state.groupDataTitleData.length){
+        checkList.push('group');
+      }
+      if(state.scoreDataTitleData.length){
+        checkList.push('question');
+      }
+      state.checkList = checkList.length?[checkList[0]]:[];
     }
   } catch (err) {
     console.error("获取表头失败:", err);
@@ -351,7 +359,6 @@ const ExportExcel = () => {
   if (state.checkList.includes("question")) {
     params.dynamicsHeaderDataMap.scoreDataTitle = state.scoreDataTitleData;
   }
-  console.log(state.checkList);
   // 3. 调用通用下载方法,并在完成后重置加载状态
   downloadExcel(studentTranscriptExcel, params).finally(() => {
     reportModuleRef.value?.SetExportLoading?.(false);
@@ -420,6 +427,7 @@ const HandleResize = throttle(() => {
 // 初始化
 const PageInit = () => {
   state.pageInfo.pageNum = 1;
+  state.checkList = [];
   GetStudentTranscriptTitle();
   GetTableCount();
   GetTableData(true);