chenrui 3 anos atrás
pai
commit
4c8a298a1f

+ 1 - 20
src/views/productManagement/productInfo/detailModal.vue

@@ -76,26 +76,7 @@ export default {
       detailsData: null, //  详情数据
       previewVisible: false,
       previewImage: '',
-      fileList: [
-        {
-          uid: '-1',
-          name: 'image.png',
-          status: 'done',
-          url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'
-        },
-        {
-          uid: '-2',
-          name: 'image.png',
-          status: 'done',
-          url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'
-        },
-        {
-          uid: '-3',
-          name: 'image.png',
-          status: 'done',
-          url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'
-        }
-      ]
+      fileList: []
     }
   },
   methods: {

+ 20 - 1
src/views/productManagement/productInfo/edit.vue

@@ -283,7 +283,18 @@ export default {
           const data = res.data
           this.form = Object.assign(this.form, data)
           this.form.productType = [ this.form.productTypeSn1, this.form.productTypeSn2, this.form.productTypeSn3 ]
-          this.$refs.productMsg.setFileList(res.data.productMsg)
+          if (res.data.productPicList && res.data.productPicList.length > 0) {
+            let str = ''
+            res.data.productPicList.map(item => {
+              if (item.imageUrl) {
+                str += item.imageUrl + ','
+              }
+            })
+            str = str.substr(0, str.length - 1)
+            this.$refs.productMsg.setFileList(str)
+          } else {
+            this.$refs.productMsg.setFileList('')
+          }
           this.$refs.editor.setHtml(res.data.description)
           this.$refs.otherDesc.setHtml(res.data.otherDesc)
         } else {
@@ -303,6 +314,14 @@ export default {
         if (valid) {
           const form = JSON.parse(JSON.stringify(_this.form))
           form.id = _this.$route.params.id ? _this.$route.params.id : undefined
+          form.productPicList = []
+          if (form.productMsg) {
+            const arr = form.productMsg.split(',')
+            arr.map(item => {
+              form.productPicList.push({ imageUrl: item })
+            })
+          }
+          delete form.productMsg
           delete form.productType
           delete form.updateDate
           _this.spinning = true