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