chenrui 4 år sedan
förälder
incheckning
540f928f1c

+ 1 - 1
src/components/UploadFile/index.vue

@@ -19,7 +19,7 @@
         <a-button> <a-icon type="upload" /> {{ upText }} </a-button>
       </div>
     </a-upload>
-    <a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel">
+    <a-modal :visible="previewVisible" :footer="null" centered :maskClosable="false" @cancel="handleCancel">
       <video v-if="fileType=='video/mp4'" controls="controls" style="width: 100%" :src="previewImage" />
       <img v-else alt="example" style="width: 100%" :src="previewImage" />
     </a-modal>

+ 2 - 2
src/views/productManagement/productBrand/detailModal.vue

@@ -95,8 +95,8 @@ export default {
     }
     .productPic{
       cursor: pointer;
-      max-width: 200px;
-      max-height: 200px;
+      max-width: 100px;
+      max-height: 100px;
       margin-right: 10px;
     }
     .btn-cont {

+ 22 - 10
src/views/productManagement/productInfo/detailModal.vue

@@ -20,13 +20,12 @@
         <a-descriptions-item label="包装规格:">{{ detailsData.packQty || '--' }}{{ detailsData.packQtyUnit || '--' }}</a-descriptions-item>
         <a-descriptions-item label="箭冠产品:">{{ detailsData.arrowFalgDictValue || '--' }}</a-descriptions-item>
         <a-descriptions-item label="产品图片:" :span="2">
-          <img
-            v-for="(item,index) in fileList"
-            :key="index"
-            :src="item.url"
-            title="点击查看大图"
-            class="productPic"
-            @click="getPreview(item.url)" />
+          <div style="display: flex;">
+            <p class="pic-box" v-for="(item,index) in fileList" :key="index">
+              <img :src="item" title="点击查看大图" class="productPic" @click="getPreview(item)" />
+            </p>
+          </div>
+          <span v-if="fileList.length == 0">--</span>
         </a-descriptions-item>
         <a-descriptions-item label="单位:">{{ detailsData.unit || '--' }}</a-descriptions-item>
         <a-descriptions-item label="产品尺寸:">{{ detailsData.size || '--' }}</a-descriptions-item>
@@ -44,7 +43,7 @@
       </a-descriptions>
       <div class="btn-cont"><a-button id="product-management-detail-modal-back" @click="isShow = false">返回列表</a-button></div>
     </div>
-    <a-modal :visible="previewVisible" :footer="null" @cancel="previewVisible=false">
+    <a-modal :visible="previewVisible" :footer="null" centered :maskClosable="false" @cancel="previewVisible=false">
       <img alt="example" style="width: 100%" :src="previewImage" />
     </a-modal>
   </a-modal>
@@ -105,6 +104,7 @@ export default {
       productSnDetail({ sn: this.itemSn }).then(res => {
         if (res.status == 200) {
           this.detailsData = res.data
+          this.fileList = res.data.productMsg ? res.data.productMsg.split(',') : []
         } else {
           this.detailsData = null
         }
@@ -142,10 +142,22 @@ export default {
     .ant-modal-body {
       padding: 40px 40px 24px;
     }
-    .productPic{
-      cursor: pointer;
+    .pic-box{
       width: 100px;
+      height: 100px;
       margin-right: 10px;
+      display: inline-flex;
+      align-items: center;
+      border: 1px dashed #d9d9d9;
+      border-radius: 4px;
+      padding: 3px;
+      .productPic{
+        cursor: pointer;
+        max-width: 100%;
+        max-height: 100%;
+        display: block;
+        margin: 0 auto;
+      }
     }
     .btn-cont {
       text-align: center;

+ 8 - 5
src/views/productManagement/productInfo/edit.vue

@@ -135,8 +135,8 @@
                 id="productInfoEdit-productMsg"
                 v-model="form.productMsg"
                 ref="productMsg"
-                :fileSize="0.25"
-                @change="changeHomeImage"
+                @change="changeImage"
+                :maxNums="5"
                 listType="picture-card" ></Upload>
             </a-form-model-item>
           </a-col>
@@ -279,8 +279,8 @@ export default {
         if (res.status == 200) {
           const data = res.data
           this.form = Object.assign(this.form, data)
-          console.log(this.form)
           this.form.productType = [ this.form.productTypeSn1, this.form.productTypeSn2, this.form.productTypeSn3 ]
+          this.$refs.productMsg.setFileList(res.data.productMsg)
           this.$refs.editor.setHtml(res.data.description)
           this.$refs.otherDesc.setHtml(res.data.otherDesc)
         } else {
@@ -320,8 +320,8 @@ export default {
       this.$router.push({ path: '/productManagement/productInfo/list' })
     },
     // 产品图片上传
-    changeHomeImage (file) {
-      this.form.homeImage = file
+    changeImage (file) {
+      this.form.productMsg = file
     },
     // 产品说明 文本编辑器
     editorDescriptionChange (html, text) {
@@ -365,6 +365,9 @@ export default {
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
+      vm.$refs.productMsg.setFileList('')
+      vm.$refs.editor.setHtml('')
+      vm.$refs.otherDesc.setHtml('')
       vm.$refs.ruleForm.resetFields()
       vm.getProductBrand()
       vm.getProductType()

+ 2 - 2
src/views/setting/noticeManagement/detailModal.vue

@@ -145,8 +145,8 @@ export default {
       width: 90px;
     }
     .pic-box{
-      width: 200px;
-      height: 200px;
+      width: 100px;
+      height: 100px;
       margin-right: 10px;
       display: inline-flex;
       align-items: center;