assessmentSelect.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <template>
  2. <div class="assessmentSelect">
  3. <NavMenus :back-confirm="false" ></NavMenus>
  4. <div class="content" >
  5. <!-- <div class="card liLunKaoHe" >
  6. <div class="txt" >
  7. 理论考核
  8. </div>
  9. </div>
  10. <div class="card shiJiKaoHe" >
  11. <div class="txt" >
  12. 实训考核
  13. </div>
  14. </div> -->
  15. <div
  16. @click="itemClick(item)"
  17. :class="'card ' + (item.class)"
  18. v-for="(item, index) of list" :key="index" >
  19. <div class="txt" >
  20. {{ item.txt }}
  21. </div>
  22. </div>
  23. </div>
  24. </div>
  25. </template>
  26. <script setup lang="ts">
  27. import { reactive, onMounted, ref } from 'vue';
  28. import ItemCard from './itemCard.vue';
  29. import NavMenus from '../components/navMenus.vue';
  30. import StepTips from '../components/stepTips.vue';
  31. import { useUserInfo } from '@/stores/userInfo';
  32. import { useRoute } from 'vue-router';
  33. import router from '@/router/index';
  34. //import { ElLoading } from 'element-plus';
  35. import { getTrainSelfByTid } from '@/api/student/trainMian';
  36. const userInfo = useUserInfo();
  37. const route = useRoute();
  38. const state: anyObj = reactive({
  39. trainingProgress: {
  40. show: true,
  41. name: '课程进度',
  42. percent: 0,
  43. },
  44. tipsMsg: '点击上方【实训学习】开始/继续学习。',
  45. taskId: route.params.taskId as string,
  46. trainDetail: {},
  47. trainSelf: {},
  48. });
  49. let list = ref([
  50. {
  51. "class" : "liLunKaoHe",
  52. "txt" : "理论考核",
  53. },
  54. {
  55. "class" : "shiJiKaoHe",
  56. "txt" : "实训考核",
  57. },
  58. ]);
  59. const itemClick = (json: any) => {
  60. console.log("itemClick json", json);
  61. switch(json.class) {
  62. case 'liLunKaoHe':
  63. break;
  64. case 'shiJiKaoHe':
  65. break;
  66. }
  67. };
  68. onMounted(() => {
  69. getTrainSelfByTid(state.taskId).then((res) => {
  70. state.trainSelf = res.data.data;
  71. const percent = state.trainSelf.studyProgress < 0 ? 0 : state.trainSelf.studyProgress > 1 ? 1 : state.trainSelf.studyProgress;
  72. state.trainingProgress.percent = percent * 100;
  73. if (state.trainSelf.isSubmit) {
  74. state.tipsMsg = '任务已完成,共享报告中可选择需要的文件下载查看。';
  75. }
  76. else if (percent == 1) {
  77. state.tipsMsg = '实训学习已完成,点击上方【技术报告编制】开始或继续编写报告。';
  78. }
  79. console.log("--- state.trainSelf ---", state.trainSelf);
  80. });
  81. });
  82. </script>
  83. <style lang="scss" scoped>
  84. .assessmentSelect {
  85. position: absolute;
  86. width: 100%;
  87. height: 100%;
  88. display: flex;
  89. justify-content: center;
  90. align-items: center;
  91. .content {
  92. .card {
  93. position: relative;
  94. width: 31.85rem;
  95. height: 42.71rem;
  96. display: inline-block;
  97. margin: 0px 3.21rem 0px 3.21rem;
  98. // 手势
  99. cursor:pointer;
  100. background-size: 100% auto;
  101. background-repeat: no-repeat;
  102. background-position: center center;
  103. .txt {
  104. position: absolute;
  105. width: 100%;
  106. font-weight: 500;
  107. font-size: 2.5rem;
  108. color: #BBD3CF;
  109. text-align: center;
  110. bottom: 9.64rem;
  111. }
  112. }
  113. .liLunKaoHe {
  114. background-image: url(/src/assets/student/step/new/LiLunKaoHe_No.webp);
  115. }
  116. .liLunKaoHe:hover {
  117. background-image: url(/src/assets/student/step/new/LiLunKaoHe_Yes.webp);
  118. .txt {
  119. color: #9DFFD7;
  120. }
  121. }
  122. .shiJiKaoHe {
  123. background-image: url(/src/assets/student/step/new/ShiJiKaoHe_No.webp);
  124. }
  125. .shiJiKaoHe:hover {
  126. background-image: url(/src/assets/student/step/new/ShiJiKaoHe_Yes.webp);
  127. .txt {
  128. color: #9DFFD7;
  129. }
  130. }
  131. }
  132. }
  133. </style>