Skip to content

Commit

Permalink
refactor(subscribe): add redefine_severity column #4
Browse files Browse the repository at this point in the history
  • Loading branch information
jsers committed Mar 29, 2023
1 parent f80de78 commit 06d8ce4
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions src/pages/warning/subscribe/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import React, { useState, useEffect, useContext } from 'react';
import { Button, Input, Table, message, Modal, Space, Select, Tag } from 'antd';
import { CopyOutlined, ExclamationCircleOutlined, SearchOutlined } from '@ant-design/icons';
import { ColumnsType } from 'antd/lib/table';
import { useHistory, useLocation } from 'react-router-dom';
import { useHistory, useLocation, Link } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import _ from 'lodash';
import queryString from 'query-string';
Expand All @@ -29,6 +29,7 @@ import { BusinessGroup } from '@/pages/targets';
import RefreshIcon from '@/components/RefreshIcon';
import BlankBusinessPlaceholder from '@/components/BlankBusinessPlaceholder';
import { CommonStateContext } from '@/App';
import { priorityColor } from '@/utils/constant';
import { pageSizeOptionsDefault } from '../const';
import './locale';
import './index.less';
Expand Down Expand Up @@ -109,7 +110,17 @@ const Shield: React.FC = () => {
);
},
},

{
title: t('redefine_severity'),
dataIndex: 'redefine_severity',
render: (text: number) => {
return (
<Tag key={text} color={priorityColor[text - 1]}>
S{text}
</Tag>
);
},
},
{
title: t('common:table.create_by'),
ellipsis: true,
Expand All @@ -122,19 +133,14 @@ const Shield: React.FC = () => {
render: (text: undefined, record: subscribeItem) => {
return (
<>
<div className='table-operator-area'>
<div
className='table-operator-area-normal'
style={{
cursor: 'pointer',
display: 'inline-block',
}}
onClick={() => {
history.push(`/alert-subscribes/edit/${record.id}`);
<Space>
<Link
to={{
pathname: `/alert-subscribes/edit/${record.id}`,
}}
>
{t('common:btn.modify')}
</div>
</Link>
<div
className='table-operator-area-normal'
style={{
Expand All @@ -149,10 +155,6 @@ const Shield: React.FC = () => {
</div>
<div
className='table-operator-area-warning'
style={{
cursor: 'pointer',
display: 'inline-block',
}}
onClick={() => {
confirm({
title: t('common:confirm.delete'),
Expand All @@ -167,7 +169,7 @@ const Shield: React.FC = () => {
>
{t('common:btn.delete')}
</div>
</div>
</Space>
</>
);
},
Expand Down

0 comments on commit 06d8ce4

Please sign in to comment.