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
Show 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) {
...
@@ -110,7 +110,7 @@ function getcolumns(setdrawer) {
key
:
'productLineName'
,
key
:
'productLineName'
,
align
:
'center'
,
align
:
'center'
,
options
:
{
options
:
{
path
:
'auth/sysProductionLine/getAllProductLineSelectionByShop'
,
path
:
'
/
auth/sysProductionLine/getAllProductLineSelectionByShop'
,
linkParams
:
{
linkParams
:
{
shopId
:
''
,
shopId
:
''
,
},
},
...
...
src/pages/device/account/index.jsx
View file @
1f33056e
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Author: Li Hanlin
* @Date: 2022-11-10 09:39:56
* @Date: 2022-11-10 09:39:56
* @Last Modified by: Li Hanlin
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-1
7 17:25:54
* @Last Modified time: 2022-11-1
8 17:29:28
*/
*/
import
*
as
React
from
'react'
;
import
*
as
React
from
'react'
;
...
@@ -12,9 +12,10 @@ import AutoTable from '@/components/AutoTable';
...
@@ -12,9 +12,10 @@ import AutoTable from '@/components/AutoTable';
import
PremButton
from
'@/components/PremButton'
;
import
PremButton
from
'@/components/PremButton'
;
import
getcolumns
from
'./columns'
;
import
getcolumns
from
'./columns'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
message
,
Dropdown
,
Menu
,
Layout
,
Button
,
Space
}
from
'antd'
;
import
{
message
,
Dropdown
,
Menu
,
Layout
,
Button
,
Space
,
Divider
,
Tabs
}
from
'antd'
;
import
TreeRender
from
'@/components/TreeRender'
;
import
TreeRender
from
'@/components/TreeRender'
;
import
{
ProDescriptions
}
from
'@ant-design/pro-components'
;
import
{
ProDescriptions
}
from
'@ant-design/pro-components'
;
import
InitForm
from
'@/components/InitForm'
;
const
{
Sider
,
Content
}
=
Layout
;
const
{
Sider
,
Content
}
=
Layout
;
function
Model
(
props
)
{
function
Model
(
props
)
{
...
@@ -145,28 +146,27 @@ function Model(props) {
...
@@ -145,28 +146,27 @@ function Model(props) {
item
:
{
item
:
{
id
:
row
.
id
,
id
:
row
.
id
,
},
},
title
:
'详情'
,
val
:
'only'
,
val
:
'only'
,
title
:
'编辑子设备'
,
title
:
'编辑子设备'
,
onFinish
:
async
(
vals
)
=>
{
//
onFinish: async (vals) =>
{
console
.
log
(
1
);
//
console.log(1);
let
params
=
{
//
let params =
{
...
vals
,
//
...vals,
id
:
row
.
id
,
//
id: row.id,
};
//
};
let
res
=
await
doFetch
({
//
let res = await doFetch(
{
url
:
urlParams
.
save
,
//
url: urlParams.save,
params
,
//
params,
});
//
});
if
(
res
.
code
===
'0000'
)
{
//
if (res.code === '0000')
{
message
.
success
(
'新增成功!'
);
//
message.success('新增成功!');
setDrawer
((
s
)
=>
({
//
setDrawer((s) => (
{
...
s
,
//
...s,
visible
:
false
,
//
visible: false,
}));
//
}));
actionRef
.
current
.
reload
();
//
actionRef.current.reload();
}
//
}
},
//
},
}));
}));
}
}
}
}
>
>
...
@@ -176,7 +176,43 @@ function Model(props) {
...
@@ -176,7 +176,43 @@ function Model(props) {
key
:
'0'
,
key
:
'0'
,
},
},
{
{
label
:
<
a
>
履历登记
</
a
>,
label
:
(
<
a
onClick=
{
()
=>
{
setDrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
type
:
'resume'
,
item
:
{
id
:
row
.
id
,
},
val
:
'only'
,
title
:
'履历登记'
,
// 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();
//
}
//
},
}));
}
}
>
履历登记
</
a
>
),
key
:
'1'
,
key
:
'1'
,
},
},
{
{
...
@@ -202,6 +238,7 @@ function Model(props) {
...
@@ -202,6 +238,7 @@ function Model(props) {
);
);
};
};
// 子设备
const
EditChildEquipment
=
()
=>
{
const
EditChildEquipment
=
()
=>
{
const
[
selectArr
,
setSelectArr
]
=
useState
([]);
const
[
selectArr
,
setSelectArr
]
=
useState
([]);
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -407,12 +444,15 @@ function Model(props) {
...
@@ -407,12 +444,15 @@ function Model(props) {
<
Space
style=
{
{
marginTop
:
16
}
}
>
<
Space
style=
{
{
marginTop
:
16
}
}
>
<
Button
<
Button
onClick=
{
()
=>
{
onClick=
{
()
=>
{
console
.
log
(
drawer
);
setDrawer
((
s
)
=>
({
setDrawer
((
s
)
=>
({
...
s
,
...
s
,
visible
:
false
,
visible
:
false
,
item
:
null
,
item
:
null
,
detailpath
:
null
,
detailpath
:
null
,
params
:
null
,
params
:
null
,
val
:
null
,
onFinish
:
null
,
}));
}));
setSelectArr
([]);
setSelectArr
([]);
}
}
}
}
...
@@ -449,6 +489,180 @@ function Model(props) {
...
@@ -449,6 +489,180 @@ function Model(props) {
);
);
};
};
// 履历登记
const
Resume
=
()
=>
{
const
[
selectArr
,
setSelectArr
]
=
useState
([]);
const
[
activeTab
,
setactiveTab
]
=
useState
(
1
);
useEffect
(()
=>
{
const
fun
=
async
()
=>
{
const
result
=
await
doFetch
({
url
:
'/asset/equipment/children/selected/queryList'
,
params
:
{
id
:
drawer
?.
item
?.
id
},
});
// console.log(result);
if
(
!
result
?.
data
?.
dataList
.
length
==
0
)
{
setSelectArr
(
result
?.
data
?.
dataList
.
map
((
it
)
=>
it
.
id
));
}
};
fun
();
},
[]);
const
fields
=
{
1
:
[
{
title
:
'设备'
,
dataIndex
:
'equipmentId'
,
key
:
'equipment'
,
},
],
2
:
[
{
title
:
'设备1'
,
dataIndex
:
'equipmentId'
,
key
:
'equipment'
,
},
],
};
return
(
<>
<
ProDescriptions
request=
{
async
()
=>
{
const
{
data
}
=
await
doFetch
({
url
:
urlParams
.
detail
,
params
:
{
id
:
drawer
?.
item
?.
id
},
});
return
{
success
:
true
,
data
:
data
?.
data
,
};
}
}
columns=
{
[
{
title
:
'设备编号'
,
dataIndex
:
'equipmentNo'
,
key
:
'equipmentNo'
,
},
{
title
:
'设备名称'
,
dataIndex
:
'equipmentName'
,
key
:
'equipmentName'
,
},
{
title
:
'位置号'
,
dataIndex
:
'positionNo'
,
key
:
'positionNo'
,
},
{
title
:
'公司名称'
,
dataIndex
:
'organizationName'
,
key
:
'organizationId'
,
},
{
title
:
'部门名称'
,
dataIndex
:
'departmentName'
,
key
:
'departmentId'
,
},
{
title
:
'工厂名称'
,
dataIndex
:
'factoryName'
,
key
:
'factoryId'
,
},
{
title
:
'车间名称'
,
dataIndex
:
'shopName'
,
key
:
'shopId'
,
},
{
title
:
'工段名称'
,
dataIndex
:
'sectionName'
,
key
:
'sectionId'
,
},
{
title
:
'产线名称'
,
dataIndex
:
'productLineName'
,
key
:
'productLineName'
,
},
{
title
:
'供应商'
,
dataIndex
:
'supplierName'
,
key
:
'supplierId'
,
},
{
title
:
'安装投产日期'
,
dataIndex
:
'productDate'
,
key
:
'productDate'
,
},
]
}
/>
<
Divider
/>
<
Tabs
activeKey=
{
activeTab
}
onChange=
{
setactiveTab
}
items=
{
[
{
label
:
'改造'
,
key
:
1
,
children
:
<
InitForm
fields=
{
fields
[
activeTab
]
}
/>,
},
// remember to pass the key prop
{
label
:
'Tab 2'
,
key
:
2
,
children
:
<
InitForm
fields=
{
fields
[
activeTab
]
}
/>,
},
]
}
/>
{
/* <Space style={{ marginTop: 16 }}>
<Button
onClick={() => {
console.log(drawer);
setDrawer((s) => ({
...s,
visible: false,
item: null,
detailpath: null,
params: null,
val: null,
onFinish: null,
}));
setSelectArr([]);
}}
>
取消
</Button>
<Button
type="primary"
onClick={async () => {
console.log(selectArr);
let res = await doFetch({
url: urlParams_childEquipment.save,
params: {
equipmentId: drawer?.item?.id,
childrenIdList: selectArr,
},
});
if (res.code === '0000') {
message.success('新增成功!');
setDrawer((s) => ({
...s,
visible: false,
item: null,
}));
setSelectArr([]);
actionRef.current.reload();
}
}}
>
提交
</Button>
</Space> */
}
</>
);
};
const
columns
=
useMemo
(()
=>
{
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setDrawer
);
let
defcolumn
=
getcolumns
(
setDrawer
);
defcolumn
[
1
].
render
=
(
text
,
row
)
=>
{
defcolumn
[
1
].
render
=
(
text
,
row
)
=>
{
...
@@ -489,17 +703,27 @@ function Model(props) {
...
@@ -489,17 +703,27 @@ function Model(props) {
let
params
=
{
let
params
=
{
treeNodeType
:
e
.
node
.
type
,
treeNodeType
:
e
.
node
.
type
,
treeNodeKey
:
e
.
node
.
key
,
treeNodeKey
:
e
.
node
.
key
,
pageSize
:
'15'
,
pageSize
:
15
,
pageIndex
:
'1'
,
pageIndex
:
1
,
};
};
const
res
=
await
doFetch
({
url
:
urlParams
.
list
,
params
});
const
res
=
await
doFetch
({
url
:
urlParams
.
list
,
params
});
if
(
res
.
code
===
'0000'
)
{
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'
新增
成功!'
);
message
.
success
(
'
查询
成功!'
);
setDrawer
((
s
)
=>
({
setDrawer
((
s
)
=>
({
...
s
,
...
s
,
visible
:
false
,
visible
:
false
,
}));
}));
actionRef
.
current
.
reload
();
}
};
const
selectMoreDrawerType
=
(
type
)
=>
{
switch
(
type
)
{
case
'editChildEquipment'
:
return
<
EditChildEquipment
/>;
case
'resume'
:
return
<
Resume
/>;
default
:
return
null
;
}
}
};
};
...
@@ -579,7 +803,7 @@ function Model(props) {
...
@@ -579,7 +803,7 @@ function Model(props) {
}
}
}
}
{
...
drawer
}
{
...
drawer
}
>
>
{
drawer
?.
type
==
'editChildEquipment'
?
<
EditChildEquipment
/>
:
null
}
{
selectMoreDrawerType
(
drawer
?.
type
)
}
</
DrawerPro
>
</
DrawerPro
>
</
div
>
</
div
>
);
);
...
...
src/pages/setting/role/columns.js
View file @
1f33056e
function
getcolumns
(
setdrawer
)
{
/* 用户管理
return
[
* @Author: Li Hanlin
{
* @Date: 2022-11-09 14:44:44
title
:
'基础信息'
,
* @Last Modified by: Li Hanlin
valueType
:
'split'
,
* @Last Modified time: 2022-11-18 15:43:51
},
*/
{
title
:
'用户名'
,
import
*
as
React
from
'react'
;
dataIndex
:
'accountName'
,
import
{
useState
,
useMemo
,
useRef
}
from
'react'
;
formItemProps
:
{
import
DrawerPro
from
'@/components/DrawerPro'
;
rules
:
[
import
AutoTable
from
'@/components/AutoTable'
;
{
import
PremButton
from
'@/components/PremButton'
;
required
:
false
,
import
getcolumns
from
'./columns'
;
message
:
'此项为必填项'
,
import
{
doFetch
}
from
'@/utils/doFetch'
;
},
import
{
message
}
from
'antd'
;
],
},
function
User
(
props
)
{
initialValue
:
'默认值'
,
const
actionRef
=
useRef
(),
hideInForm
:
false
,
formRef
=
useRef
();
search
:
false
,
const
[
drawer
,
setDrawer
]
=
useState
({
render
:
(
text
,
row
)
=>
{
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
(
return
(
<
a
<
PremButton
onClick
=
{()
=>
{
btn
=
{{
setdrawer
?.((
s
)
=>
({
size
:
'small'
,
type
:
'link'
,
onClick
:
()
=>
{
setDrawer
((
s
)
=>
({
...
s
,
...
s
,
visible
:
true
,
visible
:
true
,
item
:
null
,
item
:
row
,
title
:
'新增'
,
title
:
'详情'
,
val
:
'add'
,
val
:
'detail'
,
title
:
row
.
userName
+
'的详细信息'
,
}));
}));
},
}}
}}
>
>
{
text
}
详情
<
/a
>
<
/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
();
}
},
},
}));
},
},
{
}}
title
:
'姓名'
,
>
dataIndex
:
'userName'
,
编辑
key
:
'userId'
,
<
/PremButton
>
hideInForm
:
{
);
accountName
:
{
};
reverse
:
[
'1'
,
'2'
,
'5'
],
},
const
remove
=
(
text
,
row
,
_
,
action
)
=>
{
remark
:
[
'3'
],
return
(
},
<
PremButton
search
:
false
,
pop
=
{{
},
title
:
'是否删除该工厂?'
,
{
okText
:
'确认'
,
title
:
'额外信息'
,
cancelText
:
'取消'
,
valueType
:
'split'
,
onConfirm
:
async
()
=>
{
},
let
res
=
await
doFetch
({
url
:
urlParams
.
remove
,
params
:
{
id
:
row
.
id
}
});
{
if
(
res
.
code
===
'0000'
)
{
title
:
'联系电话'
,
message
.
success
(
'删除成功!'
);
dataIndex
:
'telephone'
,
setDrawer
((
s
)
=>
({
formItemProps
:
{
...
s
,
rules
:
[
visible
:
false
,
{
}));
required
:
false
,
actionRef
.
current
.
reload
();
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
:
[
btn
=
{{
{
size
:
'small'
,
required
:
false
,
type
:
'danger'
,
message
:
'此项为必填项'
,
}}
>
删除
<
/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
();
}
},
},
],
}));
},
},
},
},
];
}}
/
>
<
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
)
{
function
getcolumns
(
setdrawer
)
{
return
[
return
[
{
title
:
'基础信息'
,
valueType
:
'split'
,
},
{
{
title
:
'用户名'
,
title
:
'用户名'
,
dataIndex
:
'accountName'
,
dataIndex
:
'username'
,
formItemProps
:
{
key
:
'username'
,
rules
:
[
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
{
required
:
false
,
message
:
'此项为必填项'
,
},
},
],
{
title
:
'姓名'
,
dataIndex
:
'fullName'
,
key
:
'fullName'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
},
initialValue
:
'默认值'
,
{
title
:
'手机号'
,
dataIndex
:
'telephone'
,
key
:
'telephone'
},
hideInForm
:
false
,
{
title
:
'邮箱'
,
dataIndex
:
'mailNo'
,
key
:
'mailNo'
},
search
:
false
,
{
render
:
(
text
,
row
)
=>
{
title
:
'公司名称'
,
return
(
dataIndex
:
'organizationName'
,
<
a
key
:
'organizationId'
,
onClick
=
{()
=>
{
valueType
:
'select'
,
setdrawer
?.((
s
)
=>
({
options
:
{
path
:
'/emspro'
,
params
:
{}
},
...
s
,
visible
:
true
,
item
:
null
,
title
:
'新增'
,
val
:
'add'
,
}));
}}
>
{
text
}
<
/a
>
);
},
},
{
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
:
'姓名'
,
title
:
'部门名称'
,
dataIndex
:
'userName'
,
width
:
120
,
key
:
'userId'
,
align
:
'center'
,
hideInForm
:
{
valueType
:
'select'
,
accountName
:
{
dataIndex
:
'departmentName'
,
reverse
:
[
'1'
,
'2'
,
'5'
],
key
:
'departmentId'
,
options
:
{
path
:
'/auth/sysDepartment/query/depart/selectbox'
,
linkParams
:
{
organizationId
:
'parentId'
,
},
},
remark
:
[
'3'
],
},
},
search
:
false
,
},
},
{
{
title
:
'额外信息'
,
title
:
'负责工厂'
,
valueType
:
'split'
,
dataIndex
:
'factoryName'
,
key
:
'factoryId'
,
width
:
120
,
align
:
'center'
,
valueType
:
'select'
,
options
:
{
path
:
'/auth/sysFactory/getAllFactorySelection'
,
params
:
{}
},
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
},
{
{
title
:
'联系电话'
,
title
:
'负责车间'
,
dataIndex
:
'telephone'
,
dataIndex
:
'shopName'
,
formItemProps
:
{
align
:
'center'
,
rules
:
[
width
:
120
,
{
valueType
:
'select'
,
required
:
false
,
options
:
{
message
:
'此项为必填项'
,
path
:
'/auth/sysShop/getShopSelectionByFactory'
,
linkParams
:
{
factoryId
:
''
,
},
},
],
},
},
search
:
false
,
key
:
'shopId'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
},
{
{
title
:
'邮箱'
,
title
:
'负责工段'
,
dataIndex
:
'mailNo'
,
width
:
120
,
formItemProps
:
{
dataIndex
:
'sectionName'
,
rules
:
[
align
:
'center'
,
{
key
:
'sectionId'
,
required
:
false
,
valueType
:
'select'
,
message
:
'此项为必填项'
,
options
:
{
path
:
'/auth/sysSection/getAllSectionSelectionByShop'
,
linkParams
:
{
shopId
:
''
,
},
},
],
},
},
search
:
false
,
},
},
{
{
title
:
'备注'
,
title
:
'负责产线'
,
dataIndex
:
'remark'
,
width
:
120
,
valueType
:
'editor'
,
dataIndex
:
'productionLines'
,
valueType
:
'select'
,
search
:
false
,
search
:
false
,
colProps
:
{
span
:
24
},
key
:
'productLineName'
,
initialValue
:
'<p>Hello <b>World!</b></p>'
,
align
:
'center'
,
},
options
:
{
{
path
:
'/auth/sysProductionLine/getAllProductLineSelectionByShop'
,
title
:
'上传样式-图片'
,
linkParams
:
{
dataIndex
:
'uploadImage'
,
shopId
:
''
,
key
:
'uploadImage'
,
valueType
:
'uploadImage'
,
fieldProps
:
{
limit
:
2
,
},
formItemProps
:
{
rules
:
[
{
required
:
false
,
message
:
'此项为必填项'
,
},
},
],
},
},
},
},
{
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
*
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
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
message
}
from
'antd'
;
function
User
s
(
props
)
{
function
User
(
props
)
{
const
actionRef
=
useRef
(),
const
actionRef
=
useRef
(),
formRef
=
useRef
();
formRef
=
useRef
();
const
[
drawer
,
set
d
rawer
]
=
useState
({
const
[
drawer
,
set
D
rawer
]
=
useState
({
visible
:
false
,
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
)
=>
{
const
detail
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
return
(
<
PremButton
<
PremButton
...
@@ -19,7 +35,7 @@ function Users(props) {
...
@@ -19,7 +35,7 @@ function Users(props) {
size
:
'small'
,
size
:
'small'
,
type
:
'link'
,
type
:
'link'
,
onClick
:
()
=>
{
onClick
:
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
...
s
,
visible
:
true
,
visible
:
true
,
item
:
row
,
item
:
row
,
...
@@ -41,12 +57,31 @@ function Users(props) {
...
@@ -41,12 +57,31 @@ function Users(props) {
btn=
{
{
btn=
{
{
size
:
'small'
,
size
:
'small'
,
onClick
:
()
=>
{
onClick
:
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
...
s
,
visible
:
true
,
visible
:
true
,
item
:
row
,
item
:
row
,
title
:
'编辑'
,
title
:
'编辑'
,
val
:
'edit'
,
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) {
...
@@ -60,11 +95,19 @@ function Users(props) {
return
(
return
(
<
PremButton
<
PremButton
pop=
{
{
pop=
{
{
title
:
'是否删除该
用户
?'
,
title
:
'是否删除该
工厂
?'
,
okText
:
'确认'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
cancelText
:
'取消'
,
onConfirm
:
()
=>
{
onConfirm
:
async
()
=>
{
alert
(
0
);
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=
{
{
btn=
{
{
...
@@ -78,41 +121,55 @@ function Users(props) {
...
@@ -78,41 +121,55 @@ function Users(props) {
};
};
const
columns
=
useMemo
(()
=>
{
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
set
d
rawer
);
let
defcolumn
=
getcolumns
(
set
D
rawer
);
return
defcolumn
.
concat
({
return
defcolumn
.
concat
({
title
:
'操作'
,
title
:
'操作'
,
valueType
:
'option'
,
valueType
:
'option'
,
width
:
150
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[
render
:
(
text
,
row
,
_
,
action
)
=>
[
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
)],
detail
(
text
,
row
,
_
,
action
),
edit
(
text
,
row
,
_
,
action
),
remove
(
text
,
row
,
_
,
action
),
],
});
});
},
[]);
},
[]);
return
(
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
div
style=
{
{
position
:
'relative'
}
}
>
<
AutoTable
<
AutoTable
pagetitle=
"用户管理"
pagetitle=
{
<
h3
className=
"page-title"
>
用户管理
</
h3
>
}
columns=
{
columns
}
columns=
{
columns
}
path=
"/ngic-auth/sysUser/query/page"
path=
{
urlParams
.
list
}
actionRef=
{
actionRef
}
actionRef=
{
actionRef
}
pageextra=
{
'add'
}
pageextra=
{
'add'
}
resizeable=
{
tru
e
}
resizeable=
{
fals
e
}
addconfig=
{
{
addconfig=
{
{
// access: 'sysDepartment_save',
// access: 'sysDepartment_save',
btn
:
{
btn
:
{
type
:
'primary'
,
type
:
'primary'
,
disabled
:
false
,
disabled
:
false
,
onClick
:
()
=>
{
onClick
:
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
...
s
,
visible
:
true
,
visible
:
true
,
item
:
null
,
item
:
null
,
detailpath
:
null
,
detailpath
:
null
,
title
:
'新增'
,
title
:
'新增'
,
val
:
'add'
,
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) {
...
@@ -121,12 +178,13 @@ function Users(props) {
<
DrawerPro
<
DrawerPro
fields=
{
columns
}
fields=
{
columns
}
detailpath=
"/ngic-auth/sysUser/query/detail"
// detailpath={urlParams.detail}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
// params={{ id: drawer?.item?.id }}
defaultFormValue=
{
drawer
?.
item
??
{}
}
formRef=
{
formRef
}
formRef=
{
formRef
}
placement=
"right"
placement=
"right"
onClose=
{
()
=>
{
onClose=
{
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
...
s
,
visible
:
false
,
visible
:
false
,
}));
}));
...
@@ -137,4 +195,4 @@ function Users(props) {
...
@@ -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