<template>
  <div>
    <div class="user">
      <span class="title1 fl">投 诉 管 理 系 统</span>
      <div class="content">
        <div class="userImg">
          <i class="el-icon-s-custom"></i>
        </div>
        <span class="name">{{ userInfo.userName }}</span>
      </div>
    </div>

    <div class="list">
      <div class="fl qxContent">
        <el-row v-for="(item, index) in userInfo.functions" :key="index">
          <el-col :span="24" class="qxTitle" :style="index == 0? 'margin-top: 0px;':''">{{ item.systemName }}</el-col>
          <el-col :span="6" v-for="(it,ind) in item.list" :key="ind">
            <div  class="content pointer">
              <div class="img" @click="jump(it)">
                <!-- <i class="el-icon-s-tools"></i> -->
                <img :src="it.webIcon" alt="" style="width: 30px; height: 30px"/>
                <!-- <div :class="'icon icon' + it.id"></div> -->
              </div>
              <span class="name" @click="jump(it)">{{ it.name }}</span>
            </div>
          </el-col>
        </el-row>
      </div>
      <div class="fl noticesContent">
        <el-row>
          <el-col :span="24" class="noticestitle">公告</el-col>
          <el-col :span="24" v-for="(item,index) in userInfo.notices" :key="index" class="noticesList pointer">
            <span class="yuan fl"></span>
            <span class="fl font ellipsis" :title="item.content">{{ item.content }}</span>
            <span class="fr time">{{ item.createTime }}</span>
          </el-col>
        </el-row>
      </div>
    </div>
  </div>
</template>
  
  <script>
import { getVerification } from "../../common/js/home";
export default {
  name: "orderSearch",
  components: {},
  data() {
    return {
      userInfo: {},
    };
  },
  computed: {},
  watch: {},
  created() {
    console.log(this.$route);
    this.init();
  },
  methods: {
    init() {
      let params = {
        token: sessionStorage.getItem("Authorization-Token"),
        system: "web",
        fromSystem: sessionStorage.getItem("Authorization-fromSystem"),
      };
      getVerification(params).then((res) => {
        this.userInfo = res.data;
        sessionStorage.setItem("userNameData", this.userInfo.userName);
      });
    },
    jump(val) {
      if (val.name == "权限和日志管理") {
        let params = {
          token: sessionStorage.getItem("Authorization-Token"),
          system: "permission",
          fromSystem: sessionStorage.getItem("Authorization-fromSystem"),
        };
        getVerification(params).then((res) => {
          if (res.success) {
            let routeUrl = this.$router.resolve({
              path: val.url,
            });
            window.open(routeUrl.href, "_blank");
          } else {
            this.$message({
              type: "error",
              message: res.message,
            });
          }
        });
      } else {
        // let routeUrl = this.$router.resolve({
        //   path: val.url,
        // });
        window.open(val.url, "_blank");
      }
    },
  },
};
</script>
  
<style lang="less" scoped>
@import "../../common/less/public.less";
.user {
  width: 100%;
  height: 50px;
  line-height: 50px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
  .title1 {
    font-size: 20px;
    margin-left: 30px;
    color: #409eff;
  }
  .content {
    float: right;
    margin-right: 30px;
    .userImg {
      font-size: 25px;
      float: left;
    }
    .name {
      margin-left: 5px;
      float: left;
    }
  }
}
.title {
  width: 100%;
  height: 50px;
  text-align: center;
  font-size: 30px;
  line-height: 50px;
  margin-top: 30px;
  margin-bottom: 20px;
}
.list {
  width: 1000px;
  margin: 40px auto;
  height: auto;
  .qxContent{
    width: 790px;
    // padding:10px;
    // box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
    .qxTitle{
      height: 16px;
      line-height: 16px;
      font-size: 16px;
      font-weight: bold;
      border-left: 5px solid #606266;
      padding-left: 10px;
      margin-top: 20px;
      color: #606266;
    }
  }
  .content {
    width: 85%;
    height: 50px;
    line-height: 50px;
    margin-top: 20px;
    padding-left: 10px;
    border-radius: 10px;
    border: 1px solid #ebeef5;
    .img {
      font-size: 30px;
      float: left;
      // line-height: 60px;
      margin-top: 4px;
    }
    .name {
      float: left;
      margin-left: 10px;
    }
  }
  .content:hover {
    border: 1px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
  }
  .noticesContent{
    width: 200px;
    margin-left: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
    .noticestitle {
      height: 40px;
      line-height: 40px;
      background-color: #409eff;
      color: #fff;
      padding-left: 10px;
      font-size: 16px;
    }
    .noticesList{
      height: 30px;
      line-height: 30px;
      padding: 0 10px;
      .yuan{
        width: 4px;
        height: 4px;
        display: inline-block;
        border-radius: 2px;
        background-color: #409eff;
        margin-top: 14px;
        margin-right: 5px;
      }
      .font{
        width: 100px;
      }
      .time {
        font-size: 12px;
      }
    }
    .noticesList:hover .font{
      font-weight: bold;
    }
  }
}

.icon-1 {
  background: url(../../common/images/icon8.png) 0 0 no-repeat;
}
.icon1 {
  background: url(../../common/images/icon1.png) 0 0 no-repeat;
}
.icon2 {
  background: url(../../common/images/icon2.png) 0 0 no-repeat;
}
.icon3 {
  background: url(../../common/images/icon3.png) 0 0 no-repeat;
}
.icon4 {
  background: url(../../common/images/icon4.png) 0 0 no-repeat;
}
.icon5 {
  background: url(../../common/images/icon5.png) 0 0 no-repeat;
}
.icon6 {
  background: url(../../common/images/icon6.png) 0 0 no-repeat;
}
.icon7 {
  background: url(../../common/images/icon7.png) 0 0 no-repeat;
}
.icon8 {
  background: url(../../common/images/icon8.png) 0 0 no-repeat;
}
.icon9 {
  background: url(../../common/images/icon9.png) 0 0 no-repeat;
}
.icon10 {
  background: url(../../common/images/icon10.png) 0 0 no-repeat;
}
.icon {
  width: 30px;
  height: 30px;
  background-size: 100% 100%;
  margin-top: 11px;
}
</style>
  