<template>
  <common-sta-layout  key="log-manage" :table-attrs="{
    'has-operation':true
  }">
    <template #TYPE="{data}">
      {{getSystem(data.TYPE)}}
    </template>
    <template #operation="{data}">
      <el-button @click="validName(data)" type="info" v-if="data.B64_CERT">签名验签</el-button>
    </template>
  </common-sta-layout>
</template>

<script>
import CommonStaLayout from "@/components/common/CommonStaLayout.vue";
import {validNameYq} from "@/service/common/common";
import {handleMes} from "@/unit/element-ui/tip";

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

        })
      })
    }
    function getSystem(value, row, index) {
      switch(value){
        case "1":
          return "运维系统";
        case "2":
          return "空间地理信息共享交换系统";
        case "3":
          return "数据综合分析系统";
        default: return value;
      }
    }
    return {
      getSystem,
      validName
    }
  }
}
</script>

<style scoped lang="scss">

</style>
