|
@@ -0,0 +1,71 @@
|
|
|
+<template>
|
|
|
+ <el-dialog v-model="visibleDialog" title="表单详情" @close="handleCancel" style="z-index: 99">
|
|
|
+ <div>
|
|
|
+ <er-form-preview ref="EReditorRef" :file-upload-u-r-i="uploadFileApi" :is-show-complete-button="false" />
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { computed, ref } from 'vue'
|
|
|
+import formTemplate from '@/api/flow/formtemplate'
|
|
|
+import { erFormPreview } from '@ER/formEditor'
|
|
|
+
|
|
|
+// 同步值
|
|
|
+const $myEmit = defineEmits(['update:modelValue'])
|
|
|
+
|
|
|
+const myProps = defineProps({
|
|
|
+ modelValue: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
+ templateId: {
|
|
|
+ type: String,
|
|
|
+ default: null
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+const formOptions = ref({})
|
|
|
+const EReditorRef = ref()
|
|
|
+const { VITE_APP_BASE_API } = import.meta.env
|
|
|
+const uploadFileApi = ref(`${VITE_APP_BASE_API}/v1/oss/upload`)
|
|
|
+
|
|
|
+const handleCancel = () => {
|
|
|
+ $myEmit('update:modelValue', false)
|
|
|
+}
|
|
|
+
|
|
|
+const getMessageInfoDetail = async () => {
|
|
|
+ const { templateId } = myProps
|
|
|
+ const res = await formTemplate.formTemplateDetailApi(templateId)
|
|
|
+ // EReditorRef.value.setData(newFormStructure, formData)
|
|
|
+ console.log(res)
|
|
|
+ // formOptions.value = res.content
|
|
|
+}
|
|
|
+
|
|
|
+getMessageInfoDetail()
|
|
|
+
|
|
|
+// computed
|
|
|
+const visibleDialog = computed({
|
|
|
+ get() {
|
|
|
+ return myProps.modelValue
|
|
|
+ },
|
|
|
+ set(val) {
|
|
|
+ $myEmit('update:modelValue', val)
|
|
|
+ }
|
|
|
+})
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped lang="scss">
|
|
|
+.content-title {
|
|
|
+ overflow: hidden;
|
|
|
+ color: #000000d9;
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 16px;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ &.mbt20 {
|
|
|
+ margin-top: 20px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|