ReportAnalysisWidgetTongue.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <script setup lang="ts">
  2. import type { ReportModel } from '@/model';
  3. const props = withDefaults(defineProps<{
  4. dataset: ReportModel;
  5. title?: string;
  6. loading?: boolean;
  7. }>(), {
  8. title: '舌象分析',
  9. });
  10. const openTongueAnalysis = ref(false);
  11. const exceptionPanelKeys = ref<string[]>([]);
  12. const exceptionData = computed(() => {
  13. const keys = [ 'tongueColor', 'tongueCoatingColor', 'tongueShape', 'tongueCoating', 'bodyFluid', 'sublingualVein' ];
  14. const data: Record<string, string>[] = [];
  15. for ( const key of keys ) {
  16. const list = props.dataset?.[ key ]?.actualList ?? [];
  17. for ( const item of list ) if ( item?.contrast && item.contrast !== 's' ) data.push(item);
  18. }
  19. exceptionPanelKeys.value = data.map(t => t.actualValue);
  20. return data;
  21. });
  22. </script>
  23. <template>
  24. <a-card class="card" size="small" :title="props.title" :loading="props.loading">
  25. <a-descriptions :column="3" size="small">
  26. <a-descriptions-item>
  27. <a-image :width="200" :src="props.dataset.upImg" :preview="true" v-if="props.dataset.upImg" />
  28. </a-descriptions-item>
  29. <a-descriptions-item>
  30. <a-image :width="200" :src="props.dataset.downImg" :preview="true" v-if="props.dataset.downImg" />
  31. </a-descriptions-item>
  32. <a-descriptions-item v-if="props.dataset.tongueAnalysisResult">
  33. <div class="flex flex-col">
  34. {{ props.dataset.tongueAnalysisResult }}
  35. <a-button
  36. v-if="exceptionData.length" type="dashed" danger style="padding: 0;margin-top: 12px;"
  37. @click="openTongueAnalysis=true"
  38. >异常舌象分析
  39. </a-button>
  40. </div>
  41. </a-descriptions-item>
  42. </a-descriptions>
  43. <a-descriptions :column="3" bordered size="small">
  44. <a-descriptions-item style="font-size: 16px;font-weight: 600;">舌象维度</a-descriptions-item>
  45. <a-descriptions-item style="font-size: 16px;font-weight: 600;">检测结果</a-descriptions-item>
  46. <a-descriptions-item style="font-size: 16px;font-weight: 600;">标准值</a-descriptions-item>
  47. <template v-if="props.dataset.tongueColor?.actualList">
  48. <a-descriptions-item>舌色</a-descriptions-item>
  49. <a-descriptions-item>
  50. <span class="tongue-value" v-for="item in props.dataset.tongueColor.actualList" :key="item?.actualValue">
  51. <span>{{ item.actualValue }}</span>
  52. <span v-if="item.contrast !== 's'">({{ item.contrast }})</span>
  53. </span>
  54. </a-descriptions-item>
  55. <a-descriptions-item>{{ props.dataset.tongueColor.standardValue }}</a-descriptions-item>
  56. </template>
  57. <template v-if="props.dataset.tongueCoatingColor?.actualList">
  58. <a-descriptions-item>苔色</a-descriptions-item>
  59. <a-descriptions-item>
  60. <span class="tongue-value" v-for="item in props.dataset.tongueCoatingColor.actualList"
  61. :key="item?.actualValue"
  62. >
  63. <span>{{ item.actualValue }}</span>
  64. <span v-if="item.contrast !== 's'">({{ item.contrast }})</span>
  65. </span>
  66. </a-descriptions-item>
  67. <a-descriptions-item>{{ props.dataset.tongueCoatingColor.standardValue }}</a-descriptions-item>
  68. </template>
  69. <template v-if="props.dataset.tongueShape?.actualList">
  70. <a-descriptions-item>舌形</a-descriptions-item>
  71. <a-descriptions-item>
  72. <span class="tongue-value" v-for="item in props.dataset.tongueShape.actualList" :key="item?.actualValue">
  73. <span>{{ item.actualValue }}</span>
  74. <span v-if="item.contrast !== 's'">({{ item.contrast }})</span>
  75. </span>
  76. </a-descriptions-item>
  77. <a-descriptions-item>{{ props.dataset.tongueShape.standardValue }}</a-descriptions-item>
  78. </template>
  79. <template v-if="props.dataset.tongueCoating?.actualList">
  80. <a-descriptions-item>苔质</a-descriptions-item>
  81. <a-descriptions-item>
  82. <span class="tongue-value" v-for="item in props.dataset.tongueCoating.actualList" :key="item?.actualValue">
  83. <span>{{ item.actualValue }}</span>
  84. <span v-if="item.contrast !== 's'">({{ item.contrast }})</span>
  85. </span>
  86. </a-descriptions-item>
  87. <a-descriptions-item>{{ props.dataset.tongueCoating.standardValue }}</a-descriptions-item>
  88. </template>
  89. <template v-if="props.dataset.bodyFluid?.actualList">
  90. <a-descriptions-item>津液</a-descriptions-item>
  91. <a-descriptions-item>
  92. <span class="tongue-value" v-for="item in props.dataset.bodyFluid.actualList" :key="item?.actualValue">
  93. <span>{{ item.actualValue }}</span>
  94. <span v-if="item.contrast !== 's'">({{ item.contrast }})</span>
  95. </span>
  96. </a-descriptions-item>
  97. <a-descriptions-item>{{ props.dataset.bodyFluid.standardValue }}</a-descriptions-item>
  98. </template>
  99. <template v-if="props.dataset.sublingualVein?.actualList">
  100. <a-descriptions-item>舌下</a-descriptions-item>
  101. <a-descriptions-item>
  102. <span class="" v-for="item in props.dataset.sublingualVein.actualList" :key="item?.actualValue">
  103. <span>{{ item.actualValue }}</span>
  104. <span v-if="item.contrast !== 's'">({{ item.contrast }})</span>
  105. </span>
  106. </a-descriptions-item>
  107. <a-descriptions-item>{{ props.dataset.sublingualVein.standardValue }}</a-descriptions-item>
  108. </template>
  109. </a-descriptions>
  110. <vxe-modal
  111. title="异常舌象分析" v-model="openTongueAnalysis"
  112. resize show-maximize :width="600" :height="400"
  113. >
  114. <a-collapse :bordered="false" v-model:activeKey="exceptionPanelKeys">
  115. <a-collapse-panel v-for="(panel, index) in exceptionData" :key="panel.actualValue" :header="panel.actualValue">
  116. <a-descriptions :column="1" bordered size="small" :label-style="{width: '120px',textAlign:'center' }">
  117. <a-descriptions-item>
  118. <div class="flex flex-row">
  119. <a-image v-if="panel.splitImage" :src="panel.splitImage" :width="200" :preview="true" />
  120. <a-space v-if="panel.attrs" direction="vertical">
  121. <a-tag v-for="v in panel.attrs" color="#cd201f" style="margin-left: 8px;margin-right: 0;">{{ v }}
  122. </a-tag>
  123. </a-space>
  124. </div>
  125. </a-descriptions-item>
  126. <a-descriptions-item label="特征">{{ panel.features }}</a-descriptions-item>
  127. <a-descriptions-item label="临床意义">{{ panel.clinicalSignificance }}</a-descriptions-item>
  128. </a-descriptions>
  129. </a-collapse-panel>
  130. </a-collapse>
  131. </vxe-modal>
  132. </a-card>
  133. </template>
  134. <style scoped lang="scss">
  135. </style>