|
|
@ -6,7 +6,7 @@ import { uiTypes } from '~/utils/columnUtils' |
|
|
|
import MdiPlusIcon from '~icons/mdi/plus-circle-outline' |
|
|
|
import MdiPlusIcon from '~icons/mdi/plus-circle-outline' |
|
|
|
import MdiMinusIcon from '~icons/mdi/minus-circle-outline' |
|
|
|
import MdiMinusIcon from '~icons/mdi/minus-circle-outline' |
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['cancel']) |
|
|
|
const emit = defineEmits(['cancel', 'submit']) |
|
|
|
const meta = inject(MetaInj) |
|
|
|
const meta = inject(MetaInj) |
|
|
|
const advancedOptions = ref(false) |
|
|
|
const advancedOptions = ref(false) |
|
|
|
const { getMeta } = useMetas() |
|
|
|
const { getMeta } = useMetas() |
|
|
@ -39,9 +39,20 @@ const uiTypesOptions = computed<typeof uiTypes>(() => { |
|
|
|
] |
|
|
|
] |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const reloadMeta = () => { |
|
|
|
const reloadMeta = async () => { |
|
|
|
|
|
|
|
// FIXME: this not working |
|
|
|
|
|
|
|
console.log('HEREEEE') |
|
|
|
emit('cancel') |
|
|
|
emit('cancel') |
|
|
|
getMeta(meta?.value.id as string, true) |
|
|
|
await getMeta(meta?.value.id as string, true) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function handleSubmit() { |
|
|
|
|
|
|
|
// FIXME: await addOrUpdate(reloadMeta) |
|
|
|
|
|
|
|
await addOrUpdate() |
|
|
|
|
|
|
|
await reloadMeta() |
|
|
|
|
|
|
|
// FIXME: emit fails |
|
|
|
|
|
|
|
emit('submit') |
|
|
|
|
|
|
|
advancedOptions.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// create column meta if it's a new column |
|
|
|
// create column meta if it's a new column |
|
|
@ -125,7 +136,7 @@ watchEffect(() => { |
|
|
|
<!-- Cancel --> |
|
|
|
<!-- Cancel --> |
|
|
|
{{ $t('general.cancel') }} |
|
|
|
{{ $t('general.cancel') }} |
|
|
|
</a-button> |
|
|
|
</a-button> |
|
|
|
<a-button html-type="submit" type="primary" size="small" @click="addOrUpdate(reloadMeta), (advancedOptions = false)"> |
|
|
|
<a-button html-type="submit" type="primary" size="small" @click="handleSubmit"> |
|
|
|
<!-- Save --> |
|
|
|
<!-- Save --> |
|
|
|
{{ $t('general.save') }} |
|
|
|
{{ $t('general.save') }} |
|
|
|
</a-button> |
|
|
|
</a-button> |
|
|
|