fetch(modify):账号管理

This commit is contained in:
sexygoat
2026-02-02 11:51:59 +08:00
parent 78bd9fba85
commit 4d2f38c75b
13 changed files with 489 additions and 1036 deletions

View File

@@ -36,6 +36,36 @@
</template>
</ArtTable>
<!-- 授权详情对话框 -->
<ElDialog v-model="detailDialogVisible" title="授权详情" width="700px">
<ElDescriptions v-if="currentRecord" :column="2" border>
<ElDescriptionsItem label="企业ID">{{ currentRecord.enterprise_id }}</ElDescriptionsItem>
<ElDescriptionsItem label="企业名称">{{ currentRecord.enterprise_name }}</ElDescriptionsItem>
<ElDescriptionsItem label="卡ID">{{ currentRecord.card_id }}</ElDescriptionsItem>
<ElDescriptionsItem label="ICCID">{{ currentRecord.iccid }}</ElDescriptionsItem>
<ElDescriptionsItem label="手机号">{{ currentRecord.msisdn || '--' }}</ElDescriptionsItem>
<ElDescriptionsItem label="授权人ID">{{ currentRecord.authorized_by }}</ElDescriptionsItem>
<ElDescriptionsItem label="授权人">{{ currentRecord.authorizer_name }}</ElDescriptionsItem>
<ElDescriptionsItem label="授权人类型">
<ElTag :type="getAuthorizerTypeTag(currentRecord.authorizer_type)">
{{ getAuthorizerTypeText(currentRecord.authorizer_type) }}
</ElTag>
</ElDescriptionsItem>
<ElDescriptionsItem label="授权时间" :span="2">{{ formatDateTime(currentRecord.authorized_at) }}</ElDescriptionsItem>
<ElDescriptionsItem label="状态" :span="2">
<ElTag :type="getStatusTag(currentRecord.status)">
{{ getStatusText(currentRecord.status) }}
</ElTag>
</ElDescriptionsItem>
<ElDescriptionsItem label="备注" :span="2">{{ currentRecord.remark || '--' }}</ElDescriptionsItem>
</ElDescriptions>
<template #footer>
<div class="dialog-footer">
<ElButton type="primary" @click="detailDialogVisible = false">关闭</ElButton>
</div>
</template>
</ElDialog>
<!-- 修改备注对话框 -->
<ElDialog v-model="remarkDialogVisible" title="修改备注" width="500px">
<ElForm ref="remarkFormRef" :model="remarkForm" :rules="remarkRules" label-width="80px">
@@ -85,11 +115,13 @@
const router = useRouter()
const loading = ref(false)
const detailDialogVisible = ref(false)
const remarkDialogVisible = ref(false)
const remarkLoading = ref(false)
const tableRef = ref()
const remarkFormRef = ref<FormInstance>()
const currentRecordId = ref<number>(0)
const currentRecord = ref<AuthorizationItem | null>(null)
// 搜索表单初始值
const initialSearchState = {
@@ -172,7 +204,6 @@
// 列配置
const columnOptions = [
{ label: 'ID', prop: 'id' },
{ label: 'ICCID', prop: 'iccid' },
{ label: '手机号', prop: 'msisdn' },
{ label: '企业名称', prop: 'enterprise_name' },
@@ -180,8 +211,6 @@
{ label: '授权人类型', prop: 'authorizer_type' },
{ label: '授权时间', prop: 'authorized_at' },
{ label: '状态', prop: 'status' },
{ label: '回收人', prop: 'revoker_name' },
{ label: '回收时间', prop: 'revoked_at' },
{ label: '备注', prop: 'remark' },
{ label: '操作', prop: 'operation' }
]
@@ -210,20 +239,16 @@
// 动态列配置
const { columnChecks, columns } = useCheckedColumns(() => [
{
prop: 'id',
label: 'ID',
width: 80
},
{
prop: 'iccid',
label: 'ICCID',
minWidth: 180
minWidth: 200
},
{
prop: 'msisdn',
label: '手机号',
width: 120
width: 130,
formatter: (row: AuthorizationItem) => row.msisdn || '-'
},
{
prop: 'enterprise_name',
@@ -238,7 +263,7 @@
{
prop: 'authorizer_type',
label: '授权人类型',
width: 100,
width: 110,
formatter: (row: AuthorizationItem) => {
return h(ElTag, { type: getAuthorizerTypeTag(row.authorizer_type) }, () =>
getAuthorizerTypeText(row.authorizer_type)
@@ -259,18 +284,6 @@
return h(ElTag, { type: getStatusTag(row.status) }, () => getStatusText(row.status))
}
},
{
prop: 'revoker_name',
label: '回收人',
width: 120,
formatter: (row: AuthorizationItem) => row.revoker_name || '-'
},
{
prop: 'revoked_at',
label: '回收时间',
width: 180,
formatter: (row: AuthorizationItem) => (row.revoked_at ? formatDateTime(row.revoked_at) : '-')
},
{
prop: 'remark',
label: '备注',
@@ -286,7 +299,7 @@
formatter: (row: AuthorizationItem) => {
return h('div', { style: 'display: flex; gap: 8px;' }, [
h(ArtButtonTable, {
type: 'view',
text: '详情',
onClick: () => viewDetail(row)
}),
h(ArtButtonTable, {
@@ -371,10 +384,8 @@
// 查看详情
const viewDetail = (row: AuthorizationItem) => {
router.push({
path: '/asset-management/authorization-detail',
query: { id: row.id }
})
currentRecord.value = row
detailDialogVisible.value = true
}
// 显示修改备注对话框