| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277 |
- <template>
- <div class="leftBarMapContainer">
- <ul class="tabMap">
- <li v-for="(item,index) in leftBarList" :class="{'activeBar':index==currentTab}" @click="showTab(index,item)">
- <i :class="item.icon"></i>
- {{item.title}}
- </li>
- </ul>
- <div class="map-list" v-if="isShow">
- <div class="item-list" >
- <div class="item-title">
- <i class="el-icon-menu"></i>
- <span>{{leftBarList[currentTab].title}}</span>
- </div>
- <div class="item-date" v-if="currentTab == MapList.length-1">
- <el-date-picker
- v-model="dateRange"
- type="daterange"
- style="width: 100%"
- :clearable="false"
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期">
- </el-date-picker>
- </div>
- <div class="box-content">
- <ul v-for="(item,index) in MapList[currentTab].pageTab">
- <span class="box-item" v-if="currentTab == MapList.length-1">{{item.title}}</span>
- <li v-for="(item1,index1) in item.fil" :class="{'activeLi':item1.checked}" @click="showLayer(item1)" :title="item1.title">
- <div class="box-top">
- <i :class="item1.icon" v-if="item1.icon && currentTab != MapList.length-1"></i>
- <i class="el-icon-question" style="font-size: 25px;color:#818589" v-else></i>
- </div>
- <div>{{item1.name}}</div>
- </li>
- </ul>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import request from '@util/gw_ajax_request.js'
- import {leftBarData,leftBarData_FJ,mapData,mapData_FJ} from '../config/leftBarTab.js'
- export default {
- props: [],
- data() {
- return {
- leftBarList:localStorage.getItem('currentRlcode').indexOf("35")>-1?leftBarData_FJ:leftBarData,
- currentTab:undefined,
- isShow:false,
- MapList:localStorage.getItem('currentRlcode').indexOf("35")>-1?mapData_FJ:mapData,
- menuList:[],
- dateRange:[new Date().getFullYear()+"-01-01",new Date().getFullYear()+((new Date().getMonth()+1)>9?+"-"+(new Date().getMonth()+1):"-0"+(new Date().getMonth()+1))+(new Date().getDate()>9?"-"+new Date().getDate():"-0"+new Date().getDate())]
- };
- },
- watch:{
- dateRange(newValue, oldValue) {
- //debugger
- if(this.MapList && (this.MapList.length-1==this.currentTab)){
- this.MapList[this.MapList.length-1].pageTab.forEach((item)=>{
- item.fil.forEach((item1)=>{
- if(item1.checked){
- item1.startTime = newValue[0];
- item1.endTime = newValue[1];
- this.$emit('showLayer',item1);
- }
- })
- })
- }
- }
- },
- mounted(){
- this.getPblmList();
- },
- methods:{
- getPblmList(){
- let _self = this;
- this.MapList[_self.MapList.length-1].pageTab = [];
- request.get(`/dc/general/info/getObjTypeList`).then(res => {
- if(res.success) {
- let i = 0;
- for (const key in res.data) {
- _self.MapList[_self.MapList.length-1].pageTab.push({
- title:key,
- fil:[]
- })
- res.data[key].forEach(item=>{
- _self.MapList[_self.MapList.length-1].pageTab[i].fil.push({
- id:"pblmDcGraphicLayer_"+item.code,
- title:item.name,
- name:item.name?(item.name.length>4?item.name.substring(0,4)+"...":item.name):"",
- nm:item.name?(item.name.length>5?item.name.substring(0,5)+"...":item.name):"",
- icon:"watericon1-shujufuwu",
- startTime:this.dateRange[0],
- endTime:this.dateRange[1],
- code:item.code,
- checked: false
- });
- })
- i++
- }
- // res.data.forEach((item)=>{
- // _self.MapList[1].pageTab[0].fil.push({
- // id:"pblmDcGraphicLayer_"+item.code,
- // title:item.name,
- // name:item.name?(item.name.length>4?item.name.substring(0,4)+"...":item.name):"",
- // nm:item.name?(item.name.length>5?item.name.substring(0,5)+"...":item.name):"",
- // icon:"watericon1-shujufuwu",
- // code:item.code,
- // checked: false
- // });
- // })
- }
- })
- },
- showLayer(item){
- //debugger
- if(item.id.substring(0,7) != 'oneMap_' && item.id.substring(0,9) != 'superMap_'){
- item.checked = !item.checked;
- item.startTime = this.dateRange[0];
- item.endTime = this.dateRange[1];
- }
- this.$emit('showLayer',item);
- },
- showTab(index,obj){
- if(this.currentTab==index){
- this.currentTab = undefined;
- this.isShow = false;
- }else{
- this.currentTab = index;
- this.currentLi = undefined;
- this.isShow = true;
- }
- }
- }
- };
- </script>
- <style scoped>
- .leftBarMapContainer{
- position: fixed;
- left:10px;
- top:180px;
- width: 40px;
- min-height: 600px;
- background: white;
- box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
- }
- .tabMap{
- list-style: none;
- width: 100%;
- height: calc(100% - 300px);
- background: white;
- border-top: 2px solid #ff6412;
- border-bottom: 2px solid #ff6412;
- }
- .tabMap li{
- writing-mode: vertical-lr;
- text-orientation: upright;
- display: flex;
- justify-content: center;
- align-items: center;
- height: 150px;
- text-align: center;
- width: 100%;
- font-size: 17px;
- font-weight: bold;
- color: #646972;
- border-bottom: 1px solid #d3ced2;
- cursor: pointer;
- letter-spacing: 5px;
- }
- .tabMap li:last-child{
- border-bottom: 0px !important;
- }
- .tabMap li i{
- color:grey;
- font-size: 23px;
- margin: 0px 0px 5px 0px;
- }
- .activeBar{
- color:white !important;
- background-image: url(../../../assets/img/rough-cloth-light.png) !important;
- background-color: #1862f7!important;
- }
- .activeLi{
- background: #FF9800 !important;
- color:white !important;
- }
- .activeLi i{
- color:white !important;
- }
- .activeBar i{
- color:white !important;
- }
- .map-list{
- position: fixed;
- left: 55px;
- width: 300px;
- height: calc(100% - 300px);
- top: 180px;
- background: #f5f2f2;
- box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
- border-top: 2px solid #ff6412;
- border-bottom: 2px solid #ff6412;
- overflow: hidden;
- }
- .item-list{
- width: 100%;
- height:100%;
- }
- .item-title{
- line-height: 35px;
- text-indent: 10px;
- box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
- color: white;
- font-size: 17px;
- font-weight: bold;
- background-image: url(../../../assets/img/rough-cloth-light.png);
- background-color: #1862f7;
- }
- .item-date{
- width: 100%;
- height:30px;
- }
- .item-title span{
- margin-left: 10px;
- color:white;
- }
- .item-title i{
- color:white;
- }
- .item-list ul{
- list-style: none;
- width: 100%;
- min-height: 80px;
- margin-top: 10px;
- }
- .item-list ul li{
- float: left;
- width: calc(33.33% - 6px);
- margin-bottom: 10px;
- margin-left: 3px;
- margin-right: 3px;
- text-align: center;
- font-size: 12px;
- line-height: 25px;
- cursor: pointer;
- color: #2d2d2d;
- background: white;
- border-radius: 5px;
- box-shadow: 0 0px 2px 0 rgb(0 0 0 / 10%);
- }
- .box-item{
- display: flex;
- width: 100%;
- align-items: center;
- height: 30px;
- text-align: left;
- text-indent: 5px;
- font-size: 14px;
- font-weight: bold;
- color:#7a7f83;
- }
- .box-top{
- margin-top: 5px;
- }
- .box-content{
- width: 100%;
- height:calc(100% - 80px);
- overflow: auto;
- }
- </style>
|