Commit f4910450 authored by 皮倩雯's avatar 皮倩雯

fix: '集成登录新增配置站点的停用启用'

parent caac64e8
Pipeline #60580 passed with stages
......@@ -271,6 +271,7 @@ const AddModal = props => {
accountParam: bb,
iconUrl: obj.iconUrl,
accountType: 'Panda',
isHide: false,
target: obj.target,
isMaster: obj.isMaster,
images: dataList,
......@@ -313,6 +314,7 @@ const AddModal = props => {
isMaster: obj.isMaster,
images: dataList,
clients: pickItem.clients,
isHide: pickItem.isHide,
mapSetting: obj.mapSetting,
coordinate: data,
siteDescription: obj.siteDescription,
......
......@@ -10,11 +10,13 @@ import {
Table,
notification,
Image,
Tag,
} from 'antd';
import {
GetIntegratedLogin,
DelIntegratedLogin,
SetIntegratedloginSettingSort,
EditIntegratedLogin,
} from '@/services/integratedLogin/api';
import {
EditTwoTone,
......@@ -23,6 +25,8 @@ import {
SyncOutlined,
FilePdfOutlined,
OrderedListOutlined,
LockOutlined,
UnlockOutlined,
} from '@ant-design/icons';
import styles from './integrate.less';
import AddModal from './AddModal';
......@@ -74,7 +78,7 @@ const Integrate = () => {
if (text) {
return (
<Image
src={window.location.origin + `/${text}`}
src={`${window.location.origin}/${text}`}
height="50px"
style={{ backgroundColor: '#2881a1' }}
/>
......@@ -167,6 +171,18 @@ const Integrate = () => {
return <span>熊猫token</span>;
},
},
{
title: '特殊站点',
dataIndex: 'isMaster',
key: 'isMaster',
align: 'center',
render: record => {
if (record) {
return <Tag color="success"></Tag>;
}
return <Tag color="processing"></Tag>;
},
},
{
title: '操作',
key: 'action',
......@@ -177,6 +193,42 @@ const Integrate = () => {
<Tooltip title="编辑">
<EditTwoTone onClick={() => edit(record)} style={{ fontSize: '16px' }} />
</Tooltip>
{record.isHide ? (
<Tooltip title="启用">
<Popconfirm
placement="left"
title={
<p>
启用站点
<span className={styles.redText}>{record.SystemName}</span>
</p>
}
okText="确认"
cancelText="取消"
onConfirm={() => startUser(record)}
>
<UnlockOutlined style={{ fontSize: '16px', color: '#1890ff' }} />
</Popconfirm>
</Tooltip>
) : (
<Tooltip title="停用">
<Popconfirm
placement="left"
title={
<p>
停用站点
<span className={styles.redText}>{record.SystemName}</span>
</p>
}
okText="确认"
cancelText="取消"
onConfirm={() => freezeUser(record)}
>
<LockOutlined style={{ fontSize: '16px', color: '#e86060' }} />
</Popconfirm>
</Tooltip>
)}
<Tooltip title="删除">
<Popconfirm
placement="bottomRight"
......@@ -198,6 +250,49 @@ const Integrate = () => {
},
];
// 停用
const freezeUser = e => {
let aa = e;
aa.isHide = true;
console.log(e);
EditIntegratedLogin(aa).then(res => {
if (res.code == 0) {
setFlag(flag + 1);
notification.success({
message: '设置成功',
description: res.msg,
});
} else {
notification.error({
message: '设置失败',
description: res.msg,
});
}
});
};
// 启用
const startUser = e => {
console.log(e);
let aa = e;
aa.isHide = false;
console.log(e);
EditIntegratedLogin(aa).then(res => {
if (res.code == 0) {
setFlag(flag + 1);
notification.success({
message: '设置成功',
description: res.msg,
});
} else {
notification.error({
message: '设置失败',
description: res.msg,
});
}
});
};
// 模糊查询匹配的样式
const searchStyle = val => {
let n;
......@@ -211,7 +306,7 @@ const Integrate = () => {
const getData = () => {
setLoading(true);
GetIntegratedLogin().then(resnew => {
GetIntegratedLogin({ isHide: false }).then(resnew => {
if (resnew.code === 0) {
console.log(resnew.data);
let aa = [];
......@@ -272,7 +367,7 @@ const Integrate = () => {
const submitSearch = () => {
setLoading(true);
GetIntegratedLogin({ searchKey: searchWord }).then(resnew => {
GetIntegratedLogin({ searchKey: searchWord, isHide: false }).then(resnew => {
if (resnew.code === 0) {
setTableData(resnew.data);
setShowSearchStyle(true);
......@@ -290,7 +385,7 @@ const Integrate = () => {
setSearchWord('');
setShowSearchStyle(false);
setLoading(true);
GetIntegratedLogin({ searchKey: '' }).then(resnew => {
GetIntegratedLogin({ searchKey: '', isHide: false }).then(resnew => {
if (resnew.code === 0) {
setTableData(resnew.data);
} else {
......
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