<template>
  <div class="dashboard-editor-container">
    <top title="欢迎使用承揽时代企业端"></top>
    <div class="chart-wrapper">
      <div class="pop" style="width: 65%">
        <div class="out">
          <div class="int">
            <div class="bos">
              <div class="lab">
                <div class="bsg"></div>
                <div class="tit">账户信息</div>
              </div>
              <companyInfo></companyInfo>
              <yrows :cdata="data" row="结算单"></yrows>
            </div>
          </div>
        </div>
        <div class="out">
          <div class="int">
            <div class="bos">
              <div class="lab">
                <div class="bsg"></div>
                <div class="tit">快捷菜单</div>
              </div>
              <yrows :cdata="data" row="快捷菜单"></yrows>
            </div>
          </div>
        </div>
      </div>
      <!--通知消息-->
      <div class="pop" style="width: 35%">
        <div class="out mar0">
          <div class="int">
            <div class="bos">
              <div class="lab">
                <div class="bsg"></div>
                <div class="tit">通知消息</div>
              </div>
              <div class="noticeList" v-if="noticeList.length > 0">
                <div class="nitem" v-for="(item, index) in noticeList" :key="item.id" @click="op('noticeDetail', item)">
                  <div class="ntitle omit">{{ item.title }}</div>
                  <div class="ndate">{{ item.createTime.substring(0, 11) }}</div>
                </div>
              </div>
              <el-empty v-else description="暂无通知消息" :image-size="100"></el-empty>
            </div>
          </div>
        </div>
        <div class="out mar0">
          <div class="int">
            <div class="bos">
              <div class="lab">
                <div class="bsg"></div>
                <div class="tit">企业概览</div>
              </div>
              <yrows :cdata="data" row="企业概览"></yrows>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import noticeDetail from '@/views/work/notice/detail';
import top from '@/views/dashboard/top';
import yrows from '@/views/dashboard/yrows';
export default {
  components: {
    top,
    yrows
  },
  data() {
    return {
      user: this.$store.state.user,
      noticeList: [],
      data: {}
    };
  },
  created() {
    this.getData();
  },
  methods: {
    getData() {
      this.ajax({ url: '/work/company/statistics' }).then((response) => {
        this.data = response.data;
      });
      this.ajax({ url: '/work/notice/queryList' }).then((response) => {
        this.noticeList = response.data;
      });
    },
    op(tag, row) {
      if (tag == 'noticeDetail') {
        this.iframe({ obj: noticeDetail, param: { id: row.id }, title: row.title, width: '58%', height: '75%' });
        return;
      }
    }
  }
};
</script>

<style lang="scss" scoped>
.bos {
  border: 0px;
}
</style>
