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
e5762547
Commit
e5762547
authored
Nov 24, 2022
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1124
parent
52a98657
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
507 additions
and
148 deletions
+507
-148
settings.json
.vscode/settings.json
+2
-1
package.json
package.json
+1
-1
index.jsx
src/pages/device/account/index.jsx
+5
-13
index.jsx
src/pages/device/supplier/index.jsx
+2
-1
columns.js
src/pages/setting/organization/columns.js
+19
-65
index.jsx
src/pages/setting/organization/index.jsx
+146
-22
columns.js
src/pages/setting/role/columns.js
+1
-2
index.jsx
src/pages/setting/role/index.jsx
+83
-16
columns.js
src/pages/setting/users/columns.js
+165
-14
index.jsx
src/pages/setting/users/index.jsx
+82
-12
yarn.lock
yarn.lock
+1
-1
No files found.
.vscode/settings.json
View file @
e5762547
{
"editor.formatOnSave"
:
true
,
"prettier.requireConfig"
:
true
,
"editor.defaultFormatter"
:
"esbenp.prettier-vscode"
"editor.defaultFormatter"
:
"esbenp.prettier-vscode"
,
"cSpell.words"
:
[
"onselecte"
,
"setdrawer"
]
}
package.json
View file @
e5762547
...
...
@@ -53,7 +53,7 @@
"
braft-editor
"
:
"
^2.3.9
"
,
"
classnames
"
:
"
^2.3.0
"
,
"
crypto-js
"
:
"
^4.1.1
"
,
"
lodash
"
:
"
^4.17.
0
"
,
"
lodash
"
:
"
^4.17.
21
"
,
"
moment
"
:
"
^2.29.4
"
,
"
omit.js
"
:
"
^2.0.2
"
,
"
query-string
"
:
"
^7.1.1
"
,
...
...
src/pages/device/account/index.jsx
View file @
e5762547
...
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-10 09:39:56
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-2
2 15:20:40
* @Last Modified time: 2022-11-2
3 16:29:59
*/
import
*
as
React
from
'react'
;
...
...
@@ -25,6 +25,7 @@ function Model(props) {
[
drawer
,
setDrawer
]
=
useState
({
visible
:
false
,
}),
[
extraparams
,
setextraparams
]
=
useState
({}),
[
currDrawer
,
setCurrDrawer
]
=
useState
({
visible
:
false
,
}),
...
...
@@ -487,7 +488,7 @@ function Model(props) {
params
,
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'
新增
成功!'
);
message
.
success
(
'
编辑
成功!'
);
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
...
...
@@ -2014,21 +2015,11 @@ function Model(props) {
},
[]);
const
onselecteTree
=
async
(
selectedKeys
,
e
,
alldata
)
=>
{
console
.
log
(
e
.
node
);
let
params
=
{
treeNodeType
:
e
.
node
.
type
,
treeNodeKey
:
e
.
node
.
key
,
pageSize
:
15
,
pageIndex
:
1
,
};
const
res
=
await
doFetch
({
url
:
urlParams
.
list
,
params
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'查询成功!'
);
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
}
setextraparams
(
params
);
};
const
selectMoreDrawerType
=
(
type
)
=>
{
...
...
@@ -2100,6 +2091,7 @@ function Model(props) {
},
}
}
x=
{
1500
}
extraparams=
{
extraparams
}
/>
</
Content
>
</
Layout
>
...
...
src/pages/device/supplier/index.jsx
View file @
e5762547
...
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-
14 10:39:38
* @Last Modified time: 2022-11-
23 15:43:57
*/
import
*
as
React
from
'react'
;
...
...
@@ -208,6 +208,7 @@ function Supplier(props) {
...
s
,
visible
:
false
,
}));
actionRef
.
current
.
reload
();
}
}
{
...
drawer
}
/>
...
...
src/pages/setting/organization/columns.js
View file @
e5762547
function
getcolumns
(
setdrawer
)
{
return
[
{
title
:
'基础信息'
,
valueType
:
'split'
,
},
{
title
:
'用户名'
,
dataIndex
:
'accountName'
,
title
:
'组织名称'
,
dataIndex
:
'title'
,
key
:
'departmentName'
,
formItemProps
:
{
rules
:
[
{
...
...
@@ -16,45 +13,22 @@ function getcolumns(setdrawer) {
],
},
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
:
'userName'
,
key
:
'userId'
,
hideInForm
:
{
accountName
:
{
reverse
:
[
'1'
,
'2'
,
'5'
],
},
remark
:
[
'3'
],
},
title
:
'组织类型'
,
dataIndex
:
'departmentTypeName'
,
key
:
'departmentTypeName'
,
valueType
:
'input'
,
search
:
false
,
fieldProps
:
{
disabled
:
true
,
},
},
{
title
:
'额外信息'
,
valueType
:
'split'
,
},
{
title
:
'联系电话'
,
dataIndex
:
'telephone'
,
title
:
'组织代码'
,
dataIndex
:
'departmentCode'
,
key
:
'departmentCode'
,
formItemProps
:
{
rules
:
[
{
...
...
@@ -66,8 +40,9 @@ function getcolumns(setdrawer) {
search
:
false
,
},
{
title
:
'邮箱'
,
dataIndex
:
'mailNo'
,
title
:
'上级组织'
,
dataIndex
:
'parentKey'
,
key
:
'parentKey'
,
formItemProps
:
{
rules
:
[
{
...
...
@@ -76,32 +51,11 @@ function getcolumns(setdrawer) {
},
],
},
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
:
'此项为必填项'
,
},
],
placeholder
:
'请输入'
,
disabled
:
true
,
},
search
:
false
,
},
];
}
...
...
src/pages/setting/organization/index.jsx
View file @
e5762547
/* 组织管理
* @Author: Li Hanlin
* @Date: 2022-11-24 11:16:02
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-24 14:44:11
*/
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
Organization
(
props
)
{
function
Type
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
set
d
rawer
]
=
useState
({
const
[
drawer
,
set
D
rawer
]
=
useState
({
visible
:
false
,
});
const
urlParams
=
{
save
:
'/auth/sysDepartment/save'
,
remove
:
'/auth/sysDepartment/deleteById'
,
list
:
'/auth/sysDepartment/query/tree'
,
detail
:
'/asset/equipmentType/queryById'
,
};
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
...
...
@@ -19,7 +34,7 @@ function Organization(props) {
size
:
'small'
,
type
:
'link'
,
onClick
:
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
...
...
@@ -41,12 +56,40 @@ function Organization(props) {
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
// detailpath: urlParams.detail,
// params:
{
id
:
row
.
key
},
item
:
{
...
row
,
departmentName
:
row
.
title
,
},
title
:
'编辑'
,
val
:
'edit'
,
onFinish
:
async
(
vals
)
=>
{
console
.
log
(
vals
);
let
params
=
{
...
vals
,
id
:
row
.
key
,
parentId
:
row
.
parentKey
,
departmentType
:
row
.
departmentType
,
};
console
.
log
(
params
);
delete
params
.
title
;
let
res
=
await
doFetch
({
url
:
urlParams
.
save
,
params
,
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'编辑成功!'
);
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
actionRef
.
current
.
reload
();
}
},
}));
},
}
}
...
...
@@ -56,15 +99,71 @@ function Organization(props) {
);
};
const
addChild
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
setDrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
detailpath
:
null
,
item
:
{
parentKey
:
row
.
title
,
departmentTypeName
:
'部门类型'
,
},
title
:
'新增子级'
,
val
:
'addChild'
,
onFinish
:
async
(
vals
)
=>
{
let
params
=
{
...
vals
,
parentId
:
row
.
key
,
equipmentTypeName
:
vals
.
title
,
departmentType
:
'1'
,
};
delete
params
.
title
;
delete
params
.
parentKey
;
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
:
'是否删除该
用户
?'
,
title
:
'是否删除该
设备类型
?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
()
=>
{
alert
(
0
);
onConfirm
:
async
()
=>
{
let
res
=
await
doFetch
({
url
:
urlParams
.
remove
,
params
:
{
id
:
row
.
key
}
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'删除成功!'
);
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
actionRef
.
current
.
reload
();
}
},
}
}
btn=
{
{
...
...
@@ -78,55 +177,80 @@ function Organization(props) {
};
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setdrawer
);
let
defcolumn
=
getcolumns
(
setDrawer
);
if
(
drawer
?.
val
==
'add'
||
drawer
?.
val
==
'edit'
)
{
defcolumn
[
3
].
hideInForm
=
true
;
}
else
{
defcolumn
[
3
].
hideInForm
=
false
;
}
return
defcolumn
.
concat
({
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
detail
(
text
,
row
,
_
,
action
),
addChild
(
text
,
row
,
_
,
action
),
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
),
],
});
},
[]);
},
[
drawer
.
val
]);
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
,
type
:
'primary'
,
onClick
:
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
null
,
detailpath
:
null
,
item
:
{
departmentTypeName
:
'公司类型'
,
},
title
:
'新增'
,
detailpath
:
null
,
val
:
'add'
,
onFinish
:
async
(
vals
)
=>
{
let
params
=
{
...
vals
,
departmentType
:
0
,
};
let
res
=
await
doFetch
({
url
:
urlParams
.
save
,
params
,
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'新增成功!'
);
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
actionRef
.
current
.
reload
();
}
},
}));
},
},
}
}
pagination=
{
false
}
/>
<
DrawerPro
fields=
{
columns
}
detailpath=
"/ngic-auth/sysUser/query/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 +261,4 @@ function Organization(props) {
);
}
export
default
Organization
;
export
default
Type
;
src/pages/setting/role/columns.js
View file @
e5762547
...
...
@@ -3,11 +3,10 @@ function getcolumns(setdrawer) {
{
title
:
'角色名称'
,
dataIndex
:
'roleName'
,
width
:
120
,
key
:
'roleName'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'备注'
,
hideInTable
:
true
,
dataIndex
:
'remark'
,
key
:
'remarks'
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
key
:
'remark'
,
search
:
false
},
];
}
...
...
src/pages/setting/role/index.jsx
View file @
e5762547
...
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-2
2 17:21:24
* @Last Modified time: 2022-11-2
4 15:39:28
*/
import
*
as
React
from
'react'
;
...
...
@@ -16,7 +16,7 @@ import { message } from 'antd';
import
{
Drawer
}
from
'antd'
;
import
PermissionTree
from
'@/components/PermissionTree/Permissiontree'
;
function
User
(
props
)
{
function
Role
(
props
)
{
const
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
setDrawer
]
=
useState
({
...
...
@@ -25,31 +25,33 @@ function User(props) {
});
const
urlParams
=
{
save
:
'/auth/sys
Factory/saveOrUpdat
e'
,
remove
:
'/auth/sys
Factory/delete
'
,
list
:
'/auth/sys
User
/queryList'
,
save
:
'/auth/sys
Role/sav
e'
,
remove
:
'/auth/sys
Role/deleteById
'
,
list
:
'/auth/sys
Role
/queryList'
,
detail
:
'/auth/sysFactory/getById'
,
person
:
'/auth/sysUser/queryPageByRoleId'
,
};
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
const
detail
Person
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
type
:
'link'
,
//
type: 'link',
onClick
:
()
=>
{
setDrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
title
:
'详情'
,
val
:
'detail'
,
title
:
row
.
userName
+
'的详细信息'
,
val
:
'only'
,
type
:
'person'
,
title
:
row
.
roleName
+
' - 人员列表'
,
}));
},
}
}
>
详情
查看人员
</
PremButton
>
);
};
...
...
@@ -67,7 +69,6 @@ function User(props) {
title
:
'编辑'
,
val
:
'edit'
,
onFinish
:
async
(
vals
)
=>
{
console
.
log
(
1
);
let
params
=
{
...
vals
,
id
:
row
.
id
,
...
...
@@ -77,7 +78,7 @@ function User(props) {
params
,
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'
新增
成功!'
);
message
.
success
(
'
编辑
成功!'
);
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
...
...
@@ -165,6 +166,66 @@ function User(props) {
);
};
const
PersonTable
=
()
=>
{
return
(
<>
<
AutoTable
pagetitle=
{
false
}
columns=
{
[
{
title
:
'用户名'
,
dataIndex
:
'username'
,
key
:
'username'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'姓名'
,
dataIndex
:
'fullName'
,
key
:
'fullName'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'公司名称'
,
dataIndex
:
'organizationName'
,
key
:
'organizationId'
,
valueType
:
'select'
,
options
:
{
path
:
'/auth/sysDepartment/query/organization/selectbox'
,
params
:
{}
},
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'部门名称'
,
dataIndex
:
'departmentName'
,
valueType
:
'select'
,
key
:
'departmentId'
,
options
:
{
path
:
'/auth/sysDepartment/query/depart/selectbox'
,
linkParams
:
{
organizationId
:
'parentId'
,
},
},
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'工厂名称'
,
dataIndex
:
'factoryNames'
,
key
:
'factoryNames'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'负责车间'
,
dataIndex
:
'shopNames'
,
key
:
'shopNames'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
]
}
path=
{
urlParams
.
person
}
params=
{
{
roleId
:
drawer
?.
item
?.
id
}
}
actionRef=
{
actionRef
}
resizeable=
{
false
}
/>
</>
);
};
// 数据分权
const
distribution
=
(
text
,
row
,
_
,
action
)
=>
{};
...
...
@@ -174,14 +235,18 @@ function User(props) {
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
)],
render
:
(
text
,
row
,
_
,
action
)
=>
[
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
),
detailPerson
(
text
,
row
,
_
,
action
),
],
});
},
[]);
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
AutoTable
pagetitle=
{
<
h3
className=
"page-title"
>
用户
管理
</
h3
>
}
pagetitle=
{
<
h3
className=
"page-title"
>
角色
管理
</
h3
>
}
columns=
{
columns
}
path=
{
urlParams
.
list
}
actionRef=
{
actionRef
}
...
...
@@ -238,7 +303,9 @@ function User(props) {
}));
}
}
{
...
drawer
}
/>
>
{
drawer
.
type
==
'person'
?
<
PersonTable
/>
:
null
}
</
DrawerPro
>
<
Drawer
title=
"角色权限"
...
...
@@ -267,4 +334,4 @@ function User(props) {
);
}
export
default
User
;
export
default
Role
;
src/pages/setting/users/columns.js
View file @
e5762547
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
Image
}
from
'antd'
;
function
getcolumns
(
setdrawer
)
{
return
[
{
...
...
@@ -13,6 +15,26 @@ function getcolumns(setdrawer) {
width
:
100
,
key
:
'fullName'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
render
:
(
text
,
row
)
=>
{
return
(
<
a
onClick
=
{()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
title
:
'详情'
,
detailpath
:
'/auth/sysUser/detail'
,
params
:
{
id
:
row
.
id
},
val
:
'detail'
,
title
:
row
.
fullName
+
'的详细信息'
,
}));
}}
>
{
row
.
fullName
}
<
/a
>
);
},
},
{
title
:
'手机号'
,
hideInTable
:
true
,
dataIndex
:
'telephone'
,
key
:
'telephone'
},
{
title
:
'邮箱'
,
dataIndex
:
'mailNo'
,
key
:
'mailNo'
,
hideInTable
:
true
,
search
:
false
},
...
...
@@ -24,7 +46,6 @@ function getcolumns(setdrawer) {
key
:
'organizationId'
,
valueType
:
'select'
,
options
:
{
path
:
'/auth/sysDepartment/query/organization/selectbox'
,
params
:
{}
},
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'部门名称'
,
...
...
@@ -40,26 +61,62 @@ function getcolumns(setdrawer) {
},
},
},
{
title
:
'负责工厂'
,
dataIndex
:
'factoryNames'
,
align
:
'center'
,
key
:
'factoryNames'
,
hideInTable
:
true
,
hideInForm
:
true
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'负责车间'
,
dataIndex
:
'shopNames'
,
key
:
'shopNames'
,
align
:
'center'
,
hideInTable
:
true
,
hideInForm
:
true
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'角色名称'
,
dataIndex
:
'roleNames'
,
key
:
'roleNames'
,
hideInForm
:
true
,
hideInTable
:
true
,
},
{
title
:
'负责工厂'
,
dataIndex
:
'factoryNames'
,
key
:
'factoryNames'
,
search
:
false
,
fieldProps
:
{
placeholder
:
'请选择'
,
showSearch
:
true
,
mode
:
'multiple'
,
},
width
:
120
,
align
:
'center'
,
valueType
:
'select'
,
options
:
{
path
:
'/auth/sysFactory/getAllFactorySelection'
,
params
:
{}
},
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'负责车间'
,
dataIndex
:
'shopNames'
,
search
:
false
,
align
:
'center'
,
fieldProps
:
{
placeholder
:
'请选择'
,
showSearch
:
true
,
mode
:
'multiple'
,
},
width
:
120
,
valueType
:
'select'
,
options
:
{
path
:
'/auth/sysShop/getShopSelectionByFactory'
,
path
:
'/auth/sysShop/getShopSelectionByFactory
IdList
'
,
linkParams
:
{
factory
Id
:
'
'
,
factory
Names
:
'factoryIdList
'
,
},
},
key
:
'shopId'
,
...
...
@@ -70,36 +127,130 @@ function getcolumns(setdrawer) {
width
:
120
,
dataIndex
:
'sectionName'
,
align
:
'center'
,
search
:
false
,
key
:
'sectionId'
,
fieldProps
:
{
placeholder
:
'请选择'
,
showSearch
:
true
,
mode
:
'multiple'
,
},
valueType
:
'select'
,
options
:
{
path
:
'/auth/sysSection/getAllSectionSelectionByShop'
,
path
:
'/auth/sysSection/getAllSectionSelectionByShop
IdList
'
,
linkParams
:
{
shopId
:
''
,
shopId
:
'
shopIdList
'
,
},
},
},
{
title
:
'负责产线'
,
search
:
false
,
width
:
120
,
dataIndex
:
'productionLines'
,
valueType
:
'select'
,
fieldProps
:
{
placeholder
:
'请选择'
,
showSearch
:
true
,
mode
:
'multiple'
,
},
search
:
false
,
key
:
'productLineName'
,
align
:
'center'
,
options
:
{
path
:
'/auth/sysProductionLine/getAllProductLineSelectionByShop'
,
path
:
'/auth/sysProductionLine/getAllProductLineSelectionByShop
IdList
'
,
linkParams
:
{
shopId
:
''
,
shopId
:
'
shopIdList
'
,
},
},
},
{
title
:
'角色配置'
,
dataIndex
:
'roleNames'
,
key
:
'roleNames'
},
{
title
:
'直属领导'
,
dataIndex
:
'parentName'
,
key
:
'parentId'
},
{
title
:
'状态'
,
hideInTable
:
true
,
dataIndex
:
'status'
,
key
:
'status'
},
{
title
:
'状态'
,
dataIndex
:
'statusName'
,
key
:
'status'
,
search
:
false
},
{
title
:
'备注'
,
hideInTable
:
true
,
dataIndex
:
'remarks'
,
key
:
'remarks'
},
{
title
:
'个人图片'
,
hideInTable
:
true
,
dataIndex
:
'userImgList'
,
key
:
'userImgList'
},
{
title
:
'角色配置'
,
dataIndex
:
'roleNames'
,
key
:
'roleNames'
,
valueType
:
'select'
,
search
:
false
,
fieldProps
:
{
placeholder
:
'请选择'
,
showSearch
:
true
,
mode
:
'multiple'
,
},
options
:
{
path
:
'/auth/sysRole/selection'
,
},
},
{
title
:
'直属领导'
,
valueType
:
'select'
,
dataIndex
:
'parentName'
,
key
:
'parentId'
,
options
:
{
path
:
'/auth/sysUser/selection'
,
},
fieldProps
:
{
placeholder
:
'请选择'
,
showSearch
:
true
,
},
},
{
title
:
'状态'
,
hideInTable
:
true
,
dataIndex
:
'statusName'
,
key
:
'status'
,
valueType
:
'radio'
,
options
:
[
{
label
:
'启用'
,
value
:
1
,
},
{
label
:
'禁用'
,
value
:
0
,
},
],
},
// {
// title: '状态',
// width: 50,
// hideInForm: true,
// dataIndex: 'statusName',
// key: 'status',
// search: false,
// },
{
title
:
'备注'
,
hideInTable
:
true
,
dataIndex
:
'remarks'
,
valueType
:
'textarea'
,
key
:
'remarks'
,
search
:
false
,
},
// { title: '个人图片', hideInTable: true, dataIndex: 'userImgList', key: 'userImgList' },
{
title
:
'个人图片'
,
search
:
false
,
dataIndex
:
'userImgList'
,
key
:
'userImgList'
,
valueType
:
'uploadImage'
,
hideInTable
:
true
,
fieldProps
:
{
limit
:
2
,
},
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
render
:
(
text
,
row
)
=>
{
if
(
row
?.
pictureUrl
==
null
)
{
return
'暂无图片'
;
}
else
{
return
<
Image
width
=
{
70
}
src
=
{
row
.
pictureUrl
}
/>
;
}
},
},
];
}
...
...
src/pages/setting/users/index.jsx
View file @
e5762547
...
...
@@ -2,17 +2,18 @@
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-2
2 15:50:02
* @Last Modified time: 2022-11-2
4 15:02:31
*/
import
*
as
React
from
'react'
;
import
{
useState
,
useMemo
,
useRef
}
from
'react'
;
import
{
useState
,
useMemo
,
useRef
,
useCallback
}
from
'react'
;
import
DrawerPro
from
'@/components/DrawerPro'
;
import
AutoTable
from
'@/components/AutoTable'
;
import
PremButton
from
'@/components/PremButton'
;
import
InitForm
from
'@/components/InitForm'
;
import
getcolumns
from
'./columns'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
message
}
from
'antd'
;
import
{
message
,
AutoComplete
}
from
'antd'
;
function
User
(
props
)
{
const
actionRef
=
useRef
(),
...
...
@@ -22,10 +23,10 @@ function User(props) {
});
const
urlParams
=
{
save
:
'/auth/sys
Factory/saveOrUpdat
e'
,
remove
:
'/auth/sys
Factory/delete
'
,
save
:
'/auth/sys
User/sav
e'
,
remove
:
'/auth/sys
User/deleteById
'
,
list
:
'/auth/sysUser/queryList'
,
detail
:
'/auth/sys
Factory/getById
'
,
detail
:
'/auth/sys
User/detail
'
,
};
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
...
...
@@ -60,7 +61,9 @@ function User(props) {
setDrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
row
,
// item: row,
detailpath
:
urlParams
.
detail
,
params
:
{
id
:
row
.
id
},
title
:
'编辑'
,
val
:
'edit'
,
onFinish
:
async
(
vals
)
=>
{
...
...
@@ -74,7 +77,7 @@ function User(props) {
params
,
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'
新增
成功!'
);
message
.
success
(
'
编辑
成功!'
);
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
...
...
@@ -95,7 +98,7 @@ function User(props) {
return
(
<
PremButton
pop=
{
{
title
:
'是否删除该
工厂
?'
,
title
:
'是否删除该
用户
?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
async
()
=>
{
...
...
@@ -120,6 +123,56 @@ function User(props) {
);
};
// const Adduser = () => {
// const [value, setValue] = useState('');
// const [options, setOptions] = useState([]);
// const debounce = lodash.debounce;
// const serchHandle = useCallback(
// debounce(async (val) => {
// console.log(val + '!!');
// if (val) {
// let res = await doFetch({
// url: '/auth/sysUser/queryLikeIotUsername',
// params: { username: val },
// });
// console.log(res);
// }
// }, 800),
// [],
// );
// const onSearch = (val) => {
// serchHandle(val);
// };
// const onSelect = (data) => {
// console.log('onSelect', data);
// };
// const onChange = (data) => {
// setValue(data);
// };
// return (
// <>
// <div style={{ marginBottom: 22 }}>
// <div style={{ marginBottom: 8 }}>用户名</div>
// <AutoComplete
// options={options}
// style={{
// width: '50%',
// }}
// onSelect={onSelect}
// onSearch={onSearch}
// placeholder="请输入用户名"
// />
// </div>
// <InitForm
// fields={columns}
// onFinish={() => {
// console.log(1);
// }}
// />
// </>
// );
// };
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setDrawer
);
return
defcolumn
.
concat
({
...
...
@@ -148,15 +201,30 @@ function User(props) {
setDrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
item
:
null
,
item
:
{
status
:
1
,
},
detailpath
:
null
,
title
:
'新增'
,
// type: 'add',
val
:
'add'
,
onFinish
:
async
(
vals
)
=>
{
console
.
log
(
1
);
console
.
log
(
vals
);
let
params
=
{
...
vals
,
factoryIdList
:
vals
.
factoryNames
,
shopIdList
:
vals
.
shopId
,
sectionIdList
:
vals
.
sectionId
,
productionLineIdList
:
vals
.
productLineName
,
roleIdList
:
vals
.
roleNames
,
userCharReqList
:
[],
};
delete
params
.
factoryNames
;
delete
params
.
shopId
;
delete
params
.
sectionId
;
delete
params
.
productLineName
;
delete
params
.
roleNames
;
console
.
log
(
params
,
'!!!!'
);
let
res
=
await
doFetch
({
url
:
urlParams
.
save
,
params
,
...
...
@@ -190,7 +258,9 @@ function User(props) {
}));
}
}
{
...
drawer
}
/>
>
{
/* {drawer?.type == 'add' ? <Adduser /> : null} */
}
</
DrawerPro
>
</
div
>
);
}
...
...
yarn.lock
View file @
e5762547
...
...
@@ -9391,7 +9391,7 @@ lodash.zip@^4.2.0:
resolved "https://registry.npmmirror.com/lodash.zip/-/lodash.zip-4.2.0.tgz#ec6662e4896408ed4ab6c542a3990b72cc080020"
integrity sha512-C7IOaBBK/0gMORRBd8OETNx3kmOkgIWIPvyDpZSCTwUrpYmgZwJkjZeOD8ww4xbOUOs4/attY+pciKvadNfFbg==
lodash@^4.0.1, lodash@^4.17.
0, lodash@^4.17.
11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4:
lodash@^4.0.1, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4:
version "4.17.21"
resolved "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
...
...
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