2023西安数博会CIM演示-【前端】-Web
AdaKing88
2023-08-21 bc03b832caa49bbcd2674fe4cae3701b5059bf95
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<template>
  <div id="leftMain" :style="{ 'width': isShowDrawer ? '420px' : '55px' }">
    <!-- 左侧业务按钮 START -->
    <div class="leftCompass">
      <div class="leftMenu">
        <div class="Submenu" @click="openMenu('./config/layers_xian_fl.json','fl')">
          <img src="../../../assets/img/描边 拷贝 5.png" alt="" >
          <div class="titleMenu">数据目录</div>
        </div>
        <img src="../../../assets/img/------------.png" alt="" class="divider">
        <div class="Submenu" @click="openMenu('./config/layers_xian_fj.json','fj')">
          <img src="../../../assets/img/椭圆 1 拷贝 5.png" alt="" >
          <div class="titleMenu">成果资源</div>
        </div>
      </div>
    </div>
    <!-- 中间切换按钮 START -->
    <div class="switchBtn" :style="{ 'left': isShowDrawer ? '280px' : '28px' }">
      <div class="switchBtnImg" v-show="!isShowDrawer"></div>
      <div class="switchBtnclick" :style="{'margin-left': isShowDrawer ? '20px' : '15px' }"
       @click="abc()"></div>
    </div>
    <!-- 中间切换按钮 END -->
    <div class="content" :style="{ 'width': isShowDrawer ? '340px' : '55px' }">
      <LayerPanel class="dataTree" ref="layercontrol"></LayerPanel>
    </div>
    <div class="Divider" style="top:0%;background: linear-gradient(to top, rgba(137,193,255,0.5) 0%, rgba(0,255,255,0.2) 100%);"   v-show="isShowDrawer"></div>
    <div class="Divider" style="top:50%;background: linear-gradient(to bottom, rgba(137,193,255,0.5) 0%, rgba(0,255,255,0.2) 100%);" v-show="isShowDrawer"></div>
  </div>
</template>
<script>
import LayerPanel from "../../../components/developcenter/mainViewer/LayerPanel-bk.vue";
export default {
  data() {
    return {
      isShowDrawer: false, // 定义关闭按钮
      flFirst:true,
      fjFirst:true,
      type:""
    }
  },
  components:{
    LayerPanel
  },
  methods: {
    openMenu(url,type){
      if(this.isShowDrawer==false) this.isShowDrawer=true
        if(type == "fl"){
          if(!this.fjFirst && type != this.type) this.$refs.layercontrol.updataShow("fj")
          this.$refs.layercontrol.show(url, null, "black",false,"fl");
          this.flFirst = false
          this.type = type
        }else if(type == "fj"){
          if(!this.flFirst && type != this.type) this.$refs.layercontrol.updataShow("fl")
          this.$refs.layercontrol.show(url, null, "black",this.fjFirst,"fj")
          this.fjFirst = false
          this.type = type
        }
    },
    abc(){
      this.isShowDrawer = !this.isShowDrawer;
      if(this.isShowDrawer == false){
        this.$refs.layercontrol.hiddenSubContent()
      }
    }
  },
  mounted() {
    // this.$refs.layercontrol.show(LAYER_CONFIG_PATH, null, "black")
  },
}
</script>
<style lang="less" scoped>
#leftMain {
  position: absolute;
  left: 0px;
  z-index: 999;
  height: 100%;
  display: flex;
  flex-direction: row;
  width:420px;
  background-size: 420px 100%;
  transition: 0.3s ease;
  background-image: url("../../../assets/img/矩形 1 拷贝 3.png");
 
  .leftCompass {
    color: aliceblue;
    width: 52px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: absolute;
    left: 0px;
    // background-image: url("../../../assets/img/矩形 5.png");
    background-size: 52px 100%;
    .leftMenu{
      position: absolute;
      top: 120px;
      .divider{
        padding-left:5px ;
        width: 41px;
        height: 1px;
        margin-bottom:10px;
      }
      .Submenu{
        cursor: pointer;
        margin-bottom:20px;
        img{
          padding-left:7px;
          width: 38px;
          height:40px;
        }
        .titleMenu{
          padding-left:2px;
          width: 50px;
          height: 11px;
          font-size: 12px;
          // font-family: Microsoft YaHei;
          font-weight: 400;
          color: #B6E0FD;
          line-height: 25px;
 
        }
      }
    }
  }
 
  .switchBtn {
    width: 58px;
    height: 100%;
    position:absolute;
    left:28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: 0.3s ease;
    .switchBtnImg {
      width: 58px;
      height: 554px;
      background: url("../../../assets/img/组 6807.png") no-repeat;
      background-size: 100% 100%;
    }
    .switchBtnclick{
      width: 40px;
      height: 40px;
      position: absolute;
      margin-left:5px;
      // background-color: #B6E0FD;
      margin-top:-10px;
      cursor: pointer;
    }
  }
 
  .content {
    color: aliceblue;
    width: 340px;
    height: 100%;
    overflow: hidden;
    transition: 0.3s ease;
    background-size:340px 100%;
    background-image: url("../../../assets/img/左.png");
    .dataTree{
      padding:0px 50px 0px 52px 
    }
  }
 
  .Divider{
    width: 1px;
    height: 50%;
    position:absolute;
    left:54px;
  }
}
</style>