feat: 问题修复

This commit is contained in:
cgd_mac 2022-02-26 14:53:38 +08:00
parent 5ba794f9b5
commit 60d167e792
6 changed files with 73 additions and 68 deletions

View File

@ -28,7 +28,8 @@ export function reqRegister (parameter) {
return request({
url: userApi.register,
method: 'post',
data: parameter
data: parameter,
params: {type: parameter.type, phone: parameter.phone, verifyCode: parameter.code}
})
}

View File

@ -2,7 +2,7 @@ import request from '@/utils/request'
const myresourceApi = {
list: 'courseManagement/xmCourseCourseware/resource', // 学习统计
addPreview: 'courseManagement/xmCourseCourseware/details' // 下载次数和预览次数
addPreview: 'courseManagement/xmCourseCourseware/details', // 预览次数
}
export function gerMyresource (params) {

View File

@ -1,14 +1,17 @@
<template>
<a-card :bordered="false" :loading="loading">
<div class="table-page-search-wrapper">
<SearchCom :form="queryParam" :list="queryOptions" @search="handleRefresh" @reset="
<SearchCom
:form="queryParam"
:list="queryOptions"
@search="handleRefresh"
@reset="
() => {
queryParam = {}
handleRefresh()
}
"></SearchCom>
</div>
</br>
<a-tabs :default-active-key="activeTab" @change="(key)=>{activeTab = key}">
<a-tab-pane key="1" tab="预约考试">
<s-table ref="examTable" :pageSize="5" :columns="examColumns" :data="loadExamData" :rowKey="record => record.id">
@ -61,163 +64,161 @@
</template>
<script>
import { STable, SearchCom } from '@/components';
import { reqExamList, reqExamAttendList, reqExamSubscribe } from '@/api/myexam/exam';
import { dictionaryDropDown } from '@/api/sys/dictionaryItem';
import { dictToTree } from '@/utils/util';
import { dictGet } from '@/api/project/project';
import { STable, SearchCom } from '@/components'
import { reqExamList, reqExamAttendList, reqExamSubscribe } from '@/api/myexam/exam'
import { dictGet } from '@/api/project/project'
export default {
components: { STable, SearchCom },
data() {
data () {
return {
loading: false,
activeTab: '1',
queryParam: {
examClassify: '', //
examClassify: '' //
},
queryOptions: [
{ type: 'select-dic-tree', placeholder: '课程分类', key: 'examClassify', options: [] },
{ type: 'select', placeholder: '课程分类', key: 'examClassify', options: [] }
],
examColumns: [
{
title: '序号',
width: '80px',
scopedSlots: { customRender: 'index' },
align: 'center',
align: 'center'
},
{
title: '考试科目',
dataIndex: 'projectName',
dataIndex: 'projectName'
},
{
title: '准考证号',
dataIndex: 'candidateNo',
dataIndex: 'candidateNo'
},
{
title: '考试形式',
dataIndex: 'testType',
scopedSlots: { customRender: 'testType' },
scopedSlots: { customRender: 'testType' }
},
{
title: '考试时间',
dataIndex: 'examSdate',
dataIndex: 'examSdate'
},
{
title: '考试时长',
dataIndex: 'examTime',
scopedSlots: { customRender: 'examTime' },
scopedSlots: { customRender: 'examTime' }
},
{
title: '考试资格',
dataIndex: 'zige',
scopedSlots: { customRender: 'zige' },
scopedSlots: { customRender: 'zige' }
},
{
title: '操作',
width: '150px',
dataIndex: 'action',
scopedSlots: { customRender: 'action' },
},
scopedSlots: { customRender: 'action' }
}
],
examDoneColumns: [
{
title: '序号',
width: '80px',
scopedSlots: { customRender: 'index' },
align: 'center',
align: 'center'
},
{
title: '考试科目',
dataIndex: 'projectName',
dataIndex: 'projectName'
},
{
title: '准考证号',
dataIndex: 'candidateNo',
dataIndex: 'candidateNo'
},
{
title: '考试形式',
dataIndex: 'testType',
scopedSlots: { customRender: 'testType' },
scopedSlots: { customRender: 'testType' }
},
{
title: '答卷时间',
dataIndex: 'submitTime',
dataIndex: 'submitTime'
},
{
title: '考试时长',
dataIndex: 'examTime',
scopedSlots: { customRender: 'examTime' },
scopedSlots: { customRender: 'examTime' }
},
{
title: '考试成绩',
dataIndex: 'score',
dataIndex: 'score'
},
{
title: '操作',
width: '150px',
dataIndex: 'action',
scopedSlots: { customRender: 'action' },
},
scopedSlots: { customRender: 'action' }
}
],
loadExamData: parameter => {
return reqExamList(Object.assign(parameter, this.queryParam)).then(res => {
return res;
});
return res
})
},
loadExamDoneData: parameter => {
return reqExamAttendList(Object.assign(parameter, this.queryParam)).then(res => {
return res;
});
},
};
return res
})
}
}
},
mounted() {
this.dictionaryDropDown();
mounted () {
this.dictionaryDropDown()
},
methods: {
dictionaryDropDown() {
dictionaryDropDown () {
dictGet({ type: 1 }).then(res => {
this.queryOptions[0].options = res.data;
this.loading = false;
});
this.queryOptions[0].options = res.data
this.loading = false
})
},
//
handleRefresh() {
const { activeTab } = this;
console.log('activeTab', activeTab);
handleRefresh () {
const { activeTab } = this
console.log('activeTab', activeTab)
if (activeTab === '1') {
this.$refs.examTable.refresh();
this.$refs.examTable.refresh()
} else {
this.$refs.examDoneTable.refresh();
this.$refs.examDoneTable.refresh()
}
},
//
handlerMarker(data) {
const _this = this;
handlerMarker (data) {
const _this = this
this.$confirm({
title: '提示',
content: '确定要预约考试吗?',
onOk() {
onOk () {
reqExamSubscribe({ projectId: data.id }).then(res => {
_this.$message.success('预约成功!');
_this.handleRefresh();
});
_this.$message.success('预约成功!')
_this.handleRefresh()
})
},
onCancel() {},
});
onCancel () {}
})
},
handlerGoExam(row) {
handlerGoExam (row) {
// 5(...)
// const diff = new Date().getTime() - new Date(examSdate).getTime()
// if(diff > -1000*60*5){}
this.$router.push({ path: '/myexamDetail', query: { type: 'exam', projectId: row.id } });
this.$router.push({ path: '/myexamDetail', query: { type: 'exam', projectId: row.id } })
},
handlerGoReport(row) {
this.$router.push({ path: '/myreport', query: { type: 'exam', reportId: row.report.id } });
},
},
};
handlerGoReport (row) {
this.$router.push({ path: '/myreport', query: { type: 'exam', reportId: row.report.id } })
}
}
}
</script>
<style lang="less" scoped>

View File

@ -248,7 +248,8 @@ export default {
reqAddMyCourse({ personId: person.id, projectId: row.id }).then(res => {
if (res.code === 200) {
this.$message.success('添加课程成功!')
this.reqMyCourseList()
this.getCourseList()
this.getPxjhList()
}
})
},

View File

@ -108,10 +108,10 @@ export default {
})
},
handlerDownload (data, file) {
window.open(file.path)
// reqAddPreview({ coursewareId: data.id, isEdit: 0 }).then(res => {
// window.open(file.path)
// })
reqAddPreview({ coursewareId: data.id, isDown: 1 }).then(res => {
window.open(file.path)
data.downCount++
})
},
handlerPreview (data) {
this.$router.push({

View File

@ -309,7 +309,9 @@ export default {
userName: data.username,
password: data.password,
phone: data.mobile,
orgId: this.unitInfo.id
code: data.captcha,
orgId: this.unitInfo.id,
type: 'register'
}
reqRegister(params).then(res => {
this.$message.success('注册成功!')