qinzhipeng_v@didiglobal.com 4 năm trước cách đây
mục cha
commit
c894f2f969

+ 10 - 1
src/views/monthly/components/createdMonthly.vue

@@ -12,7 +12,7 @@
         </el-upload>
       </el-form-item>
       <el-form-item label="素材">
-        <el-upload action="http://star.xiaojukeji.com/upload/img.node" list-type="picture-card" :limit="1" :multiple="false" :on-preview="handlePictureCardPreview" :on-remove="handleRemove">
+        <el-upload action="http://star.xiaojukeji.com/upload/img.node" list-type="picture-card" :limit="1" :multiple="false" :on-preview="handlePictureCardPreviewTow" :on-remove="handleRemoveTow">
           <i class="el-icon-plus" />
           <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过5MB</div>
         </el-upload>
@@ -56,10 +56,19 @@ export default {
     handleClose(done) {
       this.monthly_show = false
     },
+    handleRemoveTow(file, fileList) {
+      console.log(file, fileList)
+    },
+    handlePictureCardPreviewTow(file) {
+      console.log(file, file.url)
+      this.monthly_form.thumb = 'http:' + file.url
+      this.dialogVisible = true
+    },
     handleRemove(file, fileList) {
       console.log(file, fileList)
     },
     handlePictureCardPreview(file) {
+      console.log(file, file.url)
       this.monthly_form.content = 'http:' + file.url
       this.dialogVisible = true
     }

+ 1 - 1
src/views/monthly/index.vue

@@ -110,7 +110,7 @@ export default {
     },
     async monthly_created(data) {
       console.log(data, 'cdbjksbkj')
-      const res = await materialAddMaterial()
+      const res = await materialAddMaterial(data)
       if (res.code === 200) {
         this.materialGetMaterialList()
         this.$message({ type: 'success', message: '创建成功!' })