Quellcode durchsuchen

reactor:自贡新增分机管理;

zhangchong vor 5 Monaten
Ursprung
Commit
f499d74f23

+ 2 - 2
.env.development

@@ -3,9 +3,9 @@ VITE_MODE_NAME=development
 # 防止部署多套系统到同一域名不同目录时,变量共用的问题 设置不同的前缀
 VITE_STORAGE_NAME=dev
 # 业务系统基础请求地址
-VITE_API_URL=http://110.188.24.28:50100
+VITE_API_URL=http://110.188.24.28:50300
 # 业务系统socket请求地址
-VITE_API_SOCKET_URL=http://110.188.24.28:50100/hubs/hotline
+VITE_API_SOCKET_URL=http://110.188.24.28:50300/hubs/hotline
 # 业务系统文件上传上传请求地址
 VITE_API_UPLOAD_URL=http://open.fs.12345lm.cn
 # 数据共享平台请求地址

+ 212 - 0
src/views/tels/extension/YBExtension.vue

@@ -0,0 +1,212 @@
+<template>
+	<div class="tels-callLog-container layout-padding">
+		<div class="layout-padding-auto layout-padding-view pd20">
+			<ProTable
+				ref="proTableRef"
+				:columns="columns"
+				:data="state.tableData"
+				@updateTable="queryList"
+				:loading="state.loading"
+				:pagination="false"
+				row-key="telNo"
+			>
+				<template #tableHeader>
+					<el-radio-group v-model="telState" class="mb10" @change="search">
+						<el-radio value=" "
+						>总数:
+							<el-tag>{{ state.tableList.length }}</el-tag>
+						</el-radio>
+						<el-radio value="device"
+						>注册数:
+							<el-tag type="success">{{ registerCount }}</el-tag>
+						</el-radio>
+						<el-radio value="login"
+						>签入数:
+							<el-tag type="danger">{{ loginCount }}</el-tag>
+						</el-radio>
+						<el-radio value="ready"
+						>示闲数:
+							<el-tag type="info">{{ readyCount }}</el-tag>
+						</el-radio>
+						<el-radio value="unready"
+						>小休数:
+							<el-tag type="success">{{ unreadyCount }}</el-tag>
+						</el-radio>
+						<el-radio value="ring"
+						>振铃数:
+							<el-tag type="info">{{ busyCount }}</el-tag>
+						</el-radio>
+						<el-radio value="busy"
+						>通话数:
+							<el-tag type="danger">{{ busyCount }}</el-tag>
+						</el-radio>
+						<el-radio value="acw"
+						>整理数:
+							<el-tag type="info">{{ acwCount }}</el-tag>
+						</el-radio>
+						<el-radio value="held"
+						>保持数:
+							<el-tag type="success">{{ heldCount }}</el-tag>
+						</el-radio>
+						<el-radio value="threeWay"
+						>三方会议数:
+							<el-tag type="danger">{{ threeWayCount }}</el-tag>
+						</el-radio>
+					</el-radio-group>
+				</template>
+				<template #sipState="{ row }">
+					<el-tag v-if="row.sipState === 'true'" type="success">已注册</el-tag>
+					<el-tag v-else type="danger">未注册</el-tag>
+				</template>
+				<template #state="{ row }">
+					<el-tag v-if="row.state === 'login'" type="success">签入</el-tag>
+					<el-tag v-else-if="row.state === 'ready'" type="info">示闲</el-tag>
+					<el-tag v-else-if="row.state === 'unready'" type="warning">小休</el-tag>
+					<el-tag v-else-if="row.state === 'ring'" type="danger">振铃中</el-tag>
+					<el-tag v-else-if="row.state === 'busy'">通话</el-tag>
+					<el-tag v-else-if="row.state === 'acw'" type="info">整理</el-tag>
+					<el-tag v-else-if="row.state === 'logout'" type="danger">签出</el-tag>
+					<el-tag v-else-if="row.state === 'held'" type="danger">保持</el-tag>
+					<el-tag v-else-if="row.state === 'threeWay'" type="danger">三方会议</el-tag>
+				</template>
+				<template #operation="{ row }">
+					<!--              <el-button link type="primary" @click="onListen(row)" title="监听分机" v-auth="'tels:extension:listen'" v-if="row.state === 'busy'">
+                监听分机
+              </el-button>-->
+					<el-button link type="primary" @click="onOffline(row)" title="强制下线" v-auth="'tels:extension:forceLogout'"> 强制下线 </el-button>
+				</template>
+			</ProTable>
+		</div>
+	</div>
+</template>
+
+<script lang="tsx" setup name="telsExtension">
+import { computed, onMounted, reactive, ref, onBeforeUnmount } from 'vue';
+import { ElMessage, ElMessageBox } from 'element-plus';
+import signalR from '@/utils/signalR';
+import { extensionList, forceLogout } from '@/api/tels/extension';
+
+const proTableRef = ref<RefType>(); // 表格ref
+// 表格配置项
+const columns = ref<any[]>([
+	{ prop: 'telNo', label: '分机号', width: 200 },
+	{ prop: 'sipState', label: '是否注册', width: 200 },
+	{
+		prop: 'device',
+		label: '注册信息',
+		render: (scope: any) => {
+			return (
+				<span>
+					{scope.row.device}({scope.row.sipIp})
+				</span>
+			);
+		},
+	},
+	{ prop: 'state', label: '状态', width: 200 },
+	{ prop: 'operation', label: '操作', fixed: 'right', width: 90, align: 'center' },
+]);
+// 定义变量内容
+const state = reactive({
+	tableList: [], // 列表数据
+	tableData: [], // 显示的列表数据
+	loading: false, // 加载
+	total: 0, // 总条数
+});
+const telState = ref<string>(' ');
+/** 通话记录列表 */
+const queryList = async () => {
+	state.loading = true;
+	try {
+		const { result } = await extensionList({ hasListen: true });
+		// state.tableList = [...result,...result,...result];
+		state.tableList = result;
+		state.tableData = state.tableList;
+		state.loading = false;
+	} catch (e) {
+		state.loading = false;
+	}
+};
+const search = () => {
+	state.loading = true;
+	if (telState.value !== ' ') {
+		if (telState.value === 'device') {
+			state.tableData = state.tableList.filter((item: any) => item.sipState === 'true');
+		} else {
+			state.tableData = state.tableList.filter((item: any) => item.state === telState.value);
+		}
+		setTimeout(() => {
+			state.loading = false;
+		}, 200);
+	} else {
+		state.tableData = state.tableList;
+		setTimeout(() => {
+			state.loading = false;
+		}, 200);
+	}
+};
+// 注册数
+const registerCount = computed(() => {
+	return state.tableList.filter((item: any) => item.device).length;
+});
+// 签入数
+const loginCount = computed(() => {
+	return state.tableList.filter((item: any) => item.state === 'login').length;
+});
+// 示闲数
+const readyCount = computed(() => {
+	return state.tableList.filter((item: any) => item.state === 'ready').length;
+});
+// 示忙数
+const unreadyCount = computed(() => {
+	return state.tableList.filter((item: any) => item.state === 'unready').length;
+});
+// 通话数
+const busyCount = computed(() => {
+	return state.tableList.filter((item: any) => item.state === 'busy').length;
+});
+// 整理数
+const acwCount = computed(() => {
+	return state.tableList.filter((item: any) => item.state === 'acw').length;
+});
+// 保持数
+const heldCount = computed(() => {
+	return state.tableList.filter((item: any) => item.state === 'held').length;
+});
+// 三方会议数
+const threeWayCount = computed(() => {
+	return state.tableList.filter((item: any) => item.state === 'threeWay').length;
+});
+// 强制下线
+const onOffline = (row: any) => {
+	ElMessageBox.confirm(`确定要强制下线${row.telNo}?`, '提示', {
+		confirmButtonText: '确认',
+		cancelButtonText: '取消',
+		type: 'warning',
+		draggable: true,
+		cancelButtonClass: 'default-button',
+	})
+		.then(() => {
+			forceLogout({ telNo: row.telNo })
+				.then(() => {
+					ElMessage.success('强制下线成功');
+				})
+				.catch(() => {});
+		})
+		.catch(() => {});
+	// forceLogout(row.telNo);
+};
+onMounted(() => {
+	queryList();
+	signalR.joinGroup('BigScreen-SeatState');
+	signalR.SR?.on('SeatState', (data:any) => {
+		const item = state.tableList.find((item: any) => item.telNo === data.telNo);
+		if (item) {
+			item.state = data.state;
+		}
+		search();
+	});
+});
+onBeforeUnmount(() => {
+	signalR.SR.off('SeatState');
+});
+</script>

+ 11 - 0
src/views/tels/extension/ZGExtension.vue

@@ -0,0 +1,11 @@
+<script setup lang="ts">
+
+</script>
+
+<template>
+
+</template>
+
+<style scoped lang="scss">
+
+</style>

+ 20 - 205
src/views/tels/extension/index.vue

@@ -1,212 +1,27 @@
 <template>
-	<div class="tels-callLog-container layout-padding">
-		<div class="layout-padding-auto layout-padding-view pd20">
-			<ProTable
-				ref="proTableRef"
-				:columns="columns"
-				:data="state.tableData"
-				@updateTable="queryList"
-				:loading="state.loading"
-				:pagination="false"
-				row-key="telNo"
-			>
-				<template #tableHeader>
-					<el-radio-group v-model="telState" class="mb10" @change="search">
-						<el-radio value=" "
-							>总数:
-							<el-tag>{{ state.tableList.length }}</el-tag>
-						</el-radio>
-						<el-radio value="device"
-							>注册数:
-							<el-tag type="success">{{ registerCount }}</el-tag>
-						</el-radio>
-						<el-radio value="login"
-							>签入数:
-							<el-tag type="danger">{{ loginCount }}</el-tag>
-						</el-radio>
-						<el-radio value="ready"
-							>示闲数:
-							<el-tag type="info">{{ readyCount }}</el-tag>
-						</el-radio>
-						<el-radio value="unready"
-							>小休数:
-							<el-tag type="success">{{ unreadyCount }}</el-tag>
-						</el-radio>
-						<el-radio value="ring"
-							>振铃数:
-							<el-tag type="info">{{ busyCount }}</el-tag>
-						</el-radio>
-						<el-radio value="busy"
-							>通话数:
-							<el-tag type="danger">{{ busyCount }}</el-tag>
-						</el-radio>
-						<el-radio value="acw"
-							>整理数:
-							<el-tag type="info">{{ acwCount }}</el-tag>
-						</el-radio>
-						<el-radio value="held"
-							>保持数:
-							<el-tag type="success">{{ heldCount }}</el-tag>
-						</el-radio>
-						<el-radio value="threeWay"
-							>三方会议数:
-							<el-tag type="danger">{{ threeWayCount }}</el-tag>
-						</el-radio>
-					</el-radio-group>
-				</template>
-				<template #sipState="{ row }">
-					<el-tag v-if="row.sipState === 'true'" type="success">已注册</el-tag>
-					<el-tag v-else type="danger">未注册</el-tag>
-				</template>
-				<template #state="{ row }">
-					<el-tag v-if="row.state === 'login'" type="success">签入</el-tag>
-					<el-tag v-else-if="row.state === 'ready'" type="info">示闲</el-tag>
-					<el-tag v-else-if="row.state === 'unready'" type="warning">小休</el-tag>
-					<el-tag v-else-if="row.state === 'ring'" type="danger">振铃中</el-tag>
-					<el-tag v-else-if="row.state === 'busy'">通话</el-tag>
-					<el-tag v-else-if="row.state === 'acw'" type="info">整理</el-tag>
-					<el-tag v-else-if="row.state === 'logout'" type="danger">签出</el-tag>
-					<el-tag v-else-if="row.state === 'held'" type="danger">保持</el-tag>
-					<el-tag v-else-if="row.state === 'threeWay'" type="danger">三方会议</el-tag>
-				</template>
-				<template #operation="{ row }">
-					<!--              <el-button link type="primary" @click="onListen(row)" title="监听分机" v-auth="'tels:extension:listen'" v-if="row.state === 'busy'">
-                监听分机
-              </el-button>-->
-					<el-button link type="primary" @click="onOffline(row)" title="强制下线" v-auth="'tels:extension:forceLogout'"> 强制下线 </el-button>
-				</template>
-			</ProTable>
-		</div>
-	</div>
+	<component :is="currentCity" />
 </template>
 
-<script lang="tsx" setup name="telsExtension">
-import { computed, onMounted, reactive, ref, onBeforeUnmount } from 'vue';
-import { ElMessage, ElMessageBox } from 'element-plus';
-import signalR from '@/utils/signalR';
-import { extensionList, forceLogout } from '@/api/tels/extension';
+<script lang="tsx" setup name="callLog">
+import { defineAsyncComponent, computed } from 'vue';
+import { useThemeConfig } from '@/stores/themeConfig';
+import { storeToRefs } from 'pinia';
 
-const proTableRef = ref<RefType>(); // 表格ref
-// 表格配置项
-const columns = ref<any[]>([
-	{ prop: 'telNo', label: '分机号', width: 200 },
-	{ prop: 'sipState', label: '是否注册', width: 200 },
-	{
-		prop: 'device',
-		label: '注册信息',
-		render: (scope: any) => {
-			return (
-				<span>
-					{scope.row.device}({scope.row.sipIp})
-				</span>
-			);
-		},
-	},
-	{ prop: 'state', label: '状态', width: 200 },
-	{ prop: 'operation', label: '操作', fixed: 'right', width: 90, align: 'center' },
-]);
-// 定义变量内容
-const state = reactive({
-	tableList: [], // 列表数据
-	tableData: [], // 显示的列表数据
-	loading: false, // 加载
-	total: 0, // 总条数
-});
-const telState = ref<string>(' ');
-/** 通话记录列表 */
-const queryList = async () => {
-	state.loading = true;
-	try {
-		const { result } = await extensionList({ hasListen: true });
-		// state.tableList = [...result,...result,...result];
-		state.tableList = result;
-		state.tableData = state.tableList;
-		state.loading = false;
-	} catch (e) {
-		state.loading = false;
-	}
-};
-const search = () => {
-	state.loading = true;
-	if (telState.value !== ' ') {
-		if (telState.value === 'device') {
-			state.tableData = state.tableList.filter((item: any) => item.sipState === 'true');
-		} else {
-			state.tableData = state.tableList.filter((item: any) => item.state === telState.value);
-		}
-		setTimeout(() => {
-			state.loading = false;
-		}, 200);
-	} else {
-		state.tableData = state.tableList;
-		setTimeout(() => {
-			state.loading = false;
-		}, 200);
-	}
-};
-// 注册数
-const registerCount = computed(() => {
-	return state.tableList.filter((item: any) => item.device).length;
-});
-// 签入数
-const loginCount = computed(() => {
-	return state.tableList.filter((item: any) => item.state === 'login').length;
-});
-// 示闲数
-const readyCount = computed(() => {
-	return state.tableList.filter((item: any) => item.state === 'ready').length;
-});
-// 示忙数
-const unreadyCount = computed(() => {
-	return state.tableList.filter((item: any) => item.state === 'unready').length;
-});
-// 通话数
-const busyCount = computed(() => {
-	return state.tableList.filter((item: any) => item.state === 'busy').length;
-});
-// 整理数
-const acwCount = computed(() => {
-	return state.tableList.filter((item: any) => item.state === 'acw').length;
-});
-// 保持数
-const heldCount = computed(() => {
-	return state.tableList.filter((item: any) => item.state === 'held').length;
-});
-// 三方会议数
-const threeWayCount = computed(() => {
-	return state.tableList.filter((item: any) => item.state === 'threeWay').length;
-});
-// 强制下线
-const onOffline = (row: any) => {
-	ElMessageBox.confirm(`确定要强制下线${row.telNo}?`, '提示', {
-		confirmButtonText: '确认',
-		cancelButtonText: '取消',
-		type: 'warning',
-		draggable: true,
-		cancelButtonClass: 'default-button',
-	})
-		.then(() => {
-			forceLogout({ telNo: row.telNo })
-				.then(() => {
-					ElMessage.success('强制下线成功');
-				})
-				.catch(() => {});
-		})
-		.catch(() => {});
-	// forceLogout(row.telNo);
+// 引入组件
+const YiBin = defineAsyncComponent(() => import('@/views/tels/extension/YBExtension.vue')); // 宜宾分机列表
+const ZiGong = defineAsyncComponent(() => import('@/views/tels/extension/ZGExtension.vue')); // 自贡分机列表
+const LuZhou = defineAsyncComponent(() => import('@/views/tels/extension/ZGExtension.vue')); // 泸州分机列表
+
+const storesThemeConfig = useThemeConfig();
+const { themeConfig } = storeToRefs(storesThemeConfig);
+
+const COMPONENT_LIST = {
+	YiBin,
+	ZiGong,
+	LuZhou
 };
-onMounted(() => {
-	queryList();
-	signalR.joinGroup('BigScreen-SeatState');
-	signalR.SR?.on('SeatState', (data:any) => {
-		const item = state.tableList.find((item: any) => item.telNo === data.telNo);
-		if (item) {
-			item.state = data.state;
-		}
-		search();
-	});
-});
-onBeforeUnmount(() => {
-	signalR.SR.off('SeatState');
+// 当前地州市
+const currentCity = computed(() => {
+	return COMPONENT_LIST[themeConfig.value.appScope];
 });
 </script>