<template>
<div class="position-re h100">

  <common-layout

    :filter-form="dataSyncHandleDetailFilterForm"
    :table-header="dataSyncHandleSyncTabDetailTableHeader"
    :form-attrs="{
    spanAttrs: {span:4}
    }"
  ref="layoutRef"
  :get-table-list="getTableList"
  >
    <template #IS_SUCCESS="{data}">
      <span :class="{error:data.IS_SUCCESS !== '1'}">{{getStatus(data.IS_SUCCESS)}}</span>
    </template>
    <template #top>
      <my-breadcrumb class="my-breadcrumb" :breadcrumb-arr="bradeArr"></my-breadcrumb>
      <div class="back" @click="$emit('changeOperation','',{})"><span class="fa fa-reply cur-po " >返回</span></div>
    </template>
  </common-layout>

</div>
</template>

<script>
import CommonLayout from "@/components/CommonLayout.vue";
import MyBreadcrumb from "@/components/common/MyBreadcrumb.vue";
import {ref} from "vue";
import {dataSyncHandleSyncTabDetailTableHeader} from "@/data/all-table-header";
import {dataSyncHandleDetailFilterForm} from "@/data/all-forms";
import {getDataSyncHandleDetailWatchSheet} from "@/service/data-sync-hanlle-watch/data-sync-handle-watch-sheet";
import * as d3 from 'd3'
import {isEmptyCheck} from "@/unit/validate";
import {getDateToString} from "@/unit/time";
export default {
  name: "DataSyncHandleTableDetail",
  components: {MyBreadcrumb, CommonLayout},
  props:{
    currentOpObj:{

    }
  },
  setup(props) {

    function getStatus(field) {
      if (field == "1") {
        return "成功";
      }else{
        return "失败";
      }
    }
    const layoutRef = ref({})
    function getTableList (){
      getDataSyncHandleDetailWatchSheet({
        pageIndex:layoutRef.value.pageIndex,
        pageSize:layoutRef.value.pageSize,
        cid:props.currentOpObj.CID || '',
        taskNode:layoutRef.value.form.taskNode || '',
        isSuccess:layoutRef.value.form.isSuccess || '',
      }).then(res => {
        layoutRef.value.getResData(res.msg[0].Rows||[],res.msg[0].TotalRowCount)
      })

    }
    const bradeArr = [
      {name:'数据同步治理监控 '},
      {name:'数据同步治理监控表 '},
    ]
    return {
      bradeArr,
      layoutRef,
      getTableList,
      dataSyncHandleSyncTabDetailTableHeader,
      dataSyncHandleDetailFilterForm,
      getStatus,
    }
  }
}
</script>

<style scoped lang="scss">
.error{
  color: red;
}
</style>
