提交 ff8cb4d0 作者: ZhangLingKun

优化:培训详情问题修复

上级 7ada02a8
流水线 #7113 已通过 于阶段
in 1 分 10 秒
...@@ -13,6 +13,7 @@ import { ...@@ -13,6 +13,7 @@ import {
listOrgPageType, listOrgPageType,
} from '~/api/interface/pilotTrainType'; } from '~/api/interface/pilotTrainType';
import { filterObjAttr } from '~/utils'; import { filterObjAttr } from '~/utils';
import { useSelector } from 'react-redux';
//机构列表返回类型 //机构列表返回类型
type institutionListType = InterDataType<listOrgPageType>['list']; type institutionListType = InterDataType<listOrgPageType>['list'];
...@@ -27,6 +28,7 @@ type listOrgPageParametersType = InterReqType<listOrgPageType>; ...@@ -27,6 +28,7 @@ type listOrgPageParametersType = InterReqType<listOrgPageType>;
const InstitutionsList = () => { const InstitutionsList = () => {
const navigate = useNavigate(); const navigate = useNavigate();
const { userInfo } = useSelector((state: any) => state.UserInfo);
//机型下拉列表 //机型下拉列表
const [modelsList, setModelsList] = useState<modelsListType>([]); const [modelsList, setModelsList] = useState<modelsListType>([]);
//等级下拉列表 //等级下拉列表
...@@ -107,7 +109,12 @@ const InstitutionsList = () => { ...@@ -107,7 +109,12 @@ const InstitutionsList = () => {
<Button type='link' onClick={() => editInstitutionsClick(record)}> <Button type='link' onClick={() => editInstitutionsClick(record)}>
编辑 编辑
</Button> </Button>
<Button type='link' danger onClick={() => deleteInstitutionsClick(record)}> <Button
type='link'
danger
onClick={() => deleteInstitutionsClick(record)}
disabled={!!userInfo.roleInfo.superAdmin}
>
删除 删除
</Button> </Button>
</> </>
...@@ -151,7 +158,7 @@ const InstitutionsList = () => { ...@@ -151,7 +158,7 @@ const InstitutionsList = () => {
onOk: () => { onOk: () => {
PilotTrainAPI.removeOrg({ id: record.id }).then(({ code }) => { PilotTrainAPI.removeOrg({ id: record.id }).then(({ code }) => {
if (code === '200') { if (code === '200') {
message.success('删除成功'); message.success('删除成功').then();
if (pagination.pageNo !== 1 && tableData.length === 1) { if (pagination.pageNo !== 1 && tableData.length === 1) {
pagination.pageNo -= 1; pagination.pageNo -= 1;
} }
...@@ -207,7 +214,12 @@ const InstitutionsList = () => { ...@@ -207,7 +214,12 @@ const InstitutionsList = () => {
<SearchBox <SearchBox
search={search} search={search}
child={ child={
<Button icon={<PlusOutlined />} type='primary' onClick={toAddInstitutions}> <Button
icon={<PlusOutlined />}
type='primary'
onClick={toAddInstitutions}
disabled={false}
>
新增 新增
</Button> </Button>
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论