初始版本提交

This commit is contained in:
yaoyn
2024-02-05 09:15:37 +08:00
parent b52d4414be
commit 445292105f
1848 changed files with 236859 additions and 75 deletions

View File

@ -0,0 +1,44 @@
<template>
<div>
<BasicModal @register="registerModal" v-bind="$attrs" title="预览">
<SimpleForm
ref="formRef"
:key="show"
:formProps="state.formProps"
:formModel="state.formModel"
/>
</BasicModal>
</div>
</template>
<script lang="ts" setup>
import { reactive, ref, provide } from 'vue';
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { buildOption } from '/@/utils/helper/designHelper';
const state = reactive({
formProps: {},
formModel: {},
});
provide<boolean>('isCustomForm', true);
const show = ref(1);
const formRef = ref();
const [registerModal, { setModalProps }] = useModalInner(async (data) => {
state.formProps = buildOption(JSON.parse(data.formJson).formJson, false);
show.value += 1;
await formRef.value.setDefaultValue();
formRef.value.resetFields();
setModalProps({
confirmLoading: false,
draggable: false,
title: data.title,
destroyOnClose: true,
showOkBtn: false,
showCancelBtn: false,
width: 800,
});
});
</script>