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
12367ac7
Commit
12367ac7
authored
2 years ago
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
12091651
parent
0415b362
master
ems_danji
ems_zl
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
19 deletions
+91
-19
index.jsx
src/pages/repair/fault/index.jsx
+91
-19
No files found.
src/pages/repair/fault/index.jsx
View file @
12367ac7
...
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-12-07 11:19:30
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-09 16:
05:25
* @Last Modified time: 2022-12-09 16:
47:36
*/
import
*
as
React
from
'react'
;
...
...
@@ -15,7 +15,7 @@ import { useRequest } from 'ahooks';
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
InitForm
from
'@/components/InitForm'
;
import
{
ProDescriptions
}
from
'@ant-design/pro-components'
;
import
{
message
}
from
'antd'
;
const
pathconfig
=
{
enableadd
:
true
,
enableedit
:
true
,
...
...
@@ -136,6 +136,79 @@ function Fault(props) {
const
FaultName
=
(
props
)
=>
{
const
[
request
,
setrequest
]
=
useState
();
const
gzmcref
=
useRef
();
const
remove
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
pop=
{
{
title
:
'是否删除?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
async
()
=>
{
let
res
=
await
doFetch
({
url
:
'/repair/umFaultSettingDetail/deleteById'
,
params
:
{
id
:
row
.
id
},
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'删除成功!'
);
setdrawergz
((
s
)
=>
({
...
s
,
open
:
false
,
}));
actionRef
.
current
.
reload
();
}
},
}
}
btn=
{
{
size
:
'small'
,
type
:
'danger'
,
}
}
>
删除
</
PremButton
>
);
};
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
setdrawergz
((
s
)
=>
({
...
s
,
open
:
true
,
title
:
'编辑'
,
val
:
'edit'
,
detailpath
:
'/repair/umFaultSettingDetail/queryById'
,
params
:
{
id
:
row
.
id
},
onFinish
:
async
(
vals
)
=>
{
//console.log(1);
let
params
=
{
...
vals
,
faultSettingId
:
drawer
?.
item
.
id
,
id
:
row
.
id
,
};
let
res
=
await
doFetch
({
url
:
'/repair/umFaultSettingDetail/save'
,
params
,
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'编辑成功!'
);
setdrawergz
((
s
)
=>
({
...
s
,
open
:
false
,
}));
actionRef
.
current
.
reload
();
}
},
}));
},
}
}
>
编辑
</
PremButton
>
);
};
const
columns
=
useMemo
(()
=>
{
return
[
{
...
...
@@ -169,20 +242,23 @@ function Fault(props) {
valueType
:
'textarea'
,
search
:
false
,
},
{
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
),
],
},
];
},
[]);
useEffect
(()
=>
{
const
fn
=
async
()
=>
{
let
params
=
{
id
:
drawer
?.
item
?.
id
};
let
res
=
await
doFetch
({
url
:
'/repair/umFaultSetting/queryById'
,
params
});
setrequest
(
res
?.
data
.
data
);
};
fn
();
},
[]);
const
renderRef
=
useRef
(
true
);
return
(
<>
<
ProDescriptions
dataSource=
{
request
}
dataSource=
{
drawer
?.
item
}
columns=
{
[
{
title
:
'故障类型'
,
...
...
@@ -206,19 +282,14 @@ function Fault(props) {
title
:
'设备类型'
,
dataIndex
:
'equipmentTypeName'
,
key
:
'equipmentTypeId'
,
valueType
:
'treeSelect'
,
options
:
{
path
:
'/asset/equipmentType/queryTreeList'
,
params
:
{},
},
},
]
}
/>
<
AutoTable
columns=
{
columns
}
formRef=
{
gzmcref
}
path=
"/repair/umFaultSettingDetail/query
ById
"
params=
{
{
i
d
:
drawer
?.
item
.
id
}
}
path=
"/repair/umFaultSettingDetail/query
List
"
extraparams=
{
{
faultSettingI
d
:
drawer
?.
item
.
id
}
}
pageextra=
{
'add'
}
addconfig=
{
{
// access: 'sysDepartment_save',
...
...
@@ -234,7 +305,7 @@ function Fault(props) {
onFinish
:
async
(
vals
)
=>
{
let
params
=
{
...
vals
,
i
d
:
drawer
?.
item
.
id
,
faultSettingI
d
:
drawer
?.
item
.
id
,
};
let
res
=
await
doFetch
({
url
:
'/repair/umFaultSettingDetail/save'
,
...
...
@@ -296,6 +367,7 @@ function Fault(props) {
// access: 'sysDepartment_save',
btn
:
{
disabled
:
false
,
type
:
'primary'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
...
...
This diff is collapsed.
Click to expand it.
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