From 06aa17972cc0234f93cf043209769171a20f3c07 Mon Sep 17 00:00:00 2001 From: sunhao Date: Tue, 30 Dec 2025 10:35:38 +0800 Subject: [PATCH] * [misc] fix block exporting url in doc and markdown. --- lib/zin/wg/docapp/js/v1.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/zin/wg/docapp/js/v1.js b/lib/zin/wg/docapp/js/v1.js index 6454e00f05..725b34d981 100644 --- a/lib/zin/wg/docapp/js/v1.js +++ b/lib/zin/wg/docapp/js/v1.js @@ -95,16 +95,18 @@ function getZentaoListProps(type, blockID, props) const zentaoListLang = getLang('zentaoList'); const exportUrl = `${location.origin}${$.createLink('doc', 'ajaxExportZentaoList', `blockID=${blockID}`)}`; const title = [(zentaoListLang ? zentaoListLang[type] : type), getLang('list')].join(config.clientLang.includes('zh') ? '' : ' '); - return $.extend( + const fetcher = `${location.origin}${$.createLink('doc', 'zentaoList', `type=${type}&blockID=${blockID}`)}`; + return $.extend({}, props, { title: title, - fetcher: $.createLink('doc', 'zentaoList', `type=${type}&blockID=${blockID}`), + fetcher: fetcher, clearBeforeLoad: false }, type === 'gantt' ? { + fetcher: fetcher, export: [{type: 'link', props: {text: title, href: exportUrl}}] } : { exportUrl: exportUrl, - }, props); + }); } /* 更新禅道列表。*/ @@ -2343,8 +2345,8 @@ function handleImportDocSnapshot(snapshot) const fixUrl = (url, method, paramList) => { const link = $.parseLink(url, 'auto'); - if(link.requestType.toUpperCase() === requestType || method.toLowerCase() !== link.methodName.toLowerCase()) return url; - return $.createLink('doc', method, paramList.map((p, i) => [p, link.vars[i][1]])); + if(link.requestType.toUpperCase() === requestType || method.toLowerCase() !== link.methodName.toLowerCase()) return url + return `${location.origin}${$.createLink('doc', method, paramList.map((p, i) => [p, link.vars[i][1]]))}`; }; /* Fix custom block with fetcher in difference request type. */ forEachBlock(snapshot.blocks.children, block =>