TFileStream.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <div v-show="imgtupian">
  3. <div class="imgs" v-if="imgsrc!='' " v-cloak >
  4. <el-image style='height: 480px;' v-loading="loading" :src="'data:image/png;base64,' + imgsrc" ></el-image>
  5. <!-- <div class="controls">
  6. <el-button type="danger" icon="el-icon-refresh" circle @click="inthetaclick()"></el-button>
  7. <el-button type="danger" icon="el-icon-refresh-right" circle @click="inphiclick()"></el-button>
  8. </div> -->
  9. </div>
  10. </div>
  11. </template>
  12. <script>
  13. import Vue from 'vue' // 引入vue
  14. import $ from 'jquery' ;
  15. import store from "@/store";
  16. import { request } from "@/utils/request";
  17. import { ElMessage } from '@/utils/message.js'
  18. import { log } from 'three';
  19. let Message = new ElMessage()
  20. export default {
  21. name: "VideoPlayer",
  22. props:{
  23. projectId:String,
  24. servertype:String,
  25. srsurl:String,
  26. wstep:String,
  27. bStep:Number,
  28. vStep:Number,
  29. },
  30. data() {
  31. return {
  32. imgsrc:'',
  33. loading:false,
  34. intheta:0,
  35. inphi:0,
  36. imgtupian:false,
  37. }
  38. },
  39. mounted(){
  40. },
  41. methods:{
  42. fetchData(imgs,num) {
  43. if(num=='1'){
  44. console.log(1111)
  45. this.imgsrc = imgs;
  46. }else{
  47. this.loadingend(this.loadingopen());
  48. this.imgsrc = imgs;
  49. }
  50. },
  51. //开起loading
  52. loadingopen(){
  53. const loading = this.$loading({
  54. lock: true,
  55. text: 'Loading',
  56. spinner: 'el-icon-loading',
  57. background: 'rgba(0, 0, 0, 0.7)'
  58. });
  59. return loading;
  60. },
  61. // 关闭lodind
  62. loadingend(loading){
  63. loading.close()
  64. },
  65. inthetaclick(){
  66. console.log( this.intheta);
  67. if(this.intheta>=360|| this.inphi>=360){
  68. this.intheta=0;
  69. }else{
  70. this.intheta+=30;
  71. }
  72. this.rotateclick( this.intheta,0);
  73. },
  74. inphiclick(){
  75. if(this.intheta>=360|| this.inphi>=360){
  76. this.inphi=0;
  77. }else{
  78. this.inphi+=30;
  79. }
  80. this.rotateclick(0,this.inphi);
  81. },
  82. rotateclick(X,Y){
  83. if(this.servertype=='boundary'){
  84. this.step=this.bStep;
  85. }else if(this.servertype=='volume'){
  86. this.step=this.vStep;
  87. }
  88. else{
  89. this.step=0;
  90. }
  91. let params = {
  92. transCode: "VDT0001",
  93. projectId: this.projectId,
  94. projectType: "hcfd",
  95. fileType:this.servertype,
  96. step:this.step,
  97. intheta:X,
  98. inphi:Y,
  99. lesseeId: this.$store.getters.lesseeId
  100. };
  101. this.loading = true;
  102. request(params)
  103. .then((res) => {
  104. console.log(res);
  105. // this.$$emit("loadRendering",this.projectId)
  106. })
  107. .catch((err) => {
  108. console.log(err);
  109. });
  110. }
  111. },
  112. watch:{
  113. },
  114. }
  115. </script>
  116. <style scoped>
  117. .imgs{
  118. position: relative;
  119. display: flex;
  120. justify-content: center;
  121. /* align-items: center; */
  122. align-items: center;
  123. flex-direction: column;
  124. }
  125. [v-cloak]{
  126. display: none;
  127. }
  128. .el-image{
  129. /* width: 100%;
  130. height: calc(100vh - 112px) !important; */
  131. overflow: hidden;
  132. position:relative ;
  133. display: contents;
  134. }
  135. img{
  136. width: 100%;
  137. height: 90vh;
  138. object-fit: fill;
  139. /* height: calc(100% - 110px); */
  140. }
  141. .controls{
  142. position: absolute;
  143. bottom:20px;
  144. z-index: 200;
  145. }
  146. </style>