Files
admin-sjzx/src/components/XnWorkflow/nodes/common/previewCustomForm.vue

42 lines
911 B
Vue
Raw Normal View History

2024-05-06 13:57:06 +08:00
<template>
<a-modal
title="预览"
:width="700"
:visible="visible"
:destroy-on-close="true"
:footer-style="{ textAlign: 'right' }"
:mask="false"
:confirmLoading="confirmLoading"
@ok="onSubmit"
@cancel="onClose"
>
<component ref="customFormRef" :is="customFormsLayouts" />
</a-modal>
</template>
<script setup name="previewCustomForm">
import { ElMessage } from 'element-plus'
import { loadComponent } from '../../customForm'
const visible = ref(false)
const confirmLoading = ref(false)
const customFormRef = ref()
const customFormsLayouts = ref()
const onOpen = (url) => {
if (url) {
visible.value = true
customFormsLayouts.value = loadComponent(url)
}
}
const onSubmit = () => {
customFormRef.value.getData().then((value) => {
message.info(JSON.stringify(value))
})
}
const onClose = () => {
visible.value = false
}
defineExpose({
onOpen
})
</script>