From ce13be0bec67641a173e4eb0405b3a2bebda3747 Mon Sep 17 00:00:00 2001
From: lzhe <181968431@qq.com>
Date: 星期日, 14 四月 2024 14:46:08 +0800
Subject: [PATCH] 1

---
 src/views/home/widgets/components/ver.vue |   96 ++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 73 insertions(+), 23 deletions(-)

diff --git a/src/views/home/widgets/components/ver.vue b/src/views/home/widgets/components/ver.vue
index 0725645..dd30852 100644
--- a/src/views/home/widgets/components/ver.vue
+++ b/src/views/home/widgets/components/ver.vue
@@ -1,40 +1,90 @@
 <template>
-	<el-card shadow="hover" header="鐗堟湰淇℃伅">
-		<div style="height: 210px;text-align: center;">
-			<img src="img/ver.svg" style="height:140px"/>
-			<h2 style="margin-top: 15px;">SCUI {{$CONFIG.CORE_VER}}</h2>
-			<p style="margin-top: 5px;">鏈�鏂扮増鏈� {{ver}}</p>
-		</div>
-		<div style="margin-top: 20px;">
-			<el-button type="primary" plain round @click="golog">鏇存柊鏃ュ織</el-button>
-			<el-button type="primary" plain round @click="gogit">gitee</el-button>
-		</div>
-	</el-card>
+	<div>
+		<el-card shadow="hover" header="蹇嵎鍏ュ彛">
+			<ul>
+				<li><div>浜哄伐-閮ㄩ棬</div></li>
+				<li><div class="addMenu" @click="showDrawer">+ 娣诲姞鑿滃崟</div></li>
+			</ul>
+		</el-card>
+		<el-drawer title="閫夋嫨鑿滃崟" v-model="drawer" :direction="direction" :before-close="handleClose" size="680">
+			<div v-for="(value,key,index) in menuList">
+				<div class="parent-children-title">{{key}}</div>
+				<div class="parent-children">
+					<span v-for="item in value">
+						{{item}}
+						<div class="triangle-topright"></div>
+						<el-icon class="icon-topright"><Select /></el-icon>
+					</span>
+				</div>
+			</div>
+		</el-drawer>
+	</div>
 </template>
 
 <script>
+	import * as ElementPlusIconsVue from '@element-plus/icons-vue'
+	let icons = []
+	for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
+	    icons.push(key)
+	}
 	export default {
-		title: "鐗堟湰淇℃伅",
-		icon: "el-icon-monitor",
-		description: "褰撳墠椤圭洰鐗堟湰淇℃伅",
 		data() {
 			return {
-				ver: 'loading...'
+				direction: "rtl",
+				drawer: false,
+				menuList: {}
 			}
 		},
+		components: {...ElementPlusIconsVue},
 		mounted() {
-			this.getVer()
+			var data = this.$TOOL.data.get("MENU");
+			var obj = {};
+			data.forEach((item,index)=> {
+				if(item.name != "宸ヤ綔鍙�") {
+					obj[item.name] = this.getLastLevelNames(item.children);
+				}
+			})
+			this.menuList = obj;
 		},
 		methods: {
-			async getVer(){
-				this.ver = "1.0.0"
+			getLastLevelNames(tree) {  
+			  const lastLevelNames = [];  
+			  
+			  tree.forEach(item => {  
+			    if (item.children) {  
+			      // 閫掑綊璋冪敤锛屽鐞嗗瓙鑿滃崟椤�  
+			      const childLastLevelNames = this.getLastLevelNames(item.children);  
+			      // 灏嗗瓙鑿滃崟椤圭殑鏈�搴曞眰鍚嶇О娣诲姞鍒扮粨鏋滀腑  
+			      lastLevelNames.push(...childLastLevelNames);  
+			    } else {  
+			      // 褰撳墠椤规病鏈夊瓙鑿滃崟椤癸紝鏄渶鍚庝竴灞傦紝娣诲姞鍏跺悕绉�  
+			      lastLevelNames.push(item.name);  
+			    }  
+			  });  
+			  
+			  return lastLevelNames;  
 			},
-			golog(){
-				window.open("https://gitee.com/lolicode/scui/releases")
+			showDrawer() {
+				this.drawer = true;
 			},
-			gogit(){
-				window.open("https://gitee.com/lolicode/scui")
-			}
+			handleClose(done) {
+		        this.$confirm('纭鍏抽棴锛�').then(_ => {
+		            done();
+		         }).catch(_ => {});
+		     }
 		}
 	}
 </script>
+<style scoped>
+	ul {list-style: none;margin-bottom: 10px;overflow: hidden;}
+	ul li {float: left;margin-bottom: 8px;}
+	ul li div {border: 1px solid #3b8e8e;margin-top: 10px;height: 43px;margin-left: 10px;display: flex;align-items: center;justify-content: center;color: #3b8e8e;padding: 7px 15px;border-radius: 2px;border-radius: 2px;white-space: nowrap;cursor: pointer;}
+	ul li div:hover {background-color: #ebf4f4;}
+	.addMenu {border: 1px dashed #3b8e8e;}
+	.parent-children-title {margin-left: 10px;margin-top: 24px;font-weight: 700;font-size: 14px;text-align: left;color: #333;}
+	.parent-children {display: flex;flex-direction: row;flex-wrap: wrap;justify-content: flex-start;align-items: flex-start;padding-left: 10px;box-sizing: border-box;}
+	.parent-children span {margin-left: 10px;margin-top: 10px;width: 22%;border: 0.5px solid #20B2AA;border-radius: 2px;height: 43px;display: flex;align-items: center;justify-content: center;cursor: pointer;position: relative;}
+	.parent-children span:hover {border: 1px solid #104E8B;}
+	.triangle-topright {width: 0;height: 0;border-top: 28px solid #3b8e8e;border-left: 28px solid transparent;position: absolute;right: 0;top: 0;}
+	.icon-topright {position: absolute;right: 2px;top: 2px;z-index: 2;color: #fff;}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3