--fix bug

This commit is contained in:
yuping
2023-02-18 01:17:34 +08:00
parent 9555c4c40b
commit 29c1b14f6c

View File

@@ -3,7 +3,8 @@
<div class="projectAdd">
<div class="header">
<span class="title"
>{{ projectInfo.projectId ? "编辑" : "创建"
>{{
projectInfo.projectId ? "编辑" : "创建"
}}{{ ptojectType == "3" ? "班级" : "项目" }}</span
>
<div
@@ -266,20 +267,15 @@
<div class="inname" style="width: 50px">模版</div>
<div class="in select" style="margin-left: 2px">
<a-select
:getPopupContainer="
(triggerNode) => {
return triggerNode.parentNode || document.body;
}
"
:getPopupContainer="triggerNode => (triggerNode.parentNode || document.body)"
placeholder="请选择模版"
:size="size"
style="width: 100%"
:options="classifyList5"
@change="classificationChange5"
@popupScroll="templateScroll"
:fieldNames="{
label: 'name',
value: 'projectTemplateId',
value: 'id',
}"
>
</a-select>
@@ -437,14 +433,15 @@ export default {
//选择分类
const classificationChange = (value) => {
console.log(`selected ${value}`);
state.projectType = value; //分类选择的id
};
const classificationChange5 = (key, option) => {
state.projectInfo = option;
state.projectInfo.projectTemplateId = option.id
state.projectInfo.id = ''
state.projectInfo.type = 3;
state.projectInfo.rangeTime = [option.beginTime, option.endTime];
state.projectInfo.rangeTime = [dayjs(option.beginTime, "YYYY-MM-DD HH:mm"), dayjs(option.endTime, "YYYY-MM-DD HH:mm")];
state.projectInfo.parentName = routers.query.parentName;
state.projectInfo.parentId = routers.query.parentId;
};
@@ -508,6 +505,7 @@ export default {
state.loading = true;
console.log("保存", state.projectInfo);
if (!validate(state.projectInfo, errorMsgs)) {
state.loading = false;
return;
}
/**
@@ -525,6 +523,7 @@ export default {
});
if (offName) {
message.destroy();
state.loading = false;
return message.warning("项目名称重复,请重新填写");
}
state.projectInfo.type = 3;
@@ -535,7 +534,7 @@ export default {
message.success(state.projectInfo.projectId ? "编辑成功" : "创建成功");
router.push({
path: "/taskpage",
query: { projectId: res.data.data },
query: {projectId: res.data.data},
});
});
};
@@ -549,10 +548,10 @@ export default {
const clickOk = (e) => {
state.clickNum = state.clickNum + 1
if(state.clickNum==2) {
if (state.clickNum == 2) {
state.clickNum = 0
state.changeCondition = false;
}else{
} else {
state.changeCondition = true;
}
console.log(e)
@@ -560,18 +559,16 @@ export default {
const panelOpen = (e) => {
console.log(e)
if(!e){
if (!e) {
state.clickNum = 0
state.changeCondition = false;
}
}
const disabledDate1 = (current) => {
// return current && current < dayjs().startOf("day");
console.log(state.projectInfo.rangeTime1)
if(state.changeCondition){
if (state.changeCondition) {
return current && current < moment(state.projectInfo.rangeTime[0]).endOf("YYYY-MM-DD HH:mm:ss");
}else{
} else {
return current && current > moment(state.projectInfo.rangeTime1[0]).endOf("YYYY-MM-DD HH:mm:ss")
}
};
@@ -603,6 +600,7 @@ export default {
.ant-checkbox-disabled.ant-checkbox-checked .ant-checkbox-inner::after {
border-color: #fff !important;
}
.ant-checkbox-disabled .ant-checkbox-inner {
background-color: #1890ff !important;
}