Pārlūkot izejas kodu

reactor:外呼任务和智能回访任务新增暂停和开始;电话控件新增今日等待和当前等待;

zhangchong 10 mēneši atpakaļ
vecāks
revīzija
71d46aee37

+ 2 - 0
package.json

@@ -57,6 +57,8 @@
 		"@vitejs/plugin-vue": "^4.4.0",
 		"@vitejs/plugin-vue-jsx": "^3.1.0",
 		"@vue/compiler-sfc": "^3.2.45",
+		"@vueuse/core": "^10.11.0",
+		"@vueuse/nuxt": "^10.11.0",
 		"dotenv": "^16.0.3",
 		"eslint": "^8.28.0",
 		"eslint-plugin-vue": "^9.7.0",

+ 3 - 0
src/components/OrderDetail/index.vue

@@ -159,6 +159,9 @@
 							<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.ruleForm.pushType">
 								<el-form-item label="推送分类"> {{ state.ruleForm.pushType }} </el-form-item>
 							</el-col>
+<!--              <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.ruleForm.pushType">
+                <el-form-item label="门户是否公开"> {{ state.ruleForm.pushType }} </el-form-item>
+              </el-col>-->
 							<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
 								<el-form-item label="工单标题">
 									{{ state.ruleForm.title }} <el-tag class="ml10" v-if="state.ruleForm?.workflowId">{{ state.ruleForm.statusText }}</el-tag>

+ 38 - 4
src/layout/navBars/breadcrumb/telControl.vue

@@ -281,6 +281,15 @@
 			<span class="duty-on-time-label">签入时长</span>
 			<el-text class="duty-on-time-time" tag="b" type="danger" v-if="onDutyTime">{{ formatDuration(onDutyTime) }}</el-text>
 		</div>
+    <!-- 等待人数 -->
+    <div class="wait-box">
+      <div class="today-wait">
+        <span class="today-wait-label">今日等待:</span><el-text class="today-wait-num ml5" tag="b" type="danger">{{ todayWaitValue.toFixed(0) }}</el-text>
+      </div>
+      <div class="current-wait">
+        <span class="current-wait-label">当前等待:</span><el-text class="current-wait-time ml5" tag="b" type="danger">{{ currentWaitValue.toFixed(0) }}</el-text>
+      </div>
+    </div>
 	</div>
 
 	<!-- 占位标签 -->
@@ -556,8 +565,8 @@ import { useSocket } from '@/utils/websocket';
 import mittBus from '@/utils/mitt';
 import { voiceAssistant } from '@/api/todo/voiceAssistant';
 import { submitLog } from '@/api/public/log';
-import { B } from '@vueuse/motion/dist/shared/motion.5ee44005';
 import { getDataByCode } from '@/api/system/dict';
+import { useTransition ,useDocumentVisibility } from '@vueuse/core'
 // 引入组件
 const CommonAdvice = defineAsyncComponent(() => import('@/components/CommonAdvice/index.vue')); // 常用意见
 const AnnexList = defineAsyncComponent(() => import('@/components/AnnexList/index.vue'));
@@ -736,15 +745,12 @@ const RestApplyPassFn = (data: any) => {
 };
 // 查询所有分机
 const getTelsLists = async () => {
-	state.loading = true;
 	try {
 		const { result } = await getTelList();
 		state.telsList = result ?? [];
-		state.loading = false;
 		return state.telsList;
 	} catch (err) {
 		console.log(err);
-		state.loading = false;
 	}
 };
 // 查询三方会议和转接的号码
@@ -1998,6 +2004,22 @@ const getWithList = async () => {
 		console.log(err);
 	}
 };
+// 今日等待
+const todayWait = ref(0);
+const todayWaitValue = useTransition(todayWait, {
+  duration: 1500,
+})
+// 当前等待
+const currentWait = ref<number>(0);
+const currentWaitValue = useTransition(currentWait, {
+  duration: 1500,
+})
+const visibility = useDocumentVisibility();
+watch(visibility, (current, previous) => {
+  if (current === 'visible' && previous === 'hidden') {
+    console.log('欢迎回来')
+  }
+})
 onMounted(async () => {
 	await getReason(); // 获取小休原因
 	await signalRStart(); //开启消息监听
@@ -2100,6 +2122,18 @@ onBeforeUnmount(() => {
 			}
 		}
 	}
+  .wait-box{
+    width: 120px;
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    .today-wait{
+      margin-bottom: 10px;
+    }
+    .today-wait-num,.current-wait-time{
+      font-size: var(--el-font-size-medium);
+    }
+  }
 }
 </style>
 <style lang="scss">

+ 5 - 5
src/layout/navBars/breadcrumb/user.vue

@@ -13,14 +13,14 @@
 				</el-dropdown-menu>
 			</template>
 		</el-dropdown>-->
-		<div class="layout-navBars-breadcrumb-user-icon mr10" @click="onSearchClick" title="菜单搜索">
+		<div class="layout-navBars-breadcrumb-user-icon mr5" @click="onSearchClick" title="菜单搜索">
 			<SvgIcon name="ele-Search" size="16px" />
 		</div>
 		<Search ref="searchRef" />
-		<div class="layout-navBars-breadcrumb-user-icon mr10" @click="onLayoutSetTingClick" title="布局配置" v-if="showSetting">
+		<div class="layout-navBars-breadcrumb-user-icon mr5" @click="onLayoutSetTingClick" title="布局配置" v-if="showSetting">
 			<SvgIcon name="icon-skin iconfont" size="18px" />
 		</div>
-		<div class="layout-navBars-breadcrumb-user-icon mr10" title="消息通知">
+		<div class="layout-navBars-breadcrumb-user-icon mr5" title="消息通知">
 			<div class="layout-navBars-breadcrumb-user-icon">
 				<el-popover
 					placement="bottom"
@@ -42,7 +42,7 @@
 				</el-popover>
 			</div>
 		</div>
-		<div class="layout-navBars-breadcrumb-user-icon mr10" @click="onLockScreen" title="锁屏">
+		<div class="layout-navBars-breadcrumb-user-icon mr5" @click="onLockScreen" title="锁屏">
 			<SvgIcon name="ele-Lock" size="18px" />
 		</div>
 		<!--		<div class="layout-navBars-breadcrumb-user-icon mr10" @click="onScreenFullClick" :title="isScreenFull ? '关全屏' : '开全屏'" >
@@ -519,7 +519,7 @@ onUnmounted(() => {
 	}
 
 	&-icon {
-		padding: 0 10px;
+		padding: 0 6px;
 		cursor: pointer;
 		color: var(--hotline-color-text-main);
 		&:hover {

+ 1 - 1
src/utils/other.ts

@@ -36,7 +36,7 @@ export function useTitle() {
 
 		const { path, meta } = router.currentRoute.value;
 		if (path === '/login') {
-			webTitle = <any>meta.title;
+			webTitle = <string>meta.title;
 		} else {
 			webTitle = setTagsViewNameI18n(router.currentRoute.value);
 		}

+ 73 - 11
src/views/auxiliary/smartCallOut/task.vue

@@ -60,6 +60,26 @@
 					>
 						终止任务
 					</el-button>
+					<el-button
+						link
+						type="primary"
+						v-if="[1, 2].includes(row.taskState)"
+						@click="onStart(row)"
+						title="启动任务"
+						v-auth="'auxiliary:smartCallOut:start'"
+					>
+						启动
+					</el-button>
+					<el-button
+						link
+						type="primary"
+						v-if="[1, 2].includes(row.taskState)"
+						@click="onPause(row)"
+						title="暂停任务"
+						v-auth="'auxiliary:smartCallOut:pause'"
+					>
+						暂停
+					</el-button>
 				</template>
 			</ProTable>
 		</el-card>
@@ -193,21 +213,63 @@ const onEnd = (row: any) => {
 		autofocus: false,
 	})
 		.then(() => {
-      state.loading = true;
-      // 1 :智能回访 2:批量外呼
-			smartCallOutTaskStop({ id: row.id ,typeId:2}).then(() => {
-				ElMessage({
-					type: 'success',
-					message: '终止任务成功',
+			state.loading = true;
+			// 1 :智能回访 2:批量外呼
+			smartCallOutTaskStop({ id: row.id, typeId: 2 })
+				.then(() => {
+					ElMessage({
+						type: 'success',
+						message: '终止任务成功',
+					});
+					queryList();
+					state.loading = false;
+				})
+				.catch(() => {
+					state.loading = false;
 				});
-				queryList();
-        state.loading = false;
-			}).catch(() => {
-        state.loading = false;
-      })
 		})
 		.catch(() => {});
 };
+// 启动任务
+const onStart = (row: any) => {
+	ElMessageBox.confirm(`您确定要启动外呼任务【${row.name}】吗?`, '提示', {
+		confirmButtonText: '确定',
+		cancelButtonText: '取消',
+		type: 'warning',
+		draggable: true,
+		cancelButtonClass: 'default-button',
+		autofocus: false,
+	})
+		.then(() => {
+			ElMessage({
+				type: 'success',
+				message: '启动任务成功',
+			});
+		})
+		.catch(() => {
+			// 取消
+		});
+};
+// 暂停任务
+const onPause = (row: any) => {
+	ElMessageBox.confirm(`您确定要暂停外呼任务【${row.name}】吗?`, '提示', {
+		confirmButtonText: '确定',
+		cancelButtonText: '取消',
+		type: 'warning',
+		draggable: true,
+		cancelButtonClass: 'default-button',
+		autofocus: false,
+	})
+		.then(() => {
+			ElMessage({
+				type: 'success',
+				message: '暂停任务成功',
+			});
+		})
+		.catch(() => {
+			// 取消
+		});
+};
 // 获取基础数据
 const aiCallOutTaskState = ref([]);
 const getBaseData = async () => {

+ 61 - 0
src/views/business/visit/smart.vue

@@ -40,6 +40,26 @@
 					>
 						终止任务
 					</el-button>
+          <el-button
+            link
+            type="primary"
+            v-if="[1, 2].includes(row.taskState)"
+            @click="onStart(row)"
+            title="启动任务"
+            v-auth="'business:visit:smart:start'"
+          >
+            启动
+          </el-button>
+          <el-button
+            link
+            type="primary"
+            v-if="[1, 2].includes(row.taskState)"
+            @click="onPause(row)"
+            title="暂停任务"
+            v-auth="'business:visit:smart:pause'"
+          >
+            暂停
+          </el-button>
 				</template>
 			</ProTable>
 		</el-card>
@@ -56,6 +76,7 @@ import { ElMessage, ElMessageBox, FormInstance } from 'element-plus';
 import { formatDate } from '@/utils/formatTime';
 import { getSmartVisitList } from '@/api/smartVisit';
 import { smartCallOutTaskStop } from '@/api/auxiliary/smartCallOut';
+import { startupSnapshot } from "v8";
 
 // 引入组件
 const SmartVisitAdd = defineAsyncComponent(() => import('@/views/business/visit/component/Smart-visit-add.vue')); // 选择需要智能回访的工单
@@ -158,6 +179,46 @@ const onTermination = (row: any) => {
 			// 取消
 		});
 };
+// 启动任务
+const onStart = (row: any) => {
+  ElMessageBox.confirm(`您确定要启动回访任务【${row.name}】吗?`, '提示', {
+    confirmButtonText: '确定',
+    cancelButtonText: '取消',
+    type: 'warning',
+    draggable: true,
+    cancelButtonClass: 'default-button',
+    autofocus: false,
+  })
+    .then(() => {
+        ElMessage({
+          type: 'success',
+          message: '启动任务成功',
+        });
+    })
+    .catch(() => {
+      // 取消
+    });
+};
+// 暂停任务
+const onPause = (row: any) => {
+  ElMessageBox.confirm(`您确定要暂停回访任务【${row.name}】吗?`, '提示', {
+    confirmButtonText: '确定',
+    cancelButtonText: '取消',
+    type: 'warning',
+    draggable: true,
+    cancelButtonClass: 'default-button',
+    autofocus: false,
+  })
+    .then(() => {
+      ElMessage({
+        type: 'success',
+        message: '暂停任务成功',
+      });
+    })
+    .catch(() => {
+      // 取消
+    });
+};
 // 页面加载时
 onMounted(() => {
 	queryList();