From cda5c1ff1980582d2f5e54d2c70380636f668cdd Mon Sep 17 00:00:00 2001 From: HarlanLuo Date: Wed, 19 Dec 2018 00:36:51 +0800 Subject: [PATCH] Add tui.calendar --- package.json | 2 + src/icons/svg/calendar.svg | 61 ++++ src/router/index.js | 13 + src/views/calendar/components/TuiCalendar.vue | 290 ++++++++++++++++++ src/views/calendar/components/theme.js | 117 +++++++ src/views/calendar/index.vue | 266 ++++++++++++++++ 6 files changed, 749 insertions(+) create mode 100644 src/icons/svg/calendar.svg create mode 100644 src/views/calendar/components/TuiCalendar.vue create mode 100644 src/views/calendar/components/theme.js create mode 100644 src/views/calendar/index.vue diff --git a/package.json b/package.json index 75d88dd4..be9c9946 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "clipboard": "1.7.1", "codemirror": "5.39.2", "connect": "3.6.6", + "dayjs": "^1.7.8", "driver.js": "0.8.1", "dropzone": "5.2.0", "echarts": "4.1.0", @@ -52,6 +53,7 @@ "screenfull": "3.3.3", "showdown": "1.8.6", "sortablejs": "1.7.0", + "tui-calendar": "^1.9.0", "tui-editor": "1.2.7", "vue": "2.5.17", "vue-count-to": "1.0.13", diff --git a/src/icons/svg/calendar.svg b/src/icons/svg/calendar.svg new file mode 100644 index 00000000..5f80a5d0 --- /dev/null +++ b/src/icons/svg/calendar.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/router/index.js b/src/router/index.js index ab328c46..712869e6 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -333,6 +333,19 @@ export const asyncRouterMap = [ ] }, + { + path: '/calendar', + component: Layout, + children: [ + { + path: 'index', + component: () => import('@/views/calendar/index'), + name: 'Calendar', + meta: { title: 'Calendar', icon: 'calendar' } + } + ] + }, + { path: 'external-link', component: Layout, diff --git a/src/views/calendar/components/TuiCalendar.vue b/src/views/calendar/components/TuiCalendar.vue new file mode 100644 index 00000000..98f706dd --- /dev/null +++ b/src/views/calendar/components/TuiCalendar.vue @@ -0,0 +1,290 @@ + + diff --git a/src/views/calendar/components/theme.js b/src/views/calendar/components/theme.js new file mode 100644 index 00000000..e8c6b38b --- /dev/null +++ b/src/views/calendar/components/theme.js @@ -0,0 +1,117 @@ +export default { + 'common.border': '1px solid #e5e5e5', + 'common.backgroundColor': 'white', + 'common.holiday.color': '#ff4040', + 'common.saturday.color': '#135de6', + 'common.dayname.color': '#333', + 'common.today.color': '#135de6', + + // creation guide style + 'common.creationGuide.backgroundColor': 'rgba(81, 92, 230, 0.05)', + 'common.creationGuide.border': '1px solid #515ce6', + + // month header 'dayname' + 'month.dayname.height': '31px', + 'month.dayname.borderLeft': '1px solid #e5e5e5', + 'month.dayname.paddingLeft': '10px', + 'month.dayname.paddingRight': '10px', + 'month.dayname.backgroundColor': 'inherit', + 'month.dayname.fontSize': '12px', + 'month.dayname.fontWeight': 'normal', + 'month.dayname.textAlign': 'left', + + // month day grid cell 'day' + 'month.holidayExceptThisMonth.color': 'rgba(255, 64, 64, 0.4)', + 'month.dayExceptThisMonth.color': 'rgba(51, 51, 51, 0.4)', + 'month.weekend.backgroundColor': 'inherit', + 'month.day.fontSize': '14px', + + // month schedule style + 'month.schedule.borderRadius': '2px', + 'month.schedule.height': '24px', + 'month.schedule.marginTop': '2px', + 'month.schedule.marginLeft': '8px', + 'month.schedule.marginRight': '8px', + + // month more view + 'month.moreView.border': '1px solid #d5d5d5', + 'month.moreView.boxShadow': '0 2px 6px 0 rgba(0, 0, 0, 0.1)', + 'month.moreView.backgroundColor': 'white', + 'month.moreView.paddingBottom': '17px', + 'month.moreViewTitle.height': '44px', + 'month.moreViewTitle.marginBottom': '12px', + 'month.moreViewTitle.backgroundColor': 'white', + 'month.moreViewTitle.borderBottom': 'none', + 'month.moreViewTitle.padding': '12px 17px 0 17px', + 'month.moreViewList.padding': '0 17px 17px 17px', + + // week header 'dayname' + 'week.dayname.height': '42px', + 'week.dayname.borderTop': '1px solid #e5e5e5', + 'week.dayname.borderBottom': '1px solid #e5e5e5', + 'week.dayname.borderLeft': 'inherit', + 'week.dayname.paddingLeft': '0', + 'week.dayname.backgroundColor': 'inherit', + 'week.dayname.textAlign': 'left', + 'week.today.color': '#333', + + // week vertical panel 'vpanel' + 'week.vpanelSplitter.border': '1px solid #e5e5e5', + 'week.vpanelSplitter.height': '3px', + + // week daygrid 'daygrid' + 'week.daygrid.borderRight': '1px solid #e5e5e5', + 'week.daygrid.backgroundColor': 'inherit', + + 'week.daygridLeft.width': '72px', + 'week.daygridLeft.backgroundColor': 'inherit', + 'week.daygridLeft.paddingRight': '8px', + 'week.daygridLeft.borderRight': '1px solid #e5e5e5', + + 'week.today.backgroundColor': 'rgba(81, 92, 230, 0.05)', + 'week.weekend.backgroundColor': 'inherit', + + // week timegrid 'timegrid' + 'week.timegridLeft.width': '72px', + 'week.timegridLeft.backgroundColor': 'inherit', + 'week.timegridLeft.borderRight': '1px solid #e5e5e5', + 'week.timegridLeft.fontSize': '11px', + 'week.timegridLeftTimezoneLabel.height': '20px', + + 'week.timegridOneHour.height': '52px', + 'week.timegridHalfHour.height': '26px', + 'week.timegridHalfHour.borderBottom': 'none', + 'week.timegridHorizontalLine.borderBottom': '1px solid #e5e5e5', + + 'week.timegrid.paddingRight': '8px', + 'week.timegrid.borderRight': '1px solid #e5e5e5', + 'week.timegridSchedule.borderRadius': '2px', + 'week.timegridSchedule.paddingLeft': '2px', + + 'week.currentTime.color': '#515ce6', + 'week.currentTime.fontSize': '11px', + 'week.currentTime.fontWeight': 'normal', + + 'week.pastTime.color': '#333', + 'week.pastTime.fontWeight': 'normal', + + 'week.futureTime.color': '#333', + 'week.futureTime.fontWeight': 'normal', + + 'week.currentTimeLinePast.border': '1px dashed #515ce6', + 'week.currentTimeLineBullet.backgroundColor': '#515ce6', + 'week.currentTimeLineToday.border': '1px solid #515ce6', + 'week.currentTimeLineFuture.border': 'none', + + // week creation guide style + 'week.creationGuide.color': '#515ce6', + 'week.creationGuide.fontSize': '11px', + 'week.creationGuide.fontWeight': 'bold', + + // week daygrid schedule style + 'week.dayGridSchedule.borderRadius': '2px', + 'week.dayGridSchedule.height': '24px', + 'week.dayGridSchedule.marginTop': '2px', + 'week.dayGridSchedule.marginLeft': '8px', + 'week.dayGridSchedule.marginRight': '8px' +} diff --git a/src/views/calendar/index.vue b/src/views/calendar/index.vue new file mode 100644 index 00000000..7854f1da --- /dev/null +++ b/src/views/calendar/index.vue @@ -0,0 +1,266 @@ + + + + +