|
|
@@ -4,13 +4,18 @@
|
|
|
<template #footer>
|
|
|
<a-tabs v-model:activeKey="tableType" @change="changeTable">
|
|
|
<Tabs.TabPane :key="0" tab="多元融合" :disabled="loading" />
|
|
|
- <Tabs.TabPane :key="1" tab="共享多元融合" :disabled="loading" />
|
|
|
- </a-tabs
|
|
|
+ <Tabs.TabPane :key="1" tab="共享多元融合" :disabled="loading" /> </a-tabs
|
|
|
></template>
|
|
|
<div class="desc-wrap-BasicTable">
|
|
|
<BasicTable @register="registerTable" :columns="columnsFun">
|
|
|
<template #toolbar>
|
|
|
- <a-button type="primary" @click="handleAdd" v-if="getCheckPerm('diversity-Add') && tableType == 0"> 新增</a-button>
|
|
|
+ <a-button
|
|
|
+ type="primary"
|
|
|
+ @click="handleAdd"
|
|
|
+ v-if="getCheckPerm('diversity-Add') && tableType == 0"
|
|
|
+ >
|
|
|
+ 新增</a-button
|
|
|
+ >
|
|
|
</template>
|
|
|
|
|
|
<template #href="{ record }">
|
|
|
@@ -47,7 +52,7 @@
|
|
|
{
|
|
|
label: '下载',
|
|
|
ifShow: getTypeCheckPerm('diversity-download') && !record.isOpen,
|
|
|
- disabled: tableType == 1,
|
|
|
+ disabled: tableType == 1,
|
|
|
onClick: createConfirmDownload.bind(null, record),
|
|
|
},
|
|
|
{
|
|
|
@@ -80,15 +85,9 @@
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
import { defineComponent, h, computed, ref, onMounted } from 'vue';
|
|
|
- import {
|
|
|
- BasicTable,
|
|
|
- useTable,
|
|
|
- TableAction,
|
|
|
- BasicColumn,
|
|
|
- FormProps,
|
|
|
- } from '/@/components/Table';
|
|
|
+ import { BasicTable, useTable, TableAction, BasicColumn, FormProps } from '/@/components/Table';
|
|
|
import { PageWrapper } from '/@/components/Page';
|
|
|
- import AddModal from './addCaseModal.vue'
|
|
|
+ import AddModal from './addCaseModal.vue';
|
|
|
import DownLoadModal from './DownLoadModal.vue';
|
|
|
import MoveModal from './MoveModal.vue';
|
|
|
import PowersModal from '/@/views/productOperation/modal/PowersModal.vue';
|
|
|
@@ -207,7 +206,7 @@
|
|
|
downloadOption.value = {};
|
|
|
}
|
|
|
const [registerAddModal, { openModal: openAddModal }] = useModal();
|
|
|
- const [registerDownModal, { openModal: openDownModal }] = useModal();
|
|
|
+ const [registerDownModal, { openModal: openDownModal, closeModal }] = useModal();
|
|
|
const [registerMoveModal, { openModal: openMoveModal }] = useModal();
|
|
|
const [registerPowersModal, { openModal: openPowersModal }] = useModal();
|
|
|
const [registerTable, { reload, setPagination, getColumns, setColumns }] = useTable({
|
|
|
@@ -238,7 +237,7 @@
|
|
|
});
|
|
|
function changeTable(val: number) {
|
|
|
tableType.value = val;
|
|
|
- setColumns(columns())
|
|
|
+ setColumns(columns());
|
|
|
setPagination({ current: 1 });
|
|
|
reload();
|
|
|
}
|
|
|
@@ -246,7 +245,7 @@
|
|
|
console.log('addPowes', getColumns(), columns());
|
|
|
let res = await caseFusionAdd({});
|
|
|
console.log('handleAdd', res);
|
|
|
- handlegotoEdit(res)
|
|
|
+ handlegotoEdit(res);
|
|
|
}
|
|
|
async function handleCopy(record: Recordable) {
|
|
|
createConfirm({
|
|
|
@@ -267,13 +266,13 @@
|
|
|
title: '删除',
|
|
|
content: '确定要删除吗?',
|
|
|
onOk: async () => {
|
|
|
- caseFusionDel({ fusionId: record.fusionId }).then(() => {
|
|
|
- message.success({
|
|
|
- content: '删除成功',
|
|
|
- });
|
|
|
+ caseFusionDel({ fusionId: record.fusionId }).then(() => {
|
|
|
+ message.success({
|
|
|
+ content: '删除成功',
|
|
|
+ });
|
|
|
|
|
|
- reload();
|
|
|
- });
|
|
|
+ reload();
|
|
|
+ });
|
|
|
},
|
|
|
});
|
|
|
}
|
|
|
@@ -300,7 +299,7 @@
|
|
|
okText: '继续',
|
|
|
content: '多元融合资源过大会导致离线包下载失败,请尽可能缩小多元融合资源后再下载。',
|
|
|
onOk: async () => {
|
|
|
- handleDownload(record)
|
|
|
+ handleDownload(record);
|
|
|
},
|
|
|
});
|
|
|
}
|
|
|
@@ -313,35 +312,58 @@
|
|
|
console.log(res);
|
|
|
if (res.downloadStatus != 3) {
|
|
|
// 未下载过,需要打包
|
|
|
- openDownModal(true, {
|
|
|
- ...record,
|
|
|
- });
|
|
|
- if (res.downloadStatus == 1) {
|
|
|
- if (timer.value) {
|
|
|
- afterClose();
|
|
|
- }
|
|
|
- timer.value = setInterval(() => {
|
|
|
- downloadProcess({ fusionId: record.fusionId, }).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);
|
|
|
+ openDownModal(true, {
|
|
|
+ ...record,
|
|
|
+ });
|
|
|
+ if (res.downloadStatus == 1) {
|
|
|
+ if (timer.value) {
|
|
|
+ afterClose();
|
|
|
}
|
|
|
+ getProcess({ fusionId: record.fusionId });
|
|
|
+ // timer.value = setInterval(() => {
|
|
|
+ // downloadProcess({ fusionId: record.fusionId }).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);
|
|
|
+ }
|
|
|
} else {
|
|
|
canDownload.value = false;
|
|
|
window.open(res.downloadUrl);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ function getProcess(params) {
|
|
|
+ timer.value = setTimeout(() => {
|
|
|
+ downloadProcess(params).then((res) => {
|
|
|
+ console.log('getProcess', res);
|
|
|
+ downloadOption.value = res;
|
|
|
+ if (res.status == '1003') {
|
|
|
+ createMessage.error('下载失败');
|
|
|
+ afterClose();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (res.percent >= 100) {
|
|
|
+ canDownload.value = false;
|
|
|
+ window.open(res.url);
|
|
|
+ afterClose();
|
|
|
+ closeModal()
|
|
|
+ } else {
|
|
|
+ getProcess(params);
|
|
|
+ }
|
|
|
+ console.log(res);
|
|
|
+ });
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
async function handleGenerate(record: Recordable) {
|
|
|
console.log('record', record);
|
|
|
let data = await sceneDetail({ id: record.id });
|
|
|
@@ -401,11 +423,11 @@
|
|
|
tableType: tableType.value,
|
|
|
});
|
|
|
setTimeout(() => {
|
|
|
- setColumns(columns())
|
|
|
- }, 2000)
|
|
|
+ setColumns(columns());
|
|
|
+ }, 2000);
|
|
|
}
|
|
|
onMounted(() => {
|
|
|
- setColumns(columns())
|
|
|
+ setColumns(columns());
|
|
|
});
|
|
|
return {
|
|
|
registerTable,
|
|
|
@@ -478,7 +500,7 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- :deep(.ant-table-cell-content){
|
|
|
+ :deep(.ant-table-cell-content) {
|
|
|
display: block !important;
|
|
|
}
|
|
|
}
|