Unverified Commit 43bd8265 authored by Licho's avatar Licho Committed by GitHub

fix: CTAS not execute (#2647)

* fix: CTAS not execute Signed-off-by: 's avatarlicho <lecho.sun@gmail.com> * Spotless Apply --------- Signed-off-by: 's avatarlicho <lecho.sun@gmail.com> Co-authored-by: 's avatarleechor <leechor@users.noreply.github.com>
parent 7712e433
...@@ -66,8 +66,6 @@ import org.apache.flink.table.operations.Operation; ...@@ -66,8 +66,6 @@ import org.apache.flink.table.operations.Operation;
import org.apache.flink.table.operations.QueryOperation; import org.apache.flink.table.operations.QueryOperation;
import org.apache.flink.table.operations.command.ResetOperation; import org.apache.flink.table.operations.command.ResetOperation;
import org.apache.flink.table.operations.command.SetOperation; import org.apache.flink.table.operations.command.SetOperation;
import org.apache.flink.table.operations.ddl.CreateTableASOperation;
import org.apache.flink.table.operations.ddl.CreateTableOperation;
import org.apache.flink.table.planner.delegation.DefaultExecutor; import org.apache.flink.table.planner.delegation.DefaultExecutor;
import org.apache.flink.table.typeutils.FieldInfoUtils; import org.apache.flink.table.typeutils.FieldInfoUtils;
import org.apache.flink.types.Row; import org.apache.flink.types.Row;
...@@ -376,16 +374,6 @@ public class CustomTableEnvironmentImpl extends AbstractCustomTableEnvironment { ...@@ -376,16 +374,6 @@ public class CustomTableEnvironmentImpl extends AbstractCustomTableEnvironment {
createTemporaryView(s, fromChangelogStream(dataStream)); createTemporaryView(s, fromChangelogStream(dataStream));
} }
@Override
public void executeCTAS(Operation operation) {
if (operation instanceof CreateTableASOperation) {
CreateTableASOperation createTableASOperation = (CreateTableASOperation) operation;
CreateTableOperation createTableOperation = createTableASOperation.getCreateTableOperation();
executeInternal(createTableOperation);
getPlanner().translate(CollUtil.newArrayList(createTableASOperation.getInsertOperation()));
}
}
@Override @Override
public <T> void createTemporaryView(String path, DataStream<T> dataStream, Expression... fields) { public <T> void createTemporaryView(String path, DataStream<T> dataStream, Expression... fields) {
createTemporaryView(path, fromDataStream(dataStream, fields)); createTemporaryView(path, fromDataStream(dataStream, fields));
......
...@@ -59,11 +59,8 @@ import org.apache.flink.table.operations.ExplainOperation; ...@@ -59,11 +59,8 @@ import org.apache.flink.table.operations.ExplainOperation;
import org.apache.flink.table.operations.ModifyOperation; import org.apache.flink.table.operations.ModifyOperation;
import org.apache.flink.table.operations.Operation; import org.apache.flink.table.operations.Operation;
import org.apache.flink.table.operations.QueryOperation; import org.apache.flink.table.operations.QueryOperation;
import org.apache.flink.table.operations.SinkModifyOperation;
import org.apache.flink.table.operations.command.ResetOperation; import org.apache.flink.table.operations.command.ResetOperation;
import org.apache.flink.table.operations.command.SetOperation; import org.apache.flink.table.operations.command.SetOperation;
import org.apache.flink.table.operations.ddl.CreateTableASOperation;
import org.apache.flink.table.operations.ddl.CreateTableOperation;
import org.apache.flink.types.Row; import org.apache.flink.types.Row;
import java.io.File; import java.io.File;
...@@ -348,17 +345,6 @@ public class CustomTableEnvironmentImpl extends AbstractCustomTableEnvironment { ...@@ -348,17 +345,6 @@ public class CustomTableEnvironmentImpl extends AbstractCustomTableEnvironment {
createTemporaryView(s, fromChangelogStream(dataStream)); createTemporaryView(s, fromChangelogStream(dataStream));
} }
@Override
public void executeCTAS(Operation operation) {
if (operation instanceof CreateTableASOperation) {
CreateTableASOperation createTableASOperation = (CreateTableASOperation) operation;
CreateTableOperation createTableOperation = createTableASOperation.getCreateTableOperation();
executeInternal(createTableOperation);
SinkModifyOperation sinkModifyOperation = createTableASOperation.toSinkModifyOperation(getCatalogManager());
getPlanner().translate(CollUtil.newArrayList(sinkModifyOperation));
}
}
@Override @Override
public <T> void createTemporaryView(String path, DataStream<T> dataStream, Expression... fields) { public <T> void createTemporaryView(String path, DataStream<T> dataStream, Expression... fields) {
createTemporaryView(path, fromDataStream(dataStream, fields)); createTemporaryView(path, fromDataStream(dataStream, fields));
......
...@@ -41,15 +41,12 @@ import org.apache.flink.table.api.EnvironmentSettings; ...@@ -41,15 +41,12 @@ import org.apache.flink.table.api.EnvironmentSettings;
import org.apache.flink.table.api.ExplainDetail; import org.apache.flink.table.api.ExplainDetail;
import org.apache.flink.table.api.TableException; import org.apache.flink.table.api.TableException;
import org.apache.flink.table.api.bridge.java.StreamTableEnvironment; import org.apache.flink.table.api.bridge.java.StreamTableEnvironment;
import org.apache.flink.table.operations.CreateTableASOperation;
import org.apache.flink.table.operations.ExplainOperation; import org.apache.flink.table.operations.ExplainOperation;
import org.apache.flink.table.operations.ModifyOperation; import org.apache.flink.table.operations.ModifyOperation;
import org.apache.flink.table.operations.Operation; import org.apache.flink.table.operations.Operation;
import org.apache.flink.table.operations.QueryOperation; import org.apache.flink.table.operations.QueryOperation;
import org.apache.flink.table.operations.SinkModifyOperation;
import org.apache.flink.table.operations.command.ResetOperation; import org.apache.flink.table.operations.command.ResetOperation;
import org.apache.flink.table.operations.command.SetOperation; import org.apache.flink.table.operations.command.SetOperation;
import org.apache.flink.table.operations.ddl.CreateTableOperation;
import org.apache.flink.types.Row; import org.apache.flink.types.Row;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -64,8 +61,6 @@ import org.slf4j.LoggerFactory; ...@@ -64,8 +61,6 @@ import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.ObjectNode;
import cn.hutool.core.collection.CollUtil;
/** /**
* CustomTableEnvironmentImpl * CustomTableEnvironmentImpl
* *
...@@ -165,14 +160,7 @@ public class CustomTableEnvironmentImpl extends AbstractCustomTableEnvironment { ...@@ -165,14 +160,7 @@ public class CustomTableEnvironmentImpl extends AbstractCustomTableEnvironment {
throw new TableException("Only single statement is supported."); throw new TableException("Only single statement is supported.");
} }
Operation operation = operations.get(0); Operation operation = operations.get(0);
if (operation instanceof CreateTableASOperation) { if (operation instanceof ModifyOperation) {
CreateTableASOperation createTableAsOperation = (CreateTableASOperation) operation;
CreateTableOperation createTableOperation = createTableAsOperation.getCreateTableOperation();
executeInternal(createTableOperation);
SinkModifyOperation sinkModifyOperation =
createTableAsOperation.toSinkModifyOperation(getCatalogManager());
getPlanner().translate(CollUtil.newArrayList(sinkModifyOperation));
} else if (operation instanceof ModifyOperation) {
modifyOperations.add((ModifyOperation) operation); modifyOperations.add((ModifyOperation) operation);
} else { } else {
throw new TableException("Only insert statement is supported now."); throw new TableException("Only insert statement is supported now.");
...@@ -265,15 +253,4 @@ public class CustomTableEnvironmentImpl extends AbstractCustomTableEnvironment { ...@@ -265,15 +253,4 @@ public class CustomTableEnvironmentImpl extends AbstractCustomTableEnvironment {
public <T> void createTemporaryView(String s, DataStream<Row> dataStream, List<String> columnNameList) { public <T> void createTemporaryView(String s, DataStream<Row> dataStream, List<String> columnNameList) {
createTemporaryView(s, fromChangelogStream(dataStream)); createTemporaryView(s, fromChangelogStream(dataStream));
} }
@Override
public void executeCTAS(Operation operation) {
if (operation instanceof CreateTableASOperation) {
CreateTableASOperation createTableASOperation = (CreateTableASOperation) operation;
CreateTableOperation createTableOperation = createTableASOperation.getCreateTableOperation();
executeInternal(createTableOperation);
SinkModifyOperation sinkModifyOperation = createTableASOperation.toSinkModifyOperation(getCatalogManager());
getPlanner().translate(CollUtil.newArrayList(sinkModifyOperation));
}
}
} }
...@@ -40,15 +40,12 @@ import org.apache.flink.table.api.ExplainDetail; ...@@ -40,15 +40,12 @@ import org.apache.flink.table.api.ExplainDetail;
import org.apache.flink.table.api.ExplainFormat; import org.apache.flink.table.api.ExplainFormat;
import org.apache.flink.table.api.TableException; import org.apache.flink.table.api.TableException;
import org.apache.flink.table.api.bridge.java.StreamTableEnvironment; import org.apache.flink.table.api.bridge.java.StreamTableEnvironment;
import org.apache.flink.table.operations.CreateTableASOperation;
import org.apache.flink.table.operations.ExplainOperation; import org.apache.flink.table.operations.ExplainOperation;
import org.apache.flink.table.operations.ModifyOperation; import org.apache.flink.table.operations.ModifyOperation;
import org.apache.flink.table.operations.Operation; import org.apache.flink.table.operations.Operation;
import org.apache.flink.table.operations.QueryOperation; import org.apache.flink.table.operations.QueryOperation;
import org.apache.flink.table.operations.SinkModifyOperation;
import org.apache.flink.table.operations.command.ResetOperation; import org.apache.flink.table.operations.command.ResetOperation;
import org.apache.flink.table.operations.command.SetOperation; import org.apache.flink.table.operations.command.SetOperation;
import org.apache.flink.table.operations.ddl.CreateTableOperation;
import org.apache.flink.types.Row; import org.apache.flink.types.Row;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -65,8 +62,6 @@ import com.fasterxml.jackson.core.JsonProcessingException; ...@@ -65,8 +62,6 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.ObjectNode;
import cn.hutool.core.collection.CollUtil;
/** /**
* CustomTableEnvironmentImpl * CustomTableEnvironmentImpl
* *
...@@ -167,9 +162,7 @@ public class CustomTableEnvironmentImpl extends AbstractCustomTableEnvironment { ...@@ -167,9 +162,7 @@ public class CustomTableEnvironmentImpl extends AbstractCustomTableEnvironment {
throw new TableException("Only single statement is supported."); throw new TableException("Only single statement is supported.");
} }
Operation operation = operations.get(0); Operation operation = operations.get(0);
if (operation instanceof CreateTableASOperation) { if (operation instanceof ModifyOperation) {
executeCTAS(operation);
} else if (operation instanceof ModifyOperation) {
modifyOperations.add((ModifyOperation) operation); modifyOperations.add((ModifyOperation) operation);
} else { } else {
throw new TableException("Only insert statement is supported now."); throw new TableException("Only insert statement is supported now.");
...@@ -264,15 +257,4 @@ public class CustomTableEnvironmentImpl extends AbstractCustomTableEnvironment { ...@@ -264,15 +257,4 @@ public class CustomTableEnvironmentImpl extends AbstractCustomTableEnvironment {
public <T> void createTemporaryView(String s, DataStream<Row> dataStream, List<String> columnNameList) { public <T> void createTemporaryView(String s, DataStream<Row> dataStream, List<String> columnNameList) {
createTemporaryView(s, fromChangelogStream(dataStream)); createTemporaryView(s, fromChangelogStream(dataStream));
} }
@Override
public void executeCTAS(Operation operation) {
if (operation instanceof CreateTableASOperation) {
CreateTableASOperation createTableASOperation = (CreateTableASOperation) operation;
CreateTableOperation createTableOperation = createTableASOperation.getCreateTableOperation();
executeInternal(createTableOperation);
SinkModifyOperation sinkModifyOperation = createTableASOperation.toSinkModifyOperation(getCatalogManager());
getPlanner().translate(CollUtil.newArrayList(sinkModifyOperation));
}
}
} }
...@@ -42,15 +42,12 @@ import org.apache.flink.table.api.TableException; ...@@ -42,15 +42,12 @@ import org.apache.flink.table.api.TableException;
import org.apache.flink.table.api.bridge.java.StreamTableEnvironment; import org.apache.flink.table.api.bridge.java.StreamTableEnvironment;
import org.apache.flink.table.api.internal.TableEnvironmentImpl; import org.apache.flink.table.api.internal.TableEnvironmentImpl;
import org.apache.flink.table.catalog.CatalogDescriptor; import org.apache.flink.table.catalog.CatalogDescriptor;
import org.apache.flink.table.operations.CreateTableASOperation;
import org.apache.flink.table.operations.ExplainOperation; import org.apache.flink.table.operations.ExplainOperation;
import org.apache.flink.table.operations.ModifyOperation; import org.apache.flink.table.operations.ModifyOperation;
import org.apache.flink.table.operations.Operation; import org.apache.flink.table.operations.Operation;
import org.apache.flink.table.operations.QueryOperation; import org.apache.flink.table.operations.QueryOperation;
import org.apache.flink.table.operations.SinkModifyOperation;
import org.apache.flink.table.operations.command.ResetOperation; import org.apache.flink.table.operations.command.ResetOperation;
import org.apache.flink.table.operations.command.SetOperation; import org.apache.flink.table.operations.command.SetOperation;
import org.apache.flink.table.operations.ddl.CreateTableOperation;
import org.apache.flink.types.Row; import org.apache.flink.types.Row;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -67,8 +64,6 @@ import com.fasterxml.jackson.core.JsonProcessingException; ...@@ -67,8 +64,6 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.ObjectNode;
import cn.hutool.core.collection.CollUtil;
/** /**
* CustomTableEnvironmentImpl * CustomTableEnvironmentImpl
* *
...@@ -168,9 +163,7 @@ public class CustomTableEnvironmentImpl extends AbstractCustomTableEnvironment { ...@@ -168,9 +163,7 @@ public class CustomTableEnvironmentImpl extends AbstractCustomTableEnvironment {
throw new TableException("Only single statement is supported."); throw new TableException("Only single statement is supported.");
} }
Operation operation = operations.get(0); Operation operation = operations.get(0);
if (operation instanceof CreateTableASOperation) { if (operation instanceof ModifyOperation) {
executeCTAS(operation);
} else if (operation instanceof ModifyOperation) {
modifyOperations.add((ModifyOperation) operation); modifyOperations.add((ModifyOperation) operation);
} else { } else {
throw new TableException("Only insert statement is supported now."); throw new TableException("Only insert statement is supported now.");
...@@ -266,17 +259,6 @@ public class CustomTableEnvironmentImpl extends AbstractCustomTableEnvironment { ...@@ -266,17 +259,6 @@ public class CustomTableEnvironmentImpl extends AbstractCustomTableEnvironment {
createTemporaryView(s, fromChangelogStream(dataStream)); createTemporaryView(s, fromChangelogStream(dataStream));
} }
@Override
public void executeCTAS(Operation operation) {
if (operation instanceof CreateTableASOperation) {
CreateTableASOperation createTableASOperation = (CreateTableASOperation) operation;
CreateTableOperation createTableOperation = createTableASOperation.getCreateTableOperation();
executeInternal(createTableOperation);
SinkModifyOperation sinkModifyOperation = createTableASOperation.toSinkModifyOperation(getCatalogManager());
getPlanner().translate(CollUtil.newArrayList(sinkModifyOperation));
}
}
@Override @Override
public void createCatalog(String catalogName, CatalogDescriptor catalogDescriptor) { public void createCatalog(String catalogName, CatalogDescriptor catalogDescriptor) {
getCatalogManager().createCatalog(catalogName, catalogDescriptor); getCatalogManager().createCatalog(catalogName, catalogDescriptor);
......
...@@ -33,7 +33,6 @@ import org.apache.flink.table.api.ExplainDetail; ...@@ -33,7 +33,6 @@ import org.apache.flink.table.api.ExplainDetail;
import org.apache.flink.table.api.bridge.java.StreamTableEnvironment; import org.apache.flink.table.api.bridge.java.StreamTableEnvironment;
import org.apache.flink.table.api.internal.TableEnvironmentInternal; import org.apache.flink.table.api.internal.TableEnvironmentInternal;
import org.apache.flink.table.delegation.Planner; import org.apache.flink.table.delegation.Planner;
import org.apache.flink.table.operations.Operation;
import org.apache.flink.types.Row; import org.apache.flink.types.Row;
import java.io.File; import java.io.File;
...@@ -83,8 +82,6 @@ public interface CustomTableEnvironment ...@@ -83,8 +82,6 @@ public interface CustomTableEnvironment
<T> void createTemporaryView(String s, DataStream<Row> dataStream, List<String> columnNameList); <T> void createTemporaryView(String s, DataStream<Row> dataStream, List<String> columnNameList);
void executeCTAS(Operation operation);
default void addJar(File... jarPath) { default void addJar(File... jarPath) {
Configuration configuration = this.getRootConfiguration(); Configuration configuration = this.getRootConfiguration();
List<String> pathList = List<String> pathList =
......
...@@ -230,35 +230,8 @@ public class Explainer { ...@@ -230,35 +230,8 @@ public class Explainer {
if (useStatementSet) { if (useStatementSet) {
List<String> inserts = new ArrayList<>(); List<String> inserts = new ArrayList<>();
for (StatementParam item : jobParam.getTrans()) { for (StatementParam item : jobParam.getTrans()) {
if (item.getType().equals(SqlType.INSERT)) { if (item.getType().equals(SqlType.INSERT) || item.getType().equals(SqlType.CTAS)) {
inserts.add(item.getValue()); inserts.add(item.getValue());
} else if (item.getType().equals(SqlType.CTAS)) {
SqlExplainResult record = new SqlExplainResult();
try {
record.setParseTrue(true);
record.setExplainTrue(true);
record.setSql(item.getValue());
executor.getCustomTableEnvironment()
.getParser()
.parse(item.getValue())
.forEach(x -> {
executor.getCustomTableEnvironment().executeCTAS(x);
});
} catch (Exception e) {
String error = LogUtil.getError(e);
record.setError(error);
record.setParseTrue(false);
record.setExplainTrue(false);
correct = false;
log.error(error);
break;
} finally {
record.setType("Modify DML");
record.setExplainTime(LocalDateTime.now());
record.setIndex(index);
sqlExplainRecords.add(record);
}
} }
} }
if (!inserts.isEmpty()) { if (!inserts.isEmpty()) {
......
...@@ -97,24 +97,12 @@ public class JobTransBuilder extends JobBuilder { ...@@ -97,24 +97,12 @@ public class JobTransBuilder extends JobBuilder {
? jobParam.getTrans() ? jobParam.getTrans()
: Collections.singletonList(jobParam.getTrans().get(0)); : Collections.singletonList(jobParam.getTrans().get(0));
for (StatementParam item : statementParams) { for (StatementParam item : statementParams) {
if (!useGateway && !item.getType().equals(SqlType.INSERT)) {
handleNonInsertType(item);
continue;
}
inserts.add(item.getValue()); inserts.add(item.getValue());
} }
return inserts; return inserts;
} }
private void handleNonInsertType(StatementParam item) {
if (item.getType().equals(SqlType.CTAS)) {
executor.getCustomTableEnvironment()
.getParser()
.parse(item.getValue())
.forEach(executor.getCustomTableEnvironment()::executeCTAS);
}
}
private void processWithGateway(List<String> inserts) throws Exception { private void processWithGateway(List<String> inserts) throws Exception {
jobManager.setCurrentSql(String.join(sqlSeparator, inserts)); jobManager.setCurrentSql(String.join(sqlSeparator, inserts));
GatewayResult gatewayResult = submitByGateway(inserts); GatewayResult gatewayResult = submitByGateway(inserts);
......
...@@ -43,19 +43,19 @@ const GlobalHeaderRight: React.FC = () => { ...@@ -43,19 +43,19 @@ const GlobalHeaderRight: React.FC = () => {
useEffect(() => { useEffect(() => {
setLangCache(language); setLangCache(language);
(async () => (async () =>
await setInitialState((initialStateType:any) => ({ await setInitialState((initialStateType: any) => ({
...initialStateType, ...initialStateType,
locale: language, locale: language,
settings: { settings: {
...initialStateType?.settings, ...initialStateType?.settings,
navTheme: theme, navTheme: theme,
token:{ token: {
...initialStateType?.settings?.token, ...initialStateType?.settings?.token,
sider: { sider: {
...initialStateType?.settings?.token?.sider, ...initialStateType?.settings?.token?.sider,
colorMenuBackground: theme === THEME.dark ? '#000' : '#fff', colorMenuBackground: theme === THEME.dark ? '#000' : '#fff'
}
} }
},
} }
})))(); })))();
}, [theme, language]); }, [theme, language]);
......
...@@ -136,7 +136,7 @@ const DataStudio = (props: any) => { ...@@ -136,7 +136,7 @@ const DataStudio = (props: any) => {
const centerContentHeight = size.contentHeight - newBottomHeight; const centerContentHeight = size.contentHeight - newBottomHeight;
updateCenterContentHeight(centerContentHeight); updateCenterContentHeight(centerContentHeight);
updateToolContentHeight(centerContentHeight - VIEW.leftMargin); updateToolContentHeight(centerContentHeight - VIEW.leftMargin);
}, [activeKey,panes]); }, [activeKey, panes]);
useEffect(() => { useEffect(() => {
loadData(); loadData();
......
...@@ -512,12 +512,12 @@ const Model: ModelType = { ...@@ -512,12 +512,12 @@ const Model: ModelType = {
) { ) {
centerContentHeight = state.centerContentHeight; centerContentHeight = state.centerContentHeight;
toolContentHeight = state.toolContentHeight; toolContentHeight = state.toolContentHeight;
} } else {
else { if (state.centerContentHeight > state.bottomContainer.height) {
if (state.centerContentHeight>state.bottomContainer.height){ centerContentHeight =
centerContentHeight = state.centerContentHeight - (state.bottomContainer.height as number); state.centerContentHeight - (state.bottomContainer.height as number);
toolContentHeight = state.toolContentHeight - (state.bottomContainer.height as number); toolContentHeight = state.toolContentHeight - (state.bottomContainer.height as number);
}else { } else {
centerContentHeight = state.centerContentHeight; centerContentHeight = state.centerContentHeight;
toolContentHeight = state.toolContentHeight; toolContentHeight = state.toolContentHeight;
} }
...@@ -677,7 +677,12 @@ const Model: ModelType = { ...@@ -677,7 +677,12 @@ const Model: ModelType = {
for (const [index, pane] of panes.entries()) { for (const [index, pane] of panes.entries()) {
if (pane.key === needCloseKey) { if (pane.key === needCloseKey) {
const nextPane = panes[(index + 1) % panes.length]; const nextPane = panes[(index + 1) % panes.length];
const height = document.documentElement.clientHeight - VIEW.headerHeight - VIEW.headerNavHeight - VIEW.footerHeight - VIEW.otherHeight; const height =
document.documentElement.clientHeight -
VIEW.headerHeight -
VIEW.headerNavHeight -
VIEW.footerHeight -
VIEW.otherHeight;
return { return {
...state, ...state,
tabs: { tabs: {
...@@ -692,8 +697,9 @@ const Model: ModelType = { ...@@ -692,8 +697,9 @@ const Model: ModelType = {
...state.footContainer, ...state.footContainer,
...getFooterValue(panes, nextPane.key) ...getFooterValue(panes, nextPane.key)
}, },
toolContentHeight: panes.length < 2? height-VIEW.leftMargin : state.toolContentHeight, toolContentHeight:
centerContentHeight: panes.length < 2? height : state.toolContentHeight, panes.length < 2 ? height - VIEW.leftMargin : state.toolContentHeight,
centerContentHeight: panes.length < 2 ? height : state.toolContentHeight
}; };
} }
} }
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
* *
*/ */
import { CreateBtn } from '@/components/CallBackButton/CreateBtn';
import { EditBtn } from '@/components/CallBackButton/EditBtn'; import { EditBtn } from '@/components/CallBackButton/EditBtn';
import { NormalDeleteBtn } from '@/components/CallBackButton/NormalDeleteBtn'; import { NormalDeleteBtn } from '@/components/CallBackButton/NormalDeleteBtn';
import { Authorized } from '@/hooks/useAccess'; import { Authorized } from '@/hooks/useAccess';
...@@ -29,12 +30,11 @@ import { AlertTemplateState } from '@/types/RegCenter/state'; ...@@ -29,12 +30,11 @@ import { AlertTemplateState } from '@/types/RegCenter/state';
import { l } from '@/utils/intl'; import { l } from '@/utils/intl';
import { useRequest } from '@@/exports'; import { useRequest } from '@@/exports';
import { PlusOutlined } from '@ant-design/icons'; import { PlusOutlined } from '@ant-design/icons';
import { ProList } from '@ant-design/pro-components';
import { PageContainer } from '@ant-design/pro-layout'; import { PageContainer } from '@ant-design/pro-layout';
import {Button, Card, Input, List, Modal} from 'antd'; import { Button, Card, List, Modal } from 'antd';
import React, { useState } from 'react'; import { useState } from 'react';
import Markdown from 'react-markdown'; import Markdown from 'react-markdown';
import {ProList} from "@ant-design/pro-components";
import {CreateBtn} from "@/components/CallBackButton/CreateBtn";
export default () => { export default () => {
const [alertTemplateState, setAlertTemplateState] = const [alertTemplateState, setAlertTemplateState] =
...@@ -115,10 +115,12 @@ export default () => { ...@@ -115,10 +115,12 @@ export default () => {
<Authorized key='create' path='/registration/alert/template/add'> <Authorized key='create' path='/registration/alert/template/add'>
<CreateBtn <CreateBtn
key={'CreateAlertTemplateBtn'} key={'CreateAlertTemplateBtn'}
onClick={() => setAlertTemplateState((prevState) => ({ onClick={() =>
setAlertTemplateState((prevState) => ({
...prevState, ...prevState,
addedOpen: true addedOpen: true
}))} }))
}
/> />
</Authorized> </Authorized>
]; ];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment