mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-07 22:49:26 +08:00
fix: variable parse issue in link action with variables in paths (#4732)
This commit is contained in:
parent
78955cb560
commit
aec77064c4
@ -1053,13 +1053,13 @@ export const useDetailPrintActionProps = () => {
|
||||
const printHandler = useReactToPrint({
|
||||
content: () => formBlockRef.current,
|
||||
pageStyle: `@media print {
|
||||
* {
|
||||
margin: 0;
|
||||
}
|
||||
:not(.ant-formily-item-control-content-component) > div.ant-formily-layout>div:first-child {
|
||||
overflow: hidden; height: 0;
|
||||
}
|
||||
}`,
|
||||
* {
|
||||
margin: 0;
|
||||
}
|
||||
:not(.ant-formily-item-control-content-component) > div.ant-formily-layout>div:first-child {
|
||||
overflow: hidden; height: 0;
|
||||
}
|
||||
}`,
|
||||
});
|
||||
return {
|
||||
async onClick() {
|
||||
@ -1523,7 +1523,10 @@ async function resetFormCorrectly(form: Form) {
|
||||
}
|
||||
|
||||
export function appendQueryStringToUrl(url: string, queryString: string) {
|
||||
return url + (url.includes('?') ? '&' : '?') + queryString;
|
||||
if (queryString) {
|
||||
return url + (url.includes('?') ? '&' : '?') + queryString;
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
export function useLinkActionProps() {
|
||||
@ -1548,7 +1551,8 @@ export function useLinkActionProps() {
|
||||
localVariables,
|
||||
replaceVariableValue,
|
||||
});
|
||||
const link = appendQueryStringToUrl(url, queryString);
|
||||
const targetUrl = await replaceVariableValue(url, variables, localVariables);
|
||||
const link = appendQueryStringToUrl(targetUrl, queryString);
|
||||
if (link) {
|
||||
if (isURL(link)) {
|
||||
window.open(link, '_blank');
|
||||
|
Loading…
x
Reference in New Issue
Block a user