SelfQuestionnaireProcess.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. <template>
  2. <div class="main_container hide_scrollbar">
  3. <!-- 顶部筛选与统计区域 -->
  4. <div class="page_search">
  5. <div class="search_content">
  6. <div class="content_left stats_container">
  7. <div class="stat-item">
  8. <span class="stat-num blue">{{teacherCount}}</span>
  9. <span class="stat-label">评价教师</span>
  10. </div>
  11. <div class="stat-divider"></div>
  12. <div class="stat-item">
  13. <span class="stat-num green">{{evaluationOverCount}}</span>
  14. <span class="stat-label">已评科目</span>
  15. </div>
  16. <div class="stat-divider"></div>
  17. <div class="stat-item">
  18. <span class="stat-num red">{{evaluationNotOverCount}}</span>
  19. <span class="stat-label">待评科目</span>
  20. </div>
  21. </div>
  22. <div class="content_right">
  23. <el-button class="button_border" @click="GoToElectiveSubject" >更改科目班级</el-button>
  24. </div>
  25. </div>
  26. </div>
  27. <!-- 教师卡片列表区域 -->
  28. <ul class="teacher_list">
  29. <li v-for="(item) in teacherList"
  30. :key="item.id"
  31. class="teacher_card">
  32. <div class="card_header">
  33. <div class="subject_tag" :style="{ backgroundColor: subjectToColor(item.evaluationSubjectName)?.color }">
  34. {{ item.evaluationSubjectName }}
  35. </div>
  36. <div class="info_text">
  37. <div class="teacher_name">{{ item.teacherName }}</div>
  38. <div class="class_name">{{ item.evaluationClassName }}</div>
  39. </div>
  40. </div>
  41. <div class="card_footer">
  42. <span class="status_text" :style="{color:fillOutStatusToColor(item.evaluationStatus)?.color}" >
  43. {{ fillOutStatusToColor(item.evaluationStatus)?.statusName }}
  44. </span>
  45. </div>
  46. </li>
  47. </ul>
  48. <!-- 底部操作区域 -->
  49. <div class="bottom_action">
  50. <!-- 开始评价按钮 -->
  51. <el-button class="button_background" @click="GoToFillOutQuestionnaire">开始评价</el-button>
  52. </div>
  53. </div>
  54. </template>
  55. <script setup lang="ts">
  56. import { ref, onMounted } from 'vue';
  57. import { useRouter } from 'vue-router';
  58. import { subjectToColor,fillOutStatusToColor } from '@/components/commonDictConvert';
  59. import {getEvaluationProcessMsgApi} from '@/api/selfQuestionnaireProcess'
  60. interface TeacherItm {
  61. id: string|number
  62. evaluationClassName: string //班级
  63. evaluationStatus: number //评价状态 0-待评价 1-进行中 2-已评价
  64. subjectType: number // 科目类型 0-班主任 1 科目(单科)
  65. teacherName: string //教师名称
  66. evaluationSubjectName:string //科目名称
  67. }
  68. const router = useRouter()
  69. // 基础信息数据
  70. const teacherCount = ref() // 评价教师数量
  71. const evaluationOverCount = ref() // 已评科目数量
  72. const evaluationNotOverCount = ref() //待评科目数量
  73. const deadlineTime = ref() //评价截止时间
  74. const remainTime = ref() //剩余时间
  75. // 教师列表数据
  76. const teacherList = ref<TeacherItm[]>([]);
  77. const GoToElectiveSubject = ()=>{
  78. router.push('/app/questionnaireElectiveSubject')
  79. }
  80. // 跳转到填写问卷页
  81. const GoToFillOutQuestionnaire = ()=>{
  82. // 模拟数据
  83. sessionStorage.setItem('teacherList',JSON.stringify(teacherList.value))
  84. router.push('/app/questionnaireCommit')
  85. }
  86. onMounted( async()=>{
  87. let res = await getEvaluationProcessMsgApi()
  88. if(res?.code == 200){
  89. teacherCount.value = res.data.teacherCount
  90. evaluationOverCount.value = res.data.evaluationOverCount
  91. evaluationNotOverCount.value = res.data.evaluationNotOverCount
  92. deadlineTime.value = res.data.endDateTime
  93. remainTime.value = res.data.endTime
  94. teacherList.value = res.data.dataList
  95. }
  96. })
  97. </script>
  98. <style lang="scss" scoped>
  99. .main_container {
  100. display: flex;
  101. flex-direction: column;
  102. background-color: #ffffff !important;
  103. padding:calc(16 * var(--app-rpx)) calc(12 * var(--app-rpx)) calc(90 * var(--app-rpx)) !important;
  104. .search_content{
  105. .content_right{
  106. height: auto;
  107. :deep(.button_border){
  108. width: calc(88 * var(--app-rpx));
  109. height: calc(36 * var(--app-rpx)) !important;
  110. font-size: calc(12 * var(--app-rpx));
  111. border-radius: calc(4 * var(--app-rpx));
  112. }
  113. }
  114. }
  115. /* 覆盖外部样式的一些特定调整 */
  116. .stats_container {
  117. gap: calc(20 * var(--app-rpx)) !important;
  118. align-items: center;
  119. .stat-item {
  120. display: flex;
  121. flex-direction: column;
  122. gap: calc(4 * var(--app-rpx));
  123. line-height: 1.5;
  124. .stat-num {
  125. font-weight: 600;
  126. font-size:calc(16 * var(--app-rpx));
  127. &.blue { color: #2E64FA; }
  128. &.green { color: #2BC644; }
  129. &.red { color: #F56C6C }
  130. }
  131. .stat-label {
  132. font-weight: 400;
  133. font-size:calc(12 * var(--app-rpx));
  134. color: #999999;
  135. }
  136. }
  137. .stat-divider {
  138. width: calc(1 * var(--app-rpx));
  139. height: calc(32 * var(--app-rpx));
  140. background-color: #F3F3F3;
  141. }
  142. }
  143. /* 教师列表网格布局 */
  144. .teacher_list {
  145. display: grid;
  146. grid-template-columns: repeat(2, 1fr);
  147. gap: calc(10* var(--app-rpx));
  148. margin-top: calc(16 * var(--app-rpx));
  149. .teacher_card {
  150. display: flex;
  151. flex-direction: column;
  152. height: calc(110 * var(--app-rpx));
  153. border: calc(1 * var(--app-rpx)) solid #EBEEF5;
  154. border-radius: calc(10 * var(--app-rpx)) ;
  155. cursor: pointer;
  156. .card_header {
  157. display: flex;
  158. align-items: center;
  159. gap:calc(8 * var(--app-rpx));
  160. padding:calc(14 * var(--app-rpx)) ;
  161. background: #F8FAFE;
  162. border-radius: calc(10 * var(--app-rpx)) calc(10 * var(--app-rpx)) 0px 0px;
  163. border-bottom: calc(1 * var(--app-rpx)) solid #EBEEF5;
  164. > *{
  165. flex-shrink: 0;
  166. }
  167. .subject_tag {
  168. display: flex;
  169. align-items: center;
  170. justify-content: center;
  171. width: calc(40 * var(--app-rpx));
  172. height: calc(40 * var(--app-rpx));
  173. border-radius:calc(4 * var(--app-rpx));
  174. font-weight: 600;
  175. font-size: calc(12 * var(--app-rpx));
  176. color: #FFFFFF;
  177. text-align: center;
  178. }
  179. .info_text {
  180. height: calc(40 * var(--app-rpx));
  181. display: flex;
  182. flex-direction: column;
  183. justify-content: space-between;
  184. color: #333333;
  185. .teacher_name {
  186. font-weight: 600;
  187. font-size: calc(16 * var(--app-rpx));
  188. }
  189. .class_name {
  190. font-size: calc(12 * var(--app-rpx));
  191. }
  192. }
  193. }
  194. .card_footer {
  195. flex: 1 1;
  196. display: flex;
  197. justify-content: center;
  198. align-items: center;
  199. .status_text {
  200. font-weight: 600;
  201. font-size: calc(14 * var(--app-rpx)) ;
  202. }
  203. }
  204. }
  205. }
  206. /* 底部区域 */
  207. .bottom_action {
  208. margin-top: calc(84 * var(--app-rpx)) ;
  209. margin-bottom: calc(10 * var(--app-rpx)) ;
  210. flex: 1 1;
  211. display: flex;
  212. align-items: flex-end;
  213. justify-content: center;
  214. .button_background{
  215. width:calc(100% - 16 * var(--app-rpx));
  216. height: calc(44 * var(--app-rpx));
  217. font-size: calc(16 * var(--app-rpx));
  218. border-radius: calc(4 * var(--app-rpx));
  219. font-weight: 600;
  220. }
  221. }
  222. }
  223. </style>