Commit 0c1ef5b0 by zhaochengxiang

下发盘古权限控制

parent 6b25568e
...@@ -387,7 +387,7 @@ export function getTextWidth(text, font='14px tabular-nums') { ...@@ -387,7 +387,7 @@ export function getTextWidth(text, font='14px tabular-nums') {
} }
export function getDataModelerRole(user) { export function getDataModelerRole(user) {
if ((user?.roles||[]).indexOf('ROLE_dataService_admin') !== -1) { if ((user?.roles||[]).indexOf('ROLE_dataModeler_admin') !== -1) {
return DataModelerRoleAdmin; return DataModelerRoleAdmin;
} }
// else if ((user?.roles||[]).indexOf('ROLE_dataModeler_user') !== -1) { // else if ((user?.roles||[]).indexOf('ROLE_dataModeler_user') !== -1) {
......
import React, { useState } from 'react'; import React, { useState, useContext } from 'react';
import { Modal, Button, Form, Radio } from 'antd'; import { Modal, Button, Form, Radio } from 'antd';
import { AppContext } from '../../../../App';
import { getDataModelerRole } from '../../../../util';
import { DataModelerRoleAdmin } from '../../../../util/constant';
const exportModes = [ const exportModes = [
{ name: '导出DDL', key: 'ddl' }, { name: '导出DDL', key: 'ddl' },
...@@ -12,11 +15,20 @@ const exportModes = [ ...@@ -12,11 +15,20 @@ const exportModes = [
const ExportOtherModal = (props) => { const ExportOtherModal = (props) => {
const { visible, onCancel } = props; const { visible, onCancel } = props;
const [ modeKey, setModeKey ] = useState(''); const [ modeKey, setModeKey ] = useState('');
const app = useContext(AppContext);
const [ form ] = Form.useForm(); const [ form ] = Form.useForm();
const _exportModes = React.useMemo(() => {
if (getDataModelerRole(app?.user) !== DataModelerRoleAdmin) {
return exportModes.filter(item => item.key !== 'upload')
}
return exportModes
}, [])
const onModeChange = (e) => { const onModeChange = (e) => {
setModeKey(e.target?.value); setModeKey(e.target?.value);
} }
...@@ -81,7 +93,7 @@ const ExportOtherModal = (props) => { ...@@ -81,7 +93,7 @@ const ExportOtherModal = (props) => {
> >
<Radio.Group onChange={onModeChange} value={modeKey}> <Radio.Group onChange={onModeChange} value={modeKey}>
{ {
exportModes.map((item, index) => { _exportModes.map((item, index) => {
return ( return (
<Radio <Radio
......
...@@ -3,7 +3,7 @@ import { Modal, Form, Input, Button, Spin } from 'antd'; ...@@ -3,7 +3,7 @@ import { Modal, Form, Input, Button, Spin } from 'antd';
import LocalStorage from 'local-storage'; import LocalStorage from 'local-storage';
import { dispatch } from '../../../../model'; import { dispatch } from '../../../../model';
import { showNotifaction } from '../../../../util'; import { showMessage, showNotifaction } from '../../../../util';
const StartFlowModal = (props) => { const StartFlowModal = (props) => {
const { visible, onCancel, items } = props; const { visible, onCancel, items } = props;
...@@ -36,8 +36,12 @@ const StartFlowModal = (props) => { ...@@ -36,8 +36,12 @@ const StartFlowModal = (props) => {
}, },
callback: data => { callback: data => {
if (data) { if (data) {
if (data === '发起成功') {
showMessage('success', data)
} else {
showNotifaction('送审提示', data, 5); showNotifaction('送审提示', data, 5);
} }
}
LocalStorage.set('modelChange', !(LocalStorage.get('modelChange')||false)); LocalStorage.set('modelChange', !(LocalStorage.get('modelChange')||false));
let event = new Event('storage'); let event = new Event('storage');
......
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