Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
c7e7e17c
Commit
c7e7e17c
authored
May 22, 2023
by
涂伟
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://g.civnet.cn:8443/ReactWeb5/maintenance
parents
cdd74919
a4fc9746
Pipeline
#72833
passed with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
465 additions
and
264 deletions
+465
-264
AddModal.jsx
src/pages/platformCenter/integratedLogin/AddModal.jsx
+402
-213
Integrate.jsx
src/pages/platformCenter/integratedLogin/Integrate.jsx
+63
-51
No files found.
src/pages/platformCenter/integratedLogin/AddModal.jsx
View file @
c7e7e17c
...
...
@@ -5,6 +5,7 @@
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
ReactQuill
from
'react-quill'
;
import
'react-quill/dist/quill.snow.css'
;
import
{
CM_Event_LoadDepartmentAndRoles
}
from
'@/services/standingBook/api'
;
import
{
Form
,
Modal
,
...
...
@@ -27,10 +28,12 @@ import {
EditIntegratedLogin
,
GetIntegratedloginSetting
,
}
from
'@/services/integratedLogin/api'
;
import
RMSComponents
from
'@/components/RolePmSite/index'
;
import
{
DownLoadFiles
}
from
'@/services/common/api'
;
import
{
PlusOutlined
,
LoadingOutlined
}
from
'@ant-design/icons'
;
import
{
get
,
PUBLISH_SERVICE
}
from
'@/services'
;
import
PreviewModal
from
'./PreviewModal'
;
import
CryptoJS
from
'crypto-js'
;
const
{
Item
}
=
Form
;
const
modules
=
{
toolbar
:
[
...
...
@@ -49,6 +52,7 @@ const AddModal = props => {
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
radio
,
setRadio
]
=
useState
();
const
[
radio1
,
setRadio1
]
=
useState
();
const
[
identity
,
setIdentity
]
=
useState
(
0
);
const
[
flag
,
setFlag
]
=
useState
(
1
);
const
[
form
]
=
Form
.
useForm
();
const
[
imageUrl
,
setImageUrl
]
=
useState
();
...
...
@@ -59,16 +63,28 @@ const AddModal = props => {
const
[
optionslist
,
setOptionsList
]
=
useState
([]);
const
[
keepLength
,
setKeeplength
]
=
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
;
useEffect
(()
=>
{
if
(
visible
)
{
getRole
();
getMap
();
if
(
type
===
'edit'
)
{
setRadio
(
pickItem
.
target
!=
0
);
setRadio1
(
pickItem
.
isMaster
);
console
.
log
(
pickItem
);
setIdentity
(
pickItem
.
siteType
);
setAccount
(
pickItem
.
accountType
);
form
.
setFieldsValue
({
accountParamKey
:
pickItem
.
AccountParamKey
,
accountParamValue
:
pickItem
.
AccountParamValue
===
1
?
'熊猫ticket'
:
'熊猫token'
,
...
...
@@ -77,11 +93,16 @@ const AddModal = props => {
systemClient
:
pickItem
.
SystemClient
,
systemName
:
pickItem
.
SystemName
,
iconUrl
:
pickItem
.
iconUrl
,
siteType
:
pickItem
.
siteType
,
subtitle
:
pickItem
.
Subtitle
,
accountType
:
pickItem
.
accountType
,
target
:
pickItem
.
target
!=
0
,
isMaster
:
pickItem
.
isMaster
,
images
:
pickItem
.
images
,
siteDescription
:
pickItem
.
siteDescription
,
serviceUrl
:
pickItem
.
serviceUrl
,
fixedPssword
:
pickItem
.
fixedPssword
&&
Decrypt
(
pickItem
.
fixedPssword
),
fixedUserName
:
pickItem
.
fixedUserName
,
});
if
(
pickItem
.
images
&&
pickItem
.
images
.
length
>
0
)
{
let
arr
=
[];
...
...
@@ -128,12 +149,16 @@ const AddModal = props => {
}
else
{
setRadio
(
0
);
setRadio1
(
false
);
setIdentity
(
0
);
setAccount
(
0
);
form
.
setFieldsValue
({
accountParamValue
:
'熊猫ticket'
,
target
:
0
,
isMaster
:
false
,
mapSetting
:
''
,
coordinate
:
''
,
siteType
:
0
,
accountType
:
0
,
});
}
}
else
{
...
...
@@ -147,6 +172,75 @@ const AddModal = props => {
}
},
[
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
=
()
=>
{
GetIntegratedloginSetting
().
then
(
res
=>
{
if
(
res
.
data
.
displayMode
==
'地图'
)
{
...
...
@@ -246,130 +340,139 @@ const AddModal = props => {
};
// 提交
const
onSubmit
=
()
=>
{
// console.log(form.getFieldsValue().siteDescription);
// console.log(form.getFieldsValue().siteDescription.textContent);
form
.
validateFields
().
then
(
validate
=>
{
if
(
validate
)
{
setLoading
(
true
);
let
obj
=
form
.
getFieldsValue
();
console
.
log
(
obj
.
siteDescription
);
if
(
obj
.
internetAddress
||
obj
.
intranetAddress
)
{
if
(
obj
.
accountParamValue
==
'熊猫ticket'
)
{
obj
.
accountParamValue
=
1
;
}
else
if
(
obj
.
accountParamValue
==
'熊猫token'
)
{
obj
.
accountParamValue
=
2
;
}
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
);
}
if
(
identity
===
0
)
{
if
(
!
obj
.
internetAddress
&&
!
obj
.
intranetAddress
)
{
notification
.
warning
({
message
:
'提示'
,
duration
:
3
,
description
:
'内网地址或外网地址必须填写一项'
,
});
}
console
.
log
(
obj
.
isMaster
);
if
(
!
obj
.
iconUrl
)
{
message
.
error
(
'请选择图标!'
);
return
;
}
if
(
type
===
'add'
)
{
AddIntegratedLogin
({
systemName
:
obj
.
systemName
,
subtitle
:
obj
.
subtitle
,
internetAddress
:
obj
.
internetAddress
,
intranetAddress
:
obj
.
intranetAddress
,
accountParam
:
bb
,
iconUrl
:
obj
.
iconUrl
,
accountType
:
'Panda'
,
isHide
:
false
,
target
:
radio
?
1
:
0
,
isMaster
:
obj
.
isMaster
,
images
:
dataList
,
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
=>
{
}
if
(
obj
.
accountParamValue
==
'熊猫ticket'
)
{
obj
.
accountParamValue
=
1
;
}
else
if
(
obj
.
accountParamValue
==
'熊猫token'
)
{
obj
.
accountParamValue
=
2
;
}
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
;
}
if
(
type
===
'add'
)
{
AddIntegratedLogin
({
systemName
:
obj
.
systemName
,
subtitle
:
obj
.
subtitle
,
internetAddress
:
obj
.
internetAddress
,
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
);
});
}
else
{
EditIntegratedLogin
({
systemName
:
obj
.
systemName
,
subtitle
:
obj
.
subtitle
,
internetAddress
:
obj
.
internetAddress
,
intranetAddress
:
obj
.
intranetAddress
,
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
=>
{
callBackSubmit
();
notification
.
success
({
message
:
'提示'
,
duration
:
3
,
description
:
res
.
msg
||
'新增成功'
,
});
}
else
{
setLoading
(
false
);
});
}
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
res
.
msg
||
'新增失败'
,
});
}
})
.
catch
(
err
=>
{
setLoading
(
false
);
});
}
else
{
notification
.
warning
({
message
:
'提示'
,
duration
:
3
,
description
:
'内网地址或外网地址必须填写一项'
,
});
EditIntegratedLogin
({
systemName
:
obj
.
systemName
,
subtitle
:
obj
.
subtitle
,
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 => {
// 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
(
<
Modal
title=
{
type
===
'add'
?
'新增子站'
:
'编辑子站'
}
...
...
@@ -592,107 +712,21 @@ const AddModal = props => {
<
Input
allowClear
style=
{
{
width
:
'100%'
}
}
placeholder=
"请输入名称"
/>
</
Item
>
)
}
<
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
label=
"角色选择"
name=
"roles"
>
<
div
style=
{
{
display
:
'flex'
}
}
>
<
Item
name=
"roles"
style=
{
{
marginBottom
:
0
,
width
:
'100%'
}
}
>
<
Input
placeholder=
"请选择执行角色"
/>
</
Item
>
</
Col
>
</
Row
>
<
Button
type=
"dashed"
onClick=
{
()
=>
pickFiled1
(
'roles'
)
}
icon=
{
<
PlusOutlined
style=
{
{
marginTop
:
'5px'
}
}
/>
}
style=
{
{
marginLeft
:
'10px'
,
width
:
'70px'
}
}
/>
</
div
>
</
Item
>
<
Item
label=
"新标签"
name=
"target"
>
<
Switch
checkedChildren=
"是"
unCheckedChildren=
"否"
checked=
{
radio
}
onChange=
{
onChange
}
/>
{
/* <Radio.Group onChange={onChange} value={radio}>
<Radio value={0}>否</Radio>
<Radio value={1}>是</Radio>
</Radio.Group> */
}
</
Item
>
<
Row
>
<
Col
span=
{
10
}
>
...
...
@@ -739,6 +773,150 @@ const AddModal = props => {
</
Item
>
</
Col
>
</
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
?
(
<>
<
Item
...
...
@@ -836,6 +1014,17 @@ const AddModal = props => {
type=
{
type
}
callBackSubmit=
{
onOk
}
/>
<
RMSComponents
visible=
{
isVisibleRoles
}
onCancel=
{
()
=>
setIsVisibleRoles
(
false
)
}
callBackSubmit=
{
onOK
}
newCheckedList=
{
checkedList1
}
// 单选框中的值
pickItem=
{
pick
}
groupName=
{
groupName
}
// 打开组件展示的分组名,用来首次获取数据
chooseGroupName=
{
chooseGroupName
}
// 可选分组名
keepFiled=
{
keepFiled
}
dataType=
"name"
/>
</
Modal
>
);
};
...
...
src/pages/platformCenter/integratedLogin/Integrate.jsx
View file @
c7e7e17c
...
...
@@ -120,61 +120,73 @@ const Integrate = () => {
// </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
:
'外网地址'
,
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'
,
title
:
'身份验证'
,
dataIndex
:
'siteType'
,
key
:
'siteType'
,
align
:
'center'
,
render
:
record
=>
{
if
(
record
===
1
)
{
return
<
span
>
熊猫ticket
</
span
>;
if
(
record
===
0
)
{
return
<
Tag
color=
"success"
>
被动
</
Tag
>;
}
return
<
span
>
熊猫token
</
span
>;
return
<
Tag
color=
"processing"
>
主动
</
Tag
>;
},
},
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment