From 76956e0f6cc235678fce936439ad932a7b8bc344 Mon Sep 17 00:00:00 2001 From: Tcsm <1377977403@qq.com> Date: 星期四, 24 八月 2023 21:41:31 +0800 Subject: [PATCH] 8.24提交 --- ruoyi-ui/src/views/homeRoot/index.vue | 70 +++++++++++++++++++++------------- 1 files changed, 43 insertions(+), 27 deletions(-) diff --git a/ruoyi-ui/src/views/homeRoot/index.vue b/ruoyi-ui/src/views/homeRoot/index.vue index 2d294c1..117432c 100644 --- a/ruoyi-ui/src/views/homeRoot/index.vue +++ b/ruoyi-ui/src/views/homeRoot/index.vue @@ -1,7 +1,7 @@ <template> <div class="app-container"> <div class="container"> - <h1 style="font-size:21px;padding-top:30px">鏃╀笂濂斤紒 + <h1 style="font-size: 21px;">{{ greeting +'锛�' + user.userName }} <el-dropdown style="float:right"> <span class="el-dropdown-link"> <img src="../../assets/images/Frame.png"> @@ -188,15 +188,18 @@ <script> import {listRoot} from "@/api/root/index"; +import { getUserProfile } from "@/api/system/user"; export default { name: "index", data(){ return{ + user: {}, + greeting: "", imageSrc: require('../../assets/images/Group 407.png') , dropdownList: [ - { name: '鍙樉绀虹涓�浠�', src: 'Group 407.png' }, - { name: '鏄剧ず鑷崇浜屼唬', src: 'Group 407.png' }, + { name: '鍙樉绀虹涓�浠�', src: 'Group 443.png' }, + { name: '鏄剧ず鑷崇浜屼唬', src: 'Group 444.png' }, { name: '鏄剧ず鑷崇涓変唬', src: 'Group 445.png' }, { name: '鏄剧ず鍏ㄩ儴', src: 'Group 407.png' } ], @@ -299,15 +302,10 @@ } }, - created() { - // this.getCateInfor() - // for (let i = 0; i < this.contactList.length; i++) { - // this.formDat[i] = this.contactList[i]; - // } - }, - mounted() { - this.getList(1); + created(){ + this.setGreeting(); + this.getUser(); }, methods:{ getInfo(src) @@ -331,21 +329,19 @@ } }, generation_1(){ - - // alert(127) // this.getList(1) - listRoot(1).then(response => { - this.rootList = response.data - this.isShow_1=true - this.isShow_2=false - this.isShow_3=false - this.isShow_4=false - }) + listRoot(1).then(response => { + this.rootList = response.data + this.isShow_1=true + this.isShow_2=false + this.isShow_3=false + this.isShow_4=false + }) }, getPersonInfo(id) { - this.$router.push("/familymodel/jiagenwang/personInfo/" + id); + this.$router.push("/familymodel/jiagenwang/personInfo/" + id); //alert(id) }, generation_2(){ @@ -386,7 +382,7 @@ this.isShow_3=false this.isShow_4=false } - // console.log(this.rootSecList) + // console.log(this.rootSecList) }) @@ -411,19 +407,39 @@ // listProperty(this.addDateRange(this.queryParams, this.dateRange)).then(response => { listRoot(depth).then(response => { - // alert(123) - // alert(123) - // console.log(response.data) - // alert(90) this.rootList = response.data; this.isShow_1=true - // alert(this.rootList[0].url) + // alert(this.rootList[0].url) // this.total = response.data.total; this.loading = false; + console.log(this.rootList) } ); }, + //闂�欙紙鏃堕棿鍒ゆ柇锛� + setGreeting() { + const currentTime = new Date(); + const currentHour = currentTime.getHours(); + + if (currentHour < 12) { + this.greeting = "鏃╀笂濂�"; + } else if (currentHour < 14) { + this.greeting = "涓崍濂�"; + } else if (currentHour < 18) { + this.greeting = "涓嬪崍濂�"; + } else { + this.greeting = "鏅氫笂濂�"; + } + }, + //闂�欙紙鑾峰彇鐢ㄦ埛鍚嶇О锛� + getUser() { + getUserProfile().then(response => { + this.user = response.data; + this.getList(1); + }); + + } } } </script> -- Gitblit v1.9.1