

<script>
/* eslint-disable */
// sd-skip-auto-import
import util from"./util";import components from"./_import-components/sd-preview-btn-import";var _render=function e(){var t=this,r=t._self._c;return r("span",[r("a-button",{attrs:{icon:"desktop",type:"link"},on:{click:t.preview}},[t._v("PC端预览"),!t.layoutable?r("span",[t._v("/主题切换")]):t._e()]),r("a-modal",{attrs:{footer:null,"destroy-on-close":"","dialog-class":t.$style.preview,width:"100%",closable:false},model:{value:t.showPreview,callback:function(e){t.showPreview=e},expression:"showPreview"}},[r("sd-render",{attrs:{fields:t.formData.fields,"form-props":t.formData.head},on:{close:function(e){t.showPreview=false},themeChange:t.themeChange}})],1)],1)};var staticRenderFns=[];_render._withStripped=true;export default{name:"SdPreviewBtn",components:components,mixins:[util.mixin],data(){return{showPreview:false,formData:{}}},methods:{preview(){util.getPreviewData(this.designer.componentInstancesWithHiddenFlag,this.formProps).then((e=>{this.formData=e;this.showPreview=true}))},themeChange(e){this.formProps.attrFD.theme=e}},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>
