<template>
  <div class="position-re">
    <div>
      <el-breadcrumb separator="/" class="my-breadcrumb">
        <el-breadcrumb-item>委信用信息详情</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="back" @click="$emit('changeOperation','',{})"><span class="fa fa-reply cur-po " >返回</span></div>

    <div class="detail-main">
      <div class="block block-wxy">
        <div class="my-b-title-wxy">基本信息</div>
        <div class="form form-wxy">
          <diy-el-form ref="formRef"  v-model:model-form="forms" :forms="formConfig"/>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import DiyElForm from "@/components/common/DiyElForm.vue";
import {onBeforeMount, ref} from "vue";
import {matterSearchDetailXK,matterSearchDetailYQ,matterSearchDetailCF} from "@/data/all-form";
import {
  getSxListDetails
} from "@/service/credit-information/commission-credit-information-database-search/matter-search/matter-search";
export default {
  name: "MatterSearchEdit",
  components:{
    DiyElForm
  },
  props:{
    currentOpObj:{

    },
    operationType:{

    }
  },
  setup(props,{emit}) {
    const forms = ref({});
    const formRef = ref(null);
    const formConfig = ref({});
    function getTempConfig(){
      debugger
      switch (props.currentOpObj.XXSX){
        case "行政处罚":
          formConfig.value = matterSearchDetailCF
          break;
        case "行政许可":
          formConfig.value = matterSearchDetailXK
          break;
        case "信用逾期":
          formConfig.value = matterSearchDetailYQ
          break;
      }
    }
    function getDetailData(){
      let xxsx = ''
      switch (props.currentOpObj.XXSX){
        case "行政处罚":
          xxsx = "1"
          break
        case "行政许可":
          xxsx = "2"
          break
        case "信用逾期":
          xxsx = "3"
          break
      }
      getSxListDetails({
        uuid:props.currentOpObj.MARK_UUID,
        DATA_TYPE:xxsx
      }).then(res =>{
        debugger
        forms.value = res.msg[0].Rows[0]
      })
    }
    onBeforeMount(()=>{
      getTempConfig();
      getDetailData()
    })
    return{
      forms,
      formRef,
      formConfig,
    }
  }
}
</script>

<style scoped lang="scss">
.block-wxy{
  margin-top: 20px;
  border: 1px #ddd solid;
  border-radius: 4px;
}
.my-b-title-wxy{
  padding: 20px 10px;
  color: #2199d6;
  font-size: 15px;
  background-color: #f5f5f5;
  border: 1px #ddd solid;
  border-radius: 4px;
}
.form-wxy{
  padding: 20px 20px;
}
</style>