|
|
@@ -3132,9 +3132,9 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
};
|
|
|
};
|
|
|
|
|
|
- // 获取紧急程度图标和样式
|
|
|
- const getUrgencyLevelIconAndStyle = (urgencyText: string): { icon: React.ReactNode; style: React.CSSProperties } => {
|
|
|
- if (!urgencyText || urgencyText === '-') {
|
|
|
+ // 获取紧急程度图标和样式(根据字典 value 判断:0=一般,1=紧急,2=非常紧急)
|
|
|
+ const getUrgencyLevelIconAndStyle = (urgencyValue: string | number | undefined): { icon: React.ReactNode; style: React.CSSProperties } => {
|
|
|
+ if (urgencyValue === null || urgencyValue === undefined || urgencyValue === '') {
|
|
|
return {
|
|
|
icon: null,
|
|
|
style: {
|
|
|
@@ -3144,15 +3144,15 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
- const urgencyTextLower = urgencyText.toLowerCase();
|
|
|
+ const value = Number(urgencyValue);
|
|
|
|
|
|
- // 正常:使用 urgecy1.png 图标 + "正常"文字(黑色)
|
|
|
- if (urgencyTextLower.includes('正常') || urgencyTextLower.includes('normal') || urgencyTextLower.includes('普通')) {
|
|
|
+ // 0 = 一般:使用 urgecy1.png 图标 + 黑色文字
|
|
|
+ if (value === 0) {
|
|
|
return {
|
|
|
icon: (
|
|
|
<img
|
|
|
src={urgecy1Icon}
|
|
|
- alt="正常"
|
|
|
+ alt="一般"
|
|
|
className="w-5 h-5 flex-shrink-0 mr-1.5"
|
|
|
style={{ objectFit: 'contain' }}
|
|
|
/>
|
|
|
@@ -3164,39 +3164,27 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
- // 已处理:使用 urgecy1.png 图标 + "已处理"文字(黑色)
|
|
|
- if (urgencyTextLower.includes('已处理') || urgencyTextLower.includes('processed') || urgencyTextLower.includes('handled')) {
|
|
|
+ // 1 = 紧急:使用 urgecy2.png 图标 + 橙色加粗文字
|
|
|
+ if (value === 1) {
|
|
|
return {
|
|
|
icon: (
|
|
|
<img
|
|
|
- src={urgecy1Icon}
|
|
|
- alt="已处理"
|
|
|
+ src={urgecy2Icon}
|
|
|
+ alt="紧急"
|
|
|
className="w-5 h-5 flex-shrink-0 mr-1.5"
|
|
|
style={{ objectFit: 'contain' }}
|
|
|
/>
|
|
|
),
|
|
|
style: {
|
|
|
backgroundColor: 'transparent',
|
|
|
- color: '#000000',
|
|
|
- },
|
|
|
- };
|
|
|
- }
|
|
|
-
|
|
|
- // 警示线:橙色三角形警告图标 + "警示线"文字(先判断,避免与紧急混淆)
|
|
|
- if (urgencyTextLower.includes('警示线') || urgencyTextLower.includes('warning line') || urgencyTextLower.includes('alert line')) {
|
|
|
- return {
|
|
|
- icon: (
|
|
|
- <WarningOutlined className="text-orange-500" style={{ fontSize: '16px' }} />
|
|
|
- ),
|
|
|
- style: {
|
|
|
- backgroundColor: 'transparent',
|
|
|
- color: '#333333',
|
|
|
+ color: '#fa8c16',
|
|
|
+ fontWeight: 'bold',
|
|
|
},
|
|
|
};
|
|
|
}
|
|
|
|
|
|
- // 非常紧急:使用 urgecy3.png 图标 + "非常紧急"文字(红色加粗,先判断,避免与紧急混淆)
|
|
|
- if (urgencyTextLower.includes('非常紧急') || urgencyTextLower.includes('very urgent') || urgencyTextLower.includes('特急')) {
|
|
|
+ // 2 = 非常紧急:使用 urgecy3.png 图标 + 红色加粗文字
|
|
|
+ if (value === 2) {
|
|
|
return {
|
|
|
icon: (
|
|
|
<img
|
|
|
@@ -3214,25 +3202,6 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
- // 紧急:使用 urgecy2.png 图标 + "紧急"文字(橙色加粗)
|
|
|
- if (urgencyTextLower.includes('紧急') || urgencyTextLower.includes('urgent')) {
|
|
|
- return {
|
|
|
- icon: (
|
|
|
- <img
|
|
|
- src={urgecy2Icon}
|
|
|
- alt="紧急"
|
|
|
- className="w-5 h-5 flex-shrink-0 mr-1.5"
|
|
|
- style={{ objectFit: 'contain' }}
|
|
|
- />
|
|
|
- ),
|
|
|
- style: {
|
|
|
- backgroundColor: 'transparent',
|
|
|
- color: '#fa8c16',
|
|
|
- fontWeight: 'bold',
|
|
|
- },
|
|
|
- };
|
|
|
- }
|
|
|
-
|
|
|
// 如果没有匹配到,默认灰色
|
|
|
return {
|
|
|
icon: null,
|
|
|
@@ -3244,8 +3213,8 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
};
|
|
|
|
|
|
// 获取紧急程度样式(保留用于向后兼容)
|
|
|
- const getUrgencyLevelStyle = (urgencyText: string): React.CSSProperties => {
|
|
|
- return getUrgencyLevelIconAndStyle(urgencyText).style;
|
|
|
+ const getUrgencyLevelStyle = (urgencyValue: string | number | undefined): React.CSSProperties => {
|
|
|
+ return getUrgencyLevelIconAndStyle(urgencyValue).style;
|
|
|
};
|
|
|
|
|
|
// 作业管理表格列配置
|
|
|
@@ -3358,11 +3327,11 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
const urgencyItem = urgencyLevelDictList.find(item => String(item.value) === String(urgencyValue));
|
|
|
const urgencyText = urgencyItem ? (urgencyItem.label || '') : (urgencyValue ? String(urgencyValue) : '-');
|
|
|
|
|
|
- if (!urgencyValue || urgencyText === '-') {
|
|
|
+ if (!urgencyValue || urgencyValue === null || urgencyValue === undefined || urgencyValue === '') {
|
|
|
return <span>-</span>;
|
|
|
}
|
|
|
|
|
|
- const { icon, style } = getUrgencyLevelIconAndStyle(urgencyText);
|
|
|
+ const { icon, style } = getUrgencyLevelIconAndStyle(urgencyValue);
|
|
|
|
|
|
return (
|
|
|
<span
|