TerrainCombination.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <div id="terrainAnalysis" class="sm-panel" v-show="terrainShow" v-drag>
  3. <div class="sm-content">
  4. <div class="sm-panel-header">
  5. <span :class="{ titleColor: OperationShow }" class="title-txt" @click="choose(0)">{{ Resource.TerrainOperation
  6. }}</span>
  7. <span :class="{ titleColor: floodShow }" class="title-txt" @click="choose(1)">{{ Resource.FloodAnalysis }}</span>
  8. <span :class="{ titleColor: slopeShow }" class="title-txt" @click="choose(2)">{{ Resource.terrainSlope }}</span>
  9. <span :class="{ titleColor: isolineShow }" class="title-txt" @click="choose(3)">{{ Resource.isoline }}</span>
  10. <span :class="{ titleColor: isCutFillShow }" class="title-txt" @click="choose(4)">地形平整分析</span>
  11. <span class="closeBtn" @click="toggleVisibility">&times;</span>
  12. </div>
  13. <!-- 调用子组件 -->
  14. <sm3d-terrain-operation></sm3d-terrain-operation>
  15. <sm3d-terrain-flood></sm3d-terrain-flood>
  16. <sm3d-terrain-slope></sm3d-terrain-slope>
  17. <sm3d-terrain-isoline></sm3d-terrain-isoline>
  18. <TerrainCutFillAnalysis></TerrainCutFillAnalysis>
  19. </div>
  20. </div>
  21. </template>
  22. <script>
  23. export default {
  24. name: "TerrainAnalysis",
  25. props: {},
  26. data() {
  27. return {
  28. sharedState: store.state,
  29. };
  30. },
  31. computed: {
  32. OperationShow: function () {
  33. return this.sharedState.terrain[0];
  34. },
  35. floodShow: function () {
  36. return this.sharedState.terrain[1];
  37. },
  38. slopeShow: function () {
  39. return this.sharedState.terrain[2];
  40. },
  41. isolineShow: function () {
  42. return this.sharedState.terrain[3];
  43. },
  44. terrainShow: function () {
  45. return this.sharedState.toolBar[5];
  46. },
  47. isCutFillShow: function () {
  48. return this.sharedState.terrain[4];
  49. },
  50. },
  51. methods: {
  52. toggleVisibility() {
  53. //控制组件界面显隐
  54. store.setToolBarAction(5);
  55. },
  56. choose(i) {
  57. // 验证是否为点击事件,是则继续执行click事件,否则不执行
  58. let isClick = document
  59. .getElementById("terrainAnalysis")
  60. .getAttribute("data-flag");
  61. if (isClick !== "true") {
  62. return false;
  63. }
  64. switch (i) {
  65. case 0:
  66. store.setTerrainAction([1, 0, 0, 0, 0]);
  67. break;
  68. case 1:
  69. store.setTerrainAction([0, 1, 0, 0, 0]);
  70. break;
  71. case 2:
  72. store.setTerrainAction([0, 0, 1, 0, 0]);
  73. break;
  74. case 3:
  75. store.setTerrainAction([0, 0, 0, 1, 0]);
  76. break;
  77. case 4://填挖方
  78. store.setTerrainAction([0, 0, 0, 0, 1]);
  79. break;
  80. default:
  81. store.setTerrainAction([1, 0, 0, 0, 0]);
  82. }
  83. },
  84. },
  85. watch: {},
  86. mounted() {
  87. // console.log(this.terrainShow);
  88. },
  89. };
  90. </script>
  91. <style lang="scss" scoped>
  92. #terrainAnalysis {
  93. width: 400px;
  94. max-width: 420px;
  95. }
  96. </style>