Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added web/src/assets/door-safety.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/src/assets/door_rolling.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/src/assets/floor_ice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/src/assets/floor_water.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 37 additions & 14 deletions web/src/components/check-box/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -65,8 +84,12 @@ export const useAction = (monitorSummary?: boolean) => {
value: ICameraAiMonitorType.DoorRolling,
},
{
label: "進出時間登記",
value: ICameraAiMonitorType.Attendance,
label: "場地環境衛生檢測",
value: ICameraAiMonitorType.Tidy,
},
{
label: "垃圾桶關閉檢測",
value: ICameraAiMonitorType.TrashCanLid,
},
];

Expand Down
24 changes: 24 additions & 0 deletions web/src/components/warning-select/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ export const useAction = () => {
label: "進出時間登記",
value: ICameraAiMonitorType.Attendance,
},
{
label: "員工搬貨動作檢測",
value: ICameraAiMonitorType.Move,
},
{
label: "人員摔跤檢測",
value: ICameraAiMonitorType.FallDown,
},
],
},
{
Expand All @@ -72,6 +80,14 @@ export const useAction = () => {
label: "叉車熒光帶匹配檢測",
value: ICameraAiMonitorType.Forklift,
},
{
label: "防滑膠墊使用檢測",
value: ICameraAiMonitorType.Antiskid,
},
{
label: "叉車升降移動檢測",
value: ICameraAiMonitorType.ForkliftFork,
},
],
},
{
Expand Down Expand Up @@ -112,6 +128,14 @@ export const useAction = () => {
label: "卷簾門關閉檢測",
value: ICameraAiMonitorType.DoorRolling,
},
{
label: "場地環境衛生檢測",
value: ICameraAiMonitorType.Tidy,
},
{
label: "垃圾桶關閉檢測",
value: ICameraAiMonitorType.TrashCanLid,
},
],
},
{
Expand Down
6 changes: 6 additions & 0 deletions web/src/dtos/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
63 changes: 47 additions & 16 deletions web/src/pages/feedback/component/feedback-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 } =
Expand Down Expand Up @@ -39,20 +44,52 @@ export const FeedbackList = () => {
dataIndex: "monitorTypeName",
key: "monitorTypeName",
width: 200,
render: (text: string) => {
const img = () => {
if (text.includes("人員") || text.includes("人员"))
return <img src={peopleImg} className="w-4 h-4 img-no-darg" />;
else if (text.includes("異常車輛") || text.includes("异常车辆")) {
return <img src={error_carImg} className="w-4 h-4 img-no-darg" />;
} else if (text.includes("車輛") || text.includes("车辆")) {
return <img src={carImg} className="w-4 h-4 img-no-darg" />;
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 <img src={peopleImg} className="w-4 h-4 img-no-darg" />;

case ICameraAiMonitorType.Vehicles:
case ICameraAiMonitorType.Antiskid:
case ICameraAiMonitorType.ForkliftFork:
case ICameraAiMonitorType.Tidy:
case ICameraAiMonitorType.TrashCanLid:
return <img src={carImg} className="w-4 h-4 img-no-darg" />;

case ICameraAiMonitorType.AbnormalVehicles:
case ICameraAiMonitorType.Forklift:
return <img src={error_carImg} className="w-4 h-4 img-no-darg" />;

case ICameraAiMonitorType.FloorIce:
return <img src={floorIceImg} className="w-4 h-4 img-no-darg" />;

case ICameraAiMonitorType.FloorWater:
return (
<img src={floorWaterImg} className="w-4 h-4 img-no-darg" />
);

case ICameraAiMonitorType.DoorSafety:
return (
<img src={doorSafetyImg} className="w-4 h-4 img-no-darg" />
);

case ICameraAiMonitorType.DoorRolling:
return (
<img src={doorRollingImg} className="w-4 h-4 img-no-darg" />
);
}
};

return (
<div className="flex items-center space-x-2 select-none">
{img()}
{renderImage()}
<span>{text}</span>
</div>
);
Expand All @@ -66,13 +103,7 @@ export const FeedbackList = () => {
render: (_: string, record: IRecordItem) => {
return (
<div className="w-full text-wrap select-none">
{record.equipmentName},{record.monitorTypeName}(
{`${record.name}${
record.monitorType === ICameraAiMonitorType.Costume
? `未配戴${record.costumesDetected}`
: ""
}`}
)出現超過 {record.settingDuration} 秒
{record.equipmentName},{renderAlertText(record)}
</div>
);
},
Expand Down
9 changes: 2 additions & 7 deletions web/src/pages/warning/component/equipment/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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" })}:`,
Expand Down
63 changes: 47 additions & 16 deletions web/src/pages/warning/component/warning-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -70,20 +75,52 @@ export const WarningList = () => {
dataIndex: "monitorTypeName",
key: "monitorTypeName",
width: 180,
render: (text: string) => {
const img = () => {
if (text.includes("人員") || text.includes("人员"))
return <img src={peopleImg} className="w-4 h-4 img-no-darg" />;
else if (text.includes("異常車輛") || text.includes("异常车辆")) {
return <img src={error_carImg} className="w-4 h-4 img-no-darg" />;
} else if (text.includes("車輛") || text.includes("车辆")) {
return <img src={carImg} className="w-4 h-4 img-no-darg" />;
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 <img src={peopleImg} className="w-4 h-4 img-no-darg" />;

case ICameraAiMonitorType.Vehicles:
case ICameraAiMonitorType.Antiskid:
case ICameraAiMonitorType.ForkliftFork:
case ICameraAiMonitorType.Tidy:
case ICameraAiMonitorType.TrashCanLid:
return <img src={carImg} className="w-4 h-4 img-no-darg" />;

case ICameraAiMonitorType.AbnormalVehicles:
case ICameraAiMonitorType.Forklift:
return <img src={error_carImg} className="w-4 h-4 img-no-darg" />;

case ICameraAiMonitorType.FloorIce:
return <img src={floorIceImg} className="w-4 h-4 img-no-darg" />;

case ICameraAiMonitorType.FloorWater:
return (
<img src={floorWaterImg} className="w-4 h-4 img-no-darg" />
);

case ICameraAiMonitorType.DoorSafety:
return (
<img src={doorSafetyImg} className="w-4 h-4 img-no-darg" />
);

case ICameraAiMonitorType.DoorRolling:
return (
<img src={doorRollingImg} className="w-4 h-4 img-no-darg" />
);
}
};

return (
<div className="flex items-center space-x-2 select-none">
{img()}
{renderImage()}
<span>{text}</span>
</div>
);
Expand All @@ -97,13 +134,7 @@ export const WarningList = () => {
render: (_: string, record: IRecordItem) => {
return (
<div className="w-full text-wrap select-none">
{record.equipmentName},{record.monitorTypeName}(
{`${record.name}${
record.monitorType === ICameraAiMonitorType.Costume
? `未配戴${record.costumesDetected}`
: ""
}`}
)出現超過 {record.settingDuration} 秒
{record.equipmentName},{renderAlertText(record)}
</div>
);
},
Expand Down
45 changes: 45 additions & 0 deletions web/src/utils/monitor-summary.ts
Original file line number Diff line number Diff line change
@@ -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}秒`;
}
};