详情修改
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m48s

This commit is contained in:
sexygoat
2026-03-06 17:51:27 +08:00
parent 1ebc0b8929
commit 8fbc321a5e
9 changed files with 211 additions and 85 deletions

View File

@@ -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
}
}
</script>

View File

@@ -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

View File

@@ -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

View File

@@ -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