lilei vor 4 Jahren
Ursprung
Commit
b6f6794835
1 geänderte Dateien mit 7 neuen und 6 gelöschten Zeilen
  1. 7 6
      src/views/shop/bannerSetting.vue

+ 7 - 6
src/views/shop/bannerSetting.vue

@@ -135,7 +135,7 @@
             listType="picture-card"
             listType="picture-card"
             upText="上传"
             upText="上传"
           ></Upload>
           ></Upload>
-          <img v-else :src="formData.image" style="width:100px ;height: auto;" />
+          <img v-else :src="formData.image" style="max-width:400px ;height: auto;" />
         </a-form-item>
         </a-form-item>
         <a-form-item :wrapper-col="{ span: 12, offset: 6}" style="text-align: center;">
         <a-form-item :wrapper-col="{ span: 12, offset: 6}" style="text-align: center;">
           <a-button type="primary" html-type="submit" v-if="!disabled" id="bannerSetting-submit" style="margin-right: 15px">保存</a-button>
           <a-button type="primary" html-type="submit" v-if="!disabled" id="bannerSetting-submit" style="margin-right: 15px">保存</a-button>
@@ -304,7 +304,9 @@ export default {
       this.formData.type = ''
       this.formData.type = ''
       this.formData.image = ''
       this.formData.image = ''
       this.title = '新增'
       this.title = '新增'
-      this.$refs.bannerImage.setFileList('')
+      if (this.$refs.bannerImage) {
+        this.$refs.bannerImage.setFileList('')
+      }
       this.form.resetFields()
       this.form.resetFields()
     },
     },
     // 赋值
     // 赋值
@@ -320,20 +322,19 @@ export default {
     // 0 修改,1 查看详情
     // 0 修改,1 查看详情
     handleEdit (row, type) {
     handleEdit (row, type) {
       const _this = this
       const _this = this
-      console.log(row)
       if (type == 1) {
       if (type == 1) {
         this.title = '查看详情'
         this.title = '查看详情'
         this.hideRequiredMark = true
         this.hideRequiredMark = true
       } else if (type == 0) {
       } else if (type == 0) {
         this.title = '编辑'
         this.title = '编辑'
         this.hideRequiredMark = false
         this.hideRequiredMark = false
+        setTimeout(() => {
+          _this.$refs.bannerImage.setFileList(this.formData.image)
+        }, 500)
       }
       }
       this.assignment(row)
       this.assignment(row)
       this.disabled = type == 1
       this.disabled = type == 1
       this.visible = true
       this.visible = true
-      setTimeout(() => {
-        _this.$refs.bannerImage.setFileList(this.formData.image)
-      }, 500)
     },
     },
     // 删除
     // 删除
     delect (row) {
     delect (row) {