<template>
  <div>
    <functionBar class="F_bar"></functionBar>
    <b-container fluid>
    <div style="margin-top: 80px">
    <b-row style="margin-top: 11px">
      <b-col cols="12">
            <div style="width: 800px; margin-left: 350px; color: black" >
                <b-form-group
                  label="關鍵字:"
                  label-for="filter-input"
                  label-cols="2"
                  label-align="right"
                  label-size="1px"
                >
                  <b-input-group size="1px">
                    <b-form-input
                      id="filter-input"
                      v-model="filter"
                      type="search"
                      placeholder="請輸入關鍵字"
                    ></b-form-input>
                  </b-input-group>
                </b-form-group>
              </div>
            </b-col>
        </b-row>
    <div>
    <b-row>
      <b-col>
        <!-- TABLE -->
        <b-table
        :items="fullList"
        :fields="fields"
        :filter="filter"
        thead-class="thClass"
        class="text-center"
        responsive="sm"
        striped
        bordered
        fixed
        :per-page="perPage"
        :current-page="currentPage"
        >
        <!-- HEAD -->
        <template #head()="{label}">
          <span style="font-weight: normal; color: white; font-size: 15px">{{
            label
          }}</span>
        </template>
        <!-- BODY -->
        <!-- 填報日期 -->
        <template #cell(date)="data">
            <span style="font-weight: normal; color: black; font-size: 15px">
              {{ data.value }}
            </span>
          </template>
          <!-- 承辦人 -->
          <template #cell(conference_name)="data">
            {{ data.value }}
          </template>
          <!-- 累積進度 -->
          <template #cell(undertaker_name)="data">
            <span style="font-weight: normal; color: black; font-size: 15px">
              {{ data.value }}
            </span>
          </template>
        </b-table>
        <!-- 分頁符號 -->
        <b-pagination
          v-model="currentPage"
          pills
          :total-rows="rows"
          :per-page="perPage"
          aria-controls="my-table"
          style="margin-top:-30px"
        >
        </b-pagination>
        </b-col>
      </b-row>
    </div>
    </div>
    </b-container>
  </div>
</template>
<script>
import functionBar from '@/views/ConstructionSupervision/MainPage/functionBar.vue'

export default {
  data () {
    return {
      filter: null,
      keywords: [],
      selected: [], // Must be an array reference!
      perPage: 12,
      currentPage: 1,
      fields: [
        {
          key: 'date',
          label: '填報日期',
          sortable: true,
          tdClass: 'align-middle',
          thStyle: { background: '#1d325f', color: '#ffffff', width: '80px' }
        },
        {
          key: 'conference_name',
          label: '承辦人',
          sortable: true,
          tdClass: 'align-middle',
          thStyle: { background: '#1d325f', color: '#ffffff', width: '40px' }
        },
        { key: 'undertaker_name',
          label: '累積進度',
          tdClass: 'align-middle',
          thStyle: { background: '#1d325f', color: '#ffffff', width: '40px' }
        }
      ],
      fullList: []
    }
  },
  components: {
    functionBar
  },
  computed: {
    rows () {
      return this.fullList.length
    }
  }
}
</script>
<style>
.thClass {
  font-size: 16px;
  background-color: #1d325f;
  color: white;
}
</style>
<style scoped>
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 20px;
  margin-top: 20px;
  color: #383838;
}
.text-center {
  color: #f7fafc;
  width: 100%;
  height: 100%;
  padding-left: 5%;
  padding-right: 5%;
  margin-top: -10px;
}
</style>
