Kaynağa Gözat

个人成绩单 试题分析 接入接口

la 2 yıl önce
ebeveyn
işleme
9f90fb1792
2 değiştirilmiş dosya ile 39 ekleme ve 192 silme
  1. 31 96
      src/pages/ksfx/stu_grcjd.vue
  2. 8 96
      src/pages/ksfx/stu_stfx.vue

+ 31 - 96
src/pages/ksfx/stu_grcjd.vue

@@ -55,7 +55,7 @@
 
 <script setup lang="ts">
 import * as echarts from 'echarts';
-import {student_grcjd_list} from "~/pages/process/api";
+import {student_grcjd_list} from "@/pages/ksfx/api";
 
 import { useRouter } from "vue-router";
 import { skeletonProps } from 'element-plus';
@@ -72,99 +72,37 @@ let subject_list = [{
   label: '数学'
 }]
 
-const tableData = [
-  {
-    km: '语文',
-    mf: '1',
-    cj: '选择题',
-
-    bj_pjf:120,
-    bj_zgf:120,
-    nj_pjf:120,
-    nj_zgf:120,
-    ztks_pjf:120,
-    ztks_zgf:120,
-
-  },
-  {
-    km: '语文',
-    mf: '1',
-    cj: '选择题',
-
-   bj_pjf:120,
-    bj_zgf:120,
-    nj_pjf:120,
-    nj_zgf:120,
-    ztks_pjf:120,
-    ztks_zgf:120,
-  },
-  {
-    km: '语文',
-    mf: '1',
-    cj: '选择题',
-
-   bj_pjf:120,
-    bj_zgf:120,
-    nj_pjf:120,
-    nj_zgf:120,
-    ztks_pjf:120,
-    ztks_zgf:120,
-  },
-  {
-    km: '语文',
-    mf: '1',
-    cj: '选择题',
-
-   bj_pjf:120,
-    bj_zgf:120,
-    nj_pjf:120,
-    nj_zgf:120,
-    ztks_pjf:120,
-    ztks_zgf:120,
-  },
-  {
-    km: '语文',
-    mf: '1',
-    cj: '选择题',
-
-   bj_pjf:120,
-    bj_zgf:120,
-    nj_pjf:120,
-    nj_zgf:120,
-    ztks_pjf:120,
-    ztks_zgf:120,
-  },
-  {
-    km: '语文',
-    mf: '1',
-    cj: '选择题',
-
-   bj_pjf:120,
-    bj_zgf:120,
-    nj_pjf:120,
-    nj_zgf:120,
-    ztks_pjf:120,
-    ztks_zgf:120,
-  },
-  {
-    km: '语文',
-    mf: '1',
-    cj: '选择题',
-
-   bj_pjf:120,
-    bj_zgf:120,
-    nj_pjf:120,
-    nj_zgf:120,
-    ztks_pjf:120,
-    ztks_zgf:120,
-  },
-]
+const tableData =ref([])
+
+//导出
+const exportBtn = () => {
+  console.log("导出")
+}
 
 onMounted(() => {
-  initChart()
+  initData();
 })
 
-const initChart = () => {
+const initData = () => {
+  let transObj = {
+    xueke_id: '',
+    grade_id: '',
+    school_id: ''
+  }
+  student_grcjd_list(transObj)
+    .then(res => {
+      if (res.code == "1") {
+        console.log(res)
+        tableData.value = res.data.data.tableData;
+        initChart(res.data.data.ecahrtData);
+      }
+    })
+    .catch(error => {
+      console.log(error);
+    })
+}
+
+const initChart = (item) => {
   var myChart = echarts.init(document.getElementById('echartData'));
   myChart.setOption({
     title: {
@@ -177,7 +115,7 @@ const initChart = () => {
       containLabel: true
     },
     xAxis: {
-      data: ['语文', '语文', '语文', '语文', '语文', '语文', '语文']
+      data: item.xAxis_data
     },
     yAxis: {
       type: 'value',
@@ -203,16 +141,13 @@ const initChart = () => {
             }
           }
         },
-        data: [120,200,200,150,80,70,110,130],
+        data: item.series_data,
       }
     ]
   });
 }
 
-//导出
-const exportBtn = () => {
-  console.log("导出")
-}
+
 
 </script>
 

+ 8 - 96
src/pages/ksfx/stu_stfx.vue

@@ -63,100 +63,10 @@ let subject_list = [{
   label: '数学'
 }]
 
-const tableData = [
-  {
-    xk: '语文',
-    tm: '1',
-    lx: '选择题',
-    nd: '5',
-    df: '12',
-    grdf: '12',
-
-    gr: '23%',
-    bj: '23%',
-    nj: '23%',
-    ztks: '23%',
-  },
-  {
-    xk: '语文',
-    tm: '1',
-    lx: '选择题',
-    nd: '5',
-    df: '12',
-    grdf: '12',
-
-    gr: '23%',
-    bj: '23%',
-    nj: '23%',
-    ztks: '23%',
-  },
-  {
-    xk: '语文',
-    tm: '1',
-    lx: '选择题',
-    nd: '5',
-    df: '12',
-    grdf: '12',
-
-    gr: '23%',
-    bj: '23%',
-    nj: '23%',
-    ztks: '23%',
-  },
-  {
-    xk: '语文',
-    tm: '1',
-    lx: '选择题',
-    nd: '5',
-    df: '12',
-    grdf: '12',
-
-    gr: '23%',
-    bj: '23%',
-    nj: '23%',
-    ztks: '23%',
-  },
-  {
-    xk: '语文',
-    tm: '1',
-    lx: '选择题',
-    nd: '5',
-    df: '12',
-    grdf: '12',
-
-    gr: '23%',
-    bj: '23%',
-    nj: '23%',
-    ztks: '23%',
-  },
-  {
-    xk: '语文',
-    tm: '1',
-    lx: '选择题',
-    nd: '5',
-    df: '12',
-    grdf: '12',
-
-    gr: '23%',
-    bj: '23%',
-    nj: '23%',
-    ztks: '23%',
-  },
-  {
-    xk: '语文',
-    tm: '1',
-    lx: '选择题',
-    nd: '5',
-    df: '12',
-    grdf: '12',
-
-    gr: '23%',
-    bj: '23%',
-    nj: '23%',
-    ztks: '23%',
-  },
-];
-
+const tableData = ref([]);
+onMounted(() => {
+  initData()
+})
 
 const initData = () => {
   let transObj = {
@@ -166,9 +76,11 @@ const initData = () => {
   }
   student_stfx_list(transObj)
     .then(res => {
-      console.log(res);
-
+      if (res.code == "1") {
+        tableData.value = res.data.data.tableData;
+      }
     })
+    .catch(error => { console.log(error) });
 }
 
 //导出