riku
2024-05-31 f7d98a5d5097794dcd0afaaf6d270bb43fe72a05
src/views/fysp/evaluation/EvalutationEdit.vue
@@ -1,13 +1,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 {
  data() {
    return {};
  setup() {
    const { loading, fetchData } = useFetchData();
    return { loading, fetchData };
  },
  methods: {}
  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>