This commit is contained in:
@@ -337,11 +337,14 @@
|
||||
} from '@/config/constants'
|
||||
import { AUDIT_PERMISSIONS } from '@/config/constants/audit'
|
||||
import { resolveAuditResourceTarget } from '@/utils/business/auditNavigation'
|
||||
import { isPlatformAuditAccount } from '@/utils/business/auditAccess'
|
||||
import { openAuditInvestigation } from '@/components/business/audit/investigationController'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
|
||||
defineOptions({ name: 'Account' }) // 定义组件名称,用于 KeepAlive 缓存控制
|
||||
|
||||
const { hasAuth } = useAuth()
|
||||
const userStore = useUserStore()
|
||||
const canModifyAccountStatus = hasAuth('account:modify_status')
|
||||
const route = useRoute()
|
||||
|
||||
@@ -673,8 +676,12 @@
|
||||
const getActions = (row: any) => {
|
||||
const actions: any[] = []
|
||||
|
||||
if (hasAuth(AUDIT_PERMISSIONS.resourceTimeline)) {
|
||||
if (
|
||||
isPlatformAuditAccount(userStore.info.user_type, userStore.isSuperAdmin) &&
|
||||
hasAuth(AUDIT_PERMISSIONS.resourceTimeline)
|
||||
) {
|
||||
const auditTarget = resolveAuditResourceTarget({
|
||||
userType: userStore.info.user_type,
|
||||
resourceType: 'account',
|
||||
internalId: row.id
|
||||
})
|
||||
|
||||
@@ -505,16 +505,19 @@
|
||||
const getActions = (row: EnterpriseItem) => {
|
||||
const actions: any[] = []
|
||||
|
||||
if (hasAuth(AUDIT_PERMISSIONS.enterpriseEntry)) {
|
||||
const userType = Number(userStore.getUserInfo.user_type)
|
||||
const auditPermission =
|
||||
userType === 3 ? AUDIT_PERMISSIONS.agentActivity : AUDIT_PERMISSIONS.enterpriseEntry
|
||||
if (hasAuth(auditPermission)) {
|
||||
const auditTarget = resolveAuditResourceTarget({
|
||||
userType: userStore.getUserInfo.user_type,
|
||||
userType,
|
||||
resourceType: 'enterprise',
|
||||
internalId: row.id,
|
||||
businessIdentifier: row.enterprise_code
|
||||
})
|
||||
if (auditTarget)
|
||||
actions.push({
|
||||
label: '审计记录',
|
||||
label: userType === 3 ? '活动记录' : '审计记录',
|
||||
handler: () => openAuditInvestigation(auditTarget),
|
||||
type: 'primary'
|
||||
})
|
||||
|
||||
@@ -314,7 +314,7 @@
|
||||
{{ scope.row.gateway_extend || '-' }}
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="操作" width="280" fixed="right">
|
||||
<ElTableColumn label="操作" width="260" fixed="right">
|
||||
<template #default="scope">
|
||||
<!-- 根据网络状态显示启用或停用按钮 -->
|
||||
<ElButton
|
||||
@@ -357,15 +357,6 @@
|
||||
>
|
||||
卡审计
|
||||
</ElButton>
|
||||
<ElButton
|
||||
v-if="getBindingAuditTarget(scope.row)"
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
@click="openBindingAudit(scope.row)"
|
||||
>
|
||||
绑定审计
|
||||
</ElButton>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
</ElTable>
|
||||
@@ -616,7 +607,6 @@
|
||||
|
||||
// Props
|
||||
interface BindingCard {
|
||||
id: number
|
||||
card_id?: number
|
||||
iccid: string
|
||||
msisdn?: string
|
||||
@@ -747,14 +737,17 @@
|
||||
const isSubjectActivityView = computed(() => [3, 4].includes(Number(userStore.info.user_type)))
|
||||
const auditTarget = computed(() => {
|
||||
const userType = Number(userStore.info.user_type)
|
||||
const isCard = props.cardInfo.asset_type === 'card'
|
||||
const permission =
|
||||
userType === 3
|
||||
? AUDIT_PERMISSIONS.agentActivity
|
||||
? isCard
|
||||
? AUDIT_PERMISSIONS.agentAssetInfoCardActivity
|
||||
: AUDIT_PERMISSIONS.agentAssetInfoDeviceActivity
|
||||
: userType === 4
|
||||
? AUDIT_PERMISSIONS.enterpriseActivity
|
||||
: props.cardInfo.asset_type === 'card'
|
||||
? AUDIT_PERMISSIONS.cardEntry
|
||||
: AUDIT_PERMISSIONS.deviceEntry
|
||||
? isCard
|
||||
? AUDIT_PERMISSIONS.enterpriseAssetInfoCardActivity
|
||||
: AUDIT_PERMISSIONS.enterpriseAssetInfoDeviceActivity
|
||||
: AUDIT_PERMISSIONS.assetInfoEntry
|
||||
if (!hasAuth(permission)) return null
|
||||
return resolveAuditResourceTarget({
|
||||
userType,
|
||||
@@ -771,10 +764,10 @@
|
||||
const userType = Number(userStore.info.user_type)
|
||||
const permission =
|
||||
userType === 3
|
||||
? AUDIT_PERMISSIONS.agentActivity
|
||||
? AUDIT_PERMISSIONS.agentAssetInfoBindingCardActivity
|
||||
: userType === 4
|
||||
? AUDIT_PERMISSIONS.enterpriseActivity
|
||||
: AUDIT_PERMISSIONS.cardEntry
|
||||
? AUDIT_PERMISSIONS.enterpriseAssetInfoBindingCardActivity
|
||||
: AUDIT_PERMISSIONS.assetInfoBindingCardEntry
|
||||
if (!hasAuth(permission)) return null
|
||||
return resolveAuditResourceTarget({
|
||||
userType,
|
||||
@@ -783,25 +776,10 @@
|
||||
businessIdentifier: card.iccid
|
||||
})
|
||||
}
|
||||
const getBindingAuditTarget = (card: BindingCard) => {
|
||||
if (
|
||||
![1, 2].includes(Number(userStore.info.user_type)) ||
|
||||
!hasAuth(AUDIT_PERMISSIONS.resourceTimeline)
|
||||
)
|
||||
return null
|
||||
return resolveAuditResourceTarget({
|
||||
resourceType: 'device_sim_binding',
|
||||
internalId: card.id
|
||||
})
|
||||
}
|
||||
const openBindingCardAudit = (card: BindingCard) => {
|
||||
const target = getBindingCardAuditTarget(card)
|
||||
if (target) openAuditInvestigation(target)
|
||||
}
|
||||
const openBindingAudit = (card: BindingCard) => {
|
||||
const target = getBindingAuditTarget(card)
|
||||
if (target) openAuditInvestigation(target)
|
||||
}
|
||||
const { width } = useWindowSize()
|
||||
|
||||
const CARD_MONTH_USAGE_PERMISSION = 'asset_info:view_card_month_usage'
|
||||
|
||||
@@ -296,7 +296,7 @@
|
||||
const descriptionsColumn = computed(() => {
|
||||
if (width.value <= 640) return 1
|
||||
if (width.value <= 1024) return 2
|
||||
return 4
|
||||
return 3
|
||||
})
|
||||
|
||||
const emit = defineEmits<{
|
||||
|
||||
@@ -45,15 +45,20 @@
|
||||
<ElButton type="primary" @click="handleQuery">查询</ElButton>
|
||||
<ElButton @click="handleReset()">重置</ElButton>
|
||||
<ElButton
|
||||
v-if="walletInfo?.wallet_id && hasAuth(AUDIT_PERMISSIONS.financeTimeline)"
|
||||
v-if="
|
||||
isPlatformAuditUser &&
|
||||
walletInfo?.wallet_id &&
|
||||
hasAuth(AUDIT_PERMISSIONS.assetInfoWalletFinance)
|
||||
"
|
||||
@click="openWalletAudit"
|
||||
>资金链路</ElButton
|
||||
>
|
||||
<ElButton
|
||||
v-if="
|
||||
isPlatformAuditUser &&
|
||||
walletInfo?.resource_type &&
|
||||
walletInfo?.resource_id &&
|
||||
hasAuth(AUDIT_PERMISSIONS.resourceTimeline)
|
||||
hasAuth(AUDIT_PERMISSIONS.assetInfoWalletAsset)
|
||||
"
|
||||
@click="openAssetAudit"
|
||||
>资产审计</ElButton
|
||||
@@ -182,7 +187,9 @@
|
||||
TransactionType
|
||||
} from '@/types/api'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { AUDIT_PERMISSIONS } from '@/config/constants/audit'
|
||||
import { isPlatformAuditAccount } from '@/utils/business/auditAccess'
|
||||
import {
|
||||
resolveAuditResourceTarget,
|
||||
resolveFinanceAuditTarget
|
||||
@@ -204,6 +211,10 @@
|
||||
boundDeviceNo: ''
|
||||
})
|
||||
const { hasAuth } = useAuth()
|
||||
const userStore = useUserStore()
|
||||
const isPlatformAuditUser = computed(() =>
|
||||
isPlatformAuditAccount(userStore.info.user_type, userStore.isSuperAdmin)
|
||||
)
|
||||
|
||||
const openWalletAudit = () => {
|
||||
const target = resolveFinanceAuditTarget('wallet_id', props.walletInfo?.wallet_id)
|
||||
|
||||
@@ -3161,9 +3161,9 @@
|
||||
const userType = Number(userStore.getUserInfo.user_type)
|
||||
const auditPermission =
|
||||
userType === 3
|
||||
? AUDIT_PERMISSIONS.agentActivity
|
||||
? AUDIT_PERMISSIONS.agentDeviceActivity
|
||||
: userType === 4
|
||||
? AUDIT_PERMISSIONS.enterpriseActivity
|
||||
? AUDIT_PERMISSIONS.enterpriseDeviceActivity
|
||||
: AUDIT_PERMISSIONS.deviceEntry
|
||||
if (hasAuth(auditPermission)) {
|
||||
const auditTarget = resolveAuditResourceTarget({
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
{{ userType === 3 ? '活动记录' : '换货审计' }}
|
||||
</ElButton>
|
||||
<ElButton
|
||||
v-if="oldAssetAuditTarget && hasAuth(AUDIT_PERMISSIONS.resourceTimeline)"
|
||||
v-if="oldAssetAuditTarget && hasAuth(AUDIT_PERMISSIONS.exchangeOldAssetEntry)"
|
||||
type="primary"
|
||||
plain
|
||||
@click="openAuditInvestigation(oldAssetAuditTarget)"
|
||||
@@ -27,7 +27,7 @@
|
||||
旧资产审计
|
||||
</ElButton>
|
||||
<ElButton
|
||||
v-if="newAssetAuditTarget && hasAuth(AUDIT_PERMISSIONS.resourceTimeline)"
|
||||
v-if="newAssetAuditTarget && hasAuth(AUDIT_PERMISSIONS.exchangeNewAssetEntry)"
|
||||
type="primary"
|
||||
plain
|
||||
@click="openAuditInvestigation(newAssetAuditTarget)"
|
||||
@@ -77,10 +77,10 @@
|
||||
const exchangeId = ref<number>(0)
|
||||
const userType = computed(() => Number(userStore.info.user_type))
|
||||
const exchangeAuditPermission = computed(() =>
|
||||
userType.value === 3 ? AUDIT_PERMISSIONS.agentActivity : AUDIT_PERMISSIONS.resourceTimeline
|
||||
userType.value === 3 ? AUDIT_PERMISSIONS.agentExchangeActivity : AUDIT_PERMISSIONS.exchangeEntry
|
||||
)
|
||||
const exchangeAuditTarget = computed(() => {
|
||||
if (!exchangeDetail.value || userType.value === 4) return null
|
||||
if (!exchangeDetail.value || ![1, 2, 3].includes(userType.value)) return null
|
||||
return resolveAuditResourceTarget({
|
||||
userType: userType.value,
|
||||
resourceType: 'exchange_order',
|
||||
|
||||
@@ -1555,8 +1555,8 @@
|
||||
const flowType = row.flow_type || 'shipping' // 历史数据兼容
|
||||
const userType = Number(userStore.info.user_type)
|
||||
const entryPermission =
|
||||
userType === 3 ? AUDIT_PERMISSIONS.agentActivity : AUDIT_PERMISSIONS.resourceTimeline
|
||||
if (userType !== 4 && hasAuth(entryPermission)) {
|
||||
userType === 3 ? AUDIT_PERMISSIONS.agentExchangeActivity : AUDIT_PERMISSIONS.exchangeEntry
|
||||
if ([1, 2, 3].includes(userType) && hasAuth(entryPermission)) {
|
||||
const exchangeTarget = resolveAuditResourceTarget({
|
||||
userType,
|
||||
resourceType: 'exchange_order',
|
||||
@@ -1574,7 +1574,7 @@
|
||||
resourceType: row.old_asset_type,
|
||||
internalId: row.old_asset_id
|
||||
})
|
||||
if (oldAssetTarget)
|
||||
if (oldAssetTarget && hasAuth(AUDIT_PERMISSIONS.exchangeOldAssetEntry))
|
||||
actions.push({
|
||||
label: '旧资产审计',
|
||||
handler: () => openAuditInvestigation(oldAssetTarget),
|
||||
@@ -1584,7 +1584,7 @@
|
||||
resourceType: row.new_asset_type || '',
|
||||
internalId: row.new_asset_id
|
||||
})
|
||||
if (newAssetTarget)
|
||||
if (newAssetTarget && hasAuth(AUDIT_PERMISSIONS.exchangeNewAssetEntry))
|
||||
actions.push({
|
||||
label: '新资产审计',
|
||||
handler: () => openAuditInvestigation(newAssetTarget),
|
||||
|
||||
@@ -2315,9 +2315,9 @@
|
||||
const userType = Number(userStore.getUserInfo.user_type)
|
||||
const auditPermission =
|
||||
userType === 3
|
||||
? AUDIT_PERMISSIONS.agentActivity
|
||||
? AUDIT_PERMISSIONS.agentCardActivity
|
||||
: userType === 4
|
||||
? AUDIT_PERMISSIONS.enterpriseActivity
|
||||
? AUDIT_PERMISSIONS.enterpriseCardActivity
|
||||
: AUDIT_PERMISSIONS.cardEntry
|
||||
if (hasAuth(auditPermission)) {
|
||||
const auditTarget = resolveAuditResourceTarget({
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
{{ userType === 3 ? '活动记录' : '分配审计' }}
|
||||
</ElButton>
|
||||
<ElButton
|
||||
v-if="assetAuditTarget && hasAuth(AUDIT_PERMISSIONS.resourceTimeline)"
|
||||
v-if="assetAuditTarget && hasAuth(AUDIT_PERMISSIONS.assetAllocationAssetEntry)"
|
||||
type="primary"
|
||||
plain
|
||||
@click="openAuditInvestigation(assetAuditTarget)"
|
||||
@@ -67,10 +67,12 @@
|
||||
const detailData = ref<AssetAllocationRecord | null>(null)
|
||||
const userType = computed(() => Number(userStore.info.user_type))
|
||||
const recordAuditPermission = computed(() =>
|
||||
userType.value === 3 ? AUDIT_PERMISSIONS.agentActivity : AUDIT_PERMISSIONS.resourceTimeline
|
||||
userType.value === 3
|
||||
? AUDIT_PERMISSIONS.agentAssetAllocationActivity
|
||||
: AUDIT_PERMISSIONS.assetAllocationEntry
|
||||
)
|
||||
const recordAuditTarget = computed(() => {
|
||||
if (!detailData.value || userType.value === 4) return null
|
||||
if (!detailData.value || ![1, 2, 3].includes(userType.value)) return null
|
||||
return resolveAuditResourceTarget({
|
||||
userType: userType.value,
|
||||
resourceType: 'asset_allocation_record',
|
||||
|
||||
@@ -232,8 +232,10 @@
|
||||
const actions: Array<{ label: string; handler: () => void; type: 'primary' }> = []
|
||||
const userType = Number(userStore.info.user_type)
|
||||
const entryPermission =
|
||||
userType === 3 ? AUDIT_PERMISSIONS.agentActivity : AUDIT_PERMISSIONS.resourceTimeline
|
||||
if (!hasAuth(entryPermission) || userType === 4) return actions
|
||||
userType === 3
|
||||
? AUDIT_PERMISSIONS.agentAssetAllocationActivity
|
||||
: AUDIT_PERMISSIONS.assetAllocationEntry
|
||||
if (!hasAuth(entryPermission) || ![1, 2, 3].includes(userType)) return actions
|
||||
const recordTarget = resolveAuditResourceTarget({
|
||||
userType,
|
||||
resourceType: 'asset_allocation_record',
|
||||
@@ -252,7 +254,7 @@
|
||||
resourceType: row.asset_type,
|
||||
internalId: row.asset_id
|
||||
})
|
||||
if (assetTarget)
|
||||
if (assetTarget && hasAuth(AUDIT_PERMISSIONS.assetAllocationAssetEntry))
|
||||
actions.push({
|
||||
label: '资产审计',
|
||||
handler: () => openAuditInvestigation(assetTarget),
|
||||
|
||||
@@ -96,10 +96,7 @@
|
||||
</ElCard>
|
||||
<ElCard shadow="never" class="section-card"
|
||||
><template #header>调查引用</template
|
||||
><AuditInvestigationLinks
|
||||
:refs="detail.investigation_refs"
|
||||
:current-event-id="detail.event_id"
|
||||
:show-resources="false"
|
||||
><AuditInvestigationLinks :refs="detail.investigation_refs" :show-resources="false"
|
||||
/></ElCard>
|
||||
<ElCard shadow="never" class="section-card">
|
||||
<template #header>相关资源与快照</template>
|
||||
@@ -143,6 +140,7 @@
|
||||
<template #default="{ row }">
|
||||
<ElButton link type="primary" @click="openSnapshotDialog(row)">查看快照</ElButton>
|
||||
<ElButton
|
||||
v-if="hasAuth(AUDIT_PERMISSIONS.auditEventResourceTimeline)"
|
||||
link
|
||||
type="primary"
|
||||
:disabled="!row.resource_id"
|
||||
@@ -217,6 +215,8 @@
|
||||
} from '@/utils/business/audit'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { AUDIT_PERMISSIONS } from '@/config/constants/audit'
|
||||
import AuditInvestigationLinks from '@/components/business/audit/AuditInvestigationLinks.vue'
|
||||
import { openAuditInvestigation } from '@/components/business/audit/investigationController'
|
||||
|
||||
@@ -224,6 +224,7 @@
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const userStore = useUserStore()
|
||||
const { hasAuth } = useAuth()
|
||||
const loading = ref(false)
|
||||
const detail = ref<AuditEventDetail>()
|
||||
const snapshotDialogVisible = ref(false)
|
||||
|
||||
@@ -171,8 +171,7 @@
|
||||
{ label: '操作者', prop: 'actor_name' },
|
||||
{ label: '来源', prop: 'source' },
|
||||
{ label: '结果', prop: 'result' },
|
||||
{ label: '风险', prop: 'risk_level' },
|
||||
{ label: '操作', prop: 'actions' }
|
||||
{ label: '风险', prop: 'risk_level' }
|
||||
]
|
||||
const { columnChecks, columns } = useCheckedColumns(() => [
|
||||
{
|
||||
@@ -185,7 +184,12 @@
|
||||
prop: 'action_name',
|
||||
label: '动作',
|
||||
minWidth: 220,
|
||||
formatter: (row: AuditEventView) => row.action_name || '-'
|
||||
formatter: (row: AuditEventView) =>
|
||||
h(
|
||||
ElButton,
|
||||
{ type: 'primary', link: true, onClick: () => openDetail(row) },
|
||||
() => row.action_name || '-'
|
||||
)
|
||||
},
|
||||
{ prop: 'summary', label: '摘要', minWidth: 240, showOverflowTooltip: true },
|
||||
{
|
||||
@@ -234,18 +238,6 @@
|
||||
{ type: auditRiskMeta[row.risk_level]?.type || 'info', effect: 'plain' },
|
||||
() => auditRiskMeta[row.risk_level]?.label || row.risk_level
|
||||
)
|
||||
},
|
||||
{
|
||||
prop: 'actions',
|
||||
label: '操作',
|
||||
width: 110,
|
||||
fixed: 'right',
|
||||
formatter: (row: AuditEventView) =>
|
||||
h(
|
||||
ElButton,
|
||||
{ type: 'primary', link: true, onClick: () => openDetail(row) },
|
||||
() => '查看详情'
|
||||
)
|
||||
}
|
||||
])
|
||||
|
||||
|
||||
@@ -94,28 +94,28 @@
|
||||
<template #header>调查入口</template>
|
||||
<div v-if="hasAssociations" class="link-actions">
|
||||
<ElButton
|
||||
v-if="requestReference"
|
||||
v-if="canViewRequestTimeline"
|
||||
type="primary"
|
||||
plain
|
||||
@click="openAuditInvestigation({ mode: 'request', id: requestReference })"
|
||||
@click="openAuditInvestigation({ mode: 'request', id: requestReference || '' })"
|
||||
>
|
||||
请求链路
|
||||
</ElButton>
|
||||
<ElButton
|
||||
v-if="correlationReference"
|
||||
v-if="canViewCorrelationTimeline"
|
||||
type="primary"
|
||||
plain
|
||||
@click="
|
||||
openAuditInvestigation({
|
||||
mode: 'correlation',
|
||||
id: correlationReference
|
||||
id: correlationReference || ''
|
||||
})
|
||||
"
|
||||
>
|
||||
业务关联链路
|
||||
</ElButton>
|
||||
<ElButton
|
||||
v-if="detail.resource?.type && resourceReference"
|
||||
v-if="canViewResourceTimeline"
|
||||
type="primary"
|
||||
plain
|
||||
@click="openResourceTimeline"
|
||||
@@ -257,11 +257,14 @@
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
import { openAuditInvestigation } from '@/components/business/audit/investigationController'
|
||||
import { resolveInvestigationReference } from '@/utils/business/auditNavigation'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { AUDIT_PERMISSIONS } from '@/config/constants/audit'
|
||||
|
||||
defineOptions({ name: 'AuditIntegrationDetail' })
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const { hasAuth } = useAuth()
|
||||
const loading = ref(false)
|
||||
const detail = ref<IntegrationDetailResponse>()
|
||||
|
||||
@@ -284,11 +287,25 @@
|
||||
fidelity: detail.value?.fidelity.resource_id_available
|
||||
})
|
||||
)
|
||||
const canViewRequestTimeline = computed(
|
||||
() =>
|
||||
Boolean(requestReference.value) && hasAuth(AUDIT_PERMISSIONS.integrationDetailRequestTimeline)
|
||||
)
|
||||
const canViewCorrelationTimeline = computed(
|
||||
() =>
|
||||
Boolean(correlationReference.value) &&
|
||||
hasAuth(AUDIT_PERMISSIONS.integrationDetailCorrelationTimeline)
|
||||
)
|
||||
const canViewResourceTimeline = computed(
|
||||
() =>
|
||||
Boolean(detail.value?.resource?.type && resourceReference.value) &&
|
||||
hasAuth(AUDIT_PERMISSIONS.integrationDetailResourceTimeline)
|
||||
)
|
||||
const hasAssociations = computed(() =>
|
||||
Boolean(
|
||||
requestReference.value ||
|
||||
correlationReference.value ||
|
||||
(detail.value?.resource?.type && resourceReference.value)
|
||||
canViewRequestTimeline.value ||
|
||||
canViewCorrelationTimeline.value ||
|
||||
canViewResourceTimeline.value
|
||||
)
|
||||
)
|
||||
const hasJsonContent = (value?: Record<string, unknown> | null) =>
|
||||
|
||||
@@ -180,9 +180,16 @@
|
||||
><ElTableColumn label="方向" prop="direction_name" width="90" /><ElTableColumn
|
||||
label="操作"
|
||||
min-width="190"
|
||||
><template #default="{ row }">{{
|
||||
row.operation_name || row.operation
|
||||
}}</template></ElTableColumn
|
||||
><template #default="{ row }"
|
||||
><ElButton
|
||||
link
|
||||
type="primary"
|
||||
@click="
|
||||
router.push(`/audit/integrations/${encodeURIComponent(row.integration_id)}`)
|
||||
"
|
||||
>{{ row.operation_name || row.operation || '-' }}</ElButton
|
||||
></template
|
||||
></ElTableColumn
|
||||
><ElTableColumn label="结果" width="120"
|
||||
><template #default="{ row }"
|
||||
><ElTag :type="categoryMeta(row).type">{{
|
||||
@@ -197,17 +204,6 @@
|
||||
><template #default="{ row }">{{
|
||||
row.resource?.key || row.resource?.id || '-'
|
||||
}}</template></ElTableColumn
|
||||
><ElTableColumn label="操作" width="100" fixed="right"
|
||||
><template #default="{ row }"
|
||||
><ElButton
|
||||
link
|
||||
type="primary"
|
||||
@click="
|
||||
router.push(`/audit/integrations/${encodeURIComponent(row.integration_id)}`)
|
||||
"
|
||||
>查看详情</ElButton
|
||||
></template
|
||||
></ElTableColumn
|
||||
></template
|
||||
></ArtTable
|
||||
></ElCard
|
||||
|
||||
@@ -137,6 +137,7 @@
|
||||
><div class="risk-event-table">
|
||||
<AuditEventTable
|
||||
:items="events"
|
||||
:detail-enabled="hasAuth(AUDIT_PERMISSIONS.riskEventDetail)"
|
||||
@detail="(row) => router.push(`/audit/events/${encodeURIComponent(row.event_id)}`)"
|
||||
/>
|
||||
</div>
|
||||
@@ -167,6 +168,8 @@
|
||||
WarningFilled
|
||||
} from '@element-plus/icons-vue'
|
||||
import { AuditService } from '@/api/modules'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { AUDIT_PERMISSIONS } from '@/config/constants/audit'
|
||||
import type {
|
||||
AuditEventView,
|
||||
AuditNamedCount,
|
||||
@@ -178,6 +181,7 @@
|
||||
|
||||
defineOptions({ name: 'AuditRisks' })
|
||||
const router = useRouter()
|
||||
const { hasAuth } = useAuth()
|
||||
const loading = ref(false)
|
||||
const headerColumns = ref([])
|
||||
const dateRange = ref<string[]>([])
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</ElButton>
|
||||
<h2 class="detail-title">{{ pageTitle }}</h2>
|
||||
<ElButton
|
||||
v-if="detailData && isPlatformUser && hasAuth(AUDIT_PERMISSIONS.resourceTimeline)"
|
||||
v-if="detailData && isPlatformUser && hasAuth(AUDIT_PERMISSIONS.agentRechargeEntry)"
|
||||
type="primary"
|
||||
plain
|
||||
@click="openRechargeAudit"
|
||||
@@ -19,7 +19,9 @@
|
||||
审计记录
|
||||
</ElButton>
|
||||
<ElButton
|
||||
v-if="detailData && isPlatformUser && hasAuth(AUDIT_PERMISSIONS.financeTimeline)"
|
||||
v-if="
|
||||
detailData && isPlatformUser && hasAuth(AUDIT_PERMISSIONS.agentRechargeFinanceEntry)
|
||||
"
|
||||
type="primary"
|
||||
plain
|
||||
@click="openRechargeFinance"
|
||||
@@ -30,7 +32,7 @@
|
||||
v-if="
|
||||
detailData?.approval_instance_id &&
|
||||
isPlatformUser &&
|
||||
hasAuth(AUDIT_PERMISSIONS.resourceTimeline)
|
||||
hasAuth(AUDIT_PERMISSIONS.agentRechargeApprovalEntry)
|
||||
"
|
||||
type="primary"
|
||||
plain
|
||||
|
||||
@@ -777,7 +777,7 @@
|
||||
{
|
||||
prop: 'payment_method',
|
||||
label: '支付方式',
|
||||
width: 120,
|
||||
width: 140,
|
||||
formatter: (row: AgentRecharge) => getPaymentMethodText(row.payment_method)
|
||||
},
|
||||
{
|
||||
@@ -1316,7 +1316,7 @@
|
||||
onConfirmPayment: handleShowConfirmPay,
|
||||
onReject: handleShowReject
|
||||
})
|
||||
if (isPlatformAccount.value && hasAuth(AUDIT_PERMISSIONS.resourceTimeline)) {
|
||||
if (isPlatformAccount.value && hasAuth(AUDIT_PERMISSIONS.agentRechargeEntry)) {
|
||||
const resourceTarget = resolveAuditResourceTarget({
|
||||
resourceType: 'agent_recharge',
|
||||
internalId: row.id
|
||||
@@ -1328,7 +1328,7 @@
|
||||
type: 'primary'
|
||||
})
|
||||
}
|
||||
if (isPlatformAccount.value && hasAuth(AUDIT_PERMISSIONS.financeTimeline)) {
|
||||
if (isPlatformAccount.value && hasAuth(AUDIT_PERMISSIONS.agentRechargeFinanceEntry)) {
|
||||
const financeTarget = resolveFinanceAuditTarget('recharge_id', row.id)
|
||||
if (financeTarget)
|
||||
actions.unshift({
|
||||
@@ -1337,7 +1337,7 @@
|
||||
type: 'primary'
|
||||
})
|
||||
}
|
||||
if (isPlatformAccount.value && hasAuth(AUDIT_PERMISSIONS.resourceTimeline)) {
|
||||
if (isPlatformAccount.value && hasAuth(AUDIT_PERMISSIONS.agentRechargeApprovalEntry)) {
|
||||
const approvalTarget = resolveAuditResourceTarget({
|
||||
resourceType: 'approval_instance',
|
||||
internalId: row.approval_instance_id
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
审计记录
|
||||
</ElButton>
|
||||
<ElButton
|
||||
v-if="refund && isPlatformUser && hasAuth(AUDIT_PERMISSIONS.financeTimeline)"
|
||||
v-if="refund && isPlatformUser && hasAuth(AUDIT_PERMISSIONS.refundFinanceEntry)"
|
||||
type="primary"
|
||||
plain
|
||||
@click="openRefundFinance"
|
||||
@@ -30,7 +30,7 @@
|
||||
v-if="
|
||||
refund?.approval_instance_id &&
|
||||
isPlatformUser &&
|
||||
hasAuth(AUDIT_PERMISSIONS.resourceTimeline)
|
||||
hasAuth(AUDIT_PERMISSIONS.refundApprovalEntry)
|
||||
"
|
||||
type="primary"
|
||||
plain
|
||||
|
||||
@@ -754,7 +754,7 @@
|
||||
handler: () => openAuditInvestigation(auditTarget),
|
||||
type: 'primary'
|
||||
})
|
||||
if (hasAuth(AUDIT_PERMISSIONS.financeTimeline)) {
|
||||
if (hasAuth(AUDIT_PERMISSIONS.refundFinanceEntry)) {
|
||||
const financeTarget = resolveFinanceAuditTarget('refund_id', row.id)
|
||||
if (financeTarget)
|
||||
actions.push({
|
||||
@@ -768,7 +768,7 @@
|
||||
resourceType: 'approval_instance',
|
||||
internalId: row.approval_instance_id
|
||||
})
|
||||
if (approvalTarget)
|
||||
if (approvalTarget && hasAuth(AUDIT_PERMISSIONS.refundApprovalEntry))
|
||||
actions.push({
|
||||
label: '审批审计',
|
||||
handler: () => openAuditInvestigation(approvalTarget),
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
审计记录
|
||||
</ElButton>
|
||||
<ElButton
|
||||
v-if="detailData && isPlatformUser && hasAuth(AUDIT_PERMISSIONS.financeTimeline)"
|
||||
v-if="detailData && isPlatformUser && hasAuth(AUDIT_PERMISSIONS.orderFinanceEntry)"
|
||||
type="primary"
|
||||
plain
|
||||
@click="openOrderFinance"
|
||||
|
||||
@@ -1372,7 +1372,7 @@
|
||||
handler: () => openAuditInvestigation(auditTarget),
|
||||
type: 'primary'
|
||||
})
|
||||
if (hasAuth(AUDIT_PERMISSIONS.financeTimeline)) {
|
||||
if (hasAuth(AUDIT_PERMISSIONS.orderFinanceEntry)) {
|
||||
const financeTarget = resolveFinanceAuditTarget('order_id', row.id)
|
||||
if (financeTarget)
|
||||
actions.push({
|
||||
|
||||
@@ -815,16 +815,19 @@
|
||||
const getActions = (row: ShopResponse) => {
|
||||
const actions: any[] = []
|
||||
|
||||
if (hasAuth(AUDIT_PERMISSIONS.shopEntry)) {
|
||||
const userType = Number(userStore.getUserInfo.user_type)
|
||||
const auditPermission =
|
||||
userType === 3 ? AUDIT_PERMISSIONS.agentActivity : AUDIT_PERMISSIONS.shopEntry
|
||||
if (hasAuth(auditPermission)) {
|
||||
const auditTarget = resolveAuditResourceTarget({
|
||||
userType: userStore.getUserInfo.user_type,
|
||||
userType,
|
||||
resourceType: 'shop',
|
||||
internalId: row.id,
|
||||
businessIdentifier: row.shop_code
|
||||
})
|
||||
if (auditTarget)
|
||||
actions.push({
|
||||
label: '审计记录',
|
||||
label: userType === 3 ? '活动记录' : '审计记录',
|
||||
handler: () => openAuditInvestigation(auditTarget),
|
||||
type: 'primary'
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user