|
@@ -2,7 +2,7 @@ import { PageContainer } from '@ant-design/pro-layout';
|
|
|
import type { ActionType, ProColumns } from '@jetlinks/pro-table';
|
|
import type { ActionType, ProColumns } from '@jetlinks/pro-table';
|
|
|
import type { DeviceInstance } from '@/pages/device/Instance/typings';
|
|
import type { DeviceInstance } from '@/pages/device/Instance/typings';
|
|
|
import moment from 'moment';
|
|
import moment from 'moment';
|
|
|
-import { Badge, Button, Dropdown, Menu, message, Popconfirm, Tooltip } from 'antd';
|
|
|
|
|
|
|
+import { Badge, Button, Dropdown, Menu, message, Tooltip } from 'antd';
|
|
|
import { useEffect, useRef, useState } from 'react';
|
|
import { useEffect, useRef, useState } from 'react';
|
|
|
import { useHistory } from 'umi';
|
|
import { useHistory } from 'umi';
|
|
|
import {
|
|
import {
|
|
@@ -25,12 +25,11 @@ import Export from './Export';
|
|
|
import Import from './Import';
|
|
import Import from './Import';
|
|
|
import Process from './Process';
|
|
import Process from './Process';
|
|
|
import SearchComponent from '@/components/SearchComponent';
|
|
import SearchComponent from '@/components/SearchComponent';
|
|
|
-import { ProTableCard } from '@/components';
|
|
|
|
|
|
|
+import { ProTableCard, PermissionButton } from '@/components';
|
|
|
import SystemConst from '@/utils/const';
|
|
import SystemConst from '@/utils/const';
|
|
|
import Token from '@/utils/token';
|
|
import Token from '@/utils/token';
|
|
|
import DeviceCard from '@/components/ProTableCard/CardItems/device';
|
|
import DeviceCard from '@/components/ProTableCard/CardItems/device';
|
|
|
-
|
|
|
|
|
-import { getButtonPermission, getMenuPathByParams, MENUS_CODE } from '@/utils/menu';
|
|
|
|
|
|
|
+import { getMenuPathByParams, MENUS_CODE } from '@/utils/menu';
|
|
|
|
|
|
|
|
export const statusMap = new Map();
|
|
export const statusMap = new Map();
|
|
|
statusMap.set('在线', 'success');
|
|
statusMap.set('在线', 'success');
|
|
@@ -67,6 +66,7 @@ const Instance = (props: any) => {
|
|
|
const [searchParams, setSearchParams] = useState<any>({});
|
|
const [searchParams, setSearchParams] = useState<any>({});
|
|
|
const [bindKeys, setBindKeys] = useState<any[]>([]);
|
|
const [bindKeys, setBindKeys] = useState<any[]>([]);
|
|
|
const history = useHistory<Record<string, string>>();
|
|
const history = useHistory<Record<string, string>>();
|
|
|
|
|
+ const { permission } = PermissionButton.usePermission('device/Instance');
|
|
|
const intl = useIntl();
|
|
const intl = useIntl();
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
@@ -106,20 +106,18 @@ const Instance = (props: any) => {
|
|
|
<EyeOutlined />
|
|
<EyeOutlined />
|
|
|
</Tooltip>
|
|
</Tooltip>
|
|
|
</Button>,
|
|
</Button>,
|
|
|
- <Button
|
|
|
|
|
|
|
+ <PermissionButton
|
|
|
type={'link'}
|
|
type={'link'}
|
|
|
key={'state'}
|
|
key={'state'}
|
|
|
style={{ padding: 0 }}
|
|
style={{ padding: 0 }}
|
|
|
- disabled={getButtonPermission('device/Product', ['action'])}
|
|
|
|
|
- >
|
|
|
|
|
- <Popconfirm
|
|
|
|
|
- title={intl.formatMessage({
|
|
|
|
|
|
|
+ popConfirm={{
|
|
|
|
|
+ title: intl.formatMessage({
|
|
|
id: `pages.data.option.${
|
|
id: `pages.data.option.${
|
|
|
record.state.value !== 'notActive' ? 'disabled' : 'enabled'
|
|
record.state.value !== 'notActive' ? 'disabled' : 'enabled'
|
|
|
}.tips`,
|
|
}.tips`,
|
|
|
defaultMessage: '确认禁用?',
|
|
defaultMessage: '确认禁用?',
|
|
|
- })}
|
|
|
|
|
- onConfirm={async () => {
|
|
|
|
|
|
|
+ }),
|
|
|
|
|
+ onConfirm: async () => {
|
|
|
if (record.state.value !== 'notActive') {
|
|
if (record.state.value !== 'notActive') {
|
|
|
await service.undeployDevice(record.id);
|
|
await service.undeployDevice(record.id);
|
|
|
} else {
|
|
} else {
|
|
@@ -132,33 +130,31 @@ const Instance = (props: any) => {
|
|
|
}),
|
|
}),
|
|
|
);
|
|
);
|
|
|
actionRef.current?.reload();
|
|
actionRef.current?.reload();
|
|
|
- }}
|
|
|
|
|
- >
|
|
|
|
|
- <Tooltip
|
|
|
|
|
- title={intl.formatMessage({
|
|
|
|
|
- id: `pages.data.option.${record.state.value !== 'notActive' ? 'disabled' : 'enabled'}`,
|
|
|
|
|
- defaultMessage: record.state.value !== 'notActive' ? '禁用' : '启用',
|
|
|
|
|
- })}
|
|
|
|
|
- >
|
|
|
|
|
- {record.state.value !== 'notActive' ? <StopOutlined /> : <CheckCircleOutlined />}
|
|
|
|
|
- </Tooltip>
|
|
|
|
|
- </Popconfirm>{' '}
|
|
|
|
|
- </Button>,
|
|
|
|
|
-
|
|
|
|
|
- <Button
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ }}
|
|
|
|
|
+ isPermission={permission.action}
|
|
|
|
|
+ tooltip={{
|
|
|
|
|
+ title: intl.formatMessage({
|
|
|
|
|
+ id: `pages.data.option.${record.state.value !== 'notActive' ? 'disabled' : 'enabled'}`,
|
|
|
|
|
+ defaultMessage: record.state.value !== 'notActive' ? '禁用' : '启用',
|
|
|
|
|
+ }),
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ {record.state.value !== 'notActive' ? <StopOutlined /> : <CheckCircleOutlined />}
|
|
|
|
|
+ </PermissionButton>,
|
|
|
|
|
+ <PermissionButton
|
|
|
type={'link'}
|
|
type={'link'}
|
|
|
key={'delete'}
|
|
key={'delete'}
|
|
|
style={{ padding: 0 }}
|
|
style={{ padding: 0 }}
|
|
|
- disabled={getButtonPermission('device/Instance', ['delete'])}
|
|
|
|
|
- >
|
|
|
|
|
- <Popconfirm
|
|
|
|
|
- title={intl.formatMessage({
|
|
|
|
|
|
|
+ isPermission={permission.delete}
|
|
|
|
|
+ popConfirm={{
|
|
|
|
|
+ title: intl.formatMessage({
|
|
|
id:
|
|
id:
|
|
|
record.state.value === 'notActive'
|
|
record.state.value === 'notActive'
|
|
|
? 'pages.data.option.remove.tips'
|
|
? 'pages.data.option.remove.tips'
|
|
|
: 'pages.device.instance.deleteTip',
|
|
: 'pages.device.instance.deleteTip',
|
|
|
- })}
|
|
|
|
|
- onConfirm={async () => {
|
|
|
|
|
|
|
+ }),
|
|
|
|
|
+ onConfirm: async () => {
|
|
|
if (record.state.value === 'notActive') {
|
|
if (record.state.value === 'notActive') {
|
|
|
await service.remove(record.id);
|
|
await service.remove(record.id);
|
|
|
message.success(
|
|
message.success(
|
|
@@ -171,18 +167,11 @@ const Instance = (props: any) => {
|
|
|
} else {
|
|
} else {
|
|
|
message.error(intl.formatMessage({ id: 'pages.device.instance.deleteTip' }));
|
|
message.error(intl.formatMessage({ id: 'pages.device.instance.deleteTip' }));
|
|
|
}
|
|
}
|
|
|
- }}
|
|
|
|
|
- >
|
|
|
|
|
- <Tooltip
|
|
|
|
|
- title={intl.formatMessage({
|
|
|
|
|
- id: 'pages.data.option.remove',
|
|
|
|
|
- defaultMessage: '删除',
|
|
|
|
|
- })}
|
|
|
|
|
- >
|
|
|
|
|
- <DeleteOutlined />
|
|
|
|
|
- </Tooltip>
|
|
|
|
|
- </Popconfirm>
|
|
|
|
|
- </Button>,
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ <DeleteOutlined />
|
|
|
|
|
+ </PermissionButton>,
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
const columns: ProColumns<DeviceInstance>[] = [
|
|
const columns: ProColumns<DeviceInstance>[] = [
|
|
@@ -289,8 +278,8 @@ const Instance = (props: any) => {
|
|
|
const menu = (
|
|
const menu = (
|
|
|
<Menu>
|
|
<Menu>
|
|
|
<Menu.Item key="1">
|
|
<Menu.Item key="1">
|
|
|
- <Button
|
|
|
|
|
- disabled={getButtonPermission('device/Instance', ['export'])}
|
|
|
|
|
|
|
+ <PermissionButton
|
|
|
|
|
+ isPermission={permission.delete}
|
|
|
icon={<ExportOutlined />}
|
|
icon={<ExportOutlined />}
|
|
|
type="default"
|
|
type="default"
|
|
|
onClick={() => {
|
|
onClick={() => {
|
|
@@ -298,44 +287,43 @@ const Instance = (props: any) => {
|
|
|
}}
|
|
}}
|
|
|
>
|
|
>
|
|
|
批量导出设备
|
|
批量导出设备
|
|
|
- </Button>
|
|
|
|
|
|
|
+ </PermissionButton>
|
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
|
<Menu.Item key="2">
|
|
<Menu.Item key="2">
|
|
|
- <Button
|
|
|
|
|
- disabled={getButtonPermission('device/Instance', ['import'])}
|
|
|
|
|
|
|
+ <PermissionButton
|
|
|
|
|
+ isPermission={permission.import}
|
|
|
icon={<ImportOutlined />}
|
|
icon={<ImportOutlined />}
|
|
|
onClick={() => {
|
|
onClick={() => {
|
|
|
setImportVisible(true);
|
|
setImportVisible(true);
|
|
|
}}
|
|
}}
|
|
|
>
|
|
>
|
|
|
批量导入设备
|
|
批量导入设备
|
|
|
- </Button>
|
|
|
|
|
|
|
+ </PermissionButton>
|
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
|
<Menu.Item key="4">
|
|
<Menu.Item key="4">
|
|
|
- <Button
|
|
|
|
|
- disabled={getButtonPermission('device/Instance', ['active'])}
|
|
|
|
|
|
|
+ <PermissionButton
|
|
|
|
|
+ isPermission={permission.active}
|
|
|
icon={<CheckCircleOutlined />}
|
|
icon={<CheckCircleOutlined />}
|
|
|
type="primary"
|
|
type="primary"
|
|
|
ghost
|
|
ghost
|
|
|
- >
|
|
|
|
|
- <Popconfirm
|
|
|
|
|
- title={'确认激活全部设备?'}
|
|
|
|
|
- onConfirm={() => {
|
|
|
|
|
|
|
+ popConfirm={{
|
|
|
|
|
+ title: '确认激活全部设备?',
|
|
|
|
|
+ onConfirm: async () => {
|
|
|
setType('active');
|
|
setType('active');
|
|
|
const activeAPI = `/${
|
|
const activeAPI = `/${
|
|
|
SystemConst.API_BASE
|
|
SystemConst.API_BASE
|
|
|
}/device-instance/deploy?:X_Access_Token=${Token.get()}`;
|
|
}/device-instance/deploy?:X_Access_Token=${Token.get()}`;
|
|
|
setApi(activeAPI);
|
|
setApi(activeAPI);
|
|
|
setOperationVisible(true);
|
|
setOperationVisible(true);
|
|
|
- }}
|
|
|
|
|
- >
|
|
|
|
|
- 激活全部设备
|
|
|
|
|
- </Popconfirm>
|
|
|
|
|
- </Button>
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ 激活全部设备
|
|
|
|
|
+ </PermissionButton>
|
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
|
<Menu.Item key="5">
|
|
<Menu.Item key="5">
|
|
|
- <Button
|
|
|
|
|
- disabled={getButtonPermission('device/Instance', ['sync'])}
|
|
|
|
|
|
|
+ <PermissionButton
|
|
|
|
|
+ isPermission={permission.sync}
|
|
|
icon={<SyncOutlined />}
|
|
icon={<SyncOutlined />}
|
|
|
type="primary"
|
|
type="primary"
|
|
|
onClick={() => {
|
|
onClick={() => {
|
|
@@ -348,58 +336,52 @@ const Instance = (props: any) => {
|
|
|
}}
|
|
}}
|
|
|
>
|
|
>
|
|
|
同步设备状态
|
|
同步设备状态
|
|
|
- </Button>
|
|
|
|
|
|
|
+ </PermissionButton>
|
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
|
{bindKeys.length > 0 && (
|
|
{bindKeys.length > 0 && (
|
|
|
<Menu.Item key="3">
|
|
<Menu.Item key="3">
|
|
|
- <Button
|
|
|
|
|
- disabled={getButtonPermission('device/Instance', ['delete'])}
|
|
|
|
|
|
|
+ <PermissionButton
|
|
|
|
|
+ isPermission={permission.delete}
|
|
|
icon={<DeleteOutlined />}
|
|
icon={<DeleteOutlined />}
|
|
|
type="primary"
|
|
type="primary"
|
|
|
danger
|
|
danger
|
|
|
- >
|
|
|
|
|
- <Popconfirm
|
|
|
|
|
- title="确认删除选中设备?"
|
|
|
|
|
- onConfirm={() => {
|
|
|
|
|
|
|
+ popConfirm={{
|
|
|
|
|
+ title: '确认删除选中设备?',
|
|
|
|
|
+ onConfirm: () => {
|
|
|
service.batchDeleteDevice(bindKeys).then((resp) => {
|
|
service.batchDeleteDevice(bindKeys).then((resp) => {
|
|
|
if (resp.status === 200) {
|
|
if (resp.status === 200) {
|
|
|
message.success('操作成功');
|
|
message.success('操作成功');
|
|
|
actionRef.current?.reset?.();
|
|
actionRef.current?.reset?.();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- }}
|
|
|
|
|
- okText="确认"
|
|
|
|
|
- cancelText="取消"
|
|
|
|
|
- >
|
|
|
|
|
- 删除选中设备
|
|
|
|
|
- </Popconfirm>
|
|
|
|
|
- </Button>
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ 删除选中设备
|
|
|
|
|
+ </PermissionButton>
|
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
|
)}
|
|
)}
|
|
|
{bindKeys.length > 0 && (
|
|
{bindKeys.length > 0 && (
|
|
|
<Menu.Item key="6">
|
|
<Menu.Item key="6">
|
|
|
- <Button
|
|
|
|
|
- disabled={getButtonPermission('device/Instance', ['action'])}
|
|
|
|
|
|
|
+ <PermissionButton
|
|
|
|
|
+ isPermission={permission.action}
|
|
|
icon={<StopOutlined />}
|
|
icon={<StopOutlined />}
|
|
|
type="primary"
|
|
type="primary"
|
|
|
danger
|
|
danger
|
|
|
- >
|
|
|
|
|
- <Popconfirm
|
|
|
|
|
- title="确认禁用选中设备?"
|
|
|
|
|
- onConfirm={() => {
|
|
|
|
|
|
|
+ popConfirm={{
|
|
|
|
|
+ title: '确认禁用选中设备?',
|
|
|
|
|
+ onConfirm() {
|
|
|
service.batchUndeployDevice(bindKeys).then((resp) => {
|
|
service.batchUndeployDevice(bindKeys).then((resp) => {
|
|
|
if (resp.status === 200) {
|
|
if (resp.status === 200) {
|
|
|
message.success('操作成功');
|
|
message.success('操作成功');
|
|
|
actionRef.current?.reset?.();
|
|
actionRef.current?.reset?.();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- }}
|
|
|
|
|
- okText="确认"
|
|
|
|
|
- cancelText="取消"
|
|
|
|
|
- >
|
|
|
|
|
- 禁用选中设备
|
|
|
|
|
- </Popconfirm>
|
|
|
|
|
- </Button>
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ 禁用选中设备
|
|
|
|
|
+ </PermissionButton>
|
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
|
)}
|
|
)}
|
|
|
</Menu>
|
|
</Menu>
|
|
@@ -446,13 +428,13 @@ const Instance = (props: any) => {
|
|
|
},
|
|
},
|
|
|
}}
|
|
}}
|
|
|
headerTitle={[
|
|
headerTitle={[
|
|
|
- <Button
|
|
|
|
|
|
|
+ <PermissionButton
|
|
|
onClick={() => {
|
|
onClick={() => {
|
|
|
setVisible(true);
|
|
setVisible(true);
|
|
|
setCurrent({});
|
|
setCurrent({});
|
|
|
}}
|
|
}}
|
|
|
style={{ marginRight: 12 }}
|
|
style={{ marginRight: 12 }}
|
|
|
- disabled={getButtonPermission('device/Instance', 'add')}
|
|
|
|
|
|
|
+ isPermission={permission.add}
|
|
|
key="button"
|
|
key="button"
|
|
|
icon={<PlusOutlined />}
|
|
icon={<PlusOutlined />}
|
|
|
type="primary"
|
|
type="primary"
|
|
@@ -461,7 +443,7 @@ const Instance = (props: any) => {
|
|
|
id: 'pages.data.option.add',
|
|
id: 'pages.data.option.add',
|
|
|
defaultMessage: '新增',
|
|
defaultMessage: '新增',
|
|
|
})}
|
|
})}
|
|
|
- </Button>,
|
|
|
|
|
|
|
+ </PermissionButton>,
|
|
|
<Dropdown key={'more'} overlay={menu} placement="bottom">
|
|
<Dropdown key={'more'} overlay={menu} placement="bottom">
|
|
|
<Button>批量操作</Button>
|
|
<Button>批量操作</Button>
|
|
|
</Dropdown>,
|
|
</Dropdown>,
|
|
@@ -482,35 +464,34 @@ const Instance = (props: any) => {
|
|
|
</div>
|
|
</div>
|
|
|
}
|
|
}
|
|
|
actions={[
|
|
actions={[
|
|
|
- <Button
|
|
|
|
|
|
|
+ <PermissionButton
|
|
|
type={'link'}
|
|
type={'link'}
|
|
|
onClick={() => {
|
|
onClick={() => {
|
|
|
setCurrent(record);
|
|
setCurrent(record);
|
|
|
setVisible(true);
|
|
setVisible(true);
|
|
|
}}
|
|
}}
|
|
|
key={'edit'}
|
|
key={'edit'}
|
|
|
- disabled={getButtonPermission('device/Instance', ['update', 'add'])}
|
|
|
|
|
|
|
+ isPermission={permission.update}
|
|
|
>
|
|
>
|
|
|
<EditOutlined />
|
|
<EditOutlined />
|
|
|
{intl.formatMessage({
|
|
{intl.formatMessage({
|
|
|
id: 'pages.data.option.edit',
|
|
id: 'pages.data.option.edit',
|
|
|
defaultMessage: '编辑',
|
|
defaultMessage: '编辑',
|
|
|
})}
|
|
})}
|
|
|
- </Button>,
|
|
|
|
|
- <Button
|
|
|
|
|
- disabled={getButtonPermission('device/Instance', ['action'])}
|
|
|
|
|
|
|
+ </PermissionButton>,
|
|
|
|
|
+ <PermissionButton
|
|
|
|
|
+ isPermission={permission.action}
|
|
|
type={'link'}
|
|
type={'link'}
|
|
|
key={'state'}
|
|
key={'state'}
|
|
|
style={{ padding: 0 }}
|
|
style={{ padding: 0 }}
|
|
|
- >
|
|
|
|
|
- <Popconfirm
|
|
|
|
|
- title={intl.formatMessage({
|
|
|
|
|
|
|
+ popConfirm={{
|
|
|
|
|
+ title: intl.formatMessage({
|
|
|
id: `pages.data.option.${
|
|
id: `pages.data.option.${
|
|
|
record.state.value !== 'notActive' ? 'disabled' : 'enabled'
|
|
record.state.value !== 'notActive' ? 'disabled' : 'enabled'
|
|
|
}.tips`,
|
|
}.tips`,
|
|
|
defaultMessage: '确认禁用?',
|
|
defaultMessage: '确认禁用?',
|
|
|
- })}
|
|
|
|
|
- onConfirm={async () => {
|
|
|
|
|
|
|
+ }),
|
|
|
|
|
+ onConfirm: async () => {
|
|
|
if (record.state.value !== 'notActive') {
|
|
if (record.state.value !== 'notActive') {
|
|
|
await service.undeployDevice(record.id);
|
|
await service.undeployDevice(record.id);
|
|
|
} else {
|
|
} else {
|
|
@@ -523,33 +504,30 @@ const Instance = (props: any) => {
|
|
|
}),
|
|
}),
|
|
|
);
|
|
);
|
|
|
actionRef.current?.reload();
|
|
actionRef.current?.reload();
|
|
|
- }}
|
|
|
|
|
- >
|
|
|
|
|
- {record.state.value !== 'notActive' ? <StopOutlined /> : <CheckCircleOutlined />}
|
|
|
|
|
- {intl.formatMessage({
|
|
|
|
|
- id: `pages.data.option.${
|
|
|
|
|
- record.state.value !== 'notActive' ? 'disabled' : 'enabled'
|
|
|
|
|
- }`,
|
|
|
|
|
- defaultMessage: record.state.value !== 'notActive' ? '禁用' : '启用',
|
|
|
|
|
- })}
|
|
|
|
|
- </Popconfirm>
|
|
|
|
|
- </Button>,
|
|
|
|
|
-
|
|
|
|
|
- <Button
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ {record.state.value !== 'notActive' ? <StopOutlined /> : <CheckCircleOutlined />}
|
|
|
|
|
+ {intl.formatMessage({
|
|
|
|
|
+ id: `pages.data.option.${
|
|
|
|
|
+ record.state.value !== 'notActive' ? 'disabled' : 'enabled'
|
|
|
|
|
+ }`,
|
|
|
|
|
+ defaultMessage: record.state.value !== 'notActive' ? '禁用' : '启用',
|
|
|
|
|
+ })}
|
|
|
|
|
+ </PermissionButton>,
|
|
|
|
|
+ <PermissionButton
|
|
|
key="delete"
|
|
key="delete"
|
|
|
- disabled={getButtonPermission('device/Instance', ['delete'])}
|
|
|
|
|
|
|
+ isPermission={permission.delete}
|
|
|
type={'link'}
|
|
type={'link'}
|
|
|
style={{ padding: 0 }}
|
|
style={{ padding: 0 }}
|
|
|
- >
|
|
|
|
|
- <Popconfirm
|
|
|
|
|
- title={intl.formatMessage({
|
|
|
|
|
|
|
+ popConfirm={{
|
|
|
|
|
+ title: intl.formatMessage({
|
|
|
id:
|
|
id:
|
|
|
record.state.value === 'notActive'
|
|
record.state.value === 'notActive'
|
|
|
? 'pages.data.option.remove.tips'
|
|
? 'pages.data.option.remove.tips'
|
|
|
: 'pages.device.instance.deleteTip',
|
|
: 'pages.device.instance.deleteTip',
|
|
|
- })}
|
|
|
|
|
- key={'delete'}
|
|
|
|
|
- onConfirm={async () => {
|
|
|
|
|
|
|
+ }),
|
|
|
|
|
+ onConfirm: async () => {
|
|
|
if (record.state.value === 'notActive') {
|
|
if (record.state.value === 'notActive') {
|
|
|
await service.remove(record.id);
|
|
await service.remove(record.id);
|
|
|
message.success(
|
|
message.success(
|
|
@@ -562,11 +540,11 @@ const Instance = (props: any) => {
|
|
|
} else {
|
|
} else {
|
|
|
message.error(intl.formatMessage({ id: 'pages.device.instance.deleteTip' }));
|
|
message.error(intl.formatMessage({ id: 'pages.device.instance.deleteTip' }));
|
|
|
}
|
|
}
|
|
|
- }}
|
|
|
|
|
- >
|
|
|
|
|
- <DeleteOutlined />
|
|
|
|
|
- </Popconfirm>
|
|
|
|
|
- </Button>,
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ <DeleteOutlined />
|
|
|
|
|
+ </PermissionButton>,
|
|
|
]}
|
|
]}
|
|
|
/>
|
|
/>
|
|
|
)}
|
|
)}
|