Browse Source

权限处理

zhangchong 2 years ago
parent
commit
7e5a805234

+ 32 - 19
src/layout/lockScreen/index.vue

@@ -3,8 +3,16 @@
 		<div class="layout-lock-screen-mask"></div>
 		<div class="layout-lock-screen-img" :class="{ 'layout-lock-screen-filter': state.isShowLoockLogin }"></div>
 		<div class="layout-lock-screen">
-			<div class="layout-lock-screen-date" ref="layoutLockScreenDateRef" @mousedown="onDown" @mousemove="onMove"
-				@mouseup="onEnd" @touchstart.stop="onDown" @touchmove.stop="onMove" @touchend.stop="onEnd">
+			<div
+				class="layout-lock-screen-date"
+				ref="layoutLockScreenDateRef"
+				@mousedown="onDown"
+				@mousemove="onMove"
+				@mouseup="onEnd"
+				@touchstart.stop="onDown"
+				@touchmove.stop="onMove"
+				@touchend.stop="onEnd"
+			>
 				<div class="layout-lock-screen-date-box">
 					<div class="layout-lock-screen-date-box-time">
 						{{ state.time.hm }}<span class="layout-lock-screen-date-box-minutes">{{ state.time.s }}</span>
@@ -22,10 +30,14 @@
 						<!-- <div class="layout-lock-screen-login-box-img">
 							<img src="https://img2.baidu.com/it/u=1978192862,2048448374&fm=253&fmt=auto&app=138&f=JPEG?w=504&h=500" />
 						</div> -->
-						<div class="layout-lock-screen-login-box-name">{{ themeConfig.wartermarkText }}</div>
+						<div class="layout-lock-screen-login-box-name">{{ themeConfig.watermarkText }}</div>
 						<div class="layout-lock-screen-login-box-value">
-							<el-input placeholder="请输入密码" ref="layoutLockScreenInputRef" v-model="state.lockScreenPassword"
-								@keyup.enter.native.stop="onLockScreenSubmit()">
+							<el-input
+								placeholder="请输入密码"
+								ref="layoutLockScreenInputRef"
+								v-model="state.lockScreenPassword"
+								@keyup.enter.native.stop="onLockScreenSubmit()"
+							>
 								<template #append>
 									<el-button @click="onLockScreenSubmit">
 										<el-icon class="el-input__icon">
@@ -53,7 +65,7 @@ import { formatDate } from '/@/utils/formatTime';
 import { Local, Session } from '/@/utils/storage';
 import { storeToRefs } from 'pinia';
 import { useThemeConfig } from '/@/stores/themeConfig';
-import { ElMessage, ElMessageBox } from 'element-plus'
+import { ElMessage, ElMessageBox } from 'element-plus';
 // 定义接口来定义对象的类型
 interface LockScreenState {
 	transparency: number;
@@ -174,11 +186,11 @@ const setLocalThemeConfig = () => {
 };
 // 密码输入点击事件
 const onLockScreenSubmit = () => {
-	if (Session.get("lockPwd") != state.lockScreenPassword) {
+	if (Session.get('lockPwd') != state.lockScreenPassword) {
 		ElMessage({
 			message: '锁屏密码错误,请重试',
 			type: 'warning',
-		})
+		});
 		return;
 	}
 	themeConfig.value.isLockScreen = false;
@@ -192,16 +204,18 @@ const fogetPwd = () => {
 		type: 'warning',
 		draggable: true,
 		cancelButtonClass: 'default-button',
-		autofocus: false
-	}).then(() => {
-		themeConfig.value.isLockScreen = false;
-		themeConfig.value.lockScreenTime = 30;
-		setLocalThemeConfig();
-		// 清除缓存/token等
-		Session.clear();
-		window.location.reload();
-	}).catch(() => { });
-}
+		autofocus: false,
+	})
+		.then(() => {
+			themeConfig.value.isLockScreen = false;
+			themeConfig.value.lockScreenTime = 30;
+			setLocalThemeConfig();
+			// 清除缓存/token等
+			Session.clear();
+			window.location.reload();
+		})
+		.catch(() => {});
+};
 // 页面加载时
 onMounted(() => {
 	initGetElement();
@@ -213,7 +227,6 @@ onUnmounted(() => {
 	window.clearInterval(state.setIntervalTime);
 	window.clearInterval(state.isShowLockScreenIntervalTime);
 });
-
 </script>
 
 <style scoped lang="scss">

+ 8 - 8
src/layout/navBars/breadcrumb/telControl.vue

@@ -837,11 +837,11 @@ const onHover = (val: string, path: string) => {
 const onControlClick = (val: string) => {
 	switch (val) {
 		case 'dutyOn': //签入
-			if (!auth('999101')) ElMessage.error('抱歉,您没有签入权限!');
+			if (!auth('public:seat:dutyOn')) ElMessage.error('抱歉,您没有签入权限!');
 			else onDutyFn();
 			break;
 		case 'dutyOff': //签出
-			if (!auth('999102')) ElMessage.error('抱歉,您没有签出权限!');
+			if (!auth('public:seat:dutyOff')) ElMessage.error('抱歉,您没有签出权限!');
 			else offDutyFn();
 			break;
 		case 'hangup': //挂断
@@ -849,27 +849,27 @@ const onControlClick = (val: string) => {
 			else onHangup();
 			break;
 		case 'rest': //小休
-			if (!auth('999103')) ElMessage.error('抱歉,您没有小休权限!');
+			if (!auth('public:seat:rest')) ElMessage.error('抱歉,您没有小休权限!');
 			else onRest();
 			break;
 		case 'restEnd': //结束小休
-			if (!auth('999104')) ElMessage.error('抱歉,您没有结束小休权限!');
+			if (!auth('public:seat:restEnd')) ElMessage.error('抱歉,您没有结束小休权限!');
 			else onRestEnd();
 			break;
 		case 'hold': //保持
-			if (!auth('999105')) ElMessage.error('抱歉,您没有保持权限!');
+			if (!auth('public:seat:hold')) ElMessage.error('抱歉,您没有保持权限!');
 			else onHold();
 			break;
 		case 'unHold': //取消保持
-			if (!auth('999106')) ElMessage.error('抱歉,您没有取消保持权限!');
+			if (!auth('public:seat:unHold')) ElMessage.error('抱歉,您没有取消保持权限!');
 			else onUnHold();
 			break;
 		case 'mute': //静音
-			if (!auth('999126')) ElMessage.error('抱歉,您没有静音权限!');
+			if (!auth('public:seat:mute')) ElMessage.error('抱歉,您没有静音权限!');
 			else onMute();
 			break;
 		case 'unMute': // 取消静音
-			if (!auth('999127')) ElMessage.error('抱歉,您没有取消静音权限!');
+			if (!auth('public:seat:unMute')) ElMessage.error('抱歉,您没有取消静音权限!');
 			else onunMute();
 			break;
 		case 'transfer': //转接

+ 11 - 2
src/views/business/order/components/orderDetail.vue

@@ -272,11 +272,20 @@
 					>
 					<!-- <el-button type="primary" @click="onSubmit('延期')" v-if="state.ruleForm.status != 60 && state.workflow.canHandle" :loading="state.loading">延 期</el-button> -->
 					<!-- 流程结束之后不展示补充按钮 -->
-					<el-button type="primary" @click="onSupply" :loading="state.loading" v-if="state.workflow.status == 0" v-auth="'system:workflow:supply'">补 充</el-button>
+					<el-button type="primary" @click="onSupply" :loading="state.loading" v-if="state.workflow.status == 0" v-auth="'system:workflow:supply'"
+						>补 充</el-button
+					>
 					<!-- <el-button type="primary" @click="onSubmit('督办')" :loading="state.loading" v-if="state.ruleForm.status == 0">督 办</el-button> -->
 					<!-- <el-button type="primary" @click="onSubmit('撤销')" :loading="state.loading" v-if="state.ruleForm.status == 0">撤 销</el-button> -->
 					<!-- 工单未归档都可以撤回 -->
-					<el-button type="primary" @click="onSubmit('撤回', 'recall')" :loading="state.loading" v-if="state.ruleForm.status == 0" v-auth="'system:workflow:handle'">撤 回</el-button>
+					<el-button
+						type="primary"
+						@click="onSubmit('撤回', 'recall')"
+						:loading="state.loading"
+						v-if="state.ruleForm.status == 0"
+						v-auth="'system:workflow:recall'"
+						>撤 回</el-button
+					>
 					<!-- 工单未归档和可以办理展示退回按钮 -->
 					<el-button
 						type="primary"

+ 2 - 2
src/views/business/order/index.vue

@@ -174,8 +174,8 @@
 			<!-- 功能按钮 -->
 			<div class="flex-center-between mb20 mt20">
 				<div>
-					<el-button type="primary" @click="onAddWorkOrder">
-						<SvgIcon name="ele-Plus" class="mr5" v-auth="'business:order:add'" />新建工单
+					<el-button type="primary" @click="onAddWorkOrder" v-auth="'business:order:add'">
+						<SvgIcon name="ele-Plus" class="mr5" />新建工单
 					</el-button>
 				</div>
 			</div>

+ 1 - 1
src/views/home/index.vue

@@ -103,7 +103,7 @@
 			<!-- 常用入口 -->
 			<el-col :xs="24" :sm="24" :md="24" :lg="8" :xl="8" class="right-content">
 				<div class="right-entrance box w100" v-loading="state.entranceLoading">
-					<p class="right-entrance-title" v-auth="'home:quickentry'">
+					<p class="right-entrance-title">
 						常用入口
 						<span @click="customEntry"> <SvgIcon name="ele-Setting" class="mr5" />自定义 </span>
 					</p>

+ 68 - 119
src/views/knowledge/config/type/index.vue

@@ -21,7 +21,7 @@
 						/>
 						{{ state.isExpand ? '收起' : '展开' }}</el-button
 					>
-					<el-button type="primary" @click="onOpenAdd"> <SvgIcon name="ele-Plus" class="mr5" v-auth="'knowledge:type:add'" /> 新增 </el-button>
+					<el-button type="primary" @click="onOpenAdd" v-auth="'knowledge:type:add'"> <SvgIcon name="ele-Plus" class="mr5" /> 新增 </el-button>
 				</div>
 			</div>
 			<!-- 表格 -->
@@ -108,124 +108,73 @@ const state = reactive({
 			fixed: 'right',
 			align: 'center',
 			cellRenderer: (data: any) => {
-				if (authAll(['knowledge:type:edit', 'knowledge:type:disable&undercarriage', 'knowledge:type:delete', 'knowledge:type:disable&enable'])) {
-					return h('p', {}, [
-						h(
-							ElButton,
-							{
-								onClick: () => onOpenEdit(data.rowData),
-								type: 'primary',
-								link: true,
-								title: '修改菜单',
-							},
-							{ default: () => '修改' }
-						),
-						data.rowData.isEnable
-							? h('span', {}, [
-									h(
-										ElButton,
-										{
-											onClick: () => onDisabled(data.rowData),
-											type: 'danger',
-											link: true,
-											title: '停用分类',
-										},
-										{ default: () => '停用' }
-									),
-									h(
-										ElButton,
-										{
-											onClick: () => undercarriage(data.rowData),
-											type: 'info',
-											link: true,
-											title: '停用并下架关联知识',
-											style: { marginLeft: 0 },
-										},
-										{ default: () => '停用并下架' }
-									),
-							  ])
-							: h(
-									ElButton,
-									{
-										onClick: () => onEnable(data.rowData),
-										type: 'success',
-										link: true,
-										title: '启用分类',
-									},
-									{ default: () => '启用' }
-							  ),
-						h(
-							ElButton,
-							{
-								onClick: () => onDelete(data.rowData),
-								type: 'danger',
-								link: true,
-								title: '删除分类',
-							},
-							{ default: () => '删除' }
-						),
-					]);
-				} else if (auth('knowledge:type:edit')) {
-					return h(
-						ElButton,
-						{
-							onClick: () => onOpenEdit(data.rowData),
-							type: 'primary',
-							link: true,
-							title: '修改菜单',
-						},
-						{ default: () => '修改' }
-					);
-				} else if (auth('knowledge:type:delete')) {
-					return h(
-						ElButton,
-						{
-							onClick: () => onDelete(data.rowData),
-							type: 'danger',
-							link: true,
-							title: '删除分类',
-						},
-						{ default: () => '删除' }
-					);
-				} else if (auth('knowledge:type:disable&undercarriage') && data.rowData.isEnable) {
-					return h(
-						ElButton,
-						{
-							onClick: () => undercarriage(data.rowData),
-							type: 'info',
-							link: true,
-							title: '停用并下架关联知识',
-							style: { marginLeft: 0 },
-						},
-						{ default: () => '停用并下架' }
-					);
-				} else if (auth('knowledge:type:disable&enable') && data.rowData.isEnable) {
-					return h('p', {}, [
-						data.rowData.isEnable
-							? h('span', {}, [
-									h(
-										ElButton,
-										{
-											onClick: () => onDisabled(data.rowData),
-											type: 'danger',
-											link: true,
-											title: '停用分类',
-										},
-										{ default: () => '停用' }
-									),
-							  ])
-							: h(
-									ElButton,
-									{
-										onClick: () => onEnable(data.rowData),
-										type: 'success',
-										link: true,
-										title: '启用分类',
-									},
-									{ default: () => '启用' }
-							  ),
-					]);
-				}
+				return h('p', {}, [
+					auth('knowledge:type:edit')
+						? h(
+								ElButton,
+								{
+									onClick: () => onOpenEdit(data.rowData),
+									type: 'primary',
+									link: true,
+									title: '修改菜单',
+								},
+								{ default: () => '修改' }
+						  )
+						: '',
+
+					data.rowData.isEnable
+						? h('span', {}, [
+								auth('knowledge:type:disable&enable')
+									? h(
+											ElButton,
+											{
+												onClick: () => onDisabled(data.rowData),
+												type: 'danger',
+												link: true,
+												title: '停用分类',
+											},
+											{ default: () => '停用' }
+									  )
+									: '',
+								auth('knowledge:type:disable&undercarriage')
+									? h(
+											ElButton,
+											{
+												onClick: () => undercarriage(data.rowData),
+												type: 'info',
+												link: true,
+												title: '停用并下架关联知识',
+												style: { marginLeft: 0 },
+											},
+											{ default: () => '停用并下架' }
+									  )
+									: '',
+						  ])
+						: auth('knowledge:type:disable&enable')
+						? h(
+								ElButton,
+								{
+									onClick: () => onEnable(data.rowData),
+									type: 'success',
+									link: true,
+									title: '启用分类',
+								},
+								{ default: () => '启用' }
+						  )
+						: '',
+					auth('knowledge:type:delete')
+						? h(
+								ElButton,
+								{
+									onClick: () => onDelete(data.rowData),
+									type: 'danger',
+									link: true,
+									title: '删除分类',
+								},
+								{ default: () => '删除' }
+						  )
+						: '',
+				]);
 			},
 		},
 	],

+ 2 - 2
src/views/system/config/timeLimit/index.vue

@@ -4,8 +4,8 @@
 			<div class="flex-center-between mb20">
 				<p class="table-title">信息列表</p>
 				<div>
-					<el-button type="primary" @click="addTimeLimit" v-waves>
-						<SvgIcon name="ele-Plus" class="mr5" v-auth="'system:timeLimit:add'" />新增
+					<el-button type="primary" @click="addTimeLimit" v-waves v-auth="'system:timeLimit:add'">
+						<SvgIcon name="ele-Plus" class="mr5" />新增
 					</el-button>
 				</div>
 			</div>

+ 2 - 2
src/views/system/dataAuth/index.vue

@@ -6,8 +6,8 @@
 				<div class="flex-center-between mb20">
 					<p class="table-title">信息列表</p>
 					<div>
-						<el-button type="primary" @click="onAddAuth" v-waves>
-							<SvgIcon name="ele-Plus" class="mr5" v-auth="'system:role:dataAuth:add'" />新增
+						<el-button type="primary" @click="onAddAuth" v-waves v-auth="'system:role:dataAuth:add'">
+							<SvgIcon name="ele-Plus" class="mr5" />新增
 						</el-button>
 					</div>
 				</div>

+ 28 - 48
src/views/system/menu/index.vue

@@ -55,7 +55,7 @@ import { RouteRecordRaw } from 'vue-router';
 import { ElMessageBox, ElMessage, ElButton, ElTag } from 'element-plus';
 import type { FormInstance } from 'element-plus';
 import { getMenuList, removeMenu } from '/@/api/system/menu';
-import { auth, authAll } from '/@/utils/authFunction';
+import { auth } from '/@/utils/authFunction';
 import SvgIcon from '/@/views/system/menu/component/SvgIcon.vue';
 import { throttle } from '/@/utils/tools';
 // 引入组件
@@ -195,53 +195,33 @@ const state = reactive({
 			fixed: 'right',
 			align: 'center',
 			cellRenderer: (data: any) => {
-				if (authAll(['system:menu:edit', 'system:menu:delete'])) {
-					// 权限判断
-					return h('span', { class: 'flex' }, [
-						h(
-							ElButton,
-							{
-								onClick: () => onOpenEditMenu(data.rowData),
-								type: 'primary',
-								link: true,
-								title: '修改菜单',
-							},
-							{ default: () => '修改' }
-						),
-						h(
-							ElButton,
-							{
-								onClick: () => onTabelRowDel(data.rowData),
-								type: 'danger',
-								link: true,
-								title: '删除菜单',
-							},
-							{ default: () => '删除' }
-						),
-					]);
-				} else if (auth('system:menu:edit')) {
-					return h(
-						ElButton,
-						{
-							onClick: () => onOpenEditMenu(data.rowData),
-							type: 'primary',
-							link: true,
-							title: '修改菜单',
-						},
-						{ default: () => '修改' }
-					);
-				} else if (auth('system:menu:delete')) {
-					return h(
-						ElButton,
-						{
-							onClick: () => onTabelRowDel(data.rowData),
-							type: 'danger',
-							link: true,
-							title: '删除菜单',
-						},
-						{ default: () => '删除' }
-					);
-				}
+				// 权限判断
+				return h('span', { class: 'flex' }, [
+					auth('system:menu:edit')
+						? h(
+								ElButton,
+								{
+									onClick: () => onOpenEditMenu(data.rowData),
+									type: 'primary',
+									link: true,
+									title: '修改菜单',
+								},
+								{ default: () => '修改' }
+						)
+						: '',
+					auth('system:menu:delete')
+						? h(
+								ElButton,
+								{
+									onClick: () => onTabelRowDel(data.rowData),
+									type: 'danger',
+									link: true,
+									title: '删除菜单',
+								},
+								{ default: () => '删除' }
+						)
+						: '',
+				]);
 			},
 		},
 	],

+ 27 - 47
src/views/system/organize/index.vue

@@ -53,7 +53,7 @@ import { ElButton, ElTag, ElMessage } from 'element-plus';
 import type { FormInstance } from 'element-plus';
 import { getOrgList, baseData } from '/@/api/system/organize';
 import { formatDate } from '/@/utils/formatTime';
-import { auth, authAll } from '/@/utils/authFunction';
+import { auth } from '/@/utils/authFunction';
 import { throttle } from '/@/utils/tools';
 // 引入组件
 const AddOrg = defineAsyncComponent(() => import('/@/views/system/organize/component/addOrg.vue'));
@@ -124,52 +124,32 @@ const state = reactive({
 			fixed: 'right',
 			align: 'center',
 			cellRenderer: ({ rowData }: any) => {
-				if (authAll(['system:organize:edit', 'system:organize:add'])) {
-					return h('span', {}, [
-						h(
-							ElButton,
-							{
-								onClick: () => onOpenEditOrg(rowData),
-								type: 'primary',
-								title: '修改',
-								link: true,
-							},
-							{ default: () => '修改' }
-						),
-						h(
-							ElButton,
-							{
-								onClick: () => onOpenAddOrg(rowData),
-								type: 'primary',
-								title: '新增',
-								link: true,
-							},
-							{ default: () => '新增' }
-						),
-					]);
-				} else if (auth('system:organize:edit')) {
-					return h(
-						ElButton,
-						{
-							onClick: () => onOpenEditOrg(rowData),
-							type: 'primary',
-							title: '修改',
-							link: true,
-						},
-						{ default: () => '修改' }
-					);
-				} else if (auth('system:organize:add')) {
-					return h(
-						ElButton,
-						{
-							onClick: () => onOpenAddOrg(rowData),
-							type: 'primary',
-							title: '新增',
-							link: true,
-						},
-						{ default: () => '新增' }
-					);
-				}
+				return h('span', { class: 'flex' }, [
+					auth('system:organize:edit')
+						? h(
+								ElButton,
+								{
+									onClick: () => onOpenEditOrg(rowData),
+									type: 'primary',
+									title: '修改',
+									link: true,
+								},
+								{ default: () => '修改' }
+						)
+						: '',
+					auth('system:organize:add')
+						? h(
+								ElButton,
+								{
+									onClick: () => onOpenAddOrg(rowData),
+									type: 'primary',
+									title: '新增',
+									link: true,
+								},
+								{ default: () => '新增' }
+						)
+						: '',
+				]);
 			},
 		},
 	],

+ 20 - 4
src/views/system/roles/component/permission.vue

@@ -42,7 +42,11 @@
 					:expand-on-click-node="false"
 					:check-strictly="!state.menuCheckStrictly"
 					:props="{ label: 'pageName', children: 'children', class: customNodeClass }"
-				></el-tree>
+				>
+					<template #default="{ data }">
+						<span>{{ data.pageName }}</span>
+					</template>
+				</el-tree>
 			</div>
 			<template #footer>
 				<span class="dialog-footer">
@@ -67,6 +71,7 @@ interface Tree {
 	id: number;
 	label: string;
 	isPenultimate?: boolean;
+	expanded: boolean;
 	menuType?: number;
 	children?: Tree[];
 }
@@ -116,7 +121,8 @@ const opened = () => {
 	else {
 		getRolePower({ roleid: state.currentRow.id })
 			.then((res: any) => {
-				const arr: string[] = res.result?.systemMenuArr.map((v: any) => v.code);
+				let arr: string[] = res.result?.systemMenuArr ?? [];
+				arr = arr.map((v: any) => v.code);
 				menuRef.value.setCheckedKeys(arr);
 				const arr1 = treeFlat(state.menuTableData);
 				if (arr.length === arr1.length) state.menuNodeAll = true;
@@ -158,8 +164,18 @@ const handleCheckedTreeExpand = (value: boolean) => {
 	for (let i = 0; i < state.menuTableData.length; i++) {
 		menuRef.value.store.nodesMap[state.menuTableData[i].permissionCode].expanded = value;
 	}
-	
+	// expandNodes(menuRef.value.root, value);
 };
+// 遍历树形数据,设置每一项的expanded属性,实现展开收起
+// const expandNodes = (node: any, value: boolean) => {
+// 	node.expanded = value;
+// 	for (let i = 0; i < node.childNodes.length; i++) {
+// 		node.childNodes[i].expanded = value;
+// 		if (node.childNodes[i].childNodes.length > 0) {
+// 			expandNodes(node.childNodes[i], value);
+// 		}
+// 	}
+// };
 /** 树权限(全选/全不选) */
 const handleCheckedTreeNodeAll = (value: boolean) => {
 	menuRef.value.setCheckedKeys(value ? getCode(state.menuTableData) : []);
@@ -171,7 +187,7 @@ const handleCheckedTreeNodeAll = (value: boolean) => {
 // 保存
 const onSubmit = () => {
 	let systemMenuArr = <any>[];
-	systemMenuArr = systemMenuArr.concat(menuRef.value.getCheckedNodes(), menuRef.value.getHalfCheckedNodes());
+	systemMenuArr = menuRef.value.getCheckedNodes();
 	systemMenuArr = systemMenuArr.map((v: any) => {
 		return {
 			code: v.permissionCode,

+ 1 - 1
src/views/tels/blacklist/index.vue

@@ -39,7 +39,7 @@
 					<el-button type="primary" @click="onAddBacklist" v-waves v-auth="'tels:blackList:add'">
 						<SvgIcon name="ele-Plus" class="mr5" />新增
 					</el-button>
-					<el-button type="primary" @click="onRemove" v-waves v-auth="'200202'" :disabled="!state.multipleSelection.length">
+					<el-button type="primary" @click="onRemove" v-waves v-auth="'tels:blackList:delete'" :disabled="!state.multipleSelection.length">
 						<SvgIcon name="ele-Delete" class="mr5" />解除
 					</el-button>
 				</div>

+ 53 - 48
src/views/tels/callRecord/index.vue

@@ -4,7 +4,7 @@
 			<el-tabs v-model="state.activeName" @tab-change="handleClick">
 				<el-tab-pane label="呼入列表" name="incoming"></el-tab-pane>
 				<el-tab-pane label="呼出列表" name="exhale"></el-tab-pane>
-				<el-tab-pane label="未接列表" name="missed" v-auth="'200101'"></el-tab-pane>
+				<el-tab-pane label="未接列表" name="missed" v-auth="'tels:callRecord:missed'"></el-tab-pane>
 				<el-form :model="state.queryParams" ref="ruleFormRef" :inline="true" @submit.native.prevent class="mt15">
 					<el-form-item label="呼叫方向" prop="Direction" v-if="state.activeName === 'missed'">
 						<el-select v-model="state.queryParams.Direction" placeholder="请选择呼叫方向" class="w100">
@@ -17,16 +17,16 @@
 						</el-select>
 					</el-form-item>
 					<el-form-item label="被叫号码" prop="PhoneNum">
-						<el-input v-model="state.queryParams.PhoneNum" placeholder="请输入被叫号码" clearable @keyup.enter="getList" />
+						<el-input v-model="state.queryParams.PhoneNum" placeholder="请输入被叫号码" clearable @keyup.enter="queryList" />
 					</el-form-item>
 					<el-form-item label="主叫号码" prop="ToNum">
-						<el-input v-model="state.queryParams.ToNum" placeholder="请输入主叫号码" clearable @keyup.enter="getList" />
+						<el-input v-model="state.queryParams.ToNum" placeholder="请输入主叫号码" clearable @keyup.enter="queryList" />
 					</el-form-item>
 					<el-form-item label="坐席" prop="UserName">
-						<el-input v-model="state.queryParams.UserName" placeholder="请输入坐席姓名或工号" clearable @keyup.enter="getList" />
+						<el-input v-model="state.queryParams.UserName" placeholder="请输入坐席姓名或工号" clearable @keyup.enter="queryList" />
 					</el-form-item>
 					<el-form-item>
-						<el-button type="primary" @click="getList" :loading="state.loading" v-waves> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
+						<el-button type="primary" @click="queryList" :loading="state.loading" v-waves> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
 						<el-button @click="resetQuery(ruleFormRef)" v-waves class="default-button"> <SvgIcon name="ele-Refresh" class="mr5" />重置 </el-button>
 					</el-form-item>
 				</el-form>
@@ -125,7 +125,7 @@
 				</template>
 			</el-table>
 			<!-- 分页 -->
-			<pagination :total="state.total" v-model:page="state.queryParams.PageIndex" v-model:limit="state.queryParams.PageSize" @pagination="getList" />
+			<pagination :total="state.total" v-model:page="state.queryParams.PageIndex" v-model:limit="state.queryParams.PageSize" @pagination="queryList" />
 		</el-card>
 		<PlayRecording ref="playRecordingRef" />
 	</div>
@@ -134,6 +134,8 @@
 <script lang="ts" setup name="callRecord">
 import { ref, reactive, onMounted, defineAsyncComponent } from 'vue';
 import type { FormInstance } from 'element-plus';
+import { ElMessage } from 'element-plus';
+import { auth } from '/@/utils/authFunction';
 // 引入节流
 import { throttle } from '/@/utils/tools';
 import { callPaged, callPagedMissed } from '/@/api/tels/callRecord';
@@ -206,57 +208,60 @@ const state = reactive(<QueryState>{
 });
 const ruleFormRef = ref<FormInstance>();
 const playRecordingRef = ref();
-/** 获取用户列表 */
-const getList = throttle(() => {
-	state.loading = true;
-	switch (state.activeName) {
-		case 'incoming':
-			callPaged(state.queryParams)
-				.then((response: any) => {
-					state.tableList = response?.result.items ?? [];
-					state.total = response?.result.total;
-					state.loading = false;
-				})
-				.catch(() => {
-					state.loading = false;
-				});
-			break;
-		case 'exhale':
-			callPaged(state.queryParams)
-				.then((response: any) => {
-					state.tableList = response?.result.items ?? [];
-					state.total = response?.result.total;
-					state.loading = false;
-				})
-				.catch(() => {
-					state.loading = false;
-				});
-			break;
-		case 'missed':
-			callPagedMissed(state.queryParams)
-				.then((response: any) => {
-					state.tableList = response?.result.items ?? [];
-					state.total = response?.result.total;
-					state.loading = false;
-				})
-				.catch(() => {
-					state.loading = false;
-				});
-			break;
+/** 通话记录列表 */
+const queryList = throttle(() => {
+	if (!auth('tels:blackList:query')) ElMessage.error('抱歉,您没有权限查询通话记录!');
+	else {
+		state.loading = true;
+		switch (state.activeName) {
+			case 'incoming':
+				callPaged(state.queryParams)
+					.then((response: any) => {
+						state.tableList = response?.result.items ?? [];
+						state.total = response?.result.total;
+						state.loading = false;
+					})
+					.catch(() => {
+						state.loading = false;
+					});
+				break;
+			case 'exhale':
+				callPaged(state.queryParams)
+					.then((response: any) => {
+						state.tableList = response?.result.items ?? [];
+						state.total = response?.result.total;
+						state.loading = false;
+					})
+					.catch(() => {
+						state.loading = false;
+					});
+				break;
+			case 'missed':
+				callPagedMissed(state.queryParams)
+					.then((response: any) => {
+						state.tableList = response?.result.items ?? [];
+						state.total = response?.result.total;
+						state.loading = false;
+					})
+					.catch(() => {
+						state.loading = false;
+					});
+				break;
 
-		default:
-			break;
+			default:
+				break;
+		}
 	}
 }, 500);
 /** 重置按钮操作 */
 const resetQuery = throttle((formEl: FormInstance | undefined) => {
 	if (!formEl) return;
 	formEl.resetFields();
-	getList();
+	queryList();
 }, 500);
 // 切换tab 查询列表
 const handleClick = () => {
-	getList();
+	queryList();
 };
 // 播放录音
 const onPalySoundRecording = (val: any) => {
@@ -267,7 +272,7 @@ const onDownload = (val: any) => {};
 // 关联工单
 const onRelationWorkOrder = (val: any) => {};
 onMounted(() => {
-	getList();
+	queryList();
 });
 </script>
 <style lang="scss" scoped></style>

+ 4 - 4
src/views/tels/telsLog/index.vue

@@ -42,7 +42,7 @@
 				</template>
 			</el-table>
 			<!-- 分页 -->
-			<pagination :total="state.total" v-model:page="state.queryParams.PageIndex" v-model:limit="state.queryParams.PageSize" @pagination="getList" />
+			<pagination :total="state.total" v-model:page="state.queryParams.PageIndex" v-model:limit="state.queryParams.PageSize" @pagination="queryList" />
 		</el-card>
 
 		<OperationRecord ref="operationRecordRef" />
@@ -87,10 +87,10 @@ const operationRecordRef = ref();
 /** 搜索按钮操作 节流操作 */
 const handleQuery = throttle(() => {
 	state.queryParams.PageIndex = 1;
-	getList();
+	queryList();
 }, 500);
 /** 获取用户列表 */
-const getList = () => {
+const queryList = () => {
 	state.loading = true;
 	blacklistPaged(state.queryParams)
 		.then((response: any) => {
@@ -113,6 +113,6 @@ const onDetail = (row: any) => {
 	operationRecordRef.value.openDialog(row);
 };
 onMounted(() => {
-	getList();
+	queryList();
 });
 </script>