update permission and product
This commit is contained in:
@@ -22,6 +22,13 @@
|
||||
/>
|
||||
<div v-if="!config.itemList?.length" class="empty" v-text="'暂无产品权益'" />
|
||||
</t-cell-group>
|
||||
<t-button
|
||||
v-if="canPurchase"
|
||||
class="cell-button"
|
||||
theme="primary"
|
||||
content="购买套餐"
|
||||
@click="toPurchase"
|
||||
/>
|
||||
<t-button
|
||||
v-if="canDelete"
|
||||
class="cell-button"
|
||||
@@ -58,6 +65,11 @@ const config = ref<GaoPackageConfig>();
|
||||
const isLoading = ref(false);
|
||||
const canUpdate = computed(() => !!config.value && userStore.hasPermissions(permissionCodes.packageConfig.update));
|
||||
const canDelete = computed(() => !!config.value && userStore.hasPermissions(permissionCodes.packageConfig.delete));
|
||||
const canPurchase = computed(() =>
|
||||
!!config.value
|
||||
&& config.value.status === "ACTIVE"
|
||||
&& userStore.hasPermissions(permissionCodes.customerPackage.create)
|
||||
);
|
||||
|
||||
function getStatusTheme(status?: PackageConfigStatus): "success" | "warning" | "default" {
|
||||
return status === "ACTIVE" ? "success" : status === "INACTIVE" ? "warning" : "default";
|
||||
@@ -89,6 +101,12 @@ async function toEdit(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
async function toPurchase(): Promise<void> {
|
||||
if (config.value?.id && canPurchase.value) {
|
||||
await router.push(`/management/package-configs/${config.value.id}/purchase`);
|
||||
}
|
||||
}
|
||||
|
||||
function removeConfig(): void {
|
||||
if (!config.value?.id || !canDelete.value) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user