From 511712a8c25db33008d36f6b94ed34c57d3cae0e Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 14 五月 2024 14:15:24 +0800
Subject: [PATCH] 优化首页

---
 src/components/view/b3-classes.vue |   54 ++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 48 insertions(+), 6 deletions(-)

diff --git a/src/components/view/b3-classes.vue b/src/components/view/b3-classes.vue
index 168bb7b..61a4050 100644
--- a/src/components/view/b3-classes.vue
+++ b/src/components/view/b3-classes.vue
@@ -44,7 +44,7 @@
       <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button>
     </div>
     <div class="search_thing btns" style="padding-left: 30px;">
-      <el-button size="small" type="primary" v-if="downPower">瀵� 鍑�</el-button>
+      <el-button size="small" type="primary" v-if="downPower" @click="handleDown" :loading="downLoading">瀵� 鍑�</el-button>
       <el-button size="small" type="primary" @click="schedulingVisible = true" v-if="addPower">鎺� 鐝�</el-button>
     </div>
   </div>
@@ -60,7 +60,7 @@
             <div class="user-pic">{{ item.name.charAt(0) }}</div>
             <div class="user-info">
               <p style="font-size: 14px;color: #3A7BFA;line-height: 24px;">{{ item.name }}</p>
-              <p style="color: #999999;font-size: 12px;transform: scale(0.8) translateX(-20px);white-space: nowrap;width: 150px;overflow-x: show;">鏃�: {{ item.day0 }}, 涓�: {{ item.day1 }}, 澶�: {{ item.day2 }}, 浼�: {{ item.day3 }}, 鍋�: {{ item.day4 }}</p>
+              <p style="color: #999999;font-size: 12px;transform: scale(0.8) translateX(-20px);white-space: nowrap;width: 150px;overflow-x: show;">鏃�:{{ item.day0 }},涓�:{{ item.day1 }},澶�:{{ item.day2 }},浼�:{{ item.day3 }},鍋�:{{ item.day4 }},宸�:{{ item.day6 }}</p>
               <p style="margin-top: 4px;"><span style="color: #999999;font-size: 12px;display: inline-block;transform: scale(0.8) translateX(-10px);">鍚堣鍑哄嫟: </span><span style="font-size: 16px;
     color: #FF4902;">{{ query.month?item.monthlyAttendance
 .totalAttendance:item.sidebarAnnualAttendance
@@ -83,7 +83,7 @@
             v-on:mouseenter="onMouseEnter(index)"
           v-on:mouseleave="currentUserIndex=null">
               <div class="content-body-item" v-for="(m,i) in item.list" :key="'d'+i" :class="{hoverType:currentUserIndex==index}">
-                <div class="work-box" :class="{type0:m.shift==='0',type1:m.shift==='1',type2:m.shift==='2',type3:m.shift==='3',type4:m.shift==='4',type5:m.shift==='5',}">
+                <div class="work-box" :class="{type0:m.shift==='0',type1:m.shift==='1',type2:m.shift==='2',type3:m.shift==='3',type4:m.shift==='4',type5:m.shift==='5',type6:m.shift==='6'}">
                   <!-- <div class="work-box-left">
                     <span>{{ getShiftByDic(m.shift) }}</span>
                   </div> -->
@@ -112,7 +112,7 @@
             <div class="user-pic">{{ item.name.charAt(0) }}</div>
             <div class="user-info">
               <p style="font-size: 14px;color: #3A7BFA;line-height: 24px;">{{ item.name }}</p>
-              <p style="color: #999999;font-size: 12px;transform: scale(0.8) translateX(-20px);white-space: nowrap;width: 150px;overflow-x: show;">鏃�: {{ item.day0 }}, 涓�: {{ item.day1 }}, 澶�: {{ item.day2 }}, 浼�: {{ item.day3 }}, 鍋�: {{ item.day4 }}</p>
+              <p style="color: #999999;font-size: 12px;transform: scale(0.8) translateX(-20px);white-space: nowrap;width: 150px;overflow-x: show;">鏃�:{{ item.day0 }},涓�:{{ item.day1 }},澶�:{{ item.day2 }},浼�:{{ item.day3 }},鍋�:{{ item.day4 }},宸�:{{ item.day6 }}</p>
               <p style="margin-top: 4px;"><span style="color: #999999;font-size: 12px;display: inline-block;transform: scale(0.8) translateX(-10px);">鍚堣鍑哄嫟: </span><span style="font-size: 16px;
     color: #FF4902;">{{ item.work_time }}澶�</span></p>
             </div>
@@ -139,7 +139,7 @@
               <div class="content-body-item" v-for="(m,i) in item.monthList" :key="'d'+i" :class="{hoverType:currentUserIndex==index}">
                 <p style="color:rgb(153, 153, 153);font-size: 12px;">鍚堣鍑哄嫟锛�<span style="font-size: 14px;color:#000">{{ m.totalMonthAttendance }}</span></p>
                 <p style="color:rgb(153, 153, 153);font-size: 12px;">
-                  鏃�: {{ m.day0 }}, 涓�:  {{ m.day1 }}, 澶�:  {{ m.day2 }}, 浼�:  {{ m.day3 }}, 鍋�:  {{ m.day4 }}
+                  鏃�:{{ m.day0 }},涓�:{{ m.day1 }},澶�:{{ m.day2 }},浼�:{{ m.day3 }},鍋�:{{ m.day4 }},宸�:{{ m.day6 }}
                 </p>
               </div>
             </div>
@@ -286,7 +286,8 @@
       pageLoading: false, // 缁勪欢loading鐨勫睍绀�,榛樿涓簍rue
       finishLoding: false, // 鍔犺浇瀹屾垚锛屾樉绀哄凡缁忔病鏈夋洿澶氫簡
       monthList:[],
-      yearList:[]
+      yearList:[],
+      downLoading:false,
     }
   },
   watch: {
@@ -514,6 +515,40 @@
           shift:''
         }
         this.refresh()
+      })
+    },
+    handleDown(){
+      let year = this.query.year.getFullYear()
+      let time = '';
+      if(this.query.month){
+        let month = this.query.month>9?this.query.month:'0'+this.query.month
+        time = year+'-'+month+'-01 00:00:00'
+      }else{
+        time = year+'-01-01 00:00:00'
+      }
+      this.downLoading = true
+      this.$axios.get(this.$api.performanceShift.export+`?time=${time}&userName=${this.query.userName}&laboratory=${this.query.laboratory}&isMonth=${this.query.month?true:false}`,{responseType: 'blob'}).then(res => {
+        this.$message.success('涓嬭浇鎴愬姛')
+        this.downLoading = false
+        const blob = new Blob([res], {
+          type: 'application/force-download'
+        })
+        let fileName="";
+        if(this.query.month){
+          fileName = year +'-'+this.query.month+' 鐝淇℃伅'
+        }else{
+          fileName = year+' 鐝姹囨��'
+        }
+        const filename = decodeURI(fileName+'.xlsx')
+        // 鍒涘缓涓�涓秴閾炬帴锛屽皢鏂囦欢娴佽祴杩涘幓锛岀劧鍚庡疄鐜拌繖涓秴閾炬帴鐨勫崟鍑讳簨浠�
+        const elink = document.createElement('a')
+        elink.download = filename
+        elink.style.display = 'none'
+        elink.href = URL.createObjectURL(blob)
+        document.body.appendChild(elink)
+        elink.click()
+        URL.revokeObjectURL(elink.href) // 閲婃斁URL 瀵硅薄
+        document.body.removeChild(elink)
       })
     },
     selectEnumByCategory() {
@@ -760,6 +795,13 @@
 .work-box.type5 span{
   color: #ff46c0 !important;
 }
+.work-box.type6{
+  background: #00036418;
+  color: #000464 !important;
+}
+.work-box.type6 span{
+  color: #000464 !important;
+}
 /* .el-icon-arrow-down::before{
   color: #c6c4c4;
 } */

--
Gitblit v1.9.3