<template>
  <div>
    <Dec :content="content" />
    <div class="setobject">
      <div class="top-box">
        <el-row>
          <el-col :span="12">
            <el-button type="primary">添加</el-button>
            <el-button type="primary">批量添加</el-button>
            <el-button type="primary">批量导出</el-button>
            <el-button type="danger">删除</el-button>
          </el-col>
          <el-col :span="12">
            <el-input
              v-model="searchtext"
              placeholder="试卷名称、编号"
              style="width:220px;float:right"
            >
              <i slot="suffix" class="el-input__icon el-icon-search" @click="search" />
            </el-input>
          </el-col>
        </el-row>
      </div>

      <el-row style="height:calc(100% - 56px);">
        <el-col :span="6" style="height:100%;border-right:1px solid #eee">
          <ListBox
            ref="listbox"
            title="学制"
            title-bg="#ccc"
            :data="listData"
            active-color="rgb(64, 158, 255)"
            :acitve-index="1"
            @clicklist="clicklist"
            @removelist="removelist"
          />
        </el-col>
        <el-col :span="18" style="padding:10px;">
          <el-table
            :data="tableData"
            style="width: 100%"
          >
            <el-table-column
              type="selection"
              width="55"
            />
            <el-table-column
              prop="no"
              label="序号"
              width="50"
            />
            <el-table-column
              prop="schoollength"
              label="学制"
            />
            <el-table-column
              prop="subjectno"
              label="科目编号"
            />
            <el-table-column
              prop="subject"
              label="科目"
            />
            <el-table-column
              prop="user"
              label="添加者"
            />
            <el-table-column label="操作">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="danger"
                  @click="handleDelete(scope.$index, scope.row)"
                >删除</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-col>
      </el-row>
    </div>
  </div>
</template>
<script>
import Dec from '@/components/Dec'
import ListBox from '@/components/ListBox'
export default {
  name: 'Setobject',
  components: {
    Dec,
    ListBox
  },
  data() {
    return {
      content: '',
      searchtext: '',
      listData: [
        { id: 0, name: '全部（30）', removeIcon: false },
        { id: 2, name: '小学（10）' },
        { id: 3, name: '初中（20）' }
      ],
      tableData: [
        {
          no: '1',
          schoollength: '小学',
          subjectno: '0001',
          subject: '语文',
          user: '张三'
        }
      ]
    }
  },
  methods: {
    search() {

    },
    clicklist(index) {
      console.log(index)
    },
    removelist(index) {
      console.log(index)
    },
    handleDelete(index, row) {

    }
  }
}
</script>
<style scoped>
.setobject{
    max-width: 1100px;
    height:calc(100vh - 115px);
    margin:0 auto;
    background: #fff;
    margin-top:15px;
    padding:20px;
}
.top-box{
    padding-bottom: 15px;
    border-bottom: 1px solid #ccc;
}
</style>
