Commit b28f11bd authored by wenmo's avatar wenmo

修复删除任务前端bug

parent 72491f0f
......@@ -56,7 +56,7 @@ const StudioMsg = (props:any) => {
return (
<Typography>
{current&&current.console.result.startTime?(isSql(current.task.dialect) ? renderCommonSqlContent():
{current?.task&&current.console.result.startTime?(isSql(current.task.dialect) ? renderCommonSqlContent():
renderFlinkSqlContent() ):<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
}
</Typography>
......
......@@ -456,7 +456,7 @@ const StudioMenu = (props: any) => {
</Breadcrumb>
)}
</Col>
{current?
{current?.task?
<Col span={8}>
<Tooltip title="全屏开发">
<Button
......@@ -593,7 +593,7 @@ const StudioMenu = (props: any) => {
>
<StudioGraph data={graphData} />
</Modal>
{current?
{current?.task?
<ModalForm
title={`${current.task.alias} 的 ${current.task.dialect} 导出`}
visible={exportModalVisible}
......
......@@ -81,7 +81,7 @@ const StudioRightTool = (props: any) => {
return (
<>
{ current?
{ current?.task?
<Tabs defaultActiveKey="1" size="small" tabPosition="right" style={{ height: toolHeight}}>
{renderContent()}
</Tabs>:<StudioGuide toolHeight={toolHeight} />}
......
......@@ -260,7 +260,7 @@ const Model: ModelType = {
},
saveSql(state, {payload}) {
const newTabs = state.tabs;
const newCurrent = state.current;
let newCurrent = state.current;
newCurrent.value = payload;
for (let i = 0; i < newTabs.panes.length; i++) {
if (newTabs.panes[i].key == newTabs.activeKey) {
......@@ -287,7 +287,7 @@ const Model: ModelType = {
};
},*/
saveSqlMetaData(state, {payload}) {
const newCurrent = state.current;
let newCurrent = state.current;
const newTabs = state.tabs;
if(newCurrent.key == payload.activeKey){
newCurrent.sqlMetaData = {...payload.sqlMetaData};
......@@ -339,12 +339,14 @@ const Model: ModelType = {
break;
}
}
const newCurrent = undefined;
let newCurrent = undefined;
if(newTabs.panes.length > 0){
newCurrent = newTabs.panes[newTabs.panes.length - 1];
}
if (newTabs.activeKey == payload) {
if (newCurrent && (newTabs.activeKey == payload)) {
newTabs.activeKey = newCurrent.key;
}else{
newTabs.activeKey = undefined;
}
return {
...state,
......@@ -391,7 +393,7 @@ const Model: ModelType = {
},
saveTaskData(state, {payload}) {
const newTabs = state.tabs;
const newCurrent = state.current;
let newCurrent = state.current;
for (let i = 0; i < newTabs.panes.length; i++) {
if (newTabs.panes[i].key == payload.key) {
newTabs.panes[i].task = payload;
......@@ -438,7 +440,7 @@ const Model: ModelType = {
},
saveResult(state, {payload}) {
const newTabs = state?.tabs;
const newCurrent = state?.current;
let newCurrent = state?.current;
for (let i = 0; i < newTabs.panes.length; i++) {
if (newTabs.panes[i].key == payload.key) {
newTabs.panes[i].console.result.result = payload.datas;
......
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