Browse Source

Revert "refactor:文件规范调整;"

This reverts commit 4c88119c8b496638ab46e2cb24f7c3215d01be0c.
zhangchong 1 year ago
parent
commit
d36e2b6cd5

+ 0 - 34
src/api/system/workflow.ts

@@ -283,38 +283,4 @@ export const workflowTraces = (workflowId: string) => {
 		url: `/api/v1/Workflow/${workflowId}/traces`,
 		method: 'get',
 	});
-};
-/**
- * @description: 分页查询最新版本号的模板
- * @param {object} params
- * @return {*}
- */
-export const WorkflowLatest = (params:object) => {
-	return request({
-		url: `/api/v1/Workflow/latest`,
-		method: 'get',
-		params
-	});
-};
-/**
- * @description: 查询所有工作流模块
- * @return {*}
- */
-export const wfmodules = () => {
-	return request({
-		url: `/api/v1/Workflow/wfmodules`,
-		method: 'get',
-	});
-};
-/**
- * @description: 为工作流业务匹配或取消流程模板
- * @param {object} data
- * @return {*}
- */
-export const wfmodulesMatch = (data:object) => {
-	return request({
-		url: `/api/v1/Workflow/wfmodule/match`,
-		method: 'put',
-		data
-	});
 };

+ 17 - 29
src/components/LogicFlow/index.vue

@@ -14,13 +14,13 @@
 							<el-input v-model="form.code" placeholder="请输入模板编码" clearable></el-input>
 						</el-form-item>
 					</el-col>
-<!--					<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8">-->
-<!--						<el-form-item label="业务模块" prop="moduleCode" :rules="[{ required: true, message: '请选择业务模块', trigger: 'change' }]">-->
-<!--							<el-select v-model="form.moduleCode" class="w100" placeholder="请选择业务模块" @change="changeModule">-->
-<!--								<el-option v-for="item in moduleList" :key="item.key" :label="item.value" :value="item.key" />-->
-<!--							</el-select>-->
-<!--						</el-form-item>-->
-<!--					</el-col>-->
+					<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8">
+						<el-form-item label="业务模块" prop="moduleCode" :rules="[{ required: true, message: '请选择业务模块', trigger: 'change' }]">
+							<el-select v-model="form.moduleCode" class="w100" placeholder="请选择业务模块" @change="changeModule">
+								<el-option v-for="item in moduleList" :key="item.key" :label="item.value" :value="item.key" />
+							</el-select>
+						</el-form-item>
+					</el-col>
 				</el-row>
 			</el-form>
 			<!-- 流程图画布内容 -->
@@ -230,21 +230,21 @@ const initOp = () => {
 	// 控制面板-暂存
 	lf.extension.control.addItem({
 		iconClass: 'lf-control-save',
-		title: '保存',
-		text: '存',
+		title: '暂存为草稿',
+		text: '存',
 		onClick: () => {
 			saveOnly();
 		},
 	});
 	// 控制面板-发布
-	// lf.extension.control.addItem({
-	// 	iconClass: 'lf-control-release',
-	// 	title: '发布流程模板',
-	// 	text: '发布',
-	// 	onClick: () => {
-	// 		release();
-	// 	},
-	// });
+	lf.extension.control.addItem({
+		iconClass: 'lf-control-release',
+		title: '发布流程模板',
+		text: '发布',
+		onClick: () => {
+			release();
+		},
+	});
 	// 设置默认边
 	lf.setDefaultEdgeType('hotline:transition');
 	// 设置拖拽面板
@@ -382,9 +382,6 @@ const saveOnly = throttle(() => {
 					mittBus.emit('clearCache', 'systemWorkflow');
 					router.push({
 						path: '/system/config/workflow',
-            query:{
-              tabIndex:'1'
-            }
 					});
 				});
 			} else {
@@ -396,9 +393,6 @@ const saveOnly = throttle(() => {
 					mittBus.emit('clearCache', 'systemWorkflow');
 					router.push({
 						path: '/system/config/workflow',
-            query:{
-              tabIndex:'1'
-            }
 					});
 				});
 			}
@@ -445,9 +439,6 @@ const release = throttle(async () => {
 							mittBus.emit('clearCache', 'systemWorkflow');
 							router.push({
 								path: '/system/config/workflow',
-                query:{
-                  tabIndex:'1'
-                }
 							});
 						});
 					})
@@ -471,9 +462,6 @@ const release = throttle(async () => {
 							mittBus.emit('clearCache', 'systemWorkflow');
 							router.push({
 								path: '/system/config/workflow',
-                query:{
-                  tabIndex:'1'
-                }
 							});
 						});
 					})

File diff suppressed because it is too large
+ 629 - 208
src/layout/navBars/breadcrumb/telControl.vue


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

@@ -181,7 +181,7 @@ import { Session, Local } from '/@/utils/storage';
 import signalR from '/@/utils/signalR';
 import mittBus from '/@/utils/mitt';
 import { offDuty } from '/@/api/login/user';
-import { VoiceInterfaceObject } from '/@/utils/PhoneScript';
+// 引入需要的api
 import { changePwd } from '/@/api/login/user';
 
 // 引入组件
@@ -342,10 +342,9 @@ const onHandleCommandClick = (path: string) => {
 					},
 				})
 					.then(async () => {
-            VoiceInterfaceObject.LogOut();
-						// offDuty().then(() => {
+						offDuty().then(() => {
 							// 断开链接
-							// signalR.stop();
+							signalR.stop();
 							// 重置所有状态
 							usetelStatusStore.resetState();
 							// 清除缓存/token等
@@ -353,7 +352,7 @@ const onHandleCommandClick = (path: string) => {
 							Session.clear();
 							// 使用 reload 时,不需要调用 resetRoute() 重置路由
 							window.location.reload();
-						// });
+						});
 					})
 					.catch(() => {});
 				return;

+ 3 - 9
src/stores/interface/index.ts

@@ -109,7 +109,7 @@ export enum TelStates {
 	dutyOn = 'dutyOn', // 签入
 	rest = 'rest',  // 小休
 	ring = 'ring', // 来电响铃
-	onHold = 'onHold', // 保持中
+	oneCallHold = 'oneCallHold', // 一通电话保持中
 	oneHoldOneCall = 'oneHoldOneCall', // 一通电话保持中,一通电话通话中 可以三方通话
 	onCall = 'onCall', // 一通电话通话中
 	onMute = 'onMute', 		// 一通电话通话中,静音中
@@ -126,16 +126,10 @@ export interface TelsStateInfos {
 		isRest: RestStates; // 是否小休
 		isMute: boolean; // 是否静音
 		isMeeting: boolean; // 是否会议中
-		isHold:boolean; // 是否保持中
 		phoneControlState: TelStates;  // 电话控件状态
 		telsNo: string | number; // 电话号码
-		telGongHao: string | number; // 电话工号
-		telArea: string | number; // 电话区号
-		telGuid: string | number; // 电话guid
-		telIVR: string | number; // 电话IVR
-		telType: string | number; //来电 外呼 转接
-		fromTel: string | number; // 来电号码
-		callTime?: number; // 通话时长
+		onCallArr: Array<any>; // 通话中的数组
+		onHoldArr: Array<any>; // 保持中的数组
 	}
 }
 export interface AppConfigState {

+ 13 - 32
src/stores/telStatus.ts

@@ -11,15 +11,10 @@ export const useTelStatus = defineStore('telStatus', {
 			isRest: RestStates.unRest, // 是否休息  'resting'|'InReview'|'unRest'; 休息中  审核中 其他状态
 			isMute: false, //是否静音
 			isMeeting: false, //是否三方会议中
-			isHold: false, // 是否保持中
 			phoneControlState: TelStates.dutyOff, //当前状态 默认签出
 			telsNo: "", // 分机号
-			telGongHao: "", // 电话工号
-			telArea: "", // 电话区号
-			telGuid: "", // 电话guid
-			telIVR: "", // 电话IVR
-			telType: "", //来电 外呼 转接
-			fromTel: "", // 来电号码
+			onCallArr: [], //当前通话条数
+			onHoldArr: [], //当前保持条数
 		}
 	}),
 	actions: {
@@ -35,10 +30,6 @@ export const useTelStatus = defineStore('telStatus', {
 		setMute(data: boolean): void {
 			this.telStatusInfo.isMute = data;
 		},
-		// 设置保持状态
-		setHold(data: boolean): void {
-			this.telStatusInfo.isHold = data;
-		},
 		// 设置是否在三方会议中
 		setMetTing(data: boolean): void {
 			this.telStatusInfo.isMeeting = data;
@@ -47,21 +38,17 @@ export const useTelStatus = defineStore('telStatus', {
 		setPhoneControlState(data: TelStates): void {
 			this.telStatusInfo.phoneControlState = data;
 		},
-		// 设置当前通话信息
-		setCallInfo(data:any): void {
-			this.telStatusInfo = {
-				...this.telStatusInfo,
-				...data
-			};
+		// 设置分机号
+		setTelsNo(no: string | number): void {
+			this.telStatusInfo.telsNo = no;
 		},
-		// 设置通话时长
-		setCallTime(data: number): void {
-			this.telStatusInfo.callTime = data;
+		// 设置当前通话信息 
+		setCallState(data: any): void {
+			this.telStatusInfo.onCallArr = data;
 		},
-		// 清除通话时长
-		clearCallTime(): void {
-			// 删除对象属性
-			delete this.telStatusInfo.callTime;
+		// 设置当前保持信息 
+		setHoldState(data: any): void {
+			this.telStatusInfo.onHoldArr = data;
 		},
 		// 签出重置所有状态
 		resetState(): void {
@@ -70,17 +57,11 @@ export const useTelStatus = defineStore('telStatus', {
 				isRest: RestStates.unRest, // 是否休息
 				isMute: false, // 是否静音
 				isMeeting: false, //是否三方会议中
-				isHold:false, // 是否保持中
 				phoneControlState: TelStates.dutyOff, //当前状态 默认签出
 				telsNo: "", // 分机号
-				telGongHao: "", // 电话工号
-				telArea: "", // 电话区号
-				telGuid: "", // 电话guid
-				telIVR: "", // 电话IVR
-				telType: "", //来电 外呼 转接
-				fromTel: "", // 来电号码
+				onCallArr: [], //当前通话条数
+				onHoldArr: [] //当前保持条数
 			}
-			this.clearCallTime(); // 清除通话时长
 		}
 	},
 	// 开启数据缓存

+ 0 - 798
src/utils/PhoneScript.ts

@@ -1,798 +0,0 @@
-import {ElMessage} from "element-plus";
-import router from '/@/router';
-import { storeToRefs } from 'pinia';
-import { WebsocketInterface } from "./websocket";
-import { useTelStatus } from '/@/stores/telStatus';
-import { useUserInfo } from '/@/stores/userInfo';
-import { useAppConfig } from '/@/stores/appConfig';
-import { TelStates, RestStates } from '/@/stores/interface';
-import { debounce } from '/@/utils/tools';
-
-const storesUserInfo = useUserInfo();
-const { userInfos } = storeToRefs(storesUserInfo);
-const useTelStatusStore = useTelStatus();
-const { telStatusInfo } = storeToRefs(useTelStatusStore);
-const appConfigStore = useAppConfig();
-const { AppConfigInfo } = storeToRefs(appConfigStore);
-
-//定义当前登录的用户,在jquery的$(function(){})中对下面参数赋值, 全局变量,取值在PhoneScript.js中处理的,
-const SystemAttr = {
-    CurrentUser: { "DepartmentID": "", "GongHao": "", "FenJi": "", "AgentGroupName": "" }
-}
-let timer: any = null;
-let time = 0;
-// 开始计时
-const startTime = debounce(() => {
-    let talkTime = telStatusInfo.value.callTime
-    if (talkTime) {
-        time = Number(talkTime);
-        timer = setInterval(() => {
-            time++;
-            useTelStatusStore.setCallTime(time);
-        }, 1000);
-    } else {
-        timer= setInterval(() => {
-            time++;
-            useTelStatusStore.setCallTime(time);
-        }, 1000);
-    }
-}, 1000);
-// 结束计时
-const removeTimer = debounce(() => {
-    time = 0;
-    useTelStatusStore.clearCallTime();
-    clearInterval(timer);
-}, 1000);
-
-//音频接口对象
-export const VoiceInterfaceObject:any = {
-    // 设置全局变量
-    SetSendModel: function (params: any) {
-        SystemAttr.CurrentUser.DepartmentID = params.DepartmentID || ""; // 部门ID
-        SystemAttr.CurrentUser.GongHao = params.GongHao || "";  // 工号
-        SystemAttr.CurrentUser.FenJi = params.FenJi || ""; // 分机
-        SystemAttr.CurrentUser.AgentGroupName = params.AgentGroupName || ""; // 坐席组
-    },
-    /*
-     * @@@@全局变量
-     * 
-    * 当前实体对象
-    * 下行JSON格式:{ "Action": "", "GongHao": "", "FenJi": "", "PlatFormCode": "", "Params": "" }
-    * 上行JSON格式:{ "Action": "", "GongHao": "", "FenJi": "", "PlatFormCode": "", "Params": "", "Message": "" }
-    */
-    GetSendModel: function (action: string, params?: string) {
-        let p_action = action || "";
-        let p_params = params || "";
-        return {"Action": p_action, "GongHao": SystemAttr.CurrentUser.GongHao, "FenJi": SystemAttr.CurrentUser.FenJi, "PlatFormCode": SystemAttr.CurrentUser.DepartmentID, "Params": p_params};
-    },
-    /*
-     * @@@@事件触发
-     *
-    * 当前实体对象
-    * 下行JSON格式:{ "Action": "", "GongHao": "", "FenJi": "", "PlatFormCode": "", "Params": "" }
-    * 上行JSON格式:{ "Action": "", "GongHao": "", "FenJi": "", "PlatFormCode": "", "Params": "", "Message": "" }
-    */
-    //弹屏 回调
-    Back_TelPhoneEvent: function (returnVal: { Message: string; Params: any; }) {
-        let DialArray = returnVal.Message.split(",");
-        let DialInfo:any = {};
-        DialInfo.fromTel = DialArray[0]; //来电号码
-        DialInfo.telGongHao = DialArray[1]; //来电工号
-        DialInfo.telArea = DialArray[3]; //来电区域
-        DialInfo.telGuid = DialArray[4]; //来电GUID
-        DialInfo.telIVR = DialArray[5]; //来电IVR名称
-        DialInfo.telType = returnVal.Params; // 0来电 1外呼 2转接
-
-        console.info(returnVal.Message,DialInfo,'来电谈单');
-
-        useTelStatusStore.setCallInfo({
-            telGongHao: DialInfo.telGongHao,
-            fromTel: DialInfo.fromTel,
-            telArea: DialInfo.telArea,
-            telGuid: DialInfo.telGuid,
-            telIVR: DialInfo.telIVR,
-            telType: DialInfo.telType,
-        });
-        // 设置电话状态 振铃中
-        useTelStatusStore.setPhoneControlState(TelStates.ring);
-
-        if(DialInfo.telType === '0'){ // 来电才展示弹屏
-            // 跳转到录入工单页面
-            router.push({
-                name: 'orderAdd',
-                params: {
-                    createBy: 'tel',
-                    telNo: DialInfo.fromTel,
-                    callId: DialInfo.telGuid,
-                    transfer: '12315',
-                    tagsViewName: '工单受理',
-                },
-            }).then(()=>{} );
-        }
-        //layer.open({
-        //    title: "来电弹屏",
-        //    type: 1,
-        //    area: ['600px', '360px'],
-        //    shadeClose: true, //点击遮罩关闭
-        //    content: '\<\div style="padding:10px;">来电号码:' + DialInfo.telNum + '<br>来电工号:' + DialInfo.telGongHao + '<br>来电区域:' + DialInfo.telArea + '<br>来电GUID:' + DialInfo.telGuid + '<br>来电IVR名称:' + DialInfo.telIVR + '<br>来电类型:' + DialInfo.telType + ' \<\/div>'
-        //});
-    },
-    //弹屏 回调
-    // Back_RegNumberState: function (returnVal: any) {
-    //     //Tel,GongHao,URL,Area,Guid,IVR,Remark
-    //     console.log(returnVal);
-    // },
-    //心跳 回调
-    Back_keeplive: function (returnVal: any) {
-        console.log(returnVal);
-    },
-    //登录
-    Login: function () {
-        const modelJson = this.GetSendModel("Login");
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    //登录回调
-    Back_Login: function (returnVal: { Params: string; }) {
-        if (returnVal.Params == "0") {
-            WebsocketInterface("KeepAlive");
-            // 设置分机号
-            useTelStatusStore.setCallInfo({telsNo: SystemAttr.CurrentUser.FenJi});
-            // 设置签入状态
-            useTelStatusStore.setDutyState(true);
-            // 设置电话状态
-            useTelStatusStore.setPhoneControlState(TelStates.dutyOn);
-            this.SetGroupRole();// 设置组权限
-            this.SetRecordRole();// 设置录音权限
-            this.SetCallRole();// 设置呼叫权限
-            ElMessage.success("登录语音系统成功!")
-        } else {
-            ElMessage.error("登录语音系统失败!")
-        }
-    },
-
-    //设置用户权限
-    SetGroupRole: function () {
-        const modelJson = this.GetSendModel("SetGroupRole", SystemAttr.CurrentUser.AgentGroupName);
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-
-    //设置用户权限 回调
-    Back_SetGroupRole: function (returnVal: { Params: string; Message: any; }) {
-        if (returnVal.Params == "0") {
-            ElMessage.success(returnVal.Message)
-        } else {
-            console.info(returnVal.Message);
-            ElMessage.error('设置组权限失败')
-        }
-    },
-
-    // 设置录音权限
-    SetRecordRole: function () {
-        const modelJson = this.GetSendModel("SetRecRole", '0');
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    // 设置录音权限 回调
-    Back_SetRecRole: function (returnVal: { Params: string; Message: any; }) {
-        if (returnVal.Params == "0") {
-            ElMessage.success(returnVal.Message)
-        } else {
-            console.info(returnVal.Message);
-            ElMessage.error('设置录音权限失败!')
-        }
-    },
-    // 设置呼叫权限
-    SetCallRole: function () {
-        const modelJson = this.GetSendModel("SetDialRole", '2');
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    // 设置呼叫权限 回调
-    Back_SetDialRole: function (returnVal: { Params: string; Message: any; }) {
-        console.log('设置呼叫权限回调',returnVal)
-        if (returnVal.Params == "0") {
-            ElMessage.success(returnVal.Message)
-        } else {
-            ElMessage.error('设置呼叫权限失败!');
-            console.info(returnVal.Message);
-        }
-    },
-    //登出 当前座席
-    LogOut: function () {
-        const modelJson = this.GetSendModel("LogOut");
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        ElMessage.success("语音系统退出成功!")
-        // 关闭websocket
-        const a = WebsocketInterface('Close');
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    //强制登出
-    F_LogOut: function (gongHao: any) {
-        const modelJson = {"Action": "LogOut", "GongHao": gongHao, "FenJi": "", "PlatFormCode": SystemAttr.CurrentUser.DepartmentID, "Params": ""};
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    //登出回调
-    Back_LogOut: function (returnVal: any) {
-        console.info(returnVal);
-    },
-    //退出事件
-    Back_NoLogin: function (returnVal: any) {
-        ElMessage.error(returnVal.message)
-        console.info(returnVal.message);
-    },
-    //示忙当前座席
-    SetBusy: function () {
-        const modelJson = this.GetSendModel("SetBusy");
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    //强制示忙座席
-    F_SetBusy: function (gongHao: any) {
-        const modelJson = {"Action": "SetBusy", "GongHao": gongHao, "FenJi": "", "PlatFormCode": SystemAttr.CurrentUser.DepartmentID, "Params": ""};
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    //示忙回调
-    Back_SetBusy: function (returnVal: { Params: string; Message: any; }) {
-        if (returnVal.Params == "0") {
-            ElMessage.success("小休开始!")
-            // 设置电话状态小休中
-            useTelStatusStore.setPhoneControlState(TelStates.rest);
-            useTelStatusStore.setRest(RestStates.resting);
-        } else {
-            console.info(returnVal.Message);
-        }
-    },
-    //示闲当前座席
-    SetIdle: function () {
-        const modelJson = this.GetSendModel("SetIdle");
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    //强制示闲座席
-    F_SetIdle: function (gongHao: any) {
-        const modelJson = {"Action": "SetIdle", "GongHao": gongHao, "FenJi": "", "PlatFormCode": SystemAttr.CurrentUser.DepartmentID, "Params": ""};
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    //示闲回调
-    Back_SetIdle: function (returnVal: { Params: string; Message: any; }) {
-        if (returnVal.Params == "0") {
-            ElMessage.success("小休结束!")
-            // 设置休息状态 设置未正常状态
-            useTelStatusStore.setRest(RestStates.unRest);
-            // 设置话机状态 结束休息改为签入状态
-            useTelStatusStore.setPhoneControlState(TelStates.dutyOn);
-        } else {
-            console.info(returnVal.Message);
-        }
-    },
-    //保持
-    KeepInTouch: function () {
-        const modelJson = this.GetSendModel("KeepInTouch");
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    //保持回调
-    Back_KeepInTouch: function (returnVal: { Params: string; Message: any; }) {
-        if (returnVal.Params == "0") {
-            // 设置电话状态
-            useTelStatusStore.setHold(true);
-            // 设置电话状态
-            useTelStatusStore.setPhoneControlState(TelStates.onHold);
-            ElMessage('开始保持');
-        } else {
-            console.info(returnVal.Message);
-        }
-    },
-    //取消保持
-    KeepCancelInTouch: function () {
-        const modelJson = this.GetSendModel("KeepCancelInTouch");
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    //取消保持回调
-    Back_KeepCancelInTouch: function (returnVal: { Params: string; Message: any; }) {
-        if (returnVal.Params == "0") {
-            // 设置电话状态  取消单个保持为通话中
-            useTelStatusStore.setHold(false);
-            // 设置电话状态
-            useTelStatusStore.setPhoneControlState(TelStates.onCall);
-            ElMessage('取消保持');
-        } else {
-            console.info(returnVal.Message);
-        }
-    },
-    //开启事后
-    TalkedDealBegin: function () {
-        const modelJson = this.GetSendModel("KeepCancelInTouch");
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    //开启事后 回调
-    Back_TalkedDealBegin: function (returnVal: any) {
-
-    },
-    //结束事后
-    TalkedDealEnd: function () {
-
-    },
-    //结束事后 回调
-    Back_TalkedDealEnd: function () {
-
-    },
-    //语音呼叫
-    DialOut: function (phone: any) {
-        const modelJson = this.GetSendModel("DialOut", phone);
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    // 语音呼叫 回调
-    Back_DialOut: function (returnVal: any) {
-        if (returnVal.Params == "0") {
-            ElMessage.success(returnVal.Message)
-        }else{
-            ElMessage.error(returnVal.Message)
-        }
-    },
-    // 语音呼叫 回调
-    Back_dialOut: function (returnVal: any) {
-        console.log(returnVal);
-        if (returnVal.Params == "0") {
-
-        }else{
-            ElMessage.error(returnVal.Message)
-        }
-    },
-    //视频呼叫
-    VideoCall: function (phone: any) {
-        const modelJson = this.GetSendModel("VideoCall", phone);
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    //挂断
-    HangUp: function (phone?: any) {
-        const modelJson = this.GetSendModel("HangUp", phone);
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        } else {
-            closeWrVideo("videortmp");
-        }
-    },
-    //挂断 回调
-    Back_HangUp: function (returnVal: { Params: string; Message: any; }) {
-        if (returnVal.Params == "0") {
-            console.info(returnVal.Message);
-            // 设置电话状态
-            useTelStatusStore.setCallInfo({
-                telArea: "", // 电话区号
-                telGuid: "", // 电话guid
-                telIVR: "", // 电话IVR
-                telType: "", //来电 外呼 转接
-                fromTel: "", // 来电号码
-            });
-            // 设置电话状态
-            useTelStatusStore.setPhoneControlState(TelStates.dutyOn);
-        } else {
-            console.info(returnVal.Message);
-        }
-    },
-    //强拆 挂断
-    Rtmp: function (phone: any) {
-        const modelJson = this.GetSendModel("Rtmp", phone);
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-
-    //自动外呼
-    StartAutoDial: function (phone: any) {
-        const modelJson = this.GetSendModel("StartAutoDial", phone);
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-
-    //通知公告
-    Notice: function (tels: string, content: string) {
-        const param = tels + "|" + content;
-        const modelJson = this.GetSendModel("Notice", param);
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-
-    //外呼回调
-    Back_Rtmp: function (returnVal: { Params: string; Rtsp: any; Message: any; }) {
-        if (returnVal.Params == "0") {
-            console.log(returnVal);
-            const videoid = $("#videortmp").prop("id");
-            const suuid = parseInt(String(Math.random() * 100000)) + '' + new Date().getTime();
-            registerWrVideo(suuid, videoid, returnVal.Rtsp);
-            //registerWrVideo(returnVal.CallGuid,videoid,returnVal.Rtsp);
-        } else {
-            console.info(returnVal.Message);
-        }
-    },
-
-    //强拆 挂断
-    F_HangUp: function (gongHao: any) {
-        const modelJson = {"Action": "HangUp", "GongHao": gongHao, "FenJi": "", "PlatFormCode": SystemAttr.CurrentUser.DepartmentID, "Params": ""};
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-
-    //转接
-    TeleSwitch: function (gongHao: any) {
-        const modelJson = this.GetSendModel("TeleSwitch", gongHao);
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    //转接 回调
-    Back_TeleSwitch: function (returnVal: { Params: string; Message: any; }) {
-        if (returnVal.Params == "0") {
-            console.info(returnVal.Message,'转接成功');
-            ElMessage.success(returnVal.Message);
-        } else {
-            console.info(returnVal.Message);
-        }
-    },
-    // 转接挂机通知事件
-    Back_TransferTrunkTalkingEnd: function (returnVal: { Params: string; Message: any; }) {
-        console.log(returnVal,'转接挂断事件')
-        // 设置电话状态
-        useTelStatusStore.setCallInfo({
-            telArea: "", // 电话区号
-            telGuid: "", // 电话guid
-            telIVR: "", // 电话IVR
-            telType: "", //来电 外呼 转接
-            fromTel: "", // 来电号码
-        });
-        useTelStatusStore.clearCallTime();
-        // 设置电话状态
-        useTelStatusStore.setPhoneControlState(TelStates.dutyOn);
-    },
-    // 转接开始通知事件
-    Back_BeginTransferTalking: function (returnVal: { Params: string; Message: any; }) {
-        console.log(returnVal,'转接开始事件')
-        // 设置电话状态
-        useTelStatusStore.setCallInfo({
-            telArea: "", // 电话区号
-            telGuid: "", // 电话guid
-            telIVR: "", // 电话IVR
-            telType: "", //来电 外呼 转接
-            fromTel: "", // 来电号码
-        });
-        useTelStatusStore.clearCallTime();
-        // 设置电话状态
-        useTelStatusStore.setPhoneControlState(TelStates.dutyOn);
-    },
-    //代接
-    InsteadOfTele: function (gonghao:any) {
-        const modelJson = this.GetSendModel("InsteadOfTele", gonghao);
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    //代接 回调
-    Back_InsteadOfTele: function (returnVal: { Params: string; Message: any; }) {
-        if (returnVal.Params == "0") {
-            console.info(returnVal.Message);
-        } else {
-            console.info(returnVal.Message);
-        }
-    },
-    //强插
-    CancleChannel: function (gongHao: any) {
-        const modelJson = this.GetSendModel("CancleChannel", gongHao);
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    //强插 回调
-    Back_CancleChannel: function (returnVal: { Params: string; Message: any; }) {
-        if (returnVal.Params == "0") {
-            console.info(returnVal.Message);
-        } else {
-            console.info(returnVal.Message);
-        }
-    },
-    //监听
-    LinkTele: function (gongHao: any) {
-        const modelJson = this.GetSendModel("LinkTele", gongHao);
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    //开启会议 音频
-    StartMeeting: function (meetId: string, tels: string) {
-        const param = meetId + "|" + tels;
-        const modelJson = this.GetSendModel("StartMeeting", param);
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    // 开启会议 音频 回调
-    Back_StartMeeting: function (returnVal: any) {
-        console.log(returnVal,'开启会议 音频 回调');
-    },
-    //开启会议 视频
-    Back_OnMeeting: function (returnVal: any) {
-        console.log(returnVal,'开启会议 音频 回调1');
-    },
-    //视频会议
-    StartVideoMeeting: function (meetId: string, tels: string) {
-        const param = meetId + "|" + tels;
-        const modelJson = this.GetSendModel("StartVideoMeeting", param);
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    //开启会议 视频
-    StartMeetingVideo: function (meetId: string, urls: string) {
-        const param = meetId + "|" + urls;
-        const modelJson = this.GetSendModel("StartMeetingVideo", param);
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    //视频推送
-    GetMcuVideo: function (meetId: string, guid: string) {
-        const param = meetId + "|" + guid;
-        const modelJson = this.GetSendModel("GetMcuVideo", param);
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    //视频推送 回调
-    Back_GetMcuVideo: function (returnVal: { Params: string; Message: any; }) {
-
-        if (returnVal.Params == "0") {
-            console.info(returnVal.Message);
-        } else {
-            console.info(returnVal.Message);
-        }
-    },
-    //禁言
-    ShutDownTalking: function (meetId: string, tel: string) {
-        const param = meetId + "|" + tel;
-        const modelJson = this.GetSendModel("ShutDownTalking", param);
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    //禁言 回调
-    Back_ShutDownTalking: function (returnVal: { Params: string; Message: any; }) {
-
-        if (returnVal.Params == "0") {
-            console.info(returnVal.Message);
-        } else {
-            console.info(returnVal.Message);
-        }
-    },
-    //踢人
-    ConferGetOut: function (meetId: string, tel: string) {
-        const param = meetId + "|" + tel;
-        const modelJson = this.GetSendModel("ConferGetOut", param);
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            console.info(WebsocketInterface("GetError", returnVal));
-        }
-    },
-    //踢人 回调
-    Back_ConferGetOut: function (returnVal: { Params: string; Message: any; }) {
-        if (returnVal.Params == "0") {
-            console.info(returnVal.Message);
-        } else {
-            console.info(returnVal.Message);
-        }
-    },
-    //禁言所有
-    ShutDownAll: function (meetId: string) {
-        const param = meetId + "|" + SystemAttr.CurrentUser.TelNum;
-        const modelJson = this.GetSendModel("ShutDownAll", param);
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        if (returnVal != 1) {
-            ElMessage(WebsocketInterface("GetError", returnVal))
-        }
-    },
-    //踢人 回调
-    Back_ShutDownAll: function (returnVal: { Params: string; Message: any; }) {
-        if (returnVal.Params == "0") {
-            console.info(returnVal.Message);
-        } else {
-            console.info(returnVal.Message);
-        }
-    },
-    //停止会议
-    StopMeeting: function (meetId: any) {
-        const modelJson = this.GetSendModel("StopMeeting", meetId);
-        const returnVal = WebsocketInterface("Send", JSON.stringify(modelJson));
-        //if (returnVal != 1) {
-        //    console.info(WebsocketInterface("GetError", returnVal));
-        //}else{            
-        //    closeWrVideo("video1");
-        //    closeWrVideo("video2");
-        //    closeWrVideo("video3");
-        //    closeWrVideo("video4");
-        //    closeWrVideo("video5");
-        //    closeWrVideo("video6");
-        //    closeWrVideo("video7");
-        //    closeWrVideo("video8");
-        //    closeWrVideo("video9");
-        //    $("video[name='meetvideo']").removeClass("play");
-        //}
-    },
-    // 停止会议 回调
-    Back_StopMeeting: function (returnVal: any) {
-        console.log(returnVal);
-    },
-    //会议结束 回调
-    Back_MeetingEnd: function (returnVal: any) {
-        ElMessage('会议结束')
-        console.log(returnVal);
-    },
-    //监听 回调
-    Back_LinkTele: function (returnVal: { Params: string; Message: any; }) {
-        if (returnVal.Params == "0") {
-            console.info(returnVal.Message);
-        } else {
-            console.info(returnVal.Message);
-        }
-    },
-    //分机注册状态回调
-    Back_RegNumberState: function (returnVal: any) {
-        console.log(returnVal);
-    },
-    //通话挂机事件
-    Back_TalkingEnd: function (returnVal: { Params: string; Message: any; }) {
-        console.info(returnVal.Message,'结束通话 挂机') //解析Message参数	有电话号码|电话唯一ID|录音文件名称
-        useTelStatusStore.setCallInfo({
-            telArea: "", // 电话区号
-            telGuid: "", // 电话guid
-            telIVR: "", // 电话IVR
-            telType: "", //来电 外呼 转接
-            fromTel: "", // 来电号码
-        });
-
-        useTelStatusStore.clearCallTime();
-        // 关闭定时器
-        removeTimer();
-        // 设置电话状态
-        useTelStatusStore.setPhoneControlState(TelStates.dutyOn);
-    },
-    //振铃结束
-    Back_UserRingEnd: function (returnVal: any) {
-        const DialArray = returnVal.Message.split("|");
-        const telNum =  DialArray[0]; //来电号码
-        const telGuid = DialArray[1]; //来电GUID
-        const telVoiceName = DialArray[2]; // 录音文件名
-
-        console.log(telNum,telGuid,telVoiceName)
-        useTelStatusStore.setCallInfo({
-            telArea: "", // 电话区号
-            telGuid: "", // 电话guid
-            telIVR: "", // 电话IVR
-            telType: "", //来电 外呼 转接
-            fromTel: "", // 来电号码
-        });
-        useTelStatusStore.clearCallTime();
-        // 设置电话状态
-        useTelStatusStore.setPhoneControlState(TelStates.dutyOn);
-    },
-    //开始通话事件
-    Back_BeginTalking: function (returnVal: { Params: string; Message: any; }) {
-        console.info(returnVal.Message,'开始通话'); //解析Message参数	有电话号码|电话唯一ID|录音文件名称
-        startTime();
-        // 设置电话状态 通话中
-        useTelStatusStore.setPhoneControlState(TelStates.onCall);
-    },
-    //获取视频流事件
-    Back_RtmpVideoMeeting: function (returnVal: { Params: string; Rtsp: any; Tel: any; CallGuid: any; }) {
-        console.info("Back_RtmpVideoMeeting");
-        console.log(returnVal);
-        if (returnVal.Params == "1") {
-            return;
-        }
-        const vid = $("video[name='meetvideo']:not('.play')").eq(0);
-        const vedioId = vid.prop("id");
-        const _td = vid.closest("td");
-        //var vedioId=$("#video1").prop("id");
-        const uuid = parseInt(String(Math.random() * 100000)) + '' + new Date().getTime();
-        registerWrVideo(uuid, vedioId, returnVal.Rtsp);
-        //registerWrVideo(returnVal.CallGuid, vedioId, returnVal.Rtsp);
-        _td.find("input[name='meet_num']").val(returnVal.Tel);
-        _td.find("input[name='meet_guid']").val(returnVal.CallGuid);
-        vid.addClass("play");
-    },
-    Back_EndVideoTalking: function (returnVal: { Params: string; Tel: string; }) {
-        console.log(returnVal);
-        if (returnVal.Params == "0") {
-            const _td = $("input[name='meet_num'][value='" + returnVal.Tel + "']").closest("td");
-            _td.find("input[name='meet_num']").val("");
-            _td.find("input[name='meet_guid']").val("");
-            _td.find("video").removeClass("play");
-            closeWrVideo(_td.find("video").attr("id"));
-        }
-    },
-    Back_StartVideoMeeting: function (returnVal: any) {
-        console.log(returnVal);
-    },
-
-    Back_CloseRtmp: function (returnVal: any) {
-        console.log(returnVal);
-    },
-
-    Back_VideoCall: function (returnVal: any) {
-        console.log(returnVal);
-    },
-
-    Back_BeginVideoTalking: function (returnVal: any) {
-        console.log(returnVal);
-    },
-    //排队信息推送
-    Back_TelQuene: function (returnVal: any) {
-        //  Params: "0" 表示正在排队 Params: "1" 表示排队结束
-        let telQuene = [];  // 排队信息
-        telQuene.push(returnVal);
-        telQuene = telQuene.filter((item: any) => item.Params === '0');
-        console.log(telQuene,'21');
-        if (telQuene.length > 0) {
-            ElMessage({
-                message: `当前排队人数:${telQuene.length}`,
-                type: 'info'
-            });
-        }
-    },
-};

+ 0 - 135
src/utils/websocket.ts

@@ -1,135 +0,0 @@
-/*
-* 陈玉堂  Websocket对象接口
-* 是否有重新连接IsReConnect设置为true,reConnectTime为重连的间隔;是否有心跳IsKeepAlive设置true|false, KeepAliveTime为心跳间隔, KeepAliveData心跳包参数
-* 初始化:WebsocketInterface({"url":"",IsReConnect:true|false,reConnectTime:20,onOpen:function(e){},onMessage:function(e){},onError:function(e){},onClose:function(e){} });
-* 方法:返回0成功,返回-1失败
-* 发送:WebsocketInterface("Send","msg");
-* 关闭:WebsocketInterface("Close");
-* 重连:WebsocketInterface("ReConnect");
-* 心跳:WebsocketInterface("KeepAlive");
-* 错误:WebsocketInterface("GetError",code);
-*/
-export const WebsocketInterface = (function () {
-    let wsObject:any = null; //连接对象
-    let wsOptions :any= null; //当前socket的参数
-    let wsInterval:any = null; //当前心跳定时器
-    let wsTimeout:any = null; //当前重连定时器
-
-    //方法
-    const Methods:any = {
-        Send: function (param: any) {
-            function send() {
-                wsObject.send(param);
-                console.info(param,'send发送的消息');
-            }
-            if (wsObject.readyState == 1) {
-                send();
-            }
-        },
-        Close: function () {
-            wsOptions.IsReConnect = false;
-            if (!!wsObject) {
-                wsObject.close();
-            }
-        },
-        ReConnect: function () {
-            const time = wsOptions.reConnectTime || 10; //默认为10秒
-            wsTimeout = setTimeout(function () {
-                WebsocketInterface(wsOptions);
-            }, time * 1000);
-        },
-        KeepAlive: function () {
-            const time = wsOptions.KeepAliveTime || 20; //默认为20秒
-            if (!!wsInterval) {
-                return;
-            }
-            if (wsOptions.IsKeepAlive && !!wsOptions.KeepAliveData) {
-                wsInterval = setInterval(function () {
-                    Methods["Send"](wsOptions.KeepAliveData);
-                }, time * 1000);
-            }
-        },
-        GetError: function (code: number) {
-            let msgStr;
-            switch (code) {
-                case -1:
-                    msgStr = "您的浏览器不支持WebSocket";
-                    break;
-                case 0:
-                    msgStr = "WebSocket连接尚未创建";
-                    break;
-                case 1:
-                    msgStr = "WebSocket连接已经建立";
-                    break;
-                case 2:
-                    msgStr = "WebSocket连接正在关闭";
-                    break;
-                case 3:
-                    msgStr = "WebSocket连接已经关闭或不可用";
-                    break;
-                case 4:
-                    msgStr = "指定方法未定义";
-                    break;
-                case 5:
-                    msgStr = "初始化WebSocket未定义url";
-                    break;
-            }
-            return msgStr;
-        }
-    };
-    return function (options: any, param?: string) {
-
-        if (options == "GetError") {
-            return Methods["GetError"](param);
-        }
-        if (!window.WebSocket) {
-            return -1;
-        }
-        if (typeof (options) == "string") {//方法
-            if (!wsObject) {
-                return 0;
-            }
-            if (!Methods[options]) {
-                return 4;
-            }
-            Methods[options](param);
-            return wsObject.readyState;
-        } else {//属性或事件
-            if (!wsObject && !options.url) {
-                return 5;
-            }
-            wsOptions = options;
-            wsObject = new WebSocket(options.url);
-            wsObject.onopen = function (e: any) {
-                if (!!options.onOpen) {
-                    options.onOpen(e);
-                }
-            }
-            wsObject.onmessage = function (e: any) {
-                if (!!wsTimeout) {
-                    clearTimeout(wsTimeout); //清空重连
-                    wsTimeout = null;
-                }
-                if (!!options.onMessage) {
-                    options.onMessage(e);
-                }
-            }
-            wsObject.onerror = function (e: any) {
-                if (!!options.onError) {
-                    options.onError(e);
-                }
-            }
-            wsObject.onclose = function (e: any) {
-                if (!!options.onClose) {
-                    options.onClose(e);
-                }
-                clearInterval(wsInterval); //清空心跳
-                wsInterval = null;
-                if (wsOptions.IsReConnect) {//是否重连,如果是手动断开,请调用WebsocketInterface("Close")
-                    Methods.ReConnect();
-                }
-            }
-        }
-        return wsObject.readyState;
-    }
-})();

+ 0 - 152
src/views/system/config/workflow/component/Workflow-config.vue

@@ -1,152 +0,0 @@
-<template>
-  <div class="system-workflow-config-container">
-    <el-dialog :title="'模板配置('+dialogTitle+')'" v-model="dialogVisible" draggable width="900px">
-      <el-form
-          :model="state.queryParams"
-          ref="ruleDialogFormRef"
-          :inline="true"
-          @submit.native.prevent
-          class="mt15"
-      >
-        <el-form-item label="关键字查询" prop="Keyword">
-          <el-input v-model="state.queryParams.Keyword" placeholder="模板名称/编码" clearable @keyup.enter="queryList" />
-        </el-form-item>
-        <el-form-item>
-          <el-button type="primary" @click="queryList" :loading="state.loading">
-            <SvgIcon name="ele-Search" class="mr5" />查询
-          </el-button>
-          <el-button @click="resetQuery(ruleDialogFormRef)" class="default-button"> <SvgIcon name="ele-Refresh" class="mr5" />重置 </el-button>
-        </el-form-item>
-      </el-form>
-      <el-table :data="state.tableData" @current-change="handleSelectionChange" max-height="500" v-loading="state.loading">
-        <el-table-column prop="phoneNo" label="请选择" width="70">
-          <template #default="{ row }">
-            <el-radio v-model="state.tableRadio" :label="row.id">&nbsp;</el-radio>
-          </template>
-        </el-table-column>
-        <el-table-column prop="phoneNo" label="模板名称" show-overflow-tooltip>
-          <template #default="{ row }">
-            <span style="color: var(--el-color-primary)">{{ row.name }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column prop="version" label="模板版本号" show-overflow-tooltip> </el-table-column>
-        <el-table-column prop="code" label="模板编码" show-overflow-tooltip> </el-table-column>
-        <el-table-column prop="creationTime" label="创建时间" show-overflow-tooltip width="170">
-          <template #default="{ row }">
-            <span>{{ formatDate(row.creationTime, 'YYYY-mm-dd HH:MM:SS') }}</span>
-          </template>
-        </el-table-column>
-        <template #empty>
-          <Empty />
-        </template>
-      </el-table>
-      <!-- 分页 -->
-      <pagination
-          :total="state.total"
-          v-model:page="state.queryParams.PageIndex"
-          v-model:limit="state.queryParams.PageSize"
-          @pagination="queryList"
-      />
-      <template #footer>
-				<span class="dialog-footer">
-					<el-button @click="dialogVisible = false" class="default-button">取 消</el-button>
-					<el-button type="primary" @click="onSubmit" :disabled="!state.tableRadio">保 存</el-button>
-				</span>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-
-<script lang="ts" setup name="workflowConfig">
-import { ref, reactive } from 'vue';
-import {ElMessage, ElMessageBox, FormInstance} from 'element-plus';
-import { WorkflowLatest, wfmodulesMatch} from '/@/api/system/workflow';
-import {formatDate} from "/@/utils/formatTime";
-import {throttle} from "/@/utils/tools";
-
-// 定义子组件向父组件传值/事件
-const emit = defineEmits(['updateList', 'openDialog', 'closeDialog']);
-
-// 定义变量内容
-const ruleDialogFormRef = ref<FormInstance>();
-const dialogVisible = ref(false); // 弹窗
-const dialogTitle = ref(''); // 弹窗标题
-
-const state = reactive<any>({
-  tableData: [],
-  total: 0,
-  loading:false,
-  queryParams: {
-    PageIndex: 1,
-    PageSize: 10,
-    Keyword: '',
-    Status: '1',
-  },
-  tableRadio:'',
-  rowCode:'',
-})
-
-// 打开弹窗
-const openDialog = async (row: any) => {
-  try {
-    queryList();
-    state.rowCode = row.code;
-    state.tableRadio = '';
-    dialogTitle.value = row.name;
-    dialogVisible.value = true;
-  } catch (error) {
-    console.log(error)
-    state.loading = false;
-  }
-};
-
-const queryList = () => {
-  state.loading = true;
-  WorkflowLatest(state.queryParams).then((res:any)=>{
-    state.tableData = res.result?.items ?? [];
-    state.total = res.result?.total ?? 0;
-    state.loading = false;
-  }).catch(()=>{
-    state.loading = false;
-  })
-}
-const resetQuery =  throttle((formEl: FormInstance | undefined)=>{
-  if (!formEl) return;
-  formEl.resetFields();
-  queryList();
-},500)
-
-// 选择重复件
-const handleSelectionChange = (row: any) => {
-  if (row) {
-    state.tableRadio = row.id;
-  }
-};
-
-// 关闭弹窗
-const closeDialog = () => {
-  dialogVisible.value  = false;
-};
-// 选择模板
-const onSubmit = () => {
-  ElMessageBox.confirm(`确认提交?`, '提示', {
-    confirmButtonText: '确认',
-    cancelButtonText: '取消',
-    type: 'warning',
-    draggable: true,
-    cancelButtonClass: 'default-button',
-    autofocus: false,
-  })
-      .then(() => {
-        wfmodulesMatch({code:state.rowCode,definitionId:state.tableRadio}).then(()=>{
-          ElMessage.success('操作成功');
-          emit('updateList');
-          dialogVisible.value = false;
-        }).catch(()=>{})
-      })
-      .catch(() => {});
-};
-
-//暴漏变量和方法
-defineExpose({ closeDialog, openDialog });
-</script>

+ 72 - 114
src/views/system/config/workflow/index.vue

@@ -1,10 +1,9 @@
 <template>
-	<div class="system-workflow-container layout-pd">
-		<el-card shadow="never">
+	<div class="system-workflow-container layout-padding">
+		<div class="layout-padding-auto layout-padding-view pd20">
 			<el-tabs v-model="state.activeName" @tab-change="handleClick" class="h100">
-				<el-tab-pane label="流程业务" name="0"></el-tab-pane>
-				<el-tab-pane label="流程模板" name="1"></el-tab-pane>
-				<el-tab-pane label="流程实例" name="2"></el-tab-pane>
+				<el-tab-pane label="流程模板" name="template"></el-tab-pane>
+				<el-tab-pane label="流程实例" name="example"></el-tab-pane>
 				<div class="flex-column">
 					<el-form
 						:model="state.queryParams"
@@ -12,7 +11,7 @@
 						:inline="true"
 						@submit.native.prevent
 						class="mt15"
-						v-show="state.activeName === '2'"
+						v-show="state.activeName === 'example'"
 					>
 						<el-form-item label="关键字查询" prop="Keyword">
 							<el-input v-model="state.queryParams.Keyword" placeholder="流程标题/流程ID" style="width: 300px" clearable @keyup.enter="queryList" />
@@ -32,7 +31,7 @@
 					<div class="flex-center-between mb20">
 						<p class="table-title">信息列表</p>
 						<div>
-							<el-button type="primary" @click="onAddTemp" v-waves v-if="state.activeName === '1'" v-auth="'system:workflow:template:add'">
+							<el-button type="primary" @click="onAddTemp" v-waves v-if="state.activeName === 'template'" v-auth="'system:workflow:template:add'">
 								<SvgIcon name="ele-Plus" class="mr5" />新增
 							</el-button>
 						</div>
@@ -40,73 +39,75 @@
 					<!-- 表格 -->
 					<el-table :data="state.tableList" v-loading="state.loading" row-key="id">
 						<el-table-column type="index" width="60" label="序号" />
-						<!-- 配置 -->
-						<template v-if="state.activeName === '0'">
-							<el-table-column prop="name" label="业务模块" show-overflow-tooltip></el-table-column>
-							<el-table-column prop="code" label="编码" show-overflow-tooltip></el-table-column>
-							<el-table-column prop="remark" label="备注" show-overflow-tooltip></el-table-column>
-              <el-table-column prop="definition.name" label="模板名称" show-overflow-tooltip></el-table-column>
-              <el-table-column prop="definition.code" label="模板编码" show-overflow-tooltip></el-table-column>
-              <el-table-column prop="definition.version" label="模板版本" show-overflow-tooltip></el-table-column>
-              <el-table-column label="操作" width="160" fixed="right" align="center">
-                <template #default="{ row }">
-                  <el-button link type="primary" @click="onConfig(row)"  title="配置模板"> 配置模板</el-button>
-                  <el-button link type="danger" @click="configClear(row)"  title="清除配置" v-if="row.definition"> 清除配置 </el-button>
-                </template>
-              </el-table-column>
-						</template>
 						<!-- 模板 -->
-						<template v-if="state.activeName === '1'">
+						<template v-if="state.activeName === 'template'">
+							<el-table-column prop="moduleName" label="业务模块" show-overflow-tooltip></el-table-column>
 							<el-table-column prop="name" label="模板名称" show-overflow-tooltip></el-table-column>
 							<el-table-column prop="code" label="模板编码" show-overflow-tooltip></el-table-column>
 							<el-table-column prop="version" label="版本号" show-overflow-tooltip></el-table-column>
 							<el-table-column prop="creationTime" label="更新时间" show-overflow-tooltip>
-								<template #default="{ row }">
+								<template #default="{row}">
 									<span>{{ formatDate(row.creationTime, 'YYYY-mm-dd HH:MM:SS') }}</span>
 								</template>
 							</el-table-column>
 							<el-table-column prop="statusText" label="状态" show-overflow-tooltip></el-table-column>
 							<el-table-column label="操作" width="150" fixed="right" align="center">
 								<!-- 草稿0 启用1 禁用2 -->
-								<template #default="{ row }">
-									<el-button link type="primary" @click="onEditTemp(row)" title="修改" v-auth="'system:workflow:template:edit'"> 修改 </el-button>
-									<el-button link type="success" v-if="row.status === 0" @click="onReleaseTemp(row)" title="发布" v-auth="'system:workflow:template:release'" >
+								<template #default="{row}">
+									<el-button link type="primary" @click="onEditTemp(row)" title="修改" v-auth="'system:workflow:template:edit'">
+										修改
+									</el-button>
+									<el-button
+										link
+										type="success"
+										v-if="row.status === 0"
+										@click="onReleaseTemp(row)"
+										title="发布"
+										v-auth="'system:workflow:template:release'"
+									>
 										发布
 									</el-button>
 									<!-- <el-button link type="warning" v-if="row.status === 2" @click="tempEnable(row)" title="启用" v-auth="'system:workflow:template:enable'">
-                    启用
-                  </el-button> -->
-									<!--									<el-button-->
-									<!--										link-->
-									<!--										type="danger"-->
-									<!--										v-if="row.status === 1"-->
-									<!--										@click="tempDisable(row)"-->
-									<!--										title="禁用"-->
-									<!--										v-auth="'system:workflow:template:disable'"-->
-									<!--									>-->
-									<!--										禁用-->
-									<!--									</el-button>-->
+										启用
+									</el-button> -->
+									<el-button
+										link
+										type="danger"
+										v-if="row.status === 1"
+										@click="tempDisable(row)"
+										title="禁用"
+										v-auth="'system:workflow:template:disable'"
+									>
+										禁用
+									</el-button>
 									<!-- 发布之后不能修改 -->
-									<el-button link v-if="row.status === 0" type="danger" @click="onDeleteTemp(row)" title="删除" v-auth="'system:workflow:template:delete'">
+									<el-button
+										link
+										v-if="row.status === 0"
+										type="danger"
+										@click="onDeleteTemp(row)"
+										title="删除"
+										v-auth="'system:workflow:template:delete'"
+									>
 										删除
 									</el-button>
 								</template>
 							</el-table-column>
 						</template>
 						<!-- 实例 -->
-						<template v-else-if="state.activeName === '2'">
+						<template v-else-if="state.activeName === 'example'">
 							<el-table-column prop="title" label="流程标题" show-overflow-tooltip width="300"></el-table-column>
 							<el-table-column prop="statusText" label="流程状态" show-overflow-tooltip width="100"></el-table-column>
 							<el-table-column prop="id" label="流程ID" show-overflow-tooltip width="300"></el-table-column>
 							<el-table-column prop="moduleName" label="业务模块" show-overflow-tooltip width="170"></el-table-column>
 							<el-table-column prop="moduleCode" label="流程模板" show-overflow-tooltip width="170"></el-table-column>
 							<el-table-column prop="assignTime" label="创建时间" show-overflow-tooltip width="170">
-								<template #default="{ row }">
+								<template #default="{row}">
 									<span>{{ formatDate(row.assignTime, 'YYYY-mm-dd HH:MM:SS') }}</span>
 								</template>
 							</el-table-column>
 							<el-table-column prop="completeTime" label="当前环节到达" show-overflow-tooltip width="170">
-								<template #default="{ row }">
+								<template #default="{row}">
 									<span>{{ formatDate(row.completeTime, 'YYYY-mm-dd HH:MM:SS') }}</span>
 								</template>
 							</el-table-column>
@@ -146,43 +147,35 @@
 						v-model:page="state.queryParams.PageIndex"
 						v-model:limit="state.queryParams.PageSize"
 						@pagination="queryList"
-						v-if="state.activeName !== '0'"
 					/>
 				</div>
 			</el-tabs>
-		</el-card>
-    <!--  流程跳转 -->
+		</div>
 		<workflow-jump ref="workflowJumpRef" @updateList="queryList" />
-
-    <!--  配置模板  -->
-    <Workflow-config ref="workflowConfigRef" @updateList="queryList"/>
 	</div>
 </template>
 
 <script lang="ts" setup name="systemWorkflow">
-import { ref, reactive, onMounted, defineAsyncComponent,onActivated } from 'vue';
-import { useRouter,useRoute } from 'vue-router';
+import { ref, reactive, onMounted, defineAsyncComponent } from 'vue';
+import { useRouter } from 'vue-router';
 import type { FormInstance } from 'element-plus';
 import { ElMessage, ElMessageBox } from 'element-plus';
 import { formatDate } from '/@/utils/formatTime';
 import { throttle } from '/@/utils/tools';
 import {
-  workflowList,
-  workflowPaged,
-  workflowDelete,
-  publishOnList,
-  workflowEnable,
-  workflowDisable,
-  workflowTerminate,
-  WorkflowHasDefine,
-  baseData,
-  wfmodules, wfmodulesMatch,
+	workflowList,
+	workflowPaged,
+	workflowDelete,
+	publishOnList,
+	workflowEnable,
+	workflowDisable,
+	workflowTerminate,
+	WorkflowHasDefine,
+	baseData,
 } from '/@/api/system/workflow';
 
-
 // 引入组件
 const WorkflowJump = defineAsyncComponent(() => import('/@/views/system/config/workflow/component/Workflow-jump.vue'));
-const WorkflowConfig = defineAsyncComponent(() => import('/@/views/system/config/workflow/component/Workflow-config.vue'));
 
 // 定义接口来定义对象的类型
 interface QueryState {
@@ -202,7 +195,7 @@ interface QueryState {
 
 // 定义变量内容
 const state = reactive(<QueryState>{
-	activeName: '0',
+	activeName: 'template',
 	queryParams: {
 		PageIndex: 1,
 		PageSize: 10,
@@ -215,27 +208,14 @@ const state = reactive(<QueryState>{
 	multipleSelection: [],
 	moduleOptions: [],
 });
-
 const ruleFormRef = ref<FormInstance>();
 const workflowJumpRef = ref(null as any);
-const workflowConfigRef = ref(null as any);
 const router = useRouter();
-const route = useRoute();
 /** 获取列表 */
 const queryList = () => {
-	state.loading = true;
 	switch (state.activeName) {
-		case '0':
-			wfmodules()
-				.then((response: any) => {
-					state.tableList = response.result ?? [];
-					state.loading = false;
-				})
-				.catch(() => {
-					state.loading = false;
-				});
-			break;
-		case '1':
+		case 'template':
+			state.loading = true;
 			workflowList(state.queryParams)
 				.then((response: any) => {
 					state.tableList = response.result.items ?? [];
@@ -246,7 +226,8 @@ const queryList = () => {
 					state.loading = false;
 				});
 			break;
-		case '2':
+		case 'example':
+			state.loading = true;
 			workflowPaged(state.queryParams)
 				.then((response: any) => {
 					state.tableList = response.result?.items ?? [];
@@ -266,7 +247,7 @@ const resetQuery = throttle((formEl: FormInstance | undefined) => {
 	if (!formEl) return;
 	formEl.resetFields();
 	queryList();
-}, 500);
+}, 1000);
 // 切换tab 查询列表
 const handleClick = () => {
 	queryList();
@@ -310,7 +291,7 @@ const onDeleteTemp = (row: any) => {
 };
 // 发布模板
 const onReleaseTemp = async (row: any) => {
-	const response: any = await WorkflowHasDefine(row.code);
+	const response: any = await WorkflowHasDefine(row.moduleCode);
 	if (response.result) {
 		//若已存在有效模板
 		ElMessageBox.confirm(`业务模块【${row.moduleName}】已有流程模板,确认覆盖当前版本?`, '提示', {
@@ -425,43 +406,12 @@ const onStopProcess = (row: any) => {
 		})
 		.catch(() => {});
 };
-
-
-// 配置模板
-const onConfig = (row:any)=>{
-  workflowConfigRef.value.openDialog(row);
-}
-// 清除配置
-const configClear = (row:any)=>{
-  ElMessageBox.confirm(`确认清除${row.name} 的配置?`, '提示', {
-    confirmButtonText: '确认',
-    cancelButtonText: '取消',
-    type: 'warning',
-    draggable: true,
-    cancelButtonClass: 'default-button',
-    autofocus: false,
-  })
-      .then(() => {
-        wfmodulesMatch({code:row.code,definitionId:''}).then(()=>{
-          ElMessage.success('操作成功');
-          queryList();
-        }).catch(()=>{})
-      })
-      .catch(() => {});
-}
+//
 onMounted(async () => {
 	queryList();
 	// 获取页面基础信息
 	const res: any = await baseData();
 	state.moduleOptions = res.result?.moduleOptions ?? [];
-  if(route.query.tabIndex){
-    state.activeName = route.query.tabIndex as string;
-  }
-});
-onActivated(() => {
-  if(route.query.tabIndex){
-    state.activeName = route.query.tabIndex as string;
-  }
 });
 </script>
 <style lang="scss" scoped>
@@ -469,5 +419,13 @@ onActivated(() => {
 	:deep(.el-tabs__content) {
 		height: 100%;
 	}
+	.flex-column {
+		display: flex;
+		flex-direction: column;
+		height: calc(100% - 55px);
+		.el-table {
+			flex: 1;
+		}
+	}
 }
 </style>

Some files were not shown because too many files changed in this diff