d39746e0e20cdc494b5c03073b92ed04fb49b0be.svn-base 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <div style="z-index: 25; width:auto;">
  3. <div class="biank" id="gjtiao" style="display:block;">
  4. <form class="form-inline" role="form" style="padding: 0px; background-color: rgba(255,255,255,.7);border-radius:5px;">
  5. <!-- <el-switch v-for="(item,index) in options" :key="index" v-model="value1" @change="selectChange" :active-value="item.active_value"
  6. :inactive-value="item.inactive_value" active-color="#13ce66" active-text="水文站" inactive-color="#cccccc">
  7. </el-switch> &nbsp;&nbsp; -->
  8. <label style="font-size:16px;margin-top:5px;color: white;" for="">图层控制:</label>
  9. <el-switch v-model="value1" @change="selectChange" mini active-value="point_shuihui-1-processLineShow_shuihuiTable"
  10. inactive-value="point_shuihui-0-processLineShow_shuihuiTable" active-color="#13ce66" inactive-color="#cccccc"
  11. active-text="水毁工程">
  12. </el-switch> &nbsp;&nbsp;
  13. <el-switch v-model="value2" @change="selectChange" active-value="point_people-1-processLineShow_peopleTable"
  14. inactive-value="point_people-0-processLineShow_peopleTable" active-color="#13ce66" inactive-color="#cccccc"
  15. active-text="人员">
  16. </el-switch> &nbsp;&nbsp;
  17. <el-switch v-model="value3" @change="selectChange" active-value="point_shuiku-1-processLineShow_shuikuTable"
  18. inactive-value="point_shuiku-0-processLineShow_shuikuTable" active-color="#13ce66" inactive-color="#cccccc"
  19. active-text="小水库">
  20. </el-switch> &nbsp;&nbsp;
  21. <el-switch v-model="value4" @change="selectChange" active-value="point_contry_water-1-processLineShow_countrywaterTable"
  22. inactive-value="point_contry_water-0-processLineShow_countrywaterTable" active-color="#13ce66" inactive-color="#cccccc"
  23. active-text="农村饮用水">
  24. </el-switch> &nbsp;&nbsp;
  25. <!-- <el-switch v-model="value5" @change="selectChange" active-value="SS_1" inactive-value="SS_0" active-color="#13ce66" inactive-color="#cccccc"
  26. active-text="墒情站">
  27. </el-switch> &nbsp;&nbsp;
  28. <el-switch v-model="value6" @change="selectChange" active-value="DP_1" inactive-value="DP_0" active-color="#13ce66" inactive-color="#cccccc"
  29. active-text="泵站">
  30. </el-switch> &nbsp;&nbsp;
  31. <el-switch v-model="value7" @change="selectChange" active-value="OTHER_1" inactive-value="OTHER_0" active-color="#13ce66" inactive-color="#cccccc"
  32. active-text="其它站">
  33. </el-switch> &nbsp;&nbsp; -->
  34. </form>
  35. </div>
  36. <div class="gonju">&nbsp;&nbsp;</div>
  37. </div>
  38. </template>
  39. <script>
  40. export default {
  41. name: "ControlPanel",
  42. data() {
  43. return {
  44. value1: "point_shuihui-0",
  45. value2: "point_people-1-processLineShow_peopleTable",
  46. value3: "point_shuiku-0",
  47. value4: "point_contry_water-0",
  48. value5: "SS_1",
  49. value6: "DP_1",
  50. value7: "OTHER_1",
  51. map: null,
  52. options: [{
  53. "text": "水文站",
  54. "active_value": "zz_1",
  55. "inactive_value": "zz_0",
  56. "value": false
  57. }, {
  58. "text": "水文站",
  59. "active_value": "zz_1",
  60. "inactive_value": "zz_0",
  61. "value": false
  62. }, {
  63. "text": "水文站",
  64. "active_value": "zz_1",
  65. "inactive_value": "zz_0",
  66. "value": false
  67. }, {
  68. "text": "水文站",
  69. "active_value": "zz_1",
  70. "inactive_value": "zz_0",
  71. "value": false
  72. }, {
  73. "text": "其它站",
  74. "active_value": "OTHER_1",
  75. "inactive_value": "OTHER_0",
  76. "value": false
  77. }]
  78. }
  79. },
  80. mounted: function () {
  81. this.$nextTick(function () {
  82. // Code that will run only after the
  83. // entire view has been rendered
  84. let cVue = this;
  85. cVue.map = this.$store.state.map;
  86. })
  87. },
  88. methods: {
  89. selectChange: function (value) {
  90. console.log(value.split("-"))
  91. var arr = value.split("-");
  92. this.$emit('layerVisbleEvent', arr);
  93. // this.$bus.$emit("event_layer_visible", arr);
  94. return
  95. //
  96. var layer = this.$store.state.map.findLayerById("layer_" + arr[0]);
  97. var layer_label = this.$store.state.map.findLayerById("layer_label" + arr[0]);
  98. //
  99. if (layer != null) {
  100. layer.visible = (parseInt(arr[1]) ? true : false);
  101. layer_label.visible = (parseInt(arr[1]) ? true : false);
  102. }
  103. }
  104. }
  105. }
  106. </script>
  107. <style>
  108. #gjtiao {
  109. display: none;
  110. float: left;
  111. position: absolute;
  112. bottom: 15px;
  113. margin-left: 15px;
  114. }
  115. #gjtiao .form-inline {
  116. background-color: rgba(146, 137, 137, 0.4) !important;
  117. }
  118. #gjtiao .form-inline .el-switch__label--right {
  119. color: aliceblue !important;
  120. }
  121. #gjtiao .el-switch__core {
  122. width: 35px !important;
  123. height: 15px !important;
  124. }
  125. #gjtiao .el-switch__core:after {
  126. height: 12px !important;
  127. }
  128. </style>