<template>
  <div>
    <div class="search">
      <el-popover placement="top-start" width="300" trigger="hover" content="具体元器件的管理在大类->小类下，有元器件型号、厂家、是否优选、是否GCTD">
        <i slot="reference" class="el-icon-question" />
      </el-popover>
      <el-input v-model="search" placeholder="请输入内容" class="input-with-select" style="width: 400px">
        <el-button slot="append" icon="el-icon-search" />
      </el-input>
    </div>
    <el-table :data="product" stripe style="width: 100%">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column prop="id" label="分类id" width="100" />
      <el-table-column prop="name" label="名称" width="180" />
      <el-table-column prop="model" label="型号" />
      <el-table-column prop="introduce" label="介绍" width="200" />
      <el-table-column prop="manufacturer" label="厂商" align="center" />
      <el-table-column prop="isSelect" label="是否优选" align="center" />
      <el-table-column prop="isGCTD" label="是否GCTD" align="center" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            @click="handleUpdate(scope.row)"
          >编辑</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import data from '@/data/customData/components.json'
export default {
  name: 'ComponentManage',
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 弹出层标题
      title: '',
      // 是否显示弹出层
      open: false,
      // 表单参数
      form: {},
      // 表单校验
      rules: {},
      // 搜索内容
      search: '',
      product: data.product
    }
  },
  methods: {
    /** 编辑按钮操作 */
    handleUpdate(row) {
      // const id = row.id || this.ids
      // this.editDialog = true
      // this.xmlContent = row.content
    },
    /** 搜索按钮操作 */
    handleQuery() {
      // this.queryParams.pageNum = 1
      // this.getList()
    },
    /** 重置按钮操作 */
    resetQuery() {
      // this.resetForm('queryForm')
      // this.handleQuery()
    }
  }
}
</script>

<style scoped>
.search{
  width: 100%;
  height: 60px;
  position: relative;
}
.input-with-select{
  position: absolute;
  top: 20px;
  right: 20px;
}
.el-icon-question{
  margin: 20px;
  font-size: 24px;
  color: #5cb6ff;
}
</style>
