tangning hai 1 ano
pai
achega
5245971b0a

+ 1 - 1
.env.development

@@ -6,7 +6,7 @@ VITE_PUBLIC_PATH = ./
 
 # Cross-domain proxy, you can configure multiple
 # Please note that no line breaks
-VITE_PROXY = [["/basic-api","http://localhost:3000"],["/upload","https://v4-uat.4dkankan.com/service/manage/common/upload/files"],["/service","http://192.168.0.25"]]
+VITE_PROXY = [["/service","http://192.168.0.25"]]
 # VITE_PROXY=[["/api","https://vvbin.cn/test"]]
 
 # Delete console

+ 2 - 2
.vscode/settings.json

@@ -90,11 +90,11 @@
     "editor.defaultFormatter": "esbenp.prettier-vscode"
   },
   "editor.codeActionsOnSave": {
-    "source.fixAll.eslint": true
+    "source.fixAll.eslint": "explicit"
   },
   "[vue]": {
     "editor.codeActionsOnSave": {
-      "source.fixAll.eslint": false
+      "source.fixAll.eslint": "never"
     }
   },
   "i18n-ally.localesPaths": ["src/locales/lang"],

+ 79 - 70
src/api/account/index.ts

@@ -1,8 +1,5 @@
 import { defHttp } from '/@/utils/http/axios';
-import {
-  PageParams,
-  userList,
-} from './model';
+import { PageParams, userList } from './model';
 import { Result } from '/#/axios';
 
 enum Api {
@@ -15,6 +12,7 @@ enum Api {
   getCameraDetail = '/service/manage/user/getCameraDetail',
   unbindCamera = '/service/manage/user/unbindCamera',
   allList = '/service/manage/incrementType/allList',
+  userShareList = '/service/manage/jy/userShare/list',
 }
 
 /**
@@ -32,92 +30,103 @@ export const ListApi = (params: PageParams) =>
     },
   });
 
+export const userShareList = (params: PageParams) =>
+  defHttp.post<userList>({
+    url: Api.userShareList,
+    params: params,
+    // data: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
 //权益详情
 export const userDetail = (params: PageParams) =>
-defHttp.get<userList>({
-  url: Api.userDetail,
-  params: params,
-  // data: params,
-  headers: {
-    // @ts-ignore
-    ignoreCancelToken: true,
-  },
-});
+  defHttp.get<userList>({
+    url: Api.userDetail,
+    params: params,
+    // data: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
 
 //权益详情
 export const DetailsApi = (params: PageParams) =>
-defHttp.post<userList>({
-  url: Api.getIncrementListByUserId,
-  params: params,
-  // data: params,
-  headers: {
-    // @ts-ignore
-    ignoreCancelToken: true,
-  },
-});
+  defHttp.post<userList>({
+    url: Api.getIncrementListByUserId,
+    params: params,
+    // data: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
 
 //权益延期
 export const IncrementDelayApi = (params: PageParams) =>
-defHttp.post<userList>({
-  url: Api.IncrementDelay,
-  params: params,
-  headers: {
-    // @ts-ignore
-    ignoreCancelToken: true,
-  },
-});
+  defHttp.post<userList>({
+    url: Api.IncrementDelay,
+    params: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
 
 //权益延期
 export const dincrementList = (params: PageParams) =>
-defHttp.get<userList>({
-  url: Api.allList,
-  params: params,
-  headers: {
-    // @ts-ignore
-    ignoreCancelToken: true,
-  },
-});
+  defHttp.get<userList>({
+    url: Api.allList,
+    params: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
 
 //添加用户权益
 export const AddUserIncrementApi = (params: PageParams) =>
-defHttp.post<userList>({
-  url: Api.addUserIncrement,
-  params: params,
-  headers: {
-    // @ts-ignore
-    ignoreCancelToken: true,
-  },
-});
+  defHttp.post<userList>({
+    url: Api.addUserIncrement,
+    params: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
 
 //加用户下载次数
 export const AddDownNumApi = (params: PageParams) =>
-defHttp.post<userList>({
-  url: Api.addDownNum,
-  params: params,
-  headers: {
-    // @ts-ignore
-    ignoreCancelToken: true,
-  },
-});
+  defHttp.post<userList>({
+    url: Api.addDownNum,
+    params: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
 
 //获取相机详情
 export const GetCameraDetailApi = (params: PageParams) =>
-defHttp.post<userList>({
-  url: Api.getCameraDetail,
-  params: params,
-  headers: {
-    // @ts-ignore
-    ignoreCancelToken: true,
-  },
-});
+  defHttp.post<userList>({
+    url: Api.getCameraDetail,
+    params: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
 
 //相机解绑
 export const UnbindCameraApi = (params: PageParams) =>
-defHttp.get<userList>({
-  url: Api.unbindCamera,
-  params: params,
-  headers: {
-    // @ts-ignore
-    ignoreCancelToken: true,
-  },
-});
+  defHttp.get<userList>({
+    url: Api.unbindCamera,
+    params: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });

+ 24 - 0
src/views/sceneShare/data.ts

@@ -0,0 +1,24 @@
+// import { FormSchema } from '/@/components/Form/index';
+import { BasicColumn } from '/@/components/Table/src/types/table';
+
+export const userListSchema: BasicColumn[] = [
+  {
+    title: '姓名',
+    width: 200,
+    dataIndex: 'ryNickName',
+    fixed: 'left',
+  },
+  {
+    title: '人员编号',
+    width: 200,
+    dataIndex: 'ryNo',
+  },
+  {
+    title: '状态',
+    width: 200,
+    dataIndex: 'state',
+    customRender: ({ record }) => {
+      return record.vip == 0 ? '否' : '是';
+    },
+  },
+];

+ 117 - 0
src/views/sceneShare/myScene/index.vue

@@ -0,0 +1,117 @@
+<template>
+  <BasicTable @register="registerTimeTable">
+    <template #action="{ record }">
+      <TableAction
+        :actions="[
+          {
+            label: '详情',
+            onClick: handleEdit.bind(null, record),
+          },
+        ]"
+      />
+    </template>
+  </BasicTable>
+</template>
+<script lang="ts">
+  import { defineComponent } from 'vue';
+  import { BasicTable, useTable, FormProps, TableAction } from '/@/components/Table';
+  import { userShareList } from '/@/api/account';
+  import { userListSchema } from '../data';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import { useRouter } from 'vue-router';
+  import { otherInfoStore } from '/@/store/modules/other';
+  import { usePermissionStore } from '/@/store/modules/permission';
+  export default defineComponent({
+    components: {
+      BasicTable,
+      TableAction,
+    },
+    setup() {
+      const { t } = useI18n();
+      const { setOverviewInfo } = otherInfoStore();
+      const router = useRouter();
+      const permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
+      const searchForm: Partial<FormProps> = {
+        labelWidth: 100,
+        schemas: [
+          {
+            field: 'ryNickName',
+            label: '姓名',
+            component: 'Input',
+            componentProps: {
+              maxLength: 100,
+            },
+            colProps: {
+              xl: 6,
+              xxl: 6,
+            },
+          },
+          {
+            field: 'ryNo',
+            label: '人员编号',
+            component: 'Input',
+            componentProps: {
+              maxLength: 100,
+            },
+            colProps: {
+              xl: 8,
+              xxl: 8,
+            },
+          },
+        ],
+      };
+      const [registerTimeTable, { reload }] = useTable({
+        api: userShareList,
+        columns: userListSchema,
+        useSearchForm: true,
+        formConfig: searchForm,
+        showTableSetting: true,
+        showIndexColumn: false,
+        rowKey: 'id',
+        fetchSetting: {
+          pageField: 'pageNum',
+          sizeField: 'pageSize',
+          listField: 'list',
+          totalField: 'total',
+        },
+        actionColumn: {
+          width: 100,
+          title: '场景',
+          dataIndex: 'action',
+          slots: { customRender: 'action' },
+        },
+        canResize: true,
+      });
+      function tabChange(val: string) {
+        console.log('tabChange', val);
+        reload();
+      }
+      function handleOpen(record: Recordable) {
+        console.log('点击了启用', record);
+      }
+      function handleEdit(record: Recordable) {
+        console.log('record', record);
+        setOverviewInfo(record);
+        router.push({ path: 'details' });
+      }
+      return {
+        registerTimeTable,
+        handleOpen,
+        tabChange,
+        reload,
+        handleEdit,
+        getCheckPerm,
+        t,
+      };
+    },
+  });
+</script>
+<style lang="less" scoped>
+  .desc-wrap-BasicTable {
+    background-color: #f0f2f5;
+    .vben-basic-table-form-container {
+      padding: 0;
+    }
+  }
+</style>