<template>
  <div>
    <PageTable ref="logTable" action="QueryListById" :columnsFn="columns" :initParam="formSearch" :isPage="false">
    </PageTable>
  </div>
</template>
<script>
  export default{
    components:{

    },
    props: {
      logId: {
        type: String,
        default() {
          return "";
        }
      }
    },
    data(){
      return{
        // dataList: [],
        
        formSearch: {
          logId: this.logId
        }
      }
    },
    computed:{
  
    },
    created:function(){

    },
    beforeMount:function(){

    },
    mounted:function(){
    },
    beforeDestroy:function(){

    },
    destroyed:function(){

    },
    methods:{
      columns(){
        return  [
            {
              title: this.$t('module.logQuery.operationType'),
              key: "action",
              width: 100,
              align: "center",
              ellipsis: true,
              render: (h, params) => {
                return h(
                  "span",
                  {
                    attrs: {
                      title: this.getActionName(params.row.action)
                    }
                  },
                  this.getActionName(params.row.action)
                );
              }
            },
            {
              title: this.$t('module.logQuery.recordType'),
              key: "recordType",
              align: "center",
              ellipsis: true,
              render: (h, params) => {
                return h(
                  "span",
                  {
                    attrs: {
                      title: params.row.recordType
                    }
                  },
                  params.row.recordType
                );
              }
            },
            {
              title: this.$t('module.logQuery.recordId'),
              key: "recordId",
              // width: 70,
              align: "center",
              ellipsis: true,
              render: (h, params) => {
                return h(
                  "span",
                  {
                    attrs: {
                      title: params.row.recordId
                    }
                  },
                  params.row.recordId
                );
              }
            },
            // {
            //   title: this.$t('module.logQuery.logId'),
            //   key: "logId",
            //   align: "center",
            //   // width: 120,
            //   render: (h, params) => {
            //     return h(
            //       "span",
            //       {
            //         attrs: {
            //           title: params.row.logId
            //         }
            //       },
            //       params.row.logId
            //     );
            //   }
            // },
            {
              title: this.$t('module.logQuery.recordName'),
              key: "recordName",
              align: "center",
              ellipsis: true,
              render: (h, params) => {
                return h(
                  "span",
                  {
                    attrs: {
                      title: params.row.recordName
                    }
                  },
                  params.row.recordName
                );
              }
            },
            {
              title: this.$t('module.logQuery.extra'),
              key: "extra",
              align: "center",
              // width: 140,
              ellipsis: true,
              render: (h, params) => {
                return h(
                  "span",
                  {
                    attrs: {
                      title: params.row.extra
                    }
                  },
                  params.row.extra
                );
              }
            },
        ]
      },
      getActionName(action){
        if(action == "C"){
          return this.$t("module.logQuery.create");
        }else if(action == "R"){
          return this.$t("module.logQuery.read");
        }else if(action == "U"){
          return this.$t("module.logQuery.update");
        }else if(action == "D"){
          return this.$t("module.logQuery.delete");
        }
      }
    },
    watch:{

    },
    directives:{

    }
  }
</script>
