Browse Source

电子书视频上传

zhangxc 5 years ago
parent
commit
9691f8b2f0
1 changed files with 18 additions and 11 deletions
  1. 18 11
      src/components/icss/AddMedicinePrompt.vue

+ 18 - 11
src/components/icss/AddMedicinePrompt.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-    <div class="NoiseTemplateWrapper TemplateWrapper">
+    <div class="NoiseTemplateWrapper TemplateWrapper knowledgeWrapper">
         <crumbs
         <crumbs
           :title="'医学术语静态知识维护-'+title"
           :title="'医学术语静态知识维护-'+title"
           class="topBack"
           class="topBack"
@@ -48,7 +48,6 @@
                 </el-form-item>
                 </el-form-item>
                  <el-form-item  v-if="upload" label="上传文件:" label-width="160px">
                  <el-form-item  v-if="upload" label="上传文件:" label-width="160px">
                       <el-upload
                       <el-upload
-                       
                           class="upload-demo"
                           class="upload-demo"
                           :action="config.urls.promptServer"
                           :action="config.urls.promptServer"
                           name="upfile"
                           name="upfile"
@@ -159,12 +158,11 @@
             const data = res.data.data;
             const data = res.data.data;
             
             
             if(this.form.typeId === 82 || this.form.typeId === 83){
             if(this.form.typeId === 82 || this.form.typeId === 83){
+              console.log('data',data)
              this.form.fileList=data&&data.map((it)=>{
              this.form.fileList=data&&data.map((it)=>{
-                return {
-                        name: it.text,
-                        url: it.content.replace(config.imgHost,"")
-                      };
+                return JSON.parse(it.content);
               });
               });
+              console.log(' this.form.fileList', this.form.fileList)
               this.showFileList = true
               this.showFileList = true
               this.showUpLoad = false
               this.showUpLoad = false
             }else{
             }else{
@@ -187,7 +185,6 @@
     },
     },
     methods: {
     methods: {
       changeWord(newVal){
       changeWord(newVal){
-        console.log('newVal',newVal)
         const name = newVal.nameType;
         const name = newVal.nameType;
         this.form.selectedTermName = name;
         this.form.selectedTermName = name;
         this.form.selectedTerm=name;
         this.form.selectedTerm=name;
@@ -308,15 +305,18 @@
         const item=this.form.prags;
         const item=this.form.prags;
         let param= []
         let param= []
         if(this.form.typeId === 82 || this.form.typeId === 83){
         if(this.form.typeId === 82 || this.form.typeId === 83){
+           if(this.form.fileList.length === 0){
+             this.warning("文件未上传,不存储数据")
+             return
+           }
             param.push(Object.assign({},{
             param.push(Object.assign({},{
                     position: this.form.typeId === 82 ? "8" : "9",
                     position: this.form.typeId === 82 ? "8" : "9",
                     conceptId:this.form.conceptId,
                     conceptId:this.form.conceptId,
                     title: this.form.fileTitle,
                     title: this.form.fileTitle,
                     orderNo:0,
                     orderNo:0,
-                    content:this.form.fileList[0].url,
-                    text:this.form.fileList[0].name
+                    content:JSON.stringify(this.form.fileList[0]),
           }))
           }))
-          
+         
         }else {
         }else {
           param =item.map((it,i)=>{
           param =item.map((it,i)=>{
             return Object.assign({},it,{
             return Object.assign({},it,{
@@ -380,7 +380,8 @@
           this.form.fileList=[]
           this.form.fileList=[]
            this.form.fileList.push({
            this.form.fileList.push({
              name: response.data.title, 
              name: response.data.title, 
-             url: config.imgHost+response.data.url
+             url: response.data.url,
+             size: response.data.size
            })
            })
              this.showUpLoad = false
              this.showUpLoad = false
            if(!this.form.fileTitle){
            if(!this.form.fileTitle){
@@ -441,5 +442,11 @@
     .NoiseTemplateWrapper .el-select .el-input .el-icon-circle-close{
     .NoiseTemplateWrapper .el-select .el-input .el-icon-circle-close{
         display: inherit!important;
         display: inherit!important;
     }
     }
+    .el-button--default{
+      color: #22ccc8!important;
+    }
+    .el-button--primary{
+      color: #ffffff!important;
+    }
 </style>
 </style>