<template>
  <div class="layout-no-cols">
    <div >
      <el-table ref="dataTable" data-read-url="/ui/plugins" :page-size="10" highlight-current-row>
        <el-table-column prop="name" label="名称">
          <template slot-scope="scope">
            <a href="javascript:void(0)" @click="goDetailPage(scope.row)">{{scope.row.name}}</a>
          </template>
        </el-table-column>
        <el-table-column prop="ID" label="ID"></el-table-column>
        <el-table-column prop="version" label="版本"></el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
import util from '@src/common/util.js'

export default {
  data() {
    return {
    }
  },

  methods: {
    goDetailPage(row) {
      this.$router.push({path: `/platform/plugin/${row.ID}`})
    },

    async statusChange(status, row) {
      let params = {
        ID: row.ID,
        status: status
      }
      let res = await axios.put('/ui/plugins/status', params)
      util.showResponseMessage(res.data)
      if (res.data.status === 1) {
        row.status = status
      }
    }
  }
}
</script>
<style>
  .ccc {
    color: #ccc;
  }

  .plugin-list tr.el-table__row.current-row {
    color: #28B06F;
  }

  .plugin-list tr.el-table__row.current-row a {
    color: #28B06F;
  }
</style>

<style scoped>
  .plugin-list button>span>i,
  li>i,
  span>i,
  h5>i {
    padding: 3px 5px;
  }

  .folder-node i {
    color: #2d8cf0;
    font-size: 14px;
  }

  .folder-node span {
    font-size: 14px;
  }

  .el-collapse-item {
    margin-bottom: 15px;
  }
</style>
