index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <!-- 底部导航栏 -->
  3. <div class="footet-bottom">
  4. <ul v-show="btnlistshow">
  5. <li class="fontcolor " v-for="(item, index) in listArray" :key="index" :class="{btnactive: index === currentIndex}" @click="changeColor(index)">{{item.name}}</li>
  6. <!-- <li class="fontcolor " v-for="(item, index) in listArray" :key="index" :class="{btnactive: index === currentIndex}" @click="changeColor(index)"> <el-image :src="item.img" fit="contain"></el-image>{{item.name}}</li> -->
  7. <!-- <li class="fontcolor btnactive" > <el-image :src="bt1" fit="contain"></el-image>灾情推演</li>
  8. <li class="fontcolor"> <el-image :src="bt2" fit="contain"></el-image>路径判断</li>
  9. <li class="fontcolor"> <el-image :src="bt3" fit="contain"></el-image>灾害对比</li> -->
  10. </ul>
  11. </div>
  12. <firstLeft ref="firstleftref" :classradio="props.classradio" />
  13. <towright ref="towrightref"/>
  14. </template>
  15. <script setup>
  16. import { ref, onMounted, reactive, } from "vue";
  17. import {RouterView,RouterLink } from "vue-router"
  18. import { request, uploadFile } from "@/utils/request";
  19. import firstLeft from "./first-left.vue"
  20. import towright from "./tow-right.vue"
  21. import { ElMessage, ElButton, ElDialog, ElSelect } from 'element-plus'
  22. import bt1 from "@/assets/img/bt1.png"
  23. import bt2 from "@/assets/img/bt2.png"
  24. import bt3 from "@/assets/img/bt2.png"
  25. const props = defineProps({
  26. classradio: {
  27. type: String,
  28. // default: '',activeIndex
  29. },
  30. aid: {
  31. type: Number,
  32. // default: '',activeIndex
  33. },
  34. state: {
  35. type: String,
  36. // default: '',activeIndex
  37. },
  38. });
  39. let claername=ref('');
  40. let firstleftref=ref();
  41. let towrightref=ref();
  42. let btnindex=ref(0);
  43. let emit = defineEmits(['indexchange','hiadden','vtkshowfuc' ])
  44. let listArray = ref([
  45. { id: 0, name: "灾情推演",img:bt1 },
  46. { id: 1, name: "路径判断" ,img:bt2},
  47. { id: 2, name: "灾害对比" ,img:bt2},
  48. ]);
  49. let currentIndex=ref(0);
  50. let btnlistshow=ref(false);
  51. const changeColor=(index)=>{
  52. btnindex.value=index;
  53. emit("vtkshowfuc", index);
  54. currentIndex.value = btnindex.value;
  55. indexchange(btnindex.value);
  56. emit("indexchange", btnindex.value);
  57. if(btnindex.value==0){
  58. emit("hiadden", 1);
  59. }else if(btnindex.value==1){
  60. firstleftref.value.isshow=false;
  61. emit("hiadden", null);
  62. towrightref.value.huoaid(props.aid);
  63. }else if(btnindex.value==2){
  64. firstleftref.value.isshow=false;
  65. emit("hiadden", null);
  66. }else{
  67. firstleftref.value.isshow=false;
  68. emit("hiadden", null);
  69. }
  70. }
  71. //隐藏所有
  72. const clearconst=(key)=>{
  73. // emit("hiadden", null);
  74. }
  75. // 求解成功后调用右边
  76. const firsrdata= ()=>{
  77. firstleftref.value.firstshow=true;
  78. firstleftref.value.indexinit(props.aid,props.classradio);
  79. }
  80. //
  81. const firstshowfuc=()=>{
  82. firstleftref.value.firstshow=false;
  83. firstleftref.value.isshow=false;
  84. }
  85. const indexchange=(key)=>{
  86. if(key==0){
  87. towrightref.value.towshow=false;
  88. if(props.state=='1'){
  89. firstleftref.value.firstshow=true;
  90. console.log( firstleftref.value.firstshow);
  91. firstleftref.value.indexinit(props.aid);
  92. }
  93. }else if(key==1){
  94. firstleftref.value.firstshow=false;
  95. towrightref.value.towshow=true;
  96. }
  97. else{
  98. firstleftref.value.firstshow=false;
  99. towrightref.value.towshow=false;
  100. // threerightref.value.threeshow=false;
  101. }
  102. }
  103. const hiddfalse=()=>{
  104. firstleftref.value.firstshow=false;
  105. towrightref.value.towshow=false;
  106. btnlistshow.value=false;
  107. firstleftref.value.isshow=false;
  108. }
  109. const showhadend=()=>{
  110. btnlistshow.value=true;
  111. }
  112. defineExpose({showhadend,changeColor,btnindex,btnlistshow,hiddfalse,currentIndex,firsrdata,firstshowfuc,clearconst});
  113. </script>
  114. <style lang="scss" scoped>
  115. </style>