Moli0
2022-02-15 3d13fff2afc69131bbca9ea98deaa3907bf454f6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<template>
  <div class="my_top_info">
    <!--导航内容-->
    <div class="float-left"
         style="padding-top:10px;">
      <div class="float-left font-size-14 align-center btn btn-default btn-sm top_Nav_Btn"
           v-for="item in openNav"
           :key="item.id"
           :class="{isActivity:nowNav==item.id}"
           draggable="true"
           @dragover="allowDrop"
           @drop="dropDiv(item.id)"
           @dragstart="dragStart(item.id)"
           @click="SetNowNav(item.id)">
        <span>{{item.text}}</span>
        <div v-if="!item.isMain"
             class="btn-close"
             @click.stop="CloseTab(item.id)">x</div>
      </div>
    </div>
 
    <!--右侧用户内容-->
    <div class="align-right"
         style="width:auto;height:50px;">
      <span style="line-height:50px;"><i class="el-icon-user"></i></span>
      <span style="line-height:50px;margin-right:30px;">
        <span class="font-size-16"
              id="headUserName">
          &nbsp;&nbsp;{{userInfo.userName}}
        </span>
      </span>
      <span style="line-height:50px;margin-right:20px;">
        <a href="/Notice/MessageNotice">
          <i class="el-icon-message-solid"></i><span id="headWarnningNumber"
                style="color:red;margin-left:5px">
            {{userInfo.msgCount}}
          </span>
        </a>
      </span>
      <el-button type="primary"
                 style="margin-right:20px;">退出</el-button>
    </div>
  </div>
</template>
 
<script>
export default {
  name: 'topNav',
  data () {
    return {
      oldid: -1,
      newid: -1,
      openNav: this.$parent.openNav,
      nowNav: 1,
      userInfo: {
        userName: 'Moli',
        userEmail: 'linmolilin@gmail.com',
        msgCount: 10,
      }
    }
  },
  created () {
  },
  methods: {
    SelectNav (id) {
      this.nowNav = id;
    },
    SetNowNav (id) {
      this.nowNav = id;
      this.$parent.SetNowNav(id);
    },
    CloseTab (id) {
      this.$parent.CloseNav(id);
    },
    allowDrop (ev) {
      ev.preventDefault();
    },
    dragStart (id) {
      this.oldid = id;
    },
    dropDiv (id) {
      this.newid = id;
      this.$parent.UpdateNavPosition(this.newid, this.oldid);
    }
  }
}
</script>