

<script>
/* eslint-disable */
// sd-skip-auto-import
import TableColumnTypes from"@/common/services/table-column-types";import TableActionTypes from"@/common/services/table-action-types";import components from"./_import-components/sd-form-template-list-import";var _render=function e(){var t=this,r=t._self._c;return r("div",{class:t.$style.wrap},[r("div",{class:t.$style.lefttree},[r("sd-form-template-catetree",{attrs:{"root-type":"TEMP_MANAGE_SHOW"},on:{treeSelect:t.treeSelect}})],1),r("div",{class:t.$style.rightcontent},[r("a-card",[t.parent?r("sd-data-table-ex",{ref:"dataTable",attrs:{"form-id":"onlFormTemplet","page-id":"online/templet/onlFormTemplet",columns:t.columns,actions:t.actions,"show-selection":()=>t.parent.edit,"filter-expressions":t.expressions,"search-fields":["templetName"]},on:{detailModalShow:t.detailModalShow,formBtnClick:t.formBtnClick},scopedSlots:t._u([{key:"form",fn:function({model:e,fields:a}){return[r("sd-form-item",{attrs:{name:"templetName"}}),r("sd-form-item",{attrs:{name:"templetCategory",hidden:"","input-props":{defaultValue:t.parent?t.parent.id:""}}}),r("a-form-model-item",{attrs:{label:"模板分类",prop:"templetCategory",rules:[{required:true}]}},[r("sd-form-template-cate-picker",{attrs:{"read-only":a.templetCategory.readonly},on:{change:t.categoryChange},model:{value:t.parentSel,callback:function(e){t.parentSel=e},expression:"parentSel"}})],1),r("sd-form-item",{attrs:{name:"fieldsArray",hidden:""}})]}},{key:"actions",fn:function(e,a){return r("a",{on:{click:function(e){return t.formDesign(a)}}},[t._v(t._s(t.parent.edit?"模板设计":"预览"))])}}],null,false,3645354847)}):t._e()],1)],1),r("sd-form-template-preview",{ref:"preview"})],1)};var staticRenderFns=[];_render._withStripped=true;export default{name:"SdFormTemplateList",metaInfo:{title:"模板管理"},components:components,data(){return{columns:[{title:"模板名称",dataIndex:"templetName",sdClickable:true},{title:"创建人",dataIndex:"creatorName"},{title:"创建时间",dataIndex:"creationTime",defaultSortOrder:"descend",sdRender:TableColumnTypes.dateTime},{title:"操作",dataIndex:"actions",scopedSlots:{customRender:"actions"}}],actions:[{label:"删除",id:"delete",permission:null,type:TableActionTypes.ex.delete}],parent:null,parentSel:[]}},computed:{expressions(){return this.parent?[{dataType:"str",name:"templetCategory",op:"eq",stringValue:this.parent.id}]:[]}},methods:{formDesign(e){if(this.parent.edit){const{href:t}=this.$router.resolve({path:`/sd-form-template-designer/${e.id}`});window.open(t,"_blank")}else this.$refs.preview.showPreView(e)},treeSelect(e){this.parent=e;this.parentSel=[this.parent]},categoryChange(){this.$refs.dataTable.getDetailModal().setFieldValue("templetCategory",this.parentSel[0]?.id)},detailModalShow(){this.parentSel=[this.parent]},formBtnClick(e,t,{form:r,recordId:a}){if("save"===t.buttonId)r.setFieldValue("fieldsArray","")}},render:_render,staticRenderFns:staticRenderFns};</script>

<style module lang="scss">
@use '@/common/design' as *;
.wrap {
  display: flex;
  min-height: 100%;
}
.lefttree {
  width: 20%;
  min-width: 150px;
  min-height: 100%;
  margin-right: $padding-lg;
  overflow: auto;
  :global(.ant-card) {
    min-height: 100%;
  }
}
.rightcontent {
  width: calc(80% - #{$padding-lg});
  min-height: 100%;
  overflow-y: auto;
  :global(.ant-card) {
    min-height: 100%;
  }
}
</style>
