rollMaking.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <div class="scene abstract">
  3. <!-- <el-button class="w-full my-4" style="margin-left: 0; margin-right: 0">添加场景</el-button> -->
  4. <div class="scene-list">
  5. <div class="list">
  6. <div class="tabs1 flex justify-between content-center items-center">
  7. <el-tabs v-model="active1" class="demo-tabs" @tab-click="handleClick">
  8. <el-tab-pane
  9. v-for="(item, index) in list"
  10. :key="index"
  11. :label="item.filesTypeName"
  12. :name="index"
  13. >
  14. </el-tab-pane>
  15. </el-tabs>
  16. <div class="float-right">
  17. <el-button class="newbut" :icon="Plus" @click="handleAdd">新增</el-button>
  18. </div>
  19. </div>
  20. <div class="tabs1 flex justify-between content-center items-center">
  21. <el-tabs v-model="active2" class="demo-tabs" @tab-click="handleClick2">
  22. <el-tab-pane
  23. v-for="(childrenitem, indexs) in childrenList.list"
  24. :key="indexs"
  25. :label="childrenitem.filesTypeName"
  26. :name="indexs"
  27. >
  28. </el-tab-pane>
  29. </el-tabs>
  30. <!-- <div class="float-right">
  31. <el-button class="newbut" @click="handleAdd">视图截取</el-button>
  32. <el-button class="newbut" @click="handleAdd">上传</el-button>
  33. </div> -->
  34. </div>
  35. <viewImg
  36. :list="childrenList.caseFilesList || []"
  37. width="128px"
  38. height="128px"
  39. @handleItem="handleItem"
  40. />
  41. </div>
  42. </div>
  43. </div>
  44. </template>
  45. <script setup lang="ts">
  46. import viewImg from "@/components/viewImg/index.vue";
  47. import { computed, ref } from "vue";
  48. import { updateByTreeFileLists, getByTreeFileLists } from "@/store/case";
  49. import { router } from "@/router";
  50. import { addCaseFile, setTypeFile, addrollMaking } from "./quisk";
  51. const caseId = computed(() => router.currentRoute.value?.params?.caseId);
  52. import { Plus, Upload } from "@element-plus/icons-vue";
  53. const active1 = ref(0);
  54. const active2 = ref(0);
  55. const active = ref(true);
  56. const settype = ref(false);
  57. const childrenList = ref({
  58. list: [],
  59. value: "",
  60. caseFilesList: [],
  61. });
  62. const showModal = ref(false);
  63. const srcList = [
  64. "https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg",
  65. "https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg",
  66. ];
  67. const list = ref([]);
  68. const activeNames = ref(["1"]);
  69. const handleChange = (val: string[]) => {
  70. console.log(val);
  71. };
  72. getList();
  73. function handleActive(params) {
  74. console.log("handleActive", params);
  75. }
  76. function getList() {
  77. updateByTreeFileLists(caseId.value).then((res) => {
  78. let newlist =
  79. res.find((ele) => ele.filesTypeName == "三录材料")?.childrenList || [];
  80. list.value =
  81. newlist.find((ele) => ele.filesTypeName == "现场图")?.childrenList ||
  82. [];
  83. childrenList.value.list = list.value[0]?.childrenList || [];
  84. childrenList.value.caseFilesList =
  85. childrenList.value.list[0]?.childrenList || [];
  86. });
  87. }
  88. async function handleAdd() {
  89. let resImg = await addrollMaking({ caseId: caseId.value, filesTypeName: ["原始照片"] });
  90. getList();
  91. }
  92. const handleClick = (val) => {
  93. console.log("handleClick", list.value[val.index], val);
  94. childrenList.value.list = list.value[val.index]
  95. ? list.value[val.index].childrenList
  96. : [];
  97. childrenList.value.value = active.value;
  98. active2.value = 0;
  99. };
  100. const handleClick2 = (val) => {
  101. childrenList.value.caseFilesList =
  102. childrenList.value.list[val.index]?.caseFilesList || [];
  103. console.log("handleClick2", active2.value, val);
  104. };
  105. async function handleItem(type, item) {
  106. console.log("handleItem", type, item);
  107. if (type == "edit") {
  108. await setTypeFile({
  109. ...item,
  110. caseId: caseId.value,
  111. fileOptions: list.value,
  112. });
  113. }
  114. getList();
  115. }
  116. </script>
  117. <style scoped lang="scss">
  118. .scene {
  119. height: 100%;
  120. overflow-x: scroll;
  121. .scene-list {
  122. // height: 100%;
  123. }
  124. .title0 {
  125. font-family: Microsoft YaHei, Microsoft YaHei;
  126. font-weight: bold;
  127. font-size: 16px;
  128. color: rgba(0, 0, 0, 0.85);
  129. line-height: 22px;
  130. }
  131. .demo-tabs {
  132. padding: 12px 0 ;
  133. }
  134. }
  135. </style>