index.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. (() => {
  2. Vue.component('uploadPointclound', {
  3. props: [],
  4. name: 'uploadPointclound',
  5. template: `<div id="uploadBox" >
  6. <h4>添加数据集 </h4>
  7. <div class="selectBox">
  8. <el-select v-model="value" filterable :filter-method="searchScene" placeholder="请选择">
  9. <el-option v-for="item in options" :key="item.code" :label="item.code" :value="item.code">
  10. <div class="sceneName">
  11. <p class="code">{{item.code}}</p>
  12. <span class="name">来自场景:{{item.name}}</span>
  13. </div>
  14. </el-option>
  15. </el-select>
  16. </div>
  17. <div class="uploadBtn" @click="openUpload" :class="{disabled:value==''}">
  18. <i class="fa fa-plus ng-scope"></i>&nbsp;&nbsp;添加到场景
  19. </div>
  20. <p class="itemTitle">已添加的数据集 </p>
  21. <div class="listBox">
  22. <ul class="sceneList">
  23. <li class="sceneItem" v-for="i in 10">
  24. <div class="sceneName">
  25. <p class="code">t-iksBApb</p>
  26. <span class="name">来自场景:港2</span>
  27. </div>
  28. <div class="scene_control">
  29. <el-popconfirm placement="top" title="是否要删除该数据集?" :hide-icon="true" @confirm="delConfirm">
  30. <el-button class="delBtn" title="删除" slot="reference"></el-button>
  31. </el-popconfirm>
  32. <!-- <div class="delBtn" title="删除"></div> -->
  33. </div>
  34. </li>
  35. </ul>
  36. </div>
  37. </div>`,
  38. data() {
  39. return {
  40. options: [{
  41. id: 1,
  42. name: "港2",
  43. code: 't-iksBApb'
  44. }, {
  45. id: 2,
  46. name: "港2",
  47. code: 't-iksBA2pb'
  48. }, {
  49. id: 3,
  50. name: "港2",
  51. code: 't-iksBA3pb'
  52. }, {
  53. id: 4,
  54. name: "港2",
  55. code: 't-iksBA4pb'
  56. }, {
  57. id: 5,
  58. name: "港2",
  59. code: 't-iksBA5pb'
  60. }, {
  61. id: 6,
  62. name: "港2",
  63. code: 't-iksBA6pb'
  64. }],
  65. value: '',
  66. }
  67. },
  68. methods: {
  69. searchScene() {
  70. let t = setTimeout(() => {
  71. console.log(1)
  72. clearTimeout(t)
  73. }, 3000);
  74. },
  75. openUpload() {
  76. this.$parent.showLoading()
  77. setTimeout(() => {
  78. this.value = ''
  79. this.$parent.hideLoading()
  80. this.$message({
  81. message: '恭喜你,这是一条成功消息',
  82. type: 'success',
  83. duration: 2000,
  84. });
  85. window.eventBus
  86. IV.api.AuthenticationService.sendAuthenticationChanged()
  87. // IV.SidebarMenuService.goToItem(IV.SidebarMenuService.items[1])
  88. }, 2000);
  89. // this.$confirm('此操作将永久删除该文件, 是否继续?', {
  90. // confirmButtonText: '确定',
  91. // cancelButtonText: '取消',
  92. // center: true
  93. // }).then(() => {
  94. // // this.$message({
  95. // // type: 'success',
  96. // // message: '删除成功!'
  97. // // });
  98. // }).catch(() => {
  99. // // this.$message({
  100. // // type: 'info',
  101. // // message: '已取消删除'
  102. // // });
  103. // });
  104. },
  105. delConfirm() {
  106. console.log(1)
  107. },
  108. },
  109. computed: {
  110. },
  111. destroyed() {
  112. },
  113. mounted() {
  114. window.eventBus.off('openMap', openMap);
  115. window.eventBus.on('openMap', openMap);
  116. function openMap() {
  117. IV.swapScenes()
  118. }
  119. },
  120. })
  121. })();