rk
2025-09-22 cf2391a86bdea88196d49cd33949570f74c0985d
frontWuhu/src/components/business/OperaApplicationInfoWindow.vue
@@ -12,6 +12,21 @@
      <el-form-item label="应用LOGO" prop="logo">
        <UploadAvatarImage :uploadData="uploadData" :file="file" @uploadSuccess="getFiles" />
      </el-form-item>
      <el-form-item label="应用附件" prop="mutifileUrl">
        <el-upload
          class="upload-demo"
          :action="uploadImgUrl"
          :data="uploadData"
          accept=".pdf,.jpg,.png,.jpeg,.zip,.rar"
          :limit="1"
          :on-exceed="exceed"
          :on-remove="remove"
          :on-success="getFileSuccess"
          :file-list="fileList">
          <el-button size="small" type="primary">点击上传</el-button>
          <div slot="tip" class="el-upload__tip">只能上传PDF、图片、压缩包格式文件</div>
        </el-upload>
      </el-form-item>
      <el-form-item label="服务商" prop="serverId">
        <el-select v-model="form.serverId" placeholder="请选择">
          <el-option
@@ -47,12 +62,14 @@
  components: { GlobalWindow, UploadAvatarImage, RichEditor },
  data () {
    return {
      uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/public/uploadPicture',
      // 表单数据
      form: {
        id: null,
        serverId: '',
        name: '',
        logo: '',
        mutifileUrl: '',
        lables: '',
        introduction: '',
        details: ''
@@ -78,6 +95,7 @@
        imgurl: '',
        imgurlfull: ''
      },
      fileList: []
    }
  },
  created () {
@@ -89,12 +107,13 @@
  methods: {
    open (title, target) {
      this.title = title
      this.file.imgurl = ''
      this.file.imgurlfull = ''
      this.fileList = []
      this.getFetchList()
      this.visible = true
      // 新建
      if (target == null) {
        this.file.imgurl = ''
        this.file.imgurlfull = ''
        this.$nextTick(() => {
          this.$refs.form.resetFields()
          this.form[this.configData['field.id']] = null
@@ -111,7 +130,28 @@
        }, 500)
        this.file.imgurl = target.logo
        this.file.imgurlfull = target.fullLog
        if (target.fullMutifileUrl) {
          this.fileList.push({
            name: '应用附件',
            url: target.fullMutifileUrl
      })
        }
      })
    },
    getFileSuccess(response) {
      this.form.mutifileUrl = response.data.imgaddr
      // response.data.originname
      this.fileList.push({
        name: '应用附件',
        url: response.data.url
      })
    },
    exceed() {
      this.$message.warning('只能上传一个附件')
    },
    remove() {
      this.form.mutifileUrl = ''
      this.fileList = []
    },
    getFiles(e) {
      this.file.imgurl = e.imgurl