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
a88ea068
Commit
a88ea068
authored
Jan 06, 2023
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111
parent
802a5405
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
11 deletions
+30
-11
FormItems.jsx
src/components/InitForm/FormItems.jsx
+30
-11
No files found.
src/components/InitForm/FormItems.jsx
View file @
a88ea068
...
@@ -525,8 +525,8 @@ function TimeRange({ item, colProps }) {
...
@@ -525,8 +525,8 @@ function TimeRange({ item, colProps }) {
function LinkSelect({ item, colProps, formRef, name, curindex }) {
function LinkSelect({ item, colProps, formRef, name, curindex }) {
let curoption = item.options ?? null,
let curoption = item.options ?? null,
curlinkparams = curoption?.linkParams ?? {}
;
//获取linkParams下声明的key
curlinkparams = curoption?.linkParams ?? {}
,
//获取linkParams下声明的key
extraParams = curoption?.extraParams ?? {};
return (
return (
<>
<>
<ProFormDependency name={Object.keys(curlinkparams)}>
<ProFormDependency name={Object.keys(curlinkparams)}>
...
@@ -550,7 +550,10 @@ function LinkSelect({ item, colProps, formRef, name, curindex }) {
...
@@ -550,7 +550,10 @@ function LinkSelect({ item, colProps, formRef, name, curindex }) {
let reversekey = !curlinkparams[key] ? key : curlinkparams[key];
let reversekey = !curlinkparams[key] ? key : curlinkparams[key];
result[reversekey] = parse[key];
result[reversekey] = parse[key];
}
}
let res = await doFetch({ url: curoption?.path, params: result });
let res = await doFetch({
url: curoption?.path,
params: { ...result, ...extraParams },
});
if (name) {
if (name) {
let curvals = formRef?.current?.getFieldValue(name);
let curvals = formRef?.current?.getFieldValue(name);
curvals = curvals.map((it, i) => {
curvals = curvals.map((it, i) => {
...
@@ -639,7 +642,8 @@ function Select(props) {
...
@@ -639,7 +642,8 @@ function Select(props) {
function LinkTreeSelect({ item, colProps, formRef, name, curindex }) {
function LinkTreeSelect({ item, colProps, formRef, name, curindex }) {
let prevparse = useRef();
let prevparse = useRef();
let curoption = item.options ?? null,
let curoption = item.options ?? null,
curlinkparams = curoption?.linkParams ?? {}; //获取linkParams下声明的key
curlinkparams = curoption?.linkParams ?? {}, //获取linkParams下声明的key
extraParams = curoption?.extraParams ?? {};
return (
return (
<>
<>
<ProFormDependency name={Object.keys(curlinkparams)}>
<ProFormDependency name={Object.keys(curlinkparams)}>
...
@@ -665,7 +669,10 @@ function LinkTreeSelect({ item, colProps, formRef, name, curindex }) {
...
@@ -665,7 +669,10 @@ function LinkTreeSelect({ item, colProps, formRef, name, curindex }) {
let reversekey = !curlinkparams[key] ? key : curlinkparams[key];
let reversekey = !curlinkparams[key] ? key : curlinkparams[key];
result[reversekey] = parse[key];
result[reversekey] = parse[key];
}
}
let res = await doFetch({ url: curoption?.path, params: result });
let res = await doFetch({
url: curoption?.path,
params: { ...result, ...extraParams },
});
if (prevparse.current !== JSON.stringify(parse)) {
if (prevparse.current !== JSON.stringify(parse)) {
if (name) {
if (name) {
...
@@ -775,7 +782,8 @@ function CheckboxItem({ item, colProps }) {
...
@@ -775,7 +782,8 @@ function CheckboxItem({ item, colProps }) {
function LinkCheckbox({ item, colProps, formRef, name, curindex }) {
function LinkCheckbox({ item, colProps, formRef, name, curindex }) {
let curoption = item.options ?? null,
let curoption = item.options ?? null,
curlinkparams = curoption?.linkParams ?? {}; //获取linkParams下声明的key
curlinkparams = curoption?.linkParams ?? {}, //获取linkParams下声明的key
extraParams = curoption?.extraParams ?? {};
return (
return (
<>
<>
<ProFormDependency name={Object.keys(curlinkparams)}>
<ProFormDependency name={Object.keys(curlinkparams)}>
...
@@ -796,7 +804,10 @@ function LinkCheckbox({ item, colProps, formRef, name, curindex }) {
...
@@ -796,7 +804,10 @@ function LinkCheckbox({ item, colProps, formRef, name, curindex }) {
let reversekey = !curlinkparams[key] ? key : curlinkparams[key];
let reversekey = !curlinkparams[key] ? key : curlinkparams[key];
result[reversekey] = parse[key];
result[reversekey] = parse[key];
}
}
let res = await doFetch({ url: curoption?.path, params: result });
let res = await doFetch({
url: curoption?.path,
params: { ...result, ...extraParams },
});
if (name) {
if (name) {
let curvals = formRef?.current?.getFieldValue(name);
let curvals = formRef?.current?.getFieldValue(name);
curvals = curvals.map((it, i) => {
curvals = curvals.map((it, i) => {
...
@@ -891,7 +902,8 @@ function RadioItem({ item, colProps }) {
...
@@ -891,7 +902,8 @@ function RadioItem({ item, colProps }) {
function LinkRadio({ item, colProps, formRef, name, curindex }) {
function LinkRadio({ item, colProps, formRef, name, curindex }) {
let curoption = item.options ?? null,
let curoption = item.options ?? null,
curlinkparams = curoption?.linkParams ?? {}; //获取linkParams下声明的key
curlinkparams = curoption?.linkParams ?? {}, //获取linkParams下声明的key
extraParams = curoption?.extraParams ?? {};
return (
return (
<>
<>
<ProFormDependency name={Object.keys(curlinkparams)}>
<ProFormDependency name={Object.keys(curlinkparams)}>
...
@@ -912,7 +924,10 @@ function LinkRadio({ item, colProps, formRef, name, curindex }) {
...
@@ -912,7 +924,10 @@ function LinkRadio({ item, colProps, formRef, name, curindex }) {
let reversekey = !curlinkparams[key] ? key : curlinkparams[key];
let reversekey = !curlinkparams[key] ? key : curlinkparams[key];
result[reversekey] = parse[key];
result[reversekey] = parse[key];
}
}
let res = await doFetch({ url: curoption?.path, params: result });
let res = await doFetch({
url: curoption?.path,
params: { ...result, ...extraParams },
});
if (name) {
if (name) {
let curvals = formRef?.current?.getFieldValue(name);
let curvals = formRef?.current?.getFieldValue(name);
curvals = curvals.map((it, i) => {
curvals = curvals.map((it, i) => {
...
@@ -993,7 +1008,8 @@ function Radio(props) {
...
@@ -993,7 +1008,8 @@ function Radio(props) {
function LinkCascader({ item, colProps, formRef, name, curindex }) {
function LinkCascader({ item, colProps, formRef, name, curindex }) {
let prevparse = useRef();
let prevparse = useRef();
let curoption = item.options ?? null,
let curoption = item.options ?? null,
curlinkparams = curoption?.linkParams ?? {}; //获取linkParams下声明的key
curlinkparams = curoption?.linkParams ?? {}, //获取linkParams下声明的key
extraParams = curoption?.extraParams ?? {};
return (
return (
<>
<>
<ProFormDependency name={Object.keys(curlinkparams)}>
<ProFormDependency name={Object.keys(curlinkparams)}>
...
@@ -1019,7 +1035,10 @@ function LinkCascader({ item, colProps, formRef, name, curindex }) {
...
@@ -1019,7 +1035,10 @@ function LinkCascader({ item, colProps, formRef, name, curindex }) {
let reversekey = !curlinkparams[key] ? key : curlinkparams[key];
let reversekey = !curlinkparams[key] ? key : curlinkparams[key];
result[reversekey] = parse[key];
result[reversekey] = parse[key];
}
}
let res = await doFetch({ url: curoption?.path, params: result });
let res = await doFetch({
url: curoption?.path,
params: { ...result, ...extraParams },
});
if (prevparse.current !== JSON.stringify(parse)) {
if (prevparse.current !== JSON.stringify(parse)) {
if (name) {
if (name) {
let curvals = formRef?.current?.getFieldValue(name);
let curvals = formRef?.current?.getFieldValue(name);
...
...
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