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
7249b9d6
Commit
7249b9d6
authored
Nov 17, 2022
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1116
parent
2f5a7431
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
284 additions
and
62 deletions
+284
-62
index.jsx
src/components/TreeRender/index.jsx
+30
-29
columns.js
src/pages/device/account/columns.js
+148
-20
index.jsx
src/pages/device/account/index.jsx
+106
-13
No files found.
src/components/TreeRender/index.jsx
View file @
7249b9d6
...
...
@@ -80,7 +80,7 @@ function TreeRender({ url, deleteurl, saveurl, onselected, params, noaction, max
let
res
=
data
?.
data
?.
dataList
??
[];
return
[
{
title
:
'
全部
'
,
title
:
'
设备树
'
,
key
:
'00000000'
,
children
:
res
,
},
...
...
@@ -122,7 +122,7 @@ function TreeRender({ url, deleteurl, saveurl, onselected, params, noaction, max
overflow
:
'hidden'
,
textOverflow
:
'ellipsis'
,
whiteSpace
:
'nowrap'
,
marginRight
:
6
marginRight
:
6
,
}
}
>
{
beforeStr
}
...
...
@@ -131,21 +131,21 @@ function TreeRender({ url, deleteurl, saveurl, onselected, params, noaction, max
</
span
>
</
Tooltip
>
)
:
(
<
Tooltip
title=
{
item
.
title
}
placement=
"bottom"
>
<
span
style=
{
{
display
:
'inline-block'
,
maxWidth
:
maxWidth
??
88
,
overflow
:
'hidden'
,
textOverflow
:
'ellipsis'
,
whiteSpace
:
'nowrap'
,
marginRight
:
6
}
}
>
{
item
.
title
}
</
span
>
</
Tooltip
>
);
<
Tooltip
title=
{
item
.
title
}
placement=
"bottom"
>
<
span
style=
{
{
display
:
'inline-block'
,
maxWidth
:
maxWidth
??
88
,
overflow
:
'hidden'
,
textOverflow
:
'ellipsis'
,
whiteSpace
:
'nowrap'
,
marginRight
:
6
,
}
}
>
{
item
.
title
}
</
span
>
</
Tooltip
>
);
const
actiontitle
=
(
<
div
...
...
@@ -397,19 +397,19 @@ function TreeRender({ url, deleteurl, saveurl, onselected, params, noaction, max
></
Input
>
</
div
>
)
:
(
<
div
>
<
div
style=
{
{
marginBottom
:
15
,
color
:
'#f50'
,
fontSize
:
16
}
}
>
当前结构:
{
modal
.
placeholder
}
</
div
>
<
Input
placeholder=
"子结构"
allowClear
onChange=
{
(
e
)
=>
{
setsavetitle
(
e
.
target
.
value
);
}
}
></
Input
>
<
div
>
<
div
style=
{
{
marginBottom
:
15
,
color
:
'#f50'
,
fontSize
:
16
}
}
>
当前结构:
{
modal
.
placeholder
}
</
div
>
)
}
<
Input
placeholder=
"子结构"
allowClear
onChange=
{
(
e
)
=>
{
setsavetitle
(
e
.
target
.
value
);
}
}
></
Input
>
</
div
>
)
}
</
Modal
>
<
Search
value=
{
search
}
...
...
@@ -420,6 +420,7 @@ function TreeRender({ url, deleteurl, saveurl, onselected, params, noaction, max
<
Tree
onSelect=
{
(
selectedKeys
,
e
)
=>
{
// console.log(selectedKeys);
onselected
?.(
selectedKeys
,
e
,
alldata
);
}
}
autoExpandParent=
{
autoExpandParent
}
...
...
src/pages/device/account/columns.js
View file @
7249b9d6
import
{
Image
}
from
'antd'
;
import
{
Image
,
Tag
}
from
'antd'
;
function
getcolumns
(
setdrawer
)
{
return
[
...
...
@@ -6,19 +6,25 @@ function getcolumns(setdrawer) {
title
:
'设备编号'
,
dataIndex
:
'equipmentNo'
,
key
:
'equipmentNo'
,
align
:
'center'
,
width
:
120
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'设备名称'
,
dataIndex
:
'equipmentName'
,
align
:
'center'
,
width
:
120
,
key
:
'equipmentName'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'位置号'
,
dataIndex
:
'positionNo'
,
key
:
'positionNo'
},
{
title
:
'位置号'
,
width
:
120
,
align
:
'center'
,
dataIndex
:
'positionNo'
,
key
:
'positionNo'
},
{
width
:
120
,
title
:
'设备类型'
,
align
:
'center'
,
dataIndex
:
'equipmentTypeName'
,
key
:
'equipmentType
Name
'
,
key
:
'equipmentType
Id
'
,
valueType
:
'treeSelect'
,
options
:
{
path
:
'/asset/equipmentType/queryTreeList'
,
params
:
{}
},
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
...
...
@@ -26,44 +32,125 @@ function getcolumns(setdrawer) {
{
title
:
'设备型号'
,
dataIndex
:
'equipmentModelName'
,
key
:
'equipmentModelName'
,
width
:
120
,
align
:
'center'
,
key
:
'equipmentModelId'
,
valueType
:
'select'
,
options
:
{
path
:
'/asset/equipmentModel/query/selection'
,
params
:
{}
},
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'公司名称'
,
align
:
'center'
,
dataIndex
:
'organizationName'
,
key
:
'organizationName'
,
width
:
120
,
key
:
'organizationId'
,
valueType
:
'select'
,
options
:
{
path
:
'/auth/sysDepartment/query/organization/selectbox'
,
params
:
{}
},
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'部门名称'
,
width
:
120
,
align
:
'center'
,
valueType
:
'select'
,
dataIndex
:
'departmentName'
,
key
:
'departmentId'
,
options
:
{
path
:
'/auth/sysDepartment/query/depart/selectbox'
,
linkParams
:
{
organizationId
:
'parentId'
,
},
},
},
{
title
:
'工厂名称'
,
dataIndex
:
'factoryName'
,
key
:
'factoryName'
,
key
:
'factoryId'
,
width
:
120
,
align
:
'center'
,
valueType
:
'select'
,
options
:
{
path
:
'/auth/sys
Department/query/depart/selectbox
'
,
params
:
{}
},
options
:
{
path
:
'/auth/sys
Factory/getAllFactorySelection
'
,
params
:
{}
},
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'部门名称'
,
dataIndex
:
'departmentName'
,
key
:
'departmentName'
},
{
title
:
'车间名称'
,
dataIndex
:
'shopName'
,
key
:
'shopName'
,
align
:
'center'
,
width
:
120
,
valueType
:
'select'
,
options
:
{
path
:
'/auth/sysShop/getShopSelectionByFactory'
,
linkParams
:
{
factoryId
:
''
,
},
},
key
:
'shopId'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'工段名称'
,
dataIndex
:
'sectionName'
,
key
:
'sectionName'
},
{
title
:
'产线名称'
,
dataIndex
:
'productLineName'
,
key
:
'productLineName'
},
{
title
:
'供应商'
,
dataIndex
:
'supplierName'
,
key
:
'supplierName'
},
{
title
:
'设备原值(万元)'
,
dataIndex
:
'equipmentWorth'
,
key
:
'equipmentWorth'
},
{
title
:
'图片地址'
,
width
:
100
,
title
:
'工段名称'
,
width
:
120
,
dataIndex
:
'sectionName'
,
align
:
'center'
,
key
:
'sectionId'
,
valueType
:
'select'
,
options
:
{
path
:
'/auth/sysSection/getAllSectionSelectionByShop'
,
linkParams
:
{
shopId
:
''
,
},
},
},
{
title
:
'产线名称'
,
width
:
120
,
dataIndex
:
'productLineName'
,
valueType
:
'select'
,
key
:
'productLineName'
,
align
:
'center'
,
options
:
{
path
:
'auth/sysProductionLine/getAllProductLineSelectionByShop'
,
linkParams
:
{
shopId
:
''
,
},
},
},
{
title
:
'供应商'
,
width
:
120
,
valueType
:
'select'
,
dataIndex
:
'supplierName'
,
align
:
'center'
,
hideInTable
:
true
,
key
:
'supplierId'
,
options
:
{
path
:
'/asset/equipmentSupplier/query/selection'
,
params
:
{},
},
},
{
title
:
'设备原值(万元)'
,
hideInTable
:
true
,
align
:
'center'
,
dataIndex
:
'equipmentWorth'
,
key
:
'equipmentWorth'
,
},
{
title
:
'安装投产日期'
,
hideInTable
:
true
,
align
:
'center'
,
dataIndex
:
'productDate'
,
key
:
'productDate'
,
valueType
:
'date'
,
},
{
title
:
'图片'
,
width
:
120
,
dataIndex
:
'pictureUrl'
,
search
:
false
,
key
:
'picList'
,
align
:
'center'
,
valueType
:
'uploadImage'
,
fieldProps
:
{
limit
:
1
,
...
...
@@ -76,20 +163,61 @@ function getcolumns(setdrawer) {
},
],
},
render
:
(
text
,
row
)
=>
<
Image
width
=
{
70
}
src
=
{
row
.
pictureUrl
}
/>
,
render
:
(
text
,
row
)
=>
{
if
(
row
?.
pictureUrl
==
null
)
{
return
'暂无图片'
;
}
else
{
return
<
Image
width
=
{
70
}
src
=
{
row
.
pictureUrl
}
/>
;
}
},
},
{
title
:
'二维码'
,
width
:
80
,
width
:
120
,
align
:
'center'
,
align
:
'center'
,
dataIndex
:
'qrCodeUrl'
,
key
:
'qrCodeUrl'
,
valueType
:
'uploadImage'
,
search
:
false
,
hideInForm
:
true
,
render
:
(
text
,
row
)
=>
<
Image
width
=
{
70
}
src
=
{
row
.
pictureUrl
}
/>
,
render
:
(
text
,
row
)
=>
{
if
(
row
?.
qrCodeUrl
==
null
)
{
return
'暂无图片'
;
}
else
{
return
<
Image
width
=
{
70
}
src
=
{
row
.
qrCodeUrl
}
/>
;
}
},
},
{
title
:
'状态名称'
,
align
:
'center'
,
hideInTable
:
true
,
dataIndex
:
'statusName'
,
key
:
'statusName'
,
hideInForm
:
true
,
},
{
title
:
'设备状态'
,
dataIndex
:
'status'
,
width
:
120
,
align
:
'center'
,
hideInForm
:
true
,
fixed
:
'right'
,
key
:
'status'
,
render
:
(
text
,
row
)
=>
{
switch
(
row
.
status
)
{
case
1
:
return
<
Tag
color
=
"success"
>
在用
<
/Tag>
;
case
2
:
return
<
Tag
>
报废
<
/Tag>
;
case
3
:
return
<
Tag
color
=
"volcano"
>
借用中
<
/Tag>
;
default
:
break
;
}
},
},
{
title
:
'状态名称'
,
fixed
:
'right'
,
dataIndex
:
'statusName'
,
key
:
'statusName'
},
{
title
:
'设备状态'
,
fixed
:
'right'
,
dataIndex
:
'status'
,
key
:
'status'
},
];
}
...
...
src/pages/device/account/index.jsx
View file @
7249b9d6
...
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-10 09:39:56
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-1
5 17:14:29
* @Last Modified time: 2022-11-1
6 17:19:50
*/
import
*
as
React
from
'react'
;
...
...
@@ -12,8 +12,7 @@ import AutoTable from '@/components/AutoTable';
import
PremButton
from
'@/components/PremButton'
;
import
getcolumns
from
'./columns'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
message
}
from
'antd'
;
import
{
Layout
}
from
'antd'
;
import
{
message
,
Dropdown
,
Menu
,
Layout
,
Button
}
from
'antd'
;
import
TreeRender
from
'@/components/TreeRender'
;
const
{
Sider
,
Content
}
=
Layout
;
...
...
@@ -25,10 +24,10 @@ function Model(props) {
});
const
urlParams
=
{
save
:
'/asset/equipment
Model
/save'
,
save
:
'/asset/equipment/save'
,
remove
:
'/asset/equipment/deleteById'
,
list
:
'/asset/equipment/queryList'
,
detail
:
'/asset/equipment
Model/queryById
'
,
detail
:
'/asset/equipment
/detail
'
,
};
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
...
...
@@ -124,13 +123,88 @@ function Model(props) {
);
};
const
more
=
(
text
,
row
,
_
,
action
)
=>
{
const
menu
=
(
<
Menu
items=
{
[
{
label
:
(
<
a
onClick=
{
()
=>
{
setDrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
title
:
'详情'
,
val
:
'only'
,
title
:
'编辑子设备'
,
}));
}
}
>
编辑子设备
</
a
>
),
key
:
'0'
,
},
{
label
:
<
a
>
履历登记
</
a
>,
key
:
'1'
,
},
{
label
:
<
a
>
关联备件(暂缓)
</
a
>,
key
:
'2'
,
},
{
label
:
<
a
>
寿命件台账(暂缓)
</
a
>,
key
:
'3'
,
},
]
}
/>
);
return
(
<
Dropdown
overlay=
{
menu
}
trigger=
{
[
'click'
]
}
arrow=
{
true
}
getPopupContainer=
{
()
=>
document
.
getElementsByClassName
(
'ant-table-content'
)[
0
]
}
>
<
Button
size=
"small"
>
更多
</
Button
>
</
Dropdown
>
);
};
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setDrawer
);
defcolumn
[
1
].
render
=
(
text
,
row
)
=>
{
return
(
<
a
onClick=
{
()
=>
{
setDrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
// item: row,
title
:
'详情'
,
val
:
'detail'
,
detailpath
:
urlParams
.
detail
,
params
:
{
id
:
row
.
id
},
title
:
row
.
equipmentName
+
'的详细信息'
,
}));
}
}
>
{
row
.
equipmentName
}
</
a
>
);
};
return
defcolumn
.
concat
({
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
)],
fixed
:
'right'
,
width
:
200
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
),
more
(
text
,
row
,
_
,
action
),
],
});
},
[]);
...
...
@@ -145,7 +219,7 @@ function Model(props) {
</
div
>
<
Layout
style=
{
{
height
:
'100%'
}
}
>
<
Sider
theme=
"light"
width=
{
300
}
>
<
TreeRender
/>
<
TreeRender
url=
"/auth/sysFactory/getTree"
onselected=
{
()
=>
{}
}
noaction=
{
true
}
/>
</
Sider
>
<
Content
>
<
AutoTable
...
...
@@ -154,34 +228,53 @@ function Model(props) {
path=
{
urlParams
.
list
}
actionRef=
{
actionRef
}
pageextra=
{
'add'
}
resizeable=
{
tru
e
}
resizeable=
{
fals
e
}
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
disabled
:
false
,
type
:
'primary'
,
onClick
:
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
null
,
title
:
'新增'
,
val
:
'add'
,
onFinish
:
async
(
vals
)
=>
{
console
.
log
(
vals
);
let
params
=
{
...
vals
,
};
let
res
=
await
doFetch
({
url
:
urlParams
.
save
,
params
,
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'新增成功!'
);
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
actionRef
.
current
.
reload
();
}
},
}));
},
},
}
}
x=
{
1500
}
/>
</
Content
>
</
Layout
>
<
DrawerPro
fields=
{
columns
}
detailpath=
"/ngic-auth/sysUser/query/detail"
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
//
detailpath="/ngic-auth/sysUser/query/detail"
//
params={{ id: drawer?.item?.id }}
formRef=
{
formRef
}
placement=
"right"
onClose=
{
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
...
...
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