diff --git a/web/src/assets/door-safety.png b/web/src/assets/door-safety.png new file mode 100644 index 0000000..6874967 Binary files /dev/null and b/web/src/assets/door-safety.png differ diff --git a/web/src/assets/door_rolling.png b/web/src/assets/door_rolling.png new file mode 100644 index 0000000..c59ffd7 Binary files /dev/null and b/web/src/assets/door_rolling.png differ diff --git a/web/src/assets/floor_ice.png b/web/src/assets/floor_ice.png new file mode 100644 index 0000000..776532e Binary files /dev/null and b/web/src/assets/floor_ice.png differ diff --git a/web/src/assets/floor_water.png b/web/src/assets/floor_water.png new file mode 100644 index 0000000..c417d8c Binary files /dev/null and b/web/src/assets/floor_water.png differ diff --git a/web/src/components/check-box/hook.ts b/web/src/components/check-box/hook.ts index fafb24e..a2c8852 100644 --- a/web/src/components/check-box/hook.ts +++ b/web/src/components/check-box/hook.ts @@ -12,22 +12,11 @@ export const useAction = (monitorSummary?: boolean) => { const { t } = useAuth(); const typeList = [ + /* 人 */ { label: t(KEYS.PEOPLE, { ns: "alertList" }), value: ICameraAiMonitorType.People, }, - { - label: t(KEYS.VEHICLES, { ns: "alertList" }), - value: ICameraAiMonitorType.Vehicles, - }, - { - label: t(KEYS.ABNORMALVEHICLES, { ns: "alertList" }), - value: ICameraAiMonitorType.AbnormalVehicles, - }, - { - label: t(KEYS.ANIMAL, { ns: "alertList" }), - value: ICameraAiMonitorType.Animal, - }, { label: t(KEYS.SMOKE, { ns: "alertList" }), value: ICameraAiMonitorType.Smoke, @@ -44,10 +33,40 @@ export const useAction = (monitorSummary?: boolean) => { label: "觸摸二層貨物規範檢測", value: ICameraAiMonitorType.TouchGoods, }, + { + label: "員工搬貨動作檢測", + value: ICameraAiMonitorType.Move, + }, + { + label: "人員摔跤檢測", + value: ICameraAiMonitorType.FallDown, + }, + /* 车辆 */ + { + label: t(KEYS.VEHICLES, { ns: "alertList" }), + value: ICameraAiMonitorType.Vehicles, + }, + { + label: t(KEYS.ABNORMALVEHICLES, { ns: "alertList" }), + value: ICameraAiMonitorType.AbnormalVehicles, + }, { label: "叉車熒光帶匹配檢測", value: ICameraAiMonitorType.Forklift, }, + { + label: "防滑膠墊使用檢測", + value: ICameraAiMonitorType.Antiskid, + }, + { + label: "叉車升降移動檢測", + value: ICameraAiMonitorType.ForkliftFork, + }, + /* 物體 */ + { + label: t(KEYS.ANIMAL, { ns: "alertList" }), + value: ICameraAiMonitorType.Animal, + }, { label: "識別地面水跡", value: ICameraAiMonitorType.FloorWater, @@ -65,8 +84,12 @@ export const useAction = (monitorSummary?: boolean) => { value: ICameraAiMonitorType.DoorRolling, }, { - label: "進出時間登記", - value: ICameraAiMonitorType.Attendance, + label: "場地環境衛生檢測", + value: ICameraAiMonitorType.Tidy, + }, + { + label: "垃圾桶關閉檢測", + value: ICameraAiMonitorType.TrashCanLid, }, ]; diff --git a/web/src/components/warning-select/hook.ts b/web/src/components/warning-select/hook.ts index 8fefd22..59a5997 100644 --- a/web/src/components/warning-select/hook.ts +++ b/web/src/components/warning-select/hook.ts @@ -53,6 +53,14 @@ export const useAction = () => { label: "進出時間登記", value: ICameraAiMonitorType.Attendance, }, + { + label: "員工搬貨動作檢測", + value: ICameraAiMonitorType.Move, + }, + { + label: "人員摔跤檢測", + value: ICameraAiMonitorType.FallDown, + }, ], }, { @@ -72,6 +80,14 @@ export const useAction = () => { label: "叉車熒光帶匹配檢測", value: ICameraAiMonitorType.Forklift, }, + { + label: "防滑膠墊使用檢測", + value: ICameraAiMonitorType.Antiskid, + }, + { + label: "叉車升降移動檢測", + value: ICameraAiMonitorType.ForkliftFork, + }, ], }, { @@ -112,6 +128,14 @@ export const useAction = () => { label: "卷簾門關閉檢測", value: ICameraAiMonitorType.DoorRolling, }, + { + label: "場地環境衛生檢測", + value: ICameraAiMonitorType.Tidy, + }, + { + label: "垃圾桶關閉檢測", + value: ICameraAiMonitorType.TrashCanLid, + }, ], }, { diff --git a/web/src/dtos/default.ts b/web/src/dtos/default.ts index c0b43ef..99ce9ee 100644 --- a/web/src/dtos/default.ts +++ b/web/src/dtos/default.ts @@ -44,6 +44,12 @@ export enum ICameraAiMonitorType { FloorIce = 1102, // 地面结冰 TouchGoods = 13, // 触摸二层货物规范 Attendance = 14, // 进出登记 + Move = 15, // 搬货动作监测 + FallDown = 16, // 跌倒监测 + Antiskid = 17, // 防滑垫使用监测 + ForkliftFork = 18, // 叉车升降移動檢測 + Tidy = 19, // 場地環境衛生檢測 + TrashCanLid = 20, // 垃圾桶關閉檢測 } export interface IRecordResponse { diff --git a/web/src/pages/feedback/component/feedback-list/index.tsx b/web/src/pages/feedback/component/feedback-list/index.tsx index b65841c..388cb7b 100644 --- a/web/src/pages/feedback/component/feedback-list/index.tsx +++ b/web/src/pages/feedback/component/feedback-list/index.tsx @@ -6,8 +6,13 @@ import KEYS from "@/i18n/keys/feedback-list"; import carImg from "../../../../assets/car.png"; import error_carImg from "../../../../assets/error-car.png"; import peopleImg from "../../../../assets/people.png"; +import floorIceImg from "../../../../assets/floor_ice.png"; +import floorWaterImg from "../../../../assets/floor_water.png"; +import doorSafetyImg from "../../../../assets/door-safety.png"; +import doorRollingImg from "../../../../assets/door_rolling.png"; import { useAction } from "./hook"; +import { renderAlertText } from "@/utils/monitor-summary"; export const FeedbackList = () => { const { t, dto, pagePermission, handleScroll, navigate, onChangePage } = @@ -39,20 +44,52 @@ export const FeedbackList = () => { dataIndex: "monitorTypeName", key: "monitorTypeName", width: 200, - render: (text: string) => { - const img = () => { - if (text.includes("人員") || text.includes("人员")) - return ; - else if (text.includes("異常車輛") || text.includes("异常车辆")) { - return ; - } else if (text.includes("車輛") || text.includes("车辆")) { - return ; + render: (text: string, record: IRecordItem) => { + const renderImage = () => { + switch (record.monitorType) { + case ICameraAiMonitorType.People: + case ICameraAiMonitorType.Smoke: + case ICameraAiMonitorType.Fight: + case ICameraAiMonitorType.Costume: + case ICameraAiMonitorType.TouchGoods: + case ICameraAiMonitorType.Move: + case ICameraAiMonitorType.FallDown: + return ; + + case ICameraAiMonitorType.Vehicles: + case ICameraAiMonitorType.Antiskid: + case ICameraAiMonitorType.ForkliftFork: + case ICameraAiMonitorType.Tidy: + case ICameraAiMonitorType.TrashCanLid: + return ; + + case ICameraAiMonitorType.AbnormalVehicles: + case ICameraAiMonitorType.Forklift: + return ; + + case ICameraAiMonitorType.FloorIce: + return ; + + case ICameraAiMonitorType.FloorWater: + return ( + + ); + + case ICameraAiMonitorType.DoorSafety: + return ( + + ); + + case ICameraAiMonitorType.DoorRolling: + return ( + + ); } }; return (
- {img()} + {renderImage()} {text}
); @@ -66,13 +103,7 @@ export const FeedbackList = () => { render: (_: string, record: IRecordItem) => { return (
- {record.equipmentName},{record.monitorTypeName}( - {`${record.name}${ - record.monitorType === ICameraAiMonitorType.Costume - ? `未配戴${record.costumesDetected}` - : "" - }`} - )出現超過 {record.settingDuration} 秒 + {record.equipmentName},{renderAlertText(record)}
); }, diff --git a/web/src/pages/warning/component/equipment/hook.ts b/web/src/pages/warning/component/equipment/hook.ts index 672ff13..57a3072 100644 --- a/web/src/pages/warning/component/equipment/hook.ts +++ b/web/src/pages/warning/component/equipment/hook.ts @@ -21,6 +21,7 @@ import { import { useDebounceFn } from "ahooks"; import { getErrorMessage } from "@/utils/error-message"; import { isEmpty, isNil } from "ramda"; +import { renderAlertText } from "@/utils/monitor-summary"; export const useAction = () => { const { t, currentTeam } = useAuth(); @@ -173,13 +174,7 @@ export const useAction = () => { }, { label: `${t(KEYS.ALERT_CONTENT, { ns: "alertList" })}:`, - value: `${record?.equipmentName},${record?.monitorTypeName}(${ - record?.name - }${ - record.monitorType === ICameraAiMonitorType.Costume - ? `未配戴${record?.costumesDetected}` - : "" - })出現超過${record?.settingDuration}秒`, + value: renderAlertText(record), }, { label: `${t(KEYS.AREA_ADRESS, { ns: "alertList" })}:`, diff --git a/web/src/pages/warning/component/warning-list/index.tsx b/web/src/pages/warning/component/warning-list/index.tsx index 5e09cc6..2657b50 100644 --- a/web/src/pages/warning/component/warning-list/index.tsx +++ b/web/src/pages/warning/component/warning-list/index.tsx @@ -15,7 +15,12 @@ import KEYS from "@/i18n/keys/alert-list"; import carImg from "../../../../assets/car.png"; import error_carImg from "../../../../assets/error-car.png"; import peopleImg from "../../../../assets/people.png"; +import floorIceImg from "../../../../assets/floor_ice.png"; +import floorWaterImg from "../../../../assets/floor_water.png"; +import doorSafetyImg from "../../../../assets/door-safety.png"; +import doorRollingImg from "../../../../assets/door_rolling.png"; import { useAction } from "./hook"; +import { renderAlertText } from "@/utils/monitor-summary"; const statusComponent = ( boxBorderColor: string, @@ -70,20 +75,52 @@ export const WarningList = () => { dataIndex: "monitorTypeName", key: "monitorTypeName", width: 180, - render: (text: string) => { - const img = () => { - if (text.includes("人員") || text.includes("人员")) - return ; - else if (text.includes("異常車輛") || text.includes("异常车辆")) { - return ; - } else if (text.includes("車輛") || text.includes("车辆")) { - return ; + render: (text: string, record: IRecordItem) => { + const renderImage = () => { + switch (record.monitorType) { + case ICameraAiMonitorType.People: + case ICameraAiMonitorType.Smoke: + case ICameraAiMonitorType.Fight: + case ICameraAiMonitorType.Costume: + case ICameraAiMonitorType.TouchGoods: + case ICameraAiMonitorType.Move: + case ICameraAiMonitorType.FallDown: + return ; + + case ICameraAiMonitorType.Vehicles: + case ICameraAiMonitorType.Antiskid: + case ICameraAiMonitorType.ForkliftFork: + case ICameraAiMonitorType.Tidy: + case ICameraAiMonitorType.TrashCanLid: + return ; + + case ICameraAiMonitorType.AbnormalVehicles: + case ICameraAiMonitorType.Forklift: + return ; + + case ICameraAiMonitorType.FloorIce: + return ; + + case ICameraAiMonitorType.FloorWater: + return ( + + ); + + case ICameraAiMonitorType.DoorSafety: + return ( + + ); + + case ICameraAiMonitorType.DoorRolling: + return ( + + ); } }; return (
- {img()} + {renderImage()} {text}
); @@ -97,13 +134,7 @@ export const WarningList = () => { render: (_: string, record: IRecordItem) => { return (
- {record.equipmentName},{record.monitorTypeName}( - {`${record.name}${ - record.monitorType === ICameraAiMonitorType.Costume - ? `未配戴${record.costumesDetected}` - : "" - }`} - )出現超過 {record.settingDuration} 秒 + {record.equipmentName},{renderAlertText(record)}
); }, diff --git a/web/src/utils/monitor-summary.ts b/web/src/utils/monitor-summary.ts new file mode 100644 index 0000000..134ed4f --- /dev/null +++ b/web/src/utils/monitor-summary.ts @@ -0,0 +1,45 @@ +import { ICameraAiMonitorType, IRecordItem } from "@/dtos/default"; + +export const renderAlertText = (record: IRecordItem): string => { + switch (record.monitorType) { + case ICameraAiMonitorType.TouchGoods: + return "識別人員出現違規觸摸二層貨物"; + + case ICameraAiMonitorType.Forklift: + return "識別叉車熒光帶不匹配,違規駕駛"; + + case ICameraAiMonitorType.FloorWater: + return "識別地面有水跡現象"; + + case ICameraAiMonitorType.FloorIce: + return "識別地面有結冰現象"; + + case ICameraAiMonitorType.DoorSafety: + case ICameraAiMonitorType.DoorRolling: + return `識別${record.name}打開超過${record.settingDuration}秒`; + + case ICameraAiMonitorType.Move: + return `識別員工違規搬貨超過${record.settingDuration}次`; + + case ICameraAiMonitorType.FallDown: + return "識別有人員跌倒的情況"; + + case ICameraAiMonitorType.Antiskid: + return `識別未使用防滑膠墊超過${record.settingDuration}秒`; + + case ICameraAiMonitorType.ForkliftFork: + return "識別有叉車升降移動的違規情況"; + + case ICameraAiMonitorType.Tidy: + return `識別場地環境衛生出現違規情況超過${record.settingDuration}秒`; + + case ICameraAiMonitorType.TrashCanLid: + return `識別垃圾桶打開超過${record.settingDuration}秒`; + + case ICameraAiMonitorType.Costume: + return `${record.name}未配戴${record.costumesDetected}出現超過${record.settingDuration}秒`; + + default: + return `${record.monitorTypeName}(${record.name})出現超過${record.settingDuration}秒`; + } +};