<template>
  <div class="project-search">
    <dataSearch @bindSetQuery="setQuery" :allowCreate="checkAuth('/source/data/create')"></dataSearch>
    <dataList :queryForm="queryForm" :allowEdit="checkAuth('/source/data/update')" :allowDelete="checkAuth('/source/data/delete')"></dataList>
  </div>

</template>

<script>
import { mapGetters } from 'vuex'
import {dataSearch,dataList} from "./components"
export default{
  components:{
    dataSearch,
    dataList,
  },
  data(){
    return{
        queryForm:{
          page:1,
          pageSize:10,
          code:'',
          name:'',
          status:''
        },
    }
  },
  computed: {
    ...mapGetters([
  	'roleInfo',
  	'authList'
    ])
  },

  methods:{

    checkAuth(path){
      /* 原始数据权限 */
    	/* if(this.roleInfo.is_admin==1){
    	  return true;
    	} */
    	/* let auth=this.authList.filter(o=>o.type==999 && o.path==path);
    	if(auth.length>0){
    	  return true;
    	} */
    	return true;
    },

    setQuery(e){
      this.queryForm=e;
    }

  }
}
</script>

<style lang="scss">
@import './search.scss'
</style>
