JianYan.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <script setup lang="tsx">
  2. import { useArchiveKey } from "@/views/archive/index";
  3. import { magicApi } from "@/utils/database/magic-api-request";
  4. const root = inject(useArchiveKey);
  5. async function handleClick(data) {
  6. const res = await magicApi({
  7. url: "/intergration/jyjc/getJyImage",
  8. method: "get",
  9. params: {
  10. reportId: data.reportId,
  11. },
  12. });
  13. root.store.mainComponent = (
  14. <div>
  15. {...res.items.map(item => {
  16. return (
  17. <img
  18. src={`data:image/png;base64,${item.imgData}`}
  19. style={{ width: "100%" }}
  20. alt="null"
  21. />
  22. );
  23. })}
  24. </div>
  25. );
  26. }
  27. const Table = props => {
  28. return (
  29. <div style={{ height: "50%" }}>
  30. <el-table data={props.data} height="100%" onRowClick={handleClick}>
  31. <el-table-column label={props.name}>
  32. <el-table-column prop="trscDate" label="日期" />
  33. <el-table-column
  34. prop="examPurpose"
  35. label="名称"
  36. show-overflow-tooltip
  37. />
  38. </el-table-column>
  39. </el-table>
  40. </div>
  41. );
  42. };
  43. </script>
  44. <template>
  45. <div style="width: 220px">
  46. <Table name="常规" :data="root.cache.jianYan.biochemicalSingle" />
  47. <Table name="生化单" :data="root.cache.jianYan.routine" />
  48. </div>
  49. </template>
  50. <style lang="scss"></style>