

<script>
/* eslint-disable */
// sd-skip-auto-import
import formulas from"./formula";import util from"./util";import components from"./_import-components/sd-form-props-import";var _render=function t(){var o=this,r=o._self._c;return r("a-form-model",{class:o.$style.wrapper,attrs:{layout:"vertical",model:o.formProps},on:{validate:o.onValidate}},[r("a-form-model-item",{attrs:{prop:"tableTxt",rules:[{required:true}]}},[r("sd-complex-label",{attrs:{slot:"label"},slot:"label"},[o._v(" 标题 "),r("a-checkbox",{attrs:{slot:"right"},slot:"right",model:{value:o.formProps.attrFD.hideTableTxt,callback:function(t){o.$set(o.formProps.attrFD,"hideTableTxt",t)},expression:"formProps.attrFD.hideTableTxt"}},[o._v("隐藏标题")])],1),r("a-input",{model:{value:o.formProps.tableTxt,callback:function(t){o.$set(o.formProps,"tableTxt","string"===typeof t?t.trim():t)},expression:"formProps.tableTxt"}})],1),r("a-form-model-item",[r("div",{attrs:{slot:"label"},slot:"label"},[o._v(" 模式选择 "),r("a-tooltip",[r("template",{slot:"title"},[o._v(" 基础模式只显示字段中文相关配置，高级模式下会将字段全部配置显示出来 ")]),r("a-icon",{attrs:{type:"question-circle"}})],2)],1),r("a-radio-group",{model:{value:o.formProps.attrFD.devMode,callback:function(t){o.$set(o.formProps.attrFD,"devMode",t)},expression:"formProps.attrFD.devMode"}},[r("a-radio",{attrs:{value:void 0}},[o._v(" 基础模式 ")]),r("a-radio",{attrs:{value:true}},[o._v(" 高级模式 ")])],1)],1),r("a-form-model-item",[r("a-checkbox",{attrs:{slot:"label"},slot:"label",model:{value:o.formProps.attrFD.debugMode,callback:function(t){o.$set(o.formProps.attrFD,"debugMode",t)},expression:"formProps.attrFD.debugMode"}},[o._v("显示隐藏字段 "),r("a-tooltip",[r("template",{slot:"title"},[o._v(" 运行时隐藏字段将显示在表单的最下方，方便开发调试 ")]),r("a-icon",{attrs:{type:"question-circle"}})],2)],1)],1),0===o.formProps.formType&&o.formProps.attrFD.modalProps?r("a-form-model-item",{attrs:{label:"弹框宽度(px)"}},[r("a-input-number",{attrs:{min:0},model:{value:o.formProps.attrFD.modalProps.width,callback:function(t){o.$set(o.formProps.attrFD.modalProps,"width",t)},expression:"formProps.attrFD.modalProps.width"}})],1):o._e(),o.showTableName&&o.devMode?r("a-form-model-item",{attrs:{label:"英文ID",prop:"tableName",rules:[{required:true},{validator:o.checkDbName}]}},[r("a-input",{attrs:{"read-only":o.isPublished},model:{value:o.formProps.tableName,callback:function(t){o.$set(o.formProps,"tableName","string"===typeof t?t.trim():t)},expression:"formProps.tableName"}})],1):o._e(),r("a-form-model-item",{attrs:{label:"表单校验"}},[r("sd-formula",{attrs:{fields:o.componentInstances.concat(o.formulasReservedFields),formulas:o.formulas,"data-type":"boolean"},on:{update:t=>{o.$set(o.formProps.attr.formulaValidator[0],"formula",t);o.$nextTick(o.$refs.message.onFieldBlur)}},model:{value:o.formProps.attr.formulaValidator[0].formulaObject,callback:function(t){o.$set(o.formProps.attr.formulaValidator[0],"formulaObject",t)},expression:"formProps.attr.formulaValidator[0].formulaObject"}})],1),r("a-form-model-item",{ref:"message",attrs:{label:"表单校验提示",rules:[{required:!!o.formProps.attr.formulaValidator[0].formula}],prop:"attr.formulaValidator[0].message"}},[r("a-input",{model:{value:o.formProps.attr.formulaValidator[0].message,callback:function(t){o.$set(o.formProps.attr.formulaValidator[0],"message","string"===typeof t?t.trim():t)},expression:"formProps.attr.formulaValidator[0].message"}})],1),r("a-form-model-item",[r("a-button",{attrs:{slot:"label",type:"link",icon:"sd-notebook"},on:{click:function(t){o.showDescription=true}},slot:"label"},[o._v(" 填写说明 ")])],1),r("a-modal",{attrs:{footer:null,width:"800px",title:"表单填写说明"},model:{value:o.showDescription,callback:function(t){o.showDescription=t},expression:"showDescription"}},[r("sd-quill-editor",{attrs:{options:{placeholder:"可在表单中添加备注说明，帮助用户理解业务"}},model:{value:o.formProps.attrFD.description,callback:function(t){o.$set(o.formProps.attrFD,"description",t)},expression:"formProps.attrFD.description"}})],1)],1)};var staticRenderFns=[];_render._withStripped=true;export default{name:"SdFormProps",components:components,mixins:[util.mixin],props:{showTableName:{type:Boolean,default:true}},data(){return{showDescription:false,validateStatus:{},formulas:[]}},computed:{isValid(){for(const t in this.validateStatus)if(!this.validateStatus[t])return false;return true}},watch:{isValid(t){this.$emit("validate",t)}},created(){if(!this.formProps.attr?.formulaValidator){this.$set(this.formProps,"attr",this.formProps.attr||{});this.$set(this.formProps.attr,"formulaValidator",[{}])}if(!this.formProps.attrFD.modalProps)this.formProps.attrFD.modalProps={};formulas().then((t=>{this.formulas=t}))},methods:{onValidate(t,o){this.$set(this.validateStatus,t,o)},checkDbName(t,o,r){util.checkDbName(o,r)}},render:_render,staticRenderFns:staticRenderFns};</script>

<style module lang="scss">
@use '@/common/design' as *;
.wrapper {
  :global(.ant-form-item-label) > label > div {
    > label:first-child {
      display: inline-block;
      min-width: 50%;
    }
    > label + label {
      margin-left: 0;
    }
  }
  :global(.ant-btn-link) {
    padding: 0;
  }
}
</style>
