mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-17 23:06:47 +08:00
-- fix bug
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({},'add')" style="margin-left: 19px">
|
<div class="btn btn3" @click="showModal()" 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,'edit')"></div>
|
<div class="imgIcon" @click="showEditModal(element)"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="boxs_right">
|
<div class="boxs_right">
|
||||||
<div class="imgIcon" @click="deleteChapter"></div>
|
<div class="imgIcon" @click="deleteChapter"></div>
|
||||||
@@ -376,7 +376,6 @@ 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,18 +407,14 @@ watch(() => routerInfo.value.chapterList, () => {
|
|||||||
});
|
});
|
||||||
}, { deep: true });
|
}, { deep: true });
|
||||||
|
|
||||||
const showModal = (e, type) => {
|
const showModal = () => {
|
||||||
ischapterEdit.value = (type === "edit");
|
formValue.value = {};
|
||||||
console.log(ischapterEdit.value);
|
|
||||||
if (type == "edit") {
|
|
||||||
console.log("关卡信息:" + e.name);
|
|
||||||
formValue.value = e;//回传修改的信息
|
|
||||||
} else {
|
|
||||||
//关卡信息初始化
|
|
||||||
formValue.value = {};
|
|
||||||
}
|
|
||||||
modal.value = true;
|
modal.value = true;
|
||||||
};
|
};
|
||||||
|
function showEditModal(ele){
|
||||||
|
formValue.value =ele;
|
||||||
|
modal.value = false;
|
||||||
|
}
|
||||||
const closeModal = () => {
|
const closeModal = () => {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
};
|
};
|
||||||
@@ -429,11 +424,12 @@ const editChapter = () => {
|
|||||||
if (!formValue.value.name) {
|
if (!formValue.value.name) {
|
||||||
return message.warning("请输入关卡名称");
|
return message.warning("请输入关卡名称");
|
||||||
}
|
}
|
||||||
if (ischapterEdit.value) {
|
if(formValue.value.id){
|
||||||
routerInfo.value.chapterList = [{ ...formValue.value, draftTaskList: [] }];
|
closeModal();
|
||||||
} else {
|
return
|
||||||
routerInfo.value.chapterList.push({ ...formValue.value, draftTaskList: [] });
|
|
||||||
}
|
}
|
||||||
|
routerInfo.value.chapterList.push({ ...formValue.value, draftTaskList: [] });
|
||||||
|
activeIndex.value = activeIndex.value + 1
|
||||||
formValue.value = { draftTaskList: [] };
|
formValue.value = { draftTaskList: [] };
|
||||||
closeModal();
|
closeModal();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user