马宇豪
2024-07-08 20b0ce2db27b64a60de60aee05dedd448099e330
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
129
130
131
132
<template>
    <div class="charts-cont">
        <div class="monitor">
            <div style="width: 100%;height: 100%">
<!--                <img src="../../../../assets/warningScreen/video.png">-->
        <iframe class="video" style="width: 100%;height: 100%" :src="'http://36.108.169.10:8088/808gps/open/player/video.html?lang=zh&devIdno=' + videoUrl + '&&account=gtxh&password=000000'"></iframe>
            </div>
        </div>
    </div>
</template>
 
<script lang="ts">
    import {toRefs, reactive, defineComponent, ref, defineAsyncComponent, onMounted} from 'vue';
    import { storeToRefs } from 'pinia';
    import { initBackEndControlRoutes } from '/@/router/backEnd';
    import {useUserInfo} from "/@/stores/userInfo";
    import { Session } from '/@/utils/storage';
    import { Search } from '@element-plus/icons-vue'
    import { ElMessage } from 'element-plus'
    import type { FormInstance, FormRules } from 'element-plus'
    import { workApplyApi } from '/@/api/specialWorkSystem/workApply';
    import * as echarts from 'echarts';
    import '/@/theme/bigScreen.css'
  import {videoApi} from "/@/api/systemManage/video";
 
 
    interface stateType {
    videoList: [],
    listQuery: {}
    videoUrl: string
    }
    export default defineComponent({
        name: 'monitor',
        components: {},
        props: [''],
        setup(props,context) {
            const userInfo = useUserInfo()
            const { userInfos } = storeToRefs(userInfo);
            const state = reactive<stateType>({
        videoList: [],
        listQuery: {
          bizDepId: null,
          name: '',
          shortName: '',
          pageIndex: 1,
          pageSize: 999
        },
        videoUrl: ''
            })
 
      onMounted(() => {
        getVideoTableData()
      })
 
 
      const getVideoTableData = async () => {
        let res = await videoApi().getVideoList(state.listQuery);
        if (res.data.code === '200') {
          state.videoList = res.data.data
          state.videoUrl = state.videoList[0].deviceNo
          context.emit('getData',state.videoList)
        } else {
          ElMessage({
            type: 'warning',
            message: res.data.msg
          });
        }
      }
      const changeVideo = (no)=>{
        state.videoUrl = no
      }
            return {
                Search,
        getVideoTableData,
        changeVideo,
                ...toRefs(state)
            };
        },
    });
</script>
 
<style scoped lang="scss">
    .charts-cont{
        width: 100%;
        height: 100%;
        padding: 5%;
        position: relative;
 
        .monitor{
            width: 100%;
            height: 100%;
            position: relative;
            border-radius: 8px;
            overflow: hidden;
 
            img{
                display: block;
                width: 100%;
                height: auto;
                position: absolute;
                left: 0;
                right: 0;
                bottom: 0;
                top: 0;
                margin: auto;
            }
        }
    }
    .home-container {
        height: 100%;
        overflow: hidden;
        position: relative;
        .el-row{
            margin-bottom: 20px;
        }
        .el-row:last-child {
            margin-bottom: 0;
        }
        .el-input{
            width: 100% !important;
        }
        .el-date-editor::v-deep{
            width: 100%;
        }
        .el-select{
            width: 100%;
        }
        .el-cascader{
            width: 100% !important;
        }
    }
</style>