chenpeiqing 5 månader sedan
förälder
incheckning
3da9f87da2
2 ändrade filer med 537 tillägg och 575 borttagningar
  1. 158 173
      src/components/adweb/selectSite.vue
  2. 379 402
      src/views/adweb/enquiry/AdwebEnquiryList.vue

+ 158 - 173
src/components/adweb/selectSite.vue

@@ -1,200 +1,185 @@
 <template>
   <span v-if="siteinfo.length > 1">
-    <a-select show-search
-              option-filter-prop="children"
-              :filterOption="filterOption"
-              v-model:value="siteCode" @change="changeUser" :style="'width:'+selectWidth">
+    <a-select
+      show-search
+      option-filter-prop="children"
+      :filterOption="filterOption"
+      v-model:value="siteCode"
+      @change="changeUser"
+      :style="'width:' + selectWidth"
+    >
       <a-select-option v-for="data in siteinfo" :key="data.code" :value="data.code" :info="data">
         {{ data.name }}
       </a-select-option>
     </a-select>
 
-    <a-modal
-      title="温馨提示"
-      :visible="visible"
-      :closable="false"
-      :keyboard="false"
-      :maskClosable="false"
-      :footer="null"
-      centered
-      dialogClass="wp-tips"
-    >
-      <div style="text-align: center;line-height: 2">
-         <p>您当前选择的是 WordPress 嵌套网站,需要在系统操作之前,请返回首页重新选择站点操作。本网站的产品类型是 {{
-             productType
-           }}。</p>
-          <router-link :to="{ path: '/websiteManage/dashboard/analysis' }">
-            <a-button type="primary">返回首页</a-button>
-          </router-link>
+    <a-modal title="温馨提示" :open="visible" :closable="false" :keyboard="false" :maskClosable="false" :footer="null" centered dialogClass="wp-tips">
+      <div style="text-align: center; line-height: 2">
+        <p>您当前选择的是 WordPress 嵌套网站,需要在系统操作之前,请返回首页重新选择站点操作。本网站的产品类型是 {{ productType }}。</p>
+        <router-link :to="{ path: '/websiteManage/dashboard/analysis' }">
+          <a-button type="primary">返回首页</a-button>
+        </router-link>
       </div>
     </a-modal>
   </span>
-
 </template>
 
 <script>
-import {getAction, postAction} from '/@/api/manage/manage'
-
-import {useMessage} from '/@/hooks/web/useMessage';
-import { defineExpose } from "vue";
-
-const {createMessage, createConfirm} = useMessage();
-
-export default {
-  name: 'selectSite',
-  data() {
-    return {
-      siteinfo: [],
-      siteCode: '',
-      selectSiteInfo: {},
-      visible: false,
-      productType: ''
-    }
-  },
-  props: {
-    comProps: {},
-    siteListUrl: {
-      default: '/adweb/adwebSite/getSiteListByUid'
+  import { getAction, postAction } from '/@/api/manage/manage';
+
+  import { useMessage } from '/@/hooks/web/useMessage';
+
+  const { createMessage, createConfirm } = useMessage();
+
+  export default {
+    name: 'SelectSite',
+    props: {
+      comProps: {},
+      siteListUrl: {
+        default: '/adweb/adwebSite/getSiteListByUid',
+      },
+      selectWidth: {
+        default: '300px',
+      },
     },
-    selectWidth: {
-      default: '300px'
-    }
-  },
-  watch: {
-    // siteinfo(newVal) {
-    //   this.$emit('setSiteInfo', newVal)
-    // }
-  },
-  mounted() {
-    this.getSiteInfo()
-  },
-  methods: {
-    //进入获取站点code
-    getSiteInfo() {
-      let that = this
-      getAction(that.siteListUrl).then(function (res) {
-        if (res.code === 200) {
-          that.siteinfo = res.result
-          let isInSite = false
-          for (let i in res.result) {
-            if (localStorage.getItem('siteCode') !== null && res.result[i].code === localStorage.getItem('siteCode')) {
-              isInSite = true
-              that.selectSiteInfo = res.result[i]
+    data() {
+      return {
+        siteinfo: [],
+        siteCode: '',
+        selectSiteInfo: {},
+        visible: false,
+        productType: '',
+      };
+    },
+    watch: {
+      // siteinfo(newVal) {
+      //   this.$emit('setSiteInfo', newVal)
+      // }
+    },
+    mounted() {
+      this.getSiteInfo();
+    },
+    methods: {
+      //进入获取站点code
+      getSiteInfo() {
+        let that = this;
+        getAction(that.siteListUrl).then(function (res) {
+          if (res.code === 200) {
+            that.siteinfo = res.result;
+            let isInSite = false;
+            for (let i in res.result) {
+              if (localStorage.getItem('siteCode') !== null && res.result[i].code === localStorage.getItem('siteCode')) {
+                isInSite = true;
+                that.selectSiteInfo = res.result[i];
+              }
+            }
+            if (localStorage.getItem('siteCode') !== null && isInSite) {
+              that.siteCode = localStorage.getItem('siteCode');
+            } else {
+              that.siteCode = res.result[0].code;
+              that.selectSiteInfo = res.result[0];
+              localStorage.setItem('siteCode', res.result[0].code);
             }
+            that.$nextTick(() => {
+              that.$emit('setSiteInfo', res.result, that.selectSiteInfo);
+            });
+            // if(route == 'websiteManage-dashboard-analysis'){
+            //   that.getPermissionList(that.siteCode)
+            // }
+            // that.getAllInfo()
+          } else {
+            createMessage.error('站点获取失败,请刷新重试');
           }
-          if (localStorage.getItem('siteCode') !== null && isInSite) {
-            that.siteCode = localStorage.getItem("siteCode")
+        });
+      },
+
+      //改变站点
+      changeUser(value, e) {
+        let that = this;
+        let route = this.$route.name;
+        that.siteCode = value;
+        localStorage.setItem('siteCode', value);
+
+        postAction('/adweb/adwebSiteManage/queryWordPressConfig', { siteCode: value }).then(function (res) {
+          if (
+            res.code == 200 &&
+            res.result.wordpressSwitch &&
+            res.result.wordpressSwitch == 1 &&
+            (route == 'pageManage-allPage' ||
+              route == 'pageManage-addPage' ||
+              route == 'website-enterpriseInfo-baseInfo' ||
+              route == 'website-enterpriseInfo-bannerAdv' ||
+              route == 'website-enterpriseInfo-customRevier' ||
+              route == 'website-enterpriseInfo-enterpriseintroduction' ||
+              route == 'company-advantage' ||
+              route == 'website-enterpriseInfo-projectApplication' ||
+              route == 'website-enterpriseInfo-honor' ||
+              route == 'website-productSummary-productList5684' ||
+              route == 'website-productSummary-category' ||
+              route == 'website-productSummary-productsTag' ||
+              route == 'product-draft' ||
+              route == 'website-productSummary-productList' ||
+              route == 'website-productSummary-downloadDocument' ||
+              route == 'website-productSummary-faq' ||
+              route == 'website-productSummary-productAdd' ||
+              route == 'website-newsSummary-category' ||
+              route == 'website-newsSummary-contentTag' ||
+              route == 'website-newsSummary-AdwebMaterialNewsList' ||
+              route == 'websit-newsSummary-addContent' ||
+              route == 'website-enterpriseInfo-enterprisehistory' ||
+              route == 'website-enterpriseInfo-FactoryEnvironment' ||
+              route == 'website-enterpriseInfo-serviceGuarantee' ||
+              route == 'website-enterpriseInfo-QuestionList' ||
+              route == 'website-enterpriseInfo-socialmedialinks' ||
+              route == 'website-productSummary-category1' ||
+              route == 'website-productSummary-productList1' ||
+              route == 'website-newsSummary-category1' ||
+              route == 'operate-blog-update')
+          ) {
+            that.productType = res.result.productType;
+            that.visible = true;
           } else {
-            that.siteCode = res.result[0].code
-            that.selectSiteInfo = res.result[0]
-            localStorage.setItem("siteCode", res.result[0].code)
+            // that.getPermissionList(value)
+            that.$emit('comMethods', value, e);
           }
-          that.$nextTick(() => {
-            that.$emit('setSiteInfo', res.result, that.selectSiteInfo)
-          })
-          // if(route == 'websiteManage-dashboard-analysis'){
-          //   that.getPermissionList(that.siteCode)
-          // }
-          // that.getAllInfo()
-        } else {
-          createMessage.error('站点获取失败,请刷新重试');
-        }
-      })
+        });
+      },
+
+      //站点搜索
+      filterOption(input, option) {
+        return `${option.info.name}`.toLowerCase().includes(`${input || ''}`.toLowerCase());
+      },
+
+      // getPermissionList(value){
+      //   let that = this
+      //   that.$store.dispatch('GetPermissionList', value).then(res => {
+      //     const menuData = res.result.menu;
+      //     if (menuData === null || menuData === "" || menuData === undefined) {
+      //       return;
+      //     }
+      //     let constRoutes = [];
+      //     constRoutes = generateIndexRouter(menuData);
+      //     that.$store.dispatch('UpdateAppRouter',  { constRoutes }).then(() => {
+      //       router.addRoutes(store.getters.addRouters)
+      //     })
+      //   })
+      // }
     },
-
-
-    //改变站点
-    changeUser(value, e) {
-      let that = this
-      let route = this.$route.name
-      that.siteCode = value
-      localStorage.setItem("siteCode", value)
-
-      postAction('/adweb/adwebSiteManage/queryWordPressConfig', {siteCode: value}).then(function (res) {
-        if (res.code == 200 && res.result.wordpressSwitch && res.result.wordpressSwitch == 1
-          && (route == 'pageManage-allPage'
-            || route == 'pageManage-addPage'
-
-            || route == 'website-enterpriseInfo-baseInfo'
-            || route == 'website-enterpriseInfo-bannerAdv'
-            || route == 'website-enterpriseInfo-customRevier'
-            || route == 'website-enterpriseInfo-enterpriseintroduction'
-            || route == 'company-advantage'
-            || route == 'website-enterpriseInfo-projectApplication'
-            || route == 'website-enterpriseInfo-honor'
-            || route == 'website-productSummary-productList5684'
-
-            || route == 'website-productSummary-category'
-            || route == 'website-productSummary-productsTag'
-            || route == 'product-draft'
-            || route == 'website-productSummary-productList'
-            || route == 'website-productSummary-downloadDocument'
-            || route == 'website-productSummary-faq'
-            || route == 'website-productSummary-productAdd'
-
-            || route == 'website-newsSummary-category'
-            || route == 'website-newsSummary-contentTag'
-            || route == 'website-newsSummary-AdwebMaterialNewsList'
-            || route == 'websit-newsSummary-addContent'
-            || route == 'website-enterpriseInfo-enterprisehistory'
-            || route == 'website-enterpriseInfo-FactoryEnvironment'
-            || route == 'website-enterpriseInfo-serviceGuarantee'
-            || route == 'website-enterpriseInfo-QuestionList'
-            || route == 'website-enterpriseInfo-socialmedialinks'
-
-            || route == 'website-productSummary-category1'
-            || route == 'website-productSummary-productList1'
-            || route == 'website-newsSummary-category1'
-            || route == 'operate-blog-update')
-
-        ) {
-          that.productType = res.result.productType
-          that.visible = true;
-        } else {
-          // that.getPermissionList(value)
-          that.$emit('comMethods', value, e)
-        }
-      })
-    },
-
-    //站点搜索
-    filterOption(input, option) {
-
-      return `${option.info.name}`.toLowerCase().includes(`${input || ''}`.toLowerCase())
-    },
-
-    // getPermissionList(value){
-    //   let that = this
-    //   that.$store.dispatch('GetPermissionList', value).then(res => {
-    //     const menuData = res.result.menu;
-    //     if (menuData === null || menuData === "" || menuData === undefined) {
-    //       return;
-    //     }
-    //     let constRoutes = [];
-    //     constRoutes = generateIndexRouter(menuData);
-    //     that.$store.dispatch('UpdateAppRouter',  { constRoutes }).then(() => {
-    //       router.addRoutes(store.getters.addRouters)
-    //     })
-    //   })
-    // }
-
-
-  }
-}
+  };
 </script>
 
 <style lang="less">
-.wp-tips {
-  .ant-modal-header {
-    padding: 10px;
-  }
+  .wp-tips {
+    .ant-modal-header {
+      padding: 10px;
+    }
 
-  .ant-modal-body {
-    padding: 24px;
+    .ant-modal-body {
+      padding: 24px;
 
-    p {
-      margin-bottom: 10px;
+      p {
+        margin-bottom: 10px;
+      }
     }
   }
-}
 </style>

+ 379 - 402
src/views/adweb/enquiry/AdwebEnquiryList.vue

@@ -1,60 +1,45 @@
 <template>
   <div class="p-2">
-
     <a-row class="r1" :gutter="8">
       <a-col :xl="7" :xxl="6">
         <div class="choose-site">
           <span class="t1">站点:</span>
-          <select-site ref="selectSiteRef"  @comMethods="changeSite" @setSiteInfo="getSiteList"/>
+          <select-site ref="selectSiteRef" @com-methods="changeSite" @set-site-info="getSiteList" />
         </div>
       </a-col>
       <a-col :xl="8" :xxl="6">
         <div class="choose-site">
           <span class="t1">询盘时间:</span>
-          <a-range-picker @change="onChangeDatePciker" :disabledDate="disabledDate"
-                          :value="rangeDate" style="width:70%"/>
+          <a-range-picker @change="onChangeDatePciker" :disabledDate="disabledDate" :value="rangeDate" style="width: 70%" />
         </div>
       </a-col>
       <a-col :xl="9" :xxl="12">
-        <a-button :class="queryParam.dateType == '' ? 'active' : ''" @click="setTime('')">全部时间
-        </a-button>
-        <a-button :class="queryParam.dateType == 'thirtyDay' ? 'active' : ''"
-                  @click="setTime('thirtyDay')">近30天
-        </a-button>
-        <a-button :class="queryParam.dateType == 'sevenDay' ? 'active' : ''"
-                  @click="setTime('sevenDay')">近一周
-        </a-button>
-        <a-button :class="queryParam.dateType == 'yesterday' ? 'active' : ''"
-                  @click="setTime('yesterday')">昨日
-        </a-button>
-        <a-button :class="queryParam.dateType == 'today' ? 'active' : ''" @click="setTime('today')">
-          今日
-        </a-button>
+        <a-button :class="queryParam.dateType == '' ? 'active' : ''" @click="setTime('')">全部时间 </a-button>
+        <a-button :class="queryParam.dateType == 'thirtyDay' ? 'active' : ''" @click="setTime('thirtyDay')">近30天 </a-button>
+        <a-button :class="queryParam.dateType == 'sevenDay' ? 'active' : ''" @click="setTime('sevenDay')">近一周 </a-button>
+        <a-button :class="queryParam.dateType == 'yesterday' ? 'active' : ''" @click="setTime('yesterday')">昨日 </a-button>
+        <a-button :class="queryParam.dateType == 'today' ? 'active' : ''" @click="setTime('today')"> 今日 </a-button>
       </a-col>
     </a-row>
 
     <!--查询区域-->
     <div class="jeecg-basic-table-form-container">
-      <a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam"
-              :label-col="labelCol" :wrapper-col="wrapperCol">
+      <a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
         <a-row :gutter="24">
           <a-col :lg="6">
             <a-form-item name="siteCode">
               <template #label><span title="站点code,关联站点表">站点co</span></template>
-              <a-input placeholder="请输入站点code,关联站点表" v-model:value="queryParam.siteCode"
-                       allow-clear></a-input>
+              <a-input placeholder="请输入站点code,关联站点表" v-model:value="queryParam.siteCode" allow-clear />
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
               <a-col :lg="6">
                 <a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
-                <a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
-                          style="margin-left: 8px">重置</a-button>
+                <a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
                 <a @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px">
                   {{ toggleSearchStatus ? '收起' : '展开' }}
-                  <Icon
-                    :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'"/>
+                  <Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" />
                 </a>
               </a-col>
             </span>
@@ -66,436 +51,428 @@
     <BasicTable @register="registerTable" :rowSelection="rowSelection">
       <!--插槽:table标题-->
       <template #tableTitle>
-        <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增
-        </a-button>
-        <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出
-        </a-button>
-        <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">
-          导入
-        </j-upload-button>
+        <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增 </a-button>
+        <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出 </a-button>
+        <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls"> 导入 </j-upload-button>
         <a-dropdown v-if="selectedRowKeys.length > 0">
           <template #overlay>
             <a-menu>
               <a-menu-item key="1" @click="batchHandleDelete">
-                <Icon icon="ant-design:delete-outlined"></Icon>
+                <Icon icon="ant-design:delete-outlined" />
                 删除
               </a-menu-item>
             </a-menu>
           </template>
-          <a-button>批量操作
-            <Icon icon="mdi:chevron-down"></Icon>
+          <a-button
+            >批量操作
+            <Icon icon="mdi:chevron-down" />
           </a-button>
         </a-dropdown>
         <!-- 高级查询 -->
-        <super-query :config="superQueryConfig" @search="handleSuperQuery"/>
+        <super-query :config="superQueryConfig" @search="handleSuperQuery" />
       </template>
       <!--操作栏-->
       <template #action="{ record }">
-        <TableAction :actions="getTableAction(record)"
-                     :dropDownActions="getDropDownAction(record)"/>
-      </template>
-      <template v-slot:bodyCell="{ column, record, index, text }">
+        <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
       </template>
+      <template #bodyCell="{ column, record, index, text }"> </template>
     </BasicTable>
     <!-- 表单区域 -->
-    <AdwebEnquiryModal ref="registerModal" @success="handleSuccess"></AdwebEnquiryModal>
+    <AdwebEnquiryModal ref="registerModal" @success="handleSuccess" />
   </div>
 </template>
 
 <script lang="ts" name="adweb-adwebEnquiry" setup>
-import selectSite from "@/components/adweb/selectSite.vue";
-import {onMounted, reactive, ref} from 'vue';
-import {BasicTable, TableAction} from '/@/components/Table';
-import {useListPage} from '/@/hooks/system/useListPage';
-import {columns, superQuerySchema} from './AdwebEnquiry.data';
-import {batchDelete, deleteOne, getExportUrl, getImportUrl, list} from './AdwebEnquiry.api';
-import AdwebEnquiryModal from './components/AdwebEnquiryModal.vue'
-import {useUserStore} from '/@/store/modules/user';
-import {getAction} from "@/api/manage/manage";
-import {createLocalStorage} from "@/utils/cache";
-import {useMessage} from "@/hooks/web/useMessage";
-import JUploadButton from "@/components/Button/src/JUploadButton.vue";
-import moment from 'moment'
-
-const formRef = ref();
-const queryParam = reactive<any>({});
-const toggleSearchStatus = ref<boolean>(false);
-const registerModal = ref();
-const userStore = useUserStore();
-const selectSiteRef = ref(null)
-const { createMessage } = useMessage();
-//注册table数据
-const {prefixCls, tableContext, onExportXls, onImportXls} = useListPage({
-  tableProps: {
-    title: '询盘信息存储表单',
-    api: list,
-    columns,
-    canResize: false,
-    useSearchForm: false,
-    actionColumn: {
-      width: 120,
-      fixed: 'right',
+  import selectSite from '@/components/adweb/selectSite.vue';
+  import { onMounted, reactive, ref } from 'vue';
+  import { BasicTable, TableAction } from '/@/components/Table';
+  import { useListPage } from '/@/hooks/system/useListPage';
+  import { columns, superQuerySchema } from './AdwebEnquiry.data';
+  import { batchDelete, deleteOne, getExportUrl, getImportUrl, list } from './AdwebEnquiry.api';
+  import AdwebEnquiryModal from './components/AdwebEnquiryModal.vue';
+  import { useUserStore } from '/@/store/modules/user';
+  import { getAction } from '@/api/manage/manage';
+  import { createLocalStorage } from '@/utils/cache';
+  import { useMessage } from '@/hooks/web/useMessage';
+  import JUploadButton from '@/components/Button/src/JUploadButton.vue';
+  import moment from 'moment';
+
+  const formRef = ref();
+  const queryParam = reactive<any>({});
+  const toggleSearchStatus = ref<boolean>(false);
+  const registerModal = ref();
+  const userStore = useUserStore();
+  const selectSiteRef = ref(null);
+  const { createMessage } = useMessage();
+  //注册table数据
+  const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
+    tableProps: {
+      title: '询盘信息存储表单',
+      api: list,
+      columns,
+      canResize: false,
+      useSearchForm: false,
+      actionColumn: {
+        width: 120,
+        fixed: 'right',
+      },
+      immediate: false, // 不直接触发,通过reload事件触发接口
+      beforeFetch: (params) => {
+
+        // TODO 初次进入,获取site code,
+        console.log(queryParam,localStorage.getItem('siteCode'), "queryParamqueryParamqueryParam")
+        return Object.assign(params, queryParam);
+      },
     },
-    beforeFetch: (params) => {
-      return Object.assign(params, queryParam);
+    exportConfig: {
+      name: '询盘信息存储表单',
+      url: getExportUrl,
+      params: queryParam,
     },
-  },
-  exportConfig: {
-    name: "询盘信息存储表单",
-    url: getExportUrl,
-    params: queryParam,
-  },
-  importConfig: {
-    url: getImportUrl,
-    success: handleSuccess
-  },
-});
-const [registerTable, {
-  reload,
-  collapseAll,
-  updateTableDataRecord,
-  findTableDataRecord,
-  getDataSource
-}, {rowSelection, selectedRowKeys}] = tableContext;
-
-const labelCol = reactive({
-  xs: 24,
-  sm: 4,
-  xl: 6,
-  xxl: 4
-});
-const wrapperCol = reactive({
-  xs: 24,
-  sm: 20,
-});
-let siteCode: string | null = ref('');
-let siteList = ref([]);
-
-const enquiryNums = ref({
-  'all': 0,
-  'noRead': 0,
-  'product': 0,
-  'wait': 0
-});
-
-let rangeDate: (moment.Moment)[] = ref(undefined);
-
-let subAccountOptions = ref([]);
-
-let haveSubAccount = ref(false);
-
-onMounted(async() => {
-
-})
-
-function getSiteList(siteInfo, selectedSiteInfo) {
-  siteList = siteInfo
-  if (siteList.length === 1) {
-    queryParam.siteId = siteList[0].id
-  } else {
-    let isInSite = false
-    for (let i in siteList) {
-      if (localStorage.getItem('siteCode') !== null && siteList[i].code === localStorage.getItem('siteCode')) {
-        isInSite = true
-        queryParam.siteId = siteList[i].id
-      }
-    }
-    if (localStorage.getItem('siteCode') !== null && isInSite) {
+    importConfig: {
+      url: getImportUrl,
+      success: handleSuccess,
+    },
+  });
+  const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
+
+  const labelCol = reactive({
+    xs: 24,
+    sm: 4,
+    xl: 6,
+    xxl: 4,
+  });
+  const wrapperCol = reactive({
+    xs: 24,
+    sm: 20,
+  });
+  let siteCode: string | null = ref('');
+  let siteList = ref([]);
+
+  const enquiryNums = ref({
+    all: 0,
+    noRead: 0,
+    product: 0,
+    wait: 0,
+  });
+
+  let rangeDate: moment.Moment[] = ref(undefined);
+
+  let subAccountOptions = ref([]);
+
+  let haveSubAccount = ref(false);
+
+  onMounted(async () => {});
+
+  function getSiteList(siteInfo, selectedSiteInfo) {
+    siteList.value = siteInfo;
+
+    if (siteList.value.length === 1) {
+      queryParam.siteId = siteList.value[0].id;
     } else {
-      queryParam.siteId = siteList[0].id
-      localStorage.setItem('siteCode', siteList[0].code)
+      let isInSite = false;
+      for (let site in siteList.value) {
+        if (localStorage.getItem('siteCode') !== null && site.code === localStorage.getItem('siteCode')) {
+          isInSite = true;
+          queryParam.siteId = site.id;
+        }
+      }
+      if (localStorage.getItem('siteCode') !== null && isInSite) {
+      } else {
+        queryParam.siteId = siteList.value[0].id;
+        localStorage.setItem('siteCode', siteList.value[0].code);
+      }
     }
+
+    //如果首页查询数据,直接走下面,return掉,防止接口多次请求
+    // if (routerQuery.timeType) {
+    //   let start
+    //   if (routerQuery.timeType == 'thisWeek') {
+    //     start = moment().subtract(moment().day() - 1, 'days').format('YYYY-MM-DD')
+    //   }
+    //   if (routerQuery.timeType == 'thisMonth') {
+    //     start = moment().startOf('month').format('YYYY-MM-DD');
+    //   }
+    //   let end = moment().format('YYYY-MM-DD')
+    //   rangeDate = [moment(start), moment(end)];
+    //   queryParam.start = start
+    //   queryParam.end = end
+    //   queryParam.dateType = undefined
+    //   getTableAndNum();
+    //   return
+    // }
+
+    // if (routerQuery.siteCode) {
+    //   queryParam.siteId = Number(routerQuery.siteCode)
+    // }
+    getTableAndNumWithQueryCondition();
   }
 
+  //重新刷新页面数据及获取询盘数量,不清除查询条件
+  function getTableAndNumWithQueryCondition() {
+    getEnquiryNums();
+    getSubAccountOptions();
+    loadData();
+  }
 
-  //如果首页查询数据,直接走下面,return掉,防止接口多次请求
-  // if (routerQuery.timeType) {
-  //   let start
-  //   if (routerQuery.timeType == 'thisWeek') {
-  //     start = moment().subtract(moment().day() - 1, 'days').format('YYYY-MM-DD')
-  //   }
-  //   if (routerQuery.timeType == 'thisMonth') {
-  //     start = moment().startOf('month').format('YYYY-MM-DD');
-  //   }
-  //   let end = moment().format('YYYY-MM-DD')
-  //   rangeDate = [moment(start), moment(end)];
-  //   queryParam.start = start
-  //   queryParam.end = end
-  //   queryParam.dateType = undefined
-  //   getTableAndNum();
-  //   return
-  // }
-
-  // if (routerQuery.siteCode) {
-  //   queryParam.siteId = Number(routerQuery.siteCode)
-  // }
-  getTableAndNumWithQueryCondition()
-}
-
-//重新刷新页面数据及获取询盘数量,不清除查询条件
-function getTableAndNumWithQueryCondition() {
-  getEnquiryNums();
-  getSubAccountOptions();
-  loadData();
-}
-
-//切换站点
-function changeSite(value, e) {
-  queryParam.siteId = e.info.id;
-  siteCode = localStorage.getItem('siteCode');
-  getTableAndNum(undefined, true)
-}
-
-//重新刷新页面数据及获取询盘数量
-function getTableAndNum(arg, clearParam) {
-  // 设置默认站点
-  let siteId = queryParam.siteId;
-
-  for (let site of siteList) {
-    if (site.id === siteId) {
-      localStorage.setItem("siteCode", site.code);
-    }
+  //切换站点
+  function changeSite(value, e) {
+    queryParam.siteId = e.info.id;
+    siteCode.value = localStorage.getItem('siteCode');
+    getTableAndNum(undefined, true);
   }
 
-  getEnquiryNums()
-  getSubAccountOptions();
-  if (clearParam) {
-    if (queryParam.readStatus) {
-      delete queryParam.readStatus
-    }
-    if (queryParam.searchText) {
-      delete queryParam.searchText
-    }
-    if (queryParam.searchContent) {
-      delete queryParam.searchContent
+  //重新刷新页面数据及获取询盘数量
+  function getTableAndNum(arg, clearParam) {
+    // 设置默认站点
+    let siteId = queryParam.siteId;
+
+    for (let site of siteList.value) {
+      if (site.id === siteId) {
+        localStorage.setItem('siteCode', site.code);
+      }
     }
-    if (queryParam.userEffective) {
-      delete queryParam.userEffective
+
+    getEnquiryNums();
+    getSubAccountOptions();
+    if (clearParam) {
+      if (queryParam.readStatus) {
+        delete queryParam.readStatus;
+      }
+      if (queryParam.searchText) {
+        delete queryParam.searchText;
+      }
+      if (queryParam.searchContent) {
+        delete queryParam.searchContent;
+      }
+      if (queryParam.userEffective) {
+        delete queryParam.userEffective;
+      }
+      if (queryParam.principalUid) {
+        delete queryParam.principalUid;
+      }
     }
-    if (queryParam.principalUid) {
-      delete queryParam.principalUid;
+
+    queryParam.fields = 'id,,siteName,contact,fromEmail,whatsApp,phone,fromIp,readStatus,details,principalUid,fromPage,userEffective,countryName,pluginName,recordCtime,action';
+    queryParam.userEffective = '1,2';
+    loadData();
+  }
+
+  //搜索条件部分的逻辑
+  function onChangeDatePciker(date, dateString) {
+    if (dateString.length > 0) {
+      rangeDate.value = date;
+      queryParam.start = dateString[0];
+      queryParam.end = dateString[1];
+      queryParam.dateType = undefined;
     }
   }
-  loadData()
-}
-
-//搜索条件部分的逻辑
-function onChangeDatePciker(date, dateString) {
-  if (dateString.length > 0) {
-    rangeDate = date
-    queryParam.start = dateString[0]
-    queryParam.end = dateString[1]
-    queryParam.dateType = undefined
+
+  //日期选择只能今天之前
+  function disabledDate(current) {
+    return current && current > moment().endOf('day');
   }
-}
-
-//日期选择只能今天之前
-function disabledDate(current) {
-  return current && current > moment().endOf('day');
-}
-
-//设置列表的时间查询条件
-function setTime(time) {
-  queryParam.dateType = time
-  queryParam.start = ''
-  queryParam.end = ''
-  // sevenDay   thirtyDay  today  yesterday
-  if (time == '') {
-    rangeDate = undefined
-  } else if (time == 'sevenDay') {
-    rangeDate = [moment().subtract(6, "days"), moment()]
-  } else if (time == 'thirtyDay') {
-    rangeDate = [moment().subtract(29, "days"), moment()]
-  } else if (time == 'today') {
-    rangeDate = [moment(), moment()]
-  } else if (time == 'yesterday') {
-    rangeDate = [moment().subtract(1, "days"), moment().subtract(1, "days")]
+
+  //设置列表的时间查询条件
+  function setTime(time) {
+    queryParam.dateType = time;
+    queryParam.start = '';
+    queryParam.end = '';
+    // sevenDay   thirtyDay  today  yesterday
+    if (time == '') {
+      rangeDate.value = undefined;
+    } else if (time == 'sevenDay') {
+      rangeDate.value = [moment().subtract(6, 'days'), moment()];
+    } else if (time == 'thirtyDay') {
+      rangeDate.value = [moment().subtract(29, 'days'), moment()];
+    } else if (time == 'today') {
+      rangeDate.value = [moment(), moment()];
+    } else if (time == 'yesterday') {
+      rangeDate.value = [moment().subtract(1, 'days'), moment().subtract(1, 'days')];
+    }
+    getTableAndNum();
   }
-  getTableAndNum()
-}
 
-//获取不同状态询盘的数量
-function getEnquiryNums() {
-  let siteId = ''
+  //获取不同状态询盘的数量
+  function getEnquiryNums() {
+    let siteId = '';
 
-  if (queryParam.siteId && queryParam.siteId != '') {
-    siteId = queryParam.siteId
-  } else {
-    siteId = ''
-  }
-  let d = {
-    siteId: siteId,
-    dateType: queryParam.dateType,
-    start: queryParam.start,
-    end: queryParam.end
-  }
-  getAction('/adweb/adwebEnquiry/getEnquiryNums', d).then(res => {
-    if (res.code == 200) {
-      enquiryNums.value.all = siteList.all
-      enquiryNums.value.noRead = siteList.noRead
-      enquiryNums.value.product = siteList.product
-      enquiryNums.value.wait = siteList.wait
+    if (queryParam.siteId && queryParam.siteId != '') {
+      siteId = queryParam.siteId;
     } else {
-      enquiryNums.value.all = 0
-      enquiryNums.value.noRead = 0
-      enquiryNums.value.product = 0
-      enquiryNums.value.wait = 0
+      siteId = '';
     }
+    let d = {
+      siteId: siteId,
+      dateType: queryParam.dateType,
+      start: queryParam.start,
+      end: queryParam.end,
+    };
+    getAction('/adweb/adwebEnquiry/getEnquiryNums', d).then((res) => {
+      if (res.code == 200) {
+        enquiryNums.value.all = siteList.value.all;
+        enquiryNums.value.noRead = siteList.value.noRead;
+        enquiryNums.value.product = siteList.value.product;
+        enquiryNums.value.wait = siteList.value.wait;
+      } else {
+        enquiryNums.value.all = 0;
+        enquiryNums.value.noRead = 0;
+        enquiryNums.value.product = 0;
+        enquiryNums.value.wait = 0;
+      }
+    });
+  }
 
-  })
-}
+  // 获取子账户的下拉框选项
+  function getSubAccountOptions() {
+    getAction('/usercountry/subAccounts/options?siteId=' + queryParam.siteId, null).then((res) => {
+      if (res.code === 200) {
+        subAccountOptions.value = siteList;
+        haveSubAccount.value = siteList.value !== null && siteList.value !== undefined && siteList.value.length > 0;
+      }
+    });
+  }
 
-// 获取子账户的下拉框选项
-function getSubAccountOptions() {
+  function loadData() {
+    reload();
+  }
 
-  getAction('/usercountry/subAccounts/options?siteId=' + queryParam.siteId, null).then(res => {
-    if (res.code === 200) {
-      subAccountOptions = siteList;
-      haveSubAccount = siteList !== null && siteList !== undefined && siteList.length > 0;
-    }
-  })
-}
-
-function loadData() {
-  reload()
-}
-
-// 高级查询配置
-const superQueryConfig = reactive(superQuerySchema);
-
-/**
- * 高级查询事件
- */
-function handleSuperQuery(params) {
-  Object.keys(params).map((k) => {
-    queryParam[k] = params[k];
-  });
-  searchQuery();
-}
-
-/**
- * 新增事件
- */
-function handleAdd() {
-  registerModal.value.disableSubmit = false;
-  registerModal.value.add();
-}
-
-/**
- * 编辑事件
- */
-function handleEdit(record: Recordable) {
-  registerModal.value.disableSubmit = false;
-  registerModal.value.edit(record);
-}
-
-/**
- * 详情
- */
-function handleDetail(record: Recordable) {
-  registerModal.value.disableSubmit = true;
-  registerModal.value.edit(record);
-}
-
-/**
- * 删除事件
- */
-async function handleDelete(record) {
-  await deleteOne({id: record.id}, handleSuccess);
-}
-
-/**
- * 批量删除事件
- */
-async function batchHandleDelete() {
-  await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
-}
-
-/**
- * 成功回调
- */
-function handleSuccess() {
-  (selectedRowKeys.value = []) && reload();
-}
-
-/**
- * 操作栏
- */
-function getTableAction(record) {
-  return [
-    {
-      label: '编辑',
-      onClick: handleEdit.bind(null, record),
-    },
-  ];
-}
-
-/**
- * 下拉操作栏
- */
-function getDropDownAction(record) {
-  return [
-    {
-      label: '详情',
-      onClick: handleDetail.bind(null, record),
-    }, {
-      label: '删除',
-      popConfirm: {
-        title: '是否确认删除',
-        confirm: handleDelete.bind(null, record),
-        placement: 'topLeft',
-      }
-    }
-  ]
-}
-
-/**
- * 查询
- */
-function searchQuery() {
-  reload();
-}
-
-/**
- * 重置
- */
-function searchReset() {
-  formRef.value.resetFields();
-  selectedRowKeys.value = [];
-  //刷新数据
-  reload();
-}
+  // 高级查询配置
+  const superQueryConfig = reactive(superQuerySchema);
+
+  /**
+   * 高级查询事件
+   */
+  function handleSuperQuery(params) {
+    Object.keys(params).map((k) => {
+      queryParam[k] = params[k];
+    });
+    searchQuery();
+  }
 
+  /**
+   * 新增事件
+   */
+  function handleAdd() {
+    registerModal.value.disableSubmit = false;
+    registerModal.value.add();
+  }
 
-</script>
+  /**
+   * 编辑事件
+   */
+  function handleEdit(record: Recordable) {
+    registerModal.value.disableSubmit = false;
+    registerModal.value.edit(record);
+  }
 
-<style lang="less" scoped>
-.jeecg-basic-table-form-container {
-  padding: 0;
+  /**
+   * 详情
+   */
+  function handleDetail(record: Recordable) {
+    registerModal.value.disableSubmit = true;
+    registerModal.value.edit(record);
+  }
 
-  .table-page-search-submitButtons {
-    display: block;
-    margin-bottom: 24px;
-    white-space: nowrap;
+  /**
+   * 删除事件
+   */
+  async function handleDelete(record) {
+    await deleteOne({ id: record.id }, handleSuccess);
   }
 
-  .query-group-cust {
-    min-width: 100px !important;
+  /**
+   * 批量删除事件
+   */
+  async function batchHandleDelete() {
+    await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
   }
 
-  .query-group-split-cust {
-    width: 30px;
-    display: inline-block;
-    text-align: center
+  /**
+   * 成功回调
+   */
+  function handleSuccess() {
+    (selectedRowKeys.value = []) && reload();
   }
 
-  .ant-form-item:not(.ant-form-item-with-help) {
-    margin-bottom: 16px;
-    height: 32px;
+  /**
+   * 操作栏
+   */
+  function getTableAction(record) {
+    return [
+      {
+        label: '编辑',
+        onClick: handleEdit.bind(null, record),
+      },
+    ];
   }
 
-  :deep(.ant-picker), :deep(.ant-input-number) {
-    width: 100%;
+  /**
+   * 下拉操作栏
+   */
+  function getDropDownAction(record) {
+    return [
+      {
+        label: '详情',
+        onClick: handleDetail.bind(null, record),
+      },
+      {
+        label: '删除',
+        popConfirm: {
+          title: '是否确认删除',
+          confirm: handleDelete.bind(null, record),
+          placement: 'topLeft',
+        },
+      },
+    ];
+  }
+
+  /**
+   * 查询
+   */
+  function searchQuery() {
+    reload();
+  }
+
+  /**
+   * 重置
+   */
+  function searchReset() {
+    formRef.value.resetFields();
+    selectedRowKeys.value = [];
+    //刷新数据
+    reload();
+  }
+</script>
+
+<style lang="less" scoped>
+  .jeecg-basic-table-form-container {
+    padding: 0;
+
+    .table-page-search-submitButtons {
+      display: block;
+      margin-bottom: 24px;
+      white-space: nowrap;
+    }
+
+    .query-group-cust {
+      min-width: 100px !important;
+    }
+
+    .query-group-split-cust {
+      width: 30px;
+      display: inline-block;
+      text-align: center;
+    }
+
+    .ant-form-item:not(.ant-form-item-with-help) {
+      margin-bottom: 16px;
+      height: 32px;
+    }
+
+    :deep(.ant-picker),
+    :deep(.ant-input-number) {
+      width: 100%;
+    }
   }
-}
 </style>