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
73ad6159
Commit
73ad6159
authored
Nov 30, 2022
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adder
parent
d2fa39b1
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
656 additions
and
579 deletions
+656
-579
authRoutes.js
config/authRoutes.js
+126
-114
columns.js
src/pages/repair/fault/columns.js
+31
-108
index.jsx
src/pages/repair/fault/index.jsx
+161
-125
columns.js
src/pages/repair/platform/columns.js
+178
-108
index.jsx
src/pages/repair/platform/index.jsx
+160
-124
No files found.
config/authRoutes.js
View file @
73ad6159
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/failure'
,
"path"
:
"/repair/failure"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./repair/failure'
,
"component"
:
"./repair/failure"
},
},
],
},
{
name
:
'系统管理'
,
path
:
'/system'
,
icon
:
'desktop'
,
routes
:
[
{
{
name
:
'数据字典'
,
"name"
:
"接单平台"
,
path
:
'/system/dictionary'
,
"path"
:
"/repair/platform"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./system/dictionary'
,
"component"
:
"./repair/platform"
},
},
{
{
name
:
'扩展字段'
,
"name"
:
"故障设置"
,
path
:
'/system/field'
,
"path"
:
"/repair/fault"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./system/field'
,
"component"
:
"./repair/fault"
}
]
},
},
{
{
name
:
'编号规则'
,
"name"
:
"系统管理"
,
path
:
'/system/rules'
,
"path"
:
"/system"
,
icon
:
''
,
"icon"
:
"desktop"
,
component
:
'./system/rules'
,
"routes"
:
[
{
"name"
:
"数据字典"
,
"path"
:
"/system/dictionary"
,
"icon"
:
""
,
"component"
:
"./system/dictionary"
},
},
],
{
"name"
:
"扩展字段"
,
"path"
:
"/system/field"
,
"icon"
:
""
,
"component"
:
"./system/field"
},
},
{
"name"
:
"编号规则"
,
"path"
:
"/system/rules"
,
"icon"
:
""
,
"component"
:
"./system/rules"
}
]
}
];
];
\ No newline at end of file
src/pages/repair/fault/columns.js
View file @
73ad6159
function
getcolumns
(
setdrawer
)
{
function
getcolumns
(
setdrawer
)
{
return
[
return
[
{
{
title
:
'基础信息'
,
"title"
:
"故障类型"
,
valueType
:
'split'
,
"dataIndex"
:
"faultType"
,
},
"key"
:
"faultType"
{
},
title
:
'用户名'
,
{
dataIndex
:
'accountName'
,
"title"
:
"故障代码"
,
formItemProps
:
{
"dataIndex"
:
"faultCode"
,
rules
:
[
"key"
:
"faultCode"
{
},
required
:
false
,
{
message
:
'此项为必填项'
,
"title"
:
"设备类型"
,
},
"dataIndex"
:
"equipmentTypeName"
,
],
"key"
:
"equipmentTypeId"
,
},
"valueType"
:
"treeSelect"
,
initialValue
:
'默认值'
,
"options"
:
{
hideInForm
:
false
,
"path"
:
"/asset/equipmentType/queryTreeList"
,
search
:
false
,
"params"
:
{}
render
:
(
text
,
row
)
=>
{
}
return
(
},
<
a
{
onClick
=
{()
=>
{
"title"
:
"备注"
,
setdrawer
?.((
s
)
=>
({
"dataIndex"
:
"remark"
,
...
s
,
"key"
:
"remark"
,
visible
:
true
,
"valueType"
:
"textarea"
item
:
null
,
}
title
:
'新增'
,
];
val
:
'add'
,
}
}));
export
default
getcolumns
;
}}
>
{
text
}
<
/a
>
);
},
},
{
title
:
'姓名'
,
dataIndex
:
'userName'
,
key
:
'userId'
,
hideInForm
:
{
accountName
:
{
reverse
:
[
'1'
,
'2'
,
'5'
],
},
remark
:
[
'3'
],
},
search
:
false
,
},
{
title
:
'额外信息'
,
valueType
:
'split'
,
},
{
title
:
'联系电话'
,
dataIndex
:
'telephone'
,
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
},
search
:
false
,
},
{
title
:
'邮箱'
,
dataIndex
:
'mailNo'
,
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
},
search
:
false
,
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
valueType
:
'editor'
,
search
:
false
,
colProps
:
{
span
:
24
},
initialValue
:
'<p>Hello <b>World!</b></p>'
,
},
{
title
:
'上传样式-图片'
,
dataIndex
:
'uploadImage'
,
key
:
'uploadImage'
,
valueType
:
'uploadImage'
,
fieldProps
:
{
limit
:
2
,
},
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
},
},
];
}
\ No newline at end of file
export
default
getcolumns
;
src/pages/repair/fault/index.jsx
View file @
73ad6159
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
Fault
(
props
)
{
const
pathconfig
=
{
"enableadd"
:
true
,
"enableedit"
:
true
,
"enabledelete"
:
true
,
"enabledetail"
:
true
,
"add"
:
"/repair/umFaultSetting/save"
,
"edit"
:
"/repair/umFaultSetting/save"
,
"list"
:
"/repair/umFaultSetting/queryList"
,
"delete"
:
"/repair/umFaultSetting/deleteById"
,
"detail"
:
""
};
function
Fault
(
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 Fault(props) {
...
@@ -21,11 +48,11 @@ function Fault(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 Fault(props) {
...
@@ -43,7 +70,7 @@ function Fault(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 Fault(props) {
...
@@ -60,11 +87,11 @@ function Fault(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 Fault(props) {
...
@@ -84,9 +111,9 @@ function Fault(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 Fault(props) {
...
@@ -96,9 +123,9 @@ function Fault(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 Fault(props) {
...
@@ -107,7 +134,7 @@ function Fault(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 Fault(props) {
...
@@ -119,20 +146,29 @@ function Fault(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
Fault
;
export
default
Fault
;
\ No newline at end of file
\ No newline at end of file
src/pages/repair/platform/columns.js
View file @
73ad6159
function
getcolumns
(
setdrawer
)
{
function
getcolumns
(
setdrawer
)
{
return
[
return
[
{
{
title
:
'基础信息'
,
"tab"
:
"维修工单"
,
valueType
:
'split'
,
"key"
:
"1"
,
},
"columns"
:
[
{
{
title
:
'用户名'
,
"title"
:
"维修单号"
,
dataIndex
:
'accountName'
,
"dataIndex"
:
"repairOrderNo"
,
formItemProps
:
{
"key"
:
"repairOrderNo"
rules
:
[
},
{
{
required
:
false
,
"title"
:
"设备编号"
,
message
:
'此项为必填项'
,
"dataIndex"
:
"equipmentNo"
,
"key"
:
"equipmentNo"
},
},
],
{
"title"
:
"设备名称"
,
"dataIndex"
:
"equipmentName"
,
"key"
:
"equipmentName"
},
},
initialValue
:
'默认值'
,
{
hideInForm
:
false
,
"title"
:
"故障描述"
,
search
:
false
,
"dataIndex"
:
"faultDescription"
,
render
:
(
text
,
row
)
=>
{
"key"
:
"faultDescription"
return
(
<
a
onClick
=
{()
=>
{
setdrawer
?.((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
null
,
title
:
'新增'
,
val
:
'add'
,
}));
}}
>
{
text
}
<
/a
>
);
},
},
{
"title"
:
"报修人员"
,
"dataIndex"
:
"repairUserName"
,
"key"
:
"repairUserName"
},
},
{
{
title
:
'姓名'
,
"title"
:
"报修时间"
,
dataIndex
:
'userName'
,
"dataIndex"
:
"repairTime"
,
key
:
'userId'
,
"key"
:
"repairTimeList"
,
hideInForm
:
{
"valueType"
:
"dateTimeRange"
accountName
:
{
reverse
:
[
'1'
,
'2'
,
'5'
],
},
},
remark
:
[
'3'
],
{
"title"
:
"报修单号"
,
"dataIndex"
:
"repairNo"
,
"key"
:
"repairNo"
},
},
search
:
false
,
{
"title"
:
"工单状态"
,
"dataIndex"
:
"statusName"
,
"key"
:
"statusName"
}
],
"pathconfig"
:
{
"enableadd"
:
false
,
"enableedit"
:
false
,
"enabledelete"
:
false
,
"enabledetail"
:
false
,
"add"
:
""
,
"edit"
:
""
,
"list"
:
"/repair/umRepairOrder/queryRepairOrderList"
,
"delete"
:
""
,
"detail"
:
""
}
},
},
{
{
title
:
'额外信息'
,
"tab"
:
"追踪工单"
,
valueType
:
'split'
,
"key"
:
"2"
,
"columns"
:
[
{
"title"
:
"追踪单号"
,
"dataIndex"
:
"taskOrderNo"
,
"key"
:
"taskOrderNo"
},
},
{
{
title
:
'联系电话'
,
"title"
:
"设备编号"
,
dataIndex
:
'telephone'
,
"dataIndex"
:
"equipmentNo"
,
formItemProps
:
{
"key"
:
"equipmentNo"
rules
:
[
},
{
{
required
:
false
,
"title"
:
"设备名称"
,
message
:
'此项为必填项'
,
"dataIndex"
:
"equipmentName"
,
"key"
:
"equipmentName"
},
},
],
{
"title"
:
"故障描述"
,
"dataIndex"
:
"faultDescription"
,
"key"
:
"faultDescription"
},
},
search
:
false
,
{
"title"
:
"创建时间"
,
"dataIndex"
:
"createTime"
,
"key"
:
"createTime"
},
},
{
{
title
:
'邮箱'
,
"title"
:
"创建人员"
,
dataIndex
:
'mailNo'
,
"dataIndex"
:
"createUserName"
,
formItemProps
:
{
"key"
:
"createUserName"
rules
:
[
},
{
{
required
:
false
,
"title"
:
"来源单号"
,
message
:
'此项为必填项'
,
"dataIndex"
:
"dataSourcesNo"
,
"key"
:
"dataSourcesNo"
},
},
{
"title"
:
"工单状态"
,
"dataIndex"
:
"statusName"
,
"key"
:
"statusName"
}
],
],
"pathconfig"
:
{
"enableadd"
:
false
,
"enableedit"
:
false
,
"enabledelete"
:
false
,
"enabledetail"
:
false
,
"add"
:
""
,
"edit"
:
""
,
"list"
:
"/repair/umTrackOrder/queryTrackOrderList"
,
"delete"
:
""
,
"detail"
:
""
}
},
},
search
:
false
,
{
"tab"
:
"外协工单"
,
"key"
:
"3"
,
"columns"
:
[
{
"title"
:
"维修单号"
,
"dataIndex"
:
"repairOrderNo"
,
"key"
:
"repairOrderNo"
},
},
{
{
title
:
'备注'
,
"title"
:
"设备编号"
,
dataIndex
:
'remark'
,
"dataIndex"
:
"equipmentNo"
,
valueType
:
'editor'
,
"key"
:
"equipmentNo"
search
:
false
,
colProps
:
{
span
:
24
},
initialValue
:
'<p>Hello <b>World!</b></p>'
,
},
},
{
{
title
:
'上传样式-图片'
,
"title"
:
"设备名称"
,
dataIndex
:
'uploadImage'
,
"dataIndex"
:
"equipmentName"
,
key
:
'uploadImage'
,
"key"
:
"equipmentName"
valueType
:
'uploadImage'
,
fieldProps
:
{
limit
:
2
,
},
},
formItemProps
:
{
rules
:
[
{
{
required
:
false
,
"title"
:
"故障描述"
,
message
:
'此项为必填项'
,
"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"
}
],
"pathconfig"
:
{
"enableadd"
:
true
,
"enableedit"
:
true
,
"enabledelete"
:
true
,
"enabledetail"
:
true
,
"add"
:
""
,
"edit"
:
""
,
"list"
:
""
,
"delete"
:
""
,
"detail"
:
""
}
}
];
}
export
default
getcolumns
;
\ No newline at end of file
export
default
getcolumns
;
src/pages/repair/platform/index.jsx
View file @
73ad6159
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
Platform
(
props
)
{
function
Platform
(
props
)
{
const
actionRef
=
useRef
(),
const
actionRef
=
useRef
(),
formRef
=
useRef
();
formRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
const
[
drawer
,
setdrawer
]
=
useState
({
visible
:
false
,
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
,
}));
}
},
});
});
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
...
@@ -21,11 +37,11 @@ function Platform(props) {
...
@@ -21,11 +37,11 @@ function Platform(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 +59,7 @@ function Platform(props) {
...
@@ -43,7 +59,7 @@ function Platform(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 +76,11 @@ function Platform(props) {
...
@@ -60,11 +76,11 @@ function Platform(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=
{
{
...
@@ -78,27 +94,33 @@ function Platform(props) {
...
@@ -78,27 +94,33 @@ function Platform(props) {
};
};
const
columns
=
useMemo
(()
=>
{
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setdrawer
);
let
defcolumn
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
columns
;
let
defpath
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
pathconfig
??
{};
return
defcolumn
.
concat
({
return
defcolumn
.
concat
({
title
:
'操作'
,
title
:
'操作'
,
valueType
:
'option'
,
valueType
:
'option'
,
width
:
150
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
render
:
(
text
,
row
,
_
,
action
)
=>
[
detail
(
text
,
row
,
_
,
action
),
defpath
?.
enabledetail
&&
detail
(
text
,
row
,
_
,
action
),
edit
(
text
,
row
,
_
,
action
),
defpath
?.
enableedit
&&
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
),
defpath
?.
enabledelete
&&
remove
(
text
,
row
,
_
,
action
),
],
],
});
});
},
[]);
},
[
activeTabKey
]);
const
pathconfig
=
useMemo
(()
=>
{
let
defpath
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
pathconfig
??
{};
return
defpath
;
},
[
activeTabKey
]);
return
(
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
div
style=
{
{
position
:
'relative'
}
}
>
<
AutoTable
<
AutoTable
pagetitle=
"接单平台"
pagetitle=
"接单平台"
columns=
{
columns
}
columns=
{
columns
}
path=
"/ngic-auth/sysUser/query/page"
path=
{
pathconfig
?.
list
||
'/ngic-auth/sysUser/query/page'
}
actionRef=
{
actionRef
}
actionRef=
{
actionRef
}
pageextra=
{
'add'
}
pageextra=
{
pathconfig
?.
enableadd
?
'add'
:
null
}
resizeable=
{
true
}
resizeable=
{
true
}
addconfig=
{
{
addconfig=
{
{
// access: 'sysDepartment_save',
// access: 'sysDepartment_save',
...
@@ -107,7 +129,7 @@ function Platform(props) {
...
@@ -107,7 +129,7 @@ function Platform(props) {
onClick
:
()
=>
{
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
setdrawer
((
s
)
=>
({
...
s
,
...
s
,
visible
:
true
,
open
:
true
,
item
:
null
,
item
:
null
,
title
:
'新增'
,
title
:
'新增'
,
val
:
'add'
,
val
:
'add'
,
...
@@ -115,24 +137,38 @@ function Platform(props) {
...
@@ -115,24 +137,38 @@ function Platform(props) {
},
},
},
},
}
}
}
}
tabList=
{
getcolumns
()
}
activeTabKey=
{
activeTabKey
}
onTabChange=
{
(
key
)
=>
{
setactiveTabKey
(
key
);
}
}
/>
/>
<
DrawerPro
<
DrawerPro
fields=
{
columns
}
fields=
{
columns
}
detailpath=
"/ngic-auth/sysUser/query/detail"
detailpath=
{
pathconfig
?.
detail
||
null
}
detailData=
{
drawer
?.
item
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
formRef=
{
formRef
}
formRef=
{
formRef
}
placement=
"right"
placement=
"right"
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
Platform
;
\ No newline at end of file
export
default
Platform
;
\ 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