<template>
  <div>
    <el-table :header-cell-style="{background:'#f1f2f3',color:'#333'}" size="mini" border>
      <el-table-column v-for="col in list" :key="col.gridcolid" :property="col.column" :label="col.title" :width="col.width === 0?'':col.width"></el-table-column>
      <el-table-column label="操作" width="150">
        <template slot-scope="scope">
          <el-button size="mini" type="text" @click="onRead(scope)">查 看</el-button>
          <el-divider direction="vertical"></el-divider>
          <el-button size="mini" type="text" @click="onEdit(scope)">编 辑</el-button>
          <el-divider direction="vertical"></el-divider>
          <el-button size="mini" type="text"  @click="onDelete(scope)">删 除</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  props:['gridid'],
  data () {
    return {
      list:[]
    }
  },
  methods:{
    listData () {
      let param = {
       "classname": "sysmanage.develop.appregistry.appregistry_grid",
        "method": "query_appgridcollist",
        "content": {
          "gridid": this.gridid
        }
      }
      this.$api.requested(param).then(res=>{
        this.list = res.data
      })
    },
    onRead (row) {
      this.$emit('onRead',row)
    },
    onEdit(row) {
      this.$emit('onEdit',row)
    },
    onDelete(row) {
      this.$emit('onDelete',row)
    }
  },
  mounted () {
    this.listData()
  }
}

</script>
<style>
</style>