<template>
  <div class="dashboard-editor-container">
    <div class="mtitle">
      <span style="font-size: 19px">
        <span>{{ user.nickName }}</span>
        <span class="roleName" v-if="user.roleName">({{ user.roleName }})</span>
        <span>您好，欢迎使用承揽时代企业端</span>
      </span>
      <iframe
        allowtransparency="true"
        frameborder="0"
        width="180"
        height="36"
        scrolling="no"
        style="padding-top: 10px"
        src="//tianqi.2345.com/plugin/widget/index.htm?s=3&z=2&t=0&v=0&d=2&bd=0&k=&f=#545555&ltf=#545555&htf=ffffff&q=1&e=1&a=1&c=72036&w=180&h=36&align=center"
      ></iframe>
    </div>
    <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>
            </div>
          </div>
        </div>
        <div class="out">
          <div class="int">
            <div class="bos">
              <div class="lab">
                <div class="bsg"></div>
                <div class="tit">账户信息</div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <!--通知消息-->
      <div class="pop" style="width: 35%">
        <div class="out" style="margin-right: 0px">
          <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>
    </div>
  </div>
</template>

<script>
import noticeDetail from '@/views/work/notice/detail';
export default {
  components: {},
  data() {
    return {
      user: this.$store.state.user,
      noticeList: [],
      data: {}
    };
  },
  created() {
    this.getData();
  },
  methods: {
    getData() {
      /* this.ajax({ url: '/home/index', data: { deptId: this.deptId } }).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>
