

<script>
/* eslint-disable */
// sd-skip-auto-import
import render from"../sd-component-render.vue";import{markMergedCell}from"./table-layout/table-util";import components from"./_import-components/sd-table-layout-render-import";import SdCellText from"./table-layout/sd-cell-text.vue";export function processChildren(e,t){e.data.forEach((e=>{e.forEach((e=>{const r=e.content[0];if(r?.attrFD)t(r)}))}))}var _render=function e(){var t=this,r=t._self._c;return r("table",{class:t.$style.table},[r("colgroup",t._l(t.field.def,(function(e,t){return r("col",{key:t,attrs:{width:e.width+"%"}})})),0),t._l(t.tableDataRender,(function(e,n){return r("tr",{key:n},[t._l(e,(function(e,a){return[!e.hidden?r("td",{directives:[{name:"show",rawName:"v-show",value:!t.formItemHidden[n][a],expression:"!formItemHidden[i][j]"}],key:a,style:e.style,attrs:{rowspan:e.rowspan?e.rowspan+1:void 0,colspan:e.colspan?e.colspan+1:void 0}},[e.content[0]?r("render",{attrs:{field:e.content[0]},on:{hiddenChange:e=>t.hiddenChange(n,a,e)}}):e.text?r("SdCellText",{class:{[t.$style.text]:true},attrs:{value:e.text}}):t._e()],1):t._e()]}))],2)}))],2)};var staticRenderFns=[];_render._withStripped=true;export default{name:"SdTableLayoutRender",components:{render:render,SdCellText:SdCellText,...components},props:{field:{type:Object,required:true}},data(){const e=[];this.field.data.forEach((t=>{const r=[];t.forEach((e=>{r.push(false)}));e.push(r)}));return{formItemHidden:e}},computed:{tableDataRender(){return markMergedCell(this.field.data)}},methods:{hiddenChange(e,t,r){const n=this.tableDataRender[e][t];if(n.colspan!==this.tableDataRender[e].length-1)return;this.$set(this.formItemHidden[e],t,r)}},render:_render,staticRenderFns:staticRenderFns};</script>

<style module lang="scss">
@use '@/common/design' as *;
.table {
  width: 100%;
  table-layout: fixed;
  td {
    padding: 0 5px;
    border-right: 1px solid $border-color-split;
    border-bottom: 1px solid $border-color-split;
  }
  colgroup + tr td {
    border-top: 1px solid $border-color-split;
  }
  tr {
    td:first-child {
      border-left: 1px solid $border-color-split;
    }
  }
  :global .ant-form-item {
    margin-bottom: 0;
  }
}
.text {
  padding: 8px 0;
}
</style>
