| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- import { PageContainer } from '@ant-design/pro-layout';
- import BaseService from '@/utils/BaseService';
- import type { GatewayItem } from '@/pages/link/Gateway/typings';
- import { useRef } from 'react';
- import type { ActionType, ProColumns } from '@jetlinks/pro-table';
- import { Tooltip } from 'antd';
- import {
- ArrowDownOutlined,
- BarsOutlined,
- BugOutlined,
- EditOutlined,
- MinusOutlined,
- } from '@ant-design/icons';
- import BaseCrud from '@/components/BaseCrud';
- import { useIntl } from '@@/plugin-locale/localeExports';
- export const service = new BaseService<GatewayItem>('network/config');
- const Gateway = () => {
- const intl = useIntl();
- const actionRef = useRef<ActionType>();
- const columns: ProColumns<GatewayItem>[] = [
- {
- dataIndex: 'index',
- valueType: 'indexBorder',
- width: 48,
- },
- {
- dataIndex: 'name',
- title: intl.formatMessage({
- id: 'pages.table.name',
- defaultMessage: '名称',
- }),
- },
- {
- dataIndex: 'type',
- title: intl.formatMessage({
- id: 'pages.link.type',
- defaultMessage: '类型',
- }),
- },
- {
- dataIndex: 'state',
- title: intl.formatMessage({
- id: 'pages.searchTable.titleStatus',
- defaultMessage: '状态',
- }),
- render: (text, record) => record.state.value,
- },
- {
- title: intl.formatMessage({
- id: 'pages.data.option',
- defaultMessage: '操作',
- }),
- valueType: 'option',
- align: 'center',
- width: 200,
- render: (text, record) => [
- <a onClick={() => console.log(record)}>
- <Tooltip
- title={intl.formatMessage({
- id: 'pages.data.option.edit',
- defaultMessage: '编辑',
- })}
- >
- <EditOutlined />
- </Tooltip>
- </a>,
- <a>
- <Tooltip
- title={intl.formatMessage({
- id: 'pages.data.option.remove',
- defaultMessage: '删除',
- })}
- >
- <MinusOutlined />
- </Tooltip>
- </a>,
- <a>
- <Tooltip
- title={intl.formatMessage({
- id: 'pages.data.option.download',
- defaultMessage: '下载配置',
- })}
- >
- <ArrowDownOutlined />
- </Tooltip>
- </a>,
- <a>
- <Tooltip
- title={intl.formatMessage({
- id: 'pages.notice.option.debug',
- defaultMessage: '调试',
- })}
- >
- <BugOutlined />
- </Tooltip>
- </a>,
- <a>
- <Tooltip
- title={intl.formatMessage({
- id: 'pages.data.option.record',
- defaultMessage: '通知记录',
- })}
- >
- <BarsOutlined />
- </Tooltip>
- </a>,
- ],
- },
- ];
- const schema = {};
- return (
- <PageContainer>
- <BaseCrud
- columns={columns}
- service={service}
- title={intl.formatMessage({
- id: 'pages.link.gateway',
- defaultMessage: '设备网关',
- })}
- schema={schema}
- actionRef={actionRef}
- />
- </PageContainer>
- );
- };
- export default Gateway;
|