<template>
  <div class="itemTemplateBody">
    <template v-if="list && list.length > 0">
      <el-row
        v-for="(item, index) in list"
        :key="item.code + index"
        class="body"
      >
        <el-col :span="8" style="width: 200px"
          ><div>{{ item.code }}</div></el-col
        >
        <el-col :span="8" class="setWidth" v-if="headIndex === 1"
          ><div>{{ item.name }}</div></el-col
        >
        <el-col
          :span="8"
          :style="{ width: headIndex === 1 ? '110px' : ' 108px' }"
          v-if="type === '1' && headIndex !== 1"
          ><div>{{ item.order_fee }}</div></el-col
        >
        <el-col
          :span="8"
          :style="{ width: headIndex === 1 ? '110px' : ' 108px' }"
          v-if="type === '1' && headIndex === 1"
          ><div>{{ item.fund_fee }}</div></el-col
        >
        <el-col
          :span="8"
          :style="{ width: headIndex === 1 ? '110px' : ' 108px' }"
          v-if="type === '1' && headIndex === 1"
          ><div>{{ item.inv_fee }}</div></el-col
        >

        <el-col
          :span="8"
          :style="{ width: headIndex === 1 ? '110px' : ' 108px' }"
          v-if="type === '2' && headIndex !== 1"
          ><div>{{ item.inv_fee }}</div></el-col
        >
        <el-col
          :span="8"
          :style="{ width: headIndex === 1 ? '110px' : ' 108px' }"
          v-if="type === '2' && headIndex === 1"
          ><div>{{ item.fund_fee }}</div></el-col
        >
        <el-col
          :span="8"
          :style="{ width: headIndex === 1 ? '110px' : ' 108px' }"
          v-if="type === '2' && headIndex === 1"
          ><div>{{ item.order_fee }}</div></el-col
        >

        <el-col
          :span="8"
          :style="{ width: headIndex === 1 ? '110px' : ' 108px' }"
          v-if="type === '3' && headIndex !== 1"
          ><div>{{ item.fund_fee }}</div></el-col
        >
        <el-col
          :span="8"
          :style="{ width: headIndex === 1 ? '110px' : ' 108px' }"
          v-if="type === '3' && headIndex === 1"
          ><div>{{ item.order_fee }}</div></el-col
        >
        <el-col
          :span="8"
          :style="{ width: headIndex === 1 ? '110px' : ' 108px' }"
          v-if="type === '3' && headIndex === 1"
          ><div>{{ item.inv_fee }}</div></el-col
        >
      </el-row>
    </template>
    <template v-else>
      <div class="nodate" >暂无数据</div>
    </template>
  </div>
</template>

<script>
export default {
  name: "itemTemplate",
  props: ["list", "headIndex", "type"],
  data() {
    return {};
  },

  methods: {},
};
</script>

<style lang="scss" scoped>
.relationQuery {
  .itemTemplateBody {
    // display: flex;
    width: 100%;
    position: relative;
    height: 100%;
    border: 1px solid rgb(223, 230, 236);
    border-top: 0;
    margin: 0 0 -1px 0;
    // align-items: stretch;
    .body {
      width: 100%;
      // position: relative;
      // height: 100%;
      // padding: 6px 0;
      // box-sizing: border-box;
      // // // background: #f5f7fa;
      // border: 1px dashed rgb(223, 230, 236);
      // // border-right: 0;
      box-sizing: border-box;
      position: relative;

      > div {
        padding: 6px 0;
        box-sizing: border-box;
        border-bottom: 1px dashed #e9e9eb;
        border-left: 1px dashed #e9e9eb;
        &:first-child {
          border-left-color: transparent;
        }
        &.setWidth {
          width: calc(100% - 420px);
        }

        > div {
          color: #606266;
          padding: 0 10px;
          box-sizing: border-box;
          font-size: 12px;
          display: block;
          font-family: "Microsoft Yahei", sans-serif;
          font-size: 12px;
          overflow: hidden;
          text-overflow: ellipsis;
          width: 100%;
          height: 23px;
          line-height: 23px;
        }
      }
      &:last-child {
        > div {
          // border-bottom: 0;
        }
      }
    }
    .nodate {
      width: 100%;
      line-height: 36px;
      text-align: center;
      color: #909399;
      font-size: 13px;
      //  width: 100%;
      // position: relative;
      // height: 100%;
    }
  }
}
</style>
