Commit 75ee368c96a3db085c51a6ee32efb3f341a8333e

Authored by 648540858
1 parent c5478514

优化默认节点的展示

web_src/src/components/dialog/chooseChannel.vue
... ... @@ -52,13 +52,7 @@ export default {
52 52 chooseChannelForCatalog,
53 53 },
54 54 computed: {
55   - // getPlayerShared: function () {
56   - // return {
57   - // sharedUrl: window.location.host + '/' + this.videoUrl,
58   - // sharedIframe: '<iframe src="' + window.location.host + '/' + this.videoUrl + '"></iframe>',
59   - // sharedRtmp: this.videoUrl
60   - // };
61   - // }
  55 +
62 56 },
63 57 data() {
64 58 return {
... ... @@ -84,14 +78,6 @@ export default {
84 78 this.closeCallback = closeCallback
85 79 },
86 80 tabClick (tab, event){
87   - console.log(tab.label)
88   - if (tab.label === "gbChannel") {
89   - this.$refs.chooseChannelForGb.catalogIdChange(this.catalogId);
90   - this.$refs.chooseChannelForGb.initData();
91   - }else {
92   - this.$refs.chooseChannelFoStream.catalogIdChange(this.catalogId);
93   - this.$refs.chooseChannelFoStream.initData();
94   - }
95 81  
96 82 },
97 83 close: function() {
... ... @@ -125,11 +111,6 @@ export default {
125 111 catalogIdChange: function (id) {
126 112 console.log("中间模块收到: " + id)
127 113 this.catalogId = id;
128   - if (this.tabActiveName === "gbChannel") {
129   - this.$refs.chooseChannelForGb.catalogIdChange(id);
130   - }else {
131   - this.$refs.chooseChannelFoStream.catalogIdChange(id);
132   - }
133 114 },
134 115 updateChooseChannelCallback (id){
135 116 console.log("中间模块收到选择通道变化: " + id)
... ...
web_src/src/components/dialog/chooseChannelForCatalog.vue
... ... @@ -21,7 +21,7 @@
21 21 <span v-if="node.data.type === 2" class="iconfont icon-zhibo"></span>
22 22 <span style="padding-left: 1px">{{ node.label }}</span>
23 23 <span>
24   - <i style="margin-left: 5rem; color: #9d9d9d; padding-right: 20px" v-if="node.data.id === defaultCatalogId">默认</i>
  24 + <i style="margin-left: 5rem; color: #9d9d9d; padding-right: 20px" v-if="node.data.id === defaultCatalogIdSign">默认</i>
25 25 </span>
26 26 </span>
27 27 </el-tree>
... ... @@ -38,6 +38,8 @@ export default {
38 38 name: 'chooseChannelForCatalog',
39 39 props: ['platformId', 'platformName', 'defaultCatalogId', 'catalogIdChange'],
40 40 created() {
  41 + this.chooseId = this.defaultCatalogId;
  42 + this.defaultCatalogIdSign = this.defaultCatalogId;
41 43 this.initData();
42 44 setTimeout(()=>{
43 45 if (this.catalogIdChange)this.catalogIdChange(this.defaultCatalogId);
... ... @@ -54,8 +56,9 @@ export default {
54 56 children: 'children',
55 57 isLeaf: 'leaf'
56 58 },
  59 + defaultCatalogIdSign: null,
57 60 chooseNode: null,
58   - chooseId: this.defaultCatalogId,
  61 + chooseId: "",
59 62 catalogTree: null,
60 63 contextmenuShow: false
61 64  
... ... @@ -141,7 +144,7 @@ export default {
141 144 node.parent.loaded = false
142 145 node.parent.expand();
143 146 if (res.data.data) {
144   - this.defaultCatalogId = res.data.data;
  147 + this.defaultCatalogIdSign = res.data.data;
145 148 }
146 149 }
147 150 })
... ... @@ -160,7 +163,7 @@ export default {
160 163 })
161 164 .then((res)=> {
162 165 if (res.data.code === 0) {
163   - this.defaultCatalogId = id;
  166 + this.defaultCatalogIdSign = id;
164 167 }
165 168 })
166 169 .catch(function (error) {
... ... @@ -254,7 +257,7 @@ export default {
254 257 {
255 258 label: "设为默认",
256 259 icon: "el-icon-folder-checked",
257   - disabled: node.data.id === this.defaultCatalogId,
  260 + disabled: node.data.id === this.defaultCatalogIdSign,
258 261 onClick: () => {
259 262 this.setDefaultCatalog(data.id)
260 263 },
... ...
web_src/src/components/dialog/chooseChannelForStream.vue
... ... @@ -253,10 +253,6 @@ export default {
253 253 handleGBSelectionChange: function() {
254 254 this.initData();
255 255 },
256   - // catalogIdChange: function(id) {
257   - // this.catalogId = id;
258   - // console.log("直播通道选择模块收到: " + id)
259   - // },
260 256 }
261 257 };
262 258 </script>
... ...