Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wms
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
wms
Commits
facee4fe
Commit
facee4fe
authored
Aug 14, 2023
by
krysent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new
parent
ed24dcb5
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1530 additions
and
1351 deletions
+1530
-1351
index.jsx
src/components/DrawInitForm/index.jsx
+1
-1
index.jsx
src/components/EditTable/index.jsx
+97
-90
index.jsx
src/pages/insertstore/Otherinstore/index.jsx
+156
-1260
index_c.jsx
src/pages/insertstore/Otherinstore/index_c.jsx
+1276
-0
No files found.
src/components/DrawInitForm/index.jsx
View file @
facee4fe
...
@@ -39,8 +39,8 @@ function DrawInitForm(props) {
...
@@ -39,8 +39,8 @@ function DrawInitForm(props) {
getContainer=
{
false
}
getContainer=
{
false
}
style=
{
{
position
:
"absolute"
,
transform
:
"translateX(0)"
,
maxWidth
:
"100%"
}
}
style=
{
{
position
:
"absolute"
,
transform
:
"translateX(0)"
,
maxWidth
:
"100%"
}
}
width=
{
props
.
val
==
"detail"
?
1000
:
props
.
width
}
width=
{
props
.
val
==
"detail"
?
1000
:
props
.
width
}
destroyOnClose=
{
true
}
{
...
props
}
{
...
props
}
destroyOnClose=
{
true
}
>
>
{
props
.
val
==
"only"
&&
props
.
children
}
{
props
.
val
==
"only"
&&
props
.
children
}
{
props
.
val
==
"only"
?
null
:
props
.
val
==
"detail"
?
<
Details
{
...
detailprops
}
></
Details
>
:
<
InitForm
{
...
newProps
}
></
InitForm
>
}
{
props
.
val
==
"only"
?
null
:
props
.
val
==
"detail"
?
<
Details
{
...
detailprops
}
></
Details
>
:
<
InitForm
{
...
newProps
}
></
InitForm
>
}
...
...
src/components/EditTable/index.jsx
View file @
facee4fe
import
React
,
{
useEffect
,
useRef
}
from
"react"
;
import
React
,
{
useEffect
,
useRef
,
useState
}
from
"react"
;
import
{
EditableProTable
}
from
"@ant-design/pro-table"
;
import
{
EditableProTable
}
from
"@ant-design/pro-table"
;
import
{
useUpdate
}
from
'ahooks'
;
import
{
useUpdate
}
from
"ahooks"
;
const
EditTable
=
({
const
EditTable
=
({
columns
,
columns
,
...
@@ -11,103 +10,111 @@ const EditTable = ({
...
@@ -11,103 +10,111 @@ const EditTable = ({
recordCreatorProps
,
recordCreatorProps
,
maxLength
,
maxLength
,
linkconfig
,
linkconfig
,
style
style
,
})
=>
{
})
=>
{
const
update
=
useUpdate
();
const
editorFormRef
=
useRef
();
const
editorFormRef
=
useRef
();
console
.
log
(
columns
);
useEffect
(()
=>
{
const
[
show
,
setshow
]
=
useState
(
true
);
if
(
value
===
undefined
){
useEffect
(()
=>
{
update
()
setshow
(
false
);
}
setTimeout
(()
=>
{
},[
value
])
setshow
(
true
);
},
1200
);
},
[]);
return
(
return
(
<
EditableProTable
show
&&
(
style=
{
{
...(
style
??
{})
}
}
<
EditableProTable
columns=
{
columns
}
style=
{
{
...(
style
??
{})
}
}
rowKey=
{
rowKey
}
columns=
{
columns
}
value=
{
value
||
[]
}
rowKey=
{
rowKey
}
onChange=
{
onChange
}
value=
{
value
||
[]
}
recordCreatorProps=
{
onChange=
{
onChange
}
recordCreatorProps
==
"false"
recordCreatorProps=
{
?
false
recordCreatorProps
==
"false"
:
{
?
false
newRecordType
:
"dataSource"
,
:
{
record
:
()
=>
({
newRecordType
:
"dataSource"
,
[
rowKey
]:
Date
.
now
(),
record
:
()
=>
({
}),
[
rowKey
]:
Date
.
now
(),
}
}),
}
editableFormRef=
{
editorFormRef
}
editable=
{
{
type
:
"multiple"
,
editableKeys
:
value
?
value
.
map
((
item
)
=>
item
[
rowKey
])
:
[],
actionRender
:
(
row
,
config
,
defaultDoms
)
=>
{
return
[
defaultDoms
.
delete
];
},
onValuesChange
:
async
(
record
,
recordList
)
=>
{
let
{
urlchangeval
}
=
linkconfig
??
{};
let
newvalue
=
[...
recordList
];
if
(
urlchangeval
&&
record
)
{
//根据url 改变 数据值
let
{
params
,
database
,
effectresult
}
=
urlchangeval
??
{},
curvaluerow
=
value
&&
value
.
length
>
0
?
value
.
filter
(
it
=>
it
[
rowKey
]
==
record
[
rowKey
])[
0
]
:
{}
//获取除本行之外已修改的value值
newvalue
=
newvalue
.
map
((
it
,
i
)
=>
{
if
(
!
record
)
return
it
;
if
(
it
[
rowKey
]
==
record
[
rowKey
])
{
let
freshvals
=
{}
Object
.
keys
(
effectresult
).
map
(
its
=>
{
// freshvals[its] = value[i][its];
freshvals
[
its
]
=
it
[
its
];
})
it
=
{
...
record
,
...
freshvals
}
}
else
{
it
=
value
&&
value
.
length
>
0
?
value
.
filter
(
its
=>
its
[
rowKey
]
==
it
[
rowKey
])[
0
]
:
{}
}
return
it
});
//参数获取
let
parames
=
{};
let
ifs
=
true
;
Object
.
keys
(
params
).
map
(
it
=>
{
if
(
params
[
it
]
==
"linked"
)
{
parames
[
it
]
=
record
[
it
]
if
(
record
[
it
]
!=
curvaluerow
[
it
])
{
ifs
=
false
;
}
}
else
{
parames
[
it
]
=
params
[
it
]
}
}
})
}
if
(
ifs
)
{
editableFormRef=
{
editorFormRef
}
//值未变化
editable=
{
{
}
else
{
type
:
"multiple"
,
let
res
=
await
database
(
parames
);
editableKeys
:
value
?
value
.
map
((
item
)
=>
item
[
rowKey
])
:
[],
actionRender
:
(
row
,
config
,
defaultDoms
)
=>
{
return
[
defaultDoms
.
delete
];
},
onValuesChange
:
async
(
record
,
recordList
)
=>
{
let
{
urlchangeval
}
=
linkconfig
??
{};
let
newvalue
=
[...
recordList
];
if
(
urlchangeval
&&
record
)
{
//根据url 改变 数据值
let
{
params
,
database
,
effectresult
}
=
urlchangeval
??
{},
curvaluerow
=
value
&&
value
.
length
>
0
?
value
.
filter
((
it
)
=>
it
[
rowKey
]
==
record
[
rowKey
])[
0
]
:
{};
//获取除本行之外已修改的value值
newvalue
=
newvalue
.
map
((
it
,
i
)
=>
{
newvalue
=
newvalue
.
map
((
it
,
i
)
=>
{
if
(
!
record
)
return
it
;
if
(
it
[
rowKey
]
==
record
[
rowKey
])
{
if
(
it
[
rowKey
]
==
record
[
rowKey
])
{
Object
.
keys
(
effectresult
).
map
(
items
=>
{
let
freshvals
=
{};
let
result
=
res
?.
data
?.
data
??
{}
Object
.
keys
(
effectresult
).
map
((
its
)
=>
{
it
[
items
]
=
result
[
effectresult
[
items
]];
// freshvals[its] = value[i][its];
})
freshvals
[
its
]
=
it
[
its
];
editorFormRef
.
current
?.
setRowData
?.(
i
,
it
)
});
it
=
{
...
record
,
...
freshvals
,
};
}
else
{
}
else
{
it
=
value
&&
value
.
length
>
0
?
value
.
filter
((
its
)
=>
its
[
rowKey
]
==
it
[
rowKey
])[
0
]
:
{};
}
}
return
it
return
it
;
})
});
};
}
//参数获取
onChange
(
newvalue
);
let
parames
=
{};
},
let
ifs
=
true
;
}
}
Object
.
keys
(
params
).
map
((
it
)
=>
{
maxLength=
{
maxLength
??
1000
}
if
(
params
[
it
]
==
"linked"
)
{
/>
parames
[
it
]
=
record
[
it
];
if
(
record
[
it
]
!=
curvaluerow
[
it
])
{
ifs
=
false
;
}
}
else
{
parames
[
it
]
=
params
[
it
];
}
});
if
(
ifs
)
{
//值未变化
}
else
{
let
res
=
await
database
(
parames
);
newvalue
=
newvalue
.
map
((
it
,
i
)
=>
{
if
(
it
[
rowKey
]
==
record
[
rowKey
])
{
Object
.
keys
(
effectresult
).
map
((
items
)
=>
{
let
result
=
res
?.
data
?.
data
??
{};
it
[
items
]
=
result
[
effectresult
[
items
]];
});
editorFormRef
.
current
?.
setRowData
?.(
i
,
it
);
}
else
{
}
return
it
;
});
}
}
onChange
(
newvalue
);
},
}
}
maxLength=
{
maxLength
??
1000
}
/>
)
);
);
};
};
...
...
src/pages/insertstore/Otherinstore/index.jsx
View file @
facee4fe
This diff is collapsed.
Click to expand it.
src/pages/insertstore/Otherinstore/index_c.jsx
0 → 100644
View file @
facee4fe
This diff is collapsed.
Click to expand it.
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