Commit 0c1ef5b0 by zhaochengxiang

下发盘古权限控制

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