Commit 5e9dfeb9 by zhaochengxiang

服务管理

parent fe454c2f
......@@ -124,7 +124,7 @@ export class App extends React.Component {
);
}
if (message === 'showDataService') {
if (message === 'showDataService' || message === 'showDataServiceManage') {
return (
<AppContext.Provider value={{
env: hostParams?.env,
......@@ -135,7 +135,7 @@ export class App extends React.Component {
setGlobalState,
onGlobalStateChange
}}>
<DataService />
<DataService isOnlyEnding={message==='showDataServiceManage'} />
</AppContext.Provider>
);
}
......@@ -156,8 +156,8 @@ export class App extends React.Component {
return (
<AppContext.Provider value={{
env: hostParams?.env,
user: hostParams?.user,
env: hostParams?.env,
user: hostParams?.user,
setGlobalState,
onGlobalStateChange
}}>
......
......@@ -4,8 +4,8 @@ export function refreshCatalog() {
return GetJSON("/pdataservice/pdsCURD/refreshDataServiceCatalog")
}
export function loadStateCatalog() {
return GetJSON("/pdataservice/pdsCURD/loadDataServiceStateCatalog")
export function loadStateCatalog(payload) {
return GetJSON("/pdataservice/pdsCURD/loadDataServiceStateCatalog", payload)
}
export function saveCatalog(payload) {
......
......@@ -34,7 +34,7 @@ const ModelTree = (props) => {
id: MENU_ID,
});
const { onSelect, onViewChange, refrence='', importStockModel, keyword } = props;
const { onSelect, onViewChange, refrence='', importStockModel, keyword, isOnlyEnding = false } = props;
const { user, env } = useContext(AppContext);
const [ loading, setLoading ] = useState(false);
......@@ -220,6 +220,9 @@ const ModelTree = (props) => {
setLoading(true);
dispatch({
type: 'pds.loadStateCatalog',
payload: {
isOnlyEnding
},
callback: data => {
setLoading(false);
let _treeData = data?.subCatalogs||[];
......@@ -514,7 +517,7 @@ const ModelTree = (props) => {
</Dropdown>
{
(viewSelectedKey==='dir' && getDataModelerRole(user)===DataModelerRoleAdmin) && (
(viewSelectedKey==='dir' && getDataModelerRole(user)===DataModelerRoleAdmin && !isOnlyEnding) && (
<Tooltip title="新增目录" className='ml-6'>
<PlusOutlined className='default' onClick={add} style={{ fontSize:16,cursor:'pointer' }} />
</Tooltip>
......
......@@ -29,8 +29,8 @@ const InputDebounce = DebounceInput(300)(Input);
class Model extends React.Component {
constructor() {
super();
constructor(props) {
super(props);
this.state = {
importModalVisible: false,
importStockWordDrawerVisible: false,
......@@ -50,7 +50,7 @@ class Model extends React.Component {
hints: [],
loadingStates: false,
modelStates: [],
currentModelState: '',
currentModelState: props.isOnlyEnding?'4_0':'',
currentView: '',
exportDDLModalReference: 'exportDDL',
currentModel: {},
......@@ -83,10 +83,13 @@ class Model extends React.Component {
this.setState({ loadingStates: true }, () => {
dispatch({
type: 'pds.loadStateCatalog',
payload: {
isOnlyEnding: this.props.isOnlyEnding
},
callback: data => {
this.setState({
loadingStates: false,
modelStates: [{ name: 'all', id: '', cnName: '所有状态' }, ...(data?.subCatalogs||[])]
modelStates: this.props.isOnlyEnding ? data?.subCatalogs||[] : [{ name: 'all', id: '', cnName: '所有状态' }, ...(data?.subCatalogs||[])]
});
},
error: () => {
......@@ -466,7 +469,7 @@ class Model extends React.Component {
}
render() {
const { app } = this.props;
const { app, isOnlyEnding } = this.props;
const { importModalVisible, catalogId, loadingTableData, selectModelerIds, keyword, filterTableData, selectModelerNames, exportDDLModalVisible, exportOtherModalVisible, importStockWordDrawerVisible , loadingStates, modelStates, currentModelState, currentView, recatalogModalVisible, exportDDLModalReference, currentModel, offset, historyAndVersionDrawerVisible, modelerId, startFlowModalVisible, expandTree, showDeleteTip, colSettingModalVisible, visibleColNames } = this.state;
const classes = classNames('data-model', {
......@@ -509,7 +512,7 @@ class Model extends React.Component {
>
<Space>
{
currentView==='dir' && (getDataModelerRole(app?.user)!==DataModelerRoleReader) && <React.Fragment>
currentView==='dir' && (getDataModelerRole(app?.user)!==DataModelerRoleReader) && !isOnlyEnding && <React.Fragment>
<Space>
<Button onClick={() => {
app?.editServer?.({ dirId: catalogId })
......
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