<style>
.search-btn .not-type-btn:hover {
  background: #00a0e9;
  border-color: #00a0e9;
}
.config_home {
  background: #f0f2f5;
  padding: 10px;
  margin: -10px;
  overflow-y: hidden;
}
</style>
<template>
  <div class="layout-content-padding">
    <div class="layout-content-main">
      <Row :gutter="10">
        <Col span="12">
          <messagePanel></messagePanel>
        </Col>
        <Col span="12">
          <myTask></myTask>
        </Col>
        <Col span="12">
          <taskCalendar></taskCalendar>
        </Col>
        <Col span="12">
          <UnfinishedContract></UnfinishedContract>
        </Col>
        <Col span="12">
          <UnfinishedItem></UnfinishedItem>
        </Col>
        <Col span="12">
          <YearContractNum></YearContractNum>
        </Col>
        <Col span="12">
          <DetectTypeNum></DetectTypeNum>
        </Col>
        <Col span="12">
          <ContractEndNum></ContractEndNum>
        </Col>
        <Col span="12">
          <YearTestItem></YearTestItem>
        </Col>
        <Col span="12">
          <YearOverItem></YearOverItem>
        </Col>
        <Col span="12">
          <GroupItem></GroupItem>
        </Col>
        <Col span="12">
          <CustomerContract></CustomerContract>
        </Col>
<!--      <div :style="{height}" v-if="moduleList.length" class="config_home">-->
<!--        <Row :gutter="10">-->
<!--          <Col-->
<!--            :sm="{span:item.alias === 'FoodToDoAndOverdue'?24:12}"-->
<!--            v-for="(item,index) in moduleList"-->
<!--            :key="index"-->
<!--            style="margin-bottom: 10px">-->
<!--            &lt;!&ndash; eslint-disable-next-line vue/require-component-is &ndash;&gt;-->
<!--            <component :is="item.alias" @on-result-change="_result" keep-alive></component>-->
<!--          </Col>-->
<!--        </Row>-->
<!--      </div>-->
      </Row>
    </div>
  </div>
</template>
<script>
import Global from '../../api/config'
import { sysOrg } from '../../api'
import statisticalPanel from './statisticalPanel'
import messagePanel from './messagePanel'
import toDoTask from './ToDoTask'
import myTask from './MyTask'
import TaskFlow from './TaskFlow'
import taskCalendar from './task-calendar/TaskCalendar'
import UnfinishedContract from './UnfinishedContract'
import UnfinishedItem from './UnfinishedItem'
import YearContractNum from './YearContractNum'
import DetectTypeNum from './DetectTypeNum'
import ContractEndNum from './ContractEndNum'
import YearTestItem from './YearTestItem'
import YearOverItem from './YearOverItem'
import GroupItem from './GroupItem'
import CustomerContract from './CustomerContract'
export default {
  name: 'Workbench',
  components: {
    // eslint-disable-next-line vue/no-unused-components
    statisticalPanel,
    // eslint-disable-next-line vue/no-unused-components
    messagePanel,
    // eslint-disable-next-line vue/no-unused-components
    myTask,
    // eslint-disable-next-line vue/no-unused-components
    toDoTask,
    // eslint-disable-next-line vue/no-unused-components
    TaskFlow,
    // eslint-disable-next-line vue/no-unused-components
    taskCalendar,
    // eslint-disable-next-line vue/no-unused-components
    UnfinishedContract,
    // eslint-disable-next-line vue/no-unused-components
    UnfinishedItem,
    // eslint-disable-next-line vue/no-unused-components
    YearContractNum,
    // eslint-disable-next-line vue/no-unused-components
    DetectTypeNum,
    // eslint-disable-next-line vue/no-unused-components
    ContractEndNum,
    // eslint-disable-next-line vue/no-unused-components
    YearTestItem,
    // eslint-disable-next-line vue/no-unused-components
    YearOverItem,
    // eslint-disable-next-line vue/no-unused-components
    GroupItem,
    // eslint-disable-next-line vue/no-unused-components
    CustomerContract
  },
  data() {
    return {
      height: document.documentElement.clientHeight - 115 + 'px',
      moduleList: []
    }
  },
  mounted() {
    if (Global.getLn()) {
      this._open()
    }
  },
  methods: {
    // 模块返回结果
    _result(module) {
      switch (module) {
        case 'FoodMyTask':
          this.$bus.emit('task-detail')
          break
      }
    },
    _open() {
      this._myModule()
    },
    _myModule: async function() {
      // this.$store.dispatch('SysModule/listUserFood').then(() => {
      //   this.moduleList = this.$store.state.SysModule.list
      // })
      const result = await sysOrg.getModulesList()
      if (result) {
        console.log('菜单', result)
      }
    }
  }
}
</script>

<style scoped>
</style>
