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
826ab672
Commit
826ab672
authored
Feb 24, 2023
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asder
parent
cda5b656
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
155 additions
and
132 deletions
+155
-132
index.jsx
src/components/InitForm/EditTable/index.jsx
+3
-0
index.jsx
src/components/InitForm/Expandable/index.jsx
+150
-129
index.jsx
src/pages/repair/order/index.jsx
+2
-3
No files found.
src/components/InitForm/EditTable/index.jsx
View file @
826ab672
...
@@ -34,6 +34,9 @@ const EditTable = (props) => {
...
@@ -34,6 +34,9 @@ const EditTable = (props) => {
success
:
true
,
success
:
true
,
total
:
dataSource
?.
length
??
0
,
total
:
dataSource
?.
length
??
0
,
};
};
console
.
log
(
'===================================='
);
console
.
log
(
extraparams
);
console
.
log
(
'===================================='
);
let
newparams
=
{
let
newparams
=
{
...
params
,
...
params
,
...
extraparams
,
//父组件传参
...
extraparams
,
//父组件传参
...
...
src/components/InitForm/Expandable/index.jsx
View file @
826ab672
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
AutoTable
from
'../../AutoTable/mtable'
;
import
AutoTable
from
'../../AutoTable/mtable'
;
import
EditTable
from
'../EditTable'
;
import
EditTable
from
'../EditTable'
;
function
Expandables
({
value
,
onChange
,
item
})
{
function
Expandables
({
value
=
[],
onChange
,
item
})
{
console
.
log
(
value
);
const
[
allDatasource
,
setallDatasource
]
=
useState
({});
return
(
return
(
<
div
>
<
div
>
<
AutoTable
<
AutoTable
...
@@ -11,9 +13,41 @@ function Expandables({ value, onChange, item }) {
...
@@ -11,9 +13,41 @@ function Expandables({ value, onChange, item }) {
path=
{
item
?.
path
}
path=
{
item
?.
path
}
extraparams=
{
item
?.
extraparams
}
extraparams=
{
item
?.
extraparams
}
expandable=
{
{
expandable=
{
{
expandRowByClick
:
true
,
onExpand
:
(
expanded
,
record
)
=>
{
if
(
!
expanded
)
return
;
//找到value中当前展开的值
let
curvalue
=
value
?
value
.
filter
((
it
)
=>
it
.
lifePieceAccountId
==
record
.
id
)?.[
0
]
:
{};
//value中的list
let
curvalist
=
curvalue
?.
lineStockUseList
??
[];
doFetch
({
url
:
item
.
expandablePath
,
params
:
{
lifePieceAccountId
:
record
.
id
}
}).
then
(
(
res
)
=>
{
//展开接口返回的结果
let
curDatasource
=
res
?.
data
?.
dataList
??
[];
//组合数据
let
result
=
curDatasource
?.
map
((
it
)
=>
{
const
itemval
=
curvalist
?.
filter
?.((
item
)
=>
item
.
lineStockId
==
it
.
id
)?.[
0
]
??
false
;
if
(
itemval
)
{
it
.
operateNum
=
itemval
.
operateNum
;
}
return
it
;
});
setallDatasource
((
s
)
=>
({
...
s
,
[
record
.
id
]:
result
,
}));
},
);
},
expandedRowRender
:
(
record
)
=>
{
expandedRowRender
:
(
record
)
=>
{
let
curvalue
=
value
?
value
.
filter
((
it
)
=>
it
.
lifePieceAccountId
==
record
.
id
)?.[
0
]
:
{};
return
(
return
(
<
div
>
<
EditTable
<
EditTable
resizeable=
{
false
}
resizeable=
{
false
}
alwaysShowAlert=
{
false
}
alwaysShowAlert=
{
false
}
...
@@ -59,29 +93,22 @@ function Expandables({ value, onChange, item }) {
...
@@ -59,29 +93,22 @@ function Expandables({ value, onChange, item }) {
},
},
},
},
]
}
]
}
path=
{
item
?.
expandablePath
}
dataSource=
{
allDatasource
[
record
.
id
]
}
extraparams=
{
{
lifePieceAccountId
:
record
?.
id
}
}
extraparams=
{
allDatasource
}
rowSelection=
{
{
rowSelection=
{
{
getCheckboxProps
:
(
record
)
=>
({
getCheckboxProps
:
(
record
)
=>
({
disabled
:
record
.
isAsh
==
'1'
,
disabled
:
record
.
isAsh
==
'1'
,
}),
}),
columnWidth
:
44
,
columnWidth
:
44
,
preserveSelectedRowKeys
:
true
,
preserveSelectedRowKeys
:
true
,
selectedRowKeys
:
selectedRowKeys
:
curvalue
?.
lineStockUseList
value
&&
value
.
length
>
0
?
curvalue
.
lineStockUseList
?.
map
?.((
it
)
=>
it
?.
lineStockId
)
?
value
?.
filter
?.((
it
)
=>
it
?.
lifePieceAccountId
==
record
.
id
)[
0
]
?
value
?.
filter
?.((
it
)
=>
it
?.
lifePieceAccountId
==
record
.
id
)[
0
]
?.
lineStockUseList
?.
map
?.((
it
)
=>
it
?.
lineStockId
)
:
[]
:
[],
:
[],
onChange
:
(
selectedKeys
,
selectedRows
)
=>
{
onChange
:
(
selectedKeys
,
selectedRows
)
=>
{
// debugger;
// debugger;
const
curval
=
const
curval
=
curvalue
?.
lineStockUseList
??
[];
value
?.
filter
?.((
it
)
=>
it
?.
lifePieceAccountId
==
record
.
id
)[
0
]
const
rowkeylist
=
curval
?.
map
?.((
it
)
=>
it
?.
lineStockId
);
?.
lineStockUseList
??
[];
const
rowkeylist
=
curval
&&
curval
.
length
>
0
?
curval
?.
map
((
it
)
=>
it
?.
lineStockId
)
:
[];
const
newValue
=
selectedRows
?.
map
((
its
)
=>
{
const
newValue
=
selectedRows
?.
map
((
its
)
=>
{
if
(
rowkeylist
?.
includes
(
its
?.
id
))
{
if
(
rowkeylist
?.
includes
(
its
?.
id
))
{
return
curval
?.
filter
((
it
)
=>
it
?.
lineStockId
==
its
?.
id
)[
0
];
return
curval
?.
filter
((
it
)
=>
it
?.
lineStockId
==
its
?.
id
)[
0
];
...
@@ -92,17 +119,18 @@ function Expandables({ value, onChange, item }) {
...
@@ -92,17 +119,18 @@ function Expandables({ value, onChange, item }) {
};
};
}
}
});
});
let
nvalue
=
value
?
[...
value
]
:
[];
let
nvalue
=
value
?
[...
value
]
:
[];
if
(
value
&&
value
?.
some
((
it
)
=>
it
.
lineStock
Id
==
record
?.
id
))
{
if
(
value
&&
value
?.
some
((
it
)
=>
it
.
lifePieceAccount
Id
==
record
?.
id
))
{
nvalue
=
value
?.
map
((
it
,
i
)
=>
{
nvalue
=
value
?.
map
((
it
,
i
)
=>
{
if
(
it
.
lineStock
Id
==
record
.
id
)
{
if
(
it
.
lifePieceAccount
Id
==
record
.
id
)
{
it
.
lineStockUseList
=
newValue
;
it
.
lineStockUseList
=
newValue
;
}
}
return
it
;
return
it
;
});
});
}
else
{
}
else
{
nvalue
.
push
({
nvalue
.
push
({
i
d
:
record
?.
id
,
lifePieceAccountI
d
:
record
?.
id
,
lineStockUseList
:
newValue
,
lineStockUseList
:
newValue
,
});
});
}
}
...
@@ -111,10 +139,7 @@ function Expandables({ value, onChange, item }) {
...
@@ -111,10 +139,7 @@ function Expandables({ value, onChange, item }) {
}
}
}
}
editable=
{
{
editable=
{
{
onValuesChange
:
(
rower
,
recordList
)
=>
{
onValuesChange
:
(
rower
,
recordList
)
=>
{
console
.
log
(
rower
);
const
curval
=
curvalue
?.
lineStockUseList
??
[];
const
curval
=
value
?.
filter
?.((
it
)
=>
it
?.
lifePieceAccountId
==
record
.
id
)[
0
]
?.
lineStockUseList
??
[];
const
newValue
=
curval
?.
map
((
its
)
=>
{
const
newValue
=
curval
?.
map
((
its
)
=>
{
if
(
its
?.
lineStockId
==
rower
?.
id
)
{
if
(
its
?.
lineStockId
==
rower
?.
id
)
{
return
{
return
{
...
@@ -126,9 +151,9 @@ function Expandables({ value, onChange, item }) {
...
@@ -126,9 +151,9 @@ function Expandables({ value, onChange, item }) {
}
}
});
});
let
nvalue
=
value
?
[...
value
]
:
[];
let
nvalue
=
value
?
[...
value
]
:
[];
if
(
value
&&
value
?.
some
((
it
)
=>
it
.
i
d
==
record
?.
id
))
{
if
(
value
&&
value
?.
some
((
it
)
=>
it
.
lifePieceAccountI
d
==
record
?.
id
))
{
nvalue
=
value
?.
map
((
it
,
i
)
=>
{
nvalue
=
value
?.
map
((
it
,
i
)
=>
{
if
(
it
.
i
d
==
record
.
id
)
{
if
(
it
.
lifePieceAccountI
d
==
record
.
id
)
{
it
.
lineStockUseList
=
newValue
;
it
.
lineStockUseList
=
newValue
;
}
}
return
it
;
return
it
;
...
@@ -141,12 +166,8 @@ function Expandables({ value, onChange, item }) {
...
@@ -141,12 +166,8 @@ function Expandables({ value, onChange, item }) {
}
}
onChange
(
nvalue
);
onChange
(
nvalue
);
},
},
onExpandedRowsChange
:
(
expandedRows
)
=>
{
console
.
log
(
expandedRows
);
},
}
}
}
}
/>
/>
</
div
>
);
);
},
},
}
}
}
}
...
...
src/pages/repair/order/index.jsx
View file @
826ab672
...
@@ -713,7 +713,7 @@ function Failure(props) {
...
@@ -713,7 +713,7 @@ function Failure(props) {
const
Finishrepair
=
()
=>
{
const
Finishrepair
=
()
=>
{
const
EditTableItem
=
({
record
})
=>
{
const
EditTableItem
=
({
record
})
=>
{
const
[
value
,
setvalue
]
=
useState
([]);
const
[
value
,
setvalue
]
=
useState
([]);
console
.
log
(
value
);
return
(
return
(
<
div
>
<
div
>
<
EditTable
<
EditTable
...
@@ -789,7 +789,6 @@ function Failure(props) {
...
@@ -789,7 +789,6 @@ function Failure(props) {
const
newValue
=
value
.
concat
(
rower
);
const
newValue
=
value
.
concat
(
rower
);
return
[...
newValue
];
return
[...
newValue
];
});
});
console
.
log
(
value
);
},
},
}
}
}
}
/>
/>
...
@@ -1051,7 +1050,7 @@ function Failure(props) {
...
@@ -1051,7 +1050,7 @@ function Failure(props) {
},
},
],
],
path
:
'/sparepart/lifePieceAccount/queryPageByEquipment'
,
path
:
'/sparepart/lifePieceAccount/queryPageByEquipment'
,
expandablePath
:
'/sparepart/lineStock/queryReplaceStock'
,
expandablePath
:
'/sparepart/lineStock/queryReplaceStock
All
'
,
extraparams
:
{
equipmentId
:
drawer
?.
item
?.
equipmentId
},
extraparams
:
{
equipmentId
:
drawer
?.
item
?.
equipmentId
},
},
},
];
];
...
...
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