|
@@ -4,7 +4,15 @@
|
|
|
<el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
|
|
<el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
|
|
|
<el-card class="box-card">
|
|
<el-card class="box-card">
|
|
|
<div slot="header" class="clearfix">
|
|
<div slot="header" class="clearfix">
|
|
|
- <h3 v-html="camDetail.camName" />
|
|
|
|
|
|
|
+ <el-select v-model="camId" placeholder="选择摄像头" @change="onSelect">
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in camList"
|
|
|
|
|
+ :key="item.value"
|
|
|
|
|
+ :label="item.name"
|
|
|
|
|
+ :value="item.value"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ <el-button style="float: right; padding: 3px 0" type="text" @click="goToCamLive">实时录像</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
<div id="videoplayer" class="text item">
|
|
<div id="videoplayer" class="text item">
|
|
|
<div id="dplayer" ref="dplayer" style="height: 480px;" />
|
|
<div id="dplayer" ref="dplayer" style="height: 480px;" />
|
|
@@ -13,66 +21,62 @@
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :md="8">
|
|
<el-col :md="8">
|
|
|
- <el-row>
|
|
|
|
|
- <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
|
|
|
|
|
- <el-card class="box-card">
|
|
|
|
|
- <div slot="header" class="clearfix">
|
|
|
|
|
- <el-select v-model="cam" placeholder="选择摄像头" @change="onSelect">
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="item in camList"
|
|
|
|
|
- :key="item.value"
|
|
|
|
|
- :label="item.name"
|
|
|
|
|
- :value="item.value"
|
|
|
|
|
- />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- <el-button style="float: right; padding: 3px 0" type="text" @click="goToCamLive">实时录像</el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="text item">
|
|
|
|
|
- <el-calendar v-if="showCalender" v-model="calendarDate">
|
|
|
|
|
- <div
|
|
|
|
|
- slot="dateCell"
|
|
|
|
|
- slot-scope="{ date, data }"
|
|
|
|
|
- @click="handleCellClick(date, data)"
|
|
|
|
|
- >
|
|
|
|
|
- <p>{{ data.day.split("-").slice(2).join() }}</p>
|
|
|
|
|
- <p v-if="dealMyDate(data.day)" class="blue budge" />
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-calendar>
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-card>
|
|
|
|
|
- </el-row>
|
|
|
|
|
- <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
|
|
|
|
|
- <el-card v-if="showRecordList" class="box-card">
|
|
|
|
|
- <div slot="header" class="clearfix">
|
|
|
|
|
- <el-row>
|
|
|
|
|
- <h3>列表</h3>
|
|
|
|
|
- </el-row>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="text item">
|
|
|
|
|
- <el-table
|
|
|
|
|
- :data="recordList"
|
|
|
|
|
- :show-header="false"
|
|
|
|
|
- height="480"
|
|
|
|
|
- style="width: 100%"
|
|
|
|
|
|
|
+ <el-row v-if="showCalender" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
|
|
|
|
|
+ <el-card class="box-card">
|
|
|
|
|
+ <div class="text item">
|
|
|
|
|
+ <el-calendar v-model="calendarDate">
|
|
|
|
|
+ <div
|
|
|
|
|
+ slot="dateCell"
|
|
|
|
|
+ slot-scope="{ date, data }"
|
|
|
|
|
+ @click="handleCellClick(date, data)"
|
|
|
>
|
|
>
|
|
|
- <el-table-column
|
|
|
|
|
- prop="title"
|
|
|
|
|
- >
|
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
|
- <span>{{ scope.row.title | ellipsis }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column
|
|
|
|
|
- prop="duration"
|
|
|
|
|
- >
|
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
|
- <span>{{ scope.row.duration }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- </el-table>
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-card>
|
|
|
|
|
- </el-row>
|
|
|
|
|
|
|
+ <p>{{ data.day.split("-").slice(2).join() }}</p>
|
|
|
|
|
+ <p v-if="dealMyDate(data.day)" class="blue budge" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-calendar>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-card>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row v-if="showRecordList" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
|
|
|
|
|
+ <el-card class="box-card">
|
|
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <h3>列表</h3>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-button style="float: right; padding: 3px 0" type="text" @click="goToCamLive1">显示日历</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="text item">
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ :data="recordList"
|
|
|
|
|
+ :show-header="false"
|
|
|
|
|
+ height="480"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ @row-click="onClickRow"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="recordId"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template slot-scope="scope" onclick="getCamRecord">
|
|
|
|
|
+ <span>{{ scope.row.recordId }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="title"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span>{{ scope.row.title }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="duration"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span>{{ scope.row.duration }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-card>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
@@ -101,16 +105,17 @@ export default {
|
|
|
following: 1024,
|
|
following: 1024,
|
|
|
follower: 1024
|
|
follower: 1024
|
|
|
},
|
|
},
|
|
|
|
|
+ camId: null,
|
|
|
calendarDate: new Date(),
|
|
calendarDate: new Date(),
|
|
|
dateMap: new Map(),
|
|
dateMap: new Map(),
|
|
|
|
|
+ showCalender: false,
|
|
|
showRecordList: false,
|
|
showRecordList: false,
|
|
|
camList: [],
|
|
camList: [],
|
|
|
cam: null,
|
|
cam: null,
|
|
|
camDetail: null,
|
|
camDetail: null,
|
|
|
form: {},
|
|
form: {},
|
|
|
recordList: [],
|
|
recordList: [],
|
|
|
- camRecord: null,
|
|
|
|
|
- showCalender: false
|
|
|
|
|
|
|
+ camRecord: null
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
@@ -140,11 +145,8 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- const camId = '103758827520'
|
|
|
|
|
- if (camId === undefined || camId === null) {
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ const camId = this.$route.params.camId
|
|
|
|
|
+ this.camId = camId
|
|
|
getCamDetail(camId).then(resp => {
|
|
getCamDetail(camId).then(resp => {
|
|
|
if (resp.code === 0) {
|
|
if (resp.code === 0) {
|
|
|
var camDetail = resp.data
|
|
var camDetail = resp.data
|
|
@@ -153,7 +155,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- this.cam = camId
|
|
|
|
|
this.form.camId = camId
|
|
this.form.camId = camId
|
|
|
this.form.yearMonth = this.getYearMonth(new Date())
|
|
this.form.yearMonth = this.getYearMonth(new Date())
|
|
|
getCamRecordByMonth(this.form).then(resp => {
|
|
getCamRecordByMonth(this.form).then(resp => {
|
|
@@ -174,34 +175,32 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+ // const today = new Date()
|
|
|
getLatestRecord(camId).then(resp => {
|
|
getLatestRecord(camId).then(resp => {
|
|
|
if (resp.code === 0) {
|
|
if (resp.code === 0) {
|
|
|
const respData = resp.data
|
|
const respData = resp.data
|
|
|
- // this.initMp4Player(respData.coverUrl, respData.videoUrl)
|
|
|
|
|
|
|
+ this.initMp4Player(respData.coverUrl, respData.videoUrl)
|
|
|
}
|
|
}
|
|
|
|
|
+ }).catch(error => {
|
|
|
|
|
+ console.log(error)
|
|
|
|
|
+ var ele = document.querySelector('#dplayer')
|
|
|
|
|
+ ele.innerHTML = '<h5>没有今天的录像记录</h5>'
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
onSelect(value) {
|
|
onSelect(value) {
|
|
|
- this.form.camId = value
|
|
|
|
|
- this.form.yearMonth = this.getYearMonth(this.calendarDate)
|
|
|
|
|
- this.showCalender = false
|
|
|
|
|
- getCamRecordByMonth(this.form).then(resp => {
|
|
|
|
|
- if (resp.code === 0) {
|
|
|
|
|
- for (const item of resp.data) {
|
|
|
|
|
- const date1 = new Date(item)
|
|
|
|
|
- const dayStr = this.getYearMonthDay(date1)
|
|
|
|
|
- this.dateMap.set(dayStr, date1)
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- this.showCalender = true
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ const path = '/my/cam/record/' + value
|
|
|
|
|
+ if (this.$route.path === path) {
|
|
|
|
|
+ this.$router.go(0)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$router.push(path)
|
|
|
},
|
|
},
|
|
|
handleCellClick(date, data) {
|
|
handleCellClick(date, data) {
|
|
|
this.form.yearMonthDay = this.getYearMonthDay(date)
|
|
this.form.yearMonthDay = this.getYearMonthDay(date)
|
|
|
getCamRecordByDay(this.form).then(resp => {
|
|
getCamRecordByDay(this.form).then(resp => {
|
|
|
if (resp.code === 0) {
|
|
if (resp.code === 0) {
|
|
|
|
|
+ this.showCalender = false
|
|
|
this.showRecordList = true
|
|
this.showRecordList = true
|
|
|
this.recordList = resp.data
|
|
this.recordList = resp.data
|
|
|
}
|
|
}
|
|
@@ -257,21 +256,27 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- getCamRecord(recordId) {
|
|
|
|
|
|
|
+ onClickRow(row) {
|
|
|
|
|
+ const recordId = row.recordId
|
|
|
getCamRecord(recordId).then(resp => {
|
|
getCamRecord(recordId).then(resp => {
|
|
|
if (resp.code === 0) {
|
|
if (resp.code === 0) {
|
|
|
const respData = resp.data
|
|
const respData = resp.data
|
|
|
- // this.initMp4Player(respData.coverUrl, respData.videoUrl)
|
|
|
|
|
|
|
+ console.log(respData)
|
|
|
|
|
+ this.initMp4Player(respData.coverUrl, respData.videoUrl)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
goToCamLive() {
|
|
goToCamLive() {
|
|
|
- const path = '/my/cam/live'
|
|
|
|
|
|
|
+ const path = '/my/cam/live/' + this.camId
|
|
|
if (this.$route.path === path) {
|
|
if (this.$route.path === path) {
|
|
|
this.$router.go(0)
|
|
this.$router.go(0)
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
this.$router.push(path)
|
|
this.$router.push(path)
|
|
|
|
|
+ },
|
|
|
|
|
+ goToCamLive1() {
|
|
|
|
|
+ this.showRecordList = false
|
|
|
|
|
+ this.showCalender = true
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|