From 8fbc321a5e243db46561f9948d9f5e07e0d9a29e Mon Sep 17 00:00:00 2001 From: sexygoat <1538832180@qq.com> Date: Fri, 6 Mar 2026 17:51:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=A6=E6=83=85=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../asset-management/asset-assign/index.vue | 32 +++++++++++---- .../authorization-records/index.vue | 31 ++++++++++---- .../asset-management/device-task/index.vue | 31 ++++++++++---- .../asset-management/iot-card-task/index.vue | 31 ++++++++++---- .../commission/agent-commission/index.vue | 34 +++++++++++---- .../order-management/order-list/index.vue | 31 ++++++++++---- .../package-management/package-list/index.vue | 34 ++++++++++----- .../package-series/index.vue | 41 +++++++++++-------- .../series-grants/index.vue | 31 ++++++++++---- 9 files changed, 211 insertions(+), 85 deletions(-) diff --git a/src/views/asset-management/asset-assign/index.vue b/src/views/asset-management/asset-assign/index.vue index 548640a..202d881 100644 --- a/src/views/asset-management/asset-assign/index.vue +++ b/src/views/asset-management/asset-assign/index.vue @@ -185,7 +185,20 @@ { prop: 'allocation_no', label: '分配单号', - minWidth: 200 + minWidth: 200, + formatter: (row: AssetAllocationRecord) => { + return h( + 'span', + { + style: 'color: var(--el-color-primary); cursor: pointer; text-decoration: underline;', + onClick: (e: MouseEvent) => { + e.stopPropagation() + handleNameClick(row) + } + }, + row.allocation_no + ) + } }, { prop: 'allocation_name', @@ -323,14 +336,19 @@ }) } + // 处理名称点击 + const handleNameClick = (row: AssetAllocationRecord) => { + if (hasAuth('asset_assign:view_detail')) { + viewDetail(row) + } else { + ElMessage.warning('您没有查看详情的权限') + } + } + // 右键菜单项配置 const contextMenuItems = computed((): MenuItemType[] => { const items: MenuItemType[] = [] - if (hasAuth('asset_assign:view_detail')) { - items.push({ key: 'detail', label: '详情' }) - } - return items }) @@ -347,9 +365,7 @@ if (!currentRow.value) return switch (item.key) { - case 'detail': - viewDetail(currentRow.value) - break + // No cases available } } diff --git a/src/views/asset-management/authorization-records/index.vue b/src/views/asset-management/authorization-records/index.vue index fda893f..39af8dd 100644 --- a/src/views/asset-management/authorization-records/index.vue +++ b/src/views/asset-management/authorization-records/index.vue @@ -225,7 +225,20 @@ { prop: 'iccid', label: 'ICCID', - minWidth: 200 + minWidth: 200, + formatter: (row: AuthorizationItem) => { + return h( + 'span', + { + style: 'color: var(--el-color-primary); cursor: pointer; text-decoration: underline;', + onClick: (e: MouseEvent) => { + e.stopPropagation() + handleNameClick(row) + } + }, + row.iccid + ) + } }, { prop: 'msisdn', @@ -354,6 +367,15 @@ }) } + // 处理名称点击 + const handleNameClick = (row: AuthorizationItem) => { + if (hasAuth('authorization_records:view_detail')) { + viewDetail(row) + } else { + ElMessage.warning('您没有查看详情的权限') + } + } + // 显示修改备注对话框 const showRemarkDialog = (row: AuthorizationItem) => { currentRecordId.value = row.id @@ -389,10 +411,6 @@ const contextMenuItems = computed((): MenuItemType[] => { const items: MenuItemType[] = [] - if (hasAuth('authorization_records:view_detail')) { - items.push({ key: 'detail', label: '详情' }) - } - if (hasAuth('authorization_records:update_remark')) { items.push({ key: 'edit', label: '编辑' }) } @@ -413,9 +431,6 @@ if (!currentRow.value) return switch (item.key) { - case 'detail': - viewDetail(currentRow.value) - break case 'edit': showRemarkDialog(currentRow.value) break diff --git a/src/views/asset-management/device-task/index.vue b/src/views/asset-management/device-task/index.vue index 3d97e3e..13e2a2f 100644 --- a/src/views/asset-management/device-task/index.vue +++ b/src/views/asset-management/device-task/index.vue @@ -247,13 +247,35 @@ }) } + // 处理名称点击 + const handleNameClick = (row: DeviceImportTask) => { + if (hasAuth('device_task:view_detail')) { + viewDetail(row) + } else { + ElMessage.warning('您没有查看详情的权限') + } + } + // 动态列配置 const { columnChecks, columns } = useCheckedColumns(() => [ { prop: 'task_no', label: '任务编号', width: 180, - showOverflowTooltip: true + showOverflowTooltip: true, + formatter: (row: DeviceImportTask) => { + return h( + 'span', + { + style: 'color: var(--el-color-primary); cursor: pointer; text-decoration: underline;', + onClick: (e: MouseEvent) => { + e.stopPropagation() + handleNameClick(row) + } + }, + row.task_no + ) + } }, { prop: 'status', @@ -612,10 +634,6 @@ const items: MenuItemType[] = [] - if (hasAuth('device_task:view_detail')) { - items.push({ key: 'detail', label: '详情' }) - } - if (currentRow.value.fail_count > 0 && hasAuth('device_task:download_fail_data')) { items.push({ key: 'failData', label: '失败数据' }) } @@ -636,9 +654,6 @@ if (!currentRow.value) return switch (item.key) { - case 'detail': - viewDetail(currentRow.value) - break case 'failData': downloadFailDataByRow(currentRow.value) break diff --git a/src/views/asset-management/iot-card-task/index.vue b/src/views/asset-management/iot-card-task/index.vue index 60d9147..46582f3 100644 --- a/src/views/asset-management/iot-card-task/index.vue +++ b/src/views/asset-management/iot-card-task/index.vue @@ -282,12 +282,34 @@ }) } + // 处理名称点击 + const handleNameClick = (row: IotCardImportTask) => { + if (hasAuth('iot_card_task:view_detail')) { + viewDetail(row) + } else { + ElMessage.warning('您没有查看详情的权限') + } + } + // 动态列配置 const { columnChecks, columns } = useCheckedColumns(() => [ { prop: 'task_no', label: '任务编号', - width: 180 + width: 180, + formatter: (row: IotCardImportTask) => { + return h( + 'span', + { + style: 'color: var(--el-color-primary); cursor: pointer; text-decoration: underline;', + onClick: (e: MouseEvent) => { + e.stopPropagation() + handleNameClick(row) + } + }, + row.task_no + ) + } }, { prop: 'status', @@ -666,10 +688,6 @@ const items: MenuItemType[] = [] - if (hasAuth('iot_card_task:view_detail')) { - items.push({ key: 'detail', label: '详情' }) - } - if (currentRow.value.fail_count > 0 && hasAuth('iot_card_task:download_fail_data')) { items.push({ key: 'failData', label: '失败数据' }) } @@ -690,9 +708,6 @@ if (!currentRow.value) return switch (item.key) { - case 'detail': - viewDetail(currentRow.value) - break case 'failData': downloadFailDataByRow(currentRow.value) break diff --git a/src/views/finance/commission/agent-commission/index.vue b/src/views/finance/commission/agent-commission/index.vue index 1699f40..a09bead 100644 --- a/src/views/finance/commission/agent-commission/index.vue +++ b/src/views/finance/commission/agent-commission/index.vue @@ -318,6 +318,15 @@ { label: '未提现', prop: 'unwithdraw_commission' } ] + // 处理名称点击 + const handleNameClick = (row: ShopCommissionSummaryItem) => { + if (hasAuth('agent_commission:detail')) { + showDetail(row) + } else { + ElMessage.warning('您没有查看详情的权限') + } + } + // 动态列配置 const { columnChecks, columns } = useCheckedColumns(() => [ { @@ -329,7 +338,20 @@ prop: 'shop_name', label: '店铺名称', minWidth: 180, - showOverflowTooltip: true + showOverflowTooltip: true, + formatter: (row: ShopCommissionSummaryItem) => { + return h( + 'span', + { + style: 'color: var(--el-color-primary); cursor: pointer; text-decoration: underline;', + onClick: (e: MouseEvent) => { + e.stopPropagation() + handleNameClick(row) + } + }, + row.shop_name + ) + } }, { prop: 'username', @@ -566,9 +588,7 @@ const contextMenuItems = computed((): MenuItemType[] => { const items: MenuItemType[] = [] - if (hasAuth('agent_commission:detail')) { - items.push({ key: 'detail', label: '详情' }) - } + // 移除详情选项,通过点击店铺名称查看详情 return items }) @@ -585,11 +605,7 @@ const handleContextMenuSelect = (item: MenuItemType) => { if (!currentRow.value) return - switch (item.key) { - case 'detail': - showDetail(currentRow.value) - break - } + // 暂无其他菜单项 } diff --git a/src/views/order-management/order-list/index.vue b/src/views/order-management/order-list/index.vue index 8e4df9f..6e88dc9 100644 --- a/src/views/order-management/order-list/index.vue +++ b/src/views/order-management/order-list/index.vue @@ -655,7 +655,20 @@ { prop: 'order_no', label: t('orderManagement.table.orderNo'), - minWidth: 220 + minWidth: 220, + formatter: (row: Order) => { + return h( + 'span', + { + style: 'color: var(--el-color-primary); cursor: pointer; text-decoration: underline;', + onClick: (e: MouseEvent) => { + e.stopPropagation() + handleNameClick(row) + } + }, + row.order_no + ) + } }, { prop: 'order_type', @@ -1008,6 +1021,15 @@ }) } + // 处理名称点击 + const handleNameClick = (row: Order) => { + if (hasAuth('orders:view_detail')) { + showOrderDetail(row) + } else { + ElMessage.warning('您没有查看详情的权限') + } + } + // 取消订单 const handleCancelOrder = (row: Order) => { // 已支付的订单不能取消 @@ -1045,10 +1067,6 @@ const items: MenuItemType[] = [] - if (hasAuth('orders:view_detail')) { - items.push({ key: 'detail', label: '详情' }) - } - // 只有待支付和已支付的订单可以删除 if ( (currentRow.value.payment_status === 1 || currentRow.value.payment_status === 2) && @@ -1073,9 +1091,6 @@ if (!currentRow.value) return switch (item.key) { - case 'detail': - showOrderDetail(currentRow.value) - break case 'cancel': handleCancelOrder(currentRow.value) break diff --git a/src/views/package-management/package-list/index.vue b/src/views/package-management/package-list/index.vue index 68ef589..d1af518 100644 --- a/src/views/package-management/package-list/index.vue +++ b/src/views/package-management/package-list/index.vue @@ -459,7 +459,20 @@ prop: 'package_name', label: '套餐名称', minWidth: 160, - showOverflowTooltip: true + showOverflowTooltip: true, + formatter: (row: PackageResponse) => { + return h( + 'span', + { + style: 'color: var(--el-color-primary); cursor: pointer; text-decoration: underline;', + onClick: (e: MouseEvent) => { + e.stopPropagation() + handleNameClick(row) + } + }, + row.package_name + ) + } }, { prop: 'series_name', @@ -555,13 +568,6 @@ const contextMenuItems = computed((): MenuItemType[] => { const items: MenuItemType[] = [] - if (hasAuth('package:detail')) { - items.push({ - key: 'detail', - label: '详情' - }) - } - if (hasAuth('package:edit')) { items.push({ key: 'edit', @@ -913,6 +919,15 @@ router.push(`${RoutesAlias.PackageDetail}/${row.id}`) } + // 处理名称点击 + const handleNameClick = (row: PackageResponse) => { + if (hasAuth('package:detail')) { + handleViewDetail(row) + } else { + ElMessage.warning('您没有查看详情的权限') + } + } + // 处理表格行右键菜单 const handleRowContextMenu = (row: PackageResponse, column: any, event: MouseEvent) => { event.preventDefault() @@ -926,9 +941,6 @@ if (!currentRow.value) return switch (item.key) { - case 'detail': - handleViewDetail(currentRow.value) - break case 'edit': showDialog('edit', currentRow.value) break diff --git a/src/views/package-management/package-series/index.vue b/src/views/package-management/package-series/index.vue index f220d13..4a8cdda 100644 --- a/src/views/package-management/package-series/index.vue +++ b/src/views/package-management/package-series/index.vue @@ -545,7 +545,20 @@ { prop: 'series_name', label: '系列名称', - minWidth: 150 + minWidth: 150, + formatter: (row: PackageSeriesResponse) => { + return h( + 'span', + { + style: 'color: var(--el-color-primary); cursor: pointer; text-decoration: underline;', + onClick: (e: MouseEvent) => { + e.stopPropagation() + handleNameClick(row) + } + }, + row.series_name + ) + } }, { @@ -723,14 +736,6 @@ const seriesOperationMenuItems = computed((): MenuItemType[] => { const items: MenuItemType[] = [] - // 详情 - if (hasAuth('package_series:detail')) { - items.push({ - key: 'detail', - label: '详情' - }) - } - // 编辑 if (hasAuth('package_series:edit')) { items.push({ @@ -761,11 +766,7 @@ // 处理表格行右键菜单 const handleRowContextMenu = (row: PackageSeriesResponse, column: any, event: MouseEvent) => { // 如果用户有编辑或删除权限,显示右键菜单 - if ( - hasAuth('package_series:edit') || - hasAuth('package_series:delete') || - hasAuth('package_series:detail') - ) { + if (hasAuth('package_series:edit') || hasAuth('package_series:delete')) { showSeriesOperationMenu(event, row) } } @@ -775,9 +776,6 @@ if (!currentOperatingSeries.value) return switch (item.key) { - case 'detail': - handleViewDetail(currentOperatingSeries.value) - break case 'edit': showDialog('edit', currentOperatingSeries.value) break @@ -1105,6 +1103,15 @@ const handleViewDetail = (row: PackageSeriesResponse) => { router.push(`/package-management/package-series/detail/${row.id}`) } + + // 处理名称点击 + const handleNameClick = (row: PackageSeriesResponse) => { + if (hasAuth('package_series:detail')) { + handleViewDetail(row) + } else { + ElMessage.warning('您没有查看详情的权限') + } + }