diff --git a/src/components/Common/CommonTable/index.js b/src/components/Common/CommonTable/index.js index f1386a0..600598b 100644 --- a/src/components/Common/CommonTable/index.js +++ b/src/components/Common/CommonTable/index.js @@ -1309,10 +1309,7 @@ class CommonTableRc extends React.Component { }) } - this.props.onCostomColums?.([ - ...tableColumn, - ...subTableColumn - ]); + this.props.onCostomColums?.([...tableColumn, ...subTableColumn]); // 判断工序状态 if (commonUtils.isNotEmptyArr(sPartNameStatus) && commonUtils.isNotEmptyArr(dataSource)) { @@ -1322,12 +1319,14 @@ class CommonTableRc extends React.Component { sPartNameStatus[0].render = (itemStr) => { if (commonUtils.isJSON(itemStr)) { const sPartItem = JSON.parse(itemStr); + return ( //
{ return
{ // eslint-disable-next-line array-callback-return + sPartItem.map((t, i) => { const sPartItemLength = sPartItem.length; // const record = dataSource[i]; /* 获取每行数据 */ @@ -1335,45 +1334,48 @@ class CommonTableRc extends React.Component { if (t?.background) { colorValue = t.background; } else { - const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState; - // switch (Number(sState)) { // 根据状态显示颜色 - // case 0: - // colorValue = '#808080'; /* 0:灰色 */ - // break; - // case 1: - // colorValue = '#808080'; /* 1:灰色 */ - // break; - // case 2: - // colorValue = '#ff4d4f'; /* 2:红色 */ - // break; - // case 3: - // colorValue = '#d4b106'; /* 3:黄色 */ - // break; - // case 4: - // colorValue = '#000000'; /* 黑色 */ - // break; - // case 5: - // colorValue = '#49aa19'; /* 5:绿色 */ - // break; - // default: - // colorValue = '#000000'; - // } - switch ( - Number(sState) // 根据状态显示颜色 - ) { - case 2: - colorValue = "#FF6600"; /* 2:等待:黄色 */ - break; - case 4: - colorValue = "#648c4b"; /* 4:已完成:绿色 */ - break; - case 1: - case 3: - colorValue = "#106abe"; /* 1、3:进行中:蓝色 */ - break; - default: - colorValue = "#000000"; - } + + const iStatus = commonUtils.isEmpty(t.iStatus) ? 4 : t.iStatus; + switch ( + Number(iStatus) // 根据状态显示颜色 + ) { + case 0: + colorValue = "#808080"; /* 0:灰色 */ + break; + case 1: + colorValue = "#808080"; /* 1:灰色 */ + break; + case 2: + colorValue = "#ff4d4f"; /* 2:红色 */ + break; + case 3: + colorValue = "#d4b106"; /* 3:黄色 */ + break; + case 4: + colorValue = "#000000"; /* 黑色 */ + break; + case 5: + colorValue = "#49aa19"; /* 5:绿色 */ + break; + default: + colorValue = "#000000"; + } + // switch ( + // Number(sState) // 根据状态显示颜色 + // ) { + // case 2: + // colorValue = "#FF6600"; /* 2:等待:黄色 */ + // break; + // case 4: + // colorValue = "#648c4b"; /* 4:已完成:绿色 */ + // break; + // case 1: + // case 3: + // colorValue = "#106abe"; /* 1、3:进行中:蓝色 */ + // break; + // default: + // colorValue = "#000000"; + // } } return (
@@ -1395,46 +1397,46 @@ class CommonTableRc extends React.Component { if (t?.background) { colorValue = t.background; } else { - const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState; - // switch (Number(sState)) { // 根据状态显示颜色 - // case 0: - // colorValue = '#808080'; /* 0:灰色 */ - // break; - // case 1: - // colorValue = '#808080'; /* 1:灰色 */ - // break; - // case 2: - // colorValue = '#ff4d4f'; /* 2:红色 */ - // break; - // case 3: - // colorValue = '#d4b106'; /* 3:黄色 */ - // break; - // case 4: - // colorValue = '#000000'; /* 黑色 */ - // break; - // case 5: - // colorValue = '#49aa19'; /* 5:绿色 */ - // break; - // default: - // colorValue = '#000000'; - // } - switch ( - Number(sState) // 根据状态显示颜色 - ) { - case 2: - colorValue = "#FF6600"; /* 2:等待:黄色 */ - break; - case 4: - colorValue = "#648c4b"; /* 4:已完成:绿色 */ - break; - case 1: - case 3: - colorValue = "#106abe"; /* 1、3:进行中:蓝色 */ - break; - default: - colorValue = "#000000"; - } - + const sState = commonUtils.isEmpty(t.iStatus) ? 4 : t.iStatus; + switch (Number(sState)) { // 根据状态显示颜色 + case 0: + colorValue = '#808080'; /* 0:灰色 */ + break; + case 1: + colorValue = '#808080'; /* 1:灰色 */ + break; + case 2: + colorValue = '#ff4d4f'; /* 2:红色 */ + break; + case 3: + colorValue = '#d4b106'; /* 3:黄色 */ + break; + case 4: + colorValue = '#000000'; /* 黑色 */ + break; + case 5: + colorValue = '#49aa19'; /* 5:绿色 */ + break; + default: + colorValue = '#000000'; + } + // switch ( + // Number(sState) // 根据状态显示颜色 + // ) { + // case 2: + // colorValue = "#FF6600"; /* 2:等待:黄色 */ + // break; + // case 4: + // colorValue = "#648c4b"; /* 4:已完成:绿色 */ + // break; + // case 1: + // case 3: + // colorValue = "#106abe"; /* 1、3:进行中:蓝色 */ + // break; + // default: + // colorValue = "#000000"; + // } + // } return (