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