feat:合并

This commit is contained in:
lixg
2023-03-02 19:05:04 +08:00
4 changed files with 25 additions and 20 deletions

View File

@@ -210,7 +210,7 @@ async function confirm() {
} else {
const data = props.taskList[taskIndex.value];
data.name = formData.value.evaluationName;
data.info = formData.value;
data.info = {...formData.value};
data.duration = dayjs(formData.value.evaluationEndTime).diff(
formData.value.evaluationStartTime,
"minutes"

View File

@@ -138,7 +138,7 @@ function confirm() {
} else {
const data = props.taskList[taskIndex.value]
data.name = formData.value.workName
data.info = formData.value
data.info = {...formData.value}
data.duration = dayjs(formData.value.submitEndTime).diff(formData.value.submitStartTime,'minutes')
}
emit('update:taskList', [...props.taskList])

View File

@@ -4,7 +4,7 @@
<div class="left clearfix">
<div class="leftmain">
<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="btnText">添加关卡</div>
</div>
@@ -33,7 +33,7 @@
</div>
</div>
</a-popover>
<div class="imgIcon" @click="showModal(element,'edit')"></div>
<div class="imgIcon" @click="showEditModal(element)"></div>
</div>
<div class="boxs_right">
<div class="imgIcon" @click="deleteChapter"></div>
@@ -376,7 +376,6 @@ import dialog from "@/utils/dialog";
const { query: { routerId } } = useRoute();
const modal = ref(false);
const ischapterEdit = ref(false);
const visiblene = ref(false);
const cancleLoading = ref(false);
const confirmLoading = ref(false);
@@ -408,18 +407,14 @@ watch(() => routerInfo.value.chapterList, () => {
});
}, { deep: true });
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 = {};
}
const showModal = () => {
formValue.value = {draftTaskList: []}
modal.value = true;
};
function showEditModal(ele){
formValue.value =ele;
modal.value = true;
}
const closeModal = () => {
modal.value = false;
};
@@ -429,11 +424,12 @@ const editChapter = () => {
if (!formValue.value.name) {
return message.warning("请输入关卡名称");
}
if (ischapterEdit.value) {
routerInfo.value.chapterList = [{ ...formValue.value, draftTaskList: [] }];
} else {
routerInfo.value.chapterList.push({ ...formValue.value, draftTaskList: [] });
if(formValue.value.id){
closeModal();
return
}
routerInfo.value.chapterList.push({ ...formValue.value, draftTaskList: [] });
activeIndex.value = activeIndex.value + 1
formValue.value = { draftTaskList: [] };
closeModal();
};

View File

@@ -35,7 +35,7 @@
<span style="font-size: 12px; color: #ffffff">说明</span>
</div>
</a-popover>
<div class="imgIcon" @click="showModal(index)"></div>
<div class="imgIcon" @click="editModal(index)"></div>
</div>
<div class="boxs_right">
<div class="imgIcon" @click="deleteStage(index)"></div>
@@ -513,6 +513,11 @@ const closeModal = () => {
};
//显示添加阶段弹窗
const showModal = () => {
formValue.value = {taskDraftDtoList: []}
stage.value = true
};
const editModal = () => {
formValue.value = projectInfo.value.stageList[activeIndex.value]
stage.value = true
};
@@ -522,6 +527,10 @@ function editStage() {
message.warning("请输入阶段名称!");
return
}
if(formValue.value.id){
stage.value = false
return
}
//替换 默认阶段
if (projectInfo.value.stageList.length === 1 && projectInfo.value.stageList[0].id === '0') {
formValue.value.taskDraftDtoList = [...projectInfo.value.stageList[0].taskDraftDtoList]