|
|
@ -19,12 +19,14 @@ import { defineComponent, onMounted, PropType, toRefs, watch } from 'vue' |
|
|
|
import Modal from '@/components/modal' |
|
|
|
import Modal from '@/components/modal' |
|
|
|
import { NForm, NFormItem, NInput, NSelect } from 'naive-ui' |
|
|
|
import { NForm, NFormItem, NInput, NSelect } from 'naive-ui' |
|
|
|
import { useModalData } from './use-modalData' |
|
|
|
import { useModalData } from './use-modalData' |
|
|
|
|
|
|
|
import { useI18n } from 'vue-i18n' |
|
|
|
|
|
|
|
|
|
|
|
const TenantModal = defineComponent({ |
|
|
|
const TenantModal = defineComponent({ |
|
|
|
name: 'tenant-modal', |
|
|
|
name: 'tenant-modal', |
|
|
|
emits: ['cancelModal', 'confirmModal'], |
|
|
|
emits: ['cancelModal', 'confirmModal'], |
|
|
|
setup(props, ctx) { |
|
|
|
setup(props, ctx) { |
|
|
|
const { variables, getListData, handleValidate} = useModalData(props, ctx) |
|
|
|
const { variables, getListData, handleValidate} = useModalData(props, ctx) |
|
|
|
|
|
|
|
const { t } = useI18n() |
|
|
|
|
|
|
|
|
|
|
|
const cancelModal = () => { |
|
|
|
const cancelModal = () => { |
|
|
|
if (props.statusRef === 0) { |
|
|
|
if (props.statusRef === 0) { |
|
|
@ -49,7 +51,7 @@ const TenantModal = defineComponent({ |
|
|
|
variables.model.description = props.row.description |
|
|
|
variables.model.description = props.row.description |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
return { ...toRefs(variables), cancelModal, confirmModal } |
|
|
|
return { t, ...toRefs(variables), cancelModal, confirmModal } |
|
|
|
}, |
|
|
|
}, |
|
|
|
props: { |
|
|
|
props: { |
|
|
|
showModalRef: { |
|
|
|
showModalRef: { |
|
|
@ -66,10 +68,11 @@ const TenantModal = defineComponent({ |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
render() { |
|
|
|
render() { |
|
|
|
|
|
|
|
const { t } = this |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<Modal |
|
|
|
<Modal |
|
|
|
title={this.statusRef === 0 ? '创建租户' : '编辑租户'} |
|
|
|
title={this.statusRef === 0 ? t('security.tenant.create_tenant') : t('security.tenant.edit_tenant')} |
|
|
|
show={this.showModalRef} |
|
|
|
show={this.showModalRef} |
|
|
|
onCancel={this.cancelModal} |
|
|
|
onCancel={this.cancelModal} |
|
|
|
onConfirm={this.confirmModal} |
|
|
|
onConfirm={this.confirmModal} |
|
|
@ -86,19 +89,19 @@ const TenantModal = defineComponent({ |
|
|
|
size="small" |
|
|
|
size="small" |
|
|
|
style="{ maxWidth: '240px' }" |
|
|
|
style="{ maxWidth: '240px' }" |
|
|
|
> |
|
|
|
> |
|
|
|
<NFormItem label="操作系统租户" path="tenantCode"> |
|
|
|
<NFormItem label={t('security.tenant.tenantCode')} path="tenantCode"> |
|
|
|
<NInput disabled={this.statusRef === 1} placeholder="请输入操作系统租户" v-model={[this.model.tenantCode, 'value']} /> |
|
|
|
<NInput disabled={this.statusRef === 1} placeholder={t('security.tenant.tenantCode_tips')} v-model={[this.model.tenantCode, 'value']} /> |
|
|
|
</NFormItem> |
|
|
|
</NFormItem> |
|
|
|
<NFormItem label="队列" path="queueId"> |
|
|
|
<NFormItem label={t('security.tenant.queueName')} path="queueId"> |
|
|
|
<NSelect |
|
|
|
<NSelect |
|
|
|
placeholder="Select" |
|
|
|
placeholder={t('security.tenant.queueName_tips')} |
|
|
|
options={this.model.generalOptions} |
|
|
|
options={this.model.generalOptions} |
|
|
|
v-model={[this.model.queueId, 'value']} |
|
|
|
v-model={[this.model.queueId, 'value']} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</NFormItem> |
|
|
|
</NFormItem> |
|
|
|
<NFormItem label="描述" path="description"> |
|
|
|
<NFormItem label={t('security.tenant.description')} path="description"> |
|
|
|
<NInput |
|
|
|
<NInput |
|
|
|
placeholder="请输入描述" |
|
|
|
placeholder={t('security.tenant.description_tips')} |
|
|
|
v-model={[this.model.description, 'value']} |
|
|
|
v-model={[this.model.description, 'value']} |
|
|
|
type="textarea" |
|
|
|
type="textarea" |
|
|
|
/> |
|
|
|
/> |