<!--
 * @Descripttion : 当前组件信息
 * @Author       : 无尘
 * @Date         : 2020-04-03 16:18:11
 * @LastEditors  : 无尘
 * @LastEditTime : 2020-04-03 17:59:47
 * @FilePath     : \Hapi-demoj:\公司\api-gateway\src\components\plug\log-list.vue
 -->
<template>
  <div style="margin-top:20px">
    <div class="table-content">
      <el-table :data="tableData" style="width: 100%" tooltip-effect="dark" v-loading="loading" :height="tableHeight">
        <el-table-column label="请求ip" prop="projectName">
          <template slot-scope="scope">
            {{ scope.row.requestIp }}
          </template>
        </el-table-column>
        <el-table-column label="应用" prop="groupName">
          <template slot-scope="scope">
            {{ scope.row.app }}
          </template>
        </el-table-column>
        <el-table-column label="开发者账号" prop="interfaceName">
          <template slot-scope="scope">
            {{ scope.row.developer }}
          </template>
        </el-table-column>
        <el-table-column label="请求时间" prop="bindTime">
          <template slot-scope="scope">
            <div class="color-606266 line-18">{{ scope.row.requestTime | timeStampToYmd }}</div>
            <div class="color-606266 line-18">{{ scope.row.requestTime | timeStampToHms }}</div>
          </template>
        </el-table-column>
        <el-table-column label="商户" prop="interfaceName">
          <template slot-scope="scope">
            {{ scope.row.merchant }}
          </template>
        </el-table-column>
        <el-table-column label="接口" prop="interfaceName">
          <template slot-scope="scope">
            {{ scope.row.interface }}
          </template>
        </el-table-column>
        <el-table-column label="请求内容" prop="interfaceName">
          <template slot-scope="scope">
            {{ scope.row.requestContent }}
          </template>
        </el-table-column>
        <el-table-column label="返回内容" prop="interfaceName">
          <template slot-scope="scope">
            {{ scope.row.responseContent }}
          </template>
        </el-table-column>
        <el-table-column label="状态" prop="interfaceName">
          <template slot-scope="scope">
            {{ scope.row.status }}
          </template>
        </el-table-column>
        <el-table-column label="备注">
          <template slot-scope="scope">
            {{ scope.row.remarks }}
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
import { getRequest } from '@/api/api';
export default {
  props: {
    tableData: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  data() {
    return {};
  },
  methods: {
    cancelBind(item) {
      var that = this;
      let params = {
        id: item.openPlatformInterfaceId
      };
      getRequest('/gateway-manage/platform/white/unbind', params)
        .then(res => {
          if (res.data.code == '0000') {
            this.$emit('getList');
          } else {
            this.$message.error(res.data.message);
          }
        })
        .catch(function(error) {
          that.$message.error({
            duration: 1000,
            message: error.message
          });
        });
    }
  },
  components: {}
};
</script>
<style lang="less" scoped></style>
