

<script>
/* eslint-disable */
// sd-skip-auto-import
import FormService from"@/form-designer/form-service";import util from"../util";import components from"./_import-components/sd-form-template-preview-import";var _render=function e(){var r=this,o=r._self._c;return o("div",[1===r.templetType?o("a-modal",{attrs:{footer:null,"destroy-on-close":"","dialog-class":r.$style.preview,width:"100%",closable:false},model:{value:r.showPreview,callback:function(e){r.showPreview=e},expression:"showPreview"}},[o("sd-render",{attrs:{fields:r.preViewForm.fields,"form-props":r.preViewForm.formProps},on:{close:function(e){r.showPreview=false}}})],1):o("a-modal",{attrs:{width:800,title:r.preViewForm.formProps.tableTxt,"destroy-on-close":"","ok-text":"保存"},on:{ok:r.okClick},model:{value:r.showPreview,callback:function(e){r.showPreview=e},expression:"showPreview"}},[o("sd-non-flow-render",{ref:"render",attrs:{fields:r.preViewForm.fields,"form-props":r.preViewForm.formProps}})],1)],1)};var staticRenderFns=[];_render._withStripped=true;export default{name:"SdFormTemplatePreview",metaInfo:{title:"SdFormTemplatePreview"},components:components,props:{record:{type:Object,default:()=>{}}},data(){return{showPreview:false,preViewForm:{fields:[],formProps:{}},templetType:1}},methods:{showPreView(e){FormService.getFormTemplateData({id:e.id}).then((e=>{this.preViewForm={fields:util.getPreviewFields(e.fields),formProps:{tableTxt:e.templetName,attrFD:e.attrFd}};this.templetType=e.templetType;this.showPreview=true}))}},render:_render,staticRenderFns:staticRenderFns};</script>

<style module lang="scss">
@use '@/common/design' as *;
.preview {
  // antd居中有bug，强制覆盖
  /* stylelint-disable-next-line  */
  top: 0 !important;
  :global(.ant-modal-body) {
    height: 100vh;
    max-height: none;
    padding: 0;
  }
}
</style>
