dev_review
yujialong 1 year ago
parent 152b3e969f
commit f1c6f571f8
  1. 10
      src/components/upload/index.vue
  2. 2
      src/views/match/add/step1.vue
  3. 43
      src/views/parnerOperation/learnMg.vue
  4. 39
      src/views/shop/addProduct/index.vue

@ -52,6 +52,11 @@ export default {
type: Array,
default: () => []
},
// fileList使fileListfalse
changeFileList: {
type: Boolean,
default: true
},
//
onRemove: {
type: Function,
@ -70,6 +75,7 @@ export default {
this.initOss()
},
methods: {
// oss
initOss () {
this.client = new OSS({
region: 'oss-cn-shenzhen',
@ -99,14 +105,14 @@ export default {
this.uploadProgress = 0
this.uploading = true
this.showFiles = false
// ossurl
// oss
const { name } = await this.client.multipartUpload(file.name, file, {
progress: this.handleProgress
});
this.uploading = false
const url = 'http://huoran.oss-cn-shenzhen.aliyuncs.com/' + name
this.$emit('update:fileList', [
this.changeFileList && this.$emit('update:fileList', [
...this.fileList,
{
name: name,

@ -223,7 +223,7 @@
<Upload :limit="5"
:file-list.sync="fileList"
:on-remove="handleAnnexRemove"
@onSuccess="uploadAnnexSuccess"></Upload>
@onSuccess="uploadAnnexSuccess" />
</el-form-item>
</el-form>
</div>

@ -147,14 +147,11 @@
</el-form-item>
<el-form-item prop="file"
label="文件上传">
<el-upload :before-upload="fileBeforeUpload"
:on-remove="handleRemove"
:on-success="uploadSuccessFile"
:action="this.api.fileUploadNakadai"
:file-list="form.fileList"
:headers="headers">
<el-button>上传</el-button>
</el-upload>
<Upload :limit="20"
:changeFileList="false"
:file-list.sync="form.fileList"
:on-remove="handleRemove"
@onSuccess="uploadSuccessFile" />
</el-form-item>
</el-form>
<div class="btns">
@ -294,10 +291,11 @@ import Setting from '@/setting'
import Util from '@/libs/util'
import { mapState } from 'vuex'
import Editor from '@tinymce/tinymce-vue'
// import t from "tinymce-plugin/plugins/tpImportword/plugin.js";
import editorConfig from '@/utils/editor'
import Cropper from '@/components/img-upload/Cropper'
import Axios from 'axios'
import Upload from '@/components/upload';
export default {
data () {
return {
@ -357,7 +355,8 @@ export default {
},
components: {
Editor,
Cropper
Cropper,
Upload
},
watch: {
// ,
@ -641,29 +640,29 @@ export default {
this.uploading++
},
//
uploadSuccessFile (res) {
const { originalFileName, fileUrl } = res.filesResult
uploadSuccessFile (file) {
const { name, url } = file
this.uploading--
this.form.id ?
this.$post(this.api.saveParnerFile, {
contentId: this.form.id,
id: '',
fileName: originalFileName,
filePath: fileUrl
fileName: name,
filePath: url
}).then(({ data }) => {
this.form.fileList.push({
fileName: originalFileName,
filePath: fileUrl,
name: originalFileName,
url: fileUrl,
fileName: name,
filePath: url,
name: name,
url,
id: data
})
}).catch(res => { }) :
this.form.fileList.push({
fileName: originalFileName,
filePath: fileUrl,
name: originalFileName,
url: fileUrl
fileName: name,
filePath: url,
name: name,
url
})
},
//

@ -529,14 +529,11 @@
</el-form-item>
<el-form-item prop="file"
label="产品参数">
<el-upload :before-remove="beforeRemove"
:on-remove="handleFileRemove"
:on-success="uploadSuccessFile"
:action="api.fileUploadNakadai"
:file-list="form.mallAnnex"
:headers="headers">
<el-button>上传文件</el-button>
</el-upload>
<Upload :limit="20"
:changeFileList="false"
:file-list.sync="form.mallAnnex"
:on-remove="handleFileRemove"
@onSuccess="uploadSuccessFile" />
</el-form-item>
</el-col>
</el-row>
@ -748,6 +745,7 @@ import quill from "@/components/quill";
import Editor from '@tinymce/tinymce-vue'
import editorConfig from '@/utils/editor'
import Cropper from '@/components/img-upload/Cropper'
import Upload from '@/components/upload';
import Axios from 'axios'
export default {
data () {
@ -914,7 +912,8 @@ export default {
},
components: {
Editor,
Cropper
Cropper,
Upload
},
methods: {
getData () {
@ -1503,13 +1502,12 @@ export default {
uploadSuccessInterface (res) { //
this.form.mall.interfaceDiagrams.push(res.data.filesResult.fileUrl)
},
uploadSuccessFile (res) { //
const e = res.filesResult
uploadSuccessFile (file) { //
this.form.mallAnnex.push({
mallId: this.id,
filePath: e.fileUrl,
fileName: e.originalFileName,
name: e.originalFileName,
filePath: file.url,
fileName: file.name,
name: file.name
})
},
beforeRemove (file, fileList) {
@ -1662,19 +1660,6 @@ $avatar-width: 104px;
}
}
}
/deep/.el-upload__tip {
margin-top: 0;
p {
font-size: 14px;
color: rgba(0, 0, 0, 0.45);
line-height: 1;
&:first-child {
margin-bottom: 5px;
}
}
}
.pics {
display: flex;
margin-top: 10px;

Loading…
Cancel
Save