From 70bf5f310d85c3a0700d75a7a877f5a1e403d83f Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期四, 28 三月 2024 09:09:51 +0800
Subject: [PATCH] 合并冲突

---
 src/view/index.vue |   85 +++++++++++++++++++++++++++++++-----------
 1 files changed, 63 insertions(+), 22 deletions(-)

diff --git a/src/view/index.vue b/src/view/index.vue
index fcc83e2..04e57ba 100644
--- a/src/view/index.vue
+++ b/src/view/index.vue
@@ -162,8 +162,7 @@
 	}
 
 	.tag>.el-icon-s-unfold,
-	.el-icon-s-fold,
-	.el-icon-delete {
+	.el-icon-s-fold{
 		font-size: 16px;
 		cursor: pointer;
 		margin: 0 8px;
@@ -211,6 +210,11 @@
 	.active_tab i {
 		display: inline;
 		color: #3A7BFA;
+		border-radius: 50%;
+	}
+
+	.active_tab i:hover{
+		background-color: rgba(0, 0, 0, 0.08);
 	}
 
 	.component_view {
@@ -226,7 +230,7 @@
 	}
 
 	.right_key_menu {
-		width: 120px;
+		width: 130px;
 		position: absolute;
 		top: 0;
 		left: 0;
@@ -245,7 +249,7 @@
 	}
 
 	.right_key_menu li i {
-		margin-right: 14px;
+		margin-right: 10px;
 	}
 
 	.right_key_menu li:hover {
@@ -281,7 +285,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>
@@ -299,7 +303,6 @@
 						</div>
 					</div>
 				</el-popover>
-				</el-popover>
 			</div>
 		</div>
 		<div class="right" :style="`width: calc(100% - ${leftOpen?'92':'0'}px);`">
@@ -312,7 +315,6 @@
 						<i class="el-icon-close" @click="removeTab(ai)" v-if="tabActive!=0"></i>
 					</div>
 				</div>
-				<i class="el-icon-delete" @click="allDel" title="鍒犻櫎鎵�鏈夋爣绛鹃〉"></i>
 			</div>
 			<div class="component_view">
 				<component class="com_index" v-for="(com, index) in tabs" :is="com.u" :key="com.k" v-show="com.k == tabActive"
@@ -325,7 +327,9 @@
 			<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>
+						<li @click="rightDel(activeIndex)"><i class="el-icon-d-arrow-right"></i>鍏抽棴鍙充晶椤电</li>
 						<el-divider></el-divider>
 						<li @click="refreshTable"><i class="el-icon-refresh"></i>鍒锋柊</li>
 					</ul>
@@ -359,12 +363,7 @@
 				activeBox: 0,
 				activeP: 0,
 				tabActive: 0,
-				tabs: [{
-					k: 0,
-					v: "涓汉棣栭〉",
-					i: "font icon-a-Group1124",
-					u: "nullFace"
-				}],
+				tabs: [],
 				upIndex: 0,
 				activeIndex: 0,
 				power: []
@@ -376,9 +375,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
@@ -390,16 +416,25 @@
 					}
 				});
 				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);
 				let data = this.tabs[this.tabs.length - 1]
-				this.activeP = data.k;
-				this.tabActive = data.k;
-				this.activeBox = data.k
+				this.upTabActive(data.k)
+			},
+			rightDel(index){
+				for (var i = this.tabs.length - 1; i > index; i--) {
+					this.tabs.splice(i, 1);
+				}
+				let data = this.tabs[this.tabs.length - 1]
+				this.upTabActive(data.k)
 			},
 			allDel() {
 				this.activeBox = 0
@@ -407,10 +442,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;
@@ -423,10 +459,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");
 			},
 			// 鍏抽棴鍙抽敭鑿滃崟
@@ -477,8 +518,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