|
@@ -0,0 +1,175 @@
|
|
|
+<template>
|
|
|
+ <div class="calendar-container">
|
|
|
+ <Calendar ref="calendarRef" :current="current" :dotDays="dutyData.dateList" @change="handleChange" />
|
|
|
+ <div class="duty-card">
|
|
|
+ <div class="duty-header">当天值班:{{ parseTime(current, '{y}年{m}月{d}日') }}</div>
|
|
|
+ <div class="duty-content">
|
|
|
+ <div class="duty-item">
|
|
|
+ <div class="item-left">
|
|
|
+ <i class="icon" />
|
|
|
+ <div>带班领导</div>
|
|
|
+ </div>
|
|
|
+ <div class="item-label">{{ dutyData.data1 }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="duty-item">
|
|
|
+ <div class="item-left">
|
|
|
+ <i class="icon" />
|
|
|
+ <div>主班</div>
|
|
|
+ </div>
|
|
|
+ <div class="item-label">{{ dutyData.data2 }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="duty-item">
|
|
|
+ <div class="item-left">
|
|
|
+ <i class="icon" />
|
|
|
+ <div>副班</div>
|
|
|
+ </div>
|
|
|
+ <div class="item-label">{{ dutyData.data3 }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="duty-item">
|
|
|
+ <div class="item-left">
|
|
|
+ <i class="icon" />
|
|
|
+ <div>备班</div>
|
|
|
+ </div>
|
|
|
+ <div class="item-label">{{ dutyData.data4 }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="duty-card">
|
|
|
+ <div class="duty-header">提醒事项</div>
|
|
|
+ <div class="duty-content">
|
|
|
+ <div v-for="(item, index) in dutyData.dataList2" :key="index" class="duty-item2">
|
|
|
+ <div class="text1">{{ item.time }}</div>
|
|
|
+ <div class="text2">{{ item.text }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="duty-card">
|
|
|
+ <div class="duty-header">待办事项</div>
|
|
|
+ <div class="duty-content">
|
|
|
+ <div v-for="(item, index) in dutyData.dataList3" :key="index" class="duty-item2">
|
|
|
+ <div class="text1">{{ item.time }}</div>
|
|
|
+ <div class="text2">{{ item.text }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="footer">
|
|
|
+ <div class="confirm-btn" @click="handleToShiftChange">去交班</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts" setup>
|
|
|
+import {onMounted, ref} from "vue";
|
|
|
+import {parseTime} from "@/utils/ruoyi";
|
|
|
+
|
|
|
+let calendarRef = ref();
|
|
|
+const current = ref('');
|
|
|
+const dutyData = ref({
|
|
|
+ data1: '张珊珊1',
|
|
|
+ data2: '张珊珊2',
|
|
|
+ data3: '张珊珊3',
|
|
|
+ data4: '张珊珊4',
|
|
|
+ dateList: [
|
|
|
+ { date: '2024-10-19', color: '#a2d7f1' },
|
|
|
+ { date: '2024-10-18', color: '#ffd5d8' },
|
|
|
+ { date: '2024-10-17', color: '#ffefcc' },
|
|
|
+ { date: '2024-10-16', color: '#dfdfdf' }
|
|
|
+ ],
|
|
|
+ dataList2: [
|
|
|
+ { text: '台风生成期间,请密切关注台风路径及等级变化情况1。', time: '2024-10-20 11:43:00' },
|
|
|
+ { text: '台风生成期间,请密切关注台风路径及等级变化情况2。', time: '2024-10-20 11:43:00' },
|
|
|
+ { text: '台风生成期间,请密切关注台风路径及等级变化情况3。', time: '2024-10-20 11:43:00' }
|
|
|
+ ],
|
|
|
+ dataList3: [
|
|
|
+ { text: '台风即将登录,请通知相关单位人员下午2:00到现场开展台风联合值守工作1。', time: '2024-10-20 11:43:00' },
|
|
|
+ { text: '台风即将登录,请通知相关单位人员下午2:00到现场开展台风联合值守工作2。', time: '2024-10-20 11:43:00' },
|
|
|
+ { text: '台风即将登录,请通知相关单位人员下午2:00到现场开展台风联合值守工作3。', time: '2024-10-20 11:43:00' }
|
|
|
+ ]
|
|
|
+})
|
|
|
+
|
|
|
+const handleChange = (date) => {
|
|
|
+ current.value = date.value;
|
|
|
+ console.log(current.value)
|
|
|
+}
|
|
|
+
|
|
|
+const initData = () => {
|
|
|
+ current.value = parseTime(new Date(), '{y}-{m}-{d}');
|
|
|
+};
|
|
|
+const emits = defineEmits(['changIndex']);
|
|
|
+const handleToShiftChange = () => {
|
|
|
+ emits('changIndex', 'shiftChange');
|
|
|
+}
|
|
|
+onMounted(() => {
|
|
|
+ initData();
|
|
|
+})
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.calendar-container {
|
|
|
+ .duty-card {
|
|
|
+ margin-top: 16px;
|
|
|
+ width: 100%;
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 4px;
|
|
|
+ .duty-header {
|
|
|
+ padding: 10px;
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ border-bottom: 1px solid #f0f1f1;
|
|
|
+ }
|
|
|
+ .duty-content {
|
|
|
+ padding: 10px;
|
|
|
+ .duty-item {
|
|
|
+ padding: 3px 0;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: flex-start;
|
|
|
+ font-size: 14px;
|
|
|
+ .item-left {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ .icon {
|
|
|
+ display: inline-block;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .duty-item2 {
|
|
|
+ padding: 5px;
|
|
|
+ font-size: 14px;
|
|
|
+ background-color: #f2f2f2;
|
|
|
+ border-radius: 4px;
|
|
|
+ margin-top: 10px;
|
|
|
+ &:first-child {
|
|
|
+ margin-top: 0;
|
|
|
+ }
|
|
|
+ .text1 {
|
|
|
+ font-size: 12px;
|
|
|
+ color: rgba(0, 0, 0, 0.45);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.footer {
|
|
|
+ position: fixed;
|
|
|
+ bottom: 55px;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 55px;
|
|
|
+ background: #FFFFFF;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ .confirm-btn {
|
|
|
+ width: 110px;
|
|
|
+ height: 40px;
|
|
|
+ background: #2C81FF;
|
|
|
+ border-radius: 2px;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #FFFFFF;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|