index.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <div class="mr-8">
  3. <el-table :data="tableData" style="width: 100%">
  4. <el-table-column prop="title" width="100">
  5. <template #default="scope">
  6. <div class="text-black">{{ scope.row.quotaName }}</div>
  7. </template>
  8. </el-table-column>
  9. <el-table-column
  10. v-if="showList?.showIndicRemark"
  11. prop="remark"
  12. label="指标说明"
  13. />
  14. <el-table-column
  15. v-if="showList?.showScoreRule"
  16. prop="scoreRule"
  17. label="评价标准"
  18. />
  19. <el-table-column
  20. v-if="showList?.showDatasource"
  21. prop="datasoure"
  22. label="数据来源"
  23. />
  24. <el-table-column
  25. v-if="showList?.showTargetValue"
  26. prop="targetValue"
  27. label="目标值"
  28. />
  29. <el-table-column prop="finalValue" label="完成值" />
  30. <el-table-column
  31. v-if="showList?.showStartValue"
  32. prop="startValue"
  33. label="门槛值"
  34. />
  35. <el-table-column
  36. v-if="showList?.showChallengeValue"
  37. prop="challengeValue"
  38. label="挑战值"
  39. />
  40. <el-table-column prop="ranking" label="排名" />
  41. <el-table-column prop="quotaScore" label="得分" />
  42. </el-table>
  43. </div>
  44. </template>
  45. <script lang="ts" setup>
  46. import { ref, nextTick, watch } from "vue";
  47. const tableData = ref([]);
  48. const showList = ref();
  49. const watchData = ref();
  50. const init = (data?: any) => {
  51. if (data) {
  52. tableData.value = [];
  53. watchData.value = data;
  54. setTimeout(() => {
  55. nextTick(() => {
  56. showList.value = data[0]?.dimensionList[0];
  57. tableData.value = data[0]?.dimensionList[0].quotaList;
  58. // tableData.value = data;
  59. });
  60. }, 0);
  61. }
  62. };
  63. watch(
  64. watchData.value,
  65. newVal => {
  66. showList.value = newVal[0]?.dimensionList[0];
  67. tableData.value = newVal[0]?.dimensionList[0].quotaList;
  68. },
  69. { deep: true }
  70. );
  71. // nextTick(() => {
  72. // init();
  73. // });
  74. defineExpose({
  75. init
  76. });
  77. </script>