|
@@ -97,14 +97,14 @@ const Access = () => {
|
|
|
popConfirm={{
|
|
popConfirm={{
|
|
|
title: intl.formatMessage({
|
|
title: intl.formatMessage({
|
|
|
id: `pages.data.option.${
|
|
id: `pages.data.option.${
|
|
|
- record.state.value !== 'disabled' ? 'disabled' : 'enabled'
|
|
|
|
|
|
|
+ record.state?.value !== 'disabled' ? 'disabled' : 'enabled'
|
|
|
}.tips`,
|
|
}.tips`,
|
|
|
defaultMessage: '确认禁用?',
|
|
defaultMessage: '确认禁用?',
|
|
|
}),
|
|
}),
|
|
|
onConfirm: async () => {
|
|
onConfirm: async () => {
|
|
|
const item = {
|
|
const item = {
|
|
|
...record,
|
|
...record,
|
|
|
- state: record.state.value === 'enabled' ? 'disabled' : 'enabled',
|
|
|
|
|
|
|
+ state: record.state?.value === 'enabled' ? 'disabled' : 'enabled',
|
|
|
};
|
|
};
|
|
|
await service.saveMetadataConfig(opcUaId, deviceId, item);
|
|
await service.saveMetadataConfig(opcUaId, deviceId, item);
|
|
|
message.success(
|
|
message.success(
|
|
@@ -120,24 +120,24 @@ const Access = () => {
|
|
|
tooltip={{
|
|
tooltip={{
|
|
|
title: intl.formatMessage({
|
|
title: intl.formatMessage({
|
|
|
id: `pages.data.option.${record.state.value !== 'disabled' ? 'disabled' : 'enabled'}`,
|
|
id: `pages.data.option.${record.state.value !== 'disabled' ? 'disabled' : 'enabled'}`,
|
|
|
- defaultMessage: record.state.value !== 'disabled' ? '禁用' : '启用',
|
|
|
|
|
|
|
+ defaultMessage: record.state?.value !== 'disabled' ? '禁用' : '启用',
|
|
|
}),
|
|
}),
|
|
|
}}
|
|
}}
|
|
|
>
|
|
>
|
|
|
- {record.state.value !== 'disabled' ? <StopOutlined /> : <PlayCircleOutlined />}
|
|
|
|
|
|
|
+ {record.state?.value !== 'disabled' ? <StopOutlined /> : <PlayCircleOutlined />}
|
|
|
</PermissionButton>,
|
|
</PermissionButton>,
|
|
|
<PermissionButton
|
|
<PermissionButton
|
|
|
isPermission={permission.delete}
|
|
isPermission={permission.delete}
|
|
|
style={{ padding: 0 }}
|
|
style={{ padding: 0 }}
|
|
|
- disabled={record.state.value === 'enabled'}
|
|
|
|
|
|
|
+ disabled={record.state?.value === 'enabled'}
|
|
|
tooltip={{
|
|
tooltip={{
|
|
|
title:
|
|
title:
|
|
|
- record.state.value === 'disabled'
|
|
|
|
|
|
|
+ record.state?.value === 'disabled'
|
|
|
? intl.formatMessage({
|
|
? intl.formatMessage({
|
|
|
id: 'pages.data.option.remove',
|
|
id: 'pages.data.option.remove',
|
|
|
defaultMessage: '删除',
|
|
defaultMessage: '删除',
|
|
|
})
|
|
})
|
|
|
- : '请先禁用该组件,再删除。',
|
|
|
|
|
|
|
+ : '请先禁用该点位,再删除。',
|
|
|
}}
|
|
}}
|
|
|
popConfirm={{
|
|
popConfirm={{
|
|
|
title: '确认删除',
|
|
title: '确认删除',
|
|
@@ -264,8 +264,8 @@ const Access = () => {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}}
|
|
}}
|
|
|
- okText="Yes"
|
|
|
|
|
- cancelText="No"
|
|
|
|
|
|
|
+ okText="是"
|
|
|
|
|
+ cancelText="否"
|
|
|
>
|
|
>
|
|
|
<DisconnectOutlined className={styles.icon} />
|
|
<DisconnectOutlined className={styles.icon} />
|
|
|
</Popconfirm>
|
|
</Popconfirm>
|