提交 7e2a9a02 编写于 作者: xiaoping.di's avatar xiaoping.di

paiban

上级 21cf7ddf
......@@ -332,3 +332,17 @@
word-wrap: break-word;
white-space: normal;
}
/deep/.fc-col-header-cell-cushion {
background: #fff;
border: 1px solid #0d9078;
color: #0d9078;
border-radius: 20px;
height: 30px;
line-height: 25px;
font-size: 14px;
margin: 10px 0;
text-decoration: none;
}
/deep/a:hover {
text-decoration: none;
}
......@@ -188,6 +188,8 @@
selectMinDistance: 0,
eventResize: this.eventResize,
eventOverlap: false,
navLinks: true,
navLinkDayClick: this.navLinkDayClick,
// eventDurationEditable:false,
eventDrop: this.eventDrop,
editable: true,
......@@ -325,6 +327,42 @@
}
});
},
navLinkDayClick(date) {
const day = dayjs(date).day();
const dayDate = dayjs(date).date();
const dayFormat = dayjs(date).format('YYYY-MM-DD');
let isAddAllDay = true;
const data = this.calendarOptions.events;
const len = data.length;
for (var i = 0; i < len; i++) {
const itemDay = dayjs(data[i].start).day();
if (!data[i].constraint && day === itemDay) {
data[i].allStatus && (isAddAllDay = false);
const index = this.getIdDeleteData(data[i].id);
this.isDoIt = true;
this.calendarOptions.events.splice(index, 1);
i--;
}
}
if (isAddAllDay) {
// 添加日期
const list = [
{ startTime: '09:00:00', endTime: '12:00:00' },
{ startTime: '13:00:00', endTime: '17:00:00' },
{ startTime: '18:00:00', endTime: '21:00:00' },
];
list.forEach((item) => {
const obj = {};
obj.id = dayDate + (this.calendarOptions.events.length + 1) * 10;
obj.week = this.week;
obj.end = dayFormat + ' ' + item.endTime;
obj.start = dayFormat + ' ' + item.startTime;
obj.allStatus = true;
console.log(obj);
this.calendarOptions.events.push(obj);
});
}
},
getCopyData(data) {
const copyList = [];
const addDay = 7;
......@@ -437,9 +475,9 @@
console.log(list, 'obj', this.getEveryDay);
},
handleDatesSet(dataInfo) {
this.getEveryDay = dayjs(dataInfo.startStr).format('YYYY-MM-DD HH:mm:ss');
this.getEveryDay = dayjs(dataInfo.start).format('YYYY-MM-DD HH:mm:ss');
const currentTime = new Date().getTime(); // 今天的时间戳
const getTime = new Date(dataInfo.startStr).getTime(); // 每周周一的时间戳
const getTime = new Date(dataInfo.start).getTime(); // 每周周一的时间戳
const cz = currentTime - getTime; // 每周周一时间戳 - 今天的时间
const oneHour = 1 * 60 * 60 * 1000 * 24; // 一天的时间戳
const timeDifference = (cz / oneHour) | 0; // 每周一时间距离今天时间数量
......@@ -475,10 +513,6 @@
}
},
eventResize(event) {
console.log(event, 'eventevent');
// if(){
// }
const index = this.getIdDeleteData(event.event.id);
const oldData = this.calendarOptions.events;
const keyAll = Object.keys(oldData[index]);
......@@ -498,7 +532,6 @@
return;
}
console.log(event, event, 'iiiieventeventevent');
this.$confirm('你要取消日期吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
......@@ -549,40 +582,8 @@
},
selectInfo(info) {
console.log(info, 'infoinfoinfo');
// const startDay = new Date(info.start).getDay();
// const endDay = new Date(info.end).getDay();
// const startHour = new Date(info.start).hour();
// const endHour = new Date(info.end).hour();
// const chooseStartH = new Date(info.start).getHours();
// const chooseEndH = new Date(info.end).getHours();
// // const startH = 9;
// const middleH = 12;
// // const middleEH = 18;
// const endH = 21;
// const timeList = [];
// const timeObj = {};
// if (chooseStartH < middleH && chooseEndH >= endH ) {
// console.log(chooseStartH, chooseEndH, 'endDayendDayendDayendDay1111');
// timeList.push(
// {
// start:'2021-11-25 09:00:00',
// end:'2021-11-25 12:00:00'
// },
// {
// start:'2021-11-25 13:00:00',
// end:'2021-11-25 17:00:00'
// },
// {
// start:'2021-11-25 18:00:00',
// end:'2021-11-25 21:00:00'
// }
// );
// }
// this.calendarOptions.events = timeList;
// if (startDay != endDay) {
// return this.$toast('不能夸天选择排班');
// }
const id = (this.calendarOptions.events.length + 1) * 10;
const day = dayjs(info.start).date();
const id = day + (this.calendarOptions.events.length + 1) * 10;
info.id = id;
const keyAll = ['end', 'endStr', 'id', 'start', 'startStr', 'week'];
const dataObj = {};
......@@ -595,6 +596,11 @@
});
console.log(dataObj, 'dataObjdataObj');
this.calendarOptions.events.push(dataObj);
// this.calendarOptions.events.forEach(item=>{
// if(!item.constraint){
// console.log(item.id);
// }
// });
},
selectAllow(info) {
this.isDoIt = true;
......@@ -605,10 +611,6 @@
if (startDay != endDay) {
return false;
}
// if (dayjs(info.start).format('YYYY-MM-DD HH:mm:ss').split(' ')[1] == '12:00:00' || dayjs(info.start).format('YYYY-MM-DD HH:mm:ss').split(' ')[1] == '17:00:00') {
// return false;
// }
if (startHour == 12 || startHour == 17) {
return false;
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册