Przeglądaj źródła

法国经销商页面修改

tangning 2 miesięcy temu
rodzic
commit
4af917b95c

+ 77 - 27
src/api/finance/index.ts

@@ -7,48 +7,98 @@ enum Api {
   logData = '/service/agent/log/logData',
   logList = '/service/agent/log/logList',
   export = '/service/agent/log/export',
+  contactUsList = '/service/agent/contactUs/list',
+  pointList = '/service/agent/contactUs/pointList',
+  contactUsExport = '/service/agent/contactUs/export',
+  exportPoint = '/service/agent/contactUs/exportPoint',
+  // aa = '/service/agent/log/aa',
 }
 
 /**
  * @description: Get sample list value
  */
 
- interface logDataResule {
+interface logDataResule {
   lastDownNum: number;
   lastHighNum: number;
   lastMajorNum: number;
 }
- export const logData = (params) =>
- defHttp.get<logDataResule>({
-   url: Api.logData,
-   params: params,
-   headers: {
-     // @ts-ignore
-     ignoreCancelToken: true,
-   },
- });
-
- 
- export const logList = (params) =>
- defHttp.post<Result>({
-   url: Api.logList,
-   params: params,
-   // data: params,
-   headers: {
-     // @ts-ignore
-     ignoreCancelToken: true,
-   },
- });
-
- export const DownExport = (params) =>
+export const logData = (params) =>
+  defHttp.get<logDataResule>({
+    url: Api.logData,
+    params: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
+export const contactUsList = (params) =>
+  defHttp.post<logDataResule>({
+    url: Api.contactUsList,
+    params: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
+export const pointList = (params) =>
+  defHttp.post<logDataResule>({
+    url: Api.pointList,
+    params: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
+export const logList = (params) =>
+  defHttp.post<Result>({
+    url: Api.logList,
+    params: params,
+    // data: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
+export const DownExport = (params) =>
   defHttp.downloadFile<FileStream>({
     url: Api.export + `?lang=${params.lang}`,
     params: params,
-    fileName:t('routes.equity.listTitle')+'.xlsx',
+    fileName: t('routes.equity.listTitle') + '.xlsx',
+    // data: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+    responseType: 'blob',
+  });
+
+export const DownCountExport1 = (params) =>
+  defHttp.downloadFile<FileStream>({
+    url: Api.contactUsExport + `?lang=${params.lang}`,
+    params: params,
+    fileName: t('routes.count.name1') + '.xlsx',
+    // data: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+    responseType: 'blob',
+  });
+
+export const DownCountExport2 = (params) =>
+  defHttp.downloadFile<FileStream>({
+    url: Api.exportPoint + `?lang=${params.lang}`,
+    params: params,
+    fileName: t('routes.count.name2') + '.xlsx',
     // data: params,
     headers: {
       // @ts-ignore
       ignoreCancelToken: true,
     },
-    responseType: 'blob'
-  });
+    responseType: 'blob',
+  });

+ 25 - 0
src/locales/lang/en/routes/count.ts

@@ -0,0 +1,25 @@
+export default {
+  name1: 'Prospective Users',
+  name2: 'Page Analysis',
+  name: 'User Name',
+  email: 'User Email',
+  tel: 'User Phone Number',
+  company: 'Company Name',
+  submitTime: 'Submission Time',
+  submitLocation: 'Submission Location (Country/Address)',
+  remarks: 'Remarks',
+  uuid: 'Visit ID',
+  sourceChannel: 'Source Channel',
+  qrCode: 'QR Code',
+  deviceType: 'Device Type',
+  mobile: 'Mobile',
+  computer: 'Computer',
+  pageDwellTime: 'Page Dwell Time',
+  scrollDepth: 'Scroll Depth',
+  visitTime: 'Visit Time',
+  visitAddress: 'Visit Address',
+  loadTime: 'Load Time',
+  networkType: 'Network Type',
+  browserLanguage: 'Browser Language',
+  lang: 'English',
+};

+ 1 - 0
src/locales/lang/en/routes/dashboard.ts

@@ -12,4 +12,5 @@ export default {
   account: 'User',
   retailer: 'Reseller',
   overview: 'User Overview',
+  count: 'Statistical',
 };

+ 25 - 0
src/locales/lang/zh-CN/routes/count.ts

@@ -0,0 +1,25 @@
+export default {
+  name1: '意向用户',
+  name2: '页面分析',
+  name: '用户名称',
+  email: '用户邮箱',
+  tel: '用户电话',
+  company: '公司名称',
+  submitTime: '提交时间',
+  submitLocation: '提交地点',
+  remarks: '备注',
+  uuid: '访问ID',
+  sourceChannel: '来源渠道',
+  qrCode: '二维码',
+  deviceType: '设备类型',
+  mobile: '手机',
+  computer: '电脑',
+  pageDwellTime: '页面停留时长',
+  scrollDepth: '滚动深度',
+  visitTime: '访问时间',
+  visitAddress: '访问地址',
+  loadTime: '加载时间',
+  networkType: '网络类型',
+  browserLanguage: '浏览器语言',
+  lang: '中文',
+};

+ 1 - 0
src/locales/lang/zh-CN/routes/dashboard.ts

@@ -64,6 +64,7 @@ export default {
   customerDevice: '客户设备',
   customerScene: '客户场景',
   devices: '设备管理',
+  count: '统计管理',
   equity: '权益管理',
   scene: '场景管理',
   finance: '销售统计',

+ 28 - 0
src/router/routes/modules/count.ts

@@ -0,0 +1,28 @@
+import type { AppRouteRecordRaw } from '/@/router/types';
+import { t } from '/@/hooks/web/useI18n';
+import { LAYOUT } from '/@/router/constant';
+
+export const LoglistRoute: AppRouteRecordRaw = {
+  path: '/count',
+  name: 'Count',
+  redirect: '/count/index',
+  component: LAYOUT,
+  meta: {
+    title: t('routes.dashboard.count'),
+    icon: 'wpf:statistics',
+    orderNo: 11,
+    hideChildrenInMenu: true,
+  },
+  children: [
+    {
+      path: 'index',
+      name: 'countIndex',
+      component: () => import('/@/views/count/index.vue'),
+      meta: {
+        title: t('routes.dashboard.count'),
+        hideBreadcrumb: true,
+      },
+    },
+  ],
+};
+export default LoglistRoute;

+ 112 - 0
src/views/count/data.ts

@@ -0,0 +1,112 @@
+import { BasicColumn } from '/@/components/Table/src/types/table';
+import { useI18n } from '/@/hooks/web/useI18n';
+import { Time } from '/@/components/Time';
+import { h } from 'vue';
+const { t } = useI18n();
+export const columns: BasicColumn[] = [
+  {
+    title: t('routes.count.uuid'),
+    width: 300,
+    dataIndex: 'sessionId',
+  },
+  {
+    title: t('routes.count.sourceChannel'),
+    width: 150,
+    dataIndex: 'utmSource',
+  },
+  {
+    title: t('routes.count.deviceType'),
+    width: 150,
+    dataIndex: 'deviceType',
+  },
+  {
+    title: t('routes.count.pageDwellTime') + '(min)',
+    width: 220,
+    dataIndex: 'stopTime',
+  },
+  {
+    title: t('routes.count.scrollDepth'),
+    width: 150,
+    dataIndex: 'scrollDepth',
+  },
+  {
+    title: t('routes.count.visitTime'),
+    width: 150,
+    dataIndex: 'visitTime',
+    customRender: ({ record }) => {
+      return (
+        record.createTime &&
+        h(Time, {
+          value: record.createTime,
+          mode: 'datetime',
+        })
+      );
+    },
+  },
+  {
+    title: t('routes.count.visitAddress'),
+    width: 150,
+    dataIndex: 'country',
+  },
+  {
+    title: t('routes.count.loadTime') + '(s)',
+    width: 150,
+    dataIndex: 'loadTime',
+  },
+  {
+    title: t('routes.count.networkType'),
+    width: 150,
+    dataIndex: 'networkType',
+  },
+  {
+    title: t('routes.count.browserLanguage'),
+    width: 150,
+    dataIndex: 'lang',
+  },
+];
+export const columns1: BasicColumn[] = [
+  {
+    title: t('routes.count.name'),
+    width: 150,
+    dataIndex: 'name',
+  },
+  {
+    title: t('routes.count.email'),
+    width: 150,
+    dataIndex: 'email',
+  },
+  {
+    title: t('routes.count.tel'),
+    width: 150,
+    dataIndex: 'tel',
+  },
+  {
+    title: t('routes.count.company'),
+    width: 150,
+    dataIndex: 'company',
+  },
+  {
+    title: t('routes.count.submitTime'),
+    width: 150,
+    dataIndex: 'submitTime',
+    customRender: ({ record }) => {
+      return (
+        record.createTime &&
+        h(Time, {
+          value: record.createTime,
+          mode: 'datetime',
+        })
+      );
+    },
+  },
+  {
+    title: t('routes.count.submitLocation'),
+    width: 150,
+    dataIndex: 'country',
+  },
+  {
+    title: t('routes.count.remarks'),
+    width: 150,
+    dataIndex: 'note',
+  },
+];

+ 211 - 0
src/views/count/index.vue

@@ -0,0 +1,211 @@
+<template>
+  <PageWrapper contentBackground>
+    <template #footer>
+      <a-tabs v-model:activeKey="tableType" @change="changeTable">
+        <a-tab-pane :key="0" :tab="t('routes.count.name1')" />
+        <a-tab-pane :key="1" :tab="t('routes.count.name2')" />
+        <!-- <a-tab-pane :key="3" :tab="t('routes.scene.tableType.3')" />  -->
+      </a-tabs></template
+    >
+    <div class="desc-wrap-BasicTable">
+      <BasicTable class="registerTable1" v-if="!tableType" @register="registerTable1">
+        <template #toolbar>
+          <a-button type="primary" @click="exportExcel(true)">
+            {{ t('routes.equity.exportExcel') }}</a-button
+          >
+        </template>
+      </BasicTable>
+      <BasicTable class="registerTable" v-else @register="registerTable">
+        <template #toolbar>
+          <a-button type="primary" @click="exportExcel(false)">
+            {{ t('routes.equity.exportExcel') }}</a-button
+          >
+        </template>
+      </BasicTable>
+    </div>
+  </PageWrapper>
+</template>
+<script lang="ts">
+  import { defineComponent, onMounted, computed, ref, h } from 'vue';
+  import { PageWrapper } from '/@/components/Page';
+  import { Tabs } from 'ant-design-vue';
+  import { BasicTable, useTable, BasicColumn, FormProps } from '/@/components/Table';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import { usePermissionStore } from '/@/store/modules/permission';
+  import { dincrementList, cameraIncrementLog } from '/@/api/equity';
+  import { contactUsList, pointList, DownCountExport1, DownCountExport2 } from '/@/api/finance';
+  import { useLocaleStore } from '/@/store/modules/locale';
+  import { columns1, columns } from './data'
+  import { useMessage } from '/@/hooks/web/useMessage';
+  export default defineComponent({
+    components: {
+      BasicTable,
+      PageWrapper,
+      [Tabs.name]: Tabs,
+      [Tabs.TabPane.name]: Tabs.TabPane,
+    },
+    setup() {
+      const { t } = useI18n();
+      const permissionStore = usePermissionStore();
+      const localeStore = useLocaleStore();
+      const tableType = ref(0);
+      const { createConfirm } = useMessage();
+      const { getCheckPerm } = permissionStore;
+      const isEn = computed(() => localeStore.getLocale === 'en');
+      const searchForm1: Partial<FormProps> = {
+        labelWidth: 120,
+        autoAdvancedLine: 1,
+        actionColOptions: {
+          span: 24,
+        },
+        schemas: [
+          {
+            field: 'email',
+            component: 'Input',
+            label: t('routes.account.email'),
+            colProps: {
+              xl: 7,
+              xxl: 7,
+            },
+          },
+          {
+            field: 'timeList',
+            label: t('routes.count.submitTime'),
+            component: 'RangePicker',
+            componentProps: {
+              maxLength: 100,
+              valueFormat: 'YYYY-MM-DD',
+              format: 'YYYY-MM-DD',
+            },
+            colProps: {
+              xl: 7,
+              xxl: 7,
+            },
+          },
+        ],
+      };
+      
+      const searchForm: Partial<FormProps> = {
+        labelWidth: 120,
+        autoAdvancedLine: 1,
+        actionColOptions: {
+          span: 24,
+        },
+        schemas: [
+          {
+            field: 'email',
+            component: 'Input',
+            label: t('routes.account.email'),
+            colProps: {
+              xl: 7,
+              xxl: 7,
+            },
+          },
+          // {
+          //   field: 'timeList',
+          //   label: t('routes.count.submitTime'),
+          //   component: 'RangePicker',
+          //   componentProps: {
+          //     maxLength: 100,
+          //     valueFormat: 'YYYY-MM-DD',
+          //     format: 'YYYY-MM-DD',
+          //   },
+          //   colProps: {
+          //     xl: 7,
+          //     xxl: 7,
+          //   },
+          // },
+          {
+            field: 'timeList',
+            label: t('routes.count.visitTime'),
+            component: 'RangePicker',
+            componentProps: {
+              maxLength: 100,
+              valueFormat: 'YYYY-MM-DD',
+              format: 'YYYY-MM-DD',
+            },
+            colProps: {
+              xl: 7,
+              xxl: 7,
+            },
+          },
+          {
+            field: 'utmSource',
+            component: 'Input',
+            label: t('routes.count.sourceChannel'),
+            colProps: {
+              xl: 7,
+              xxl: 7,
+            },
+          },
+        ],
+      };
+      const [registerTable, { reload: reload0 }] = useTable({
+        api: pointList,
+        columns: columns,
+        useSearchForm: true,
+        formConfig: searchForm,
+        showIndexColumn: true,
+        showTableSetting: true,
+        rowKey: 'id',
+        fetchSetting: {
+          pageField: 'pageNum',
+          sizeField: 'pageSize',
+          listField: 'list',
+          totalField: 'total',
+        },
+        canResize: false,
+      });
+      const [registerTable1, { reload: reload1 }] = useTable({
+        api: contactUsList,
+        columns: columns1,
+        useSearchForm: true,
+        formConfig: searchForm1,
+        showTableSetting: true,
+        showIndexColumn: true,
+        rowKey: 'id',
+        fetchSetting: {
+          pageField: 'pageNum',
+          sizeField: 'pageSize',
+          listField: 'list',
+          totalField: 'total',
+        },
+        canResize: false,
+      });
+      function reload() {
+        reload0();
+        reload1();
+      }
+      function exportExcel(val) {
+        createConfirm({
+          iconType: 'warning',
+          title: () => h('span', t('common.reminder')),
+          content: () => h('span', t('routes.equity.excelTitle')),
+          onOk: async () => {
+            let exportUrl = val ? DownCountExport1 : DownCountExport2;
+            await exportUrl({
+              lang: isEn.value ? 'en' : 'cn',
+            });
+          },
+        });
+      }
+      return {
+        registerTable,
+        registerTable1,
+        reload,
+        exportExcel,
+        tableType,
+        t,
+        getCheckPerm,
+      };
+    },
+  });
+</script>
+<style lang="less" scoped>
+  .desc-wrap-BasicTable {
+    background-color: #f0f2f5;
+    .vben-basic-table-form-container {
+      padding: 0;
+    }
+  }
+</style>

+ 3 - 3
src/views/equity/index.vue

@@ -62,12 +62,12 @@
     sortBy?: string;
   }
   export default defineComponent({
-    components: { 
+    components: {
       AddModal,
       EditModal,
       DownModal,
-      BasicTable, 
-      TableAction, 
+      BasicTable,
+      TableAction,
       PageWrapper,
       TableImg,
       [Descriptions.name]: Descriptions,