qinzhipeng_v@didiglobal.com 4 жил өмнө
parent
commit
3dcfe8ff3b

+ 4 - 3
src/api/monthly/index.js

@@ -11,10 +11,11 @@ export function materialGetMaterialList(data) {
 }
 
 // 删除素材
-export function materialDeleteMaterial(id) {
+export function materialDeleteMaterial(data) {
   return request({
-    url: TeamManagement + `/material/deleteMaterial?materialId="${id}"`,
-    method: 'get'
+    url: TeamManagement + `/material/deleteMaterial`,
+    method: 'post',
+    data
   })
 }
 

+ 3 - 4
src/views/monthly/components/createdMonthly.vue

@@ -48,6 +48,7 @@ export default {
   methods: {
     monthly_dialog() {
       this.$emit('monthly_created', this.monthly_form)
+      this.$emit('update:show', false)
     },
     handleClose(done) {
       this.monthly_show = false
@@ -56,15 +57,13 @@ export default {
       console.log(file, fileList)
     },
     handlePictureCardPreviewTow(file) {
-      console.log(file, file.url)
-      this.monthly_form.thumb = 'http:' + file.url
+      this.monthly_form.content = 'http:' + file.url
     },
     handleRemove(file, fileList) {
       console.log(file, fileList)
     },
     handlePictureCardPreview(file) {
-      console.log(file, file.url)
-      this.monthly_form.content = 'http:' + file.url
+      this.monthly_form.thumb = 'http:' + file.url
     }
   }
 }

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

@@ -120,8 +120,8 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(async() => {
-        const res = await materialDeleteMaterial(11)
-        if (res === 200) {
+        const res = await materialDeleteMaterial({ id: id })
+        if (res.code === 200) {
           this.materialGetMaterialList()
           this.$message({ type: 'success', message: '删除成功!' })
         }