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
2f5a7431
Commit
2f5a7431
authored
Nov 15, 2022
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1115
parent
907b28a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
115 additions
and
96 deletions
+115
-96
columns.js
src/pages/device/account/columns.js
+64
-77
index.jsx
src/pages/device/account/index.jsx
+51
-19
No files found.
src/pages/device/account/columns.js
View file @
2f5a7431
import
{
Image
}
from
'antd'
;
function
getcolumns
(
setdrawer
)
{
return
[
{
title
:
'基础信息'
,
valueType
:
'split'
,
title
:
'设备编号'
,
dataIndex
:
'equipmentNo'
,
key
:
'equipmentNo'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'用户名'
,
dataIndex
:
'accountName'
,
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
},
initialValue
:
'默认值'
,
hideInForm
:
false
,
search
:
false
,
render
:
(
text
,
row
)
=>
{
return
(
<
a
onClick
=
{()
=>
{
setdrawer
?.((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
null
,
title
:
'新增'
,
val
:
'add'
,
}));
}}
>
{
text
}
<
/a
>
);
},
title
:
'设备名称'
,
dataIndex
:
'equipmentName'
,
key
:
'equipmentName'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'位置号'
,
dataIndex
:
'positionNo'
,
key
:
'positionNo'
},
{
title
:
'姓名'
,
dataIndex
:
'userName'
,
key
:
'userId'
,
hideInForm
:
{
accountName
:
{
reverse
:
[
'1'
,
'2'
,
'5'
],
},
remark
:
[
'3'
],
},
search
:
false
,
title
:
'设备类型'
,
dataIndex
:
'equipmentTypeName'
,
key
:
'equipmentTypeName'
,
valueType
:
'treeSelect'
,
options
:
{
path
:
'/asset/equipmentType/queryTreeList'
,
params
:
{}
},
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'额外信息'
,
valueType
:
'split'
,
title
:
'设备型号'
,
dataIndex
:
'equipmentModelName'
,
key
:
'equipmentModelName'
,
valueType
:
'select'
,
options
:
{
path
:
'/asset/equipmentModel/query/selection'
,
params
:
{}
},
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'联系电话'
,
dataIndex
:
'telephone'
,
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
},
search
:
false
,
title
:
'公司名称'
,
dataIndex
:
'organizationName'
,
key
:
'organizationName'
,
valueType
:
'select'
,
options
:
{
path
:
'/auth/sysDepartment/query/organization/selectbox'
,
params
:
{}
},
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'邮箱'
,
dataIndex
:
'mailNo'
,
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
},
search
:
false
,
title
:
'工厂名称'
,
dataIndex
:
'factoryName'
,
key
:
'factoryName'
,
valueType
:
'select'
,
options
:
{
path
:
'/auth/sysDepartment/query/depart/selectbox'
,
params
:
{}
},
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'部门名称'
,
dataIndex
:
'departmentName'
,
key
:
'departmentName'
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
valueType
:
'editor'
,
search
:
false
,
colProps
:
{
span
:
24
},
initialValue
:
'<p>Hello <b>World!</b></p>'
,
title
:
'车间名称'
,
dataIndex
:
'shopName'
,
key
:
'shopName'
,
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
:
'上传样式-图片'
,
dataIndex
:
'uploadImage'
,
key
:
'uploadImage'
,
title
:
'图片地址'
,
width
:
100
,
dataIndex
:
'pictureUrl'
,
search
:
false
,
key
:
'picList'
,
valueType
:
'uploadImage'
,
fieldProps
:
{
limit
:
2
,
limit
:
1
,
},
formItemProps
:
{
rules
:
[
{
required
:
fals
e
,
required
:
tru
e
,
message
:
'此项为必填项'
,
},
],
},
render
:
(
text
,
row
)
=>
<
Image
width
=
{
70
}
src
=
{
row
.
pictureUrl
}
/>
,
},
{
title
:
'二维码'
,
width
:
80
,
dataIndex
:
'qrCodeUrl'
,
key
:
'qrCodeUrl'
,
valueType
:
'uploadImage'
,
search
:
false
,
hideInForm
:
true
,
render
:
(
text
,
row
)
=>
<
Image
width
=
{
70
}
src
=
{
row
.
pictureUrl
}
/>
,
},
{
title
:
'状态名称'
,
fixed
:
'right'
,
dataIndex
:
'statusName'
,
key
:
'statusName'
},
{
title
:
'设备状态'
,
fixed
:
'right'
,
dataIndex
:
'status'
,
key
:
'status'
},
];
}
...
...
src/pages/device/account/index.jsx
View file @
2f5a7431
...
...
@@ -2,27 +2,35 @@
* @Author: Li Hanlin
* @Date: 2022-11-10 09:39:56
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-15 1
3:29:58
* @Last Modified time: 2022-11-15 1
7:14:29
*/
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
TreeRender
from
'@/components/TreeRender'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
message
}
from
'antd'
;
import
{
Layout
}
from
'antd'
;
import
TreeRender
from
'@/components/TreeRender'
;
const
{
Sider
,
Content
}
=
Layout
;
function
Account
(
props
)
{
function
Model
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
set
d
rawer
]
=
useState
({
const
[
drawer
,
set
D
rawer
]
=
useState
({
visible
:
false
,
});
const
urlParams
=
{
save
:
'/asset/equipmentModel/save'
,
remove
:
'/asset/equipment/deleteById'
,
list
:
'/asset/equipment/queryList'
,
detail
:
'/asset/equipmentModel/queryById'
,
};
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
...
...
@@ -30,7 +38,7 @@ function Account(props) {
size
:
'small'
,
type
:
'link'
,
onClick
:
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
...
...
@@ -52,12 +60,32 @@ function Account(props) {
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
title
:
'编辑'
,
val
:
'edit'
,
detailpath
:
urlParams
.
detail
,
params
:
{
id
:
row
.
id
},
onFinish
:
async
(
vals
)
=>
{
console
.
log
(
1
);
let
params
=
{
...
vals
,
id
:
row
.
id
,
};
let
res
=
await
doFetch
({
url
:
urlParams
.
save
,
params
,
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'新增成功!'
);
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
actionRef
.
current
.
reload
();
}
},
}));
},
}
}
...
...
@@ -71,11 +99,19 @@ function Account(props) {
return
(
<
PremButton
pop=
{
{
title
:
'是否删除该
用户
?'
,
title
:
'是否删除该
设备
?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
()
=>
{
alert
(
0
);
onConfirm
:
async
()
=>
{
let
res
=
await
doFetch
({
url
:
urlParams
.
remove
,
params
:
{
id
:
row
.
id
}
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'删除成功!'
);
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
actionRef
.
current
.
reload
();
}
},
}
}
btn=
{
{
...
...
@@ -89,16 +125,12 @@ function Account(props) {
};
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
set
d
rawer
);
let
defcolumn
=
getcolumns
(
set
D
rawer
);
return
defcolumn
.
concat
({
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
detail
(
text
,
row
,
_
,
action
),
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
),
],
render
:
(
text
,
row
,
_
,
action
)
=>
[
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
)],
});
},
[]);
...
...
@@ -119,7 +151,7 @@ function Account(props) {
<
AutoTable
pagetitle=
{
<
h3
style=
{
{
marginBottom
:
0
,
fontWeight
:
400
}
}
>
设备台账
</
h3
>
}
columns=
{
columns
}
path=
"/ngic-auth/sysUser/query/page"
path=
{
urlParams
.
list
}
actionRef=
{
actionRef
}
pageextra=
{
'add'
}
resizeable=
{
true
}
...
...
@@ -160,4 +192,4 @@ function Account(props) {
);
}
export
default
Account
;
export
default
Model
;
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