<template>
  <div class="dashboard-container">
    <el-form :model="peopleform" label-width="88px" ref="peopleform">
      <div class="search-div">
        <el-row>
          <el-col :span="8">
            <div class="search-input">
              <el-form-item label="所属地区" label-width="70px" class="fourLabel">
                <el-select class="wdh" placeholder="请选择" v-model="peopleform.companyHierarchy" clearable>
                  <el-option v-for="item in dataDictioPubArr" :key="item.value" :label="item.dictName" :value="item.dictName"></el-option>
                </el-select>
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="8">
            <div>
              <el-form-item label="所属监测点" class="fourLabel">
                <el-input placeholder="请输入" v-model="peopleform.companyName" clearable>
                </el-input>
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="8">
            <div class="search-button">
              <span class="search-line"></span>
              <div class="search-select" @click="searchShowMore">更多条件 <i class="el-icon-arrow-up" v-show="searchShowMoreBool"></i><i class="el-icon-arrow-down" v-show="!searchShowMoreBool"></i></div>
              <el-button class="outButton" size="mini" type="primary">
                <i class="iconfont">&#xe67f;</i>
                查询</el-button>
              <!-- <el-button class="outButton" icon="el-icon-search" size="mini" type="primary">清空</el-button> -->
            </div>
          </el-col>
          <div v-show="searchShowMoreBool">
            <el-col :span="8">
              <div>
                <el-form-item label="用户名称" label-width="70px" class="fourLabel">
                  <el-input placeholder="请输入" v-model="peopleform.companyName" clearable>
                  </el-input>
                </el-form-item>
              </div>
            </el-col>
            <el-col :span="8">
              <div>
                <el-form-item label="标题" class="fourLabel">
                  <el-input placeholder="请输入" v-model="peopleform.companyName" clearable>
                  </el-input>
                </el-form-item>
              </div>
            </el-col>
            <el-col :span="8">
              <div>
                <el-form-item label="状态" class="fourLabel">
                  <el-select class="wdh" placeholder="请选择" v-model="peopleform.status" clearable>
                    <el-option v-for="item in status" :key="item.value" :label="item.dictName" :value="item.dictName"></el-option>
                  </el-select>
                </el-form-item>
              </div>
            </el-col>
          </div>
        </el-row>
      </div>
      <el-row>
        <div class="addBtnBg">
          <el-button class="outButton" size="mini" @click="addBtn" type="primary">
            <i class="iconfont">&#xe697;</i>
            发布</el-button>
        </div>
      </el-row>
    </el-form>
    <el-row>
      <el-table tooltip-effect="dark" style="width: 100%;" align="center" border stripe highlight-current-rowv-loading="tableLoading" :data="tableData">
        <el-table-column align="center" label="序号" width="60">
          <template slot-scope="scope"><span>{{scope.$index+1}}</span></template>
        </el-table-column>
        <el-table-column align="center" :show-overflow-tooltip="true" label="所属地区" prop="companyName">
        </el-table-column>
        <el-table-column align="center" :show-overflow-tooltip="true" label="所属监测点" prop="companyHierarchy">
        </el-table-column>
        <el-table-column align="center" :show-overflow-tooltip="true" prop="reporter" label="用户名称">
        </el-table-column>
        <el-table-column align="center" :show-overflow-tooltip="true" prop="reporter" label="状态">
        </el-table-column>
        <el-table-column align="center" :show-overflow-tooltip="true" prop="reporter" label="稿件标题">
        </el-table-column>
        <el-table-column align="center" :show-overflow-tooltip="true" prop="reporter" label="投稿时间">
        </el-table-column>
        <el-table-column width="200" label="操作">
          <template slot-scope="scope">

            <el-tooltip class="item" effect="light" content="编辑" placement="top">
              <el-button class="button operate_edit_btn" size="mini" type="primary" @click.stop="see(scope.row)">
                <i class="iconfont">&#xe693;</i>
              </el-button>
            </el-tooltip>
            <el-tooltip class="item" effect="light" content="查看" placement="top">
              <el-button class="button operate_show_btn" size="mini" type="primary" @click.stop="see(scope.row)">
                <i class="iconfont">&#xe67e;</i>
              </el-button>
            </el-tooltip>
            <el-tooltip class="item" effect="light" content="审核" placement="top">
              <el-button class="button operate_check_btn" size="mini" type="primary" @click.stop="see(scope.row)">
                <i class="iconfont">&#xe613;</i>
              </el-button>
            </el-tooltip>

          </template>
        </el-table-column>
      </el-table>
      <!-- 分页开始 -->
      <div class="pagination-container">
        <el-pagination class="right" :current-page.sync="limit.page" :page-size="limit.size" :page-sizes="[10,20,30,40]" :total="limit.total" @size-change="handleChangeSize" @current-change="handleCurrentChangePage" layout="total, sizes, prev, pager, next, jumper">
        </el-pagination>
      </div>
    </el-row>

  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: 'Daily',
  data() {
    return {
      searchShowMoreBool: false,
      peopleform: {},
      yearArr: [{
        index: 1,
        value: '发布'
      }],
      status: [{
        index: 1,
        dictName: '未提交',
      }, {
        index: 2,
        dictName: '已提交',
      }, {
        index: 3,
        dictName: '审核通过',
      }, {
        index: 4,
        dictName: '驳回',
      }],
      dataDictioPubArr: [{
        index: 1
      }],
      tableData: [{
        index: 1
      }],
      limit: {
        page: 1,
        size: 10,
        total: 0
      }
    }
  },
  computed: {
    ...mapGetters([
      'name'
    ])
  },
  methods: {
    //更多条件点击事件
    searchShowMore() {
      this.searchShowMoreBool = !this.searchShowMoreBool;
    },
    see(row) {

    },
    handleChangeSize(value) {

    },
    handleCurrentChangePage(value) {
    },
    addBtn() {
      this.$router.push({ path: '/onlineContribute/detail' })
    }
  }
}
</script>

<style lang="scss" scoped>
.search {
  &-div {
    .el-col-8 {
      width: 32%;
      height: 48px;
      .search-input {
        .el-form-item {
          // display: inline-block;
          // width: auto!important;
          // margin-bottom: 15px;
        }
      }
      .search-button {
        margin-right: 40px;
        float: right;
        .search-line {
          cursor: pointer;
          border-left: 1px dashed #737bf1;
          height: 38px;
          display: inline-block;
          margin-right: 14px;
          float: left;
        }
        .search-select {
          color: #409eff;
          background: #deebf9;
          border-color: #b3d8ff;
          display: inline-block;
          height: 36px;
          line-height: 36px;
          margin-right: 10px;
          border-radius: 4px;
          font-size: 14px;
          padding: 0 8px;
          cursor: pointer;
        }
      }
    }
  }
}
</style>
