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
d811e2b4
Commit
d811e2b4
authored
Dec 01, 2022
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asder
parent
8e4441b6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
230 additions
and
141 deletions
+230
-141
authRoutes.js
config/authRoutes.js
+18
-0
index.jsx
src/pages/repair/order/index.jsx
+51
-15
index.jsx
src/pages/repair/outsourcing/index.jsx
+0
-3
index.jsx
src/pages/repair/track/index.jsx
+161
-123
No files found.
config/authRoutes.js
View file @
d811e2b4
...
@@ -96,6 +96,24 @@ export default [
...
@@ -96,6 +96,24 @@ export default [
"path"
:
"/repair/fault"
,
"path"
:
"/repair/fault"
,
"icon"
:
""
,
"icon"
:
""
,
"component"
:
"./repair/fault"
"component"
:
"./repair/fault"
},
{
"name"
:
"外协工单"
,
"path"
:
"/repair/outsourcing"
,
"icon"
:
""
,
"component"
:
"./repair/outsourcing"
},
{
"name"
:
"维修工单"
,
"path"
:
"/repair/order"
,
"icon"
:
""
,
"component"
:
"./repair/order"
},
{
"name"
:
"追踪工单"
,
"path"
:
"/repair/track"
,
"icon"
:
""
,
"component"
:
"./repair/track"
}
}
]
]
},
},
...
...
src/pages/repair/order/index.jsx
View file @
d811e2b4
...
@@ -4,12 +4,39 @@ import DrawerPro from '@/components/DrawerPro';
...
@@ -4,12 +4,39 @@ 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
{
doFetch
}
from
'@/utils/doFetch'
;
const
pathconfig
=
{
enableadd
:
true
,
enableedit
:
true
,
enabledelete
:
true
,
enabledetail
:
true
,
add
:
''
,
edit
:
''
,
list
:
''
,
delete
:
''
,
detail
:
''
,
};
function
Order
(
props
)
{
function
Order
(
props
)
{
const
actionRef
=
useRef
(),
const
actionRef
=
useRef
(),
formRef
=
useRef
();
formRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
const
[
drawer
,
setdrawer
]
=
useState
({
visible
:
false
,
open
:
false
,
});
const
{
run
,
loading
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
onSuccess
:
(
res
,
params
)
=>
{
if
(
res
?.
code
==
'0000'
)
{
actionRef
?.
current
?.
reload
();
setdrawer
((
s
)
=>
({
...
s
,
open
:
false
,
}));
}
},
});
});
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
...
@@ -21,11 +48,11 @@ function Order(props) {
...
@@ -21,11 +48,11 @@ function Order(props) {
onClick
:
()
=>
{
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
setdrawer
((
s
)
=>
({
...
s
,
...
s
,
visible
:
true
,
open
:
true
,
item
:
row
,
item
:
row
,
title
:
'详情'
,
title
:
'详情'
,
val
:
'detail'
,
val
:
'detail'
,
title
:
row
.
userName
+
'的
详细信息'
,
title
:
'
详细信息'
,
}));
}));
},
},
}
}
}
}
...
@@ -43,7 +70,7 @@ function Order(props) {
...
@@ -43,7 +70,7 @@ function Order(props) {
onClick
:
()
=>
{
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
setdrawer
((
s
)
=>
({
...
s
,
...
s
,
visible
:
true
,
open
:
true
,
item
:
row
,
item
:
row
,
title
:
'编辑'
,
title
:
'编辑'
,
val
:
'edit'
,
val
:
'edit'
,
...
@@ -60,11 +87,11 @@ function Order(props) {
...
@@ -60,11 +87,11 @@ function Order(props) {
return
(
return
(
<
PremButton
<
PremButton
pop=
{
{
pop=
{
{
title
:
'是否删除
该用户
?'
,
title
:
'是否删除?'
,
okText
:
'确认'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
cancelText
:
'取消'
,
onConfirm
:
()
=>
{
onConfirm
:
()
=>
{
alert
(
0
);
run
({
url
:
pathconfig
?.
delete
||
'/delete'
,
params
:
{
id
:
row
?.
id
}
}
);
},
},
}
}
}
}
btn=
{
{
btn=
{
{
...
@@ -84,9 +111,9 @@ function Order(props) {
...
@@ -84,9 +111,9 @@ function Order(props) {
valueType
:
'option'
,
valueType
:
'option'
,
width
:
150
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
render
:
(
text
,
row
,
_
,
action
)
=>
[
detail
(
text
,
row
,
_
,
action
),
pathconfig
?.
enabledetail
&&
detail
(
text
,
row
,
_
,
action
),
edit
(
text
,
row
,
_
,
action
),
pathconfig
?.
enableedit
&&
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
),
pathconfig
?.
enabledelete
&&
remove
(
text
,
row
,
_
,
action
),
],
],
});
});
},
[]);
},
[]);
...
@@ -96,9 +123,9 @@ function Order(props) {
...
@@ -96,9 +123,9 @@ function Order(props) {
<
AutoTable
<
AutoTable
pagetitle=
"维修工单"
pagetitle=
"维修工单"
columns=
{
columns
}
columns=
{
columns
}
path=
"/ngic-auth/sysUser/query/page"
actionRef=
{
actionRef
}
actionRef=
{
actionRef
}
pageextra=
{
'add'
}
path=
{
pathconfig
?.
list
||
'/ngic-auth/sysUser/query/page'
}
pageextra=
{
pathconfig
?.
enableadd
?
'add'
:
null
}
resizeable=
{
true
}
resizeable=
{
true
}
addconfig=
{
{
addconfig=
{
{
// access: 'sysDepartment_save',
// access: 'sysDepartment_save',
...
@@ -107,7 +134,7 @@ function Order(props) {
...
@@ -107,7 +134,7 @@ function Order(props) {
onClick
:
()
=>
{
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
setdrawer
((
s
)
=>
({
...
s
,
...
s
,
visible
:
true
,
open
:
true
,
item
:
null
,
item
:
null
,
title
:
'新增'
,
title
:
'新增'
,
val
:
'add'
,
val
:
'add'
,
...
@@ -119,20 +146,29 @@ function Order(props) {
...
@@ -119,20 +146,29 @@ function Order(props) {
<
DrawerPro
<
DrawerPro
fields=
{
columns
}
fields=
{
columns
}
detailpath=
"/ngic-auth/sysUser/query/detail"
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
formRef=
{
formRef
}
formRef=
{
formRef
}
placement=
"right"
placement=
"right"
detailpath=
{
pathconfig
?.
detail
||
null
}
detailData=
{
drawer
?.
item
}
defaultFormValue=
{
drawer
?.
item
}
onClose=
{
()
=>
{
onClose=
{
()
=>
{
setdrawer
((
s
)
=>
({
setdrawer
((
s
)
=>
({
...
s
,
...
s
,
visible
:
false
,
open
:
false
,
}));
}));
}
}
}
}
{
...
drawer
}
{
...
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
>
</
div
>
);
);
}
}
export
default
Order
;
export
default
Order
;
\ No newline at end of file
src/pages/repair/outsourcing/index.jsx
View file @
d811e2b4
...
@@ -64,7 +64,6 @@ function Outsourcing(props) {
...
@@ -64,7 +64,6 @@ function Outsourcing(props) {
okText
:
'确认'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
cancelText
:
'取消'
,
onConfirm
:
()
=>
{
onConfirm
:
()
=>
{
alert
(
0
);
},
},
}
}
}
}
btn=
{
{
btn=
{
{
...
@@ -96,7 +95,6 @@ function Outsourcing(props) {
...
@@ -96,7 +95,6 @@ function Outsourcing(props) {
<
AutoTable
<
AutoTable
pagetitle=
"外协工单"
pagetitle=
"外协工单"
columns=
{
columns
}
columns=
{
columns
}
path=
"/ngic-auth/sysUser/query/page"
actionRef=
{
actionRef
}
actionRef=
{
actionRef
}
pageextra=
{
'add'
}
pageextra=
{
'add'
}
resizeable=
{
true
}
resizeable=
{
true
}
...
@@ -119,7 +117,6 @@ function Outsourcing(props) {
...
@@ -119,7 +117,6 @@ function Outsourcing(props) {
<
DrawerPro
<
DrawerPro
fields=
{
columns
}
fields=
{
columns
}
detailpath=
"/ngic-auth/sysUser/query/detail"
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
formRef=
{
formRef
}
formRef=
{
formRef
}
placement=
"right"
placement=
"right"
...
...
src/pages/repair/track/index.jsx
View file @
d811e2b4
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
{
doFetch
}
from
'@/utils/doFetch'
;
function
Track
(
props
)
{
const
pathconfig
=
{
const
actionRef
=
useRef
(),
"enableadd"
:
true
,
formRef
=
useRef
();
"enableedit"
:
true
,
const
[
drawer
,
setdrawer
]
=
useState
({
"enabledelete"
:
true
,
visible
:
false
,
"enabledetail"
:
true
,
});
"add"
:
""
,
"edit"
:
""
,
"list"
:
""
,
"delete"
:
""
,
"detail"
:
""
};
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
function
Track
(
props
)
{
return
(
const
actionRef
=
useRef
(),
<
PremButton
formRef
=
useRef
();
btn=
{
{
const
[
drawer
,
setdrawer
]
=
useState
({
size
:
'small'
,
open
:
false
,
type
:
'link'
,
});
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
title
:
'详情'
,
val
:
'detail'
,
title
:
row
.
userName
+
'的详细信息'
,
}));
},
}
}
>
详情
</
PremButton
>
);
};
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
title
:
'编辑'
,
val
:
'edit'
,
}));
},
}
}
>
编辑
</
PremButton
>
);
};
const
remove
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
pop=
{
{
title
:
'是否删除该用户?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
()
=>
{
alert
(
0
);
},
}
}
btn=
{
{
size
:
'small'
,
type
:
'danger'
,
}
}
>
删除
</
PremButton
>
);
};
const
columns
=
useMemo
(()
=>
{
const
{
run
,
loading
}
=
useRequest
(
doFetch
,
{
let
defcolumn
=
getcolumns
(
setdrawer
);
manual
:
true
,
return
defcolumn
.
concat
(
{
onSuccess
:
(
res
,
params
)
=>
{
title
:
'操作'
,
if
(
res
?.
code
==
'0000'
)
{
valueType
:
'option'
,
actionRef
?.
current
?.
reload
();
width
:
150
,
setdrawer
((
s
)
=>
({
render
:
(
text
,
row
,
_
,
action
)
=>
[
...
s
,
detail
(
text
,
row
,
_
,
action
)
,
open
:
false
,
edit
(
text
,
row
,
_
,
action
),
}));
remove
(
text
,
row
,
_
,
action
),
}
]
,
}
,
});
});
},
[]);
return
(
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
<
div
style=
{
{
position
:
'relative'
}
}
>
return
(
<
AutoTable
<
PremButton
pagetitle=
"追踪工单"
btn=
{
{
columns=
{
columns
}
size
:
'small'
,
path=
"/ngic-auth/sysUser/query/page"
type
:
'link'
,
actionRef=
{
actionRef
}
pageextra=
{
'add'
}
resizeable=
{
true
}
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
disabled
:
false
,
onClick
:
()
=>
{
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
setdrawer
((
s
)
=>
({
...
s
,
...
s
,
visible
:
true
,
open
:
true
,
item
:
null
,
item
:
row
,
title
:
'新增'
,
title
:
'详情'
,
val
:
'add'
,
val
:
'detail'
,
title
:
'详细信息'
,
}));
}));
},
},
},
}
}
}
}
>
/>
详情
</
PremButton
>
);
};
<
DrawerPro
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
fields=
{
columns
}
return
(
formRef=
{
formRef
}
<
PremButton
placement=
"right"
btn=
{
{
onClose=
{
()
=>
{
size
:
'small'
,
setdrawer
((
s
)
=>
({
onClick
:
()
=>
{
...
s
,
setdrawer
((
s
)
=>
({
visible
:
false
,
...
s
,
}));
open
:
true
,
}
}
item
:
row
,
{
...
drawer
}
title
:
'编辑'
,
/>
val
:
'edit'
,
</
div
>
}));
);
},
}
}
}
>
编辑
</
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
(()
=>
{
let
defcolumn
=
getcolumns
(
setdrawer
);
return
defcolumn
.
concat
({
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
pathconfig
?.
enabledetail
&&
detail
(
text
,
row
,
_
,
action
),
pathconfig
?.
enableedit
&&
edit
(
text
,
row
,
_
,
action
),
pathconfig
?.
enabledelete
&&
remove
(
text
,
row
,
_
,
action
),
],
});
},
[]);
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
AutoTable
pagetitle=
"追踪工单"
columns=
{
columns
}
actionRef=
{
actionRef
}
path=
{
pathconfig
?.
list
||
'/ngic-auth/sysUser/query/page'
}
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'
,
}));
},
},
}
}
/>
<
DrawerPro
fields=
{
columns
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
formRef=
{
formRef
}
placement=
"right"
detailpath=
{
pathconfig
?.
detail
||
null
}
detailData=
{
drawer
?.
item
}
defaultFormValue=
{
drawer
?.
item
}
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
Track
;
export
default
Track
;
\ 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