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
@@ -29,7 +44,7 @@
        <el-input type="textarea" :autosize="{ minRows: 12, maxRows: 6 }" v-model="form.introduction" placeholder="请输入应用简介" v-trim/>
      </el-form-item>
      <el-form-item label="应用详情" prop="details">
        <el-input v-model="form.details" placeholder="请输入应用详情" v-trim/>
        <RichEditor :content="{ content: form.details }" @edit="form.details = $event" :max-length="0" />
      </el-form-item>
    </el-form>
  </GlobalWindow>
@@ -40,18 +55,21 @@
import GlobalWindow from '@/components/common/GlobalWindow'
import UploadAvatarImage from '@/components/common/UploadAvatarImage'
import { fetchList } from '@/api/business/serverProvider'
import RichEditor from '@/components/common/RichEditor'
export default {
  name: 'OperaApplicationInfoWindow',
  extends: BaseOpera,
  components: { GlobalWindow, UploadAvatarImage },
  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: ''
@@ -77,6 +95,7 @@
        imgurl: '',
        imgurlfull: ''
      },
      fileList: []
    }
  },
  created () {
@@ -88,6 +107,9 @@
  methods: {
    open (title, target) {
      this.title = title
      this.file.imgurl = ''
      this.file.imgurlfull = ''
      this.fileList = []
      this.getFetchList()
      this.visible = true
      // 新建
@@ -103,10 +125,34 @@
        for (const key in this.form) {
          this.form[key] = target[key]
        }
        setTimeout(() => {
          this.form.details = target.details
        }, 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
      this.file.imgurlfull = e.imgurlfull