tab增加退出清空功能;
增加userId == 8的判断
This commit is contained in:
@ -11,8 +11,6 @@ interface PageProps extends ConnectProps {
|
|||||||
dispatch: Dispatch; // dva dispatch方法
|
dispatch: Dispatch; // dva dispatch方法
|
||||||
}
|
}
|
||||||
const User: React.FC<PageProps> = ({ user, dispatch }) => {
|
const User: React.FC<PageProps> = ({ user, dispatch }) => {
|
||||||
|
|
||||||
|
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!user.userInfo) {
|
if (!user.userInfo) {
|
||||||
@ -29,7 +27,7 @@ const User: React.FC<PageProps> = ({ user, dispatch }) => {
|
|||||||
console.error('Userinfo 解析失败', e);
|
console.error('Userinfo 解析失败', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (user.token) {
|
} else if (user.token) {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: 'user/fetchUserInfo',
|
type: 'user/fetchUserInfo',
|
||||||
});
|
});
|
||||||
@ -42,6 +40,9 @@ const User: React.FC<PageProps> = ({ user, dispatch }) => {
|
|||||||
icon: <ExclamationCircleOutlined />,
|
icon: <ExclamationCircleOutlined />,
|
||||||
content: '退出登录后,您将需要重新登录',
|
content: '退出登录后,您将需要重新登录',
|
||||||
onOk() {
|
onOk() {
|
||||||
|
dispatch({
|
||||||
|
type: 'tab/clearTab'
|
||||||
|
});
|
||||||
dispatch({
|
dispatch({
|
||||||
type: 'user/logout',
|
type: 'user/logout',
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
@ -54,7 +55,7 @@ const User: React.FC<PageProps> = ({ user, dispatch }) => {
|
|||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else if(e.key === 'profile') {
|
} else if (e.key === 'profile') {
|
||||||
history.push('/PersonalInfo');
|
history.push('/PersonalInfo');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -21,6 +21,7 @@ export interface TabModelType {
|
|||||||
addTab: Effect;
|
addTab: Effect;
|
||||||
closeTab: Effect;
|
closeTab: Effect;
|
||||||
switchTab: Effect;
|
switchTab: Effect;
|
||||||
|
clearTab: Effect; // 新增清空tab的effect
|
||||||
};
|
};
|
||||||
reducers: {
|
reducers: {
|
||||||
updateState: Reducer<TabModelState>;
|
updateState: Reducer<TabModelState>;
|
||||||
@ -84,7 +85,17 @@ const TabModel: TabModelType = {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
//清空tab
|
||||||
|
*clearTab({ payload }, { call, put }) {
|
||||||
|
// 清空tab列表
|
||||||
|
yield put({
|
||||||
|
type: 'updateState',
|
||||||
|
payload: {
|
||||||
|
tabList: [],
|
||||||
|
activeKey: '/',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
*closeTab({ payload }, { call, put, select }) {
|
*closeTab({ payload }, { call, put, select }) {
|
||||||
const { key } = payload;
|
const { key } = payload;
|
||||||
const { tabList, activeKey } = yield select((state: any) => state.tab);
|
const { tabList, activeKey } = yield select((state: any) => state.tab);
|
||||||
|
@ -30,6 +30,7 @@ interface Dict {
|
|||||||
|
|
||||||
|
|
||||||
const SupplierCategoryEntry: React.FC = () => {
|
const SupplierCategoryEntry: React.FC = () => {
|
||||||
|
const userId = sessionStorage.getItem('userId') || '';
|
||||||
// 查询
|
// 查询
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
//列表渲染数据
|
//列表渲染数据
|
||||||
@ -120,7 +121,7 @@ const SupplierCategoryEntry: React.FC = () => {
|
|||||||
发起审批
|
发起审批
|
||||||
</a>
|
</a>
|
||||||
)}
|
)}
|
||||||
{record.approveStatus === '0' && (
|
{record.approveStatus === '0' && userId == '8' && (
|
||||||
<Button type="link" onClick={() => {
|
<Button type="link" onClick={() => {
|
||||||
supplierChangeApprove({ id: record.id, approveStatus: '1' }).then(() => {
|
supplierChangeApprove({ id: record.id, approveStatus: '1' }).then(() => {
|
||||||
handleReset()
|
handleReset()
|
||||||
|
@ -27,6 +27,8 @@ interface Data {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const AccessManagement: React.FC = () => {
|
const AccessManagement: React.FC = () => {
|
||||||
|
//
|
||||||
|
const userId = sessionStorage.getItem('userId') || '';
|
||||||
// 查询
|
// 查询
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
//列表渲染数据
|
//列表渲染数据
|
||||||
@ -127,7 +129,7 @@ const AccessManagement: React.FC = () => {
|
|||||||
<a onClick={() => openModal('result', record)}>评审结果</a>
|
<a onClick={() => openModal('result', record)}>评审结果</a>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{record.approveStatus === '0' && (
|
{record.approveStatus === '0' && userId == '8' && (
|
||||||
<Button type="link" onClick={() => {
|
<Button type="link" onClick={() => {
|
||||||
supplierChangeApprove({ id: record.id, approveStatus: '1' }).then(() => {
|
supplierChangeApprove({ id: record.id, approveStatus: '1' }).then(() => {
|
||||||
handleReset()
|
handleReset()
|
||||||
|
@ -35,6 +35,7 @@ interface Dict {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const CategoryLibraryManage: React.FC = () => {
|
const CategoryLibraryManage: React.FC = () => {
|
||||||
|
const userId = sessionStorage.getItem('userId') || '';
|
||||||
// 搜索表单
|
// 搜索表单
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
// 列表数据
|
// 列表数据
|
||||||
@ -191,7 +192,7 @@ const CategoryLibraryManage: React.FC = () => {
|
|||||||
>
|
>
|
||||||
审批记录
|
审批记录
|
||||||
</a>
|
</a>
|
||||||
{record.approveStatus === 3 && (
|
{record.approveStatus === 3 && userId == '8' && (
|
||||||
<Button type="link" onClick={() => {
|
<Button type="link" onClick={() => {
|
||||||
supplierChangeApprove({ workFlowId: record.workFlowId, approveStatus: 1 }).then(() => {
|
supplierChangeApprove({ workFlowId: record.workFlowId, approveStatus: 1 }).then(() => {
|
||||||
handleReset()
|
handleReset()
|
||||||
|
@ -33,6 +33,7 @@ interface Data {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const CategoryLibraryManage: React.FC = () => {
|
const CategoryLibraryManage: React.FC = () => {
|
||||||
|
const userId = sessionStorage.getItem('userId') || '';
|
||||||
// 搜索表单
|
// 搜索表单
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
// 列表数据
|
// 列表数据
|
||||||
@ -186,7 +187,7 @@ const CategoryLibraryManage: React.FC = () => {
|
|||||||
>
|
>
|
||||||
审批记录
|
审批记录
|
||||||
</a>
|
</a>
|
||||||
{record.approveStatus === '0' && (
|
{record.approveStatus === '0' && userId == '8' && (
|
||||||
<Button type="link" onClick={() => {
|
<Button type="link" onClick={() => {
|
||||||
supplierChangeApprove({ workFlowId: record.workFlowId, approveStatus: 1 }).then(() => {
|
supplierChangeApprove({ workFlowId: record.workFlowId, approveStatus: 1 }).then(() => {
|
||||||
handleReset()
|
handleReset()
|
||||||
|
@ -37,6 +37,7 @@ interface Props {
|
|||||||
dispatch: any;
|
dispatch: any;
|
||||||
}
|
}
|
||||||
const SupplierChangeReviewManage: React.FC<Props> = ({ dispatch }) => {
|
const SupplierChangeReviewManage: React.FC<Props> = ({ dispatch }) => {
|
||||||
|
const userId = sessionStorage.getItem('userId') || '';
|
||||||
//搜索
|
//搜索
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
//渲染数据
|
//渲染数据
|
||||||
@ -194,7 +195,7 @@ const SupplierChangeReviewManage: React.FC<Props> = ({ dispatch }) => {
|
|||||||
审批记录
|
审批记录
|
||||||
</Button>
|
</Button>
|
||||||
{/* 测试使用,需删除 */}
|
{/* 测试使用,需删除 */}
|
||||||
{ record.approveStatus === '0' && (
|
{ record.approveStatus === '0' && userId == '8' && (
|
||||||
<Button type="link" onClick={() => {
|
<Button type="link" onClick={() => {
|
||||||
supplierChangeApprove({ id:record.id, approveStatus: '1' }).then(() => {
|
supplierChangeApprove({ id:record.id, approveStatus: '1' }).then(() => {
|
||||||
handleReset()
|
handleReset()
|
||||||
@ -204,7 +205,7 @@ const SupplierChangeReviewManage: React.FC<Props> = ({ dispatch }) => {
|
|||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -26,6 +26,7 @@ interface Dict {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const supplierExitAudit: React.FC = () => {
|
const supplierExitAudit: React.FC = () => {
|
||||||
|
const userId = sessionStorage.getItem('userId') || '';
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [data, setData] = useState<any[]>([]);
|
const [data, setData] = useState<any[]>([]);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
@ -114,7 +115,7 @@ const supplierExitAudit: React.FC = () => {
|
|||||||
>
|
>
|
||||||
查看
|
查看
|
||||||
</a>
|
</a>
|
||||||
{record.approveStatus === '0' && (
|
{record.approveStatus === '0' && userId == '8' && (
|
||||||
<Button type="link" onClick={() => {
|
<Button type="link" onClick={() => {
|
||||||
supplierChangeApprove({ id: record.id, approveStatus: '1' }).then(() => {
|
supplierChangeApprove({ id: record.id, approveStatus: '1' }).then(() => {
|
||||||
handleReset()
|
handleReset()
|
||||||
@ -124,7 +125,7 @@ const supplierExitAudit: React.FC = () => {
|
|||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
Reference in New Issue
Block a user