专区自己新建的显示下载按钮
Showing
3 changed files
with
33 additions
and
17 deletions
| ... | @@ -206,18 +206,31 @@ const downloadWord = () => { | ... | @@ -206,18 +206,31 @@ const downloadWord = () => { |
| 206 | let report = resultReportRef.value?.report; | 206 | let report = resultReportRef.value?.report; |
| 207 | dom.innerHTML = report?.innerHTML; | 207 | dom.innerHTML = report?.innerHTML; |
| 208 | resultDataLoading.value = true; | 208 | resultDataLoading.value = true; |
| 209 | loadingText.value = '评测报告正在发送中,请勿关闭浏览器...'; | 209 | loadingText.value = `评测报告正在${route.query.dataOwner == '1' ? '发送' : '下载' }中,请勿关闭浏览器...`; |
| 210 | downPromise.value = convertHtml2Img(report, dom).then(() => { | 210 | downPromise.value = convertHtml2Img(report, dom).then(() => { |
| 211 | sendAnonReport({ taskGuid: taskGuid.value, html: encodeURIComponent(`<div>${getHTML(dom.innerHTML)}</div>`) }).then((res: any) => { | 211 | if (route.query.dataOwner == '1') { |
| 212 | downPromise.value = null | 212 | sendAnonReport({ taskGuid: taskGuid.value, html: encodeURIComponent(`<div>${getHTML(dom.innerHTML)}</div>`) }).then((res: any) => { |
| 213 | loadingText.value = ''; | 213 | downPromise.value = null |
| 214 | resultDataLoading.value = false; | 214 | loadingText.value = ''; |
| 215 | if (res?.code == proxy.$passCode) { | 215 | resultDataLoading.value = false; |
| 216 | proxy.$ElMessage.success('评测报告发送成功'); | 216 | if (res?.code == proxy.$passCode) { |
| 217 | } else { | 217 | proxy.$ElMessage.success('评测报告发送成功'); |
| 218 | res?.msg && ElMessage.error(res?.msg); | 218 | } else { |
| 219 | } | 219 | res?.msg && ElMessage.error(res?.msg); |
| 220 | }) | 220 | } |
| 221 | }) | ||
| 222 | } else { | ||
| 223 | htmlToWord({ html: encodeURIComponent(`<div>${getHTML(dom.innerHTML)}</div>`) }).then((res: any) => { | ||
| 224 | downPromise.value = null | ||
| 225 | loadingText.value = ''; | ||
| 226 | resultDataLoading.value = false; | ||
| 227 | if (res && !res.msg) { | ||
| 228 | download(res, (route.query.taskName || oldAnonTaskValueInfo.value.taskName) + '_匿名化评估报告.docx', 'word') | ||
| 229 | } else { | ||
| 230 | res?.msg && ElMessage.error(res?.msg); | ||
| 231 | } | ||
| 232 | }) | ||
| 233 | } | ||
| 221 | }).catch(() => { | 234 | }).catch(() => { |
| 222 | downPromise.value = null; | 235 | downPromise.value = null; |
| 223 | }); | 236 | }); |
| ... | @@ -264,7 +277,8 @@ onBeforeMount(() => { | ... | @@ -264,7 +277,8 @@ onBeforeMount(() => { |
| 264 | v-preReClick>预览Word评估报告</el-button> | 277 | v-preReClick>预览Word评估报告</el-button> |
| 265 | <div v-show="isWordStyle" style="margin-bottom: 8px;"> | 278 | <div v-show="isWordStyle" style="margin-bottom: 8px;"> |
| 266 | <el-button @click="isWordStyle = false">返回</el-button> | 279 | <el-button @click="isWordStyle = false">返回</el-button> |
| 267 | <el-button type="primary" @click="downloadWord">确认并发送评测报告</el-button> | 280 | <el-button type="primary" @click="downloadWord">{{ route.query.dataOwner == '1' ? '确认并发送评测报告' : '下载评测报告' |
| 281 | }}</el-button> | ||
| 268 | </div> | 282 | </div> |
| 269 | </template> | 283 | </template> |
| 270 | <anonResultAnalysis ref="resultReportRef" :show-title="true" :analysis-result-info="analysisResultInfo" | 284 | <anonResultAnalysis ref="resultReportRef" :show-title="true" :analysis-result-info="analysisResultInfo" | ... | ... |
| ... | @@ -169,7 +169,8 @@ | ... | @@ -169,7 +169,8 @@ |
| 169 | v-loading="!!downPromise" @click="transfer">预览Word评估报告</el-button> | 169 | v-loading="!!downPromise" @click="transfer">预览Word评估报告</el-button> |
| 170 | <div v-show="isWordStyle"> | 170 | <div v-show="isWordStyle"> |
| 171 | <el-button @click="isWordStyle = false">返回</el-button> | 171 | <el-button @click="isWordStyle = false">返回</el-button> |
| 172 | <el-button type="primary" @click="downloadWord">确认并发送评测报告</el-button> | 172 | <!-- 专区自己新建的显示下载报告。 --> |
| 173 | <el-button type="primary" @click="downloadWord">下载评估报告</el-button> | ||
| 173 | </div> | 174 | </div> |
| 174 | </template> | 175 | </template> |
| 175 | </ContentWrap> | 176 | </ContentWrap> |
| ... | @@ -1968,12 +1969,12 @@ const downloadWord = () => { | ... | @@ -1968,12 +1969,12 @@ const downloadWord = () => { |
| 1968 | loadingText.value = '报告正在下载中,请勿关闭浏览器...'; | 1969 | loadingText.value = '报告正在下载中,请勿关闭浏览器...'; |
| 1969 | downloadLoading.value = true; | 1970 | downloadLoading.value = true; |
| 1970 | downPromise.value = convertHtml2Img(report, dom).then(() => { | 1971 | downPromise.value = convertHtml2Img(report, dom).then(() => { |
| 1971 | sendAnonReport({ taskGuid: taskGuid.value, html: encodeURIComponent(`<div>${getHTML(dom.innerHTML)}</div>`) }).then((res: any) => { | 1972 | htmlToWord({ html: encodeURIComponent(`<div>${getHTML(dom.innerHTML)}</div>`) }).then((res: any) => { |
| 1972 | downPromise.value = null | 1973 | downPromise.value = null |
| 1973 | loadingText.value = ''; | 1974 | loadingText.value = ''; |
| 1974 | downloadLoading.value = false; | 1975 | downloadLoading.value = false; |
| 1975 | if (res?.code == proxy.$passCode) { | 1976 | if (res && !res.msg) { |
| 1976 | proxy.$ElMessage.success('评测报告发送成功'); | 1977 | download(res, (route.query.taskName || oldAnonTaskValueInfo.value.taskName) + '_匿名化评估报告.docx', 'word') |
| 1977 | } else { | 1978 | } else { |
| 1978 | res?.msg && ElMessage.error(res?.msg); | 1979 | res?.msg && ElMessage.error(res?.msg); |
| 1979 | } | 1980 | } | ... | ... |
| ... | @@ -95,7 +95,8 @@ const tableInfo = ref({ | ... | @@ -95,7 +95,8 @@ const tableInfo = ref({ |
| 95 | query: { | 95 | query: { |
| 96 | guid: scope.row.guid, | 96 | guid: scope.row.guid, |
| 97 | execGuid: scope.row.lastExecGuid, | 97 | execGuid: scope.row.lastExecGuid, |
| 98 | taskName: scope.row.taskName | 98 | taskName: scope.row.taskName, |
| 99 | dataOwner: scope.row.dataOwnership | ||
| 99 | } | 100 | } |
| 100 | }); | 101 | }); |
| 101 | } | 102 | } | ... | ... |
-
Please register or sign in to post a comment