Parcourir la Source

[FE]添加AL报警详情视频倍数播放功能

liuwenxun 4 ans auparavant
Parent
commit
ee83267923

+ 37 - 2
ebc-middle-platform/src/modules/page/PageLayout.vue

@ -1,13 +1,48 @@
1 1
<template>
2 2
3
  <div>
4
    <div>123</div>
5
    <button @click="showaudit">点击</button>
6
7
    <audit :auditshow.sync="auditshow"></audit>
8
9
  </div>
10
3 11
</template>
4 12
5 13
<script>
14
import audit from './components/modal/audit'
15
6 16
export default {
7
  name: 'PageLayout'
17
  components: {
18
    audit
19
  },
20
  data () {
21
    return {
22
      auditshow: false
23
    }
24
  },
25
  methods: {
26
    showaudit () {
27
      // console.log(123)
28
      this.auditshow = true
29
    }
30
  }
8 31
}
32
9 33
</script>
10 34
11
<style scoped>
35
  <style>
36
.video {
37
  width: 425px;
38
  height: 300px;
39
  border: 1px solid black;
40
}
41
.vjs-control-bar .vjs-picture-in-picture-control .vjs-control .vjs-button {
42
  width: 0;
43
}
12 44
45
.vjs-seek-to-live-control .vjs-control {
46
  width: 0;
47
}
13 48
</style>

+ 5 - 0
security-protection-platform/src/main.js

@ -18,6 +18,11 @@ import PKGJson from '../package.json'
18 18
19 19
import '@/styles/index.scss' // global css
20 20
21
import VideoPlayer from 'vue-video-player'
22
require('video.js/dist/video-js.css')
23
require('vue-video-player/src/custom-theme.css')
24
Vue.use(VideoPlayer)
25
21 26
// 安装组件库插件
22 27
Vue.use(aid, {
23 28
  local: i18nManager.language,

+ 39 - 5
security-protection-platform/src/modules/aialarm/index.vue

@ -139,8 +139,10 @@
139 139
          </div>
140 140
          <div>
141 141
            <div>识别视频</div>
142
            <div>
143
              <video :src="videoDetailData.videoFileUrl" class="video" controls></video>
142
            <div class="video">
143
              <!-- <video :src="videoDetailData.videoFileUrl" class="video" controls></video> -->
144
              <video-player ref="videoPlayer" :playsinline="true" :options="playerOptions" class="video-player vjs-custom-skin"></video-player>
145

144 146
            </div>
145 147
          </div>
146 148
        </div>
@ -249,10 +251,40 @@ export default {
249 251
      page: 1,
250 252
      limit: 10,
251 253

252
      total: 0
254
      total: 0,
255
      playerOptions: {
256
        playbackRates: [0.7, 1.0, 1.5, 2.0], // 播放速度
257
        autoplay: false, // 如果true,浏览器准备好时开始回放。
258
        muted: true, // 默认情况下将会消除任何音频。
259
        loop: false, // 导致视频一结束就重新开始。
260
        preload: 'auto', // 建议浏览器在<video>加载元素后是否应该开始下载视频数据。auto浏览器选择最佳行为,立即开始加载视频(如果浏览器支持)
261
        language: 'zh-CN',
262
        aspectRatio: '13:10', // 将播放器置于流畅模式,并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字(例如"16:9"或"4:3")
263
        // fluid: true, // 当true时,Video.js player将拥有流体大小。换句话说,它将按比例缩放以适应其容器。
264
        // 是否流体自适应容器宽高
265
        fluid: true,
266
        // // 设置视频播放器的显示宽度(以像素为单位)
267
        // width: '100px',
268
        // // 设置视频播放器的显示高度(以像素为单位)
269
        // height: '300px',
270
        sources: [{
271
          type: 'video/mp4', // 这里的种类支持很多种:基本视频格式、直播、流媒体等,具体可以参看git网址项目
272
          src: '' // url地址
273
        }],
274

275
        notSupportedMessage: '此视频暂无法播放,请稍后再试', // 允许覆盖Video.js无法播放媒体源时显示的默认信息。
276
        controlBar: {
277
          timeDivider: true,
278
          // durationDisplay: true,
279
          remainingTimeDisplay: false,
280
          fullscreenToggle: true, // 全屏按钮,
281
          pictureInPictureToggle: false
282
        }
283
      }
253 284

254 285
    }
255 286
  },
287

256 288
  mounted () {
257 289
    this.gettype()
258 290
    this.search()
@ -267,11 +299,13 @@ export default {
267 299
    async handleClick (scope, val) {
268 300
      this.clickdetail = val
269 301
      // 去除模态框中的单选项
270
      let res = await aialarmapi.getAlarmDetail({params: {'workTaskId': scope.row.workTaskId}})
302
      let res = await aialarmapi.getAlarmDetail({ params: { 'workTaskId': scope.row.workTaskId } })
271 303
      if (res.status === 200) {
272 304
        this.alarmDetailData = res.data.data.alarmInfo
273 305
        this.pictureDetailData = res.data.data.pictureInfo
274 306
        this.videoDetailData = res.data.data.videoInfo
307
        this.playerOptions.sources[0].src = this.videoDetailData.videoFileUrl
308
        // console.log(this.playerOptions.sources[0].src)
275 309
      } else { this.$Message.danger('处理失败') }
276 310
      this.status = ''
277 311
      this.details_modal = true // 打开模态框
@ -487,6 +521,6 @@ export default {
487 521
.video {
488 522
  width: 100%;
489 523
  height: 100%;
490
  object-fit: fill;
524
  margin: 0 auto;
491 525
}
492 526
</style>

+ 193 - 0
security-protection-platform/src/modules/userRights/usermana/components/modal/audit.vue

@ -0,0 +1,193 @@
1
<template>
2
  <div>
3
    <t-modal :visibled.sync="visibled" width="600px" height="696px">
4
      <p slot="header">
5

6
        <span>人脸审核</span>
7
      </p>
8
      <div style="text-align:center">
9
        <div class="infobody">
10

11
          <div>
12
            <span>姓名 :</span>
13
            <span>张三</span>
14
          </div>
15
          <div>
16
            <span>员工编号 :</span>
17
            <span>zhangsan</span>
18
          </div>
19
          <div>
20
            <span>公司 :</span>
21
            <span>xx风场</span>
22
          </div>
23
          <div>
24
            <span>部门 :</span>
25
            <span>设备管理处</span>
26
          </div>
27
          <div>
28
            <span>职务 :</span>
29
            <span>运维人员</span>
30
          </div>
31
          <div>
32
            <span>年龄 :</span>
33
            <span>28</span>
34
          </div>
35
          <div style="width:100%">
36
            <span>手机 :</span>
37
            <span>188888888</span>
38
          </div>
39
          <div style="height:160px">
40
            <div>人脸照片 :</div>
41
            <div>
42
              <img src="http://img95.699pic.com/photo/50028/0321.jpg_wh300.jpg" alt="" srcset="">
43
            </div>
44
          </div>
45

46
        </div>
47
        <div class="faceaudit">
48
          <t-form :model="formItem" :label-span="1.5" :rules="ruleValidate" label-position="right">
49
            <t-form-item label="人脸审核" prop="audit">
50

51
              <t-radio-group v-model="formItem.audit" class="col-5">
52
                <t-radio label="yes">通过</t-radio>
53
                <t-radio label="no">不通过</t-radio>
54
              </t-radio-group>
55
            </t-form-item>
56

57
            <!-- <t-form-item label="审核意见" prop="opinion">
58

59
              <t-input v-model="formItem.opinion" :rows="3" :maxlength="100" type="textarea" placeholder="请输入审核意见" count></t-input>
60

61
            </t-form-item> -->
62

63
          </t-form>
64

65
          <div class="opinion">
66
            <div>审核意见</div>
67
            <div>
68
              <t-input v-model="formItem.opinion" :rows="3" :maxlength="100" type="textarea" placeholder="请输入审核意见" count></t-input>
69
            </div>
70
          </div>
71
        </div>
72

73
      </div>
74
      <div slot="footer">
75
        <t-button long @click="visibled=false">取消</t-button>
76
        <t-button color="primary" long @click="submit">提交</t-button>
77

78
      </div>
79
    </t-modal>
80
  </div>
81
</template>
82

83
<script>
84
export default {
85
  props: {
86
    // 显示 / 隐藏导入工单对话框
87
    auditshow: {
88
      type: Boolean,
89
      default: false
90
    }
91
  },
92
  data () {
93
    return {
94
      formItem: {
95
        audit: '',
96
        opinion: ''
97
      },
98
      ruleValidate: {
99
        audit: [{ required: true, message: '请选择操作', trigger: 'change' }]
100
      }
101
    }
102
  },
103
  computed: {
104
    visibled: {
105
      set (val) {
106
        this.$emit('update:auditshow', val)
107
      },
108
      get () {
109
        return this.auditshow
110
      }
111
    }
112
  },
113
  watch: {
114
    visibled () {
115
      this.formItem.audit = ''
116
      this.formItem.opinion = ''
117
      if (this.visibled === true) {
118
        // console.log('打开了')
119
        /**
120
         *
121
         *向后端获取modal数据
122
         *
123
         */
124
      }
125
    }
126
  },
127
  methods: {
128
    submit () {
129
      console.log(this.formItem)
130
      /*
131
        向后端发送post请求
132
     */
133

134
      this.visibled = false
135
    }
136
  }
137

138
}
139
</script>
140

141
<style lang='scss' scoped>
142
.infobody {
143
  width: 552px;
144
  height: 376px;
145
  border-radius: 4px;
146
  background-color: rgba(245, 245, 245, 1);
147
  display: flex;
148
  justify-content: space-between;
149
  align-items: center;
150
  flex-wrap: wrap;
151
  padding: 16px;
152
  color: rgba(0, 0, 0, 0.45);
153
  font-size: 14px;
154
  margin-bottom: 20px;
155

156
  > div {
157
    width: 250px;
158
    height: 22px;
159
    text-align: left;
160
    span {
161
      margin-right: 5px;
162
    }
163
    > span:nth-child(2) {
164
      color: rgba(0, 0, 0, 0.65);
165
      font-size: 14px;
166
    }
167
  }
168
  > div:nth-last-child(1) {
169
    display: flex;
170
    > div:nth-child(2) {
171
      margin-left: 5px;
172
      img {
173
        width: 120px;
174
        height: 160px;
175
        border-radius: 5px;
176
      }
177
    }
178
  }
179
}
180
.opinion {
181
  display: flex;
182
  width: 100%;
183
  justify-content: flex-start;
184
  > div:nth-child(1) {
185
    width: 70px;
186
    height: 20px;
187
    margin-right: 22px;
188
  }
189
  > div:nth-child(2) {
190
    flex: 1;
191
  }
192
}
193
</style>