From c75d6ee120e601d78fdc6123ce16e3beec69787d Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期一, 17 六月 2024 13:52:07 +0800 Subject: [PATCH] 试卷模块 --- src/views/exam/paper/edit.vue | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/views/exam/paper/edit.vue b/src/views/exam/paper/edit.vue index 7ac665c..d37f453 100644 --- a/src/views/exam/paper/edit.vue +++ b/src/views/exam/paper/edit.vue @@ -15,7 +15,7 @@ <el-input style="width: 300px" v-model="form.name"/> </el-form-item> <el-form-item :key="index" :label="'鏍囬'+(index+1)+'锛�'" required - v-for="(titleItem,index) in form.questionTitleList" v-show="form.paperType===1"> + v-for="(titleItem,index) in form.questionTitleList" v-show="form.paperType===1 || (form.paperType ===3 && form.id)"> <el-input v-model="titleItem.title" style="width: 50%"/> <el-select @change="addQuestionType" v-model="titleItem.questionType" style="margin-left: 20px" placeholder="璇烽�夋嫨棰樼洰绫诲瀷"> @@ -44,7 +44,7 @@ :controls="false" @change="updateTotalScore"/> </el-col> <el-col :span="3"> - <el-button type="text" size="mini" @click="removeQuestion(titleItem,questionItem)">鍒犻櫎 + <el-button type="text" size="mini" @click="removeQuestion(titleItem,questionIndex)">鍒犻櫎 </el-button> </el-col> </el-row> @@ -72,7 +72,7 @@ <el-radio v-model="form.visibility" :label="'1'">绉佹湁</el-radio> <el-radio v-model="form.visibility" :label="'2'">鍏紑</el-radio> </el-form-item> - <el-form-item v-show="form.paperType ===2 ||form.paperType ===3" :key="index" + <el-form-item v-show="form.paperType ===2 || (form.paperType ===3 && !form.id)" :key="index" :label="translateQuestionType(item.questionType)+'锛�'" v-for="(item,index) in form.questionSetting"> <div style="display: flex;"> <span style="margin-right: 10px">{{ '鏍囬' }}</span> @@ -87,16 +87,16 @@ <div style="display: flex;"> <span style="margin-right: 10px">{{ '鏁伴噺锛�' }}</span> <span v-if ="form.paperType ===2 || (form.paperType ===3 && !form.id)" style="margin-right: 50px;width: 100px">{{ totalNum }}</span> - <span v-if ="form.paperType ===1" style="margin-right: 50px;width: 100px">{{ form.num }}</span> + <span v-if ="form.paperType ===1 || (form.paperType ===3 && form.id)" style="margin-right: 50px;width: 100px">{{ form.num }}</span> <span style="margin-right: 10px">{{ '鎬诲垎锛�' }}</span> <span v-if ="form.paperType ===2 || (form.paperType ===3 && !form.id)" style="width: 100px">{{ totalScore }}</span> - <span v-if ="form.paperType ===1" style="width: 100px">{{ form.score }}</span> + <span v-if ="form.paperType ===1 || (form.paperType ===3 && form.id)" style="width: 100px">{{ form.score }}</span> </div> </el-form-item> <el-form-item> <el-button type="primary" @click="submitForm">鎻愪氦</el-button> <el-button @click="resetForm">閲嶇疆</el-button> - <el-button type="success" @click="addTitle" v-show="form.paperType ===1">娣诲姞鏍囬</el-button> + <el-button type="success" @click="addTitle" v-show="form.paperType ===1 ||(form.paperType ===3 && form.id)">娣诲姞鏍囬</el-button> </el-form-item> </el-form> @@ -388,7 +388,9 @@ { questionType: 3, title: '鍒ゆ柇棰�', score: null, num: null }, { questionType: 4, title: '濉┖棰�', score: null, num: null }, { questionType: 5, title: '绠�绛旈', score: null, num: null }, - { questionType: 6, title: '璁$畻棰�', score: null, num: null }, + { questionType: 6, title: '璇煶棰�', score: null, num: null }, + { questionType: 7, title: '璁$畻棰�', score: null, num: null }, + { questionType: 8, title: '鍒嗘瀽棰�', score: null, num: null }, ], questionTitleList: [] } -- Gitblit v1.8.0