Compare commits
3 Commits
54b26419a7
...
6e7cb3edfa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e7cb3edfa | ||
|
|
f63eefca43 | ||
|
|
919af0739c |
@ -53,9 +53,11 @@
|
||||
</el-col>
|
||||
<el-col :span="1">
|
||||
<el-icon
|
||||
v-if="item.case_item_model.length>1"
|
||||
color="red"
|
||||
size="20px"
|
||||
style="cursor: pointer"
|
||||
|
||||
@click="delModel(key)"
|
||||
><Delete
|
||||
/></el-icon>
|
||||
@ -104,7 +106,7 @@
|
||||
</el-row> -->
|
||||
<el-row :gutter="20" style="margin-top: 30px" v-if="showTab !== 0">
|
||||
<el-col :span="8">
|
||||
<el-button type="primary" @click="addQuestion"
|
||||
<el-button type="primary" :disabled="item.case_item_question && (item.case_item_question)[0] && (item.case_item_question)[0].created_at" @click="addQuestion"
|
||||
>增加题目</el-button
|
||||
>
|
||||
</el-col>
|
||||
@ -114,7 +116,7 @@
|
||||
<question
|
||||
:modalForm="cell"
|
||||
v-for="(cell, key) in item.case_item_question"
|
||||
:key="item.question_id"
|
||||
:key="cell.name"
|
||||
:qIndex="key"
|
||||
@handleAddSelect="handleAddSelect"
|
||||
@handleDelQusetion="handleDelQusetion"
|
||||
@ -290,7 +292,7 @@ const addQuestion = () => {
|
||||
pageData.value[showTab.value].case_item_question = [];
|
||||
}
|
||||
pageData.value[showTab.value].case_item_question.push({
|
||||
question_id: new Date().getTime(),
|
||||
question_id:'',
|
||||
is_right_next: 2,
|
||||
});
|
||||
};
|
||||
@ -348,6 +350,7 @@ const handleEdit = async (id) => {
|
||||
});
|
||||
if (code == 200) {
|
||||
ElMessage.success("保存成功");
|
||||
getDetail(case_id.value,showTab.value);
|
||||
} else {
|
||||
ElMessage.error(data.message);
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="题目类型:" prop="question_type">
|
||||
<el-select style="width:350px" v-model="modalForm.question_type" placeholder="请选择问题类型" @change="changeType">
|
||||
<el-select :disabled="modalForm.created_at" style="width:350px" v-model="modalForm.question_type" placeholder="请选择问题类型" @change="changeType">
|
||||
<el-option label="单选" :value="1" />
|
||||
<el-option label="多选" :value="2" />
|
||||
<el-option label="问答" :value="3" />
|
||||
@ -25,7 +25,7 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="题目名称:" prop="question_name">
|
||||
<el-input v-model="modalForm.question_name" style="width: 350px" placeholder="请输入题目名称" />
|
||||
<el-input :disabled="modalForm.created_at" v-model="modalForm.question_name" style="width: 350px" placeholder="请输入题目名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -37,6 +37,7 @@
|
||||
style="font-size: 14px"
|
||||
>
|
||||
<el-switch
|
||||
:disabled="modalForm.created_at"
|
||||
v-model="modalForm.is_right_next"
|
||||
:active-value="1"
|
||||
:inactive-value="2"
|
||||
@ -54,6 +55,7 @@
|
||||
>
|
||||
<el-input
|
||||
v-model="modalForm.error_tips"
|
||||
:disabled="modalForm.created_at"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 4 }"
|
||||
style="width: 800px"
|
||||
@ -65,7 +67,7 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="正确答案:" prop="question_answer">
|
||||
<el-input v-model.trim="modalForm.question_answer" style="width: 350px" placeholder="请输入正确答案" />
|
||||
<el-input :disabled="modalForm.created_at" v-model.trim="modalForm.question_answer" style="width: 350px" placeholder="请输入正确答案" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -73,7 +75,7 @@
|
||||
<el-row :gutter="20" v-for="(item,index) in modalForm.case_item_question_option" :key="item.option_id" v-if="modalForm.question_type==1 || modalForm.question_type==2">
|
||||
<el-col :span="20">
|
||||
<el-form-item :label="'选项'+alphabet[index]+':'" >
|
||||
<el-input v-model="item.option_value" style="width: 350px" placeholder="请输入选项内容" />
|
||||
<el-input :disabled="modalForm.created_at" v-model="item.option_value" style="width: 350px" placeholder="请输入选项内容" />
|
||||
</el-form-item>
|
||||
<el-icon v-if="index==0" size="18" style="margin-top: -8px;cursor: pointer;" @click="addSelect"><CirclePlus /></el-icon>
|
||||
<el-icon v-else size="18" color="red" style="margin-top: -8px;cursor: pointer;" @click="delSelect(index)"><Delete /></el-icon>
|
||||
@ -100,6 +102,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ref,reactive } from "vue";
|
||||
import { ElMessage } from 'element-plus'
|
||||
const props=defineProps({
|
||||
modalForm:{
|
||||
type:Object,
|
||||
@ -124,7 +127,13 @@
|
||||
});
|
||||
}
|
||||
const addSelect=()=>{
|
||||
if(props.modalForm.created_at){
|
||||
ElMessage.warning('禁止该操作');
|
||||
return false;
|
||||
}else{
|
||||
emits('handleAddSelect',props.qIndex)
|
||||
}
|
||||
|
||||
}
|
||||
const changeType=(val)=>{
|
||||
emits('handleChangeType',{
|
||||
@ -133,12 +142,18 @@ const changeType=(val)=>{
|
||||
})
|
||||
}
|
||||
const delSelect=(index)=>{
|
||||
if(props.modalForm.created_at){
|
||||
ElMessage.warning('禁止该操作');
|
||||
return false;
|
||||
}else{
|
||||
emits('handleDelSelect',{
|
||||
qIndex:props.qIndex,
|
||||
delIndex:index
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const delQusetion=(index)=>{
|
||||
emits('handleDelQusetion',{
|
||||
qIndex:props.qIndex,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user