Commit b28f11bd authored by wenmo's avatar wenmo

修复删除任务前端bug

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