lxf 1 year ago
parent
commit
b69ddbaa1d
1 changed files with 19 additions and 9 deletions
  1. 19 9
      src/components/makeGroupProduct/index.vue

+ 19 - 9
src/components/makeGroupProduct/index.vue

@@ -40,10 +40,10 @@
                 </el-form-item>
               </template>
             </el-table-column>
-            <!-- <el-table-column label="设计图" align="center" width="100">
+            <el-table-column label="设计图" align="center" width="100">
               <template #default="{ row, $index }">
                 <el-form-item :prop="'skuSpecList.' + $index + '.designImgUrl'">
-                  <el-upload
+                  <!-- <el-upload
                     class="avatar-uploader"
                     action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
                     :data="uploadDesignData"
@@ -53,13 +53,18 @@
                         return handleDesignSuccess(uploadFile, $index);
                       }
                     "
-                    :before-upload="uploadDesignFile">
-                    <el-image v-if="row.designImgUrl" :src="row.designImgUrl" fit="scale-down" class="avatar" />
-                    <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
-                  </el-upload>
+                    :before-upload="uploadDesignFile"> -->
+                  <el-image
+                    v-if="row.designImgUrl"
+                    :src="row.designImgUrl"
+                    fit="scale-down"
+                    style="width: 50px; height: 50px; cursor: pointer"
+                    @click="openFile(row.designImgUrl)" />
+                  <!-- <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
+                  </el-upload> -->
                 </el-form-item>
               </template>
-            </el-table-column> -->
+            </el-table-column>
             <el-table-column label="品名" min-width="220">
               <template #default="{ row, $index }">
                 <el-form-item :prop="'skuSpecList.' + $index + '.name'" :rules="rulesSpec.name" :inline-message="true" style="width: 100%">
@@ -76,7 +81,8 @@
             </el-table-column>
             <el-table-column label="图稿文件" align="center" width="160">
               <template #default="{ row, $index }">
-                <el-button type="primary" @click="clickDrawingFile($index)" text>选择</el-button>
+                <el-button type="primary" @click="clickDrawingFile($index)" v-if="!row.sharedFolder" text>选择</el-button>
+                <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="clickDrawingFile($index)" v-else>{{ row.sharedFolder }}</a>
               </template>
             </el-table-column>
             <el-table-column label="加工版面" width="140">
@@ -541,10 +547,14 @@ const clickDrawingFile = (index) => {
   openDrawingFile.value = true;
 };
 const selectPic = (row) => {
-  console.log(row);
+  formData.data.skuSpecList[drawingFileIndex.value].sharedFolder = row.artworkName + "/" + row.fileName;
+  formData.data.skuSpecList[drawingFileIndex.value].designImgUrl = row.imgUrl;
   ElMessage({ message: "选择完成", type: "success" });
   openDrawingFile.value = false;
 };
+const openFile = (path) => {
+  window.open(path);
+};
 </script>
 
 <style lang="scss" scoped>