This commit is contained in:
@@ -420,6 +420,8 @@
|
||||
const { hasAuth } = useAuth()
|
||||
const userStore = useUserStore()
|
||||
const router = useRouter()
|
||||
const canUpdatePackageShelfStatus = hasAuth('package:update_away')
|
||||
const canUpdatePackageStatus = hasAuth('package:update_status')
|
||||
|
||||
const currentUserType = computed(() => Number(userStore.info.user_type ?? 0))
|
||||
const isAgentAccount = computed(() => currentUserType.value === 3)
|
||||
@@ -617,8 +619,8 @@
|
||||
return map[row.expiry_base] || row.expiry_base || '-'
|
||||
}
|
||||
},
|
||||
{ label: '上架状态', prop: 'shelf_status' },
|
||||
{ label: '状态', prop: 'status' },
|
||||
...(canUpdatePackageShelfStatus ? [{ label: '上架状态', prop: 'shelf_status' }] : []),
|
||||
...(canUpdatePackageStatus ? [{ label: '状态', prop: 'status' }] : []),
|
||||
{ label: '创建时间', prop: 'created_at' },
|
||||
{ label: '更新时间', prop: 'updated_at' }
|
||||
]
|
||||
@@ -862,41 +864,47 @@
|
||||
)
|
||||
}
|
||||
]),
|
||||
{
|
||||
prop: 'shelf_status',
|
||||
label: '上架状态',
|
||||
width: 100,
|
||||
formatter: (row: PackageResponse) => {
|
||||
return h(ElSwitch, {
|
||||
modelValue: row.shelf_status === 1,
|
||||
activeText: getShelfStatusText(1),
|
||||
inactiveText: getShelfStatusText(2),
|
||||
inlinePrompt: true,
|
||||
disabled: !hasAuth('package:update_away'),
|
||||
'onUpdate:modelValue': (val: string | number | boolean) =>
|
||||
handleShelfStatusChange(row, val ? 1 : 2)
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '状态',
|
||||
width: 100,
|
||||
formatter: (row: PackageResponse) => {
|
||||
const frontendStatus = apiStatusToFrontend(row.status ?? 0)
|
||||
return h(ElSwitch, {
|
||||
modelValue: frontendStatus,
|
||||
activeValue: CommonStatus.ENABLED,
|
||||
inactiveValue: CommonStatus.DISABLED,
|
||||
activeText: getStatusText(CommonStatus.ENABLED),
|
||||
inactiveText: getStatusText(CommonStatus.DISABLED),
|
||||
inlinePrompt: true,
|
||||
disabled: !hasAuth('package:update_status'),
|
||||
'onUpdate:modelValue': (val: string | number | boolean) =>
|
||||
handleStatusChange(row, val as number)
|
||||
})
|
||||
}
|
||||
},
|
||||
...(canUpdatePackageShelfStatus
|
||||
? [
|
||||
{
|
||||
prop: 'shelf_status',
|
||||
label: '上架状态',
|
||||
width: 100,
|
||||
formatter: (row: PackageResponse) => {
|
||||
return h(ElSwitch, {
|
||||
modelValue: row.shelf_status === 1,
|
||||
activeText: getShelfStatusText(1),
|
||||
inactiveText: getShelfStatusText(2),
|
||||
inlinePrompt: true,
|
||||
'onUpdate:modelValue': (val: string | number | boolean) =>
|
||||
handleShelfStatusChange(row, val ? 1 : 2)
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
: []),
|
||||
...(canUpdatePackageStatus
|
||||
? [
|
||||
{
|
||||
prop: 'status',
|
||||
label: '状态',
|
||||
width: 100,
|
||||
formatter: (row: PackageResponse) => {
|
||||
const frontendStatus = apiStatusToFrontend(row.status ?? 0)
|
||||
return h(ElSwitch, {
|
||||
modelValue: frontendStatus,
|
||||
activeValue: CommonStatus.ENABLED,
|
||||
inactiveValue: CommonStatus.DISABLED,
|
||||
activeText: getStatusText(CommonStatus.ENABLED),
|
||||
inactiveText: getStatusText(CommonStatus.DISABLED),
|
||||
inlinePrompt: true,
|
||||
'onUpdate:modelValue': (val: string | number | boolean) =>
|
||||
handleStatusChange(row, val as number)
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
: []),
|
||||
{
|
||||
prop: 'real_data_mb',
|
||||
label: '总流量',
|
||||
|
||||
@@ -408,6 +408,7 @@
|
||||
defineOptions({ name: 'PackageSeries' })
|
||||
|
||||
const { hasAuth } = useAuth()
|
||||
const canUpdatePackageSeriesStatus = hasAuth('package_series:update_status')
|
||||
const router = useRouter()
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
@@ -512,7 +513,7 @@
|
||||
prop: 'validity_type',
|
||||
formatter: (row: any) => row.one_time_commission_config?.validity_type || '-'
|
||||
},
|
||||
{ label: '状态', prop: 'status' },
|
||||
...(canUpdatePackageSeriesStatus ? [{ label: '状态', prop: 'status' }] : []),
|
||||
{ label: '创建时间', prop: 'created_at' }
|
||||
]
|
||||
|
||||
@@ -720,25 +721,28 @@
|
||||
return validityType
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '状态',
|
||||
width: 100,
|
||||
formatter: (row: PackageSeriesResponse) => {
|
||||
const frontendStatus = apiStatusToFrontend(row.status)
|
||||
return h(ElSwitch, {
|
||||
modelValue: frontendStatus,
|
||||
activeValue: CommonStatus.ENABLED,
|
||||
inactiveValue: CommonStatus.DISABLED,
|
||||
activeText: getStatusText(CommonStatus.ENABLED),
|
||||
inactiveText: getStatusText(CommonStatus.DISABLED),
|
||||
inlinePrompt: true,
|
||||
disabled: !hasAuth('package_series:update_status'),
|
||||
'onUpdate:modelValue': (val: string | number | boolean) =>
|
||||
handleStatusChange(row, val as number)
|
||||
})
|
||||
}
|
||||
},
|
||||
...(canUpdatePackageSeriesStatus
|
||||
? [
|
||||
{
|
||||
prop: 'status',
|
||||
label: '状态',
|
||||
width: 100,
|
||||
formatter: (row: PackageSeriesResponse) => {
|
||||
const frontendStatus = apiStatusToFrontend(row.status)
|
||||
return h(ElSwitch, {
|
||||
modelValue: frontendStatus,
|
||||
activeValue: CommonStatus.ENABLED,
|
||||
inactiveValue: CommonStatus.DISABLED,
|
||||
activeText: getStatusText(CommonStatus.ENABLED),
|
||||
inactiveText: getStatusText(CommonStatus.DISABLED),
|
||||
inlinePrompt: true,
|
||||
'onUpdate:modelValue': (val: string | number | boolean) =>
|
||||
handleStatusChange(row, val as number)
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
: []),
|
||||
{
|
||||
prop: 'description',
|
||||
label: '描述',
|
||||
|
||||
@@ -587,6 +587,7 @@
|
||||
defineOptions({ name: 'SeriesGrants' })
|
||||
|
||||
const { hasAuth } = useAuth()
|
||||
const canUpdateSeriesGrantStatus = hasAuth('series_grants:update_status')
|
||||
const router = useRouter()
|
||||
const userStore = useUserStore()
|
||||
const { info: userInfo } = storeToRefs(userStore)
|
||||
@@ -743,7 +744,7 @@
|
||||
{ label: '一次性佣金金额', prop: 'one_time_commission_amount' },
|
||||
{ label: '强制充值', prop: 'force_recharge_enabled' },
|
||||
{ label: '套餐数量', prop: 'package_count' },
|
||||
{ label: '状态', prop: 'status' },
|
||||
...(canUpdateSeriesGrantStatus ? [{ label: '状态', prop: 'status' }] : []),
|
||||
{ label: '创建时间', prop: 'created_at' }
|
||||
]
|
||||
|
||||
@@ -973,25 +974,28 @@
|
||||
label: '套餐数量',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '状态',
|
||||
width: 100,
|
||||
formatter: (row: ShopSeriesGrantResponse) => {
|
||||
const frontendStatus = apiStatusToFrontend(row.status)
|
||||
return h(ElSwitch, {
|
||||
modelValue: frontendStatus,
|
||||
activeValue: CommonStatus.ENABLED,
|
||||
inactiveValue: CommonStatus.DISABLED,
|
||||
activeText: getStatusText(CommonStatus.ENABLED),
|
||||
inactiveText: getStatusText(CommonStatus.DISABLED),
|
||||
inlinePrompt: true,
|
||||
disabled: !hasAuth('series_grants:update_status'),
|
||||
'onUpdate:modelValue': (val: string | number | boolean) =>
|
||||
handleStatusChange(row, val as number)
|
||||
})
|
||||
}
|
||||
},
|
||||
...(canUpdateSeriesGrantStatus
|
||||
? [
|
||||
{
|
||||
prop: 'status',
|
||||
label: '状态',
|
||||
width: 100,
|
||||
formatter: (row: ShopSeriesGrantResponse) => {
|
||||
const frontendStatus = apiStatusToFrontend(row.status)
|
||||
return h(ElSwitch, {
|
||||
modelValue: frontendStatus,
|
||||
activeValue: CommonStatus.ENABLED,
|
||||
inactiveValue: CommonStatus.DISABLED,
|
||||
activeText: getStatusText(CommonStatus.ENABLED),
|
||||
inactiveText: getStatusText(CommonStatus.DISABLED),
|
||||
inlinePrompt: true,
|
||||
'onUpdate:modelValue': (val: string | number | boolean) =>
|
||||
handleStatusChange(row, val as number)
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
: []),
|
||||
{
|
||||
prop: 'created_at',
|
||||
label: '创建时间',
|
||||
|
||||
Reference in New Issue
Block a user