<template>
 <div class="h100">
   <common-layout

     :form-attrs="{
     spanAttrs: {
       span:4
     }
     }"
     :table-attrs="{
     'has-operation':true
     }"
     ref="layoutRef" :table-header="invokeLogTableHeader" :filter-form="invokeLogHomeFilterForm" :get-table-list="getTableData">
     <template #operation="{data}">
       <el-button type="info" @click="validName(data)" v-if="data.B64_CERT">签名验签</el-button>
     </template>
   </common-layout>
 </div>
</template>

<script>


import CommonLayout from "@/components/CommonLayout.vue";
import {ref} from "vue";
import {invokeLogHomeFilterForm} from "@/data/all-forms";
import {invokeLogTableHeader} from "@/data/all-table-header";
import {getLogInvokeHomeTableData} from "@/service/system-manage/log-invoke";
import {validNameYq} from "@/service/common/common";
import {handleMes} from "@/unit/element-ui/tip";

export default {
  name: "InvokeLog",
  components: {CommonLayout},
  setup(){
    function validName(item){
      validNameYq({
        b64OriginData:item.B64_ORIGIN_DATA,
        b64SignedData:item.B64_SIGNED_DATA,
        b64Cert:item.B64_CERT,
      }).then(res => {
        handleMes(res,() => {

        })
      })
    }
    function getTableData(){
      getLogInvokeHomeTableData({
        pageIndex:layoutRef.value.pageIndex,
        pageSize:layoutRef.value.pageSize,
        SERVICE_PATH:layoutRef.value.form.SERVICE_PATH,
      }).then(res => {
        layoutRef.value.getResData(res.msg[0].Rows||[],res.msg[0].TotalRowCount)
      })
    }
    const layoutRef = ref(null)
    return {
      layoutRef,
      getTableData,
      invokeLogHomeFilterForm,
      invokeLogTableHeader,
      validName
    }
  }

}
</script>

<style scoped lang="scss">

</style>
