Przeglądaj źródła

feat: 问题修改

sunxiao 3 miesięcy temu
rodzic
commit
369183a303

+ 0 - 2
src/layout/components/HeaderGroup/TelCallBoard.vue

@@ -1,5 +1,4 @@
 <script setup>
-import { ElMessage } from 'element-plus'
 import { storeToRefs } from 'pinia';
 import useVoiceStore from "@/store/modules/voice";
 import iconCallOn from '@/assets/images/header/icon-call-on.svg';
@@ -16,7 +15,6 @@ const inputNums = ref(null);
 
 const isPlay = ref(false);
 
-const num = ref(null);
 const boardNums = [1, 2, 3, 4, 5, 6, 7, 8, 9,'*', 0, '#']
 
 // 计算属性 - 切换状态图标

+ 2 - 2
src/layout/components/HeaderGroup/index.vue

@@ -45,12 +45,12 @@ const handleCommand = (command) => {
 }
 
 const logout = () => {
-  ElMessageBox.confirm('确定注销并退出系统吗?', '提示', {
+  ElMessageBox.confirm('确定退出系统吗?', '提示', {
     confirmButtonText: '确定',
     cancelButtonText: '取消',
     type: 'warning'
   }).then(async () => {
-
+    localStorage.removeItem('VOICE_STATUS')
     if ( voiceStore.isAuthPane ) {
       await voiceStore.unInit();
     }

+ 1 - 1
src/layout/components/Navbar.vue

@@ -83,7 +83,7 @@ function handleCommand(command) {
 }
 
 function logout() {
-  ElMessageBox.confirm('确定注销并退出系统吗?', '提示', {
+  ElMessageBox.confirm('确定退出系统吗?', '提示', {
     confirmButtonText: '确定',
     cancelButtonText: '取消',
     type: 'warning'

+ 18 - 6
src/layout/index.vue

@@ -26,13 +26,25 @@ onMounted(() => {
     workbenchApi.getSeatsByUser({ userId: useUser.id }).then(({ data }) => {
       if (!data) return;
       useVoice.HS_CTI_INSTANCE(data.outId);
-      setTimeout(() => {
-        try {
-          useVoice.setIdle();
-        } catch(error) {
-          console.log(error);
+
+      const voiceStatus = localStorage.getItem('VOICE_STATUS');
+
+      if ( voiceStatus ) {
+        if ( voiceStatus === 'busy' ) {
+          setTimeout(() => useVoice.setBusy(), 1000);
+        } else {
+          setTimeout(() => useVoice.setIdle(), 1000);
         }
-      }, 3000);
+        // useVoice.systemState = voiceStatus !== 'busy'
+      } else {
+        setTimeout(() => {
+          try {
+            useVoice.setIdle();
+          } catch(error) {
+            console.log(error);
+          }
+        }, 3000);
+      }
     })
   }
 })

+ 11 - 2
src/store/modules/voice.js

@@ -115,12 +115,14 @@ const useVoiceStore = defineStore('voice', () => {
 
   // 置忙
   const setBusy = () => {
+    localStorage.setItem('VOICE_STATUS', 'busy');
     systemState.value = false;
     HS_CTI.setBusy().then(res => { console.log(res) });
   };
 
   // 置闲
   const setIdle = () => {
+    localStorage.setItem('VOICE_STATUS', 'idle');
     systemState.value = true;
     HS_CTI.setIdle().then(res => { console.log(res) });
   }
@@ -152,7 +154,7 @@ const useVoiceStore = defineStore('voice', () => {
 
   // 下面开始事件监听
   const listenScoketEvent = (CTIEvent) => {
-    HS_CTI.on(CTIEvent.OnAgentWorkReport, ({ workStatus, description, callId, phone }) => {
+    HS_CTI.on(CTIEvent.OnAgentWorkReport, async ({ workStatus, description, callId, phone }) => {
 
       console.log( "-----------------------" );
       console.log( "-----------------------" );
@@ -161,13 +163,20 @@ const useVoiceStore = defineStore('voice', () => {
       console.log( "-----------------------" );
       console.log( "-----------------------" );
 
+
+
       // 销毁实例调用签出接口成功后 - 坐席签出
       if ( workStatus === -1 ) {
         ElMessage({
-          message: '坐席签出成功',
+          message: '当前坐席签出',
           type: 'success',
           plain: true,
         })
+        await unInit();
+        localStorage.removeItem('VOICE_STATUS');
+        userStore.logOut().then(() => {
+          location.href = '/index';
+        })
       }
 
       // 登录CTI 成功

+ 1 - 0
src/utils/request.js

@@ -83,6 +83,7 @@ service.interceptors.response.use(res => {
       return res.data
     }
     if (code === 401) {
+      localStorage.removeItem('VOICE_STATUS');
       if (!isRelogin.show) {
         isRelogin.show = true;
         ElMessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(async () => {

+ 40 - 134
src/views/voice/analyse/index.vue

@@ -1,122 +1,13 @@
 <script setup>
 import { analyseApi } from '@/api/voice/analyse';
-import BaseLayoutViewport from '@/components/BaseLayout';
-const total = ref(0);
-const value1 = ref('');
 
 const callRecordCountInfo = ref({});
 const userTableData = ref([]);
 const robotTableData = ref([]);
 
-const queryParams = ref({
-  pageNum: 1,
-  pageSize: 10
-})
-const options = [
-  {
-    value: 'Option1',
-    label: 'Option1',
-  },
-  {
-    value: 'Option2',
-    label: 'Option2',
-  },
-  {
-    value: 'Option3',
-    label: 'Option3',
-  },
-  {
-    value: 'Option4',
-    label: 'Option4',
-  },
-  {
-    value: 'Option5',
-    label: 'Option5',
-  },
-]
-
-const tableData = [
-  {
-    date: '2016-05-03',
-    name: 'Tom',
-    address: 'No. 189, Grove St, Los Angeles',
-  },
-  {
-    date: '2016-05-02',
-    name: 'Tom',
-    address: 'No. 189, Grove St, Los Angeles',
-  },
-  {
-    date: '2016-05-04',
-    name: 'Tom',
-    address: 'No. 189, Grove St, Los Angeles',
-  },
-  {
-    date: '2016-05-01',
-    name: 'Tom',
-    address: 'No. 189, Grove St, Los Angeles',
-  },{
-    date: '2016-05-03',
-    name: 'Tom',
-    address: 'No. 189, Grove St, Los Angeles',
-  },
-  {
-    date: '2016-05-02',
-    name: 'Tom',
-    address: 'No. 189, Grove St, Los Angeles',
-  },
-  {
-    date: '2016-05-04',
-    name: 'Tom',
-    address: 'No. 189, Grove St, Los Angeles',
-  },
-  {
-    date: '2016-05-01',
-    name: 'Tom',
-    address: 'No. 189, Grove St, Los Angeles',
-  },{
-    date: '2016-05-03',
-    name: 'Tom',
-    address: 'No. 189, Grove St, Los Angeles',
-  },
-  {
-    date: '2016-05-02',
-    name: 'Tom',
-    address: 'No. 189, Grove St, Los Angeles',
-  },
-  {
-    date: '2016-05-04',
-    name: 'Tom',
-    address: 'No. 189, Grove St, Los Angeles',
-  },
-  {
-    date: '2016-05-01',
-    name: 'Tom',
-    address: 'No. 189, Grove St, Los Angeles',
-  },{
-    date: '2016-05-03',
-    name: 'Tom',
-    address: 'No. 189, Grove St, Los Angeles',
-  },
-  {
-    date: '2016-05-02',
-    name: 'Tom',
-    address: 'No. 189, Grove St, Los Angeles',
-  },
-  {
-    date: '2016-05-04',
-    name: 'Tom',
-    address: 'No. 189, Grove St, Los Angeles',
-  },
-  {
-    date: '2016-05-01',
-    name: 'Tom',
-    address: 'No. 189, Grove St, Los Angeles',
-  },
-]
-
 const formatNum = num => {
-  return Number(num === null ? 0 : num.toFixed(2)) + '%';
+  return num + '%';
+  // return (Number(num === null ? 0 : num.toFixed(2))).toFixed() + '%';
 }
 
 onMounted(() => {
@@ -127,7 +18,8 @@ onMounted(() => {
       humanPercent: formatNum(humanPercent),
       aiPercent: formatNum(aiPercent),
       traditionPercent: formatNum(traditionPercent),
-      whiteListPercent: formatNum(whiteListPercent)
+      whiteListPercent: formatNum(whiteListPercent),
+
     };
   })
 
@@ -139,7 +31,7 @@ onMounted(() => {
       4: '后处理',
       5: '拨号中'
     }
-    userTableData.value = data.map(item => ({
+    userTableData.value = data.filter(Boolean).map(item => ({
       ...item,
       statusText: statusEnum[item.status]
     }));
@@ -148,7 +40,6 @@ onMounted(() => {
   analyseApi.getRobotCallCount().then(({ data }) => {
     robotTableData.value = data;
   })
-
 })
 </script>
 
@@ -185,43 +76,50 @@ onMounted(() => {
                 <div>
                   <p class="card-sub-title">白名单直呼</p>
                   <ul class="flex items-center justify-center pt-[5px]">
-                    <li>
-                      <span class="text">电话量</span>
+                    <li class="card-label">
+                      <span class="text">呼入量</span>
                       <span class="num">{{ callRecordCountInfo.whiteListTotal }}</span>
                     </li>
                     <li class="line"></li>
-                    <li>
+                    <li class="card-label">
                       <span class="text">总量占比</span>
                       <span class="num">{{ callRecordCountInfo.whiteListPercent }}</span>
                     </li>
                   </ul>
                   <p class="count-num pt-[8px]">12345转入次数 <span class="text-[#65C734] font-bold">{{ callRecordCountInfo.specialCount }}</span></p>
                 </div>
+
                 <div>
                   <p class="card-sub-title">AI机器人</p>
                   <ul class="flex items-center justify-center pt-[5px]">
-                    <li>
+                    <li class="card-label">
                       <span class="text">电话量</span>
                       <span class="num">{{ callRecordCountInfo.aiTotal }}</span>
                     </li>
                     <li class="line"></li>
-                    <li>
+                    <li class="card-label">
                       <span class="text">总量占比</span>
                       <span class="num">{{ callRecordCountInfo.aiPercent }}</span>
                     </li>
                   </ul>
                   <p class="count-num pt-[8px]">转人工次数 <span class="text-[#65C734] font-bold">{{ callRecordCountInfo.transferCount }}</span></p>
                 </div>
+
                 <div>
                   <p class="card-sub-title">传统服务</p>
                   <ul class="flex items-center justify-center pt-[5px]">
-                    <li>
-                      <span class="text">电话量</span>
+                    <li class="card-label">
+                      <span class="text">呼入量</span>
                       <span class="num">{{ callRecordCountInfo.traditionTotal }}</span>
                     </li>
                     <li class="line"></li>
-                    <li>
-                      <span class="text">总量占比</span>
+                    <li class="card-label">
+                      <span class="text">呼出量</span>
+                      <span class="num">{{ callRecordCountInfo.traditionTotal }}</span>
+                    </li>
+                    <li class="line"></li>
+                    <li class="card-label">
+                      <span class="text">呼出量</span>
                       <span class="num">{{ callRecordCountInfo.traditionPercent }}</span>
                     </li>
                   </ul>
@@ -232,11 +130,11 @@ onMounted(() => {
         </div>
   
         <div class="layout-card">
-          <h4 class="title">人工客服状态</h4>
+          <h4 class="title">人工客服当前状态</h4>
           <ul class="status-list">
             <li class="status-item">
               <span class="text">登录总数</span>
-              <span class="num">{{ callRecordCountInfo.transferCount }}</span>
+              <span class="num">{{ callRecordCountInfo.totalPerson }}</span>
             </li>
             <li class="status-item">
               <span class="text">置闲</span>
@@ -258,24 +156,23 @@ onMounted(() => {
               <span class="text">累计通话</span>
               <span class="num">{{ callRecordCountInfo.personCount }}</span>
             </li>
-            <li class="status-item">
+            <!-- <li class="status-item">
               <span class="text">累计通话时长</span>
               <p >
                 <span class="num">{{ callRecordCountInfo.personTotal }}</span>
                 <span class="text-[14px]"> h</span>
               </p>
-              
-            </li>
+            </li> -->
           </ul>
         </div>
   
         <div class="layout-card">
-          <h4 class="title">机器人客服状态</h4>
+          <h4 class="title">机器人客服当前状态</h4>
           <ul class="status-list robot-list">
             <li class="status-item">
               <div class="status-item-inner">
                 <span class="text">在线</span>
-                <span class="num">{{ callRecordCountInfo.robotOnLineCount }}</span>
+                <span class="num">{{ 20 || callRecordCountInfo.robotOnLineCount }}</span>
               </div>
             </li>
             <li class="status-item">
@@ -297,13 +194,13 @@ onMounted(() => {
                 <span class="num">{{ callRecordCountInfo.robotCount }}</span>
               </div>
             </li>
-            <li class="status-item">
+            <!-- <li class="status-item">
               <div class="status-item-inner">
                 <span class="text">累计通话时长</span>
                 <span class="num">{{ callRecordCountInfo.robotTotal }}</span>
                 <span class="text-[14px]"> h</span>
               </div>
-            </li>
+            </li> -->
           </ul>
         </div>
   
@@ -318,7 +215,7 @@ onMounted(() => {
             <el-table-column prop="inAllCount" label="累计呼入" align="center" />
             <el-table-column prop="outTodayCount" label="今日呼出" align="center" />
             <el-table-column prop="outAllCount" label="累计呼出" align="center" />
-            <el-table-column prop="totalTimes" label="累计通话时长" align="center" />
+            <!-- <el-table-column prop="totalTimes" label="累计通话时长" align="center" /> -->
           </el-table>
         </div>
 
@@ -342,6 +239,7 @@ onMounted(() => {
 <style lang="scss" scoped>
 .analyse-container {
   background: #f1f5fd;
+
   .layout-card {
     width: 100%;
     padding: 20px;
@@ -363,13 +261,20 @@ onMounted(() => {
     align-items: center;
 
     .analyse-item-box {
+      .card-label {
+        min-width: 60px;
+        .text,.num {
+          text-align: center;
+        }
+      }
+
       &:nth-child(1) {
         flex: 1;
       }
 
       &:nth-child(2) {
         position: relative;
-        flex: 2;
+        flex: 1.5;
 
         &::before {
           content: ' ';
@@ -412,6 +317,7 @@ onMounted(() => {
 
       .card-sub-title {
         padding-top: 5px;
+        text-align: center;
         font-size: 10px;
         line-height: 20px;
         color: #165DFF;

+ 2 - 2
src/views/voice/notice/add.vue

@@ -98,11 +98,11 @@ onMounted(() => {
 
 
   // 泵站
-  servicesApi.getPumpingList().then(res => {
+  servicesApi.getPumpingList({pageSize: 10000, pageNum: 1}).then(res => {
     pumpingOptions.value = res.data;
   })
   // 小区
-  servicesApi.getNeighborhoodList().then(res => {
+  servicesApi.getNeighborhoodList({pageSize: 10000, pageNum: 1}).then(res => {
     housingOptions.value = res.rows;
   })
 

+ 35 - 24
src/views/voice/services/index.vue

@@ -70,7 +70,6 @@ const floorList = computed(() => {
 
 // 关联数据
 const contactCheckData = computed(() => {
-  console.log("dialogDataSource.value", dialogDataSource.value);
   const result = dialogDataSource.value.map(({ name, checkList }) => {
     const tempObj = { name, floorList: '' };
     tempObj.floorList = checkList.map(item => item.buildingsNames).join('、');
@@ -84,17 +83,19 @@ const props = {
   lazyLoad: async (node, resolve) => {
     let nodes = null;
     const { level } = node;
-    switch( level ) {
-      case 0 :
-        nodes = await getCityTree({ type: 1 }, level);
-        break;
-      case 1 :
-        nodes = await getCityTree({ type: 2, pid: node.value }, level);
-        break;
-      case 2 :
-        nodes = await getCityTree({ type: 3, pid: node.value}, level)
-        break;
-    }
+    nodes = await getCityTree({ type: 3, pid: 10000101 }, level);
+    // switch( level ) {
+    //   case 0 :
+    //     nodes = await getCityTree({ type: 2, pid: 10000101 }, level);
+    //     // nodes = await getCityTree({ type: 1 }, level);
+    //     break;
+    //   case 1 :
+    //     nodes = await getCityTree({ type: 2, pid: node.value }, level);
+    //     break;
+    //   case 2 :
+    //     nodes = await getCityTree({ type: 3, pid: node.value}, level)
+    //     break;
+    // }
     resolve( nodes );
   }
 }
@@ -104,7 +105,8 @@ async function getCityTree (params, level) {
   const nodes = data.map(item => ({
     value: item.id,
     label: item.name,
-    leaf: level >= 2,
+    // leaf: level >= 2,
+    leaf: level == 0,
   }))
   return nodes;
 }
@@ -190,7 +192,8 @@ const handleEditData = ({ id, name, buildingsNames, address, provinceId, cityId,
     housingFormData.value = {
       id,
       name,
-      selectOptions: [provinceId, cityId, countryId],
+      // selectOptions: [provinceId, cityId, countryId],
+      selectOptions: [countryId],
       address,
       buildingNameList: buildingsNames.split('、')
     }
@@ -199,7 +202,8 @@ const handleEditData = ({ id, name, buildingsNames, address, provinceId, cityId,
     pumpFormData.value = {
       id,
       name,
-      selectOptions: [provinceId, cityId, countryId],
+      // selectOptions: [provinceId, cityId, countryId],
+      selectOptions: [countryId],
     }
     pumpDialogVisible.value = true;
   }
@@ -222,12 +226,13 @@ const onHousingDialogConfirm = () => {
   housingFormRef.value.validate(async (valid, fields) => {
     if (valid) {
       const { id, name, selectOptions, address, buildingNameList } = housingFormData.value;
-      const [provinceId, cityId, countryId] = selectOptions;
+      // const [provinceId, cityId, countryId] = selectOptions;
+      const [countryId] = selectOptions;
       if ( id ) {
-        await servicesApi.putNeighborhood({ id, name, address, buildingNameList, provinceId, cityId, countryId })
+        await servicesApi.putNeighborhood({ id, name, address, buildingNameList, countryId })
         ElMessage.success('小区修改成功')
       } else {
-        await servicesApi.postNeighborhood({ name, address, buildingNameList, provinceId, cityId, countryId })
+        await servicesApi.postNeighborhood({ name, address, buildingNameList, countryId })
         ElMessage.success('小区新增成功')
       }
       resetHousingData();
@@ -242,13 +247,16 @@ const onPumpDialogConfirm = () => {
   pumpFormRef.value.validate(async (valid, fields) => {
     if (valid) {
       const { id, name, selectOptions } = pumpFormData.value;
-      const [provinceId, cityId, countryId] = selectOptions;
+      const [countryId] = selectOptions;
+      // const [provinceId, cityId, countryId] = selectOptions;
 
       if ( id ) {
-        await servicesApi.putStation({ name, provinceId, cityId, countryId, id })
+        // await servicesApi.putStation({ name, provinceId, cityId, countryId, id })
+        await servicesApi.putStation({ name,  countryId, id })
         ElMessage.success('泵站修改成功')
       } else {
-        await servicesApi.postStation({ name, provinceId, cityId, countryId })
+        await servicesApi.postStation({ name, countryId })
+        // await servicesApi.postStation({ name, provinceId, cityId, countryId })
         ElMessage.success('泵站新增成功')
       }
       resetHousingData();
@@ -329,16 +337,19 @@ const onRelationCancel = () => {
 const getList = async () => {
   loading.value = true;
 
-  const [ provinceId, cityId, countryId ] = adressValue.value;
+  // const [ provinceId, cityId, countryId ] = adressValue.value;
+  const [ countryId ] = adressValue.value;
   let rows = null;
   let t = null;
 
   if ( activeName.value === 'first' ) {
-    const res = await servicesApi.getNeighborhoodList({ ...queryParams.value, provinceId, cityId, countryId });
+    // const res = await servicesApi.getNeighborhoodList({ ...queryParams.value, provinceId, cityId, countryId });
+    const res = await servicesApi.getNeighborhoodList({ ...queryParams.value, countryId });
     rows = res.rows;
     t = res.total;
   } else {
-    const res = await servicesApi.getStationList({ ...queryParams.value, provinceId, cityId, countryId });
+    // const res = await servicesApi.getStationList({ ...queryParams.value, provinceId, cityId, countryId });
+    const res = await servicesApi.getStationList({ ...queryParams.value, countryId });
     rows = res.rows;
     t = res.total;
   }