|
@@ -155,9 +155,9 @@
|
|
<div class="only-title-mater">
|
|
<div class="only-title-mater">
|
|
<a-upload
|
|
<a-upload
|
|
name="file"
|
|
name="file"
|
|
- action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
|
|
|
|
:file-list="fileList"
|
|
:file-list="fileList"
|
|
- @change="handleChange"
|
|
|
|
|
|
+ :customRequest="customRequest"
|
|
|
|
+ :remove="handleRemoveUpload"
|
|
>
|
|
>
|
|
<a-button><a-icon type="upload"/>文件上传</a-button>
|
|
<a-button><a-icon type="upload"/>文件上传</a-button>
|
|
</a-upload>
|
|
</a-upload>
|
|
@@ -336,7 +336,11 @@ import moment from 'moment';
|
|
import {getAction, postFileAction, postAction} from '@/api/manage';
|
|
import {getAction, postFileAction, postAction} from '@/api/manage';
|
|
import {mapGetters} from 'vuex';
|
|
import {mapGetters} from 'vuex';
|
|
import {urlAcount} from './copy-library-server.js';
|
|
import {urlAcount} from './copy-library-server.js';
|
|
-
|
|
|
|
|
|
+let COS = require('cos-js-sdk-v5');
|
|
|
|
+let cos = new COS({
|
|
|
|
+ SecretId: 'AKIDE6IpMi8fJQRCg1iuWzFajjRs43kbbets',
|
|
|
|
+ SecretKey: 'tXzuwMfplTTK3c9GFUyETilasvQfePu9'
|
|
|
|
+});
|
|
export default {
|
|
export default {
|
|
name: 'copy-library',
|
|
name: 'copy-library',
|
|
components: {
|
|
components: {
|
|
@@ -737,14 +741,31 @@ export default {
|
|
console.log(error, 'eeee');
|
|
console.log(error, 'eeee');
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- handleChange(info) {
|
|
|
|
|
|
+ customRequest(info) {
|
|
const isZip = info.file.name.indexOf('xlsx') !== -1 || info.file.name.indexOf('xls') !== -1;
|
|
const isZip = info.file.name.indexOf('xlsx') !== -1 || info.file.name.indexOf('xls') !== -1;
|
|
if (!isZip) {
|
|
if (!isZip) {
|
|
this.$message.error('上传模板只能是 xls、xlsx格式!');
|
|
this.$message.error('上传模板只能是 xls、xlsx格式!');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- this.fileList = info.fileList;
|
|
|
|
|
|
+ this.fileList = [];
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.fileList.push(info.file);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ handleRemoveUpload(data) {
|
|
|
|
+ let index = this.fileList.indexOf(data);
|
|
|
|
+ let newUploadFile = this.fileList;
|
|
|
|
+ newUploadFile.splice(index, 1);
|
|
|
|
+ this.fileList = newUploadFile;
|
|
},
|
|
},
|
|
|
|
+ // handleChange(info) {
|
|
|
|
+ // const isZip = info.file.name.indexOf('xlsx') !== -1 || info.file.name.indexOf('xls') !== -1;
|
|
|
|
+ // if (!isZip) {
|
|
|
|
+ // this.$message.error('上传模板只能是 xls、xlsx格式!');
|
|
|
|
+ // return;
|
|
|
|
+ // }
|
|
|
|
+ // this.fileList = info.fileList;
|
|
|
|
+ // },
|
|
handleSearchMaster() {
|
|
handleSearchMaster() {
|
|
this.hendleMaterialInfo();
|
|
this.hendleMaterialInfo();
|
|
},
|
|
},
|
|
@@ -1019,7 +1040,7 @@ export default {
|
|
}
|
|
}
|
|
let paramsData = new FormData();
|
|
let paramsData = new FormData();
|
|
paramsData.append('accountId', this.advertisingAccount);
|
|
paramsData.append('accountId', this.advertisingAccount);
|
|
- paramsData.append('excelFile', this.fileList[0].originFileObj);
|
|
|
|
|
|
+ paramsData.append('excelFile', this.fileList[0]);
|
|
postFileAction(urlAcount + '/bytedance-api/advertiser/bytedanceGeneralCopywriter/loadExcel', paramsData, {
|
|
postFileAction(urlAcount + '/bytedance-api/advertiser/bytedanceGeneralCopywriter/loadExcel', paramsData, {
|
|
headers: {
|
|
headers: {
|
|
'Content-Type': 'multipart/form-data'
|
|
'Content-Type': 'multipart/form-data'
|