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
ee4ea158
Commit
ee4ea158
authored
Dec 29, 2022
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asder
parent
4b6399e8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
19 deletions
+26
-19
mtable.jsx
src/components/AutoTable/mtable.jsx
+25
-13
columns.js
src/pages/setting/users/columns.js
+1
-6
No files found.
src/components/AutoTable/mtable.jsx
View file @
ee4ea158
...
...
@@ -169,7 +169,13 @@ const Mtable = (props) => {
params
:
newparames
,
request
:
async
(
params
)
=>
{
if
(
Object
.
keys
(
it
?.
options
).
includes
(
'linkParams'
))
{
let
list
=
await
doFetch
({
url
:
it
?.
options
?.
path
,
params
:
newparames
});
let
resparams
=
{},
linkParams
=
it
?.
options
?.
linkParams
??
{};
for
(
let
i
in
linkParams
)
{
let
paramsKey
=
!
linkParams
[
i
]
?
i
:
linkParams
[
i
];
resparams
[
paramsKey
]
=
newparames
[
i
];
}
let
list
=
await
doFetch
({
url
:
it
?.
options
?.
path
,
params
:
resparams
});
const
res
=
list
.
data
.
dataList
;
return
it
.
valueType
==
'treeSelect'
?
handlEmptyChild
(
res
)
:
res
;
}
else
{
...
...
@@ -356,19 +362,25 @@ const Mtable = (props) => {
{
...
datas
}
size=
{
size
}
onSubmit=
{
(
params
)
=>
{
////console.log(params, 'onSubmit');
let
newparams
=
{};
columns
.
map
((
it
,
i
)
=>
{
if
(
it
?.
options
?.
linkParams
&&
Object
.
keys
(
it
?.
options
?.
linkParams
).
includes
(
Object
.
keys
(
params
)[
0
])
)
{
for
(
let
dataindex
in
it
?.
options
?.
linkParams
)
{
let
newparams
=
{},
curkey
=
Object
.
keys
(
params
)[
Object
.
keys
(
params
).
length
-
1
],
curval
=
Object
.
values
(
params
)[
Object
.
keys
(
params
).
length
-
1
];
columns
?.
filter
((
it
)
=>
!
(
it
.
search
===
false
||
it
.
hideInSearch
===
true
))
.
map
((
it
,
i
)
=>
{
let
{
linkParams
}
=
it
?.
options
??
{};
if
(
linkParams
&&
Object
.
keys
(
linkParams
).
includes
(
curkey
))
{
for
(
let
dataindex
in
linkParams
)
{
newparams
[
dataindex
]
=
formRefs
?.
current
?.
getFieldValue
?.(
dataindex
);
}
}
});
setnewparams
(
newparams
);
if
(
Object
.
keys
(
newparams
).
length
>
0
)
{
setnewparams
((
s
)
=>
({
...
s
,
...
newparams
,
}));
}
}
}
onSizeChange=
{
(
size
)
=>
{
localStorage
.
setItem
(
'size'
,
size
);
//设置全局表格规格缓存
...
...
src/pages/setting/users/columns.js
View file @
ee4ea158
...
...
@@ -160,7 +160,6 @@ function getcolumns(setDrawer, ifs, formRef) {
{
title
:
'部门名称'
,
width
:
120
,
valueType
:
'treeSelect'
,
dataIndex
:
'departmentName'
,
fieldProps
:
{
...
...
@@ -193,14 +192,12 @@ function getcolumns(setDrawer, ifs, formRef) {
mode
:
'multiple'
,
},
width
:
120
,
valueType
:
'select'
,
options
:
{
path
:
'/auth/sysFactory/getAllFactorySelection'
,
params
:
{}
},
},
{
title
:
'负责车间'
,
dataIndex
:
'shopNames'
,
fieldProps
:
{
placeholder
:
'请选择'
,
showSearch
:
true
,
...
...
@@ -211,7 +208,7 @@ function getcolumns(setDrawer, ifs, formRef) {
options
:
{
path
:
'/auth/sysShop/getShopSelectionByFactoryIdList'
,
linkParams
:
{
factoryIdList
:
'
factoryIdList
'
,
factoryIdList
:
''
,
},
},
key
:
'shopIdList'
,
...
...
@@ -240,7 +237,6 @@ function getcolumns(setDrawer, ifs, formRef) {
},
{
title
:
'负责产线'
,
search
:
false
,
width
:
120
,
dataIndex
:
'productionLines'
,
valueType
:
'select'
,
...
...
@@ -252,7 +248,6 @@ function getcolumns(setDrawer, ifs, formRef) {
search
:
false
,
hideInTable
:
true
,
key
:
'productionLineIdList'
,
options
:
{
path
:
'/auth/sysProductionLine/getAllProductLineSelectionByShopIdList'
,
linkParams
:
{
...
...
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