riku
2024-05-31 f7d98a5d5097794dcd0afaaf6d270bb43fe72a05
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<template>
  <FYPageHeader title="评估结果详情"></FYPageHeader>
  <el-row v-for="item in evaluation" :key="item.id">
    
  </el-row>
</template>
 
<script>
import evaluateApi from '@/api/fysp/evaluateApi';
import { useFetchData } from '@/composables/fetchData';
 
export default {
  setup() {
    const { loading, fetchData } = useFetchData();
    return { loading, fetchData };
  },
  data() {
    return {
      evaluation: []
    };
  },
  created() {
    // // watch 路由的参数,以便再次获取数据
    // this.$watch(
    //   () => this.$route.params,
    //   () => {
    //     this.getScore();
    //   },
    //   // 组件创建完后获取数据,
    //   // 此时 data 已经被 observed 了
    //   { immediate: true }
    // );
    this.getScore();
  },
  methods: {
    // 获取评分
    getScore() {
      this.fetchData(() => {
        return evaluateApi.fetchItemEvaluation(this.$route.params.subTaskId).then((res) => {
          this.evaluation = res;
        });
      });
    }
  }
};
</script>
<style scoped></style>