|
@@ -793,7 +793,8 @@ export default {
|
|
|
let reactGridLayout = viewcontent.children[0];
|
|
let reactGridLayout = viewcontent.children[0];
|
|
|
let itemEls = reactGridLayout.children;
|
|
let itemEls = reactGridLayout.children;
|
|
|
let classList = reactGridLayout.children[0].classList; // 元素样式列表
|
|
let classList = reactGridLayout.children[0].classList; // 元素样式列表
|
|
|
- let classListBackup = []; // 样式备份
|
|
|
|
|
|
|
+ let classListBackup = []; // 样式名备份
|
|
|
|
|
+ let tableStyles = []; // 表格样式备份
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
* 1.因为部分样式(transition)在html2canvas的表达器中会出现渲染问题,所以需要在截图前将样式暂时移除
|
|
* 1.因为部分样式(transition)在html2canvas的表达器中会出现渲染问题,所以需要在截图前将样式暂时移除
|
|
@@ -809,6 +810,36 @@ export default {
|
|
|
itemEls[i].querySelector('.chart-title .tools').style.display = 'none';
|
|
itemEls[i].querySelector('.chart-title .tools').style.display = 'none';
|
|
|
itemEls[i].querySelector('.chart-tools').style.display = 'none';
|
|
itemEls[i].querySelector('.chart-tools').style.display = 'none';
|
|
|
});
|
|
});
|
|
|
|
|
+ let tableEl = itemEls[i].querySelector('.table-view');
|
|
|
|
|
+ if(tableEl) {
|
|
|
|
|
+ tableEl.querySelector('.ant-table-header').style.marginRight = '0';
|
|
|
|
|
+ let svgs = tableEl.querySelectorAll('svg');
|
|
|
|
|
+ for(let x = 0; x < svgs.length; x++) {
|
|
|
|
|
+ svgs[x].setAttribute('width', '12px');
|
|
|
|
|
+ svgs[x].setAttribute('height', '12px');
|
|
|
|
|
+ svgs[x].setAttribute('fill', '#ccc');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ let tableStyle = {
|
|
|
|
|
+ index: i
|
|
|
|
|
+ };
|
|
|
|
|
+ tableEl.querySelector('.ant-table-body').getAttribute('style').split(';').forEach(x => {
|
|
|
|
|
+ if(x) {
|
|
|
|
|
+ let arr = x.split(':');
|
|
|
|
|
+ tableStyle[arr[0]] = arr[1];
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ let str = '';
|
|
|
|
|
+ for(let k in tableStyle) {
|
|
|
|
|
+ if(k === 'overflow') {
|
|
|
|
|
+ str += k + ':hidden !important;';
|
|
|
|
|
+ }else {
|
|
|
|
|
+ str += k + ':' + tableStyle[k] + ';';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ tableEl.querySelector('.ant-table-body').setAttribute('style', str);
|
|
|
|
|
+ tableStyles.push(tableStyle);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
@@ -836,6 +867,28 @@ export default {
|
|
|
itemEls[i].querySelector('.chart-title .tools').style.display = '';
|
|
itemEls[i].querySelector('.chart-title .tools').style.display = '';
|
|
|
itemEls[i].querySelector('.chart-tools').style.display = '';
|
|
itemEls[i].querySelector('.chart-tools').style.display = '';
|
|
|
});
|
|
});
|
|
|
|
|
+ let tableEl = itemEls[i].querySelector('.table-view');
|
|
|
|
|
+ if(tableEl) {
|
|
|
|
|
+ tableEl.querySelector('.ant-table-header').style.marginRight = '';
|
|
|
|
|
+ let svgs = tableEl.querySelectorAll('svg');
|
|
|
|
|
+ for(let x = 0; x < svgs.length; x++) {
|
|
|
|
|
+ svgs[x].setAttribute('width', '1em');
|
|
|
|
|
+ svgs[x].setAttribute('height', '1em');
|
|
|
|
|
+ svgs[x].setAttribute('fill', 'currentColor');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for(let j=tableStyles.length-1;j>=0;j--) {
|
|
|
|
|
+ let tableStyle = tableStyles[j];
|
|
|
|
|
+ if(tableStyle.index === i) {
|
|
|
|
|
+ delete tableStyle.index;
|
|
|
|
|
+ let str = '';
|
|
|
|
|
+ for(let k in tableStyle) {
|
|
|
|
|
+ str += k + ':' + tableStyle[k] + ';';
|
|
|
|
|
+ }
|
|
|
|
|
+ tableEl.querySelector('.ant-table-body').setAttribute('style', str);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
yield put({ type: 'setField', name: 'loading', value: false });
|
|
yield put({ type: 'setField', name: 'loading', value: false });
|
|
|
}
|
|
}
|
|
@@ -845,6 +898,7 @@ export default {
|
|
|
const { itemEl, item } = action;
|
|
const { itemEl, item } = action;
|
|
|
const { name } = item;
|
|
const { name } = item;
|
|
|
let classListBackup = [];
|
|
let classListBackup = [];
|
|
|
|
|
+ let tableStyle = {};
|
|
|
|
|
|
|
|
let classList = itemEl.classList;
|
|
let classList = itemEl.classList;
|
|
|
for(let i = 0; i < classList.length; i++) {
|
|
for(let i = 0; i < classList.length; i++) {
|
|
@@ -856,6 +910,32 @@ export default {
|
|
|
});
|
|
});
|
|
|
itemEl.querySelector('.chart-title .tools').style.display = 'none';
|
|
itemEl.querySelector('.chart-title .tools').style.display = 'none';
|
|
|
itemEl.querySelector('.chart-tools').style.display = 'none';
|
|
itemEl.querySelector('.chart-tools').style.display = 'none';
|
|
|
|
|
+
|
|
|
|
|
+ let tableEl = itemEl.querySelector('.table-view');
|
|
|
|
|
+ if(tableEl) {
|
|
|
|
|
+ tableEl.querySelector('.ant-table-header').style.marginRight = '0';
|
|
|
|
|
+ let svgs = tableEl.querySelectorAll('svg');
|
|
|
|
|
+ for(let x = 0; x < svgs.length; x++) {
|
|
|
|
|
+ svgs[x].setAttribute('width', '12px');
|
|
|
|
|
+ svgs[x].setAttribute('height', '12px');
|
|
|
|
|
+ svgs[x].setAttribute('fill', '#ccc');
|
|
|
|
|
+ }
|
|
|
|
|
+ tableEl.querySelector('.ant-table-body').getAttribute('style').split(';').forEach(x => {
|
|
|
|
|
+ if(x) {
|
|
|
|
|
+ let arr = x.split(':');
|
|
|
|
|
+ tableStyle[arr[0]] = arr[1];
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ let str = '';
|
|
|
|
|
+ for(let k in tableStyle) {
|
|
|
|
|
+ if(k === 'overflow') {
|
|
|
|
|
+ str += k + ':hidden !important;';
|
|
|
|
|
+ }else {
|
|
|
|
|
+ str += k + ':' + tableStyle[k] + ';';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ tableEl.querySelector('.ant-table-body').setAttribute('style', str);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
yield put({ type: 'setField', name: 'loading', value: false });
|
|
yield put({ type: 'setField', name: 'loading', value: false });
|
|
@@ -881,6 +961,21 @@ export default {
|
|
|
});
|
|
});
|
|
|
itemEl.querySelector('.chart-title .tools').style.display = '';
|
|
itemEl.querySelector('.chart-title .tools').style.display = '';
|
|
|
itemEl.querySelector('.chart-tools').style.display = '';
|
|
itemEl.querySelector('.chart-tools').style.display = '';
|
|
|
|
|
+ let tableEl = itemEl.querySelector('.table-view');
|
|
|
|
|
+ if(tableEl) {
|
|
|
|
|
+ tableEl.querySelector('.ant-table-header').style.marginRight = '';
|
|
|
|
|
+ let svgs = tableEl.querySelectorAll('svg');
|
|
|
|
|
+ for(let x = 0; x < svgs.length; x++) {
|
|
|
|
|
+ svgs[x].setAttribute('width', '1em');
|
|
|
|
|
+ svgs[x].setAttribute('height', '1em');
|
|
|
|
|
+ svgs[x].setAttribute('fill', 'currentColor');
|
|
|
|
|
+ }
|
|
|
|
|
+ let str = '';
|
|
|
|
|
+ for(let k in tableStyle) {
|
|
|
|
|
+ str += k + ':' + tableStyle[k] + ';';
|
|
|
|
|
+ }
|
|
|
|
|
+ tableEl.querySelector('.ant-table-body').setAttribute('style', str);
|
|
|
|
|
+ }
|
|
|
yield put({ type: 'setField', name: 'loading', value: false });
|
|
yield put({ type: 'setField', name: 'loading', value: false });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|