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