feat: 我的课程接口对接

This commit is contained in:
cgd_mac 2022-01-16 10:26:12 +08:00
parent c7f51a10dc
commit 04c18d2561
17 changed files with 381 additions and 294 deletions

View File

@ -48,4 +48,13 @@ export default {
justify-content: center;
}
//
.ant-pro-basicLayout-children-content-wrap{
height: 100%;
}
.ant-pro-grid-content{
height: 100%;
}
</style>

58
src/api/mycourse/index.js Normal file
View File

@ -0,0 +1,58 @@
import request from '@/utils/request'
const mycourseApi = {
mycourseList: 'myCourse/getMyCourseList', // 我的课程列表,课程搜索
addMyCourse: 'myCourse/addMyCourse', // 添加课程
centerList: 'focused/training/list', // 集中培训列表
centerDetail: 'focused/training/list', // 集中培训详情
recommendList: 'sys/recommend/listPage', // 系统推荐课程列表
recommendDetail: 'sys/recommend/detail' // 系统课程推荐详情
}
export function reqMyCourseList (params) {
return request({
url: mycourseApi.mycourseList,
method: 'get',
params: params
})
}
export function reqAddMyCourse (params) {
return request({
url: mycourseApi.addMyCourse,
method: 'get',
params: params
})
}
export function reqCourseCenterList (params) {
return request({
url: mycourseApi.centerList,
method: 'get',
params: params
})
}
export function reqCourseCenterDetail (params) {
return request({
url: mycourseApi.centerDetail,
method: 'get',
params: params
})
}
export function reqRecommendList (params) {
return request({
url: mycourseApi.recommendList,
method: 'get',
params: params
})
}
export function recommendDetail (params) {
return request({
url: mycourseApi.recommendDetail,
method: 'get',
params: params
})
}

13
src/api/myexam/exam.js Normal file
View File

@ -0,0 +1,13 @@
import request from '@/utils/request'
const examApi = {
examList: 'exam/list', // 我的考试-预约考试列表
}
export function reqExamList (params) {
return request({
url: examApi.examList,
method: 'get',
params: params
})
}

View File

@ -0,0 +1,13 @@
import request from '@/utils/request'
const countApi = {
myexamCount: 'studyStatistics/getMyCourseList' // 学习统计
}
export function getMyexamCount (params) {
return request({
url: countApi.myexamCount,
method: 'get',
params: params
})
}

View File

@ -0,0 +1,22 @@
import request from '@/utils/request'
const answerApi = {
answerViewReport: 'answer/viewReport', // 查看报告
answerViewResolution: 'answer/viewResolution' // 查看解析
}
export function answerViewReport (params) {
return request({
url: answerApi.answerViewReport,
method: 'get',
params: params
})
}
export function answerViewResolution (params) {
return request({
url: answerApi.answerViewResolution,
method: 'get',
params: params
})
}

View File

@ -1,7 +1,7 @@
<template>
<div class="report-box">
<a-row :gutter="30">
<a-col :span="12">
<a-col :span="24">
<a-card title="得分统计" :bordered="false">
<a-row :gutter="30" style="margin: 15px 0;">
<a-col :span="12" class="flex-center">
@ -16,7 +16,7 @@
</a-card>
</a-col>
<!-- <a-divider type="vertical" /> -->
<a-col :span="12">
<!-- <a-col :span="12">
<a-card title="答题分析" :bordered="false">
<a-table :columns="columns" :data-source="dataList" size="small" :pagination="false" :bordered="false">
<span slot="action" slot-scope="text, record">
@ -24,7 +24,7 @@
</span>
</a-table>
</a-card>
</a-col>
</a-col> -->
<a-col :span="24" style="margin-top: 15px;">
<a-card title="答题卡" :bordered="false">
<ul class="answer-box">

View File

@ -41,8 +41,8 @@
<div><span style="margin-right: 20px;">答题情况做对{{ item.rightQuestions }}/{{ item.totalQuestions }}</span><span>交卷时间{{ item.submitTime }}</span></div>
</div>
<div style="flex: 0 0 200px; text-align: right;">
<div :span="24" style="margin-bottom: 10px;"><a-button type="primary" size="small" >查看报告</a-button></div>
<div :span="24"><a-button type="primary" size="small">查看解析</a-button></div>
<div @click="handlerGoReport(item, 1)" :span="24" style="margin-bottom: 10px;"><a-button type="primary" size="small" >查看报告</a-button></div>
<div @click="handlerGoReport(item, 2)" :span="24"><a-button type="danger" size="small">查看解析</a-button></div>
</div>
</div>
</a-card>
@ -85,7 +85,7 @@ export default {
}
},
mounted () {
this.activeTab = this.$route.query.type || '1',
this.activeTab = this.$route.query.type || '1'
this.initData()
},
methods: {
@ -124,6 +124,13 @@ export default {
this.$nextTick(() => {
this[`getPractice${type}PageList`]()
})
},
// /
handlerGoReport (item, type) {
this.$router.push({
path: '/myreport',
query: { type: type, reportId: item.reportId }
})
}
}
}

View File

@ -86,15 +86,23 @@ export default {
.exam-detail {
display: flex;
max-height: 100%;
height: 100%;
.exam-box {
flex: 1;
height: 100%;
overflow-x: hidden;
overflow-y: auto;
}
.exam-line {
flex: 0 0 10px;
}
.answer-card {
flex: 0 0 400px;
height: 100%;
overflow-x: hidden;
overflow-y: auto;
}
}

View File

@ -10,10 +10,19 @@
:showPagination="false"
:data-source="dataList"
:rowKey="record => record.id">
<span slot="action" slot-scope="text, record, index">
<a v-if="index % 3 == 1" @click="$refs.userForm.edit(record)">添加课程</a>
<a v-if="index % 3 == 2" @click="$refs.userForm.edit(record)">继续学习</a>
<a v-if="index % 3 == 0">已完成学习</a>
<template slot="trainSdate" slot-scope="text, record">
{{ record.trainSdate }}{{ record.trainEdate }}
</template>
<span slot="status" slot-scope="text, record">
<a-tag v-if="record.status === 1" color="orange">未发布</a-tag>
<a-tag v-if="record.status === 2" color="orange">未开始</a-tag>
<a-tag v-if="record.status === 3" color="blue">进行中</a-tag>
<a-tag v-if="record.status === 4" color="green">已结束</a-tag>
<a-tag v-if="record.status === 5" color="red">已中止</a-tag>
<template v-else>-</template>
</span>
<span slot="action" slot-scope="text, record">
<a @click="handlerDetail(record)">培训详情</a>
</span>
</a-table>
<CentralizedTrainingDetail ref="centralizedTrainingDetail"></CentralizedTrainingDetail>
@ -21,10 +30,7 @@
</template>
<script>
import { userPage, userDel, passwordReset } from '@/api/security/user'
import { getCourseList, deleteCourse } from '@/api/course/course'
import { dictionaryDropDown } from '@/api/sys/dictionaryItem'
import { dictToTree } from '@/utils/util'
import { reqCourseCenterList } from '@/api/mycourse/index'
import CentralizedTrainingDetail from './CentralizedTrainingDetail.vue'
export default {
components: {
@ -38,16 +44,16 @@ export default {
columns: [
{
title: '培训名称',
dataIndex: 'courseName',
scopedSlots: { customRender: 'courseName' }
dataIndex: 'trainName'
},
{
title: '培训时间',
dataIndex: 'courseTypeName'
dataIndex: 'trainSdate',
scopedSlots: { customRender: 'trainSdate' }
},
{
title: '培训地点',
dataIndex: 'date'
dataIndex: 'address'
},
{
title: '培训状态',
@ -62,7 +68,7 @@ export default {
],
// Promise
loadData: parameter => {
return getCourseList(Object.assign(parameter, this.queryParam)).then(res => {
return reqCourseCenterList({ pageNum: 1, pageSize: 5 }).then(res => {
return res
})
},
@ -70,47 +76,16 @@ export default {
options: {}
}
},
created () {
this.dictionaryDropDown()
mounted () {
setTimeout(() => {
this.loading = false
}, 800)
},
methods: {
tabChange (key) {
console.log('key', key)
},
//
handlerDetail () {
handlerDetail (row) {
this.$refs.aycourseDetail.getDetail(row)
this.$refs.aycourseDetail.visible = true
},
//
dictionaryDropDown () {
dictionaryDropDown({ dictionaryCode: '0006' }).then((res) => {
this.loading = false
this.queryOptions[1].options = dictToTree(res.data, [], 0)
})
},
classificationChange (value) {
this.queryParam.classification = value
},
//
handleRefresh () {
},
sysUserDelete (param) {
userDel(param)
.then(res => {
if (res.code === 200) {
this.$message.success('删除成功')
this.$refs.table.refresh()
} else {
this.$message.error('删除失败:' + res.msg)
}
})
.catch(err => {
this.$message.error('删除错误:' + err.msg)
})
},
handleOk () {
this.$refs.table.refresh()
}
}
}

View File

@ -1,36 +1,53 @@
<template>
<a-modal title="集中培训详情" :width="800" :visible="visible" :confirmLoading="confirmLoading" :footer="null">
<a-descriptions title="User Info">
<a-descriptions-item label="UserName">
Zhou Maomao
<a-modal title="集中培训详情" :width="800" v-model="visible" :confirmLoading="confirmLoading" :footer="null">
<a-descriptions :column="1" title="">
<a-descriptions-item label="培训名称">
{{ data.trainName }}
</a-descriptions-item>
<a-descriptions-item label="Telephone">
1810000000
<a-descriptions-item label="培训时间">
{{ data.trainSdate }}{{ data.trainEdate }}
</a-descriptions-item>
<a-descriptions-item label="Live">
Hangzhou, Zhejiang
<a-descriptions-item label="主持人">
{{ data.host }}
</a-descriptions-item>
<a-descriptions-item label="Remark">
empty
<a-descriptions-item label="会议人数">
{{ data.personNum }}/{{ data.personNum }}
</a-descriptions-item>
<a-descriptions-item label="Address">
No. 18, Wantang Road, Xihu District, Hangzhou, Zhejiang, China
<a-descriptions-item label="学习内容">
{{ data.learningContent }}
</a-descriptions-item>
<a-descriptions-item label="联系人">
{{ data.contact }}({{ data.phone }})
</a-descriptions-item>
<a-descriptions-item label="备注">
{{ data.remark }}
</a-descriptions-item>
</a-descriptions>
<div v-if="data.status === 3" class="flex-center">
<a-button @click="handlerJoin" type="primary">报名参加</a-button>
</div>
</a-modal>
</template>
<script>
import { reqCourseCenterDetail } from '@/api/mycourse/index'
export default {
data () {
return {
visible: false,
confirmLoading: false
confirmLoading: false,
data: {}
}
},
methods: {
//
handlerStartLearn () {}
getDetail (row) {
reqCourseCenterDetail({ projectId: row.id }).then(res => {
this.data = res.data
})
},
handlerJoin () {
}
}
}
</script>

View File

@ -30,102 +30,27 @@
</template>
<script>
import { userPage, userDel, passwordReset } from '@/api/security/user'
import { getCourseList, deleteCourse } from '@/api/course/course'
import { dictionaryDropDown } from '@/api/sys/dictionaryItem'
import { dictToTree } from '@/utils/util'
import { STable, SearchCom } from '@/components'
import { reqRecommendList } from '@/api/mycourse/index'
export default {
components: {
STable,
SearchCom
},
data () {
return {
dataList: [],
activeTab: '1',
loading: true,
queryParam: {
classification: '' //
},
queryOptions: [
{ type: 'input', placeholder: '课程名称', key: 'courseName' },
{ type: 'select-dic-tree', placeholder: '请选择课程类别', key: 'courseType', options: [] }
],
//
columns: [
{
title: '课程名称',
dataIndex: 'courseName',
scopedSlots: { customRender: 'courseName' }
},
{
title: '课程类别',
dataIndex: 'courseTypeName'
},
{
title: '学习时间',
dataIndex: 'date'
},
{
title: '操作',
width: '150px',
dataIndex: 'action',
scopedSlots: { customRender: 'action' }
}
],
// Promise
loadData: parameter => {
return getCourseList(Object.assign(parameter, this.queryParam)).then(res => {
return res
})
},
selectedRows: [], //
options: {}
loading: true
}
},
created () {
this.dictionaryDropDown()
mounted () {
this.initData()
},
methods: {
tabChange (key) {
console.log('key', key)
},
//
handlerDetail () {
this.$refs.aycourseDetail.visible = true
},
//
dictionaryDropDown () {
dictionaryDropDown({ dictionaryCode: '0006' }).then((res) => {
this.queryOptions[1].options = dictToTree(res.data, [], 0)
initData () {
reqRecommendList({ pageSize: 20, pageNum: 1 }).then(res => {
this.dataList = res.rows
this.loading = false
})
},
classificationChange (value) {
this.queryParam.classification = value
},
//
handleRefresh () {
}
},
sysUserDelete (param) {
userDel(param)
.then(res => {
if (res.code === 200) {
this.$message.success('删除成功')
this.$refs.table.refresh()
} else {
this.$message.error('删除失败:' + res.msg)
}
})
.catch(err => {
this.$message.error('删除错误:' + err.msg)
})
},
handleOk () {
this.$refs.table.refresh()
}
}
}
</script>

View File

@ -18,7 +18,6 @@
:pageSize="5"
:columns="columns"
:data="loadData"
:alert="options.alert"
:rowKey="record => record.id">
<span slot="index" slot-scope="text, record, index">
{{ index + 1 }}
@ -27,34 +26,29 @@
<a-button @click="handlerDetail(record)" type="link" >{{ record.courseName }}</a-button>
</template>
<span slot="status" slot-scope="text, record">
<a-tag color="red">未开始</a-tag>
<a-tag v-if="record.status === 1" color="red">未开始</a-tag>
<a-tag v-if="record.status === 2" color="blue">进行中</a-tag>
<a-tag v-if="record.status === 3" color="green">已完成</a-tag>
<template v-else>-</template>
</span>
<template slot="progress" slot-scope="text, record">
<a-progress :percent="30" />
<template slot="schedule" slot-scope="text, record">
<a-progress :percent="record.schedule" />
</template>
<span slot="action" slot-scope="text, record, index">
<a v-if="index % 3 == 1" @click="$refs.userForm.edit(record)">添加课程</a>
<a v-if="index % 3 == 2" @click="$refs.userForm.edit(record)">继续学习</a>
<a v-if="index % 3 == 0">已完成学习</a>
<!-- <a-divider type="vertical" />
<a-dropdown v-if="hasPerm('sys:user:resetPwd') || hasPerm('sys:user:grantRole') || hasPerm('sys:user:del')">
<a class="ant-dropdown-link"> 更多 <a-icon type="down" /> </a>
<a-menu slot="overlay">
<a-menu-item v-if="hasPerm('sys:user:resetPwd')">
<a-popconfirm placement="topRight" title="确认重置密码?" @confirm="() => resetPwd(record)">
<a>重置密码</a>
<template slot="learnHours" slot-scope="text, record">
{{ record.learnHours }}小时
</template>
<span slot="action" slot-scope="text, record">
<a-popconfirm
v-if="record.status === 1"
:title="`确定要添加${record.name}课程吗?`"
ok-text="添加"
cancel-text="取消"
@confirm="handlerAddCourse(record)"
>
<a>添加课程</a>
</a-popconfirm>
</a-menu-item>
<a-menu-item v-if="hasPerm('sys:user:grantRole')">
<a @click="$refs.userRoleForm.userRole(record)">授权角色</a>
</a-menu-item>
<a-menu-item v-if="hasPerm('sys:user:delete')">
<a-popconfirm placement="topRight" title="确认删除?" @confirm="() => singleDelete(record)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown> -->
<a v-if="record.status === 2" @click="handlerContinue(record)">继续学习</a>
<a v-if="record.status === 3">已完成学习</a>
</span>
</s-table>
<MycourseDetail ref="aycourseDetail"></MycourseDetail>
@ -62,8 +56,7 @@
</template>
<script>
import { userPage, userDel, passwordReset } from '@/api/security/user'
import { getCourseList, deleteCourse } from '@/api/course/course'
import { reqMyCourseList } from '@/api/mycourse/index'
import { dictionaryDropDown } from '@/api/sys/dictionaryItem'
import { dictToTree } from '@/utils/util'
import { STable, SearchCom } from '@/components'
@ -80,11 +73,12 @@ export default {
return {
loading: true,
queryParam: {
classification: '' //
name: '', //
trainWay: ''
},
queryOptions: [
{ type: 'input', placeholder: '课程名称', key: 'courseName' },
{ type: 'select-dic-tree', placeholder: '课程类别', key: 'courseType', options: [] }
{ type: 'input', placeholder: '课程名称', key: 'name' },
{ type: 'select-dic-tree', placeholder: '课程类别', key: 'trainWay', options: [] }
],
//
columns: [
@ -96,16 +90,16 @@ export default {
},
{
title: '课程名称',
dataIndex: 'courseName',
scopedSlots: { customRender: 'courseName' }
dataIndex: 'name',
scopedSlots: { customRender: 'name' }
},
{
title: '课程类别',
dataIndex: 'courseTypeName'
dataIndex: 'trainType'
},
{
title: '学习时间',
dataIndex: 'date'
title: '开始时间',
dataIndex: 'startDate'
},
{
title: '课程状态',
@ -115,19 +109,21 @@ export default {
},
{
title: '课程进度',
dataIndex: 'progress',
scopedSlots: { customRender: 'progress' },
dataIndex: 'schedule',
scopedSlots: { customRender: 'schedule' },
width: '180px'
},
{
title: '已休学时',
dataIndex: 'yxxs',
scopedSlots: { customRender: 'present' }
dataIndex: 'learnHours',
scopedSlots: { customRender: 'learnHours' }
}
],
// Promise
loadData: parameter => {
return getCourseList(Object.assign(parameter, this.queryParam)).then(res => {
const { info: userInfo } = this.$store.state.user
const params = { ...parameter, ...this.queryParam, personId: userInfo.id }
return reqMyCourseList(params).then(res => {
return res
})
},
@ -162,23 +158,22 @@ export default {
//
handleRefresh () {
},
sysUserDelete (param) {
userDel(param)
.then(res => {
if (res.code === 200) {
this.$message.success('删除成功')
this.$refs.table.refresh()
} else {
this.$message.error('删除失败:' + res.msg)
}
})
.catch(err => {
this.$message.error('删除错误:' + err.msg)
})
},
handleOk () {
this.$refs.table.refresh()
},
//
handlerAddCourse (row) {
const _this = this
this.$emit('add', {
row: row,
callback: function () {
_this.$refs.table.refresh()
} })
},
//
handlerContinue (row) {
this.$emit('continue', { row: row })
}
}
}

View File

@ -5,62 +5,66 @@
>
<a-tabs :default-active-key="activeTab" @change="tabChange">
<a-tab-pane key="1" tab="年度培训计划">
<a-table
ref="table"
<s-table
ref="yearTable"
:pageSize="5"
:columns="columns"
:showPagination="false"
:data-source="dataList"
:data="loadDataYear"
:rowKey="record => record.id">
<span slot="action" slot-scope="text, record, index">
<a v-if="index % 3 == 1" @click="$refs.userForm.edit(record)">添加课程</a>
<a v-if="index % 3 == 2" @click="$refs.userForm.edit(record)">继续学习</a>
<a v-if="index % 3 == 0">已完成学习</a>
<span slot="action" slot-scope="text, record">
<a-popconfirm
v-if="record.status === 1"
:title="`确定要添加${record.name}课程吗?`"
ok-text="添加"
cancel-text="取消"
@confirm="handlerAddCourse(record)"
>
<a>添加课程</a>
</a-popconfirm>
<a v-if="record.status === 2" @click="handlerContinue(record)">继续学习</a>
<a v-if="record.status === 3">已完成学习</a>
</span>
</a-table>
</s-table>
</a-tab-pane>
<a-tab-pane key="2" tab="单位培训计划">
<a-table
ref="table"
<s-table
ref="unitTable"
:pageSize="5"
:columns="columns"
:showPagination="false"
:data-source="dataList"
:data="loadDataUnit"
:rowKey="record => record.id">
<span slot="action" slot-scope="text, record, index">
<a v-if="index % 3 == 1" @click="$refs.userForm.edit(record)">添加课程</a>
<a v-if="index % 3 == 2" @click="$refs.userForm.edit(record)">继续学习</a>
<a v-if="index % 3 == 0">已完成学习</a>
<span slot="action" slot-scope="text, record">
<a-popconfirm
v-if="record.status === 1"
:title="`确定要添加${record.name}课程吗?`"
ok-text="添加"
cancel-text="取消"
@confirm="handlerAddCourse(record)"
>
<a>添加课程</a>
</a-popconfirm>
<a v-if="record.status === 2" @click="handlerContinue(record)">继续学习</a>
<a v-if="record.status === 3">已完成学习</a>
</span>
</a-table>
</s-table>
</a-tab-pane>
</a-tabs>
</a-card>
</template>
<script>
import { userPage, userDel, passwordReset } from '@/api/security/user'
import { getCourseList, deleteCourse } from '@/api/course/course'
import { dictionaryDropDown } from '@/api/sys/dictionaryItem'
import { dictToTree } from '@/utils/util'
import { STable, SearchCom } from '@/components'
import { reqMyCourseList } from '@/api/mycourse/index'
import { STable } from '@/components'
export default {
components: {
STable,
SearchCom
STable
},
data () {
return {
dataList: [],
dataListYear: [],
dataListUnit: [],
activeTab: '1',
loading: true,
queryParam: {
classification: '' //
},
queryOptions: [
{ type: 'input', placeholder: '课程名称', key: 'courseName' },
{ type: 'select-dic-tree', placeholder: '请选择课程类别', key: 'courseType', options: [] }
],
//
columns: [
{
@ -84,57 +88,46 @@ export default {
}
],
// Promise
loadData: parameter => {
return getCourseList(Object.assign(parameter, this.queryParam)).then(res => {
loadDataYear: parameter => {
const { info: userInfo } = this.$store.state.user
return reqMyCourseList({ personId: userInfo.id, type: 2, pageNum: 1, pageSize: 5 }).then(res => {
return res
})
},
selectedRows: [], //
options: {}
loadDataUnit: parameter => {
const { info: userInfo } = this.$store.state.user
return reqMyCourseList({ personId: userInfo.id, type: 3, pageNum: 1, pageSize: 5 }).then(res => {
return res
})
}
}
},
created () {
this.dictionaryDropDown()
mounted () {
setTimeout(() => {
this.loading = false
}, 800)
},
methods: {
tabChange (key) {
console.log('key', key)
if (key == 1) {
this.$refs.yearTable.refresh()
}
if (key == 2) {
this.$refs.unitTable.refresh()
}
},
//
handlerDetail () {
this.$refs.aycourseDetail.visible = true
},
//
dictionaryDropDown () {
dictionaryDropDown({ dictionaryCode: '0006' }).then((res) => {
this.queryOptions[1].options = dictToTree(res.data, [], 0)
this.loading = false
})
handlerAddCourse (row) {
this.$emit('add', { row: row })
},
classificationChange (value) {
this.queryParam.classification = value
},
//
handleRefresh () {
handlerContinue (row) {
this.$emit('continue', { row: row })
}
},
sysUserDelete (param) {
userDel(param)
.then(res => {
if (res.code === 200) {
this.$message.success('删除成功')
this.$refs.table.refresh()
} else {
this.$message.error('删除失败:' + res.msg)
}
})
.catch(err => {
this.$message.error('删除错误:' + err.msg)
})
},
handleOk () {
this.$refs.table.refresh()
}
}
}
</script>

View File

@ -2,12 +2,12 @@
<div>
<a-card :bordered="false" >
<a-card title="我的课程" :bodyStyle="{padding: '0px !important'}" >
<MyCourseList></MyCourseList>
<MyCourseList @add="handlerAddCourse" @continue="handlerContinue"></MyCourseList>
</a-card>
<br />
<a-card title="培训计划" :bodyStyle="{padding: '0px !important'}">
<a slot="extra" href="#">查看更多</a>
<TrainingPlan></TrainingPlan>
<TrainingPlan @add="handlerAddCourse" @continue="handlerContinue"></TrainingPlan>
</a-card>
<br />
<a-card title="集中培训" :bodyStyle="{padding: '0px !important'}">
@ -27,6 +27,7 @@ import MyCourseList from './MyCourseList.vue' // 我的课程
import TrainingPlan from './TrainingPlan.vue' //
import CentralizedTraining from './CentralizedTraining.vue' //
import CourseRecommendation from './CourseRecommendation.vue' //
import { reqAddMyCourse } from '@/api/mycourse/index'
export default {
components: {
MyCourseList,
@ -41,6 +42,23 @@ export default {
},
methods: {
//
handlerAddCourse (row, callback) {
const { info: userInfo } = this.$store.state.user
reqAddMyCourse({ personId: userInfo.id, projectId: row.id }).then(res => {
if (res.code === 200) {
this.$message.success('添加课程成功!')
callback && callback()
}
})
},
//
handlerContinue (row) {
this.$router.push({
path: '/mycourse/courseLearn',
query: { courseId: row.id }
})
}
}
}
</script>

View File

@ -51,7 +51,7 @@
<script>
import { STable, SearchCom } from '@/components'
import { getCourseList } from '@/api/course/course'
import { reqExamList } from '@/api/myexam/exam'
export default {
components: { STable, SearchCom },
@ -142,12 +142,12 @@ export default {
}
],
loadExamData: parameter => {
return getCourseList(Object.assign(parameter, this.queryParam)).then(res => {
return reqExamList(Object.assign(parameter, this.queryParam)).then(res => {
return res
})
},
loadExamDoneData: parameter => {
return getCourseList(Object.assign(parameter, this.queryParam)).then(res => {
return reqExamList(Object.assign(parameter, this.queryParam)).then(res => {
return res
})
}

View File

@ -55,6 +55,7 @@ import {
NumberInfo,
MiniSmoothArea
} from '@/components'
import { getMyexamCount } from '@/api/myexamCount/index.js'
export default {
components: {
ChartCard,
@ -71,6 +72,18 @@ export default {
return {
loading: false
}
},
mounted () {
this.initData()
},
methods: {
initData () {
console.log('this.$sotre', this.$store)
const { info: userInfo } = this.$store.state.user
getMyexamCount({ personId: userInfo.id }).then(res => {
console.log('data', res)
})
}
}
}
</script>

View File

@ -1,24 +1,24 @@
<template>
<a-card :bordered="false">
<a-tabs :default-active-key="activeTab">
<a-tabs v-if="query.type" :default-active-key="query.type">
<a-tab-pane key="1" tab="答题报告">
<a-card :bordered="false" :bodyStyle="{padding: '0px !important'}" :headStyle="{paddingLeft: '0px !important'}">
<template slot="title">
<h3>建筑施工安全培训第一期课程学习</h3>
<div class="sub-info"><span>交卷时间2021年06月11日 15:06</span><span>答题用时31分19秒</span></div>
<DbReport></DbReport>
<h3>{{viewReport.courseName}}</h3>
<div class="sub-info"><span>交卷时间{{viewReport.submitTime}}</span><span v-if="viewReport.totalScore">答题用时{{viewReport.totalScore}}</span></div>
<DbReport :data="viewReport.reportItems"></DbReport>
</template>
</a-card>
</a-tab-pane>
<a-tab-pane key="2" tab="查看解析">
<a-card :bordered="false" :bodyStyle="{padding: '0px !important'}" :headStyle="{paddingLeft: '0px !important'}">
<template slot="title">
<h4>建筑施工安全培训第一期课程学习</h4>
<h4>{{viewReport.courseName}}</h4>
<div class="sub-info"><span>选择题30/30</span><span>选择题30/30</span><span>选择题30/30</span></div>
</template>
<template v-for="(item, index) in 10" >
<template v-for="(item, index) in viewResolution" >
<div :key="index">
<DbQuestionInfoItem :questionIndex="index+1" ></DbQuestionInfoItem>
<DbQuestionInfoItem :data="item" :questionIndex="index+1" ></DbQuestionInfoItem>
<a-divider></a-divider>
</div>
</template>
@ -31,12 +31,33 @@
<script>
import DbQuestionInfoItem from '@/components/DbQuestionInfoItem/index.vue'
import DbReport from '@/components/DbReport/index.vue'
import { answerViewReport, answerViewResolution } from '@/api/practice/report'
export default {
components: { DbQuestionInfoItem, DbReport },
data () {
return {
activeTab: '1'
query: {},
activeTab: '',
viewReport: {}, //
viewResolution: [] //
}
},
mounted () {
this.query = this.$route.query
this.getAnswerViewReport()
this.getAnswerViewResolution()
},
methods: {
getAnswerViewReport () {
answerViewReport({ reportId: Number(this.query.reportId) }).then(res => {
this.viewReport = res.data
})
},
getAnswerViewResolution () {
answerViewResolution({ reportId: Number(this.query.reportId) }).then(res => {
this.viewResolution = res.data
})
}
}
}