|
@@ -20,6 +20,7 @@ interface DataType {
|
|
|
responsiblePerson: string;
|
|
|
videoType: string;
|
|
|
skillUuid: string;
|
|
|
+ ip: string;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -31,6 +32,7 @@ const Audio: React.FC = () => {
|
|
|
const [searchValue, setSearchValue] = useState("");
|
|
|
const [idx, setIdx] = useState(0);
|
|
|
const [loading, setLoading] = useState(false);
|
|
|
+ const [factoryName, setFactoryName] = useState("");
|
|
|
const deleteDisable = useMemo(() => {
|
|
|
return selectedRowKeys.length === 0;
|
|
|
}, [selectedRowKeys]);
|
|
@@ -138,25 +140,39 @@ const Audio: React.FC = () => {
|
|
|
width: 120,
|
|
|
render: (text: string) => skillData.find(item => item.uuid === text)?.name ?? '-',
|
|
|
},
|
|
|
+ {
|
|
|
+ title: "场站",
|
|
|
+ dataIndex: "ip",
|
|
|
+ key: "ip",
|
|
|
+ width: 120,
|
|
|
+ render: (text: string) => text ?? '-',
|
|
|
+ },
|
|
|
{
|
|
|
title: "操作",
|
|
|
dataIndex: "operation",
|
|
|
key: "operation",
|
|
|
fixed: "right",
|
|
|
width: 150,
|
|
|
- render: (_, record) => (
|
|
|
- <span style={{ display: "flex" }}>
|
|
|
- <Button color="primary" variant="link" className={styles.clo} onClick={() => editskill(record, 'show')}>
|
|
|
- 查看
|
|
|
- </Button>
|
|
|
- <Button color="primary" variant="link" className={styles.clo} onClick={() => editskill(record, 'edit')}>
|
|
|
- 编辑
|
|
|
- </Button>
|
|
|
- <Button color="primary" variant="link" className={styles.clo} onClick={() => deleteFn(record.uuid)}>
|
|
|
- 删除
|
|
|
- </Button>
|
|
|
- </span>
|
|
|
- ),
|
|
|
+ render: (_, record: any) => {
|
|
|
+ return (
|
|
|
+ <span style={{ display: "flex" }}>
|
|
|
+ <Button color="primary" variant="link" className={styles.clo} onClick={() => editskill(record, 'show')}>
|
|
|
+ 查看
|
|
|
+ </Button>
|
|
|
+ {record?.ip.trim() === factoryName &&
|
|
|
+ (<>
|
|
|
+ <Button color="primary" variant="link" className={styles.clo} onClick={() => editskill(record, 'edit')}>
|
|
|
+ 编辑
|
|
|
+ </Button>
|
|
|
+ <Button color="primary" variant="link" className={styles.clo} onClick={() => deleteFn(record.uuid)}>
|
|
|
+ 删除
|
|
|
+ </Button>
|
|
|
+ </>)
|
|
|
+ }
|
|
|
+
|
|
|
+ </span>
|
|
|
+ )
|
|
|
+ },
|
|
|
},
|
|
|
];
|
|
|
|
|
@@ -193,8 +209,9 @@ const Audio: React.FC = () => {
|
|
|
const listFn = () => {
|
|
|
setLoading(true);
|
|
|
getSensors(params).then((res) => {
|
|
|
- setDataSource(res.data.records ?? [])
|
|
|
- setTotal(res.data.total ?? 0)
|
|
|
+ setFactoryName(res.data.edgeName?.trim())
|
|
|
+ setDataSource(res.data.soundSensors.records ?? [])
|
|
|
+ setTotal(res.data.soundSensors.total ?? 0)
|
|
|
setLoading(false);
|
|
|
});
|
|
|
}
|
|
@@ -205,6 +222,9 @@ const Audio: React.FC = () => {
|
|
|
const rowSelection: TableRowSelection<DataType> = {
|
|
|
selectedRowKeys,
|
|
|
onChange: onSelectChange,
|
|
|
+ getCheckboxProps: (record: DataType) => ({
|
|
|
+ disabled: record?.ip.trim() !== factoryName
|
|
|
+ }),
|
|
|
selections: [
|
|
|
Table.SELECTION_ALL,
|
|
|
Table.SELECTION_INVERT,
|