Commit 4ff996a4 by zhaochengxiang

全文检索

parent 5aa636ac
......@@ -14,9 +14,27 @@ import AssetManage from './view/Manage/AssetManage';
import AssetBrowse from './view/Manage/AssetBrowse';
import AssetRecycle from './view/Manage/AssetRecycle';
import DatasourceManage from './view/Manage/DatasourceManage';
import ImportModal from './view/Manage/Model/Component/ImportModal';
export default class App extends React.Component {
render() {
const { params, callback } = this.props;
let message = '', id = '';
if (params) {
message = params.message||'';
id = params.id||'';
}
if (message === 'showDataModelDetail') {
return <ImportModal
modelerId={id}
reference='search'
action='detail'
/>;
}
return (
<React.Fragment>
<Router basename={window.__POWERED_BY_QIANKUN__ ? '/data-govern' : '/'}>
......
......@@ -11,19 +11,18 @@ import App from './App'
import './index.less';
const app = (
//解决主次应用样式冲突
//https://qiankun.umijs.org/faq#how-to-guarantee-the-main-app-stylesheet-isolated-with-sub-apps
<ConfigProvider locale={zh_CN} prefixCls="yy">
<Provider store={store}><App /></Provider>
</ConfigProvider>
);
function render(props) {
const { container } = props;
ReactDOM.render(app, container ? container.querySelector('#root') : document.querySelector('#root'));
const { container, ...restProps } = props;
ReactDOM.render(
//解决主次应用样式冲突
//https://qiankun.umijs.org/faq#how-to-guarantee-the-main-app-stylesheet-isolated-with-sub-apps
<ConfigProvider locale={zh_CN} prefixCls="yy">
<Provider store={store}><App {...restProps} /></Provider>
</ConfigProvider>,
container ? container.querySelector('#root') : document.querySelector('#root'));
}
function storeTest(props) {
props.onGlobalStateChange((value, prev) => console.log(`[onGlobalStateChange - ${props.name}]:`, value, prev), true);
......
......@@ -52,6 +52,7 @@ function GetMenuIcon({ name = '', isMenuItem = false }) {
function GetSubMenu(children, depth = 0) {
return children.map((route, i) => {
const key = `${depth}-${i}`;
return route.children ?
<SubMenu key={route.path} className={'layout-menu'}
title={
......
......@@ -11,7 +11,7 @@ import { dispatchLatest } from '../../../../model';
import { showMessage } from '../../../../util';
const ImportModal = (props) => {
const { catalogId, visible, onCancel, action, addMode, modelerId } = props;
const { catalogId, visible, onCancel, action, addMode, modelerId, reference=null } = props;
const [ step, setStep ] = useState(0);
const [ excelFiles, setExcelFiles ] = useState([]);
const [ hints, setHints ] = useState([]);
......@@ -218,36 +218,43 @@ const ImportModal = (props) => {
}
return (
<Modal
forceRender
visible={visible}
title={title}
width={step===1?1300:520}
maskClosable={false}
onCancel={() => {
reset();
onCancel && onCancel();
}}
footer={footer}
>
<>
{
step===0 && addMode==='excel' && <ImportExcel onChange={onImportExcelChange} />
}
{
step===0 && addMode==='excel-copy' && <ImportExcelCopy onChange={onImportExcelCopyChange} />
}
{
step===0 && addMode==='erwin' && <></>
}
{
step===0 && addMode==='metadata' && <ImportMetadata />
}
{
step===1 && <ImportAction hints={hints} onChange={onActionChange} action={action} modelerId={modelerId} form={form} />
}
</>
</Modal>
<>
{
!reference && <Modal
forceRender
visible={visible}
title={title}
width={step===1?1300:520}
maskClosable={false}
onCancel={() => {
reset();
onCancel && onCancel();
}}
footer={footer}
>
<>
{
step===0 && addMode==='excel' && <ImportExcel onChange={onImportExcelChange} />
}
{
step===0 && addMode==='excel-copy' && <ImportExcelCopy onChange={onImportExcelCopyChange} />
}
{
step===0 && addMode==='erwin' && <></>
}
{
step===0 && addMode==='metadata' && <ImportMetadata />
}
{
step===1 && <ImportAction hints={hints} onChange={onActionChange} action={action} modelerId={modelerId} form={form} />
}
</>
</Modal>
}
{
reference==='search' && <ImportAction hints={hints} onChange={onActionChange} action={action} modelerId={modelerId} form={form} />
}
</>
)
}
......
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