Unverified Commit 39e61435 authored by aiwenmo's avatar aiwenmo Committed by GitHub

[Fix-1020][core,web] Fix error in saving task after modifying task name (#1023)

Co-authored-by: 's avatarwenmo <32723967+wenmo@users.noreply.github.com>
parent 0e2b9c92
...@@ -49,19 +49,19 @@ public final class FlinkRestAPIConstant { ...@@ -49,19 +49,19 @@ public final class FlinkRestAPIConstant {
public static final String EXCEPTIONS = "/exceptions?maxExceptions=10"; public static final String EXCEPTIONS = "/exceptions?maxExceptions=10";
public static final String JOB_MANAGER = "/jobmanager/"; public static final String JOB_MANAGER = "/jobmanager";
public static final String TASK_MANAGER = "/taskmanagers/"; public static final String TASK_MANAGER = "/taskmanagers/";
public static final String METRICS = "/metrics/"; public static final String METRICS = "/metrics";
public static final String LOG = "/log/"; public static final String LOG = "/log";
public static final String LOGS = "/logs/"; public static final String LOGS = "/logs/";
public static final String STDOUT = "/stdout/"; public static final String STDOUT = "/stdout";
public static final String THREAD_DUMP = "/thread-dump/"; public static final String THREAD_DUMP = "/thread-dump";
public static final String GET = "?get="; public static final String GET = "?get=";
......
...@@ -26,50 +26,51 @@ import {Button, Input, Space} from "antd"; ...@@ -26,50 +26,51 @@ import {Button, Input, Space} from "antd";
const DTable = (props: any) => { const DTable = (props: any) => {
const {dataSource,columns} = props; const {dataSource, columns, scroll} = props;
const [data,setData] = useState<[]>([]); const [data, setData] = useState<[]>([]);
const refreshData = async () =>{ const refreshData = async () => {
const msg = await getData(dataSource.url, dataSource.params); const msg = await getData(dataSource.url, dataSource.params);
setData(msg.datas); setData(msg.datas);
}; };
const buildColumn = () =>{ const buildColumn = () => {
const columnList: any=[]; const columnList: any = [];
columns.map((item) => { columns.map((item) => {
const openSorter = item.openSorter==null?true:item.openSorter; const openSorter = item.openSorter == null ? true : item.openSorter;
const isString = item.isString==null?true:item.isString; const isString = item.isString == null ? true : item.isString;
const openSearch = item.openSearch==null?'like':item.openSearch; const openSearch = item.openSearch == null ? 'like' : item.openSearch;
let column = { let column = {
title: item.title?item.title:item.field, title: item.title ? item.title : item.field,
dataIndex: item.dataIndex?item.dataIndex:item.field, dataIndex: item.dataIndex ? item.dataIndex : item.field,
key: item.dataIndex?item.dataIndex:item.field, key: item.dataIndex ? item.dataIndex : item.field,
}; };
if(openSorter){ if (openSorter) {
if(isString){ if (isString) {
column = { column = {
sorter: (a, b) => { sorter: (a, b) => {
const value1 = a[column.dataIndex]!=null?a[column.dataIndex].toString():''; const value1 = a[column.dataIndex] != null ? a[column.dataIndex].toString() : '';
const value2 = b[column.dataIndex]!=null?b[column.dataIndex].toString():''; const value2 = b[column.dataIndex] != null ? b[column.dataIndex].toString() : '';
return value1.localeCompare(value2); return value1.localeCompare(value2);
}, },
...column, ...column,
} }
}else{ } else {
column = { column = {
sorter: (a, b) => a[column.dataIndex] - b[column.dataIndex], sorter: (a, b) => a[column.dataIndex] - b[column.dataIndex],
...column, ...column,
} }
} }
} }
if(openSearch==='like'){ if (openSearch === 'like') {
column = {...column,...getColumnSearchProps(column.dataIndex),} column = {...column, ...getColumnSearchProps(column.dataIndex),}
}else if(openSearch==='dict'){ } else if (openSearch === 'dict') {
column = { column = {
onFilter: (value, record) => record[column.dataIndex] === value, onFilter: (value, record) => record[column.dataIndex] === value,
...column,} ...column,
}
} }
columnList.push({ columnList.push({
...column, ...column,
...@@ -80,7 +81,7 @@ const DTable = (props: any) => { ...@@ -80,7 +81,7 @@ const DTable = (props: any) => {
} }
useEffect(() => { useEffect(() => {
if(dataSource&&dataSource.url){ if (dataSource && dataSource.url) {
refreshData(); refreshData();
} }
}, [dataSource]); }, [dataSource]);
...@@ -89,7 +90,8 @@ const DTable = (props: any) => { ...@@ -89,7 +90,8 @@ const DTable = (props: any) => {
<ProTable <ProTable
columns={buildColumn()} columns={buildColumn()}
style={{width: '100%'}} style={{width: '100%'}}
dataSource={dataSource?(dataSource.url?data:dataSource):[]} scroll={scroll}
dataSource={dataSource ? (dataSource.url ? data : dataSource) : []}
rowKey="name" rowKey="name"
pagination={{ pagination={{
pageSize: 10, pageSize: 10,
......
...@@ -30,25 +30,25 @@ import Tables from "@/pages/DataBase/Tables"; ...@@ -30,25 +30,25 @@ import Tables from "@/pages/DataBase/Tables";
import {TreeDataNode} from "@/components/Studio/StudioTree/Function"; import {TreeDataNode} from "@/components/Studio/StudioTree/Function";
import Generation from "@/pages/DataBase/Generation"; import Generation from "@/pages/DataBase/Generation";
const { DirectoryTree } = Tree; const {DirectoryTree} = Tree;
const {Option} = Select; const {Option} = Select;
const { TabPane } = Tabs; const {TabPane} = Tabs;
const StudioMetaData = (props: any) => { const StudioMetaData = (props: any) => {
const {database,toolHeight, dispatch} = props; const {database, toolHeight, dispatch} = props;
const [databaseId, setDatabaseId] = useState<number>(); const [databaseId, setDatabaseId] = useState<number>();
const [treeData, setTreeData] = useState<[]>([]); const [treeData, setTreeData] = useState<[]>([]);
const [modalVisit, setModalVisit] = useState(false); const [modalVisit, setModalVisit] = useState(false);
const [row, setRow] = useState<TreeDataNode>(); const [row, setRow] = useState<TreeDataNode>();
const onRefreshTreeData = (databaseId: number)=>{ const onRefreshTreeData = (databaseId: number) => {
if(!databaseId)return; if (!databaseId) return;
setDatabaseId(databaseId); setDatabaseId(databaseId);
const res = showMetaDataTable(databaseId); const res = showMetaDataTable(databaseId);
res.then((result) => { res.then((result) => {
let tables = result.datas; let tables = result.datas;
if(tables) { if (tables) {
for (let i = 0; i < tables.length; i++) { for (let i = 0; i < tables.length; i++) {
tables[i].title = tables[i].name; tables[i].title = tables[i].name;
tables[i].key = tables[i].name; tables[i].key = tables[i].name;
...@@ -64,26 +64,27 @@ const StudioMetaData = (props: any) => { ...@@ -64,26 +64,27 @@ const StudioMetaData = (props: any) => {
} }
} }
setTreeData(tables); setTreeData(tables);
}else{ } else {
setTreeData([]); setTreeData([]);
} }
}); });
}; };
const onChangeDataBase = (value: number)=>{ const onChangeDataBase = (value: number) => {
onRefreshTreeData(value); onRefreshTreeData(value);
}; };
const getDataBaseOptions = ()=>{ const getDataBaseOptions = () => {
return <>{database.map(({ id, name, alias, type, enabled }) => ( return <>{database.map(({id, name, alias, type, enabled}) => (
<Option value={id} label={<><Tag color={enabled ? "processing" : "error"}>{type}</Tag>{ alias === "" ? name:alias}</>}> <Option value={id}
<Tag color={enabled ? "processing" : "error"}>{type}</Tag>{ alias === "" ? name:alias} label={<><Tag color={enabled ? "processing" : "error"}>{type}</Tag>{alias === "" ? name : alias}</>}>
<Tag color={enabled ? "processing" : "error"}>{type}</Tag>{alias === "" ? name : alias}
</Option> </Option>
))}</> ))}</>
}; };
const openColumnInfo = (e: React.MouseEvent, node: TreeDataNode) => { const openColumnInfo = (e: React.MouseEvent, node: TreeDataNode) => {
if(node.isLeaf){ if (node.isLeaf) {
setRow(node); setRow(node);
setModalVisit(true); setModalVisit(true);
} }
...@@ -105,7 +106,7 @@ const StudioMetaData = (props: any) => { ...@@ -105,7 +106,7 @@ const StudioMetaData = (props: any) => {
{getDataBaseOptions()} {getDataBaseOptions()}
</Select> </Select>
<Scrollbars style={{height: (toolHeight - 32)}}> <Scrollbars style={{height: (toolHeight - 32)}}>
{treeData.length>0?( {treeData.length > 0 ? (
<DirectoryTree <DirectoryTree
showIcon showIcon
switcherIcon={<DownOutlined/>} switcherIcon={<DownOutlined/>}
...@@ -113,13 +114,13 @@ const StudioMetaData = (props: any) => { ...@@ -113,13 +114,13 @@ const StudioMetaData = (props: any) => {
onRightClick={({event, node}: any) => { onRightClick={({event, node}: any) => {
openColumnInfo(event, node) openColumnInfo(event, node)
}} }}
/>):(<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />)} />) : (<Empty image={Empty.PRESENTED_IMAGE_SIMPLE}/>)}
</Scrollbars> </Scrollbars>
<Modal <Modal
title={row?.key} title={row?.key}
visible={modalVisit} visible={modalVisit}
width={1000} width={1000}
onCancel={()=>{ onCancel={() => {
cancelHandle(); cancelHandle();
}} }}
footer={[ footer={[
...@@ -134,35 +135,37 @@ const StudioMetaData = (props: any) => { ...@@ -134,35 +135,37 @@ const StudioMetaData = (props: any) => {
<TabPane <TabPane
tab={ tab={
<span> <span>
<TableOutlined /> <TableOutlined/>
表信息 表信息
</span> </span>
} }
key="tableInfo" key="tableInfo"
> >
{row?<Tables table={row}/>:<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />} {row ? <Tables table={row}/> : <Empty image={Empty.PRESENTED_IMAGE_SIMPLE}/>}
</TabPane> </TabPane>
<TabPane <TabPane
tab={ tab={
<span> <span>
<CodepenOutlined /> <CodepenOutlined/>
字段信息 字段信息
</span> </span>
} }
key="columnInfo" key="columnInfo"
> >
{row? <Columns dbId={databaseId} schema={row.schema} table={row.table}/> : <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />} {row ? <Columns dbId={databaseId} schema={row.schema} table={row.table} scroll={{x: 1000}}/> :
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE}/>}
</TabPane> </TabPane>
<TabPane <TabPane
tab={ tab={
<span> <span>
<OrderedListOutlined /> <OrderedListOutlined/>
SQL 生成 SQL 生成
</span> </span>
} }
key="sqlGeneration" key="sqlGeneration"
> >
{row? <Generation dbId={databaseId} schema={row.schema} table={row.table}/> : <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />} {row ? <Generation dbId={databaseId} schema={row.schema} table={row.table}/> :
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE}/>}
</TabPane> </TabPane>
</Tabs> </Tabs>
</Modal> </Modal>
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
*/ */
import {message, Tabs, Menu, Dropdown} from 'antd'; import {Dropdown, Menu, message, Tabs} from 'antd';
import React, {useState} from 'react'; import React from 'react';
import {connect} from 'umi'; import {connect} from 'umi';
import {StateType} from '@/pages/DataStudio/model'; import {StateType} from '@/pages/DataStudio/model';
import styles from './index.less'; import styles from './index.less';
...@@ -31,7 +31,7 @@ import {Dispatch} from "@@/plugin-dva/connect"; ...@@ -31,7 +31,7 @@ import {Dispatch} from "@@/plugin-dva/connect";
const {TabPane} = Tabs; const {TabPane} = Tabs;
const EditorTabs = (props: any) => { const EditorTabs = (props: any) => {
const {tabs, current, toolHeight, width,height} = props; const {tabs, current, toolHeight, width, height} = props;
const onChange = (activeKey: any) => { const onChange = (activeKey: any) => {
props.saveToolHeight(toolHeight); props.saveToolHeight(toolHeight);
...@@ -42,7 +42,7 @@ const EditorTabs = (props: any) => { ...@@ -42,7 +42,7 @@ const EditorTabs = (props: any) => {
if (action === 'add') { if (action === 'add') {
add(); add();
} else if (action === 'remove') { } else if (action === 'remove') {
props.saveToolHeight(toolHeight-0.0001); props.saveToolHeight(toolHeight - 0.0001);
// if (current.isModified) { // if (current.isModified) {
// saveTask(current, dispatch); // saveTask(current, dispatch);
// } // }
...@@ -71,11 +71,11 @@ const EditorTabs = (props: any) => { ...@@ -71,11 +71,11 @@ const EditorTabs = (props: any) => {
newActiveKey = newPanes[0].key; newActiveKey = newPanes[0].key;
} }
} }
props.saveTabs(newPanes,newActiveKey); props.saveTabs(newPanes, newActiveKey);
}; };
const handleClickMenu = (e: any, current) => { const handleClickMenu = (e: any, current) => {
props.closeTabs(current,e.key); props.closeTabs(current, e.key);
}; };
const menu = (pane) => ( const menu = (pane) => (
...@@ -92,11 +92,11 @@ const EditorTabs = (props: any) => { ...@@ -92,11 +92,11 @@ const EditorTabs = (props: any) => {
const Tab = (pane: any) => ( const Tab = (pane: any) => (
<span> <span>
{pane.key === 0 ? ( {pane.key === 0 ? (
pane.title <>{pane.icon} {pane.title}</>
) : ( ) : (
<Dropdown overlay={menu(pane)} trigger={['contextMenu']}> <Dropdown overlay={menu(pane)} trigger={['contextMenu']}>
<span className="ant-dropdown-link"> <span className="ant-dropdown-link">
{pane.title} <>{pane.icon} {pane.title}</>
</span> </span>
</Dropdown> </Dropdown>
)} )}
...@@ -105,7 +105,7 @@ const EditorTabs = (props: any) => { ...@@ -105,7 +105,7 @@ const EditorTabs = (props: any) => {
return ( return (
<> <>
{tabs.panes.length === 0?<StudioHome width={width} />: {tabs.panes.length === 0 ? <StudioHome width={width}/> :
<Tabs <Tabs
hideAdd hideAdd
type="editable-card" type="editable-card"
...@@ -114,16 +114,16 @@ const EditorTabs = (props: any) => { ...@@ -114,16 +114,16 @@ const EditorTabs = (props: any) => {
activeKey={tabs.activeKey + ''} activeKey={tabs.activeKey + ''}
onEdit={onEdit} onEdit={onEdit}
className={styles['edit-tabs']} className={styles['edit-tabs']}
style={{height: height?height:toolHeight}} style={{height: height ? height : toolHeight}}
> >
{tabs.panes.map((pane,i) => ( {tabs.panes.map((pane, i) => (
<TabPane tab={Tab(pane)} key={pane.key} closable={pane.closable}> <TabPane tab={Tab(pane)} key={pane.key} closable={pane.closable}>
<StudioEdit <StudioEdit
tabsKey={pane.key} tabsKey={pane.key}
sql={pane.value} sql={pane.value}
monaco={pane.monaco} monaco={pane.monaco}
// sqlMetaData={pane.sqlMetaData} // sqlMetaData={pane.sqlMetaData}
height={height?height:(toolHeight - 32)} height={height ? height : (toolHeight - 32)}
width={width} width={width}
language={current.task.dialect === DIALECT.JAVA ? 'java' : 'sql'} language={current.task.dialect === DIALECT.JAVA ? 'java' : 'sql'}
/> />
...@@ -134,23 +134,23 @@ const EditorTabs = (props: any) => { ...@@ -134,23 +134,23 @@ const EditorTabs = (props: any) => {
); );
}; };
const mapDispatchToProps = (dispatch: Dispatch)=>({ const mapDispatchToProps = (dispatch: Dispatch) => ({
closeTabs:(current: any,key: string)=>dispatch({ closeTabs: (current: any, key: string) => dispatch({
type: 'Studio/closeTabs', type: 'Studio/closeTabs',
payload: { payload: {
deleteType: key, deleteType: key,
current current
}, },
}),saveTabs:(newPanes: any,newActiveKey: number)=>dispatch({ }), saveTabs: (newPanes: any, newActiveKey: number) => dispatch({
type: 'Studio/saveTabs', type: 'Studio/saveTabs',
payload: { payload: {
activeKey: newActiveKey, activeKey: newActiveKey,
panes: newPanes, panes: newPanes,
}, },
}),saveToolHeight:(toolHeight: number)=>dispatch({ }), saveToolHeight: (toolHeight: number) => dispatch({
type: 'Studio/saveToolHeight', type: 'Studio/saveToolHeight',
payload: toolHeight - 0.0001, payload: toolHeight - 0.0001,
}),changeActiveKey:(activeKey: number)=>dispatch({ }), changeActiveKey: (activeKey: number) => dispatch({
type: 'Studio/changeActiveKey', type: 'Studio/changeActiveKey',
payload: activeKey, payload: activeKey,
}), }),
...@@ -161,4 +161,4 @@ export default connect(({Studio}: { Studio: StateType }) => ({ ...@@ -161,4 +161,4 @@ export default connect(({Studio}: { Studio: StateType }) => ({
sql: Studio.sql, sql: Studio.sql,
tabs: Studio.tabs, tabs: Studio.tabs,
toolHeight: Studio.toolHeight, toolHeight: Studio.toolHeight,
}),mapDispatchToProps)(EditorTabs); }), mapDispatchToProps)(EditorTabs);
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
*/ */
import React, {useEffect, useState} from 'react'; import React, {useState} from 'react';
import {Form, Button, Input, Modal} from 'antd'; import {Button, Form, Input, Modal} from 'antd';
import type {CatalogueTableListItem} from '../data.d'; import type {CatalogueTableListItem} from '../data.d';
...@@ -40,6 +40,7 @@ const formLayout = { ...@@ -40,6 +40,7 @@ const formLayout = {
const UpdateCatalogueForm: React.FC<UpdateFormProps> = (props) => { const UpdateCatalogueForm: React.FC<UpdateFormProps> = (props) => {
const [formVals, setFormVals] = useState<Partial<CatalogueTableListItem>>({ const [formVals, setFormVals] = useState<Partial<CatalogueTableListItem>>({
id: props.values.id, id: props.values.id,
taskId: props.values.taskId,
name: props.values.name, name: props.values.name,
isLeaf: props.values.isLeaf, isLeaf: props.values.isLeaf,
parentId: props.values.parentId, parentId: props.values.parentId,
...@@ -100,6 +101,7 @@ const UpdateCatalogueForm: React.FC<UpdateFormProps> = (props) => { ...@@ -100,6 +101,7 @@ const UpdateCatalogueForm: React.FC<UpdateFormProps> = (props) => {
form={form} form={form}
initialValues={{ initialValues={{
id: formVals.id, id: formVals.id,
taskId: formVals.taskId,
name: formVals.name, name: formVals.name,
isLeaf: formVals.isLeaf, isLeaf: formVals.isLeaf,
parentId: formVals.parentId, parentId: formVals.parentId,
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
export type CatalogueTableListItem = { export type CatalogueTableListItem = {
id: number, id: number,
taskId: number,
name: string, name: string,
isLeaf: string, isLeaf: string,
parentId: number, parentId: number,
......
...@@ -230,9 +230,10 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => { ...@@ -230,9 +230,10 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
result.then(result => { result.then(result => {
let newTabs = tabs; let newTabs = tabs;
let newPane: any = { let newPane: any = {
title: <>{node!.icon} {node!.name}</>, title: node!.name,
key: node!.taskId, key: node!.taskId,
value: (result.datas.statement ? result.datas.statement : ''), value: (result.datas.statement ? result.datas.statement : ''),
icon: node!.icon,
closable: true, closable: true,
path: node!.path, path: node!.path,
task: { task: {
...@@ -310,6 +311,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => { ...@@ -310,6 +311,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
setActiveNode(node); setActiveNode(node);
setCatalogueFormValues({ setCatalogueFormValues({
id: node?.id, id: node?.id,
taskId: node?.taskId,
name: node?.name, name: node?.name,
}); });
}; };
...@@ -656,14 +658,17 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => { ...@@ -656,14 +658,17 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
handleUpdateCatalogueModalVisible(false); handleUpdateCatalogueModalVisible(false);
setCatalogueFormValues({}); setCatalogueFormValues({});
getTreeData(); getTreeData();
if (value.taskId) {
dispatch({ dispatch({
type: "Studio/renameTab", type: "Studio/renameTab",
payload: { payload: {
key: value.id, key: value.taskId,
name: <>{activeNode.icon} {value.name}</> title: value.name,
icon: activeNode.icon
}, },
}); });
} }
}
}} }}
onCancel={() => { onCancel={() => {
handleUpdateCatalogueModalVisible(false); handleUpdateCatalogueModalVisible(false);
......
...@@ -19,12 +19,12 @@ ...@@ -19,12 +19,12 @@
import React from "react"; import React from "react";
import {KeyOutlined, CheckSquareOutlined} from '@ant-design/icons'; import {CheckSquareOutlined, KeyOutlined} from '@ant-design/icons';
import DTable from "@/components/Common/DTable"; import DTable from "@/components/Common/DTable";
const Columns = (props: any) => { const Columns = (props: any) => {
const {dbId,table,schema} = props; const {dbId, table, schema, scroll} = props;
const cols = [{ const cols = [{
title: '序号', title: '序号',
...@@ -50,7 +50,7 @@ const Columns = (props: any) => { ...@@ -50,7 +50,7 @@ const Columns = (props: any) => {
dataIndex: 'keyFlag', dataIndex: 'keyFlag',
render: (_, record) => ( render: (_, record) => (
<> <>
{record.keyFlag?<KeyOutlined style={{ color:'#FAA100'}} />:undefined} {record.keyFlag ? <KeyOutlined style={{color: '#FAA100'}}/> : undefined}
</> </>
), ),
filters: [ filters: [
...@@ -64,12 +64,12 @@ const Columns = (props: any) => { ...@@ -64,12 +64,12 @@ const Columns = (props: any) => {
}, },
], ],
openSearch: 'dict', openSearch: 'dict',
},{ }, {
title: '自增', title: '自增',
dataIndex: 'autoIncrement', dataIndex: 'autoIncrement',
render: (_, record) => ( render: (_, record) => (
<> <>
{record.autoIncrement?<CheckSquareOutlined style={{ color:'#1296db'}} />:undefined} {record.autoIncrement ? <CheckSquareOutlined style={{color: '#1296db'}}/> : undefined}
</> </>
), ),
filters: [ filters: [
...@@ -83,12 +83,12 @@ const Columns = (props: any) => { ...@@ -83,12 +83,12 @@ const Columns = (props: any) => {
}, },
], ],
openSearch: 'dict', openSearch: 'dict',
},{ }, {
title: '非空', title: '非空',
dataIndex: 'nullable', dataIndex: 'nullable',
render: (_, record) => ( render: (_, record) => (
<> <>
{!record.nullable?<CheckSquareOutlined style={{ color:'#1296db'}} />:undefined} {!record.nullable ? <CheckSquareOutlined style={{color: '#1296db'}}/> : undefined}
</> </>
), ),
filters: [ filters: [
...@@ -102,30 +102,31 @@ const Columns = (props: any) => { ...@@ -102,30 +102,31 @@ const Columns = (props: any) => {
}, },
], ],
openSearch: 'dict', openSearch: 'dict',
},{ }, {
title: '默认值', title: '默认值',
dataIndex: 'defaultValue', dataIndex: 'defaultValue',
},{ }, {
title: '精度', title: '精度',
dataIndex: 'precision', dataIndex: 'precision',
isString: false, isString: false,
},{ }, {
title: '小数范围', title: '小数范围',
dataIndex: 'scale', dataIndex: 'scale',
isString: false, isString: false,
},{ }, {
title: '字符集', title: '字符集',
dataIndex: 'characterSet', dataIndex: 'characterSet',
},{ }, {
title: '排序规则', title: '排序规则',
dataIndex: 'collation', dataIndex: 'collation',
},{ }, {
title: 'Java 类型', title: 'Java 类型',
dataIndex: 'javaType', dataIndex: 'javaType',
},] },]
return ( return (
<DTable columns={cols} <DTable columns={cols}
dataSource={{url:'api/database/listColumns',params:{id:dbId,schemaName:schema,tableName:table}}}/> scroll={scroll}
dataSource={{url: 'api/database/listColumns', params: {id: dbId, schemaName: schema, tableName: table}}}/>
) )
}; };
......
...@@ -19,9 +19,7 @@ ...@@ -19,9 +19,7 @@
import type {Effect, Reducer} from "umi"; import type {Effect, Reducer} from "umi";
import { import {handleAddOrUpdate} from "@/components/Common/crud";
handleAddOrUpdate
} from "@/components/Common/crud";
import type {SqlMetaData} from "@/components/Studio/StudioEvent/data"; import type {SqlMetaData} from "@/components/Studio/StudioEvent/data";
export type ClusterType = { export type ClusterType = {
...@@ -124,6 +122,7 @@ export type TabsItemType = { ...@@ -124,6 +122,7 @@ export type TabsItemType = {
title: string; title: string;
key: number, key: number,
value: string; value: string;
icon: any;
closable: boolean; closable: boolean;
path: string[]; path: string[];
task?: TaskType; task?: TaskType;
...@@ -629,19 +628,23 @@ const Model: ModelType = { ...@@ -629,19 +628,23 @@ const Model: ModelType = {
let 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].title = payload.name; newTabs.panes[i].title = payload.title;
newTabs.panes[i].task.alias = payload.name; newTabs.panes[i].icon = payload.icon;
newTabs.panes[i].task.alias = payload.title;
newTabs.panes[i].path[newTabs.panes[i].path.length - 1] = payload.title;
} }
if (newTabs.panes[i].key == newCurrent.key) { if (newTabs.panes[i].key == newCurrent.key) {
newCurrent.title = payload.name; newCurrent.title = payload.title;
newCurrent.task.alias = payload.name; newCurrent.icon = payload.icon;
newCurrent.task.alias = payload.title;
newCurrent.path[newCurrent.path.length - 1] = payload.title;
} }
} }
if (newTabs.panes.length == 0) { if (newTabs.panes.length == 0) {
return { return {
...state, ...state,
current: undefined, current: undefined,
tabs: newTabs, tabs: {...newTabs},
currentPath: ['引导页'], currentPath: ['引导页'],
}; };
} }
......
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