

<script>
/* eslint-disable */
// sd-skip-auto-import
import{Message}from"ant-design-vue";import webflow from"@/webflow/sd-webflow.vue";import runtimeUtil from"./runtime-util";import util from"./util";import components from"./_import-components/sd-render-import";var _render=function t(){var e=this,r=e._self._c;return r("div",{class:[e.$style.wrapper,"sd-form-theme",e.formProps.attrFD.theme]},[!e.formProps.attrFD.layoutable?r("div",{class:e.$style.themeSwitch},[e._v(" 主题样式： "),r("a-radio-group",{on:{change:e.themeChange},model:{value:e.formProps.attrFD.theme,callback:function(t){e.$set(e.formProps.attrFD,"theme",t)},expression:"formProps.attrFD.theme"}},e._l(e.themes,(function(t){return r("a-radio-button",{key:t.id,attrs:{value:t.id}},[e._v(" "+e._s(t.name)+" ")])})),1)],1):e._e(),r("sd-webflow",{ref:"webflow",attrs:{"flow-data":e.flowData,"header-buttons":["closePreview"],"submit-buttons":["fakeSubmit"],"button-icons":{closePreview:"close-circle"},"removed-tabs":["sdFlowchart"]},on:{actionBtnClick:e.actionBtnClick},scopedSlots:e._u([{key:"form",fn:function(){return[r("sd-form-by-builder",{attrs:{"form-data":e.flowData.processFormData}})]},proxy:true}])})],1)};var staticRenderFns=[];_render._withStripped=true;export default{name:"SdRender",components:{[webflow.name]:webflow,...components},props:{fields:{type:Array,required:true},formProps:{type:Object,required:true}},data(){return{themes:util.getThemes()}},computed:{flowData(){return{pageTitle:this.formProps.tableTxt,processFormData:{processFormPropertyValues:this.fields,attrFD:this.formProps.attrFD,attr:this.formProps.attr},attrs:{auditElement:[]},buttons:[{buttonId:"fakeButton",buttonName:"关注"},{buttonId:"fakeButton2",buttonName:"保存"},{buttonId:"closePreview",buttonName:"关闭预览窗口"},{buttonId:"fakeSubmit",buttonName:"部门领导审批"}],saveButtons:[],pushButtons:[],processActiveLogInfo:[]}}},methods:{actionBtnClick(t,{button:e}){switch(e.buttonId){case"closePreview":this.$emit("close");break;default:this.$refs.webflow.validateFields().then((t=>{if(t)Message.info("此按钮仅供查看视觉效果，并没有实际的功能")}));break}},themeChange(t){const e=t.target.value;runtimeUtil.loadTheme(e);this.$emit("themeChange",e)}},render:_render,staticRenderFns:staticRenderFns};</script>

<style module lang="scss">
@use '@/common/design' as *;
.wrapper {
  // 预览时禁止上传文件
  [class*='sd-attachment'] {
    pointer-events: none;
  }
  .theme-switch {
    position: absolute;
    right: 180px;
    left: 0;
    z-index: 10;
    margin-top: 15px;
    color: $text-color-inverse;
    text-align: center;
    :global(.ant-radio-button-wrapper-checked) {
      border-color: $text-color-inverse;
    }
    :global(.ant-radio-button-wrapper:not(.ant-radio-button-wrapper-checked)) {
      color: $text-color-inverse;
      background-color: transparent;
    }
  }
}
</style>
