chooseChannel.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. winHeight: window.innerHeight - 250,
  71. };
  72. },
  73. methods: {
  74. openDialog(platformId, platformName, defaultCatalogId, closeCallback) {
  75. this.platformId = platformId
  76. this.platformName = platformName
  77. this.defaultCatalogId = defaultCatalogId
  78. this.showDialog = true
  79. this.closeCallback = closeCallback
  80. },
  81. tabClick (tab, event){
  82. console.log(tab.label)
  83. if (tab.label === "gbChannel") {
  84. this.$refs.chooseChannelForGb.catalogIdChange(this.catalogId);
  85. this.$refs.chooseChannelForGb.initData();
  86. }else {
  87. this.$refs.chooseChannelFoStream.catalogIdChange(this.catalogId);
  88. this.$refs.chooseChannelFoStream.initData();
  89. }
  90. },
  91. close: function() {
  92. this.closeCallback()
  93. },
  94. search: function() {
  95. },
  96. save: function() {
  97. var that = this;
  98. this.$axios({
  99. method:"post",
  100. url:"/api/platform/update_channel_for_gb",
  101. data:{
  102. platformId: that.platformId,
  103. channelReduces: that.chooseData
  104. }
  105. }).then((res)=>{
  106. if (res.data == true) {
  107. that.$message({
  108. showClose: true,
  109. message: '保存成功,',
  110. type: 'success'
  111. });
  112. }
  113. }).catch(function (error) {
  114. console.log(error);
  115. });
  116. },
  117. catalogIdChange: function (id) {
  118. console.log("中间模块收到: " + id)
  119. this.catalogId = id;
  120. if (this.tabActiveName === "gbChannel") {
  121. this.$refs.chooseChannelForGb.catalogIdChange(id);
  122. }else {
  123. this.$refs.chooseChannelFoStream.catalogIdChange(id);
  124. }
  125. },
  126. updateChooseChannelCallback (id, nodeIds){
  127. console.log("中间模块收到选择通道变化: " + id)
  128. console.log("中间模块收到选择通道变化: " + nodeIds)
  129. console.log("中间模块收到选择通道变化: " + typeof (nodeIds))
  130. this.$refs.chooseChannelForCatalog.refreshCatalogById(id, nodeIds)
  131. }
  132. }
  133. };
  134. </script>
  135. <style>
  136. </style>