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
69ac8b6b
Commit
69ac8b6b
authored
Aug 31, 2022
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据库初始化追加
parent
5fb162e4
Pipeline
#58925
passed with stages
Changes
11
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
257 additions
and
51 deletions
+257
-51
AddModal.jsx
...ages/bsmanager/patrolMaintenance/maintenance/AddModal.jsx
+40
-36
ChangeAdd.jsx
...ges/bsmanager/patrolMaintenance/maintenance/ChangeAdd.jsx
+1
-1
maintenance.jsx
...s/bsmanager/patrolMaintenance/maintenance/maintenance.jsx
+2
-2
AddModal.jsx
...s/bsmanager/patrolMaintenance/patrolFeedback/AddModal.jsx
+3
-0
patrolFeedback.jsx
...nager/patrolMaintenance/patrolFeedback/patrolFeedback.jsx
+3
-3
AddModal.jsx
src/pages/bsmanager/workOrder/incident/AddModal.jsx
+6
-6
incident.less
src/pages/bsmanager/workOrder/incident/incident.less
+4
-3
AppendModal.jsx
src/pages/database/databaseInitialization/AppendModal.jsx
+191
-0
DatabaseInitialization.jsx
...atabase/databaseInitialization/DatabaseInitialization.jsx
+0
-0
DatabaseInitialization.less
...tabase/databaseInitialization/DatabaseInitialization.less
+3
-0
api.js
src/services/database/api.js
+4
-0
No files found.
src/pages/bsmanager/patrolMaintenance/maintenance/AddModal.jsx
View file @
69ac8b6b
...
...
@@ -37,10 +37,6 @@ import ChangeAdd from './ChangeAdd';
const
{
Option
}
=
Select
;
const
AddModal
=
props
=>
{
const
[
inputValue
,
setInputValue
]
=
useState
({
feedbackName
:
''
,
doRole
:
''
,
});
const
{
callBackSubmit
=
()
=>
{},
visible
,
type
,
formObj
,
keepTableData
}
=
props
;
const
[
Type1
,
setType1
]
=
useState
(
''
);
...
...
@@ -74,13 +70,11 @@ const AddModal = props => {
form
.
setFieldsValue
({
isSubmit
:
'否'
,
docycle
:
'一周一次'
});
setType1
(
''
);
setType2
(
''
);
setInputValue
({
feedbackName
:
''
,
doRole
:
''
});
setFiled1
({});
}
else
if
(
type
===
'edit'
)
{
CM_XWBPlan_DataList
({
id
:
formObj
.
id
}).
then
(
res
=>
{
let
data
=
res
.
data
[
0
];
data
&&
form
.
setFieldsValue
({
...
data
});
setInputValue
({
...
data
});
console
.
log
(
data
.
businessTypee
);
setType1
(
data
.
businessType
);
setType2
(
data
.
accountName
);
...
...
@@ -113,8 +107,6 @@ const AddModal = props => {
form
.
validateFields
().
then
(
validate
=>
{
if
(
validate
)
{
let
obj
=
form
.
getFieldsValue
();
// obj.feedbackName = inputValue.feedbackName;
// obj.doRole = inputValue.doRole;
if
(
type
==
'add'
)
{
CM_XWBPlan_DataEditORAdd
(
obj
).
then
(
res
=>
{
if
(
res
.
msg
==
''
)
{
...
...
@@ -167,26 +159,34 @@ const AddModal = props => {
setType2
(
e
.
target
.
value
);
form
.
setFieldsValue
({
accountName
:
e
.
target
.
value
});
};
const
changeText
=
(
e
,
type
)
=>
{
let
inputText
=
{
...
inputValue
};
inputText
[
type
]
=
e
.
target
.
value
;
setInputValue
(
inputText
);
};
const
pickFiled
=
fileds
=>
{
setTypes
(
'add'
);
setCharacterValue
(
inputValue
[
fileds
]);
setCheckedList1
(
inputValue
[
fileds
].
split
(
','
));
setPickItem
(
fileds
);
setIsVisible
(
true
);
if
(
form
.
getFieldValue
(
fileds
))
{
setTypes
(
'add'
);
setCharacterValue
(
form
.
getFieldValue
(
fileds
));
setCheckedList1
(
form
.
getFieldValue
(
fileds
).
split
(
','
));
setPickItem
(
fileds
);
setIsVisible
(
true
);
}
else
{
setTypes
(
'add'
);
setCharacterValue
(
form
.
getFieldValue
(
fileds
));
setCheckedList1
([]);
setPickItem
(
fileds
);
setIsVisible
(
true
);
}
};
const
pickFiled1
=
fileds
=>
{
setTypes
(
'app'
);
setCharacterValue
(
inputValue
[
fileds
]);
setCheckedList1
(
inputValue
[
fileds
].
split
(
','
));
console
.
log
(
inputValue
[
fileds
]);
console
.
log
(
inputValue
[
fileds
].
split
(
','
));
setPickItem
(
fileds
);
setIsVisibleRoles
(
true
);
if
(
form
.
getFieldValue
(
fileds
))
{
setTypes
(
'app'
);
setCheckedList1
(
form
.
getFieldValue
(
fileds
).
split
(
','
));
setPickItem
(
fileds
);
setIsVisibleRoles
(
true
);
}
else
{
setTypes
(
'app'
);
setCheckedList1
([]);
setPickItem
(
fileds
);
setIsVisibleRoles
(
true
);
}
};
const
getRole
=
()
=>
{
CM_Event_LoadDepartmentAndRoles
().
then
(
res
=>
{
...
...
@@ -258,7 +258,7 @@ const AddModal = props => {
if
(
!
name
)
{
return
'请传入对象属性'
;
}
//先获取一下这个数组中有多少个"name"
//
先获取一下这个数组中有多少个"name"
let
nameArr
=
[];
a3
.
map
(
i
=>
{
if
(
nameArr
.
indexOf
(
i
.
group
)
===
-
1
)
{
...
...
@@ -266,7 +266,7 @@ const AddModal = props => {
}
});
console
.
log
(
nameArr
);
//新建一个包含多个list的结果对象
//
新建一个包含多个list的结果对象
let
tempObj
=
{};
// 根据不同的"name"生成多个数组
for
(
let
k
in
nameArr
)
{
...
...
@@ -295,20 +295,23 @@ const AddModal = props => {
setSelectValue1
(
value
);
};
const
onOK
=
prop
=>
{
console
.
log
(
prop
.
isType
);
setIsVisibleRoles
(
false
);
let
inputText
=
{};
inputText
[
prop
.
pickItem
]
=
prop
.
str
;
setCheckedList1
(
prop
.
stt
);
form
.
setFieldsValue
(
inputText
);
};
const
onOK1
=
prop
=>
{
console
.
log
(
prop
);
setIsVisible
(
false
);
console
.
log
(
props
);
let
inputText
=
{
...
inputValue
};
let
inputText
=
{};
inputText
[
prop
.
pickItem
]
=
prop
.
str
;
setCheckedList1
(
prop
.
checkedList
);
setInputValue
(
inputText
);
setCheckedList1
(
prop
.
stt
);
form
.
setFieldsValue
(
inputText
);
};
// const title = <ModalDrag title="巡维保计划配置" />
const
inputType
=
value
=>
{
console
.
log
(
value
);
if
(
value
)
{
form
.
setFieldsValue
({
businessType
:
value
});
}
...
...
@@ -345,7 +348,8 @@ const AddModal = props => {
let
aa
=
form
.
getFieldValue
().
businessName
;
if
(
type
===
'add'
&&
keepTableData
.
indexOf
(
aa
)
!=
-
1
)
{
return
Promise
.
reject
(
'业务名称已存在'
);
}
else
if
(
}
if
(
type
===
'edit'
&&
keepTableData
.
indexOf
(
aa
)
!=
-
1
&&
aa
!=
formObj
.
businessName
...
...
@@ -556,7 +560,7 @@ const AddModal = props => {
<
ChangeAdd
visible=
{
isVisible
}
onCancel=
{
()
=>
setIsVisible
(
false
)
}
callBackSubmit=
{
onOK
}
callBackSubmit=
{
onOK
1
}
newCheckedList=
{
checkedList1
}
isType=
{
types
}
filed=
{
filed
}
...
...
src/pages/bsmanager/patrolMaintenance/maintenance/ChangeAdd.jsx
View file @
69ac8b6b
...
...
@@ -95,7 +95,7 @@ const ChangeAdd = props => {
setCheckedList
(
checkArr
);
setIndeterminate
(
!!
checkArr
.
length
&&
checkArr
.
length
<
filed
.
length
);
setCheckAll
(
checkArr
.
length
===
filed
.
length
&&
filed
.
length
!=
0
);
let
newArr
=
characterValue
.
length
?
characterValue
.
split
(
','
)
:
[];
let
newArr
=
characterValue
?
characterValue
.
split
(
','
)
:
[];
setSelectData
(
newArr
);
}
}
...
...
src/pages/bsmanager/patrolMaintenance/maintenance/maintenance.jsx
View file @
69ac8b6b
...
...
@@ -329,7 +329,7 @@ const maintenance = () => {
marginTop
:
'10px'
,
}
}
>
<
span
style=
{
{
marginTop
:
'-
3
px'
}
}
>
新增
</
span
>
<
span
style=
{
{
marginTop
:
'-
2
px'
}
}
>
新增
</
span
>
</
Button
>
<
Button
icon=
{
<
OrderedListOutlined
className=
{
styles
.
icon
}
/>
}
...
...
@@ -340,7 +340,7 @@ const maintenance = () => {
marginTop
:
'10px'
,
}
}
>
<
span
style=
{
{
marginTop
:
'-
3
px'
}
}
>
调序
</
span
>
<
span
style=
{
{
marginTop
:
'-
2
px'
}
}
>
调序
</
span
>
</
Button
>
</
span
>
</
div
>
...
...
src/pages/bsmanager/patrolMaintenance/patrolFeedback/AddModal.jsx
View file @
69ac8b6b
...
...
@@ -306,8 +306,11 @@ const AddModal = props => {
};
const
onOK
=
prop
=>
{
console
.
log
(
prop
);
setIsVisibleRoles
(
false
);
let
inputText
=
{};
console
.
log
(
inputText
);
console
.
log
(
inputText
[
prop
.
pickItem
]);
inputText
[
prop
.
pickItem
]
=
prop
.
str
;
setCheckedList1
(
prop
.
stt
);
form
.
setFieldsValue
(
inputText
);
...
...
src/pages/bsmanager/patrolMaintenance/patrolFeedback/patrolFeedback.jsx
View file @
69ac8b6b
...
...
@@ -229,7 +229,7 @@ const patrolFeedback = () => {
marginTop
:
'10px'
,
}
}
>
<
span
style=
{
{
marginTop
:
'-
3
px'
}
}
>
新增
</
span
>
<
span
style=
{
{
marginTop
:
'-
2
px'
}
}
>
新增
</
span
>
</
Button
>
<
Button
icon=
{
<
OrderedListOutlined
className=
{
styles
.
icon
}
/>
}
...
...
@@ -240,7 +240,7 @@ const patrolFeedback = () => {
marginTop
:
'10px'
,
}
}
>
<
span
style=
{
{
marginTop
:
'-
3
px'
}
}
>
调序
</
span
>
<
span
style=
{
{
marginTop
:
'-
2
px'
}
}
>
调序
</
span
>
</
Button
>
<
Button
icon=
{
<
DeleteOutlined
className=
{
styles
.
icon
}
/>
}
...
...
@@ -252,7 +252,7 @@ const patrolFeedback = () => {
onClick=
{
de
}
disabled=
{
!
hasSelected
}
>
<
span
style=
{
{
marginTop
:
'-
3
px'
}
}
>
批量删除
</
span
>
<
span
style=
{
{
marginTop
:
'-
2
px'
}
}
>
批量删除
</
span
>
</
Button
>
</
span
>
</
div
>
...
...
src/pages/bsmanager/workOrder/incident/AddModal.jsx
View file @
69ac8b6b
...
...
@@ -626,7 +626,7 @@ const AddModal = props => {
setOrder
(
res
.
data
.
root
.
Order
);
form
.
setFieldsValue
({
...
res
.
data
.
root
});
if
(
res
.
data
.
root
.
ImageExpression
)
{
setImageUrl
(
window
.
location
.
origin
+
`
/civweb4/
${
res
.
data
.
root
.
ImageExpression
}
`
);
setImageUrl
(
`
${
window
.
location
.
origin
}
/civweb4/
${
res
.
data
.
root
.
ImageExpression
}
`
);
setIm
(
res
.
data
.
root
.
ImageExpression
);
}
else
{
form
.
setFieldsValue
({
...
...
@@ -1302,7 +1302,7 @@ const AddModal = props => {
const
onOk
=
props
=>
{
if
(
props
)
{
setImageUrl
(
window
.
location
.
origin
+
`
/civweb4/
${
props
}
`
);
setImageUrl
(
`
${
window
.
location
.
origin
}
/civweb4/
${
props
}
`
);
setIm
(
props
);
setKeepImgeUrl
(
props
);
form
.
setFieldsValue
({
ImageExpression
:
`
${
props
}
`
});
...
...
@@ -1853,12 +1853,12 @@ const AddModal = props => {
form
.
setFieldsValue
({
ImageExpression
:
''
});
}
}
style=
{
{
position
:
'
relativ
e'
,
position
:
'
absolut
e'
,
fontSize
:
'18px'
,
left
:
'
3
4px'
,
top
:
'
10
px'
,
left
:
'
4
4px'
,
top
:
'
45
px'
,
color
:
'white'
,
zIndex
:
'
2
'
zIndex
:
'
999
'
}
}
/>
</>
...
...
src/pages/bsmanager/workOrder/incident/incident.less
View file @
69ac8b6b
...
...
@@ -272,13 +272,14 @@
}
}
.imgg {
position:
absolut
e;
top:
0
;
left:
0
;
position:
relativ
e;
top:
-33px
;
left:
-9px
;
height: 104px;
width: 104px;
background: rgba(0, 0, 0, 0.5);
border-radius: 2px;
z-index:1;
}
.imgg :hover {
opacity: 0.7;
...
...
src/pages/database/databaseInitialization/AppendModal.jsx
0 → 100644
View file @
69ac8b6b
/* 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
styles
from
'./DatabaseInitialization.less'
;
import
{
GetLicenseDifference
,
InitEditDataBase
,
GetProductList
}
from
'@/services/database/api'
;
const
AppendModal
=
props
=>
{
const
{
callBackSubmit
=
()
=>
{},
visible
,
onCancel
,
value
}
=
props
;
const
[
data
,
setData
]
=
useState
([]);
const
[
allLength
,
setAllLength
]
=
useState
(
''
);
const
[
flag
,
setFlag
]
=
useState
();
const
[
loading
,
setLoading
]
=
useState
(
false
);
useEffect
(()
=>
{
if
(
visible
)
{
getProduct
();
console
.
log
(
value
);
}
else
{
setData
([]);
setFlag
();
setAllLength
(
''
);
}
},
[
visible
]);
const
getProduct
=
()
=>
{
setLoading
(
true
);
GetLicenseDifference
(
value
).
then
(
res
=>
{
setLoading
(
false
);
if
(
res
.
code
===
0
)
{
let
arr
=
formateArrDataA
(
res
.
data
,
'productName'
);
let
aa
=
Object
.
keys
(
arr
);
aa
.
map
(
i
=>
{
let
list
=
[];
arr
[
i
].
map
(
j
=>
{
list
.
push
(
j
.
name
);
});
arr
[
i
]
=
list
;
});
setData
(
arr
);
if
(
res
.
data
.
length
==
0
)
{
setFlag
(
1
);
}
else
{
setFlag
(
0
);
}
setAllLength
(
res
.
data
.
length
);
}
else
{
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
res
.
msg
,
});
}
});
};
const
formateArrDataA
=
(
initialArr
,
name
)
=>
{
// 判定传参是否符合规则
if
(
!
(
initialArr
instanceof
Array
))
{
return
'请传入正确格式的数组'
;
}
if
(
!
name
)
{
return
'请传入对象属性'
;
}
// 先获取一下这个数组中有多少个"name"
let
nameArr
=
[];
for
(
let
i
in
initialArr
)
{
if
(
nameArr
.
indexOf
(
initialArr
[
i
][
`
${
name
}
`
])
===
-
1
)
{
nameArr
.
push
(
initialArr
[
i
][
`
${
name
}
`
]);
}
}
// 新建一个包含多个list的结果对象
let
tempObj
=
{};
// 根据不同的"name"生成多个数组
for
(
let
k
in
nameArr
)
{
for
(
let
j
in
initialArr
)
{
if
(
initialArr
[
j
][
`
${
name
}
`
]
==
nameArr
[
k
])
{
// 每次外循环时新建一个对应"name"的数组, 内循环时当前数组不变
tempObj
[
nameArr
[
k
]]
=
tempObj
[
nameArr
[
k
]]
||
[];
tempObj
[
nameArr
[
k
]].
push
(
initialArr
[
j
]);
}
}
}
for
(
let
keys
in
tempObj
)
{
let
arr
=
[];
tempObj
[
keys
].
map
((
item
,
index
)
=>
{
tempObj
[
keys
]
=
arr
;
item
.
key
=
index
;
arr
.
push
(
item
);
});
}
return
tempObj
;
};
const
Submit
=
()
=>
{
callBackSubmit
();
};
return
(
<
Modal
title=
"产品追加"
width=
"800px"
visible=
{
visible
}
onCancel=
{
onCancel
}
destroyOnClose
maskClosable=
{
false
}
bodyStyle=
{
{
height
:
'500px'
,
overflowY
:
'scroll'
,
}
}
footer=
{
<
Space
>
<
Button
onClick=
{
onCancel
}
>
取消
</
Button
>
<
Popconfirm
placement=
"topLeft"
title=
{
<
span
style=
{
{
color
:
'rgb(24 144 255)'
}
}
>
是否确认追加!
</
span
>
}
okText=
"确认"
cancelText=
"取消"
onConfirm=
{
()
=>
{
Submit
();
}
}
>
<
Button
type=
"primary"
>
追加
</
Button
>
</
Popconfirm
>
</
Space
>
}
>
<
Spin
spinning=
{
loading
}
>
{
flag
==
1
?
(
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
description=
{
<
span
>
当前授权码下产品已全部初始化,无需再次追加
</
span
>
}
/>
)
:
(
<>
{
allLength
>
0
&&
(
<
div
style=
{
{
marginBottom
:
'26px'
}
}
>
<
strong
>
追加产品列表(共
<
span
style=
{
{
color
:
'rgb(24 144 255)'
}
}
>
{
allLength
}
</
span
>
个)
</
strong
>
</
div
>
)
}
{
data
&&
Object
.
keys
(
data
).
map
((
i
,
j
)
=>
(
<
div
style=
{
{
border
:
'2px solid #c2cdfd'
,
borderRadius
:
'5px'
,
marginBottom
:
'20px'
,
position
:
'relative'
,
paddingTop
:
'30px'
,
}
}
>
<
div
style=
{
{
position
:
'absolute'
,
left
:
'13px'
,
top
:
'-12px'
,
backgroundColor
:
'white'
,
paddingLeft
:
'10px'
,
paddingRight
:
'10px'
,
}
}
>
<>
<
span
>
{
i
}
</
span
>
<
span
>
(共
<
span
style=
{
{
color
:
'rgb(24, 144, 255)'
}
}
>
{
data
[
i
].
length
}
</
span
>
个)
</
span
>
</>
</
div
>
{
data
[
i
].
map
(
j
=>
(
<
span
style=
{
{
width
:
'150px'
,
marginLeft
:
'24px'
,
display
:
'inline-block'
,
marginBottom
:
'20px'
,
}
}
>
{
j
}
</
span
>
))
}
</
div
>
))
}
</>
)
}
</
Spin
>
</
Modal
>
);
};
export
default
AppendModal
;
src/pages/database/databaseInitialization/DatabaseInitialization.jsx
View file @
69ac8b6b
This diff is collapsed.
Click to expand it.
src/pages/database/databaseInitialization/DatabaseInitialization.less
View file @
69ac8b6b
...
...
@@ -23,6 +23,9 @@ InitDataBaseContainer {
padding-bottom: 0px !important;
}
}
.ant-modal-footer {
padding: 10px 25px 10px 40px;
}
.cardContainer {
margin-top: 10px;
...
...
src/services/database/api.js
View file @
69ac8b6b
...
...
@@ -228,3 +228,7 @@ export const SetAdminMenuToRole = params =>
export
const
NewInitAddDataBase
=
params
=>
post
(
`
${
PUBLISH_SERVICE
}
/DBManager/NewInitAddDataBase`
,
params
);
// 获取追加产品
export
const
GetLicenseDifference
=
params
=>
post
(
`
${
PUBLISH_SERVICE
}
/DBManager/GetLicenseDifference`
,
params
);
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