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
1f33056e
Commit
1f33056e
authored
Nov 18, 2022
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1118
parent
79c1e48d
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
604 additions
and
232 deletions
+604
-232
columns.js
src/pages/device/account/columns.js
+1
-1
index.jsx
src/pages/device/account/index.jsx
+252
-28
columns.js
src/pages/setting/role/columns.js
+188
-99
columns.js
src/pages/setting/users/columns.js
+84
-83
index.jsx
src/pages/setting/users/index.jsx
+79
-21
No files found.
src/pages/device/account/columns.js
View file @
1f33056e
...
...
@@ -110,7 +110,7 @@ function getcolumns(setdrawer) {
key
:
'productLineName'
,
align
:
'center'
,
options
:
{
path
:
'auth/sysProductionLine/getAllProductLineSelectionByShop'
,
path
:
'
/
auth/sysProductionLine/getAllProductLineSelectionByShop'
,
linkParams
:
{
shopId
:
''
,
},
...
...
src/pages/device/account/index.jsx
View file @
1f33056e
This diff is collapsed.
Click to expand it.
src/pages/setting/role/columns.js
View file @
1f33056e
function
getcolumns
(
setdrawer
)
{
return
[
{
title
:
'基础信息'
,
valueType
:
'split'
,
},
{
title
:
'用户名'
,
dataIndex
:
'accountName'
,
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
/* 用户管理
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-18 15:43:51
*/
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
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
message
}
from
'antd'
;
function
User
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
setDrawer
]
=
useState
({
visible
:
false
,
});
const
urlParams
=
{
save
:
'/auth/sysFactory/saveOrUpdate'
,
remove
:
'/auth/sysFactory/delete'
,
list
:
'/auth/sysUser/queryList'
,
detail
:
'/auth/sysFactory/getById'
,
};
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn
=
{{
size
:
'small'
,
type
:
'link'
,
onClick
:
()
=>
{
setDrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
title
:
'详情'
,
val
:
'detail'
,
title
:
row
.
userName
+
'的详细信息'
,
}));
},
],
},
initialValue
:
'默认值'
,
hideInForm
:
false
,
search
:
false
,
render
:
(
text
,
row
)
=>
{
return
(
<
a
onClick
=
{()
=>
{
setdrawer
?.((
s
)
=>
({
}}
>
详情
<
/PremButton
>
);
};
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn
=
{{
size
:
'small'
,
onClick
:
()
=>
{
setDrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
title
:
'编辑'
,
val
:
'edit'
,
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
();
}
},
}));
},
}}
>
编辑
<
/PremButton
>
);
};
const
remove
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
pop
=
{{
title
:
'是否删除该工厂?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
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
=
{{
size
:
'small'
,
type
:
'danger'
,
}}
>
删除
<
/PremButton
>
);
};
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setDrawer
);
return
defcolumn
.
concat
({
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
)],
});
},
[]);
return
(
<
div
style
=
{{
position
:
'relative'
}}
>
<
AutoTable
pagetitle
=
{
<
h3
className
=
"page-title"
>
角色管理
<
/h3>
}
columns
=
{
columns
}
path
=
{
urlParams
.
list
}
actionRef
=
{
actionRef
}
pageextra
=
{
'add'
}
resizeable
=
{
false
}
addconfig
=
{{
// access: 'sysDepartment_save',
btn
:
{
type
:
'primary'
,
disabled
:
false
,
onClick
:
()
=>
{
setDrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
null
,
detailpath
:
null
,
title
:
'新增'
,
val
:
'add'
,
onFinish
:
async
(
vals
)
=>
{
console
.
log
(
1
);
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
();
}
},
}));
}}
>
{
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
:
'此项为必填项'
,
},
],
},
},
];
}}
/
>
<
DrawerPro
fields
=
{
columns
}
// detailpath={urlParams.detail}
// params={{ id: drawer?.item?.id }}
defaultFormValue
=
{
drawer
?.
item
??
{}}
formRef
=
{
formRef
}
placement
=
"right"
onClose
=
{()
=>
{
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
}}
{...
drawer
}
/
>
<
/div
>
);
}
export
default
getcolumns
;
export
default
User
;
src/pages/setting/users/columns.js
View file @
1f33056e
function
getcolumns
(
setdrawer
)
{
return
[
{
title
:
'基础信息'
,
valueType
:
'split'
,
},
{
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
>
);
},
dataIndex
:
'username'
,
key
:
'username'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'姓名'
,
dataIndex
:
'userName'
,
key
:
'userId'
,
hideInForm
:
{
accountName
:
{
reverse
:
[
'1'
,
'2'
,
'5'
],
dataIndex
:
'fullName'
,
key
:
'fullName'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'手机号'
,
dataIndex
:
'telephone'
,
key
:
'telephone'
},
{
title
:
'邮箱'
,
dataIndex
:
'mailNo'
,
key
:
'mailNo'
},
{
title
:
'公司名称'
,
dataIndex
:
'organizationName'
,
key
:
'organizationId'
,
valueType
:
'select'
,
options
:
{
path
:
'/emspro'
,
params
:
{}
},
},
{
title
:
'公司名称'
,
align
:
'center'
,
dataIndex
:
'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'
,
},
remark
:
[
'3'
],
},
search
:
false
,
},
{
title
:
'额外信息'
,
valueType
:
'split'
,
title
:
'负责工厂'
,
dataIndex
:
'factoryName'
,
key
:
'factoryId'
,
width
:
120
,
align
:
'center'
,
valueType
:
'select'
,
options
:
{
path
:
'/auth/sysFactory/getAllFactorySelection'
,
params
:
{}
},
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'联系电话'
,
dataIndex
:
'telephone'
,
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
title
:
'负责车间'
,
dataIndex
:
'shopName'
,
align
:
'center'
,
width
:
120
,
valueType
:
'select'
,
options
:
{
path
:
'/auth/sysShop/getShopSelectionByFactory'
,
linkParams
:
{
factoryId
:
''
,
},
},
search
:
false
,
key
:
'shopId'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'邮箱'
,
dataIndex
:
'mailNo'
,
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
],
title
:
'负责工段'
,
width
:
120
,
dataIndex
:
'sectionName'
,
align
:
'center'
,
key
:
'sectionId'
,
valueType
:
'select'
,
options
:
{
path
:
'/auth/sysSection/getAllSectionSelectionByShop'
,
linkParams
:
{
shopId
:
''
,
},
},
search
:
false
,
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
valueType
:
'editor'
,
title
:
'负责产线'
,
width
:
120
,
dataIndex
:
'productionLines'
,
valueType
:
'select'
,
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
:
'此项为必填项'
,
},
],
key
:
'productLineName'
,
align
:
'center'
,
options
:
{
path
:
'/auth/sysProductionLine/getAllProductLineSelectionByShop'
,
linkParams
:
{
shopId
:
''
,
},
},
},
{
title
:
'角色配置'
,
dataIndex
:
'roleNames'
,
key
:
'roleNames'
},
{
title
:
'直属领导名称'
,
dataIndex
:
'parentName'
,
key
:
'parentId'
},
{
title
:
'状态'
,
dataIndex
:
'status'
,
key
:
'status'
},
{
title
:
'状态名'
,
dataIndex
:
'statusName'
,
key
:
'status'
,
search
:
false
},
{
title
:
'备注'
,
dataIndex
:
'remarks'
,
key
:
'remarks'
},
];
}
...
...
src/pages/setting/users/index.jsx
View file @
1f33056e
/* 用户管理
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-18 14:23:58
*/
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
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
message
}
from
'antd'
;
function
User
s
(
props
)
{
function
User
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
set
d
rawer
]
=
useState
({
const
[
drawer
,
set
D
rawer
]
=
useState
({
visible
:
false
,
});
const
urlParams
=
{
save
:
'/auth/sysFactory/saveOrUpdate'
,
remove
:
'/auth/sysFactory/delete'
,
list
:
'/auth/sysUser/queryList'
,
detail
:
'/auth/sysFactory/getById'
,
};
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
...
...
@@ -19,7 +35,7 @@ function Users(props) {
size
:
'small'
,
type
:
'link'
,
onClick
:
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
...
...
@@ -41,12 +57,31 @@ function Users(props) {
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
title
:
'编辑'
,
val
:
'edit'
,
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
();
}
},
}));
},
}
}
...
...
@@ -60,11 +95,19 @@ function Users(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=
{
{
...
...
@@ -78,41 +121,55 @@ function Users(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
)],
});
},
[]);
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
AutoTable
pagetitle=
"用户管理"
pagetitle=
{
<
h3
className=
"page-title"
>
用户管理
</
h3
>
}
columns=
{
columns
}
path=
"/ngic-auth/sysUser/query/page"
path=
{
urlParams
.
list
}
actionRef=
{
actionRef
}
pageextra=
{
'add'
}
resizeable=
{
tru
e
}
resizeable=
{
fals
e
}
addconfig=
{
{
// access: 'sysDepartment_save',
btn
:
{
type
:
'primary'
,
disabled
:
false
,
onClick
:
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
null
,
detailpath
:
null
,
title
:
'新增'
,
val
:
'add'
,
onFinish
:
async
(
vals
)
=>
{
console
.
log
(
1
);
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
();
}
},
}));
},
},
...
...
@@ -121,12 +178,13 @@ function Users(props) {
<
DrawerPro
fields=
{
columns
}
detailpath=
"/ngic-auth/sysUser/query/detail"
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
// detailpath={urlParams.detail}
// params={{ id: drawer?.item?.id }}
defaultFormValue=
{
drawer
?.
item
??
{}
}
formRef=
{
formRef
}
placement=
"right"
onClose=
{
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
...
...
@@ -137,4 +195,4 @@ function Users(props) {
);
}
export
default
User
s
;
export
default
User
;
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