<template>
  <el-container>
    <el-header style="padding: 15px">
      <ZyjhHead ref="zyjhSearchParams" @initData="initData" @$plsr="plsr" @$save="save" />
    </el-header>
    <el-container>
      <el-main>
        <VxeGrid ref="_table" v-bind="gridOptions" />
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import ZyjhHead from './comps/head'
import zyjhConfig from './index'

export default {
  name:"Zyjh",
  components: {ZyjhHead},
  data(){
    return {
      list:{},
      gridOptions:{}
    }
  },
  created(){
    const {options,columns}=zyjhConfig()
    this.gridOptions=options
    this.gridOptions.columns=columns
  },
  mounted(){},
  methods:{
    save(){
      const data=this.$refs._table.getUpdateRecords();
      console.log(data)
      if(data.length===0){
        this.$message.warning('没有修改的数据无需保存')
        return
      }
    },
    plsr(qgjhrq){
      const _table=this.$refs._table
      const _data=_table.getCheckboxRecords()
      if (_data.length===0){
        this.$message.warning('请选择待处理的数据')
        return
      }
      for (const item of _data) {
        item.qgjhrq=qgjhrq
      }
      _table.updateData()
    },
    initData(data){
      this.list=data;
      this.gridOptions.data=data;
    }
  }
}
</script>

<style lang="scss" scoped >

.el-header{margin:0;padding: 5px;height:auto;
  .el-input{
    width: 140px;
  }
  .el-select{
    width: 140px;
  }

}
.el-container{padding: 0;margin:0;}
.el-main{padding: 0;}
.el-col{padding: 0;height: 32px;}
.el-aside{background: #fff;padding: 0}
.el-container{padding: 0}
.el-row {}
.el-row:last-child {margin-bottom: 0; }

.tableStyles{
  background: #0a76a4;
}

.my-dropdown {
  width: 400px;
  height: 400px;
  background-color: #fff;
  border: 1px solid #dcdfe6;
  box-shadow: 0 0 6px 2px rgba(0, 0, 0, 0.1);
  font-size: 12px;

}
.mytable1{

}
.borderClass{

}
.vxe-input {
  display: inline-block !important;
  position: relative !important;
  width: auto;
}
.el-input {
  display: inline-block !important;
  position: relative !important;
  width: auto;
}
.keyword-lighten {
  color: #000;
  background-color: #FFFF00;
}

.vxe-textarea--inner {
  line-height: inherit;
}
.el-form-item__label-wrap {
  margin-left: 0px !important;
  float: left;
}
.fontClass{
  font-size: 12px;
  font-weight: bold;
}


</style>
