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

增加公共函数

上级 bfa4224f
......@@ -187,18 +187,12 @@ export function getColumns(columns) {
return sum;
}
let columnsHandle = getColumnsData(columns)
.filter((v, i) => {
let columnsHandle = getColumnsData(columns).filter((v, i) => {
return (v.level < columnsHeight && v.isLast) || v.width > 1;
});
let columnsMerges = [];
columnsHandle.forEach((v, i) => {
let {
isLast,
width,
col,
level
} = v;
let { isLast, width, col, level } = v;
let nowCol = col - 1;
let nowLevel = level - 1;
if (isLast && width === 1) {
......@@ -234,12 +228,8 @@ export function getColumnsSqlKeyRealize({
styles,
fileName = '导出文件',
ext = 'xlsx',
}) {
let {
columnsList,
columnsMerges,
columnsKey
} = getColumns(columns);
}) {
let { columnsList, columnsMerges, columnsKey } = getColumns(columns);
let content = {
sheets: [
{
......@@ -317,17 +307,9 @@ export function getColumnsDataRealize({
fileName = '导出文件',
ext = 'xlsx',
eliminateStr = [],
}) {
let {
columnsList,
columnsMerges,
columnsKey,
columnsHeight
} = getColumns(columns);
let {
colSpanData,
rowSpanData
} = getSpanJson(mergeKey, data, eliminateStr);
}) {
let { columnsList, columnsMerges, columnsKey, columnsHeight } = getColumns(columns);
let { colSpanData, rowSpanData } = getSpanJson(mergeKey, data, eliminateStr);
// 处理数据
let bodyData = [];
const uj = {
......@@ -435,8 +417,7 @@ export function getWord({
allValues = {},
listConfig = {},
ext = 'docx',
}
) {
}) {
//可更新的
let getFileData = giveFilePostDataInfoForTrue(
{
......@@ -495,13 +476,12 @@ function makeArrayKey(key) {
function FormdataWrapper(obj, fd, pre) {
fd = fd || new FormData();
Object.keys(obj)
.forEach(function (prop) {
Object.keys(obj).forEach(function(prop) {
var key = pre ? pre + '[' + prop + ']' : prop;
if (isObject(obj[prop]) && !isArray(obj[prop]) && !isFile(obj[prop])) {
FormdataWrapper(obj[prop], fd, key);
} else if (isArray(obj[prop])) {
obj[prop].forEach(function (value) {
obj[prop].forEach(function(value) {
var arrayKey = makeArrayKey(key);
if (isObject(value) && !isFile(value)) {
FormdataWrapper(value, fd, arrayKey);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论