index.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <div class="h-full threadDetail">
  3. <div class="layout p-3">
  4. <div class="bg-white w-1/2 shadow-md rounded-md">
  5. <Information :data="information" @refreshData="refreshData"></Information>
  6. </div>
  7. <div class="bg-white w-1/2 ml-3 shadow-md rounded-md">
  8. <Attachment :data="attachment" :information="information" @refreshData="refreshData"></Attachment>
  9. </div>
  10. </div>
  11. <div class="layout pl-3 pr-3 pb-3">
  12. <div class="bg-white w-2/3 shadow-md rounded-md">
  13. <RelatedTasks :data="relatedTasks" :information="information" @refreshData="refreshData"></RelatedTasks>
  14. </div>
  15. <div class="bg-white w-1/3 ml-3 shadow-md rounded-md">
  16. <OperationRecord :data="operationRecord" :information="information" @refreshData="refreshData"></OperationRecord>
  17. </div>
  18. </div>
  19. </div>
  20. </template>
  21. <script lang="ts" setup>
  22. import Information from './components/information.vue'
  23. import Attachment from './components/attachment.vue'
  24. import RelatedTasks from './components/relatedTasks.vue';
  25. import OperationRecord from './components/operationRecord.vue';
  26. import { ref, reactive, onMounted, inject } from "vue";
  27. import { post, get } from "@/utils/request";
  28. import { useRouter, useRoute } from "vue-router";
  29. import { GETDETAIL } from "../constant"
  30. const route = useRoute()
  31. const globalPopup = inject<GlobalPopup>('globalPopup')
  32. const addressParameters: any = ref(0) // 地址上的参数
  33. const information = ref({}) // 基本信息
  34. const attachment = ref([]) // 附件
  35. const relatedTasks = ref([]) // 相关任务
  36. const operationRecord = ref([]) // 操作记录
  37. function getDetail() {
  38. const id = addressParameters.value
  39. post(GETDETAIL, { id }).then((res) => {
  40. const { clueLogList, files, taskList } = res.data
  41. information.value = res.data
  42. attachment.value = files || []
  43. relatedTasks.value = taskList || []
  44. operationRecord.value = clueLogList || []
  45. })
  46. }
  47. function refreshData() {
  48. getDetail()
  49. }
  50. onMounted(() => {
  51. const { id } = route.query
  52. addressParameters.value = id
  53. getDetail()
  54. })
  55. </script>
  56. <style lang="scss" scoped>
  57. .threadDetail {
  58. display: flex;
  59. flex-direction: column;
  60. .layout {
  61. width: 100%;
  62. height: 50%;
  63. display: flex;
  64. justify-content: space-between;
  65. }
  66. }
  67. </style>