Procházet zdrojové kódy

提交主页样式

sunyanqiang před 3 roky
rodič
revize
1d56a8062b
1 změnil soubory, kde provedl 64 přidání a 23 odebrání
  1. 64 23
      src/views/pt.vue

+ 64 - 23
src/views/pt.vue

@@ -4,7 +4,15 @@
     <div class="box">
       <!-- 头部区域 -->
       <div class="tou">
-        <span style="color: #00ccff; font-size: 1.2vw">{{ times }}</span>
+        <div class="yong_hu">
+          <span style="color: ">单位 :</span>
+          <span class="span" style="padding-left: 4px">{{ danWie }}</span>
+          <span style="color: #00f6ff">用户名 :</span>
+          <span style="padding-left: 4px; color: #00f6ff">{{ yongHu }}</span>
+        </div>
+        <span style="color: #00f6ff; font-size: 1vw" class="tiem">{{
+          times
+        }}</span>
         <!-- <img class="liuxian" src="../assets/images/流线.gif" alt />
         <img class="img-left" src="../assets/images/闪烁GIF-慢.gif" alt /> -->
       </div>
@@ -181,7 +189,11 @@
           <ul class="ul">
             <li>
               <div class="demo-box">
-                <div class="demo active" v-on:click="sixiangfun" data-url="/diary?ref=addtabs">
+                <div
+                  class="demo active"
+                  v-on:click="sixiangfun"
+                  data-url="/diary?ref=addtabs"
+                >
                   <img src="../images/sx.png" alt />
                 </div>
               </div>
@@ -597,6 +609,7 @@ import {
   updateNotice,
   getWorkTask,
 } from "@/api/pt";
+import { getUserProfile } from "@/api/system/user";
 import Cookies from "js-cookie";
 export default {
   dicts: ["sys_notice_status", "sys_notice_type"],
@@ -630,9 +643,14 @@ export default {
       form: {},
       noticeList: [],
       worklist: [],
+      // 用户信息
+      user: {},
+      danWie: "",
+      yongHu: "",
     };
   },
   created() {
+    this.getUser();
     this.timer = null;
     this.startTime();
     this.timer2 = null;
@@ -647,6 +665,14 @@ export default {
     // console.log(this.$route.params.name)
   },
   methods: {
+    // 获取登录信息
+    getUser() {
+      getUserProfile().then((response) => {
+        this.user = response.data;
+        this.danWie = response.data.dept.deptName;
+        this.yongHu = response.data.nickName;
+      });
+    },
     getlist() {
       listNotice().then((res) => {
         this.noticeList = res.data;
@@ -701,95 +727,95 @@ export default {
       this.$router
         .push({ path: "/index", query: { name: "/grassrootsregistration" } })
         .catch(() => {});
-        Cookies.set('shuaxin','false');
+      Cookies.set("shuaxin", "false");
     },
     zhanbeifun() {
       this.$router
         .push({ path: "/index", query: { name: "/combatduty" } })
         .catch(() => {});
-        Cookies.set('shuaxin','false');
+      Cookies.set("shuaxin", "false");
     },
     renlifun() {
       this.$router
         .push({ path: "/index", query: { name: "/peopleManage" } })
         .catch(() => {});
-        Cookies.set('shuaxin','false');
+      Cookies.set("shuaxin", "false");
     },
     renyuanfun() {
       this.$router
         .push({ path: "/index", query: { name: "/peopleChuRu" } })
         .catch(() => {});
-        Cookies.set('shuaxin','false');
+      Cookies.set("shuaxin", "false");
     },
     yingfangfun() {
       this.$router
         .push({ path: "/index", query: { name: "/barracksManagement" } })
         .catch(() => {});
-        Cookies.set('shuaxin','false');
+      Cookies.set("shuaxin", "false");
     },
     junchefun() {
       this.$router
         .push({ path: "/index", query: { name: "/militaryvehicleManagement" } })
         .catch(() => {});
-        Cookies.set('shuaxin','false');
+      Cookies.set("shuaxin", "false");
     },
     gongzuofun() {
       this.$router
         .push({ path: "/index", query: { name: "/workingArrangements" } })
         .catch(() => {});
-        Cookies.set('shuaxin','false');
+      Cookies.set("shuaxin", "false");
     },
     guizhangfun() {
       this.$router
         .push({ path: "/index", query: { name: "/regulations" } })
         .catch(() => {});
-        Cookies.set('shuaxin','false');
+      Cookies.set("shuaxin", "false");
     },
     yiliaofun() {
       this.$router
         .push({ path: "/index", query: { name: "/medicalhealth" } })
         .catch(() => {});
-        Cookies.set('shuaxin','false');
+      Cookies.set("shuaxin", "false");
     },
     jianchafun() {
       this.$router
         .push({ path: "/index", query: { name: "/bdglregular" } })
         .catch(() => {});
-        Cookies.set('shuaxin','false');
+      Cookies.set("shuaxin", "false");
     },
     mengangfun() {
       this.$router
         .push({ path: "/index", query: { name: "/doormanManage" } })
         .catch(() => {});
-        Cookies.set('shuaxin','false');
+      Cookies.set("shuaxin", "false");
     },
     yingjufun() {
       this.$router
         .push({ path: "/index", query: { name: "/materialManagement" } })
         .catch(() => {});
-        Cookies.set('shuaxin','false');
+      Cookies.set("shuaxin", "false");
     },
     xitongfun() {
       this.$router
         .push({ path: "/index", query: { name: "/system" } })
         .catch(() => {});
-        Cookies.set('shuaxin','false');
+      Cookies.set("shuaxin", "false");
     },
     gongju() {
       this.$router
         .push({ path: "/index", query: { name: "/tool" } })
         .catch(() => {});
-        Cookies.set('shuaxin','false');
+      Cookies.set("shuaxin", "false");
     },
     wenyinfun() {
       this.$router
         .push({ path: "/index", query: { name: "/print" } })
         .catch(() => {});
-       Cookies.set('shuaxin','false');
+      Cookies.set("shuaxin", "false");
     },
     taishifun() {
       this.$router.push({ path: "/taishi" }).catch(() => {});
-      Cookies.set('shuaxin','false');
+      Cookies.set("shuaxin", "false");
       // window.open(`/taishi`,'_self');
     },
     baomifun() {
@@ -870,7 +896,7 @@ export default {
         //     }
         //   }
         // });
-        printEachTrigger().then((res) => { 
+        printEachTrigger().then((res) => {
           if (res.code == 200) {
             if (res.print == "printUserInfo") {
               var sendId = Cookies.get("userId");
@@ -883,7 +909,7 @@ export default {
             }
           }
         });
-        workEachTrigger().then((res) => {   
+        workEachTrigger().then((res) => {
           var sendId = Cookies.get("userId");
           if (res.code == 200) {
             if (res.workEach != 0) {
@@ -894,7 +920,7 @@ export default {
             }
           }
         });
-        workTrigger().then((res) => { 
+        workTrigger().then((res) => {
           // var sendId = Cookies.get("userId");
           if (res.code == 200) {
             if (res.workRequest != 0) {
@@ -992,10 +1018,25 @@ li {
   background: url("../assets/images/首页顶部1.gif") no-repeat center;
   background-size: cover;
 }
-.tou span {
+.tou .yong_hu {
   position: absolute;
-  right: 100px;
+  right: 24px;
   top: 33px;
+  min-width: 320px;
+  font-size: 15px;
+  box-sizing: border-box;
+}
+.tou .tiem {
+  position: absolute;
+  /* right: 24px; */
+  left: 124px;
+  top: 33px;
+  min-width: 320px;
+  font-size: 15px;
+  box-sizing: border-box;
+}
+.tou .span {
+  margin-right: 20px;
 }
 .liuxian {
   position: absolute;