Merge branch 'develop' of https://gitee.com/siwa-team/dawa-vue into develop

This commit is contained in:
18571350067 2022-02-26 16:21:16 +08:00
commit 4998a082a8
11 changed files with 114 additions and 93 deletions

View File

@ -28,7 +28,8 @@ export function reqRegister (parameter) {
return request({ return request({
url: userApi.register, url: userApi.register,
method: 'post', 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 = { const myresourceApi = {
list: 'courseManagement/xmCourseCourseware/resource', // 学习统计 list: 'courseManagement/xmCourseCourseware/resource', // 学习统计
addPreview: 'courseManagement/xmCourseCourseware/details' // 下载次数和预览次数 addPreview: 'courseManagement/xmCourseCourseware/details', // 预览次数
} }
export function gerMyresource (params) { export function gerMyresource (params) {

View File

@ -220,13 +220,17 @@ export default {
if (!err) { if (!err) {
this.btnLoading = true this.btnLoading = true
state.passwordLevelChecked = false state.passwordLevelChecked = false
this.$store.dispatch('ChangePassword', values).then(res => { this.$store
this.btnLoading = false .dispatch('ChangePassword', values)
this.$message.success('修改密码成功') .then(res => {
this.$store.dispatch('Logout').then(() => { this.$message.success('修改密码成功')
this.$router.push({ name: 'login' }) this.$store.dispatch('Logout').then(() => {
this.$router.push({ name: 'login' })
})
})
.finally(() => {
this.btnLoading = false
}) })
})
} }
}) })
} }

View File

@ -93,6 +93,8 @@ const user = {
password: data.password password: data.password
}).then(res => { }).then(res => {
resolve(res) resolve(res)
}).finally((error)=>{
reject(error)
}) })
} catch (error) { } catch (error) {
reject(error) reject(error)

View File

@ -24,7 +24,7 @@
</span> </span>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a-popconfirm <a-popconfirm
v-if="record.status === 1" v-if="record.signStatus === 1 && record.status === 2"
slot="actions" slot="actions"
:title="`确定要报名参加${record.trainName}吗?`" :title="`确定要报名参加${record.trainName}吗?`"
ok-text="添加" ok-text="添加"
@ -33,7 +33,8 @@
> >
<a>报名参加</a> <a>报名参加</a>
</a-popconfirm> </a-popconfirm>
<a v-else slot="actions" href="javascript:void(0);">已报名</a> <a v-if="record.signStatus === 2" slot="actions" href="javascript:void(0);">已报名</a>
<a v-if="record.signStatus === 3" slot="actions" href="javascript:void(0);">已签到</a>
</span> </span>
</a-table> </a-table>
<CentralizedTrainingDetail ref="centralizedTrainingDetail"></CentralizedTrainingDetail> <CentralizedTrainingDetail ref="centralizedTrainingDetail"></CentralizedTrainingDetail>
@ -91,14 +92,12 @@ export default {
} }
}, },
mounted () { mounted () {
// setTimeout(() => {
// this.loading = false
// }, 800)
this.initData() this.initData()
}, },
methods: { methods: {
initData () { initData () {
reqCourseCenterList({ pageNum: 1, pageSize: 5 }).then(res => { const { person } = this.$store.state.user
reqCourseCenterList({ personId: person.id, pageNum: 1, pageSize: 5 }).then(res => {
this.loading = false this.loading = false
this.dataList = res.rows this.dataList = res.rows
}) })

View File

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

View File

@ -76,7 +76,7 @@
<!-- 系统推荐课程 start --> <!-- 系统推荐课程 start -->
<a-col :span="24" :style="{ marginBottom: '24px' }"> <a-col :span="24" :style="{ marginBottom: '24px' }">
<a-card :bordered="false" title="系统推荐课程" :style="{ height: '100%' }"> <a-card :bordered="false" title="系统推荐课程" :style="{ height: '100%' }">
<a-row v-if="sysList && sysList.length>0" :gutter="16"> <a-row v-if="sysList && sysList.length > 0" :gutter="16">
<a-col :span="6" :md="4" :sm="6" v-for="(item, index) in sysList" :key="index"> <a-col :span="6" :md="4" :sm="6" v-for="(item, index) in sysList" :key="index">
<a-card <a-card
@click="handlerContinue(item)" @click="handlerContinue(item)"
@ -103,9 +103,11 @@
<a-card :bordered="false" title="集中培训" :style="{ height: '100%' }"> <a-card :bordered="false" title="集中培训" :style="{ height: '100%' }">
<a-list class="demo-loadmore-list" item-layout="horizontal" :data-source="jzpxList"> <a-list class="demo-loadmore-list" item-layout="horizontal" :data-source="jzpxList">
<a-list-item slot="renderItem" slot-scope="item"> <a-list-item slot="renderItem" slot-scope="item">
<a @click="handlerCenterDetail(item)" slot="actions" href="javascript:void(0);">培训详情</a> <a @click="handlerCenterDetail(item)" slot="actions" href="javascript:void(0);">
培训详情
</a>
<a-popconfirm <a-popconfirm
v-if="item.status === 1" v-if="item.signStatus === 1 && item.status === 2"
slot="actions" slot="actions"
:title="`确定要报名参加${item.trainName}吗?`" :title="`确定要报名参加${item.trainName}吗?`"
ok-text="添加" ok-text="添加"
@ -114,7 +116,8 @@
> >
<a>报名参加</a> <a>报名参加</a>
</a-popconfirm> </a-popconfirm>
<a v-else slot="actions" href="javascript:void(0);">已报名</a> <a v-if="item.signStatus === 2" slot="actions" href="javascript:void(0);">已报名</a>
<a v-if="item.signStatus === 3" slot="actions" href="javascript:void(0);">已签到</a>
<a-list-item-meta :title="item.trainName"></a-list-item-meta> <a-list-item-meta :title="item.trainName"></a-list-item-meta>
<div style="width: 200px;"> <div style="width: 200px;">
{{ item.trainSdate }} {{ item.trainSdate }}
@ -225,7 +228,7 @@ export default {
// //
getJzpxList () { getJzpxList () {
const { person } = this.$store.state.user const { person } = this.$store.state.user
reqCourseCenterList({personId:person.id, pageSize: 5, pageNum: 1 }).then(res => { reqCourseCenterList({ personId: person.id, pageSize: 5, pageNum: 1 }).then(res => {
this.jzpxList = res.rows this.jzpxList = res.rows
}) })
}, },
@ -248,7 +251,8 @@ export default {
reqAddMyCourse({ personId: person.id, projectId: row.id }).then(res => { reqAddMyCourse({ personId: person.id, projectId: row.id }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$message.success('添加课程成功!') this.$message.success('添加课程成功!')
this.reqMyCourseList() this.getCourseList()
this.getPxjhList()
} }
}) })
}, },

View File

@ -70,7 +70,7 @@ export default {
courseType: '' // courseType: '' //
}, },
queryOptions: [ queryOptions: [
{ type: 'select-dic-tree', placeholder: '课程分类', key: 'courseType', options: [] } { type: 'select-dic-tree', width: '200', placeholder: '课程分类', key: 'courseType', options: [] }
] ]
} }
}, },

View File

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

View File

@ -19,10 +19,13 @@
<div v-html="model.content"></div> <div v-html="model.content"></div>
</div> </div>
</div> </div>
<div class="table-operator" v-if="path">
<a-button type="primary" icon="arrow-down" @click="download" class="down"> <div class="down-class" v-show="fileList.length > 0">
附件下载 <a-divider orientation="left">附件下载</a-divider>
</a-button> <a-upload
:file-list="fileList"
:showUploadList="{showDownloadIcon: true, showRemoveIcon: false}">
</a-upload>
</div> </div>
</div> </div>
</a-card> </a-card>
@ -80,6 +83,7 @@ export default {
readCount: 0, readCount: 0,
unreadCount: 0, unreadCount: 0,
noticeRange: 1, noticeRange: 1,
fileList: [],
// //
columns1: [ columns1: [
{ {
@ -138,12 +142,12 @@ export default {
close () { close () {
this.$router.push({ path: '/notice/list', query: { noticeRange: this.noticeRange } }) this.$router.push({ path: '/notice/list', query: { noticeRange: this.noticeRange } })
}, },
getDetail (id) { async getDetail (id) {
noticeGet({ id: id }).then(res => { await noticeGet({ id: id }).then(res => {
this.model = res.data this.model = res.data
const fileArr = JSON.parse(res.data.file) const fileArr = JSON.parse(res.data.file)
if (fileArr.length > 0) { if (fileArr.length > 0) {
this.path = fileArr[0].url this.fileList = fileArr
} }
}) })
}, },
@ -182,4 +186,8 @@ export default {
.article-body { .article-body {
margin-top: 15px; margin-top: 15px;
} }
.down-class {
width: 50%;
margin-top: 20px;
}
</style> </style>

View File

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