hcong
2024-11-15 18eee6f8818b864d1f8d8fb56298620921f909e4
src/views/fysp/check/components/ComChangeEdit.vue
@@ -3,9 +3,7 @@
    <div class="t-card_item">
      整改图片&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <div>
        <!-- <el-button @click="chosePicFromAnyPic">从任意图片选取</el-button> -->
        <!-- <el-button type="primary" @click="chosePicFromLedgerPic">从台账选取</el-button> -->
        <el-button @click="choseChangePic">从文件夹选取</el-button>
        <el-button @click="choseChangePic" :disabled="fileList.length >= 3">从文件夹选取</el-button>
      </div>
    </div>
    <el-upload
@@ -21,30 +19,35 @@
      :disabled="readonly"
      accept="image/*"
    >
      <el-button type="primary" id="uploadBtnId" style="display: none"></el-button>
      <el-icon>
        <Plus />
      </el-icon>
      <template #trigger v-if="fileList.length < 3 && !readonly">
        <el-button
          v-if="fileList.length < 3"
          type="primary"
          id="uploadBtnId"
          style="display: none"
        ></el-button>
        <el-icon>
          <Plus />
        </el-icon>
      </template>
      <template #tip>
        <div style="color: #f56c6c">最少上传一张图片,最多选择三张图片</div>
      </template>
    </el-upload>
    <div class="flex-div">
      <el-button type="primary" @click="onSubmit">保存</el-button>
      <el-button @click="this.$emit('submited', false)">取消</el-button>
    </div>
    <el-dialog
      title="任意图片"
      width="80%"
      v-model="anyPhotoDialog"
      :before-close="beforeAnyPhotoDialogclose"
    <ArbitraryPhoto
      :max-select="maxSelectImgCount - fileList.length"
      v-if="anyPhotoDialog"
      v-model:dialog-visible="anyPhotoDialog"
      @submit="handleSelectedAnyPhono"
      :subtask="subtask"
      :defaultFile="fileList"
      ref="arbitraryPhotoRef"
    >
      <ArbitraryPhoto
        v-if="anyPhotoDialog"
        @selectByAnyPhonoEvent="handleSelectedAnyPhono"
        :subtask="subtask"
        :defaultFile="fileList"
        ref="arbitraryPhotoRef"
      >
      </ArbitraryPhoto>
    </el-dialog>
    </ArbitraryPhoto>
    <el-dialog
      title="台账图片"
      width="80%"
@@ -109,6 +112,8 @@
  },
  data() {
    return {
      // 图片选择最大数量
      maxSelectImgCount: 3,
      previewDialogImageUrl: '',
      previewDialogVisible: false,
      fileList: [],
@@ -145,14 +150,19 @@
        return;
      }
      let beforeEditImgList = [];
      useCloned(this.oldChangeFileList).cloned.value.forEach((oldChangeFileitem) => {
        if (oldChangeFileitem.ischanged == 1) {
          oldChangeFileitem.url =
            $fysp.imgUrl + oldChangeFileitem.extension1 + oldChangeFileitem.guid + '.jpg';
          oldChangeFileitem.name = '1';
          beforeEditImgList.push(oldChangeFileitem);
      useCloned(this.oldChangeFileList).cloned.value.forEach(
        (oldChangeFileitem) => {
          if (oldChangeFileitem.ischanged == 1) {
            oldChangeFileitem.url =
              $fysp.imgUrl +
              oldChangeFileitem.extension1 +
              oldChangeFileitem.guid +
              '.jpg';
            oldChangeFileitem.name = '1';
            beforeEditImgList.push(oldChangeFileitem);
          }
        }
      });
      );
      this.fileList = useCloned(beforeEditImgList).cloned.value;
      this.oldFileList = useCloned(beforeEditImgList).cloned.value;
    },
@@ -179,13 +189,12 @@
          }
          exclude = false;
          // picUrls.push(item)
        } else {
        }
      });
      const that = this;
      let deleteImgCopy = this.deleteImg;
      if (this.changeType == 1) {
        fileUtil.getImageFiles(picUrls, function (files) {
          data.append('deleteImg', deleteImgCopy);
@@ -193,11 +202,11 @@
          files.forEach((image) => {
            data.append('images', image);
          });
          problemApi.updateChange(data).then((res) => {});
        });
        that.$emit('submited', true);
      }else {
      } else {
        fileUtil.getImageFiles(picUrls, function (files) {
          data.append('problemId', that.problemId);
          files.forEach((image) => {
@@ -313,4 +322,7 @@
  width: 100%;
  height: 100%;
}
::v-deep .el-upload--picture-card {
  border: 0 !important;
}
</style>