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

新页面添加

上级 35474710
...@@ -39,12 +39,22 @@ ...@@ -39,12 +39,22 @@
查询 查询
</el-button> </el-button>
</div> </div>
<div
class="fullCalendar-show"
>
<FullCalendar <FullCalendar
ref="fullCalendar" ref="fullCalendar"
:options="calendarOptions" :options="calendarOptions"
class="FullCalendar" class="FullCalendar"
/> />
</div> </div>
<!-- <div
v-else
class="fullCalendar-nothing"
>
<img src="../../../assets/image/nothingData.png" alt="" >
</div> -->
</div>
</div> </div>
</template> </template>
<script> <script>
...@@ -96,20 +106,10 @@ ...@@ -96,20 +106,10 @@
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: 'b', title: 'Room B'},
// { id: 'c', title: 'Room C' },
// { id: 'd', title: 'Room D' }
],
eventColor: '#fff', eventColor: '#fff',
eventBackgroundColor: '#fff', eventBackgroundColor: '#fff',
events: [ events: [],
// { 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 不显示 allDaySlot: false, // 周,日视图时,all-day 不显示
slotDuration: '00:05:00', slotDuration: '00:05:00',
slotMinTime: '09:00', slotMinTime: '09:00',
...@@ -123,7 +123,6 @@ ...@@ -123,7 +123,6 @@
meridiem: 'short', meridiem: 'short',
hour12: false, // 设置时间为24小时 hour12: false, // 设置时间为24小时
}, },
gotoDate:this.gotoDate
}, },
workingTicketVisible: false, // 工作表票详情页面 workingTicketVisible: false, // 工作表票详情页面
scrollerHeight: 0, scrollerHeight: 0,
...@@ -137,38 +136,6 @@ ...@@ -137,38 +136,6 @@
this.getFirstLevelLable(); this.getFirstLevelLable();
}, },
mounted() { 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,
// },
// ];
}, },
methods: { methods: {
// 通过监听expand-change事件(当展开节点发生变化时触发)获取第二层数据,组装interfaceOptions数据 // 通过监听expand-change事件(当展开节点发生变化时触发)获取第二层数据,组装interfaceOptions数据
...@@ -212,11 +179,9 @@ ...@@ -212,11 +179,9 @@
this.departmentId = value[1]; this.departmentId = value[1];
}, },
getNowDate(value) { getNowDate(value) {
console.log(value, 'value');
this.dateTime = value; this.dateTime = value;
}, },
search() { search() {
// this.calendarOptions.gotoDate(this.dateTime);
const params = { const params = {
dateTime: this.dateTime || null, dateTime: this.dateTime || null,
departmentId: this.departmentId || null, departmentId: this.departmentId || null,
...@@ -238,74 +203,18 @@ ...@@ -238,74 +203,18 @@
resourceId: item.doctorId, resourceId: item.doctorId,
end: item.endTime, end: item.endTime,
start: item.startTime, start: item.startTime,
color: '#0d9078', color: ' #FFEDE9',
}; };
} }
); );
// 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(); const calendarApi = this.$refs.fullCalendar.getApi();
calendarApi.gotoDate('2021-11-01'); calendarApi.gotoDate(this.dateTime);
// 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);
} }
}); });
}, },
/**
* 点击日历日程事件
*
* info: 事件信息
* event是日程(事件)对象
* jsEvent是个javascript事件
* view是当前视图对象。
*/
handleInitData(data) {
var newDate = [];
newDate = data;
newDate.forEach((item) => {
const dataObj = {};
dataObj['resourceId'] = item.doctorId;
dataObj['end'] = item.endTime;
dataObj['start'] = item.startTime;
dataObj['color'] = 'green';
this.calendarOptions.events.push(dataObj);
// debugger;
});
console.log(this.calendarOptions.events, 'this.calendarOptions.events');
},
}, },
}; };
</script> </script>
...@@ -343,12 +252,27 @@ ...@@ -343,12 +252,27 @@
align-items: center; align-items: center;
} }
} }
.fullCalendar-show{
// max-width: 300px !important;
overflow-x:scroll;
}
.FullCalendar { .FullCalendar {
background: #fff; background: #fff;
padding: 20px; padding: 20px;
} }
.fullCalendar-nothing{
background: #fff;
padding: 20px;
display: flex;
justify-content: center;
img{
display: flex;
}
}
} }
/deep/ .fc-col-header-cell{
max-width: 80px !important;
}
.w2 { .w2 {
/deep/.fc-prev-button { /deep/.fc-prev-button {
background: #f4f4f5; background: #f4f4f5;
...@@ -356,6 +280,9 @@ ...@@ -356,6 +280,9 @@
border: 1px solid #d9d9d9; border: 1px solid #d9d9d9;
} }
} }
/deep/ .fc-timegrid-col-frame{
background: #fff !important;
}
.w3 { .w3 {
/deep/.fc-next-button { /deep/.fc-next-button {
background: #f4f4f5; background: #f4f4f5;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册