jinx 3 سال پیش
والد
کامیت
5352a43387

+ 46 - 0
src/api/operate/index.ts

@@ -2,6 +2,8 @@ import { defHttp } from '/@/utils/http/axios';
 import {
   PageParams,
   operateList,
+  sceneMoveParams,
+  sceneControlParams,
   RentListGetResultModel,
   addCameraParams,
   updateParams,
@@ -11,6 +13,10 @@ import { Result } from '/#/axios';
 enum Api {
   pageList = '/newV4/service/manage/news/pageNews',
   operateSceneList = '/newV4/service/manage/scene/list',
+  sceneMove = '/newV4/service/manage/scene/move',
+  sceneDelete = '/newV4/service/manage/scene/delete',
+  sceneDownload = '/newV4/service/manage/scene/downScene',
+  sceneCopy = '/newV4/service/manage/scene/copy',
 }
 
 /**
@@ -38,6 +44,46 @@ export const operateSceneList = (params: operateList) =>
       ignoreCancelToken: true,
     },
   });
+export const sceneMove = (params: sceneMoveParams) =>
+  defHttp.post<Result>({
+    url: Api.sceneMove,
+    params: params,
+    // data: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+export const sceneDelete = (params: sceneControlParams) =>
+  defHttp.post<Result>({
+    url: Api.sceneDelete,
+    params: params,
+    // data: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+export const sceneDownload = (params: sceneControlParams) =>
+  defHttp.post<Result>({
+    url: Api.sceneDownload,
+    params: params,
+    // data: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+export const sceneCopy = (params: sceneControlParams) =>
+  defHttp.post<Result>({
+    url: Api.sceneCopy,
+    params: params,
+    // data: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
 // export const unDeviceApi = (params: PageParams) =>
 //   defHttp.post<RentListGetResultModel>({
 //     url: Api.unbindDevice,

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

@@ -11,6 +11,13 @@ export interface operateList {
   pageNum?: number;
   pageSize?: number;
 }
+export interface sceneMoveParams {
+  snCode: string;
+  num: string;
+}
+export interface sceneControlParams {
+  num: string;
+}
 export interface addCameraParams {
   address: string;
   balance: string;

+ 14 - 14
src/router/routes/modules/productOperation.ts

@@ -9,7 +9,7 @@ export const productOperation: AppRouteRecordRaw = {
   component: LAYOUT,
   meta: {
     title: t('routes.dashboard.productOperation'),
-    icon: 'la:file-invoice-dollar',
+    icon: 'carbon:carbon-for-ibm-product',
     orderNo: 102,
     // hideChildrenInMenu: true,
   },
@@ -20,7 +20,7 @@ export const productOperation: AppRouteRecordRaw = {
       component: () => import('/@/views/productOperation/cameraScene.vue'),
       meta: {
         title: t('routes.dashboard.cameraScene'),
-        icon: 'la:file-invoice-dollar',
+        // icon: 'la:file-invoice-dollar',
       },
       children: [
         {
@@ -29,25 +29,25 @@ export const productOperation: AppRouteRecordRaw = {
           component: () => import('/@/views/productOperation/sceneManager/laserScene.vue'),
           meta: {
             title: t('routes.dashboard.laserScene'),
-            icon: 'la:file-invoice-dollar',
-          },
-        },
-        {
-          path: 'liteScene',
-          name: 'LiteScene',
-          component: () => import('/@/views/productOperation/sceneManager/liteScene.vue'),
-          meta: {
-            title: t('routes.dashboard.liteScene'),
-            icon: 'la:file-invoice-dollar',
+            // icon: 'la:file-invoice-dollar',
           },
         },
+        // {
+        //   path: 'liteScene',
+        //   name: 'LiteScene',
+        //   component: () => import('/@/views/productOperation/sceneManager/liteScene.vue'),
+        //   meta: {
+        //     title: t('routes.dashboard.liteScene'),
+        //     // icon: 'la:file-invoice-dollar',
+        //   },
+        // },
         {
           path: 'kankanScene',
           name: 'KankanScene',
           component: () => import('/@/views/productOperation/sceneManager/kankanScene.vue'),
           meta: {
             title: t('routes.dashboard.kankanScene'),
-            icon: 'la:file-invoice-dollar',
+            // icon: 'la:file-invoice-dollar',
           },
         },
         {
@@ -56,7 +56,7 @@ export const productOperation: AppRouteRecordRaw = {
           component: () => import('/@/views/productOperation/sceneManager/minionScene.vue'),
           meta: {
             title: t('routes.dashboard.MinionScene'),
-            icon: 'la:file-invoice-dollar',
+            // icon: 'la:file-invoice-dollar',
           },
         },
       ],

+ 262 - 0
src/views/productOperation/sceneManager/kankanScene.vue

@@ -0,0 +1,262 @@
+<template>
+  <BasicTable @register="registerTable">
+    <template #toolbar>
+      <!-- <a-button type="primary" @click="exportExcel"> 导出1</a-button> -->
+    </template>
+    <template #action="{ record }">
+      <TableAction
+        stopButtonPropagation
+        :actions="[
+          {
+            label: '迁移',
+            icon: 'bx:move-horizontal',
+            onClick: handleDelete.bind(null, record),
+          },
+          {
+            label: '下载',
+            icon: 'carbon:download',
+            color: 'success',
+            onClick: handleDelete.bind(null, record),
+          },
+          {
+            label: '重算',
+            icon: 'bx:reset',
+            color: 'warning',
+            onClick: handleDelete.bind(null, record),
+          },
+          {
+            label: '删除',
+            icon: 'ic:outline-delete-outline',
+            color: 'error',
+            onClick: handleDelete.bind(null, record),
+          },
+        ]"
+      />
+    </template>
+  </BasicTable>
+</template>
+<script lang="ts">
+  import { defineComponent, h } from 'vue';
+  import {
+    BasicTable,
+    useTable,
+    TableAction,
+    BasicColumn,
+    TableImg,
+    FormProps,
+  } from '/@/components/Table';
+  import { PageWrapper } from '/@/components/Page';
+  import { Time } from '/@/components/Time';
+  import { Descriptions } from 'ant-design-vue';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { Switch } from 'ant-design-vue';
+  import { operateSceneList } from '/@/api/operate';
+
+  export default defineComponent({
+    components: {
+      BasicTable,
+      TableAction,
+      PageWrapper,
+      TableImg,
+      [Descriptions.name]: Descriptions,
+      [Descriptions.Item.name]: Descriptions.Item,
+    },
+    setup() {
+      const { t } = useI18n();
+      const { createMessage, createConfirm } = useMessage();
+      const columns: BasicColumn[] = [
+        {
+          title: '场景标题',
+          dataIndex: 'sceneName',
+          width: 150,
+          // customRender: ({ record }) => {
+          //   return (
+          //     record.createTime &&
+          //     h(Time, {
+          //       value: record.createTime,
+          //       mode: 'datetime',
+          //     })
+          //   );
+          // },
+        },
+        {
+          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: 80,
+        },
+        {
+          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,
+        },
+        {
+          title: '操作',
+          dataIndex: 'action',
+          slots: { customRender: 'action' },
+          ifShow: true,
+          fixed: 'right',
+          width: 280,
+        },
+      ];
+      const searchForm: 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,
+            },
+          },
+        ],
+      };
+      const [registerTable] = useTable({
+        api: operateSceneList,
+        title: '四维看看场景列表',
+        // titleHelpMessage: ['已启用expandRowByClick', '已启用stopButtonPropagation'],
+        columns: columns,
+        searchInfo: { type: 0 },
+        useSearchForm: true,
+        formConfig: searchForm,
+        showTableSetting: true,
+        rowKey: 'num',
+        fetchSetting: {
+          pageField: 'pageNum',
+          sizeField: 'pageSize',
+          listField: 'list',
+          totalField: 'total',
+        },
+        canResize: false,
+      });
+      function handleDelete(record: Recordable) {
+        console.log('点击了删除', record);
+      }
+      function handleOpen(record: Recordable) {
+        console.log('点击了启用', record);
+      }
+      function exportExcel() {
+        createConfirm({
+          iconType: 'warning',
+          title: () => h('span', '温馨提示'),
+          content: () => h('span', '确定当前标签下的订单记录?'),
+          onOk: async () => {
+            // await DownExport();
+          },
+        });
+      }
+      return {
+        registerTable,
+        handleDelete,
+        handleOpen,
+        exportExcel,
+      };
+    },
+  });
+</script>

+ 100 - 47
src/views/productOperation/sceneManager/laserScene.vue

@@ -3,31 +3,50 @@
     <template #toolbar>
       <!-- <a-button type="primary" @click="exportExcel"> 导出1</a-button> -->
     </template>
-    <template #action="{ column, record }">
-        <TableAction
-          stopButtonPropagation
-          :actions="[
-            {
-              label: '删除',
-              icon: 'ic:outline-delete-outline',
-              onClick: handleDelete.bind(null, record),
+    <template #action="{ record }">
+      <TableAction
+        stopButtonPropagation
+        :actions="[
+          {
+            label: '迁移',
+            icon: 'bx:move-horizontal',
+            popConfirm: {
+              title: '是否迁移?',
+              confirm: handleMove.bind(null, record),
+            },
+          },
+          {
+            label: '下载',
+            icon: 'carbon:download',
+            color: 'success',
+            onClick: handleDownload.bind(null, record),
+          },
+          {
+            label: '重算',
+            icon: 'bx:reset',
+            color: 'warning',
+            popConfirm: {
+              title: '是否重算?',
+              confirm: handleReset.bind(null, record),
             },
-          ]"
-          :dropDownActions="[
-            {
-              label: '启用',
-              popConfirm: {
-                title: '是否启用?',
-                confirm: handleOpen.bind(null, record),
-              },
+          },
+          {
+            label: '删除',
+            icon: 'ic:outline-delete-outline',
+            color: 'error',
+            popConfirm: {
+              title: '是否删除?',
+              confirm: handleDelete.bind(null, record),
+              placement: 'topLeft',
             },
-          ]"
-        />
+          },
+        ]"
+      />
     </template>
   </BasicTable>
 </template>
 <script lang="ts">
-  import { defineComponent, h } from 'vue';
+  import { defineComponent, h, reactive, toRefs } from 'vue';
   import {
     BasicTable,
     useTable,
@@ -42,8 +61,15 @@
   import { useI18n } from '/@/hooks/web/useI18n';
   import { useMessage } from '/@/hooks/web/useMessage';
   import { Switch } from 'ant-design-vue';
-  import { operateSceneList } from '/@/api/operate';
-
+  import {
+    operateSceneList,
+    sceneMove,
+    sceneDelete,
+    sceneReset,
+    sceneDownload,
+    sceneCopy,
+  } from '/@/api/operate';
+  import { message } from 'ant-design-vue';
   export default defineComponent({
     components: {
       BasicTable,
@@ -56,6 +82,7 @@
     setup() {
       const { t } = useI18n();
       const { createMessage, createConfirm } = useMessage();
+
       const columns: BasicColumn[] = [
         {
           title: '场景标题',
@@ -108,7 +135,7 @@
         {
           title: 'sn码',
           dataIndex: 'snCode',
-          width: 80,
+          width: 180,
         },
         {
           title: '场景大小',
@@ -162,9 +189,9 @@
           title: '操作',
           dataIndex: 'action',
           slots: { customRender: 'action' },
-          ifShow:true,
+          ifShow: true,
           fixed: 'right',
-          width: 80,
+          width: 280,
         },
       ];
       const searchForm: Partial<FormProps> = {
@@ -195,7 +222,7 @@
             },
           },
           {
-            field: 'bindAccount',
+            field: 'userName',
             label: '绑定账号',
             component: 'Input',
             componentProps: {
@@ -208,17 +235,12 @@
           },
         ],
       };
-      const [registerTable] = useTable({
+      const [registerTable, { reload }] = useTable({
         api: operateSceneList,
         title: '四维深时场景列表',
         // titleHelpMessage: ['已启用expandRowByClick', '已启用stopButtonPropagation'],
         columns: columns,
-        // actionColumn: {
-        //   width: 160,
-        //   title: 'Action',
-        //   dataIndex: 'action',
-        //   // slots: { customRender: 'action' },
-        // },
+        searchInfo: { type: 1 },
         useSearchForm: true,
         formConfig: searchForm,
         showTableSetting: true,
@@ -231,27 +253,58 @@
         },
         canResize: false,
       });
-      function handleDelete(record: Recordable) {
-        console.log('点击了删除', record);
+      async function handleDelete(record: Recordable) {
+        console.log('handleDelete', record);
+
+        sceneDelete({ num: record.num })
+          .then(() => {
+            message.success({
+              content: '删除成功',
+            });
+
+            reload();
+          })
+          .catch(() => {
+            message.success({
+              content: '删除失败',
+            });
+          });
       }
-      function handleOpen(record: Recordable) {
-        console.log('点击了启用', record);
+      async function handleMove(record: Recordable) {
+        sceneMove({ snCode: record.snCode, num: record.num })
+          .then(() => {
+            message.success({
+              content: '迁移成功',
+            });
+          })
+          .catch(() => {
+            message.success({
+              content: '迁移失败',
+            });
+          });
       }
-      function exportExcel() {
-        createConfirm({
-          iconType: 'warning',
-          title: () => h('span', '温馨提示'),
-          content: () => h('span', '确定当前标签下的订单记录?'),
-          onOk: async () => {
-            // await DownExport();
-          },
-        });
+      function handleDownload(record: Recordable) {
+        console.log('handleDownload', record);
+      }
+      function handleReset(record: Recordable) {
+        console.log('handleReset', record);
       }
+      // function exportExcel() {
+      //   createConfirm({
+      //     iconType: 'warning',
+      //     title: () => h('span', '温馨提示'),
+      //     content: () => h('span', '确定当前标签下的订单记录?'),
+      //     onOk: async () => {
+      //       // await DownExport();
+      //     },
+      //   });
+      // }
       return {
         registerTable,
         handleDelete,
-        handleOpen,
-        exportExcel,
+        handleMove,
+        handleDownload,
+        handleReset,
       };
     },
   });

+ 262 - 0
src/views/productOperation/sceneManager/minionScene.vue

@@ -0,0 +1,262 @@
+<template>
+  <BasicTable @register="registerTable">
+    <template #toolbar>
+      <!-- <a-button type="primary" @click="exportExcel"> 导出1</a-button> -->
+    </template>
+    <template #action="{ record }">
+      <TableAction
+        stopButtonPropagation
+        :actions="[
+          {
+            label: '迁移',
+            icon: 'bx:move-horizontal',
+            onClick: handleDelete.bind(null, record),
+          },
+          {
+            label: '下载',
+            icon: 'carbon:download',
+            color: 'success',
+            onClick: handleDelete.bind(null, record),
+          },
+          {
+            label: '重算',
+            icon: 'bx:reset',
+            color: 'warning',
+            onClick: handleDelete.bind(null, record),
+          },
+          {
+            label: '删除',
+            icon: 'ic:outline-delete-outline',
+            color: 'error',
+            onClick: handleDelete.bind(null, record),
+          },
+        ]"
+      />
+    </template>
+  </BasicTable>
+</template>
+<script lang="ts">
+  import { defineComponent, h } from 'vue';
+  import {
+    BasicTable,
+    useTable,
+    TableAction,
+    BasicColumn,
+    TableImg,
+    FormProps,
+  } from '/@/components/Table';
+  import { PageWrapper } from '/@/components/Page';
+  import { Time } from '/@/components/Time';
+  import { Descriptions } from 'ant-design-vue';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { Switch } from 'ant-design-vue';
+  import { operateSceneList } from '/@/api/operate';
+
+  export default defineComponent({
+    components: {
+      BasicTable,
+      TableAction,
+      PageWrapper,
+      TableImg,
+      [Descriptions.name]: Descriptions,
+      [Descriptions.Item.name]: Descriptions.Item,
+    },
+    setup() {
+      const { t } = useI18n();
+      const { createMessage, createConfirm } = useMessage();
+      const columns: BasicColumn[] = [
+        {
+          title: '场景标题',
+          dataIndex: 'sceneName',
+          width: 150,
+          // customRender: ({ record }) => {
+          //   return (
+          //     record.createTime &&
+          //     h(Time, {
+          //       value: record.createTime,
+          //       mode: 'datetime',
+          //     })
+          //   );
+          // },
+        },
+        {
+          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: 80,
+        },
+        {
+          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,
+        },
+        {
+          title: '操作',
+          dataIndex: 'action',
+          slots: { customRender: 'action' },
+          ifShow: true,
+          fixed: 'right',
+          width: 280,
+        },
+      ];
+      const searchForm: 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,
+            },
+          },
+        ],
+      };
+      const [registerTable] = useTable({
+        api: operateSceneList,
+        title: '四维看见场景列表',
+        // titleHelpMessage: ['已启用expandRowByClick', '已启用stopButtonPropagation'],
+        columns: columns,
+        searchInfo: { type: 1 },
+        useSearchForm: true,
+        formConfig: searchForm,
+        showTableSetting: true,
+        rowKey: 'num',
+        fetchSetting: {
+          pageField: 'pageNum',
+          sizeField: 'pageSize',
+          listField: 'list',
+          totalField: 'total',
+        },
+        canResize: false,
+      });
+      function handleDelete(record: Recordable) {
+        console.log('点击了删除', record);
+      }
+      function handleOpen(record: Recordable) {
+        console.log('点击了启用', record);
+      }
+      function exportExcel() {
+        createConfirm({
+          iconType: 'warning',
+          title: () => h('span', '温馨提示'),
+          content: () => h('span', '确定当前标签下的订单记录?'),
+          onOk: async () => {
+            // await DownExport();
+          },
+        });
+      }
+      return {
+        registerTable,
+        handleDelete,
+        handleOpen,
+        exportExcel,
+      };
+    },
+  });
+</script>