chooseChannel.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <div id="chooseChannel" v-loading="isLoging">
  3. <el-dialog title="选择通道" top="2rem" width="70%" :close-on-click-modal="false" :visible.sync="showDialog" :destroy-on-close="true" @close="close()">
  4. <el-tabs v-model="tabActiveName" >
  5. <el-tab-pane label="国标通道" name="gbChannel">
  6. <el-container>
  7. <el-main style="background-color: #FFF;">
  8. <chooseChannelForGb :chooseChanage=chooseChanage ></chooseChannelForGb>
  9. </el-main>
  10. <el-footer>
  11. <el-button size="mini" type="primary" style="float: right" @click="save()">保存</el-button>
  12. </el-footer>
  13. </el-container>
  14. </el-tab-pane>
  15. <el-tab-pane label="直播流通道" name="streamchannel">
  16. <!-- TODO -->
  17. </el-tab-pane>
  18. </el-tabs>
  19. </el-dialog>
  20. </div>
  21. </template>
  22. <script>
  23. import chooseChannelForGb from './chooseChannelForGb.vue'
  24. export default {
  25. name: 'chooseChannel',
  26. props: {},
  27. components: {
  28. chooseChannelForGb,
  29. },
  30. computed: {
  31. // getPlayerShared: function () {
  32. // return {
  33. // sharedUrl: window.location.host + '/' + this.videoUrl,
  34. // sharedIframe: '<iframe src="' + window.location.host + '/' + this.videoUrl + '"></iframe>',
  35. // sharedRtmp: this.videoUrl
  36. // };
  37. // }
  38. },
  39. created() {},
  40. data() {
  41. return {
  42. isLoging: false,
  43. tabActiveName: "gbChannel",
  44. platformId: "",
  45. isLoging: false,
  46. showDialog: false,
  47. chooseData: []
  48. };
  49. },
  50. methods: {
  51. openDialog: function (platformId, closeCallback) {
  52. console.log(platformId)
  53. this.platformId = platformId
  54. this.showDialog = true
  55. this.closeCallback = closeCallback
  56. },
  57. close: function() {
  58. },
  59. search: function() {
  60. },
  61. save: function() {
  62. var that = this;
  63. this.$axios({
  64. method:"post",
  65. url:"/api/platforms/updateChannelForGB",
  66. data:{
  67. platformId: that.platformId,
  68. channelReduces: that.chooseData
  69. }
  70. }).then((res)=>{
  71. if (res.data == true) {
  72. that.$message({
  73. showClose: true,
  74. message: '保存成功,',
  75. type: 'success'
  76. });
  77. }
  78. }).catch(function (error) {
  79. console.log(error);
  80. });
  81. },
  82. chooseChanage: function(val) {
  83. console.log(val)
  84. this.chooseData = val;
  85. }
  86. }
  87. };
  88. </script>
  89. <style>
  90. </style>