Forráskód Böngészése

reactor:坐席监控新增振铃状态;

zhangchong 7 hónapja
szülő
commit
0956aff59a

BIN
src/assets/img/seats/ring.png


+ 8 - 1
src/views/seats/header.vue

@@ -40,6 +40,9 @@
       </el-badge>
     </div>
     <div class="right_icons">
+      <el-badge :value="ringCount" :max="99" class="right_icons_item">
+        <img src="@/assets/img/seats/ring.png" alt="" />振铃中
+      </el-badge>
       <el-badge :value="threeWayCount" :max="99" class="right_icons_item">
         <img src="@/assets/img/seats/threeWay.png" alt="" />三方会议
       </el-badge>
@@ -180,7 +183,7 @@ const signOut = () => {
 };
 const globalState = useGlobalState();
 const olaRef = ref();
-const websocket_connect = (telNo: string, telPwd: string, telGroup: string) => {
+const websocket_connect = (telNo: string, telPwd: string) => {
   olaRef.value = olaFn(themeConfig.value.callCenterSocketUrl, {
     username: telNo,
     password: telPwd,
@@ -264,6 +267,10 @@ const onMessage = async (event: any) => {
 const busyCount = computed(() => {
   return seatsList.value.filter((item: any) => item.state === "busy").length;
 });
+// 振铃
+const ringCount = computed(() => {
+  return seatsList.value.filter((item: any) => item.state === "ring").length;
+});
 // 小休数量、
 const unreadyCount = computed(() => {
   return seatsList.value.filter((item: any) => item.state === "unready").length;

+ 1 - 1
src/views/seats/left-bottom.vue

@@ -56,7 +56,7 @@ const props = defineProps({
     default: () => {},
   },
 });
-const option = ref({});
+const option = ref<EmptyObjectType>({});
 const state = reactive<any>({
   count: {
     inNoOn: 0,

+ 1 - 1
src/views/seats/left-center.vue

@@ -24,7 +24,7 @@ const Empty = defineAsyncComponent(
 const CountUp = defineAsyncComponent(
   () => import("@/components/Count-up/index.vue")
 );
-const data = ref([]);
+const data = ref<EmptyArrayType>([]);
 const props = defineProps({
   content: {
     type: Array,

+ 7 - 3
src/views/seats/right.vue

@@ -108,11 +108,11 @@ const props = defineProps({
   },
 });
 
-const textRefs = ref([]);
+const textRefs = ref<EmptyArrayType>([]);
 const textRef = ref();
 const popoverRef = ref();
 const hidePopover = ref(false);
-const call = ref({});
+const call = ref<EmptyObjectType>({});
 const globalState = useGlobalState();
 // 开始签入时长
 const talkTime = ref<any>(0); // 通话时长
@@ -131,7 +131,7 @@ const startCallTimer = (second: any) => {
     }, 1000);
   }
 };
-const handleClick = (index: string | number, item: { state: string }) => {
+const handleClick = (index: number, item: { state: string; telNo: string }) => {
   textRef.value = textRefs.value[index];
   call.value = item;
   talkTime.value = 0;
@@ -163,6 +163,7 @@ const currentStatusText = (state: string) => {
     login: "签入",
     ready: "示闲",
     unready: "小休",
+    ring: "振铃中",
     busy: "通话中",
     acw: "整理",
     held: "保持",
@@ -183,6 +184,8 @@ const loading = ref(false);
 const sortSeatsList = () => {
   // 通话中的排序
   const busyData = seatsList.value.filter((item: any) => item.state === "busy");
+  // 通话中的排序
+  const ringData = seatsList.value.filter((item: any) => item.state === "ring");
   // 话后整理
   const acwData = seatsList.value.filter((item: any) => item.state === "acw");
   // 保持
@@ -205,6 +208,7 @@ const sortSeatsList = () => {
   );
   seatsList.value = [
     ...busyData,
+    ...ringData,
     ...readyData,
     ...acwData,
     ...heldData,

+ 7 - 21
tsconfig.json

@@ -10,23 +10,12 @@
     "resolveJsonModule": true,
     "isolatedModules": true,
     "esModuleInterop": true,
-    "lib": [
-      "esnext",
-      "dom"
-    ],
+    "lib": ["esnext", "dom"],
     "baseUrl": "./",
-    "types": [
-      "node",
-      "vite/client",
-      "element-plus/global"
-    ],
+    "types": ["node", "vite/client", "element-plus/global"],
     "paths": {
-      "@/*": [
-        "src/*"
-      ],
-      "api/*": [
-        "src/api/*"
-      ]
+      "@/*": ["src/*"],
+      "api/*": ["src/api/*"]
     }
   },
   "include": [
@@ -34,17 +23,14 @@
     "src/**/*.d.ts",
     "src/**/*.tsx",
     "src/**/*.vue",
-    "types/env.d.ts",
+    "global.d.ts",
     "types/*.d.ts",
     "node_modules/@vue/reactivity/dist/reactivity.d.ts"
   ],
-  "exclude": [
-    "node_modules",
-    "public"
-  ],
+  "exclude": ["node_modules", "public", "dist"],
   "references": [
     {
       "path": "./tsconfig.config.json"
     }
   ]
-}
+}

+ 0 - 6
types/env.d.ts

@@ -1,6 +0,0 @@
-declare module "*.vue" {
-  import { defineComponent } from "vue";
-  const Component: ReturnType<typeof defineComponent>;
-  export default Component;
-}
-

+ 33 - 0
types/global.d.ts

@@ -0,0 +1,33 @@
+// 声明一个模块,防止引入文件时报错
+declare module "*.json";
+declare module "*.png";
+declare module "*.jpg";
+declare module "*.scss";
+declare module "*.ts";
+declare module "*.js";
+
+// 声明文件,*.vue 后缀的文件交给 vue 模块来处理
+declare module "*.vue" {
+  import type { DefineComponent } from "vue";
+  const component: DefineComponent<{}, {}, any>;
+  export default component;
+}
+
+// 声明 ref
+declare type RefType<T = any> = T | null;
+
+// 声明 HTMLElement
+declare type HtmlType = HTMLElement | string | undefined | null;
+
+// 申明 children 可选
+declare type ChildType<T = any> = {
+  children?: T[];
+};
+
+// 申明 数组
+declare type EmptyArrayType<T = any> = T[];
+
+// 申明 对象
+declare type EmptyObjectType<T = any> = {
+  [key: string]: T;
+};