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

修改

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