fix: 添加租户套餐为空时的错误提示
检测租户套餐列表是否为空,为空时显示错误提示并抛出异常,避免用户填写表单后无法选择套餐
This commit is contained in:
parent
6be8870801
commit
e2f361929c
@ -5,6 +5,8 @@ import { useVbenDrawer } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { tenantAdd, tenantInfo, tenantUpdate } from '#/api/system/tenant';
|
||||
import { packageSelectList } from '#/api/system/tenant-package';
|
||||
@ -35,6 +37,14 @@ const [BasicForm, formApi] = useVbenForm({
|
||||
|
||||
async function setupPackageSelect() {
|
||||
const tenantPackageList = await packageSelectList();
|
||||
/**
|
||||
* 检测是否存在租户套餐 你也不想表单填完了发现套餐为0无法选中吧
|
||||
*/
|
||||
if (tenantPackageList.length === 0) {
|
||||
message.error('请先配置租户套餐');
|
||||
throw new Error('请先配置租户套餐');
|
||||
}
|
||||
|
||||
const options = tenantPackageList.map((item) => ({
|
||||
label: item.packageName,
|
||||
value: item.packageId,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user