<template>
  <div class="eibs-tab">
    <div :class="model.recgrp.tgepp.length > 1 ? 'dcl-wrap' : 'dcl-wrap1'"
      v-if="model.recgrp.tgepp && model.recgrp.tgepp.length">
      <div class="dcl-left div-tags" v-if="model.recgrp.tgepp.length > 1">
        <div class="dcl-item" v-for="(item, index) in model.recgrp.tgepp" :key="index"
          :class="[curActive === index ? 'active-tag' : '']">
          期权信息({{ index + 1 }})
        </div>
      </div>
      <div v-for="(item, index) in model.recgrp.tgepp" :key="index+'1'" v-show="curActive == index"
        :class="model.recgrp.tgepp.length > 1 ? 'dcl-right' : 'dcl-right1'">
        <c-col :span="24">
          <c-col :span="12" class="col-left">
            <c-col :span="24">
              <el-form-item label="明细主键" :prop="`recgrp.tgepp.${curActive}.seqno`">
                <c-fullbox>
                  <c-input v-model="model.recgrp.tgepp[curActive].seqno" style="width: 100%" placeholder="请输入明细主键"
                    disabled></c-input>
                </c-fullbox>
              </el-form-item>
            </c-col>
            <c-col :span="24">
              <el-form-item label="明细操作类型" :prop="`recgrp.tgepp.${curActive}.listopertype`">
                <c-select v-model="model.recgrp.tgepp[curActive].listopertype" dbCode="action" style="width: 100%" placeholder="请输入操作类型"
                  disabled>
                </c-select>
              </el-form-item>
            </c-col>
            <c-col :span="24">
              <c-col :span="12">
                <el-form-item label="币种" prop="`recgrp.tgepp.${curActive}.currencycode`">
                  <c-select v-model="model.recgrp.tgepp[curActive].currencycode" style="width: 100%" placeholder="请输入" dbCode="curtxt" sort="SRT">
                  </c-select>
                </el-form-item>
              </c-col>
              <c-col :span="12">
                <el-form-item label="名义本金" prop="`recgrp.tgepp.${curActive}.notionalamt`">
                  <c-input-currency v-model="model.recgrp.tgepp[curActive].notionalamt" placeholder="请输入金额"></c-input-currency>
                </el-form-item>
              </c-col>
            </c-col>
            <c-col :span="24">
              <c-col :span="12">
                <el-form-item label="币种1" prop="`recgrp.tgepp.${curActive}.currencycode1`">
                  <c-select v-model="model.recgrp.tgepp[curActive].currencycode1" style="width: 100%" placeholder="请输入" dbCode="curtxt" sort="SRT">
                  </c-select>
                </el-form-item>
              </c-col>
              <c-col :span="12">
                <el-form-item label="名义本金1" prop="`recgrp.tgepp.${curActive}.notionalamt1`">
                  <c-input-currency v-model="model.recgrp.tgepp[curActive].notionalamt1" placeholder="请输入金额"></c-input-currency>
                </el-form-item>
              </c-col>
            </c-col>
            <c-col :span="24">
              <el-form-item label="交易日" :prop="`recgrp.tgepp.${curActive}.tradedate`">
                <c-date-picker type="date" v-model="model.recgrp.tgepp[curActive].tradedate" style="width:100%"
                  placeholder="请输入"></c-date-picker>
              </el-form-item>
            </c-col>
            <c-col :span="24">
              <el-form-item label="行权日" :prop="`recgrp.tgepp.${curActive}.exedate`">
                <c-date-picker type="date" v-model="model.recgrp.tgepp[curActive].exedate" style="width:100%"
                  placeholder="请输入"></c-date-picker>
              </el-form-item>
            </c-col>
          </c-col>
          <c-col :span="12" class="col-right">
            <c-col :span="24">
              <el-form-item label="行权方式" :prop="`recgrp.tgepp.${curActive}.exeway`">
                <c-select v-model="model.recgrp.tgepp[curActive].exeway" dbCode="exeway" style="width: 100%" placeholder="请输入">
                </c-select>
              </el-form-item>
            </c-col>
            <c-col :span="24">
              <el-form-item label="行权价" :prop="`recgrp.tgepp.${curActive}.exeprice`">
                <c-input-currency v-model="model.recgrp.tgepp[curActive].exeprice"></c-input-currency>
              </el-form-item>
            </c-col>
            <c-col :span="24">
              <el-form-item label="交易方向" :prop="`recgrp.tgepp.${curActive}.tradedirection`">
                <c-select v-model="model.recgrp.tgepp[curActive].tradedirection" dbCode="tradir" style="width: 100%" placeholder="请输入">
                </c-select>
              </el-form-item>
            </c-col>
            <c-col :span="24">
              <el-form-item label="期权费" :prop="`recgrp.tgepp.${curActive}.optionamt`">
                <c-input v-model="model.recgrp.tgepp[curActive].optionamt"></c-input>
              </el-form-item>
            </c-col>
            <c-col :span="24">
              <el-form-item label="交割日" :prop="`recgrp.tgepp.${curActive}.delidate`">
                <c-date-picker type="date" v-model="model.recgrp.tgepp[curActive].delidate" style="width:100%"
                  placeholder="请输入"></c-date-picker>
              </el-form-item>
            </c-col>
          </c-col>
        </c-col>
      </div>

    </div>
  </div>
</template>
<script>
  import Api from "~/service/Api";
  export default {
    inject: ["root"],
    props: ["model", "codes"],
    mixins: [],
    data() {
      return {
        curActive: 0,
        currentFormData: {},
        bopcodDialogTableVisible: false,
        tableList: [],
        tableColumn: [
          { label: "交易代码", prop: "cod" },
          { label: "描述", prop: "txt" }
        ],
        dbcode: "",
      };
    },
    mounted() {

    },
    methods: {


    },
    created() { },
    watch: {}
  };
</script>
<style scoped>
  .dcl-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    border: 1px solid #f1f1f1;
    box-sizing: border-box;
    border-radius: 3px;
  }

  .dcl-wrap1 {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    box-sizing: border-box;
    border-radius: 3px;
  }

  .dcl-left {
    width: 120px;
    height: 100%;
    overflow: auto;
    padding: 10px 0 10px 10px;
    position: relative;
    background-color: rgba(102, 83, 242, 0.1);
  }

  .div-tags {
    padding: 0 !important;
  }

  .dcl-item {
    width: 100%;
    height: 60px;
    text-align: center;
    line-height: 25px;
    cursor: pointer;
    padding: 5px 5px;
    border: 1px solid #f1f1f1;
    box-shadow: 2px 2px 2px 1px rgba(0, 0, 0, 0.1);
    font-size: 14px;
  }

  .active-tag {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    border: 1px solid #f1f1f1;
  }

  .dcl-right {
    width: calc(100% - 120px);
    height: 100%;
    border-left: 1px solid #f1f1f1;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 10px 10px 10px 0;
  }

  .dcl-right1 {
    height: 100%;
    box-sizing: border-box;
  }
</style>