|
@@ -74,7 +74,7 @@
|
|
|
:on-progress="handleProgress"
|
|
|
:before-upload="beforeUpload"
|
|
|
:on-success="handleSuccess"
|
|
|
- :data="{type: 1}"
|
|
|
+ :data="multipartFile"
|
|
|
multiple
|
|
|
>
|
|
|
<el-button size="small" type="primary">批量上传</el-button>
|
|
@@ -178,7 +178,8 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- uploadUrl:process.env.VUE_APP_BASE_API+"/qw/material/add",
|
|
|
+ multipartFile:{deviceId:"4eea1292408044beb49c02d3197871b0"},
|
|
|
+ uploadUrl:process.env.VUE_APP_BASE_API+"/common/qwUploadOSS",
|
|
|
dialogVisible: false,
|
|
|
url: '',
|
|
|
listDialogVisible: false,
|
|
@@ -314,7 +315,7 @@ export default {
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(function() {
|
|
|
- delMaterial(item.materialId)
|
|
|
+ delMaterial(item.id)
|
|
|
.then(function() {
|
|
|
that.queryParams.pageNum=0;
|
|
|
that.getMaterialList();
|
|
@@ -324,19 +325,19 @@ export default {
|
|
|
handleProgress(event, file, fileList) {
|
|
|
},
|
|
|
handleSuccess(response, file, fileList) {
|
|
|
- // const that = this
|
|
|
- // addMaterial({
|
|
|
- // type: '1',
|
|
|
- // groupId: this.queryParams.groupId,
|
|
|
- // name: file.name,
|
|
|
- // url: response.url
|
|
|
- // }).then(() => {
|
|
|
- // this.resultNumber++
|
|
|
- // if (fileList.length === this.resultNumber) {
|
|
|
- // that.getMaterialList()
|
|
|
- // this.resultNumber = 0
|
|
|
- // }
|
|
|
- // })
|
|
|
+ const that = this
|
|
|
+ addMaterial({
|
|
|
+ groupId: this.queryParams.groupId,
|
|
|
+ fileName: file.name,
|
|
|
+ url: response.url,
|
|
|
+ data:response.data
|
|
|
+ }).then(() => {
|
|
|
+ this.resultNumber++
|
|
|
+ if (fileList.length === this.resultNumber) {
|
|
|
+ that.getMaterialList()
|
|
|
+ this.resultNumber = 0
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
beforeUpload(file) {
|
|
|
const isPic =
|