|
@@ -1,219 +1,342 @@
|
|
|
<template>
|
|
|
- <a-tabs v-model:activeKey="searchInfo.activeKey">
|
|
|
- <a-tab-pane key="1" tab="Tab 1">
|
|
|
- <BasicTable @register="registerTimeTable">
|
|
|
+ <PageWrapper contentBackground>
|
|
|
+ <template #footer>
|
|
|
+ <a-tabs v-model:activeKey="tableType" @change="changeTable">
|
|
|
+ <a-tab-pane :key="0" tab="四维看看" />
|
|
|
+ <a-tab-pane :key="1" tab="四维看见" />
|
|
|
+ <a-tab-pane :key="2" tab="四维双目深时" />
|
|
|
+ <a-tab-pane :key="3" tab="四维双目Lite" />
|
|
|
+ <a-tab-pane :key="4" tab="全景看看" />
|
|
|
+ </a-tabs
|
|
|
+ ></template>
|
|
|
+ <div class="desc-wrap-BasicTable">
|
|
|
+ <BasicTable v-if="tableType == 4" @register="registerTableViewKankan">
|
|
|
<template #action="{ record }">
|
|
|
<TableAction
|
|
|
+ stopButtonPropagation
|
|
|
:actions="[
|
|
|
{
|
|
|
- label: '编辑',
|
|
|
- icon: 'ep:edit',
|
|
|
- onClick: handleEdit.bind(null, record),
|
|
|
+ label: '删除',
|
|
|
+ color: 'error',
|
|
|
+ popConfirm: {
|
|
|
+ title: '是否删除?',
|
|
|
+ confirm: handleDelete.bind(null, record),
|
|
|
+ placement: 'topLeft',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ]"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </BasicTable>
|
|
|
+ <BasicTable v-else @register="registerTable">
|
|
|
+ <template #action="{ record }">
|
|
|
+ <TableAction
|
|
|
+ stopButtonPropagation
|
|
|
+ :actions="[
|
|
|
+ {
|
|
|
+ label: '迁移',
|
|
|
+ onClick: handleMove.bind(null, record),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '下载',
|
|
|
+ disabled:
|
|
|
+ (record.payStatus - 0 != 1 && record.status - 0 == 0) ||
|
|
|
+ (record.payStatus - 0 != 1 && record.status - 0 == -1),
|
|
|
+ onClick: handleDownload.bind(null, record),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '重算',
|
|
|
+ disabled: record.payStatus != 1 && record.status - 0 == 0,
|
|
|
+ popConfirm: {
|
|
|
+ title: '是否重算?',
|
|
|
+ confirm: handleReset.bind(null, record),
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '复制',
|
|
|
+ disabled:
|
|
|
+ (record.payStatus != 1 && record.status - 0 == 0) ||
|
|
|
+ (record.payStatus != 1 && record.status - 0 == -1),
|
|
|
+ popConfirm: {
|
|
|
+ title: '是否复制?',
|
|
|
+ confirm: handleCopy.bind(null, record),
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
label: '删除',
|
|
|
- icon: 'ic:outline-delete-outline',
|
|
|
+ color: 'error',
|
|
|
popConfirm: {
|
|
|
- title: '是否确认删除',
|
|
|
+ title: '是否删除?',
|
|
|
confirm: handleDelete.bind(null, record),
|
|
|
+ placement: 'topRight',
|
|
|
},
|
|
|
},
|
|
|
]"
|
|
|
/>
|
|
|
</template>
|
|
|
</BasicTable>
|
|
|
- </a-tab-pane>
|
|
|
- <a-tab-pane key="2" tab="Tab 2">Content of tab 2</a-tab-pane>
|
|
|
- <a-tab-pane key="3" tab="Tab 3">Content of tab 3</a-tab-pane>
|
|
|
- <template #tabBarExtraContent>
|
|
|
- <a-button>Extra Action</a-button>
|
|
|
- </template>
|
|
|
- </a-tabs>
|
|
|
+ </div>
|
|
|
+ <DownLoadModal
|
|
|
+ :downloadOption="downloadOption"
|
|
|
+ @cancel="afterClose"
|
|
|
+ @register="registerDownModal"
|
|
|
+ @update="reload"
|
|
|
+ cancelText="取消下载"
|
|
|
+ okText="下载"
|
|
|
+ @cancelDownload="cancelDownload"
|
|
|
+ :okButtonProps="{ disabled: canDownload }"
|
|
|
+ />
|
|
|
+ <MoveModal @register="registerMoveModal" />
|
|
|
+ </PageWrapper>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
-import { defineComponent, reactive, h } from 'vue';
|
|
|
-import { BasicTable, useTable, FormProps, TableAction, BasicColumn } from '/@/components/Table';
|
|
|
-import { PageWrapper } from '/@/components/Page';
|
|
|
-import { Divider, Card, Empty, Descriptions, Steps, Tabs } from 'ant-design-vue';
|
|
|
-import { CameraList, DelAndUpload, EditAndUpload } from '/@/api/product';
|
|
|
-import { useModal } from '/@/components/Modal';
|
|
|
-import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
-import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
-import { Switch } from 'ant-design-vue';
|
|
|
-import { Time } from '/@/components/Time';
|
|
|
-export default defineComponent({
|
|
|
- components: {
|
|
|
+ import { defineComponent, ref } from 'vue';
|
|
|
+ import {
|
|
|
BasicTable,
|
|
|
+ useTable,
|
|
|
TableAction,
|
|
|
- PageWrapper,
|
|
|
- [Divider.name]: Divider,
|
|
|
- [Card.name]: Card,
|
|
|
- Empty,
|
|
|
- [Descriptions.name]: Descriptions,
|
|
|
- [Descriptions.Item.name]: Descriptions.Item,
|
|
|
- [Steps.name]: Steps,
|
|
|
- [Steps.Step.name]: Steps.Step,
|
|
|
- [Tabs.name]: Tabs,
|
|
|
- [Tabs.TabPane.name]: Tabs.TabPane,
|
|
|
- },
|
|
|
- setup() {
|
|
|
- const { t } = useI18n();
|
|
|
- const searchInfo = reactive<Recordable>({
|
|
|
- activeKey: '1',
|
|
|
- });
|
|
|
- const [registerAddModal, { openModal: openAddModal }] = useModal();
|
|
|
- const [registerEditModal, { openModal: openEditModal }] = useModal();
|
|
|
- const { createMessage } = useMessage();
|
|
|
+ } from '/@/components/Table';
|
|
|
+ import { PageWrapper } from '/@/components/Page';
|
|
|
+ import DownLoadModal from '/@/views/productOperation/modal/DownLoadModal.vue';
|
|
|
+ import MoveModal from '/@/views/productOperation/modal/MoveModal.vue';
|
|
|
+ import { overallList, overallDelete } from '/@/api/operate';
|
|
|
+ import { Descriptions, Tabs, } from 'ant-design-vue';
|
|
|
+ import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
+ import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
+ import { columns,searchForm,cameraScene,cameraSearchForm} from './data'
|
|
|
+ import { useModal } from '/@/components/Modal';
|
|
|
+ import {
|
|
|
+ operateSceneList,
|
|
|
+ sceneMove,
|
|
|
+ sceneDelete,
|
|
|
+ sceneReset,
|
|
|
+ sceneDownload,
|
|
|
+ checkDownLoad,
|
|
|
+ downloadProcess,
|
|
|
+ sceneCopy,
|
|
|
+ rebuildScene,
|
|
|
+ } from '/@/api/operate';
|
|
|
+ import { message } from 'ant-design-vue';
|
|
|
+ export default defineComponent({
|
|
|
+ components: {
|
|
|
+ DownLoadModal,
|
|
|
+ MoveModal,
|
|
|
+ BasicTable,
|
|
|
+ TableAction,
|
|
|
+ PageWrapper,
|
|
|
+ [Descriptions.name]: Descriptions,
|
|
|
+ [Descriptions.Item.name]: Descriptions.Item,
|
|
|
|
|
|
- const refundTimeTableSchema: BasicColumn[] = [
|
|
|
- {
|
|
|
- title: '版本号',
|
|
|
- width: 150,
|
|
|
- dataIndex: 'version',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '版本更新说明',
|
|
|
- width: 150,
|
|
|
- dataIndex: 'description',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '最低版本号',
|
|
|
- width: 150,
|
|
|
- dataIndex: 'minVersion',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '创建人',
|
|
|
- width: 150,
|
|
|
- dataIndex: 'recStatus',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '创建时间',
|
|
|
- width: 150,
|
|
|
- dataIndex: 'createTime',
|
|
|
- customRender: ({ record }) => {
|
|
|
- return (
|
|
|
- record.createTime &&
|
|
|
- h(Time, {
|
|
|
- value: record.createTime,
|
|
|
- mode: 'datetime',
|
|
|
- })
|
|
|
- );
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- title: '状态',
|
|
|
- dataIndex: 'status',
|
|
|
- width: 80,
|
|
|
- customRender: ({ record }) => {
|
|
|
- if (!Reflect.has(record, 'pendingStatus')) {
|
|
|
- record.pendingStatus = false;
|
|
|
- }
|
|
|
- return h(Switch, {
|
|
|
- checked: record.status === 'A',
|
|
|
- checkedChildren: '启用',
|
|
|
- unCheckedChildren: '禁用',
|
|
|
- loading: false,
|
|
|
- onChange: async (checked: boolean) => {
|
|
|
- record.pendingStatus = true;
|
|
|
- const newStatus = checked ? 'A' : 'I';
|
|
|
- await EditAndUpload({ ...record, status: newStatus });
|
|
|
- if (checked) {
|
|
|
- Reflect.set(record, 'status', newStatus);
|
|
|
- } else {
|
|
|
- Reflect.set(record, 'status', newStatus);
|
|
|
- }
|
|
|
- reload()
|
|
|
- createMessage.success(t('common.optSuccess'));
|
|
|
- },
|
|
|
- });
|
|
|
+ [Tabs.name]: Tabs,
|
|
|
+ [Tabs.TabPane.name]: Tabs.TabPane,
|
|
|
+ },
|
|
|
+ setup() {
|
|
|
+ const { t } = useI18n();
|
|
|
+ const { createMessage, createConfirm } = useMessage();
|
|
|
+ const timer = ref<NodeJS.Timeout | number | undefined | null>(null);
|
|
|
+ const tableType = ref<number>(0); //0看看 、1看见、2深时
|
|
|
+ const tabList = ref<string[]>(['四维看看', '四维看见', '四维双目深时', '四维双目Lite']);
|
|
|
+ function cancelDownload() {
|
|
|
+ downloadOption.value = {};
|
|
|
+ }
|
|
|
+ const [registerDownModal, { openModal: openDownModal }] = useModal();
|
|
|
+ const [registerMoveModal, { openModal: openMoveModal }] = useModal();
|
|
|
+ const [registerTableViewKankan, { reload:ViewReload }] = useTable({
|
|
|
+ api: overallList,
|
|
|
+ title: `全景看看作品列表`,
|
|
|
+ // titleHelpMessage: ['已启用expandRowByClick', '已启用stopButtonPropagation'],
|
|
|
+ columns: cameraScene,
|
|
|
+ searchInfo: { type: tableType },
|
|
|
+ useSearchForm: true,
|
|
|
+ formConfig: cameraSearchForm,
|
|
|
+ showTableSetting: true,
|
|
|
+ showIndexColumn:false,
|
|
|
+ rowKey: 'num',
|
|
|
+ fetchSetting: {
|
|
|
+ pageField: 'pageNum',
|
|
|
+ sizeField: 'pageSize',
|
|
|
+ listField: 'list',
|
|
|
+ totalField: 'total',
|
|
|
},
|
|
|
- },
|
|
|
- ];
|
|
|
- const searchForm: Partial<FormProps> = {
|
|
|
- labelWidth: 100,
|
|
|
- schemas: [
|
|
|
- {
|
|
|
- field: 'version',
|
|
|
- label: '版本号',
|
|
|
- component: 'Input',
|
|
|
- componentProps: {
|
|
|
- maxLength: 100,
|
|
|
- },
|
|
|
- colProps: {
|
|
|
- xl: 6,
|
|
|
- xxl: 6,
|
|
|
- },
|
|
|
+ canResize: false,
|
|
|
+ });
|
|
|
+ const [registerTable, { reload }] = useTable({
|
|
|
+ api: operateSceneList,
|
|
|
+ title: `场景列表`,
|
|
|
+ // titleHelpMessage: ['已启用expandRowByClick', '已启用stopButtonPropagation'],
|
|
|
+ columns: columns,
|
|
|
+ searchInfo: { type: tableType },
|
|
|
+ useSearchForm: true,
|
|
|
+ formConfig: searchForm,
|
|
|
+ showTableSetting: true,
|
|
|
+ showIndexColumn:false,
|
|
|
+ rowKey: 'num',
|
|
|
+ fetchSetting: {
|
|
|
+ pageField: 'pageNum',
|
|
|
+ sizeField: 'pageSize',
|
|
|
+ listField: 'list',
|
|
|
+ totalField: 'total',
|
|
|
},
|
|
|
- ],
|
|
|
- };
|
|
|
- const [registerTimeTable, { reload }] = useTable({
|
|
|
- api: CameraList,
|
|
|
- title: '相机列表',
|
|
|
- columns: refundTimeTableSchema,
|
|
|
- useSearchForm: true,
|
|
|
- formConfig: searchForm,
|
|
|
- showTableSetting: true,
|
|
|
- rowKey: 'id',
|
|
|
- fetchSetting: {
|
|
|
- pageField: 'pageNum',
|
|
|
- sizeField: 'pageSize',
|
|
|
- listField: 'list',
|
|
|
- totalField: 'total',
|
|
|
- },
|
|
|
- searchInfo: searchInfo,
|
|
|
- // beforeFetch:(T)=>{
|
|
|
- // T.type = searchInfo.type
|
|
|
- // console.log('beforeFetch',T,searchInfo)
|
|
|
- // return T
|
|
|
- // },
|
|
|
- actionColumn: {
|
|
|
- width: 180,
|
|
|
- title: '操作',
|
|
|
- dataIndex: 'action',
|
|
|
- slots: { customRender: 'action' },
|
|
|
- },
|
|
|
- canResize: false,
|
|
|
- });
|
|
|
- function tabChange(val: string) {
|
|
|
- console.log('tabChange', val);
|
|
|
- reload();
|
|
|
- }
|
|
|
- async function handleDelete(record: Recordable) {
|
|
|
- console.log('点击了删除', record);
|
|
|
- await DelAndUpload({ id: record.id });
|
|
|
- createMessage.success(t('common.optSuccess'));
|
|
|
- reload();
|
|
|
- }
|
|
|
- function handleOpen(record: Recordable) {
|
|
|
- console.log('点击了启用', record);
|
|
|
- }
|
|
|
- function handleEdit(record: Recordable) {
|
|
|
- console.log('record', record);
|
|
|
- openEditModal(true, {
|
|
|
- ...record,
|
|
|
+ canResize: false,
|
|
|
});
|
|
|
- }
|
|
|
- return {
|
|
|
- registerTimeTable,
|
|
|
- handleDelete,
|
|
|
- handleOpen,
|
|
|
- tabChange,
|
|
|
- reload,
|
|
|
- registerAddModal,
|
|
|
- registerEditModal,
|
|
|
- openAddModal,
|
|
|
- handleEdit,
|
|
|
- t,
|
|
|
- searchInfo,
|
|
|
- };
|
|
|
- },
|
|
|
-});
|
|
|
+ function changeTable(val: string) {
|
|
|
+ tableType.value = val;
|
|
|
+ reload();
|
|
|
+ }
|
|
|
+ async function handleCopy(record: Recordable) {
|
|
|
+ createConfirm({
|
|
|
+ title: '复制场景',
|
|
|
+ content: '复制场景,场景归属在原相机下。<br/>确定要复制场景吗?',
|
|
|
+ onOk: async () => {
|
|
|
+ sceneCopy({ num: record.num })
|
|
|
+ .then(() => {
|
|
|
+ message.success({
|
|
|
+ content: '删除成功',
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ message.success({
|
|
|
+ content: '删除失败',
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ async function handleDelete(record: Recordable) {
|
|
|
+ console.log('handleDelete', record);
|
|
|
+ // createConfirm({
|
|
|
+ // title: '删除',
|
|
|
+ // content: '确定要删除场景吗?',
|
|
|
+ // onOk: async () => {
|
|
|
+ sceneDelete({ num: record.num })
|
|
|
+ .then(() => {
|
|
|
+ message.success({
|
|
|
+ content: '删除成功',
|
|
|
+ });
|
|
|
+
|
|
|
+ reload();
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ message.success({
|
|
|
+ content: '删除失败',
|
|
|
+ });
|
|
|
+ });
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ }
|
|
|
+ async function handleMove(record: Recordable) {
|
|
|
+ openMoveModal(true, {
|
|
|
+ ...record,
|
|
|
+ });
|
|
|
+ // sceneMove({ snCode: record.snCode, num: record.num })
|
|
|
+ // .then(() => {
|
|
|
+ // message.success({
|
|
|
+ // content: '迁移成功',
|
|
|
+ // });
|
|
|
+ // })
|
|
|
+ // .catch(() => {
|
|
|
+ // message.success({
|
|
|
+ // content: '迁移失败',
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ }
|
|
|
+ // const timer = ref<NodeJS.Timeout | null = null>(null); //0看看 、1看见、2深时
|
|
|
+ const downloadOption = ref<Object>({});
|
|
|
+ const canDownload = ref<boolean>(true);
|
|
|
+ function handleDownload(record: Recordable) {
|
|
|
+ console.log('handleDownload', record);
|
|
|
+
|
|
|
+ checkDownLoad({ num: record.num }).then((res) => {
|
|
|
+ console.log(res);
|
|
|
+ if (res.downloadStatus == 0) {
|
|
|
+ // 未下载过,需要打包
|
|
|
+ sceneDownload({ num: record.num }).then((downres) => {
|
|
|
+ console.log(downres);
|
|
|
+ openDownModal(true, {
|
|
|
+ ...record,
|
|
|
+ });
|
|
|
+ if (downres.downloadStatus == 1) {
|
|
|
+ if (timer.value) {
|
|
|
+ afterClose();
|
|
|
+ }
|
|
|
+ timer.value = setInterval(() => {
|
|
|
+ downloadProcess({ num: record.num }).then((processres) => {
|
|
|
+ if (processres.percent >= 100) {
|
|
|
+ canDownload.value = false;
|
|
|
+ afterClose();
|
|
|
+ }
|
|
|
+ downloadOption.value = processres;
|
|
|
+ console.log(processres);
|
|
|
+ });
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ function afterClose() {
|
|
|
+ clearInterval(timer.value);
|
|
|
+ timer.value = null;
|
|
|
+ }
|
|
|
+ function handleReset(record: Recordable) {
|
|
|
+ console.log('handleReset', record);
|
|
|
+ rebuildScene({ num: record.num })
|
|
|
+ .then(() => {
|
|
|
+ message.success({
|
|
|
+ content: '操作成功',
|
|
|
+ });
|
|
|
+ reload();
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ }
|
|
|
+
|
|
|
+ return {
|
|
|
+ registerTableViewKankan,
|
|
|
+ registerTable,
|
|
|
+ handleDelete,
|
|
|
+ handleCopy,
|
|
|
+ handleMove,
|
|
|
+ handleDownload,
|
|
|
+ handleReset,
|
|
|
+ tableType,
|
|
|
+ changeTable,
|
|
|
+ reload,
|
|
|
+ t,
|
|
|
+ openDownModal,
|
|
|
+ registerDownModal,
|
|
|
+ registerMoveModal,
|
|
|
+ afterClose,
|
|
|
+ timer,
|
|
|
+ canDownload,
|
|
|
+ downloadOption,
|
|
|
+ cancelDownload,
|
|
|
+ ViewReload,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ });
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
-.desc-wrap-BasicTable {
|
|
|
- background-color: #f0f2f5;
|
|
|
- .vben-basic-table-form-container {
|
|
|
- padding: 0;
|
|
|
+ // .tableHeader {
|
|
|
+ // height: 50px;
|
|
|
+ // display: flex;
|
|
|
+ // align-items: center;
|
|
|
+
|
|
|
+ // .item {
|
|
|
+ // font-size: 14px;
|
|
|
+ // color: #666;
|
|
|
+ // margin-right: 10px;
|
|
|
+ // cursor: pointer;
|
|
|
+ // &.active {
|
|
|
+ // font-weight: bold;
|
|
|
+ // color: #222;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ .desc-wrap-BasicTable {
|
|
|
+ background-color: #f0f2f5;
|
|
|
+ .vben-basic-table-form-container {
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
}
|
|
|
-}
|
|
|
</style>
|