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
44706b3a
Commit
44706b3a
authored
Jul 10, 2023
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '维保模板删除数据列表不刷新bug修复'
parent
ce889955
Pipeline
#75671
waiting for manual action with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
275 deletions
+87
-275
AddModal.jsx
...ages/bsmanager/patrolMaintenance/maintenance/AddModal.jsx
+53
-25
maintenance.jsx
...s/bsmanager/patrolMaintenance/maintenance/maintenance.jsx
+34
-250
No files found.
src/pages/bsmanager/patrolMaintenance/maintenance/AddModal.jsx
View file @
44706b3a
...
...
@@ -148,7 +148,7 @@ const AddModal = props => {
getParentList
();
if
(
type
===
'add'
)
{
setChee
(
'否'
);
form
.
setFieldsValue
({
isSubmit
:
'否'
,
docycle
:
'一周一次'
});
form
.
setFieldsValue
({
isSubmit
:
'否'
,
docycle
:
'一周一次'
,
feedbackRule
:
''
});
getGetTaskSyncField
();
setType1
(
''
);
setType2
(
''
);
...
...
@@ -184,6 +184,7 @@ const AddModal = props => {
setChee
(
''
);
form
.
resetFields
();
formAdd
.
resetFields
();
setKeepAll
([]);
setKeepTree
([]);
setKeepData
([]);
setKeep
([]);
...
...
@@ -689,7 +690,6 @@ const AddModal = props => {
newData
.
push
(
i
);
});
setKeepData
(
newData
);
debugger
;
setKeep
(
newData
);
if
(
str
)
{
// 编辑初次回显处理过滤下拉款数据
...
...
@@ -1057,24 +1057,51 @@ const AddModal = props => {
</
div
>
</
Item
>
</
Col
>
<
Col
span=
{
24
}
>
<
Item
label=
"关联事件"
name=
"relationEvent"
labelCol=
{
{
span
:
5
}
}
>
<
Select
placeholder=
"选择关联事件类型
"
showSearch
onChange=
{
e
=>
onChangeEvent
(
e
)
}
allowClear
{
form
.
getFieldsValue
().
feedbackRule
!==
''
?
(
<
Col
span=
{
24
}
>
<
Item
label=
"关联事件
"
name=
"relationEvent"
labelCol=
{
{
span
:
5
}
}
rules=
{
[{
required
:
true
,
message
:
'请选择关联事件类型'
}]
}
>
{
eventData
?
eventData
.
map
((
item
,
index
)
=>
(
<
Option
key=
{
index
}
value=
{
item
}
>
{
item
}
</
Option
>
))
:
''
}
</
Select
>
</
Item
>
</
Col
>
<
Select
placeholder=
"选择关联事件类型"
showSearch
onChange=
{
e
=>
onChangeEvent
(
e
)
}
allowClear
>
{
eventData
?
eventData
.
map
((
item
,
index
)
=>
(
<
Option
key=
{
index
}
value=
{
item
}
>
{
item
}
</
Option
>
))
:
''
}
</
Select
>
</
Item
>
</
Col
>
)
:
(
<
Col
span=
{
24
}
>
<
Item
label=
"关联事件"
name=
"relationEvent"
labelCol=
{
{
span
:
5
}
}
>
<
Select
placeholder=
"选择关联事件类型"
showSearch
onChange=
{
e
=>
onChangeEvent
(
e
)
}
allowClear
>
{
eventData
?
eventData
.
map
((
item
,
index
)
=>
(
<
Option
key=
{
index
}
value=
{
item
}
>
{
item
}
</
Option
>
))
:
''
}
</
Select
>
</
Item
>
</
Col
>
)
}
<
Col
span=
{
23
}
>
<
span
style=
{
{
fontSize
:
'12px'
,
color
:
'#bfbcbc'
,
marginLeft
:
'114px'
}
}
>
当配置了关联事件后,可配置字段映射规则
...
...
@@ -1111,12 +1138,13 @@ const AddModal = props => {
{
required
:
true
,
message
:
'请填写字段名'
},
{
validator
:
(
rule
,
value
)
=>
{
let
filterValue
=
formAdd
.
getFieldsValue
().
parmars
;
let
num
=
filterValue
.
findIndex
(
i
=>
i
.
fromField
===
value
);
let
index
=
rule
.
field
.
split
(
'.'
)[
1
];
// debugger
if
(
num
!==
undefined
&&
num
!==
Number
(
index
))
{
return
Promise
.
reject
(
'字段重复'
);
if
(
value
)
{
let
filterValue
=
formAdd
.
getFieldsValue
().
parmars
;
let
num
=
filterValue
.
findIndex
(
i
=>
i
.
fromField
===
value
);
let
index
=
rule
.
field
.
split
(
'.'
)[
1
];
if
(
num
!==
undefined
&&
num
!==
Number
(
index
))
{
return
Promise
.
reject
(
'字段重复'
);
}
}
return
Promise
.
resolve
();
},
...
...
src/pages/bsmanager/patrolMaintenance/maintenance/maintenance.jsx
View file @
44706b3a
...
...
@@ -34,260 +34,45 @@ const maintenance = () => {
const
[
keepTableData
,
setKeepTableData
]
=
useState
([]);
const
[
activeName
,
setActiveName
]
=
useState
(
'template'
);
// const columns = [
// {
// title: '业务名称',
// dataIndex: 'businessName',
// key: 'businessName',
// width: 150,
// onCell: () => ({
// style: {
// maxWidth: 150,
// overflow: 'hidden',
// whiteSpace: 'nowrap',
// textOverflow: 'ellipsis',
// cursor: 'pointer',
// },
// }),
// align: 'center',
// render: record => (
// <Tooltip placement="topLeft" title={record}>
// {record}
// </Tooltip>
// ),
// },
// {
// title: '业务类型',
// dataIndex: 'businessType',
// key: 'businessType',
// width: 100,
// onCell: () => ({
// style: {
// maxWidth: 100,
// overflow: 'hidden',
// whiteSpace: 'nowrap',
// textOverflow: 'ellipsis',
// cursor: 'pointer',
// },
// }),
// align: 'center',
// render: record => (
// <Tooltip placement="topLeft" title={record}>
// {record}
// </Tooltip>
// ),
// },
// {
// title: '执行周期',
// dataIndex: 'docycle',
// key: 'docycle',
// width: 100,
// align: 'center',
// },
// {
// title: '维保设备',
// dataIndex: 'accountName',
// key: 'accountName',
// width: 200,
// onCell: () => ({
// style: {
// maxWidth: 200,
// overflow: 'hidden',
// whiteSpace: 'nowrap',
// textOverflow: 'ellipsis',
// cursor: 'pointer',
// },
// }),
// align: 'center',
// render: record => (
// <Tooltip placement="topLeft" title={record}>
// {record}
// </Tooltip>
// ),
// },
// {
// title: '反馈名称',
// dataIndex: 'feedbackName',
// key: 'feedbackName',
// onCell: () => ({
// style: {
// maxWidth: 200,
// overflow: 'hidden',
// whiteSpace: 'nowrap',
// textOverflow: 'ellipsis',
// cursor: 'pointer',
// },
// }),
// align: 'center',
// render: record => (
// <Tooltip placement="topLeft" title={record}>
// {record}
// </Tooltip>
// ),
// },
// {
// title: '执行角色',
// dataIndex: 'doRole',
// key: 'doRole',
// align: 'center',
// onCell: () => ({
// style: {
// maxWidth: 200,
// overflow: 'hidden',
// whiteSpace: 'nowrap',
// textOverflow: 'ellipsis',
// cursor: 'pointer',
// },
// }),
// render: record => (
// <Tooltip placement="topLeft" title={record}>
// {record}
// </Tooltip>
// ),
// },
// {
// title: '预生成天数',
// dataIndex: 'produceDays',
// key: 'produceDays',
// width: 90,
// align: 'center',
// onCell: () => ({
// style: {
// maxWidth: 80,
// overflow: 'hidden',
// whiteSpace: 'nowrap',
// textOverflow: 'ellipsis',
// cursor: 'pointer',
// },
// }),
// },
// {
// title: '在线任务量',
// dataIndex: 'onLines',
// key: 'onLines',
// width: 90,
// align: 'center',
// onCell: () => ({
// style: {
// maxWidth: 80,
// overflow: 'hidden',
// whiteSpace: 'nowrap',
// textOverflow: 'ellipsis',
// cursor: 'pointer',
// },
// }),
// render: record => (
// <Tooltip placement="topLeft" title={record}>
// {record}
// </Tooltip>
// ),
// },
// // {
// // title: '启停',
// // dataIndex: 'doNot',
// // key: 'doNot',
// // width: 80,
// // align: 'center',
// // },
// {
// title: '是否送审',
// dataIndex: 'isSubmit',
// key: 'isSubmit',
// width: 80,
// align: 'center',
// render: record => {
// if (record === '是') {
// return <Tag color="success">是</Tag>;
// } else {
// return <Tag color="processing">否</Tag>;
// }
// },
// },
// {
// title: '台账过滤条件',
// dataIndex: 'filterCondition',
// key: 'filterCondition',
// width: 150,
// onCell: () => ({
// style: {
// maxWidth: 150,
// overflow: 'hidden',
// whiteSpace: 'nowrap',
// textOverflow: 'ellipsis',
// cursor: 'pointer',
// },
// }),
// align: 'center',
// render: record => (
// <Tooltip placement="topLeft" title={record}>
// {record}
// </Tooltip>
// ),
// },
// {
// title: '操作',
// ellipsis: true,
// key: 'action',
// align: 'center',
// render: (text, record) => (
// <Space>
// <Tooltip title="修改">
// <EditTwoTone onClick={() => editEventType(record)} style={{ fontSize: '16px' }} />
// </Tooltip>
// <Tooltip title="删除">
// <Popconfirm
// placement="bottomRight"
// title={<p>是否确认删除?</p>}
// okText="确认"
// cancelText="取消"
// onConfirm={() => deleteEventType(record)}
// >
// <DeleteOutlined style={{ fontSize: '16px', color: '#e86060' }} />
// </Popconfirm>
// </Tooltip>
// </Space>
// ),
// },
// ];
useEffect
(()
=>
{
setTreeLoading
(
true
);
if
(
activeName
===
'template'
)
{
CM_XWBPlan_DataList
().
then
(
res
=>
{
setTreeLoading
(
false
);
if
(
res
.
msg
===
'Ok'
)
{
setTableData
(
res
.
data
);
let
list
=
[];
res
.
data
.
map
(
i
=>
{
list
.
push
(
i
.
businessName
);
});
setKeepTableData
(
list
);
}
});
getDataList
();
}
else
{
GetDeviceConfigList
().
then
(
res
=>
{
setTreeLoading
(
false
);
if
(
res
.
msg
===
'Ok'
)
{
setTableData
(
res
.
data
);
// let list = [];
// res.data.map(i => {
// list.push(i.AccountName);
// });
// setKeepTableData(list);
}
else
{
setTableData
([]);
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
res
.
msg
,
});
}
});
getConfigList
();
}
},
[
flag
,
activeName
]);
const
getDataList
=
()
=>
{
CM_XWBPlan_DataList
().
then
(
res
=>
{
setTreeLoading
(
false
);
if
(
res
.
msg
===
'Ok'
)
{
setTableData
(
res
.
data
);
let
list
=
[];
res
.
data
.
map
(
i
=>
{
list
.
push
(
i
.
businessName
);
});
setKeepTableData
(
list
);
}
});
};
const
getConfigList
=
()
=>
{
GetDeviceConfigList
().
then
(
res
=>
{
setTreeLoading
(
false
);
if
(
res
.
msg
===
'Ok'
)
{
setTableData
(
res
.
data
);
}
else
{
setTableData
([]);
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
res
.
msg
,
});
}
});
};
const
columns
=
useMemo
(()
=>
{
if
(
activeName
===
'template'
)
{
return
[
...
...
@@ -680,13 +465,13 @@ const maintenance = () => {
};
const
deleteEventType
=
record
=>
{
CM_XWBPlan_RemovePlan
({
planId
:
record
.
id
}).
then
(
res
=>
{
if
(
res
.
msg
===
''
)
{
if
(
res
.
code
===
0
)
{
notification
.
success
({
message
:
'提示'
,
duration
:
3
,
description
:
'删除成功'
,
});
setFlag
(
flag
+
1
);
getDataList
(
);
}
else
{
notification
.
error
({
message
:
'提示'
,
...
...
@@ -712,7 +497,6 @@ const maintenance = () => {
const
onOK
=
prop
=>
{
setSortVisible
(
false
);
let
aa
=
prop
.
str
.
toString
();
console
.
log
(
aa
);
CM_XWBPlan_ChangeOrder
(
aa
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
notification
.
success
({
...
...
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