<template>
  <el-row>
    <el-col :span="6" style="border-right: 1px solid #000; padding-right: 20px">
      <!-- 顶部工具栏 -->
      <el-form :model="headerFormData" label-width="auto">
        <el-form-item label="数据源名称">
          <el-input v-model="headerFormData.datasetName" placeholder="请输入"></el-input>
        </el-form-item>
        <el-form-item label="接口服务名称">
          <el-input v-model="headerFormData.dataType" placeholder="请输入"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSearch">查询</el-button>
          <el-button type="default" @click="onReset">重置</el-button>
        </el-form-item>
      </el-form>
      <!-- 左侧表格 -->

      <el-table :data="leftTableData" border max-height="500" style="width: 100%; margin-right: 10px">
        <el-table-column label="序号" type="index" width="50"></el-table-column>
        <el-table-column prop="name" label="接口服务名称"></el-table-column>
        <el-table-column prop="name" label="接口提供方URL地址"></el-table-column>
        <el-table-column label="操作" width="120">
          <template slot-scope="scope">
            <el-button type="text" @click="onEyeClick(scope.row)" icon="el-icon-view"></el-button>
            <el-button type="text" @click="onEyeClick(scope.row)" icon="el-icon-delete"></el-button>
          </template>
        </el-table-column>
      </el-table>
      <!-- 分页 -->
      <div class="pagination-container">
        <el-pagination background layout="prev, pager, next" :current-page="pagination.currentPage"
          :page-size="pagination.pageSize" :total="pagination.total" @current-change="onPageChange"></el-pagination>
      </div>
    </el-col>
    <el-col :span="18" style="padding-left: 20px">
      <div>六统一接入方式为API,必填此表</div>
      <!-- 右侧表格 -->
      <div style="
          width: 100%;
          display: flex;
          justify-content: end;
          align-items: center;
        ">

        <el-button type="primary">新增</el-button>
        <el-button type="primary">上传</el-button>
        <el-button type="primary">模版下载</el-button>
      </div>
      <el-table ref="rightTable" :data="rightTableData" border style="width: 100%" :expand-row-keys="expandedRows"
        @expand-change="onExpandChange" :show-header="false" max-height="800">
        <!-- 序号列 -->
        <el-table-column label="序号" type="index" width="50"></el-table-column>

        <!-- 普通列 -->
        <el-table-column prop="name" label="表中文名">
          <template slot-scope="scope">
            <div style="display: flex; align-items: center">
              <div>接口服务名称</div>
              <el-input style="width: 260px; margin-left: 20px" v-model="scope.row.input"
                placeholder="请输入内容"></el-input>
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="alias" label="表英文名">
          <template slot-scope="scope">
            <div style="display: flex; align-items: center">
              <span>表英文名</span>
              <el-input style="width: 260px; margin-left: 20px" v-model="scope.row.input"
                placeholder="请输入内容"></el-input>
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="urlDetail" label="接口描述">
          <template slot-scope="scope">
            <div style="display: flex; align-items: center">
              <span>接口描述</span>
              <el-input style="width: 260px; margin-left: 20px" v-model="scope.row.urlDetail"
                placeholder="请输入内容"></el-input>
            </div>
          </template>
        </el-table-column>

        <!-- 展开行 -->
        <el-table-column type="expand">
          <template slot-scope="props">
            <div class="expanded-content">
              <el-form :model="apiFormData" label-width="auto" inline class="form-detail-inline"
                :label-position="right">
                <el-form-item label="应用场景">
                  <el-input v-model="apiFormData.scenario" placeholder="请输入"></el-input>
                </el-form-item>
                <el-form-item label="接口提供方">
                  <el-input v-model="apiFormData.dataType" placeholder="请输入"></el-input>
                </el-form-item>
                <el-form-item label="接口提供方URL地址">
                  <el-input v-model="apiFormData.dataType" placeholder="请输入"></el-input>
                </el-form-item>
                <el-form-item label="支持格式">
                  <el-input v-model="apiFormData.datasetName" placeholder="请输入"></el-input>
                </el-form-item>
                <el-form-item label="接口调用方">
                  <el-input v-model="apiFormData.dataType" placeholder="请输入"></el-input>
                </el-form-item>
                <el-form-item label="接口接口调用方URL地址">
                  <el-input v-model="apiFormData.dataType" placeholder="请输入"></el-input>
                </el-form-item>

                <el-form-item label="请求方式">
                  <el-input v-model="apiFormData.datasetName" placeholder="请输入"></el-input>
                </el-form-item>
                <el-form-item label="六统一接口地址URL">
                  <el-input v-model="apiFormData.dataType" placeholder="请输入"></el-input>
                </el-form-item>
                <el-form-item label="调用方向">
                  <el-input v-model="apiFormData.dataType" placeholder="请输入"></el-input>
                </el-form-item>

                <el-form-item label="调试频率">
                  <el-input v-model="apiFormData.datasetName" placeholder="请输入"></el-input>
                </el-form-item>
                <el-form-item label="每频率内的条数">
                  <el-input v-model="apiFormData.dataType" placeholder="请输入"></el-input>
                </el-form-item>
                <el-form-item label="调用间隔说明">
                  <el-input v-model="apiFormData.dataType" placeholder="请输入"></el-input>
                </el-form-item>

                <el-form-item label="联调的数据量">
                  <el-input v-model="apiFormData.datasetName" placeholder="请输入"></el-input>
                </el-form-item>
                <el-form-item label="联调实施步骤">
                  <el-input v-model="apiFormData.dataType" placeholder="请输入"></el-input>
                </el-form-item>
                <el-form-item label="网络策略确认">
                  <el-input v-model="apiFormData.dataType" placeholder="请输入"></el-input>
                </el-form-item>
              </el-form>
              <div class="title">接口定义</div>
              <div class="table_title">Header请求参数</div>
              <el-table ref="rightTable" :data="rightTableData" border style="width: 100%">
                <!-- 序号列 -->
                <el-table-column label="序号" type="index" width="50"></el-table-column>

                <!-- 普通列 -->
                <el-table-column prop="name" label="中文名称">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="英文名称">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="数据类型">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="是否必填">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="描述">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="示例说明">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>

                <el-table-column fixed="right" label="操作" width="100">
                  <template :slot-scope="{ row }">
                    <el-button type="text" size="small">删除</el-button>
                  </template>
                </el-table-column>
              </el-table>
              <div class="table_title">Body请求参数说明</div>
              <el-table ref="rightTable" :data="rightTableData" border style="width: 100%">
                <!-- 序号列 -->
                <el-table-column label="序号" type="index" width="50"></el-table-column>

                <!-- 普通列 -->
                <el-table-column prop="name" label="中文名称">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="英文名称">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="数据类型">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="是否必填">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="描述">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="示例说明">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>

                <el-table-column fixed="right" label="操作" width="100">
                  <template :slot-scope="{ row }">
                    <el-button type="text" size="small">删除</el-button>
                  </template>
                </el-table-column>
              </el-table>

              <div class="table_title">Query请求参数说明</div>
              <el-table ref="rightTable" :data="rightTableData" border style="width: 100%">
                <!-- 序号列 -->
                <el-table-column label="序号" type="index" width="50"></el-table-column>

                <!-- 普通列 -->
                <el-table-column prop="name" label="中文名称">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="英文名称">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="数据类型">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="是否必填">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="描述">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="示例说明">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>

                <el-table-column fixed="right" label="操作" width="100">
                  <template :slot-scope="{ row }">
                    <el-button type="text" size="small">删除</el-button>
                  </template>
                </el-table-column>
              </el-table>

              <div class="table_title">返回参数说明</div>
              <el-table ref="rightTable" :data="rightTableData" border style="width: 100%">
                <!-- 序号列 -->
                <el-table-column label="序号" type="index" width="50"></el-table-column>

                <!-- 普通列 -->
                <el-table-column prop="name" label="中文名称">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="英文名称">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="数据类型">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="是否必填">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="描述">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="示例说明">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>

                <el-table-column fixed="right" label="操作" width="100">
                  <template :slot-scope="{ row }">
                    <el-button type="text" size="small">删除</el-button>
                  </template>
                </el-table-column>
              </el-table>

              <div class="table_title">data子项说明</div>
              <el-table ref="rightTable" :data="rightTableData" border style="width: 100%">
                <!-- 序号列 -->
                <el-table-column label="序号" type="index" width="50"></el-table-column>

                <!-- 普通列 -->
                <el-table-column prop="name" label="中文名称">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="英文名称">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="数据类型">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="是否必填">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="描述">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="alias" label="示例说明">
                  <template slot-scope="scope">
                    <el-input v-model="scope.rowinput" placeholder="请输入内容"></el-input>
                  </template>
                </el-table-column>

                <el-table-column fixed="right" label="操作" width="100">
                  <template :slot-scope="{ row }">
                    <el-button type="text" size="small">删除</el-button>
                  </template>
                </el-table-column>
              </el-table>

              <el-form :model="apiFormData" label-width="auto" inline class="textarea-form" :label-position="right">
                <el-row>
                  <el-col :span="12">
                    <el-form-item label="请求示例">
                      <el-input v-model="apiFormData.datasetName" placeholder="请输入" type="textarea"
                        :rows="4"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item label="返回示例">
                      <el-input v-model="apiFormData.dataType" placeholder="请输入" type="textarea" :rows="4"></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
            </div>
          </template>
        </el-table-column>
      </el-table>
    </el-col>
  </el-row>
</template>
<script>
import MyForm from "@/components/MyForm";
export default {
  name: "",
  components: {
    MyForm,
  },
  data() {
    return {
      pagination: {
        currentPage: 1,
        pageSize: 10,
        total: 161,
      },
      leftTableData: [{}],
      rightTableData: [{}],
      headerFormData: {},
      apiFormData: {},
      expandedRows: [],
    };
  },
  methods: {},
  created() {},
  mounted() {},
};
</script>
<style lang="scss" scoped>
.expanded-content{
  padding: 20px;
  box-sizing: border-box;
}
.title {
  width: 100%;
  text-align: left;
}
.table_title {
  width: 100%;
  text-align: left;
  margin: 10px 0;
}

.textarea-form{
  margin-top: 20px;
}
</style>
