Commit c7e7e17c authored by 涂伟's avatar 涂伟
parents cdd74919 a4fc9746
Pipeline #72833 passed with stages
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import ReactQuill from 'react-quill'; import ReactQuill from 'react-quill';
import 'react-quill/dist/quill.snow.css'; import 'react-quill/dist/quill.snow.css';
import { CM_Event_LoadDepartmentAndRoles } from '@/services/standingBook/api';
import { import {
Form, Form,
Modal, Modal,
...@@ -27,10 +28,12 @@ import { ...@@ -27,10 +28,12 @@ import {
EditIntegratedLogin, EditIntegratedLogin,
GetIntegratedloginSetting, GetIntegratedloginSetting,
} from '@/services/integratedLogin/api'; } from '@/services/integratedLogin/api';
import RMSComponents from '@/components/RolePmSite/index';
import { DownLoadFiles } from '@/services/common/api'; import { DownLoadFiles } from '@/services/common/api';
import { PlusOutlined, LoadingOutlined } from '@ant-design/icons'; import { PlusOutlined, LoadingOutlined } from '@ant-design/icons';
import { get, PUBLISH_SERVICE } from '@/services'; import { get, PUBLISH_SERVICE } from '@/services';
import PreviewModal from './PreviewModal'; import PreviewModal from './PreviewModal';
import CryptoJS from 'crypto-js';
const { Item } = Form; const { Item } = Form;
const modules = { const modules = {
toolbar: [ toolbar: [
...@@ -49,6 +52,7 @@ const AddModal = props => { ...@@ -49,6 +52,7 @@ const AddModal = props => {
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [radio, setRadio] = useState(); const [radio, setRadio] = useState();
const [radio1, setRadio1] = useState(); const [radio1, setRadio1] = useState();
const [identity, setIdentity] = useState(0);
const [flag, setFlag] = useState(1); const [flag, setFlag] = useState(1);
const [form] = Form.useForm(); const [form] = Form.useForm();
const [imageUrl, setImageUrl] = useState(); const [imageUrl, setImageUrl] = useState();
...@@ -59,16 +63,28 @@ const AddModal = props => { ...@@ -59,16 +63,28 @@ const AddModal = props => {
const [optionslist, setOptionsList] = useState([]); const [optionslist, setOptionsList] = useState([]);
const [keepLength, setKeeplength] = useState(''); const [keepLength, setKeeplength] = useState('');
const [fileList, setFileList] = useState([]); const [fileList, setFileList] = useState([]);
const [isVisibleRoles, setIsVisibleRoles] = useState(false);
const [groupName, setGroupName] = useState('角色');
const [chooseGroupName, setChooseGroupName] = useState(['角色']);
const [checkedList1, setCheckedList1] = useState([]); // 最新选择数据
const [keepFiled, setKeepFiled] = useState([]);
const [pick, setPick] = useState(''); // 复选框数据填入项
const [keepIds, setKeepIds] = useState(null);
const [account, setAccount] = useState(0);
const key = CryptoJS.enc.Utf8.parse('1p2a3n4d5a6o7m8s9a10n1e2t3c4o5re'); // 十六位十六进制数作为密钥
const iv = CryptoJS.enc.Utf8.parse('1234567890000000');
const { Option } = Select; const { Option } = Select;
useEffect(() => { useEffect(() => {
if (visible) { if (visible) {
getRole();
getMap(); getMap();
if (type === 'edit') { if (type === 'edit') {
setRadio(pickItem.target != 0); setRadio(pickItem.target != 0);
setRadio1(pickItem.isMaster); setRadio1(pickItem.isMaster);
console.log(pickItem); setIdentity(pickItem.siteType);
setAccount(pickItem.accountType);
form.setFieldsValue({ form.setFieldsValue({
accountParamKey: pickItem.AccountParamKey, accountParamKey: pickItem.AccountParamKey,
accountParamValue: pickItem.AccountParamValue === 1 ? '熊猫ticket' : '熊猫token', accountParamValue: pickItem.AccountParamValue === 1 ? '熊猫ticket' : '熊猫token',
...@@ -77,11 +93,16 @@ const AddModal = props => { ...@@ -77,11 +93,16 @@ const AddModal = props => {
systemClient: pickItem.SystemClient, systemClient: pickItem.SystemClient,
systemName: pickItem.SystemName, systemName: pickItem.SystemName,
iconUrl: pickItem.iconUrl, iconUrl: pickItem.iconUrl,
siteType: pickItem.siteType,
subtitle: pickItem.Subtitle, subtitle: pickItem.Subtitle,
accountType: pickItem.accountType,
target: pickItem.target != 0, target: pickItem.target != 0,
isMaster: pickItem.isMaster, isMaster: pickItem.isMaster,
images: pickItem.images, images: pickItem.images,
siteDescription: pickItem.siteDescription, siteDescription: pickItem.siteDescription,
serviceUrl: pickItem.serviceUrl,
fixedPssword: pickItem.fixedPssword && Decrypt(pickItem.fixedPssword),
fixedUserName: pickItem.fixedUserName,
}); });
if (pickItem.images && pickItem.images.length > 0) { if (pickItem.images && pickItem.images.length > 0) {
let arr = []; let arr = [];
...@@ -128,12 +149,16 @@ const AddModal = props => { ...@@ -128,12 +149,16 @@ const AddModal = props => {
} else { } else {
setRadio(0); setRadio(0);
setRadio1(false); setRadio1(false);
setIdentity(0);
setAccount(0);
form.setFieldsValue({ form.setFieldsValue({
accountParamValue: '熊猫ticket', accountParamValue: '熊猫ticket',
target: 0, target: 0,
isMaster: false, isMaster: false,
mapSetting: '', mapSetting: '',
coordinate: '', coordinate: '',
siteType: 0,
accountType: 0,
}); });
} }
} else { } else {
...@@ -147,6 +172,75 @@ const AddModal = props => { ...@@ -147,6 +172,75 @@ const AddModal = props => {
} }
}, [visible]); }, [visible]);
// 解密
const Decrypt = word => {
let encryptedHexStr = CryptoJS.enc.Hex.parse(word);
let srcs = CryptoJS.enc.Base64.stringify(encryptedHexStr);
let decrypt = CryptoJS.AES.decrypt(srcs, key, {
iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7,
});
let decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);
return decryptedStr.toString();
};
// 加密
const Encrypt = word => {
let srcs = CryptoJS.enc.Utf8.parse(word);
let encrypted = CryptoJS.AES.encrypt(srcs, key, {
iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7,
});
return encrypted.ciphertext.toString().toUpperCase();
};
const getRole = () => {
CM_Event_LoadDepartmentAndRoles().then(res => {
if (res.msg === 'Ok') {
setKeepFiled(groupArr(res.data, 'groupType'));
let aa = groupArr(res.data, 'groupType');
if (type === 'edit' && pickItem.roles) {
let data = pickItem.roles;
let newData = [];
data.forEach(item => {
newData.push(aa.角色.find(i => i.value == item).label);
});
form.setFieldsValue({ roles: newData.toString() });
}
}
});
};
const pickFiled1 = fileds => {
if (form.getFieldValue(fileds)) {
setCheckedList1(form.getFieldValue(fileds).split(','));
setPick(fileds);
setIsVisibleRoles(true);
} else {
setCheckedList1([]);
setPick(fileds);
setIsVisibleRoles(true);
}
};
const groupArr = (initialArr, name) => {
let list = {};
initialArr.data.map(i => {
let ar = [];
i.root.map(j => {
let ss = {};
ss.label = j.Name;
ss.value = j.ID.toString();
ar.push(ss);
// console.log(ss);
});
list[i.groupType] = ar;
});
return list;
};
const getMap = () => { const getMap = () => {
GetIntegratedloginSetting().then(res => { GetIntegratedloginSetting().then(res => {
if (res.data.displayMode == '地图') { if (res.data.displayMode == '地图') {
...@@ -246,130 +340,139 @@ const AddModal = props => { ...@@ -246,130 +340,139 @@ const AddModal = props => {
}; };
// 提交 // 提交
const onSubmit = () => { const onSubmit = () => {
// console.log(form.getFieldsValue().siteDescription);
// console.log(form.getFieldsValue().siteDescription.textContent);
form.validateFields().then(validate => { form.validateFields().then(validate => {
if (validate) { if (validate) {
setLoading(true); setLoading(true);
let obj = form.getFieldsValue(); let obj = form.getFieldsValue();
console.log(obj.siteDescription); if (identity === 0) {
if (obj.internetAddress || obj.intranetAddress) { if (!obj.internetAddress && !obj.intranetAddress) {
if (obj.accountParamValue == '熊猫ticket') { notification.warning({
obj.accountParamValue = 1; message: '提示',
} else if (obj.accountParamValue == '熊猫token') { duration: 3,
obj.accountParamValue = 2; description: '内网地址或外网地址必须填写一项',
}
let aa = { key: obj.accountParamKey, value: obj.accountParamValue };
let bb = [];
bb.push(aa);
if (obj.iconUrl.file) {
obj.iconUrl = obj.iconUrl.file.response.data;
}
let data = [];
if (obj.coordinate) {
data = obj.coordinate.split(',');
}
let dataList = [];
if (fileList.length > 0) {
fileList.map(i => {
if (i.submitUrl) {
dataList.push(i.submitUrl);
} else {
dataList.push(i.response.data);
}
}); });
}
console.log(obj.isMaster);
if (!obj.iconUrl) {
message.error('请选择图标!');
return; return;
} }
if (type === 'add') { }
AddIntegratedLogin({ if (obj.accountParamValue == '熊猫ticket') {
systemName: obj.systemName, obj.accountParamValue = 1;
subtitle: obj.subtitle, } else if (obj.accountParamValue == '熊猫token') {
internetAddress: obj.internetAddress, obj.accountParamValue = 2;
intranetAddress: obj.intranetAddress, }
accountParam: bb, let aa = { key: obj.accountParamKey, value: obj.accountParamValue };
iconUrl: obj.iconUrl, let bb = [];
accountType: 'Panda', bb.push(aa);
isHide: false, if (obj.iconUrl.file) {
target: radio ? 1 : 0, obj.iconUrl = obj.iconUrl.file.response.data;
isMaster: obj.isMaster, }
images: dataList, let data = [];
mapSetting: obj.mapSetting, if (obj.coordinate) {
coordinate: data, data = obj.coordinate.split(',');
siteDescription: obj.siteDescription, }
}) let dataList = [];
.then(res => { if (fileList.length > 0) {
if (res.code === 0) { fileList.map(i => {
onCancel(); if (i.submitUrl) {
setLoading(false); dataList.push(i.submitUrl);
callBackSubmit(); } else {
notification.success({ dataList.push(i.response.data);
message: '提示', }
duration: 3, });
description: res.msg || '新增成功', }
}); console.log(obj.isMaster);
} else { if (!obj.iconUrl) {
setLoading(false); message.error('请选择图标!');
notification.error({ return;
message: '提示', }
duration: 3, if (type === 'add') {
description: res.msg || '新增失败', AddIntegratedLogin({
}); systemName: obj.systemName,
} subtitle: obj.subtitle,
}) internetAddress: obj.internetAddress,
.catch(err => { intranetAddress: obj.intranetAddress,
accountParam: bb,
iconUrl: obj.iconUrl,
accountType: account,
isHide: false,
target: radio ? 1 : 0,
isMaster: obj.isMaster,
images: dataList,
mapSetting: obj.mapSetting,
siteType: obj.siteType,
coordinate: data,
serviceUrl: obj.serviceUrl,
siteDescription: obj.siteDescription,
fixedUserName: obj.fixedUserName,
fixedPssword: Encrypt(obj.fixedPssword),
roles: keepIds,
})
.then(res => {
if (res.code === 0) {
onCancel();
setLoading(false); setLoading(false);
}); callBackSubmit();
} else { notification.success({
EditIntegratedLogin({ message: '提示',
systemName: obj.systemName, duration: 3,
subtitle: obj.subtitle, description: res.msg || '新增成功',
internetAddress: obj.internetAddress, });
intranetAddress: obj.intranetAddress, } else {
accountParam: bb,
iconUrl: obj.iconUrl,
accountType: 'Panda',
target: radio ? 1 : 0,
isMaster: obj.isMaster,
images: dataList,
clients: pickItem.clients,
isHide: pickItem.isHide,
mapSetting: obj.mapSetting,
coordinate: data,
siteDescription: obj.siteDescription,
})
.then(res => {
if (res.code === 0) {
onCancel();
setLoading(false);
callBackSubmit();
notification.success({
message: '提示',
duration: 3,
description: res.msg || '编辑成功',
});
} else {
setLoading(false);
notification.error({
message: '提示',
duration: 3,
description: res.msg || '编辑失败',
});
}
})
.catch(err => {
setLoading(false); setLoading(false);
}); notification.error({
} message: '提示',
duration: 3,
description: res.msg || '新增失败',
});
}
})
.catch(err => {
setLoading(false);
});
} else { } else {
notification.warning({ EditIntegratedLogin({
message: '提示', systemName: obj.systemName,
duration: 3, subtitle: obj.subtitle,
description: '内网地址或外网地址必须填写一项', internetAddress: obj.internetAddress,
}); intranetAddress: obj.intranetAddress,
accountParam: bb,
iconUrl: obj.iconUrl,
accountType: account,
target: radio ? 1 : 0,
isMaster: obj.isMaster,
images: dataList,
siteType: obj.siteType,
clients: pickItem.clients,
isHide: pickItem.isHide,
mapSetting: obj.mapSetting,
coordinate: data,
serviceUrl: obj.serviceUrl,
siteDescription: obj.siteDescription,
fixedUserName: obj.fixedUserName,
fixedPssword: Encrypt(obj.fixedPssword),
roles: keepIds === null ? pickItem.roles : keepIds,
})
.then(res => {
if (res.code === 0) {
onCancel();
setLoading(false);
callBackSubmit();
notification.success({
message: '提示',
duration: 3,
description: res.msg || '编辑成功',
});
} else {
setLoading(false);
notification.error({
message: '提示',
duration: 3,
description: res.msg || '编辑失败',
});
}
})
.catch(err => {
setLoading(false);
});
} }
} }
}); });
...@@ -530,6 +633,23 @@ const AddModal = props => { ...@@ -530,6 +633,23 @@ const AddModal = props => {
// editor 文本框对象,可以调用函数获取content, delta值 // editor 文本框对象,可以调用函数获取content, delta值
}; };
const onChangeIdentity = e => {
setIdentity(e.target.value);
};
const onChangeAccount = e => {
setAccount(e.target.value);
};
const onOK = prop => {
setIsVisibleRoles(false);
let inputText = {};
inputText[prop.pickItem] = prop.str;
setCheckedList1(prop.stt);
setKeepIds(prop.ids);
form.setFieldsValue(inputText);
};
return ( return (
<Modal <Modal
title={type === 'add' ? '新增子站' : '编辑子站'} title={type === 'add' ? '新增子站' : '编辑子站'}
...@@ -592,107 +712,21 @@ const AddModal = props => { ...@@ -592,107 +712,21 @@ const AddModal = props => {
<Input allowClear style={{ width: '100%' }} placeholder="请输入名称" /> <Input allowClear style={{ width: '100%' }} placeholder="请输入名称" />
</Item> </Item>
)} )}
<Item <Item label="角色选择" name="roles">
label="内网地址" <div style={{ display: 'flex' }}>
name="intranetAddress" <Item name="roles" style={{ marginBottom: 0, width: '100%' }}>
rules={[ <Input placeholder="请选择执行角色" />
{
validator: (rule, value) => {
let aa = form.getFieldValue().intranetAddress;
if (aa) {
let bb = aa.split('//');
let cc = [];
if (bb[1]) {
cc = bb[1].split(':');
}
let regEn = /^10\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])$/;
let regFn = /^172\.(1[6789]|2[0-9]|3[01])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])$/;
let regCn = /^192\.168\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])$/;
let ss = [];
let url = /^http(s)?/;
ss.push(regEn.test(cc[0]));
ss.push(regFn.test(cc[0]));
ss.push(regCn.test(cc[0]));
if (!url.test(aa)) {
return Promise.reject('url格式不正确');
}
// else if (ss.indexOf(true) == -1) {
// return Promise.reject('局域网IP不正确');
// }
}
return Promise.resolve();
},
},
]}
>
<AutoComplete placeholder="建议使用局域网IP" options={options} allowClear />
</Item>
<Item
label="外网地址"
name="internetAddress"
rules={[
{
validator: (rule, value) => {
let aa = form.getFieldValue().internetAddress;
if (aa) {
let bb = aa.split('//');
let cc = [];
if (bb[1]) {
cc = bb[1].split(':');
}
let url = /^http(s)?/;
// let regEn = /^10\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])$/;
let regFn = /^172\.(1[6789]|2[0-9]|3[01])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])$/;
let regCn = /^192\.168\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])$/;
let reg = /^(127\.0\.0\.1)|(localhost)/;
let ss = [];
// ss.push(regEn.test(cc[0]));
ss.push(regFn.test(cc[0]));
ss.push(regCn.test(cc[0]));
ss.push(reg.test(cc[0]));
console.log(ss);
if (!url.test(aa)) {
return Promise.reject('url格式不正确');
} else if (ss.indexOf(true) !== -1) {
return Promise.reject('请勿输入内网ip');
}
}
return Promise.resolve();
},
},
]}
>
<AutoComplete placeholder="建议使用公网IP或域名" options={options} allowClear />
</Item>
<Row>
<Col span={12}>
<Item
labelCol={{ span: 8 }}
label="账号参数"
name="accountParamKey"
rules={[{ required: true, message: '请输入参数' }]}
>
<Input allowClear placeholder="请填写账号参数" />
</Item>
</Col>
<Col span={10}>
<Item label="账号值" labelCol={{ span: 7 }} name="accountParamValue">
<Select placeholder="请选择值">
<Option value="1">熊猫ticket</Option>
<Option value="2">熊猫token</Option>
</Select>
</Item> </Item>
</Col> <Button
</Row> type="dashed"
onClick={() => pickFiled1('roles')}
icon={<PlusOutlined style={{ marginTop: '5px' }} />}
style={{ marginLeft: '10px', width: '70px' }}
/>
</div>
</Item>
<Item label="新标签" name="target"> <Item label="新标签" name="target">
<Switch checkedChildren="是" unCheckedChildren="否" checked={radio} onChange={onChange} /> <Switch checkedChildren="是" unCheckedChildren="否" checked={radio} onChange={onChange} />
{/* <Radio.Group onChange={onChange} value={radio}>
<Radio value={0}>否</Radio>
<Radio value={1}>是</Radio>
</Radio.Group> */}
</Item> </Item>
<Row> <Row>
<Col span={10}> <Col span={10}>
...@@ -739,6 +773,150 @@ const AddModal = props => { ...@@ -739,6 +773,150 @@ const AddModal = props => {
</Item> </Item>
</Col> </Col>
</Row> </Row>
<Item label="身份验证" name="siteType">
<Radio.Group onChange={onChangeIdentity} value={identity}>
<Radio value={0}>被动</Radio>
<Radio value={1}>主动</Radio>
</Radio.Group>
</Item>
{identity === 1 && (
<>
<Item
label="运维服务地址"
name="serviceUrl"
rules={[{ required: true, message: '请输入参数' }]}
>
<Input placeholder="请输入运维服务地址" allowClear />
</Item>
<Item label="登陆账号" name="accountType">
<Radio.Group onChange={onChangeAccount} value={account}>
<Radio value={0}>当前帐号</Radio>
<Radio value={1}>固定账号</Radio>
</Radio.Group>
</Item>
</>
)}
{account === 1 && identity === 1 && (
<Row>
<Col span={12}>
<Item
labelCol={{ span: 8 }}
label="账号"
name="fixedUserName"
rules={[{ required: true, message: '请输入账号' }]}
>
<Input allowClear placeholder="请输入账号名" />
</Item>
</Col>
<Col span={10}>
<Item label="密码" labelCol={{ span: 7 }} name="fixedPssword">
<Input allowClear placeholder="请输入密码" type="password" />
</Item>
</Col>
</Row>
)}
{identity === 1 ? (
<></>
) : (
<>
<Item
label="内网地址"
name="intranetAddress"
rules={[
{
validator: (rule, value) => {
let aa = form.getFieldValue().intranetAddress;
if (aa) {
let bb = aa.split('//');
let cc = [];
if (bb[1]) {
cc = bb[1].split(':');
}
let regEn = /^10\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])$/;
let regFn = /^172\.(1[6789]|2[0-9]|3[01])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])$/;
let regCn = /^192\.168\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])$/;
let ss = [];
let url = /^http(s)?/;
ss.push(regEn.test(cc[0]));
ss.push(regFn.test(cc[0]));
ss.push(regCn.test(cc[0]));
if (!url.test(aa)) {
return Promise.reject('url格式不正确');
}
// else if (ss.indexOf(true) == -1) {
// return Promise.reject('局域网IP不正确');
// }
}
return Promise.resolve();
},
},
]}
>
<AutoComplete placeholder="建议使用局域网IP" options={options} allowClear />
</Item>
<Item
label="外网地址"
name="internetAddress"
rules={[
{
validator: (rule, value) => {
let aa = form.getFieldValue().internetAddress;
if (aa) {
let bb = aa.split('//');
let cc = [];
if (bb[1]) {
cc = bb[1].split(':');
}
let url = /^http(s)?/;
// let regEn = /^10\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])$/;
let regFn = /^172\.(1[6789]|2[0-9]|3[01])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])$/;
let regCn = /^192\.168\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[0-9])$/;
let reg = /^(127\.0\.0\.1)|(localhost)/;
let ss = [];
// ss.push(regEn.test(cc[0]));
ss.push(regFn.test(cc[0]));
ss.push(regCn.test(cc[0]));
ss.push(reg.test(cc[0]));
console.log(ss);
if (!url.test(aa)) {
return Promise.reject('url格式不正确');
} else if (ss.indexOf(true) !== -1) {
return Promise.reject('请勿输入内网ip');
}
}
return Promise.resolve();
},
},
]}
>
<AutoComplete placeholder="建议使用公网IP或域名" options={options} allowClear />
</Item>
<Row>
<Col span={12}>
<Item
labelCol={{ span: 8 }}
label="账号参数"
name="accountParamKey"
rules={[{ required: true, message: '请输入参数' }]}
>
<Input allowClear placeholder="请填写账号参数" />
</Item>
</Col>
<Col span={10}>
<Item label="账号值" labelCol={{ span: 7 }} name="accountParamValue">
<Select placeholder="请选择值">
<Option value="1">熊猫ticket</Option>
<Option value="2">熊猫token</Option>
</Select>
</Item>
</Col>
</Row>
</>
)}
{show == 1 ? ( {show == 1 ? (
<> <>
<Item <Item
...@@ -836,6 +1014,17 @@ const AddModal = props => { ...@@ -836,6 +1014,17 @@ const AddModal = props => {
type={type} type={type}
callBackSubmit={onOk} callBackSubmit={onOk}
/> />
<RMSComponents
visible={isVisibleRoles}
onCancel={() => setIsVisibleRoles(false)}
callBackSubmit={onOK}
newCheckedList={checkedList1} // 单选框中的值
pickItem={pick}
groupName={groupName} // 打开组件展示的分组名,用来首次获取数据
chooseGroupName={chooseGroupName} // 可选分组名
keepFiled={keepFiled}
dataType="name"
/>
</Modal> </Modal>
); );
}; };
......
...@@ -120,61 +120,73 @@ const Integrate = () => { ...@@ -120,61 +120,73 @@ const Integrate = () => {
// </span> // </span>
// ), // ),
// }, // },
// {
// title: '外网地址',
// dataIndex: 'InternetAddress',
// key: 'InternetAddress',
// align: 'center',
// render: record => {
// if (record) {
// return (
// <Tooltip title={record}>
// <span style={{ color: '#50aefc', cursor: 'pointer' }}>已配置</span>
// </Tooltip>
// );
// }
// return <span>未配置</span>;
// },
// },
// {
// title: '内网地址',
// dataIndex: 'IntranetAddress',
// key: 'IntranetAddress',
// align: 'center',
// render: record => {
// if (record) {
// return (
// <Tooltip title={record}>
// <span style={{ color: '#50aefc', cursor: 'pointer' }}>已配置</span>
// </Tooltip>
// );
// }
// return <span>未配置</span>;
// },
// },
// {
// title: '账号参数',
// dataIndex: 'AccountParamKey',
// key: 'AccountParamKey',
// align: 'center',
// render: (text, record) => (
// <span>
// <Tooltip placement="top" title={text}>
// {text}
// </Tooltip>
// </span>
// ),
// },
// {
// title: '账号值',
// dataIndex: 'AccountParamValue',
// key: 'AccountParamValue',
// align: 'center',
// render: record => {
// if (record === 1) {
// return <span>熊猫ticket</span>;
// }
// return <span>熊猫token</span>;
// },
// },
{ {
title: '外网地址', title: '身份验证',
dataIndex: 'InternetAddress', dataIndex: 'siteType',
key: 'InternetAddress', key: 'siteType',
align: 'center',
render: record => {
if (record) {
return (
<Tooltip title={record}>
<span style={{ color: '#50aefc', cursor: 'pointer' }}>已配置</span>
</Tooltip>
);
}
return <span>未配置</span>;
},
},
{
title: '内网地址',
dataIndex: 'IntranetAddress',
key: 'IntranetAddress',
align: 'center',
render: record => {
if (record) {
return (
<Tooltip title={record}>
<span style={{ color: '#50aefc', cursor: 'pointer' }}>已配置</span>
</Tooltip>
);
}
return <span>未配置</span>;
},
},
{
title: '账号参数',
dataIndex: 'AccountParamKey',
key: 'AccountParamKey',
align: 'center',
render: (text, record) => (
<span>
<Tooltip placement="top" title={text}>
{text}
</Tooltip>
</span>
),
},
{
title: '账号值',
dataIndex: 'AccountParamValue',
key: 'AccountParamValue',
align: 'center', align: 'center',
render: record => { render: record => {
if (record === 1) { if (record === 0) {
return <span>熊猫ticket</span>; return <Tag color="success">被动</Tag>;
} }
return <span>熊猫token</span>; return <Tag color="processing">主动</Tag>;
}, },
}, },
{ {
......
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