| 
					
				 | 
			
			
				@@ -1,10 +1,10 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   <div class="main"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <div class="main-body"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      <el-form class="p20" label-width="100px"  label-position="left" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <el-form class="p20" label-width="90px"  label-position="center" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       ref="elForm" :model="info" :rules="rules" > 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <el-row> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <el-col :span="8" > 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <el-col :span="6" > 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <el-form-item label="所属部门" class="mt20" prop="department" > 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				              <el-select v-model="info.department" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               @change="selectDepartment($event)" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -20,8 +20,8 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             </el-form-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           </el-col> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <el-col :span="8"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-             <el-form-item label="所属分类" class="mt20" prop="category"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <el-col :span="6"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             <el-form-item label="文件分类" class="mt20" prop="category"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                  <el-select v-model="info.category" collapse-tags placeholder="请选择"  clearable> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    <el-option v-for="(item,index) in categorys" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    :value="index" :key="index" :label="item"></el-option> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -29,7 +29,14 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				              </el-form-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           </el-col> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <el-col :span="8"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <el-col :span="5"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             <el-form-item label="选择年度" class="mt20" prop="bucket"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 <el-date-picker  v-model="info.bucket" type="year" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    format="yyyy" value-format="yyyy"  clearable></el-date-picker> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             </el-form-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </el-col> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <el-col :span="4"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <el-form-item label="是否公开" class="mt20" prop="category"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 <el-switch :active-value="1" :inactive-value="0" v-model="info.isOpen"></el-switch> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             </el-form-item> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -107,6 +114,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         rules: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           title:[{required:true, message:'请输入标题'}], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           brief:[{required:true, message:'请输入简介'}], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          bucket:[{required:true, message:'请输入年度'}], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           category:[{required:true, message:'请输入选择分类'}], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           isOpen:[{required:true, message:'请'}], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           department:[{required:true, message:'请选择部门'}], 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -122,23 +130,25 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return data.owners[ val ] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    beforeMount(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      this.showDepartments = this.userDepartments.filter( item=>{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return item.isLeader == 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      if( this.showDepartments.length >0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        let department = this.showDepartments[0]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.info.departmentId = department.departmentId 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.info.department = department.department; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     created(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.articalId = +this.$route.query.articalId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       if( this.articalId){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.loadArtical(  this.articalId ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.initShowDepartment() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     methods:{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      initShowDepartment(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.showDepartments = this.userDepartments.filter( item=>{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          return item.isLeader == 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if( this.showDepartments.length >0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          let department = this.showDepartments[0]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.info.departmentId = department.departmentId 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.info.department = department.department; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       useIframe(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let {filename} = this.info; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.info.brief = `<p><iframe src="${data.preview}${filename}" style="width:100%;height:800px"></iframe></p>`; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -148,15 +158,12 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (res.code == 200) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               this.info = res.data.info; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               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){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              if( this.isLeader < 1){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 let query= {articalId: articalId } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 this.$router.push( {path: '/file-info', query}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              this.initShowDepartment() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				          }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -195,7 +202,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       onSubmit(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.$refs["elForm"].validate((valid) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           if (!valid) return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          let {articalId, category,brief, title, isOpen,filename } = this.info; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          let {articalId, category,brief, title, isOpen,filename,bucket } = this.info; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           if( !articalId){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             addArtical( this.info ).then(res=>{ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -204,7 +211,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            editArtical( {articalId, category, brief, title, isOpen,filename }).then( res=>{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            editArtical( {articalId, category, brief, title, isOpen,filename,bucket }).then( res=>{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               if( res.code == 200){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 this.$router.go(-1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               } 
			 |