<template>
    <div style="width: 100%">
        <div style="text-align: center;font-size: 18px;font-weight: bold; min-height: 45px;line-height: 45px;"
             :style="titleCss" v-if="name && dataSetting.hideShowName != '是'">{{name}}</div>
<!--        <el-divider class="divider-class" v-if="name && dataSetting.hideShowName != '是'"></el-divider>-->
        <table-form-render isGroup :propTableviewsData="tableviewsData" :groupArr="groupArr" v-if="groupArr.length > 0" ref="renderRef"
                           :propFormData="formData" :formOperate="formOperate" :propDataAllObj="dataAllObj" :isEditData="isEditData"
                           :propUploadFkInfo="uploadFkInfo" :propTableviewEventArr="tableviewEventArr"
                           :propConditionEventRuleArr="conditionEventRuleArr" :propNewConditionEventRuleArr="newConditionEventRuleArr"
                           :propNewControlEventObj="newControlEventObj" :propControlEventObj="controlEventObj"
                           :propAddCommentsFields="addCommentsFields" :propRelationId="relationId"
                           :propFieldSysDataObj="fieldSysDataObj" :isFlow="isFlow" :flowFieldStatus="flowFieldStatus"
        >
        </table-form-render>
        <div v-else style="text-align: center;height:100px;line-height:100px">{{'请添加分组内容！'}}</div>
    </div>
</template>

<script>
    export default {
        name: "pl-group",
        props:{
            name:{
                type:String,default:""
            },
            tableviewsData:{
                type:Object,default: () => {
                    return {}
                }
            },
            formData:{
                type:Object,default: () => {
                    return {}
                }
            },
            uploadFkInfo:{
                type:Object,default: () => {
                    return {}
                }
            },
            tableviewEventArr:{
                type:Array,default: () => {
                    return []
                }
            },
            newConditionEventRuleArr:{
                type:Array,default: () => {
                    return []
                }
            },
            fieldSysDataObj:{type:Object,default:() => {return {};}},
            newControlEventObj:{type:Object,default:() => {return {};}},
            controlEventObj:{type:Object,default:() => {return {};}},
            conditionEventRuleArr:{
                type:Array,default: () => {
                    return []
                }
            },
            dataSetting:{
                type:Object,default: () => {
                    return {}
                }
            },
            dataAllObj:{
                type:Object,default: () => {
                    return {}
                }
            },
            flowFieldStatus:{
                type:Object,default: () => {
                    return {}
                }
            },
            groupArr:{
                type:Array,default: () => {
                    return []
                }
            },
            addCommentsFields:{
                type:Array,default: () => {
                    return []
                }
            },
            relationId:{
              type:String,default:""
            },
            formOperate:{
                type:String,default:"add"
            },
            isEditData: {type: Boolean, default: false},//是否可编辑数据
            isFlow: {type: Boolean, default: false},//是否是流程
        },
        data(){
            return {
              titleCss:''
            }
        },
        watch:{
          'dataSetting.colCss'(val){
            if(val){
              this.titleCss=this.dataSetting.colCss
            }
          },
        },
        created() {
          if(this.dataSetting.colCss){
            this.titleCss=this.dataSetting.colCss
          }
        },
        methods:{
            submitComment(){
                this.$refs.renderRef && this.$refs.renderRef.submitComment();
            }
        }
    }
</script>

<style scoped>
    .divider-class{
        color:red;
        margin: 0 0 10px 0;
    }
</style>
