MrShi
2024-04-02 22271e641e4505ba906c3770905b7e84e3ad8d85
company/src/components/common/UploadFile.vue
@@ -5,6 +5,7 @@
      :accept="uploadData.fileTyp"
      :action="uploadImgUrl"
      :limit="1"
      :before-remove="removes"
      :on-exceed="handleExceed"
      :on-success="handleFileSuccess"
      :on-error="uploadError"
@@ -33,12 +34,17 @@
  },
  data() {
    return {
      fileList:null,
      uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/public/upload?folder='+this.uploadData.folder
    }
  },
  methods: {
    removes() {
      this.$emit('remove')
    },
    // 上传图片
    handleExceed(){},
    handleFileSuccess(res, file) {
      if (res.code == 200) {
        let { data } = res
@@ -108,17 +114,14 @@
  height: 90px !important;
}
::v-deep .el-upload-list__item {
  width: 90px !important;
  height: 90px !important;
  width: 80% !important;
  height: 50px !important;
}
.icon {
  -webkit-transform: translate(-50%,-50%);
  -ms-transform: translate(-50%,-50%);
  transform: translate(0%, -85%);
}
::v-deep .el-upload-list__item {
  width: 90px !important;
  height: 90px !important;
}
</style>