fix some bug
This commit is contained in:
parent
a098d3056c
commit
0012a697cb
@ -90,6 +90,7 @@ const rules = {
|
|||||||
type Props = {
|
type Props = {
|
||||||
domain: Domain
|
domain: Domain
|
||||||
show: boolean
|
show: boolean
|
||||||
|
'onUpdate:show': (v: boolean) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
type Events = {
|
type Events = {
|
||||||
@ -202,7 +203,7 @@ function modalActions({ domain }: Props, { emit }: SetupContext<Events>) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function DomainEditModal({ domain, show }: Props, { emit }: SetupContext<Events>) {
|
function DomainEditModal({ domain, show, }: Props, { emit }: SetupContext<Events>) {
|
||||||
return (
|
return (
|
||||||
<NModal maskClosable={false} show={show}>
|
<NModal maskClosable={false} show={show}>
|
||||||
<NCard style={{ width: '640px' }} role='dialog'>
|
<NCard style={{ width: '640px' }} role='dialog'>
|
||||||
|
@ -8,6 +8,8 @@ const { t } = i18n.global
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
domain: Domain
|
domain: Domain
|
||||||
|
onRemoveDomain: (d: Domain) => void
|
||||||
|
onEditDomain: (d: Domain) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
type Events = {
|
type Events = {
|
||||||
|
@ -14,6 +14,7 @@ const { notification } = createDiscreteApi(['notification'])
|
|||||||
type Props = {
|
type Props = {
|
||||||
domain: Domain
|
domain: Domain
|
||||||
show: boolean
|
show: boolean
|
||||||
|
'onUpdate:show': (value: boolean) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
type Events = {
|
type Events = {
|
||||||
|
@ -45,6 +45,8 @@ type Props = {
|
|||||||
record: Record
|
record: Record
|
||||||
domain: string
|
domain: string
|
||||||
show: boolean
|
show: boolean
|
||||||
|
'onReloadRecords': () => void
|
||||||
|
'onUpdate:show': (v: boolean) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
type Events = {
|
type Events = {
|
||||||
@ -273,7 +275,7 @@ function buildRules(record: Record): FormRules {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function confirm({ record, domain }: Props) {
|
async function confirm(record: Record, domain: string) {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
if (!record.id || record.id < 1) {
|
if (!record.id || record.id < 1) {
|
||||||
@ -292,7 +294,7 @@ async function confirm({ record, domain }: Props) {
|
|||||||
function modalHeader({ record }: Props) {
|
function modalHeader({ record }: Props) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{(!record || !record.id || record.id < 1) ? <span>{t('common.new')}</span> : <span> t('common.edit')</span>}
|
{(!record || !record.id || record.id < 1) ? <span>{t('common.new')}</span> : <span> {t('common.edit')}</span>}
|
||||||
<span>{t('records._')}</span>
|
<span>{t('records._')}</span>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
@ -310,7 +312,7 @@ function modalActions({ record, domain }: Props, { emit }: SetupContext<Events>)
|
|||||||
|
|
||||||
<NButton size='small' type='primary' loading={loading.value} attrType='submit'
|
<NButton size='small' type='primary' loading={loading.value} attrType='submit'
|
||||||
disabled={invalidData.value !== (validationFlags.content | validationFlags.name)}
|
disabled={invalidData.value !== (validationFlags.content | validationFlags.name)}
|
||||||
onClick={() => confirm({ record, domain, show: false }).then(() => { emit('reloadRecords'); emit('update:show', false) })}>
|
onClick={() => confirm(record, domain).then(() => { emit('reloadRecords'); emit('update:show', false) })}>
|
||||||
{{
|
{{
|
||||||
icon: () => <NIcon component={Check} />,
|
icon: () => <NIcon component={Check} />,
|
||||||
default: () => t('common.confirm')
|
default: () => t('common.confirm')
|
||||||
|
@ -8,6 +8,8 @@ const { t } = i18n.global
|
|||||||
type Props = {
|
type Props = {
|
||||||
record: Record
|
record: Record
|
||||||
domain: string
|
domain: string
|
||||||
|
onRecordDelete: (domain: string, record: Record) => void
|
||||||
|
onEditRecord: (domain: string, record: Record) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
type Events = {
|
type Events = {
|
||||||
|
Loading…
Reference in New Issue
Block a user