项目管理更新课程Form页面

This commit is contained in:
hbzgyjh 2021-12-13 16:44:19 +08:00
parent 28296c7b4f
commit 0d242f5f8a
3 changed files with 38 additions and 17 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<a-card :bordered="false" title="题库管理"> <a-card :bordered="true" hoverable :title="title">
<template slot="extra"> <template v-if="!courseId" slot="extra">
<a-button size="small" @click="questionColse">返回</a-button> <a-button size="small" @click="questionColse">返回</a-button>
</template> </template>
<div class="questionLeft"> <div class="questionLeft">
@ -14,14 +14,14 @@
<div class="questionDetail"> <div class="questionDetail">
<br /> <br />
<div> <div>
<a-button type="primary" class="create-button" style="font-size: 15px; margin: 0px 10px 10px 0px" @click="questionSave">新增题目</a-button> <a-button v-if="!courseId" type="primary" class="create-button" style="font-size: 15px; margin: 0px 10px 10px 0px" @click="questionSave">新增题目</a-button>
<a-button type="primary" class="create-button" style="font-size: 15px; margin: 0px 10px 10px 0px" @click="questionBatch"> <a-button v-if="!courseId" type="primary" class="create-button" style="font-size: 15px; margin: 0px 10px 10px 0px" @click="questionBatch">
批量导入 批量导入
</a-button> </a-button>
<a-button type="primary" class="create-button" style="font-size: 15px; margin: 0px 10px 10px 0px" @click="showModal"> <a-button v-if="!courseId" type="primary" class="create-button" style="font-size: 15px; margin: 0px 10px 10px 0px" @click="showModal">
模板下载 模板下载
</a-button> </a-button>
<a-modal v-model="visible" title="模板下载" cancelText="关闭" :ok-button-props="{ style: { display: 'none' } }"> <a-modal v-if="!courseId" v-model="visible" title="模板下载" cancelText="关闭" :ok-button-props="{ style: { display: 'none' } }">
<a-button type="primary" class="create-button" style="font-size: 15px; margin:-15px 50px 3px 50px" @click="questionBatchDownloadDemo">示例模板</a-button> <a-button type="primary" class="create-button" style="font-size: 15px; margin:-15px 50px 3px 50px" @click="questionBatchDownloadDemo">示例模板</a-button>
<a-button type="primary" class="create-button" style="font-size: 15px; margin:-15px 30px 3px 70px" @click="questionBatchDownload">纯净模板</a-button> <a-button type="primary" class="create-button" style="font-size: 15px; margin:-15px 30px 3px 70px" @click="questionBatchDownload">纯净模板</a-button>
</a-modal> </a-modal>
@ -33,8 +33,8 @@
<div class="question"> <div class="question">
<h1 class="questionName" v-if="quesitonList != null && quesitonList.length != 0"> <h1 class="questionName" v-if="quesitonList != null && quesitonList.length != 0">
{{ questionDetail.questionTypeName }}{{ questionDetail.questionName }} {{ questionDetail.questionTypeName }}{{ questionDetail.questionName }}
<span class="edit" @click="edit(questionDetail.id)">编辑</span> <span v-if="!courseId" class="edit" @click="edit(questionDetail.id)">编辑</span>
<a-popconfirm title="确定要删除此题?" ok-text="确定" cancel-text="取消" @confirm="del(questionDetail.id)"> <a-popconfirm v-if="!courseId" title="确定要删除此题?" ok-text="确定" cancel-text="取消" @confirm="del(questionDetail.id)">
<span class="edit">删除</span> <span class="edit">删除</span>
</a-popconfirm> </a-popconfirm>
</h1> </h1>
@ -85,8 +85,14 @@ import storage from 'store'
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
export default { export default {
props:{
courseId:{
type: String,
}
},
data() { data() {
return { return {
title:"题库管理",
quesitonList: [], quesitonList: [],
questionDetail: {}, questionDetail: {},
isactive: 1, isactive: 1,
@ -101,7 +107,7 @@ export default {
methods: { methods: {
getQuestion() { getQuestion() {
// id // id
getQuestionListByCourseId({ id: this.$route.query.id }).then((res) => { getQuestionListByCourseId({ id: this.$route.query.id || this.courseId }).then((res) => {
this.quesitonList = res.data this.quesitonList = res.data
if (!res.data) return if (!res.data) return

View File

@ -55,7 +55,7 @@
<p>课程预览</p> <p>课程预览</p>
</a-drawer> </a-drawer>
<a-drawer title="题库预览" placement="right" width="1200" :closable="true" :visible="questionVisible" @close="drawerClose"> <a-drawer title="题库预览" placement="right" width="1200" :closable="true" :visible="questionVisible" @close="drawerClose">
<p>题库预览</p> <question-list :courseId="selectCourseId"></question-list>
</a-drawer> </a-drawer>
<a-drawer title="必选题设置" placement="right" width="1200" :closable="true" :visible="requiredTopicVisible" @close="drawerClose"> <a-drawer title="必选题设置" placement="right" width="1200" :closable="true" :visible="requiredTopicVisible" @close="drawerClose">
<p>必选题设置</p> <p>必选题设置</p>
@ -69,12 +69,15 @@
import { STable } from '@/components' import { STable } from '@/components'
import ProjectCourseSelect from './ProjectCourseSelect.vue' import ProjectCourseSelect from './ProjectCourseSelect.vue'
import { getCourseList, getCourseListByCourseIds } from '@/api/project/projectCourse' import { getCourseList, getCourseListByCourseIds } from '@/api/project/projectCourse'
import QuestionList from '@/views/course/question/QuestionList.vue'
export default { export default {
//import使 //import使
components: { components: {
STable, STable,
QuestionList,
ProjectCourseSelect, ProjectCourseSelect,
QuestionList,
}, },
props: { props: {
projectForm: { projectForm: {
@ -92,6 +95,7 @@ export default {
totalHours: 0, // totalHours: 0, //
totalLearnHours: 0, // totalLearnHours: 0, //
totalTopicNum: 0, // totalTopicNum: 0, //
selectCourseId: '', //id
courseVisible: false, // courseVisible: false, //
questionVisible: false, // questionVisible: false, //
@ -144,7 +148,8 @@ export default {
}, },
// //
openVisible(type) { openVisible(type,record) {
this.selectCourseId = record.id;
if(type === 'course') this.courseVisible = true; if(type === 'course') this.courseVisible = true;
else if(type === 'topic') this.requiredTopicVisible = true; else if(type === 'topic') this.requiredTopicVisible = true;
else if(type === 'question') this.questionVisible = true; else if(type === 'question') this.questionVisible = true;

View File

@ -44,12 +44,18 @@
</a-row> </a-row>
<a-card :bordered="false" title="组卷策略详情"> <a-card :bordered="false" title="组卷策略详情">
<a-table :columns="columns" :data-source="tableData" bordered :position="{ disabled: false }"> <a-table :columns="columns" :data-source="tableData" bordered :position="{ disabled: false }" :pagination="false">
<template slot="topicNum" slot-scope="text, record"> <template slot="topicNum" slot-scope="text, record">
<a-input-number style="margin: -5px 0" v-model="record.topicNum" /> <a-input-number style="margin: -5px 0" v-model="record.topicNum" min="0" :max="record.totalNum" />
</template> </template>
<template slot="topicScore" slot-scope="text, record"> <template slot="topicScore" slot-scope="text, record">
<a-input-number style="margin: -5px 0" v-model="record.topicScore" /> <a-input-number style="margin: -5px 0" v-model="record.topicScore" min="0" />
</template>
<template slot="totalScore" slot-scope="text, record">
<p>{{record.topicScore}}</p>
</template>
<template slot="footer" :style="{ float:left }">
<p>总分数{{form.totalScore}} </p>
</template> </template>
</a-table> </a-table>
</a-card> </a-card>
@ -123,7 +129,8 @@ export default {
title: '总分', title: '总分',
dataIndex: 'totalScore', dataIndex: 'totalScore',
customRender: (value, row, index) => { customRender: (value, row, index) => {
return { children: value, attrs: { rowSpan: index == 0 ? 5 : 0 } } if (!row.topicNum || !row.topicScore) return '';
return (row.topicNum * row.topicScore) + '分'
}, },
}, },
], ],
@ -136,6 +143,9 @@ export default {
watch: {}, watch: {},
// //
methods: { methods: {
validataScore() {
},
// //
toSave() { toSave() {
this.form.testPaperTactics = this.tableData this.form.testPaperTactics = this.tableData
@ -156,9 +166,9 @@ export default {
created() { created() {
if (this.tableData.length == 0) { if (this.tableData.length == 0) {
let ids = this.form.lessonIds.map((t) => { let ids = this.form.lessonIds.map((t) => {
return parseInt(t.ids); return parseInt(t.ids);
}) })
getQuestionNumByCourseIds({ ids: ids}).then((res) => { getQuestionNumByCourseIds({ ids: ids }).then((res) => {
this.tableData = res.data this.tableData = res.data
}) })
} }