chooseChannel.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <div id="chooseChannel" v-loading="isLoging">
  3. <el-dialog title="选择通道" v-if="showDialog" top="2rem" width="90%" :close-on-click-modal="false" :visible.sync="showDialog" :destroy-on-close="true" @close="close()">
  4. <el-row>
  5. <el-col :span="10">
  6. <el-tabs v-model="catalogTabActiveName" >
  7. <el-tab-pane label="目录结构" name="catalog">
  8. <el-container>
  9. <el-main v-bind:style="{backgroundColor: '#FFF', maxHeight: winHeight + 'px'}">
  10. <chooseChannelForCatalog ref="chooseChannelForCatalog" :platformId=platformId :platformName=platformName :defaultCatalogId=defaultCatalogId :catalogIdChange="catalogIdChange"></chooseChannelForCatalog>
  11. </el-main>
  12. </el-container>
  13. </el-tab-pane>
  14. </el-tabs>
  15. </el-col>
  16. <el-col :span="14">
  17. <el-tabs v-model="tabActiveName" @tab-click="tabClick">
  18. <el-tab-pane label="国标通道" name="gbChannel">
  19. <el-container>
  20. <el-main style="background-color: #FFF;">
  21. <chooseChannelForGb ref="chooseChannelForGb" :platformId=platformId :updateChoosedCallback="updateChooseChannelCallback"></chooseChannelForGb>
  22. </el-main>
  23. </el-container>
  24. </el-tab-pane>
  25. <el-tab-pane label="直播流通道" name="streamchannel">
  26. <el-container>
  27. <el-main style="background-color: #FFF;">
  28. <chooseChannelFoStream ref="chooseChannelFoStream" :platformId=platformId :updateChoosedCallback="updateChooseChannelCallback"></chooseChannelFoStream>
  29. </el-main>
  30. </el-container>
  31. </el-tab-pane>
  32. </el-tabs>
  33. </el-col>
  34. </el-row>
  35. </el-dialog>
  36. </div>
  37. </template>
  38. <script>
  39. import chooseChannelForGb from '../dialog/chooseChannelForGb.vue'
  40. import chooseChannelFoStream from '../dialog/chooseChannelForStream.vue'
  41. import chooseChannelForCatalog from '../dialog/chooseChannelForCatalog.vue'
  42. export default {
  43. name: 'chooseChannel',
  44. props: {},
  45. components: {
  46. chooseChannelForGb,
  47. chooseChannelFoStream,
  48. chooseChannelForCatalog,
  49. },
  50. computed: {
  51. // getPlayerShared: function () {
  52. // return {
  53. // sharedUrl: window.location.host + '/' + this.videoUrl,
  54. // sharedIframe: '<iframe src="' + window.location.host + '/' + this.videoUrl + '"></iframe>',
  55. // sharedRtmp: this.videoUrl
  56. // };
  57. // }
  58. },
  59. data() {
  60. return {
  61. isLoging: false,
  62. tabActiveName: "gbChannel",
  63. catalogTabActiveName: "catalog",
  64. platformId: "",
  65. catalogId: "",
  66. platformName: "",
  67. defaultCatalogId: "",
  68. showDialog: false,
  69. chooseData: {}
  70. };
  71. },
  72. methods: {
  73. openDialog(platformId, platformName, defaultCatalogId, closeCallback) {
  74. this.platformId = platformId
  75. this.platformName = platformName
  76. this.defaultCatalogId = defaultCatalogId
  77. this.showDialog = true
  78. this.closeCallback = closeCallback
  79. },
  80. tabClick (tab, event){
  81. console.log(tab.label)
  82. if (tab.label === "gbChannel") {
  83. this.$refs.chooseChannelForGb.catalogIdChange(this.catalogId);
  84. this.$refs.chooseChannelForGb.initData();
  85. }else {
  86. this.$refs.chooseChannelFoStream.catalogIdChange(this.catalogId);
  87. this.$refs.chooseChannelFoStream.initData();
  88. }
  89. },
  90. close: function() {
  91. this.closeCallback()
  92. },
  93. search: function() {
  94. },
  95. save: function() {
  96. var that = this;
  97. this.$axios({
  98. method:"post",
  99. url:"/api/platform/update_channel_for_gb",
  100. data:{
  101. platformId: that.platformId,
  102. channelReduces: that.chooseData
  103. }
  104. }).then((res)=>{
  105. if (res.data == true) {
  106. that.$message({
  107. showClose: true,
  108. message: '保存成功,',
  109. type: 'success'
  110. });
  111. }
  112. }).catch(function (error) {
  113. console.log(error);
  114. });
  115. },
  116. catalogIdChange: function (id) {
  117. console.log("中间模块收到: " + id)
  118. this.catalogId = id;
  119. if (this.tabActiveName === "gbChannel") {
  120. this.$refs.chooseChannelForGb.catalogIdChange(id);
  121. }else {
  122. this.$refs.chooseChannelFoStream.catalogIdChange(id);
  123. }
  124. },
  125. updateChooseChannelCallback (id, nodeIds){
  126. console.log("中间模块收到选择通道变化: " + id)
  127. console.log("中间模块收到选择通道变化: " + nodeIds)
  128. console.log("中间模块收到选择通道变化: " + typeof (nodeIds))
  129. this.$refs.chooseChannelForCatalog.refreshCatalogById(id, nodeIds)
  130. }
  131. }
  132. };
  133. </script>
  134. <style>
  135. </style>