提交 1ab86321 authored 作者: 钟是志's avatar 钟是志

修改

上级 6e999a0c
import { giveFilePostDataInfoForTrue } from '@/webPublic/one_stop_public/Base16';
import { queryOauthActionPath } from '@/webPublic/one_stop_public/utils/queryConfig';
import { getToken } from '@/webPublic/one_stop_public/utils/token';
export { deepCopy} from '@/webPublic/zyd_public/utils/utils';
import { deepCopy } from '@/webPublic/zyd_public/utils/utils';
const apiUrl = queryOauthActionPath();
......@@ -23,8 +23,8 @@ const apiUrl = queryOauthActionPath();
export function getSpanJson({
mergeKey, data, eliminateRow = [], eliminateCol = []
}) {
try {
try {
let dataList = deepCopy(data);
return {
rowSpanData: getRowSpanJson(mergeKey,dataList, eliminateRow),
......@@ -153,29 +153,35 @@ export function getColumns(columns) {
}
function getColumnsData(data = [], res = [], level = 1) {
try{
for (let item of data) {
//item.key = i;
let isLast = !item.children;
item.level = level;
item.isLast = isLast;
item.width = !isLast ? getColumnsWidth(item.children) : 1;
item.col = col;
res.push(item);
columnsList[level - 1][col - 1] = {
...uj,
v: item.title,
};
if (!isLast) {
if (Array.isArray(item.children)) {
let x = level + 1;
getColumnsData(item.children, res, x);
}
} else {
col++;
columnsKey.push(item['dataIndex']);
//item.key = i;
let isLast = !item.children;
item.level = level;
item.isLast = isLast;
item.width = !isLast ? getColumnsWidth(item.children) : 1;
item.col = col;
res.push(item);
columnsList[level - 1][col - 1] = {
...uj,
v: item.title,
};
if (!isLast) {
if (Array.isArray(item.children)) {
let x = level + 1;
getColumnsData(item.children, res, x);
}
} else {
col++;
columnsKey.push(item['dataIndex']);
}
}
return res;
}catch (e) {
debugger;
console.table(e);
return false;
}
}
//递归行数
......@@ -188,6 +194,8 @@ export function getColumns(columns) {
columnsHeight = x;
}
getColumnsMaxLevel(item.children, x);
}else{
columnsHeight += 1;
}
}
return level;
......@@ -248,9 +256,9 @@ export function getColumnsSqlKeyRealize({
ext = 'xlsx',
}) {
columns = deepCopy(columns);
let { columnsList, columnsMerges, columnsKey } = getColumns(columns);
let content = {
sheets: [
{
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论