|
@@ -539,7 +539,7 @@
|
|
|
function cancelDownload() {
|
|
|
downloadOption.value = {};
|
|
|
}
|
|
|
- const [registerDownModal, { openModal: openDownModal }] = useModal();
|
|
|
+ const [registerDownModal, { openModal: openDownModal, closeModal }] = useModal();
|
|
|
const [registerMoveModal, { openModal: openMoveModal }] = useModal();
|
|
|
const [registerPowersModal, { openModal: openPowersModal }] = useModal();
|
|
|
const [registerCaseListModal, { openModal: openCaseListModal }] = useModal();
|
|
@@ -627,42 +627,45 @@
|
|
|
console.log('handleDownload', record, canDownload.value);
|
|
|
canDownload.value = true;
|
|
|
let isObj = record.type == 5 || record.type == 7 ? 1 : 0;
|
|
|
- checkDownLoad({ num: record.num, isObj }).then((res) => {
|
|
|
- console.log(res);
|
|
|
+ let params = { num: record.num, isObj };
|
|
|
+ checkDownLoad(params).then(async (res) => {
|
|
|
+ let sceneDownloadRes = res;
|
|
|
if (res.downloadStatus != 3) {
|
|
|
// 未下载过,需要打包
|
|
|
- sceneDownload({ num: record.num, isObj }).then((res) => {
|
|
|
- console.log(res);
|
|
|
- openDownModal(true, {
|
|
|
- ...record,
|
|
|
- });
|
|
|
- if (res.downloadStatus == 1) {
|
|
|
- if (timer.value) {
|
|
|
- afterClose();
|
|
|
- }
|
|
|
- timer.value = setInterval(() => {
|
|
|
- downloadProcess({ num: record.num, isObj }).then((res) => {
|
|
|
- if (res.status == '1003') {
|
|
|
- createMessage.error('下载失败');
|
|
|
- afterClose();
|
|
|
- return;
|
|
|
- }
|
|
|
- if (res.percent >= 100) {
|
|
|
- canDownload.value = false;
|
|
|
- afterClose();
|
|
|
- }
|
|
|
- downloadOption.value = res;
|
|
|
- console.log(res);
|
|
|
- });
|
|
|
- }, 1000);
|
|
|
- }
|
|
|
+ if (res.downloadStatus != 1) {
|
|
|
+ sceneDownloadRes = await sceneDownload(params);
|
|
|
+ }
|
|
|
+ openDownModal(true, {
|
|
|
+ ...record,
|
|
|
});
|
|
|
+ if (sceneDownloadRes.downloadStatus == 1) {
|
|
|
+ if (timer.value) {
|
|
|
+ afterClose();
|
|
|
+ }
|
|
|
+ getProcess(params);
|
|
|
+ }
|
|
|
} else {
|
|
|
- canDownload.value = false;
|
|
|
window.open(res.downloadUrl);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ function getProcess(params) {
|
|
|
+ timer.value = setTimeout(() => {
|
|
|
+ downloadProcess(params).then((processres) => {
|
|
|
+ console.log('processres', processres, params);
|
|
|
+ downloadOption.value = processres;
|
|
|
+ if (processres.percent >= 100) {
|
|
|
+ canDownload.value = false;
|
|
|
+ afterClose();
|
|
|
+ window.open(processres.url);
|
|
|
+ closeModal();
|
|
|
+ cancelDownload();
|
|
|
+ } else {
|
|
|
+ getProcess(params);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
function handleEdit(record: Recordable) {
|
|
|
window.open(record.thumbEdit + '&&token=' + token.value);
|
|
|
}
|