084a87b7 by lihua

专区自己新建的显示下载按钮

1 parent 27925b94
......@@ -206,8 +206,9 @@ const downloadWord = () => {
let report = resultReportRef.value?.report;
dom.innerHTML = report?.innerHTML;
resultDataLoading.value = true;
loadingText.value = '评测报告正在发送中,请勿关闭浏览器...';
loadingText.value = `评测报告正在${route.query.dataOwner == '1' ? '发送' : '下载' }中,请勿关闭浏览器...`;
downPromise.value = convertHtml2Img(report, dom).then(() => {
if (route.query.dataOwner == '1') {
sendAnonReport({ taskGuid: taskGuid.value, html: encodeURIComponent(`<div>${getHTML(dom.innerHTML)}</div>`) }).then((res: any) => {
downPromise.value = null
loadingText.value = '';
......@@ -218,6 +219,18 @@ const downloadWord = () => {
res?.msg && ElMessage.error(res?.msg);
}
})
} else {
htmlToWord({ html: encodeURIComponent(`<div>${getHTML(dom.innerHTML)}</div>`) }).then((res: any) => {
downPromise.value = null
loadingText.value = '';
resultDataLoading.value = false;
if (res && !res.msg) {
download(res, (route.query.taskName || oldAnonTaskValueInfo.value.taskName) + '_匿名化评估报告.docx', 'word')
} else {
res?.msg && ElMessage.error(res?.msg);
}
})
}
}).catch(() => {
downPromise.value = null;
});
......@@ -264,7 +277,8 @@ onBeforeMount(() => {
v-preReClick>预览Word评估报告</el-button>
<div v-show="isWordStyle" style="margin-bottom: 8px;">
<el-button @click="isWordStyle = false">返回</el-button>
<el-button type="primary" @click="downloadWord">确认并发送评测报告</el-button>
<el-button type="primary" @click="downloadWord">{{ route.query.dataOwner == '1' ? '确认并发送评测报告' : '下载评测报告'
}}</el-button>
</div>
</template>
<anonResultAnalysis ref="resultReportRef" :show-title="true" :analysis-result-info="analysisResultInfo"
......
......@@ -169,7 +169,8 @@
v-loading="!!downPromise" @click="transfer">预览Word评估报告</el-button>
<div v-show="isWordStyle">
<el-button @click="isWordStyle = false">返回</el-button>
<el-button type="primary" @click="downloadWord">确认并发送评测报告</el-button>
<!-- 专区自己新建的显示下载报告。 -->
<el-button type="primary" @click="downloadWord">下载评估报告</el-button>
</div>
</template>
</ContentWrap>
......@@ -1968,12 +1969,12 @@ const downloadWord = () => {
loadingText.value = '报告正在下载中,请勿关闭浏览器...';
downloadLoading.value = true;
downPromise.value = convertHtml2Img(report, dom).then(() => {
sendAnonReport({ taskGuid: taskGuid.value, html: encodeURIComponent(`<div>${getHTML(dom.innerHTML)}</div>`) }).then((res: any) => {
htmlToWord({ html: encodeURIComponent(`<div>${getHTML(dom.innerHTML)}</div>`) }).then((res: any) => {
downPromise.value = null
loadingText.value = '';
downloadLoading.value = false;
if (res?.code == proxy.$passCode) {
proxy.$ElMessage.success('评测报告发送成功');
if (res && !res.msg) {
download(res, (route.query.taskName || oldAnonTaskValueInfo.value.taskName) + '_匿名化评估报告.docx', 'word')
} else {
res?.msg && ElMessage.error(res?.msg);
}
......
......@@ -95,7 +95,8 @@ const tableInfo = ref({
query: {
guid: scope.row.guid,
execGuid: scope.row.lastExecGuid,
taskName: scope.row.taskName
taskName: scope.row.taskName,
dataOwner: scope.row.dataOwnership
}
});
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!