Commit a88ea068 authored by TZW's avatar TZW

111

parent 802a5405
......@@ -525,8 +525,8 @@ function TimeRange({ item, colProps }) {
function LinkSelect({ item, colProps, formRef, name, curindex }) {
let curoption = item.options ?? null,
curlinkparams = curoption?.linkParams ?? {}; //获取linkParams下声明的key
curlinkparams = curoption?.linkParams ?? {}, //获取linkParams下声明的key
extraParams = curoption?.extraParams ?? {};
return (
<>
<ProFormDependency name={Object.keys(curlinkparams)}>
......@@ -550,7 +550,10 @@ function LinkSelect({ item, colProps, formRef, name, curindex }) {
let reversekey = !curlinkparams[key] ? key : curlinkparams[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) {
let curvals = formRef?.current?.getFieldValue(name);
curvals = curvals.map((it, i) => {
......@@ -639,7 +642,8 @@ function Select(props) {
function LinkTreeSelect({ item, colProps, formRef, name, curindex }) {
let prevparse = useRef();
let curoption = item.options ?? null,
curlinkparams = curoption?.linkParams ?? {}; //获取linkParams下声明的key
curlinkparams = curoption?.linkParams ?? {}, //获取linkParams下声明的key
extraParams = curoption?.extraParams ?? {};
return (
<>
<ProFormDependency name={Object.keys(curlinkparams)}>
......@@ -665,7 +669,10 @@ function LinkTreeSelect({ item, colProps, formRef, name, curindex }) {
let reversekey = !curlinkparams[key] ? key : curlinkparams[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 (name) {
......@@ -775,7 +782,8 @@ function CheckboxItem({ item, colProps }) {
function LinkCheckbox({ item, colProps, formRef, name, curindex }) {
let curoption = item.options ?? null,
curlinkparams = curoption?.linkParams ?? {}; //获取linkParams下声明的key
curlinkparams = curoption?.linkParams ?? {}, //获取linkParams下声明的key
extraParams = curoption?.extraParams ?? {};
return (
<>
<ProFormDependency name={Object.keys(curlinkparams)}>
......@@ -796,7 +804,10 @@ function LinkCheckbox({ item, colProps, formRef, name, curindex }) {
let reversekey = !curlinkparams[key] ? key : curlinkparams[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) {
let curvals = formRef?.current?.getFieldValue(name);
curvals = curvals.map((it, i) => {
......@@ -891,7 +902,8 @@ function RadioItem({ item, colProps }) {
function LinkRadio({ item, colProps, formRef, name, curindex }) {
let curoption = item.options ?? null,
curlinkparams = curoption?.linkParams ?? {}; //获取linkParams下声明的key
curlinkparams = curoption?.linkParams ?? {}, //获取linkParams下声明的key
extraParams = curoption?.extraParams ?? {};
return (
<>
<ProFormDependency name={Object.keys(curlinkparams)}>
......@@ -912,7 +924,10 @@ function LinkRadio({ item, colProps, formRef, name, curindex }) {
let reversekey = !curlinkparams[key] ? key : curlinkparams[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) {
let curvals = formRef?.current?.getFieldValue(name);
curvals = curvals.map((it, i) => {
......@@ -993,7 +1008,8 @@ function Radio(props) {
function LinkCascader({ item, colProps, formRef, name, curindex }) {
let prevparse = useRef();
let curoption = item.options ?? null,
curlinkparams = curoption?.linkParams ?? {}; //获取linkParams下声明的key
curlinkparams = curoption?.linkParams ?? {}, //获取linkParams下声明的key
extraParams = curoption?.extraParams ?? {};
return (
<>
<ProFormDependency name={Object.keys(curlinkparams)}>
......@@ -1019,7 +1035,10 @@ function LinkCascader({ item, colProps, formRef, name, curindex }) {
let reversekey = !curlinkparams[key] ? key : curlinkparams[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 (name) {
let curvals = formRef?.current?.getFieldValue(name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment