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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<template>
  <div class="width100vw"
       style="height:100vh;">
    <div id="miniNav"
         style="width:50px;height:100vh;position:fixed;overflow:hidden;background-color:#252525">
      <div style="position:absolute;width:50px;height:50px;color:white;font-size:30px;padding:10px;"
           onclick="NavControl()">
        <span class="glyphicon glyphicon-th"></span>
      </div>
      <hr style="margin-top:60px;" />
    </div>
    <div id="iframeNav"
         class="my_Left_nav_web"
         style="overflow:hidden;background-color:rgba(255,255,255,0);border:none;margin:0;padding:0">
      <leftNav ref="leftNav"></leftNav>
    </div>
    <div id="adminIndex"
         style="margin-left:250px;width:auto;background-color:#000;background-color:#fff;height:100vh;overflow:hidden;min-width:500px;">
      <topNav ref="topNav"></topNav>
      <div class="boxpadding">
        <router-view v-for="item in openNav"
                     :key="item.id"
                     :class="{'display-none':nowNav!=item.id}"
                     :name="item.name"></router-view>
      </div>
    </div>
  </div>
</template>
 
<script>
// const leftNav = () => import('../../components/Nav/LeftNav.vue');
 
import leftNav from '../../components/Nav/LeftNav'
import topNav from '../../components/Nav/TopNav'
 
export default {
  data () {
    return {
      openNav: [],
      nowNav: 1
    }
  },
  created () {
 
  },
  components: {
    leftNav,
    topNav
  },
  methods: {
    SetNowNav (navId) {
      this.nowNav = navId;
      this.$refs.topNav.SelectNav(navId);
    },
    AddNav (obj) {
      let b = false;
      $.each(this.openNav, function (i, item) {
        if (item.id == obj.id) {
          b = true;
          return;
        }
      });
      if (!b) {
        this.openNav.push(obj);
      }
      this.SetNowNav(obj.id);
    },
    CloseNav (navId) {
      if (navId == 0) {
        return;
      }
      for (var i = 0; i < this.openNav.length; i++) {
        if (this.openNav[i].id == navId) {
          this.openNav.splice(i, 1);
          if (navId == this.nowNav) {
            this.SetNowNav(this.openNav[i - 1].id);
          }
          return;
        }
      }
    },
    UpdateNavPosition (id1, id2) {
      var temp = {};
      var index1 = -1;
      var index2 = -1;
      for (var i = 0; i < this.openNav.length; i++) {
        if (this.openNav[i].id == id1) {
          index1 = i;
        }
        if (this.openNav[i].id == id2) {
          index2 = i;
        }
      }
      if (index1 + index2 > 0) {
        temp = this.openNav[index1];
        this.openNav[index1] = this.openNav[index2];
        this.openNav[index2] = temp;
      }
    },
    InitNavPostion () {
 
    },
  }
}
</script>