This commit is contained in:
yuping
2023-02-19 16:00:54 +08:00
parent 0382af8507
commit ecacb0c980

View File

@@ -98,33 +98,19 @@
<div class="inname">项目时间</div>
</div>
<div v-if="projectInfo.projectId" class="in">
<div class="in">
<a-range-picker
separator="至"
:show-time="{ format: 'HH:mm' }"
:placeholder="[' 开始时间', ' 结束时间']"
:disabled-date="disabledDate1"
:placeholder="[' 开始时间2', ' 结束时间2']"
:disabledDate="disabledDate"
v-model:value="projectInfo.rangeTime"
@calendarChange="calendarChange"
style="width: 100%; height: 40px; border-radius: 5px"
:allowClear="false"
valueFormat="YYYY-MM-DD HH:mm"
@change="timeChange"
@ok="clickOk"
@openChange="panelOpen"
:disabled="viewDetail ? true : false"
/>
</div>
<div v-else class="in">
<a-range-picker
separator="至"
:show-time="{ format: 'HH:mm' }"
:placeholder="[' 开始时间', ' 结束时间']"
v-model:value="projectInfo.rangeTime"
style="width: 100%; height: 40px; border-radius: 5px"
valueFormat="YYYY-MM-DD HH:mm"
@change="timeChange"
:disabled="viewDetail ? true : false"
:disabled="!!viewDetail"
/>
</div>
</div>
@@ -330,13 +316,14 @@ export default {
const routers = useRoute();
const router = useRouter();
const state = reactive({
datePartial: 'start',
loading: false,
currentPage: 1, //当前页
tableDataTotal: -1, //模版列表总数
pageSize: 10, //每页10条数据
totalPages: 0, //总页数
viewDetail: null,
projectInfo: {},
projectInfo: {id: ''},
projectPic: [],
memberParam: {
pageNo: 1,
@@ -397,13 +384,6 @@ export default {
state.projectInfo.endTime,
];
state.projectInfo.rangeTime1 = [
state.projectInfo.beginTime,
state.projectInfo.endTime,
];
state.projectInfo.edits = true;
state.courseSyncFlag = !!state.projectInfo.courseSyncFlag;
if (Number(state.projectInfo.status) === -5) {
let obj = {
@@ -546,44 +526,24 @@ export default {
state.projectInfo.sourceBelongFullName = orgName;
}
const clickOk = (e) => {
state.clickNum = state.clickNum + 1
if (state.clickNum == 2) {
state.clickNum = 0
state.changeCondition = false;
} else {
state.changeCondition = true;
}
console.log(e)
}
const panelOpen = (e) => {
console.log(e)
if (!e) {
state.clickNum = 0
state.changeCondition = false;
}
}
const disabledDate1 = (current) => {
if (state.changeCondition) {
return current && current < moment(state.projectInfo.rangeTime[0]).endOf("YYYY-MM-DD HH:mm:ss");
} else {
return current && current > moment(state.projectInfo.rangeTime1[0]).endOf("YYYY-MM-DD HH:mm:ss")
}
};
const disabledDate = (current) => {
return current && current < dayjs().startOf("day");
//编辑的时候 开始实际只能选当前时间之前的时间
if (state.projectInfo.projectId && state.datePartial === 'start') {
return current && current > dayjs(state.projectInfo?.rangeTime[0]).endOf("YYYY-MM-DD HH:mm");
}
return current && current < dayjs().endOf('day');
};
function calendarChange(date, dateStr, partial) {
state.datePartial = partial
}
return {
...toRefs(state),
disabledDate,
disabledDate1,
clickOk,
panelOpen,
managerChange,
calendarChange,
timeChange,
classificationChange,
classificationChange5,