rollerScreen.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <div id="screenDiv" style="position: absolute; height: 100%; width: 100%">
  3. <div
  4. v-for="(k, i) in layers"
  5. :key="i"
  6. class="splitScreen"
  7. :class="{
  8. w50: type == 1 || type == 2,
  9. h50: type == -1 || type == -2,
  10. }"
  11. >
  12. <li
  13. class="sm-tool-btn"
  14. :class="i == 1 && (type == 1 || type == 2) ? 'sm-btn1' : 'sm-btn'"
  15. title="资源目录"
  16. @click="$set(layers, i, !layers[i])"
  17. >
  18. <span class="iconfont icontuceng"></span>
  19. </li>
  20. <layer-manage-split
  21. ref="splitManage"
  22. type="roller"
  23. :splitId="i"
  24. :isshow="layers[i]"
  25. :checkedKeys="checkedKeys[i]"
  26. @close="$set(layers, i, false)"
  27. @handleCheckChange="handleCheckChange"
  28. ></layer-manage-split>
  29. <input v-model="toolTitle[i]" type="text" class="sm-toolTitle" />
  30. </div>
  31. </div>
  32. </template>
  33. <script>
  34. export default {
  35. name: "rollerScreen",
  36. data() {
  37. return {
  38. layers: [],
  39. checkedKeys: [],
  40. toolTitle: [],
  41. };
  42. },
  43. computed: {
  44. type() {
  45. return store.state.rollerType;
  46. },
  47. },
  48. watch: {
  49. type() {
  50. this.layers = Array(2);
  51. this.checkedKeys = Array(2);
  52. this.toolTitle = Array(2);
  53. this.setCheckeds();
  54. },
  55. },
  56. // inject: ["checkedChange"],
  57. mounted() {},
  58. methods: {
  59. setCheckeds() {
  60. if (!store.state.checkedData) return;
  61. for (let i = 0; i < this.checkedKeys.length; i++) {
  62. this.checkedKeys[i] = [store.state.checkedData.id];
  63. this.toolTitle[i] = [store.state.checkedData.title];
  64. }
  65. this.$set(this.checkedKeys, this.checkedKeys);
  66. this.$set(this.toolTitle, this.toolTitle);
  67. },
  68. handleCheckChange(obj, checked, splitId) {
  69. if (obj.children && obj.children.length > 0) {
  70. for (let i = 0; i < obj.children.length; i++) {
  71. this.handleCheckChange(obj.children[i], checked);
  72. }
  73. } else {
  74. if (checked) {
  75. store.setCheckedData(obj);
  76. this.$set(this.toolTitle, splitId, obj.title);
  77. // this.$set(this.checkedKeys, splitId, obj.id);
  78. }
  79. let sceneLayer = store.state.layerparamslist[obj.id];
  80. if (sceneLayer) {
  81. this.bus.$emit("setImageryRoller", sceneLayer);
  82. } else {
  83. this.bus.$emit("checkedChange", obj, true);
  84. }
  85. }
  86. },
  87. setImageryRollerMode(imageryLayers) {
  88. // let imageryLayers = viewer.imageryLayers;
  89. if (this.imageryRoller) {
  90. for (let i = 0; i < imageryLayers.length; i++) {
  91. // let imageryLayer =imageryLayers[i] //imageryLayers.get(i);
  92. switch (rollerShutterConfig.splitDirection) {
  93. case Cesium.SplitDirection.LEFT:
  94. imageryLayer.splitDirection = new Cesium.Cartesian2(
  95. Cesium.ImagerySplitDirection.RIGHT,
  96. Cesium.ImagerySplitDirection.NONE
  97. );
  98. break;
  99. case Cesium.SplitDirection.RIGHT:
  100. imageryLayer.splitDirection = new Cesium.Cartesian2(
  101. Cesium.ImagerySplitDirection.LEFT,
  102. Cesium.ImagerySplitDirection.NONE
  103. );
  104. break;
  105. case Cesium.SplitDirection.TOP:
  106. imageryLayer.splitDirection = new Cesium.Cartesian2(
  107. Cesium.ImagerySplitDirection.NONE,
  108. Cesium.ImagerySplitDirection.BOTTOM
  109. );
  110. break;
  111. case Cesium.SplitDirection.BOTTOM:
  112. imageryLayer.splitDirection = new Cesium.Cartesian2(
  113. Cesium.ImagerySplitDirection.NONE,
  114. Cesium.ImagerySplitDirection.TOP
  115. );
  116. break;
  117. default:
  118. imageryLayer.splitDirection = new Cesium.Cartesian2(
  119. Cesium.ImagerySplitDirection.NONE,
  120. Cesium.ImagerySplitDirection.NONE
  121. );
  122. break;
  123. }
  124. }
  125. } else {
  126. for (let i = 0; i < imageryLayers.length; i++) {
  127. let imageryLayer = imageryLayers.get(i);
  128. imageryLayer.splitDirection = new Cesium.Cartesian2(
  129. Cesium.ImagerySplitDirection.NONE,
  130. Cesium.ImagerySplitDirection.NONE
  131. );
  132. }
  133. }
  134. },
  135. },
  136. };
  137. </script>
  138. <style lang="scss" >
  139. .splitScreen {
  140. float: left;
  141. height: 100%;
  142. width: 100%;
  143. position: relative;
  144. .sm-btn {
  145. position: absolute;
  146. top: 60px;
  147. left: 20px;
  148. background-color: transparent;
  149. // font-size: 30px;
  150. z-index: 100;
  151. // width: 80px;
  152. // height: 80px;
  153. // background: red;
  154. }
  155. .sm-btn1 {
  156. position: absolute;
  157. top: 100px;
  158. right: 20px;
  159. background-color: transparent;
  160. font-size: 30px;
  161. z-index: 100;
  162. }
  163. .sm-panel {
  164. max-width: 300px;
  165. height: 400px; //75%;
  166. max-height: 80%;
  167. top: 80px;
  168. left: 50px;
  169. }
  170. }
  171. .w50 {
  172. width: 50%;
  173. }
  174. .h50 {
  175. height: 50%;
  176. }
  177. .sm-toolTitle {
  178. width: 400px;
  179. // height: 80px;
  180. position: absolute;
  181. top: 100px;
  182. left: calc(50% - 300px);
  183. z-index: 100;
  184. text-align: center;
  185. font-size: 24px;
  186. color: aqua;
  187. background: transparent;
  188. border-color: transparent;
  189. }
  190. @import "../../Combinations/toolBar/toolBar.scss";
  191. </style>