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
309ad5e4
Commit
309ad5e4
authored
Sep 05, 2022
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据库初始化追加
parent
cae1fb8c
Pipeline
#59232
passed with stages
Changes
5
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
490 additions
and
109 deletions
+490
-109
AddModal.jsx
src/pages/bsmanager/workOrder/incident/AddModal.jsx
+19
-19
AppendModal.jsx
src/pages/database/databaseInitialization/AppendModal.jsx
+99
-5
DatabaseInitialization.jsx
...atabase/databaseInitialization/DatabaseInitialization.jsx
+365
-83
index.jsx
src/pages/platformCenter/gis/schemeConfig/ScopeMap/index.jsx
+5
-2
api.js
src/services/webConfig/api.js
+2
-0
No files found.
src/pages/bsmanager/workOrder/incident/AddModal.jsx
View file @
309ad5e4
...
...
@@ -476,7 +476,7 @@ const AddModal = props => {
const
[
reportValue
,
setReportValue
]
=
useState
();
// 保存上报字段外部字段
const
[
displayValue
,
setDisplayValue
]
=
useState
();
// 保存显示字段外部字段
const
[
editableValue
,
setEditableValue
]
=
useState
();
// 保存编辑字段外部字段
const
[
transitValue
,
setTransitValue
]
=
useState
();
// 保存转单
字段外部字段
const
[
displayColumns
,
setDisplayColumns
]
=
useState
();
// 保存显示列
字段外部字段
const
[
relatedEventValue
,
setRelatedEventValue
]
=
useState
();
// 保存关联字段外部字段
const
[
groupName
,
setGroupName
]
=
useState
(
'角色'
);
const
[
chooseGroupName
,
setChooseGroupName
]
=
useState
([
'角色'
,
'部门'
,
'站点'
]);
...
...
@@ -563,8 +563,8 @@ const AddModal = props => {
setFlag
(
0
);
}
if
(
type
==
'add'
)
{
if
(
obj
.
TransitField
s
==
undefined
)
{
obj
.
TransitField
s
=
''
;
if
(
obj
.
DisplayColumn
s
==
undefined
)
{
obj
.
DisplayColumn
s
=
''
;
}
if
(
obj
.
Roles
==
undefined
)
{
obj
.
Roles
=
''
;
...
...
@@ -669,8 +669,8 @@ const AddModal = props => {
}
else
{
setEditableIsShow
(
'none'
);
}
set
TransitValue
(
res
.
data
.
root
.
outTransitField
s
);
if
(
res
.
data
.
root
.
out
TransitField
s
!=
0
)
{
set
DisplayColumns
(
res
.
data
.
root
.
outDisplayColumn
s
);
if
(
res
.
data
.
root
.
out
DisplayColumn
s
!=
0
)
{
setTransitIsShow
(
'inline'
);
}
else
{
setTransitIsShow
(
'none'
);
...
...
@@ -882,11 +882,11 @@ const AddModal = props => {
setEditableIsShow
(
'none'
);
}
};
//
转单
字段外部字段
//
显示列
字段外部字段
const
ExternalTransitField
=
e
=>
{
if
(
form
.
getFieldValue
().
TransitField
s
)
{
if
(
form
.
getFieldValue
().
DisplayColumn
s
)
{
let
pp
=
formateArrDataA
(
e
,
'group'
);
let
ab
=
form
.
getFieldValue
().
TransitField
s
.
split
(
','
);
let
ab
=
form
.
getFieldValue
().
DisplayColumn
s
.
split
(
','
);
let
arr
=
Object
.
keys
(
pp
);
let
b
=
[];
let
a
=
[];
...
...
@@ -904,7 +904,7 @@ const AddModal = props => {
}
}
});
set
TransitValue
(
a
.
length
);
set
DisplayColumns
(
a
.
length
);
if
(
a
.
length
!=
0
)
{
setTransitIsShow
(
'inline'
);
}
else
{
...
...
@@ -1123,8 +1123,8 @@ const AddModal = props => {
setEditableIsShow
(
'none'
);
}
}
if
(
prop
.
pickItem
==
'
TransitField
s'
)
{
set
TransitValue
(
prop
.
valueArr
.
length
);
if
(
prop
.
pickItem
==
'
DisplayColumn
s'
)
{
set
DisplayColumns
(
prop
.
valueArr
.
length
);
if
(
prop
.
valueArr
.
length
!=
0
)
{
setTransitIsShow
(
'inline'
);
}
else
{
...
...
@@ -1706,11 +1706,11 @@ const AddModal = props => {
</
div
>
</
Item
>
</
Col
>
{
/*
<Col span={24}>
<
Col
span=
{
24
}
>
<
Item
label=
{
<
div
>
<Tooltip title={`存在${
transitValue
}个外部字段`}>
<
Tooltip
title=
{
`存在${
displayColumns
}个外部字段`
}
>
<
InfoCircleOutlined
style=
{
{
color
:
'red'
,
...
...
@@ -1719,25 +1719,25 @@ const AddModal = props => {
}
}
/>
</
Tooltip
>
<span>
转单
字段</span>
<
span
>
显示列
字段
</
span
>
</
div
>
}
name="
TransitField
s"
name=
"
DisplayColumn
s"
labelCol=
{
{
span
:
5
}
}
>
<
div
style=
{
{
display
:
'flex'
}
}
>
<Form.Item name="
TransitField
s" style={{ marginBottom: 0, width: '100%' }}>
<Input placeholder="请选择
转单
字段" allowClear />
<
Form
.
Item
name=
"
DisplayColumn
s"
style=
{
{
marginBottom
:
0
,
width
:
'100%'
}
}
>
<
Input
placeholder=
"请选择
显示列
字段"
allowClear
/>
</
Form
.
Item
>
<
Button
type=
"dashed"
onClick={() => pickFiled('
TransitField
s')}
onClick=
{
()
=>
pickFiled
(
'
DisplayColumn
s'
)
}
icon=
{
<
PlusOutlined
style=
{
{
marginTop
:
'5px'
}
}
/>
}
style=
{
{
marginLeft
:
'10px'
,
width
:
'70px'
}
}
/>
</
div
>
</
Item
>
</Col>
*/
}
</
Col
>
<
Col
span=
{
24
}
>
<
Item
label=
"事件权限"
name=
"Roles"
labelCol=
{
{
span
:
5
}
}
>
<
div
style=
{
{
display
:
'flex'
}
}
>
...
...
src/pages/database/databaseInitialization/AppendModal.jsx
View file @
309ad5e4
/* eslint-disable guard-for-in */
/* eslint-disable no-restricted-syntax */
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Button
,
Space
,
notification
,
Modal
,
Popconfirm
,
Empty
,
Spin
}
from
'antd'
;
import
{
Button
,
Space
,
notification
,
Modal
,
Popconfirm
,
Empty
,
Spin
,
Tooltip
}
from
'antd'
;
import
{
BarcodeOutlined
,
UserOutlined
,
CalendarOutlined
}
from
'@ant-design/icons'
;
import
styles
from
'./DatabaseInitialization.less'
;
import
{
GetLicenseDifference
,
InitEditDataBase
,
GetProductList
}
from
'@/services/database/api'
;
const
AppendModal
=
props
=>
{
const
{
callBackSubmit
=
()
=>
{},
visible
,
onCancel
,
value
}
=
props
;
const
{
callBackSubmit
=
()
=>
{},
visible
,
onCancel
,
value
,
keepHistroy
}
=
props
;
const
[
data
,
setData
]
=
useState
([]);
const
[
allLength
,
setAllLength
]
=
useState
(
''
);
const
[
flag
,
setFlag
]
=
useState
();
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
code
,
setCode
]
=
useState
(
''
);
const
[
project
,
setProject
]
=
useState
(
''
);
const
[
name
,
setName
]
=
useState
(
''
);
const
[
number
,
setNumber
]
=
useState
(
''
);
const
[
much
,
setMuch
]
=
useState
([]);
const
[
code1
,
setCode1
]
=
useState
(
''
);
const
[
project1
,
setProject1
]
=
useState
(
''
);
const
[
name1
,
setName1
]
=
useState
(
''
);
const
[
number1
,
setNumber1
]
=
useState
(
''
);
useEffect
(()
=>
{
if
(
visible
)
{
getProduct
();
console
.
log
(
value
);
console
.
log
(
keepHistroy
);
let
aa
=
[];
keepHistroy
.
map
((
i
,
j
)
=>
{
if
(
i
.
license
!=
'已使用'
&&
j
!=
keepHistroy
.
length
-
1
)
{
aa
.
push
(
i
);
}
});
if
(
aa
.
length
>
0
)
{
let
a
=
[];
let
b
=
[];
let
c
=
[];
aa
.
map
(
k
=>
{
a
.
push
(
k
.
license
);
b
.
push
(
k
.
projectName
);
c
.
push
(
`
${
k
.
applicantName
}
(
${
k
.
jobNumber
}
)`
);
});
setCode1
(
a
.
toString
());
setProject1
(
b
.
toString
());
setName1
(
c
.
toString
());
}
setMuch
(
aa
);
setCode
(
keepHistroy
[
keepHistroy
.
length
-
1
].
license
);
setProject
(
keepHistroy
[
keepHistroy
.
length
-
1
].
projectName
);
setName
(
keepHistroy
[
keepHistroy
.
length
-
1
].
applicantName
);
setNumber
(
keepHistroy
[
keepHistroy
.
length
-
1
].
jobNumber
);
}
else
{
setData
([]);
setFlag
();
...
...
@@ -99,7 +134,7 @@ const AppendModal = props => {
return
(
<
Modal
title=
"产品追加"
width=
"
8
00px"
width=
"
10
00px"
visible=
{
visible
}
onCancel=
{
onCancel
}
destroyOnClose
...
...
@@ -134,11 +169,70 @@ const AppendModal = props => {
)
:
(
<>
{
allLength
>
0
&&
(
<
div
style=
{
{
marginBottom
:
'26px'
}
}
>
<
div
style=
{
{
height
:
'50px'
,
display
:
'flex'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
,
marginBottom
:
'15px'
,
}
}
>
{
much
.
length
>
0
?
(
<
Tooltip
title=
{
code1
}
>
<
div
style=
{
{
display
:
'inline-block'
,
backgroundColor
:
'aliceblue'
}
}
>
<
BarcodeOutlined
style=
{
{
color
:
'rgb(227 168 96)'
,
marginRight
:
'5px'
}
}
/>
授权码:
{
code
?
<>
{
code
}
</>
:
<
span
>
--
</
span
>
}
<
span
>
...
</
span
>
</
div
>
</
Tooltip
>
)
:
(
<
div
style=
{
{
display
:
'inline-block'
,
backgroundColor
:
'aliceblue'
}
}
>
<
BarcodeOutlined
style=
{
{
color
:
'rgb(227 168 96)'
,
marginRight
:
'5px'
}
}
/>
授权码:
{
code
?
<>
{
code
}
</>
:
<
span
>
--
</
span
>
}
</
div
>
)
}
{
much
.
length
>
0
?
(
<
Tooltip
title=
{
project1
}
>
<
div
style=
{
{
display
:
'inline-block'
,
backgroundColor
:
'aliceblue'
}
}
>
<
CalendarOutlined
style=
{
{
color
:
'#8466cb'
,
marginRight
:
'5px'
}
}
/>
项目名:
{
project
?
<>
{
project
}
</>
:
'--'
}
<
span
>
...
</
span
>
</
div
>
</
Tooltip
>
)
:
(
<
div
style=
{
{
display
:
'inline-block'
,
backgroundColor
:
'aliceblue'
}
}
>
<
CalendarOutlined
style=
{
{
color
:
'#8466cb'
,
marginRight
:
'5px'
}
}
/>
项目名:
{
project
?
<>
{
project
}
</>
:
'--'
}
</
div
>
)
}
{
much
.
length
>
0
?
(
<
Tooltip
title=
{
name1
}
>
<
div
style=
{
{
display
:
'inline-block'
,
backgroundColor
:
'aliceblue'
}
}
>
<
UserOutlined
style=
{
{
color
:
'green'
,
marginRight
:
'5px'
}
}
/>
授权人:
{
name
?
<>
{
name
}
</>
:
'-'
}
{
number
?
<>
(
{
number
}
)
</>
:
'-'
}
{
much
.
length
>
0
?
<
span
>
...
</
span
>
:
<></>
}
</
div
>
</
Tooltip
>
)
:
(
<
div
style=
{
{
display
:
'inline-block'
,
backgroundColor
:
'aliceblue'
}
}
>
<
UserOutlined
style=
{
{
color
:
'green'
,
marginRight
:
'5px'
}
}
/>
授权人:
{
name
?
<>
{
name
}
</>
:
'-'
}
{
number
?
<>
(
{
number
}
)
</>
:
'-'
}
</
div
>
)
}
<
div
style=
{
{
display
:
'inline-block'
,
backgroundColor
:
'aliceblue'
}
}
>
<
div
style=
{
{
float
:
'right'
}
}
>
<
strong
>
追加产品列表(共
<
span
style=
{
{
color
:
'rgb(24 144 255)'
}
}
>
{
allLength
}
</
span
>
个)
追加产品列表(共
<
span
style=
{
{
color
:
'rgb(24 144 255)'
}
}
>
{
allLength
}
</
span
>
个)
</
strong
>
</
div
>
</
div
>
</
div
>
)
}
{
data
&&
Object
.
keys
(
data
).
map
((
i
,
j
)
=>
(
...
...
src/pages/database/databaseInitialization/DatabaseInitialization.jsx
View file @
309ad5e4
...
...
@@ -20,6 +20,7 @@ import {
Popconfirm
,
Timeline
,
Tooltip
,
Table
,
}
from
'antd'
;
import
PageContainer
from
'@/components/BasePageContainer'
;
import
{
connect
}
from
'react-redux'
;
...
...
@@ -32,6 +33,7 @@ import {
CheckDatabaseIsExist
,
NewInitAddDataBase
,
InitEditDataBase
,
getDataBaseConfigNew
,
}
from
'@/services/database/api'
;
import
{
CloseCircleOutlined
,
...
...
@@ -41,6 +43,10 @@ import {
BarcodeOutlined
,
UserOutlined
,
CalendarOutlined
,
CheckOutlined
,
MinusSquareOutlined
,
PlusOutlined
,
EyeOutlined
,
}
from
'@ant-design/icons'
;
import
styles
from
'./DatabaseInitialization.less'
;
import
styles1
from
'../InitDataBase/InitDataBase.less'
;
...
...
@@ -70,6 +76,7 @@ const DatabaseInitialization = props => {
const
[
initLoading
,
setInitLoading
]
=
useState
(
false
);
const
[
keepDb
,
setKeepDb
]
=
useState
([]);
const
[
keepProduct
,
setKeepProduct
]
=
useState
([]);
const
[
keepStatus
,
setKeepStatus
]
=
useState
([]);
const
scroll
=
useRef
(
null
);
const
[
data
,
setData
]
=
useState
([]);
...
...
@@ -100,6 +107,7 @@ const DatabaseInitialization = props => {
const
[
dataResult
,
setDataResult
]
=
useState
(
''
);
const
[
productResult
,
setProductResult
]
=
useState
(
''
);
const
[
keepInitContent
,
setKeepInitContent
]
=
useState
(
''
);
const
[
keepInitContentDetail
,
setKeepInitContentDetail
]
=
useState
(
''
);
const
[
keepinitVisible
,
setKeepInitVisible
]
=
useState
(
false
);
const
[
password
,
setPassword
]
=
useState
(
false
);
const
[
isAuthorize
,
setIsAuthorize
]
=
useState
(
false
);
...
...
@@ -109,6 +117,9 @@ const DatabaseInitialization = props => {
const
[
appendVisible
,
setAppendVisible
]
=
useState
(
false
);
const
[
append
,
setAppend
]
=
useState
(
'不需要追加'
);
const
[
dataValue
,
setDataValue
]
=
useState
();
const
[
keepHistroy
,
setKeepHistroy
]
=
useState
([]);
const
[
historyVisible
,
setHistoryVisible
]
=
useState
(
false
);
const
[
keepInitDetailVisible
,
setKeepInitDetailVisible
]
=
useState
(
false
);
// 获取数据库配置信息
useEffect
(()
=>
{
...
...
@@ -244,6 +255,7 @@ const DatabaseInitialization = props => {
);
console
.
log
(
arr
);
setInitContentdetail
(
arr
);
setKeepInitContentDetail
(
arr
);
setShowDetali
(
true
);
scroll
.
current
.
scrollTop
=
scroll
.
current
.
scrollHeight
;
}
...
...
@@ -270,7 +282,7 @@ const DatabaseInitialization = props => {
setInitContent
(
''
);
setInitContentdetail
(
''
);
setFinish
(
false
);
deleteInitDBLogNew
();
//
deleteInitDBLogNew();
setShowDetali
(
false
);
};
...
...
@@ -280,13 +292,19 @@ const DatabaseInitialization = props => {
// setInitContent('');
// setInitContentdetail('');
setFinish
(
false
);
deleteInitDBLogNew
();
//
deleteInitDBLogNew();
setShowDetali
(
false
);
};
const
GetDb
=
kk
=>
{
console
.
log
(
121212
);
GetDbProduct
().
then
(
res
=>
{
getDataBaseConfigNew
().
then
(
resdata
=>
{
console
.
log
(
resdata
.
data
);
GetDbProduct
({
ip
:
resdata
.
data
.
ip
,
dbName
:
resdata
.
data
.
dbName
,
userName
:
resdata
.
data
.
userName
,
password
:
resdata
.
data
.
password
,
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
data
.
DbInfo
.
ip
==
'127.0.0.1'
||
!
res
.
data
.
DbInfo
.
ip
)
{
setIfInline
(
'hidden'
);
...
...
@@ -295,24 +313,37 @@ const DatabaseInitialization = props => {
}
setKeepInline
(
res
.
data
.
DbInfo
);
if
(
res
.
data
.
Project
&&
res
.
data
.
Project
.
length
>
0
)
{
setkeepNumber
(
res
.
data
.
Project
[
0
].
license
);
setkeepMsg
(
res
.
data
.
Project
[
0
].
projectName
);
setkeepNa
(
res
.
data
.
Project
[
0
].
applicantName
);
setkeepCo
(
res
.
data
.
Project
[
0
].
jobNumber
);
setKeepHistroy
(
res
.
data
.
Project
);
setkeepNumber
(
res
.
data
.
Project
[
res
.
data
.
Project
.
length
-
1
].
license
);
setkeepMsg
(
res
.
data
.
Project
[
res
.
data
.
Project
.
length
-
1
].
projectName
);
setkeepNa
(
res
.
data
.
Project
[
res
.
data
.
Project
.
length
-
1
].
applicantName
);
setkeepCo
(
res
.
data
.
Project
[
res
.
data
.
Project
.
length
-
1
].
jobNumber
);
}
else
{
setKeepHistroy
([]);
// setKeepProductData('');
setkeepNumber
(
''
);
setkeepMsg
(
''
);
setkeepNa
(
''
);
setkeepCo
(
''
);
}
form
.
setFieldsValue
(
res
.
data
.
DbInfo
);
// form.setFieldsValue(res.data.DbInfo);
form
.
setFieldsValue
({
ip
:
resdata
.
data
.
ip
,
dbName
:
resdata
.
data
.
dbName
,
userName
:
resdata
.
data
.
userName
,
password
:
resdata
.
data
.
password
,
});
GetDbChangeFirst
(
kk
);
// 有License的情况下首次进入展示数据
// if (res.data.IsAuthorize) {
if
(
res
.
data
.
Product
)
{
let
aa
=
[];
let
gg
=
[];
res
.
data
.
Product
.
map
(
i
=>
{
if
(
i
.
status
==
1
)
{
gg
.
push
(
i
.
name
);
}
aa
.
push
(
i
.
name
);
});
if
(
aa
.
length
>
0
)
{
...
...
@@ -339,6 +370,7 @@ const DatabaseInitialization = props => {
}
let
newArr
=
Array
.
from
(
new
Set
(
aa
));
console
.
log
(
newArr
);
setKeepStatus
(
gg
);
setKeepProduct
(
newArr
);
setKeepCode
(
newArr
);
setValue
(
newArr
);
...
...
@@ -347,23 +379,12 @@ const DatabaseInitialization = props => {
setIsAuthorize
(
res
.
data
.
IsAuthorize
);
if
(
res
.
data
.
IsAuthorize
)
{
setMsg
(
''
);
// if (res.data.IsAppend) {
// setMsg('当前环境需要追加产品');
// setAppend('');
// } else {
// setMsg('');
// setAppend('没有追加的产品');
// }
}
else
{
// if (res.data.IsAppend) {
// setbeforeColor('green');
// setResult('检测到License,当前环境需要追加产品');
// setMsg('检测到License,当前环境需要追加产品');
// setAppend('');
// setAppendVisible(true);
// } else {
// setAppend('没有追加的产品');
if
(
res
.
data
.
Project
&&
res
.
data
.
Project
[
0
])
{
if
(
res
.
data
.
Project
&&
res
.
data
.
Project
[
0
]
&&
res
.
data
.
Project
[
res
.
data
.
Project
.
length
-
1
]
==
'已使用'
)
{
setbeforeColor
(
'red'
);
setResult
(
'检测到License已被使用'
);
setMsg
(
'检测到License已被使用'
);
...
...
@@ -372,7 +393,6 @@ const DatabaseInitialization = props => {
setResult
(
'未检测到License'
);
setMsg
(
'未检测到License'
);
}
// }
}
}
else
{
notification
.
error
({
...
...
@@ -382,6 +402,7 @@ const DatabaseInitialization = props => {
});
}
});
});
};
const
GetDbChangeFirst
=
kk
=>
{
...
...
@@ -390,47 +411,18 @@ const DatabaseInitialization = props => {
GetDbProduct
({
...
obj
}).
then
(
res
=>
{
setCardLoading
(
false
);
if
(
res
.
code
===
0
)
{
if
(
res
.
data
.
Product
)
{
let
aa
=
[];
res
.
data
.
Product
.
map
(
i
=>
{
aa
.
push
(
i
.
name
);
});
if
(
aa
.
length
>
0
)
{
let
dd
=
[];
aa
.
map
(
i
=>
{
kk
.
map
(
j
=>
{
if
(
j
.
name
===
i
)
{
dd
.
push
(
j
);
}
});
});
let
Arr
=
Array
.
from
(
new
Set
(
dd
));
let
arr
=
formateArrDataA
(
Arr
,
'productName'
);
let
a
=
Object
.
keys
(
arr
);
a
.
map
(
i
=>
{
let
list
=
[];
arr
[
i
].
map
(
j
=>
{
list
.
push
(
j
.
name
);
});
arr
[
i
]
=
list
;
});
setProduct
(
arr
);
setKeepValue
(
arr
);
}
let
newArr
=
Array
.
from
(
new
Set
(
aa
));
console
.
log
(
newArr
);
setKeepProduct
(
newArr
);
setKeepCode
(
newArr
);
setValue
(
newArr
);
}
if
(
res
.
data
.
IsAuthorize
)
{
if
(
kk
)
{
findCheck
(
res
.
data
.
IsAppend
);
findCheck
1
(
res
.
data
.
IsAppend
);
}
else
{
onCheckLaster
(
res
.
data
.
IsAppend
);
}
}
else
{
if
(
res
.
data
.
Project
&&
res
.
data
.
Project
[
0
])
{
if
(
res
.
data
.
Project
&&
res
.
data
.
Project
[
0
]
&&
res
.
data
.
Project
[
res
.
data
.
Project
.
length
-
1
]
==
'已使用'
)
{
setbeforeColor
(
'red'
);
setResult
(
'检测到License已被使用'
);
setMsg
(
'检测到License已被使用'
);
...
...
@@ -440,6 +432,20 @@ const DatabaseInitialization = props => {
setMsg
(
'未检测到License'
);
}
}
if
(
res
.
data
.
Project
&&
res
.
data
.
Project
.
length
>
0
)
{
setKeepHistroy
(
res
.
data
.
Project
);
setkeepNumber
(
res
.
data
.
Project
[
res
.
data
.
Project
.
length
-
1
].
license
);
setkeepMsg
(
res
.
data
.
Project
[
res
.
data
.
Project
.
length
-
1
].
projectName
);
setkeepNa
(
res
.
data
.
Project
[
res
.
data
.
Project
.
length
-
1
].
applicantName
);
setkeepCo
(
res
.
data
.
Project
[
res
.
data
.
Project
.
length
-
1
].
jobNumber
);
}
else
{
// setKeepProductData('');
setKeepHistroy
([]);
setkeepNumber
(
''
);
setkeepMsg
(
''
);
setkeepNa
(
''
);
setkeepCo
(
''
);
}
}
else
{
notification
.
error
({
message
:
'提示'
,
...
...
@@ -452,7 +458,6 @@ const DatabaseInitialization = props => {
const
GetDbChange
=
e
=>
{
let
obj
=
form
.
getFieldsValue
();
console
.
log
(
2222
);
GetDbProduct
({
...
obj
}).
then
(
res
=>
{
setCardLoading
(
false
);
if
(
res
.
code
===
0
)
{
...
...
@@ -464,7 +469,11 @@ const DatabaseInitialization = props => {
onCheckLaster
(
res
.
data
.
IsAppend
);
}
}
else
{
if
(
res
.
data
.
Project
&&
res
.
data
.
Project
[
0
])
{
if
(
res
.
data
.
Project
&&
res
.
data
.
Project
[
0
]
&&
res
.
data
.
Project
[
res
.
data
.
Project
.
length
-
1
]
==
'已使用'
)
{
setbeforeColor
(
'red'
);
setResult
(
'检测到License已被使用'
);
setMsg
(
'检测到License已被使用'
);
...
...
@@ -475,11 +484,14 @@ const DatabaseInitialization = props => {
}
}
if
(
res
.
data
.
Project
&&
res
.
data
.
Project
.
length
>
0
)
{
setkeepNumber
(
res
.
data
.
Project
[
0
].
license
);
setkeepMsg
(
res
.
data
.
Project
[
0
].
projectName
);
setkeepNa
(
res
.
data
.
Project
[
0
].
applicantName
);
setkeepCo
(
res
.
data
.
Project
[
0
].
jobNumber
);
setKeepHistroy
(
res
.
data
.
Project
);
setkeepNumber
(
res
.
data
.
Project
[
res
.
data
.
Project
.
length
-
1
].
license
);
setkeepMsg
(
res
.
data
.
Project
[
res
.
data
.
Project
.
length
-
1
].
projectName
);
setkeepNa
(
res
.
data
.
Project
[
res
.
data
.
Project
.
length
-
1
].
applicantName
);
setkeepCo
(
res
.
data
.
Project
[
res
.
data
.
Project
.
length
-
1
].
jobNumber
);
}
else
{
// setKeepProductData('');
setKeepHistroy
([]);
setkeepNumber
(
''
);
setkeepMsg
(
''
);
setkeepNa
(
''
);
...
...
@@ -487,7 +499,11 @@ const DatabaseInitialization = props => {
}
if
(
res
.
data
.
Product
)
{
let
aa
=
[];
let
gg
=
[];
res
.
data
.
Product
.
map
(
i
=>
{
if
(
i
.
status
==
1
)
{
gg
.
push
(
i
.
name
);
}
aa
.
push
(
i
.
name
);
});
if
(
aa
.
length
>
0
)
{
...
...
@@ -517,15 +533,16 @@ const DatabaseInitialization = props => {
// 当前数据库已存在和上一个已存在数据库值重新赋值
if
(
newArr
.
length
>
0
)
{
setKeepProduct
(
newArr
);
setKeepStatus
(
gg
);
setKeepCode
(
newArr
);
setValue
(
newArr
);
}
else
{
setKeepProduct
([]);
setKeepStatus
([]);
setKeepCode
([]);
setValue
([]);
}
if
(
res
.
data
.
Product
.
length
==
0
)
{
console
.
log
(
1212
);
setKeepValue
([]);
}
}
...
...
@@ -543,13 +560,16 @@ const DatabaseInitialization = props => {
const
GetDbChangeAppend
=
()
=>
{
let
obj
=
form
.
getFieldsValue
();
console
.
log
(
5555
);
GetDbProduct
({
...
obj
}).
then
(
res
=>
{
setCardLoading
(
false
);
if
(
res
.
code
===
0
)
{
if
(
res
.
data
.
Product
)
{
let
aa
=
[];
let
gg
=
[];
res
.
data
.
Product
.
map
(
i
=>
{
if
(
i
.
status
==
1
)
{
gg
.
push
(
i
.
name
);
}
aa
.
push
(
i
.
name
);
});
if
(
aa
.
length
>
0
)
{
...
...
@@ -578,10 +598,12 @@ const DatabaseInitialization = props => {
// 当前数据库已存在和上一个已存在数据库值重新赋值
if
(
newArr
.
length
>
0
)
{
setKeepProduct
(
newArr
);
setKeepStatus
(
gg
);
setKeepCode
(
newArr
);
setValue
(
newArr
);
}
else
{
setKeepProduct
([]);
setKeepStatus
([]);
setKeepCode
([]);
setValue
([]);
}
...
...
@@ -589,6 +611,11 @@ const DatabaseInitialization = props => {
setKeepValue
([]);
}
}
if
(
res
.
data
.
Project
&&
res
.
data
.
Project
.
length
>
0
)
{
setKeepHistroy
(
res
.
data
.
Project
);
}
else
{
setKeepHistroy
([]);
}
setKeepDb
(
res
.
data
);
setIsAuthorize
(
res
.
data
.
IsAuthorize
);
}
else
{
...
...
@@ -615,9 +642,10 @@ const DatabaseInitialization = props => {
doInitLog
();
NewInitAddDataBase
({
...
obj
,
productSetting
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
if
(
value
.
length
>
0
)
{
setKeepProduct
(
value
);
}
// if (value.length > 0) {
// setKeepProduct(value);
// }
GetDbChangeAppend
();
setMsg
(
'检测到License已被使用'
);
setfirstColor
(
'green'
);
...
...
@@ -674,6 +702,7 @@ const DatabaseInitialization = props => {
// if (value.length > 0) {
// setKeepProduct(value);
// }
GetDbChangeAppend
();
setMsg
(
'检测到License已被使用'
);
setfirstColor
(
'green'
);
setDataResult
(
'成功'
);
...
...
@@ -806,7 +835,7 @@ const DatabaseInitialization = props => {
}
});
deleteInitDBLogNew
();
//
deleteInitDBLogNew();
}
else
{
setbeforeColor
(
'red'
);
setResult
(
'请输入完整数据库信息'
);
...
...
@@ -904,7 +933,7 @@ const DatabaseInitialization = props => {
setResult
(
'无法追加,该数据库为非授权初始化数据库,请直接升级数据库! '
);
setMsg
(
'无法追加,该数据库为非授权初始化数据库,请直接升级数据库!'
);
setAppend
(
'无需追加'
);
deleteInitDBLogNew
();
//
deleteInitDBLogNew();
}
}
else
{
setPassword
(
true
);
...
...
@@ -931,12 +960,57 @@ const DatabaseInitialization = props => {
});
};
const
findCheck1
=
aa
=>
{
let
obj
=
form
.
getFieldsValue
();
CheckDatabaseIsExist
({
...
obj
}).
then
(
res
=>
{
setCardLoading
(
false
);
if
(
res
.
code
===
0
)
{
setDataValue
(
form
.
getFieldsValue
());
if
(
res
.
data
===
true
)
{
if
(
aa
)
{
setbeforeColor
(
'green'
);
setResult
(
'检测到License,当前环境需要追加产品'
);
setMsg
(
'检测到License,当前环境需要追加产品'
);
setAppend
(
''
);
setAppendVisible
(
true
);
setDataValue
(
form
.
getFieldsValue
());
}
else
{
setbeforeColor
(
'red'
);
setPassword
(
false
);
setResult
(
'无法追加,该数据库为非授权初始化数据库,请直接升级数据库! '
);
setMsg
(
'无法追加,该数据库为非授权初始化数据库,请直接升级数据库!'
);
setAppend
(
'无需追加'
);
// deleteInitDBLogNew();
}
}
else
{
setPassword
(
true
);
setbeforeColor
(
'green'
);
setResult
(
'通过'
);
setMsg
(
''
);
setAppend
(
'无需追加'
);
let
arr
=
[];
keepData
.
map
(
i
=>
{
if
(
keepCode
.
indexOf
(
i
.
name
)
!=
-
1
)
{
arr
.
push
(
i
);
}
});
}
}
else
{
setbeforeColor
(
'red'
);
setResult
(
`
${
res
.
msg
}
`
);
setMsg
(
res
.
msg
);
}
});
};
const
save
=
()
=>
{
flagChange
();
};
useEffect
(()
=>
{
if
(
!
initVisible
)
{
if
(
!
initVisible
&&
!
initVisibledetail
)
{
setShow
(
'hidden'
);
}
},
[
initVisible
]);
...
...
@@ -971,8 +1045,66 @@ const DatabaseInitialization = props => {
const
onOk
=
()
=>
{
setAppendVisible
(
false
);
initDatabaseProAppend
();
GetDbChangeAppend
();
//
GetDbChangeAppend();
};
const
onHistory
=
()
=>
{
setHistoryVisible
(
true
);
};
const
columns
=
[
{
title
:
'授权码'
,
dataIndex
:
'license'
,
key
:
'license'
,
// width: 100,
// fixed: 'left',
},
{
title
:
'项目名'
,
dataIndex
:
'projectName'
,
key
:
'projectName'
,
// width: 100,
},
{
title
:
'授权人'
,
dataIndex
:
'applicantName'
,
key
:
'applicantName'
,
// width: 150,
},
{
title
:
'使用时间'
,
dataIndex
:
'createTime'
,
key
:
'createTime'
,
// width: 150,
},
{
title
:
'部署产品'
,
dataIndex
:
'productSolutions'
,
key
:
'productSolutions'
,
render
:
text
=>
{
console
.
log
(
text
);
let
aa
=
[];
if
(
text
)
{
text
.
map
(
i
=>
{
aa
.
push
(
i
.
productName
);
});
return
(
<
Tooltip
title=
{
aa
.
toString
()
}
arrowPointAtCenter
placement=
"rightTop"
>
<
span
>
{
text
.
length
}
个
</
span
>
</
Tooltip
>
);
}
},
},
];
useEffect
(()
=>
{
if
(
!
initVisibledetail
&&
!
initVisible
)
{
deleteInitDBLogNew
();
}
},
[
initVisibledetail
,
initVisible
]);
return
(
<>
<
PageContainer
className=
{
styles
.
InitDataBaseContainer
}
>
...
...
@@ -1292,6 +1424,16 @@ const DatabaseInitialization = props => {
}
}
>
<
div
style=
{
{
display
:
'inline-block'
,
backgroundColor
:
'aliceblue'
}
}
>
{
keepHistroy
.
length
>
0
?
(
<
Tooltip
title=
"查看数据库授权记录"
>
<
EyeOutlined
style=
{
{
color
:
'rgb(24 144 255)'
,
marginRight
:
'5px'
}
}
onClick=
{
onHistory
}
/>
</
Tooltip
>
)
:
(
<></>
)
}
<
BarcodeOutlined
style=
{
{
color
:
'rgb(227 168 96)'
,
marginRight
:
'5px'
}
}
/>
授权码:
{
keepNumber
?
(
...
...
@@ -1341,12 +1483,53 @@ const DatabaseInitialization = props => {
{
data
[
item
]
&&
data
[
item
].
map
((
i
,
j
)
=>
{
if
(
keepProduct
.
indexOf
(
i
)
!=
-
1
)
{
return
<
Checkbox
checked
>
{
i
}
</
Checkbox
>;
if
(
keepStatus
.
indexOf
(
i
)
!=
-
1
)
{
return
(
<
span
style=
{
{
width
:
'250px'
,
marginLeft
:
'24px'
,
display
:
'inline-block'
,
marginBottom
:
'20px'
,
}
}
>
<
CheckOutlined
style=
{
{
color
:
'green'
,
marginRight
:
'5px'
}
}
/>
{
i
}
</
span
>
);
}
else
{
return
(
<
Checkbox
checked=
{
false
}
disabled
>
<
span
style=
{
{
width
:
'250px'
,
marginLeft
:
'24px'
,
display
:
'inline-block'
,
marginBottom
:
'20px'
,
}
}
>
<
PlusOutlined
style=
{
{
color
:
'#96cdf9'
,
marginRight
:
'5px'
}
}
/>
{
i
}
</
Checkbox
>
</
span
>
);
}
}
else
{
return
(
<
span
style=
{
{
width
:
'250px'
,
marginLeft
:
'24px'
,
display
:
'inline-block'
,
marginBottom
:
'20px'
,
color
:
'#c3c3c3'
,
}
}
>
{
/* <MinusSquareOutlined
style={{ color: 'gray', marginTop: '-6px', marginRight: '5px' }}
/> */
}
{
i
}
</
span
>
);
}
})
}
...
...
@@ -1369,7 +1552,7 @@ const DatabaseInitialization = props => {
cancelText=
"取消"
onConfirm=
{
()
=>
{
Submit
();
deleteInitDBLogNew
();
//
deleteInitDBLogNew();
}
}
>
<
Button
type=
"primary"
disabled=
{
msg
!=
''
}
>
...
...
@@ -1391,7 +1574,7 @@ const DatabaseInitialization = props => {
setInitVisible
(
false
);
setInitContent
(
''
);
setInitContentdetail
(
''
);
deleteInitDBLogNew
();
//
deleteInitDBLogNew();
}
}
width=
{
800
}
maskClosable=
{
false
}
...
...
@@ -1427,19 +1610,26 @@ const DatabaseInitialization = props => {
overflowY
:
'scroll'
,
marginRight
:
' -24px'
,
}
}
>
<
Spin
spinning=
{
initLoading
}
tip=
"loading..."
style=
{
{
width
:
'100%'
,
marginTop
:
'40px'
}
}
>
<
span
>
{
initContent
}
</
span
>
<
div
style=
{
{
height
:
'40px'
}
}
>
<
div
style=
{
{
position
:
'relative'
}
}
>
<
Spin
{
/* {initLoading ? <span>加载中...</span> : <></>} */
}
{
/* <Spin
spinning={initLoading}
tip="loading..."
style={{ width: '100%', marginTop: '40px' }}
/>
/>
*/
}
</
div
>
</
div
>
{
/* <br />
{showDetali ? <span>{initContentdetail}</span> : <></>} */
}
</
Spin
>
</
div
>
</
Modal
>
<
Modal
...
...
@@ -1455,6 +1645,14 @@ const DatabaseInitialization = props => {
height
:
'500px'
,
}
}
footer=
{
[
<
Button
onClick=
{
()
=>
{
setKeepInitDetailVisible
(
true
);
setKeepInitVisible
(
false
);
}
}
>
查看详细日志
</
Button
>,
<
Button
onClick=
{
()
=>
{
setKeepInitVisible
(
false
);
...
...
@@ -1477,6 +1675,49 @@ const DatabaseInitialization = props => {
{
keepInitContent
}
</
div
>
</
Modal
>
<
Modal
title=
"详细日志信息"
visible=
{
keepInitDetailVisible
}
onCancel=
{
()
=>
{
setKeepInitDetailVisible
(
false
);
}
}
width=
{
800
}
maskClosable=
{
false
}
bodyStyle=
{
{
height
:
'500px'
,
}
}
footer=
{
[
<
Button
onClick=
{
()
=>
{
setKeepInitDetailVisible
(
false
);
setKeepInitVisible
(
true
);
}
}
>
查看日志
</
Button
>,
<
Button
onClick=
{
()
=>
{
setKeepInitDetailVisible
(
false
);
}
}
key=
"back"
type=
"primary"
>
关闭窗口
</
Button
>,
]
}
>
<
div
ref=
{
scroll
}
style=
{
{
maxHeight
:
'470px'
,
overflowY
:
'auto'
,
marginRight
:
' -24px'
,
}
}
>
{
keepInitContentDetail
}
</
div
>
</
Modal
>
<
AppendModal
visible=
{
appendVisible
}
onCancel=
{
()
=>
{
...
...
@@ -1484,7 +1725,40 @@ const DatabaseInitialization = props => {
}
}
value=
{
dataValue
}
callBackSubmit=
{
onOk
}
keepHistroy=
{
keepHistroy
}
/>
<
Modal
title=
"数据库授权记录"
visible=
{
historyVisible
}
onCancel=
{
()
=>
{
setHistoryVisible
(
false
);
}
}
width=
{
1000
}
bodyStyle=
{
{
height
:
'500px'
,
overflowY
:
'scroll'
,
}
}
footer=
{
[
<
Button
onClick=
{
()
=>
{
setHistoryVisible
(
false
);
}
}
key=
"back"
>
关闭
</
Button
>,
]
}
>
<
Table
size=
"small"
rowKey=
{
record
=>
record
.
userID
}
bordered
columns=
{
columns
}
dataSource=
{
keepHistroy
}
pagination=
{
false
}
scroll=
{
{
x
:
'max-content'
}
}
/>
</
Modal
>
<
Modal
title=
"初始化数据库详细日志"
visible=
{
initVisibledetail
}
...
...
@@ -1499,6 +1773,14 @@ const DatabaseInitialization = props => {
// overflowY: 'auto',
}
}
footer=
{
[
<
Button
onClick=
{
()
=>
{
setInitVisible
(
true
);
setinitVisibledetail
(
false
);
}
}
>
查看初始化日志
</
Button
>,
<
Button
onClick=
{
()
=>
{
handleClickdetail
();
...
...
src/pages/platformCenter/gis/schemeConfig/ScopeMap/index.jsx
View file @
309ad5e4
...
...
@@ -28,9 +28,9 @@ import {
import
{
EnvironmentOutlined
}
from
'@ant-design/icons'
;
import
classnames
from
'classnames'
;
import
{
GetWebSiteConfig
}
from
'@/services/gis/gis'
;
import
{
SetServiceConfig
}
from
'@/services/webConfig/api'
;
import
styles
from
'./index.less'
;
import
{
SetServiceConfig
,
GetSpriteSheet
}
from
'@/services/webConfig/api'
;
import
{
ContinuousLegend
}
from
'@antv/g2/lib/dependents'
;
import
styles
from
'./index.less'
;
const
{
Option
}
=
Select
;
const
defaultMap
=
{
basemaps
:
[
...
...
@@ -153,6 +153,9 @@ const Map = props => {
const
[
color
,
setColor
]
=
useState
(
''
);
useEffect
(()
=>
{
// GetSpriteSheet().then(res => {
// console.log(123);
// });
GetWebSiteConfig
({
client
:
'sandbox'
}).
then
(
res
=>
{
let
setttings
=
{};
if
(
res
.
data
.
length
===
0
)
{
...
...
src/services/webConfig/api.js
View file @
309ad5e4
...
...
@@ -308,3 +308,5 @@ export const DragSingleWebsite = param =>
export
const
UpdateSchemPipeNetwork
=
param
=>
get
(
`
${
PANDA_GIS
}
/MapLayer/UpdateSchemPipeNetwork`
,
param
);
export
const
GetSpriteSheet
=
param
=>
get
(
`
${
PANDA_GIS
}
/MultiMedia/GetSpriteSheet`
,
param
);
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