123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735 |
- <script setup lang="ts">
- import CpmdHeader from '@/components/CpmdHeader.vue';
- import { onMounted, onUnmounted, ref } from 'vue'
- import { menuStatusStore, userInfoStore } from '@/stores'
- import { useRouter } from 'vue-router';
- import { getDataApi } from '@/api/plan';
- import { userPlanApi, userPlanDetailApi } from '@/api/home';
- const router = useRouter()
- const menuStatus = menuStatusStore();
- menuStatus.saveActiveIndex('5')
- const userInfo = userInfoStore()
- const pageNum = ref<number>(1)
- const pageSize = ref<number>(5)
- const totol = ref<number>(0)
- const isLoading = ref<boolean>(false)
- const noMore = ref<boolean>(false)
- const list = ref<any>([])
- const getData = async () => {
- //判断总条数是否大于当前页面的数据
- //先判断
- if (totol.value == list.value.length) {
- //显示noMore
- if (totol.value == 0) {
- noMore.value = false;
- } else {
- noMore.value = true;
- }
- return
- }
-
- if (isLoading.value) {
- return
- }
- isLoading.value = true;
-
- pageNum.value++
-
- let res = await initData()
- isLoading.value = false;
- }
- const initData = async () => {
- //判断用户登录没有
- if (!userInfo.token) {
- return
- }
- let params = {
- pageNum: pageNum.value,
- pageSize: pageSize.value,
- userNo: userInfo.userInfo.userNo
- }
- let res: any = await getDataApi(params)
- if (res.code == 200) {
- //在这里需要将已经测试完成的测试计划下的---的题目都标记出来
- // list.value.push(...res.data)
- if (res.data.content.length > 0) {
- let listInit = []
- listInit.push(...res.data.content)
- // list.value.push(...res.data.content)
- //在这里进行循环--将需要显示的报告查询出来放入数组
- for (let i = 0; i < listInit.length; i++) {
- // list.value[i].listLin = []
- let params = {
- planId: listInit[i].id,
- userNo: userInfo.userInfo.userNo
- }
- let temp: any = await userPlanDetailApi(params)
-
- let scaleList = []
- for (let j = 0; j < temp.data.length; j++) {
- if (temp.data[j].isDisplayed == '1' && temp.data[j].contentType == '0') {
- scaleList.push(temp.data[j])
- }
- }
- listInit[i].scaleList = scaleList;
-
- let taskList = []
- for (let j = 0; j < temp.data.length; j++) {
- if (temp.data[j].isDisplayed == '1' && temp.data[j].contentType == '1') {
- taskList.push(temp.data[j])
- }
- }
- listInit[i].taskList = taskList;
-
-
- }
- list.value.push(...listInit)
- totol.value = res.data.totalElements
- } else {
- list.value = []
- totol.value = 0
- // totalElements
- }
- }
- }
- const planNumGet = async () => {
- if (userInfo.token) {
- let userNo = ''
- //登录的话
- //判断当前是否有后台管理
- userNo = userInfo.userInfo.userNo;
- //调用根据用户查询计划的API
- let res: any = await userPlanApi(userNo)
- userInfo.savePlanCurrentNum(res.data.length)
- }
- }
- onMounted(() => {
- initData()
- //进到界面开始轮询
- planNumGet()
- })
- const viewReport = (val: any) => {
- router.push({ name: 'report', params: { planId: val.planId, flag: val.flag } })
- { name: 'report', params: { planId: 'a', flag: 'b' } })
- { name: 'report' })
- { name: 'plan' })
- }
- onUnmounted(() => {
- })
- </script>
- <template>
- <div class="home_header_out">
- <div class=" home_header_inner">
- <CpmdHeader />
- <div style="text-align: center;">
-
- </div>
- </div>
- <div class="kply">
- <div class="kply_inner">
-
- <div style="padding: 20px 40px;">
- <div style="padding:10% 20%" v-show="list.length == 0">
- <img width="60%" style="margin-left: 20%;" src="../assets/planNo.png">
- </div>
- <div class="infinite-list-wrapper" style="overflow: auto" v-infinite-scroll="getData">
- <div v-for="item in list">
- <div class="test_record">
- <img src="../assets/kepu/task_1.png" />
- <span>{{ item.planName }}</span>
- </div>
- <div class="test_time">
- <span>测试时间:{{ item.taskStartTime }}~{{ item.taskEndTime }}</span>
- </div>
- <div class="content_out">
- <div class="content_inner">
- <div class="task_out">
- <div class="content_title">1.问答测试</div>
- <div class="task_inner">
- <div class="task_inner_single" v-for="subItem in item.scaleList"
- :key="subItem.id">
- <div class="task_inner_one">
- <img style="width: 80px;height: 80px"
- src="../assets/kepu/xlwht_active.png" alt="">
- <div class="task_content">
- <div class="title">{{ subItem.name }}</div>
- {{
- subItem.expectTime }
- <div class="des" v-show="subItem.isCompleted == '1'">实际用时:{{
- subItem.useTime }}</div>
-
- <div class="isCompleted" v-show="subItem.isCompleted == '1'">
- <div @click="viewReport(subItem)"
- class='isCompleted_status'> 查看报告</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="task_out">
- <div class="content_title">2.认知评估</div>
- <div class="task_inner">
- <div class="task_inner_single" v-for="subItem in item.taskList">
- <div class="task_inner_one">
- <img style="width: 80px;height: 80px"
- src="../assets/kepu/xlwht_active.png" alt="">
- <div class="task_content">
- <div class="title">{{ subItem.name }}</div>
- {{
- subItem.expectTime }
- <div class="des" v-show="subItem.isCompleted == '1'">实际用时:{{
- subItem.useTime }}</div>
-
- <div class="isCompleted" v-show="subItem.isCompleted == '1'">
- <div @click="viewReport(subItem)"
- class='isCompleted_status'> 查看报告</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div></div>
- </div>
-
- {{ item.score }
- </div>
- <div style="text-align: center;margin-top:20px" v-show="isLoading">努力加载中...</div>
- <div style="text-align: center;;margin-top:20px" v-show="noMore">没有更多了</div>
- </div>
-
- </div>
- </div>
- </div>
- </div>
- </template>
- <style lang="scss" scoped>
- .home_header_out {
- // position: relative;
- padding-bottom: 60px;
- width: 100%;
- min-width: 1200px;
- background-image: url('../assets/home/bg_ty.png');
- background-repeat: no-repeat;
- background-size: contain;
- flex: 1;
- background-color: #B3F1DA; //估计是需要动态
- //获取屏幕宽度home_header_out 这个div的宽度--然后宽度*1000再除1920即为当前div的宽度
- .home_header_inner {
- min-height: 1;
- left: 0;
- right: 0;
- margin: auto;
- // height: 100px;
- width: 1200px;
- .xlts_img {
- height: 60px;
- }
- }
- .kply {
- width: 100%;
- margin-top: 40px;
- // background-color: #FAFAFA;
- .kply_inner {
- // padding: 20px 20px;
- left: 0;
- right: 0;
- margin: auto;
- width: 1200px;
- background-color: #ffffff;
- border-radius: 40px;
- // margin-bottom: 20px;
- // height: 1000px;
- .infinite-list-wrapper {
- // max-height: 900px;
- // max-height: 500px;
- // min-height: 500px;
- .kepu_title {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- .kepu_title_des {
- font-family: Alibaba PuHuiTi 2.0;
- font-weight: 600;
- font-size: 30px;
- color: #000000;
- }
- .home_mid_plan_button {
- width: 100%;
- display: flex;
- flex-direction: row;
- justify-content: end;
- // text-align: right;
- .pub_button {
- cursor: pointer;
- // width: 100px;
- border-radius: 12px;
- border: 3px solid #48D68E;
- color: #ffffff;
- background-color: #000000;
- padding: 8px 30px;
- cursor: pointer;
- display: flex;
- align-items: center;
- }
- }
- }
- .com_out {
- min-height: 500px;
- padding: 20px 20px;
- }
- .test_record {
- margin-top: 20px;
- display: flex;
- align-items: center;
- img {
- width: 70px;
- }
- span {
- margin-left: 20px;
- font-size: 28px;
- font-weight: 700;
- letter-spacing: 3px;
- }
- }
- .test_time {
- margin-bottom: 10px;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- span {
- color: #000000;
- opacity: 0.4;
- font-size: 20px;
- }
- div {
- cursor: pointer;
- // width: 100px;
- border-radius: 12px;
- border: 3px solid #48D68E;
- color: #ffffff;
- background-color: #000000;
- margin-right: 20px;
- padding: 8px 30px;
- cursor: pointer;
- display: flex;
- align-items: center;
- }
- }
- .record_out {
- margin-top: 30px;
- background-color: #F7F7F7;
- padding: 30px 40px;
- border-radius: 40px;
- .record_score {
- color: #48D68E;
- margin-bottom: 5px;
- font-size: 20px;
- letter-spacing: 3px;
- }
- .record_result {
- line-height: 30px;
- color: #48D68E;
- margin-bottom: 10px;
- font-size: 20px;
- letter-spacing: 3px;
- }
- }
- .content_out {
- display: flex;
- flex-direction: column;
- width: 100%;
- // height: 200px;
- background-color: #F7F7F7;
- border-radius: 40px;
- .content_inner {
- padding: 20px 40px;
- .content_title {
- margin-bottom: 0px;
- font-weight: 700;
- font-size: 18px;
- }
- .content_one {
- border-radius: 20px;
- // padding: 10px 20px;
- display: flex;
- background-color: #ffffff;
- width: 45%;
- align-items: center;
- .content_single {
- border-radius: 20px;
- padding: 10px 20px;
- display: flex;
- background-color: #ffffff;
- width: 45%;
- align-items: center;
- .content_detail {
- display: flex;
- margin-left: 15px;
- justify-content: start;
- height: 80px;
- flex-direction: column;
- .title {
- font-weight: 700;
- font-size: 18px;
- }
- .des {
- color: #999999;
- font-size: 14px;
- }
- }
- }
- }
- .task_out {
- margin-top: 20px;
- display: flex;
- flex-direction: column;
- .task_inner {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- flex-wrap: wrap;
- .task_inner_single {
- margin-top: 20px;
- height: 100px;
- border-radius: 20px;
- width: 45%;
- display: flex;
- flex-direction: row;
- background-color: #ffffff;
- align-items: center;
- .task_inner_one {
- padding: 10px 20px;
- border-radius: 20px;
- width: 100%;
- display: flex;
- flex-direction: row;
- background-color: #ffffff;
- align-items: center;
- .task_content {
- height: 80px;
- margin-left: 10px;
- display: flex;
- flex-direction: column;
- width: 100%;
- .title {
- font-weight: 700;
- font-size: 18px;
- width: 100%;
- letter-spacing: 2px;
- }
- .des {
- color: #999999;
- font-size: 14px;
- line-height: 24px;
- letter-spacing: 2px;
- }
- .noCompleted {
- width: 100%;
- color: #ffffff;
- display: flex;
- justify-content: end;
- .noCompleted_status {
- line-height: 24px;
- font-size: 14px;
- border-radius: 20px;
- text-align: center;
- right: 0px;
- width: 70px;
- background-color: red;
- }
- }
- .isCompleted {
- width: 100%;
- color: #ffffff;
- display: flex;
- justify-content: end;
- .isCompleted_status {
- padding-left: 10px;
- padding-right: 10px;
- line-height: 30px;
- font-size: 14px;
- border-radius: 4px;
- text-align: center;
- right: 0px;
- width: 70px;
- border-radius: 12px;
- border: 3px solid #48D68E;
- color: #ffffff;
- background-color: #000000;
- cursor: pointer
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- .home_mid {
- // background-color: blanchedalmond;
- width: 1200px;
- left: 0;
- right: 0;
- margin: auto;
- margin-top: 40px;
- // position: relative;
- .kepu_title {
- text-align: center;
- font-size: 50px;
- color: #111111;
- line-height: 95px;
- // width: 100%;
- // left: 0;
- // right: 0;
- // margin: auto
- }
- .kepu_title_sub {
- margin-top: 30px;
- text-align: center;
- font-size: 28px;
- color: #48D68E;
- line-height: 26px;
- }
- .man1_group {
- margin-top: 60px;
- height: 100%;
- display: flex;
- .man1 {
- position: relative;
- width: 327px;
- // height: 100%;
- // height: 100%
- .man1_img {
- position: absolute;
- bottom: 0;
- /* bottom: 0px; */
- /* height: auto; */
- width: 100%;
- left: 100px
- }
- }
- .des {
- border: #48D68E solid 5px;
- border-radius: 40px;
- padding: 20px;
- letter-spacing: 6px;
- flex: 1;
- .des_inner {
- border: 1px dashed #48D68E;
- border-radius: 40px;
- padding-bottom: 40px;
- padding-top: 30px;
- padding-left: 100px;
- padding-right: 20px;
- letter-spacing: 6px;
- font-weight: normal;
- font-size: 24px;
- color: #333333;
- line-height: 40px;
- }
- }
- }
- .man2_group {
- margin-top: 60px;
- height: 100%;
- display: flex;
- .man2 {
- position: relative;
- width: 327px;
- // height: 100%;
- // height: 100%
- .man2_img {
- position: absolute;
- bottom: 0;
- /* bottom: 0px; */
- /* height: auto; */
- width: 100%;
- left: -100px
- }
- }
- .des2 {
- border: #48D68E solid 5px;
- border-radius: 40px;
- padding: 20px;
- letter-spacing: 6px;
- flex: 1;
- .des2_inner {
- border: 1px dashed #48D68E;
- border-radius: 40px;
- padding-bottom: 40px;
- padding-top: 30px;
- padding-left: 20px;
- padding-right: 100px;
- letter-spacing: 6px;
- font-weight: normal;
- font-size: 24px;
- color: #333333;
- line-height: 40px;
- }
- }
- }
- .get_more {
- text-align: center;
- img {
- width: 300px;
- margin-top: 60px;
- margin-bottom: 60px;
- }
- }
- }
- // .home_footer_out {
- // width: 100%;
- // background-color: #000000;
- // }</style>
|