Commit a88ea068 authored by TZW's avatar TZW

111

parent 802a5405
...@@ -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);
......
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