|
@@ -388,25 +388,29 @@ export default {
|
|
|
|
|
|
if(!document.getElementsByClassName('table')[0]) return this.$message.warning(this.$t('OnlineExcelPage.please_add_table_msg') )
|
|
|
|
|
|
- let canvas = await html2canvas(document.getElementsByClassName('table')[0],{
|
|
|
- scale:2,
|
|
|
- useCORS: true,
|
|
|
- backgroundColor:null,
|
|
|
- imageTimeout:0,
|
|
|
- allowTaint:true,
|
|
|
- })
|
|
|
- let imagesrc = canvas.toDataURL('image/png');
|
|
|
- // console.log(imagesrc)
|
|
|
- const formData = new FormData();
|
|
|
- formData.append('Image',imagesrc);
|
|
|
- const { Data } = await dataBaseInterface.uploadImg(formData)
|
|
|
+ let Data = {};
|
|
|
+ if(!this.sheetId) {
|
|
|
+ let canvas = await html2canvas(document.getElementsByClassName('table')[0],{
|
|
|
+ scale:2,
|
|
|
+ useCORS: true,
|
|
|
+ backgroundColor:null,
|
|
|
+ imageTimeout:0,
|
|
|
+ allowTaint:true,
|
|
|
+ })
|
|
|
+ let imagesrc = canvas.toDataURL('image/png');
|
|
|
+ const formData = new FormData();
|
|
|
+ formData.append('Image',imagesrc);
|
|
|
+ const r = await dataBaseInterface.uploadImg(formData);
|
|
|
+ if(r.Ret != 200) return;
|
|
|
+ Data = r.Data;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
let params = {
|
|
|
ExcelName: name,
|
|
|
ExcelType: sheetType,
|
|
|
ExcelClassifyId: classify,
|
|
|
- ExcelImage: Data.ResourceUrl,
|
|
|
+ ExcelImage: this.sheetId ? '' : Data.ResourceUrl,
|
|
|
Source: 2,
|
|
|
TableData: this.$refs.customTableRef.getSaveParams(),
|
|
|
SourcesFrom:this.sheetForm.SourcesFrom
|