trainExam.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <div class="train-exam-wrapper">
  3. <NavMenus confirmCnt="报告未保存部分会丢失,请先保存好编辑的报告。<br />是否返回任务首页?"> </NavMenus>
  4. <div class="train-exam-index">
  5. <div class="menu-title">
  6. <span>技术报告编制</span> <el-icon><ArrowRight /></el-icon><span style="color: #51A5F8">文档编辑</span>
  7. </div>
  8. <div class="menu-item" :class="{selected:selected==1}" @click="selectItem(1)">项目概况</div>
  9. <div class="menu-item" :class="{selected:selected==2}" @click="selectItem(2)">检测缺陷结果</div>
  10. <div class="menu-item" :class="{selected:selected==3}" @click="selectItem(3)">缺陷状况评估</div>
  11. <div class="menu-item" :class="{selected:selected==4}" @click="selectItem(4)">缺陷明细</div>
  12. </div>
  13. <div class="train-exam-main">
  14. <StudentReportEditor :reportId="reportId" :studentTaskId="studentTaskId" :taskId="taskId" :showItems="showItems"></StudentReportEditor>
  15. </div>
  16. <!--<div class="exam-buttons">
  17. <div class="menu-item selected" @click="saveData(0)">保存</div>
  18. <div class="menu-item selected" @click="saveData(1)">提交</div>
  19. </div>-->
  20. </div>
  21. </template>
  22. <script setup lang="ts">
  23. import {ref, onMounted } from "vue";
  24. import NavMenus from '../components/navMenus.vue';
  25. import {ArrowRight} from "@element-plus/icons-vue";
  26. import StudentReportEditor from "@/components/student/StudentReportEditor.vue";
  27. import router from '@/router/index'
  28. import { useRoute } from "vue-router";
  29. //const props = defineProps({
  30. // reportId: {////任务报告的Id 学生任务提交完成后,同一个任务是否有不同Id
  31. // type: String,
  32. // default: "1748234519357419522",
  33. // },
  34. // studentTaskId: {////学生任务Id,用于从Oss中获取图片
  35. // type: String,
  36. // default: "",
  37. // },
  38. // taskId:{////任务的Id,用于获取任务信息
  39. // type: String,
  40. // default: "1747502297063055361",
  41. // }
  42. //});
  43. const taskId = ref("");
  44. const reportId = ref("");
  45. const studentTaskId = ref("");
  46. const showItems=ref([true,false,false,false]);
  47. const selected=ref(1);
  48. const selectItem=(index:any)=>{
  49. let ary=[];
  50. for(let i=1;i<=4;i++){
  51. let key=i==index;
  52. ary.push(key);
  53. }
  54. showItems.value=ary;
  55. selected.value=index;
  56. }
  57. const route = useRoute();
  58. ////初始化的时候获取相关参数,传入组件,子组件onMounted 完成才能调用父组件的onMounted
  59. if (route.params.taskId != null && route.params.taskId.toString().length > 0) {
  60. taskId.value = route.params.taskId + "";
  61. }
  62. if (route.params.reportId != null && route.params.reportId.toString().length > 0) {
  63. reportId.value = route.params.reportId + "";
  64. }
  65. if (route.params.taskStudentId != null && route.params.taskStudentId.toString().length > 0) {
  66. studentTaskId.value = route.params.taskStudentId + "";
  67. }
  68. const saveData = (type: any) => { }
  69. onMounted(() => {
  70. });
  71. </script>
  72. <style scoped>
  73. .train-exam-wrapper {
  74. position: absolute;
  75. width: 100%;
  76. height: 100%;
  77. height: 100%;
  78. width: 100%;
  79. display: grid;
  80. grid-template-columns:1fr;
  81. grid-template-rows: 1fr;
  82. align-items:center;
  83. }
  84. .train-exam-main {
  85. overflow: hidden;
  86. margin: 2rem auto;
  87. height: 90%;
  88. min-height: 40rem;
  89. box-sizing: border-box;
  90. box-shadow: rgba(0,0,0,1) 0px 0px 10px;
  91. border-radius:3px;
  92. }
  93. .train-exam-main, .train-exam-index {
  94. }
  95. .train-exam-index {
  96. height: 80%;
  97. min-height: 40rem;
  98. box-sizing: border-box;
  99. display: flex;
  100. justify-content: start;
  101. flex-flow:column;
  102. background-color: rgba(217,217,217,0.2);
  103. box-shadow: rgba(0,0,0,0.3) 0px 0px 3px;
  104. border-radius: 3px;
  105. padding: 3rem 2rem;
  106. margin-left: 1rem;
  107. position:absolute;
  108. }
  109. .menu-title {
  110. color: #fff;
  111. align-items: center;
  112. display: flex;
  113. height: 5rem;
  114. justify-content:center;
  115. background-image: url(@/assets/student/training/menu_title.png);
  116. background-size: 100% 100%;
  117. font-size:1.2rem;
  118. width:20rem;
  119. }
  120. .menu-item {
  121. margin-top:2rem;
  122. color: #fff;
  123. justify-content:center;
  124. align-items: center;
  125. display: flex;
  126. height: 5rem;
  127. background-image: url(@/assets/student/training/menu-item-button.png);
  128. background-size: 100% 100%;
  129. font-size: 1.2rem;
  130. width: 20rem;
  131. }
  132. .menu-item.selected {
  133. background-image: url(@/assets/student/training/menu-item-button-selected.png);
  134. }
  135. /* .exam-buttons {
  136. display:flex;
  137. align-items:start;
  138. justify-content:center;
  139. position:absolute;
  140. height:5rem;
  141. overflow:hidden;
  142. bottom:2rem;
  143. width:100%;
  144. }
  145. .exam-buttons > div {
  146. height:4rem;
  147. margin:0;
  148. margin-right:2rem;
  149. font-size:1.5rem;
  150. }*/
  151. </style>