diff --git a/resources/jscomposition/cases/casesDetail/components/DisplayForm.vue b/resources/jscomposition/cases/casesDetail/components/DisplayForm.vue index 7c398ab629..19e96b3c51 100644 --- a/resources/jscomposition/cases/casesDetail/components/DisplayForm.vue +++ b/resources/jscomposition/cases/casesDetail/components/DisplayForm.vue @@ -7,34 +7,40 @@ tw-float-end tw-absolute tw-right-4 tw-top-4 tw-font-semibold tw-text-gray-500 tw-shadow-sm tw-ring-1 tw-ring-gray-300 hover:tw-bg-gray-50 tw-gap-2" - @click="onPrint"> + @click="onPrint" + > + mode="in-out" + >
+ tw-absolute tw-left-0 tw-top-0 tw-z-10 tw-justify-center tw-items-center" + >
+ mode="in-out" + >
+ class="tw-pointer-events-none" + > + :show-errors="true" + />
@@ -54,8 +60,34 @@ const props = defineProps({ const previewData = computed(() => props.data.taskData); const screen = ref(null); +const configScreen = ref({}); const showPlaceholder = ref(false); +const disableForm = (screenConfig) => { + if (screenConfig instanceof Array) { + for (let i = screenConfig.length - 1; i >= 0; i -= 1) { + if ( + screenConfig[i].component === "FormButton" + || screenConfig[i].component === "FileUpload" + || screenConfig[i].component === "PhotoVideo" + ) { + screenConfig.splice(i, 1); + } else { + disableForm(screenConfig[i]); + } + } + } + if (screenConfig.config !== undefined) { + screenConfig.config.disabled = true; + screenConfig.config.readonly = true; + screenConfig.config.editable = false; + } + if (screenConfig.items !== undefined) { + disableForm(screenConfig.items); + } + return screenConfig; +}; + const getScreen = async (screenId) => { showPlaceholder.value = true; @@ -66,6 +98,7 @@ const getScreen = async (screenId) => { if (response.data) { screen.value = response.data; + configScreen.value = disableForm(screen.value.config); } }, 300); };