tangning vor 2 Jahren
Ursprung
Commit
9cf2c81046

+ 3 - 3
src/App.vue

@@ -26,7 +26,7 @@
     padding: 0;
   }
 }
-.ant-calendar-picker{
-  min-width: 385px;
-}
+// .ant-calendar-picker{
+//   min-width: 385px;
+// }
 </style>

+ 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',
+  incrementUseTypeList = '/service/manage/incrementUseType/allList',
 }
 
 /**
@@ -34,90 +32,101 @@ export const ListApi = (params: PageParams) =>
 
 //权益详情
 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,
+    },
+  });
+
+//全部权益使用类型
+export const incrementUseTypeList = (params: PageParams) =>
+  defHttp.get<userList>({
+    url: Api.incrementUseTypeList,
+    params: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });

+ 165 - 0
src/api/authorizeModeling/index.ts

@@ -0,0 +1,165 @@
+import { defHttp } from '/@/utils/http/axios';
+import { Result } from '/#/axios';
+
+enum Api {
+  authorizeModelingList = '/service/manage/authorizeModeling/list',
+  authorizeModelingaddOrUpdate = '/service/manage/authorizeModeling/addOrUpdate',
+  authorizeModelingdelete = '/service/manage/authorizeModeling/delete',
+  authorizeInstallList = '/service/manage/authorizeInstall/list',
+  authorizeInstalladdOrUpdate = '/service/manage/authorizeInstall/addOrUpdate',
+  authorizeInstalldelete = '/service/manage/authorizeInstall/delete',
+  checkMachineCode = '/service/manage/authorizeInstall/checkMachineCode',
+  authorizeCameraList = '/service/manage/authorizeCamera/list',
+  authorizeCameraaddOrUpdate = '/service/manage/authorizeCamera/addOrUpdate',
+  authorizeCameradelete = '/service/manage/authorizeCamera/delete',
+  authorizeCameradetail = '/service/manage/authorizeCamera/detail/',
+  authorizeCameraupdateSnCode = '/service/manage/authorizeCamera/updateSnCode/',
+  authorizeCamerasnUpdateLog = '/service/manage/authorizeCamera/snUpdateLog/',
+}
+
+/**
+ * @description: Get sample list value
+ */
+
+export const authorizeModelingList = (params) =>
+  defHttp.post<Result>({
+    url: Api.authorizeModelingList,
+    params: params,
+    // data: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
+export const authorizeModelingaddOrUpdate = (params) =>
+  defHttp.post<Result>({
+    url: Api.authorizeModelingaddOrUpdate,
+    params: params,
+    // data: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
+export const authorizeModelingdelete = (params) =>
+  defHttp.post<Result>({
+    url: Api.authorizeModelingdelete,
+    params: params,
+    // data: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
+export const authorizeInstallList = (params) =>
+  defHttp.post<Result>({
+    url: Api.authorizeInstallList,
+    params: params,
+    // data: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
+export const authorizeInstalladdOrUpdate = (params) =>
+  defHttp.post<Result>({
+    url: Api.authorizeInstalladdOrUpdate,
+    params: params,
+    // data: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
+export const checkMachineCode = (params) =>
+  defHttp.post<Result>({
+    url: Api.checkMachineCode,
+    params: params,
+    // data: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
+export const authorizeInstalldelete = (params) =>
+  defHttp.post<Result>({
+    url: Api.authorizeInstalldelete,
+    params: params,
+    // data: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
+export const authorizeCameraList = (params) =>
+  defHttp.post<Result>({
+    url: Api.authorizeCameraList,
+    params: params,
+    // data: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
+export const authorizeCameraaddOrUpdate = (params) =>
+  defHttp.post<Result>({
+    url: Api.authorizeCameraaddOrUpdate,
+    params: params,
+    // data: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
+export const authorizeCameradelete = (params) =>
+  defHttp.post<Result>({
+    url: Api.authorizeCameradelete,
+    params: params,
+    // data: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
+//全部权益使用类型
+export const authorizeCameradetail = (id) =>
+  defHttp.get<Result>({
+    url: Api.authorizeCameradetail + id,
+    params: {},
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
+//全部权益使用类型
+export const authorizeCameraupdateSnCode = ({ id, snCode }) =>
+  defHttp.get<Result>({
+    url: Api.authorizeCameraupdateSnCode + id + '/' + snCode,
+    params: {},
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
+//全部权益使用类型
+export const authorizeCamerasnUpdateLog = (id) =>
+  defHttp.get<Result>({
+    url: Api.authorizeCamerasnUpdateLog + id,
+    params: {},
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });

+ 189 - 24
src/views/account/details/data.ts

@@ -2,6 +2,7 @@ import { FormSchema } from '/@/components/Form/index';
 import { BasicColumn, FormProps } from '/@/components/Table';
 import { Time } from '/@/components/Time';
 import { h } from 'vue';
+import { incrementUseTypeList } from '/@/api/account';
 
 export interface ListItem {
   key: string;
@@ -173,14 +174,34 @@ export const equityColumns: BasicColumn[] = [
     width: 100,
   },
   {
-    title: '数量',
-    dataIndex: 'count',
-    width: 80,
+    title: '客户名称',
+    dataIndex: 'customerName',
+    width: 100,
   },
   {
-    title: '交易号',
-    dataIndex: 'number',
-    width: 180,
+    title: '客户类别',
+    dataIndex: 'customerTypeStr',
+    width: 100,
+  },
+  {
+    title: '终端客户名称',
+    dataIndex: 'endCustomer',
+    width: 100,
+  },
+  {
+    title: '经销商名称',
+    dataIndex: 'agentName',
+    width: 100,
+  },
+  {
+    title: '使用类型',
+    dataIndex: 'useTypeStr',
+    width: 100,
+  },
+  {
+    title: '权益类型',
+    dataIndex: 'memberLevels',
+    width: 100,
   },
   {
     title: '订单金额',
@@ -188,22 +209,47 @@ export const equityColumns: BasicColumn[] = [
     width: 80,
   },
   {
+    title: '数量',
+    dataIndex: 'count',
+    width: 80,
+  },
+  {
     title: '支付方式',
     dataIndex: 'payType',
     // slots: { customRender: 'orderType' },
     width: 80,
   },
   {
-    title: '订单状态',
+    title: '交易号',
+    dataIndex: 'number',
+    width: 180,
+  },
+  {
+    title: '付款状态',
     dataIndex: 'payStatus',
     // slots: { customRender: 'orderStatus' },
     width: 80,
   },
+  {
+    title: '充值方式',
+    dataIndex: 'payMethod',
+    width: 100,
+  },
+  {
+    title: '会员服务期限',
+    dataIndex: 'incrementTime',
+    width: 100,
+  },
+  {
+    title: 'SN码',
+    dataIndex: 'snCode',
+    width: 100,
+  },
 ];
 export const equitySearchForm: Partial<FormProps> = {
   labelWidth: 100,
-  autoSubmitOnEnter:true,
-  autoAdvancedLine:1,
+  autoSubmitOnEnter: true,
+  autoAdvancedLine: 1,
   actionColOptions: {
     span: 24,
   },
@@ -215,13 +261,14 @@ export const equitySearchForm: Partial<FormProps> = {
       componentProps: {
         maxLength: 100,
         format: 'YYYY-MM-DD',
-        valueFormat:'YYYY-MM-DD',
+        valueFormat: 'YYYY-MM-DD',
       },
       colProps: {
         xl: 7,
         xxl: 7,
       },
-    },{
+    },
+    {
       field: 'orderSn',
       label: '订单号',
       component: 'Input',
@@ -232,7 +279,8 @@ export const equitySearchForm: Partial<FormProps> = {
         xl: 7,
         xxl: 7,
       },
-    },{
+    },
+    {
       field: 'userName',
       label: '用户账号',
       component: 'Input',
@@ -243,7 +291,8 @@ export const equitySearchForm: Partial<FormProps> = {
         xl: 7,
         xxl: 7,
       },
-    },{
+    },
+    {
       field: 'tradeNum',
       label: '交易号',
       component: 'Input',
@@ -251,16 +300,81 @@ export const equitySearchForm: Partial<FormProps> = {
         maxLength: 100,
       },
       colProps: {
-        xl: 7,
-        xxl: 7,
+        span: 7,
+      },
+    },
+    {
+      field: 'customerType',
+      component: 'Select',
+      label: '客户类别',
+      colProps: {
+        span: 7,
+      },
+      componentProps: {
+        options: [
+          {
+            label: '直销',
+            value: 0,
+            key: '0',
+          },
+          {
+            label: '经销',
+            value: 1,
+            key: '1',
+          },
+        ],
+      },
+    },
+    {
+      field: 'useType',
+      component: 'ApiSelect',
+      label: '使用类型',
+      componentProps: {
+        // filterOption: onFilterOption,
+        // showSearch: true,
+        api: incrementUseTypeList,
+        labelField: 'name',
+        valueField: 'id',
+        immediate: true,
+      },
+      colProps: {
+        span: 7,
       },
     },
+    {
+      field: 'payMethod',
+      component: 'Select',
+      label: '充值方式',
+      colProps: {
+        span: 7,
+      },
+      componentProps: {
+        options: [
+          {
+            label: '线上',
+            value: 0,
+            key: '0',
+          },
+          {
+            label: '线下',
+            value: 1,
+            key: '1',
+          },
+        ],
+      },
+    },
+    {
+      field: 'amount',
+      component: 'Input',
+      label: '订单金额',
+      colProps: { span: 7 },
+    },
   ],
 };
 export const orderSearchForm: Partial<FormProps> = {
   labelWidth: 100,
-  autoSubmitOnEnter:true,
-  autoAdvancedLine:1,
+  autoSubmitOnEnter: true,
+  autoAdvancedLine: 1,
   actionColOptions: {
     span: 24,
   },
@@ -276,7 +390,20 @@ export const orderSearchForm: Partial<FormProps> = {
         xl: 7,
         xxl: 7,
       },
-    },{
+    },
+    {
+      field: 'userName',
+      label: '用户账号',
+      component: 'Input',
+      componentProps: {
+        maxLength: 100,
+      },
+      colProps: {
+        xl: 7,
+        xxl: 7,
+      },
+    },
+    {
       field: 'tradeNum',
       label: '交易号',
       component: 'Input',
@@ -287,20 +414,21 @@ export const orderSearchForm: Partial<FormProps> = {
         xl: 7,
         xxl: 7,
       },
-    },{
+    },
+    {
       field: 'ctivated',
       label: '下单时间',
       component: 'RangePicker',
       componentProps: {
         maxLength: 100,
         format: 'YYYY-MM-DD',
-        valueFormat:'YYYY-MM-DD',
+        valueFormat: 'YYYY-MM-DD',
       },
       colProps: {
         xl: 7,
         xxl: 7,
       },
-    }
+    },
   ],
 };
 //下载订单
@@ -329,21 +457,53 @@ export const dowmColumns: BasicColumn[] = [
     title: '用户账号',
     dataIndex: 'userName',
     width: 120,
-  },{
+  },
+  {
     title: 'SN码',
     dataIndex: 'snCode',
     width: 120,
-  },{
+  },
+  {
     title: '场景',
     dataIndex: 'sceneNum',
     width: 100,
   },
   {
+    title: '客户名称',
+    dataIndex: 'customerName',
+    width: 100,
+  },
+  {
+    title: '客户类别',
+    dataIndex: 'customerTypeStr',
+    width: 100,
+  },
+  {
+    title: '终端客户名称',
+    dataIndex: 'endCustomer',
+    width: 100,
+  },
+  {
+    title: '经销商名称',
+    dataIndex: 'agentName',
+    width: 100,
+  },
+  {
+    title: '使用类型',
+    dataIndex: 'useTypeStr',
+    width: 100,
+  },
+  {
     title: '订单金额(元)',
     dataIndex: 'amount',
     width: 80,
   },
   {
+    title: '数量',
+    dataIndex: 'count',
+    width: 100,
+  },
+  {
     title: '支付方式',
     dataIndex: 'payType',
     // slots: { customRender: 'orderType' },
@@ -355,11 +515,16 @@ export const dowmColumns: BasicColumn[] = [
     width: 180,
   },
   {
-    title: '订单状态',
+    title: '付款状态',
     dataIndex: 'payStatus',
     // slots: { customRender: 'orderStatus' },
     width: 80,
   },
+  {
+    title: '充值方式',
+    dataIndex: 'payMethod',
+    width: 180,
+  },
 ];
 //相机订单
 export const cameraColumns: BasicColumn[] = [

+ 45 - 36
src/views/account/overview/AddDownModal.vue

@@ -7,11 +7,9 @@
     @cancel="resetFields"
     @ok="handleConfirm"
   >
-    <div class="pt-2px pr-3px">
+    <div class="pt-2px pr-3px zdysrk">
       <BasicForm @register="registerForm">
-        <template #text="{ model, field }">
-          {{ model[field]  }}{{fileFlow.type}}
-        </template>
+        <template #text="{ model, field }"> {{ model[field] }}{{ fileFlow.type }} </template>
       </BasicForm>
     </div>
   </BasicModal>
@@ -27,7 +25,8 @@
   import { ResultEnum } from '/@/enums/httpEnum';
   import { DetailsApi, dincrementList, AddUserIncrementApi, AddDownNumApi } from '/@/api/account';
   import dayjs from 'dayjs';
-  import { otherInfoStore } from '/@/store/modules/other'
+  import { remarkschemas, Addschemas } from "./data";
+  import { otherInfoStore } from '/@/store/modules/other';
 
   const { t } = useI18n();
   export default defineComponent({
@@ -41,35 +40,37 @@
       const overviewInfo = computed(() => otherInfo.getOverviewInfo);
       // const overviewInfo = getOverviewInfo() || {}
       const fileFlow = reactive({
-        file:null,
-        id:'',
-        type:'down',//down-下载,equity-权益
-      })
+        file: null,
+        id: '',
+        type: 'down', //down-下载,equity-权益
+      });
       const { createMessage, createConfirm } = useMessage();
       const schemas: FormSchema[] = [
-          {
-            field: 'id',
-            component: 'Input',
-            show:false,
-            label: 'id',
+        ...Addschemas,
+        {
+          field: 'id',
+          component: 'Input',
+          show: false,
+          label: 'id',
+        },
+        {
+          field: 'count',
+          component: 'InputNumber',
+          label: '新增次数',
+          required: true,
+          componentProps: {
+            min: 1,
+          },
+          colProps: {
+            span: 22,
           },
-          {
-            field: 'count',
-            component: 'InputNumber',
-            label: '新增次数',
-            required: true,
-            componentProps: {
-              min:1,
-            },
-            colProps: {
-              span: 22,
-            },
-          }
+        },
+        ...remarkschemas,
       ];
 
       const [registerForm, { validate, resetFields, setFieldsValue, updateSchema }] = useForm({
         labelWidth: 120,
-        schemas:schemas,
+        schemas: schemas,
         showActionButtonGroup: false,
         actionColOptions: {
           span: 24,
@@ -82,10 +83,10 @@
       });
       async function onDataReceive(data) {
         const res = await dincrementList();
-        console.log('onDataReceive',data,res)
+        console.log('onDataReceive', data, res);
         resetFields();
-        fileFlow.type = data.type
-        fileFlow.id = data.id
+        fileFlow.type = data.type;
+        fileFlow.id = data.id;
         setFieldsValue(data);
       }
       async function handleConfirm() {
@@ -95,19 +96,19 @@
           title: () => h('span', '温馨提示'),
           content: () => h('span', `确定要新增下载次数吗?`),
           onOk: async () => {
-            handleSubmit()
+            handleSubmit();
           },
         });
       }
       const handleSubmit = async () => {
-        const submitUrl = AddDownNumApi
+        const submitUrl = AddDownNumApi;
         try {
           const params = await validate();
-          console.log('validate',params)
-          const res = await submitUrl({userId:params.id,...params});
-          overviewInfo.value.surDownNum = overviewInfo.value.surDownNum + params.count
+          console.log('validate', params);
+          const res = await submitUrl({ userId: params.id, ...params });
+          overviewInfo.value.surDownNum = overviewInfo.value.surDownNum + params.count;
           console.log('res', res);
-          otherInfo.updateOverviewInfo()
+          otherInfo.updateOverviewInfo();
           closeModal();
           resetFields();
           createMessage.success(t('common.optSuccess'));
@@ -133,3 +134,11 @@
     },
   });
 </script>
+
+<style lang="less">
+  .zdysrk {
+    .ant-calendar-picker {
+      min-width: 285px;
+    }
+  }
+</style>

+ 155 - 140
src/views/account/overview/AddModal.vue

@@ -7,11 +7,9 @@
     @cancel="resetFields"
     @ok="handleConfirm"
   >
-    <div class="pt-2px pr-3px">
+    <div class="pt-2px pr-3px zdysrk">
       <BasicForm @register="registerForm">
-        <template #text="{ model, field }">
-          {{ model[field]  }}{{fileFlow.type}}
-        </template>
+        <template #text="{ model, field }"> {{ model[field] }}{{ fileFlow.type }} </template>
       </BasicForm>
     </div>
   </BasicModal>
@@ -21,13 +19,14 @@
   import { BasicModal, useModalInner } from '/@/components/Modal';
   import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
   import { useMessage } from '/@/hooks/web/useMessage';
+  import { remarkschemas, Addschemas } from "./data";
   import { InvoiceRegister } from '/@/api/order';
   import { useI18n } from '/@/hooks/web/useI18n';
   import { uploadApi } from '/@/api/product/index';
   import { ResultEnum } from '/@/enums/httpEnum';
   import { DetailsApi, dincrementList, AddUserIncrementApi, AddDownNumApi } from '/@/api/account';
   import dayjs from 'dayjs';
-  import { otherInfoStore } from '/@/store/modules/other'
+  import { otherInfoStore } from '/@/store/modules/other';
 
   const { t } = useI18n();
   export default defineComponent({
@@ -41,28 +40,28 @@
       const overviewInfo = computed(() => otherInfo.getOverviewInfo);
       // const overviewInfo = getOverviewInfo() || {}
       const fileFlow = reactive({
-        file:null,
-        id:'',
-        type:'down',//down-下载,equity-权益
-      })
+        file: null,
+        id: '',
+        type: 'down', //down-下载,equity-权益
+      });
       const { createMessage, createConfirm } = useMessage();
       const schemas: FormSchema[] = [
-          {
-            field: 'id',
-            component: 'Input',
-            show:false,
-            label: 'id',
-          },
-          {
-            field: 'incrementTypeId',
-            component: 'ApiSelect',
-            label: '权益类型',
-            required: true,
-            componentProps: {
+        {
+          field: 'id',
+          component: 'Input',
+          show: false,
+          label: 'id',
+        },
+        {
+          field: 'incrementTypeId',
+          component: 'ApiSelect',
+          label: '权益类型',
+          required: true,
+          componentProps: {
             api: async function () {
               const res = await dincrementList();
-              return res.map(ele => {
-                return {name:ele.name,value:ele.id}
+              return res.map((ele) => {
+                return { name: ele.name, value: ele.id };
               });
             },
             numberToString: true,
@@ -72,123 +71,132 @@
             params: {
               agentName: '',
             },
-            onChange:(value)=>{
-              console.log('onChange',value)
-              updateSchema([{field: 'monthQy',ifShow:value=='3',},
-                            {field: 'incrementEndTime',componentProps: { disabled:value=='3',}}])
+            onChange: (value) => {
+              console.log('onChange', value);
+              updateSchema([
+                { field: 'monthQy', ifShow: value == '3' },
+                { field: 'incrementEndTime', componentProps: { disabled: value == '3' } },
+              ]);
               setFieldsValue({
-                monthQy:1,
-                incrementEndTime: dayjs().add(1,value=='3'?'month':'year').format('YYYY-MM-DD'),
+                monthQy: 1,
+                incrementEndTime: dayjs()
+                  .add(1, value == '3' ? 'month' : 'year')
+                  .format('YYYY-MM-DD'),
               });
-            }
-          },
-            // componentProps: {
-            //   options: [
-            //     {
-            //       label: '专业会员',
-            //       value: 'PR',
-            //       key: '0',
-            //     },
-            //     {
-            //       label: '高级会员',
-            //       value: 'SE',
-            //       key: '1',
-            //     },
-            //   ],
-            //   onChange: (incrementTypeId) => {
-            //     updateSchema([{field: 'monthQy',ifShow:incrementTypeId=='SE',},
-            //                   {field: 'incrementEndTime',componentProps: { disabled:incrementTypeId=='SE',}}])
-            //     setFieldsValue({
-            //       monthQy:1,
-            //       incrementEndTime: dayjs().add(1,incrementTypeId=='SE'?'month':'year').format('YYYY-MM-DD'),
-            //     });
-            //   },
-            // },
-            colProps: {
-              span: 20,
             },
           },
-          {
-            field: 'counts',
-            component: 'InputNumber',
-            label: '新增权益数',
-            required: true,
-            defaultValue:1,
-            componentProps: {
-              min:1,
-            },
-            colProps: {
-              span: 20,
-            },
+          // componentProps: {
+          //   options: [
+          //     {
+          //       label: '专业会员',
+          //       value: 'PR',
+          //       key: '0',
+          //     },
+          //     {
+          //       label: '高级会员',
+          //       value: 'SE',
+          //       key: '1',
+          //     },
+          //   ],
+          //   onChange: (incrementTypeId) => {
+          //     updateSchema([{field: 'monthQy',ifShow:incrementTypeId=='SE',},
+          //                   {field: 'incrementEndTime',componentProps: { disabled:incrementTypeId=='SE',}}])
+          //     setFieldsValue({
+          //       monthQy:1,
+          //       incrementEndTime: dayjs().add(1,incrementTypeId=='SE'?'month':'year').format('YYYY-MM-DD'),
+          //     });
+          //   },
+          // },
+          colProps: {
+            span: 20,
           },
-          {
-            field: 'monthQy',
-            component: 'Select',
-            label: '会员期限',
-            ifShow:false,
-            required: true,
-            defaultValue:1,
-            componentProps: {
-              options: [
-                {
-                  label: '1个月',
-                  value: 1,
-                  key: '1',
-                },{
-                  label: '2个月',
-                  value: 2,
-                  key: '2',
-                },{
-                  label: '3个月',
-                  value: 3,
-                  key: '3',
-                },{
-                  label: '4个月',
-                  value: 4,
-                  key: '4',
-                },{
-                  label: '5个月',
-                  value: 5,
-                  key: '5',
-                },{
-                  label: '6个月',
-                  value: 6,
-                  key: '6',
-                },
-              ],
-              onChange: (data) => {
-                setFieldsValue({
-                  incrementEndTime: dayjs().add(data,'month').format('YYYY-MM-DD'),
-                });
+        },
+        {
+          field: 'counts',
+          component: 'InputNumber',
+          label: '新增权益数',
+          required: true,
+          defaultValue: 1,
+          componentProps: {
+            min: 1,
+          },
+          colProps: {
+            span: 20,
+          },
+        },
+        {
+          field: 'monthQy',
+          component: 'Select',
+          label: '会员期限',
+          ifShow: false,
+          required: true,
+          defaultValue: 1,
+          componentProps: {
+            options: [
+              {
+                label: '1个月',
+                value: 1,
+                key: '1',
               },
-            },
-            colProps: {
-              span: 20,
+              {
+                label: '2个月',
+                value: 2,
+                key: '2',
+              },
+              {
+                label: '3个月',
+                value: 3,
+                key: '3',
+              },
+              {
+                label: '4个月',
+                value: 4,
+                key: '4',
+              },
+              {
+                label: '5个月',
+                value: 5,
+                key: '5',
+              },
+              {
+                label: '6个月',
+                value: 6,
+                key: '6',
+              },
+            ],
+            onChange: (data) => {
+              setFieldsValue({
+                incrementEndTime: dayjs().add(data, 'month').format('YYYY-MM-DD'),
+              });
             },
           },
-          {
-            field: 'incrementEndTime',
-            component: 'DatePicker',
-            label: '到期日期',
-            required: true,
-            defaultValue:dayjs().add(1,'month').format('YYYY-MM-DD'),
-            colProps: {
-              span: 20,
-            },
-            componentProps: {
-              disabled:false,
-              valueFormat: 'YYYY-MM-DD',
-              format: 'YYYY-MM-DD',
-              disabledDate: (current) => {
-                return current && current < dayjs().endOf('day');
-              },
+          colProps: {
+            span: 16,
+          },
+        },
+        {
+          field: 'incrementEndTime',
+          component: 'DatePicker',
+          label: '到期日期',
+          required: true,
+          defaultValue: dayjs().add(1, 'month').format('YYYY-MM-DD'),
+          colProps: {
+            span: 16,
+          },
+          componentProps: {
+            disabled: false,
+            valueFormat: 'YYYY-MM-DD',
+            format: 'YYYY-MM-DD',
+            disabledDate: (current) => {
+              return current && current < dayjs().endOf('day');
             },
-          }
+          },
+        },
       ];
 
       const [registerForm, { validate, resetFields, setFieldsValue, updateSchema }] = useForm({
         labelWidth: 120,
-        schemas:schemas,
+        schemas: [...Addschemas, ...schemas, ...remarkschemas],
         showActionButtonGroup: false,
         actionColOptions: {
           span: 24,
@@ -201,10 +209,10 @@
       });
       async function onDataReceive(data) {
         const res = await dincrementList();
-        console.log('onDataReceive',data,res)
+        console.log('onDataReceive', data, res);
         resetFields();
-        fileFlow.type = data.type
-        fileFlow.id = data.id
+        fileFlow.type = data.type;
+        fileFlow.id = data.id;
         setFieldsValue(data);
       }
       async function handleConfirm() {
@@ -214,25 +222,25 @@
           title: () => h('span', '温馨提示'),
           content: () => h('span', `确定要新增权益吗?`),
           onOk: async () => {
-            handleSubmit()
+            handleSubmit();
           },
         });
       }
       const handleSubmit = async () => {
-        const submitUrl = AddUserIncrementApi
+        const submitUrl = AddUserIncrementApi;
         try {
           const params = await validate();
-          console.log('validate',params)
+          console.log('validate', params);
           const apiData = {
-              ...params,
-              userId:params.id,
-              incrementEndTime:params.incrementEndTime,
-              count:params.counts,
-            }
+            ...params,
+            userId: params.id,
+            incrementEndTime: params.incrementEndTime,
+            count: params.counts,
+          };
           const res = await submitUrl(apiData);
-          overviewInfo.value.incrementCount = overviewInfo.value.incrementCount + apiData.count
+          overviewInfo.value.incrementCount = overviewInfo.value.incrementCount + apiData.count;
           console.log('res', res);
-          otherInfo.updateOverviewInfo()
+          otherInfo.updateOverviewInfo();
           closeModal();
           resetFields();
           createMessage.success(t('common.optSuccess'));
@@ -258,3 +266,10 @@
     },
   });
 </script>
+<style lang="less">
+  .zdysrk {
+    .ant-calendar-picker {
+      min-width: 285px;
+    }
+  }
+</style>

+ 77 - 1
src/views/account/overview/data.tsx

@@ -1,7 +1,8 @@
 import { DescItem } from '/@/components/Description/index';
 import { BasicColumn } from '/@/components/Table/src/types/table';
 import { Button } from '/@/components/Button';
-
+import { FormSchema } from '/@/components/Form/index';
+import { incrementUseTypeList } from '/@/api/account';
 import { Badge } from 'ant-design-vue';
 
 export const refundData = {
@@ -200,3 +201,78 @@ export const refundTimeTableData: any[] = [
     t5: '1h',
   },
 ];
+// 基础设置 form
+export const remarkschemas: FormSchema[] = [
+  {
+    field: 'remark',
+    component: 'InputTextArea',
+    required: true,
+    label: '备注',
+    componentProps: {
+      placeholder: '请输入钉钉审批单号',
+      rows: 4,
+    },
+    colProps: { span: 20 },
+  },
+];
+export const Addschemas: FormSchema[] = [
+  {
+    field: 'customerName',
+    component: 'Input',
+    label: '客户名称',
+    required: true,
+    colProps: { span: 20 },
+  },
+  {
+    field: 'customerType',
+    component: 'Select',
+    label: '客户类别',
+    required: true,
+    colProps: { span: 20 },
+    componentProps: {
+      options: [
+        {
+          label: '直销',
+          value: 0,
+          key: '0',
+        },
+        {
+          label: '经销',
+          value: 1,
+          key: '1',
+        },
+      ],
+    },
+  },
+  {
+    field: 'endCustomer',
+    component: 'Input',
+    label: '终端客户',
+    required: true,
+    colProps: { span: 20 },
+  },
+  {
+    field: 'useType',
+    component: 'ApiSelect',
+    required: true,
+    label: '使用类型',
+    componentProps: {
+      // filterOption: onFilterOption,
+      // showSearch: true,
+      api: incrementUseTypeList,
+      labelField: 'name',
+      valueField: 'id',
+      immediate: true,
+    },
+    colProps: {
+      span: 18,
+    },
+  },
+  {
+    field: 'projectNum',
+    component: 'Input',
+    label: '项目号',
+    required: true,
+    colProps: { span: 20 },
+  },
+];

+ 32 - 5
src/views/account/overview/interesModal.vue

@@ -3,7 +3,7 @@
     v-bind="$attrs"
     @register="register"
     title="权益详情"
-    :width="800"
+    :width="900"
     @visible-change="handleVisibleChange"
     @ok="handleSubmit"
   >
@@ -62,12 +62,29 @@
         {
           title: '会员权益ID',
           dataIndex: 'id',
-          width: 80,
+          width: 100,
           customRender: ({ record }) => {
             return record.memberLevels? (record.memberLevels +' '+ record.id): record.id;
           },
         },
         {
+          title: '权益类型',
+          width: 100,
+          dataIndex: 'memberLevels',
+          customRender: ({ record }) => {
+            let obj = {
+              'PR': '专业会员',
+              'SE': '高级会员',
+            }
+            return obj[record.memberLevels] || '';
+          },
+        },
+        {
+          title: '使用类型',
+          width: 100,
+          dataIndex: 'useTypeStr',
+        },
+        {
           title: '授权相机S/N吗',
           width: 160,
           dataIndex: 'snCode',
@@ -75,7 +92,7 @@
         {
           title: '购买日期',
           dataIndex: 'incrementStartTime',
-          width: 180,
+          width: 120,
           customRender: ({ record }) => {
             return record.incrementStartTime
               ? h(Time, {
@@ -88,7 +105,7 @@
         {
           title: '到期日期',
           dataIndex: 'incrementEndTime',
-          width: 180,
+          width: 120,
           customRender: ({ record }) => {
             return record.incrementEndTime
               ? h(Time, {
@@ -99,11 +116,21 @@
           },
         },
         {
+          title: '项目号',
+          width: 100,
+          dataIndex: 'projectNum',
+        },
+        {
+          title: '备注',
+          width: 100,
+          dataIndex: 'remark',
+        },
+        {
           title: t('common.operating'),
           ifShow:getCheckPerm('account-equityRenew'),
           dataIndex: '',
           slots: { customRender: 'action' },
-          width: 80,
+          width: 60,
         },
       ];
       const [

+ 122 - 118
src/views/dealer/finance.vue

@@ -19,127 +19,131 @@
   </PageWrapper>
 </template>
 <script lang="ts">
-import { defineComponent, h, ref } from 'vue';
-import {
-  BasicTable,
-  useTable,
-  TableAction,
-  BasicColumn,
-  TableImg,
-  FormProps,
-} from '/@/components/Table';
-import { PageWrapper } from '/@/components/Page';
-import { Time } from '/@/components/Time';
-import { logListApi, DownExport } from '/@/api/dealer';
-import {  Descriptions, Tabs } from 'ant-design-vue';
-import { useModal } from '/@/components/Modal';
-import { useI18n } from '/@/hooks/web/useI18n';
-import { useMessage } from '/@/hooks/web/useMessage';
-import { usePermissionStore } from '/@/store/modules/permission';
-export default defineComponent({
-  components: {
+  import { defineComponent, h, ref } from 'vue';
+  import {
     BasicTable,
+    useTable,
     TableAction,
-    PageWrapper,
+    BasicColumn,
     TableImg,
-    [Descriptions.name]: Descriptions,
-    [Descriptions.Item.name]: Descriptions.Item,
-    [Tabs.name]: Tabs,
-    [Tabs.TabPane.name]: Tabs.TabPane,
-  },
-  setup() {
-    const { t } = useI18n();
-    const { createMessage } = useMessage();
-    const permissionStore = usePermissionStore();
-    const { getCheckPerm } = permissionStore;
-    const [register, { openModal }] = useModal();
-    const language = ref<string>('cn'); //未处理,0已处理(默认1)
-    const columns: BasicColumn[] = [
-      {
-        title: '经销商名称',
-        dataIndex: 'agentName',
-        ellipsis: true,
-        width: 250,
-      },
-      {
-        title: '专业会员(年)销售年数',
-        dataIndex: 'majorNum',
-        ellipsis: true,
-        width: 80,
-      },
-      {
-        title: '高级会员(月)销售月数',
-        ellipsis: true,
-        dataIndex: 'highNum',
-        width: 120,
-      },
-      {
-        title: '场景下载销售数量',
-        ellipsis: true,
-        dataIndex: 'downNum',
-        width: 120,
-      },
-    ];
-    const searchForm: Partial<FormProps> = {
-      labelWidth: 100,
-      autoSubmitOnEnter: true,
-      schemas: [
+    FormProps,
+  } from '/@/components/Table';
+  import { PageWrapper } from '/@/components/Page';
+  import { Time } from '/@/components/Time';
+  import { logListApi, DownExport } from '/@/api/dealer';
+  import { Descriptions, Tabs } from 'ant-design-vue';
+  import { useModal } from '/@/components/Modal';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { usePermissionStore } from '/@/store/modules/permission';
+  export default defineComponent({
+    components: {
+      BasicTable,
+      TableAction,
+      PageWrapper,
+      TableImg,
+      [Descriptions.name]: Descriptions,
+      [Descriptions.Item.name]: Descriptions.Item,
+      [Tabs.name]: Tabs,
+      [Tabs.TabPane.name]: Tabs.TabPane,
+    },
+    setup() {
+      const { t } = useI18n();
+      const { createMessage } = useMessage();
+      const permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
+      const [register, { openModal }] = useModal();
+      const language = ref<string>('cn'); //未处理,0已处理(默认1)
+      const columns: BasicColumn[] = [
         {
-          field: 'timeList',
-          label: '时间段',
-          component: 'RangePicker',
-          componentProps: {
-            maxLength: 100,
-            format: 'YYYY-MM-DD',
-            valueFormat: 'YYYY-MM-DD',
-            showTime: true,
-          },
-          colProps: {
-            xl: 8,
-            xxl: 8,
+          title: '经销商名称',
+          dataIndex: 'agentName',
+          ellipsis: true,
+          width: 250,
+        },
+        {
+          title: '专业会员(年)销售年数',
+          dataIndex: 'majorNum',
+          ellipsis: true,
+          width: 80,
+        },
+        {
+          title: '高级会员(月)销售月数',
+          ellipsis: true,
+          dataIndex: 'highNum',
+          width: 120,
+        },
+        {
+          title: '场景下载销售数量',
+          ellipsis: true,
+          dataIndex: 'downNum',
+          width: 120,
+        },
+      ];
+      const searchForm: Partial<FormProps> = {
+        labelWidth: 100,
+        autoSubmitOnEnter: true,
+        schemas: [
+          {
+            field: 'timeList',
+            label: '时间段',
+            component: 'RangePicker',
+            componentProps: {
+              maxLength: 100,
+              format: 'YYYY-MM-DD',
+              valueFormat: 'YYYY-MM-DD',
+              showTime: true,
+            },
+            colProps: {
+              xl: 8,
+              xxl: 8,
+            },
           },
+        ],
+      };
+      const [registerTable, { reload }] = useTable({
+        api: logListApi,
+        title: '销售统计列表',
+        titleHelpMessage: [
+          '统计规则:',
+          '1、会员权益:统计当前经销商新授权的记录、以及相关权益ID续费记录,包括经销商授权和续费、平台授权(续费)、官网自购(续费);',
+          '2、场景下载:统计当前经销售新授权(除相关用户)的下载次数;',
+        ],
+        columns: columns,
+        useSearchForm: true,
+        formConfig: searchForm,
+        showTableSetting: true,
+        showIndexColumn: false,
+        searchInfo: { language },
+        rowKey: 'id',
+        fetchSetting: {
+          pageField: 'pageNum',
+          sizeField: 'pageSize',
+          listField: 'list',
+          totalField: 'total',
+        },
+        beforeFetch: (T) => {
+          if (T.ctivated) {
+            T.publicTimeStart = T.ctivated[0];
+            T.publicTimeEnd = T.ctivated[1];
+          }
+          return T;
         },
-      ],
-    };
-    const [registerTable, { reload }] = useTable({
-      api: logListApi,
-      title: '销售统计列表',
-      titleHelpMessage: ['统计规则:', '1、会员权益:统计当前经销商新授权的记录、以及相关权益ID续费记录,包括经销商授权和续费、平台授权(续费)、官网自购(续费);','2、场景下载:统计当前经销售新授权(除相关用户)的下载次数;'],
-      columns: columns,
-      useSearchForm: true,
-      formConfig: searchForm,
-      showTableSetting: true,
-      showIndexColumn: false,
-      searchInfo: { language },
-      rowKey: 'id',
-      fetchSetting: {
-        pageField: 'pageNum',
-        sizeField: 'pageSize',
-        listField: 'list',
-        totalField: 'total',
-      },
-      beforeFetch: (T) => {
-        if (T.ctivated) {
-          T.publicTimeStart = T.ctivated[0];
-          T.publicTimeEnd = T.ctivated[1];
-        }
-        return T;
-      },
-      canResize: true,
-    });
-    async function hendleAddNew() {
-      await DownExport()
-      console.log('新增新闻');
-    }
-    return {
-      registerTable,
-      hendleAddNew,
-      reload,
-      language,
-      register,
-      openModal,
-      getCheckPerm,
-    };
-  },
-});
-</script>
+        canResize: true,
+      });
+      async function hendleAddNew() {
+        await DownExport();
+        console.log('新增新闻');
+      }
+      return {
+        registerTable,
+        hendleAddNew,
+        reload,
+        language,
+        register,
+        openModal,
+        getCheckPerm,
+      };
+    },
+  });
+</script>

+ 230 - 206
src/views/device/detailsMoadl.vue

@@ -18,92 +18,94 @@
   </BasicModal>
 </template>
 <script lang="ts">
-import { defineComponent, ref, onMounted, reactive } from 'vue';
-import { BasicModal, useModalInner } from '/@/components/Modal';
-import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
-import { useMessage } from '/@/hooks/web/useMessage';
-import { companyList } from '/@/api/customer';
-// import { sceneMove } from '/@/api/operate';
-import { downTemplate } from '/@/api/customer';
-import { cameraParam, cameraUpdate, cameraOut } from '/@/api/device';
-import { agentNewList } from '/@/api/dealer';
-import { CameraList } from '/@/api/order';
-import { useI18n } from '/@/hooks/web/useI18n';
-const { t } = useI18n();
-interface Option {
-  value: string;
-}
+  import { defineComponent, ref, onMounted, reactive } from 'vue';
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { companyList } from '/@/api/customer';
+  // import { sceneMove } from '/@/api/operate';
+  import { downTemplate } from '/@/api/customer';
+  import { cameraParam, cameraUpdate, cameraOut } from '/@/api/device';
+  import { agentNewList } from '/@/api/dealer';
+  import { CameraList } from '/@/api/order';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import dayjs from 'dayjs';
+  const { t } = useI18n();
+  interface Option {
+    value: string;
+  }
 
-export default defineComponent({
-  components: { BasicModal, BasicForm },
-  props: {
-    userData: { type: Object },
-  },
-  emits: ['reload'],
-  setup(_, { emit }) {
-    const modelRef = ref({
-      isUpdate:false,
-    });
-    const title = ref('设备出库');
-    const optionsOrderSn = ref<Option[]>([]);
-    const optionsName = ref<Option[]>([]);
-    const fileFlow = reactive({
-      file: null,
-    });
-    const { createMessage } = useMessage();
-    const schemas: FormSchema[] = [
-      {
-        field: 'id',
-        component: 'Input',
-        label: 'id',
-        show: false,
-      },
-      {
-        field: 'outType',
-        component: 'Select',
-        label: '出库类型',
-        required: true,
-        colProps: {
-          span: 18,
+  export default defineComponent({
+    components: { BasicModal, BasicForm },
+    props: {
+      userData: { type: Object },
+    },
+    emits: ['reload'],
+    setup(_, { emit }) {
+      const modelRef = ref({
+        isUpdate: false,
+      });
+      const title = ref('设备出库');
+      const optionsOrderSn = ref<Option[]>([]);
+      const optionsName = ref<Option[]>([]);
+      const fileFlow = reactive({
+        file: null,
+      });
+      const { createMessage } = useMessage();
+      const schemas: FormSchema[] = [
+        {
+          field: 'id',
+          component: 'Input',
+          label: 'id',
+          show: false,
         },
-        componentProps: {
-          options: [
-            {
-              label: t('routes.product.outType.0'),
-              value: '0',
-              key: '0',
-            },
-            {
-              label: t('routes.product.outType.1'),
-              value: '1',
-              key: '1',
-            },
-            {
-              label: t('routes.product.outType.2'),
-              value: '2',
-              key: '2',
-            },
-            {
-              label: t('routes.product.outType.3'),
-              value: '3',
-              key: '3',
+        {
+          field: 'outType',
+          component: 'Select',
+          label: '出库类型',
+          required: true,
+          colProps: {
+            span: 18,
+          },
+          componentProps: {
+            options: [
+              {
+                label: t('routes.product.outType.0'),
+                value: '0',
+                key: '0',
+              },
+              {
+                label: t('routes.product.outType.1'),
+                value: '1',
+                key: '1',
+              },
+              {
+                label: t('routes.product.outType.2'),
+                value: '2',
+                key: '2',
+              },
+              {
+                label: t('routes.product.outType.3'),
+                value: '3',
+                key: '3',
+              },
+            ],
+            onChange: (value) => {
+              // updateSchema([{field: 'agentId',ifShow:value=='4',},
+              //         {field: 'companyName',ifShow:value!='4',}])
             },
-          ],
-          onChange:(value)=>{
-            // updateSchema([{field: 'agentId',ifShow:value=='4',},
-            //         {field: 'companyName',ifShow:value!='4',}])
-            }
+          },
         },
-      },{
-            field: 'agentId',
-            component: 'ApiSelect',
-            label: '经销商名称',
-            componentProps: {
+        {
+          field: 'agentId',
+          component: 'ApiSelect',
+          label: '经销商名称',
+          componentProps: {
             filterOption: onFilterOption,
-            showSearch:true,
+            showSearch: true,
             api: async function () {
-              const {list} = await agentNewList({pageSize:1000,pageNum:1});
-              return list
+              const { list } = await agentNewList({ pageSize: 1000, pageNum: 1 });
+              return list;
             },
             // numberToString: true,
             labelField: 'name',
@@ -113,147 +115,169 @@ export default defineComponent({
               agentName: '',
             },
           },
-            colProps: {
-              span: 18,
-            },
+          colProps: {
+            span: 18,
           },
-      {
-        field: 'companyName',
-        component: 'AutoComplete',
-        label: '客户名称',
-        colProps: {
-          span: 18,
         },
-        componentProps: {
-          filterOption: onFilterOption,
-          onSearch: async (searchText: string) => {
-            const {list} = await companyList({ companyName: searchText });
-            let optionsList = list.map((ele) => { return { ...ele,value: ele.companyName }; }) || []
-            console.log('paramList',optionsList)
-            optionsName.value = optionsList || [];
-            updateSchema({
-              field: 'companyName',
-              componentProps:{
-                options: optionsName.value,
-              },
-            })
+        {
+          field: 'companyName',
+          component: 'AutoComplete',
+          label: '客户名称',
+          colProps: {
+            span: 18,
           },
-          onChange: (data) => {
-            console.log('data', data);
+          componentProps: {
+            filterOption: onFilterOption,
+            onSearch: async (searchText: string) => {
+              const { list } = await companyList({ companyName: searchText });
+              let optionsList =
+                list.map((ele) => {
+                  return { ...ele, value: ele.companyName };
+                }) || [];
+              console.log('paramList', optionsList);
+              optionsName.value = optionsList || [];
+              updateSchema({
+                field: 'companyName',
+                componentProps: {
+                  options: optionsName.value,
+                },
+              });
+            },
+            onChange: (data) => {
+              console.log('data', data);
+            },
           },
         },
-      },
-      {
-        field: 'orderSn',
-        component: 'AutoComplete',
-        label: '订单号',
-        colProps: {
-          span: 18,
+        {
+          field: 'orderSn',
+          component: 'AutoComplete',
+          label: '订单号',
+          colProps: {
+            span: 18,
+          },
+          componentProps: {
+            options: optionsOrderSn.value,
+            filterOption: onFilterOption,
+            onSearch: async (searchText: string) => {
+              const { list } = await CameraList({ orderSn: searchText });
+              optionsOrderSn.value = !searchText
+                ? []
+                : list.map((ele) => {
+                    return { value: ele.orderSn };
+                  });
+              updateSchema({
+                field: 'orderSn',
+                componentProps: {
+                  options: optionsOrderSn.value,
+                },
+              });
+            },
+            onChange: (data) => {
+              console.log('data', data);
+            },
+          },
         },
-        componentProps: {
-          options: optionsOrderSn.value,
-          filterOption: onFilterOption,
-          onSearch: async (searchText: string) => {
-            const { list } = await CameraList({ orderSn: searchText });
-            optionsOrderSn.value = !searchText ? [] : list.map((ele) => { return { value: ele.orderSn }; });
-            updateSchema({
-              field: 'orderSn',
-              componentProps:{
-                options: optionsOrderSn.value,
-              },
-            })
+        {
+          field: 'buyDate',
+          component: 'DatePicker',
+          label: '购买日期',
+          required: true,
+          defaultValue: dayjs().format('YYYY-MM-DD'),
+          colProps: {
+            span: 16,
           },
-          onChange: (data) => {
-            console.log('data', data);
+          componentProps: {
+            disabled: false,
+            valueFormat: 'YYYY-MM-DD',
+            format: 'YYYY-MM-DD',
           },
         },
-      },
-    ];
-    const [registerForm, { validate, resetFields, setFieldsValue, updateSchema }] = useForm({
-      labelWidth: 120,
-      schemas,
-      showActionButtonGroup: false,
-      actionColOptions: {
-        span: 24,
-      },
-    });
-    onMounted(() => {});
-    let addListFunc = () => {};
-    const [register, { closeModal }] = useModalInner((data) => {
-      // console.log(data);
-      data && onDataReceive(data);
-    });
-
-    function onDataReceive(data) {
-      modelRef.value = data;
-      title.value = data.isUpdate?'编辑':'设备出库'
-      console.log('onDataReceive', data);
-      const { outType } = data;
-      let obj = t('routes.product.outType')
-      resetFields();
-      // updateSchema([{field: 'agentId',ifShow:data.outType=='4',},
-      //               {field: 'companyName',ifShow:data.outType!='4',}])
-      setFieldsValue({
-        type: obj[outType],
-
-        ...data,
+      ];
+      const [registerForm, { validate, resetFields, setFieldsValue, updateSchema }] = useForm({
+        labelWidth: 120,
+        schemas,
+        showActionButtonGroup: false,
+        actionColOptions: {
+          span: 24,
+        },
+      });
+      onMounted(() => {});
+      let addListFunc = () => {};
+      const [register, { closeModal }] = useModalInner((data) => {
+        // console.log(data);
+        data && onDataReceive(data);
       });
-    }
 
-    const handleSubmit = async () => {
-      const apiUrl = modelRef.value.isUpdate?cameraUpdate:cameraOut
-      try {
-        const params = await validate();
-        console.log('params', params);
-        const res = await apiUrl({
-          ...params,
-          // companyName:params.outType == 4?'':params.companyName,
-          // agentId:params.outType != 4?'':params.agentId,
-        });
-        console.log('res', res);
-        closeModal();
+      function onDataReceive(data) {
+        modelRef.value = data;
+        title.value = data.isUpdate ? '编辑' : '设备出库';
+        console.log('onDataReceive', data);
+        const { outType } = data;
+        let obj = t('routes.product.outType');
         resetFields();
-        createMessage.success(t('common.optSuccess'));
-        emit('reload');
-      } catch (error) {
-        console.log('not passing', error);
+        // updateSchema([{field: 'agentId',ifShow:data.outType=='4',},
+        //               {field: 'companyName',ifShow:data.outType!='4',}])
+        setFieldsValue({
+          type: obj[outType],
+
+          ...data,
+        });
       }
-    };
-    function onFilterOption(inputText: string, option: Option) {
-      if(option.label){
-        return option.label.toUpperCase().indexOf(inputText.toUpperCase()) >= 0;
+
+      const handleSubmit = async () => {
+        const apiUrl = modelRef.value.isUpdate ? cameraUpdate : cameraOut;
+        try {
+          const params = await validate();
+          console.log('params', params);
+          const res = await apiUrl({
+            ...params,
+            // companyName:params.outType == 4?'':params.companyName,
+            // agentId:params.outType != 4?'':params.agentId,
+          });
+          console.log('res', res);
+          closeModal();
+          resetFields();
+          createMessage.success(t('common.optSuccess'));
+          emit('reload');
+        } catch (error) {
+          console.log('not passing', error);
+        }
+      };
+      function onFilterOption(inputText: string, option: Option) {
+        if (option.label) {
+          return option.label.toUpperCase().indexOf(inputText.toUpperCase()) >= 0;
+        }
+        return option.value.toUpperCase().indexOf(inputText.toUpperCase()) >= 0;
       }
-      return option.value.toUpperCase().indexOf(inputText.toUpperCase()) >= 0;
-    }
 
-    function handleVisibleChange(v) {
-      // console.log(v);
-      // v && props.userData && nextTick(() => onDataReceive(props.userData));
-    }
+      function handleVisibleChange(v) {
+        // console.log(v);
+        // v && props.userData && nextTick(() => onDataReceive(props.userData));
+      }
 
-    async function getTemplate() {
-      try {
-        const res = await downTemplate({ type: 2 });
-        console.log('res', res);
-      } catch (error) {
-        console.log('not passing', error);
+      async function getTemplate() {
+        try {
+          const res = await downTemplate({ type: 2 });
+          console.log('res', res);
+        } catch (error) {
+          console.log('not passing', error);
+        }
       }
-    }
-    return {
-      register,
-      schemas,
-      registerForm,
-      model: modelRef,
-      title,
-      fileFlow,
-      handleVisibleChange,
-      onFilterOption,
-      handleSubmit,
-      addListFunc,
-      resetFields,
-      t,
-      getTemplate,
-    };
-  },
-});
+      return {
+        register,
+        schemas,
+        registerForm,
+        model: modelRef,
+        title,
+        fileFlow,
+        handleVisibleChange,
+        onFilterOption,
+        handleSubmit,
+        addListFunc,
+        resetFields,
+        t,
+        getTemplate,
+      };
+    },
+  });
 </script>

+ 10 - 0
src/views/device/index.vue

@@ -159,6 +159,16 @@ import { lte } from 'lodash';
           width: 80,
         },
         {
+          title: '购买日期',
+          dataIndex: 'buyDate',
+          width: 100,
+        },
+        {
+          title: '保修届满日期',
+          dataIndex: 'warrantyDate',
+          width: 100,
+        },
+        {
           title: '绑定账号',
           dataIndex: 'userName',
           width: 180,

+ 182 - 0
src/views/empower/AddCameraModal.vue

@@ -0,0 +1,182 @@
+<template>
+  <BasicModal
+    v-bind="$attrs"
+    @register="register"
+    title="相机授权"
+    @visible-change="handleVisibleChange"
+    @cancel="resetFields"
+    @ok="handleConfirm"
+  >
+    <div class="pt-2px pr-3px zdysrk">
+      <BasicForm @register="registerForm">
+        <template #text="{ model, field }"> {{ model[field] }}{{ fileFlow.type }} </template>
+      </BasicForm>
+    </div>
+  </BasicModal>
+</template>
+<script lang="ts">
+  import { defineComponent, nextTick, onMounted, reactive, computed, h } from 'vue';
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { remarkschemas, Addschemas } from './data';
+  import { InvoiceRegister } from '/@/api/order';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import { uploadApi } from '/@/api/product/index';
+  import { ResultEnum } from '/@/enums/httpEnum';
+  import { authorizeCameraaddOrUpdate } from '/@/api/authorizeModeling';
+  import dayjs from 'dayjs';
+  import { otherInfoStore } from '/@/store/modules/other';
+
+  const { t } = useI18n();
+  export default defineComponent({
+    components: { BasicModal, BasicForm },
+    props: {
+      userData: { type: Object },
+    },
+    emits: ['update', 'register'],
+    setup(props, { emit }) {
+      const otherInfo = otherInfoStore();
+      const overviewInfo = computed(() => otherInfo.getOverviewInfo);
+      // const overviewInfo = getOverviewInfo() || {}
+      const fileFlow = reactive({
+        file: null,
+        id: '',
+        type: 'down', //down-下载,equity-权益
+      });
+      const { createMessage, createConfirm, createSuccessModal } = useMessage();
+      const schemas: FormSchema[] = [
+        {
+          field: 'id',
+          component: 'Input',
+          show: false,
+          label: 'id',
+        },
+        {
+          field: 'machineCode',
+          component: 'InputTextArea',
+          required: true,
+          componentProps: {
+            rows: 4,
+          },
+          label: '机器码',
+          colProps: { span: 20 },
+        },
+        {
+          field: 'snCodes',
+          component: 'InputTextArea',
+          required: true,
+          label: '授权SN码',
+          componentProps: {
+            placeholder: '请输入授权SN码,多个sn码换行输入',
+            rows: 4,
+          },
+          colProps: { span: 20 },
+        },
+      ];
+
+      const [registerForm, { validate, resetFields, setFieldsValue, updateSchema }] = useForm({
+        labelWidth: 120,
+        schemas: [...Addschemas, ...schemas, ...remarkschemas],
+        showActionButtonGroup: false,
+        actionColOptions: {
+          span: 24,
+        },
+      });
+      onMounted(() => {});
+      let addListFunc = () => {};
+      const [register, { closeModal }] = useModalInner((data) => {
+        data && onDataReceive(data);
+      });
+      async function onDataReceive(data) {
+        resetFields();
+        fileFlow.id = data.id;
+        updateSchema([
+          {
+            field: 'useType',
+            componentProps: {
+              onChange: (value) => {
+                updateSchema({ field: 'projectNum', ifShow: value == '4' });
+              },
+            },
+          },
+          {
+            field: 'projectNum',
+            ifShow: data.useType == '4',
+          },
+        ]);
+        setFieldsValue(data);
+      }
+      async function handleConfirm() {
+        const { id } = await validate();
+        createConfirm({
+          iconType: 'warning',
+          title: () => h('span', '温馨提示'),
+          content: () => h('span', `确定要${id ? '编辑' : '新增'}授权吗?`),
+          onOk: async () => {
+            handleSubmit();
+          },
+        });
+      }
+      const handleSubmit = async () => {
+        try {
+          const params = await validate();
+          // let authorizeTime = params.authorizeTime.split('_');
+          const apiData = {
+            ...params,
+            userId: params.id,
+            // authorizeTime: authorizeTime[0],
+            // authorizeTimeUnit: authorizeTime[1],
+          };
+          let res = await authorizeCameraaddOrUpdate(apiData);
+          let count = (res.snCodes && res.snCodes.split('\n')) || [];
+          closeModal();
+          resetFields();
+          createSuccessModal({
+            title: t('layout.setting.operatingTitle'),
+            content: h('div', {}, [
+              h('p', `安装Key:${res.authorizeKey}`),
+              h('p', `授权相机数量:${count.length}`),
+            ]),
+            okText: '复制授权Key',
+            onOk: async () => {
+              // 双击复制
+              let save = function (e) {
+                e.clipboardData.setData('text/plain', res.authorizeKey);
+                e.preventDefault(); //阻止默认行为
+              };
+              document.addEventListener('copy', save); //添加一个copy事件
+              document.execCommand('copy'); //执行copy方法
+              createMessage.success('复制成功');
+            },
+          });
+          // createMessage.success(t('common.optSuccess'));
+          emit('update');
+        } catch (error) {
+          console.log('not passing', error);
+        }
+      };
+      function handleVisibleChange(v) {
+        v && props.userData && nextTick(() => onDataReceive(props.userData));
+      }
+      return {
+        register,
+        registerForm,
+        fileFlow,
+        handleVisibleChange,
+        handleSubmit,
+        addListFunc,
+        resetFields,
+        handleConfirm,
+        t,
+      };
+    },
+  });
+</script>
+<style lang="less">
+  .zdysrk {
+    .ant-calendar-picker {
+      min-width: 285px;
+    }
+  }
+</style>

+ 185 - 0
src/views/empower/AddInstallModal.vue

@@ -0,0 +1,185 @@
+<template>
+  <BasicModal
+    v-bind="$attrs"
+    @register="register"
+    title="安装授权"
+    @visible-change="handleVisibleChange"
+    @cancel="resetFields"
+    @ok="handleConfirm"
+  >
+    <div class="pt-2px pr-3px zdysrk">
+      <BasicForm @register="registerForm">
+        <template #text="{ model, field }"> {{ model[field] }}{{ fileFlow.type }} </template>
+      </BasicForm>
+    </div>
+  </BasicModal>
+</template>
+<script lang="ts">
+  import { defineComponent, nextTick, onMounted, reactive, computed, h } from 'vue';
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { remarkschemas, Addschemas } from './data';
+  import { InvoiceRegister } from '/@/api/order';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import { uploadApi } from '/@/api/product/index';
+  import { ResultEnum } from '/@/enums/httpEnum';
+  import { authorizeInstalladdOrUpdate, checkMachineCode } from '/@/api/authorizeModeling';
+  import dayjs from 'dayjs';
+  import { otherInfoStore } from '/@/store/modules/other';
+
+  const { t } = useI18n();
+  export default defineComponent({
+    components: { BasicModal, BasicForm },
+    props: {
+      userData: { type: Object },
+    },
+    emits: ['update', 'register'],
+    setup(props, { emit }) {
+      const otherInfo = otherInfoStore();
+      const overviewInfo = computed(() => otherInfo.getOverviewInfo);
+      // const overviewInfo = getOverviewInfo() || {}
+      const fileFlow = reactive({
+        file: null,
+        id: '',
+        type: 'down', //down-下载,equity-权益
+      });
+      const { createMessage, createConfirm, createSuccessModal } = useMessage();
+      const schemas: FormSchema[] = [
+        {
+          field: 'id',
+          component: 'Input',
+          show: false,
+          label: 'id',
+        },
+        {
+          field: 'machineCode',
+          component: 'InputTextArea',
+          required: true,
+          label: '机器码',
+          componentProps: {
+            rows: 4,
+          },
+          colProps: { span: 20 },
+        },
+      ];
+
+      const [registerForm, { validate, resetFields, setFieldsValue, updateSchema }] = useForm({
+        labelWidth: 120,
+        schemas: [...Addschemas, ...schemas, ...remarkschemas],
+        showActionButtonGroup: false,
+        actionColOptions: {
+          span: 24,
+        },
+      });
+      onMounted(() => {});
+      let addListFunc = () => {};
+      const [register, { closeModal }] = useModalInner((data) => {
+        data && onDataReceive(data);
+      });
+      async function onDataReceive(data) {
+        resetFields();
+        fileFlow.id = data.id;
+        updateSchema([
+          {
+            field: 'useType',
+            componentProps: {
+              onChange: (value) => {
+                updateSchema({ field: 'projectNum', ifShow: value == '4' });
+              },
+            },
+          },
+          {
+            field: 'projectNum',
+            ifShow: data.useType == '4',
+          },
+          {
+            field: 'machineCode',
+            componentProps: {
+              disabled: data.id ? true : false,
+            },
+          },
+        ]);
+        setFieldsValue(data);
+      }
+      async function handleConfirm() {
+        const { id, machineCode } = await validate();
+        let res = await checkMachineCode({ machineCode });
+        console.log('res', res);
+        if (res && res.id) {
+          createConfirm({
+            iconType: 'warning',
+            title: () => h('span', '温馨提示'),
+            content: () => h('span', `当前设备已存在授权记录。`),
+            okText: '继续',
+            onOk: async () => {
+              handleSubmit();
+            },
+          });
+        } else {
+          createConfirm({
+            iconType: 'warning',
+            title: () => h('span', '温馨提示'),
+            content: () => h('span', `确定要${id ? '编辑' : '新增'}授权吗?`),
+            onOk: async () => {
+              handleSubmit();
+            },
+          });
+        }
+      }
+      const handleSubmit = async () => {
+        try {
+          const params = await validate();
+          console.log('validate', params);
+          const apiData = {
+            ...params,
+            userId: params.id,
+          };
+          let res = await authorizeInstalladdOrUpdate(apiData);
+          closeModal();
+          resetFields();
+          createSuccessModal({
+            title: t('layout.setting.operatingTitle'),
+            content: `安装Key:${res.authorizeKey}`,
+            okText: '复制',
+            onOk: async () => {
+              // 双击复制
+              let save = function (e) {
+                e.clipboardData.setData('text/plain', res.authorizeKey);
+                e.preventDefault(); //阻止默认行为
+              };
+              document.addEventListener('copy', save); //添加一个copy事件
+              document.execCommand('copy'); //执行copy方法
+              createMessage.success('复制成功');
+            },
+          });
+          // createMessage.success(t('common.optSuccess'));
+          emit('update');
+        } catch (error) {
+          console.log('not passing', error);
+        }
+      };
+      function handleVisibleChange(v) {
+        v && props.userData && nextTick(() => onDataReceive(props.userData));
+      }
+      return {
+        register,
+        registerForm,
+        fileFlow,
+        handleVisibleChange,
+        handleSubmit,
+        addListFunc,
+        resetFields,
+        handleConfirm,
+        t,
+      };
+    },
+  });
+</script>
+<style lang="less">
+  .zdysrk {
+    .ant-calendar-picker {
+      min-width: 285px;
+    }
+  }
+</style>

+ 193 - 0
src/views/empower/AddModal.vue

@@ -0,0 +1,193 @@
+<template>
+  <BasicModal
+    v-bind="$attrs"
+    @register="register"
+    title="本地版算法授权"
+    @visible-change="handleVisibleChange"
+    @cancel="resetFields"
+    @ok="handleConfirm"
+  >
+    <div class="pt-2px pr-3px zdysrk">
+      <BasicForm @register="registerForm">
+        <template #text="{ model, field }"> {{ model[field] }}{{ fileFlow.type }} </template>
+      </BasicForm>
+    </div>
+  </BasicModal>
+</template>
+<script lang="ts">
+  import { defineComponent, nextTick, onMounted, reactive, computed, h } from 'vue';
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { remarkschemas, Addschemas } from "./data";
+  import { InvoiceRegister } from '/@/api/order';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import { uploadApi } from '/@/api/product/index';
+  import { ResultEnum } from '/@/enums/httpEnum';
+  import { authorizeModelingaddOrUpdate } from '/@/api/authorizeModeling';
+  import dayjs from 'dayjs';
+  import { otherInfoStore } from '/@/store/modules/other';
+
+  const { t } = useI18n();
+  export default defineComponent({
+    components: { BasicModal, BasicForm },
+    props: {
+      userData: { type: Object },
+    },
+    emits: ['update', 'register'],
+    setup(props, { emit }) {
+      const otherInfo = otherInfoStore();
+      const overviewInfo = computed(() => otherInfo.getOverviewInfo);
+      // const overviewInfo = getOverviewInfo() || {}
+      const fileFlow = reactive({
+        file: null,
+        id: '',
+        type: 'down', //down-下载,equity-权益
+      });
+      const { createMessage, createConfirm } = useMessage();
+      const schemas: FormSchema[] = [
+        {
+          field: 'id',
+          component: 'Input',
+          show: false,
+          label: 'id',
+        },
+        {
+          field: 'authorizeKey',
+          component: 'Input',
+          required: true,
+          label: '授权码',
+          colProps: { span: 20 },
+        },
+        {
+          field: 'authorizeTime',
+          component: 'Select',
+          label: '授权期限',
+          required: true,
+          defaultValue: '10_1',
+          componentProps: {
+            options: [
+              {
+                label: '10天',
+                value: '10_1',
+                key: '10',
+              },
+              {
+                label: '1个月',
+                value: '1_2',
+                key: '30',
+              },
+              {
+                label: '3个月',
+                value: '3_2',
+                key: '90',
+              },
+              {
+                label: '1年',
+                value: '1_3',
+                key: '365',
+              },
+              {
+                label: '2年',
+                value: '2_3',
+                key: '730',
+              },
+              {
+                label: '3年',
+                value: '3_3',
+                key: '1095',
+              },
+            ],
+          },
+          colProps: {
+            span: 18,
+          },
+        },
+      ];
+
+      const [registerForm, { validate, resetFields, setFieldsValue, updateSchema }] = useForm({
+        labelWidth: 120,
+        schemas: [...Addschemas, ...schemas, ...remarkschemas],
+        showActionButtonGroup: false,
+        actionColOptions: {
+          span: 24,
+        },
+      });
+      onMounted(() => {});
+      let addListFunc = () => {};
+      const [register, { closeModal }] = useModalInner((data) => {
+        data && onDataReceive(data);
+      });
+      async function onDataReceive(data) {
+        resetFields();
+        fileFlow.id = data.id;
+        updateSchema([
+          {
+            field: 'useType',
+            componentProps: {
+              onChange: (value) => {
+                updateSchema({ field: 'projectNum', ifShow: value == '4' });
+              },
+            },
+          },
+          {
+            field: 'projectNum',
+            ifShow: data.useType == '4',
+          },
+        ]);
+        setFieldsValue(data);
+      }
+      async function handleConfirm() {
+        const { id } = await validate();
+        createConfirm({
+          iconType: 'warning',
+          title: () => h('span', '温馨提示'),
+          content: () => h('span', `确定要${id ? '编辑' : '新增'}授权吗?`),
+          onOk: async () => {
+            handleSubmit();
+          },
+        });
+      }
+      const handleSubmit = async () => {
+        try {
+          const params = await validate();
+          let authorizeTime = params.authorizeTime.split('_');
+          const apiData = {
+            ...params,
+            userId: params.id,
+            authorizeTime: authorizeTime[0],
+            authorizeTimeUnit: authorizeTime[1],
+          };
+          await authorizeModelingaddOrUpdate(apiData);
+          closeModal();
+          resetFields();
+          createMessage.success(t('common.optSuccess'));
+          emit('update');
+        } catch (error) {
+          console.log('not passing', error);
+        }
+      };
+      function handleVisibleChange(v) {
+        v && props.userData && nextTick(() => onDataReceive(props.userData));
+      }
+      return {
+        register,
+        registerForm,
+        fileFlow,
+        handleVisibleChange,
+        handleSubmit,
+        addListFunc,
+        resetFields,
+        handleConfirm,
+        t,
+      };
+    },
+  });
+</script>
+<style lang="less">
+  .zdysrk {
+    .ant-calendar-picker {
+      min-width: 285px;
+    }
+  }
+</style>

+ 250 - 0
src/views/empower/algorithm.vue

@@ -0,0 +1,250 @@
+<template>
+  <div>
+    <BasicTable @register="registerTable">
+      <template #toolbar>
+        <a-button type="primary" @click="handleEdit" v-if="getCheckPerm('dealer-export')"
+          >授权</a-button
+        >
+      </template>
+      <template #action="{ record }">
+        <TableAction
+          :actions="[
+            {
+              label: '编辑',
+              //ifShow: getCheckPerm('account-equityEdit'),
+              onClick: handleEdit.bind(null, record),
+            },
+            {
+              label: '删除',
+              color: 'error',
+              //ifShow: getCheckPerm('account-equityDelete'),
+              onClick: handleDelete.bind(null, record),
+            },
+          ]"
+        />
+      </template>
+    </BasicTable>
+    <AddModal @register="register" @update="reload" />
+  </div>
+</template>
+<script lang="ts">
+  import { defineComponent, h } from 'vue';
+  import {
+    BasicTable,
+    useTable,
+    TableAction,
+    BasicColumn,
+    TableImg,
+    FormProps,
+  } from '/@/components/Table';
+  import {
+    authorizeModelingList,
+    authorizeModelingaddOrUpdate,
+    authorizeModelingdelete,
+  } from '/@/api/authorizeModeling';
+  import { useModal } from '/@/components/Modal';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import AddModal from './AddModal.vue';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { usePermissionStore } from '/@/store/modules/permission';
+  import { incrementUseTypeList } from '/@/api/account';
+  export default defineComponent({
+    components: {
+      BasicTable,
+      AddModal,
+      TableAction,
+      TableImg,
+    },
+    setup() {
+      const { t } = useI18n();
+      const { createMessage, createConfirm } = useMessage();
+      const permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
+      const [register, { openModal }] = useModal();
+      const columns: BasicColumn[] = [
+        {
+          title: '客户名称',
+          dataIndex: 'customerName',
+          ellipsis: true,
+          width: 250,
+        },
+        {
+          title: '客户类别',
+          dataIndex: 'customerType',
+          ellipsis: true,
+          width: 80,
+          customRender: ({ record }) => {
+            return record.customerType == 1 ? '经销' : '直销';
+          },
+        },
+        {
+          title: '终端客户',
+          ellipsis: true,
+          dataIndex: 'endCustomer',
+          width: 120,
+        },
+        {
+          title: '使用类型',
+          ellipsis: true,
+          dataIndex: 'useTypeStr',
+          width: 120,
+        },
+        {
+          title: '项目号',
+          ellipsis: true,
+          dataIndex: 'projectNum',
+          width: 120,
+        },
+        {
+          title: '算法授权Key',
+          ellipsis: true,
+          dataIndex: 'authorizeKey',
+          width: 120,
+        },
+        {
+          title: '授权期限',
+          ellipsis: true,
+          dataIndex: 'authorizeTime',
+          width: 120,
+          customRender: ({ record }) => {
+            let obj = {
+              1: '天',
+              2: '个月',
+              3: '年',
+            };
+            return record.authorizeTime + obj[record.authorizeTimeUnit];
+          },
+        },
+        {
+          title: '授权说明',
+          ellipsis: true,
+          dataIndex: 'remark',
+          width: 120,
+        },
+        {
+          title: '创建人',
+          ellipsis: true,
+          dataIndex: 'sysUserName',
+          width: 120,
+        },
+        {
+          title: '创建时间',
+          ellipsis: true,
+          dataIndex: 'createTime',
+          width: 160,
+        },
+      ];
+      const searchForm: Partial<FormProps> = {
+        labelWidth: 100,
+        autoSubmitOnEnter: true,
+        schemas: [
+          {
+            field: 'customerName',
+            label: '客户名称',
+            component: 'Input',
+            colProps: {
+              xl: 8,
+              xxl: 8,
+            },
+          },
+          {
+            field: 'customerType',
+            label: '客户类别',
+            component: 'Select',
+            componentProps: {
+              options: [
+                {
+                  label: '直销',
+                  value: 0,
+                  key: '0',
+                },
+                {
+                  label: '经销',
+                  value: 1,
+                  key: '1',
+                },
+              ],
+            },
+            colProps: {
+              xl: 8,
+              xxl: 8,
+            },
+          },
+          {
+            field: 'useType',
+            label: '使用类型',
+            component: 'ApiSelect',
+            componentProps: {
+              api: incrementUseTypeList,
+              labelField: 'name',
+              valueField: 'id',
+              immediate: true,
+            },
+            colProps: {
+              xl: 8,
+              xxl: 8,
+            },
+          },
+          {
+            field: 'authorizeKey',
+            label: '算法授权Key',
+            component: 'Input',
+            colProps: {
+              xl: 8,
+              xxl: 8,
+            },
+          },
+        ],
+      };
+      const [registerTable, { reload }] = useTable({
+        api: authorizeModelingList,
+        title: '算法授权列表',
+        columns: columns,
+        useSearchForm: true,
+        formConfig: searchForm,
+        showTableSetting: true,
+        showIndexColumn: false,
+        fetchSetting: {
+          pageField: 'pageNum',
+          sizeField: 'pageSize',
+          listField: 'list',
+          totalField: 'total',
+        },
+        actionColumn: {
+          width: 100,
+          title: '操作',
+          dataIndex: 'action',
+          slots: { customRender: 'action' },
+        },
+        rowKey: 'id',
+        canResize: true,
+      });
+      async function handleDelete(record) {
+        createConfirm({
+          iconType: 'warning',
+          title: () => h('span', '温馨提示'),
+          content: () => h('span', '确定要删除授权吗?'),
+          onOk: async () => {
+            await authorizeModelingdelete({ id: record.id });
+            reload();
+            createMessage.success(t('common.optSuccess'));
+          },
+        });
+      }
+      function handleEdit(record = {}) {
+        openModal(true, {
+          ...record,
+          authorizeTime:`${record.authorizeTime || '10'}_${record.authorizeTimeUnit || '1'}`
+        });
+      }
+      return {
+        registerTable,
+        handleDelete,
+        reload,
+        register,
+        getCheckPerm,
+        handleEdit,
+      };
+    },
+  });
+</script>

+ 271 - 0
src/views/empower/camera.vue

@@ -0,0 +1,271 @@
+<template>
+  <div>
+    <BasicTable @register="registerTable">
+      <template #toolbar>
+        <a-button type="primary" @click="handleEdit" v-if="getCheckPerm('dealer-export')"
+          >授权</a-button
+        >
+      </template>
+      <template #action="{ record }">
+        <TableAction
+          :actions="[
+            {
+              label: '详情',
+              //ifShow: getCheckPerm('account-equityEdit'),
+              onClick: handleDetail.bind(null, record),
+            },
+            {
+              label: '编辑',
+              //ifShow: getCheckPerm('account-equityEdit'),
+              onClick: handleEdit.bind(null, record),
+            },
+            {
+              label: '删除',
+              color: 'error',
+              //ifShow: getCheckPerm('account-equityDelete'),
+              onClick: handleDelete.bind(null, record),
+            },
+          ]"
+        />
+      </template>
+    </BasicTable>
+    <AddModal @register="register" @update="reload" />
+    <DetailModal @register="registerDetail" @update="reload" />
+  </div>
+</template>
+<script lang="ts">
+  import { defineComponent, h } from 'vue';
+  import {
+    BasicTable,
+    useTable,
+    TableAction,
+    BasicColumn,
+    FormProps,
+  } from '/@/components/Table';
+  import {
+    authorizeCameraList,
+    authorizeCameradelete,
+  } from '/@/api/authorizeModeling';
+  import { useModal } from '/@/components/Modal';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import AddModal from './AddCameraModal.vue';
+  import DetailModal from './detailModel.vue';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { usePermissionStore } from '/@/store/modules/permission';
+  import { incrementUseTypeList } from '/@/api/account';
+  export default defineComponent({
+    components: {
+      BasicTable,
+      AddModal,
+      TableAction,
+      DetailModal,
+    },
+    setup() {
+      const { t } = useI18n();
+      const { createMessage, createConfirm } = useMessage();
+      const permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
+      const [register, { openModal }] = useModal();
+      const [registerDetail, { openModal: opendetailModel }] = useModal();
+      const columns: BasicColumn[] = [
+        {
+          title: '客户名称',
+          dataIndex: 'customerName',
+          ellipsis: true,
+          width: 250,
+        },
+        {
+          title: '客户类别',
+          dataIndex: 'customerType',
+          ellipsis: true,
+          width: 80,
+          customRender: ({ record }) => {
+            return record.customerType == 1 ? '经销' : '直销';
+          },
+        },
+        {
+          title: '终端客户',
+          ellipsis: true,
+          dataIndex: 'endCustomer',
+          width: 120,
+        },
+        {
+          title: '使用类型',
+          ellipsis: true,
+          dataIndex: 'useType',
+          width: 120,
+        },
+        {
+          title: '项目号',
+          ellipsis: true,
+          dataIndex: 'projectNum',
+          width: 120,
+        },
+        {
+          title: '设备UUID',
+          ellipsis: true,
+          dataIndex: 'machineUuid',
+          width: 120,
+        },
+        {
+          title: '设备名称',
+          ellipsis: true,
+          dataIndex: 'machineName',
+          width: 120,
+        },
+        {
+          title: '相机授权Key',
+          ellipsis: true,
+          dataIndex: 'authorizeKey',
+          width: 120,
+        },
+        {
+          title: '授权相机数量',
+          ellipsis: true,
+          dataIndex: 'machineCode',
+          width: 120,
+        },
+        {
+          title: '备注',
+          ellipsis: true,
+          dataIndex: 'remark',
+          width: 120,
+        },
+        {
+          title: '创建人',
+          ellipsis: true,
+          dataIndex: 'sysUserName',
+          width: 120,
+        },
+        {
+          title: '创建时间',
+          ellipsis: true,
+          dataIndex: 'createTime',
+          width: 160,
+        },
+      ];
+      const searchForm: Partial<FormProps> = {
+        labelWidth: 100,
+        autoSubmitOnEnter: true,
+        schemas: [
+          {
+            field: 'customerName',
+            label: '客户名称',
+            component: 'Input',
+            colProps: {
+              xl: 8,
+              xxl: 8,
+            },
+          },
+          {
+            field: 'customerType',
+            label: '客户类别',
+            component: 'Select',
+            componentProps: {
+              options: [
+                {
+                  label: '直销',
+                  value: 0,
+                  key: '0',
+                },
+                {
+                  label: '经销',
+                  value: 1,
+                  key: '1',
+                },
+              ],
+            },
+            colProps: {
+              xl: 8,
+              xxl: 8,
+            },
+          },
+          {
+            field: 'useType',
+            label: '使用类型',
+            component: 'ApiSelect',
+            componentProps: {
+              api: incrementUseTypeList,
+              labelField: 'name',
+              valueField: 'id',
+              immediate: true,
+            },
+            colProps: {
+              xl: 8,
+              xxl: 8,
+            },
+          },
+          {
+            field: 'machineUuid',
+            label: '设备UUID',
+            component: 'Input',
+            colProps: {
+              xl: 8,
+              xxl: 8,
+            },
+          },
+          {
+            field: 'machineCode',
+            label: '安装授权Key',
+            component: 'Input',
+            colProps: {
+              xl: 8,
+              xxl: 8,
+            },
+          },
+        ],
+      };
+      const [registerTable, { reload }] = useTable({
+        api: authorizeCameraList,
+        title: '深时本地版相机授权',
+        columns: columns,
+        useSearchForm: true,
+        formConfig: searchForm,
+        showTableSetting: true,
+        showIndexColumn: false,
+        fetchSetting: {
+          pageField: 'pageNum',
+          sizeField: 'pageSize',
+          listField: 'list',
+          totalField: 'total',
+        },
+        actionColumn: {
+          width: 150,
+          title: '操作',
+          dataIndex: 'action',
+          slots: { customRender: 'action' },
+        },
+        rowKey: 'id',
+        canResize: true,
+      });
+      async function handleDelete(record) {
+        createConfirm({
+          iconType: 'warning',
+          title: () => h('span', '温馨提示'),
+          content: () => h('span', '确定要删除授权吗?'),
+          onOk: async () => {
+            await authorizeCameradelete({ id: record.id });
+            reload();
+            createMessage.success(t('common.optSuccess'));
+          },
+        });
+      }
+      function handleEdit(record = {}) {
+        openModal(true, record);
+      }
+      function handleDetail(record = {}) {
+        opendetailModel(true, record);
+      }
+      return {
+        registerTable,
+        handleDelete,
+        reload,
+        register,
+        registerDetail,
+        getCheckPerm,
+        handleEdit,
+        handleDetail,
+      };
+    },
+  });
+</script>

+ 77 - 0
src/views/empower/data.ts

@@ -0,0 +1,77 @@
+import { FormSchema } from '/@/components/Form/index';
+import { incrementUseTypeList } from '/@/api/account';
+
+// 基础设置 form
+export const remarkschemas: FormSchema[] = [
+  {
+    field: 'remark',
+    component: 'InputTextArea',
+    label: '备注',
+    componentProps: {
+      placeholder: '请输入钉钉审批单号',
+      rows: 4,
+    },
+    colProps: { span: 20 },
+  },
+];
+export const Addschemas: FormSchema[] = [
+  {
+    field: 'customerName',
+    component: 'Input',
+    label: '客户名称',
+    required: true,
+    colProps: { span: 20 },
+  },
+  {
+    field: 'customerType',
+    component: 'Select',
+    label: '客户类别',
+    required: true,
+    colProps: { span: 20 },
+    componentProps: {
+      options: [
+        {
+          label: '直销',
+          value: 0,
+          key: '0',
+        },
+        {
+          label: '经销',
+          value: 1,
+          key: '1',
+        },
+      ],
+    },
+  },
+  {
+    field: 'endCustomer',
+    component: 'Input',
+    label: '终端客户',
+    required: true,
+    colProps: { span: 20 },
+  },
+  {
+    field: 'useType',
+    component: 'ApiSelect',
+    required: true,
+    label: '使用类型',
+    componentProps: {
+      // filterOption: onFilterOption,
+      // showSearch: true,
+      api: incrementUseTypeList,
+      labelField: 'name',
+      valueField: 'id',
+      immediate: true,
+    },
+    colProps: {
+      span: 18,
+    },
+  },
+  {
+    field: 'projectNum',
+    component: 'Input',
+    label: '项目号',
+    required: true,
+    colProps: { span: 20 },
+  },
+];

+ 161 - 0
src/views/empower/detailModel.vue

@@ -0,0 +1,161 @@
+<template>
+  <div>
+    <BasicModal
+      v-bind="$attrs"
+      @register="register"
+      title="授权详情"
+      :width="800"
+      @visible-change="handleVisibleChange"
+      @ok="handleSubmit"
+    >
+      <div class="pt-3px pr-3px">
+        <div class="table_list">
+          <BasicTable @register="registerSubtable">
+            <template #toolbar>
+              <a-button type="primary" @click="handllogList">更换记录</a-button>
+            </template>
+            <template #action="{ record }">
+              <TableAction
+                :actions="[
+                  {
+                    label: '更换',
+                    onClick: handleUpdataSn.bind(null, record, 'edit'),
+                  },
+                ]"
+              />
+            </template>
+          </BasicTable>
+        </div>
+      </div>
+    </BasicModal>
+    <AddModal @register="registerupdata" @update="reload" />
+    <AddListModal @register="registerList" @update="reload" />
+  </div>
+</template>
+<script lang="ts">
+  import { defineComponent, nextTick, onMounted, reactive, computed, h, ref } from 'vue';
+  import { BasicTable, useTable, BasicColumn, TableAction } from '/@/components/Table';
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import { BasicForm } from '/@/components/Form/index';
+  import { Time } from '/@/components/Time';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import AddModal from './uploadModal.vue';
+  import AddListModal from './logListModal.vue';
+  import { authorizeCameradetail } from '/@/api/authorizeModeling';
+  import { GetCameraDetailApi, UnbindCameraApi } from '/@/api/account';
+  import { otherInfoStore } from '/@/store/modules/other';
+  import { DetailsApi, IncrementDelayApi } from '/@/api/account';
+  import { usePermissionStore } from '/@/store/modules/permission';
+  import { useModal } from '/@/components/Modal';
+
+  const { t } = useI18n();
+  export default defineComponent({
+    components: { BasicModal, BasicForm, BasicTable, TableAction, AddModal, AddListModal },
+    props: {
+      userData: { type: Object },
+    },
+    emits: ['update'],
+    setup(props, { emit }) {
+      const otherInfo = otherInfoStore();
+      const overviewInfo = computed(() => otherInfo.getOverviewInfo);
+      const { createMessage, createConfirm } = useMessage();
+      const [registerupdata, { openModal: openSnModal }] = useModal();
+      const [registerList, { openModal }] = useModal();
+      const permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
+      console.log('overviewInfo', overviewInfo);
+      // const overviewInfo = getOverviewInfo() || {}
+      const id = ref('');
+      const fileFlow = reactive({
+        file: null,
+        id: '',
+        type: 'down', //down-下载,equity-权益
+      });
+      const columns: BasicColumn[] = [
+        {
+          title: '相机类型',
+          dataIndex: 'cameraType',
+          width: 120,
+          // customRender: ({ record }) => {
+          //   return t(`routes.devices.cameraName.${record.cameraType}`);
+          // },
+        },
+        {
+          title: 'SN码',
+          dataIndex: 'snCode',
+          width: 150,
+        },
+        {
+          title: t('common.operating'),
+          dataIndex: 'action',
+          ifShow: getCheckPerm('account-equityCameraUnbind'),
+          slots: { customRender: 'action' },
+          align: 'center',
+          fixed: 'right',
+          width: 30,
+        },
+      ];
+      const [registerSubtable, { reload }] = useTable({
+        title: `授权相机列表`,
+        searchInfo: {
+          userId: overviewInfo.value?.id,
+        },
+        api: () => {
+          return authorizeCameradetail(id.value);
+        },
+        columns: columns,
+        immediate: false,
+        rowKey: 'id',
+        fetchSetting: {
+          pageField: 'pageNum',
+          sizeField: 'pageSize',
+          listField: 'list',
+          totalField: 'total',
+        },
+        showIndexColumn: false,
+        canResize: true,
+        bordered: true,
+      });
+
+      onMounted(() => {});
+      let addListFunc = () => {};
+      const [register, { closeModal }] = useModalInner((data) => {
+        data && onDataReceive(data);
+      });
+      function onDataReceive(data) {
+        console.log('onDataReceive', data.id);
+        id.value = data.id;
+        fileFlow.id = data.id;
+        reload();
+      }
+      function handllogList() {
+        openModal(true, { id: id.value });
+      }
+      async function handleUpdataSn(record: Recordable) {
+        openSnModal(true, { id: id.value, oldSnCode: record.snCode });
+      }
+      const handleSubmit = async () => {
+        closeModal();
+        emit('update');
+      };
+      function handleVisibleChange(v) {
+        v && props.userData && nextTick(() => onDataReceive(props.userData));
+      }
+      return {
+        register,
+        registerList,
+        registerupdata,
+        fileFlow,
+        handleVisibleChange,
+        handleSubmit,
+        addListFunc,
+        registerSubtable,
+        reload,
+        handleUpdataSn,
+        handllogList,
+        t,
+      };
+    },
+  });
+</script>

+ 251 - 0
src/views/empower/install.vue

@@ -0,0 +1,251 @@
+<template>
+  <div>
+    <BasicTable @register="registerTable">
+      <template #toolbar>
+        <a-button type="primary" @click="handleEdit" v-if="getCheckPerm('dealer-export')"
+          >授权</a-button
+        >
+      </template>
+      <template #action="{ record }">
+        <TableAction
+          :actions="[
+            {
+              label: '编辑',
+              //ifShow: getCheckPerm('account-equityEdit'),
+              onClick: handleEdit.bind(null, record),
+            },
+            {
+              label: '删除',
+              color: 'error',
+              //ifShow: getCheckPerm('account-equityDelete'),
+              onClick: handleDelete.bind(null, record),
+            },
+          ]"
+        />
+      </template>
+    </BasicTable>
+    <AddModal @register="register" @update="reload" />
+  </div>
+</template>
+<script lang="ts">
+  import { defineComponent, h } from 'vue';
+  import {
+    BasicTable,
+    useTable,
+    TableAction,
+    BasicColumn,
+    FormProps,
+  } from '/@/components/Table';
+  import {
+    authorizeInstallList,
+    authorizeInstalldelete,
+  } from '/@/api/authorizeModeling';
+  import { useModal } from '/@/components/Modal';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import AddModal from './AddInstallModal.vue';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { usePermissionStore } from '/@/store/modules/permission';
+  import { incrementUseTypeList } from '/@/api/account';
+  export default defineComponent({
+    components: {
+      BasicTable,
+      AddModal,
+      TableAction,
+    },
+    setup() {
+      const { t } = useI18n();
+      const { createMessage, createConfirm } = useMessage();
+      const permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
+      const [register, { openModal }] = useModal();
+      const columns: BasicColumn[] = [
+        {
+          title: '客户名称',
+          dataIndex: 'customerName',
+          ellipsis: true,
+          width: 250,
+        },
+        {
+          title: '客户类别',
+          dataIndex: 'customerType',
+          ellipsis: true,
+          width: 80,
+          customRender: ({ record }) => {
+            return record.customerType == 1 ? '经销' : '直销';
+          },
+        },
+        {
+          title: '终端客户',
+          ellipsis: true,
+          dataIndex: 'endCustomer',
+          width: 120,
+        },
+        {
+          title: '使用类型',
+          ellipsis: true,
+          dataIndex: 'useType',
+          width: 120,
+        },
+        {
+          title: '项目号',
+          ellipsis: true,
+          dataIndex: 'projectNum',
+          width: 120,
+        },
+        {
+          title: '设备UUID',
+          ellipsis: true,
+          dataIndex: 'machineUuid',
+          width: 120,
+        },
+        {
+          title: '设备名称',
+          ellipsis: true,
+          dataIndex: 'machineName',
+          width: 120,
+        },
+        {
+          title: '安装Key',
+          ellipsis: true,
+          dataIndex: 'authorizeKey',
+          width: 120,
+        },
+        {
+          title: '备注',
+          ellipsis: true,
+          dataIndex: 'authorizeTime',
+          width: 120,
+        },
+        {
+          title: '创建人',
+          ellipsis: true,
+          dataIndex: 'sysUserName',
+          width: 120,
+        },
+        {
+          title: '创建时间',
+          ellipsis: true,
+          dataIndex: 'createTime',
+          width: 160,
+        },
+      ];
+      const searchForm: Partial<FormProps> = {
+        labelWidth: 100,
+        autoSubmitOnEnter: true,
+        schemas: [
+          {
+            field: 'customerName',
+            label: '客户名称',
+            component: 'Input',
+            colProps: {
+              xl: 8,
+              xxl: 8,
+            },
+          },
+          {
+            field: 'customerType',
+            label: '客户类别',
+            component: 'Select',
+            componentProps: {
+              options: [
+                {
+                  label: '直销',
+                  value: 0,
+                  key: '0',
+                },
+                {
+                  label: '经销',
+                  value: 1,
+                  key: '1',
+                },
+              ],
+            },
+            colProps: {
+              xl: 8,
+              xxl: 8,
+            },
+          },
+          {
+            field: 'useType',
+            label: '使用类型',
+            component: 'ApiSelect',
+            componentProps: {
+              api: incrementUseTypeList,
+              labelField: 'name',
+              valueField: 'id',
+              immediate: true,
+            },
+            colProps: {
+              xl: 8,
+              xxl: 8,
+            },
+          },
+          {
+            field: 'machineUuid',
+            label: '设备UUID',
+            component: 'Input',
+            colProps: {
+              xl: 8,
+              xxl: 8,
+            },
+          },
+          {
+            field: 'machineCode',
+            label: '安装授权Key',
+            component: 'Input',
+            colProps: {
+              xl: 8,
+              xxl: 8,
+            },
+          },
+        ],
+      };
+      const [registerTable, { reload }] = useTable({
+        api: authorizeInstallList,
+        title: '本地版安装授权',
+        columns: columns,
+        useSearchForm: true,
+        formConfig: searchForm,
+        showTableSetting: true,
+        showIndexColumn: false,
+        fetchSetting: {
+          pageField: 'pageNum',
+          sizeField: 'pageSize',
+          listField: 'list',
+          totalField: 'total',
+        },
+        actionColumn: {
+          width: 100,
+          title: '操作',
+          dataIndex: 'action',
+          slots: { customRender: 'action' },
+        },
+        rowKey: 'id',
+        canResize: true,
+      });
+      async function handleDelete(record) {
+        createConfirm({
+          iconType: 'warning',
+          title: () => h('span', '温馨提示'),
+          content: () => h('span', '确定要删除授权吗?'),
+          onOk: async () => {
+            await authorizeInstalldelete({ id: record.id });
+            reload();
+            createMessage.success(t('common.optSuccess'));
+          },
+        });
+      }
+      function handleEdit(record = {}) {
+        openModal(true, record);
+      }
+      return {
+        registerTable,
+        handleDelete,
+        reload,
+        register,
+        getCheckPerm,
+        handleEdit,
+      };
+    },
+  });
+</script>

+ 132 - 0
src/views/empower/logListModal.vue

@@ -0,0 +1,132 @@
+<template>
+  <BasicModal
+    v-bind="$attrs"
+    @register="register"
+    title="更换记录"
+    :width="800"
+    @visible-change="handleVisibleChange"
+  >
+    <BasicTable @register="registerSubtable"></BasicTable>
+  </BasicModal>
+</template>
+<script lang="ts">
+  import { defineComponent, nextTick, onMounted, reactive, computed, h, ref } from 'vue';
+  import { BasicTable, useTable, BasicColumn, TableAction } from '/@/components/Table';
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import { BasicForm } from '/@/components/Form/index';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { authorizeCamerasnUpdateLog } from '/@/api/authorizeModeling';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import { GetCameraDetailApi, UnbindCameraApi } from '/@/api/account';
+  import { otherInfoStore } from '/@/store/modules/other';
+  import { DetailsApi, IncrementDelayApi } from '/@/api/account';
+  import { usePermissionStore } from '/@/store/modules/permission';
+  import { useModal } from '/@/components/Modal';
+
+  const { t } = useI18n();
+  export default defineComponent({
+    components: { BasicModal, BasicForm, BasicTable, TableAction },
+    props: {
+      userData: { type: Object },
+    },
+    emits: ['update'],
+    setup(props, { emit }) {
+      const otherInfo = otherInfoStore();
+      const overviewInfo = computed(() => otherInfo.getOverviewInfo);
+      const { createMessage, createConfirm } = useMessage();
+      const [registerList, { openModal }] = useModal();
+      const permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
+      console.log('overviewInfo', overviewInfo);
+      // const overviewInfo = getOverviewInfo() || {}
+      const id = ref('');
+      const fileFlow = reactive({
+        file: null,
+        id: '',
+        type: 'down', //down-下载,equity-权益
+      });
+      const columns: BasicColumn[] = [
+        {
+          title: '原SN码',
+          dataIndex: 'oldSnCode',
+          width: 120,
+        },
+        {
+          title: '新SN码',
+          dataIndex: 'newSnCode',
+          width: 150,
+        },
+        {
+          title: '更换Key',
+          dataIndex: 'updateAuthorizeKey',
+          width: 150,
+        },
+        {
+          title: '操作时间',
+          dataIndex: 'updateTime',
+          width: 150,
+        },
+      ];
+      const [registerSubtable, { reload }] = useTable({
+        api: () => {
+          return authorizeCamerasnUpdateLog(id.value);
+        },
+        columns: columns,
+        immediate: false,
+        rowKey: 'id',
+        fetchSetting: {
+          pageField: 'pageNum',
+          sizeField: 'pageSize',
+          listField: 'data',
+          totalField: 'total',
+        },
+        pagination: false,
+        canResize: true,
+        bordered: true,
+      });
+
+      onMounted(() => {});
+      let addListFunc = () => {};
+      const [register, { closeModal }] = useModalInner((data) => {
+        data && onDataReceive(data);
+      });
+      function onDataReceive(data) {
+        console.log('onDataReceive', data);
+        fileFlow.id = data.id;
+        id.value = data.id;
+        reload();
+      }
+      async function handleDelete(record: Recordable) {
+        createConfirm({
+          iconType: 'warning',
+          title: () => h('span', '温馨提示'),
+          content: () => h('span', `您确定解绑该相机!`),
+          onOk: async () => {
+            await await UnbindCameraApi({ cameraId: record.id });
+            createMessage.success(t('common.optSuccess'));
+            reload();
+          },
+        });
+      }
+      const handleSubmit = async () => {
+        closeModal();
+        emit('update');
+      };
+      function handleVisibleChange(v) {
+        v && props.userData && nextTick(() => onDataReceive(props.userData));
+      }
+      return {
+        register,
+        registerList,
+        fileFlow,
+        handleVisibleChange,
+        handleSubmit,
+        addListFunc,
+        registerSubtable,
+        reload,
+        handleDelete,
+        t,
+      };
+    },
+  });
+</script>

+ 148 - 0
src/views/empower/uploadModal.vue

@@ -0,0 +1,148 @@
+<template>
+  <BasicModal
+    v-bind="$attrs"
+    @register="register"
+    title="更换SN码"
+    @visible-change="handleVisibleChange"
+    @cancel="resetFields"
+    @ok="handleSubmit"
+  >
+    <div class="pt-2px pr-3px zdysrk">
+      <BasicForm @register="registerForm">
+        <template #text="{ model, field }"> {{ model[field] }} </template>
+      </BasicForm>
+    </div>
+  </BasicModal>
+</template>
+<script lang="ts">
+  import { defineComponent, nextTick, onMounted, reactive, computed, h } from 'vue';
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { authorizeCameraupdateSnCode } from '/@/api/authorizeModeling';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import { uploadApi } from '/@/api/product/index';
+  import { ResultEnum } from '/@/enums/httpEnum';
+  import { authorizeModelingaddOrUpdate } from '/@/api/authorizeModeling';
+  import dayjs from 'dayjs';
+  import { otherInfoStore } from '/@/store/modules/other';
+
+  const { t } = useI18n();
+  export default defineComponent({
+    components: { BasicModal, BasicForm },
+    props: {
+      userData: { type: Object },
+    },
+    emits: ['update', 'register'],
+    setup(props, { emit }) {
+      const otherInfo = otherInfoStore();
+      const overviewInfo = computed(() => otherInfo.getOverviewInfo);
+      // const overviewInfo = getOverviewInfo() || {}
+      const fileFlow = reactive({
+        file: null,
+        id: '',
+        type: 'down', //down-下载,equity-权益
+      });
+      const { createMessage, createConfirm, createSuccessModal } = useMessage();
+      const schemas: FormSchema[] = [
+        {
+          field: 'id',
+          component: 'Input',
+          show: false,
+          label: 'id',
+        },
+        {
+          field: 'oldSnCode',
+          component: 'Input',
+          slot: 'text',
+          label: '原SN码',
+          colProps: { span: 20 },
+        },
+        {
+          field: 'snCode',
+          component: 'Input',
+          label: '新SN码',
+          colProps: { span: 20 },
+        },
+      ];
+
+      const [registerForm, { validate, resetFields, setFieldsValue, updateSchema }] = useForm({
+        labelWidth: 120,
+        schemas: schemas,
+        showActionButtonGroup: false,
+        actionColOptions: {
+          span: 24,
+        },
+      });
+      onMounted(() => {});
+      let addListFunc = () => {};
+      const [register, { closeModal }] = useModalInner((data) => {
+        data && onDataReceive(data);
+      });
+      async function onDataReceive(data) {
+        resetFields();
+        fileFlow.id = data.id;
+        setFieldsValue(data);
+      }
+      async function handleConfirm() {
+        const { id } = await validate();
+        createConfirm({
+          iconType: 'warning',
+          title: () => h('span', '温馨提示'),
+          content: () => h('span', `确定要${id ? '编辑' : '新增'}授权吗?`),
+          onOk: async () => {
+            handleSubmit();
+          },
+        });
+      }
+      const handleSubmit = async () => {
+        try {
+          const params = await validate();
+          let res = await authorizeCameraupdateSnCode(params);
+          closeModal();
+          resetFields();
+          createSuccessModal({
+            title: t('layout.setting.operatingTitle'),
+            content: `安装Key:${res.updateAuthorizeKey}`,
+            okText: '复制',
+            onOk: async () => {
+              // 双击复制
+              let save = function (e) {
+                e.clipboardData.setData('text/plain', res.updateAuthorizeKey);
+                e.preventDefault(); //阻止默认行为
+              };
+              document.addEventListener('copy', save); //添加一个copy事件
+              document.execCommand('copy'); //执行copy方法
+              createMessage.success('复制成功');
+            },
+          });
+          // createMessage.success(t('common.optSuccess'));
+          emit('update');
+        } catch (error) {
+          console.log('not passing', error);
+        }
+      };
+      function handleVisibleChange(v) {
+        v && props.userData && nextTick(() => onDataReceive(props.userData));
+      }
+      return {
+        register,
+        registerForm,
+        fileFlow,
+        handleVisibleChange,
+        handleSubmit,
+        addListFunc,
+        resetFields,
+        handleConfirm,
+        t,
+      };
+    },
+  });
+</script>
+<style lang="less">
+  .zdysrk {
+    .ant-calendar-picker {
+      min-width: 285px;
+    }
+  }
+</style>

+ 2 - 2
src/views/order/cameraList.vue

@@ -80,7 +80,7 @@ import { Switch } from 'ant-design-vue';
 import { downloadByData } from '/@/utils/file/download';
 import { CameraList, CameraItem, CameraExport } from '/@/api/order';
 import { usePermissionStore } from '/@/store/modules/permission';
-import { cameraColumns, equitySearchForm } from '../account/details/data';
+import { cameraColumns, orderSearchForm } from '../account/details/data';
 
 export default defineComponent({
   components: {
@@ -104,7 +104,7 @@ export default defineComponent({
       // titleHelpMessage: ['已启用expandRowByClick', '已启用stopButtonPropagation'],
       columns: cameraColumns,
       useSearchForm: true,
-      formConfig: equitySearchForm,
+      formConfig: orderSearchForm,
       showIndexColumn: false,
       showTableSetting: true,
       canResize: true,

+ 58 - 49
src/views/order/downloadList.vue

@@ -1,50 +1,59 @@
 <template>
-    <BasicTable @register="registerTable">
-      <template #toolbar>
-        <a-button type="primary" @click="exportExcel" v-if="getCheckPerm('download-order-export')"> 导出</a-button>
-      </template>
-      <template #bodyCell="{ column, record }">
-        <template v-if="column.key === 'action'">
-          <TableAction
-            stopButtonPropagation
-            :actions="[
-              {
-                label: '删除',
-                //icon: 'ic:outline-delete-outline',
-                onClick: handleDelete.bind(null, record),
-              },
-            ]"
-            :dropDownActions="[
-              {
-                label: '启用',
-                popConfirm: {
-                  title: '是否启用?',
-                  confirm: handleOpen.bind(null, record),
-                },
+  <BasicTable @register="registerTable">
+    <template #toolbar>
+      <a-button type="primary" @click="exportExcel" v-if="getCheckPerm('download-order-export')">
+        导出</a-button
+      >
+    </template>
+    <template #bodyCell="{ column, record }">
+      <template v-if="column.key === 'action'">
+        <TableAction
+          stopButtonPropagation
+          :actions="[
+            {
+              label: '删除',
+              //icon: 'ic:outline-delete-outline',
+              onClick: handleDelete.bind(null, record),
+            },
+          ]"
+          :dropDownActions="[
+            {
+              label: '启用',
+              popConfirm: {
+                title: '是否启用?',
+                confirm: handleOpen.bind(null, record),
               },
-            ]"
-          />
-        </template>
+            },
+          ]"
+        />
       </template>
-    </BasicTable>
+    </template>
+  </BasicTable>
 </template>
 <script lang="ts">
   import { defineComponent, h, ref } from 'vue';
-  import { BasicTable, useTable, TableAction, BasicColumn, TableImg, FormProps } from '/@/components/Table';
+  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 { DownList,DownExport } from '/@/api/order'
-  import {  downloadByData, } from '/@/utils/file/download';
+  import { DownList, DownExport } from '/@/api/order';
+  import { downloadByData } from '/@/utils/file/download';
   import { usePermissionStore } from '/@/store/modules/permission';
-  import { dowmColumns,equitySearchForm } from '../account/details/data'
+  import { dowmColumns, equitySearchForm } from '../account/details/data';
 
   export default defineComponent({
-    components: { 
-      BasicTable, 
-      TableAction, 
+    components: {
+      BasicTable,
+      TableAction,
       PageWrapper,
       TableImg,
       [Descriptions.name]: Descriptions,
@@ -52,7 +61,7 @@
     },
     setup() {
       const { t } = useI18n();
-      const isSearch = ref(false)
+      const isSearch = ref(false);
       const { createConfirm } = useMessage();
       const permissionStore = usePermissionStore();
       const { getCheckPerm } = permissionStore;
@@ -64,20 +73,20 @@
         useSearchForm: true,
         formConfig: equitySearchForm,
         showTableSetting: true,
-        showIndexColumn:false,
+        showIndexColumn: false,
         rowKey: 'id',
-        beforeFetch:(T)=>{
-          const {ctivated,tradeNum,userName,orderSn} = T
-          if(ctivated||tradeNum||userName||orderSn){
-            isSearch.value = true
-          }else{
-            isSearch.value = false
+        beforeFetch: (T) => {
+          const { ctivated, tradeNum, userName, orderSn } = T;
+          if (ctivated || tradeNum || userName || orderSn) {
+            isSearch.value = true;
+          } else {
+            isSearch.value = false;
           }
-          if(T.ctivated){
-            T.startTime = T.ctivated[0]
-            T.endTime = T.ctivated[1]
+          if (T.ctivated) {
+            T.startTime = T.ctivated[0];
+            T.endTime = T.ctivated[1];
           }
-          return T
+          return T;
         },
         fetchSetting: {
           pageField: 'pageNum',
@@ -96,10 +105,10 @@
       function exportExcel() {
         createConfirm({
           iconType: 'warning',
-          title: () => h('span', '温馨提示'),          
-          content: () => h('span', isSearch.value?'确认导出搜索结果?':'确认导出全部?'),
+          title: () => h('span', '温馨提示'),
+          content: () => h('span', isSearch.value ? '确认导出搜索结果?' : '确认导出全部?'),
           onOk: async () => {
-            DownExport()
+            DownExport();
           },
         });
       }
@@ -112,4 +121,4 @@
       };
     },
   });
-</script>
+</script>

+ 0 - 2
src/views/product/updataTips/AddModal.vue

@@ -126,7 +126,6 @@
         {
           field: 'infoUrl',
           component: 'Input',
-          required: true,
           label: '中文详情链接',
           rules: [
             {
@@ -192,7 +191,6 @@
         {
           field: 'infoUrlEn',
           component: 'Input',
-          required: true,
           label: '英文详情链接',
           rules: [
             {

+ 0 - 2
src/views/product/updataTips/EditModal.vue

@@ -133,7 +133,6 @@
         {
           field: 'infoUrl',
           component: 'Input',
-          required: true,
           label: '中文详情链接',
           rules: [
             {
@@ -199,7 +198,6 @@
         {
           field: 'infoUrlEn',
           component: 'Input',
-          required: true,
           label: '英文详情链接',
           rules: [
             {

+ 228 - 226
src/views/product/updataTips/index.vue

@@ -14,7 +14,7 @@
         <template #toolbar>
           <a-button
             type="primary"
-            v-if="getTypeCheckPerm('sdk-add')"
+            v-if="getTypeCheckPerm('updataTips-add')"
             @click="
               () => {
                 openAddModal(true, searchInfo.type);
@@ -29,12 +29,12 @@
               {
                 label: '编辑',
                 //icon: 'ep:edit',
-                ifShow: getTypeCheckPerm('sdk-update'),
+                ifShow: getTypeCheckPerm('updataTips-edit'),
                 onClick: handleEdit.bind(null, record),
               },
               {
                 label: '删除',
-                ifShow: getTypeCheckPerm('sdk-delete') && record.status != 1,
+                ifShow: getTypeCheckPerm('updataTips-delete') && record.status != 1,
                 //icon: 'ic:outline-delete-outline',
                 onClick: handleDelete.bind(null, record),
               },
@@ -48,241 +48,243 @@
   </PageWrapper>
 </template>
 <script lang="ts">
-import { defineComponent, reactive, h } from 'vue';
-import { Time } from '/@/components/Time';
-import { BasicTable, useTable, FormProps, TableAction, BasicColumn } from '/@/components/Table';
-import { PageWrapper } from '/@/components/Page';
-import { Divider, Card, Empty, Descriptions, Steps, Tabs,Switch } from 'ant-design-vue';
-import { tipList, tipDelete, SpaceSdkOnline } from '/@/api/product';
-import { tipUpdata } from '/@/api/product/index';
-import { useModal } from '/@/components/Modal';
-import { useI18n } from '/@/hooks/web/useI18n';
-import AddModal from './AddModal.vue';
-import EditModal from './EditModal.vue';
-import { useMessage } from '/@/hooks/web/useMessage';
-import { usePermissionStore } from '/@/store/modules/permission';
-export default defineComponent({
-  components: {
-    BasicTable,
-    AddModal,
-    EditModal,
-    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 permissionStore = usePermissionStore();
-    const { getCheckPerm } = permissionStore;
-    const searchInfo = reactive<Recordable>({
-      type: '0',
-    });
-    const [registerAddModal, { openModal: openAddModal }] = useModal();
-    const [registerEditModal, { openModal: openEditModal }] = useModal();
-    const { createMessage, createConfirm } = useMessage();
-    const searchForm: Partial<FormProps> = {
-      labelWidth: 100,
-      schemas: [
-        {
-          field: 'version',
-          label: '版本号',
-          component: 'Input',
-          componentProps: {
-            maxLength: 100,
+  import { defineComponent, reactive, h } from 'vue';
+  import { Time } from '/@/components/Time';
+  import { BasicTable, useTable, FormProps, TableAction, BasicColumn } from '/@/components/Table';
+  import { PageWrapper } from '/@/components/Page';
+  import { Divider, Card, Empty, Descriptions, Steps, Tabs, Switch } from 'ant-design-vue';
+  import { tipList, tipDelete, SpaceSdkOnline } from '/@/api/product';
+  import { tipUpdata } from '/@/api/product/index';
+  import { useModal } from '/@/components/Modal';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import AddModal from './AddModal.vue';
+  import EditModal from './EditModal.vue';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { usePermissionStore } from '/@/store/modules/permission';
+  export default defineComponent({
+    components: {
+      BasicTable,
+      AddModal,
+      EditModal,
+      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 permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
+      const searchInfo = reactive<Recordable>({
+        type: '0',
+      });
+      const [registerAddModal, { openModal: openAddModal }] = useModal();
+      const [registerEditModal, { openModal: openEditModal }] = useModal();
+      const { createMessage, createConfirm } = useMessage();
+      const searchForm: Partial<FormProps> = {
+        labelWidth: 100,
+        schemas: [
+          {
+            field: 'version',
+            label: '版本号',
+            component: 'Input',
+            componentProps: {
+              maxLength: 100,
+            },
+            colProps: {
+              xl: 6,
+              xxl: 6,
+            },
           },
-          colProps: {
-            xl: 6,
-            xxl: 6,
+        ],
+      };
+      const sdkTableSchema: BasicColumn[] = [
+        {
+          title: '版本号',
+          width: 80,
+          dataIndex: 'version',
+        },
+        {
+          title: '提示时段',
+          width: 240,
+          dataIndex: 'timeList',
+          customRender: ({ record }) => {
+            return record.timeList[0] + '~' + record.timeList[1];
           },
         },
-      ],
-    };
-    const sdkTableSchema: BasicColumn[] = [
-      {
-        title: '版本号',
-        width: 80,
-        dataIndex: 'version',
-      },
-      {
-        title: '提示时段',
-        width: 240,
-        dataIndex: 'timeList',
-        customRender: ({ record }) => {
-          return record.timeList[0] + '~' +record.timeList[1]
+        {
+          title: '标题',
+          width: 150,
+          dataIndex: 'title',
+          ellipsis: true,
         },
-      },
-      {
-        title: '标题',
-        width: 150,
-        dataIndex: 'title',
-        ellipsis:true,
-      },
-      {
-        title: '创建人',
-        width: 120,
-        dataIndex: 'createName',
-      },{
-        title: '创建时间',
-        width: 150,
-        dataIndex: 'createTime',
-        customRender: ({ record }) => {
-          return (
-            record.createTime &&
-            h(Time, {
-              value: record.createTime,
-              mode: 'datetime',
-            })
-          );
+        {
+          title: '创建人',
+          width: 120,
+          dataIndex: 'createName',
         },
-      },{
-        title: '状态',
-        dataIndex: 'banStatus',
-        // ifShow: getCheckPerm('tips-status'),
-        ifShow: getCheckPerm('sdk-top'),
-        width: 100,
-        customRender: ({ record }) => {
-          if (!Reflect.has(record, 'banStatus')) {
-            record.pendingStatus = false;
-          }
-          return h(Switch, {
-            checked: record.banStatus == 0 ? true : false,
-            checkedChildren: '启用',
-            unCheckedChildren: '禁用',
-            // disabled:record.status != 1,
-            loading: false,
-            onChange: async (checked: boolean) => {
-              record.pendingStatus = true;
-              const newStatus = checked?0:1;
-              await tipUpdata({...record,banStatus:newStatus});
-              Reflect.set(record, 'banStatus', checked);
-              createMessage.success(t('common.optSuccess'));
-              reload()
-            },
-          });
+        {
+          title: '创建时间',
+          width: 150,
+          dataIndex: 'createTime',
+          customRender: ({ record }) => {
+            return (
+              record.createTime &&
+              h(Time, {
+                value: record.createTime,
+                mode: 'datetime',
+              })
+            );
+          },
         },
-      }
-    ];
-    const [registerTimeTable, { reload }] = useTable({
-      api: tipList,
-      title: '',
-      columns: sdkTableSchema,
-      useSearchForm: true,
-      formConfig: searchForm,
-      showTableSetting: true,
-      showIndexColumn:false,
-      rowKey: 'id',
-      fetchSetting: {
-        pageField: 'pageNum',
-        sizeField: 'pageSize',
-        listField: 'list',
-        totalField: 'total',
-      },
-      searchInfo: searchInfo,
-      actionColumn: {
-        width: 200,
-        title: '操作',
-        dataIndex: 'action',
-        slots: { customRender: 'action' },
-      },
-      canResize: true,
-    });
-    function tabChange(val: string) {
-      console.log('tabChange', val);
-      reload();
-    }
-    function renderType(type: number): string {
-      switch (type) {
-        case 0:
-          return t(`routes.product.statusType.0`);
-        case 1:
-          return t(`routes.product.statusType.1`);
-        default:
-          return t(`routes.product.statusType.0`);
-      }
-    }
-    async function handleDelete(record: Recordable) {
-      createConfirm({
-        iconType: 'warning',
-        title: () => h('span', t('sys.app.logoutTip')),
-        content: () => h('span', '确定要删除吗?'),
-        onOk: async () => {
-          await tipDelete({ id: record.id });
-          createMessage.success(t('common.optSuccess'));
-          reload();
+        {
+          title: '状态',
+          dataIndex: 'banStatus',
+          // ifShow: getCheckPerm('tips-status'),
+          ifShow: getCheckPerm('updataTips-enable'),
+          width: 100,
+          customRender: ({ record }) => {
+            if (!Reflect.has(record, 'banStatus')) {
+              record.pendingStatus = false;
+            }
+            return h(Switch, {
+              checked: record.banStatus == 0 ? true : false,
+              checkedChildren: '启用',
+              unCheckedChildren: '禁用',
+              // disabled:record.status != 1,
+              loading: false,
+              onChange: async (checked: boolean) => {
+                record.pendingStatus = true;
+                const newStatus = checked ? 0 : 1;
+                await tipUpdata({ ...record, banStatus: newStatus });
+                Reflect.set(record, 'banStatus', checked);
+                createMessage.success(t('common.optSuccess'));
+                reload();
+              },
+            });
+          },
         },
-      });
-    }
-    function handleOpen(record: Recordable) {
-      console.log('点击了启用', record);
-    }
-    async function handlePublish(record: Recordable) {
-      createConfirm({
-        iconType: 'warning',
-        title: () => h('span', t('sys.app.logoutTip')),
-        content: () => h('span', '是否确定发布该文件?发布后将在官网展示。'),
-        onOk: async () => {
-          await SpaceSdkOnline({ id: record.id, status:1 });//状态 0 - 未发布 1 -发布  2-下架
-          createMessage.success(t('common.optSuccess'));
-          reload();
+      ];
+      const [registerTimeTable, { reload }] = useTable({
+        api: tipList,
+        title: '',
+        columns: sdkTableSchema,
+        useSearchForm: true,
+        formConfig: searchForm,
+        showTableSetting: true,
+        showIndexColumn: false,
+        rowKey: 'id',
+        fetchSetting: {
+          pageField: 'pageNum',
+          sizeField: 'pageSize',
+          listField: 'list',
+          totalField: 'total',
         },
-      });
-    }
-    async function handleOff(record: Recordable) {
-      createConfirm({
-        iconType: 'warning',
-        title: () => h('span', t('sys.app.logoutTip')),
-        content: () => h('span', '是否确定下架?下架后官网不再展示该SDK。'),
-        onOk: async () => {
-          await SpaceSdkOnline({ id: record.id, status:2 });//状态 0 - 未发布 1 -发布  2-下架
-          createMessage.success(t('common.optSuccess'));
-          reload();
+        searchInfo: searchInfo,
+        actionColumn: {
+          width: 200,
+          title: '操作',
+          dataIndex: 'action',
+          slots: { customRender: 'action' },
         },
+        canResize: true,
       });
-    }
-    function handleEdit(record: Recordable) {
-      console.log('record', record);
-      openEditModal(true, {
-        ...record,
-        type:searchInfo.type
-      });
-    }
-    
-    function getTypeCheckPerm(val){
-        let myType = searchInfo.type
-        return getCheckPerm(val) || getCheckPerm(`${val}-${myType}`)
+      function tabChange(val: string) {
+        console.log('tabChange', val);
+        reload();
       }
-    return {
-      registerTimeTable,
-      handleDelete,
-      handleOpen,
-      handlePublish,
-      tabChange,
-      handleOff,
-      reload,
-      registerAddModal,
-      registerEditModal,
-      openAddModal,
-      handleEdit,
-      getTypeCheckPerm,
-      t,
-      searchInfo,
-    };
-  },
-});
+      function renderType(type: number): string {
+        switch (type) {
+          case 0:
+            return t(`routes.product.statusType.0`);
+          case 1:
+            return t(`routes.product.statusType.1`);
+          default:
+            return t(`routes.product.statusType.0`);
+        }
+      }
+      async function handleDelete(record: Recordable) {
+        createConfirm({
+          iconType: 'warning',
+          title: () => h('span', t('sys.app.logoutTip')),
+          content: () => h('span', '确定要删除吗?'),
+          onOk: async () => {
+            await tipDelete({ id: record.id });
+            createMessage.success(t('common.optSuccess'));
+            reload();
+          },
+        });
+      }
+      function handleOpen(record: Recordable) {
+        console.log('点击了启用', record);
+      }
+      async function handlePublish(record: Recordable) {
+        createConfirm({
+          iconType: 'warning',
+          title: () => h('span', t('sys.app.logoutTip')),
+          content: () => h('span', '是否确定发布该文件?发布后将在官网展示。'),
+          onOk: async () => {
+            await SpaceSdkOnline({ id: record.id, status: 1 }); //状态 0 - 未发布 1 -发布  2-下架
+            createMessage.success(t('common.optSuccess'));
+            reload();
+          },
+        });
+      }
+      async function handleOff(record: Recordable) {
+        createConfirm({
+          iconType: 'warning',
+          title: () => h('span', t('sys.app.logoutTip')),
+          content: () => h('span', '是否确定下架?下架后官网不再展示该SDK。'),
+          onOk: async () => {
+            await SpaceSdkOnline({ id: record.id, status: 2 }); //状态 0 - 未发布 1 -发布  2-下架
+            createMessage.success(t('common.optSuccess'));
+            reload();
+          },
+        });
+      }
+      function handleEdit(record: Recordable) {
+        console.log('record', record);
+        openEditModal(true, {
+          ...record,
+          type: searchInfo.type,
+        });
+      }
+
+      function getTypeCheckPerm(val) {
+        let myType = searchInfo.type;
+        return getCheckPerm(val) || getCheckPerm(`${val}-${myType}`);
+      }
+      return {
+        registerTimeTable,
+        handleDelete,
+        handleOpen,
+        handlePublish,
+        tabChange,
+        handleOff,
+        reload,
+        registerAddModal,
+        registerEditModal,
+        openAddModal,
+        handleEdit,
+        getTypeCheckPerm,
+        t,
+        searchInfo,
+      };
+    },
+  });
 </script>
 <style lang="less" scoped>
-.desc-wrap-BasicTable {
-  background-color: #f0f2f5;
-  .vben-basic-table-form-container {
-    padding: 0;
+  .desc-wrap-BasicTable {
+    background-color: #f0f2f5;
+    .vben-basic-table-form-container {
+      padding: 0;
+    }
   }
-}
 </style>