From c91ea4d8cda53c0f319c9f4306ff03e7c774bca0 Mon Sep 17 00:00:00 2001 From: zouyu <2723363702@qq.com> Date: 星期五, 15 三月 2024 16:03:56 +0800 Subject: [PATCH] 业务管理:检验任务(update) --- src/view/index.vue | 68 +++++++++++++++++++++++++-------- 1 files changed, 51 insertions(+), 17 deletions(-) diff --git a/src/view/index.vue b/src/view/index.vue index 83766bf..3a373e8 100644 --- a/src/view/index.vue +++ b/src/view/index.vue @@ -12,11 +12,12 @@ height: 48px; display: flex; align-items: center; - padding: 0 30px; + padding: 0 24px; } .logo { width: 130px; + height: 40px; } .logo img { @@ -162,7 +163,7 @@ .tag>.el-icon-s-unfold, .el-icon-s-fold, - .el-icon-delete { + .tag>.el-icon-delete { font-size: 16px; cursor: pointer; margin: 0 8px; @@ -264,7 +265,7 @@ <div class="all" @click="closeRightKey"> <div class="title"> <div class="logo"> - <!-- <img src="../../static/img/logo 1.png" /> --> + <img src="../../static/img/logo1.png" /> </div> <div class="label">LIMS瀹為獙瀹ょ鐞嗙郴缁�</div> <div class="user"> @@ -280,7 +281,7 @@ <i :class="a.i"></i> <div>{{a.v}}</div> </div> - <el-popover placement="right-start" trigger="click" v-if="a.self != true && getPower(a.p)"> + <el-popover ref="popoverName" placement="right-start" trigger="click" v-if="a.self != true && getPower(a.p)"> <div :class="`box ${activeBox == a.k ? 'active_box' : ''}`" slot="reference"> <i :class="a.i"></i> <div style="text-align: center;">{{ a.v }}</div> @@ -297,7 +298,6 @@ </el-col> </div> </div> - </el-popover> </el-popover> </div> </div> @@ -324,7 +324,8 @@ <el-col :span="24"> <el-card :body-style="{padding: '6px'}"> <ul> - <li style="color: red;" @click="removeTab(activeIndex)"><i class="el-icon-close"></i>鍏抽棴</li> + <li @click="removeTab(activeIndex)"><i class="el-icon-close"></i>鍏抽棴</li> + <li @click="allDel"><i class="el-icon-delete"></i>鍏抽棴鎵�鏈�</li> <el-divider></el-divider> <li @click="refreshTable"><i class="el-icon-refresh"></i>鍒锋柊</li> </ul> @@ -358,12 +359,7 @@ activeBox: 0, activeP: 0, tabActive: 0, - tabs: [{ - k: 0, - v: "涓汉棣栭〉", - i: "font icon-a-Group1124", - u: "nullFace" - }], + tabs: [], upIndex: 0, activeIndex: 0, power: [] @@ -375,9 +371,36 @@ mounted() { this.userName = JSON.parse(localStorage.getItem("user")).name; this.power = JSON.parse(sessionStorage.getItem('power')) + this.tabs = JSON.parse(localStorage.getItem('tabs')) + if (this.tabs == undefined || this.tabs == null) { + this.tabs = [{ + k: 0, + v: "涓汉棣栭〉", + i: "font icon-a-Group1124", + u: "nullFace" + }] + } + this.tabActive = JSON.parse(localStorage.getItem('tabActive')) + if (this.tabActive == undefined || this.tabActive == null) { + this.tabActive = 0 + } + this.activeP = JSON.parse(localStorage.getItem('activeP')) + if (this.activeP == undefined || this.activeP == null) { + this.activeP = 0 + } + this.activeBox = JSON.parse(localStorage.getItem('activeBox')) + if (this.activeBox == undefined || this.activeBox == null) { + this.activeBox = 0 + } this.getPower() }, methods: { + saveClick(){ + localStorage.setItem('tabs', JSON.stringify(this.tabs)) + localStorage.setItem('tabActive', JSON.stringify(this.tabActive)) + localStorage.setItem('activeP', JSON.stringify(this.activeP)) + localStorage.setItem('activeBox', JSON.stringify(this.activeBox)) + }, addTab(ob, self) { this.activeBox = self == -1 ? ob.k : self this.activeP = ob.k; //0 @@ -389,9 +412,13 @@ } }); if (num == -1) { - if(ob.u == "") ob.u = "nullFace" + if (ob.u == "") ob.u = "nullFace" this.tabs.push(ob); } + this.$refs['popoverName'].forEach(a=>{ + a.doClose() + }) + this.saveClick() }, removeTab(index) { this.tabs.splice(index, 1); @@ -399,6 +426,7 @@ this.activeP = data.k; this.tabActive = data.k; this.activeBox = data.k + this.saveClick() }, allDel() { this.activeBox = 0 @@ -406,10 +434,11 @@ this.tabActive = 0 this.tabs = [{ k: 0, - v: " 棣栭〉", + v: "涓汉棣栭〉", i: "font icon-a-Group1124", - u: "index-index" + u: "nullFace" }] + this.saveClick() }, upTabActive(num) { this.tabActive = num; @@ -422,10 +451,15 @@ } }) } + this.saveClick() }, out() { sessionStorage.clear(); localStorage.removeItem("autoenter"); + localStorage.removeItem("tabs") + localStorage.removeItem("tabActive") + localStorage.removeItem("activeP") + localStorage.removeItem("activeBox") this.$router.push("/enter"); }, // 鍏抽棴鍙抽敭鑿滃崟 @@ -476,8 +510,8 @@ groupCount(g1, gs) { if (g1 == undefined) return 24 let count = 0 - gs.forEach(a=>{ - if(a.g == g1) count++ + gs.forEach(a => { + if (a.g == g1) count++ }) if (count > 4) return 8 if (count > 1) return 12 -- Gitblit v1.9.3