<!--
 * @Description: 修改
 * @Author: wsd
 * @Date: 2022-10-26 14:20:38
 * @LastEditTime: 2022-10-26 15:10:38
 * @LastEditors: wsd
-->
<template>
  <div class="container">
    <h4>代理服务列表</h4>
    <el-table :data="tableData">
      <el-table-column type="index" label="序号" width="50" align="center">
      </el-table-column>
      <el-table-column
        prop="name"
        label="代理服务名称"
        align="center"
        show-overflow-tooltip
      >
      </el-table-column>
      <el-table-column
        prop="version"
        label="版本"
        align="center"
        show-overflow-tooltip
      >
        <template #default="{row}">
          <p>{{row.version ? row.version : '无'}}</p>
          <el-button type="text" @click="detailVersion(row)">历史版本</el-button>
        </template>
      </el-table-column>
      <el-table-column
        prop="publisher"
        label="发布人"
        align="center"
        show-overflow-tooltip
      >
      </el-table-column>
      <el-table-column
        prop="publishTime"
        label="发布日期"
        align="center"
        show-overflow-tooltip
      >
      </el-table-column>
      <el-table-column
        prop="description"
        label="操作"
        align="center"
        show-overflow-tooltip
      >
        <template #default="{row}">
          <el-button type="text" @click="detailInfo(row)">查看详情</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      :page-size="page.pageSize"
      :current-page.sync="page.pageNum"
      background
      @current-change="quickQueryData()"
      :total="page.total"
    ></el-pagination>
    <versionOld :visibles="oldDialog" :rowData="oldData" @confirm="closeDialog()" />
    <el-dialog :close-on-click-modal="false" title="代理服务定义" :visible.sync="dialogFormVisible" :destroy-on-close="true" append-to-body width="72%">
      <agency-info v-model="dialogFormVisible" :currentRow="currentRow" @confirm="handleSubmit()" />
    </el-dialog>
  </div>
</template>
<script>
import AgencyInfo from '../../esb_service/agency_service/AgencyInfo.vue'
import versionOld from './versionOld.vue'
export default {
  name: '',
  components: {
    versionOld,
    AgencyInfo
  },
  props: {},
  data() {
    return {
      page: {
        pageSize: 10,
        pageNum: 1,
        total: 0
      },
      currentRow: {},
      dialogFormVisible: false,
      oldDialog: false,
      oldData: [],
      tableData: []
    }
  },
  created() {},
  mounted() {
    getData()
  },
  methods: {
    closeDialog() {
      this.oldDialog = false
    },
    quickQueryData() {
    },
    detailVersion(row) {
      this.oldDialog = true
      this.oldData.push(row)
    },
    detailInfo(row) {
      this.dialogFormVisible = true
    },

  }
}
</script>
<style lang='scss' scoped>
.container {
  background: #fff;
  margin-top: 10px;
  padding:0 30px;
  box-sizing: border-box;
  h4 {
    font-size: 16px;
    line-height: 30px;
    margin-bottom: 10px;
  }
}
</style>
