fix:查看评估题目图片

This commit is contained in:
wyx
2023-03-07 23:52:41 +08:00
parent 7fd172679b
commit b25d07e592

View File

@@ -41,17 +41,22 @@
</div>
</div>
<div>
<div class="box1" v-for="(itteems, indexss) in values.assessmentSingleChoiceVoList" style="margin-left: 55px; margin-top: 20px" :key="indexss">
<div class="asstype">选择{{indexss+1}}</div>
<div style="display:flex;justify-content:center;align-items:center;">
<div v-if="itteems.select" style="display:flex;justify-content:center;align-items:center;width:16px;height:16px;border-radius:8px;border:1px solid rgba(151, 151, 151, 0.29);margin-right: 8px;">
<div style="width:8px;height:8px;border-radius:4px;background-color:#409eff;"></div>
<div class="box1" v-for="(itteems, indexss) in values.assessmentSingleChoiceVoList" style="margin-left: 55px; margin-top: 20px; flex-direction:column; justify-content:flex-start;align-items:flex-start;" :key="indexss">
<div style="display:flex;">
<div class="asstype">选择{{indexss+1}}</div>
<div style="display:flex;justify-content:center;align-items:center;">
<div v-if="itteems.select" style="display:flex;justify-content:center;align-items:center;width:16px;height:16px;border-radius:8px;border:1px solid rgba(151, 151, 151, 0.29);margin-right: 8px;">
<div style="width:8px;height:8px;border-radius:4px;background-color:#409eff;"></div>
</div>
<div v-else style="width:16px;height:16px;border-radius:8px;border:1px solid rgba(151, 151, 151, 0.29);margin-right: 8px;"></div>
{{itteems.singleOptionName}}
</div>
<div v-else style="width:16px;height:16px;border-radius:8px;border:1px solid rgba(151, 151, 151, 0.29);margin-right: 8px;"></div>
{{itteems.singleOptionName}}
</div>
<img v-if="itteems?.singleOptionPictureAddress" :src="itteems?.singleOptionPictureAddress" alt="" srcset="" style="width: 140px;height:140px;margin-top:5px;">
<div v-else-if="isExistImg(values.assessmentSingleChoiceVoList, 1)" style="width: 140px;height:140px;margin-top:5px;"></div>
<!-- <a-radio :value="indexs" defaultValue>{{iitem.singleOptionName}}</a-radio> -->
</div>
</div>
<div style="margin-bottom:30px;"></div>
</div>
@@ -68,15 +73,19 @@
</div>
</div>
<div>
<div class="box1" v-for="(itteems, indexss) in values.multipleChoiceVoList" style="margin-left: 55px; margin-top: 20px" :key="indexss">
<div class="asstype">选择{{indexss+1}}</div>
<div style="display:flex;justify-content:center;align-items:center;">
<div v-if="itteems.select" style="display:flex;justify-content:center;align-items:center;width:16px;height:16px;border-radius:8px;border:1px solid rgba(151, 151, 151, 0.29);margin-right: 8px;">
<div style="width:8px;height:8px;border-radius:4px;background-color:#409eff;"></div>
<div class="box1" v-for="(itteems, indexss) in values.multipleChoiceVoList" style="margin-left: 55px; margin-top: 20px; flex-direction:column; justify-content:flex-start;align-items:flex-start;" :key="indexss">
<div style="display:flex;">
<div class="asstype">选择{{indexss+1}}</div>
<div style="display:flex;justify-content:center;align-items:center;">
<div v-if="itteems.select" style="display:flex;justify-content:center;align-items:center;width:16px;height:16px;border-radius:8px;border:1px solid rgba(151, 151, 151, 0.29);margin-right: 8px;">
<div style="width:8px;height:8px;border-radius:4px;background-color:#409eff;"></div>
</div>
<div v-else style="width:16px;height:16px;border-radius:8px;border:1px solid rgba(151, 151, 151, 0.29);margin-right: 8px;"></div>
{{itteems.multipleOptionName}}
</div>
<div v-else style="width:16px;height:16px;border-radius:8px;border:1px solid rgba(151, 151, 151, 0.29);margin-right: 8px;"></div>
{{itteems.multipleOptionName}}
</div>
<img v-if="itteems?.multipleOptionPictureAddress" :src="itteems?.multipleOptionPictureAddress" alt="" srcset="" style="width: 140px;height:140px;margin-top:5px;">
<div v-else-if="isExistImg(values.multipleChoiceVoList, 2)" style="width: 140px;height:140px;margin-top:5px;"></div>
<!-- <a-radio :value="indexs" defaultValue>{{iitem.singleOptionName}}</a-radio> -->
</div>
</div>
@@ -217,10 +226,31 @@ export default {
}
};
// 判断当前题目中是否有的选项有图片有的没有
const isExistImg = (data, index) => {
let exist = false;
data.forEach((i,n)=>{
console.log(i,n)
if(index==1){
if(i.singleOptionPictureAddress){
exist = true;
return exist;
}
}else{
if(i.multipleOptionPictureAddress){
exist = true;
return exist;
}
}
})
return exist;
}
return {
...toRefs(state),
afterVisibleChange,
closeDrawer,
isExistImg
// change,
};
},