Skip to content

Commit

Permalink
Merge pull request #190 from actiontech/fix_upgrade_render_sql_render
Browse files Browse the repository at this point in the history
[fix](com render sql): replace code for render sql com
  • Loading branch information
LZS911 authored Jan 25, 2024
2 parents d893dc4 + 34a438f commit 6d80343
Show file tree
Hide file tree
Showing 13 changed files with 5,590 additions and 5,172 deletions.
2 changes: 1 addition & 1 deletion packages/sqle/src/components/RenderSQL/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { RenderSQLStyleWrapper } from './style';
const RenderSQL: React.FC<RenderSQLProps> = ({
sql,
rows = 10,
tooltip,
tooltip = true,
onClick
}) => {
if (!sql) {
Expand Down
15 changes: 5 additions & 10 deletions packages/sqle/src/page/AuditPlan/PlanDetail/DetailCom/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ import audit_plan from '@actiontech/shared/lib/api/sqle/service/audit_plan';
import { IAuditPlanSQLHeadV1 } from '@actiontech/shared/lib/api/sqle/service/common';
import { AuditPlanSQLHeadV1TypeEnum } from '@actiontech/shared/lib/api/sqle/service/common.enum';
import { formatTime } from '@actiontech/shared/lib/utils/Common';
import HighlightCode from '../../../../utils/HighlightCode';
import { useTableRequestParams } from '@actiontech/shared/lib/components/ActiontechTable';

import RenderSQL from '../../../../components/RenderSQL';

const DetailCom = () => {
const { t } = useTranslation();

Expand Down Expand Up @@ -71,18 +72,12 @@ const DetailCom = () => {
(head as IAuditPlanSQLHeadV1[]).map((item) => ({
title: item.desc,
dataIndex: item.name,
width: item.type === AuditPlanSQLHeadV1TypeEnum.sql ? 300 : 'auto',
width: item.type === AuditPlanSQLHeadV1TypeEnum.sql ? 500 : 'auto',
render: (text) => {
if (item.type === AuditPlanSQLHeadV1TypeEnum.sql) {
// todo: RenderSQL
return (
<div className="sql-cont-width">
<pre
dangerouslySetInnerHTML={{
__html: HighlightCode.highlightSql(text)
}}
className="pre-warp-break-all"
></pre>
<div className="sql-cont-width" style={{ width: 500 }}>
<RenderSQL sql={text} />
</div>
);
}
Expand Down
Loading

0 comments on commit 6d80343

Please sign in to comment.