Skip to content

Commit

Permalink
Merge pull request #6 from actiontech/feature/DMS-522
Browse files Browse the repository at this point in the history
fix: order related issues
  • Loading branch information
LZS911 authored Oct 20, 2023
2 parents f08cd07 + 6094569 commit 723a396
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 13 deletions.
28 changes: 28 additions & 0 deletions packages/sqle/src/icon/Order.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -672,3 +672,31 @@ export const IconFailedOrderStep: React.FC<CustomIconProps> = ({ color }) => {
</CommonIconStyleWrapper>
);
};

export const IconOrderUploadTypeChecked: React.FC<CustomIconProps> = ({
className
}) => {
return (
<CommonIconStyleWrapper
className={classnames('icon-order-upload-checked', className)}
>
<svg
width="14"
height="14"
viewBox="0 0 14 14"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g id="Frame">
<path
id="Vector"
d="M3.88879 7.00002L6.22213 9.33335L10.8888 4.66669"
stroke="#FCFBF9"
strokeWidth="1.5"
strokeLinejoin="round"
/>
</g>
</svg>
</CommonIconStyleWrapper>
);
};
7 changes: 5 additions & 2 deletions packages/sqle/src/page/Order/AuditDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const AuditDetail: React.FC<OrderDetailAuditResultProps> = ({
taskInfos,
orderInfo,
projectName,
orderStatus,
...props
}) => {
const { t } = useTranslation();
Expand Down Expand Up @@ -122,7 +123,8 @@ const AuditDetail: React.FC<OrderDetailAuditResultProps> = ({
duplicate,
auditResultActiveKey,
auditLevelFilterValue,
currentListLayout
currentListLayout,
orderStatus
]
}
);
Expand Down Expand Up @@ -173,7 +175,8 @@ const AuditDetail: React.FC<OrderDetailAuditResultProps> = ({
auditResultActiveKey,
duplicate,
tableFilterInfo,
auditLevelFilterValue
auditLevelFilterValue,
orderStatus
],
isNoMore: (d) => {
return d ? (d.list.length % 20 > 0 ? true : false) : false;
Expand Down
2 changes: 1 addition & 1 deletion packages/sqle/src/page/Order/Create/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ const Create: React.FC = () => {

<CreatedResult
createdOrderId={createdOrderId}
desc={baseForm.getFieldsValue()?.desc ?? '-'}
desc={baseForm.getFieldsValue()?.desc ?? ''}
hidden={!showResult}
projectID={projectID}
/>
Expand Down
2 changes: 0 additions & 2 deletions packages/sqle/src/page/Order/List/column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ const OrderListColumn: (
dataIndex: 'workflow_name',
className: 'order-list-table-workflow-name-column',
title: () => t('order.order.name'),
sorter: true,
render: (name: string) => (
<OrderNameStyleWrapper ellipsis={true}>{name}</OrderNameStyleWrapper>
),
Expand All @@ -94,7 +93,6 @@ const OrderListColumn: (
dataIndex: 'desc',
title: () => t('order.order.desc'),
className: 'order-list-table-desc-column',
sorter: true,
render: (desc: string, record: IWorkflowDetailResV1) =>
desc ? (
<OrderDesc
Expand Down
14 changes: 7 additions & 7 deletions packages/sqle/src/page/Order/SQLStatementForm/UploadType.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { UploadItemTypeStyleWrapper } from './style';
import { SQLInputType } from '.';
import { IconOrderFileUpload, IconOrderSQLUpload } from '../../../icon/Order';
import { useTranslation } from 'react-i18next';
import { Row, Col } from 'antd5';
import UploadTypeItem from './UploadTypeItem';

const UploadType: React.FC<{
value?: SQLInputType;
Expand All @@ -13,31 +13,31 @@ const UploadType: React.FC<{
return (
<Row gutter={12}>
<Col span={8}>
<UploadItemTypeStyleWrapper
<UploadTypeItem
onClick={() => onChange?.(SQLInputType.manualInput)}
active={value === SQLInputType.manualInput}
>
<IconOrderSQLUpload />
<span className="text">{t('order.sqlInfo.manualInput')}</span>
</UploadItemTypeStyleWrapper>
</UploadTypeItem>
</Col>
<Col span={8}>
<UploadItemTypeStyleWrapper
<UploadTypeItem
active={value === SQLInputType.uploadFile}
onClick={() => onChange?.(SQLInputType.uploadFile)}
>
<IconOrderFileUpload />
<span className="text">{t('order.sqlInfo.uploadFile')}</span>
</UploadItemTypeStyleWrapper>
</UploadTypeItem>
</Col>
<Col span={8} hidden={hideUpdateMybatisFile}>
<UploadItemTypeStyleWrapper
<UploadTypeItem
active={value === SQLInputType.uploadMybatisFile}
onClick={() => onChange?.(SQLInputType.uploadMybatisFile)}
>
<IconOrderFileUpload />
<span className="text">{t('order.sqlInfo.updateMybatisFile')}</span>
</UploadItemTypeStyleWrapper>
</UploadTypeItem>
</Col>
</Row>
);
Expand Down
23 changes: 23 additions & 0 deletions packages/sqle/src/page/Order/SQLStatementForm/UploadTypeItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ReactNode } from 'react';
import { UploadItemTypeStyleWrapper } from './style';
import { IconOrderUploadTypeChecked } from '../../../icon/Order';
import { EmptyBox } from '@actiontech/shared';

const UploadTypeItem: React.FC<{
active: boolean;
onClick: () => void;
children: ReactNode;
}> = ({ active, onClick, children }) => {
return (
<UploadItemTypeStyleWrapper active={active} onClick={onClick}>
{children}
<EmptyBox if={active}>
<div className="active-icon-wrapper">
<IconOrderUploadTypeChecked className="active-icon" />
</div>
</EmptyBox>
</UploadItemTypeStyleWrapper>
);
};

export default UploadTypeItem;
19 changes: 19 additions & 0 deletions packages/sqle/src/page/Order/SQLStatementForm/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export const UploadItemTypeStyleWrapper = styled('div')<{ active?: boolean }>`
cursor: pointer;
transition: border-color 0.4s ease;
transition: color 0.4s ease;
position: relative;
overflow: hidden;
.custom-icon {
display: inline-block;
Expand All @@ -42,4 +44,21 @@ export const UploadItemTypeStyleWrapper = styled('div')<{ active?: boolean }>`
? theme.sharedTheme.uiToken.colorPrimary
: theme.sharedTheme.uiToken.colorText};
}
.active-icon-wrapper {
width: 0;
height: 0;
border: 11px solid ${({ theme }) => theme.sharedTheme.uiToken.colorPrimary};
border-left-color: transparent;
border-bottom-color: transparent;
position: absolute;
top: 0;
right: 0;
.active-icon {
position: absolute;
top: -11px;
right: -11px;
}
}
`;
2 changes: 1 addition & 1 deletion packages/sqle/src/page/Order/hooks/useAllowAuditLevel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const useAllowAuditLevel = () => {
return false;
});
if (invalidTasks.length > 0 && tips.length > 0) {
setDisabledOperatorOrderBtnTips(tips.join('\n'));
setDisabledOperatorOrderBtnTips([...new Set(tips)].join('\n'));
setBtnDisabled();
} else {
resetBtnDisabled();
Expand Down

0 comments on commit 723a396

Please sign in to comment.