TestRecord.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858
  1. <script setup lang="ts">
  2. import CpmdHeader from '@/components/CpmdHeader.vue';
  3. import { onMounted, onUnmounted, ref } from 'vue'
  4. import { getUnread } from '../utils/test'
  5. //持久化设置 菜单状态
  6. import { menuStatusStore, userInfoStore } from '@/stores'
  7. // import router from '@/router';
  8. import { useRouter } from 'vue-router';
  9. import { getDataApi } from '@/api/plan';
  10. import { userPlanApi, userPlanDetailApi } from '@/api/home';
  11. const router = useRouter()
  12. const menuStatus = menuStatusStore();
  13. menuStatus.saveActiveIndex('5')
  14. const userInfo = userInfoStore()
  15. //分页设计
  16. //当前页
  17. //是哪一页
  18. const pageNum = ref<number>(1)
  19. //一页显示多少条
  20. const pageSize = ref<number>(5)
  21. //数据总共多少条
  22. const totol = ref<number>(0)
  23. //显示是否是在加载中
  24. const isLoading = ref<boolean>(false)
  25. //是否显示noMore
  26. const noMore = ref<boolean>(false)
  27. //页面返回的数据
  28. const list = ref<any>([])
  29. //获取数据报
  30. const getData = async () => {
  31. //判断总条数是否大于当前页面的数据
  32. //先判断
  33. if (totol.value == list.value.length) {
  34. //显示noMore
  35. if (totol.value == 0) {
  36. noMore.value = false;
  37. } else {
  38. noMore.value = true;
  39. }
  40. return
  41. }
  42. //先是加载中的话就不加载了
  43. if (isLoading.value) {
  44. return
  45. }
  46. isLoading.value = true;
  47. //参数构造
  48. pageNum.value++
  49. //到这里就可以显示加载中
  50. let res = await initData()
  51. isLoading.value = false;
  52. }
  53. const initData = async () => {
  54. //判断用户登录没有
  55. if (!userInfo.token) {
  56. return
  57. }
  58. let params = {
  59. pageNum: pageNum.value,
  60. pageSize: pageSize.value,
  61. userNo: userInfo.userInfo.userNo
  62. }
  63. let res: any = await getDataApi(params)
  64. if (res.code == 200) {
  65. //在这里需要将已经测试完成的测试计划下的---的题目都标记出来
  66. // list.value.push(...res.data)
  67. if (res.data.content.length > 0) {
  68. let listInit = []
  69. listInit.push(...res.data.content)
  70. // list.value.push(...res.data.content)
  71. //在这里进行循环--将需要显示的报告查询出来放入数组
  72. for (let i = 0; i < listInit.length; i++) {
  73. // list.value[i].listLin = []
  74. let params = {
  75. planId: listInit[i].id,
  76. userNo: userInfo.userInfo.userNo
  77. }
  78. let temp: any = await userPlanDetailApi(params)
  79. //在这里循环//且类型等于0 量表的 得到量表的列表
  80. let scaleList = []
  81. for (let j = 0; j < temp.data.length; j++) {
  82. if (temp.data[j].isDisplayed == '1' && temp.data[j].contentType == '0') {
  83. if (temp.data[j].flag != '20210617140713') {
  84. scaleList.push(temp.data[j])
  85. }
  86. }
  87. }
  88. listInit[i].scaleList = scaleList;
  89. //在这里循环 //且类型为等于1的量表 得到量表列表
  90. let taskList = []
  91. for (let j = 0; j < temp.data.length; j++) {
  92. if (temp.data[j].isDisplayed == '1' && temp.data[j].contentType == '1') {
  93. taskList.push(temp.data[j])
  94. }
  95. }
  96. listInit[i].taskList = taskList;
  97. // list.value[i].list = temp.data
  98. // list.value[i].listLin = []
  99. }
  100. list.value.push(...listInit)
  101. totol.value = res.data.totalElements
  102. } else {
  103. list.value = []
  104. totol.value = 0
  105. // totalElements
  106. }
  107. }
  108. }
  109. //先判断总条数是否等于 当前页面的参数
  110. //如果等于的话--显示nomore
  111. //如果总条数大于 当前页面的总条数就显示loading
  112. //刚进入页面就将高度设置为页面需要的
  113. onMounted(() => {
  114. initData()
  115. if (userInfo.token) {
  116. getUnread()
  117. }
  118. //进到界面开始轮询
  119. })
  120. //界面销毁函数
  121. //跳转页面切换页面
  122. const viewReport = (val: any) => {
  123. debugger;
  124. router.push({ name: 'report', params: { planId: val.planId, flag: val.flag, name: val.name } })
  125. // router.push({ name: 'report', params: { planId: 'a', flag: 'b' } })
  126. // router.push({ name: 'report' })
  127. // router.push({ name: 'plan' })
  128. }
  129. //轮旋切换页面的方法
  130. //退出页面销毁 方法
  131. onUnmounted(() => {
  132. })
  133. </script>
  134. <template>
  135. <div class="home_header_out">
  136. <div class=" home_header_inner">
  137. <CpmdHeader />
  138. <div style="text-align: center;">
  139. <!-- <img class="xlts_img" style="margin-top:40px" src="../assets/home/other_text.png" /> -->
  140. </div>
  141. </div>
  142. <div class="leave_message">
  143. <!-- <img class="img" src="../assets/zs/community.png" alt=""> -->
  144. <div class="font_blue"> 测试记录 </div>
  145. </div>
  146. <div class="kply">
  147. <div class="kply_inner">
  148. <!-- -->
  149. <div>
  150. <!-- <div style="width: 1200px;margin-left:32px; box-shadow: 0px 4px 32px 0px rgba(0,0,0,0.17);"
  151. v-show="list.length == 0">
  152. <img width="400px" src="../assets/planNo.png">
  153. </div> -->
  154. <div style="box-shadow: 0px 4px 32px 0px rgba(0,0,0,0.17);width: 1200px;margin-left:32px"
  155. v-show="list.length == 0">
  156. <div style="padding:10% 20%;display: flex;justify-content: center ;">
  157. <!-- <img width="100%" src="../assets/planNo.png"> -->
  158. <img width="400px" src=" ../assets/planNo.png">
  159. </div>
  160. </div>
  161. <div class="infinite-list-wrapper" style="overflow: auto" v-infinite-scroll="getData">
  162. <div>
  163. <div v-for="item in list" class='record_zt'>
  164. <div class="test_record">
  165. <span class="test_plan_name">{{ item.planName }}
  166. <span class="unread_status" style="" v-show="item.isRead == 0">未读</span>
  167. <span class="read_status" v-show="item.isRead == 1">已读</span>
  168. </span>
  169. </div>
  170. <div class="test_time">
  171. <span>测试时间:{{ item.taskStartTime }}~{{ item.taskEndTime }}</span>
  172. </div>
  173. <div class="content_out">
  174. <div class="content_inner">
  175. <div class="task_out">
  176. <div class="content_title">1.问答测试</div>
  177. <div class="task_inner">
  178. <div class="task_inner_single" v-for="subItem in item.scaleList"
  179. :key="subItem.id">
  180. <div class="task_inner_one">
  181. <img style="width: 80px;height: 80px"
  182. src="../assets/kepu/xlwht_active.png" alt="">
  183. <div class="task_content">
  184. <div class="title">{{ subItem.name }}</div>
  185. <!-- <div class="des" v-show="subItem.isCompleted != '1'">预计用时:{{
  186. subItem.expectTime }}</div> -->
  187. <div class="des" v-show="subItem.isCompleted == '1'">实际用时:{{
  188. subItem.useTime }}</div>
  189. <!-- <div class="noCompleted" v-show="subItem.isCompleted != '1'">
  190. <div class='noCompleted_status'> 未完成</div>
  191. </div> -->
  192. <div class="isCompleted"
  193. v-show="subItem.isCompleted == '1'">
  194. <div @click="viewReport(subItem)"
  195. class='isCompleted_status'> 查看报告 <img
  196. style='height: 12px;margin-left:4px'
  197. src='../assets/zs/jian.png' /></div>
  198. </div>
  199. <!-- {{ subItem.isRequired }} -->
  200. <div class="isMust" v-show="subItem.isRequired == '1'">必做
  201. </div>
  202. <div class="isChoosable" v-show="subItem.isRequired == '0'">
  203. 选做
  204. </div>
  205. </div>
  206. </div>
  207. </div>
  208. </div>
  209. </div>
  210. <div class="task_out">
  211. <div class="content_title">2.认知评估</div>
  212. <div class="task_inner">
  213. <div class="task_inner_single" v-for="subItem in item.taskList">
  214. <div class="task_inner_one">
  215. <img style="width: 80px;height: 80px"
  216. src="../assets/kepu/task_active.png" alt="">
  217. <div class="task_content">
  218. <div class="title">{{ subItem.name }}</div>
  219. <!-- <div class="des" v-show="subItem.isCompleted != '1'">预计用时:{{
  220. subItem.expectTime }}</div> -->
  221. <div class="des" v-show="subItem.isCompleted == '1'">实际用时:{{
  222. subItem.useTime }}</div>
  223. <!-- <div class="noCompleted" v-show="subItem.isCompleted != '1'">
  224. <div class='noCompleted_status'> 未完成</div>
  225. </div> -->
  226. <div class="isCompleted"
  227. v-show="subItem.isCompleted == '1'">
  228. <div @click="viewReport(subItem)"
  229. class='isCompleted_status'> 查看报告 <img
  230. style='height: 12px;margin-left:4px'
  231. src='../assets/zs/jian.png' /></div>
  232. </div>
  233. <div class="isMust" v-show="subItem.isRequired == '1'">必做
  234. </div>
  235. <div class="isChoosable" v-show="subItem.isRequired == '0'">
  236. 选做
  237. </div>
  238. </div>
  239. </div>
  240. </div>
  241. </div>
  242. </div>
  243. </div>
  244. <div></div>
  245. </div>
  246. <!-- <div class="record_out">
  247. <div class="record_score">
  248. <span>得&nbsp;&nbsp;&nbsp;&nbsp;分:</span>
  249. <span>{{ item.score }}</span>
  250. </div>
  251. <div class="record_result">
  252. <span>结&nbsp;&nbsp;&nbsp;&nbsp;论:</span>
  253. </div>
  254. </div> -->
  255. </div>
  256. </div>
  257. <div style="text-align: center;margin-top:20px" v-show="isLoading">努力加载中...</div>
  258. <div style="text-align: center;;margin-top:20px" v-show="noMore">没有更多了</div>
  259. </div>
  260. <!-- 测试记录列表 -->
  261. </div>
  262. </div>
  263. </div>
  264. </div>
  265. </template>
  266. <style lang="scss" scoped>
  267. .home_header_out {
  268. scroll-snap-align: start;
  269. // position: relative;
  270. padding-bottom: 60px;
  271. width: 100%;
  272. min-width: 1200px;
  273. // background-image: url('../assets/home/bg_ty.png');
  274. background-repeat: no-repeat;
  275. background-size: contain;
  276. flex: 1;
  277. // background-color: #B3F1DA; //估计是需要动态
  278. //获取屏幕宽度home_header_out 这个div的宽度--然后宽度*1000再除1920即为当前div的宽度
  279. .home_header_inner {
  280. min-height: 1;
  281. left: 0;
  282. right: 0;
  283. margin: auto;
  284. // height: 100px;
  285. width: 100%;
  286. .xlts_img {
  287. height: 60px;
  288. }
  289. }
  290. .leave_message {
  291. left: 0;
  292. right: 0;
  293. margin: auto;
  294. width: 1200px;
  295. margin-bottom: 20px;
  296. margin-top: 20px;
  297. .font_blue {
  298. position: relative;
  299. color: #00DE7E;
  300. font-weight: 700;
  301. font-size: 22px;
  302. font-family: 'Rammetto One-Regular';
  303. padding-top: 30px;
  304. z-index: 10;
  305. background: url(../assets/zs/test_record1.png) no-repeat;
  306. background-size: auto 50px;
  307. }
  308. }
  309. .kply {
  310. width: 100%;
  311. // background-color: #FAFAFA;
  312. .kply_inner {
  313. // padding: 20px 20px;
  314. left: 0;
  315. right: 0;
  316. margin: auto;
  317. width: 1264px;
  318. background-color: #ffffff;
  319. border-radius: 40px;
  320. // margin-bottom: 20px;
  321. // height: 1000px;
  322. .infinite-list-wrapper {
  323. padding: 32px;
  324. // max-height: 900px;
  325. // max-height: 500px;
  326. // min-height: 500px;
  327. .record_zt {
  328. box-shadow: 0px 4px 32px 0px rgba(0, 0, 0, 0.17);
  329. margin-bottom: 40px;
  330. box-sizing: border-box;
  331. padding: 32px 20px;
  332. }
  333. .kepu_title {
  334. display: flex;
  335. flex-direction: row;
  336. justify-content: space-between;
  337. align-items: center;
  338. .kepu_title_des {
  339. font-family: Alibaba PuHuiTi 2.0;
  340. font-weight: 600;
  341. font-size: 30px;
  342. color: #000000;
  343. }
  344. .home_mid_plan_button {
  345. width: 100%;
  346. display: flex;
  347. flex-direction: row;
  348. justify-content: end;
  349. // text-align: right;
  350. .pub_button {
  351. cursor: pointer;
  352. // width: 100px;
  353. border-radius: 12px;
  354. border: 3px solid #48D68E;
  355. color: #ffffff;
  356. background-color: #000000;
  357. padding: 8px 30px;
  358. cursor: pointer;
  359. display: flex;
  360. align-items: center;
  361. }
  362. }
  363. }
  364. .com_out {
  365. min-height: 500px;
  366. padding: 20px 20px;
  367. }
  368. .test_record {
  369. display: flex;
  370. align-items: center;
  371. img {
  372. width: 50px;
  373. }
  374. .test_plan_name {
  375. background-image: url('../assets/zs/plan_line.png');
  376. background-repeat: no-repeat;
  377. background-size: contain;
  378. padding-bottom: 10px;
  379. background-position: bottom;
  380. position: relative;
  381. .read_status {
  382. font-size: 14px;
  383. line-height: 24px;
  384. font-weight: 100;
  385. background-color: #DEDEDE;
  386. color: #333333;
  387. width: 50px;
  388. top: -20px;
  389. text-align: center;
  390. border-radius: 6px;
  391. position: absolute;
  392. }
  393. .unread_status {
  394. font-size: 14px;
  395. line-height: 24px;
  396. font-weight: 100;
  397. background-color: #00DE7E;
  398. color: #ffffff;
  399. width: 50px;
  400. top: -20px;
  401. text-align: center;
  402. border-radius: 6px;
  403. position: absolute;
  404. }
  405. }
  406. span {
  407. font-size: 22px;
  408. font-weight: 700;
  409. letter-spacing: 3px;
  410. }
  411. }
  412. .test_time {
  413. margin-bottom: 10px;
  414. display: flex;
  415. flex-direction: row;
  416. justify-content: space-between;
  417. align-items: center;
  418. span {
  419. color: #000000;
  420. opacity: 0.4;
  421. font-size: 18px;
  422. }
  423. div {
  424. cursor: pointer;
  425. // width: 100px;
  426. border-radius: 12px;
  427. border: 3px solid #48D68E;
  428. color: #ffffff;
  429. background-color: #000000;
  430. margin-right: 20px;
  431. padding: 8px 30px;
  432. cursor: pointer;
  433. display: flex;
  434. align-items: center;
  435. }
  436. }
  437. .record_out {
  438. margin-top: 30px;
  439. background-color: #F7F7F7;
  440. padding: 30px 40px;
  441. border-radius: 40px;
  442. .record_score {
  443. color: #48D68E;
  444. margin-bottom: 5px;
  445. font-size: 20px;
  446. letter-spacing: 3px;
  447. }
  448. .record_result {
  449. line-height: 30px;
  450. color: #48D68E;
  451. margin-bottom: 10px;
  452. font-size: 20px;
  453. letter-spacing: 3px;
  454. }
  455. }
  456. .content_out {
  457. display: flex;
  458. flex-direction: column;
  459. width: 100%;
  460. // height: 200px;
  461. background-color: #F7F7F7;
  462. border-radius: 5px;
  463. .content_inner {
  464. padding: 20px 40px;
  465. .content_title {
  466. margin-bottom: 0px;
  467. font-weight: 700;
  468. font-size: 18px;
  469. }
  470. .content_one {
  471. border-radius: 20px;
  472. // padding: 10px 20px;
  473. display: flex;
  474. background-color: #ffffff;
  475. width: 45%;
  476. align-items: center;
  477. .content_single {
  478. border-radius: 20px;
  479. padding: 10px 20px;
  480. display: flex;
  481. background-color: #ffffff;
  482. width: 45%;
  483. align-items: center;
  484. .content_detail {
  485. display: flex;
  486. margin-left: 15px;
  487. justify-content: start;
  488. height: 80px;
  489. flex-direction: column;
  490. .title {
  491. font-weight: 700;
  492. font-size: 18px;
  493. }
  494. .des {
  495. color: #999999;
  496. font-size: 14px;
  497. }
  498. }
  499. }
  500. }
  501. .task_out {
  502. margin-top: 20px;
  503. display: flex;
  504. flex-direction: column;
  505. .task_inner {
  506. display: flex;
  507. flex-direction: row;
  508. justify-content: space-between;
  509. flex-wrap: wrap;
  510. .task_inner_single {
  511. margin-top: 20px;
  512. height: 100px;
  513. border-radius: 20px;
  514. width: 45%;
  515. display: flex;
  516. flex-direction: row;
  517. background-color: #ffffff;
  518. align-items: center;
  519. .task_inner_one {
  520. padding: 10px 20px;
  521. border-radius: 20px;
  522. width: 100%;
  523. display: flex;
  524. flex-direction: row;
  525. background-color: #ffffff;
  526. align-items: center;
  527. .task_content {
  528. position: relative;
  529. height: 80px;
  530. margin-left: 10px;
  531. display: flex;
  532. flex-direction: column;
  533. width: 100%;
  534. .isMust {
  535. position: absolute;
  536. right: 0;
  537. background-color: #00DE7E;
  538. font-size: 10px;
  539. color: #ffffff;
  540. padding: 4px 10px;
  541. border-radius: 3px;
  542. }
  543. .isChoosable {
  544. position: absolute;
  545. right: 0;
  546. background-color: #E1E1E1;
  547. font-size: 10px;
  548. color: #7D7D7D;
  549. padding: 4px 10px;
  550. border-radius: 3px;
  551. border: 1px solid #00DE7E;
  552. }
  553. .title {
  554. font-weight: 700;
  555. font-size: 18px;
  556. width: 100%;
  557. letter-spacing: 2px;
  558. }
  559. .des {
  560. color: #999999;
  561. font-size: 14px;
  562. line-height: 24px;
  563. letter-spacing: 2px;
  564. }
  565. .noCompleted {
  566. width: 100%;
  567. color: #ffffff;
  568. display: flex;
  569. justify-content: end;
  570. .noCompleted_status {
  571. line-height: 24px;
  572. font-size: 14px;
  573. border-radius: 20px;
  574. text-align: center;
  575. right: 0px;
  576. width: 70px;
  577. background-color: red;
  578. }
  579. }
  580. .isCompleted {
  581. width: 100%;
  582. color: #ffffff;
  583. display: flex;
  584. justify-content: end;
  585. .isCompleted_status {
  586. padding: 8px 20px;
  587. display: flex;
  588. line-height: 18px;
  589. font-size: 14px;
  590. align-items: center;
  591. text-align: center;
  592. right: 0px;
  593. width: 70px;
  594. border-radius: 4px;
  595. border: 1px solid #48D68E;
  596. color: #ffffff;
  597. background-color: #3B3B3B;
  598. cursor: pointer
  599. }
  600. }
  601. }
  602. }
  603. }
  604. }
  605. }
  606. }
  607. }
  608. }
  609. }
  610. }
  611. }
  612. .home_mid {
  613. // background-color: blanchedalmond;
  614. width: 1200px;
  615. left: 0;
  616. right: 0;
  617. margin: auto;
  618. margin-top: 40px;
  619. // position: relative;
  620. .kepu_title {
  621. text-align: center;
  622. font-size: 50px;
  623. color: #111111;
  624. line-height: 95px;
  625. // width: 100%;
  626. // left: 0;
  627. // right: 0;
  628. // margin: auto
  629. }
  630. .kepu_title_sub {
  631. margin-top: 30px;
  632. text-align: center;
  633. font-size: 28px;
  634. color: #48D68E;
  635. line-height: 26px;
  636. }
  637. .man1_group {
  638. margin-top: 60px;
  639. height: 100%;
  640. display: flex;
  641. .man1 {
  642. position: relative;
  643. width: 327px;
  644. // height: 100%;
  645. // height: 100%
  646. .man1_img {
  647. position: absolute;
  648. bottom: 0;
  649. /* bottom: 0px; */
  650. /* height: auto; */
  651. width: 100%;
  652. left: 100px
  653. }
  654. }
  655. .des {
  656. border: #48D68E solid 5px;
  657. border-radius: 40px;
  658. padding: 20px;
  659. letter-spacing: 6px;
  660. flex: 1;
  661. .des_inner {
  662. border: 1px dashed #48D68E;
  663. border-radius: 40px;
  664. padding-bottom: 40px;
  665. padding-top: 30px;
  666. padding-left: 100px;
  667. padding-right: 20px;
  668. letter-spacing: 6px;
  669. font-weight: normal;
  670. font-size: 24px;
  671. color: #333333;
  672. line-height: 40px;
  673. }
  674. }
  675. }
  676. .man2_group {
  677. margin-top: 60px;
  678. height: 100%;
  679. display: flex;
  680. .man2 {
  681. position: relative;
  682. width: 327px;
  683. // height: 100%;
  684. // height: 100%
  685. .man2_img {
  686. position: absolute;
  687. bottom: 0;
  688. /* bottom: 0px; */
  689. /* height: auto; */
  690. width: 100%;
  691. left: -100px
  692. }
  693. }
  694. .des2 {
  695. border: #48D68E solid 5px;
  696. border-radius: 40px;
  697. padding: 20px;
  698. letter-spacing: 6px;
  699. flex: 1;
  700. .des2_inner {
  701. border: 1px dashed #48D68E;
  702. border-radius: 40px;
  703. padding-bottom: 40px;
  704. padding-top: 30px;
  705. padding-left: 20px;
  706. padding-right: 100px;
  707. letter-spacing: 6px;
  708. font-weight: normal;
  709. font-size: 24px;
  710. color: #333333;
  711. line-height: 40px;
  712. }
  713. }
  714. }
  715. .get_more {
  716. text-align: center;
  717. img {
  718. width: 300px;
  719. margin-top: 60px;
  720. margin-bottom: 60px;
  721. }
  722. }
  723. }
  724. // .home_footer_out {
  725. // width: 100%;
  726. // background-color: #000000;
  727. // }</style>