|
|
@@ -9,10 +9,7 @@
|
|
|
</a-tabs>
|
|
|
</template>
|
|
|
<div class="desc-wrap-BasicTable">
|
|
|
- <BasicTable
|
|
|
- @register="registerTable"
|
|
|
- :rowSelection="{ type: 'checkbox', onChange: handleSelect }"
|
|
|
- >
|
|
|
+ <BasicTable @register="registerTable" :rowSelection="{ type: 'checkbox' }">
|
|
|
<template #toolbar>
|
|
|
<a-button type="primary" @click="patchRestoreScene"> 批量复原</a-button>
|
|
|
<!-- <a-button type="primary" color="warning" @click="() => {}"> 编辑</a-button>
|
|
|
@@ -50,6 +47,7 @@
|
|
|
</template>
|
|
|
</BasicTable>
|
|
|
</div>
|
|
|
+ <RestoreModal @register="registerRestoreModal" />
|
|
|
</PageWrapper>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
@@ -68,29 +66,15 @@
|
|
|
import { Tabs } from 'ant-design-vue';
|
|
|
import { sceneDetail, buildSceneObj } from '/@/api/lastApi/index';
|
|
|
|
|
|
- import {
|
|
|
- ListApi,
|
|
|
- downloadSceneDataAPi,
|
|
|
- addDownloadNumApi,
|
|
|
- checkDownloadApi,
|
|
|
- DeleteApi,
|
|
|
- UpgradeToV4,
|
|
|
- sceneCopy,
|
|
|
- } from '/@/api/archive/list';
|
|
|
+ import { ListApi } from '/@/api/archive/list';
|
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
- import {
|
|
|
- downloadByUrl,
|
|
|
- // downloadByData,
|
|
|
- // downloadByBase64,
|
|
|
- // downloadByOnlineUrl,
|
|
|
- } from '/@/utils/file/download';
|
|
|
-
|
|
|
+ import RestoreModal from './restoreModal.vue';
|
|
|
// import { useUserStore } from '/@/store/modules/user';
|
|
|
|
|
|
import { useLocaleStore } from '/@/store/modules/locale';
|
|
|
- import { SceneDownloadParam } from '/@/api/scene/model';
|
|
|
const localeStore = useLocaleStore();
|
|
|
- console.log('localeStore', localeStore);
|
|
|
+ const [registerRestoreModal, { openModal: openRestoreModal }] = useModal();
|
|
|
+ // console.log('localeStore', localeStore);
|
|
|
|
|
|
// const userStore = useUserStore();
|
|
|
|
|
|
@@ -100,12 +84,13 @@
|
|
|
TableAction,
|
|
|
TableImg,
|
|
|
PageWrapper,
|
|
|
+ RestoreModal,
|
|
|
[Tabs.name]: Tabs,
|
|
|
[Tabs.TabPane.name]: Tabs.TabPane,
|
|
|
},
|
|
|
setup() {
|
|
|
const { createMessage, createConfirm } = useMessage();
|
|
|
- const [registerDownloadModal, { openModal: openDownloadModal }] = useModal();
|
|
|
+
|
|
|
const { t } = useI18n();
|
|
|
const loading = ref(false);
|
|
|
const tableType = ref<Number>(0); //0看看 、1看见、2深时
|
|
|
@@ -221,7 +206,7 @@
|
|
|
tableSetting: { fullScreen: true },
|
|
|
clickToRowSelect: true,
|
|
|
showIndexColumn: true,
|
|
|
- rowKey: 'num',
|
|
|
+ rowKey: 'sceneNum',
|
|
|
beforeFetch: (T) => {
|
|
|
loading.value = true;
|
|
|
return T;
|
|
|
@@ -258,54 +243,6 @@
|
|
|
createMessage.error(t(`apiCode.errCode${data.code}`));
|
|
|
}
|
|
|
}
|
|
|
- function handleLivestream(item) {
|
|
|
- let url = item.webSite;
|
|
|
- let page = url.substring(url.lastIndexOf('/') + 1, url.lastIndexOf('.html'));
|
|
|
- url = url.replace(page, 'rtc-live');
|
|
|
- window.open(url.replace('http://', 'https://') + (isJA.value ? '&lang=ja' : ''), '_blank');
|
|
|
- }
|
|
|
- function handleCopy(item) {
|
|
|
- createConfirm({
|
|
|
- iconType: 'warning',
|
|
|
- title: () => h('span', t('routes.scenes.copyInfi.title')),
|
|
|
- content: () => h('span', t('routes.scenes.copyInfi.content')),
|
|
|
- onOk: async () => {
|
|
|
- await sceneCopy(item.num);
|
|
|
- createMessage.success(t('common.optSuccess'));
|
|
|
- reload();
|
|
|
- },
|
|
|
- });
|
|
|
- }
|
|
|
- function handleUpgrade(item) {
|
|
|
- createConfirm({
|
|
|
- iconType: 'warning',
|
|
|
- title: () => h('span', t('routes.scenes.upgradeMessg.title')),
|
|
|
- content: () => h('span', t('routes.scenes.upgradeMessg.text')),
|
|
|
- onOk: async () => {
|
|
|
- console.log('item', item);
|
|
|
- let res = await UpgradeToV4(item.num);
|
|
|
- console.log('res', res);
|
|
|
- createMessage.success(t('common.optSuccess'));
|
|
|
- reload();
|
|
|
- },
|
|
|
- });
|
|
|
- }
|
|
|
- // async function restoreScene(record: Recordable) {
|
|
|
- // try {
|
|
|
- // const langtext = isJA.value ? 'ja' : 'zh';
|
|
|
- // const token = userStore.getToken; //&token=${token}
|
|
|
- // let url = record.webSite.replace('smobile', 'epc') + `&lang=${langtext}`;
|
|
|
- // if (tableType.value == 4 || tableType.value == 2) {
|
|
|
- // url = url + `&token=${token}`;
|
|
|
- // }
|
|
|
- // if (record.isUpgrade == 1) {
|
|
|
- // url = url.replace('smg', 'epg');
|
|
|
- // }
|
|
|
- // openUrl(url);
|
|
|
- // } catch (error) {
|
|
|
- // console.log('error', error);
|
|
|
- // }
|
|
|
- // }
|
|
|
async function restoreScene(record: Recordable) {
|
|
|
try {
|
|
|
console.log('record', record);
|
|
|
@@ -313,79 +250,52 @@
|
|
|
console.log('error', error);
|
|
|
}
|
|
|
}
|
|
|
- async function handleDelete(record: Recordable) {
|
|
|
- console.log('DeleteApi', record);
|
|
|
- await DeleteApi(record.num);
|
|
|
- createMessage.success(t('common.optSuccess'));
|
|
|
- reload();
|
|
|
- }
|
|
|
|
|
|
- async function handleDownloadScene(record: Recordable) {
|
|
|
- let param: SceneDownloadParam = {
|
|
|
- num: record.num,
|
|
|
- isObj: null,
|
|
|
- };
|
|
|
- if (tableType.value == 4 || tableType.value == 2) {
|
|
|
- param.isObj = tableType.value == 4 ? 1 : 0;
|
|
|
- }
|
|
|
- await addDownloadNumApi(param);
|
|
|
- // SceneDownloadModel
|
|
|
- const checker = await checkDownloadApi(param);
|
|
|
- if (checker.downloadStatus < 3) {
|
|
|
- const res = await downloadSceneDataAPi(param);
|
|
|
- console.log('res', res);
|
|
|
- openDownloadModal(true, { ...record, isObj: param.isObj });
|
|
|
- } else {
|
|
|
- downloadByUrl({
|
|
|
- url: checker.downloadUrl,
|
|
|
- target: '_self',
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
function changeTable(val: Number) {
|
|
|
tableType.value = val;
|
|
|
reload();
|
|
|
}
|
|
|
- const handleSelect = async () => {
|
|
|
- const keys = getSelectRowKeys();
|
|
|
- console.log('key', keys);
|
|
|
- };
|
|
|
const patchRestoreScene = async () => {
|
|
|
const keys = getSelectRowKeys();
|
|
|
- console.log('patchRestoreScene', keys);
|
|
|
+
|
|
|
+ if (keys.length > 0) {
|
|
|
+ console.log('patchRestoreScene', keys);
|
|
|
+ openRestoreModal(true, {
|
|
|
+ tableType: tableType.value,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ createMessage.info(t('modal.atLeastOne'));
|
|
|
+ }
|
|
|
};
|
|
|
+
|
|
|
return {
|
|
|
registerTable,
|
|
|
createMessage,
|
|
|
t,
|
|
|
handleGenerate,
|
|
|
restoreScene,
|
|
|
- handleDownloadScene,
|
|
|
- handleDelete,
|
|
|
- handleLivestream,
|
|
|
- handleUpgrade,
|
|
|
- registerDownloadModal,
|
|
|
changeTable,
|
|
|
- handleCopy,
|
|
|
tableType,
|
|
|
loading,
|
|
|
isJA,
|
|
|
- handleSelect,
|
|
|
patchRestoreScene,
|
|
|
+ registerRestoreModal,
|
|
|
+ openRestoreModal,
|
|
|
};
|
|
|
},
|
|
|
});
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
:deep(.ant-table-tbody > tr > td:not(.ant-table-selection-column, .ant-table-cell-fix-right)) {
|
|
|
- /* background-color: gray; */
|
|
|
opacity: 0.5;
|
|
|
+ pointer-events: none;
|
|
|
}
|
|
|
:deep(.ant-table-tbody
|
|
|
> tr.ant-table-row-selected
|
|
|
> td:not(.ant-table-selection-column, .ant-table-cell-fix-right)) {
|
|
|
/* background-color: gray; */
|
|
|
opacity: 0.6;
|
|
|
+ pointer-events: all;
|
|
|
}
|
|
|
/* :deep(.ant-table-tbody > tr.ant-table-row-selected > td) {
|
|
|
background-color: red !important;
|