Commit ebc0a272 by zhaochengxiang

全文检索模型详情

parent 1659edc4
...@@ -88,6 +88,7 @@ export class App extends React.Component { ...@@ -88,6 +88,7 @@ export class App extends React.Component {
modelerId={id} modelerId={id}
action='detail' action='detail'
terms={terms} terms={terms}
reference='full-search'
/> />
</AppContext.Provider> </AppContext.Provider>
); );
......
...@@ -88,7 +88,7 @@ const callback = resp => { ...@@ -88,7 +88,7 @@ const callback = resp => {
if (resp.status === 401) { if (resp.status === 401) {
showMessage('warn', 'session过期,请重新登录!'); showMessage('warn', 'session过期,请重新登录!');
window.location.href = isSzseEnv?"/api/auth/login":"/center-home/view/login" window.location.href = isSzseEnv?`/api/auth/login?redirectURL=${encodeURIComponent(window.location.href)}`:"/center-home/view/login"
return null; return null;
} }
......
...@@ -2,6 +2,7 @@ import React, { useState, useEffect, useRef, useImperativeHandle } from 'react'; ...@@ -2,6 +2,7 @@ import React, { useState, useEffect, useRef, useImperativeHandle } from 'react';
import { Spin, Tabs, Anchor, Affix, Button } from 'antd'; import { Spin, Tabs, Anchor, Affix, Button } from 'antd';
import LocalStorage from 'local-storage'; import LocalStorage from 'local-storage';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import classnames from 'classnames';
import ImportActionHeader from './ImportActionHeader'; import ImportActionHeader from './ImportActionHeader';
import { ImportActionTable } from './ImportActionTable'; import { ImportActionTable } from './ImportActionTable';
...@@ -18,7 +19,7 @@ import './ImportAction.less' ...@@ -18,7 +19,7 @@ import './ImportAction.less'
export const importActionSubject = new Subject() export const importActionSubject = new Subject()
const ImportAction = React.forwardRef((props, ref) => { const ImportAction = React.forwardRef((props, ref) => {
const { action, hints, onChange, form, modelerId, terms, ddl, roughModelerData, versionId, permitCheckOut, catalogId, branchId, approvalModelId, approvalId } = props; const { action, hints, onChange, form, modelerId, terms, ddl, roughModelerData, versionId, permitCheckOut, catalogId, branchId, approvalModelId, approvalId, reference = '' } = props;
const [ constraints, setConstraints ] = useState([]); const [ constraints, setConstraints ] = useState([]);
const [ constraint, setConstraint ] = useState({}); const [ constraint, setConstraint ] = useState({});
...@@ -623,29 +624,31 @@ const ImportAction = React.forwardRef((props, ref) => { ...@@ -623,29 +624,31 @@ const ImportAction = React.forwardRef((props, ref) => {
{ {
(action==='detail' && ((modelerData||{}).optionList||[]).findIndex(item => item.enabled && item.name==='查看') === -1) ? <div style={{ padding: '10px 20px', height: 60 }}> (action==='detail' && ((modelerData||{}).optionList||[]).findIndex(item => item.enabled && item.name==='查看') === -1) ? <div style={{ padding: '10px 20px', height: 60 }}>
{loading?'':'暂无权限'} {loading?'':'暂无权限'}
</div> : <div className='import-action'> </div> : <div className={classnames('import-action', reference==='full-search'?'import-action-fullsearch':'')}>
<Tabs activeKey={activeValue} centered onChange={(val) => { {
setActiveValue(val); reference !== 'full-search' && <Tabs activeKey={activeValue} centered onChange={(val) => {
var targetElement = container?.querySelector(`.${val}`); // 找到目标元素 setActiveValue(val);
if (targetElement) { var targetElement = container?.querySelector(`.${val}`); // 找到目标元素
importActionSubject.next({ type: 'expand', key: val, action }) if (targetElement) {
setTimeout(() => { importActionSubject.next({ type: 'expand', key: val, action })
animating.current = true; setTimeout(() => {
targetElement.scrollIntoView(); animating.current = true;
}, 100) targetElement.scrollIntoView();
} }, 100)
}}> }
<Tabs.TabPane tab='基本信息' key="model-import-action-basic" /> }}>
<Tabs.TabPane tab='技术信息' key="model-import-action-technical" /> <Tabs.TabPane tab='基本信息' key="model-import-action-basic" />
<Tabs.TabPane tab='数据表结构' key="model-import-action-table" /> <Tabs.TabPane tab='技术信息' key="model-import-action-technical" />
<Tabs.TabPane tab='数据表索引' key="model-import-action-index" /> <Tabs.TabPane tab='数据表结构' key="model-import-action-table" />
<Tabs.TabPane tab='管理信息' key="model-import-action-manage" /> <Tabs.TabPane tab='数据表索引' key="model-import-action-index" />
<Tabs.TabPane tab='关联对象' key="model-import-action-relation" /> <Tabs.TabPane tab='管理信息' key="model-import-action-manage" />
{ <Tabs.TabPane tab='关联对象' key="model-import-action-relation" />
modelerData?.id && <Tabs.TabPane tab='模型评论' key="model-import-action-comment" /> {
} modelerData?.id && <Tabs.TabPane tab='模型评论' key="model-import-action-comment" />
</Tabs> }
<div ref={setContainer} style={{ height: action==='edit-inherite-modal'?'60vh':'calc(100vh - 44px - 64px - 66px)', overflow: 'auto' }}> </Tabs>
}
<div ref={setContainer} style={{ height: action==='edit-inherite-modal'?'60vh':(reference!=='full-search'?'calc(100vh - 44px - 64px - 66px)': '100%'), overflow: 'auto' }}>
<ImportActionHeader <ImportActionHeader
form={form} form={form}
editable={action!=='detail'&&action!=='flow'&&action!=='detail-version'&&action!=='edit-inherited'} editable={action!=='detail'&&action!=='flow'&&action!=='detail-version'&&action!=='edit-inherited'}
...@@ -659,6 +662,7 @@ const ImportAction = React.forwardRef((props, ref) => { ...@@ -659,6 +662,7 @@ const ImportAction = React.forwardRef((props, ref) => {
terms={terms} terms={terms}
supportedPartitionTypes={supportedPartitionTypes} supportedPartitionTypes={supportedPartitionTypes}
action={action} action={action}
reference={reference}
/> />
<ImportActionTable <ImportActionTable
modelerData={modelerData||{}} modelerData={modelerData||{}}
...@@ -672,31 +676,35 @@ const ImportAction = React.forwardRef((props, ref) => { ...@@ -672,31 +676,35 @@ const ImportAction = React.forwardRef((props, ref) => {
originAction={getQueryParam(Action, props?.location?.search)} originAction={getQueryParam(Action, props?.location?.search)}
terms={terms} terms={terms}
/> />
<ImportActionIndex
modelerData={modelerData||{}}
constraint={constraint}
template={template}
types={supportedIndextypes}
validateReports={validateReports}
onChange={onIndexChange}
editable={action!=='detail'&&action!=='flow'&&action!=='detail-version'&&action!=='edit-inherited'}
terms={terms}
action={action}
/>
<ImportActionManage
form={form}
modelerData={modelerData||{}}
editable={action!=='detail'&&action!=='flow'&&action!=='detail-version'&&action!=='edit-inherited'}
action={action}
/>
<ImportActionRelation
modelerData={modelerData} action={action}
/>
{ {
modelerData?.id && <ImportActionComment reference !== 'full-search' && <React.Fragment>
modelerData={modelerData} <ImportActionIndex
action={action} modelerData={modelerData||{}}
/> constraint={constraint}
template={template}
types={supportedIndextypes}
validateReports={validateReports}
onChange={onIndexChange}
editable={action!=='detail'&&action!=='flow'&&action!=='detail-version'&&action!=='edit-inherited'}
terms={terms}
action={action}
/>
<ImportActionManage
form={form}
modelerData={modelerData||{}}
editable={action!=='detail'&&action!=='flow'&&action!=='detail-version'&&action!=='edit-inherited'}
action={action}
/>
<ImportActionRelation
modelerData={modelerData} action={action}
/>
{
modelerData?.id && <ImportActionComment
modelerData={modelerData}
action={action}
/>
}
</React.Fragment>
} }
</div> </div>
</div> </div>
......
...@@ -8,4 +8,44 @@ ...@@ -8,4 +8,44 @@
width: 80%; width: 80%;
justify-content: space-between; justify-content: space-between;
} }
.model-import-action-basic,
.model-import-action-technical,
.model-import-action-table,
.model-import-action-index,
.model-import-action-manage,
.model-import-action-relation,
.model-import-action-comment {
background-color: #FFF;
padding: 20px;
}
.model-import-action-technical,
.model-import-action-table,
.model-import-action-index,
.model-import-action-manage,
.model-import-action-relation,
.model-import-action-comment {
margin-top: 7px;
}
}
.import-action-fullsearch {
.model-import-action-basic,
.model-import-action-technical,
.model-import-action-table,
.model-import-action-index,
.model-import-action-manage,
.model-import-action-relation,
.model-import-action-comment {
padding: 0 20px;
}
.model-import-action-technical,
.model-import-action-table,
.model-import-action-index,
.model-import-action-manage,
.model-import-action-relation,
.model-import-action-comment {
margin-top: 0px;
}
} }
\ No newline at end of file
...@@ -8,26 +8,6 @@ ...@@ -8,26 +8,6 @@
} }
} }
.model-import-action-basic,
.model-import-action-technical,
.model-import-action-table,
.model-import-action-index,
.model-import-action-manage,
.model-import-action-relation,
.model-import-action-comment {
background-color: #FFF;
padding: 20px;
}
.model-import-action-technical,
.model-import-action-table,
.model-import-action-index,
.model-import-action-manage,
.model-import-action-relation,
.model-import-action-comment {
margin-top: 7px;
}
.edit-template .model-import-action-table { .edit-template .model-import-action-table {
padding: 0; padding: 0;
} }
\ No newline at end of file
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