Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ems3.3
Project
Project
Details
Activity
Releases
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
wuhao
ems3.3
Commits
726f66a3
Commit
726f66a3
authored
Jan 18, 2023
by
左玲玲
😬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0921
parent
53462862
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
70 deletions
+69
-70
index.jsx
src/components/InitForm/EditTable/index.jsx
+1
-0
index.jsx
src/pages/maintain/plan/index.jsx
+68
-70
No files found.
src/components/InitForm/EditTable/index.jsx
View file @
726f66a3
...
...
@@ -164,6 +164,7 @@ const EditTable = (props) => {
}
}
search=
{
{
filterType
:
'light'
,
//轻量模式
placement
:
'bottomLeft'
}
}
/>
);
...
...
src/pages/maintain/plan/index.jsx
View file @
726f66a3
...
...
@@ -21,8 +21,8 @@ function Plan(props) {
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
open
:
false
,
}),
open
:
false
,
}),
[
activeTabKey
,
setactiveTabKey
]
=
useState
(
'1'
);
const
{
run
,
loading
,
runAsync
}
=
useRequest
(
doFetch
,
{
...
...
@@ -460,43 +460,32 @@ function Plan(props) {
let
defpath
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
pathconfig
??
{};
return
activeTabKey
==
1
?
defcolumn
.
concat
([
{
title
:
'启用/停用'
,
dataIndex
:
'isStopStatus'
,
key
:
'isStopStatus'
,
hideInForm
:
true
,
hideInSearch
:
true
,
valueType
:
'switch'
,
render
:
(
text
,
row
,
_
,
action
)
=>
{
//"1停用 2启用 *"
return
row
.
isStopStatus
==
1
?
(
<
Popconfirm
title=
"是否开启或停用?"
onConfirm=
{
async
()
=>
{
if
(
row
.
isStopStatus
==
1
)
{
await
runAsync
({
url
:
'/maintain/umMaintainPlan/enableDeactivate'
,
params
:
{
id
:
row
.
id
,
isStopFlag
:
2
},
});
}
}
}
okText=
"确定"
cancelText=
"取消"
disabled=
{
!
(
row
.
maintainStatus
==
1
||
(
row
.
maintainStatus
==
2
&&
row
.
isCycle
==
2
))
{
title
:
'启用/停用'
,
dataIndex
:
'isStopStatus'
,
key
:
'isStopStatus'
,
hideInForm
:
true
,
hideInSearch
:
true
,
valueType
:
'switch'
,
render
:
(
text
,
row
,
_
,
action
)
=>
{
//"1停用 2启用 *"
return
row
.
isStopStatus
==
1
?
(
<
Popconfirm
title=
"是否开启或停用?"
onConfirm=
{
async
()
=>
{
if
(
row
.
isStopStatus
==
1
)
{
await
runAsync
({
url
:
'/maintain/umMaintainPlan/enableDeactivate'
,
params
:
{
id
:
row
.
id
,
isStopFlag
:
2
},
});
}
>
<
Switch
checked=
{
row
.
isStopStatus
==
1
?
true
:
false
}
checkedChildren=
"开启"
unCheckedChildren=
"停用"
defaultChecked=
{
false
}
disabled=
{
!
(
row
.
maintainStatus
==
1
||
(
row
.
maintainStatus
==
2
&&
row
.
isCycle
==
2
))
}
/>
</
Popconfirm
>
)
:
(
}
}
okText=
"确定"
cancelText=
"取消"
disabled=
{
!
(
row
.
maintainStatus
==
1
||
(
row
.
maintainStatus
==
2
&&
row
.
isCycle
==
2
))
}
>
<
Switch
checked=
{
row
.
isStopStatus
==
1
?
true
:
false
}
checkedChildren=
"开启"
...
...
@@ -505,36 +494,47 @@ function Plan(props) {
disabled=
{
!
(
row
.
maintainStatus
==
1
||
(
row
.
maintainStatus
==
2
&&
row
.
isCycle
==
2
))
}
onChange=
{
(
checked
)
=>
{
if
(
checked
)
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
row
,
title
:
'调整日期'
,
val
:
'detailaddon'
,
id
:
row
?.
id
,
from
:
'tq'
,
}));
}
}
}
/>
);
},
hideInDescriptions
:
true
,
},
{
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
(
row
.
maintainStatus
==
1
||
(
row
.
maintainStatus
==
2
&&
row
.
isCycle
==
2
))
&&
editDate
(
text
,
row
,
_
,
action
),
row
.
maintainStatus
==
2
&&
close
(
text
,
row
,
_
,
action
),
defpath
?.
enabledelete
&&
row
.
maintainStatus
==
1
&&
remove
(
text
,
row
,
_
,
action
),
],
</
Popconfirm
>
)
:
(
<
Switch
checked=
{
row
.
isStopStatus
==
1
?
true
:
false
}
checkedChildren=
"开启"
unCheckedChildren=
"停用"
defaultChecked=
{
false
}
disabled=
{
!
(
row
.
maintainStatus
==
1
||
(
row
.
maintainStatus
==
2
&&
row
.
isCycle
==
2
))
}
onChange=
{
(
checked
)
=>
{
if
(
checked
)
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
row
,
title
:
'调整日期'
,
val
:
'detailaddon'
,
id
:
row
?.
id
,
from
:
'tq'
,
}));
}
}
}
/>
);
},
])
hideInDescriptions
:
true
,
},
{
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
(
row
.
maintainStatus
==
1
||
(
row
.
maintainStatus
==
2
&&
row
.
isCycle
==
2
))
&&
editDate
(
text
,
row
,
_
,
action
),
row
.
maintainStatus
==
2
&&
close
(
text
,
row
,
_
,
action
),
defpath
?.
enabledelete
&&
row
.
maintainStatus
==
1
&&
remove
(
text
,
row
,
_
,
action
),
],
},
])
:
defcolumn
;
},
[
activeTabKey
]);
...
...
@@ -579,8 +579,8 @@ function Plan(props) {
drawer
?.
val
==
'detailaddon'
?
editDateColumns
:
drawer
?.
val
==
'detail'
?
detailsColumns
:
columns
?
detailsColumns
:
columns
}
detailpath=
{
pathconfig
?.
detail
||
null
}
// detailData={drawer?.item}
...
...
@@ -596,7 +596,6 @@ function Plan(props) {
}
}
{
...
drawer
}
onFinish=
{
async
(
vals
)
=>
{
console
.
log
(
vals
);
let
params
=
JSON
.
parse
(
JSON
.
stringify
(
vals
));
params
.
equipmentList
=
vals
?.
paramList
?.
map
((
it
)
=>
{
return
{
...
...
@@ -610,7 +609,6 @@ function Plan(props) {
message
.
warning
(
'下次保养日期必填!'
);
return
;
}
console
.
log
(
params
);
if
(
drawer
?.
val
==
'add'
)
{
await
runAsync
({
url
:
pathconfig
?.
add
||
'/add'
,
params
:
{
...
params
}
});
}
else
if
(
drawer
?.
val
==
'edit'
)
{
...
...
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