mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat: 添加同步租户套餐的功能,并更新租户选择器逻辑。
This commit is contained in:
@ -1,7 +1,12 @@
|
||||
<script setup lang="tsx">
|
||||
import { computed } from 'vue';
|
||||
import { NButton, NDivider } from 'naive-ui';
|
||||
import { fetchBatchDeleteTenant, fetchGetTenantList, fetchSyncTenantDict } from '@/service/api/system/tenant';
|
||||
import {
|
||||
fetchBatchDeleteTenant,
|
||||
fetchGetTenantList,
|
||||
fetchSyncTenantDict,
|
||||
fetchSyncTenantPackage
|
||||
} from '@/service/api/system/tenant';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { useAuthStore } from '@/store/modules/auth';
|
||||
import { useAuth } from '@/hooks/business/auth';
|
||||
@ -129,7 +134,7 @@ const {
|
||||
icon="material-symbols:sync-outline"
|
||||
tooltipContent="同步套餐"
|
||||
popconfirmContent={`确认同步[${row.companyName}]的套餐吗?`}
|
||||
onPositiveClick={() => handleSyncTenantDict()}
|
||||
onPositiveClick={() => handleSyncTenantPackage(row)}
|
||||
/>
|
||||
);
|
||||
};
|
||||
@ -196,6 +201,17 @@ async function handleSyncTenantDict() {
|
||||
await getData();
|
||||
}
|
||||
|
||||
async function handleSyncTenantPackage(row: Api.System.Tenant) {
|
||||
const params: Api.System.SyncTenantPackageParams = {
|
||||
tenantId: row.tenantId,
|
||||
packageId: row.packageId
|
||||
};
|
||||
const { error } = await fetchSyncTenantPackage(params);
|
||||
if (error) return;
|
||||
window.$message?.success('同步租户套餐成功');
|
||||
await getData();
|
||||
}
|
||||
|
||||
async function handleExport() {
|
||||
download('/system/tenant/export', searchParams, `租户列表_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
|
Reference in New Issue
Block a user