|
|
@@ -1,38 +1,36 @@
|
|
|
import { listDictModel } from '/@/api/common';
|
|
|
+import { sysTenantPackageQueryPage } from '/@/api/sys/sysTenantPackageApi';
|
|
|
+import { validatorUsername } from '/@/api/sys/sysUserApi';
|
|
|
import { DescItem } from '/@/components/Description';
|
|
|
import { BasicColumn, FormSchema } from '/@/components/Table';
|
|
|
|
|
|
export const columns: BasicColumn[] = [
|
|
|
{
|
|
|
- title: '租户名称',
|
|
|
+ title: '名称',
|
|
|
dataIndex: 'name',
|
|
|
},
|
|
|
{
|
|
|
- title: '租户联系人',
|
|
|
- dataIndex: 'contractUser',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '租户类型',
|
|
|
+ title: '类型',
|
|
|
dataIndex: 'type',
|
|
|
},
|
|
|
{
|
|
|
- title: '租户联系人电话',
|
|
|
- dataIndex: 'contactMobile',
|
|
|
+ title: '联系人',
|
|
|
+ dataIndex: 'contractUser',
|
|
|
},
|
|
|
{
|
|
|
- title: '租户所属用户id',
|
|
|
- dataIndex: 'tenantUserId',
|
|
|
+ title: '联系人电话',
|
|
|
+ dataIndex: 'contactMobile',
|
|
|
},
|
|
|
{
|
|
|
- title: '租户套餐id',
|
|
|
- dataIndex: 'packageId',
|
|
|
+ title: '管理账号',
|
|
|
+ dataIndex: 'username',
|
|
|
},
|
|
|
{
|
|
|
- title: '租户备注',
|
|
|
- dataIndex: 'remark',
|
|
|
+ title: '套餐名称',
|
|
|
+ dataIndex: 'packageName',
|
|
|
},
|
|
|
{
|
|
|
- title: '租户状态',
|
|
|
+ title: '状态',
|
|
|
dataIndex: 'disable',
|
|
|
},
|
|
|
];
|
|
|
@@ -40,26 +38,26 @@ export const columns: BasicColumn[] = [
|
|
|
// 表单列定义
|
|
|
export const searchFormSchema: FormSchema[] = [
|
|
|
{
|
|
|
- label: '租户名称',
|
|
|
+ label: '名称',
|
|
|
field: 'name',
|
|
|
component: 'Input',
|
|
|
componentProps: {
|
|
|
- placeholder: '请输入租户名称',
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- label: '租户类型',
|
|
|
- field: 'type',
|
|
|
- component: 'ApiSelect',
|
|
|
- componentProps: {
|
|
|
- api: listDictModel,
|
|
|
- params: {
|
|
|
- dictCode: 'sys_create_type',
|
|
|
- },
|
|
|
+ placeholder: '请输入名称',
|
|
|
},
|
|
|
},
|
|
|
- {
|
|
|
- label: '租户状态',
|
|
|
+ // {
|
|
|
+ // label: '类型',
|
|
|
+ // field: 'type',
|
|
|
+ // component: 'ApiSelect',
|
|
|
+ // componentProps: {
|
|
|
+ // api: listDictModel,
|
|
|
+ // params: {
|
|
|
+ // dictCode: 'sys_create_type',
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ label: '状态',
|
|
|
field: 'disable',
|
|
|
component: 'ApiSelect',
|
|
|
componentProps: {
|
|
|
@@ -73,126 +71,145 @@ export const searchFormSchema: FormSchema[] = [
|
|
|
// 表单新增编辑
|
|
|
export const dataFormSchema: FormSchema[] = [
|
|
|
{
|
|
|
- label: '租户名称',
|
|
|
+ label: '名称',
|
|
|
field: 'name',
|
|
|
required: true,
|
|
|
component: 'Input',
|
|
|
componentProps: {
|
|
|
- placeholder: '请输入租户名称',
|
|
|
+ placeholder: '请输入名称',
|
|
|
},
|
|
|
},
|
|
|
- {
|
|
|
- label: '租户联系人',
|
|
|
+ // 类型是否可以修改待定
|
|
|
+ // {
|
|
|
+ // label: '类型',
|
|
|
+ // field: 'type',
|
|
|
+ // component: 'ApiRadioGroup',
|
|
|
+ // componentProps: {
|
|
|
+ // api: listDictModel,
|
|
|
+ // params: {
|
|
|
+ // dictCode: 'sys_create_type',
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ label: '联系人',
|
|
|
field: 'contractUser',
|
|
|
required: true,
|
|
|
component: 'Input',
|
|
|
componentProps: {
|
|
|
- placeholder: '请输入租户联系人',
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- label: '租户类型',
|
|
|
- field: 'type',
|
|
|
- component: 'ApiRadioGroup',
|
|
|
- componentProps: {
|
|
|
- api: listDictModel,
|
|
|
- params: {
|
|
|
- dictCode: 'sys_create_type',
|
|
|
- },
|
|
|
+ placeholder: '请输入联系人',
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- label: '租户联系人电话',
|
|
|
+ label: '联系人电话',
|
|
|
field: 'contactMobile',
|
|
|
required: true,
|
|
|
component: 'Input',
|
|
|
componentProps: {
|
|
|
- placeholder: '请输入租户联系人电话',
|
|
|
+ placeholder: '请输入联系人电话',
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- label: '租户所属用户id',
|
|
|
- field: 'tenantUserId',
|
|
|
- required: true,
|
|
|
+ label: '管理账号',
|
|
|
+ field: 'username',
|
|
|
component: 'Input',
|
|
|
componentProps: {
|
|
|
- placeholder: '请输入租户所属用户id',
|
|
|
+ placeholder: '请输入管理账号',
|
|
|
+ disabled: false,
|
|
|
},
|
|
|
- },
|
|
|
- {
|
|
|
- label: '租户套餐id',
|
|
|
- field: 'packageId',
|
|
|
- required: true,
|
|
|
- component: 'Input',
|
|
|
- componentProps: {
|
|
|
- placeholder: '请输入租户套餐id',
|
|
|
+ dynamicRules: () => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ validator: async (_, value) => {
|
|
|
+ if (!value) {
|
|
|
+ return Promise.reject('管理账号不能为空');
|
|
|
+ }
|
|
|
+ await validatorUsername({ username: value }).then(res => {
|
|
|
+ if (res != 1) {
|
|
|
+ return Promise.reject('管理账号不可用,请重新输入!');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return Promise.resolve();
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- label: '租户备注',
|
|
|
- field: 'remark',
|
|
|
+ label: '套餐',
|
|
|
+ field: 'packageId',
|
|
|
required: true,
|
|
|
- component: 'Input',
|
|
|
- componentProps: {
|
|
|
- placeholder: '请输入租户备注',
|
|
|
+ component: 'ApiSelect',
|
|
|
+ componentProps: () => {
|
|
|
+ return {
|
|
|
+ placeholder: '请选择套餐',
|
|
|
+ api: sysTenantPackageQueryPage,
|
|
|
+ params: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 999,
|
|
|
+ disable: '0',
|
|
|
+ },
|
|
|
+ mode: 'single',
|
|
|
+ labelField: 'packageName',
|
|
|
+ valueField: 'id',
|
|
|
+ resultField: 'data',
|
|
|
+ };
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- label: '租户状态',
|
|
|
+ label: '状态',
|
|
|
field: 'disable',
|
|
|
- component: 'ApiSelect',
|
|
|
+ component: 'ApiRadioGroup',
|
|
|
componentProps: {
|
|
|
api: listDictModel,
|
|
|
params: {
|
|
|
dictCode: 'sys_disable_type',
|
|
|
},
|
|
|
},
|
|
|
+ defaultValue: '0',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '备注',
|
|
|
+ field: 'remark',
|
|
|
+ component: 'InputTextArea',
|
|
|
+ componentProps: {
|
|
|
+ placeholder: '请输入备注',
|
|
|
+ },
|
|
|
},
|
|
|
];
|
|
|
// 表单详情查看
|
|
|
export const viewSchema: DescItem[] = [
|
|
|
{
|
|
|
- label: '租户id',
|
|
|
- field: 'id',
|
|
|
- },
|
|
|
- {
|
|
|
- label: '租户名称',
|
|
|
+ label: '名称',
|
|
|
field: 'name',
|
|
|
},
|
|
|
{
|
|
|
- label: '租户联系人',
|
|
|
- field: 'contractUser',
|
|
|
- },
|
|
|
- {
|
|
|
- label: '租户类型',
|
|
|
+ label: '类型',
|
|
|
field: 'type',
|
|
|
},
|
|
|
{
|
|
|
- label: '租户联系人电话',
|
|
|
- field: 'contactMobile',
|
|
|
+ label: '联系人',
|
|
|
+ field: 'contractUser',
|
|
|
},
|
|
|
{
|
|
|
- label: '租户所属用户id',
|
|
|
- field: 'tenantUserId',
|
|
|
+ label: '联系人电话',
|
|
|
+ field: 'contactMobile',
|
|
|
},
|
|
|
{
|
|
|
- label: '租户套餐id',
|
|
|
- field: 'packageId',
|
|
|
+ label: '管理账号',
|
|
|
+ field: 'username',
|
|
|
},
|
|
|
{
|
|
|
- label: '租户备注',
|
|
|
- field: 'remark',
|
|
|
+ label: '套餐',
|
|
|
+ field: 'packageName',
|
|
|
},
|
|
|
{
|
|
|
- label: '租户状态',
|
|
|
+ label: '状态',
|
|
|
field: 'disable',
|
|
|
},
|
|
|
{
|
|
|
- label: '创建时间',
|
|
|
- field: 'createTime',
|
|
|
- },
|
|
|
- {
|
|
|
- label: '更新时间',
|
|
|
- field: 'updateTime',
|
|
|
+ label: '备注',
|
|
|
+ field: 'remark',
|
|
|
},
|
|
|
];
|