fix
This commit is contained in:
parent
6bb2e359da
commit
92af33cade
@ -2,8 +2,8 @@
|
|||||||
* @Descripttion:
|
* @Descripttion:
|
||||||
* @Author: zenghua.wang
|
* @Author: zenghua.wang
|
||||||
* @Date: 2022-02-23 21:12:37
|
* @Date: 2022-02-23 21:12:37
|
||||||
* @LastEditors: wzh 1048523306@qq.com
|
* @LastEditors: zenghua.wang
|
||||||
* @LastEditTime: 2024-09-09 18:46:56
|
* @LastEditTime: 2025-01-25 17:05:12
|
||||||
*/
|
*/
|
||||||
import lodash from 'lodash';
|
import lodash from 'lodash';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
@ -244,65 +244,6 @@ export const setUploadField = (url) => {
|
|||||||
if (isEmpty(url) || url.includes('http')) return null;
|
if (isEmpty(url) || url.includes('http')) return null;
|
||||||
return url;
|
return url;
|
||||||
};
|
};
|
||||||
/**
|
|
||||||
* 合并列
|
|
||||||
* @param {*} param0
|
|
||||||
* @param {*} options
|
|
||||||
* @param {*} rowList
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export const setSpan = ({ rowIndex, columnIndex }, options, rowList) => {
|
|
||||||
const columnList = deepClone(options.columns).filter((item) => !item.hide);
|
|
||||||
const conditions = [];
|
|
||||||
const getColspan = (column, conditions) => {
|
|
||||||
const len = rowList.length;
|
|
||||||
const arr = [];
|
|
||||||
for (let i = 0; i < len; i++) {
|
|
||||||
let colspan = 1;
|
|
||||||
for (let j = i + 1; j < len; j++) {
|
|
||||||
const bool = conditions.every((col) => {
|
|
||||||
return rowList[i][col] === rowList[j][col];
|
|
||||||
});
|
|
||||||
if (bool && rowList[i][column] === rowList[j][column]) {
|
|
||||||
colspan += 1;
|
|
||||||
arr[i] = colspan;
|
|
||||||
arr[j] = 0;
|
|
||||||
if (j === len - 1) i = j;
|
|
||||||
} else {
|
|
||||||
colspan = 1;
|
|
||||||
if (!arr[i]) arr[i] = colspan;
|
|
||||||
i = j;
|
|
||||||
arr[j] = colspan;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return arr;
|
|
||||||
};
|
|
||||||
if (rowList.length <= 1) {
|
|
||||||
return {
|
|
||||||
rowspan: 1,
|
|
||||||
colspan: 1,
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
for (let i = 0, columnLen = columnList.length; i < columnLen; i++) {
|
|
||||||
if (columnList[i].isColspan) {
|
|
||||||
const arr = getColspan(columnList[i].prop, conditions);
|
|
||||||
const index = options.selection ? (options.index ? i + 2 : i + 1) : options.index ? i + 1 : i;
|
|
||||||
conditions.push(columnList[i].prop);
|
|
||||||
if (columnIndex === index) {
|
|
||||||
for (let j = 0, rowLen = rowList.length; j < rowLen; j++) {
|
|
||||||
if (rowIndex === j) {
|
|
||||||
return {
|
|
||||||
rowspan: arr[j],
|
|
||||||
colspan: arr[j] > 0 ? 1 : 0,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
/**
|
/**
|
||||||
* @Title: a链接方式文件下载
|
* @Title: a链接方式文件下载
|
||||||
* @param {void} content:
|
* @param {void} content:
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
* @Descripttion:
|
* @Descripttion:
|
||||||
* @Author: zenghua.wang
|
* @Author: zenghua.wang
|
||||||
* @Date: 2022-02-23 21:12:37
|
* @Date: 2022-02-23 21:12:37
|
||||||
* @LastEditors: wzh 1048523306@qq.com
|
* @LastEditors: zenghua.wang
|
||||||
* @LastEditTime: 2024-09-09 18:46:56
|
* @LastEditTime: 2025-01-25 17:04:22
|
||||||
*/
|
*/
|
||||||
import lodash from 'lodash';
|
import lodash from 'lodash';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
@ -244,65 +244,6 @@ export const setUploadField = (url) => {
|
|||||||
if (isEmpty(url) || url.includes('http')) return null;
|
if (isEmpty(url) || url.includes('http')) return null;
|
||||||
return url;
|
return url;
|
||||||
};
|
};
|
||||||
/**
|
|
||||||
* 合并列
|
|
||||||
* @param {*} param0
|
|
||||||
* @param {*} options
|
|
||||||
* @param {*} rowList
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export const setSpan = ({ rowIndex, columnIndex }, options, rowList) => {
|
|
||||||
const columnList = deepClone(options.columns).filter((item) => !item.hide);
|
|
||||||
const conditions = [];
|
|
||||||
const getColspan = (column, conditions) => {
|
|
||||||
const len = rowList.length;
|
|
||||||
const arr = [];
|
|
||||||
for (let i = 0; i < len; i++) {
|
|
||||||
let colspan = 1;
|
|
||||||
for (let j = i + 1; j < len; j++) {
|
|
||||||
const bool = conditions.every((col) => {
|
|
||||||
return rowList[i][col] === rowList[j][col];
|
|
||||||
});
|
|
||||||
if (bool && rowList[i][column] === rowList[j][column]) {
|
|
||||||
colspan += 1;
|
|
||||||
arr[i] = colspan;
|
|
||||||
arr[j] = 0;
|
|
||||||
if (j === len - 1) i = j;
|
|
||||||
} else {
|
|
||||||
colspan = 1;
|
|
||||||
if (!arr[i]) arr[i] = colspan;
|
|
||||||
i = j;
|
|
||||||
arr[j] = colspan;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return arr;
|
|
||||||
};
|
|
||||||
if (rowList.length <= 1) {
|
|
||||||
return {
|
|
||||||
rowspan: 1,
|
|
||||||
colspan: 1,
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
for (let i = 0, columnLen = columnList.length; i < columnLen; i++) {
|
|
||||||
if (columnList[i].isColspan) {
|
|
||||||
const arr = getColspan(columnList[i].prop, conditions);
|
|
||||||
const index = options.selection ? (options.index ? i + 2 : i + 1) : options.index ? i + 1 : i;
|
|
||||||
conditions.push(columnList[i].prop);
|
|
||||||
if (columnIndex === index) {
|
|
||||||
for (let j = 0, rowLen = rowList.length; j < rowLen; j++) {
|
|
||||||
if (rowIndex === j) {
|
|
||||||
return {
|
|
||||||
rowspan: arr[j],
|
|
||||||
colspan: arr[j] > 0 ? 1 : 0,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
/**
|
/**
|
||||||
* @Title: a链接方式文件下载
|
* @Title: a链接方式文件下载
|
||||||
* @param {void} content:
|
* @param {void} content:
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
* @Descripttion:
|
* @Descripttion:
|
||||||
* @Author: zenghua.wang
|
* @Author: zenghua.wang
|
||||||
* @Date: 2022-02-23 21:12:37
|
* @Date: 2022-02-23 21:12:37
|
||||||
* @LastEditors: wzh 1048523306@qq.com
|
* @LastEditors: zenghua.wang
|
||||||
* @LastEditTime: 2024-09-09 18:46:56
|
* @LastEditTime: 2025-01-25 17:03:51
|
||||||
*/
|
*/
|
||||||
import lodash from 'lodash';
|
import lodash from 'lodash';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
@ -244,65 +244,6 @@ export const setUploadField = (url) => {
|
|||||||
if (isEmpty(url) || url.includes('http')) return null;
|
if (isEmpty(url) || url.includes('http')) return null;
|
||||||
return url;
|
return url;
|
||||||
};
|
};
|
||||||
/**
|
|
||||||
* 合并列
|
|
||||||
* @param {*} param0
|
|
||||||
* @param {*} options
|
|
||||||
* @param {*} rowList
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export const setSpan = ({ rowIndex, columnIndex }, options, rowList) => {
|
|
||||||
const columnList = deepClone(options.columns).filter((item) => !item.hide);
|
|
||||||
const conditions = [];
|
|
||||||
const getColspan = (column, conditions) => {
|
|
||||||
const len = rowList.length;
|
|
||||||
const arr = [];
|
|
||||||
for (let i = 0; i < len; i++) {
|
|
||||||
let colspan = 1;
|
|
||||||
for (let j = i + 1; j < len; j++) {
|
|
||||||
const bool = conditions.every((col) => {
|
|
||||||
return rowList[i][col] === rowList[j][col];
|
|
||||||
});
|
|
||||||
if (bool && rowList[i][column] === rowList[j][column]) {
|
|
||||||
colspan += 1;
|
|
||||||
arr[i] = colspan;
|
|
||||||
arr[j] = 0;
|
|
||||||
if (j === len - 1) i = j;
|
|
||||||
} else {
|
|
||||||
colspan = 1;
|
|
||||||
if (!arr[i]) arr[i] = colspan;
|
|
||||||
i = j;
|
|
||||||
arr[j] = colspan;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return arr;
|
|
||||||
};
|
|
||||||
if (rowList.length <= 1) {
|
|
||||||
return {
|
|
||||||
rowspan: 1,
|
|
||||||
colspan: 1,
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
for (let i = 0, columnLen = columnList.length; i < columnLen; i++) {
|
|
||||||
if (columnList[i].isColspan) {
|
|
||||||
const arr = getColspan(columnList[i].prop, conditions);
|
|
||||||
const index = options.selection ? (options.index ? i + 2 : i + 1) : options.index ? i + 1 : i;
|
|
||||||
conditions.push(columnList[i].prop);
|
|
||||||
if (columnIndex === index) {
|
|
||||||
for (let j = 0, rowLen = rowList.length; j < rowLen; j++) {
|
|
||||||
if (rowIndex === j) {
|
|
||||||
return {
|
|
||||||
rowspan: arr[j],
|
|
||||||
colspan: arr[j] > 0 ? 1 : 0,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
/**
|
/**
|
||||||
* @Title: a链接方式文件下载
|
* @Title: a链接方式文件下载
|
||||||
* @param {void} content:
|
* @param {void} content:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user