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
07e6443e
Commit
07e6443e
authored
Jan 11, 2023
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111
parent
9c01ca81
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
1436 additions
and
179 deletions
+1436
-179
authRoutes.js
config/authRoutes.js
+197
-166
proxy.js
config/proxy.js
+1
-1
FormItems.jsx
src/components/InitForm/FormItems.jsx
+1
-0
AvatarDropdown.jsx
src/components/RightContent/AvatarDropdown.jsx
+10
-12
Project.jsx
src/pages/maintain/criterion/Project.jsx
+171
-0
columns.js
src/pages/maintain/criterion/columns.js
+80
-0
index.jsx
src/pages/maintain/criterion/index.jsx
+201
-0
procolumns.js
src/pages/maintain/criterion/procolumns.js
+97
-0
columns.js
src/pages/maintain/orders/columns.js
+60
-0
index.jsx
src/pages/maintain/orders/index.jsx
+166
-0
columns.js
src/pages/maintain/plan/columns.js
+60
-0
index.jsx
src/pages/maintain/plan/index.jsx
+166
-0
columns.js
src/pages/maintain/workOrder/columns.js
+60
-0
index.jsx
src/pages/maintain/workOrder/index.jsx
+166
-0
No files found.
config/authRoutes.js
View file @
07e6443e
export
default
[
export
default
[
{
{
path
:
'/welcome'
,
"path"
:
"/welcome"
,
name
:
'欢迎'
,
"name"
:
"欢迎"
,
icon
:
'smile'
,
"icon"
:
"smile"
,
component
:
'./Welcome'
,
"component"
:
"./Welcome"
},
},
{
{
name
:
'基础设置'
,
"name"
:
"基础设置"
,
icon
:
'setting'
,
"icon"
:
"setting"
,
path
:
'/setting'
,
"path"
:
"/setting"
,
routes
:
[
"routes"
:
[
{
{
name
:
'用户管理'
,
"name"
:
"用户管理"
,
path
:
'/setting/users'
,
"path"
:
"/setting/users"
,
component
:
'./setting/users'
,
"component"
:
"./setting/users"
},
},
{
{
name
:
'角色管理'
,
"name"
:
"角色管理"
,
path
:
'/setting/role'
,
"path"
:
"/setting/role"
,
component
:
'./setting/role'
,
"component"
:
"./setting/role"
},
},
{
{
name
:
'组织管理'
,
"name"
:
"组织管理"
,
path
:
'/setting/organization'
,
"path"
:
"/setting/organization"
,
component
:
'./setting/organization'
,
"component"
:
"./setting/organization"
},
},
{
{
name
:
'工厂管理'
,
"name"
:
"工厂管理"
,
path
:
'/setting/factory'
,
"path"
:
"/setting/factory"
,
component
:
'./setting/factory'
,
"component"
:
"./setting/factory"
},
},
{
{
name
:
'车间管理'
,
"name"
:
"车间管理"
,
path
:
'/setting/workshop'
,
"path"
:
"/setting/workshop"
,
component
:
'./setting/workshop'
,
"component"
:
"./setting/workshop"
},
},
{
{
name
:
'工段管理'
,
"name"
:
"工段管理"
,
path
:
'/setting/section'
,
"path"
:
"/setting/section"
,
component
:
'./setting/section'
,
"component"
:
"./setting/section"
},
},
{
{
name
:
'产线管理'
,
"name"
:
"产线管理"
,
path
:
'/setting/production'
,
"path"
:
"/setting/production"
,
component
:
'./setting/production'
,
"component"
:
"./setting/production"
}
,
}
]
,
]
},
},
{
{
name
:
'设备管理'
,
"name"
:
"设备管理"
,
icon
:
'bulb'
,
"icon"
:
"bulb"
,
path
:
'/device'
,
"path"
:
"/device"
,
routes
:
[
"routes"
:
[
{
{
name
:
'设备台账'
,
"name"
:
"设备台账"
,
path
:
'/device/account'
,
"path"
:
"/device/account"
,
component
:
'./device/account'
,
"component"
:
"./device/account"
},
},
{
{
name
:
'设备类型'
,
"name"
:
"设备类型"
,
path
:
'/device/type'
,
"path"
:
"/device/type"
,
component
:
'./device/type'
,
"component"
:
"./device/type"
},
},
{
{
name
:
'设备型号'
,
"name"
:
"设备型号"
,
path
:
'/device/model'
,
"path"
:
"/device/model"
,
component
:
'./device/model'
,
"component"
:
"./device/model"
},
},
{
{
name
:
'设备供应商'
,
"name"
:
"设备供应商"
,
path
:
'/device/supplier'
,
"path"
:
"/device/supplier"
,
component
:
'./device/supplier'
,
"component"
:
"./device/supplier"
}
,
}
]
,
]
},
},
{
{
name
:
'维修管理'
,
"name"
:
"维修管理"
,
path
:
'/repair'
,
"path"
:
"/repair"
,
icon
:
'tool'
,
"icon"
:
"tool"
,
routes
:
[
"routes"
:
[
{
{
name
:
'接单平台'
,
"name"
:
"接单平台"
,
path
:
'/repair/platform'
,
"path"
:
"/repair/platform"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./repair/platform'
,
"component"
:
"./repair/platform"
},
},
{
{
name
:
'故障报修'
,
"name"
:
"故障报修"
,
path
:
'/repair/failure'
,
"path"
:
"/repair/failure"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./repair/failure'
,
"component"
:
"./repair/failure"
},
},
{
{
name
:
'维修工单'
,
"name"
:
"维修工单"
,
path
:
'/repair/order'
,
"path"
:
"/repair/order"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./repair/order'
,
"component"
:
"./repair/order"
},
},
{
{
name
:
'追踪工单'
,
"name"
:
"追踪工单"
,
path
:
'/repair/track'
,
"path"
:
"/repair/track"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./repair/track'
,
"component"
:
"./repair/track"
},
},
{
{
name
:
'外协工单'
,
"name"
:
"外协工单"
,
path
:
'/repair/outsourcing'
,
"path"
:
"/repair/outsourcing"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./repair/outsourcing'
,
"component"
:
"./repair/outsourcing"
},
},
{
{
name
:
'故障设置'
,
"name"
:
"故障设置"
,
path
:
'/repair/fault'
,
"path"
:
"/repair/fault"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./repair/fault'
,
"component"
:
"./repair/fault"
}
,
}
]
,
]
},
},
{
{
name
:
'系统管理'
,
"name"
:
"系统管理"
,
path
:
'/system'
,
"path"
:
"/system"
,
icon
:
'desktop'
,
"icon"
:
"desktop"
,
routes
:
[
"routes"
:
[
{
{
name
:
'数据字典'
,
"name"
:
"数据字典"
,
path
:
'/system/dictionary'
,
"path"
:
"/system/dictionary"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./system/dictionary'
,
"component"
:
"./system/dictionary"
},
},
{
{
name
:
'扩展字段'
,
"name"
:
"扩展字段"
,
path
:
'/system/field'
,
"path"
:
"/system/field"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./system/field'
,
"component"
:
"./system/field"
},
},
{
{
name
:
'编号规则'
,
"name"
:
"编号规则"
,
path
:
'/system/rules'
,
"path"
:
"/system/rules"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./system/rules'
,
"component"
:
"./system/rules"
},
},
{
{
name
:
'推送配置'
,
"name"
:
"推送配置"
,
path
:
'/system/pushsetting'
,
"path"
:
"/system/pushsetting"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./system/pushsetting'
,
"component"
:
"./system/pushsetting"
}
,
}
]
,
]
},
},
{
{
name
:
'备件管理'
,
"name"
:
"备件管理"
,
path
:
'/spare'
,
"path"
:
"/spare"
,
icon
:
'sliders'
,
"icon"
:
"sliders"
,
routes
:
[
"routes"
:
[
{
{
name
:
' 备件库存'
,
"name"
:
" 备件库存"
,
path
:
'/spare/stock'
,
"path"
:
"/spare/stock"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./spare/stock'
,
"component"
:
"./spare/stock"
},
},
{
{
name
:
'入库管理'
,
"name"
:
"入库管理"
,
path
:
'/spare/instore'
,
"path"
:
"/spare/instore"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./spare/instore'
,
"component"
:
"./spare/instore"
},
},
{
{
name
:
'出库管理'
,
"name"
:
"出库管理"
,
path
:
'/spare/outstore'
,
"path"
:
"/spare/outstore"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./spare/outstore'
,
"component"
:
"./spare/outstore"
},
},
{
{
name
:
'出入库记录'
,
"name"
:
"出入库记录"
,
path
:
'/spare/record'
,
"path"
:
"/spare/record"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./spare/record'
,
"component"
:
"./spare/record"
},
},
{
{
name
:
'备件领用'
,
"name"
:
"备件领用"
,
path
:
'/spare/requisition'
,
"path"
:
"/spare/requisition"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./spare/requisition'
,
"component"
:
"./spare/requisition"
},
},
{
{
name
:
'备件回冲'
,
"name"
:
"备件回冲"
,
path
:
'/spare/spareback'
,
"path"
:
"/spare/spareback"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./spare/spareback'
,
"component"
:
"./spare/spareback"
},
},
{
{
name
:
' 线边库存'
,
"name"
:
" 线边库存"
,
path
:
'/spare/edgestore'
,
"path"
:
"/spare/edgestore"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./spare/edgestore'
,
"component"
:
"./spare/edgestore"
},
},
{
{
name
:
'备件供应商'
,
"name"
:
"备件供应商"
,
path
:
'/spare/supplier'
,
"path"
:
"/spare/supplier"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./spare/supplier'
,
"component"
:
"./spare/supplier"
},
},
{
{
name
:
' 备件设置'
,
"name"
:
" 备件设置"
,
path
:
'/spare/setting'
,
"path"
:
"/spare/setting"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./spare/setting'
,
"component"
:
"./spare/setting"
}
,
}
]
,
]
},
},
{
{
name
:
'点检管理'
,
"name"
:
"点检管理"
,
path
:
'/check'
,
"path"
:
"/check"
,
icon
:
'check-circle'
,
"icon"
:
"check-circle"
,
routes
:
[
"routes"
:
[
{
{
name
:
' 点检标准'
,
"name"
:
" 点检标准"
,
path
:
'/check/standard'
,
"path"
:
"/check/standard"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./check/standard'
,
"component"
:
"./check/standard"
},
},
{
{
name
:
'点检计划'
,
"name"
:
"点检计划"
,
path
:
'/check/plan'
,
"path"
:
"/check/plan"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./check/plan'
,
"component"
:
"./check/plan"
},
},
{
{
name
:
'点检接单'
,
"name"
:
"点检接单"
,
path
:
'/check/order'
,
"path"
:
"/check/order"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./check/order'
,
"component"
:
"./check/order"
},
},
{
{
name
:
'点检工单'
,
"name"
:
"点检工单"
,
path
:
'/check/task'
,
"path"
:
"/check/task"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./check/task'
,
"component"
:
"./check/task"
}
,
}
]
,
]
},
},
];
{
"name"
:
"保养管理"
,
"path"
:
"/maintain"
,
"icon"
:
"dashboard"
,
"routes"
:
[
{
"name"
:
"保养接单"
,
"path"
:
"/maintain/orders"
,
"icon"
:
""
,
"component"
:
"./maintain/orders"
},
{
"name"
:
"保养工单"
,
"path"
:
"/maintain/workOrder"
,
"icon"
:
""
,
"component"
:
"./maintain/workOrder"
},
{
"name"
:
" 保养标准"
,
"path"
:
"/maintain/criterion"
,
"icon"
:
""
,
"component"
:
"./maintain/criterion"
},
{
"name"
:
"保养计划"
,
"path"
:
"/maintain/plan"
,
"icon"
:
""
,
"component"
:
"./maintain/plan"
}
]
}
];
\ No newline at end of file
config/proxy.js
View file @
07e6443e
...
@@ -13,7 +13,7 @@ export default {
...
@@ -13,7 +13,7 @@ export default {
dev
:
{
dev
:
{
[
defaultSetting
.
proxypath
]:
{
[
defaultSetting
.
proxypath
]:
{
// 要代理的地址
// 要代理的地址
target
:
'http://192.168.40.64:2800
0
'
,
//jf哥
target
:
'http://192.168.40.64:2800
1
'
,
//jf哥
// target: 'http://192.168.40.64:28000', //gc哥
// target: 'http://192.168.40.64:28000', //gc哥
// target: 'http://192.168.40.203:8000', //dj哥
// target: 'http://192.168.40.203:8000', //dj哥
changeOrigin
:
true
,
changeOrigin
:
true
,
...
...
src/components/InitForm/FormItems.jsx
View file @
07e6443e
...
@@ -904,6 +904,7 @@ function LinkRadio({ item, colProps, formRef, name, curindex }) {
...
@@ -904,6 +904,7 @@ function LinkRadio({ item, colProps, formRef, name, curindex }) {
let curoption = item.options ?? null,
let curoption = item.options ?? null,
curlinkparams = curoption?.linkParams ?? {}, //获取linkParams下声明的key
curlinkparams = curoption?.linkParams ?? {}, //获取linkParams下声明的key
extraParams = curoption?.extraParams ?? {};
extraParams = curoption?.extraParams ?? {};
console.log(extraParams);
return (
return (
<>
<>
<ProFormDependency name={Object.keys(curlinkparams)}>
<ProFormDependency name={Object.keys(curlinkparams)}>
...
...
src/components/RightContent/AvatarDropdown.jsx
View file @
07e6443e
...
@@ -30,6 +30,11 @@ const loginOut = async () => {
...
@@ -30,6 +30,11 @@ const loginOut = async () => {
};
};
const
AvatarDropdown
=
({
menu
})
=>
{
const
AvatarDropdown
=
({
menu
})
=>
{
const
getUserApp
=
useRequest
(
async
()
=>
{
let
res
=
await
doFetch
({
url
:
'/auth/sysUser/userApp/selection'
,
params
:
{}
});
return
res
?.
data
?.
dataList
||
{};
});
console
.
log
(
getUserApp
);
const
{
initialState
,
setInitialState
}
=
useModel
(
'@@initialState'
);
const
{
initialState
,
setInitialState
}
=
useModel
(
'@@initialState'
);
const
[
visible
,
cv
]
=
useState
(
false
),
const
[
visible
,
cv
]
=
useState
(
false
),
[
formRef
]
=
Form
.
useForm
(),
[
formRef
]
=
Form
.
useForm
(),
...
@@ -158,7 +163,9 @@ const AvatarDropdown = ({ menu }) => {
...
@@ -158,7 +163,9 @@ const AvatarDropdown = ({ menu }) => {
);
);
const
handleChange
=
(
value
)
=>
{
const
handleChange
=
(
value
)
=>
{
console
.
log
(
value
);
if
(
value
)
{
window
.
location
.
href
=
value
;
}
};
};
return
(
return
(
...
@@ -192,17 +199,8 @@ const AvatarDropdown = ({ menu }) => {
...
@@ -192,17 +199,8 @@ const AvatarDropdown = ({ menu }) => {
</
Modal
>
</
Modal
>
<
Select
<
Select
style=
{
{
width
:
150
,
marginRight
:
8
}
}
style=
{
{
width
:
150
,
marginRight
:
8
}
}
defaultValue=
"a"
defaultValue=
"http://ems.nangaoyun.com:8089"
options=
{
[
options=
{
getUserApp
.
data
}
{
value
:
'a'
,
label
:
'EMS'
,
},
{
value
:
'b'
,
label
:
'导航'
,
},
]
}
onChange=
{
handleChange
}
onChange=
{
handleChange
}
/>
/>
<
HeaderDropdown
overlay=
{
menuHeaderDropdown
}
>
<
HeaderDropdown
overlay=
{
menuHeaderDropdown
}
>
...
...
src/pages/maintain/criterion/Project.jsx
0 → 100644
View file @
07e6443e
import
*
as
React
from
'react'
;
import
{
useState
,
useMemo
,
useRef
}
from
'react'
;
import
ModalPro
from
'@/components/ModalPro'
;
import
AutoTable
from
'@/components/AutoTable'
;
import
PremButton
from
'@/components/PremButton'
;
import
procolumns
from
'./procolumns'
;
import
{
useRequest
}
from
'ahooks'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
function
Project
({
equipmentMaintainStandardId
})
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
open
:
false
,
});
const
pathconfig
=
useMemo
(()
=>
{
let
pathconf
=
procolumns
(
setdrawer
)?.
pathconfig
??
{};
return
pathconf
;
},
[]);
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
)
=>
{
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
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
row
,
title
:
'编辑'
,
val
:
'edit'
,
id
:
row
?.
id
,
}));
},
}
}
>
编辑
</
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
=
procolumns
(
drawer
?.
id
)?.
columns
;
return
defcolumn
.
concat
({
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
pathconfig
?.
enableedit
&&
edit
(
text
,
row
,
_
,
action
),
pathconfig
?.
enabledelete
&&
remove
(
text
,
row
,
_
,
action
),
],
});
},
[
drawer
?.
id
]);
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
AutoTable
columns=
{
columns
}
actionRef=
{
actionRef
}
path=
{
pathconfig
?.
list
||
'/ngic-auth/sysUser/query/page'
}
pageextra=
{
pathconfig
?.
enableadd
?
'add'
:
null
}
resizeable=
{
false
}
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
disabled
:
false
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
null
,
title
:
'新增'
,
val
:
'add'
,
id
:
null
,
}));
},
},
}
}
extraparams=
{
{
equipmentMaintainStandardId
}
}
/>
<
ModalPro
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
,
equipmentMaintainStandardId
},
});
}
else
if
(
drawer
?.
val
==
'edit'
)
{
run
({
url
:
pathconfig
?.
edit
||
'/edit'
,
params
:
{
...
vals
,
id
:
drawer
?.
item
?.
id
,
equipmentMaintainStandardId
},
});
}
}
}
/>
</
div
>
);
}
export
default
Project
;
src/pages/maintain/criterion/columns.js
0 → 100644
View file @
07e6443e
function
getcolumns
(
equipmentModelId
)
{
return
{
columns
:
[
{
title
:
'标准编号'
,
dataIndex
:
'standardNo'
,
key
:
'standardNo'
,
hideInForm
:
true
,
},
{
title
:
'保养类型'
,
dataIndex
:
'maintainTypeName'
,
key
:
'maintainType'
,
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
valueType
:
'select'
,
mode
:
'radio'
,
options
:
[
{
label
:
'专业保养'
,
value
:
2
,
},
{
label
:
'自主保养'
,
value
:
1
,
},
],
},
{
title
:
'设备型号'
,
dataIndex
:
'equipmentModelName'
,
key
:
'equipmentModelId'
,
valueType
:
'select'
,
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
mode
:
'radio'
,
options
:
{
path
:
'/maintain/umMaintainStandard/selected/queryList'
,
linkParams
:
{
maintainType
:
'maintainType'
,
},
extraParams
:
{
equipmentModelId
,
},
},
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
key
:
'remark'
,
valueType
:
'textarea'
,
hideInSearch
:
true
,
},
],
pathconfig
:
{
enableadd
:
true
,
enableedit
:
true
,
enabledelete
:
true
,
enabledetail
:
false
,
add
:
'/maintain/umMaintainStandard/save'
,
edit
:
'/maintain/umMaintainStandard/save'
,
list
:
'/maintain/umMaintainStandard/queryList'
,
delete
:
'/maintain/umMaintainStandard/deleteById'
,
detail
:
''
,
},
};
}
export
default
getcolumns
;
src/pages/maintain/criterion/index.jsx
0 → 100644
View file @
07e6443e
/* 保养标准
* @Author: Li Hanlin
* @Date: 2023-01-11 10:46:48
* @Last Modified by: Li Hanlin
* @Last Modified time: 2023-01-11 13:57:52
*/
import
*
as
React
from
'react'
;
import
{
useState
,
useMemo
,
useRef
}
from
'react'
;
import
DrawerPro
from
'@/components/DrawerPro'
;
import
AutoTable
from
'@/components/AutoTable'
;
import
PremButton
from
'@/components/PremButton'
;
import
getcolumns
from
'./columns'
;
import
{
useRequest
}
from
'ahooks'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
Project
from
'./Project'
;
function
Criterion
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
open
:
false
,
});
const
pathconfig
=
useMemo
(()
=>
{
let
pathconf
=
getcolumns
(
setdrawer
)?.
pathconfig
??
{};
return
pathconf
;
},
[]);
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
)
=>
{
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
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
row
,
title
:
'编辑'
,
val
:
'edit'
,
equipmentModelId
:
row
?.
equipmentModelId
,
}));
},
}
}
>
编辑
</
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
project
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
row
,
title
:
'保养项目'
,
val
:
'detailaddon'
,
id
:
row
?.
id
,
}));
},
}
}
>
项目明细
</
PremButton
>
);
};
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
drawer
?.
equipmentModelId
)?.
columns
;
return
defcolumn
.
concat
({
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
project
(
text
,
row
,
_
,
action
),
pathconfig
?.
enableedit
&&
edit
(
text
,
row
,
_
,
action
),
pathconfig
?.
enabledelete
&&
remove
(
text
,
row
,
_
,
action
),
],
});
},
[
drawer
?.
equipmentModelId
]);
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=
{
false
}
addconfig=
{
{
// access: 'sysDepartment_save',
name
:
'新增标准'
,
btn
:
{
disabled
:
false
,
type
:
'primary'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
null
,
title
:
'新增'
,
val
:
'add'
,
equipmentModelId
:
null
,
}));
},
},
}
}
/>
<
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
}
});
}
}
}
>
<
Project
equipmentMaintainStandardId=
{
drawer
?.
id
}
/>
</
DrawerPro
>
</
div
>
);
}
export
default
Criterion
;
src/pages/maintain/criterion/procolumns.js
0 → 100644
View file @
07e6443e
function
procolumns
(
id
)
{
return
{
columns
:
[
{
title
:
'保养项目'
,
dataIndex
:
'maintainItemName'
,
key
:
'maintainItemName'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'保养部位'
,
dataIndex
:
'maintainPosition'
,
key
:
'maintainPosition'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'保养方法'
,
dataIndex
:
'maintainWay'
,
key
:
'maintainWay'
,
colProps
:
{
span
:
24
},
valueType
:
'textarea'
,
},
{
title
:
'保养频次'
,
dataIndex
:
'maintainFrequencyName'
,
key
:
'maintainFrequency'
,
colProps
:
{
span
:
24
},
valueType
:
'select'
,
options
:
[
{
label
:
'周'
,
value
:
0
},
{
label
:
'月度'
,
value
:
1
},
{
label
:
'季度'
,
value
:
2
},
{
label
:
'半年'
,
value
:
3
},
{
label
:
'年度'
,
value
:
4
},
],
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'判定类型'
,
dataIndex
:
'judgeTypeName'
,
key
:
'judgeType'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
valueType
:
'select'
,
options
:
[
{
label
:
'定性'
,
value
:
1
},
{
label
:
'定量'
,
value
:
2
},
],
hideInSearch
:
true
,
},
{
title
:
'下限值'
,
dataIndex
:
'lowerLimit'
,
key
:
'lowerLimit'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
hideInForm
:
{
judgeType
:
[
1
,
null
,
undefined
]
},
valueType
:
'digit'
,
hideInSearch
:
true
,
},
{
title
:
'上限值'
,
dataIndex
:
'upperLimit'
,
key
:
'upperLimit'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
valueType
:
'digit'
,
hideInForm
:
{
judgeType
:
[
1
,
null
,
undefined
]
},
hideInSearch
:
true
,
},
{
title
:
'预计工时'
,
dataIndex
:
'estimateWorkingHours'
,
key
:
'estimateWorkingHours'
,
valueType
:
'digit'
,
hideInSearch
:
true
,
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
key
:
'remark'
,
colProps
:
{
span
:
24
},
valueType
:
'textarea'
,
hideInSearch
:
true
,
},
],
pathconfig
:
{
enableadd
:
true
,
enableedit
:
true
,
enabledelete
:
true
,
enabledetail
:
false
,
add
:
'/maintain/umMaintainItem/save'
,
edit
:
'/maintain/umMaintainItem/save'
,
list
:
'/maintain/umMaintainItem/queryList'
,
delete
:
'/maintain/umMaintainItem/deleteById'
,
detail
:
''
,
},
};
}
export
default
procolumns
;
src/pages/maintain/orders/columns.js
0 → 100644
View file @
07e6443e
function
getcolumns
(
setdrawer
)
{
return
{
"pathconfig"
:
{
"enableadd"
:
false
,
"enableedit"
:
false
,
"enabledelete"
:
false
,
"enabledetail"
:
false
,
"add"
:
""
,
"edit"
:
""
,
"list"
:
"/repair/umRepairOrder/queryRepairOrderList"
,
"delete"
:
""
,
"detail"
:
""
},
"columns"
:
[
{
"title"
:
"维修单号"
,
"dataIndex"
:
"repairOrderNo"
,
"key"
:
"repairOrderNo"
},
{
"title"
:
"设备编号"
,
"dataIndex"
:
"equipmentNo"
,
"key"
:
"equipmentNo"
},
{
"title"
:
"设备名称"
,
"dataIndex"
:
"equipmentName"
,
"key"
:
"equipmentName"
},
{
"title"
:
"故障描述"
,
"dataIndex"
:
"faultDescription"
,
"key"
:
"faultDescription"
},
{
"title"
:
"报修人员"
,
"dataIndex"
:
"repairUserName"
,
"key"
:
"repairUserName"
},
{
"title"
:
"报修时间"
,
"dataIndex"
:
"repairTime"
,
"key"
:
"repairTimeList"
,
"valueType"
:
"dateTimeRange"
},
{
"title"
:
"报修单号"
,
"dataIndex"
:
"repairNo"
,
"key"
:
"repairNo"
},
{
"title"
:
"工单状态"
,
"dataIndex"
:
"statusName"
,
"key"
:
"statusName"
}
]
};
}
export
default
getcolumns
;
\ No newline at end of file
src/pages/maintain/orders/index.jsx
0 → 100644
View file @
07e6443e
import
*
as
React
from
'react'
;
import
{
useState
,
useMemo
,
useRef
}
from
'react'
;
import
DrawerPro
from
'@/components/DrawerPro'
;
import
AutoTable
from
'@/components/AutoTable'
;
import
PremButton
from
'@/components/PremButton'
;
import
getcolumns
from
'./columns'
;
import
{
useRequest
}
from
'ahooks'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
function
Orders
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
open
:
false
,
});
const
pathconfig
=
useMemo
(()
=>
{
let
pathconf
=
getcolumns
(
setdrawer
)?.
pathconfig
??
{};
return
pathconf
;
},
[]);
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
)
=>
{
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
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
row
,
title
:
'编辑'
,
val
:
'edit'
,
}));
},
}
}
>
编辑
</
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
)?.
columns
;
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
Orders
;
\ No newline at end of file
src/pages/maintain/plan/columns.js
0 → 100644
View file @
07e6443e
function
getcolumns
(
setdrawer
)
{
return
{
"pathconfig"
:
{
"enableadd"
:
false
,
"enableedit"
:
false
,
"enabledelete"
:
false
,
"enabledetail"
:
false
,
"add"
:
""
,
"edit"
:
""
,
"list"
:
"/repair/umRepairOrder/queryRepairOrderList"
,
"delete"
:
""
,
"detail"
:
""
},
"columns"
:
[
{
"title"
:
"维修单号"
,
"dataIndex"
:
"repairOrderNo"
,
"key"
:
"repairOrderNo"
},
{
"title"
:
"设备编号"
,
"dataIndex"
:
"equipmentNo"
,
"key"
:
"equipmentNo"
},
{
"title"
:
"设备名称"
,
"dataIndex"
:
"equipmentName"
,
"key"
:
"equipmentName"
},
{
"title"
:
"故障描述"
,
"dataIndex"
:
"faultDescription"
,
"key"
:
"faultDescription"
},
{
"title"
:
"报修人员"
,
"dataIndex"
:
"repairUserName"
,
"key"
:
"repairUserName"
},
{
"title"
:
"报修时间"
,
"dataIndex"
:
"repairTime"
,
"key"
:
"repairTimeList"
,
"valueType"
:
"dateTimeRange"
},
{
"title"
:
"报修单号"
,
"dataIndex"
:
"repairNo"
,
"key"
:
"repairNo"
},
{
"title"
:
"工单状态"
,
"dataIndex"
:
"statusName"
,
"key"
:
"statusName"
}
]
};
}
export
default
getcolumns
;
\ No newline at end of file
src/pages/maintain/plan/index.jsx
0 → 100644
View file @
07e6443e
import
*
as
React
from
'react'
;
import
{
useState
,
useMemo
,
useRef
}
from
'react'
;
import
DrawerPro
from
'@/components/DrawerPro'
;
import
AutoTable
from
'@/components/AutoTable'
;
import
PremButton
from
'@/components/PremButton'
;
import
getcolumns
from
'./columns'
;
import
{
useRequest
}
from
'ahooks'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
function
Plan
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
open
:
false
,
});
const
pathconfig
=
useMemo
(()
=>
{
let
pathconf
=
getcolumns
(
setdrawer
)?.
pathconfig
??
{};
return
pathconf
;
},
[]);
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
)
=>
{
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
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
row
,
title
:
'编辑'
,
val
:
'edit'
,
}));
},
}
}
>
编辑
</
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
)?.
columns
;
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
Plan
;
\ No newline at end of file
src/pages/maintain/workOrder/columns.js
0 → 100644
View file @
07e6443e
function
getcolumns
(
setdrawer
)
{
return
{
"pathconfig"
:
{
"enableadd"
:
false
,
"enableedit"
:
false
,
"enabledelete"
:
false
,
"enabledetail"
:
false
,
"add"
:
""
,
"edit"
:
""
,
"list"
:
"/repair/umRepairOrder/queryRepairOrderList"
,
"delete"
:
""
,
"detail"
:
""
},
"columns"
:
[
{
"title"
:
"维修单号"
,
"dataIndex"
:
"repairOrderNo"
,
"key"
:
"repairOrderNo"
},
{
"title"
:
"设备编号"
,
"dataIndex"
:
"equipmentNo"
,
"key"
:
"equipmentNo"
},
{
"title"
:
"设备名称"
,
"dataIndex"
:
"equipmentName"
,
"key"
:
"equipmentName"
},
{
"title"
:
"故障描述"
,
"dataIndex"
:
"faultDescription"
,
"key"
:
"faultDescription"
},
{
"title"
:
"报修人员"
,
"dataIndex"
:
"repairUserName"
,
"key"
:
"repairUserName"
},
{
"title"
:
"报修时间"
,
"dataIndex"
:
"repairTime"
,
"key"
:
"repairTimeList"
,
"valueType"
:
"dateTimeRange"
},
{
"title"
:
"报修单号"
,
"dataIndex"
:
"repairNo"
,
"key"
:
"repairNo"
},
{
"title"
:
"工单状态"
,
"dataIndex"
:
"statusName"
,
"key"
:
"statusName"
}
]
};
}
export
default
getcolumns
;
\ No newline at end of file
src/pages/maintain/workOrder/index.jsx
0 → 100644
View file @
07e6443e
import
*
as
React
from
'react'
;
import
{
useState
,
useMemo
,
useRef
}
from
'react'
;
import
DrawerPro
from
'@/components/DrawerPro'
;
import
AutoTable
from
'@/components/AutoTable'
;
import
PremButton
from
'@/components/PremButton'
;
import
getcolumns
from
'./columns'
;
import
{
useRequest
}
from
'ahooks'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
function
WorkOrder
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
open
:
false
,
});
const
pathconfig
=
useMemo
(()
=>
{
let
pathconf
=
getcolumns
(
setdrawer
)?.
pathconfig
??
{};
return
pathconf
;
},
[]);
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
)
=>
{
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
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
row
,
title
:
'编辑'
,
val
:
'edit'
,
}));
},
}
}
>
编辑
</
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
)?.
columns
;
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
WorkOrder
;
\ 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