From 8e4ab7acddbdb84fd755acf7e75cf471f50cba60 Mon Sep 17 00:00:00 2001
From: houzhongjian <houzhongyi@126.com>
Date: 星期四, 31 十月 2024 10:16:47 +0800
Subject: [PATCH] 优化部分页面及配置

---
 src/views/Home/Index.vue |   83 ++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 80 insertions(+), 3 deletions(-)

diff --git a/src/views/Home/Index.vue b/src/views/Home/Index.vue
index b824385..340a7da 100644
--- a/src/views/Home/Index.vue
+++ b/src/views/Home/Index.vue
@@ -1,12 +1,89 @@
 <template>
-  <div>
-    <h1>这里是应用首页</h1>
-  </div>
+    <div>
+      <h1>这里是主页</h1>
+    </div>
+<!--  <div>-->
+<!--    <h1>应用列表</h1>-->
+<!--  </div>-->
+<!--  <el-skeleton :loading="loading" animated>-->
+<!--    <div id="app" v-for="(item, index) in appList" :key="`dynamics-${index}`">-->
+<!--      <div class="card" @click="gotoApp(item)">-->
+<!--        <img :src="item.icon" style="width: 100px; height: 100px" />-->
+<!--        <div>-->
+<!--          {{item.appName}}-->
+<!--        </div>-->
+<!--      </div>-->
+<!--    </div>-->
+<!--  </el-skeleton>-->
+
 </template>
 <script lang="ts" setup>
+
+import * as AppApi from '@/api/system/app'
+import {Apps} from "@/views/Home/types";
+import {CACHE_KEY, useCache} from "@/hooks/web/useCache";
 
 
 defineOptions({ name: 'Home' })
 
+const { wsCache } = useCache()
+
+const loading = ref(true)
+
+// let appList = reactive<Apps[]>([])
+//
+// const getAppList = async () => {
+//   const data = await AppApi.getAppList()
+//   appList = Object.assign(appList, data)
+// }
+//
+// const getAppMenuList = async (id) => {
+//   const data = await AppApi.getAppMenuList(id)
+//   let userInfo = wsCache.get(CACHE_KEY.USER)
+//   let routers = wsCache.get(CACHE_KEY.ROLE_ROUTERS)
+//   console.log(userInfo)
+//   console.log(routers)
+//   userInfo.menus = data
+//   wsCache.set(CACHE_KEY.USER, userInfo)
+//   wsCache.set(CACHE_KEY.ROLE_ROUTERS, data)
+//   window.location.href = '/energy/index'
+// }
+//
+// const getAllApi = async () => {
+//   await Promise.all([
+//     getAppList()
+//   ])
+//   loading.value = false
+// }
+//
+// // getAllApi()
+//
+// // 进入应用
+// const gotoApp = async (item) => {
+//   let id = item.id
+//   getAppMenuList(id)
+// }
 
 </script>
+
+<style lang="scss" scoped>
+#app{
+  width: 300px;
+  height: 200px;
+  display: inline-block;
+  background: transparent;
+}
+.card{
+  border: thin dashed gainsboro;
+  width: 150px;
+  height: 100px;
+  padding: 30px;
+  text-align: center;
+  justify-content: center;
+  font-size: 15px;
+  font-weight: bolder;
+  color: blue;
+  background: aliceblue;
+  border-radius: 10px;
+}
+</style>

--
Gitblit v1.9.3