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

提交代码

上级 b88bc1e2
...@@ -19,8 +19,10 @@ ...@@ -19,8 +19,10 @@
"tinypng": "pica-cli-service tinypng" "tinypng": "pica-cli-service tinypng"
}, },
"dependencies": { "dependencies": {
"@fullcalendar/core": "^5.10.0",
"@fullcalendar/daygrid": "^5.10.0", "@fullcalendar/daygrid": "^5.10.0",
"@fullcalendar/interaction": "^5.10.0", "@fullcalendar/interaction": "^5.10.0",
"@fullcalendar/resource-timegrid": "^5.10.0",
"@fullcalendar/timegrid": "^5.10.0", "@fullcalendar/timegrid": "^5.10.0",
"@fullcalendar/vue": "^5.10.0", "@fullcalendar/vue": "^5.10.0",
"axios": "^0.19.2", "axios": "^0.19.2",
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
import dayGridPlugin from '@fullcalendar/daygrid'; import dayGridPlugin from '@fullcalendar/daygrid';
import timeGridPlugin from '@fullcalendar/timegrid'; import timeGridPlugin from '@fullcalendar/timegrid';
import interactionPlugin from '@fullcalendar/interaction'; import interactionPlugin from '@fullcalendar/interaction';
import resourceTimeGridPlugin from '@fullcalendar/resource-timegrid';
import { import {
getFirstLevelLable, getFirstLevelLable,
childLabelList, childLabelList,
...@@ -86,52 +87,25 @@ ...@@ -86,52 +87,25 @@
currentIndex: 3, currentIndex: 3,
haveWeek: [1], haveWeek: [1],
calendarOptions: { calendarOptions: {
// 引入的插件,比如fullcalendar/daygrid,fullcalendar/timegrid引入后才可显示月,周,日 plugins: [dayGridPlugin, interactionPlugin, timeGridPlugin, resourceTimeGridPlugin],
plugins: [dayGridPlugin, interactionPlugin, timeGridPlugin], timeZone: 'UTC',
initialView: 'timeGrid', // 默认为那个视图(月:dayGridMonth,周:timeGridWeek,日:timeGridDay) schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives',
duration: { days: 4 }, initialView: 'resourceTimeGridDay',
selectable: false, resources: [
selectMirror: true, // { id: 'a', title: 'Room A' },
// selectAllow: this.selectAllow, // { id: 'b', title: 'Room B'},
selectOverlap: false, // { id: 'c', title: 'Room C' },
// select: this.selectInfo, // { id: 'd', title: 'Room D' }
selectMinDistance: 0, ],
// eventResize: this.eventResize, eventColor: '#fff',
// eventDrop: this.eventDrop, eventBackgroundColor: '#fff',
editable: false, events: [
overlap: false, // { id: '1', resourceId: 'a', start: '2021-10-30 14:30:00', end: '2021-10-30 15:30:00' },
defaultDate: new Date(), // { id: '2', resourceId: 'b', start: '2021-10-30 14:30:00', end: '2021-10-30 15:30:00' },
// datesSet: this.handleDatesSet, // { id: '3', resourceId: 'c', start: '2021-10-30 14:30:00', end: '2021-10-30 15:30:00'},
events: [], // { id: '4', resourceId: 'd', start: '2021-10-30 14:30:00', end: '2021-10-30 15:30:00' },
slotEventOverlap: true, ],
header: {
// center: 'month,agendaFourDay', // buttons for switching between views
},
firstDay: 1, // 设置一周中显示的第一天是哪天,周日是0,周一是1,类推
locale: 'zh-cn', // 切换语言,当前为中文
eventColor: '#fff', // 全部日历日程背景色3BB2E3
eventBackgroundColor: '#E7F4F5',
// themeSystem: 'bootstrap', // 主题色(本地测试未能生效)
// initialDate: moment().format('YYYY-MM-DD'), // 自定义设置背景颜色时一定要初始化日期时间
timeGridEventMinHeight: '40', // 设置事件的最小高度
aspectRatio: 1.35, // 设置日历单元格宽度与高度的比例。
// displayEventTime: false, // 是否显示时间
allDaySlot: false, // 周,日视图时,all-day 不显示 allDaySlot: false, // 周,日视图时,all-day 不显示
eventLimit: true, // 设置月日程,与all-day slot的最大显示数量,超过的通过弹窗显示
customButtons: {
myCustomButton: {
text: '本周',
},
},
dayHeaderContent: this.getHederList,
// headerToolbar: {
// // 日历头部按钮位置
// left: '',
// center: 'prev myCustomButton next',
// right: '',
// },
expandRows: true,
slotMinWidth: 50,
slotDuration: '00:05:00', slotDuration: '00:05:00',
slotMinTime: '09:00', slotMinTime: '09:00',
slotMaxTime: '21:00', slotMaxTime: '21:00',
...@@ -143,16 +117,6 @@ ...@@ -143,16 +117,6 @@
meridiem: 'short', meridiem: 'short',
hour12: false, // 设置时间为24小时 hour12: false, // 设置时间为24小时
}, },
eventLimitNum: {
// 事件显示数量限制(本地测试未能生效)
dayGrid: {
eventLimit: 5,
},
timeGrid: {
eventLimit: 4, // adjust to 6 only for timeGridWeek/timeGridDay
},
},
// eventClick: this.handleEventClick,
}, },
workingTicketVisible: false, // 工作表票详情页面 workingTicketVisible: false, // 工作表票详情页面
scrollerHeight: 0, scrollerHeight: 0,
...@@ -168,17 +132,35 @@ ...@@ -168,17 +132,35 @@
mounted() { mounted() {
this.calendarOptions.events = [ this.calendarOptions.events = [
{ {
end: '2021-10-30 14:30:00', end: '2021-10-30 10:15:00',
id: 10, start: '2021-10-30 10:00:00',
start: '2021-10-30 11:00:00', color:'green',
color:'red' 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-31 14:30:00', end: '2021-10-30 10:15:00',
id: 10, start: '2021-10-30 10:00:00',
start: '2021-10-31 11:00:00', color:'green',
color:'red' resourceId: 1000005462,
} },
{
end: '2021-10-30 10:15:00',
start: '2021-10-30 10:00:00',
color:'green',
resourceId: 100925427,
},
]; ];
}, },
methods: { methods: {
...@@ -233,12 +215,24 @@ ...@@ -233,12 +215,24 @@
}; };
previewWork({ ...params }).then((res) => { previewWork({ ...params }).then((res) => {
if (res.code === '000000') { if (res.code === '000000') {
this.doctorList = res.data.doctorList || []; this.calendarOptions.resources = (res.data.doctorList || []).map(item => {
console.log(this.doctorList); return {
// this.calendarOptions.events = res.data.dutyWorkList || []; id:item.doctorId,
this.handleInitData(res.data.dutyWorkList); title:item.doctorName,
this.calendarOptions.duration.days = this.doctorList.length; };
console.log(); });
// this.calendarOptions.events = res.data.dutyWorkList.map((item, index) => {
// return {
// id:index,
// resourceId:item.doctorId,
// end:item.endTime,
// start:item.startTime,
// color:'#0d9078'
// };
// });
console.log(this.calendarOptions.resources);
console.log(this.calendarOptions.events);
// this.handleInitData(res.data.dutyWorkList);
} }
}); });
}, },
...@@ -250,33 +244,19 @@ ...@@ -250,33 +244,19 @@
* jsEvent是个javascript事件 * jsEvent是个javascript事件
* view是当前视图对象。 * view是当前视图对象。
*/ */
getHederList() {
console.log('1', this.index);
const italicEl = document.createElement('i');
if (this.doctorList.length) {
italicEl.innerHTML = this.doctorList[this.index]['doctorName'];
}
if (this.index < this.doctorList.length) {
this.index += 1;
}
console.log(italicEl);
return { domNodes: [italicEl] };
},
handleInitData(data) { handleInitData(data) {
var newDate = null; var newDate = [];
newDate = [].concat(data); newDate = data;
newDate.forEach((item) => { newDate.forEach((item) => {
const dataObj = {}; const dataObj = {};
const id = (this.calendarOptions.events.length + 1) * 10; dataObj['resourceId'] = item.doctorId;
dataObj['id'] = id;
dataObj['doctorName'] = item.doctorName;
dataObj['doctorId'] = item.doctorId;
dataObj['end'] = item.endTime; dataObj['end'] = item.endTime;
dataObj['start'] = item.startTime; dataObj['start'] = item.startTime;
dataObj['color'] = 'red'; dataObj['color'] = 'green';
this.calendarOptions.events.push(dataObj); this.calendarOptions.events.push(dataObj);
console.log(this.calendarOptions.events, 'this.calendarOptions.events'); // debugger;
}); });
console.log(this.calendarOptions.events, 'this.calendarOptions.events');
}, },
}, },
}; };
......
...@@ -1046,7 +1046,7 @@ ...@@ -1046,7 +1046,7 @@
dependencies: dependencies:
tslib "^2.1.0" tslib "^2.1.0"
"@fullcalendar/core@~5.10.0": "@fullcalendar/core@^5.10.0", "@fullcalendar/core@~5.10.0":
version "5.10.0" version "5.10.0"
resolved "http://192.168.110.93:4873/@fullcalendar%2fcore/-/core-5.10.0.tgz#5e8f46618bf45ddfb16827e68fe11dbd655d529f" resolved "http://192.168.110.93:4873/@fullcalendar%2fcore/-/core-5.10.0.tgz#5e8f46618bf45ddfb16827e68fe11dbd655d529f"
integrity sha1-Xo9GYYv0Xd+xaCfmj+EdvWVdUp8= integrity sha1-Xo9GYYv0Xd+xaCfmj+EdvWVdUp8=
...@@ -1071,7 +1071,47 @@ ...@@ -1071,7 +1071,47 @@
"@fullcalendar/common" "~5.10.0" "@fullcalendar/common" "~5.10.0"
tslib "^2.1.0" tslib "^2.1.0"
"@fullcalendar/timegrid@^5.10.0": "@fullcalendar/premium-common@~5.10.0":
version "5.10.0"
resolved "http://192.168.110.93:4873/@fullcalendar%2fpremium-common/-/premium-common-5.10.0.tgz#1abd26483243482eda26ffcf3d65e63d9e1cc64f"
integrity sha1-Gr0mSDJDSC7aJv/PPWXmPZ4cxk8=
dependencies:
"@fullcalendar/common" "~5.10.0"
tslib "^2.1.0"
"@fullcalendar/resource-common@~5.10.0":
version "5.10.0"
resolved "http://192.168.110.93:4873/@fullcalendar%2fresource-common/-/resource-common-5.10.0.tgz#fd40974d1b8540673617c6ac4a0df56eea17a6b6"
integrity sha1-/UCXTRuFQGc2F8asSg31buoXprY=
dependencies:
"@fullcalendar/common" "~5.10.0"
"@fullcalendar/premium-common" "~5.10.0"
tslib "^2.1.0"
"@fullcalendar/resource-daygrid@~5.10.0":
version "5.10.0"
resolved "http://192.168.110.93:4873/@fullcalendar%2fresource-daygrid/-/resource-daygrid-5.10.0.tgz#0ee59679e735f924164c1d208e5459bbaf3af920"
integrity sha1-DuWWeec1+SQWTB0gjlRZu686+SA=
dependencies:
"@fullcalendar/common" "~5.10.0"
"@fullcalendar/daygrid" "~5.10.0"
"@fullcalendar/premium-common" "~5.10.0"
"@fullcalendar/resource-common" "~5.10.0"
tslib "^2.1.0"
"@fullcalendar/resource-timegrid@^5.10.0":
version "5.10.0"
resolved "http://192.168.110.93:4873/@fullcalendar%2fresource-timegrid/-/resource-timegrid-5.10.0.tgz#bdf276bf163670097fbfd0664821822a8d4986f4"
integrity sha1-vfJ2vxY2cAl/v9BmSCGCKo1JhvQ=
dependencies:
"@fullcalendar/common" "~5.10.0"
"@fullcalendar/premium-common" "~5.10.0"
"@fullcalendar/resource-common" "~5.10.0"
"@fullcalendar/resource-daygrid" "~5.10.0"
"@fullcalendar/timegrid" "~5.10.0"
tslib "^2.1.0"
"@fullcalendar/timegrid@^5.10.0", "@fullcalendar/timegrid@~5.10.0":
version "5.10.0" version "5.10.0"
resolved "http://192.168.110.93:4873/@fullcalendar%2ftimegrid/-/timegrid-5.10.0.tgz#7177914bdc5a6c58ec4af851520b12eb8c480141" resolved "http://192.168.110.93:4873/@fullcalendar%2ftimegrid/-/timegrid-5.10.0.tgz#7177914bdc5a6c58ec4af851520b12eb8c480141"
integrity sha1-cXeRS9xabFjsSvhRUgsS64xIAUE= integrity sha1-cXeRS9xabFjsSvhRUgsS64xIAUE=
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册