diff --git a/sub-admin/src/utils/index.js b/sub-admin/src/utils/index.js index 50dd47a..ee49137 100644 --- a/sub-admin/src/utils/index.js +++ b/sub-admin/src/utils/index.js @@ -2,8 +2,8 @@ * @Descripttion: * @Author: zenghua.wang * @Date: 2022-02-23 21:12:37 - * @LastEditors: wzh 1048523306@qq.com - * @LastEditTime: 2024-09-09 18:46:56 + * @LastEditors: zenghua.wang + * @LastEditTime: 2025-01-25 17:05:12 */ import lodash from 'lodash'; import moment from 'moment'; @@ -244,65 +244,6 @@ export const setUploadField = (url) => { if (isEmpty(url) || url.includes('http')) return null; 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链接方式文件下载 * @param {void} content: diff --git a/sub-government-affairs-service/src/utils/index.js b/sub-government-affairs-service/src/utils/index.js index 50dd47a..de9c7ea 100644 --- a/sub-government-affairs-service/src/utils/index.js +++ b/sub-government-affairs-service/src/utils/index.js @@ -2,8 +2,8 @@ * @Descripttion: * @Author: zenghua.wang * @Date: 2022-02-23 21:12:37 - * @LastEditors: wzh 1048523306@qq.com - * @LastEditTime: 2024-09-09 18:46:56 + * @LastEditors: zenghua.wang + * @LastEditTime: 2025-01-25 17:04:22 */ import lodash from 'lodash'; import moment from 'moment'; @@ -244,65 +244,6 @@ export const setUploadField = (url) => { if (isEmpty(url) || url.includes('http')) return null; 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链接方式文件下载 * @param {void} content: diff --git a/sub-operation-service/src/utils/index.js b/sub-operation-service/src/utils/index.js index 50dd47a..65f8327 100644 --- a/sub-operation-service/src/utils/index.js +++ b/sub-operation-service/src/utils/index.js @@ -2,8 +2,8 @@ * @Descripttion: * @Author: zenghua.wang * @Date: 2022-02-23 21:12:37 - * @LastEditors: wzh 1048523306@qq.com - * @LastEditTime: 2024-09-09 18:46:56 + * @LastEditors: zenghua.wang + * @LastEditTime: 2025-01-25 17:03:51 */ import lodash from 'lodash'; import moment from 'moment'; @@ -244,65 +244,6 @@ export const setUploadField = (url) => { if (isEmpty(url) || url.includes('http')) return null; 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链接方式文件下载 * @param {void} content: