|
@@ -2,36 +2,51 @@
|
|
<div class="maturity-game-page" v-loading="pageLoading">
|
|
<div class="maturity-game-page" v-loading="pageLoading">
|
|
<head-component :headinfo=headinfo></head-component>
|
|
<head-component :headinfo=headinfo></head-component>
|
|
<div class="page-content">
|
|
<div class="page-content">
|
|
- <div class="content-left"></div>
|
|
|
|
- <div class="content-center">
|
|
|
|
- <div class="content-img">
|
|
|
|
- <img src="@/assets/images/wakeup/maturity/shadow-bg.png" >
|
|
|
|
- <div v-for="(item,index) in maturityAppraisalData">
|
|
|
|
- <p v-show="index===0?true:false">{{item.questionTitle}}</p>
|
|
|
|
|
|
+ <div class="page-box">
|
|
|
|
+ <div class="content-left"></div>
|
|
|
|
+ <div class="content-center">
|
|
|
|
+ <div class="content-img">
|
|
|
|
+ <img src="@/assets/images/wakeup/maturity/shadow-bg.png">
|
|
|
|
+ <div v-for="(item,index) in maturityAppraisalData">
|
|
|
|
+ <p v-show="index===0?true:false">{{ item.questionTitle }}</p>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
- <div class="group-btn">
|
|
|
|
- <img src="@/assets/images/wakeup/maturity/btn1.png" @click="selectBtn(questionAnswerA)">{{ questionAnswerA }}
|
|
|
|
- <img src="@/assets/images/wakeup/maturity/btn2.png" @click="selectBtn(questionAnswerB)">{{ questionAnswerB }}
|
|
|
|
- <img src="@/assets/images/wakeup/maturity/btn3.png" @click="selectBtn(questionAnswerC)">{{ questionAnswerC }}
|
|
|
|
- <img src="@/assets/images/wakeup/maturity/btn4.png" @click="selectBtn(questionAnswerD)">{{ questionAnswerD }}
|
|
|
|
- <img src="@/assets/images/wakeup/maturity/btn5.png" @click="selectBtn(questionAnswerE)">{{ questionAnswerE }}
|
|
|
|
- </div>
|
|
|
|
- <div class="progress-container">
|
|
|
|
- <div class="progress-bar" :style="{ width: progress + '%' }">
|
|
|
|
|
|
+ <div class="group-btn">
|
|
|
|
+ <img src="@/assets/images/wakeup/maturity/btn1.png" @click="selectBtn(questionAnswerA)">{{
|
|
|
|
+ questionAnswerA
|
|
|
|
+ }}
|
|
|
|
+ <img src="@/assets/images/wakeup/maturity/btn2.png" @click="selectBtn(questionAnswerB)">{{
|
|
|
|
+ questionAnswerB
|
|
|
|
+ }}
|
|
|
|
+ <img src="@/assets/images/wakeup/maturity/btn3.png" @click="selectBtn(questionAnswerC)">{{
|
|
|
|
+ questionAnswerC
|
|
|
|
+ }}
|
|
|
|
+ <img src="@/assets/images/wakeup/maturity/btn4.png" @click="selectBtn(questionAnswerD)">{{
|
|
|
|
+ questionAnswerD
|
|
|
|
+ }}
|
|
|
|
+ <img src="@/assets/images/wakeup/maturity/btn5.png" @click="selectBtn(questionAnswerE)">{{
|
|
|
|
+ questionAnswerE
|
|
|
|
+ }}
|
|
</div>
|
|
</div>
|
|
- <div class="progress-info">
|
|
|
|
- {{ newData.length }} / {{ questionSize }}
|
|
|
|
|
|
+ <div class="progress-container">
|
|
|
|
+ <div class="progress-bar" :style="{ width: progress + '%' }">
|
|
|
|
+ </div>
|
|
|
|
+ <div class="progress-info">
|
|
|
|
+ {{ newData.length }} / {{ questionSize }}
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
- <div class="content-right">
|
|
|
|
- <img class="btn-img" v-show="newData.length>0" @click="previousQuestion" src="@/assets/images/wakeup/maturity/pre-qustion.png" >
|
|
|
|
- <div class="time">
|
|
|
|
- <img src="@/assets/images/wakeup/maturity/time.png" >
|
|
|
|
- <p> {{ formattedTime(elapsedTime) }}</p>
|
|
|
|
|
|
+ <div class="content-right">
|
|
|
|
+ <img class="btn-img" v-show="newData.length>0" @click="previousQuestion"
|
|
|
|
+ src="@/assets/images/wakeup/maturity/pre-qustion.png">
|
|
|
|
+ <div class="time">
|
|
|
|
+ <img src="@/assets/images/wakeup/maturity/time.png">
|
|
|
|
+ <p> {{ formattedTime(elapsedTime) }}</p>
|
|
|
|
+ </div>
|
|
|
|
+ <img class="btn-img" @click="submitAnswer" v-show="newData.length >= questionSize"
|
|
|
|
+ src="@/assets/images/wakeup/maturity/submit.png">
|
|
</div>
|
|
</div>
|
|
- <img class="btn-img" @click="submitAnswer" v-show="newData.length >= questionSize" src="@/assets/images/wakeup/maturity/submit.png" >
|
|
|
|
|
|
+ <drag_component></drag_component>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -40,8 +55,9 @@
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
import headComponent from '@/views/xjc-integratedmachine/components/head_component.vue'
|
|
import headComponent from '@/views/xjc-integratedmachine/components/head_component.vue'
|
|
-import {exampleList, insertAppraisalAnswer, maturityAppraisalList} from "@/api/xjc-integratedmachine/wakeup/index.js";
|
|
|
|
|
|
+import {insertAppraisalAnswer, maturityAppraisalList} from "@/api/xjc-integratedmachine/wakeup/index.js";
|
|
import {ElMessageBox} from "element-plus";
|
|
import {ElMessageBox} from "element-plus";
|
|
|
|
+import drag_component from "@/views/xjc-integratedmachine/components/drag_component.vue";
|
|
|
|
|
|
|
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
@@ -50,17 +66,18 @@ const headinfo = ref({})
|
|
// const progress = ref(0)
|
|
// const progress = ref(0)
|
|
const draggedItem = ref(null);
|
|
const draggedItem = ref(null);
|
|
const maturityAppraisalData = ref([])
|
|
const maturityAppraisalData = ref([])
|
|
-const questionAnswerA = ref(null)
|
|
|
|
-const questionAnswerB = ref(null)
|
|
|
|
-const questionAnswerC = ref(null)
|
|
|
|
-const questionAnswerD = ref(null)
|
|
|
|
-const questionAnswerE = ref(null)
|
|
|
|
|
|
+const questionAnswerA = ref(null)
|
|
|
|
+const questionAnswerB = ref(null)
|
|
|
|
+const questionAnswerC = ref(null)
|
|
|
|
+const questionAnswerD = ref(null)
|
|
|
|
+const questionAnswerE = ref(null)
|
|
|
|
|
|
const itemScore = ref('')
|
|
const itemScore = ref('')
|
|
const newData = ref([])
|
|
const newData = ref([])
|
|
const appraisalId = ref(null)
|
|
const appraisalId = ref(null)
|
|
const questionSize = ref(null);
|
|
const questionSize = ref(null);
|
|
const useTime = ref(0);
|
|
const useTime = ref(0);
|
|
|
|
+
|
|
function dragStart(event) {
|
|
function dragStart(event) {
|
|
draggedItem.value = event.target;
|
|
draggedItem.value = event.target;
|
|
}
|
|
}
|
|
@@ -75,14 +92,14 @@ function drop(event) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-function setHeadinfo(){
|
|
|
|
|
|
+function setHeadinfo() {
|
|
headinfo.value = {
|
|
headinfo.value = {
|
|
title: '生涯成熟度测评',
|
|
title: '生涯成熟度测评',
|
|
user: {
|
|
user: {
|
|
avatar: '头像路径',
|
|
avatar: '头像路径',
|
|
nickName: '张三'
|
|
nickName: '张三'
|
|
},
|
|
},
|
|
- backUrl : '/index'
|
|
|
|
|
|
+ backUrl: '/index'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -97,11 +114,11 @@ function jumpTo(path) {
|
|
function getMaturityAppraisalList() {
|
|
function getMaturityAppraisalList() {
|
|
pageLoading = true;
|
|
pageLoading = true;
|
|
let appraisalCode = "3001"
|
|
let appraisalCode = "3001"
|
|
- maturityAppraisalList({appraisalCode:appraisalCode}).then(res => {
|
|
|
|
- if(res.data.questionList.length > 0){
|
|
|
|
- res.data.questionList.map((item,index) =>{
|
|
|
|
|
|
+ maturityAppraisalList({appraisalCode: appraisalCode}).then(res => {
|
|
|
|
+ if (res.data.questionList.length > 0) {
|
|
|
|
+ res.data.questionList.map((item, index) => {
|
|
item.questionAnswer = item.questionAnswer.split(';');
|
|
item.questionAnswer = item.questionAnswer.split(';');
|
|
- if(index === 0){
|
|
|
|
|
|
+ if (index === 0) {
|
|
//给第一道题的选项进行赋值;
|
|
//给第一道题的选项进行赋值;
|
|
questionAnswerA.value = item.questionAnswer[0];
|
|
questionAnswerA.value = item.questionAnswer[0];
|
|
questionAnswerB.value = item.questionAnswer[1];
|
|
questionAnswerB.value = item.questionAnswer[1];
|
|
@@ -116,11 +133,12 @@ function getMaturityAppraisalList() {
|
|
appraisalId.value = res.data.appraisalId;
|
|
appraisalId.value = res.data.appraisalId;
|
|
questionSize.value = res.data.questionSize;
|
|
questionSize.value = res.data.questionSize;
|
|
pageLoading = false;
|
|
pageLoading = false;
|
|
- }).catch((err)=>{
|
|
|
|
|
|
+ }).catch((err) => {
|
|
console.log("error")
|
|
console.log("error")
|
|
pageLoading = false;
|
|
pageLoading = false;
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+
|
|
//计时器
|
|
//计时器
|
|
const elapsedTime = ref(0);
|
|
const elapsedTime = ref(0);
|
|
const timerId = ref(null);
|
|
const timerId = ref(null);
|
|
@@ -153,7 +171,7 @@ const formattedTime = (ms) => {
|
|
const hours = String(Math.floor(totalSeconds / 3600)).padStart(2, '0');
|
|
const hours = String(Math.floor(totalSeconds / 3600)).padStart(2, '0');
|
|
const minutes = String(Math.floor((totalSeconds % 3600) / 60)).padStart(2, '0');
|
|
const minutes = String(Math.floor((totalSeconds % 3600) / 60)).padStart(2, '0');
|
|
const seconds = String(totalSeconds % 60).padStart(2, '0');
|
|
const seconds = String(totalSeconds % 60).padStart(2, '0');
|
|
- useTime.value = totalSeconds;
|
|
|
|
|
|
+ useTime.value = totalSeconds;
|
|
return `${hours}:${minutes}:${seconds}`;
|
|
return `${hours}:${minutes}:${seconds}`;
|
|
};
|
|
};
|
|
|
|
|
|
@@ -185,12 +203,12 @@ const updateCurrent = (newCurrent) => {
|
|
const selectBtn = (val) => {
|
|
const selectBtn = (val) => {
|
|
//将当前题目加入新数组,
|
|
//将当前题目加入新数组,
|
|
// 拼接选项数据
|
|
// 拼接选项数据
|
|
- if(newData.value.length != questionSize.value ){
|
|
|
|
|
|
+ if (newData.value.length != questionSize.value) {
|
|
itemScore.value += val + '|'
|
|
itemScore.value += val + '|'
|
|
newData.value.push(maturityAppraisalData.value[0]);
|
|
newData.value.push(maturityAppraisalData.value[0]);
|
|
}
|
|
}
|
|
//更换题卡;
|
|
//更换题卡;
|
|
- if(maturityAppraisalData.value.length >1 ){
|
|
|
|
|
|
+ if (maturityAppraisalData.value.length > 1) {
|
|
maturityAppraisalData.value.splice(0, 1);
|
|
maturityAppraisalData.value.splice(0, 1);
|
|
//给按钮赋值;
|
|
//给按钮赋值;
|
|
questionAnswerValue();
|
|
questionAnswerValue();
|
|
@@ -207,13 +225,15 @@ const previousQuestion = (val) => {
|
|
//返回上一题后要更新按钮赋值;
|
|
//返回上一题后要更新按钮赋值;
|
|
questionAnswerValue();
|
|
questionAnswerValue();
|
|
};
|
|
};
|
|
-function questionAnswerValue(){
|
|
|
|
- questionAnswerA.value = maturityAppraisalData.value[0].questionAnswer[0]
|
|
|
|
- questionAnswerB.value = maturityAppraisalData.value[0].questionAnswer[1]
|
|
|
|
- questionAnswerC.value = maturityAppraisalData.value[0].questionAnswer[2]
|
|
|
|
- questionAnswerD.value = maturityAppraisalData.value[0].questionAnswer[3]
|
|
|
|
- questionAnswerE.value = maturityAppraisalData.value[0].questionAnswer[4]
|
|
|
|
|
|
+
|
|
|
|
+function questionAnswerValue() {
|
|
|
|
+ questionAnswerA.value = maturityAppraisalData.value[0].questionAnswer[0]
|
|
|
|
+ questionAnswerB.value = maturityAppraisalData.value[0].questionAnswer[1]
|
|
|
|
+ questionAnswerC.value = maturityAppraisalData.value[0].questionAnswer[2]
|
|
|
|
+ questionAnswerD.value = maturityAppraisalData.value[0].questionAnswer[3]
|
|
|
|
+ questionAnswerE.value = maturityAppraisalData.value[0].questionAnswer[4]
|
|
}
|
|
}
|
|
|
|
+
|
|
function submitAnswer() {
|
|
function submitAnswer() {
|
|
ElMessageBox.confirm('确定提交生成报告', '提示', {
|
|
ElMessageBox.confirm('确定提交生成报告', '提示', {
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
@@ -226,13 +246,13 @@ function submitAnswer() {
|
|
"itemScore": itemScore.value,
|
|
"itemScore": itemScore.value,
|
|
"useTime": useTime.value,
|
|
"useTime": useTime.value,
|
|
"sourceType": "1",
|
|
"sourceType": "1",
|
|
- "appraisalId":appraisalId.value,
|
|
|
|
|
|
+ "appraisalId": appraisalId.value,
|
|
"ytjType": "wakeup"
|
|
"ytjType": "wakeup"
|
|
}
|
|
}
|
|
insertAppraisalAnswer(params).then(res => {
|
|
insertAppraisalAnswer(params).then(res => {
|
|
console.log(res);
|
|
console.log(res);
|
|
pageLoading = false;
|
|
pageLoading = false;
|
|
- }).catch((err)=>{
|
|
|
|
|
|
+ }).catch((err) => {
|
|
console.log("error")
|
|
console.log("error")
|
|
pageLoading = false;
|
|
pageLoading = false;
|
|
})
|
|
})
|
|
@@ -245,41 +265,48 @@ function submitAnswer() {
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
-p{
|
|
|
|
|
|
+p {
|
|
margin: 0;
|
|
margin: 0;
|
|
- padding:0;
|
|
|
|
|
|
+ padding: 0;
|
|
}
|
|
}
|
|
-.maturity-game-page{
|
|
|
|
|
|
+
|
|
|
|
+.maturity-game-page {
|
|
background: url('@/assets/images/wakeup/maturity/maturity-game-bg.png') no-repeat;
|
|
background: url('@/assets/images/wakeup/maturity/maturity-game-bg.png') no-repeat;
|
|
background-size: 1920px 1080px;
|
|
background-size: 1920px 1080px;
|
|
- z-index:10;
|
|
|
|
|
|
+ z-index: 10;
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 1080px;
|
|
height: 1080px;
|
|
- .page-content{
|
|
|
|
|
|
+
|
|
|
|
+ .page-content {
|
|
width: 100%;
|
|
width: 100%;
|
|
position: absolute;
|
|
position: absolute;
|
|
top: 123px;
|
|
top: 123px;
|
|
bottom: 0;
|
|
bottom: 0;
|
|
display: flex;
|
|
display: flex;
|
|
justify-content: space-around;
|
|
justify-content: space-around;
|
|
- .content-left{
|
|
|
|
|
|
+
|
|
|
|
+ .content-left {
|
|
width: 244px;
|
|
width: 244px;
|
|
}
|
|
}
|
|
- .content-center{
|
|
|
|
- height:910px;
|
|
|
|
|
|
+
|
|
|
|
+ .content-center {
|
|
|
|
+ height: 910px;
|
|
display: flex;
|
|
display: flex;
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
- .content-img{
|
|
|
|
|
|
+
|
|
|
|
+ .content-img {
|
|
width: 1187px;
|
|
width: 1187px;
|
|
height: 424px;
|
|
height: 424px;
|
|
//border: 1px solid;
|
|
//border: 1px solid;
|
|
margin-top: 40px;
|
|
margin-top: 40px;
|
|
position: relative;
|
|
position: relative;
|
|
- img{
|
|
|
|
|
|
+
|
|
|
|
+ img {
|
|
width: 1187px;
|
|
width: 1187px;
|
|
height: 424px;
|
|
height: 424px;
|
|
}
|
|
}
|
|
- p{
|
|
|
|
|
|
+
|
|
|
|
+ p {
|
|
width: 930px;
|
|
width: 930px;
|
|
position: absolute;
|
|
position: absolute;
|
|
top: 150px;
|
|
top: 150px;
|
|
@@ -291,6 +318,7 @@ p{
|
|
text-align: center;
|
|
text-align: center;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
.progress-container {
|
|
.progress-container {
|
|
width: 100%;
|
|
width: 100%;
|
|
//background-color: #f3f3f3;
|
|
//background-color: #f3f3f3;
|
|
@@ -320,28 +348,33 @@ p{
|
|
margin-left: 20px;
|
|
margin-left: 20px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- .content-right{
|
|
|
|
|
|
+
|
|
|
|
+ .content-right {
|
|
display: flex;
|
|
display: flex;
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
align-items: center;
|
|
- .btn-img{
|
|
|
|
|
|
+
|
|
|
|
+ .btn-img {
|
|
width: 244px;
|
|
width: 244px;
|
|
height: 77px;
|
|
height: 77px;
|
|
margin-top: 20px;
|
|
margin-top: 20px;
|
|
}
|
|
}
|
|
- .time{
|
|
|
|
- width:220px;
|
|
|
|
|
|
+
|
|
|
|
+ .time {
|
|
|
|
+ width: 220px;
|
|
height: 50px;
|
|
height: 50px;
|
|
//border: 1px solid;
|
|
//border: 1px solid;
|
|
display: flex;
|
|
display: flex;
|
|
justify-content: center;
|
|
justify-content: center;
|
|
margin-top: 20px;
|
|
margin-top: 20px;
|
|
- img{
|
|
|
|
|
|
+
|
|
|
|
+ img {
|
|
width: 42px;
|
|
width: 42px;
|
|
height: 42px;
|
|
height: 42px;
|
|
//border: 1px solid;
|
|
//border: 1px solid;
|
|
}
|
|
}
|
|
- p{
|
|
|
|
|
|
+
|
|
|
|
+ p {
|
|
width: 150px;
|
|
width: 150px;
|
|
font-weight: 300;
|
|
font-weight: 300;
|
|
font-size: 32px;
|
|
font-size: 32px;
|
|
@@ -351,18 +384,21 @@ p{
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- .group-btn{
|
|
|
|
|
|
+
|
|
|
|
+ .group-btn {
|
|
display: flex;
|
|
display: flex;
|
|
justify-content: space-around;
|
|
justify-content: space-around;
|
|
margin-top: 80px;
|
|
margin-top: 80px;
|
|
- img{
|
|
|
|
|
|
+
|
|
|
|
+ img {
|
|
width: 200px;
|
|
width: 200px;
|
|
height: 135px;
|
|
height: 135px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-.el-message-box{
|
|
|
|
- max-width:none;
|
|
|
|
|
|
+
|
|
|
|
+.el-message-box {
|
|
|
|
+ max-width: none;
|
|
width: 632px;
|
|
width: 632px;
|
|
height: 289px;
|
|
height: 289px;
|
|
}
|
|
}
|