|
|
@ -9,6 +9,8 @@ import { BasicColumn } from '/@/components/Table'; |
|
|
|
import { FormSchema } from '/@/components/Table'; |
|
|
|
import { FormSchema } from '/@/components/Table'; |
|
|
|
import { h } from 'vue'; |
|
|
|
import { h } from 'vue'; |
|
|
|
import { Tag } from 'ant-design-vue'; |
|
|
|
import { Tag } from 'ant-design-vue'; |
|
|
|
|
|
|
|
import { listTenant } from '/@/api/platform/system/controller/tenant'; |
|
|
|
|
|
|
|
import { isEmpty } from '/@/utils/is'; |
|
|
|
|
|
|
|
|
|
|
|
/** 表格列配置 */ |
|
|
|
/** 表格列配置 */ |
|
|
|
export const columns: BasicColumn[] = [ |
|
|
|
export const columns: BasicColumn[] = [ |
|
|
@ -106,7 +108,22 @@ export const formSchema: FormSchema[] = [ |
|
|
|
field: 'code', |
|
|
|
field: 'code', |
|
|
|
label: '多租户编码', |
|
|
|
label: '多租户编码', |
|
|
|
component: 'Input', |
|
|
|
component: 'Input', |
|
|
|
required: true, |
|
|
|
rules: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
required: true, |
|
|
|
|
|
|
|
whitespace: true, |
|
|
|
|
|
|
|
message: '请输入多租户编码', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
validator: async (rule, value) => { |
|
|
|
|
|
|
|
if (!isEmpty(value)) { |
|
|
|
|
|
|
|
const result = await listTenant({ code: value }); |
|
|
|
|
|
|
|
if(result.data?.length > 0) return Promise.reject('该多租户编码已存在'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return Promise.resolve(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
validateTrigger: 'blur' |
|
|
|
|
|
|
|
}], |
|
|
|
colProps: { |
|
|
|
colProps: { |
|
|
|
span: 12 |
|
|
|
span: 12 |
|
|
|
} |
|
|
|
} |
|
|
|