|
@@ -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>
|