提交 35474710 编写于 作者: qian.jie's avatar qian.jie

Merge branch 'feature/jq_1' of...

Merge branch 'feature/jq_1' of 192.168.110.53:com.pica.cloud.education.frontend/pica-admin-consultation into feature/jq_1
......@@ -40,7 +40,7 @@
</el-button>
</div>
<FullCalendar
ref="Calendar"
ref="fullCalendar"
:options="calendarOptions"
class="FullCalendar"
/>
......@@ -87,23 +87,28 @@
currentIndex: 3,
haveWeek: [1],
calendarOptions: {
plugins: [dayGridPlugin, interactionPlugin, timeGridPlugin, resourceTimeGridPlugin],
plugins: [
dayGridPlugin,
interactionPlugin,
timeGridPlugin,
resourceTimeGridPlugin,
],
timeZone: 'UTC',
schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives',
initialView: 'resourceTimeGridDay',
resources: [
// { id: 'a', title: 'Room A' },
// { id: 'b', title: 'Room B'},
// { id: 'c', title: 'Room C' },
// { id: 'd', title: 'Room D' }
// { id: 'a', title: 'Room A' },
// { id: 'b', title: 'Room B'},
// { id: 'c', title: 'Room C' },
// { id: 'd', title: 'Room D' }
],
eventColor: '#fff',
eventBackgroundColor: '#fff',
events: [
// { id: '1', resourceId: 'a', start: '2021-10-30 14:30:00', end: '2021-10-30 15:30:00' },
// { id: '2', resourceId: 'b', start: '2021-10-30 14:30:00', end: '2021-10-30 15:30:00' },
// { id: '3', resourceId: 'c', start: '2021-10-30 14:30:00', end: '2021-10-30 15:30:00'},
// { id: '4', resourceId: 'd', start: '2021-10-30 14:30:00', end: '2021-10-30 15:30:00' },
// { id: '1', resourceId: 'a', start: '2021-11-01 14:30:00', end: '2021-11-01 15:30:00', color:'#aaccee' },
// { id: '2', resourceId: 'b', start: '2021-10-30 14:30:00', end: '2021-10-30 15:30:00', color:'#aaccee' },
// { id: '3', resourceId: 'c', start: '2021-10-30 14:30:00', end: '2021-10-30 15:30:00', color:'#aaccee' },
// { id: '4', resourceId: 'd', start: '2021-10-30 14:30:00', end: '2021-10-30 15:30:00', color:'#aaccee' },
],
allDaySlot: false, // 周,日视图时,all-day 不显示
slotDuration: '00:05:00',
......@@ -111,6 +116,7 @@
slotMaxTime: '21:00',
slotLabelInterval: '',
scrollTime: false,
initialDate: '2021-10-31',
slotLabelFormat: {
hour: 'numeric',
minute: '2-digit',
......@@ -131,38 +137,38 @@
this.getFirstLevelLable();
},
mounted() {
this.calendarOptions.events = [
{
end: '2021-10-30 10:15:00',
start: '2021-10-30 10:00:00',
color:'green',
resourceId: 1007393527,
},
{
end: '2021-10-30 12:30:00',
start: '2021-10-30 11:30:00',
color:'green',
resourceId: 1007393527,
},
{
end: '2021-10-30 10:15:00',
start: '2021-10-30 10:00:00',
color:'green',
resourceId: 1007393588,
},
{
end: '2021-10-30 10:15:00',
start: '2021-10-30 10:00:00',
color:'green',
resourceId: 1000005462,
},
{
end: '2021-10-30 10:15:00',
start: '2021-10-30 10:00:00',
color:'green',
resourceId: 100925427,
},
];
// this.calendarOptions.events = [
// {
// end: '2021-10-30 10:15:00',
// start: '2021-10-30 10:00:00',
// color:'green',
// resourceId: 1007393527,
// },
// {
// end: '2021-10-30 12:30:00',
// start: '2021-10-30 11:30:00',
// color:'green',
// resourceId: 1007393527,
// },
// {
// end: '2021-10-30 10:15:00',
// start: '2021-10-30 10:00:00',
// color:'green',
// resourceId: 1007393588,
// },
// {
// end: '2021-10-30 10:15:00',
// start: '2021-10-30 10:00:00',
// color:'green',
// resourceId: 1000005462,
// },
// {
// end: '2021-10-30 10:15:00',
// start: '2021-10-30 10:00:00',
// color:'green',
// resourceId: 100925427,
// },
// ];
},
methods: {
// 通过监听expand-change事件(当展开节点发生变化时触发)获取第二层数据,组装interfaceOptions数据
......@@ -217,24 +223,64 @@
};
previewWork({ ...params }).then((res) => {
if (res.code === '000000') {
this.calendarOptions.resources = (res.data.doctorList || []).map(item => {
return {
id:item.doctorId,
title:item.doctorName,
};
});
// this.calendarOptions.events = res.data.dutyWorkList.map((item, index) => {
// return {
// id:index,
// resourceId:item.doctorId,
// end:item.endTime,
// start:item.startTime,
// color:'#0d9078'
// };
// });
this.calendarOptions.resources = (res.data.doctorList || []).map(
(item) => {
return {
id: item.doctorId,
title: item.doctorName,
};
}
);
this.calendarOptions.events = res.data.dutyWorkList.map(
(item, index) => {
return {
id: index,
resourceId: item.doctorId,
end: item.endTime,
start: item.startTime,
color: '#0d9078',
};
}
);
// this.calendarOptions.events = [
// {
// end: '2021-10-30 10:15:00',
// start: '2021-10-30 10:00:00',
// color:'green',
// resourceId: 1007393527,
// },
// {
// end: '2021-10-30 12:30:00',
// start: '2021-10-30 11:30:00',
// color:'green',
// resourceId: 1007393527,
// },
// {
// end: '2021-10-30 10:15:00',
// start: '2021-10-30 10:00:00',
// color:'green',
// resourceId: 1007393588,
// },
// {
// end: '2021-10-30 10:15:00',
// start: '2021-10-30 10:00:00',
// color:'green',
// resourceId: 1000005462,
// },
// {
// end: '2021-10-30 10:15:00',
// start: '2021-10-30 10:00:00',
// color:'green',
// resourceId: 100925427,
// },
// ];
const calendarApi = this.$refs.fullCalendar.getApi();
calendarApi.gotoDate('2021-11-01');
// this.initialDate = '2021-10-30';
console.log(this.calendarOptions.resources);
console.log(this.calendarOptions.events);
// this.handleInitData(res.data.dutyWorkList);
// this.handleInitData(res.data.dutyWorkList);
}
});
},
......@@ -256,7 +302,7 @@
dataObj['start'] = item.startTime;
dataObj['color'] = 'green';
this.calendarOptions.events.push(dataObj);
// debugger;
// debugger;
});
console.log(this.calendarOptions.events, 'this.calendarOptions.events');
},
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册