0bc8d9f6 by lihua

调整报告生成样式

1 parent cb50dc19
...@@ -125,7 +125,7 @@ const getAnalysisResultPageData = (isFull = false) => { ...@@ -125,7 +125,7 @@ const getAnalysisResultPageData = (isFull = false) => {
125 }); 125 });
126 obj['equivalenceClassNum'] = changeNum(d.equivalenceClassNum || 0, 0); 126 obj['equivalenceClassNum'] = changeNum(d.equivalenceClassNum || 0, 0);
127 obj['reIdentifyRisk'] = changeNum(d.reIdentifyRisk || 0, 2); 127 obj['reIdentifyRisk'] = changeNum(d.reIdentifyRisk || 0, 2);
128 obj['isGtThreshold'] = d.isGtThreshold; 128 obj['isGtThreshold'] = d.isGtThreshold === 'Y' ? '是取值为1' : '否取值为0';
129 fullResultData.value.push(obj); 129 fullResultData.value.push(obj);
130 }); 130 });
131 resultData.value = fullResultData.value.slice(0, pageInfo.value.limit); 131 resultData.value = fullResultData.value.slice(0, pageInfo.value.limit);
...@@ -139,7 +139,7 @@ const getAnalysisResultPageData = (isFull = false) => { ...@@ -139,7 +139,7 @@ const getAnalysisResultPageData = (isFull = false) => {
139 }); 139 });
140 obj['equivalenceClassNum'] = changeNum(d.equivalenceClassNum || 0, 0); 140 obj['equivalenceClassNum'] = changeNum(d.equivalenceClassNum || 0, 0);
141 obj['reIdentifyRisk'] = changeNum(d.reIdentifyRisk || 0, 2); 141 obj['reIdentifyRisk'] = changeNum(d.reIdentifyRisk || 0, 2);
142 obj['isGtThreshold'] = d.isGtThreshold; 142 obj['isGtThreshold'] = d.isGtThreshold === 'Y' ? '是取值为1' : '否取值为0';
143 resultData.value.push(obj); 143 resultData.value.push(obj);
144 }); 144 });
145 pageInfo.value.rows = res.data?.totalRows ?? 0; 145 pageInfo.value.rows = res.data?.totalRows ?? 0;
...@@ -206,7 +206,21 @@ const downloadWord = () => { ...@@ -206,7 +206,21 @@ const downloadWord = () => {
206 resultDataLoading.value = true; 206 resultDataLoading.value = true;
207 loadingText.value = '报告正在下载中,请勿关闭浏览器...'; 207 loadingText.value = '报告正在下载中,请勿关闭浏览器...';
208 downPromise.value = convertHtml2Img(report, dom).then(() => { 208 downPromise.value = convertHtml2Img(report, dom).then(() => {
209 downloadAnonReport({ taskGuid: taskGuid.value, title: `${analysisResultInfo.value.tenantName}持有的“${oldAnonTaskValueInfo.value.taskName}”`, evaluationDate: analysisResultInfo.value.execTime ? analysisResultInfo.value.execTime.substring(0, 10) : '', deIdentProcessorName: userData.tenantName, html: encodeURIComponent(`<div>${getHTML(dom.innerHTML)}</div>`) }).then((res: any) => { downPromise.value = null 209 const htmlContent = getHTML(dom.innerHTML);
210 const pageBreakRegex = /<br\s[^>]*>/gi;
211 const match = htmlContent.match(pageBreakRegex);
212 let htmlOverview = htmlContent;
213 let htmlContentPart = '';
214
215 if (match && match.length >= 1) {
216 const secondBr = match[0];
217 const index = htmlContent.indexOf(secondBr);
218 if (index !== -1) {
219 htmlOverview = htmlContent.substring(0, index + secondBr.length);
220 htmlContentPart = htmlContent.substring(index + secondBr.length);
221 }
222 }
223 downloadAnonReport({ taskGuid: taskGuid.value, title: `${analysisResultInfo.value.tenantName}持有的“${oldAnonTaskValueInfo.value.taskName}”`, evaluationDate: analysisResultInfo.value.execTime ? analysisResultInfo.value.execTime.substring(0, 10) : '', deIdentProcessorName: userData.tenantName, htmlOverview: encodeURIComponent(`<div>${htmlOverview}</div>`), htmlContent: encodeURIComponent(`<div>${htmlContentPart}</div>`) }).then((res: any) => {
210 loadingText.value = ''; 224 loadingText.value = '';
211 resultDataLoading.value = false; 225 resultDataLoading.value = false;
212 if (res && !res.msg) { 226 if (res && !res.msg) {
......
...@@ -2151,7 +2151,7 @@ const getAnalysisResultPageData = (isFull = false) => { ...@@ -2151,7 +2151,7 @@ const getAnalysisResultPageData = (isFull = false) => {
2151 }); 2151 });
2152 obj['equivalenceClassNum'] = changeNum(d.equivalenceClassNum || 0, 0); 2152 obj['equivalenceClassNum'] = changeNum(d.equivalenceClassNum || 0, 0);
2153 obj['reIdentifyRisk'] = changeNum(d.reIdentifyRisk || 0, 2); 2153 obj['reIdentifyRisk'] = changeNum(d.reIdentifyRisk || 0, 2);
2154 obj['isGtThreshold'] = d.isGtThreshold; 2154 obj['isGtThreshold'] = d.isGtThreshold === 'Y' ? '是取值为1' : '否取值为0';
2155 fullResultData.value.push(obj); 2155 fullResultData.value.push(obj);
2156 }); 2156 });
2157 resultData.value = fullResultData.value.slice(0, pageInfo.value.limit); 2157 resultData.value = fullResultData.value.slice(0, pageInfo.value.limit);
...@@ -2165,7 +2165,7 @@ const getAnalysisResultPageData = (isFull = false) => { ...@@ -2165,7 +2165,7 @@ const getAnalysisResultPageData = (isFull = false) => {
2165 }); 2165 });
2166 obj['equivalenceClassNum'] = changeNum(d.equivalenceClassNum || 0, 0); 2166 obj['equivalenceClassNum'] = changeNum(d.equivalenceClassNum || 0, 0);
2167 obj['reIdentifyRisk'] = changeNum(d.reIdentifyRisk || 0, 2); 2167 obj['reIdentifyRisk'] = changeNum(d.reIdentifyRisk || 0, 2);
2168 obj['isGtThreshold'] = d.isGtThreshold; 2168 obj['isGtThreshold'] = d.isGtThreshold === 'Y' ? '是取值为1' : '否取值为0';
2169 resultData.value.push(obj); 2169 resultData.value.push(obj);
2170 }); 2170 });
2171 pageInfo.value.rows = res.data?.totalRows ?? 0; 2171 pageInfo.value.rows = res.data?.totalRows ?? 0;
...@@ -2234,6 +2234,7 @@ const downloadWord = () => { ...@@ -2234,6 +2234,7 @@ const downloadWord = () => {
2234 dom.innerHTML = report?.innerHTML; 2234 dom.innerHTML = report?.innerHTML;
2235 loadingText.value = '报告正在下载中,请勿关闭浏览器...'; 2235 loadingText.value = '报告正在下载中,请勿关闭浏览器...';
2236 downloadLoading.value = true; 2236 downloadLoading.value = true;
2237
2237 downPromise.value = convertHtml2Img(report, dom).then(() => { 2238 downPromise.value = convertHtml2Img(report, dom).then(() => {
2238 downloadAnonReport({ taskGuid: oldAnonTaskValueInfo.value.guid, title: `${analysisResultInfo.value.tenantName}持有的“${oldAnonTaskValueInfo.value.taskName}”`, evaluationDate: analysisResultInfo.value.execTime ? analysisResultInfo.value.execTime.substring(0, 10) : '', 2239 downloadAnonReport({ taskGuid: oldAnonTaskValueInfo.value.guid, title: `${analysisResultInfo.value.tenantName}持有的“${oldAnonTaskValueInfo.value.taskName}”`, evaluationDate: analysisResultInfo.value.execTime ? analysisResultInfo.value.execTime.substring(0, 10) : '',
2239 deIdentProcessorName: userData.tenantName, html: encodeURIComponent(`<div>${getHTML(dom.innerHTML)}</div>`) }).then((res: any) => { 2240 deIdentProcessorName: userData.tenantName, html: encodeURIComponent(`<div>${getHTML(dom.innerHTML)}</div>`) }).then((res: any) => {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!