diff --git a/src/api/index.js b/src/api/index.js
index a80636a..9e2c2d6 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -1,15 +1,26 @@
-let host = 'http://192.168.31.152:8001'
+import Setting from '@/setting'
+// let host = 'http://192.168.31.152:8001'
+let uploadURL = Setting.apiUploadURL
export default {
- logins: `management/userInfo/login`, //登录
+ // 登录
+ logins: `management/userInfo/login`,
+
+ // oss文件管理
+ fileDeletion: `${uploadURL}/oss/manage/fileDeletion`,
+ fileupload: `${uploadURL}/oss/manage/fileupload`,
+ getPlayAuth: `${uploadURL}/oss/manage/getPlayAuth`,
+ removeMoreVideo: `${uploadURL}/oss/manage/removeMoreVideo`,
+ removeVideo: `${uploadURL}/oss/manage/removeVideo`,
// 查询省份城市
queryProvince: `cjEnterprise/province/queryProvince`,
queryCity: `cjEnterprise/city/queryCity`,
queryClient: `cjEnterprise/client/list`,
- userinfoUpdate:`management/userInfo/update`,//个人中心信息修改
- userinfo:`management/userInfo/getUserInfo`,//个人中心信息展示
- getAccount:`management/userInfo/getAccount`,//账号判重
+ // 个人中心
+ userinfoUpdate:`management/userInfo/update`,
+ userinfo:`management/userInfo/getUserInfo`,
+ getAccount:`management/userInfo/getAccount`,
// 学生班级
addClass: `management/class/addClass`,
@@ -77,13 +88,6 @@ export default {
queryPermissionMenu: `management/permission/queryManagementPermissionMenu`,
toAssign: `management/permission/toAssign`,
- // 视频管理
- fileDeletion: `oss/manage/fileDeletion`, //批量删除文件
- fileupload: `oss/manage/fileupload`, //文件上传
- getPlayAuth: `oss/manage/getPlayAuth`, //获取播放凭证
- removeMoreVideo: `oss/manage/removeMoreVideo`, //批量删除视频文件
- removeVideo: `oss/manage/removeVideo`, //删除视频文件
-
getTypeByOneLever:`cjEnterprise/questionBank/getTypeByOneLever`,
typesList:`cjEnterprise/questionTypes/typesList`,
// 共享相关
@@ -109,6 +113,7 @@ export default {
getModifyByList:`management/testPaper/getModifyByList`,
modifyState:`management/testPaper/modifyState`,
schoolTestPaperByRelease:`management/testPaper/schoolTestPaperByRelease`,
+ previewPaper:`/management/testPaper/previewPaper`,
// 试题信息相关
addQuestions:`management/questions/addQuestions`,
@@ -144,7 +149,7 @@ export default {
getExcel:`cjEnterprise/questions/getExcel`,
impExcel:`management/questions/impExcel`,
- // 成绩管理
+ // 考核成绩管理
answerDetail:`management/paperRecord/answerDetail`,
findByIdpaperRecord:`management/paperRecord/findById`,
getAssessmentByClass:`management/paperRecord/getAssessmentByClass`,
@@ -152,4 +157,35 @@ export default {
savepaperRecord:`management/paperRecord/save`,
teacherByGetAchievement:`management/paperRecord/teacherByGetAchievement`,
achievementStatistics:`/management/paperRecord/achievementStatistics`,
+
+ // 留言板
+ delComment:`/management/messageBoard/delComment`,
+ delReply:`/management/messageBoard/delReply`,
+ delMessageBoard:`/management/messageBoard/delMessageBoard`,
+ queryMessageBoard:`/management/messageBoard/queryMessageBoard`,
+ queryMessageBoardDetail:`/management/messageBoard/queryMessageBoardDetail`,
+ saveComment:`/management/messageBoard/saveComment`,
+ saveMessageBoard:`/management/messageBoard/saveMessageBoard`,
+ saveReply:`/management/messageBoard/saveReply`,
+
+ // 练习管理
+ cancelPractise:`/management/practise/cancelPractise`,
+ createPractise:`/management/practise/createPractise`,
+ pageByName:`/management/practise/pageByName`,
+ seeDetails:`/management/practise/seeDetails`,
+ updatePractise:`/management/practise/updatePractise`,
+
+ // 练习批阅
+ practiceReviewList:`/management/practise/review/reviewList`,
+ reviewListByStudent:`/management/practise/review/reviewListByStudent`,
+ reviewDetail:`/management/practise/review/reviewDetail`,
+ reviewByidPractice:`/management/practise/review/reviewByid`,
+
+ // 练习成绩管理
+ AchievementDetail:`/management/practise/review/AchievementDetail`,
+ AchievementList:`/management/practise/review/AchievementList`,
+ exportPractice:`/management/practise/review/export`,
+ getMineClass:`/management/practise/review/getMineClass`,
+ AchievementListByClassId:`/management/practise/review/AchievementListByClassId`,
+ byClassIdGetPractise:`/management/practise/review/byClassIdGetPractise`,
}
\ No newline at end of file
diff --git a/src/assets/img/login_bg.png b/src/assets/img/login_bg.png
index 03e46b2..72ea233 100644
Binary files a/src/assets/img/login_bg.png and b/src/assets/img/login_bg.png differ
diff --git a/src/components/testPaperDetail/index.vue b/src/components/testPaperDetail/index.vue
index 201f54d..abf7ca5 100644
--- a/src/components/testPaperDetail/index.vue
+++ b/src/components/testPaperDetail/index.vue
@@ -27,6 +27,7 @@
选项:
@@ -52,6 +53,7 @@
import mixins from '@/mixins/setBackground'
import { mapState } from 'vuex'
export default {
+ props: ['data'],
mixins: [ mixins ],
data() {
return {
@@ -77,6 +79,7 @@ export default {
}
],
active: 1,
+ allData: {},
curType: []
};
},
@@ -89,33 +92,66 @@ export default {
])
},
mounted() {
+ this.insertScript()
this.getData()
},
methods: {
getData() {
- this.$post(`${this.api.previewtestPaper}?id=${this.id}`)
- .then(res => {
- this.allData = res.data
- this.curType = this.allData.list1
- this.handleOptions()
- })
- .catch(err => {
-
- });
+ if(this.data){
+ this.initData(this.data)
+ }else{
+ this.$post(`${this.api.previewtestPaper}?id=${this.id}`)
+ .then(res => {
+ this.initData(res.data)
+ }).catch(err => {})
+ }
+ },
+ initData(data){
+ let index = 0
+ for(let i in data){
+ data[i].map(n => {
+ index++
+ n.mediaEleId = `player${index}`
+ })
+ }
+ this.allData = data
+ this.curType = this.allData.list1
+ this.handleOptions()
+ },
+ initMedia(item){
+ if(item.videoAudio && !item.player){
+ // let fileId = '312d8a6efd1747ae9de519da574195db'
+ this.$get(`${this.api.getPlayAuth}/${item.videoAudio}`).then(res => {
+ let playAuth = res.data.playAuth
+ this.$nextTick(() => {
+ console.log('初始化开始',item.mediaEleId)
+ item.player = new Aliplayer({
+ id: item.mediaEleId,
+ width: '100%',
+ autoplay: false,
+ vid : item.videoAudio,
+ playauth : playAuth,
+ encryptType:1, //当播放私有加密流时需要设置。
+ })
+ console.log('初始化结束')
+ })
+ }).catch(res => {})
+ }
},
tabChange(id){
this.active = id
this.curType = this.allData[`list${id}`]
+
this.handleOptions()
},
handleOptions(){
let curType = this.curType
curType.forEach(n => {
+ this.initMedia(n)
if(!n.options){
let options = {}
for(let i in n){
if(i.includes('option') && n[i]){
- console.log(i.replace('option',''))
options[i.replace('option','')] = n[i]
}
}
@@ -123,13 +159,24 @@ export default {
}
})
this.curType = curType
- console.log(22,this.curType)
- }
+ },
+ insertScript(){
+ const linkTag = document.createElement('link')
+ linkTag.rel = 'stylesheet'
+ linkTag.href = 'https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css'
+ document.body.appendChild(linkTag)
+
+ const scriptTag = document.createElement('script')
+ scriptTag.type = 'text/javascript'
+ scriptTag.src = 'https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js'
+ document.body.appendChild(scriptTag)
+ },
},
};
diff --git a/src/layouts/navbar/index.vue b/src/layouts/navbar/index.vue
index 9a83cf3..64ec10e 100644
--- a/src/layouts/navbar/index.vue
+++ b/src/layouts/navbar/index.vue
@@ -74,6 +74,11 @@ export default {
index: '/testPaper/list',
title: '试卷管理'
},
+ {
+ icon: 'el-icon-s-order',
+ index: '/practice/list',
+ title: '练习管理'
+ },
{
icon: 'el-icon-data-analysis',
index: '/assessment/list',
@@ -88,6 +93,11 @@ export default {
icon: 'el-icon-setting',
index: '/system/list',
title: '系统设置'
+ },
+ {
+ icon: 'el-icon-chat-dot-round',
+ index: '/messageBoard/list',
+ title: '交流互动'
}
],
menus: []
@@ -103,8 +113,8 @@ export default {
// 通过 Event Bus 进行组件间通信,来折叠侧边栏
bus.$on('collapse', msg => {
this.collapse = msg;
- bus.$emit('collapse-content', msg);
- });
+ bus.$emit('collapse-content', msg)
+ })
},
methods: {
initMenu(){
diff --git a/src/libs/util.js b/src/libs/util.js
index 12204d9..f342b94 100644
--- a/src/libs/util.js
+++ b/src/libs/util.js
@@ -57,6 +57,21 @@ const util = {
break;
}
}
+ },
+ // 传入文件后缀判断是否是视频
+ isVideo(ext) {
+ if('mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv'.includes(ext)) return true
+ return false
+ },
+ // 传入文件后缀判断是否是音频
+ isAudio(ext) {
+ if('mp3,aac,ape,flac,wav,wma,amr,mid'.includes(ext)) return true
+ return false
+ },
+ // 传入文件后缀判断是否是图片
+ isImg(ext) {
+ if('jpg,jpeg,png,gif,svg,psd'.includes(ext)) return true
+ return false
}
};
diff --git a/src/pages/account/login/index.vue b/src/pages/account/login/index.vue
index 1e0a108..40e70b4 100644
--- a/src/pages/account/login/index.vue
+++ b/src/pages/account/login/index.vue
@@ -58,7 +58,6 @@ export default {
data: function() {
return {
loginForm: {
- // username: '18818574533',
username: 'manager',
password: 'huoran123',
},
@@ -110,7 +109,7 @@ export default {
display: flex;
justify-content: center;
align-items: center;
- background-color: #333;
+ background-color: rgba(51,51,51,.7);
.inner{
display: inline-flex;
justify-content: space-between;
diff --git a/src/pages/achievement/list/examResults.vue b/src/pages/achievement/list/examResults.vue
index bc8f42c..730659b 100644
--- a/src/pages/achievement/list/examResults.vue
+++ b/src/pages/achievement/list/examResults.vue
@@ -15,7 +15,7 @@
-
+
@@ -137,7 +137,7 @@ export default {
},
methods: {
...mapActions('achievement', [
- 'setInfo'
+ 'setAssListInfo','setAssDetailInfo'
]),
getData() {
this.$post(this.api.teacherByGetAchievement, {
@@ -189,7 +189,7 @@ export default {
this.multipleSelection = val;
},
show(row){
- this.setInfo({
+ this.setAssDetailInfo({
id: row.paperId,
assessmentId: row.id,
stuId: row.stuId
@@ -198,7 +198,7 @@ export default {
},
toStat(){
if(this.listData.length){
- this.setInfo({
+ this.setAssDetailInfo({
id: this.listData[0].paperId,
assessmentId: this.assessmentId,
assessmentName: this.assessmentName,
@@ -212,7 +212,7 @@ export default {
},
exportData(){
- }
+ },
}
};
diff --git a/src/pages/achievement/list/practiceResults.vue b/src/pages/achievement/list/practiceResults.vue
index 6e1d4ef..801b456 100644
--- a/src/pages/achievement/list/practiceResults.vue
+++ b/src/pages/achievement/list/practiceResults.vue
@@ -8,10 +8,15 @@
筛选
-
+
-
-
+
+
+
+
+
+
+
@@ -32,7 +37,7 @@
{{scope.$index + (page - 1) * pageSize + 1}}
-
-
-
-
-
+
+
+
+
+
- 查看详情
+ 查看详情
@@ -89,77 +94,90 @@
-
+
@@ -206,31 +260,4 @@ export default {
/deep/.no-mb.el-form-item{
margin-bottom: 0;
}
- /deep/.el-radio{
- margin-right: 15px;
- }
- ::v-deep .el-checkbox-group{
- font-size: 2px;
- }
- .Upload {
- text-align: center;
- }
- .bt {
- margin-bottom: 15px;
- }
- .flex_around {
- display: flex;
- justify-content: space-around;
- align-items: center;
- }
- .card_m {
- margin: 10px 0 20px 0;
- }
- .input ::v-deep .el-input {
- width: 50%;
- }
- .radio {
- margin: 0 15px 0 30px;
- font-weight: 600;
- }
\ No newline at end of file
diff --git a/src/pages/assessment/detail/index.vue b/src/pages/assessment/detail/index.vue
new file mode 100644
index 0000000..c12fca6
--- /dev/null
+++ b/src/pages/assessment/detail/index.vue
@@ -0,0 +1,262 @@
+
+
+
{{paperName }}
+
+
+
+
+
+
+
+
+
+
得分:
+
{{item.question_score}}
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/assessment/list/index.vue b/src/pages/assessment/list/index.vue
index a5b3629..3e73a8d 100644
--- a/src/pages/assessment/list/index.vue
+++ b/src/pages/assessment/list/index.vue
@@ -61,13 +61,37 @@
- 查看
+
+
+
+
考核内容:
+
{{assContent}}
+
+
+
+
考核人数:
+
{{assPeopleNum}}人
+
+
+
+ 查看
+
+
- 修改
+ 修改
取消
- 监控
+ 监控
结束考试
@@ -195,25 +219,8 @@
-
-
-
-
考核内容:
-
{{assContent}}
-
-
-
-
考核人数:
-
{{assPeopleNum}}人
-
-
-
+
+
@@ -221,6 +228,7 @@
diff --git a/src/pages/messageBoard/list/index.vue b/src/pages/messageBoard/list/index.vue
new file mode 100644
index 0000000..cb72e66
--- /dev/null
+++ b/src/pages/messageBoard/list/index.vue
@@ -0,0 +1,298 @@
+
+
+
+
+
+
+
+
+
+
+ {{item.userName}}
+ 发表于
+ {{item.createTime}}
+
+
+
+
+
+
+ 回复
+ 删除
+
+
+
+
+
+
+
+
+
+ {{reply.userName}}
+ 发表于
+ {{reply.commentTime}}
+
+
+
+
+
+ 回复
+ 删除
+
+
+
+
+
{{item.showChildren ? '收起所有回复' : `查看所有${item.getCommentReplyNum}条回复`}}
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/practice/detail/index.vue b/src/pages/practice/detail/index.vue
new file mode 100644
index 0000000..b2a09a4
--- /dev/null
+++ b/src/pages/practice/detail/index.vue
@@ -0,0 +1,279 @@
+
+
+
{{paperName }}
+
+
+
+
+
+
+
+
+
+
得分:
+
{{item.questionScore}}
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/practice/doReview/index.vue b/src/pages/practice/doReview/index.vue
new file mode 100644
index 0000000..93cb88e
--- /dev/null
+++ b/src/pages/practice/doReview/index.vue
@@ -0,0 +1,274 @@
+
+
+
{{paperName}}
+
+
+
+
+ 查看全部
+ 只看错题
+
+
+
+
{{item.isSub ? '简答题' : '客观题'}}:{{getCorrectingName(item.isCorrecting)}}
+
+
+
+
正确答案:
+
{{item.answer}}
+
+
+
学生答案:
+
{{item.userAnswer}}
+
+
+
+ 知识点:
+ {{item.knowledgePoints}}
+
+
+ 答案解析:
+ {{item.answerAnalysis}}
+
+
+
+
+
+
+ 提交
+ 保存
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/practice/list/index.vue b/src/pages/practice/list/index.vue
new file mode 100644
index 0000000..4c1b25d
--- /dev/null
+++ b/src/pages/practice/list/index.vue
@@ -0,0 +1,487 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
练习内容:
+
{{assContent}}
+
+
+
+
练习人数:
+
{{assPeopleNum}}人
+
+
+
+ 查看
+
+ 修改
+ 取消
+ 批阅
+ 成绩查询
+
+
+
+
+
+
+
+
+
+
+
+
+ 试卷选择
+
+ {{testPaperName}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{scope.$index + (page - 1) * pageSize + 1}}
+
+
+
+
+ 预览
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/practice/list/studentSide.vue b/src/pages/practice/list/studentSide.vue
new file mode 100644
index 0000000..fc208b7
--- /dev/null
+++ b/src/pages/practice/list/studentSide.vue
@@ -0,0 +1,121 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/practice/list/studentTree.vue b/src/pages/practice/list/studentTree.vue
new file mode 100644
index 0000000..dcf89a8
--- /dev/null
+++ b/src/pages/practice/list/studentTree.vue
@@ -0,0 +1,135 @@
+
+
+
+
+
+
+
+
{{item.label}}
+
+
+
+
+
+
+
+
+
{{item1.label}}年级
+
+
+
+
+
+
+ {{item2.label}}班
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/practice/result/index.vue b/src/pages/practice/result/index.vue
new file mode 100644
index 0000000..858aeb8
--- /dev/null
+++ b/src/pages/practice/result/index.vue
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{scope.$index + (page - 1) * pageSize + 1}}
+
+
+
+
+
+
+
+ {{getExamStatusName(scope.row.state)}}
+
+
+
+
+ {{getReviewStatusName(scope.row.reviewStatus)}}
+
+
+
+
+ 查看
+ 批阅
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/practice/review/index.vue b/src/pages/practice/review/index.vue
new file mode 100644
index 0000000..968b078
--- /dev/null
+++ b/src/pages/practice/review/index.vue
@@ -0,0 +1,155 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{scope.$index + (page - 1) * pageSize + 1}}
+
+
+
+
+
+ {{getReviewStatusName(scope.row.reviewStatus)}}
+
+
+
+
+ 查看
+ 批阅
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/practice/scoreQuery/index.vue b/src/pages/practice/scoreQuery/index.vue
new file mode 100644
index 0000000..b8e54e1
--- /dev/null
+++ b/src/pages/practice/scoreQuery/index.vue
@@ -0,0 +1,269 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{scope.$index + (page - 1) * pageSize + 1}}
+
+
+
+
+
+
+
+
+ 查看详情
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{scope.$index + (page - 1) * pageSize + 1}}
+
+
+
+
+
+
+ 查看
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/quesBank/list/myQuesBank.vue b/src/pages/quesBank/list/myQuesBank.vue
index 0ee66f6..d85fbb2 100644
--- a/src/pages/quesBank/list/myQuesBank.vue
+++ b/src/pages/quesBank/list/myQuesBank.vue
@@ -91,7 +91,7 @@
-
+
@@ -206,7 +206,11 @@ export default {
userId: this.userId
})
.then(res => {
- this.listData = res.data.list.list
+ let list = res.data.list.list
+ list.map(n => {
+ n.questionStem = n.questionStem.replace(/<\/?.+?>/gi,'')
+ })
+ this.listData = list
this.total = res.data.list.totalCount
})
.catch(err => {})
@@ -290,10 +294,10 @@ export default {
.catch(() => {});
},
handleSelectionChange(val) {
- this.multipleSelection = val;
+ this.multipleSelection = val
},
shareDataBatch() {
- if(this.multipleSelection.length != ''){
+ if(this.multipleSelection.length){
let newArr = this.multipleSelection
let shareList = newArr.map(item => {
return item.id
@@ -309,19 +313,20 @@ export default {
}
this.$post(this.api.batchSave,data).then(res => {
this.multipleSelection = [];
- this.$message.success('共享成功');
+ this.$message.success('共享成功')
this.getData()
+ this.$refs.table.clearSelection()
}).catch(res => {
this.getData()
})
})
.catch(() => {});
}else{
- this.$message.error('请先选择数据');
+ this.$message.error('请先选择数据')
}
},
cancelShareBatch() {
- if(this.multipleSelection.length != ''){
+ if(this.multipleSelection.length){
let newArr = this.multipleSelection
let shareList = newArr.map(item => {
return item.id
@@ -361,15 +366,16 @@ export default {
this.multipleSelection = [];
this.$message.success('删除成功');
this.getData()
- }).catch(res => {});
+ this.$refs.table.clearSelection()
+ }).catch(res => {})
})
- .catch(() => {});
+ .catch(() => {})
}else{
- this.$message.error('请先选择数据!');
+ this.$message.error('请先选择数据!')
}
},
downLoad() {
- location.href = this.api.getExcel
+ location.href = 'http://39.108.250.202:9000/cjEnterprise/questions/getExcel'
},
showimportVisible() {
this.importVisible = true
diff --git a/src/pages/quesBank/list/quesDialog.vue b/src/pages/quesBank/list/quesDialog.vue
index c91ee57..701b8f6 100644
--- a/src/pages/quesBank/list/quesDialog.vue
+++ b/src/pages/quesBank/list/quesDialog.vue
@@ -14,11 +14,6 @@
-
@@ -36,6 +31,7 @@
上传视频/音频
- 导入失败,查看原因
-
- A
-
- 设为正确答案
-
-
- B
-
- 设为正确答案
-
-
+
+
+ A
+
+ 设为正确答案
+
+
+ B
+
+ 设为正确答案
+
+
+
+
+ A
+
+ 设为正确答案
+
+
+ B
+
+ 设为正确答案
+
C
@@ -124,11 +130,11 @@ export default {
props: ['visible','title','isDetail'],
data() {
return {
+ acceptExt: '.avi,.wmv,.mpg,.mpeg,.mov,.rm,.ram,.swf,.flv,.mp4,.mp3,.wma,.avi,.rm,.rmvb,.flv,.mpg,.mkv',
quesBankList: [],
typeList: [],
topicForm: {
userId: this.userId,
- schoolId: this.clientId,
cid : '',
typeId: '',
courses: '',
@@ -148,6 +154,8 @@ export default {
disTrue: false,
eisTrue: false,
fisTrue: false,
+ judgeOptionA: '正确',
+ judgeOptionB: '错误',
answerAnalysis: '',
videoAudio: ''
},
@@ -157,31 +165,22 @@ export default {
knowledgePoints: [{ required: true, message: '请填写知识点', trigger: 'blur' }],
questionType: [{ required: true, message: '请选择题型', trigger: 'change' }],
questionStem: [{ required: true, message: '请填写题干', trigger: 'blur' }],
- // optionA: [{ required: true, message: '请选择正确选项', trigger: 'change' }],
- // optionB: [{ required: true, message: '请选择正确选项', trigger: 'change' }]
},
options: 'ABCDEF',
questionType: ['','单选题','多选题','判断题','简答题','填空题'],
fillList: [''],
uploadList: [],
- uploadFaild: false
};
},
computed: {
...mapState('user', [
- 'userId','clientId'
+ 'userId'
])
},
components: { quill },
mounted() {
- this.topicForm.schoolId = this.clientId
this.getQuesBank()
},
- // watch: {
- // visible(val){
- // this.toTop()
- // }
- // },
methods: {
getData(id) {
this.$post(`${this.api.findById}?id=${id}`)
@@ -190,7 +189,6 @@ export default {
this.topicForm = {
id: list.id,
userId: list.userId,
- schoolId: list.schoolId,
cid : list.cid,
typeId: list.typeId,
courses: list.courses,
@@ -210,16 +208,24 @@ export default {
disTrue: false,
eisTrue: false,
fisTrue: false,
+ judgeOptionA: '正确',
+ judgeOptionB: '错误',
answerAnalysis: list.answerAnalysis,
videoAudio: list.videoAudio
},
this.topicForm.questionType = this.questionType[this.topicForm.typeId]
let typeId = this.topicForm.typeId
- if(typeId == 1 || typeId == 2 || typeId == 3){
+ if(typeId == 1 || typeId == 2){
let answer = this.topicForm.answer.toLowerCase().split('')
answer.forEach(n => {
this.topicForm[`${n}isTrue`] = true
})
+ }else if(typeId == 3){
+ if(this.topicForm.answer == 'A'){
+ this.topicForm.aisTrue = '1'
+ }else{
+ this.topicForm.aisTrue = '2'
+ }
}else if(typeId == 5){
let fillList = []
for(let n in this.topicForm) {
@@ -245,6 +251,9 @@ export default {
for(let i in this.topicForm){
if(i.includes('isTrue')) this.topicForm[i] = false
}
+ if(this.topicForm.questionType == '判断题'){
+ this.topicForm.aisTrue = '1'
+ }
},
saveTopics() {
this.$refs.topicForm.validate((valid) => {
@@ -254,7 +263,18 @@ export default {
let answer = ''
let isInvalidAnswer = false
this.topicForm.typeId = this.questionType.indexOf(topicForm.questionType)
- if(topicForm.typeId != 4 && topicForm.typeId != 5){
+ if(this.topicForm.typeId == 3){
+ this.topicForm.optionA = '正确'
+ this.topicForm.optionB = '错误'
+ if(this.topicForm.aisTrue == 1){
+ this.topicForm.aisTrue = true
+ this.topicForm.answer = 'A'
+ }else{
+ this.topicForm.bisTrue = true
+ this.topicForm.answer = 'B'
+ }
+ }
+ if(topicForm.typeId == 1 || topicForm.typeId == 2 || topicForm.typeId == 3){
for(let n in topicForm) {
if(n.includes('option')) {
topicForm[n] != '' && ++optionCount
@@ -265,9 +285,10 @@ export default {
if(!topicForm[`option${curOpt.toUpperCase()}`].length) isInvalidAnswer = true
}
}
- if(optionCount < 2) return this.$message.warning('请至少添加两个选项!');
- if(!answer) return this.$message.warning('请设置正确答案!');
- if(topicForm.questionType != '多选题' && answer.length > 1) return this.$message.warning('单选题、判断题只能设置一个正确答案!');
+ if(optionCount < 2) return this.$message.warning('请至少添加两个选项!')
+ if(!answer) return this.$message.warning('请设置正确答案!')
+ if(topicForm.questionType == '单选题' && answer.length > 1) return this.$message.warning('单选题只能设置一个正确选项!')
+ if(topicForm.questionType == '多选题' && answer.length < 2) return this.$message.warning('多选题必须设置至少两个正确选项!')
if(isInvalidAnswer) return this.$message.warning('正确答案选项为空,请重新设置!');
this.topicForm.answer = answer.toUpperCase()
}else if(this.topicForm.typeId == 5){
@@ -284,24 +305,24 @@ export default {
if(this.topicForm.id) {
this.$post(this.api.updateQuestions,this.topicForm).then(res => {
if(res.success) {
- this.$message.success('修改成功');
+ this.$message.success('修改成功')
this.$emit('getData')
}else{
- this.$message.error(res.data.message);
+ this.$message.error(res.data.message)
}
- }).catch(res => {});
+ }).catch(res => {})
}else{
this.$post(this.api.addQuestions,this.topicForm).then(res => {
if(res.success) {
- this.$message.success('新增成功');
+ this.$message.success('新增成功')
this.$emit('getData')
}else{
- this.$message.error(res.data.message);
+ this.$message.error(res.data.message)
}
- }).catch(res => {});
+ }).catch(res => {})
}
}else{
- return false;
+ return false
}
})
},
@@ -311,7 +332,6 @@ export default {
resetForm() {
this.topicForm = {
userId: this.userId,
- schoolId: this.clientId,
cid : '',
typeId: '',
courses: '',
@@ -331,6 +351,8 @@ export default {
disTrue: false,
eisTrue: false,
fisTrue: false,
+ judgeOptionA: '正确',
+ judgeOptionB: '错误',
answerAnalysis: '',
videoAudio: ''
}
@@ -345,7 +367,7 @@ export default {
this.topicForm.id = id
this.topicForm.questionType = this.questionType[this.topicForm.questionType]
this.NewTopics = true
- }).catch(res => {});
+ }).catch(res => {})
},
addFill(){
if(this.fillList.some(n => n === '')) return this.$message.warning('请先填写当前答案')
@@ -357,14 +379,10 @@ export default {
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
- );
+ )
},
uploadSuccess(res, file, fileList) {
- this.uploadFaild = false
- if(res.data.token){
- this.token = res.data.token
- this.uploadFaild = true
- }
+ this.topicForm.videoAudio = res.data.filesResult.fileId
},
showFaild(){
location.href = `${this.api.export_failure}?token=${this.token}`
@@ -442,5 +460,4 @@ export default {
padding-right: 20px;
overflow: auto;
}
-
-
+
\ No newline at end of file
diff --git a/src/pages/setting/person/index.vue b/src/pages/setting/person/index.vue
index 93371fb..ade5467 100644
--- a/src/pages/setting/person/index.vue
+++ b/src/pages/setting/person/index.vue
@@ -1,26 +1,14 @@
-