Skip to content

Commit

Permalink
chore: move OrderIdStyleWrapper to shared
Browse files Browse the repository at this point in the history
  • Loading branch information
siriuswh0327 committed Oct 27, 2023
1 parent ccd4ed1 commit 131f7a6
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 34 deletions.
16 changes: 16 additions & 0 deletions packages/shared/lib/styleWrapper/element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,19 @@ export const ConsolidatedListStyleWrapper = styled('section')`
}
}
`;

/**
* 功能: 用于带Icon的表格列,如工单号
*/
export const TableColumnWithIconStyleWrapper = styled('div')`
display: flex;
align-items: center;
span {
margin-right: 12px;
&:last-child {
margin-right: 0;
}
}
`;
6 changes: 3 additions & 3 deletions packages/sqle/src/page/AuditPlan/PlanList/column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import {
import { Link } from 'react-router-dom';
import { t } from '../../../locale';
import DatabaseTypeLogo from '../../../components/DatabaseTypeLogo';
import { OrderIdStyleWrapper } from '../../../style/order';
import { IconOrderId } from '../../../icon/Order';
import { RuleUrlParamKey } from '../../Rule/useRuleFilterForm';
import TokenCom from './TableTaskTypeFilter/component/TokenCom';
import { ModalName } from '../../../data/ModalName';
import { BasicToolTips } from '@actiontech/shared';
import { IconTipGray } from '@actiontech/shared/lib/Icon';
import { TableColumnWithIconStyleWrapper } from '@actiontech/shared/lib/styleWrapper/element';

export type PlanListTableFilterParamType = PageInfoWithoutIndexAndSize<
IGetAuditPlansV2Params,
Expand Down Expand Up @@ -107,12 +107,12 @@ const PlanListColumn: (
fixed: 'left',
render: (text: string) => {
return (
<OrderIdStyleWrapper>
<TableColumnWithIconStyleWrapper>
<IconOrderId />
<Link to={`/sqle/project/${projectID}/auditPlan/detail/${text}`}>
<span>{text}</span>
</Link>
</OrderIdStyleWrapper>
</TableColumnWithIconStyleWrapper>
);
}
},
Expand Down
6 changes: 3 additions & 3 deletions packages/sqle/src/page/Order/List/column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import OrderDesc from './components/OrderDesc';
import OrderStatus from './components/OrderStatus';
import { OrderNameStyleWrapper } from './style';
import { IconOrderId } from '../../../icon/Order';
import { OrderIdStyleWrapper } from '../../../style/order';
import { IWorkflowDetailResV1 } from '@actiontech/shared/lib/api/sqle/service/common';
import { IGetWorkflowsV1Params } from '@actiontech/shared/lib/api/sqle/service/workflow/index.d';
import { AvatarCom } from '@actiontech/shared';
import { TableColumnWithIconStyleWrapper } from '@actiontech/shared/lib/styleWrapper/element';

export type OrderListTableFilterParamType = PageInfoWithoutIndexAndSize<
IGetWorkflowsV1Params,
Expand Down Expand Up @@ -72,10 +72,10 @@ const OrderListColumn: (
title: () => t('order.order.id'),
render: (id: string) => {
return (
<OrderIdStyleWrapper>
<TableColumnWithIconStyleWrapper>
<IconOrderId />
<span>{id}</span>
</OrderIdStyleWrapper>
</TableColumnWithIconStyleWrapper>
);
},
fixed: 'left'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
import { useTranslation } from 'react-i18next';
import { useState } from 'react';
import { useNavigate } from 'react-router-dom';

import { Link, useNavigate } from 'react-router-dom';
import ChartWrapper from '../../../../../components/ChartCom/ChartWrapper';
import CardWrapper from '../../../../../components/CardWrapper';
import TableTopList, {
ITableTopList
} from '../../../../../components/ChartCom/TableTopList';
import { AvatarCom, BasicButton } from '@actiontech/shared';
import { OrderIdStyleWrapper } from '../../../../../style/order';
import OrderStatus from '../../../../Order/List/components/OrderStatus';
import { IconOrderId } from '../../../../../icon/Order';
import { Link } from '../../../../../components/Link';
import { useCurrentProject } from '@actiontech/shared/lib/global';
import { formatTime } from '@actiontech/shared/lib/utils/Common';
import useChatsDataByAPI from '../../hooks/useChatsDataByAPI';
import { IRiskWorkflow } from '@actiontech/shared/lib/api/sqle/service/common';
import { WorkflowDetailResV1StatusEnum } from '@actiontech/shared/lib/api/sqle/service/common.enum';
import statistic from '@actiontech/shared/lib/api/sqle/service/statistic';
import { TableColumnWithIconStyleWrapper } from '@actiontech/shared/lib/styleWrapper/element';

const OrderRiskList = () => {
const { t } = useTranslation();
Expand Down Expand Up @@ -53,12 +51,14 @@ const OrderRiskList = () => {
render: (name: string, record: IRiskWorkflow) => {
if (!name) return '-';
return (
<OrderIdStyleWrapper>
<TableColumnWithIconStyleWrapper>
<IconOrderId />
<Link to={`project/${projectID}/order/${record.workflow_id}`}>
<Link
to={`sqle/project/${projectID}/order/${record.workflow_id}`}
>
{name}
</Link>
</OrderIdStyleWrapper>
</TableColumnWithIconStyleWrapper>
);
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
import { useTranslation } from 'react-i18next';
import { useState } from 'react';
import { useNavigate } from 'react-router-dom';

import { Link, useNavigate } from 'react-router-dom';
import { Typography } from 'antd5';
import ChartWrapper from '../../../../../components/ChartCom/ChartWrapper';
import CardWrapper from '../../../../../components/CardWrapper';
import { BasicButton } from '@actiontech/shared';
import TableTopList, {
ITableTopList
} from '../../../../../components/ChartCom/TableTopList';
import { Link } from '../../../../../components/Link';
import { useCurrentProject } from '@actiontech/shared/lib/global';
import useChatsDataByAPI from '../../hooks/useChatsDataByAPI';
import { formatTime } from '@actiontech/shared/lib/utils/Common';
import { IcoScanId } from '../../../../../icon/Scan';
import { OrderIdStyleWrapper } from '../../../../../style/order';
import { formatParamsBySeparator } from '@actiontech/shared/lib/utils/Tool';
import { IRiskAuditPlan } from '@actiontech/shared/lib/api/sqle/service/common';
import statistic from '@actiontech/shared/lib/api/sqle/service/statistic';
import { TableColumnWithIconStyleWrapper } from '@actiontech/shared/lib/styleWrapper/element';

const ScanRiskList = () => {
const { t } = useTranslation();
Expand Down Expand Up @@ -59,17 +57,17 @@ const ScanRiskList = () => {
render: (name: string, record: IRiskAuditPlan) => {
if (!name) return '-';
return (
<OrderIdStyleWrapper>
<TableColumnWithIconStyleWrapper>
<span>
<IcoScanId />
</span>
<Link
data-testid="report-time"
to={`project/${projectID}/auditPlan/detail/${record.audit_plan_name}/report/${record.audit_plan_report_id}`}
to={`/sqle/project/${projectID}/auditPlan/detail/${record.audit_plan_name}/report/${record.audit_plan_report_id}`}
>
{name}
</Link>
</OrderIdStyleWrapper>
</TableColumnWithIconStyleWrapper>
);
}
},
Expand Down
14 changes: 0 additions & 14 deletions packages/sqle/src/style/order.ts

This file was deleted.

0 comments on commit 131f7a6

Please sign in to comment.