unknown 3 년 전
부모
커밋
a73095fd3e
4개의 변경된 파일26개의 추가작업 그리고 11개의 파일을 삭제
  1. 9 6
      src/pages/other/file-add.vue
  2. 9 2
      src/pages/other/index.vue
  3. 7 3
      src/pages/other/my-file.vue
  4. 1 0
      src/router/index.js

+ 9 - 6
src/pages/other/file-add.vue

@@ -142,11 +142,12 @@
          getArticalInfo({articalId}).then(res => {
            if (res.code == 200) {
               this.info = res.data.info;
-              for (let i in this.userDepartments) {
-               if (this.userDepartments[i].departmentId == this.info.departmentId) {
-                 this.isLeader = this.userDepartments[i].isLeader;
-               }
-              }
+              this.isLeader=res.data.isLeader
+              // for (let i in this.userDepartments) {
+              //  if (this.userDepartments[i].departmentId == this.info.departmentId) {
+              //    this.isLeader = this.userDepartments[i].isLeader;
+              //  }
+              // }
               if( this.isLeader < 2){
                 let query= {articalId: articalId }
                 this.$router.push( {path: '/file-info', query})
@@ -171,7 +172,9 @@
           confirmButtonText: "回到我的文件",
           beforeClose: (action, instance, done) => {
             if (action === 'confirm') {
-              that.$router.push({path:'/my-file'});
+              that.$router.back()
+              // push({path:'/my-file'});
+              
               done();
             }else{
               done();

+ 9 - 2
src/pages/other/index.vue

@@ -1,8 +1,12 @@
 <template lang="html">
   <div class="other-container" style="margin-top: 178px;">
     <IHeader />
-     <div>
-      <router-view></router-view>
+    <div>
+      <keep-alive>
+        <router-view v-if="$route.keepAlive">
+        </router-view>
+      </keep-alive>
+      <router-view v-if="!$route.keepAlive"></router-view>
      </div>
      <IFooter />
   </div>
@@ -22,6 +26,9 @@ export default {
     return {
     };
   },
+  created(){
+    console.log( $route )
+  },
   computed: {
   	...mapGetters("user", ["userInfo", "userDepartments"])
   }

+ 7 - 3
src/pages/other/my-file.vue

@@ -26,7 +26,7 @@
               </el-form-item>
 
               <el-form-item>
-                <el-button @click="getArticalList" type="primary">搜索</el-button>
+                <el-button @click="getArticalList" type="primary">搜索 </el-button>
               </el-form-item>
             </el-form>
 
@@ -98,6 +98,7 @@ export default {
   },
   watch:{
     'searchInfo.keyword'(val){
+      console.log("watch", val)
       this.getArticalList()
     }
   },
@@ -124,14 +125,17 @@ export default {
   filters:{
     toDatetime
   },
-  mounted() {
+  created() {
+    console.log("created", this.$route.keepAlive)
     this.getArticalList();
   },
   methods: {
     ...mapActions("user", ["logout"]),
     download( row ){
       // let articalId = row.articalId
-      download( `/api/artical/downloadFile/${articalId}`)
+      // download( `/api/artical/downloadFile/${articalId}`)
+      let query= {articalId: row.articalId }
+      this.$router.push( {path: '/file-info', query})
       // window.open( `http://smoa.ndjsxh.cn:8888/api/downloadFile/${articalId}`)
     },
     editFile( row ){

+ 1 - 0
src/router/index.js

@@ -99,6 +99,7 @@ export const constantRoutes = [
         {
           path: '/my-file',
           component: () => import('@/pages/other/my-file'),
+          keepAlive:true,
           hidden: true
         },
         {