|
@@ -60,15 +60,15 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="附件:" class="mandatory">
|
|
|
<el-upload
|
|
|
- :disabled="!!oper.state.fileOssUrl"
|
|
|
class="upload-demo"
|
|
|
:http-request="uploadFile"
|
|
|
:multiple="false"
|
|
|
:limit="1"
|
|
|
:before-upload="beforeUpload"
|
|
|
:before-remove="beforeRemove"
|
|
|
- :file-list="oper.state.fileList">
|
|
|
- <el-button size="medium" type="primary" :disabled="!!oper.state.fileOssUrl" @click="ev => oper.state.fileOssUrl && ev.stopPropagation()"><i class="el-icon-upload2 el-icon--left"></i>上传</el-button>
|
|
|
+ :file-list="oper.state.fileList"
|
|
|
+ >
|
|
|
+ <el-button size="medium" type="primary" :disabled="!!oper.state.fileOssUrl" @click="ev => oper.state.fileOssUrl && ev.stopPropagation()"><i class="el-icon-upload2 el-icon--left"></i>上传</el-button>
|
|
|
<template v-slot:tip>
|
|
|
<div class="el-upload__tip">注:可上传100M以内的pdf、jpg、word文件</div>
|
|
|
</template>
|
|
@@ -160,14 +160,16 @@ export default {
|
|
|
let res = await axios.post(url, {file: data.file})
|
|
|
this.oper.state.fileOssUrl = res.data.ossUrl
|
|
|
data.onSuccess()
|
|
|
+ console.log('chengg');
|
|
|
} catch {
|
|
|
data.onError()
|
|
|
+ console.log('shib');
|
|
|
}
|
|
|
},
|
|
|
beforeUpload(file) {
|
|
|
let successTypes = [...imgTypes, ...fileTypes]
|
|
|
let maxSize = 100 * 1024 * 1024
|
|
|
-
|
|
|
+ console.log('oper.state.fileList',this.oper.state.fileList)
|
|
|
if (!successTypes.some(type => ~file.type.indexOf(type))) {
|
|
|
this.$message.error(`请上传${successTypes.join('、')}等格式的文件`, '提示')
|
|
|
return false
|
|
@@ -190,7 +192,7 @@ export default {
|
|
|
} else if (!this.oper.state.fileName || !this.oper.state.fileName.trim()) {
|
|
|
return this.$message.error('附件标题不能为空!', '提示')
|
|
|
}
|
|
|
-
|
|
|
+ console.log('this.oper.state.id ',this.oper.state.id )
|
|
|
this.oper.state.id ? this.oper.update() : this.oper.insert()
|
|
|
|
|
|
this.$emit('referList')
|