y595705120 3 years ago
parent
commit
a73eeabd69
1 changed files with 10 additions and 5 deletions
  1. 10 5
      src/pages/other/file-add.vue

+ 10 - 5
src/pages/other/file-add.vue

@@ -40,8 +40,13 @@
              <el-input  v-model="info.title" type="text"></el-input>
          </el-form-item>
 
-        <el-form-item label="文章简介"  prop="filename">
-           <span> {{info.filename}}</span>
+        <el-form-item label="上传附件"  prop="filename">
+
+            <span>
+             <upload-file  placeholder="上传文档"  @rmImage="info.filename=''"  @onFinish="onUpload"/>
+             <span style="float: left;"> {{info.filename}}</span>
+            </span>
+
         </el-form-item>
 
 
@@ -174,7 +179,7 @@
             if (action === 'confirm') {
               that.$router.back()
               // push({path:'/my-file'});
-              
+
               done();
             }else{
               done();
@@ -190,7 +195,7 @@
       onSubmit(){
         this.$refs["elForm"].validate((valid) => {
           if (!valid) return;
-          let {articalId, category,brief, title, isOpen } = this.info;
+          let {articalId, category,brief, title, isOpen,filename } = this.info;
 
           if( !articalId){
             addArtical( this.info ).then(res=>{
@@ -199,7 +204,7 @@
               }
             })
           }else{
-            editArtical( {articalId, category, brief, title, isOpen }).then( res=>{
+            editArtical( {articalId, category, brief, title, isOpen,filename }).then( res=>{
               if( res.code == 200){
                 this.$router.go(-1);
               }