import React from 'react';
import { Button, Space, Switch, Table, Tooltip, Modal, Select, } from 'antd';
import Styles from './web.pc.module.less';
import { CheckOutlined, CloseOutlined, ExclamationCircleFilled } from '@ant-design/icons';
const { confirm } = Modal;
export default function render(props) {
const { data, methods } = props;
const { oakFullpath, oakDirty, oakExecuting, applicationPassports, systemId, applications, passports, types, apArray, } = data;
const { clean, execute, t, onCheckedChange, updateItem, checkLastOne, onSelectChange } = methods;
if (!(applications && applications.length > 0)) {
return (
请先前往应用管理创建application
);
}
if (!(passports && passports.length > 0)) {
return (请先完成登录配置,启用登录方式
);
}
let columns = [
{
title: '',
key: 'applicationName',
dataIndex: 'aName',
fixed: 'left',
width: 100,
},
];
const showConfirm = (aId, pId, apId) => {
confirm({
title: '当前application将无登录方式',
icon: ,
content: '关闭后,当前applicaion将无登录方式,可能影响用户登录',
onOk() {
onCheckedChange(aId, pId, false, apId);
},
onCancel() {
},
});
};
if (types && types.length > 0) {
for (const type of types) {
columns.push({
title: t(`passport:v.type.${type}`),
dataIndex: 'typeRecords',
key: `${type} `,
align: 'center',
width: 120,
render: (_, { typeRecords, aId }) =>
{typeRecords[type].render === 'select' ? (
) : (<>
启用:
} unCheckedChildren={} checked={!!typeRecords[type].checked} onChange={(checked) => {
if (!checked && checkLastOne(aId, typeRecords[type].pId)) {
showConfirm(aId, typeRecords[type].pId, typeRecords[type].apId);
}
else {
onCheckedChange(aId, typeRecords[type].pId, checked, typeRecords[type].apId);
}
}}/>
{typeRecords[type].showPwd &&
允许密码登录:
} unCheckedChildren={} checked={!!typeRecords[type].allowPwd} onChange={(checked) => {
methods.updateItem({
allowPwd: checked
}, typeRecords[type].apId);
}}/>
}
>)}
});
}
columns.push({
title: '默认登录方式',
key: 'default',
dataIndex: 'defaultValue',
fixed: 'right',
width: 140,
render: (_, { defaultOptions, defaultValue, aId }) => <>