wente
2023-11-20 819468f088be66befd788d357af44a496150d36e
项目表
3个文件已修改
22 ■■■■■ 已修改文件
web/packages/components/zt-uploader/src/zt-uploader.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/components/config-uploader/src/config-uploader.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/project/Environ-AddOrUpdate.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/packages/components/zt-uploader/src/zt-uploader.vue
@@ -331,6 +331,8 @@
      if (this.uploadList !== val) {
        this.uploadList = this.getUploadList(val)
        this.fileList = this.getUploadList(val)
        console.log(this.fileList,'this.fileList this.fileList')
        this.$emit('getUploaderImg',this.fileList)
      }
    },
    isShowCrop(value) {
web/src/components/config-uploader/src/config-uploader.vue
@@ -18,7 +18,7 @@
        <el-table-column align="left">
          <template slot-scope="scope">
            <zt-uploader :image="image" v-model="dataForm[scope.row.busiField]" multiple :limit="scope.row.fileLimit" :file-type="scope.row.fileType"
                         :accept="scope.row.accept" :file-size="scope.row.fileSize" @input="change(scope.row.busiField)"/>
                         :accept="scope.row.accept" :file-size="scope.row.fileSize" @getUploaderImg="getUploaderImg" @input="change(scope.row.busiField)"/>
          </template>
        </el-table-column>
      </el-table>
@@ -90,12 +90,20 @@
        return null
      },
      change(busiField) {
        console.log(busiField,'busiField busiField')
        this.fields.forEach(field => {
          if (field.busiField === busiField) {
            field.files.length = 0
            this.dataForm[busiField].forEach(file => field.files.push(file))
          }
        })
      },
      getUploaderImg(list){
        // this.imageList = list
        if(list[0].url){
          this.$emit('getImageUrl',list[0].url)
        }
      }
    }
  }
web/src/views/modules/project/Environ-AddOrUpdate.vue
@@ -105,7 +105,11 @@
              <div :style="'height:'+ (151+image.height)+'px'"   class="el-wt-border-left">
                <span>{{dataForm.environ.testEnvirontDiagram}}</span>
                <config-uploader busi-type="test_environt_diagram" model-name="dataForm" :dataForm="dataForm"
                                 @getImageUrl="getImageUrl"
                                 v-model="dataForm.files"/>
                <div>
<!--                  <el-image :src="dataForm.imgUrl" :width="" :height=""></el-image>-->
                </div>
              </div>
            </div>
          </div>
@@ -203,6 +207,8 @@
    data() {
      return {
        image: {
          url:'',
          width:'',
          height:1,
        },
        dataForm: {
@@ -268,6 +274,10 @@
      addDiscrepancyRow(){
        this.dataForm.environAnalysisList.push({})
      },
      getImageUrl(url){
        this.image.url  = url
        console.log(this.image.url,' this.image.url')
      },
      // 表单提交
      async formSubmit() {
        let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/project/Environ/', this.dataForm)