mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-17 06:46:46 +08:00
fix: 更新编辑关卡时没有加载关卡信息等
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
<div class="left clearfix">
|
<div class="left clearfix">
|
||||||
<div class="leftmain">
|
<div class="leftmain">
|
||||||
<div class="tit" style="margin-left: 18px">关卡</div>
|
<div class="tit" style="margin-left: 18px">关卡</div>
|
||||||
<div class="btn btn3" @click="showModal()" style="margin-left: 19px">
|
<div class="btn btn3" @click="showModal({},'add')" style="margin-left: 19px">
|
||||||
<div class="search"></div>
|
<div class="search"></div>
|
||||||
<div class="btnText">添加关卡</div>
|
<div class="btnText">添加关卡</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a-popover>
|
</a-popover>
|
||||||
<div class="imgIcon" @click="showModal(element)"></div>
|
<div class="imgIcon" @click="showModal(element,'edit')"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="boxs_right">
|
<div class="boxs_right">
|
||||||
<div class="imgIcon" @click="deleteChapter"></div>
|
<div class="imgIcon" @click="deleteChapter"></div>
|
||||||
@@ -376,6 +376,7 @@ import dialog from "@/utils/dialog";
|
|||||||
|
|
||||||
const {query: {routerId}} = useRoute();
|
const {query: {routerId}} = useRoute();
|
||||||
const modal = ref(false)
|
const modal = ref(false)
|
||||||
|
const ischapterEdit = ref(false)
|
||||||
const visiblene = ref(false)
|
const visiblene = ref(false)
|
||||||
const cancleLoading = ref(false)
|
const cancleLoading = ref(false)
|
||||||
const confirmLoading = ref(false)
|
const confirmLoading = ref(false)
|
||||||
@@ -408,7 +409,16 @@ watch(() => routerInfo.value.chapterList, () => {
|
|||||||
})
|
})
|
||||||
}, {deep: true})
|
}, {deep: true})
|
||||||
|
|
||||||
const showModal = () => {
|
const showModal = (e,type) => {
|
||||||
|
ischapterEdit.value = (type === "edit");
|
||||||
|
console.log(ischapterEdit.value)
|
||||||
|
if(type == 'edit'){
|
||||||
|
console.log("关卡信息:" + e.name);
|
||||||
|
formValue.value = e;//回传修改的信息
|
||||||
|
}else{
|
||||||
|
//关卡信息初始化
|
||||||
|
formValue.value = {};
|
||||||
|
}
|
||||||
modal.value = true;
|
modal.value = true;
|
||||||
};
|
};
|
||||||
const closeModal = () => {
|
const closeModal = () => {
|
||||||
@@ -420,10 +430,16 @@ const editChapter = () => {
|
|||||||
if (!formValue.value.name) {
|
if (!formValue.value.name) {
|
||||||
return message.warning("请输入关卡名称");
|
return message.warning("请输入关卡名称");
|
||||||
}
|
}
|
||||||
|
if(ischapterEdit.value){
|
||||||
|
routerInfo.value.chapterList = [{...formValue.value, draftTaskList: []}];
|
||||||
|
}
|
||||||
|
else{
|
||||||
routerInfo.value.chapterList.push({...formValue.value, draftTaskList: []})
|
routerInfo.value.chapterList.push({...formValue.value, draftTaskList: []})
|
||||||
|
}
|
||||||
formValue.value = {draftTaskList: []}
|
formValue.value = {draftTaskList: []}
|
||||||
closeModal()
|
closeModal()
|
||||||
};
|
};
|
||||||
|
|
||||||
//删除关卡
|
//删除关卡
|
||||||
const deleteChapter = () => {
|
const deleteChapter = () => {
|
||||||
dialog({
|
dialog({
|
||||||
|
|||||||
Reference in New Issue
Block a user