coys 2 tahun lalu
induk
melakukan
3eab9ecb5b
2 mengubah file dengan 32 tambahan dan 19 penghapusan
  1. 11 8
      src/components/TopBar.vue
  2. 21 11
      src/views/home/works.vue

+ 11 - 8
src/components/TopBar.vue

@@ -7,7 +7,6 @@
       </div>
       <div class="bottom-box">
         <div>
-          
           <p class="user-name">{{ userName }}</p>
 
           <p class="introduce-info" v-for="item in rolesList" :key="item.roleId">{{ orgName }} · {{ item.roleName }}</p>
@@ -50,11 +49,16 @@ export default {
   computed: {
     ...mapGetters(['userName', 'orgName', 'orgId'])
   },
-  created() {
-    this.getTheWeather()
-  },
+  created() {},
   mounted() {
-    // console.log(this.rolesList);
+    setTimeout(() => {
+      if(this.orgId){
+
+        this.getTheWeather()
+      }
+    }, 100);
+    
+
     // this.rolesList=JSON.parse(window.sessionStorage.getItem('SET_USER_ROLELIST'))||[]
   },
   methods: {
@@ -86,10 +90,9 @@ export default {
           }
         })
         setTimeout(() => {
-          
           this.rolesList = JSON.parse(window.sessionStorage.getItem('SET_USER_ROLELIST')) || []
-        }, 100);
-       console.log(this.rolesList);
+        }, 100)
+        console.log(this.rolesList)
       })
     }
   }

+ 21 - 11
src/views/home/works.vue

@@ -1,19 +1,21 @@
 <template>
   <div class="index-container">
-    <top-bar></top-bar>
+    <top-bar ref="topbar"></top-bar>
    
     <!-- 步骤条 -->
     <div :class="workList.length<=1? 'oneItem':''">
+      <div class="clas">
 
-      <van-steps :active="active" active-icon="success" active-color="#38f">
-        <van-step v-for="item in workList" :key="item.taskType" 
-        ><van-badge :content="item.nums" color="#1989fa" >
-          <a :href="`#${worksLink(1, item.taskType)}`">{{ item.taskTypeText }}</a>
-        </van-badge>
-        
-      </van-step>
-     
-    </van-steps>
+        <van-steps :active="active" active-icon="success" active-color="#38f">
+          <van-step v-for="item in workList" :key="item.taskType" 
+          ><van-badge :content="item.nums" color="#1989fa" >
+            <a :href="`#${worksLink(1, item.taskType)}`">{{ item.taskTypeText }}</a>
+          </van-badge>
+          
+        </van-step>
+       
+      </van-steps>
+      </div>
   </div>
     <div class="big_box" @scroll="scrolling">
       <!-- 列表 -->
@@ -76,7 +78,12 @@ export default {
       falg: false //待调阅的时候 不进行跳转页面单独处理
     }
   },
-  mounted() {},
+  mounted() {
+    if(this.orgId){
+
+this.$refs.topbar.getTheWeather()
+}
+  },
   created() {
     this.getList()
   },
@@ -339,4 +346,7 @@ a {
     display: none;
   }
 }
+.clas{
+  width: auto;
+}
 </style>