fix:项目创建时间去除限制

This commit is contained in:
wuyx
2023-02-23 14:29:50 +08:00

View File

@@ -2,8 +2,7 @@
<template xmlns:display="http://www.w3.org/1999/xhtml">
<div class="projectAdd">
<div class="header">
<span class="title">{{
projectInfo.id ? "编辑" : "创建"
<span class="title">{{ projectInfo.id ? "编辑" : "创建"
}}{{ ptojectType == "3" ? "班级" : "项目" }}</span>
<div @click="backPage" style="cursor: pointer" to="/projectmanage" class="goback">
<span class="return"></span><span class="returntext">返回</span>
@@ -37,44 +36,45 @@
<div class="name flex-top">
<div class="namebox" style="margin-top: 10px">
<img class="nameimg" src="../../assets/images/basicinfo/asterisk.png" />
<div class="inname">封面图2</div>
<div class="inname">封面图</div>
</div>
<div class="in select" style="flex: 1; display: flex">
<div :class="`box ${projectInfo.picUrl === src.value ? 'active' : ''}`" style="
width: 100px;
height: 100px;
border-radius: 5px;
cursor: pointer;
position: relative;
overflow: hidden;
" v-for="(src, index) in projectPic" :style="{
display: index >= 3 ? 'none' : 'flex',
}" :key="index" @click="() => (projectInfo.picUrl = src.value)">
width: 100px;
height: 100px;
border-radius: 5px;
cursor: pointer;
position: relative;
overflow: hidden;
" v-for="(src, index) in projectPic" :style="{
display: index >= 3 ? 'none' : 'flex',
}" :key="index" @click="() => (projectInfo.picUrl = src.value)">
<img style="
width: 100px;
height: 100px;
margin-bottom: 4px;
margin-right: 4px;
" :src="src.value" alt="avatar" />
width: 100px;
height: 100px;
margin-bottom: 4px;
margin-right: 4px;
" :src="src.value" alt="avatar" />
</div>
<div @click="showLearnBgMore" v-if="projectPic.length > 3" style="
width: 100px;
height: 100px;
padding-left: 15px;
border-radius: 5px;
cursor: pointer;
position: relative;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid #c7cbd2;
font-size: 14px;
font-weight: 400;
color: #4ea6ff;
line-height: 36px;
">
查看更多 <img src="../../assets/images/projectadd/go.png" alt="" />
width: 100px;
height: 100px;
padding-left: 15px;
border-radius: 5px;
cursor: pointer;
position: relative;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid #c7cbd2;
font-size: 14px;
font-weight: 400;
color: #4ea6ff;
line-height: 36px;
">
查看更多
<img src="../../assets/images/projectadd/go.png" alt="" />
</div>
</div>
</div>
@@ -150,10 +150,10 @@
<!-- :disabled="viewDetail ? true : false" -->
<a-checkbox v-model:checked="courseSyncFlag" disabled>
<span style="
width: 100%;
color: rgba(109, 117, 132, 1);
font-size: 14px;
">
width: 100%;
color: rgba(109, 117, 132, 1);
font-size: 14px;
">
同步课程学习记录如学员在课程库中拥有课程的学习记录自动免修该课程
</span>
</a-checkbox>
@@ -162,10 +162,10 @@
<!-- :disabled="viewDetail ? true : false" -->
<a-checkbox v-model:checked="courseSyncFlag" disabled>
<span style="
width: 100%;
color: rgba(109, 117, 132, 1);
font-size: 14px;
">
width: 100%;
color: rgba(109, 117, 132, 1);
font-size: 14px;
">
同步课程学习记录如学员在课程库中拥有课程的学习记录自动免修该课程
</span>
</a-checkbox>
@@ -194,9 +194,10 @@
<div class="name">
<div class="inname" style="width: 50px">模版</div>
<div class="in select" style="margin-left: 2px">
<a-select :getPopupContainer="triggerNode => (triggerNode.parentNode || document.body)" placeholder="请选择模版"
style="width: 100%" :options="classifyList5" @change="classificationChange5" @popupScroll="templateScroll"
:fieldNames="{
<a-select :getPopupContainer="
(triggerNode) => triggerNode.parentNode || document.body
" placeholder="请选择模版" style="width: 100%" :options="classifyList5" @change="classificationChange5"
@popupScroll="templateScroll" :fieldNames="{
label: 'name',
value: 'id',
}">
@@ -225,11 +226,11 @@
v-for="item in projectPic"
:key="item.code"
class="learnBgItem"
> -->
> -->
<div @click="chooseImg2(item)" v-for="item in projectPic" :key="item.code" class="learnBgItem" :style="{
border:
pathBgId === item.code
? '2px solid rgba(78, 166, 255, 1)'
projectInfo.picUrl === item.value
? '3px solid rgba(78, 166, 255, 1)'
: '1px solid #ccc',
'background-image': 'url(' + item.value.split(',')[0] + ')',
}">
@@ -275,14 +276,14 @@ export default {
const routers = useRoute();
const router = useRouter();
const state = reactive({
datePartial: 'start',
datePartial: "start",
loading: false,
currentPage: 1, //当前页
tableDataTotal: -1, //模版列表总数
pageSize: 10, //每页10条数据
totalPages: 0, //总页数
viewDetail: null,
projectInfo: { id: '' },
projectInfo: { id: "" },
projectPic: [],
memberParam: {
pageNo: 1,
@@ -296,7 +297,8 @@ export default {
changeCondition: false,
clickNum: 0,
timeRange: [],
learnBgMore: false
learnBgMore: false,
pathBgId: null,
});
// 封面图选择
@@ -306,6 +308,7 @@ export default {
};
onMounted(() => {
state.projectPic = store.state.project_pic.map((e) => ({
code: e.id,
value: e.value,
label: e.name,
}));
@@ -313,7 +316,7 @@ export default {
getProjectInfo();
getTemplate();
state.ptojectType = routers.query.ptojectType;
// console.log("routers.query.ptojectType", routers.query.ptojectType);
console.log("获取封面图", state.projectPic);
});
watch(routers.query, () => {
@@ -329,8 +332,7 @@ export default {
(state.projectInfo.id || state.projectInfo.parentId) &&
api
.getProjectDetail({
projectId:
state.projectInfo.id || state.projectInfo.parentId,
projectId: state.projectInfo.id || state.projectInfo.parentId,
})
.then((res) => {
state.projectInfo = {
@@ -340,7 +342,10 @@ export default {
!routers.query.projectId &&
!!routers.query.parentId &&
(state.projectInfo.name = "");
state.timeRange = [state.projectInfo.beginTime, state.projectInfo.endTime];
state.timeRange = [
state.projectInfo.beginTime,
state.projectInfo.endTime,
];
state.courseSyncFlag = !!state.projectInfo.courseSyncFlag;
if (Number(state.projectInfo.status) === -5) {
let obj = {
@@ -375,8 +380,8 @@ export default {
const classificationChange5 = (key, option) => {
state.projectInfo = option;
state.projectInfo.projectTemplateId = option.id
state.projectInfo.id = ''
state.projectInfo.projectTemplateId = option.id;
state.projectInfo.id = "";
state.projectInfo.type = 3;
state.timeRange = [option.beginTime, option.endTime];
state.projectInfo.parentName = routers.query.parentName;
@@ -483,11 +488,13 @@ export default {
state.projectInfo.sourceBelongFullName = orgName;
}
const disabledDate = (current) => {
//编辑的时候 开始实际只能选当前时间之前的时间
if (state.projectInfo.id && state.datePartial === 'start') {
return current && current > dayjs(state.timeRange[0]).endOf("YYYY-MM-DD HH:mm");
if (state.projectInfo.id && state.datePartial === "start") {
return (
current &&
current > dayjs(state.timeRange[0]).endOf("YYYY-MM-DD HH:mm")
);
}
// 去除创建项目时间限制 可以选择创建时间之前的时间
// return current && current < dayjs().subtract(1, 'days').endOf('day')
@@ -502,13 +509,14 @@ export default {
state.learnBgMore = false;
};
function calendarChange(date, dateStr, partial) {
state.datePartial = partial
state.datePartial = partial;
}
const chooseImg2 = (item) => {
// console.log(item);
state.projectInfo.picUrl = item.value;
state.pathBgId = item.code;
state.pathBg = item.value.split(',')[0];
state.mobilePicUrl = item.value.split(',')[1];
state.pathBg = item.value.split(",")[0];
state.mobilePicUrl = item.value.split(",")[1];
};
return {
@@ -525,7 +533,7 @@ export default {
handleChangeSelect,
showLearnBgMore,
closeLearnBgMore,
chooseImg2
chooseImg2,
};
},
};
@@ -596,7 +604,7 @@ export default {
}
.active {
border: 2px solid rgba(78, 166, 255, 1);
border: 3px solid rgba(78, 166, 255, 1);
}
.content {