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
Hide 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"
:
"/repair/platform"
,
name
:
'系统管理'
,
"icon"
:
""
,
path
:
'/system'
,
"component"
:
"./repair/platform"
icon
:
'desktop'
,
},
routes
:
[
{
{
"name"
:
"故障设置"
,
name
:
'数据字典'
,
"path"
:
"/repair/fault"
,
path
:
'/system/dictionary'
,
"icon"
:
""
,
icon
:
''
,
"component"
:
"./repair/fault"
component
:
'./system/dictionary'
,
}
},
]
{
},
name
:
'扩展字段'
,
{
path
:
'/system/field'
,
"name"
:
"系统管理"
,
icon
:
''
,
"path"
:
"/system"
,
component
:
'./system/field'
,
"icon"
:
"desktop"
,
},
"routes"
:
[
{
{
name
:
'编号规则'
,
"name"
:
"数据字典"
,
path
:
'/system/rules'
,
"path"
:
"/system/dictionary"
,
icon
:
''
,
"icon"
:
""
,
component
:
'./system/rules'
,
"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
;
}}
>
\ No newline at end of file
{
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
:
'此项为必填项'
,
},
],
},
},
];
}
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
=
{
const
actionRef
=
useRef
(),
"enableadd"
:
true
,
formRef
=
useRef
();
"enableedit"
:
true
,
const
[
drawer
,
setdrawer
]
=
useState
({
"enabledelete"
:
true
,
visible
:
false
,
"enabledetail"
:
true
,
});
"add"
:
"/repair/umFaultSetting/save"
,
"edit"
:
"/repair/umFaultSetting/save"
,
"list"
:
"/repair/umFaultSetting/queryList"
,
"delete"
:
"/repair/umFaultSetting/deleteById"
,
"detail"
:
""
};
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
function
Fault
(
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
(
detailpath=
"/ngic-auth/sysUser/query/detail"
<
PremButton
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
btn=
{
{
formRef=
{
formRef
}
size
:
'small'
,
placement=
"right"
onClick
:
()
=>
{
onClose=
{
()
=>
{
setdrawer
((
s
)
=>
({
setdrawer
((
s
)
=>
({
...
s
,
...
s
,
open
:
true
,
visible
:
false
,
item
:
row
,
}));
title
:
'编辑'
,
}
}
val
:
'edit'
,
{
...
drawer
}
}));
/>
},
</
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
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"
],
},
},
{
initialValue
:
'默认值'
,
"title"
:
"设备名称"
,
hideInForm
:
false
,
"dataIndex"
:
"equipmentName"
,
search
:
false
,
"key"
:
"equipmentName"
render
:
(
text
,
row
)
=>
{
},
return
(
{
<
a
"title"
:
"故障描述"
,
onClick
=
{()
=>
{
"dataIndex"
:
"faultDescription"
,
setdrawer
?.((
s
)
=>
({
"key"
:
"faultDescription"
...
s
,
},
visible
:
true
,
{
item
:
null
,
"title"
:
"报修人员"
,
title
:
'新增'
,
"dataIndex"
:
"repairUserName"
,
val
:
'add'
,
"key"
:
"repairUserName"
}));
},
}}
{
>
"title"
:
"报修时间"
,
{
text
}
"dataIndex"
:
"repairTime"
,
<
/a
>
"key"
:
"repairTimeList"
,
);
"valueType"
:
"dateTimeRange"
},
},
},
{
{
"title"
:
"报修单号"
,
title
:
'姓名'
,
"dataIndex"
:
"repairNo"
,
dataIndex
:
'userName'
,
"key"
:
"repairNo"
key
:
'userId'
,
},
hideInForm
:
{
{
accountName
:
{
"title"
:
"工单状态"
,
reverse
:
[
'1'
,
'2'
,
'5'
],
"dataIndex"
:
"statusName"
,
},
"key"
:
"statusName"
remark
:
[
'3'
],
}
},
],
search
:
false
,
"pathconfig"
:
{
},
"enableadd"
:
false
,
{
"enableedit"
:
false
,
title
:
'额外信息'
,
"enabledelete"
:
false
,
valueType
:
'split'
,
"enabledetail"
:
false
,
},
"add"
:
""
,
{
"edit"
:
""
,
title
:
'联系电话'
,
"list"
:
"/repair/umRepairOrder/queryRepairOrderList"
,
dataIndex
:
'telephone'
,
"delete"
:
""
,
formItemProps
:
{
"detail"
:
""
rules
:
[
}
{
},
required
:
false
,
{
message
:
'此项为必填项'
,
"tab"
:
"追踪工单"
,
},
"key"
:
"2"
,
],
"columns"
:
[
},
{
search
:
false
,
"title"
:
"追踪单号"
,
},
"dataIndex"
:
"taskOrderNo"
,
{
"key"
:
"taskOrderNo"
title
:
'邮箱'
,
},
dataIndex
:
'mailNo'
,
{
formItemProps
:
{
"title"
:
"设备编号"
,
rules
:
[
"dataIndex"
:
"equipmentNo"
,
{
"key"
:
"equipmentNo"
required
:
false
,
},
message
:
'此项为必填项'
,
{
},
"title"
:
"设备名称"
,
],
"dataIndex"
:
"equipmentName"
,
},
"key"
:
"equipmentName"
search
:
false
,
},
},
{
{
"title"
:
"故障描述"
,
title
:
'备注'
,
"dataIndex"
:
"faultDescription"
,
dataIndex
:
'remark'
,
"key"
:
"faultDescription"
valueType
:
'editor'
,
},
search
:
false
,
{
colProps
:
{
span
:
24
},
"title"
:
"创建时间"
,
initialValue
:
'<p>Hello <b>World!</b></p>'
,
"dataIndex"
:
"createTime"
,
},
"key"
:
"createTime"
{
},
title
:
'上传样式-图片'
,
{
dataIndex
:
'uploadImage'
,
"title"
:
"创建人员"
,
key
:
'uploadImage'
,
"dataIndex"
:
"createUserName"
,
valueType
:
'uploadImage'
,
"key"
:
"createUserName"
fieldProps
:
{
},
limit
:
2
,
{
},
"title"
:
"来源单号"
,
formItemProps
:
{
"dataIndex"
:
"dataSourcesNo"
,
rules
:
[
"key"
:
"dataSourcesNo"
{
},
required
:
false
,
{
message
:
'此项为必填项'
,
"title"
:
"工单状态"
,
},
"dataIndex"
:
"statusName"
,
],
"key"
:
"statusName"
},
}
},
],
];
"pathconfig"
:
{
}
"enableadd"
:
false
,
"enableedit"
:
false
,
export
default
getcolumns
;
"enabledelete"
:
false
,
"enabledetail"
:
false
,
"add"
:
""
,
"edit"
:
""
,
"list"
:
"/repair/umTrackOrder/queryTrackOrderList"
,
"delete"
:
""
,
"detail"
:
""
}
},
{
"tab"
:
"外协工单"
,
"key"
:
"3"
,
"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"
}
],
"pathconfig"
:
{
"enableadd"
:
true
,
"enableedit"
:
true
,
"enabledelete"
:
true
,
"enabledetail"
:
true
,
"add"
:
""
,
"edit"
:
""
,
"list"
:
""
,
"delete"
:
""
,
"detail"
:
""
}
}
];
}
export
default
getcolumns
;
\ No newline at end of file
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
detail
=
(
text
,
row
,
_
,
action
)
=>
{
const
{
run
,
loading
}
=
useRequest
(
doFetch
,
{
return
(
manual
:
true
,
<
PremButton
onSuccess
:
(
res
,
params
)
=>
{
btn=
{
{
if
(
res
?.
code
==
'0000'
)
{
size
:
'small'
,
actionRef
?.
current
?.
reload
();
type
:
'link'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
setdrawer
((
s
)
=>
({
...
s
,
...
s
,
visible
:
true
,
open
:
false
,
item
:
row
,
title
:
'详情'
,
val
:
'detail'
,
title
:
row
.
userName
+
'的详细信息'
,
}));
}));
},
}
}
}
},
>
});
详情
</
PremButton
>
);
};
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
return
(
<
PremButton
<
PremButton
btn=
{
{
btn=
{
{
size
:
'small'
,
size
:
'small'
,
onClick
:
()
=>
{
type
:
'link'
,
setdrawer
((
s
)
=>
({
onClick
:
()
=>
{
...
s
,
setdrawer
((
s
)
=>
({
visible
:
true
,
...
s
,
item
:
row
,
open
:
true
,
title
:
'编辑'
,
item
:
row
,
val
:
'edit'
,
title
:
'详情'
,
}));
val
:
'detail'
,
},
title
:
'详细信息'
,
}
}
}));
>
},
编辑
}
}
</
PremButton
>
>
);
详情
};
</
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
)
=>
{
const
remove
=
(
text
,
row
,
_
,
action
)
=>
{
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=
{
{
size
:
'small'
,
size
:
'small'
,
type
:
'danger'
,
type
:
'danger'
,
}
}
}
}
>
>
删除
删除
</
PremButton
>
</
PremButton
>
);
);
};
};
const
columns
=
useMemo
(()
=>
{
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setdrawer
);
let
defcolumn
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
columns
;
return
defcolumn
.
concat
({
let
defpath
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
pathconfig
??
{};
title
:
'操作'
,
return
defcolumn
.
concat
({
valueType
:
'option'
,
title
:
'操作'
,
width
:
150
,
valueType
:
'option'
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
width
:
150
,
detail
(
text
,
row
,
_
,
action
),
render
:
(
text
,
row
,
_
,
action
)
=>
[
edit
(
text
,
row
,
_
,
action
),
defpath
?.
enabledetail
&&
detail
(
text
,
row
,
_
,
action
),
remove
(
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=
"/ngic-auth/sysUser/query/page"
return
(
actionRef=
{
actionRef
}
<
div
style=
{
{
position
:
'relative'
}
}
>
pageextra=
{
'add'
}
<
AutoTable
resizeable=
{
true
}
pagetitle=
"接单平台"
addconfig=
{
{
columns=
{
columns
}
// access: 'sysDepartment_save',
path=
{
pathconfig
?.
list
||
'/ngic-auth/sysUser/query/page'
}
btn
:
{
actionRef=
{
actionRef
}
disabled
:
false
,
pageextra=
{
pathconfig
?.
enableadd
?
'add'
:
null
}
onClick
:
()
=>
{
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
fields=
{
columns
}
detailpath=
{
pathconfig
?.
detail
||
null
}
detailData=
{
drawer
?.
item
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
formRef=
{
formRef
}
placement=
"right"
onClose=
{
()
=>
{
setdrawer
((
s
)
=>
({
setdrawer
((
s
)
=>
({
...
s
,
...
s
,
visible
:
true
,
open
:
false
,
item
:
null
,
title
:
'新增'
,
val
:
'add'
,
}));
}));
},
}
}
},
{
...
drawer
}
}
}
onFinish=
{
(
vals
)
=>
{
/>
if
(
drawer
?.
val
==
'add'
)
{
run
({
url
:
pathconfig
?.
add
||
'/add'
,
params
:
{
...
vals
}
});
<
DrawerPro
}
else
if
(
drawer
?.
val
==
'edit'
)
{
fields=
{
columns
}
run
({
url
:
pathconfig
?.
edit
||
'/edit'
,
params
:
{
...
vals
,
id
:
drawer
?.
item
?.
id
}
});
detailpath=
"/ngic-auth/sysUser/query/detail"
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
}
}
formRef=
{
formRef
}
/>
placement=
"right"
</
div
>
onClose=
{
()
=>
{
);
setdrawer
((
s
)
=>
({
}
...
s
,
visible
:
false
,
}));
}
}
{
...
drawer
}
/>
</
div
>
);
}
export
default
Platform
;
export
default
Platform
;
\ No newline at end of file
\ 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