|
|
@@ -15,17 +15,25 @@
|
|
|
label="人流量监测"
|
|
|
name="first"
|
|
|
>
|
|
|
- <div class="has-top-padding">
|
|
|
+ <div v-loading="videoOption.loading" class="has-top-padding maxheight">
|
|
|
<div class="l-flex--row c-table__header">
|
|
|
- <div class="l-flex__auto c-sibling-item">
|
|
|
+ <div class="l-flex__none c-sibling-item">
|
|
|
<button
|
|
|
- v-if="isSuperAdmin"
|
|
|
+ v-if="isSuperAdmin && bind"
|
|
|
class="o-button"
|
|
|
@click="onAdd"
|
|
|
>
|
|
|
<i class="o-button__icon el-icon-circle-plus-outline" />新增
|
|
|
</button>
|
|
|
</div>
|
|
|
+ <div class="l-flex__auto c-sibling-item">
|
|
|
+ <button
|
|
|
+ class="o-button o-botton_white"
|
|
|
+ @click="onFull"
|
|
|
+ >
|
|
|
+ <i class="o-button__icon el-icon-full-screen" />全部
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
<search-input
|
|
|
v-model.trim="searchname"
|
|
|
class="l-flex__none c-sibling-item"
|
|
|
@@ -62,6 +70,7 @@
|
|
|
class="video"
|
|
|
muted
|
|
|
autoplay
|
|
|
+ controls
|
|
|
:poster="require('@/assets//video-post.png')"
|
|
|
/>
|
|
|
<div
|
|
|
@@ -72,7 +81,7 @@
|
|
|
</div>
|
|
|
<div class="o-video_buttom l-flex--row">
|
|
|
<div class="l-flex__auto">{{ video.name }}</div>
|
|
|
- <template v-if="isSuperAdmin">
|
|
|
+ <template v-if="isSuperAdmin && bind">
|
|
|
<img
|
|
|
class="o-video_edit"
|
|
|
:src="imgUrl.edit"
|
|
|
@@ -102,7 +111,7 @@
|
|
|
<el-link
|
|
|
class="u-pointer"
|
|
|
type="warning"
|
|
|
- @click="getCamera"
|
|
|
+ @click="getCamera(cameraType)"
|
|
|
>
|
|
|
出错了,点击重试
|
|
|
</el-link>
|
|
|
@@ -112,25 +121,33 @@
|
|
|
:total="videoOption.totalCount"
|
|
|
:page.sync="videoOption.params.pageNum"
|
|
|
:limit.sync="videoOption.params.pageSize"
|
|
|
- @pagination="getCamera"
|
|
|
+ @pagination="getCamera(cameraType)"
|
|
|
/>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
- <!-- <el-tab-pane
|
|
|
+ <el-tab-pane
|
|
|
label="LED屏画面监测"
|
|
|
name="second"
|
|
|
>
|
|
|
- <div v-loading="screenOption.loading" class="has-top-padding">
|
|
|
+ <div v-loading="screenOption.loading" class="has-top-padding maxheight">
|
|
|
<div class="l-flex--row c-table__header">
|
|
|
- <div class="l-flex__auto c-sibling-item">
|
|
|
+ <div class="l-flex__none c-sibling-item">
|
|
|
<button
|
|
|
- v-if="isSuperAdmin"
|
|
|
+ v-if="isSuperAdmin && bind"
|
|
|
class="o-button"
|
|
|
@click="onAdd"
|
|
|
>
|
|
|
<i class="o-button__icon el-icon-circle-plus-outline" />新增
|
|
|
</button>
|
|
|
</div>
|
|
|
+ <div class="l-flex__auto c-sibling-item">
|
|
|
+ <button
|
|
|
+ class="o-button o-botton_white"
|
|
|
+ @click="onFull"
|
|
|
+ >
|
|
|
+ <i class="o-button__icon el-icon-full-screen" />全部
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
<search-input
|
|
|
v-model.trim="searchname"
|
|
|
class="l-flex__none c-sibling-item"
|
|
|
@@ -167,6 +184,7 @@
|
|
|
class="video"
|
|
|
muted
|
|
|
autoplay
|
|
|
+ controls
|
|
|
:poster="require('@/assets/video-post.png')"
|
|
|
/>
|
|
|
<div
|
|
|
@@ -177,16 +195,16 @@
|
|
|
</div>
|
|
|
<div class="o-video_buttom l-flex--row">
|
|
|
<div class="l-flex__auto">{{ video.name }}</div>
|
|
|
- <template v-if="isSuperAdmin">
|
|
|
+ <template v-if="isSuperAdmin && bind">
|
|
|
<img
|
|
|
class="o-video_edit"
|
|
|
:src="imgUrl.edit"
|
|
|
- @click.stop="editbtn(video)"
|
|
|
+ @click.stop="onEdit(video)"
|
|
|
>
|
|
|
<img
|
|
|
class="o-video_delete"
|
|
|
:src="imgUrl.delete"
|
|
|
- @click.stop="deletebtn(video)"
|
|
|
+ @click.stop="onDel(video)"
|
|
|
>
|
|
|
</template>
|
|
|
</div>
|
|
|
@@ -205,7 +223,7 @@
|
|
|
<el-link
|
|
|
class="u-pointer"
|
|
|
type="warning"
|
|
|
- @click="getCamera"
|
|
|
+ @click="getCamera(cameraType)"
|
|
|
>
|
|
|
出错了,点击重试
|
|
|
</el-link>
|
|
|
@@ -216,10 +234,10 @@
|
|
|
:page-sizes="[6]"
|
|
|
:page.sync="screenOption.params.pageNum"
|
|
|
:limit.sync="screenOption.params.pageSize"
|
|
|
- @pagination="getCamera"
|
|
|
+ @pagination="getCamera(cameraType)"
|
|
|
/>
|
|
|
</div>
|
|
|
- </el-tab-pane> -->
|
|
|
+ </el-tab-pane>
|
|
|
</el-tabs>
|
|
|
<el-dialog
|
|
|
:title="dialogTitle"
|
|
|
@@ -324,6 +342,21 @@
|
|
|
@closeDetail="closeDetail"
|
|
|
/>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ title
|
|
|
+ :fullscreen="true"
|
|
|
+ :visible="fullshow"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ class="fulldialog"
|
|
|
+ >
|
|
|
+ <Fullscreen
|
|
|
+ v-if="fullshow"
|
|
|
+ :camera-type="cameraType"
|
|
|
+ :device="device"
|
|
|
+ :total-count="cameraType===2?videoOption.totalCount:screenOption.totalCount"
|
|
|
+ @closeDetail="closeDetail"
|
|
|
+ />
|
|
|
+ </el-dialog>
|
|
|
</wrapper>
|
|
|
</template>
|
|
|
|
|
|
@@ -334,17 +367,28 @@ import {
|
|
|
getCamera,
|
|
|
addCamera,
|
|
|
updateCamera,
|
|
|
- deleteCamera
|
|
|
+ deleteCamera,
|
|
|
+ getBindCamera
|
|
|
} from '@/api/camera'
|
|
|
import { createListOptions } from '@/utils'
|
|
|
import Detail from './components/Detail'
|
|
|
+import Fullscreen from './components/Fullscreen'
|
|
|
|
|
|
const CAMERA_URL = `${location.protocol === 'https:' ? 'wss' : 'ws'}://${process.env.VUE_APP_GATEWAY || location.host}${process.env.VUE_APP_CAMERA_PROXY}`
|
|
|
|
|
|
export default {
|
|
|
name: 'Camera',
|
|
|
components: {
|
|
|
- Detail
|
|
|
+ Detail,
|
|
|
+ Fullscreen
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ device: {
|
|
|
+ type: Object,
|
|
|
+ default () {
|
|
|
+ return {}
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
@@ -381,19 +425,20 @@ export default {
|
|
|
screenOption: createListOptions({
|
|
|
pageSize: 6
|
|
|
}),
|
|
|
- checkList: [],
|
|
|
- returnList: createListOptions({
|
|
|
- pageSize: 9
|
|
|
- }),
|
|
|
- returnheight: 0,
|
|
|
- rowNum: 8
|
|
|
+ fullshow: false,
|
|
|
+ bind: JSON.stringify(this.device) === '{}'
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapGetters(['isSuperAdmin'])
|
|
|
+ ...mapGetters(['isSuperAdmin']),
|
|
|
+ cameraType () {
|
|
|
+ return this.activeName === 'first' ? 2 : 1
|
|
|
+ }
|
|
|
},
|
|
|
created () {
|
|
|
- this.getCamera()
|
|
|
+ // console.log(JSON.stringify(this.device) === '{}')
|
|
|
+ this.getCamera(this.cameraType)
|
|
|
+ // this.getBindCamera()
|
|
|
},
|
|
|
beforeDestroy () {
|
|
|
this.destroyPlayer()
|
|
|
@@ -412,26 +457,72 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- handleClick () {},
|
|
|
+ handleClick () {
|
|
|
+ this.getCamera(this.cameraType)
|
|
|
+ // if (this.cameraType === 1) {
|
|
|
+ // if (this.screenOption.list.length === 0) {
|
|
|
+ // this.getCamera(this.cameraType, 'no')
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // if (this.videoOption.list.length === 0) {
|
|
|
+ // this.getCamera(this.cameraType, 'no')
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ },
|
|
|
search () {
|
|
|
- this.getCamera()
|
|
|
+ this.getCamera(this.cameraType)
|
|
|
},
|
|
|
- getCamera () {
|
|
|
- const options = this.videoOption
|
|
|
+ getBindCamera () {
|
|
|
+ getBindCamera({
|
|
|
+ deviceId: this.device.id,
|
|
|
+ cameraType: this.cameraType
|
|
|
+ }).then((data) => {
|
|
|
+ console.log(data)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getCamera (cameraType, no) {
|
|
|
+ var type
|
|
|
+ var options
|
|
|
+ if (cameraType === 2) {
|
|
|
+ options = this.videoOption
|
|
|
+ } else {
|
|
|
+ options = this.screenOption
|
|
|
+ }
|
|
|
+ // const options = this.videoOption
|
|
|
options.error = false
|
|
|
options.loading = true
|
|
|
options.params.name = this.searchname
|
|
|
- getCamera(options.params)
|
|
|
+ options.params.cameraType = cameraType || ''
|
|
|
+ if (this.bind) {
|
|
|
+ type = getCamera
|
|
|
+ } else {
|
|
|
+ type = getBindCamera
|
|
|
+ options.params.deviceId = this.device.id
|
|
|
+ }
|
|
|
+ type(options.params)
|
|
|
.then(
|
|
|
({ data, totalCount }) => {
|
|
|
- options.totalCount = totalCount
|
|
|
+ options.totalCount = totalCount || 0
|
|
|
options.list = data
|
|
|
- options.totalCount && this.$nextTick(() => {
|
|
|
- this.videoheight = (this.$refs.videoB[0].clientWidth * 9) / 16 + 'px'
|
|
|
+ // options.totalCount &&
|
|
|
+ this.$nextTick(() => {
|
|
|
+ try {
|
|
|
+ if (this.$refs.videoB) {
|
|
|
+ this.videoheight = ((this.$refs.videoB[0].clientWidth || this.$refs.screenB[0].clientWidth) * 9) / 16 + 'px'
|
|
|
+ } else if (this.$refs.screenB) {
|
|
|
+ this.videoheight = ((this.$refs.screenB[0].clientWidth || this.$refs.videoB[0].clientWidth) * 9) / 16 + 'px'
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error)
|
|
|
+ }
|
|
|
this.destroyPlayer()
|
|
|
- for (let i = 0; i < data.length; i++) {
|
|
|
- if (options.list[i].onlineStatus) {
|
|
|
- this.getflv(options.list[i].identifier)
|
|
|
+ // if (!no) {
|
|
|
+ // this.destroyPlayer()
|
|
|
+ // }
|
|
|
+ for (let i = 0; i < options.list.length; i++) {
|
|
|
+ var item = this.bind ? options.list[i] : options.list[i].thirdPartyDevice
|
|
|
+ if (item.onlineStatus) {
|
|
|
+ this.getflv(item.identifier)
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
@@ -451,10 +542,11 @@ export default {
|
|
|
identifier: this.camera.identifier,
|
|
|
username: this.camera.username,
|
|
|
password: this.camera.password,
|
|
|
- remark: this.camera.remark
|
|
|
+ remark: this.camera.remark,
|
|
|
+ cameraType: this.cameraType
|
|
|
}).then(() => {
|
|
|
this.handleCloseAddDialog('cameraForm')
|
|
|
- this.getCamera()
|
|
|
+ this.getCamera(this.cameraType)
|
|
|
})
|
|
|
},
|
|
|
onAdd () {
|
|
|
@@ -507,10 +599,11 @@ export default {
|
|
|
identifier: item.identifier,
|
|
|
username: this.camera.username,
|
|
|
password: this.camera.password,
|
|
|
- remark: this.camera.remark
|
|
|
+ remark: this.camera.remark,
|
|
|
+ cameraType: this.cameraType
|
|
|
}).then(() => {
|
|
|
this.handleCloseAddDialog('cameraForm')
|
|
|
- this.getCamera()
|
|
|
+ this.getCamera(this.cameraType)
|
|
|
})
|
|
|
},
|
|
|
onDel (item) {
|
|
|
@@ -519,7 +612,7 @@ export default {
|
|
|
if (videoOption.list.length === 1 && videoOption.params.pageNum > 1) {
|
|
|
videoOption.params.pageNum -= 1
|
|
|
}
|
|
|
- this.getCamera()
|
|
|
+ this.getCamera(this.cameraType)
|
|
|
})
|
|
|
},
|
|
|
getflv (identifier) {
|
|
|
@@ -532,7 +625,11 @@ export default {
|
|
|
url: `${CAMERA_URL}/${identifier}?authorization=${this.$keycloak.token}`
|
|
|
})
|
|
|
this.playerList[identifier].on('error', (e) => {
|
|
|
- console.log(e)
|
|
|
+ // console.log(e)
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: e
|
|
|
+ })
|
|
|
})
|
|
|
// 将实例挂载到video元素上面
|
|
|
this.playerList[identifier].attachMediaElement(this.$refs[identifier][0])
|
|
|
@@ -556,7 +653,12 @@ export default {
|
|
|
},
|
|
|
closeDetail () {
|
|
|
this.detailing = false
|
|
|
- this.getCamera()
|
|
|
+ this.fullshow = false
|
|
|
+ this.getCamera(this.cameraType)
|
|
|
+ },
|
|
|
+ onFull () {
|
|
|
+ this.destroyPlayer()
|
|
|
+ this.fullshow = true
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -571,7 +673,7 @@ video::-webkit-media-controls-enclosure {
|
|
|
height: 100%;
|
|
|
}
|
|
|
.rowheight {
|
|
|
- // height: calc(100% - 40px);
|
|
|
+ max-height: calc(100% - 100px);
|
|
|
overflow: auto;
|
|
|
}
|
|
|
.c-tabs {
|
|
|
@@ -625,6 +727,14 @@ video::-webkit-media-controls-enclosure {
|
|
|
color: #aaa;
|
|
|
text-align: center;
|
|
|
}
|
|
|
+.maxheight{
|
|
|
+ height: 100%;
|
|
|
+}
|
|
|
+.o-botton_white{
|
|
|
+ background-color: #fff;
|
|
|
+ border: 1px solid #D5D9E4;
|
|
|
+ color: #8E929C;
|
|
|
+}
|
|
|
</style>
|
|
|
<style lang="scss">
|
|
|
.fulldialog {
|