<template>
  <div>
      <div>
        <div class="inline-16" style="margin-bottom:10px">
          <el-input suffix-icon="el-icon-search" size="small" v-model="params.content.where.condition" placeholder="产品名称,编号" @keyup.enter.native="queryEnterpriseArchives(params.content.pageNumber = 1)" @clear="queryEnterpriseArchives(params.content.pageNumber = 1)" clearable></el-input> 
        </div>
        <el-table
          :data="ENlist"
          stripe
          style="width: 100%"
          height="300"
          border>
          <el-table-column
            prop="modelname"
            label="模板名称"
            width="180">
          </el-table-column>
          <el-table-column
            prop="systemappname"
            label="应用"
            width="180">
          </el-table-column>
          <el-table-column>
            <template slot-scope="scope">
              <el-button size="mini" type="text" @click="rowClick(scope.row)">选 择</el-button>
            </template>
          </el-table-column>
        </el-table>
        <div style="display:flex;justify-content:space-between;margin-top:16px;">
          <div style="text-align:left">
          <el-pagination
              background
              small
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="params.content.pageNumber"
              :page-size="params.content.pageSize"
              layout="total, prev, pager, next"
              :total="total">
            </el-pagination>
          </div>
          <el-button size="mini" @click="$emit('onCancel')">取消</el-button>
        </div>
      </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      ENlist:[],
      total:0,
      currentPage:0,
      form:{},
      params:{
        "id": 20221121155801,
        "content": { 
          "pageNumber": 1,
          "pageSize": 20,
          "where":{
          "condition":""
          }
        }
      },
      selected:''
    }
  },
  methods:{
    async queryEnterpriseArchives () {
      const res = await this.$api.requested(this.params)
      this.ENlist = res.data
      this.total = res.total
      console.log(this.ENlist);
      
    },
    handleSizeChange(val) {
      this.params.content.pageSize = val
      this.queryEnterpriseArchives()
    },
    handleCurrentChange(val) {
      this.params.content.pageNumber = val
      this.queryEnterpriseArchives()
    },
    rowClick (row) {
      this.$emit('onSelect',row)
    },
    onCancel () {
      this.$emit('onCancel')
    }
  },
  mounted () {
    this.queryEnterpriseArchives()
  }
}

</script>
<style>
</style>