提交 0130990b authored 作者: lihuihui's avatar lihuihui

update

上级 502787b9
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" href="https://zws-imgs-pub.ezijing.com/pc/base/favicon.ico" /> <link rel="icon" href="https://zws-imgs-pub.ezijing.com/pc/base/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>金融产品数字化营销职业技能等级证书学习平台</title> <title>金融数据合规管理证书在线学习及考试系统</title>
<link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.9.3/skins/default/aliplayer-min.css" /> <link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.9.3/skins/default/aliplayer-min.css" />
<link rel="stylesheet" href="//at.alicdn.com/t/font_2173492_ctgt96uojqw.css" /> <link rel="stylesheet" href="//at.alicdn.com/t/font_2173492_ctgt96uojqw.css" />
</head> </head>
......
...@@ -22,11 +22,11 @@ export function sendCode(data) { ...@@ -22,11 +22,11 @@ export function sendCode(data) {
} }
// 登出 // 登出
export function logout() { export function logout() {
return httpRequest.get('/api/zy/user/logout') return httpRequest.get('/api/lms-financial/user/logout')
} }
// 获取用户信息 // 获取用户信息
export function getUser() { export function getUser() {
return httpRequest.get('/api/fd/user/get-student-info') return httpRequest.get('/api/lms-financial/user/get-student-info')
} }
// 修改用户信息 // 修改用户信息
export function updateUser(data) { export function updateUser(data) {
......
...@@ -9,16 +9,16 @@ export function getCourseModule() { ...@@ -9,16 +9,16 @@ export function getCourseModule() {
/** /**
* 获取课程列表 * 获取课程列表
*/ */
export function getCourseList() { export function getCourseList(params) {
return httpRequest.get('/api/zy/v2/education/courses/list') return httpRequest.get('/api/lms-financial/v1/education/course-list', { params })
} }
/** /**
* 获取课程详情 * 获取课程详情
* @param {string} courseId 课程ID * @param {string} courseId 课程ID
*/ */
export function getCourse(courseId) { export function getCourse(params) {
return httpRequest.get(`/api/zy/v2/education/courses/${courseId}`).then(response => { return httpRequest.get('/api/lms-financial/v1/education/course-view', { params }).then(response => {
// response.chapters = response.chapters.filter(item => { // response.chapters = response.chapters.filter(item => {
// item.children = item.children.filter(child => child.type === 2) // item.children = item.children.filter(child => child.type === 2)
// return item.children.length // return item.children.length
......
<template> <template>
<div class="course-list" element-loading-text="加载中..." v-loading="!loaded"> <div>
<template v-if="currentList.length"> <div style="margin-bottom: 20px">
<course-list-item v-for="item in currentList" :data="item" :key="item.id" v-bind="$attrs" v-on="$listeners" /> <el-button type="primary" @click="getCourseList('learn-time')">最近学习<i class="el-icon-caret-bottom el-icon--right"></i></el-button>
</template> <el-button type="primary" @click="getCourseList('updated_time')">最近更新<i class="el-icon-caret-bottom el-icon--right"></i></el-button>
<template v-else> </div>
<slot name="empty"> <app-container>
<div class="empty">暂无相关课程</div> <div class="course-list" element-loading-text="加载中..." v-loading="!loaded">
</slot> <template v-if="currentList.length">
</template> <course-list-item v-for="item in currentList" :data="item" :key="item.id" v-bind="$attrs" v-on="$listeners" />
</template>
<template v-else>
<slot name="empty">
<div class="empty">暂无相关课程</div>
</slot>
</template>
</div>
</app-container>
</div> </div>
</template> </template>
...@@ -39,12 +47,15 @@ export default { ...@@ -39,12 +47,15 @@ export default {
} }
}, },
methods: { methods: {
getCourseList() { getCourseList(value = '') {
api api
.getCourseList() .getCourseList({ sort: value })
.then(response => { .then(response => {
this.list = this.requestCallback ? this.requestCallback(response) : response response.data.forEach(item => {
this.$emit('request-success', response) item.times = response.times
})
this.list = this.requestCallback ? this.requestCallback(response) : response.data
this.$emit('request-success', response.data)
}) })
.finally(() => { .finally(() => {
this.loaded = true this.loaded = true
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<img class="course-item-pic" :src="data.curriculum.curriculum_picture" /> <img class="course-item-pic" :src="data.curriculum.curriculum_picture" />
<div class="course-item-content"> <div class="course-item-content">
<div class="course-item__title">{{ data.curriculum.curriculum_name }}</div> <div class="course-item__title">{{ data.curriculum.curriculum_name }}</div>
<div class="course-top__tips">第x次重修</div> <div class="course-top__tips" v-if="data.times">{{ data.times }}次重修</div>
<div class="course-item__tools"> <div class="course-item__tools">
<div class="course-item__progress"> <div class="course-item__progress">
<span>视频观看进度</span> <span>视频观看进度</span>
......
...@@ -163,7 +163,7 @@ export default { ...@@ -163,7 +163,7 @@ export default {
.then(res => { .then(res => {
const { data = {} } = res || {} const { data = {} } = res || {}
this.page.total = parseInt(data.total || 0) this.page.total = parseInt(data.total || 0)
this.dataList = callback ? callback(data) : data.list this.dataList = callback ? callback(data) : data
}) })
.catch(() => { .catch(() => {
this.page.total = 0 this.page.total = 0
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</div> </div>
<el-menu class="nav" :unique-opened="true" :default-active="defaultActive"> <el-menu class="nav" :unique-opened="true" :default-active="defaultActive">
<template v-for="item in currentMenus"> <template v-for="item in currentMenus">
<el-submenu :index="item.title" :key="item.title" v-show="menuVisible(item.tag)" v-if="item.children"> <el-submenu :index="item.title" :key="item.title" v-if="item.children">
<template #title> <template #title>
<i class="iconfont" :class="item.icon"></i><span>{{ item.title }}</span> <i class="iconfont" :class="item.icon"></i><span>{{ item.title }}</span>
</template> </template>
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
:key="item.title" :key="item.title"
v-for="item in item.children" v-for="item in item.children"
@click="handleClick(item.path, item)" @click="handleClick(item.path, item)"
v-show="menuVisible(item.tag)"
> >
<template #title> <template #title>
<template v-if="item.href"> <template v-if="item.href">
...@@ -33,7 +32,6 @@ ...@@ -33,7 +32,6 @@
:index="item.path" :index="item.path"
:key="item.title" :key="item.title"
@click="handleClick(item.path, item)" @click="handleClick(item.path, item)"
v-show="menuVisible(item.tag)"
v-else v-else
> >
<i class="iconfont" :class="item.icon"></i> <i class="iconfont" :class="item.icon"></i>
...@@ -132,12 +130,6 @@ export default { ...@@ -132,12 +130,6 @@ export default {
} }
}, },
methods: { methods: {
menuVisible(tag) {
if (!tag) {
return true
}
return !!this.menuPermissions.find(item => item.tag === tag)
},
genClasses(data) { genClasses(data) {
const isActive = this.$route.fullPath.includes(data.path) const isActive = this.$route.fullPath.includes(data.path)
return { 'is-active': isActive } return { 'is-active': isActive }
......
...@@ -26,7 +26,7 @@ export default { ...@@ -26,7 +26,7 @@ export default {
// components: { AppSearchBar }, // components: { AppSearchBar },
data() { data() {
return { return {
title: '金融产品数字化营销职业技能等级证书' title: '金融数据合规管理证书在线学习及考试系统'
} }
}, },
computed: { computed: {
......
...@@ -22,7 +22,7 @@ export function sendCode(data) { ...@@ -22,7 +22,7 @@ export function sendCode(data) {
} }
// 登出 // 登出
export function logout() { export function logout() {
return httpRequest.get('/api/zy/user/logout') return httpRequest.get('/api/lms-financial/user/logout')
} }
// 获取用户信息 // 获取用户信息
export function getUser() { export function getUser() {
......
<template> <template>
<app-container title="个人信息"> <app-container title="个人信息">
<el-form :model="ruleForm" :rules="rules" label-width="100px" ref="ruleForm" class="form" hide-required-asterisk> <el-form :model="ruleForm" :rules="rules" label-width="100px" ref="ruleForm" class="form" hide-required-asterisk>
<el-form-item label="所在院校" prop="school_name"> <!-- <el-form-item label="所在院校" prop="school_name">
<el-input v-model="info.school_name" disabled></el-input> <el-input v-model="info.school_name" disabled></el-input>
</el-form-item> </el-form-item>
<el-form-item label="院系名称" prop="college"> <el-form-item label="院系名称" prop="college">
...@@ -12,6 +12,9 @@ ...@@ -12,6 +12,9 @@
</el-form-item> </el-form-item>
<el-form-item label="考证等级" prop="grade"> <el-form-item label="考证等级" prop="grade">
<el-input v-model="info.grade" disabled></el-input> <el-input v-model="info.grade" disabled></el-input>
</el-form-item> -->
<el-form-item label="所属机构" prop="student_info.school">
<el-input v-model="ruleForm.student_info.school" disabled></el-input>
</el-form-item> </el-form-item>
<el-form-item label="用户真实姓名" prop="realname"> <el-form-item label="用户真实姓名" prop="realname">
<el-input v-model="ruleForm.realname" disabled></el-input> <el-input v-model="ruleForm.realname" disabled></el-input>
...@@ -19,12 +22,12 @@ ...@@ -19,12 +22,12 @@
<el-form-item label="身份证号码" prop="id_number"> <el-form-item label="身份证号码" prop="id_number">
<el-input v-model="info.id_number" disabled></el-input> <el-input v-model="info.id_number" disabled></el-input>
</el-form-item> </el-form-item>
<el-form-item label="身份" prop="role"> <!-- <el-form-item label="身份" prop="role">
<el-select v-model="ruleForm.role" disabled style="width: 100%"> <el-select v-model="ruleForm.role" disabled style="width: 100%">
<el-option :value="1" label="学生"></el-option> <el-option :value="1" label="学生"></el-option>
<el-option :value="2" label="老师"></el-option> <el-option :value="2" label="老师"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item> -->
<el-form-item label="登录帐号" prop="mobile"> <el-form-item label="登录帐号" prop="mobile">
<el-input v-model="ruleForm.mobile" disabled></el-input> <el-input v-model="ruleForm.mobile" disabled></el-input>
</el-form-item> </el-form-item>
......
import httpRequest from '@/utils/axios' import httpRequest from '@/utils/axios'
/* 意见反馈 */ /* 意见反馈 */
export function submitFeedback(data) { export function getCert() {
return httpRequest.post('/api/zy/v2/feedback/commit', data) return httpRequest.get('/api/lms-financial/v1/education/certificate')
} }
<template> <template>
<div>11</div> <app-container>
<el-empty description="您还未取得证书,快去学习考试吧" v-if="!data.length"></el-empty>
<div class="cert" v-else>
<el-button type="primary" @click="downImg">证书下载</el-button>
<div class="img">
<img :src="item.url" :key="index" alt="" v-for="(item, index) in data">
</div>
</div>
</app-container>
</template> </template>
<script> <script>
export default {} import * as api from '../api.js'
export default {
data() {
return {
data: []
}
},
mounted () {
api.getCert().then(response => {
console.log(response)
this.data = response.data
})
},
methods: {
downImg() {
this.data.forEach((item, index) => {
setTimeout(() => {
window.open(item.url)
}, index * 1000)
})
}
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.img{
width: 80%;
img{
width: 100%;
display: block;
margin-top: 20px;
}
}
</style> </style>
...@@ -10,15 +10,15 @@ export function getCourseModule() { ...@@ -10,15 +10,15 @@ export function getCourseModule() {
* 获取课程列表 * 获取课程列表
*/ */
export function getCourseList() { export function getCourseList() {
return httpRequest.get('/api/zy/v2/education/courses/list') return httpRequest.get('/api/lms-financial/v1/education/course-list')
} }
/** /**
* 获取课程详情 * 获取课程详情
* @param {string} courseId 课程ID * @param {string} courseId 课程ID
*/ */
export function getCourse(courseId) { export function getCourse(params) {
return httpRequest.get(`/api/zy/v2/education/courses/${courseId}`).then(response => { return httpRequest.get('/api/lms-financial/v1/education/course-view', { params }).then(response => {
// response.chapters = response.chapters.filter(item => { // response.chapters = response.chapters.filter(item => {
// item.children = item.children.filter(child => child.type === 2) // item.children = item.children.filter(child => child.type === 2)
// return item.children.length // return item.children.length
......
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
}, },
handleClick(data) { handleClick(data) {
if (data.type === 2 || data.type === 4) { if (data.type === 2 || data.type === 4) {
this.$router.push({ name: 'viewerCourseChapter', params: { cid: this.courseId, id: data.id } }) this.$router.push({ name: 'viewerCourseChapter', query: { cid: this.courseId, vid: data.id } })
} }
}, },
toExamPage(data, type) { toExamPage(data, type) {
......
...@@ -4,7 +4,10 @@ ...@@ -4,7 +4,10 @@
<!-- 视频 --> <!-- 视频 -->
<div class="item"> <div class="item">
<div class="item-title"> <div class="item-title">
课程“音视频”观看统计( 累计学习时长:"00:00,完成率:0/24 ) 课程“音视频”观看统计( 累计学习时长:"{{ formatDuration(this.data.course_duration) }},完成率:{{
this.data.course_progress
}}
</div> </div>
<div class="table"> <div class="table">
<div class="table-row table-row-th"> <div class="table-row table-row-th">
...@@ -12,50 +15,17 @@ ...@@ -12,50 +15,17 @@
<div class="table-cell w100">学习时长</div> <div class="table-cell w100">学习时长</div>
<div class="table-cell w100">百分比</div> <div class="table-cell w100">百分比</div>
</div> </div>
<div class="table-row-group" v-for="(item, index) in videoList" :key="index"> <div class="table-row-group" v-for="(item, index) in list" :key="index">
<div class="table-row-group-th">{{ item.title }}</div> <div class="table-row-group-th">{{ item.title }}</div>
<div class="table-row" v-for="(subItem, index) in item.sections" :key="index"> <div class="table-row" v-for="(subItem, index) in item.sections" :key="index" @click="goPage(subItem)">
<div class="table-cell">{{ subItem.title }}</div> <div class="table-cell">{{ subItem.title }}</div>
<div class="table-cell w100">{{ formatDuration(subItem.duration) }}</div> <div class="table-cell w100">{{ formatDuration(subItem.duration) }}</div>
<div class="table-cell w100">{{ subItem.progress }}%</div> <div class="table-cell w100">{{ subItem.progress }}%</div>
</div> </div>
</div> </div>
<div class="empty-data" v-if="!videoList.length">暂无数据</div> <!-- <div class="empty-data" v-if="!videoList.length">暂无数据</div> -->
</div> </div>
</div> </div>
<!-- 作业 -->
<!-- <div class="item">
<div class="item-title">
{{ $t('pages.learn.courseDetail.subjectivequestions') }}
</div>
<div class="table">
<div class="table-row table-row-th">
<div class="table-cell">{{ $t('pages.learn.courseDetail.chapter') }}</div>
<div class="table-cell w100">{{ $t('pages.learn.courseDetail.Submissiontime') }}</div>
<div class="table-cell w100">{{ $t('pages.learn.courseDetail.score') }}</div>
</div>
<div class="table-row-group" v-for="(item, index) in homeWorkList" :key="index">
<div class="table-row-group-th">{{ item.title }}</div>
<div class="table-row" v-for="(subItem, index) in item.sections" :key="index">
<div class="table-cell">{{ subItem.title }}</div>
<div class="table-cell w100">{{ subItem.created_time || '暂无提交' }}</div>
<div class="table-cell w100">{{ showCore(subItem.score) }}</div>
</div>
</div>
<div class="empty-data" v-if="!homeWorkList.length">{{ $t('pages.learn.courseDetail.Nodataavailable') }}</div>
</div>
</div>
<div class="item">
<div class="item-title">{{ $t('pages.learn.courseDetail.Bighomework') }}</div>
<div class="status-text">
{{ $t('pages.learn.courseDetail.Status') }}{{ essay.status || $t('action.courseAction.none') }}
</div>
<div class="status-text" v-if="essay.created_time">
{{ $t('pages.learn.courseDetail.Submissiontime') }}{{ essay.created_time }}
</div>
<div class="status-text">{{ $t('pages.learn.courseDetail.score2') }}{{ showCore(essay.score) }}</div>
</div> -->
</div> </div>
</template> </template>
...@@ -71,9 +41,38 @@ export default { ...@@ -71,9 +41,38 @@ export default {
}, },
essay() { essay() {
return this.data.essay_evaluation || {} return this.data.essay_evaluation || {}
},
list() {
return this.data.chapters.reduce((prev, cur) => {
const data = []
cur.children.forEach(item => {
if (item.video_duration !== undefined) {
data.push({
duration: item.video_duration,
progress: item.video_progress,
title: item.name,
vid: item.id
})
}
})
prev.push({
title: cur.name,
sections: data
})
return prev
}, [])
} }
}, },
methods: { methods: {
goPage(item) {
this.$router.push({
path: '/player/detail',
query: {
cid: this.$route.query.id,
vid: item.vid
}
})
},
formatDuration(duration) { formatDuration(duration) {
const h = Math.floor(duration / 3600) const h = Math.floor(duration / 3600)
const m = Math.floor((duration - h * 3600) / 60) const m = Math.floor((duration - h * 3600) / 60)
......
...@@ -4,7 +4,7 @@ const routes = [ ...@@ -4,7 +4,7 @@ const routes = [
component: () => import('@/components/layout/index.vue'), component: () => import('@/components/layout/index.vue'),
children: [ children: [
{ path: '/course/learn', component: () => import('./views/Index.vue') }, { path: '/course/learn', component: () => import('./views/Index.vue') },
{ path: '/course/learn/:id', name: 'courseLearnItem', component: () => import('./views/Item.vue') } { path: '/course/detail', name: 'courseLearnItem', component: () => import('./views/Item.vue') }
] ]
} }
] ]
......
<template> <template>
<div> <course-list @on-click="handleClick" :searchValue="searchValue" />
<div style="margin-bottom: 20px">
<el-button type="primary">最近学习<i class="el-icon-caret-bottom el-icon--right"></i></el-button>
<el-button type="primary">最近更新<i class="el-icon-caret-bottom el-icon--right"></i></el-button>
</div>
<app-container>
<course-list @on-click="handleClick" :searchValue="searchValue" />
</app-container>
</div>
</template> </template>
<script> <script>
import * as api from '@/api/course.js'
import CourseList from '@/components/CourseList.vue' import CourseList from '@/components/CourseList.vue'
export default { export default {
...@@ -31,7 +24,7 @@ export default { ...@@ -31,7 +24,7 @@ export default {
}, },
methods: { methods: {
handleClick(data) { handleClick(data) {
this.$router.push({ name: 'courseLearnItem', params: { id: data.course_id } }) this.$router.push({ name: 'courseLearnItem', query: { id: data.course_id } })
}, },
// 搜索 // 搜索
handleSearch() {} handleSearch() {}
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="course-top-hd"> <div class="course-top-hd">
<div class="course-top-hd-left"> <div class="course-top-hd-left">
<div class="course-top__title">{{ detail.curriculum.curriculum_name }}</div> <div class="course-top__title">{{ detail.curriculum.curriculum_name }}</div>
<div class="course-top__tips">第x次重修</div> <div class="course-top__tips" v-if="times">{{ times }}次重修</div>
<div class="course-top__progress"> <div class="course-top__progress">
视频观看进度 <el-progress :percentage="detail.video_progress"></el-progress> 视频观看进度 <el-progress :percentage="detail.video_progress"></el-progress>
</div> </div>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<course-chapter :courseId="courseId" :showProgress="true" :data="detail.chapters"></course-chapter> <course-chapter :courseId="courseId" :showProgress="true" :data="detail.chapters"></course-chapter>
</el-tab-pane> </el-tab-pane>
<el-tab-pane lazy label="学习进度"> <el-tab-pane lazy label="学习进度">
<course-progress :data="{}"></course-progress> <course-progress :data="detail"></course-progress>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
...@@ -58,12 +58,13 @@ export default { ...@@ -58,12 +58,13 @@ export default {
return { return {
tabActive: 0, tabActive: 0,
loaded: false, loaded: false,
detail: {} detail: {},
times: 0
} }
}, },
computed: { computed: {
courseId() { courseId() {
return this.$route.params.id return this.$route.query.id
}, },
buttonText() { buttonText() {
return this.detail.latest_play ? '继续学习' : '开始学习' return this.detail.latest_play ? '继续学习' : '开始学习'
...@@ -95,10 +96,12 @@ export default { ...@@ -95,10 +96,12 @@ export default {
getCourse() { getCourse() {
this.loaded = false this.loaded = false
api api
.getCourse(this.courseId) .getCourse({ course_id: this.$route.query.id })
.then(response => { .then(response => {
response = response.data
this.times = response.times
if (response.files && response.files.length) { if (response.files && response.files.length) {
response.chapters.push({ id: '1', name: '补充阅读材料', children: response.files }) // response.chapters.push({ id: '1', name: '补充阅读材料', children: response.files })
} }
this.detail = response this.detail = response
}) })
...@@ -107,7 +110,8 @@ export default { ...@@ -107,7 +110,8 @@ export default {
}) })
}, },
onChapterClick(data) { onChapterClick(data) {
this.$router.push({ name: 'viewerCourseChapter', params: { cid: this.courseId, id: data.id } }) console.log(data.id, this.$route.query.id)
this.$router.push({ name: 'viewerCourseChapter', query: { vid: data.id, cid: this.$route.query.id } })
}, },
toExamPage(data, type) { toExamPage(data, type) {
const path = type === 3 ? '/exam/test/result' : '/exam/test/exam' const path = type === 3 ? '/exam/test/result' : '/exam/test/exam'
......
...@@ -2,16 +2,15 @@ import httpRequest from '@/utils/axios' ...@@ -2,16 +2,15 @@ import httpRequest from '@/utils/axios'
/** /**
* 获取课程详情 * 获取课程详情
* @param {string} semesterId 学期ID
* @param {string} courseId 课程ID * @param {string} courseId 课程ID
*/ */
export function getCourse(semesterId, courseId) { export function getCourse(params) {
return httpRequest.get(`/api/zy/v2/education/courses/${courseId}`).then(response => { return httpRequest.get('/api/lms-financial/v1/education/course-view', { params }).then(response => {
response.chapters = response.chapters.filter(item => { response.chapters = response.data.chapters.filter(item => {
item.children = item.children.filter(child => child.type === 2 || child.type === 4) item.children = item.children.filter(child => child.type === 2 || child.type === 4)
return item.children.length return item.children.length
}) })
return response return response.data
}) })
} }
...@@ -33,7 +32,7 @@ export function getChapterVideo(vid) { ...@@ -33,7 +32,7 @@ export function getChapterVideo(vid) {
*/ */
export function getChapterVideoAliyun(vid) { export function getChapterVideoAliyun(vid) {
return httpRequest.post( return httpRequest.post(
'/api/zy/v2/education/aliyun-video-streaming', '/api/lms-financial/v1/education/aliyun-video-streaming',
{ vid }, { vid },
{ headers: { 'Content-Type': 'application/json' } } { headers: { 'Content-Type': 'application/json' } }
) )
...@@ -45,8 +44,8 @@ export function getChapterVideoAliyun(vid) { ...@@ -45,8 +44,8 @@ export function getChapterVideoAliyun(vid) {
* @param {string} resourseId 章节的资源ID * @param {string} resourseId 章节的资源ID
* @param {Object} params * @param {Object} params
*/ */
export function getChapterVideoProgress(semesterId, resourseId, params) { export function getChapterVideoProgress(params) {
return httpRequest.get(`/api/zy/v2/education/video/${resourseId}/device`, { params }) return httpRequest.get('/api/lms-financial/v1/education/video-device', { params })
} }
/** /**
...@@ -54,7 +53,7 @@ export function getChapterVideoProgress(semesterId, resourseId, params) { ...@@ -54,7 +53,7 @@ export function getChapterVideoProgress(semesterId, resourseId, params) {
* @param {Object} params * @param {Object} params
*/ */
export function updateChapterVideoProgress(params) { export function updateChapterVideoProgress(params) {
return httpRequest.get('/api/zy/v2/analytics/upload-video', { params }) return httpRequest.get('/api/lms-financial/v1/analytics/upload-video', { params })
} }
/** /**
......
...@@ -82,7 +82,7 @@ export default { ...@@ -82,7 +82,7 @@ export default {
this.$router.push({ name: 'survey', params: { sid, cid } }) this.$router.push({ name: 'survey', params: { sid, cid } })
return return
} }
this.$router.push({ name: 'viewerCourseChapter', params: { id: data.id } }) this.$router.push({ name: 'viewerCourseChapter', query: { cid: this.$route.query.cid, vid: data.id } })
} }
} }
} }
......
...@@ -33,6 +33,8 @@ export default { ...@@ -33,6 +33,8 @@ export default {
} }
} }
}, },
mounted() {
},
computed: { computed: {
currentCompoent() { currentCompoent() {
const componentNames = { const componentNames = {
...@@ -46,10 +48,11 @@ export default { ...@@ -46,10 +48,11 @@ export default {
100: 'CourseRead', // 课程资料 100: 'CourseRead', // 课程资料
101: 'CourseExam' // 课程考试 101: 'CourseExam' // 课程考试
} }
console.log(1123123)
return this.chapter ? componentNames[this.chapter.type] || '' : '' return this.chapter ? componentNames[this.chapter.type] || '' : ''
}, },
pid() { pid() {
return this.$route.params.id return this.$route.query.vid
} }
} }
} }
......
...@@ -87,7 +87,7 @@ export default { ...@@ -87,7 +87,7 @@ export default {
}, },
// 课程ID // 课程ID
cid() { cid() {
return this.$route.params.cid return this.$route.query.cid
}, },
// 视频资源ID // 视频资源ID
resourceId() { resourceId() {
...@@ -170,6 +170,7 @@ export default { ...@@ -170,6 +170,7 @@ export default {
if (this.throttled) { if (this.throttled) {
this.throttled(time, durations) this.throttled(time, durations)
} else { } else {
console.log(11)
this.throttled = throttle(this.updateChapterVideoProgress, this.throttleWait * 1000, { leading: false }) this.throttled = throttle(this.updateChapterVideoProgress, this.throttleWait * 1000, { leading: false })
} }
}, },
...@@ -209,8 +210,8 @@ export default { ...@@ -209,8 +210,8 @@ export default {
// 获取章节视频进度 // 获取章节视频进度
getChapterVideoProgress() { getChapterVideoProgress() {
api api
.getChapterVideoProgress(this.sid, this.resourceId, { .getChapterVideoProgress({
device_id: this.deviceId vid: this.resourceId
}) })
.then(response => { .then(response => {
this.progress = response this.progress = response
...@@ -224,14 +225,13 @@ export default { ...@@ -224,14 +225,13 @@ export default {
updateChapterVideoProgress(time, durations) { updateChapterVideoProgress(time, durations) {
// 登录用户信息 // 登录用户信息
const user = this.$store.state.user const user = this.$store.state.user
const info = user.role === 2 ? user.staff_info : user.student_info
const params = { const params = {
sid: info.id, sid: user.student_info.id,
uid: user.id, uid: user.id,
d: this.deviceId, d: this.deviceId,
i: this.deviceId, i: this.deviceId,
c: this.cid, // 课程ID c: this.cid, // 课程ID
s: this.sid, // 学期ID // s: this.sid, // 学期ID
v: this.resourceId, // 视频资源ID v: this.resourceId, // 视频资源ID
_p: this.progress.pt, // 累计时间 _p: this.progress.pt, // 累计时间
_m: this.progress.mpt, // 当前播放最大时间 _m: this.progress.mpt, // 当前播放最大时间
......
const routes = [ const routes = [
{ {
path: '/viewer/:cid', path: '/viewer',
component: () => import('./views/Index.vue'), component: () => import('./views/Index.vue'),
children: [{ name: 'viewerCourseChapter', path: ':id', component: () => import('./components/layout.vue') }] children: [{ name: 'viewerCourseChapter', path: '/player/detail', component: () => import('./components/layout.vue') }]
} }
] ]
export { routes } export { routes }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="course-viewer-main"> <div class="course-viewer-main">
<!-- 顶部区域 --> <!-- 顶部区域 -->
<div class="course-viewer-main-hd"> <div class="course-viewer-main-hd">
<router-link :to="`/course/learn/${cid}`"> <router-link :to="`/course/detail?id=${cid}`">
<i class="el-icon-arrow-left"></i> <i class="el-icon-arrow-left"></i>
</router-link> </router-link>
<h1 class="course-viewer-main-hd__title">{{ detail.course_name }}</h1> <h1 class="course-viewer-main-hd__title">{{ detail.course_name }}</h1>
...@@ -82,11 +82,11 @@ export default { ...@@ -82,11 +82,11 @@ export default {
}, },
// 课程ID // 课程ID
cid() { cid() {
return this.$route.params.cid return this.$route.query.cid
}, },
// 当前页面的ID // 当前页面的ID
pid() { pid() {
return this.$route.params.id return this.$route.query.vid
}, },
// 章节列表 // 章节列表
chapters() { chapters() {
...@@ -148,7 +148,7 @@ export default { ...@@ -148,7 +148,7 @@ export default {
getCourse() { getCourse() {
this.loaded = false this.loaded = false
api api
.getCourse(this.sid, this.cid) .getCourse({ course_id: this.$route.query.cid })
.then(response => { .then(response => {
this.detail = response this.detail = response
}) })
......
import httpRequest from '@/utils/axios'
/**
* 获取考试列表
*/
export function getExamList() {
return httpRequest.get('/api/lms-financial/v1/examination/list')
}
/**
* 提交重修申请
*/
export function sbumitRetake(data) {
return httpRequest.post('/api/lms-financial/v1/examination/retake', data)
}
/**
* 获取考试列表
*/
export function getExamQuestion(params) {
return httpRequest.get(
'/api/lms-financial/v1/examination/paper',
{ params },
{ headers: { 'Content-Type': 'multipart/form-data' } }
)
}
/**
* 缓存模拟考试试题
*/
export function setCache(params) {
return httpRequest.post('/api/lms-financial/v1/examination/submit-paper', params)
}
<template> <template>
<div> <div>
<exam-card <exam-card
title="模拟考试" title="考试"
:hasMark="hasMark" :hasMark="hasMark"
:status="status" :status="status"
:hasSubmitBtn="!!!this.$route.query.id"
:hasCountdown="!!!this.$route.query.id"
:data="data" :data="data"
:hasCollect="false"
@submit="submitExam" @submit="submitExam"
@back="handleBack" @back="handleBack"
ref="exam" ref="exam"
...@@ -15,7 +14,7 @@ ...@@ -15,7 +14,7 @@
</div> </div>
</template> </template>
<script> <script>
import * as api from '@/api/exam.js' import * as api from '../api.js'
import ExamCard from '@/components/exam/examCard.vue' import ExamCard from '@/components/exam/examCard.vue'
export default { export default {
components: { ExamCard }, components: { ExamCard },
...@@ -29,7 +28,7 @@ export default { ...@@ -29,7 +28,7 @@ export default {
}, },
computed: { computed: {
examId() { examId() {
return this.$route.query.exam_id return this.$route.query.id
} }
}, },
beforeMount() { beforeMount() {
...@@ -42,16 +41,13 @@ export default { ...@@ -42,16 +41,13 @@ export default {
methods: { methods: {
// 获取考卷 // 获取考卷
getTopic() { getTopic() {
const isCreate =
this.$route.query.id || this.$route.query.is_create === undefined ? 0 : this.$route.query.is_create
const param = { const param = {
type: 2, // 1:能力自测, 2:模拟考试
paper_id: this.examId, paper_id: this.examId,
is_create: isCreate // 是否重新测试: 1:是,否则不是 is_create: 1
} }
// const params = this.$route.query.is_create ? { ...param, is_create: 1 } : param
api.getExamQuestion(param).then(response => { api.getExamQuestion(param).then(response => {
this.data = JSON.parse(response.data).sheet this.data = typeof response.data === 'string' ? JSON.parse(response.data) : response.data
// 已提交 // 已提交
const isSubmited = ['1', '2'].includes(this.data.status) const isSubmited = ['1', '2'].includes(this.data.status)
// 缓存答题 // 缓存答题
......
<template> <template>
<app-container title="试卷管理"> <app-container title="试卷管理">
<div class="exam-card"> <div style="display: flex">
<div class="exam-card__head"> <div class="exam-card" v-for="(item, index) in data" :key="index">
2022年第一期<br /> <div class="exam-card__head">
金融数据合规管理证书考试 <!-- 2022年第一期<br />
</div> 金融数据合规管理证书考试 -->
<div class="card-body"> <div class="text">
<div class="card-body__data"> {{ item.paper_title }}
试卷总分:<span>100</span> </div>
</div>
<div class="card-body__data">
及格分数:<span>100</span>
</div> </div>
<div class="card-body__data"> <div class="card-body">
考试时长:<span>100</span>分钟 <div class="card-body__data">
试卷总分:<span>{{ item.total_score }}</span
>
</div>
<div class="card-body__data">
及格分数:<span>{{ item.pass_score }}</span
>
</div>
<div class="card-body__data">
考试时长:<span>{{ item.paper_times }}</span
>分钟
</div>
<div class="card-body__data red" v-if="item.remaining_times != undefined">
剩余时长:<span>{{ item.remaining_times }}</span
>分钟
</div>
<div
class="card-body__btn"
@click="startExam(item)"
v-if="item.status == 100 || item.status == 101 || item.status == 104"
>
开始考试
</div>
<div class="card-body__btn2" @click="startExam(item)" v-if="item.status == 102">继续考试</div>
<div class="card-body__btn3" @click="startExam(item)" v-if="item.status == 103">已完成</div>
</div> </div>
<!-- <div class="card-body__data red">
剩余时长:<span>100</span>分钟
</div> -->
<!-- <div class="card-body__btn">开始考试</div> -->
<!-- <div class="card-body__btn2">继续考试</div> -->
<div class="card-body__btn3">已完成</div>
</div> </div>
</div> </div>
<el-dialog title="考前须知" :visible.sync="dialogVisible" width="70%">
<div style="font-size: 18px">
请各位考生认真阅读以下内容,明确考试规则,遵守考试纪律。预祝大家考试顺利!<br />
<br />
1、请确保考试电脑网络稳定<br />
2、考试时长60分钟,考试时间结束仍未提交试卷的,系统将自动提交<br />
3、进入考试系统后系统随机抓屏,离开或退出考试页面超过5次后系统将强制交卷<br />
4、题库随机组题,题型为:单选+多选+判断<br />
5、提交试卷后即显示成绩,80分为通过,可获得本年度证书,低于80分则需重学重考<br />
6、考试通过后颁发电子证书, 3个工作日内进入我的证书查看下载
</div>
<span slot="footer" class="dialog-footer">
<el-button :disabled="!isRead" type="primary" @click="goPage">{{ noticeText }}</el-button>
</span>
</el-dialog>
</app-container> </app-container>
</template> </template>
<script> <script>
export default {} import * as api from '../api.js'
export default {
data() {
return {
data: {},
dialogVisible: false,
noticeTimes: null,
noticeText: '我已阅读,开始考试(20秒)',
isRead: false,
curExamId: ''
}
},
mounted() {
api.getExamList().then(response => {
this.data = response.data
})
},
methods: {
goPage() {
this.$router.push({
path: '/exam/exam/exam',
query: {
id: this.curExamId
}
})
},
startExam(data) {
const num = parseInt(data.status)
switch (num) {
case 100:
this.$message({
message: '请完成视频课程学习后再参加考试'
})
break
case 101:
this.dialogVisible = true
this.curExamId = data.id
break
case 102:
this.$router.push({
path: '/exam/exam/exam',
query: {
id: data.id,
is_create: 1
}
})
break
case 103:
this.$router.push({
path: '/exam/exam/result',
query: {
exam_id: data.id
}
})
break
case 104:
this.$alert('重考申请还未通过,无法进行考试', {
confirmButtonText: '重新提交申请',
callback: action => {
api.sbumitRetake({ examination_id: data.id }).then(response => {
if (response.code === 0) {
this.$message({
type: 'success',
message: '提交成功'
})
}
})
}
})
break
}
}
},
watch: {
dialogVisible: function (newVal, oldVal) {
console.log(this.dialogVisible)
let numTime = 20
if (this.dialogVisible && !this.isRead) {
clearInterval(this.noticeTimes)
this.noticeTimes = setInterval(() => {
numTime--
this.noticeText = `我已阅读,开始考试(${numTime}秒)`
if (numTime === 0) {
this.isRead = true
this.noticeText = '我已阅读,开始考试'
clearInterval(this.noticeTimes)
}
}, 1000)
} else {
clearInterval(this.noticeTimes)
}
}
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -40,46 +163,63 @@ export default {} ...@@ -40,46 +163,63 @@ export default {}
border-radius: 10px; border-radius: 10px;
overflow: hidden; overflow: hidden;
.exam-card__head { .exam-card__head {
padding-top: 22px;
box-sizing: border-box;
height: 99px; height: 99px;
background: rgba(170, 25, 65, 1); background: rgba(170, 25, 65, 1);
font-size: 18px; display: flex;
line-height: 26px; align-items: center;
color: #ffffff; .text {
text-align: center; width: 260px;
text-align: center;
margin: 0 auto;
color: #ffffff;
font-size: 18px;
line-height: 26px;
}
} }
.card-body{ .card-body {
.card-body__data{ .card-body__data {
padding-left: 87px; padding-left: 87px;
box-sizing: border-box; box-sizing: border-box;
margin-top: 35px; margin-top: 35px;
font-size: 16px; font-size: 16px;
color: rgba(102, 102, 102, 1); color: rgba(102, 102, 102, 1);
line-height: 100%; line-height: 100%;
span{ span {
font-size: 22px; font-size: 22px;
font-weight: bold; font-weight: bold;
} }
&.red{ &.red {
color: rgba(170, 25, 65, 1); color: rgba(170, 25, 65, 1);
} }
} }
.card-body__btn{ .card-body__btn {
width: 150px; width: 150px;
height: 41px; height: 41px;
background: rgba(255, 245, 248, 0.39); background: rgba(255, 245, 248, 0.39);
border: 1px solid #AA1941; border: 1px solid #aa1941;
border-radius: 6px; border-radius: 6px;
text-align: center; text-align: center;
line-height: 41px; line-height: 41px;
box-sizing: border-box; box-sizing: border-box;
color: #AA1941; color: #aa1941;
font-size: 16px; font-size: 16px;
margin: 60px auto 0; margin: 60px auto 0;
cursor: pointer; cursor: pointer;
} }
.card-body__btn3{ .card-body__btn2 {
width: 150px;
height: 41px;
background: rgba(170, 25, 65, 1);
border-radius: 6px;
text-align: center;
line-height: 41px;
box-sizing: border-box;
color: #fff;
font-size: 16px;
margin: 30px auto 0;
cursor: pointer;
}
.card-body__btn3 {
width: 150px; width: 150px;
height: 41px; height: 41px;
background: rgba(221, 221, 221, 1); background: rgba(221, 221, 221, 1);
...@@ -94,4 +234,9 @@ export default {} ...@@ -94,4 +234,9 @@ export default {}
} }
} }
} }
::v-deep {
.el-dialog__footer {
text-align: center;
}
}
</style> </style>
...@@ -8,31 +8,22 @@ ...@@ -8,31 +8,22 @@
</span> </span>
</div> </div>
<div class="chart-box"> <div class="chart-box">
<div class="chart-item"> <div class="chart-item" v-if="Object.keys(datas.data).length">
<div class="chart-title">成绩</div> <div class="chart-title">成绩</div>
<chart :accuracy="objectQuestionScore"> <chart :accuracy="score" :accuracScore="totalScore">
<template v-slot:tips> <template v-slot:tips>
<div class="num">{{ objectQuestionScore }}</div> <div class="num">{{ score }}</div>
</template> </template>
</chart> </chart>
</div> </div>
</div> </div>
<p class="new__text">恭喜考试通过,您已获得xxxx证书,请前往我的证书页面查看</p> <p class="new__text">{{ resultText }}</p>
</div> </div>
<!-- <div class="card-right">
<card v-if="data.sheet" :data="data.sheet" @goQuestion="goPage">
<template v-slot:btnBox>
<div class="btn-box">
<div class="btn" @click="goPage('all')">全部解析</div>
</div>
</template>
</card>
</div> -->
</div> </div>
</template> </template>
<script> <script>
import chart from '@/components/exam/result/pieChart.vue' import chart from '@/components/exam/result/pieChart.vue'
import * as api from '@/api/exam.js' import * as api from '../api.js'
export default { export default {
components: { components: {
chart chart
...@@ -42,20 +33,22 @@ export default { ...@@ -42,20 +33,22 @@ export default {
data: { data: {
sheet: {} sheet: {}
}, },
accuracy: 0, totalScore: 100,
accuracScore: 0, score: 0,
accuracText: 0, datas: {},
subjectQuestionTotal: 0, status: 0,
subjectQuestionScore: 0, paperTimes: 0
objectQuestionTotal: 0,
objectQuestionScore: 0,
status: 0
} }
}, },
created() { created() {
this.getExamPapers() this.getExamPapers()
}, },
computed: { computed: {
resultText() {
return this.score >= 80
? '恭喜考试通过,您已获得xxxx证书,请前往我的证书页面查看'
: this.datas.times > 1 ? '系统将向管理员发送重考申请,您可同步开始课程重修,重修完成且审批通过后方可继续考试' : '考试未通过,请重新完成视频课程学习后再次参加考试'
},
examId() { examId() {
return this.$route.query.exam_id return this.$route.query.exam_id
}, },
...@@ -76,70 +69,16 @@ export default { ...@@ -76,70 +69,16 @@ export default {
}) })
}, },
getExamPapers() { getExamPapers() {
console.log(this.examId)
const param = { const param = {
type: 2, paper_id: this.examId
paper_id: this.examId,
is_create: 0
} }
api.getExamQuestion(param).then(response => { api.getExamQuestion(param).then(response => {
const data = JSON.parse(response.data) const data = response.data
// let rightNum = 0 this.datas = response
// let totalNum = 0 this.totalScore = data.questions.total_score
// data.sheet.questions.question_items.forEach(list => { this.score = data.score
// list.question_list = list.question_list.reduce((a, b) => { this.paperTimes = data.questions.paper_times
// return a.concat(b)
// }, [])
// list.question_list.forEach(item => {
// const currentItem = data.sheet.score_items[list.question_item_id][item.id]
// if (currentItem.checked_flag) {
// totalNum++
// if (currentItem.is_right) rightNum++
// } else {
// if (item.question_options) {
// totalNum++
// if (currentItem.is_right) rightNum++
// }
// }
// })
// })
// this.accuracy = parseInt(rightNum)
// if (parseInt(rightNum) === 0 && parseInt(totalNum) === 0) {
// this.accuracText = '-'
// } else {
// this.accuracText = parseInt((rightNum / totalNum) * 100)
// }
this.data = data
// this.accuracScore = parseInt(totalNum)
this.status = data.sheet.status
let subjectQuestionTotal = 0
let subjectQuestionScore = 0
let objectQuestionTotal = 0
let objectQuestionScore = 0
data.sheet.questions.question_items.forEach(item => {
item.question_list = item.question_list.reduce((a, b) => {
return a.concat(b)
}, [])
const currentQuestionScore = data.sheet.score_items[item.question_item_id]
// console.log(item)
item.question_list.forEach(it => {
const currentItem = currentQuestionScore[it.id]
if (Array.isArray(it.question_options) && it.question_options.length) {
// if (currentItem.is_right) objectQuestionScore += parseFloat(currentItem.score)
objectQuestionScore += parseFloat(currentItem.score)
objectQuestionTotal += parseFloat(it.score)
} else {
// if (currentItem.is_right) subjectQuestionScore += parseFloat(currentItem.score)
subjectQuestionScore += parseFloat(currentItem.score)
subjectQuestionTotal += parseFloat(it.score)
}
})
})
this.subjectQuestionTotal = subjectQuestionTotal
this.subjectQuestionScore = subjectQuestionScore
// this.subjectQuestionScore = 20
this.objectQuestionTotal = objectQuestionTotal
this.objectQuestionScore = objectQuestionScore
// this.objectQuestionScore = 65
}) })
} }
} }
......
import httpRequest from '@/utils/axios'
/**
* 获取我的试题
*/
export function getMyQuestions(params) {
return httpRequest.get('/api/zy/v2/examination/my-question', { params })
}
/**
* 删除试题
*/
export function deleteQuestion(data) {
return httpRequest.post('/api/zy/v2/examination/delete-my-question', data)
}
/**
* 收藏试题
*/
export function addCollection(data) {
return httpRequest.post('/api/zy/v2/examination/add-collection', data)
}
/**
* 取消收藏试题
*/
export function deleteCollection(data) {
return httpRequest.post('/api/zy/v2/examination/delete-my-question', data)
}
<template>
<div class="my-question-list" element-loading-text="加载中..." v-loading="!loaded">
<div class="my-question-list-hd">
<div class="select">
<el-select v-model="selectId" placeholder="选择课程" clearable @change="handleTypeChange">
<el-option v-for="item in selectList" :key="item.id" :label="item.category_name" :value="item.id"></el-option>
</el-select>
</div>
<div class="title"><slot name="title"></slot></div>
<div class="tools">
<span>选择题型</span>
<el-select v-model="questionType" placeholder="选择课程" clearable @change="handleTypeChange">
<el-option v-for="item in typeList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</div>
</div>
<div class="my-question-list-bd">
<template v-if="list.length">
<question-list-item
v-for="item in list"
:data="item"
:key="item.id"
v-bind="$attrs"
v-on="$listeners"
@on-remove="handleRemove"
@on-addCollection="handleAddCollection"
@on-removeCollection="handleRemoveCollection"
@on-click="handleClick(item.num)"
></question-list-item>
</template>
<div class="empty" v-else>暂无试题</div>
</div>
<div class="my-question-list-ft" v-if="list.length">
<div class="buttons">
<el-button size="medium" @click="toggleSelectAll(!isAllChecked)">
{{ isAllChecked ? '取消全选' : '全选' }}
</el-button>
<el-button size="medium" @click="handleBatchRemove" v-if="hasRemove">删除</el-button>
</div>
<div class="pagations">
<el-pagination
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
layout="prev, pager, next"
:total="total"
>
</el-pagination>
</div>
</div>
</div>
</template>
<script>
import * as api from '../api.js'
import QuestionListItem from './QuestionListItem.vue'
export default {
components: { QuestionListItem },
props: {
requestCallback: Function,
requestParams: { type: Object, default: () => ({}) }
},
data() {
return {
loaded: false,
questionType: 0,
list: [],
total: 0,
currentPage: 1,
selectList: [],
selectId: '',
typeList: [
{ value: 0, label: '全部' },
{ value: 1, label: '单选题' },
{ value: 2, label: '多选题' },
{ value: 3, label: '问答题' },
{ value: 5, label: '案例题' },
{ value: 6, label: '判断题' },
{ value: 7, label: '实操题' },
{ value: 8, label: '情景题' }
]
}
},
computed: {
// 已选中
checkedList() {
return this.list.filter(item => item.checked)
},
// 是否全选
isAllChecked() {
return this.checkedList.length === this.list.length
},
// 是否显示删除按钮
hasRemove() {
return !!this.checkedList.length
}
},
methods: {
// 获取试题列表
getMyQuestions() {
this.loaded = false
const params = Object.assign({}, this.requestParams, {
question_type: this.questionType,
page: this.currentPage,
page_size: 10,
category_id: this.selectId
})
api
.getMyQuestions(params)
.then(response => {
const { list = [], current_total: total } = this.requestCallback ? this.requestCallback(response) : response
this.total = total
this.list = list.flat().map(item => {
item.checked = false
return item
})
this.list = this.changeArr(this.list)
this.selectList = response.all_category
this.$emit('request-success', response)
})
.finally(() => {
this.loaded = true
})
},
changeArr(arr) {
const obj = {}
arr = arr.reduce((item, next) => {
if (parseInt(next.group_id) === 0) {
item.push(next)
return item
} else {
if (!obj[next.group_id]) {
obj[next.group_id] = true
item.push(next)
}
return item
}
}, [])
return arr
},
// 类型改变
handleTypeChange(value) {
this.currentPage = 1
this.getMyQuestions()
},
// 页码改变
handleCurrentChange(value) {
this.getMyQuestions()
},
// 全选、取消全选
toggleSelectAll(checked) {
this.list = this.list.map(item => {
item.checked = checked
return item
})
},
// 收藏
handleAddCollection(data) {
api.addCollection({ question_id: data.question_id }).then(response => {
data.is_collection = true
})
},
// 取消收藏
handleRemoveCollection(data) {
api.deleteCollection({ question_id: data.question_id, type: 2 }).then(response => {
data.is_collection = false
})
},
// 删除
handleRemove(data) {
this.handleRemoveReqeust({ question_id: data.question_id })
},
// 批量删除
handleBatchRemove() {
const ids = this.checkedList.map(item => {
return item.question_id
})
this.handleRemoveReqeust({ question_id: ids.join(',') })
},
// 删除接口
handleRemoveReqeust(params) {
const requestParams = Object.assign({}, params, this.requestParams)
api.deleteQuestion(requestParams).then(response => {
this.$message({ message: '删除成功', type: 'success' })
this.getMyQuestions()
})
},
// 跳详情
handleClick(index) {
window.localStorage.removeItem('answerRecord')
this.$router.push({
path: '/exam/questions/exam',
query: { type: this.requestParams.type, qType: this.questionType, index }
})
}
},
beforeMount() {
this.getMyQuestions()
}
}
</script>
<style lang="scss" scoped>
.my-question-list-hd {
display: flex;
align-items: center;
padding-bottom: 8px;
font-size: 18px;
border-bottom: 1px solid #ccc;
.title {
flex: 1;
padding: 0 20px;
}
::v-deep .el-radio {
font-size: 18px;
}
::v-deep .el-radio__label {
font-size: 18px;
font-weight: 400;
}
::v-deep .el-radio__inner {
width: 18px;
height: 18px;
}
}
.my-question-list-ft {
padding-top: 20px;
display: flex;
justify-content: space-between;
align-items: center;
::v-deep .el-button {
width: 100px;
}
}
</style>
<template>
<div class="my-question-list-item">
<el-checkbox v-model="data.checked"></el-checkbox>
<div class="badge" :class="`questiont-type_${data.question_type}`">{{ questionTypeName }}</div>
<div class="name" v-html="data.question_content || data.common_content" @click="$emit('on-click')"></div>
<div class="tools">
<i class="el-icon-delete" @click="$emit('on-remove', data)"></i>
<i
class="el-icon-star-on"
:class="{ 'is-active': data.is_collection }"
@click="toggleCollection"
v-if="hasCollection"
></i>
</div>
</div>
</template>
<script>
export default {
props: {
data: { type: Object, default: () => ({}) },
hasCollection: { type: Boolean, default: true }
},
data() {
return {
radio: false
}
},
computed: {
questionTypeName() {
const map = { 1: '单选题', 2: '多选题', 3: '问答题', 5: '案例题', 6: '判断题', 7: '实操题', 8: '情景题' }
return map[this.data.question_type]
}
},
methods: {
toggleCollection() {
this.data.is_collection ? this.$emit('on-removeCollection', this.data) : this.$emit('on-addCollection', this.data)
}
}
}
</script>
<style lang="scss" scoped>
.my-question-list-item {
display: flex;
align-items: center;
padding: 22px 0;
border-bottom: 1px solid #eee;
&:hover {
.name {
color: #c01540;
}
}
.badge {
margin: 0 8px;
width: 60px;
height: 18px;
font-size: 12px;
line-height: 18px;
color: #fff;
text-align: center;
background: #ffbe44;
border-radius: 9px;
}
.questiont-type_1 {
background: #f47c46;
}
.questiont-type_2 {
background: #ffbe44;
}
.questiont-type_5 {
background: #7ed6e8;
}
.questiont-type_6 {
background: #83da60;
}
.name {
flex: 1;
padding: 0 10px;
font-size: 18px;
}
.tools {
padding-left: 20px;
display: flex;
font-size: 18px;
color: #d4d4d4;
i {
margin-left: 10px;
cursor: pointer;
}
.is-active {
color: #ffcd39;
}
}
}
</style>
const routes = [
{
path: '/',
component: () => import('@/components/layout/index.vue'),
children: [
{ path: '/exam/questions/all', component: () => import('./views/All.vue') },
{ path: '/exam/questions/wrong', component: () => import('./views/Wrong.vue') },
{ path: '/exam/questions/collection', component: () => import('./views/Collection.vue') }
]
},
{ path: '/exam/questions/exam', component: () => import('./views/Exam.vue') }
]
export { routes }
<template>
<app-container>
<question-list :requestParams="{ type: 3 }" @request-success="handleRequestSuccess">
<template #title>做题总数:{{ total }}</template>
</question-list>
</app-container>
</template>
<script>
import QuestionList from '../components/QuestionList.vue'
export default {
components: { QuestionList },
data() {
return {
total: 0
}
},
methods: {
handleRequestSuccess(response) {
this.total = response.total
}
}
}
</script>
<template>
<app-container>
<question-list :hasCollection="false" :requestParams="{ type: 2 }" @request-success="handleRequestSuccess">
<template #title>收藏总数:{{ total }}</template>
</question-list>
</app-container>
</template>
<script>
import QuestionList from '../components/QuestionList.vue'
export default {
components: { QuestionList },
data() {
return {
total: 0
}
},
methods: {
handleRequestSuccess(response) {
this.total = response.current_total
}
}
}
</script>
<template>
<exam-card
:title="title"
:status="2"
:groups="questionGroups"
:numberGroups="numberGroups"
:hasMark="false"
:hasDeleteBtn="true"
:hasCountDown="false"
:hasShowResultBtn="true"
:groupPage="bigNum"
:groupPageSize="pageSize"
:groupPageCount="total"
submitButtonText="清空记录,重新答题"
@back="handleBack"
@submit="handleSubmit"
@page-change="handlePageChange"
@delete="deleteQuestion"
@primary="handlePrimary"
ref="exam"
v-loading="loading"
>
</exam-card>
</template>
<script>
import * as api from '@/api/exam.js'
import ExamCard from '@/components/exam/examCard.vue'
export default {
components: { ExamCard },
data() {
return {
loading: false,
bigNum: 0,
page: 0,
pageSize: 10,
list: [], // 试题组
total: 0,
allQuestionList: [] // 所有试题
}
},
computed: {
title() {
return this.$route.query.type === '1' ? '错题集合' : '收藏试题'
},
questionGroups() {
return this.list.map(list => {
const [first = {}] = list
return { question_item_id: '', question_type: first.question_type, question_list: list, hasResult: false }
})
},
numberGroups() {
return this.allQuestionList.map(list => {
const [first = {}] = list
return { question_item_id: '', question_type: first.question_type, question_list: list }
})
}
},
beforeMount() {
this.init()
},
methods: {
init() {
// 获取所有小题
this.getAllQuestion().then(() => {
const flatList = this.allQuestionList.reduce((result, list) => {
return result.concat(list)
}, [])
const index = parseInt(this.$route.query.index) || 0
// // 通过小题编号查找大题
const found = flatList.find(item => item.num === index)
if (found) {
this.bigNum = found.big_num
this.page = parseInt((found.big_num - 1) / this.pageSize)
}
// 获取考卷
this.getTopic()
})
},
// 删除题目
deleteQuestion(data) {
const param = {
question_id: data.question_list[0].question_id,
type: this.$route.query.type
}
api.deleteQuestion(param).then(response => {
this.page = 0
this.getAllQuestion()
this.getTopic().then(() => {
// 重置
this.$refs.exam.reset()
})
})
},
// 返回
handleBack() {
if (this.$route.query.type === '1') {
this.$router.push('/exam/questions/wrong')
} else {
this.$router.push('/exam/questions/collection')
}
},
// 获取考卷
getTopic() {
const query = this.$route.query
const param = {
type: query.type,
question_type: query.qType,
page: this.page + 1,
page_size: this.pageSize
}
this.loading = true
return api.getMyQuestion(param).then(response => {
this.list = response.list
this.total = response.collection_total || response.error_total
this.loading = false
})
},
getAllQuestion() {
const query = this.$route.query
const param = {
type: query.type,
question_type: query.qType
}
return api.getAllQuestion(param).then(response => {
this.allQuestionList = response.list
if (!this.allQuestionList.length) {
this.handleBack()
}
})
},
// 清空
handleSubmit(data) {
const param = {
type: this.$route.query.type,
question_type: this.$route.query.qType,
clear: 1
}
this.cacheQuestion(param, () => {
this.page = 0
this.getAllQuestion()
this.getTopic().then(() => {
// 重置
this.$refs.exam.reset()
})
})
},
// 确认答案
handlePrimary(data, groups) {
this.cacheQuestion(this.genSubmitData(groups)).then(() => {
this.getAllQuestion()
})
},
// 翻页
handlePageChange(index, data, groups) {
const page = parseInt((index - 1) / this.pageSize)
if (this.page !== page) {
this.page = page
this.getTopic()
}
this.cacheQuestion(this.genSubmitData(groups))
},
cacheQuestion(param, callback) {
return api.setMyCache(param).then(response => {
callback && callback()
})
},
// 组装提交数据
genSubmitData(questionGroups) {
const answers = {}
questionGroups.forEach(group => {
group.question_list.forEach(item => {
if (item.user_answer.length) {
answers[item.question_id] = item.user_answer
}
})
})
return {
type: this.$route.query.type,
question_type: this.$route.query.qType,
answer: JSON.stringify(answers)
}
}
}
}
</script>
<template>
<app-container>
<question-list :requestParams="{ type: 1 }" @request-success="handleRequestSuccess">
<template #title>错题总数:{{ total }}</template>
</question-list>
</app-container>
</template>
<script>
import QuestionList from '../components/QuestionList.vue'
export default {
components: { QuestionList },
data() {
return {
total: 0
}
},
methods: {
handleRequestSuccess(response) {
this.total = response.current_total
}
}
}
</script>
import httpRequest from '@/utils/axios' import httpRequest from '@/utils/axios'
/* 意见反馈 */ /* 意见反馈 */
export function submitFeedback(data) { export function examRecord() {
return httpRequest.post('/api/zy/v2/feedback/commit', data) return httpRequest.post('/api/lms-financial/v1/examination/sheets')
} }
<template> <template>
<app-container title="学员须知"> <app-container title="学员须知">
<app-list v-bind="tableOptions" ref="tabList"> <app-list v-bind="tableOptions" ref="tabList"> </app-list>
</app-list>
</app-container> </app-container>
</template> </template>
<script> <script>
import * as api from '../api.js'
import AppList from '@/components/base/AppList.vue' import AppList from '@/components/base/AppList.vue'
export default { export default {
components: { components: {
...@@ -14,12 +14,13 @@ export default { ...@@ -14,12 +14,13 @@ export default {
return { return {
tableOptions: { tableOptions: {
remote: { remote: {
httpRequest: api.examRecord
}, },
columns: [ columns: [
{ prop: 'name', label: '序号' }, // { prop: 'name', label: '序号' },
{ prop: 'user_count', label: '考卷名称' }, { prop: 'paper_title', label: '考卷名称' },
{ prop: 'operate2', label: '分数' }, { prop: 'score', label: '分数' },
{ prop: 'operate3', label: '考试时间' } { prop: 'created_time', label: '考试时间' }
] ]
} }
} }
...@@ -59,12 +60,12 @@ export default { ...@@ -59,12 +60,12 @@ export default {
margin-bottom: 28px; margin-bottom: 28px;
line-height: 100%; line-height: 100%;
} }
.notice__content{ .notice__content {
font-size: 16px; font-size: 16px;
line-height: 34px; line-height: 34px;
color: rgba(137, 137, 137, 1); color: rgba(137, 137, 137, 1);
margin-left: 46px; margin-left: 46px;
span{ span {
color: rgba(102, 102, 102, 1); color: rgba(102, 102, 102, 1);
font-weight: bold; font-weight: bold;
} }
......
const routes = [
{
path: '/',
component: () => import('@/components/layout/index.vue'),
children: [{ path: '/exam/test/result', component: () => import('./views/Result.vue') }]
},
{ path: '/exam/test/exam', component: () => import('./views/Exam.vue') }
]
export { routes }
<template>
<exam-card
title="课后练习"
:hasMark="hasMark"
:status="status"
:data="data"
:hasCountdown="false"
@submit="handleSubmit"
@back="handleBack"
ref="exam"
v-if="Object.keys(data).length"
></exam-card>
</template>
<script>
import * as api from '@/api/exam.js'
import ExamCard from '@/components/exam/examCard.vue'
export default {
components: { ExamCard },
data() {
return {
status: 1, // 考试状态
hasMark: true,
data: {},
cacheAnswerTime: null
}
},
beforeMount() {
// 获取考卷
this.getTopic()
},
beforeDestroy() {
this.cacheAnswerTime && clearInterval(this.cacheAnswerTime) // 停止缓存
},
methods: {
// 获取考卷
getTopic() {
const query = this.$route.query
const param = {
type: 1,
is_create: parseInt(query.type) === 2 ? 0 : 1,
course_id: query.course_id,
chapter_id: query.chapter_id,
paper_id: query.exam_id
}
api.getCourseQuestion(param).then(response => {
this.data = JSON.parse(response.data).sheet
// 已提交
const isSubmited = ['1', '2'].includes(this.data.status)
// 缓存答题
if (isSubmited) {
this.status = 2
this.hasMark = false
} else {
clearInterval(this.cacheAnswerTime)
this.cacheAnswerTime = setInterval(this.handleCache, 3000)
}
})
},
// 返回
handleBack() {
this.$router.push(`/course/learn/${this.$route.query.course_id}`)
},
// 提交答案
handleSubmit(data) {
const params = this.genSubmitData(data).params
const answerNum = this.genSubmitData(data).answerNum
params.status = 1
if (answerNum !== 0) {
this.$confirm(`您还有${answerNum}道题没有作答`, '请确认', {
confirmButtonText: '确认提交',
cancelButtonText: '继续作答',
type: 'warning'
})
.then(() => {
this.submitApi(params)
})
.catch(() => {})
} else {
this.submitApi(params)
}
},
submitApi(params) {
this.cacheAnswerTime && clearInterval(this.cacheAnswerTime) // 停止缓存
api.setCourseCache(params).then(res => {
this.$router.replace({
path: '/exam/test/result',
query: Object.assign({}, this.$route.query, { type: 2 })
})
})
},
// 缓存答案
handleCache() {
const refData = this.$refs.exam
const params = this.genSubmitData(refData.questionGroups).params
params.status = 0
api.setCourseCache(params)
},
// 组装提交数据
genSubmitData(questionGroups) {
const answers = {}
let answerNum = 0
questionGroups.forEach(group => {
if (!answers[group.question_item_id]) answers[group.question_item_id] = {}
group.question_list.forEach(item => {
if (!item.user_answer.length) {
answerNum++
}
answers[group.question_item_id][item.id] = {
sign: item.sign ? item.sign : false,
answer: item.user_answer
}
})
})
const data = {
params: { type: 1, sheet_id: this.data.id, status: 0, answers: JSON.stringify(answers), duration: 0 },
answerNum: answerNum
}
return data
}
}
}
</script>
<template>
<div class="result-box" v-if="data.sheet">
<div class="card-left">
<div class="title">
<span>成绩报告</span>
<span class="time" v-if="data.sheet">
{{ data.sheet.created_time }}
</span>
</div>
<div class="chart-box">
<!-- <chart :accuracy="accuracy" :accuracScore="accuracScore">
<template v-slot:tips>
<div class="num">{{ accuracText }}%</div>
<div class="t">正确率</div>
</template>
</chart> -->
<div class="chart-item" v-if="objectQuestionTotal">
<div class="chart-title">客观题</div>
<chart :accuracy="objectQuestionScore" :accuracScore="objectQuestionTotal">
<template v-slot:tips>
<div class="num">{{ objectQuestionScore }}</div>
</template>
</chart>
</div>
<div class="chart-item" v-if="subjectQuestionTotal">
<div class="chart-title">主观题</div>
<chart :accuracy="subjectQuestionScore" :accuracScore="subjectQuestionTotal">
<template v-slot:tips>
<div class="num" v-if="status === '2'">{{ subjectQuestionScore }}</div>
<div class="num" v-else>-分</div>
</template>
</chart>
</div>
</div>
<div class="assess">测试评估</div>
<div class="assess-box">
<div class="prog">
<div class="line-box">
<div class="line" :style="setStyle"></div>
</div>
<div class="icon"></div>
</div>
<!-- <div class="text" v-if="accuracText < 100">
{{ accuracText < 80 ? '您离成功还有一段距离,继续努力!' : '成功近在眼前,再接再厉!' }}
</div> -->
<template v-if="status !== '2'"> <p class="text">请等待老师评分~</p></template>
<template v-else>
<p class="text" v-if="percent < 0.8">您离成功还有一段距离,继续努力!</p>
<div class="chart-box">
<div class="chart-item">
<div class="chart-title">总分</div>
<chart
:accuracy="subjectQuestionScore + objectQuestionScore"
:accuracScore="subjectQuestionTotal + objectQuestionTotal"
>
<template v-slot:tips>
<div class="num">{{ subjectQuestionScore + objectQuestionScore }}</div>
</template>
</chart>
</div>
</div>
</template>
<!-- <div class="btn">全部考试服务</div> -->
</div>
</div>
<div class="card-right">
<card v-if="Object.keys(data.sheet).length" :data="data.sheet" @goQuestion="goPage">
<template v-slot:btnBox>
<div class="btn-box">
<div class="btn" @click="goPage('all')">全部解析</div>
<!-- <div class="btn" @click="goPage('err')">错题解析</div> -->
</div>
</template>
</card>
</div>
</div>
</template>
<script>
import chart from '@/components/exam/result/pieChart.vue'
import card from '@/components/exam/result/resultCard.vue'
import * as api from '@/api/exam.js'
export default {
components: {
chart,
card
},
data() {
return {
data: {},
accuracy: 0,
accuracScore: 0,
accuracText: 0,
subjectQuestionTotal: 0,
subjectQuestionScore: 0,
objectQuestionTotal: 0,
objectQuestionScore: 0,
status: 0
}
},
created() {
this.getExamPapers()
},
computed: {
examId() {
return this.$route.query.exam_id
},
percent() {
return (
(this.subjectQuestionScore + this.objectQuestionScore) / (this.subjectQuestionTotal + this.objectQuestionTotal)
)
},
setStyle() {
return `width: ${100 * this.percent}%`
}
},
methods: {
goPage(param) {
const urlParam = this.$route.query
urlParam.id = param
urlParam.type = 2
this.$router.push({ path: '/exam/test/exam', query: urlParam })
},
getExamPapers() {
const param = {
type: 1,
is_create: 0,
course_id: this.$route.query.course_id,
chapter_id: this.$route.query.chapter_id
}
api.getCourseQuestion(param).then(response => {
const data = JSON.parse(response.data)
// let rightNum = 0
// let totalNum = 0
// data.sheet.questions.question_items.forEach(list => {
// list.question_list = list.question_list.reduce((a, b) => {
// return a.concat(b)
// }, [])
// list.question_list.forEach(item => {
// const currentItem = data.sheet.score_items[list.question_item_id][item.id]
// if (currentItem.checked_flag) {
// totalNum++
// if (currentItem.is_right) rightNum++
// } else {
// if (item.question_options) {
// totalNum++
// if (currentItem.is_right) rightNum++
// }
// }
// })
// })
// this.accuracy = parseInt(rightNum)
// if (parseInt(rightNum) === 0 && parseInt(totalNum) === 0) {
// this.accuracText = '-'
// } else {
// this.accuracText = parseInt((rightNum / totalNum) * 100)
// }
this.data = data
// this.accuracScore = parseInt(totalNum)
this.status = data.sheet.status
let subjectQuestionTotal = 0
let subjectQuestionScore = 0
let objectQuestionTotal = 0
let objectQuestionScore = 0
data.sheet.questions.question_items.forEach(item => {
item.question_list = item.question_list.reduce((a, b) => {
return a.concat(b)
}, [])
const currentQuestionScore = data.sheet.score_items[item.question_item_id]
item.question_list.forEach(it => {
const currentItem = currentQuestionScore[it.id]
if (Array.isArray(it.question_options) && it.question_options.length) {
if (currentItem.is_right) objectQuestionScore += parseFloat(currentItem.score)
objectQuestionTotal += parseFloat(it.score)
} else {
if (currentItem.is_right) subjectQuestionScore += parseFloat(currentItem.score)
subjectQuestionTotal += parseFloat(it.score)
}
})
})
this.subjectQuestionTotal = subjectQuestionTotal
this.subjectQuestionScore = subjectQuestionScore
// this.subjectQuestionScore = 7
this.objectQuestionTotal = objectQuestionTotal
this.objectQuestionScore = objectQuestionScore
// this.objectQuestionScore = 29
})
}
}
}
</script>
<style lang="scss" scoped>
.result-box {
width: 100%;
// height: 100%;
display: flex;
.card-left {
box-sizing: border-box;
padding: 10px 30px 20px;
flex: 1;
background: #fff;
margin-right: 10px;
// height: 560px;
border-radius: 8px;
.title {
font-size: 18px;
color: #222222;
line-height: 45px;
border-bottom: 1px solid #ccc;
display: flex;
}
.time {
font-size: 14px;
color: #222222;
line-height: 45px;
margin-left: auto;
}
.chart-box {
// width: 148px;
margin: 26px 0 0;
display: flex;
justify-content: center;
.chart-item {
display: flex;
align-items: center;
.chart-title {
font-size: 30px;
color: #333;
margin-right: 20px;
}
}
.chart-item:nth-child(2) {
margin-left: 60px;
}
}
.assess {
font-size: 18px;
color: #222222;
line-height: 45px;
border-bottom: 1px solid #ccc;
}
.assess-box {
padding: 27px 0;
.prog {
width: 350px;
margin: 0 auto;
display: flex;
align-items: center;
justify-content: space-between;
.line-box {
width: 300px;
width: 300px;
height: 10px;
background: #f9f9f9;
border-radius: 5px;
.line {
width: 80%;
height: 10px;
background: linear-gradient(90deg, #f47c46 0%, #f22f48 100%);
border-radius: 5px;
}
}
.icon {
width: 41px;
height: 38px;
background: url(@/assets/images/res-icon.png);
background-size: 100% 100%;
}
}
.text {
font-size: 14px;
color: #222222;
line-height: 20px;
text-align: center;
margin: 50px 0 68px 0;
}
.btn {
cursor: pointer;
text-align: center;
line-height: 40px;
width: 144px;
height: 40px;
background: #c01540;
border-radius: 4px;
font-size: 14px;
font-weight: bold;
color: #ffffff;
margin: 0 auto;
}
}
}
.card-right {
box-sizing: border-box;
flex: 1;
background: #fff;
// height: 560px;
border-radius: 8px;
margin-left: 10px;
padding: 10px 30px 0;
}
}
</style>
import Vue from 'vue' import Vue from 'vue'
import Vuex from 'vuex' import Vuex from 'vuex'
import { getUser, logout, getIsVip, createGuestUser, getPermissions } from '@/api/account' import { getUser, logout, getIsVip, createGuestUser } from '@/api/account'
Vue.use(Vuex) Vue.use(Vuex)
const store = new Vuex.Store({ const store = new Vuex.Store({
...@@ -17,7 +17,7 @@ const store = new Vuex.Store({ ...@@ -17,7 +17,7 @@ const store = new Vuex.Store({
}, },
mutations: { mutations: {
setUser(state, user) { setUser(state, user) {
state.user = user state.user = user.data
}, },
setIsWeapp(state, isWeapp) { setIsWeapp(state, isWeapp) {
state.isWeapp = isWeapp state.isWeapp = isWeapp
...@@ -91,19 +91,19 @@ const store = new Vuex.Store({ ...@@ -91,19 +91,19 @@ const store = new Vuex.Store({
} }
} }
commit('setGuestUser', guestUser) commit('setGuestUser', guestUser)
},
// 获取所有权限列表
getPermissions({ commit }) {
getPermissions({ type: 1 }).then(res => {
if (res.data && res.data.items) {
commit('setPermissions', res.data.items)
}
})
} }
// // 获取所有权限列表
// getPermissions({ commit }) {
// getPermissions({ type: 1 }).then(res => {
// if (res.data && res.data.items) {
// commit('setPermissions', res.data.items)
// }
// })
// }
} }
}) })
store.dispatch('getPermissions') // store.dispatch('getPermissions')
// 加载本地游客用户 // 加载本地游客用户
// store.dispatch('loadGuestUser') // store.dispatch('loadGuestUser')
......
...@@ -7,8 +7,8 @@ const httpRequest = axios.create({ ...@@ -7,8 +7,8 @@ const httpRequest = axios.create({
timeout: 60000, timeout: 60000,
withCredentials: true, withCredentials: true,
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded', 'Content-Type': 'application/x-www-form-urlencoded'
tenant: 'x1' // tenant: 'x1'
} }
}) })
......
...@@ -14,12 +14,12 @@ export default defineConfig({ ...@@ -14,12 +14,12 @@ export default defineConfig({
cert: fs.readFileSync(path.join(__dirname, './https/dev.ezijing.com.pem')) cert: fs.readFileSync(path.join(__dirname, './https/dev.ezijing.com.pem'))
}, },
proxy: { proxy: {
// '/api/fd': 'http://localhost-financial-api.ezijing.com' // '/api/lms-financial': 'http://localhost-financial-api.ezijing.com'
'/api/fd': { // '/api/lms-financial': {
target: 'http://localhost-financial-api.ezijing.com', // target: 'http://localhost-financial-api.ezijing.com',
changeOrigin: true, // changeOrigin: true,
rewrite: path => path.replace(/^\/api\/zy/, '') // rewrite: path => path.replace(/^\/api\/fd/, '')
} // }
} }
}, },
resolve: { resolve: {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论