408249787 преди 2 години
родител
ревизия
ffec6fbb70
променени са 2 файла, в които са добавени 47 реда и са изтрити 1 реда
  1. 3 1
      src/router/generator-platform-routers.js
  2. 44 0
      src/views/calendar/Calendar.vue

+ 3 - 1
src/router/generator-platform-routers.js

@@ -370,7 +370,9 @@ const constantRouterComponents = {
   'Hotspot': () => import('@/views/qykh/hotspot/Hotspot'),
   'HotspotHelp': () => import('@/views/qykh/hotspot-help/HotspotHelp'),
   'Information': () => import('@/views/qykh/information/Information'),
-  'InformationHelp': () => import('@/views/qykh/information-help/InformationHelp')
+  'InformationHelp': () => import('@/views/qykh/information-help/InformationHelp'),
+  // 日历
+  'Calendar': () => import('@/views/calendar/Calendar')
 }
 
 // 前端未找到页面路由(固定不用改)

+ 44 - 0
src/views/calendar/Calendar.vue

@@ -0,0 +1,44 @@
+<template>
+  <a-card :bordered="false">
+    <a-calendar @select="handleSelect">
+      <div v-if="date.includes(BaseTool.Date.formatter(value, BaseTool.Date.PICKER_NORM_DATE_PATTERN))" slot="dateCellRender" slot-scope="value" class="events">
+        休
+      </div>
+      <div v-else slot="dateCellRender">班</div>
+    </a-calendar>
+  </a-card>
+</template>
+<script>
+export default {
+  data () {
+    return {
+      date: []
+    }
+  },
+  methods: {
+    handleSelect (value) {
+      const info = this.BaseTool.Date.formatter(value, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      if (this.date.includes(info)) {
+        this.date = this.date.filter(item => item !== info)
+      } else {
+        this.date.push(info)
+      }
+    }
+  }
+}
+</script>
+<style scoped>
+.events {
+  list-style: none;
+  margin: 0;
+  padding: 0;
+  color: red;
+}
+.events .ant-badge-status {
+  overflow: hidden;
+  white-space: nowrap;
+  width: 100%;
+  text-overflow: ellipsis;
+  font-size: 12px;
+}
+</style>