ffcb97271b44af865c6936a6dc99ae180af8bd2d.svn-base 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <template>
  2. <div class="leftBarMapContainer">
  3. <ul class="tabMap">
  4. <li v-for="(item,index) in leftBarList" :class="{'activeBar':index==currentTab}" @click="showTab(index,item)">
  5. <i :class="item.icon"></i>
  6. {{item.title}}
  7. </li>
  8. </ul>
  9. <div class="map-list" v-if="isShow">
  10. <div class="item-list" >
  11. <div class="item-title">
  12. <i class="el-icon-menu"></i>
  13. <span>{{leftBarList[currentTab].title}}</span>
  14. </div>
  15. <div class="item-date" v-if="currentTab == MapList.length-1">
  16. <el-date-picker
  17. v-model="dateRange"
  18. type="daterange"
  19. style="width: 100%"
  20. :clearable="false"
  21. value-format="yyyy-MM-dd"
  22. range-separator="至"
  23. start-placeholder="开始日期"
  24. end-placeholder="结束日期">
  25. </el-date-picker>
  26. </div>
  27. <div class="box-content">
  28. <ul v-for="(item,index) in MapList[currentTab].pageTab">
  29. <span class="box-item" v-if="currentTab == MapList.length-1">{{item.title}}</span>
  30. <li v-for="(item1,index1) in item.fil" :class="{'activeLi':item1.checked}" @click="showLayer(item1)" :title="item1.title">
  31. <div class="box-top">
  32. <i :class="item1.icon" v-if="item1.icon && currentTab != MapList.length-1"></i>
  33. <i class="el-icon-question" style="font-size: 25px;color:#818589" v-else></i>
  34. </div>
  35. <div>{{item1.name}}</div>
  36. </li>
  37. </ul>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. </template>
  43. <script>
  44. import request from '@util/gw_ajax_request.js'
  45. import {leftBarData,leftBarData_FJ,mapData,mapData_FJ} from '../config/leftBarTab.js'
  46. export default {
  47. props: [],
  48. data() {
  49. return {
  50. leftBarList:localStorage.getItem('currentRlcode').indexOf("35")>-1?leftBarData_FJ:leftBarData,
  51. currentTab:undefined,
  52. isShow:false,
  53. MapList:localStorage.getItem('currentRlcode').indexOf("35")>-1?mapData_FJ:mapData,
  54. menuList:[],
  55. 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())]
  56. };
  57. },
  58. watch:{
  59. dateRange(newValue, oldValue) {
  60. //debugger
  61. if(this.MapList && (this.MapList.length-1==this.currentTab)){
  62. this.MapList[this.MapList.length-1].pageTab.forEach((item)=>{
  63. item.fil.forEach((item1)=>{
  64. if(item1.checked){
  65. item1.startTime = newValue[0];
  66. item1.endTime = newValue[1];
  67. this.$emit('showLayer',item1);
  68. }
  69. })
  70. })
  71. }
  72. }
  73. },
  74. mounted(){
  75. this.getPblmList();
  76. },
  77. methods:{
  78. getPblmList(){
  79. let _self = this;
  80. this.MapList[_self.MapList.length-1].pageTab = [];
  81. request.get(`/dc/general/info/getObjTypeList`).then(res => {
  82. if(res.success) {
  83. let i = 0;
  84. for (const key in res.data) {
  85. _self.MapList[_self.MapList.length-1].pageTab.push({
  86. title:key,
  87. fil:[]
  88. })
  89. res.data[key].forEach(item=>{
  90. _self.MapList[_self.MapList.length-1].pageTab[i].fil.push({
  91. id:"pblmDcGraphicLayer_"+item.code,
  92. title:item.name,
  93. name:item.name?(item.name.length>4?item.name.substring(0,4)+"...":item.name):"",
  94. nm:item.name?(item.name.length>5?item.name.substring(0,5)+"...":item.name):"",
  95. icon:"watericon1-shujufuwu",
  96. startTime:this.dateRange[0],
  97. endTime:this.dateRange[1],
  98. code:item.code,
  99. checked: false
  100. });
  101. })
  102. i++
  103. }
  104. // res.data.forEach((item)=>{
  105. // _self.MapList[1].pageTab[0].fil.push({
  106. // id:"pblmDcGraphicLayer_"+item.code,
  107. // title:item.name,
  108. // name:item.name?(item.name.length>4?item.name.substring(0,4)+"...":item.name):"",
  109. // nm:item.name?(item.name.length>5?item.name.substring(0,5)+"...":item.name):"",
  110. // icon:"watericon1-shujufuwu",
  111. // code:item.code,
  112. // checked: false
  113. // });
  114. // })
  115. }
  116. })
  117. },
  118. showLayer(item){
  119. //debugger
  120. if(item.id.substring(0,7) != 'oneMap_' && item.id.substring(0,9) != 'superMap_'){
  121. item.checked = !item.checked;
  122. item.startTime = this.dateRange[0];
  123. item.endTime = this.dateRange[1];
  124. }
  125. this.$emit('showLayer',item);
  126. },
  127. showTab(index,obj){
  128. if(this.currentTab==index){
  129. this.currentTab = undefined;
  130. this.isShow = false;
  131. }else{
  132. this.currentTab = index;
  133. this.currentLi = undefined;
  134. this.isShow = true;
  135. }
  136. }
  137. }
  138. };
  139. </script>
  140. <style scoped>
  141. .leftBarMapContainer{
  142. position: fixed;
  143. left:10px;
  144. top:180px;
  145. width: 40px;
  146. min-height: 600px;
  147. background: white;
  148. box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
  149. }
  150. .tabMap{
  151. list-style: none;
  152. width: 100%;
  153. height: calc(100% - 300px);
  154. background: white;
  155. border-top: 2px solid #ff6412;
  156. border-bottom: 2px solid #ff6412;
  157. }
  158. .tabMap li{
  159. writing-mode: vertical-lr;
  160. text-orientation: upright;
  161. display: flex;
  162. justify-content: center;
  163. align-items: center;
  164. height: 150px;
  165. text-align: center;
  166. width: 100%;
  167. font-size: 17px;
  168. font-weight: bold;
  169. color: #646972;
  170. border-bottom: 1px solid #d3ced2;
  171. cursor: pointer;
  172. letter-spacing: 5px;
  173. }
  174. .tabMap li:last-child{
  175. border-bottom: 0px !important;
  176. }
  177. .tabMap li i{
  178. color:grey;
  179. font-size: 23px;
  180. margin: 0px 0px 5px 0px;
  181. }
  182. .activeBar{
  183. color:white !important;
  184. background-image: url(../../../assets/img/rough-cloth-light.png) !important;
  185. background-color: #1862f7!important;
  186. }
  187. .activeLi{
  188. background: #FF9800 !important;
  189. color:white !important;
  190. }
  191. .activeLi i{
  192. color:white !important;
  193. }
  194. .activeBar i{
  195. color:white !important;
  196. }
  197. .map-list{
  198. position: fixed;
  199. left: 55px;
  200. width: 300px;
  201. height: calc(100% - 300px);
  202. top: 180px;
  203. background: #f5f2f2;
  204. box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
  205. border-top: 2px solid #ff6412;
  206. border-bottom: 2px solid #ff6412;
  207. overflow: hidden;
  208. }
  209. .item-list{
  210. width: 100%;
  211. height:100%;
  212. }
  213. .item-title{
  214. line-height: 35px;
  215. text-indent: 10px;
  216. box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
  217. color: white;
  218. font-size: 17px;
  219. font-weight: bold;
  220. background-image: url(../../../assets/img/rough-cloth-light.png);
  221. background-color: #1862f7;
  222. }
  223. .item-date{
  224. width: 100%;
  225. height:30px;
  226. }
  227. .item-title span{
  228. margin-left: 10px;
  229. color:white;
  230. }
  231. .item-title i{
  232. color:white;
  233. }
  234. .item-list ul{
  235. list-style: none;
  236. width: 100%;
  237. min-height: 80px;
  238. margin-top: 10px;
  239. }
  240. .item-list ul li{
  241. float: left;
  242. width: calc(33.33% - 6px);
  243. margin-bottom: 10px;
  244. margin-left: 3px;
  245. margin-right: 3px;
  246. text-align: center;
  247. font-size: 12px;
  248. line-height: 25px;
  249. cursor: pointer;
  250. color: #2d2d2d;
  251. background: white;
  252. border-radius: 5px;
  253. box-shadow: 0 0px 2px 0 rgb(0 0 0 / 10%);
  254. }
  255. .box-item{
  256. display: flex;
  257. width: 100%;
  258. align-items: center;
  259. height: 30px;
  260. text-align: left;
  261. text-indent: 5px;
  262. font-size: 14px;
  263. font-weight: bold;
  264. color:#7a7f83;
  265. }
  266. .box-top{
  267. margin-top: 5px;
  268. }
  269. .box-content{
  270. width: 100%;
  271. height:calc(100% - 80px);
  272. overflow: auto;
  273. }
  274. </style>