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
9e3ebb1d
Commit
9e3ebb1d
authored
Dec 01, 2022
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
12012048
parent
673a72b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
306 additions
and
307 deletions
+306
-307
columns.js
src/pages/repair/failure/columns.js
+147
-148
index.jsx
src/pages/repair/failure/index.jsx
+159
-159
No files found.
src/pages/repair/failure/columns.js
View file @
9e3ebb1d
function
getcolumns
(
setdrawer
)
{
function
getcolumns
(
setdrawer
)
{
return
[
return
[
{
{
"tab"
:
"已完成"
,
tab
:
'未完成'
,
"key"
:
"1"
,
key
:
'1'
,
"columns"
:
[
columns
:
[
{
{
"title"
:
"报修单号"
,
title
:
'报修单号'
,
"dataIndex"
:
"repairNo"
,
dataIndex
:
'repairNo'
,
"key"
:
"repairNo"
key
:
'repairNo'
,
},
},
{
{
"title"
:
"设备编号"
,
title
:
'设备编号'
,
"dataIndex"
:
"equipmentNo"
,
dataIndex
:
'equipmentNo'
,
"key"
:
"equipmentNo"
key
:
'equipmentNo'
,
},
},
{
{
"title"
:
"设备名称"
,
title
:
'设备名称'
,
"dataIndex"
:
"equipmentName"
,
dataIndex
:
'equipmentName'
,
"key"
:
"equipmentName"
key
:
'equipmentName'
,
},
},
{
{
"title"
:
"故障描述"
,
title
:
'故障描述'
,
"dataIndex"
:
"faultDescription"
,
dataIndex
:
'faultDescription'
,
"key"
:
"faultDescription"
,
key
:
'faultDescription'
,
"valueType"
:
"textarea"
valueType
:
'textarea'
,
},
},
{
{
"title"
:
"报修人员"
,
title
:
'报修人员'
,
"dataIndex"
:
"repairUserName"
,
dataIndex
:
'repairUserName'
,
"key"
:
"repairUserName"
key
:
'repairUserName'
,
},
},
{
{
"title"
:
"报修时间"
,
title
:
'报修时间'
,
"dataIndex"
:
"repairTimeList"
,
dataIndex
:
'repairTimeList'
,
"key"
:
"repairTimeList"
,
key
:
'repairTimeList'
,
"valueType"
:
"dateTimeRange"
valueType
:
'dateTimeRange'
,
},
},
{
{
"title"
:
"维修单号"
,
title
:
'维修单号'
,
"dataIndex"
:
"repairOrderNo"
,
dataIndex
:
'repairOrderNo'
,
"key"
:
"repairOrderNo"
key
:
'repairOrderNo'
,
},
},
{
{
"title"
:
"工单状态"
,
title
:
'工单状态'
,
"dataIndex"
:
"statusName"
,
dataIndex
:
'statusName'
,
"key"
:
"status"
,
key
:
'status'
,
"valueType"
:
"radio"
,
valueType
:
'radio'
,
"options"
:
[
options
:
[
{
{
"label"
:
"待维修"
,
label
:
'待维修'
,
"value"
:
"1"
value
:
'1'
,
},
},
{
{
"label"
:
"维修中"
,
label
:
'维修中'
,
"value"
:
"2"
value
:
'2'
,
}
},
]
],
}
},
],
],
"pathconfig"
:
{
pathconfig
:
{
"enableadd"
:
true
,
enableadd
:
true
,
"enableedit"
:
false
,
enableedit
:
false
,
"enabledelete"
:
true
,
enabledelete
:
true
,
"enabledetail"
:
false
,
enabledetail
:
false
,
"add"
:
""
,
add
:
''
,
"edit"
:
""
,
edit
:
''
,
"list"
:
""
,
list
:
'/repair/umFailureRepair/queryNoFinishList'
,
"delete"
:
""
,
delete
:
''
,
"detail"
:
""
detail
:
''
,
}
},
},
},
{
{
"tab"
:
"已完成"
,
tab
:
'已完成'
,
"key"
:
"2"
,
key
:
'2'
,
"columns"
:
[
columns
:
[
{
{
"title"
:
"报修单号"
,
title
:
'报修单号'
,
"dataIndex"
:
"repairNo"
,
dataIndex
:
'repairNo'
,
"key"
:
"repairNo"
key
:
'repairNo'
,
},
},
{
{
"title"
:
"设备编号"
,
title
:
'设备编号'
,
"dataIndex"
:
"equipmentNo"
,
dataIndex
:
'equipmentNo'
,
"key"
:
"equipmentNo"
key
:
'equipmentNo'
,
},
},
{
{
"title"
:
"设备名称"
,
title
:
'设备名称'
,
"dataIndex"
:
"equipmentName"
,
dataIndex
:
'equipmentName'
,
"key"
:
"equipmentName"
key
:
'equipmentName'
,
},
},
{
{
"title"
:
"故障描述"
,
title
:
'故障描述'
,
"dataIndex"
:
"faultDescription"
,
dataIndex
:
'faultDescription'
,
"key"
:
"faultDescription"
key
:
'faultDescription'
,
},
},
{
{
"title"
:
"报修人员"
,
title
:
'报修人员'
,
"dataIndex"
:
"repairUserName"
,
dataIndex
:
'repairUserName'
,
"key"
:
"repairUserName"
key
:
'repairUserName'
,
},
},
{
{
"title"
:
"报修时间"
,
title
:
'报修时间'
,
"dataIndex"
:
"repairTime"
,
dataIndex
:
'repairTime'
,
"key"
:
"repairTime"
key
:
'repairTime'
,
},
},
{
{
"title"
:
"关单时间"
,
title
:
'关单时间'
,
"dataIndex"
:
"repairCloseTime"
,
dataIndex
:
'repairCloseTime'
,
"key"
:
"repairCloseTime"
key
:
'repairCloseTime'
,
},
},
{
{
"title"
:
"维修单号"
,
title
:
'维修单号'
,
"dataIndex"
:
"repairOrderNo"
,
dataIndex
:
'repairOrderNo'
,
"key"
:
"repairOrderNo"
key
:
'repairOrderNo'
,
},
},
{
{
"title"
:
"工单状态"
,
title
:
'工单状态'
,
"dataIndex"
:
"statusName"
,
dataIndex
:
'statusName'
,
"key"
:
"status"
,
key
:
'status'
,
"valueType"
:
"radio"
,
valueType
:
'radio'
,
"options"
:
[
options
:
[
{
{
"label"
:
"待维修"
,
label
:
'待维修'
,
"value"
:
"1"
value
:
'1'
,
},
},
{
{
"label"
:
"维修中"
,
label
:
'维修中'
,
"value"
:
"2"
value
:
'2'
,
}
},
]
],
}
},
],
],
"pathconfig"
:
{
pathconfig
:
{
"enableadd"
:
true
,
enableadd
:
true
,
"enableedit"
:
true
,
enableedit
:
true
,
"enabledelete"
:
true
,
enabledelete
:
true
,
"enabledetail"
:
true
,
enabledetail
:
true
,
"add"
:
""
,
add
:
''
,
"edit"
:
""
,
edit
:
''
,
"list"
:
""
,
list
:
'/repair/umFailureRepair/queryFinishList'
,
"delete"
:
""
,
delete
:
''
,
"detail"
:
""
detail
:
''
,
}
},
}
},
];
];
}
}
export
default
getcolumns
;
export
default
getcolumns
;
\ No newline at end of file
src/pages/repair/failure/index.jsx
View file @
9e3ebb1d
import
*
as
React
from
'react'
;
import
*
as
React
from
'react'
;
import
{
useState
,
useMemo
,
useRef
}
from
'react'
;
import
{
useState
,
useMemo
,
useRef
}
from
'react'
;
import
DrawerPro
from
'@/components/DrawerPro'
;
import
DrawerPro
from
'@/components/DrawerPro'
;
import
AutoTable
from
'@/components/AutoTable'
;
import
AutoTable
from
'@/components/AutoTable'
;
import
PremButton
from
'@/components/PremButton'
;
import
PremButton
from
'@/components/PremButton'
;
import
getcolumns
from
'./columns'
;
import
getcolumns
from
'./columns'
;
import
{
useRequest
}
from
'ahooks'
;
import
{
useRequest
}
from
'ahooks'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
function
Failure
(
props
)
{
function
Failure
(
props
)
{
const
actionRef
=
useRef
(),
const
actionRef
=
useRef
(),
formRef
=
useRef
();
formRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
const
[
drawer
,
setdrawer
]
=
useState
({
open
:
false
,
}),
[
activeTabKey
,
setactiveTabKey
]
=
useState
(
'1'
);
const
{
run
,
loading
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
onSuccess
:
(
res
,
params
)
=>
{
if
(
res
?.
code
==
'0000'
)
{
actionRef
?.
current
?.
reload
();
setdrawer
((
s
)
=>
({
...
s
,
open
:
false
,
open
:
false
,
}),
}));
[
activeTabKey
,
setactiveTabKey
]
=
useState
(
'1'
);
}
},
});
const
{
run
,
loading
}
=
useRequest
(
doFetch
,
{
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
manual
:
true
,
return
(
onSuccess
:
(
res
,
params
)
=>
{
<
PremButton
if
(
res
?.
code
==
'0000'
)
{
btn=
{
{
actionRef
?.
current
?.
reload
();
size
:
'small'
,
type
:
'link'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
setdrawer
((
s
)
=>
({
...
s
,
...
s
,
open
:
false
,
open
:
true
,
item
:
row
,
title
:
'详情'
,
val
:
'detail'
,
title
:
'详细信息'
,
}));
}));
}
},
},
}
}
});
>
详情
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
</
PremButton
>
return
(
);
<
PremButton
};
btn=
{
{
size
:
'small'
,
type
:
'link'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
row
,
title
:
'详情'
,
val
:
'detail'
,
title
:
'详细信息'
,
}));
},
}
}
>
详情
</
PremButton
>
);
};
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
return
(
<
PremButton
<
PremButton
btn=
{
{
btn=
{
{
size
:
'small'
,
size
:
'small'
,
onClick
:
()
=>
{
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
setdrawer
((
s
)
=>
({
...
s
,
...
s
,
open
:
true
,
open
:
true
,
item
:
row
,
item
:
row
,
title
:
'编辑'
,
title
:
'编辑'
,
val
:
'edit'
,
val
:
'edit'
,
}));
}));
},
},
}
}
}
}
>
>
编辑
编辑
</
PremButton
>
</
PremButton
>
);
);
};
};
const
remove
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
pop=
{
{
title
:
'是否删除?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
()
=>
{
run
({
url
:
pathconfig
?.
delete
||
'/delete'
,
params
:
{
id
:
row
?.
id
}
});
},
}
}
btn=
{
{
size
:
'small'
,
type
:
'danger'
,
}
}
>
删除
</
PremButton
>
);
};
const
columns
=
useMemo
(()
=>
{
const
remove
=
(
text
,
row
,
_
,
action
)
=>
{
let
defcolumn
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
columns
;
return
(
let
defpath
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
pathconfig
??
{};
<
PremButton
return
defcolumn
.
concat
({
pop=
{
{
title
:
'操作'
,
title
:
'是否删除?'
,
valueType
:
'option'
,
okText
:
'确认'
,
width
:
150
,
cancelText
:
'取消'
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
onConfirm
:
()
=>
{
defpath
?.
enabledetail
&&
detail
(
text
,
row
,
_
,
action
),
run
({
url
:
pathconfig
?.
delete
||
'/delete'
,
params
:
{
id
:
row
?.
id
}
});
defpath
?.
enableedit
&&
edit
(
text
,
row
,
_
,
action
),
},
defpath
?.
enabledelete
&&
remove
(
text
,
row
,
_
,
action
),
}
}
],
btn=
{
{
});
size
:
'small'
,
},
[
activeTabKey
]);
type
:
'danger'
,
}
}
>
删除
</
PremButton
>
);
};
const
pathconfig
=
useMemo
(()
=>
{
const
columns
=
useMemo
(()
=>
{
let
defpath
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
pathconfig
??
{};
let
defcolumn
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
columns
;
return
defpath
;
let
defpath
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
pathconfig
??
{};
},
[
activeTabKey
]);
return
defcolumn
.
concat
({
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
defpath
?.
enabledetail
&&
detail
(
text
,
row
,
_
,
action
),
defpath
?.
enableedit
&&
edit
(
text
,
row
,
_
,
action
),
defpath
?.
enabledelete
&&
remove
(
text
,
row
,
_
,
action
),
],
});
},
[
activeTabKey
]);
return
(
const
pathconfig
=
useMemo
(()
=>
{
<
div
style=
{
{
position
:
'relative'
}
}
>
let
defpath
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
pathconfig
??
{};
<
AutoTable
return
defpath
;
pagetitle=
"故障报修"
},
[
activeTabKey
]);
columns=
{
columns
}
path=
{
pathconfig
?.
list
||
'/ngic-auth/sysUser/query/page'
}
actionRef=
{
actionRef
}
pageextra=
{
pathconfig
?.
enableadd
?
'add'
:
null
}
resizeable=
{
true
}
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
disabled
:
false
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
null
,
title
:
'新增'
,
val
:
'add'
,
}));
},
},
}
}
tabList=
{
getcolumns
()
}
activeTabKey=
{
activeTabKey
}
onTabChange=
{
(
key
)
=>
{
setactiveTabKey
(
key
);
}
}
/>
<
DrawerPro
return
(
fields=
{
columns
}
<
div
style=
{
{
position
:
'relative'
}
}
>
detailpath=
{
pathconfig
?.
detail
||
null
}
<
AutoTable
detailData=
{
drawer
?.
item
}
pagetitle=
{
<
h3
className=
"page-title"
>
故障报修
</
h3
>
}
defaultFormValue=
{
drawer
?.
item
}
columns=
{
columns
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
path=
{
pathconfig
?.
list
||
'/ngic-auth/sysUser/query/page'
}
formRef=
{
formRef
}
actionRef=
{
actionRef
}
placement=
"right"
pageextra=
{
pathconfig
?.
enableadd
?
'add'
:
null
}
onClose=
{
()
=>
{
resizeable=
{
true
}
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
disabled
:
false
,
type
:
'primary'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
setdrawer
((
s
)
=>
({
...
s
,
...
s
,
open
:
false
,
open
:
true
,
item
:
null
,
title
:
'新增'
,
val
:
'add'
,
}));
}));
}
}
},
{
...
drawer
}
},
onFinish=
{
(
vals
)
=>
{
}
}
if
(
drawer
?.
val
==
'add'
)
{
tabList=
{
getcolumns
()
}
run
({
url
:
pathconfig
?.
add
||
'/add'
,
params
:
{
...
vals
}
});
activeTabKey=
{
activeTabKey
}
}
else
if
(
drawer
?.
val
==
'edit'
)
{
onTabChange=
{
(
key
)
=>
{
run
({
url
:
pathconfig
?.
edit
||
'/edit'
,
params
:
{
...
vals
,
id
:
drawer
?.
item
?.
id
}
});
setactiveTabKey
(
key
);
}
}
}
}
}
/>
/>
</
div
>
<
DrawerPro
);
fields=
{
columns
}
}
detailpath=
{
pathconfig
?.
detail
||
null
}
detailData=
{
drawer
?.
item
}
defaultFormValue=
{
drawer
?.
item
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
formRef=
{
formRef
}
placement=
"right"
onClose=
{
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
false
,
}));
}
}
{
...
drawer
}
onFinish=
{
(
vals
)
=>
{
if
(
drawer
?.
val
==
'add'
)
{
run
({
url
:
pathconfig
?.
add
||
'/add'
,
params
:
{
...
vals
}
});
}
else
if
(
drawer
?.
val
==
'edit'
)
{
run
({
url
:
pathconfig
?.
edit
||
'/edit'
,
params
:
{
...
vals
,
id
:
drawer
?.
item
?.
id
}
});
}
}
}
/>
</
div
>
);
}
export
default
Failure
;
export
default
Failure
;
\ No newline at end of file
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