From 57e76b55709e8ea88a83ab6c3f665fd9ee7fd64c Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期三, 03 七月 2024 14:23:48 +0800 Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/center-lims-before into master --- src/components/view/b3-classes.vue | 67 ++++++++++++++++++++++++++++----- 1 files changed, 56 insertions(+), 11 deletions(-) diff --git a/src/components/view/b3-classes.vue b/src/components/view/b3-classes.vue index 61a4050..90cc096 100644 --- a/src/components/view/b3-classes.vue +++ b/src/components/view/b3-classes.vue @@ -49,7 +49,7 @@ </div> </div> <div class="center" v-loading="pageLoading"> - <scroll-pagination @load="init" :finishLoding="finishLoding" v-show="query.month&&list.length>0" style="height: 100%;" :key="'123'"> + <scroll-pagination @load="init" :finishLoding="finishLoding" v-show="query.month&&list.length>0" style="height: 100%;" :key="'123'" :list="list"> <div class="clearfix"> <div class="fixed-left"> <div class="content-title" style="padding-left: 16px;box-sizing: border-box;"> @@ -83,25 +83,21 @@ 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',type6:m.shift==='6'}"> - <!-- <div class="work-box-left"> - <span>{{ getShiftByDic(m.shift) }}</span> - </div> --> - <el-dropdown trigger="click" placement="bottom" @command="e=>handleCommand(e,m)" :disabled="!downPower"> - <!-- <i class="el-icon-arrow-down el-icon--right" style="font-size: 20px;color: #fff;cursor: pointer;"></i> --> + <el-dropdown trigger="click" placement="bottom" @command="e=>handleCommand(e,m)" :disabled="!upPower" style="width: 100%;height: 100%;cursor: pointer;"> + <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'}"> <span style="cursor: pointer;" :style="`opacity: ${getShiftByDic(m.shift)=='鏃�'?0:1};`">{{ getShiftByDic(m.shift) }}</span> + </div> <el-dropdown-menu slot="dropdown"> <el-dropdown-item v-for="(n,j) in classType" :key="'h'+j" :command="n.value">{{ n.label }}</el-dropdown-item> </el-dropdown-menu> </el-dropdown> - </div> </div> </div> </div> </div> </div> </scroll-pagination> - <scroll-pagination @load="initYear" :finishLoding="finishLoding" v-show="!query.month&&yearList.length>0" style="width: 100%;" :key="'111'"> + <scroll-pagination @load="initYear" :finishLoding="finishLoding" v-show="!query.month&&yearList.length>0" style="width: 100%;" :key="'111'" :list="yearList"> <div class="clearfix year-table"> <div class="fixed-left"> <div class="content-title" style="padding-left: 16px;box-sizing: border-box;"> @@ -288,6 +284,7 @@ monthList:[], yearList:[], downLoading:false, + keyMap:{}, } }, watch: { @@ -332,6 +329,8 @@ refresh(){ this.list = []; this.yearList = [] + this.keyMap = {}; + this.finishLoding = false; this.currentPage = 1 this.query = { userName:'', @@ -346,7 +345,9 @@ } }, refreshTable(){ + this.keyMap = {}; this.currentPage = 1 + this.finishLoding = false; if(this.query.month){ this.list = []; this.init() @@ -356,6 +357,14 @@ } }, init(){ + const key = `_${this.currentPage}` + const value = this.keyMap[key] + // 濡傛灉value瀛樺湪锛岃〃绀虹紦瀛樻湁鍊硷紝閭d箞闃绘璇锋眰 + if(value) { + return + } + // value涓嶅瓨鍦紝琛ㄧず绗竴娆¤姹�,璁剧疆鍗犱綅 + this.keyMap[key] = 'temp' if(this.currentPage==1){ this.pageLoading = true } @@ -406,6 +415,14 @@ }) }, initYear(){ + const key = `_${this.currentPage}` + const value = this.keyMap[key] + // 濡傛灉value瀛樺湪锛岃〃绀虹紦瀛樻湁鍊硷紝閭d箞闃绘璇锋眰 + if(value) { + return + } + // value涓嶅瓨鍦紝琛ㄧず绗竴娆¤姹�,璁剧疆鍗犱綅 + this.keyMap[key] = 'temp' // pageYear if(this.currentPage==1){ this.pageLoading = true @@ -619,6 +636,33 @@ return obj.label } return '鏃�' + }, + scrollInit() { + // 鑾峰彇瑕佺粦瀹氫簨浠剁殑鍏冪礌 + const nav = document.getElementById("nav") + var flag; // 榧犳爣鎸変笅 + var downX; // 榧犳爣鐐瑰嚮鐨剎涓嬫爣 + var scrollLeft; // 褰撳墠鍏冪礌婊氬姩鏉$殑鍋忕Щ閲� + nav.addEventListener("mousedown", function(event) { + flag = true; + downX = event.clientX; // 鑾峰彇鍒扮偣鍑荤殑x涓嬫爣 + scrollLeft = this.scrollLeft; // 鑾峰彇褰撳墠鍏冪礌婊氬姩鏉$殑鍋忕Щ閲� + }); + nav.addEventListener("mousemove", function(event) { + if (flag) { // 鍒ゆ柇鏄惁鏄紶鏍囨寜涓嬫粴鍔ㄥ厓绱犲尯鍩� + var moveX = event.clientX; // 鑾峰彇绉诲姩鐨剎杞� + var scrollX = moveX - downX; // 褰撳墠绉诲姩鐨剎杞翠笅鏍囧噺鍘诲垰鐐瑰嚮涓嬪幓鐨剎杞翠笅鏍囧緱鍒伴紶鏍囨粦鍔ㄨ窛绂� + this.scrollLeft = scrollLeft - scrollX // 榧犳爣鎸変笅鐨勬粴鍔ㄦ潯鍋忕Щ閲忓噺鍘诲綋鍓嶉紶鏍囩殑婊戝姩璺濈 + } + }); + // 榧犳爣鎶捣鍋滄鎷栧姩 + nav.addEventListener("mouseup", function() { + flag = false; + }); + // 榧犳爣绂诲紑鍏冪礌鍋滄鎷栧姩 + nav.addEventListener("mouseleave", function(event) { + flag = false; + }); } } } @@ -683,6 +727,7 @@ min-height: calc(100% - 10px); /* 瑙嗗彛楂樺害 */ margin-left: 220px; overflow-x: scroll; + /* overflow-x: hidden; */ } .content { @@ -748,7 +793,7 @@ display: flex; align-items: center; justify-content: space-around; - background: #F5F7FB; + background: #edeff2; border-radius: 8px 8px 8px 8px; color: #999; font-size: 14px; @@ -850,7 +895,7 @@ margin-left: 10px; } .hoverType{ - background: rgba(58,123,250,0.05); + background: rgba(58,123,250,0.03); } .year-table{ width: 100%; -- Gitblit v1.9.3