whychdw
2021-08-05 7d6fabfb88c1dc560e2b310427aa0de5a4449c51
内容提交
2个文件已添加
5个文件已修改
197 ■■■■■ 已修改文件
src/components/PageHeader.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/battGroupMager/AddBattGroup.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/rtmpVideo.vue 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/weatherComponent/index.vue 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/dataMager/battGroupMager.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/dataTest/components/endoscopeVideo.vue 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/dataTest/realTimeAio.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/PageHeader.vue
@@ -113,6 +113,7 @@
            top="0" class="dialog-center" :modal-append-to-body="false">
            <alarm-alert v-if="alarmAlertStatus" :visible.sync="alarmAlertStatus"></alarm-alert>
        </el-dialog>
        <weather-component></weather-component>
    </div>
</template>
@@ -133,9 +134,11 @@
    } from '../assets/js/tools'
    import getPageMenu from "@/assets/js/tools/getPageMenu";
    import checkMenuIsUse from "@/assets/js/tools/checkMenuIsUse";
    import WeatherComponent from "@/components/weatherComponent";
    export default {
        components: {
            WeatherComponent,
            HdwBadgeBtn,
            ProgressState,
            PifuList,
src/components/battGroupMager/AddBattGroup.vue
@@ -24,8 +24,12 @@
                    </el-form-item>
                </el-col>
                <el-col :span="layout.span">
                    <el-form-item label="区/县" prop="StationName5">
                        <el-select v-model="params.StationName5" placeholder="请选择区县" @change="countyChange"
                    <el-form-item label="区/县/班组" prop="StationName5">
                        <el-select
                            v-model="params.StationName5"
                            placeholder="请选择区县"
                            @change="countyChange"
                            allow-create
                            :filterable="true">
                            <el-option v-for="item in linkage.counties" :key="item" :label="item" :value="item">
                            </el-option>
src/components/rtmpVideo.vue
@@ -1,6 +1,6 @@
<template>
    <div class="rtmp-video-wrapper">
        <video ref="videoPlayer" :options="options" class="video-js"></video>
        <video ref="videoPlayer" class="video-js"></video>
    </div>
</template>
@@ -8,10 +8,17 @@
import videoJs from 'video.js';
import 'videojs-flash';
import SWF_URL from 'videojs-swf/dist/video-js.swf';
import loadImg from '@/assets/images/dw_bg.jpg';
export default {
    name: "rtmpVideo",
    player: "",
    props: {
        url: {
            type: String,
            default: "",
        },
    },
    data() {
        return {
            options: {
@@ -21,22 +28,26 @@
                autoplay: false,         // 自动播放
                sources: [{             // 流配置,数组形式,会根据兼容顺序自动切换
                    type: 'rtmp/mp4',
                    src: 'rtmp://58.200.131.2:1935/livetv/hunantv' // 亲测可用
                    src: loadImg // 亲测可用
                }],
                techOrder: ['html5', 'flash'],
                flash: {
                    swf: SWF_URL
                }
                },
            },
            playFlag: false,
        }
    },
    watch: {
        url() {
            this.changeUrl();
        },
    },
    methods: {
        create() {
            let self = this;
            // 初始化播放器
            this.$options.player = videoJs(this.$refs.videoPlayer, this.options, function onPlayerReady() {
                console.log('onPlayerReady', this);
                this.on('pause', function() {
                    console.log('暂停播放')
@@ -56,13 +67,21 @@
                })
            });
        },
        changeUrl() {
            let url = this.url;
            if(this.$options.player) {
                let myPlayer =  this.$options.player;
                myPlayer.src(url);
                myPlayer.load(url);
            }
        },
        play() {
            this.$nextTick(()=>{
                if(this.$options.player) {
                    this.$options.player.play();
                }
            });
        },
        dispose() {
            if(this.$options.player) {
@@ -74,7 +93,6 @@
    },
    mounted() {
        this.create();
        console.log(this.$options.player);
    },
    beforeDestroy() {
        this.dispose();
src/components/weatherComponent/index.vue
New file
@@ -0,0 +1,58 @@
<template>
    <div class="weather-wrapper">
        <div class="weather-title"></div>
        <div class="weather-body">
        </div>
    </div>
</template>
<script>
export default {
    name: "weatherComponent",
    props: {
        city: {
            type: String,
            default: ""
        },
        district: {
            type: String,
            default: ""
        },
    },
    data() {
        return {
        }
    },
    methods: {
        getSupportCity() {
            this.$axios({
                method: 'get',
                url: 'http://apis.juhe.cn/simpleWeather/cityList',
                params: {
                    key: '195f091cfb0f4a04d053a56d0dbc3f1d'
                },
                withCredentials: false,
            }).then(res=>{
                console.log(res);
            }).catch(error=>{
            });
        },
        start(mac) {
        },
    },
    mounted() {
        this.getSupportCity();
    },
    beforeDestroy() {
    }
}
</script>
<style scoped>
</style>
src/pages/dataMager/battGroupMager.vue
@@ -30,12 +30,12 @@
                        </el-option>
                    </el-select>
                </div>
                <div class="table-cell text-right">区/县:</div>
                <div class="table-cell text-right">区/县/班组:</div>
                <div class="table-cell">
                    <el-select 
                    v-model="filters.values.county"
                    @change="searchHome"  
                    size="small" placeholder="请选择区/县">
                    size="small" placeholder="请选择区/县/班组">
                        <el-option
                        v-for="item in filters.data.county"
                        :key="item.value"
@@ -86,7 +86,7 @@
                </el-table-column>
                <el-table-column
                prop="StationName5"
                label="区县"
                label="区县/班组"
                min-width="120"
                :resizable="false"
                align="center">
@@ -580,7 +580,7 @@
            if(searchParams.StationName5 == "") {
                // 设置机房
                this.filters.data.home = [{
                    label: "请选择区/县",
                    label: "请选择区/县/班组",
                    value: ''
                }];
                // 查询数据
src/pages/dataTest/components/endoscopeVideo.vue
New file
@@ -0,0 +1,84 @@
<template>
    <div class="endoscope-video">
        <rtmp-video :url="url"></rtmp-video>
    </div>
</template>
<script>
import RtmpVideo from "@/components/rtmpVideo";
export default {
    name: "endoscopeVideo",
    components: {RtmpVideo},
    data() {
        return {
            url: "",
            mac: "",
        }
    },
    methods: {
        getList() {
            this.$axios({
                method: 'get',
                url: 'http://121.36.27.55:51389/A059Web/webService/getList',
                withCredentials: false,
            }).then(res=>{
                let rs = res.data;
                if(rs.code ==200 && rs.data.length) {
                    let data = rs.data;
                    let mac = data[0].mac;
                    let url = data[0].rtmp;
                    this.start(mac, url);
                }
            }).catch(error=>{
                console.log(error);
            });
        },
        start(mac, url) {
            this.$axios({
                method: 'post',
                url: 'http://121.36.27.55:51389/A059Web/webService/startTest',
                withCredentials: false,
                params: {
                    mac: mac
                },
            }).then(res=>{
                let rs = res.data;
                if(rs.code == 200) {
                    this.url = url;
                    this.mac = mac;
                }
            }).catch(error=>{
                console.log(error);
            });
        },
        stop() {
            let mac = this.mac;
            if(!mac) {
                return;
            }
            this.$axios({
                method: 'post',
                url: 'http://121.36.27.55:51389/A059Web/webService/stopTest',
                withCredentials: false,
                params: {
                    mac: mac
                },
            }).then(res=>{
                console.log('内窥镜MAC:'+mac+'停止推送视频');
            }).catch(error=>{
                console.log(error);
            });
        },
    },
    mounted() {
        this.getList();
    },
    beforeDestroy() {
        this.stop();
    }
}
</script>
<style scoped>
</style>
src/pages/dataTest/realTimeAio.vue
@@ -296,8 +296,8 @@
            <activate-dialog-content v-if="dialog.show" :type="dialog.type" :batt="batt"></activate-dialog-content>
        </el-dialog>
        <el-dialog title="内窥镜" width="800px" :visible.sync="videoDialog.show" :close-on-click-modal="false"
                   top="0" class="dialog-center" :modal-append-to-body="false" :destroy-on-close="true">
            <rtmp-video></rtmp-video>
                   top="0" class="dialog-center" :modal-append-to-body="false">
            <endoscope-video v-if="videoDialog.show"></endoscope-video>
        </el-dialog>
    </flex-layout>
</template>
@@ -344,6 +344,7 @@
    const_aio
} from '@/assets/js/const';
import RtmpVideo from "@/components/rtmpVideo";
import EndoscopeVideo from "@/pages/dataTest/components/endoscopeVideo";
let vol, resChart, temp, conduct, currChart, leakVol;
let staticL, stateL, flushL;
@@ -352,6 +353,7 @@
export default {
    name: "realTimeAio",
    components: {
        EndoscopeVideo,
        RtmpVideo,
        ContentBox,
        BarChart,