Browse Source

feat(bugs): 用户管理

tangning 3 years ago
parent
commit
e7231ca997

+ 5 - 3
src/api/operate/index.ts

@@ -5,6 +5,8 @@ import {
   sceneMoveParams,
   sceneControlParams,
   RentListGetResultModel,
+  checkDownLoadResult,
+  sceneDownloadResult,
   addCameraParams,
   updateParams,
 } from './model';
@@ -100,7 +102,7 @@ export const sceneDelete = (params: sceneControlParams) =>
     },
   });
 export const checkDownLoad = (params: sceneControlParams) =>
-  defHttp.get<Result>({
+  defHttp.get<checkDownLoadResult>({
     url: Api.checkDownLoad,
     params: params,
     // data: params,
@@ -110,7 +112,7 @@ export const checkDownLoad = (params: sceneControlParams) =>
     },
   });
 export const sceneDownload = (params: sceneControlParams) =>
-  defHttp.get<Result>({
+  defHttp.get<sceneDownloadResult>({
     url: Api.sceneDownload,
     params: params,
     // data: params,
@@ -120,7 +122,7 @@ export const sceneDownload = (params: sceneControlParams) =>
     },
   });
 export const downloadProcess = (params: sceneControlParams) =>
-  defHttp.get<Result>({
+  defHttp.get<sceneDownloadResult>({
     url: Api.downloadProcess,
     params: params,
     // data: params,

+ 15 - 0
src/api/operate/model.ts

@@ -43,6 +43,21 @@ export interface updateParams {
   canShow: number;
   liveRoomCapacities: number;
 }
+export interface checkDownLoadResult {
+  id: number;
+  canShow: number;
+  downloadStatus: number;
+  percent: number;
+  liveRoomCapacities: number;
+}
+
+export interface sceneDownloadResult {
+  id: number;
+  canShow: number;
+  downloadStatus: number;
+  percent: number;
+  liveRoomCapacities: number;
+}
 export interface DeviceListItem {
   id: number;
   activatedTime: string;

+ 199 - 0
src/views/account/details/OrderList.vue

@@ -0,0 +1,199 @@
+<template>
+  <a-tabs v-model:activeKey="searchInfo.activeKey">
+    <a-tab-pane key="1" tab="权益订单">
+      <BasicTable @register="registerTimeTable">
+        <template #action="{ record }">
+          <TableAction
+            :actions="[
+              {
+                label: '编辑',
+                icon: 'ep:edit',
+                onClick: handleEdit.bind(null, record),
+              },
+              {
+                label: '删除',
+                icon: 'ic:outline-delete-outline',
+                popConfirm: {
+                  title: '是否确认删除',
+                  confirm: handleDelete.bind(null, record),
+                },
+              },
+            ]"
+          />
+        </template>
+      </BasicTable>
+    </a-tab-pane>
+    <a-tab-pane key="2" tab="下载订单">
+      <BasicTable @register="registerDown"></BasicTable>
+    </a-tab-pane>
+    <a-tab-pane key="3" tab="消费订单">
+      <BasicTable @register="registerCamera"></BasicTable>
+    </a-tab-pane>
+  </a-tabs>
+</template>
+<script lang="ts">
+import { defineComponent, reactive } from 'vue';
+import { BasicTable, useTable, FormProps, TableAction } from '/@/components/Table';
+import { PageWrapper } from '/@/components/Page';
+import { Divider, Card, Empty, Descriptions, Steps, Tabs } from 'ant-design-vue';
+import { DelAndUpload } from '/@/api/product';
+import { IncrementList } from '/@/api/order'
+import { DownList,CameraList } from '/@/api/order'
+import { useModal } from '/@/components/Modal';
+import { useI18n } from '/@/hooks/web/useI18n';
+import { useMessage } from '/@/hooks/web/useMessage';
+import { cameraColumns, dowmColumns, equityColumns,equitySearchForm } from './data'
+export default defineComponent({
+  components: {
+    BasicTable,
+    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();
+
+    const searchForm: Partial<FormProps> = {
+      labelWidth: 100,
+      schemas: [
+        {
+          field: 'version',
+          label: '版本号',
+          component: 'Input',
+          componentProps: {
+            maxLength: 100,
+          },
+          colProps: {
+            xl: 6,
+            xxl: 6,
+          },
+        },
+      ],
+    };
+    
+    const [registerDown, { reload:Downreload }] = useTable({
+      api: DownList,
+      title: '下载列表',
+      columns: dowmColumns,
+      useSearchForm: true,
+      formConfig: searchForm,
+      showTableSetting: true,
+      showIndexColumn: false,
+      rowKey: 'id',
+      fetchSetting: {
+        pageField: 'pageNum',
+        sizeField: 'pageSize',
+        listField: 'list',
+        totalField: 'total',
+      },
+      // actionColumn: {
+      //   width: 180,
+      //   title: '操作',
+      //   dataIndex: 'action',
+      //   slots: { customRender: 'action' },
+      // },
+      canResize: false,
+    });
+    
+    const [registerCamera, { reload:Camerareload }] = useTable({
+      api: CameraList,
+      title: '相机列表',
+      columns: cameraColumns,
+      useSearchForm: true,
+      formConfig: searchForm,
+      showIndexColumn: false,
+      showTableSetting: true,
+      rowKey: 'id',
+      fetchSetting: {
+        pageField: 'pageNum',
+        sizeField: 'pageSize',
+        listField: 'list',
+        totalField: 'total',
+      },
+      canResize: false,
+    });
+    const [registerTimeTable, { reload }] = useTable({
+      api: IncrementList,
+      title: '权益列表',
+      columns: equityColumns,
+      useSearchForm: true,
+      formConfig: equitySearchForm,
+      showIndexColumn: false,
+      showTableSetting: true,
+      rowKey: 'id',
+      fetchSetting: {
+        pageField: 'pageNum',
+        sizeField: 'pageSize',
+        listField: 'list',
+        totalField: 'total',
+      },
+      // searchInfo: searchInfo,
+      // 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,
+      });
+    }
+    return {
+      registerTimeTable,
+      registerCamera,
+      registerDown,
+      handleDelete,
+      handleOpen,
+      tabChange,
+      reload,
+      Downreload,
+      Camerareload,
+      registerAddModal,
+      registerEditModal,
+      openAddModal,
+      handleEdit,
+      t,
+      searchInfo,
+    };
+  },
+});
+</script>
+<style lang="less" scoped>
+.desc-wrap-BasicTable {
+  background-color: #f0f2f5;
+  .vben-basic-table-form-container {
+    padding: 0;
+  }
+}
+</style>

+ 0 - 47
src/views/account/details/SecureSetting.vue

@@ -1,47 +0,0 @@
-<template>
-  <CollapseContainer title="安全设置" :canExpan="false">
-    <List>
-      <template v-for="item in list" :key="item.key">
-        <ListItem>
-          <ListItemMeta>
-            <template #title>
-              {{ item.title }}
-              <div class="extra" v-if="item.extra">
-                {{ item.extra }}
-              </div>
-            </template>
-            <template #description>
-              <div>{{ item.description }}</div>
-            </template>
-          </ListItemMeta>
-        </ListItem>
-      </template>
-    </List>
-  </CollapseContainer>
-</template>
-<script lang="ts">
-  import { List } from 'ant-design-vue';
-  import { defineComponent } from 'vue';
-  import { CollapseContainer } from '/@/components/Container/index';
-
-  import { secureSettingList } from './data';
-
-  export default defineComponent({
-    components: { CollapseContainer, List, ListItem: List.Item, ListItemMeta: List.Item.Meta },
-    setup() {
-      return {
-        list: secureSettingList,
-      };
-    },
-  });
-</script>
-<style lang="less" scoped>
-  .extra {
-    float: right;
-    margin-top: 10px;
-    margin-right: 30px;
-    font-weight: normal;
-    color: #1890ff;
-    cursor: pointer;
-  }
-</style>

+ 172 - 0
src/views/account/details/data.ts

@@ -1,4 +1,7 @@
 import { FormSchema } from '/@/components/Form/index';
+import { BasicColumn, FormProps } from '/@/components/Table';
+import { Time } from '/@/components/Time';
+import { h } from 'vue';
 
 export interface ListItem {
   key: string;
@@ -142,3 +145,172 @@ export const msgNotifyList: ListItem[] = [
     description: '待办任务将以站内信的形式通知',
   },
 ];
+//权益订单
+export const equityColumns: BasicColumn[] = [
+  {
+    title: '时间',
+    dataIndex: 'createTime',
+    width: 150,
+    customRender: ({ record }) => {
+      return (
+        record.createTime &&
+        h(Time, {
+          value: record.createTime,
+          mode: 'datetime',
+        })
+      );
+    },
+  },
+  {
+    title: '订单号',
+    dataIndex: 'orderSn',
+    ellipsis: false,
+    width: 180,
+  },
+  {
+    title: '用户名',
+    dataIndex: 'userName',
+    width: 80,
+  },
+  {
+    title: '订单金额',
+    dataIndex: 'amount',
+    width: 80,
+  },
+  {
+    title: '支付方式',
+    dataIndex: 'payType',
+    // slots: { customRender: 'orderType' },
+    width: 80,
+  },
+  {
+    title: '订单状态',
+    dataIndex: 'payStatus',
+    // slots: { customRender: 'orderStatus' },
+    width: 80,
+  },
+];
+export const equitySearchForm: Partial<FormProps> = {
+  labelWidth: 100,
+  schemas: [
+    {
+      field: 'sceneName',
+      label: '下单时间',
+      component: 'RangePicker',
+      componentProps: {
+        maxLength: 100,
+      },
+      colProps: {
+        xl: 7,
+        xxl: 7,
+      },
+    },{
+      field: 'sceneName',
+      label: '订单号',
+      component: 'Input',
+      componentProps: {
+        maxLength: 100,
+      },
+      colProps: {
+        xl: 6,
+        xxl: 6,
+      },
+    }
+  ],
+};
+//下载订单
+export const dowmColumns: BasicColumn[] = [
+  {
+    title: '时间',
+    dataIndex: 'createTime',
+    width: 150,
+    customRender: ({ record }) => {
+      return (
+        record.createTime &&
+        h(Time, {
+          value: record.createTime,
+          mode: 'datetime',
+        })
+      );
+    },
+  },
+  {
+    title: '订单号',
+    dataIndex: 'orderSn',
+    ellipsis: false,
+    width: 180,
+  },
+  {
+    title: '用户名',
+    dataIndex: 'userName',
+    width: 80,
+  },
+  {
+    title: '订单金额',
+    dataIndex: 'amount',
+    width: 80,
+  },
+  {
+    title: '支付方式',
+    dataIndex: 'payType',
+    // slots: { customRender: 'orderType' },
+    width: 80,
+  },
+  {
+    title: '订单状态',
+    dataIndex: 'payStatus',
+    // slots: { customRender: 'orderStatus' },
+    width: 80,
+  },
+];
+//相机订单
+export const cameraColumns: BasicColumn[] = [
+  {
+    title: '下单时间',
+    dataIndex: 'orderTime',
+    width: 120,
+    customRender: ({ record }) => {
+      return (
+        record.orderTime &&
+        h(Time, {
+          value: record.orderTime,
+          mode: 'datetime',
+        })
+      );
+    },
+  },
+  {
+    title: '订单号',
+    dataIndex: 'orderSn',
+    ellipsis: false,
+    width: 180,
+  },
+  {
+    title: '用户账号',
+    dataIndex: 'userName',
+    ellipsis: false,
+    width: 120,
+  },
+  {
+    title: '订单金额(元)',
+    dataIndex: 'goodsAmount',
+    ellipsis: false,
+    width: 120,
+  },
+  {
+    title: '支付方式',
+    dataIndex: 'paymentTypeName',
+    width: 80,
+  },
+  {
+    title: '交易号',
+    dataIndex: 'tradeNum',
+    width: 220,
+  },
+  {
+    title: '订单状态',
+    dataIndex: 'paymentStatus',
+    // slots: { customRender: 'orderStatus' },
+    width: 80,
+  },
+];

+ 1 - 1
src/views/account/details/index.vue

@@ -20,7 +20,7 @@
   import { settingList } from './data';
 
   import Overview from '../overview/index.vue';
-  import OrderList from '../overview/index.vue';
+  import OrderList from './OrderList.vue';
   import Product from '../product/index.vue';
 
   export default defineComponent({

+ 276 - 0
src/views/account/product/data.tsx

@@ -0,0 +1,276 @@
+import { h, computed } from 'vue';
+import { BasicColumn, FormProps, } from '/@/components/Table';
+import { Time } from '/@/components/Time';
+import { useMessage } from '/@/hooks/web/useMessage';
+import { useI18n } from '/@/hooks/web/useI18n';
+import { useLocaleStore } from '/@/store/modules/locale';
+const localeStore = useLocaleStore();
+const { createMessage } = useMessage();
+const { t } = useI18n();
+const isJA = computed(() => localeStore.getLocale === 'en');
+
+export const columns:  BasicColumn[] = [
+  {
+    title: '场景标题',
+    dataIndex: 'sceneName',
+    width: 150,
+  },
+  {
+    title: '场景码',
+    dataIndex: 'num',
+    ellipsis: false,
+    width: 80,
+  },
+  {
+    title: '拍摄时间',
+    dataIndex: 'createTime',
+    width: 180,
+    customRender: ({ record }) => {
+      return (
+        record.createTime &&
+        h(Time, {
+          value: record.createTime,
+          mode: 'datetime',
+        })
+      );
+    },
+  },
+  {
+    title: '计算完成时间',
+    dataIndex: 'amount',
+    width: 180,
+    customRender: ({ record }) => {
+      return (
+        record.createTime &&
+        h(Time, {
+          value: record.createTime,
+          mode: 'datetime',
+        })
+      );
+    },
+  },
+  {
+    title: 'sn码',
+    dataIndex: 'snCode',
+    width: 180,
+  },
+  {
+    title: '场景大小',
+    dataIndex: 'sceneSize',
+    width: 80,
+    customRender: ({ record }) => {
+      return h(
+        'span',
+        { class: 'sceneSize' },
+        Math.ceil(record.sceneSize / 1024 / 1024) + 'M',
+      );
+    },
+  },
+  {
+    title: '是否复制',
+    dataIndex: 'isCopy',
+    width: 80,
+    customRender: ({ record }) => {
+      return record.isCopy ? '是' : '否';
+    },
+  },
+  {
+    title: '复制时间',
+    dataIndex: 'copyTime',
+    width: 180,
+    customRender: ({ record }) => {
+      return record.copyTime
+        ? h(Time, {
+            value: record.copyTime,
+            mode: 'datetime',
+          })
+        : '-';
+    },
+  },
+  {
+    title: '绑定账号',
+    dataIndex: 'userName',
+    width: 100,
+  },
+  {
+    title: '浏览量',
+    dataIndex: 'viewCount',
+    width: 80,
+  },
+  {
+    title: '状态',
+    dataIndex: 'statusString',
+    width: 80,
+    customRender: ({ record }) => {
+      let str;
+      switch (record.status - 0) {
+        case 0:
+          str = '计算中';
+          break;
+        case 1:
+          str = '计算成功';
+          break;
+        case -2:
+          str = '计算成功';
+          break;
+        case -1:
+          str = '计算失败';
+          break;
+      }
+      return record.payStatus == 1 ? '封存' : str;
+    },
+  },
+  {
+    title: '操作',
+    dataIndex: 'action',
+    slots: { customRender: 'action' },
+    ifShow: true,
+    fixed: 'right',
+    flag: 'ACTION',
+    width: 250,
+  },
+];
+
+export const searchForm: Partial<FormProps> = {
+  labelWidth: 100,
+  schemas: [
+    {
+      field: 'sceneName',
+      label: '作品标题',
+      component: 'Input',
+      componentProps: {
+        maxLength: 100,
+      },
+      colProps: {
+        xl: 7,
+        xxl: 7,
+      },
+    },
+
+    {
+      field: 'userName',
+      label: '用户账号',
+      component: 'Input',
+      componentProps: {
+        maxLength: 100,
+      },
+      colProps: {
+        xl: 6,
+        xxl: 6,
+      },
+    },
+  ],
+};
+
+export const cameraScene: BasicColumn[] = [
+  {
+    title: '作品标题',
+    dataIndex: 'name',
+    width: 150,
+    customRender: ({ record }) => {
+      return record.name ? h('span', record.name) : '-';
+    },
+  },
+  {
+    title: '作品码',
+    dataIndex: 'sceneCodes',
+    ellipsis: false,
+    width: 180,
+  },
+  {
+    title: '用户账号',
+    dataIndex: 'userId',
+    width: 100,
+  },
+
+  {
+    title: '创建时间',
+    dataIndex: 'createTime',
+    width: 180,
+    customRender: ({ record }) => {
+      return record.createTime
+        ? h(Time, {
+            value: record.createTime,
+            mode: 'datetime',
+          })
+        : '-';
+    },
+  },
+  {
+    title: '最新编辑时间',
+    dataIndex: 'updateTime',
+    width: 180,
+    customRender: ({ record }) => {
+      return record.updateTime
+        ? h(Time, {
+            value: record.updateTime,
+            mode: 'datetime',
+          })
+        : '-';
+    },
+  },
+  {
+    title: '是否加密',
+    dataIndex: 'status',
+    width: 80,
+    customRender: ({ record }) => {
+      return record.isCopy ? '是' : '否';
+    },
+  },
+  {
+    title: '浏览量',
+    dataIndex: 'visit',
+    width: 80,
+  },
+  {
+    title: '操作',
+    dataIndex: 'action',
+    slots: { customRender: 'action' },
+    ifShow: true,
+    fixed: 'right',
+    flag: 'ACTION',
+    width: 50,
+  },
+];
+
+export const cameraSearchForm: Partial<FormProps> = {
+  labelWidth: 100,
+  schemas: [
+    {
+      field: 'sceneName',
+      label: '场景标题',
+      component: 'Input',
+      componentProps: {
+        maxLength: 100,
+      },
+      colProps: {
+        xl: 7,
+        xxl: 7,
+      },
+    },
+    {
+      field: 'snCode',
+      label: 'sn码',
+      component: 'Input',
+      componentProps: {
+        maxLength: 100,
+      },
+      colProps: {
+        xl: 7,
+        xxl: 7,
+      },
+    },
+    {
+      field: 'userName',
+      label: '绑定账号',
+      component: 'Input',
+      componentProps: {
+        maxLength: 100,
+      },
+      colProps: {
+        xl: 6,
+        xxl: 6,
+      },
+    },
+  ],
+};

+ 314 - 191
src/views/account/product/index.vue

@@ -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>