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
Dec 09, 2022
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
12091651
parent
0415b362
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 @@
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Author: Li Hanlin
* @Date: 2022-12-07 11:19:30
* @Date: 2022-12-07 11:19:30
* @Last Modified by: Li Hanlin
* @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'
;
import
*
as
React
from
'react'
;
...
@@ -15,7 +15,7 @@ import { useRequest } from 'ahooks';
...
@@ -15,7 +15,7 @@ import { useRequest } from 'ahooks';
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
InitForm
from
'@/components/InitForm'
;
import
InitForm
from
'@/components/InitForm'
;
import
{
ProDescriptions
}
from
'@ant-design/pro-components'
;
import
{
ProDescriptions
}
from
'@ant-design/pro-components'
;
import
{
message
}
from
'antd'
;
const
pathconfig
=
{
const
pathconfig
=
{
enableadd
:
true
,
enableadd
:
true
,
enableedit
:
true
,
enableedit
:
true
,
...
@@ -136,6 +136,79 @@ function Fault(props) {
...
@@ -136,6 +136,79 @@ function Fault(props) {
const
FaultName
=
(
props
)
=>
{
const
FaultName
=
(
props
)
=>
{
const
[
request
,
setrequest
]
=
useState
();
const
[
request
,
setrequest
]
=
useState
();
const
gzmcref
=
useRef
();
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
(()
=>
{
const
columns
=
useMemo
(()
=>
{
return
[
return
[
{
{
...
@@ -169,20 +242,23 @@ function Fault(props) {
...
@@ -169,20 +242,23 @@ function Fault(props) {
valueType
:
'textarea'
,
valueType
:
'textarea'
,
search
:
false
,
search
:
false
,
},
},
{
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
),
],
},
];
];
},
[]);
},
[]);
useEffect
(()
=>
{
const
renderRef
=
useRef
(
true
);
const
fn
=
async
()
=>
{
let
params
=
{
id
:
drawer
?.
item
?.
id
};
let
res
=
await
doFetch
({
url
:
'/repair/umFaultSetting/queryById'
,
params
});
setrequest
(
res
?.
data
.
data
);
};
fn
();
},
[]);
return
(
return
(
<>
<>
<
ProDescriptions
<
ProDescriptions
dataSource=
{
request
}
dataSource=
{
drawer
?.
item
}
columns=
{
[
columns=
{
[
{
{
title
:
'故障类型'
,
title
:
'故障类型'
,
...
@@ -206,19 +282,14 @@ function Fault(props) {
...
@@ -206,19 +282,14 @@ function Fault(props) {
title
:
'设备类型'
,
title
:
'设备类型'
,
dataIndex
:
'equipmentTypeName'
,
dataIndex
:
'equipmentTypeName'
,
key
:
'equipmentTypeId'
,
key
:
'equipmentTypeId'
,
valueType
:
'treeSelect'
,
options
:
{
path
:
'/asset/equipmentType/queryTreeList'
,
params
:
{},
},
},
},
]
}
]
}
/>
/>
<
AutoTable
<
AutoTable
columns=
{
columns
}
columns=
{
columns
}
formRef=
{
gzmcref
}
formRef=
{
gzmcref
}
path=
"/repair/umFaultSettingDetail/query
ById
"
path=
"/repair/umFaultSettingDetail/query
List
"
params=
{
{
i
d
:
drawer
?.
item
.
id
}
}
extraparams=
{
{
faultSettingI
d
:
drawer
?.
item
.
id
}
}
pageextra=
{
'add'
}
pageextra=
{
'add'
}
addconfig=
{
{
addconfig=
{
{
// access: 'sysDepartment_save',
// access: 'sysDepartment_save',
...
@@ -234,7 +305,7 @@ function Fault(props) {
...
@@ -234,7 +305,7 @@ function Fault(props) {
onFinish
:
async
(
vals
)
=>
{
onFinish
:
async
(
vals
)
=>
{
let
params
=
{
let
params
=
{
...
vals
,
...
vals
,
i
d
:
drawer
?.
item
.
id
,
faultSettingI
d
:
drawer
?.
item
.
id
,
};
};
let
res
=
await
doFetch
({
let
res
=
await
doFetch
({
url
:
'/repair/umFaultSettingDetail/save'
,
url
:
'/repair/umFaultSettingDetail/save'
,
...
@@ -296,6 +367,7 @@ function Fault(props) {
...
@@ -296,6 +367,7 @@ function Fault(props) {
// access: 'sysDepartment_save',
// access: 'sysDepartment_save',
btn
:
{
btn
:
{
disabled
:
false
,
disabled
:
false
,
type
:
'primary'
,
onClick
:
()
=>
{
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
setdrawer
((
s
)
=>
({
...
s
,
...
s
,
...
...
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