mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-15 05:46:45 +08:00
fix:评估管理-单选题-多选题-问答题-评分提编辑删除选项保存修改bug修复
This commit is contained in:
@@ -56,7 +56,7 @@
|
||||
<script>
|
||||
import { ref } from "vue";
|
||||
import ResearchAddItem from "./ResearchAddItem.vue";
|
||||
import { deleteChoiceQuestion } from "@/api/indexResearch";
|
||||
// import { deleteChoiceQuestion } from "@/api/indexResearch";
|
||||
|
||||
export default {
|
||||
name: "ResearchAddSingle",
|
||||
@@ -104,32 +104,44 @@ export default {
|
||||
}
|
||||
});
|
||||
};
|
||||
const del = ({ id, optionId }) => {
|
||||
const del = ({ id, optionId}) => {
|
||||
// 接口删除
|
||||
// if (assessmentId.value && optionId) {
|
||||
// deleteChoiceQuestion({
|
||||
// assessmentId: assessmentId.value,
|
||||
// questionType: "1",
|
||||
// optionId,
|
||||
// }).then((res) => {
|
||||
// if (res.data.code === 200) {
|
||||
// virtualDel(id);
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
// virtualDel(id);
|
||||
// }
|
||||
if (assessmentId.value && optionId) {
|
||||
deleteChoiceQuestion({
|
||||
assessmentId: assessmentId.value,
|
||||
questionType: "1",
|
||||
optionId,
|
||||
}).then((res) => {
|
||||
if (res.data.code === 200) {
|
||||
virtualDel(id);
|
||||
}
|
||||
});
|
||||
virtualDel(id);
|
||||
} else {
|
||||
virtualDel(id);
|
||||
}
|
||||
};
|
||||
const virtualDel = (id) => {
|
||||
// 前端删除
|
||||
// curItem.value.singleList.forEach((item, index) => {
|
||||
// if (item.id === id) {
|
||||
// curItem.value.singleList.splice(index, 1);
|
||||
// }
|
||||
// });
|
||||
// curItem.value.singleList.map((item, index) => {
|
||||
// item.id = index + 1;
|
||||
// });
|
||||
|
||||
// 前端删除
|
||||
curItem.value.singleList.forEach((item, index) => {
|
||||
if (item.id === id) {
|
||||
curItem.value.singleList.splice(index, 1);
|
||||
curItem.value.singleList[index].deleted = true;
|
||||
}
|
||||
});
|
||||
curItem.value.singleList.map((item, index) => {
|
||||
item.id = index + 1;
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user