From 18852cbde460274f3b204fd3ce57a6e5e87cc49b Mon Sep 17 00:00:00 2001
From: lzhe <lzhe@example.com>
Date: 星期四, 10 十月 2024 10:18:09 +0800
Subject: [PATCH] 1

---
 src/views/console/base/CalenderTab.vue |   45 ++++++++++++++++++++++++++++++++++-----------
 1 files changed, 34 insertions(+), 11 deletions(-)

diff --git a/src/views/console/base/CalenderTab.vue b/src/views/console/base/CalenderTab.vue
index c6a0ebc..95fc076 100644
--- a/src/views/console/base/CalenderTab.vue
+++ b/src/views/console/base/CalenderTab.vue
@@ -1,7 +1,7 @@
 <!--
  * @Date: 2024-04-04 22:45:43
  * @LastEditors: gaoshp
- * @LastEditTime: 2024-10-02 20:52:59
+ * @LastEditTime: 2024-10-09 22:59:25
  * @FilePath: /cps-web/src/views/console/base/CalenderTab.vue
 -->
 <template>
@@ -30,7 +30,11 @@
             </el-header>
             <el-main>
                 <el-row :gutter="12" v-show="shiftListName.length > 0">
-                    <el-button v-for="item in shiftListName">{{ item.code + '-' + item.name
+                    <el-button v-for="item in shiftListName"
+                        :style="{ backgroundColor: item.colour || '#2563eb', color: '#fff' }">{{
+                            item.code +
+                            '-' +
+                            item.name
                         }}</el-button>
                 </el-row>
                 <el-row>
@@ -119,7 +123,6 @@
                 if (res.code === 200) {
                     this.raworkVisible = true
                     this.workStations = this.formatData(res.data)
-                    console.log(this.workStations)
                 }
             })
 
@@ -176,7 +179,7 @@
             } else {
                 this.save(workstation.map(v => v.id))
             }
-            console.log(this.$refs.workstations.getCheckedNodes().filter(v => v.isWorkstation))
+            // console.log(this.$refs.workstations.getCheckedNodes().filter(v => v.isWorkstation))
         },
         save(workstationIdList) {
             console.log(workstationIdList, this.selectInfo)
@@ -193,7 +196,7 @@
             })
         },
         dayclick(day) {
-            console.log(day)
+            // console.log(day)
         },
         init() {
             this.$HTTP.post('/api/blade-cps/shift/list', { statusList: [1] }).then(res => {
@@ -207,9 +210,9 @@
             this.months = []
             this.$HTTP.get(`/api/blade-cps/calendar/${row.id}`).then(res => {
                 if (res.code === 200) {
-                    console.log(res.data)
+                    // console.log(res.data)
                     this.setDay(res.data)
-                    console.log('////', this.shiftList, res.data.calendarDayVOList[0].id)
+                    // console.log('////', this.shiftList, res.data.calendarDayVOList[0].id)
                     let modelIds = [...new Set(res.data.calendarDayVOList.map(v => v.modelId))]
                     if (modelIds.length > 0) {
                         this.shiftListName = this.shiftList.filter(v => modelIds.includes(v.id))
@@ -279,12 +282,19 @@
                     })
 
                     for (let i = 0; i < 12; i++) {
-                        data.calendarDayVOList.map(v => v.modelId)
+
                         let modelIds = [...new Set(data.calendarDayVOList.map(v => v.modelId))]
                         let ext = modelIds.map(v => {
                             let ban = this.shiftListName.find(item => item.id === v)
+                            console.log(ban.colour)
                             return {
-                                highlight: color.stringToColor(v),
+                                highlight: {
+                                    // color: ban.colour || color.stringToColor(v),
+                                    // fillMode: 'light',
+                                    style: {
+                                        'background-color': ban.colour
+                                    }
+                                },
                                 dates: data.calendarDayVOList.filter(item => {
                                     return moment(item.calendarDate).month() === i && item.modelId === v
                                 }).map(v => v.calendarDate),
@@ -293,6 +303,8 @@
                                 },
                             }
                         })
+                        console.log('---------youxian')
+
                         this.months.push({
                             year: year,
                             month: i,
@@ -304,11 +316,22 @@
                                         return moment(item).month() === i
                                     })
                                 },
-                                ...ext
+                                ...ext,
+                                // 浼樺厛
+                                {
+                                    dates: data.calendarDayVOList.filter(item => {
+                                        return moment(item.calendarDate).month() === i
+                                    }).filter(item => item.isHighPriority).map(item => item.calendarDate),
+                                    bar: {
+                                        style: {
+                                            backgroundColor: 'red',
+                                        }
+                                    },
+                                }
                             ]
                         })
                     }
-                    console.log(this.months, '------------')
+
                 }
             })
 

--
Gitblit v1.9.3