index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <!--
  2. * @Author: zhanghaifeng
  3. * @Date: 2024-11-27 15:44:12
  4. * @LastEditors: zhanghaifeng
  5. * @LastEditTime: 2025-06-24 17:11:05
  6. * @Description:
  7. * @FilePath: /hospital-project/src/components/personList/index.vue
  8. -->
  9. <template>
  10. <div class="mr-8">
  11. <el-table :data="tableData" style="width: 100%">
  12. <el-table-column prop="title" width="100">
  13. <template #default="scope">
  14. <div class="text-black">{{ scope.row.quotaName }}</div>
  15. </template>
  16. </el-table-column>
  17. <el-table-column
  18. v-if="showList?.showIndicRemark"
  19. prop="remark"
  20. label="指标说明"
  21. />
  22. <el-table-column
  23. v-if="showList?.showScoreRule"
  24. prop="scoreRule"
  25. label="评价标准"
  26. />
  27. <el-table-column
  28. v-if="showList?.showDatasource"
  29. prop="datasoure"
  30. label="数据来源"
  31. />
  32. <el-table-column
  33. v-if="showList?.showTargetValue"
  34. prop="targetValue"
  35. label="目标值"
  36. />
  37. <el-table-column prop="finalValue" label="完成值" />
  38. <el-table-column
  39. v-if="showList?.showStartValue"
  40. prop="startValue"
  41. label="门槛值"
  42. />
  43. <el-table-column
  44. v-if="showList?.showChallengeValue"
  45. prop="challengeValue"
  46. label="挑战值"
  47. />
  48. <el-table-column prop="ranking" label="排名" />
  49. <el-table-column prop="quotaScore" label="得分" />
  50. </el-table>
  51. </div>
  52. </template>
  53. <script lang="ts" setup>
  54. import { ref, nextTick, watch } from "vue";
  55. const tableData = ref([]);
  56. const showList = ref();
  57. const watchData = ref();
  58. const props = defineProps({
  59. paramsIndex: {
  60. type: Object
  61. },
  62. detailData: {
  63. type: Array,
  64. default: () => []
  65. }
  66. });
  67. watch(props, newVal => {
  68. showList.value = newVal.detailData[0]?.dimensionList[0];
  69. tableData.value = newVal.detailData[0]?.dimensionList[0]?.quotaList;
  70. });
  71. const init = (data?: any, id?: any) => {
  72. if (data) {
  73. tableData.value = [];
  74. watchData.value = data;
  75. setTimeout(() => {
  76. nextTick(() => {
  77. if (id) {
  78. data[0]?.dimensionList.map(it => {
  79. if (it.dimId == id) {
  80. showList.value = it;
  81. tableData.value = it.quotaList;
  82. }
  83. });
  84. } else {
  85. showList.value = data[0]?.dimensionList[0];
  86. tableData.value = data[0]?.dimensionList[0].quotaList;
  87. }
  88. });
  89. }, 0);
  90. }
  91. };
  92. watch(
  93. watchData.value,
  94. newVal => {
  95. showList.value = newVal[0]?.dimensionList[0];
  96. tableData.value = newVal[0]?.dimensionList[0].quotaList;
  97. },
  98. { deep: true }
  99. );
  100. defineExpose({
  101. init
  102. });
  103. </script>