mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-13 04:46:46 +08:00
删除交互修复
This commit is contained in:
@@ -36,7 +36,10 @@
|
|||||||
<div class="main_item">
|
<div class="main_item">
|
||||||
<div class="signbox">
|
<div class="signbox">
|
||||||
<div class="sign">
|
<div class="sign">
|
||||||
<img src="@/assets/images/coursewareManage/asterisk.png" alt="" />
|
<img
|
||||||
|
src="@/assets/images/coursewareManage/asterisk.png"
|
||||||
|
alt="asterisk"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<span>创建题干:</span>
|
<span>创建题干:</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -252,24 +255,24 @@ export default {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleDel = ({ id, curItem }) => {
|
const handleDel = ({ id, curItem }) => {
|
||||||
console.log(888888888);
|
|
||||||
console.log(id);
|
|
||||||
console.log(curItem);
|
|
||||||
// 接口删除
|
// 接口删除
|
||||||
if (curItem.voteStemId) {
|
if (curItem.voteStemId) {
|
||||||
api.deleteVoteStem(curItem.voteStemId).then((res) => {
|
api.deleteVoteStem(curItem.voteStemId).then((res) => {
|
||||||
console.log(56444);
|
if (res.data.code === 200) {
|
||||||
console.log(res);
|
virtualDel(id);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
virtualDel();
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
const virtualDel = (id) => {
|
||||||
// 前端删除
|
// 前端删除
|
||||||
state.allFormsData.forEach((item, index) => {
|
state.allFormsData.forEach((item, index) => {
|
||||||
if (item.id === id) {
|
if (item.id === id) {
|
||||||
state.allFormsData.splice(index, 1);
|
state.allFormsData.splice(index, 1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log(5656777777777);
|
|
||||||
console.log(state.allFormsData);
|
|
||||||
state.allFormsData.map((item, index) => {
|
state.allFormsData.map((item, index) => {
|
||||||
item.id = index + 1;
|
item.id = index + 1;
|
||||||
return item;
|
return item;
|
||||||
|
|||||||
@@ -421,8 +421,9 @@ export default {
|
|||||||
questionType: "1",
|
questionType: "1",
|
||||||
orderNumber: curItem.orderNumber,
|
orderNumber: curItem.orderNumber,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log(56444);
|
if (res.data.code === 200) {
|
||||||
console.log(res);
|
virtualDel(id);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (type === 2) {
|
if (type === 2) {
|
||||||
@@ -431,8 +432,9 @@ export default {
|
|||||||
questionType: "2",
|
questionType: "2",
|
||||||
orderNumber: curItem.orderNumber,
|
orderNumber: curItem.orderNumber,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log(56444);
|
if (res.data.code === 200) {
|
||||||
console.log(res);
|
virtualDel(id);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (type === 3) {
|
if (type === 3) {
|
||||||
@@ -441,8 +443,9 @@ export default {
|
|||||||
questionType: "3",
|
questionType: "3",
|
||||||
optionId: curItem.optionId,
|
optionId: curItem.optionId,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log(56444);
|
if (res.data.code === 200) {
|
||||||
console.log(res);
|
virtualDel(id);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (type === 4) {
|
if (type === 4) {
|
||||||
@@ -451,11 +454,16 @@ export default {
|
|||||||
questionType: "4",
|
questionType: "4",
|
||||||
optionId: curItem.optionId,
|
optionId: curItem.optionId,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log(56444);
|
if (res.data.code === 200) {
|
||||||
console.log(res);
|
virtualDel(id);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
virtualDel();
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
const virtualDel = (id) => {
|
||||||
// 前端删除
|
// 前端删除
|
||||||
state.allFormsData.forEach((item, index) => {
|
state.allFormsData.forEach((item, index) => {
|
||||||
if (item.id === id) {
|
if (item.id === id) {
|
||||||
|
|||||||
@@ -112,10 +112,15 @@ export default {
|
|||||||
questionType: "1",
|
questionType: "1",
|
||||||
optionId,
|
optionId,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log(56444);
|
if (res.data.code === 200) {
|
||||||
console.log(res);
|
virtualDel(id);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
virtualDel(id);
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
const virtualDel = (id) => {
|
||||||
// 前端删除
|
// 前端删除
|
||||||
curItem.value.singleList.forEach((item, index) => {
|
curItem.value.singleList.forEach((item, index) => {
|
||||||
if (item.id === id) {
|
if (item.id === id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user