Commit 677aca5c authored by 王飞龙's avatar 王飞龙

考试管理添加

parent 32657bf2
import request from '@/utils/request'
import Qs from 'qs'
/**
* 1. 列表查询
* 2. 查询详细信息
* 3. 新增
* 4. 修改
* 5. 逻辑删除
* 6. 导出
*
*/
// 1. 查询试卷表列表
export function listTeaExamExaminationPaper(query) {
return request({
url: '/teaexamexaminationpaper/queryTeaExamExaminationPaperByPagination',
method: 'get',
params: query
})
}
// 2. 查询试卷表详细信息
export function getTeaExamExaminationPaper(businessId) {
return request({
url: '/teaexamexaminationpaper/detail/' + businessId,
method: 'get'
})
}
// 3. 新增试卷表
export function addTeaExamExaminationPaper(data) {
data = Qs.stringify(data)
return request({
url: '/teaexamexaminationpaper/add',
method: 'post',
data: data
})
}
// 4. 修改试卷表
export function updateTeaExamExaminationPaper(data) {
const businessId = data.businessId
data = Qs.stringify(data)
return request({
url: '/teaexamexaminationpaper/update/' + businessId,
method: 'put',
data
})
}
// 5. 逻辑删除试卷表
export function delTeaExamExaminationPaper(businessId) {
return request({
url: '/teaexamexaminationpaper/deleteLogical/' + businessId,
method: 'delete'
})
}
// 6. 导出试卷表
export function exportTeaExamExaminationPaper(query) {
return request({
url: '/teaexamexaminationpaper/export',
method: 'get',
params: query,
responseType: 'blob'
})
}
import request from '@/utils/request'
import Qs from 'qs'
/**
* 1. 列表查询
* 2. 查询详细信息
* 3. 新增
* 4. 修改
* 5. 逻辑删除
* 6. 导出
*
*/
// 1. 查询试题表列表
export function listTeaExamQuestions(query) {
return request({
url: '/teaexamquestions/queryTeaExamQuestionsByPagination',
method: 'get',
params: query
})
}
// 2. 查询试题表详细信息
export function getTeaExamQuestions(businessId) {
return request({
url: '/teaexamquestions/detail/' + businessId,
method: 'get'
})
}
// 3. 新增试题表
export function addTeaExamQuestions(data) {
data = Qs.stringify(data)
return request({
url: '/teaexamquestions/add',
method: 'post',
data: data
})
}
// 4. 修改试题表
export function updateTeaExamQuestions(data) {
const businessId = data.businessId
data = Qs.stringify(data)
return request({
url: '/teaexamquestions/update/' + businessId,
method: 'put',
data
})
}
// 5. 逻辑删除试题表
export function delTeaExamQuestions(businessId) {
return request({
url: '/teaexamquestions/deleteLogical/' + businessId,
method: 'delete'
})
}
// 6. 导出试题表
export function exportTeaExamQuestions(query) {
return request({
url: '/teaexamquestions/export',
method: 'get',
params: query,
responseType: 'blob'
})
}
...@@ -248,6 +248,7 @@ export default { ...@@ -248,6 +248,7 @@ export default {
res.rows.forEach(item => { res.rows.forEach(item => {
item.srclist = [] item.srclist = []
item.srclist.push(this.imagePath + item.path) item.srclist.push(this.imagePath + item.path)
console.log(item.srclist)
}) })
_this.tableData = res.rows _this.tableData = res.rows
_this.fullscreenLoading = false _this.fullscreenLoading = false
......
...@@ -272,6 +272,7 @@ export default { ...@@ -272,6 +272,7 @@ export default {
}) })
} else { } else {
// 新增 // 新增
form.flag = '1'
addCmsProject(form).then(res => { addCmsProject(form).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$message({ this.$message({
......
...@@ -98,9 +98,11 @@ ...@@ -98,9 +98,11 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="18" > <el-col :span="18">
<el-form-item label="新闻内容:" prop="remarks"> <el-form-item label="新闻内容:" prop="remarks">
<vue-editor id="editorsay" v-model="form.details" :editor-toolbar="customToolbar" @image-added="handleImageAdded" /> <div class="ql-editor">
<vue-editor id="editorsay" v-model="form.details" :editor-toolbar="customToolbar" @image-added="handleImageAdded" />
</div>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -314,6 +316,7 @@ export default { ...@@ -314,6 +316,7 @@ export default {
}) })
} else { } else {
// 新增 // 新增
form.flag = '1'
addSysContentNewsInformation(form).then(res => { addSysContentNewsInformation(form).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$message({ this.$message({
......
...@@ -280,7 +280,7 @@ ...@@ -280,7 +280,7 @@
:class="commonField.updateClass" :class="commonField.updateClass"
:type="commonField.typeParent" :type="commonField.typeParent"
:size="commonField.size" :size="commonField.size"
@click="handleExamination(scope.$index)" @click="handleExamination(scope.row)"
>考试管理</el-button> >考试管理</el-button>
<el-button <el-button
:class="commonField.updateClass" :class="commonField.updateClass"
...@@ -622,6 +622,7 @@ export default { ...@@ -622,6 +622,7 @@ export default {
obj.id = i + 1 obj.id = i + 1
obj.tcode = pages[i].code obj.tcode = pages[i].code
obj.tlessonName = pages[i].lessonName obj.tlessonName = pages[i].lessonName
obj.bussinessId = pages[i].businessId
obj.tname = pages[i].name obj.tname = pages[i].name
obj.tsex = (pages[i].sex == '1') ? '女' : '男' obj.tsex = (pages[i].sex == '1') ? '女' : '男'
obj.imageSrc = pages[i].defaultUrl ? pages[i].defaultUrl : require('@/assets/image/test.png') obj.imageSrc = pages[i].defaultUrl ? pages[i].defaultUrl : require('@/assets/image/test.png')
...@@ -762,9 +763,14 @@ export default { ...@@ -762,9 +763,14 @@ export default {
} }
}, },
// 跳转考试管理 // 跳转考试管理
handleExamination(index) { handleExamination(data) {
console.log('data', data)
this.$router.push({ this.$router.push({
path: '/courseInformation/examinationManagement/index' path: '/courseInformation/examinationManagement/index',
query: {
bussinessId: data.bussinessId,
name: data.tlessonName
}
}) })
}, },
// 下载模板 // 下载模板
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 标题--> <!-- 标题-->
<div class="examinationTitle">大数据平台核心技术</div> <div class="examinationTitle">{{ name }}</div>
<el-tabs v-model="activeName"> <el-tabs v-model="activeName" @tab-click="tabClick">
<el-tab-pane label="试题管理" name="ExaminationPaper" /> <el-tab-pane label="试题管理" name="ExaminationPaper" />
<el-tab-pane label="试卷管理" name="QuestionManagement" /> <el-tab-pane label="试卷管理" name="QuestionManagement" />
</el-tabs> </el-tabs>
...@@ -23,14 +23,29 @@ export default { ...@@ -23,14 +23,29 @@ export default {
ExaminationPaper, ExaminationPaper,
QuestionManagement QuestionManagement
}, },
// 向子组件QuestionManagement传递参数bussinessId
data() { data() {
return { return {
activeName: 'ExaminationPaper' // 标签默认选中 activeName: 'ExaminationPaper', // 标签默认选中
bussinessId: '', // 业务id
name: '' // 课程名称
} }
}, },
created() { created() {
// 接受路由传递的参数
this.bussinessId = this.$route.query.bussinessId
this.name = this.$route.query.name
console.log(this.bussinessId, this.name)
}, },
methods: { methods: {
tabClick() {
// 在tab切换时更新bussinessId
if (this.activeName === 'ExaminationPaper') {
this.bussinessId = '123' // 传递给ExaminationPaper组件的业务id值
} else if (this.activeName === 'QuestionManagement') {
this.bussinessId = '456' // 传递给QuestionManagement组件的业务id值
}
}
} }
} }
</script> </script>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true"> <el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true">
<el-form-item label="填写人"> <el-form-item label="填写人">
<el-input v-model="queryParams.unit" placeholder="请输入填写人" clearable /> <el-input v-model="queryParams.answerName" placeholder="请输入填写人" clearable />
</el-form-item> </el-form-item>
<!-- 状态--> <!-- 状态-->
<el-form-item label="状态"> <el-form-item label="状态">
...@@ -56,17 +56,17 @@ ...@@ -56,17 +56,17 @@
<span>{{ scope.$index + 1 }}</span> <span>{{ scope.$index + 1 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="studentName" label="填写人" show-overflow-tooltip /> <el-table-column prop="answerName" label="填写人" show-overflow-tooltip />
<el-table-column prop="examDate" label="填写时间" /> <el-table-column prop="fillingTime" label="填写时间" />
<el-table-column prop="status" label="状态"> <el-table-column prop="flag" label="状态">
<template slot-scope="scope"> <template slot-scope="scope">
{{ statusChange(scope.row.status) }} {{ statusChange(scope.row.flag) }}
</template> </template>
</el-table-column> </el-table-column>
<!-- 得分--> <!-- 得分-->
<el-table-column prop="score" label="得分"> <el-table-column prop="score" label="得分">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.status === '1'">{{ scope.row.score }}</span> <span v-if="scope.row.flag === '0'">{{ scope.row.score }}</span>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
...@@ -163,6 +163,7 @@ ...@@ -163,6 +163,7 @@
import commonField from '@/utils/commonField' import commonField from '@/utils/commonField'
import { updateProjectStatus, delCmsProject, listCmsProject } from '@/api/contentManagement/cmsProject' import { updateProjectStatus, delCmsProject, listCmsProject } from '@/api/contentManagement/cmsProject'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
import { listTeaExamExaminationPaper } from '@/api/examination/teaExamExaminationPaper'
export default { export default {
name: 'QuestionManagement', name: 'QuestionManagement',
data() { data() {
...@@ -353,33 +354,31 @@ export default { ...@@ -353,33 +354,31 @@ export default {
return '困难' return '困难'
} }
}, },
// loadData() { loadData() {
// // 列表渲染数据 // 列表渲染数据
// var data = [] var data = []
// const _this = this const _this = this
// this.tableData = [] this.tableData = []
// _this.fullscreenLoading = true _this.fullscreenLoading = true
// const params = { const params = {
// page: _this.queryParams.page, page: _this.queryParams.page,
// rows: _this.queryParams.rows, rows: _this.queryParams.rows
// title: _this.queryParams.title, }
// unit: _this.queryParams.unit listTeaExamExaminationPaper(params).then(res => {
// } var pages = res.rows// 查询过来的每页数据
// listCmsProject(params).then(res => { _this.total = res.total// 总记录数
// var pages = res.rows// 查询过来的每页数据 _this.bussid = []
// _this.total = res.total// 总记录数 res.rows.forEach(item => {
// _this.bussid = [] item.srclist = []
// res.rows.forEach(item => { item.srclist.push(item.path)
// item.srclist = [] })
// item.srclist.push(item.path) _this.tableData = res.rows
// }) _this.fullscreenLoading = false
// _this.tableData = res.rows if (res.rows.length === 0) {
// _this.fullscreenLoading = false _this.tableDataTips = '暂无数据'
// if (res.rows.length === 0) { }
// _this.tableDataTips = '暂无数据' })
// } },
// })
// },
// 修改状态 // 修改状态
// handleStatusChange(row) { // handleStatusChange(row) {
// const text = row.flag === '1' ? '启用' : '停用' // const text = row.flag === '1' ? '启用' : '停用'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment