| | |
| | | <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 |
| | |
| | | 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: '' |
| | |
| | | imgurl: '', |
| | | imgurlfull: '' |
| | | }, |
| | | fileList: [] |
| | | } |
| | | }, |
| | | created () { |
| | |
| | | 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 |
| | |
| | | }, 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 |