You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.3 KiB
46 lines
1.3 KiB
<template>
|
|
<BasicModal
|
|
@register="registerModal"
|
|
:title="L('Share')"
|
|
@ok="handleSubmit"
|
|
>
|
|
<BasicForm @register="registerForm" />
|
|
</BasicModal>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { nextTick } from 'vue';
|
|
import { useLocalization } from '/@/hooks/abp/useLocalization';
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
import { BasicForm, useForm } from '/@/components/Form';
|
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
|
import { getShareModalSchemas } from './data';
|
|
import { share } from '/@/api/oss-management/private';
|
|
|
|
const { L } = useLocalization(['AbpOssManagement', 'AbpUi']);
|
|
const { createMessage } = useMessage();
|
|
const [registerForm, { validate, resetFields, setFieldsValue }] = useForm({
|
|
labelAlign: 'left',
|
|
labelWidth: 120,
|
|
showActionButtonGroup: false,
|
|
schemas: getShareModalSchemas(),
|
|
});
|
|
const [registerModal, { changeOkLoading, closeModal }] = useModalInner((data) => {
|
|
nextTick(() => {
|
|
resetFields();
|
|
setFieldsValue(data);
|
|
});
|
|
});
|
|
|
|
function handleSubmit() {
|
|
validate().then((input) => {
|
|
changeOkLoading(true);
|
|
share(input).then(() => {
|
|
createMessage.success(L('Successful'));
|
|
closeModal();
|
|
}).finally(() => {
|
|
changeOkLoading(false);
|
|
});
|
|
});
|
|
}
|
|
</script>
|
|
|