|
@@ -645,6 +645,36 @@ const PSRDetail = () => {
|
|
|
const contentWindow = iframeRef.current.contentWindow;
|
|
|
luckysheetRef.current = contentWindow.luckysheet;
|
|
|
};
|
|
|
+
|
|
|
+ const setActHideRow = (data) => {
|
|
|
+ const rowHide = {};
|
|
|
+ const rang = [6, 246];
|
|
|
+ const otherRang = [247, 297];
|
|
|
+ let otherBegin;
|
|
|
+ data.celldata.forEach((cell) => {
|
|
|
+ if (cell.c !== 2) return;
|
|
|
+ if (cell.r >= rang[0] && cell.r <= rang[1]) {
|
|
|
+ if (!cell.v?.v) {
|
|
|
+ const key1 = cell.r.toString();
|
|
|
+ rowHide[key1] = 0;
|
|
|
+ }
|
|
|
+ } else if (
|
|
|
+ cell.r >= otherRang[0] &&
|
|
|
+ cell.r <= otherRang[1] &&
|
|
|
+ !cell.v?.v
|
|
|
+ ) {
|
|
|
+ if (!otherBegin) {
|
|
|
+ otherBegin = cell.r + 5;
|
|
|
+ } else if (cell.r >= otherBegin) {
|
|
|
+ const key1 = cell.r.toString();
|
|
|
+ rowHide[key1] = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ console.log('------------------rowHide--------------', rowHide);
|
|
|
+ return rowHide;
|
|
|
+ };
|
|
|
+
|
|
|
const renderSheet = (currentData, is_edit = false, day = '') => {
|
|
|
if (!currentData || !currentData[0]?.celldata) {
|
|
|
setNoData(true);
|
|
@@ -667,12 +697,6 @@ const PSRDetail = () => {
|
|
|
hintText: '当前excel不可编辑!',
|
|
|
};
|
|
|
data?.forEach((item) => {
|
|
|
- // item.config.authority = isEdit
|
|
|
- // ? null
|
|
|
- // : {
|
|
|
- // sheet: true,
|
|
|
- // hintText: '当前excel不可编辑!',
|
|
|
- // };
|
|
|
// 公式计算
|
|
|
let calcChain = [];
|
|
|
let index = item.index;
|
|
@@ -686,6 +710,8 @@ const PSRDetail = () => {
|
|
|
}
|
|
|
});
|
|
|
item.calcChain = calcChain;
|
|
|
+ //现金流表设置隐藏行
|
|
|
+ if (item.name == '现金流') item.config.rowhidden = setActHideRow(item);
|
|
|
});
|
|
|
|
|
|
let option = {
|
|
@@ -724,6 +750,7 @@ const PSRDetail = () => {
|
|
|
// 默认禁止编辑
|
|
|
// item.config.authority = { sheet: true, hintText };
|
|
|
});
|
|
|
+ console.log('-----------', data);
|
|
|
|
|
|
//设置不可编辑
|
|
|
if (!is_edit) unableEdit(option);
|