培训管理

xgf-training-dev
LiuJiaNan 2025-02-22 17:21:46 +08:00
parent 7c245ffe68
commit f939db5e07
6 changed files with 446 additions and 622 deletions

View File

@ -1,476 +1,428 @@
<template> <template>
<view class="content"> <view class="content">
<view class="top"> <view class="top">
<view class="time"> <image src="/static/images/study/bgimg1.png" />
<text style="margin-right: 14rpx" class="iconfont">&#xed63;</text> <view class="suject">
<text>倒计时</text> <text class="line-2">考试科目{{ info.examname }}</text>
<u-count-down :time="info.ANSWERSHEETTIME * 60 * 1000" format="mm 分 ss 秒" auto-start millisecond @finish="fnCountDownFinish" /> </view>
</view> <view class="questions">
</view> <text>当前试题{{ current + 1 }}/{{ options.length }}</text>
</view>
<view class="time">
<text>考试剩余时间</text>
<u-count-down
:time="info.answersheettime * 60 * 1000"
format="HH 时 mm 分 ss 秒"
@finish="fnCountDownFinish"
/>
</view>
</view>
<view class="topic"> <view class="topic">
<view class="title"> <view class="title">
<text> <text>
<text class="tag_title"> <text class="tag_title">
{{ handleCalcQuestType(options[current].QUESTIONTYPE) }} {{ handleCalcQuestType(options[current].questiontype) }}
</text> </text>
{{ current + 1 }}.{{ options[current].QUESTIONDRY }} {{ current + 1 }}.{{ options[current].questiondry }}
</text> </text>
</view> </view>
<view v-show="options[current].QUESTIONTYPE === '1'" class="options"> <view v-show="options[current].questiontype === '1'" class="options">
<view class="item" :class="{ 'active': options[current].checked === 'A' }" @click="fnChooseTopic('radio', 'A')"> <view class="item" :class="{ 'active': options[current].checked === 'A' }" @click="fnChooseTopic('radio', 'A')">
<text class="option">A</text> <text class="option">A</text>
<text class="text">{{ options[current].OPTIONA }}</text> <text class="text">{{ options[current].optiona }}</text>
</view> </view>
<view class="item" :class="{ 'active': options[current].checked === 'B' }" @click="fnChooseTopic('radio', 'B')"> <view class="item" :class="{ 'active': options[current].checked === 'B' }" @click="fnChooseTopic('radio', 'B')">
<text class="option">B</text> <text class="option">B</text>
<text class="text">{{ options[current].OPTIONB }}</text> <text class="text">{{ options[current].optionb }}</text>
</view> </view>
<view class="item" :class="{ 'active': options[current].checked === 'C' }" @click="fnChooseTopic('radio', 'C')"> <view class="item" :class="{ 'active': options[current].checked === 'C' }" @click="fnChooseTopic('radio', 'C')">
<text class="option">C</text> <text class="option">C</text>
<text class="text">{{ options[current].OPTIONC }}</text> <text class="text">{{ options[current].optionc }}</text>
</view> </view>
<view class="item" :class="{ 'active': options[current].checked === 'D' }" @click="fnChooseTopic('radio', 'D')"> <view class="item" :class="{ 'active': options[current].checked === 'D' }" @click="fnChooseTopic('radio', 'D')">
<text class="option">D</text> <text class="option">D</text>
<text class="text">{{ options[current].OPTIOND }}</text> <text class="text">{{ options[current].optiond }}</text>
</view> </view>
</view> </view>
<view v-show="options[current].QUESTIONTYPE === '2'" class="options"> <view v-show="options[current].questiontype === '2'" class="options">
<view <view
class="item" class="item"
:class="{ :class="{
'active': options[current].checked && options[current].checked.indexOf('A') !== -1 'active': options[current].checked && options[current].checked.indexOf('A') !== -1
}" }"
@click="fnChooseTopic('multiple', 'A')" @click="fnChooseTopic('multiple', 'A')"
> >
<text class="option">A</text> <text class="option">A</text>
<text class="text">{{ options[current].OPTIONA }}</text> <text class="text">{{ options[current].optiona }}</text>
</view> </view>
<view <view
class="item" class="item"
:class="{ :class="{
'active': options[current].checked && options[current].checked.indexOf('B') !== -1 'active': options[current].checked && options[current].checked.indexOf('B') !== -1
}" }"
@click="fnChooseTopic('multiple', 'B')" @click="fnChooseTopic('multiple', 'B')"
> >
<text class="option">B</text> <text class="option">B</text>
<text class="text">{{ options[current].OPTIONB }}</text> <text class="text">{{ options[current].optionb }}</text>
</view> </view>
<view <view
class="item" class="item"
:class="{ :class="{
'active': options[current].checked && options[current].checked.indexOf('C') !== -1 'active': options[current].checked && options[current].checked.indexOf('C') !== -1
}" }"
@click="fnChooseTopic('multiple', 'C')" @click="fnChooseTopic('multiple', 'C')"
> >
<text class="option">C</text> <text class="option">C</text>
<text class="text">{{ options[current].OPTIONC }}</text> <text class="text">{{ options[current].optionc }}</text>
</view> </view>
<view <view
class="item" class="item"
:class="{ :class="{
'active': options[current].checked && options[current].checked.indexOf('D') !== -1 'active': options[current].checked && options[current].checked.indexOf('D') !== -1
}" }"
@click="fnChooseTopic('multiple', 'D')" @click="fnChooseTopic('multiple', 'D')"
> >
<text class="option">D</text> <text class="option">D</text>
<text class="text">{{ options[current].OPTIOND }}</text> <text class="text">{{ options[current].optiond }}</text>
</view> </view>
</view> </view>
<view v-show="options[current].QUESTIONTYPE === '3'" class="options"> <view v-show="options[current].questiontype === '3'" class="options">
<view class="item" :class="{ 'active': options[current].checked === 'A' }" @click="fnChooseTopic('judge', 'A')"> <view class="item" :class="{ 'active': options[current].checked === 'A' }" @click="fnChooseTopic('judge', 'A')">
<text class="option">{{ options[current].OPTIONA }}</text> <text class="option">{{ options[current].optiona }}</text>
<text class="text"></text> <text class="text"></text>
</view> </view>
<view class="item" :class="{ 'active': options[current].checked === 'B' }" @click="fnChooseTopic('judge', 'B')"> <view class="item" :class="{ 'active': options[current].checked === 'B' }" @click="fnChooseTopic('judge', 'B')">
<text class="option">{{ options[current].OPTIONB }}</text> <text class="option">{{ options[current].optionb }}</text>
<text class="text"></text> <text class="text"></text>
</view> </view>
</view> </view>
<view v-show="options[current].QUESTIONTYPE === '4'" class="options"> <view v-show="options[current].questiontype === '4'" class="options">
<view class="item"> <view class="item">
<u-textarea v-model="options[current].checked" auto-height count /> <u-textarea v-model="options[current].checked" auto-height count/>
</view> </view>
</view> </view>
</view> </view>
<view class="footer"> <view class="footer">
<u-button v-show="current !== 0" :style="{ width: '45%' }" text="上一题" @click="fnPreviousQuestion" /> <u-button v-show="current !== 0" :style="{ width: '45%' }" text="上一题" @click="fnPreviousQuestion"/>
<u-button v-show="current !== options.length - 1" type="primary" :style="{ width: current === 0 ? '100%' : '45%' }" text="下一题" @click="fnNextQuestion" /> <u-button v-show="current !== options.length - 1" type="primary"
<u-button v-show="current === options.length - 1" type="primary" :style="{ width: '45%' }" text="交卷" @click="fnHandInThePaper" /> :style="{ width: current === 0 ? '100%' : '45%' }" text="下一题" @click="fnNextQuestion"/>
</view> <u-button v-show="current === options.length - 1" type="primary" :style="{ width: '45%' }" text="交卷"
@click="fnHandInThePaper"/>
</view>
<u-toast ref="uToast" /> <u-toast ref="uToast"/>
</view> </view>
</template> </template>
<script> <script>
import { import {
getExamExercises, getExamExercises,
// getStrengthenExam, // getStrengthenExam,
setTestPaperSubmission, setTestPaperSubmission,
} from '@/api'; } from '@/api';
export default { export default {
data() { data() {
return { return {
// STAGEEXAMPAPERINPUT_ID: '', routeQuery: {},
// STAGEEXAMPAPER_ID: '', entrySite: '',
// CLASS_ID: '', info: {},
// POST_ID: '', options: [{}],
// STUDENT_ID: '', current: 0,
// NUMBEROFEXAMS: '', questionTypeMap: {
routeQuery: {}, 1: '单选',
entrySite: '', 2: '多选',
info: {}, 3: '判断',
options: [{}], 4: '填空'
current: 0, },
questionTypeMap: { studentId:''
1: '单选', }
2: '多选', },
3: '判断', onLoad(query) {
4: '填空' this.routeQuery = query
} // this.STAGEEXAMPAPER_ID = query.STAGEEXAMPAPER_ID;
} // this.entrySite = query.entrySite;
}, this.fnGetData()
onLoad(query) { },
this.routeQuery = query onBackPress(event) {
// this.STAGEEXAMPAPER_ID = query.STAGEEXAMPAPER_ID; if (event.from === 'backbutton') {
// this.entrySite = query.entrySite; uni.$u.toast('考试过程中不允许退出')
this.fnGetData() return true
}, }
onBackPress(event) { return false
if (event.from === 'backbutton') { },
uni.$u.toast('考试过程中不允许退出') methods: {
return true async fnGetData() {
} const {stageexampaperinputId, classId, } = this.routeQuery
return false const resData = await getExamExercises({
}, stageexampaperinputId: stageexampaperinputId,
computed: { classId: classId,
userInfo() { })
return this.$store.getters.getUserInfo this.info = resData.info
} this.options = resData.inputQue
}, this.studentId = resData.student.studentId
methods: { if (resData.numberofexams > 0) {
async fnGetData() { uni.showModal({
const { stageexampaperinputId, classId, postId, studentId, numberofexams } = this.routeQuery title: "温馨提示",
const resData = await getExamExercises({ content: `您还可以考试${resData.numberofexams}次!`,
STAGEEXAMPAPERINPUT_ID: stageexampaperinputId, showCancel: false,
// STAGEEXAMPAPER_ID: this.STAGEEXAMPAPER_ID, });
CLASS_ID: classId, }
POST_ID: postId, },
STUDENT_ID: studentId, fnChooseTopic(type, checked) {
NUMBEROFEXAMS: numberofexams if (!this.options[this.current].checked) {
}) this.$set(this.options[this.current], 'checked', '')
// if (this.entrySite === "strengththen") { }
// resData = await getStrengthenExam({ if (type === 'judge' || type === 'radio') {
// STRENGTHEN_STAGEEXAMPAPER_INPUT_ID: this.STAGEEXAMPAPERINPUT_ID, if (this.options[this.current].checked === checked) {
// CLASS_ID: this.CLASS_ID, this.options[this.current].checked = ''
// POST_ID: this.POST_ID, } else {
// STUDENT_ID: this.STUDENT_ID, this.options[this.current].checked = checked
// NUMBEROFEXAMS: this.NUMBEROFEXAMS, }
// }); }
// } else { if (type === 'multiple') {
// resData = await getExamExercises({ if (this.options[this.current].checked) {
// STAGEEXAMPAPERINPUT_ID: this.STAGEEXAMPAPERINPUT_ID, const checkedArr = this.options[this.current].checked.split(',')
// STAGEEXAMPAPER_ID: this.STAGEEXAMPAPER_ID, if (checkedArr.indexOf(checked) !== -1) {
// CLASS_ID: this.CLASS_ID, checkedArr.splice(checkedArr.indexOf(checked), 1)
// POST_ID: this.POST_ID, this.options[this.current].checked = checkedArr.join(',')
// STUDENT_ID: this.STUDENT_ID, } else {
// NUMBEROFEXAMS: this.NUMBEROFEXAMS, checkedArr.push(checked)
// }); checkedArr.sort()
// } this.options[this.current].checked = checkedArr.join(',')
}
// this.info = resData.pd; } else {
this.info = { ...this.info, ANSWERSHEETTIME: 30 } this.options[this.current].checked = checked
this.options = [ }
{ }
QUESTIONDRY: '题干题干题干题干题干1 ( ) .', },
QUESTIONTYPE: '1', handleCalcQuestType(type) {
OPTIONA: '这是选项A', return `(${this.questionTypeMap[type]})`
OPTIONB: '这是选项B', },
OPTIONC: '这是选项C', fnIsFinish() {
OPTIOND: '这是选项D' if (!this.options[this.current].checked) {
}, uni.showModal({
{ title: '温馨提示',
QUESTIONDRY: '题干题干题干题干题干2 ()', content: '请对本题进行作答。',
QUESTIONTYPE: '2', showCancel: false
OPTIONA: '这是选项A', })
OPTIONB: '这是选项B', return false
OPTIONC: '这是选项C', }
OPTIOND: '这是选项D' return true
}, },
{ /**
QUESTIONDRY: '未带安全头盔可正常进入堆场进行工业,以上说法是否正确?', * 下一题按钮点击事件
QUESTIONTYPE: '3', */
OPTIONA: '对', fnNextQuestion() {
OPTIONB: '错' if (!this.fnIsFinish()) return
}, this.current++
{ },
QUESTIONDRY: '当进入施工现场后, 应立刻对_____设施做全面检查?', /**
QUESTIONTYPE: '4', * 上一题按钮点击事件
OPTIONA: '对', */
OPTIONB: '错' fnPreviousQuestion() {
} this.current--
] },
// if (resData.NUMBEROFEXAMS > 0) { /**
// uni.showModal({ * 交卷按钮点击事件
// title: "", */
// content: `${resData.NUMBEROFEXAMS}`, fnHandInThePaper() {
// showCancel: false, if (!this.fnIsFinish()) return
// }); uni.showModal({
// } else if (resData.NUMBEROFEXAMS === "-9999") { title: '温馨提示',
// uni.showModal({ content: `题目已全部做完,确认交卷吗?`,
// title: "", success: (res) => {
// content: `60`, if (res.confirm) {
// showCancel: false, this.fnSubmit()
// }); }
// } else { }
// uni.showModal({ })
// title: "", },
// content: ``, fnCountDownFinish() {
// showCancel: false, uni.$u.toast('考试时间已结束')
// success: (res) => { for (let i = 0; i < this.options.length; i++) {
// if (res.confirm) { if (!this.options[i].checked) {
// uni.navigateBack(); this.options[i].checked = ''
// } }
// }, }
// }); this.fnSubmit()
// } },
}, async fnSubmit() {
fnChooseTopic(type, checked) { const {stageexampaperinputId, classId, } = this.routeQuery
if (!this.options[this.current].checked) { for (let i = 0; i < this.options.length; i++) {
this.$set(this.options[this.current], 'checked', '') if (this.options[i].questiontype === "2") {
} this.options[i].checked = this.options[i].checked.replace(/,/g, "");
if (type === 'judge' || type === 'radio') { }
if (this.options[this.current].checked === checked) { }
this.options[this.current].checked = '' const resData = await setTestPaperSubmission({
} else { stageexampaperinputId: stageexampaperinputId,
this.options[this.current].checked = checked classId: classId,
} studentId: this.studentId,
} passscore: this.info.passscore,
if (type === 'multiple') { options: JSON.stringify(this.options),
if (this.options[this.current].checked) { });
const checkedArr = this.options[this.current].checked.split(',') if (resData.examResult === "0") {
if (checkedArr.indexOf(checked) !== -1) { uni.showModal({
checkedArr.splice(checkedArr.indexOf(checked), 1) title: "温馨提示",
this.options[this.current].checked = checkedArr.join(',') content: `您的成绩为${resData.examScore}分,很遗憾您没有通过本次考试,请再接再厉!`,
} else { showCancel: false,
checkedArr.push(checked) success: (res) => {
checkedArr.sort() if (res.confirm) {
this.options[this.current].checked = checkedArr.join(',') uni.navigateBack({delta: 2});
} }
} else { },
this.options[this.current].checked = checked });
} } else {
} uni.showModal({
}, title: "温馨提示",
handleCalcQuestType(type) { content: `您的成绩为${resData.examScore}分,恭喜您通过本次考试,请继续保持!`,
return `(${this.questionTypeMap[type]})` showCancel: false,
}, success: (res) => {
fnIsFinish() { if (res.confirm) {
if (!this.options[this.current].checked) { uni.navigateBack({delta: 2});
uni.showModal({ }
title: '温馨提示', },
content: '请对本题进行作答。', });
showCancel: false }
}) }
return false }
}
return true
},
/**
* 下一题按钮点击事件
*/
fnNextQuestion() {
if (!this.fnIsFinish()) return
this.current++
},
/**
* 上一题按钮点击事件
*/
fnPreviousQuestion() {
this.current--
},
/**
* 交卷按钮点击事件
*/
fnHandInThePaper() {
if (!this.fnIsFinish()) return
uni.showModal({
title: '温馨提示',
content: `题目已全部做完,确认交卷吗?`,
success: (res) => {
if (res.confirm) {
this.fnSubmit()
}
}
})
},
fnCountDownFinish() {
uni.$u.toast('考试时间已结束')
for (let i = 0; i < this.options.length; i++) {
if (!this.options[i].checked) {
this.options[i].checked = ''
}
}
this.fnSubmit()
},
async fnSubmit() {
// uni.navigateBack({ delta: 2 })
for (let i = 0; i < this.options.length; i++) {
if (this.options[i].QUESTIONTYPE === "2") {
this.options[i].checked = this.options[i].checked.replace(/,/g, "");
}
}
const resData = await setTestPaperSubmission({
USERNAME: this.userInfo.NAME,
entrySite: this.entrySite,
STAGEEXAMPAPERINPUT_ID: this.STAGEEXAMPAPERINPUT_ID,
CLASS_ID: this.CLASS_ID,
STUDENT_ID: this.STUDENT_ID,
NUMBEROFEXAMS: this.NUMBEROFEXAMS,
PASSSCORE: this.info.PASSSCORE,
EXAMSCORE: this.info.EXAMSCORE,
EXAMTIMEBEGIN: this.info.EXAMTIMEBEGIN,
options: JSON.stringify(this.options),
});
if (resData.examResult === "0") {
uni.showModal({
title: "温馨提示",
content: `您的成绩为${resData.examScore}分,很遗憾您没有通过本次考试,请再接再厉!`,
showCancel: false,
success: (res) => {
if (res.confirm) {
if (this.entrySite === "video_study")
uni.navigateBack({ delta: 3 });
else uni.navigateBack();
}
},
});
} else {
uni.showModal({
title: "温馨提示",
content: `您的成绩为${resData.examScore}分,恭喜您通过本次考试,请继续保持!`,
showCancel: false,
success: (res) => {
if (res.confirm) {
if (this.entrySite === "video_study")
uni.navigateBack({ delta: 3 });
else if (this.entrySite === "strengththen")
uni.navigateBack({ delta: 2 });
else uni.navigateBack();
}
},
});
}
}
}
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '/static/fonts/iconfont_timer.css';
.content { .content {
.top { .top {
padding: 17rpx; margin: 20rpx;
.time { border-radius: 20rpx;
display: flex; padding: 40rpx;
flex-direction: row; text-align: center;
justify-content: flex-start; box-sizing: border-box;
align-items: center; position: relative;
color: #363636;
font-size: 28rpx;
::v-deep { image {
.u-count-down__text { width: 100%;
display: inline; height: 100%;
color: #363636; position: absolute;
font-size: 28rpx; top: 0;
line-height: normal; left: 0;
} }
}
}
}
.topic { .suject {
margin: 20rpx; color: #fff;
padding: 20rpx 20rpx 150rpx; font-weight: bold;
box-sizing: border-box; font-size: 32rpx;
position: relative;
z-index: 1;
}
.title { .questions {
font-size: 32rpx; color: #eeecec;
font-weight: 600; font-size: 30rpx;
padding-top: 20rpx;
position: relative;
z-index: 1;
}
.question-type { .time {
border-radius: 40rpx; display: flex;
padding: 4rpx 14rpx; flex-direction: row;
border: 1rpx solid #3c9cff; justify-content: center;
font-size: 24rpx; align-items: center;
color: #3c9cff; color: #eeecec;
} font-size: 28rpx;
padding-top: 20rpx;
position: relative;
z-index: 1;
.tag_title { ::v-deep {
font-size: 28rpx; .u-count-down__text {
background-color: #b3b3b3; color: #eeecec;
color: #fff; font-size: 28rpx;
border-radius: 8rpx; line-height: normal;
padding: 2rpx 10rpx; }
margin-right: 10rpx; }
} }
} }
.options { .topic {
margin-top: 40rpx; margin: 20rpx;
padding: 20rpx 20rpx 150rpx;
box-sizing: border-box;
.item { .title {
position: relative; font-size: 32rpx;
margin-top: 40rpx; font-weight: 600;
color: #696868;
&.active { .question-type {
color: #3c9cff; border-radius: 40rpx;
padding: 4rpx 14rpx;
border: 1rpx solid #3c9cff;
font-size: 24rpx;
color: #3c9cff;
}
.option { .tag_title {
background-color: #3c9cff; font-size: 28rpx;
color: #fff; background-color: #b3b3b3;
} color: #fff;
} border-radius: 8rpx;
padding: 2rpx 10rpx;
margin-right: 10rpx;
}
}
.option { .options {
background-color: #eee; margin-top: 40rpx;
border-radius: 80rpx;
width: 65rpx;
height: 65rpx;
line-height: 65rpx;
text-align: center;
font-size: 30rpx;
display: inline-block;
}
.text { .item {
margin-left: 30rpx; position: relative;
height: 60rpx; margin-top: 40rpx;
line-height: 60rpx; color: #696868;
}
}
}
}
.footer { &.active {
display: flex; color: #3c9cff;
position: fixed;
bottom: 0;
justify-content: space-between;
width: 100%;
left: 0;
padding: 20rpx;
box-sizing: border-box;
background: #fff;
button { .option {
border-radius: 10rpx; background-color: #3c9cff;
} color: #fff;
} }
}
.option {
background-color: #eee;
border-radius: 80rpx;
width: 65rpx;
height: 65rpx;
line-height: 65rpx;
text-align: center;
font-size: 30rpx;
display: inline-block;
}
.text {
margin-left: 30rpx;
height: 60rpx;
line-height: 60rpx;
}
}
}
}
.footer {
display: flex;
position: fixed;
bottom: 0;
justify-content: space-between;
width: 100%;
left: 0;
padding: 20rpx;
box-sizing: border-box;
background: #fff;
button {
border-radius: 10rpx;
}
}
} }
</style> </style>

View File

@ -1,19 +1,20 @@
<template> <template>
<view class="content"> <view class="content">
<view class="content__titletop"> <view class="content__titletop">
<view class="content__title">试卷名称-综合素质测评</view> <view class="content__title">试卷名称{{info.examname}}</view>
<view class="content__subtitle">(满分: 100)</view> <view class="content__subtitle">(满分: {{info.paperexamscore}})</view>
<view class="content__subtitle">(合格分: {{info.passscore}})</view>
</view> </view>
<view class="content__info"> <view class="content__info">
<text>姓名: 测试者</text> <view>姓名: {{info.username}}</view>
<text>分数: 85</text> <view>分数: {{info.examscore}}</view>
<text>考试时间: 2024-12-30</text> <view>考试时间: {{info.examtimeend}}</view>
</view> </view>
<view class="content__sign"> <view class="content__sign">
<view style="margin-right: 10rpx">签字: </view> <view style="margin-right: 10rpx">签字: </view>
<u-image width="120rpx" height="70rpx" model="widthFix" src="https://img.alicdn.com/img/i1/131787161/O1CN01z67Qvv22lnCzgPob4_!!0-saturn_solar.jpg_.webp" /> <u-image width="120rpx" height="70rpx" model="widthFix" :src="$filePath + info.signaturePath" @click="previewImage" />
</view> </view>
<view class="counter"> <view class="counter">
@ -96,9 +97,7 @@ import { getTaskScoreInfo } from "@/api";
export default { export default {
data() { data() {
return { return {
pageSize: 10, info:{},
currentPage: 1,
totalPage: 0,
questionList: [], questionList: [],
current: 0, // current: 0, //
questionTypeMap: { questionTypeMap: {
@ -120,95 +119,21 @@ export default {
methods: { methods: {
async getData(stagestudentrelationId, classId) { async getData(stagestudentrelationId, classId) {
// const resData = await getTaskScoreInfo({ const resData = await getTaskScoreInfo({
// stagestudentrelationId, stagestudentrelationId,
// classId classId
// }) })
// this.questionList = resData.list this.questionList = resData.pd.questionList
this.questionList = [ this.info = resData.pd
{
stageexamrecordId: '7cea826c3c974cb69028dd0624b632ba',
stageexampaperId: null,
stageexamId: null,
questionId: null,
userId: null,
answer: 'B',
answerright: 'B',
creator: null,
createTime: null,
operator: null,
operatTime: null,
isDelete: null,
corpinfoId: null,
studytaskId: null,
paperId: null,
classId: null,
studentId: null,
paperQuestionId: 'c413570fac8b49d8bd3ac27e223beb48',
questionnumber: null,
questiontype: '1',
questiondry: '发生生产安全事故以后,单位负责人应当在( )小时内向当地县级应急管理部门和负有安全生产监督管理职责的有关部门报告。',
optiona: '2',
optionb: '1',
optionc: '4',
optiond: '半',
descr: '17',
score: '50.0',
labelType: '6a8577ad5cf84e259f6a601a0c253726',
coursewarename: '测试40秒',
labelTypeName: '规范标准',
checkList: null,
count: null,
videocoursewareId: null
},
{
stageexamrecordId: '956a9175accc4c96b062eac68a5cdc28',
stageexampaperId: null,
stageexamId: null,
questionId: null,
userId: null,
answer: 'C',
answerright: 'C',
creator: null,
createTime: null,
operator: null,
operatTime: null,
isDelete: null,
corpinfoId: null,
studytaskId: null,
paperId: null,
classId: null,
studentId: null,
paperQuestionId: 'b8203efc27c04afc8b692fc2c82095ca',
questionnumber: null,
questiontype: '2',
questiondry: '发生生产安全事故以后,单位负责人应当在( )小时内向当地县级应急管理部门和负有安全生产监督管理职责的有关部门报告。',
optiona: '2',
optionb: '1',
optionc: '4',
optiond: '半',
descr: '17',
score: '50.0',
labelType: '2c0f587e982641c7965182826f9c41ac',
coursewarename: '测试40秒',
labelTypeName: '法律法规',
checkList: null,
count: null,
videocoursewareId: null
}
]
this.totalPage = 2
this.totalCount = this.questionList.length
},
resetList() {
this.pageSize = 10
this.currentPage = 1
this.questionList = []
this.getData()
}, },
handleCalcQuestType(type) { handleCalcQuestType(type) {
return `(${this.questionTypeMap[type]})` return `(${this.questionTypeMap[type]})`
} },
previewImage(){
uni.previewImage({
urls: [this.$filePath + this.info.signaturePath],
})
}
} }
} }
</script> </script>
@ -233,10 +158,9 @@ export default {
.content__info { .content__info {
font-size: 34rpx; font-size: 34rpx;
margin-top: 36rpx; view{
display: flex; margin-top: 18rpx;
justify-content: space-between; }
align-items: center;
} }
.content__sign { .content__sign {
@ -257,7 +181,7 @@ export default {
.tag_title { .tag_title {
font-size: 28rpx; font-size: 28rpx;
background-color: #94f0bd; background-color: #fff;
color: #5ac725; color: #5ac725;
border-radius: 8rpx; border-radius: 8rpx;
padding: 2rpx 8rpx; padding: 2rpx 8rpx;

View File

@ -66,13 +66,14 @@ export default {
}, },
/* 监听页面显示,页面每次出现在屏幕上都触发,包括从下级页面点返回露出当前页面 */ /* 监听页面显示,页面每次出现在屏幕上都触发,包括从下级页面点返回露出当前页面 */
onShow() { async onShow() {
// this.resetList(); await this.getUserFaceCompleted()
await this.resetList()
}, },
async onLoad(query) { async onLoad(query) {
await this.getUserFaceCompleted() // await this.getUserFaceCompleted()
await this.resetList() // await this.resetList()
}, },
methods: { methods: {
@ -108,7 +109,7 @@ export default {
onlyFromCamera: false, // onlyFromCamera: false, //
hideAlbum: false, // , hideAlbum: false, // ,
success: (response) => { success: (response) => {
const { stageexampaperinputId, classId, postId, studentId, numberofexams, type } = JSON.parse(response.result) const { stageexampaperinputId, classId, type, } = JSON.parse(response.result)
const findClassId = this.trainList.some((item) => item.classId === classId) const findClassId = this.trainList.some((item) => item.classId === classId)
if (type === '0') { if (type === '0') {
// //
@ -132,9 +133,6 @@ export default {
type: 'learning_certification', type: 'learning_certification',
stageexampaperinputId, stageexampaperinputId,
classId, classId,
postId,
studentId,
numberofexams
} }
}) })
} else { } else {
@ -200,7 +198,7 @@ export default {
url: '/pages/train_management/exam_record', url: '/pages/train_management/exam_record',
params: { params: {
classId, classId,
stagestudentrelationId stagestudentrelationId
} }
}) })
} }

View File

@ -71,6 +71,7 @@
import { getDataDictionary, joinClass } from '@/api'; import { getDataDictionary, joinClass } from '@/api';
import Sign from '@/components/sign/sign.vue' import Sign from '@/components/sign/sign.vue'
import { validateFieldPhone, validateFieldIdCard } from '@/utils/formValidateField.js' import { validateFieldPhone, validateFieldIdCard } from '@/utils/formValidateField.js'
import store from "@/store";
export default { export default {
data() { data() {
@ -256,7 +257,7 @@ export default {
delete params.writeSign delete params.writeSign
await joinClass({ await joinClass({
files, files,
formData: { ...params, classId } formData: { ...params, classId,USER_ID:this.$store.getters.getUserInfo.USER_ID }
}) })
.then(() => { .then(() => {
uni.$u.toast('保存成功') uni.$u.toast('保存成功')

View File

@ -1,40 +1,18 @@
<template> <template>
<view class="content"> <view class="content">
<u-list @scrolltolower="scrolltolower"> <u-cell-group>
<u-list-item v-for="(item, index) in signList" :key="index"> <u-cell title="头像">
<view class="sign_item"> <template #value>
<view class="sign_item_avatar"> <u-image width="200rpx" height="200rpx" model="widthFix" :src="$filePath + signInfo.useravatarurl" />
<!-- 用来给图片资源添加前置的统一的访问路径头部: $filePath, 这个将会用在下面的 u-image 组件中的 src 属性中, 示例为: src="$filePath + item.FILEPATH" --> </template>
<u-image width="200rpx" height="200rpx" model="widthFix" :src="item.useravatarurl" /> </u-cell>
</view> <u-cell title="姓名" :value="signInfo.name"></u-cell>
<view class="info_body"> <u-cell title="班级名称" :value="signInfo.className"></u-cell>
<view class="info_name"> <u-cell title="签到时间" :value="signInfo.studyStartTime"></u-cell>
<text>{{ item.userName }}</text> <u-cell title="培训地点" :value="signInfo.trainingLocationName"></u-cell>
</view> <u-cell title="签到状态" :value="studyStateMap[signInfo.studystate].value"></u-cell>
<view class="info_raw"> <u-cell title="考试签到" :value="stageexamStateMap[signInfo.stageexamstate].value"></u-cell>
<text class="content_label">班级名称: </text> </u-cell-group>
<text class="content_value">{{ item.name }}</text>
</view>
<view class="info_raw">
<text class="content_label">签到时间: </text>
<text class="content_value">{{ item.studyStartTime }}</text>
</view>
<view class="info_raw">
<text class="content_label">培训地点: </text>
<text class="content_value">{{ item.trainingLocation }}</text>
</view>
<view class="info_raw flex_layout">
<text class="content_label">签到状态: </text>
<text class="tag" :class="studyStateMap[item.studystate].color">{{ studyStateMap[item.studystate].value }}</text>
</view>
<view class="info_raw flex_layout">
<text class="content_label">考试状态: </text>
<text class="tag" :class="stageexamStateMap[item.stageexamstate].color">{{ stageexamStateMap[item.stageexamstate].value }}</text>
</view>
</view>
</view>
</u-list-item>
</u-list>
</view> </view>
</template> </template>
@ -45,17 +23,14 @@ export default {
data() { data() {
return { return {
routeQuery: {}, routeQuery: {},
pageSize: 10, signInfo: {},
currentPage: 1,
totalPage: 0,
signList: [],
// //
studyStateMap: { studyStateMap: {
'0': { '0': {
value: '未签到', value: '未签到',
color: 'tag__red' color: 'tag__red'
}, },
'1': { '3': {
value: '已签到', value: '已签到',
color: 'tag__green' color: 'tag__green'
} }
@ -78,47 +53,21 @@ export default {
} }
}, },
onShow() {
this.resetList()
},
onLoad(query) { onLoad(query) {
this.routeQuery = query this.routeQuery = query
this.getData()
}, },
methods: { methods: {
async getData() { async getData() {
const { classId } = this.routeQuery const { classId } = this.routeQuery
// let resData = await getSignInfo({ let resData = await getSignInfo({
// showCount: this.pageSize, showCount: 1,
// currentPage: this.currentPage, currentPage: 1,
// classId classId
// }); });
// this.signList = [...this.signList, ...resData.page.list] this.signInfo = resData.page.list[0]
// this.totalPage = resData.page.totalPage
this.signList = [
{
userName: '齐天大圣1',
useravatarurl: 'https://img.alicdn.com/img/i1/131787161/O1CN01z67Qvv22lnCzgPob4_!!0-saturn_solar.jpg_.webp',
name: '班级名称1班级名称1班级名称1班级名称1',
studyStartTime: '2025-02-11 09:40',
trainingLocation: '教三大教室',
studystate: '0',
stageexamstate: '0'
},
]
this.totalPage = 2
}, },
resetList() {
this.pageSize = 10
this.currentPage = 1
this.trainList = []
this.getData()
},
scrolltolower() {
this.currentPage++
if (this.totalPage >= this.currentPage) this.getData()
}
} }
} }
</script> </script>
@ -188,4 +137,4 @@ export default {
} }
} }
} }
</style> </style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB