<template>
|
<div>
|
<el-row>
|
<el-col
|
:span="24"
|
style="height: 45px; text-align: left; margin-top: 20px; display: flex"
|
>
|
<el-radio-group v-model="type" style="margin-right: 15px">
|
<el-radio-button label="时间段"></el-radio-button>
|
<el-radio-button label="单日"></el-radio-button>
|
<el-radio-button label="单月"></el-radio-button>
|
<el-radio-button label="年度"></el-radio-button>
|
</el-radio-group>
|
<span style="margin-right: 15px">
|
<el-date-picker
|
v-model="search.valueDay"
|
:type="
|
type == '时间段'
|
? 'date'
|
: type == '单月'
|
? 'month'
|
: type == '年度'
|
? 'year'
|
: 'date'
|
"
|
:placeholder="
|
type == '时间段'
|
? '选择日期'
|
: type == '单月'
|
? '选择月份'
|
: type == '年度'
|
? '选择年份'
|
: '选择日期'
|
"
|
clearable
|
style="width: 130px"
|
></el-date-picker>
|
</span>
|
<span v-show="type == '时间段'" style="margin-right: 15px">
|
<el-time-select
|
v-model="search.valueTime"
|
:picker-options="{
|
start: '00:00',
|
step: '00:30',
|
end: '23:30',
|
}"
|
placeholder="选择时间"
|
clearable
|
style="width: 130px"
|
></el-time-select>
|
</span>
|
<el-input
|
placeholder="查询广播"
|
suffix-icon="el-icon-service"
|
v-model="search.search_fm"
|
style="margin-right: 15px; width: 130px"
|
></el-input>
|
<el-select
|
v-model="determine"
|
placeholder="请选择"
|
@change="handleChange"
|
style="margin-right: 15px"
|
>
|
<el-option
|
v-for="item in options"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
></el-option>
|
</el-select>
|
|
<div style="width: 30%; display: flex">
|
<span style="width: 100px; line-height: 28px">录音方式:</span>
|
<el-select v-model="isUnderWayValue" placeholder="请选择录音方式">
|
<el-option label="定时录制" value="0"> </el-option>
|
<el-option label="监听录制" value="3"> </el-option>
|
<el-option label="采样录制" value="4"> </el-option>
|
</el-select>
|
</div>
|
</el-col>
|
|
<el-col :span="24" class="Device" style="margin-top: 30px">
|
<el-table
|
:data="tableData"
|
:height="tableH"
|
v-loading="loading"
|
stripe
|
size="small"
|
class="detailTable"
|
>
|
<el-table-column
|
label="monitorpointId"
|
prop="monitorpointId"
|
></el-table-column>
|
<el-table-column
|
label="monitorpointName"
|
prop="monitorpointName"
|
></el-table-column>
|
<el-table-column label="frequency" prop="frequency"></el-table-column>
|
<el-table-column label="startTime" prop="startTime">
|
<template slot-scope="scope">
|
{{ dateFormatter(new Date(scope.row.startTime)) }}
|
</template>
|
</el-table-column>
|
<el-table-column label="stopTime" prop="stopTime">
|
<template slot-scope="scope">
|
{{ dateFormatter(new Date(scope.row.stopTime)) }}
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="recordStatus"
|
prop="recordStatus"
|
></el-table-column>
|
<el-table-column label="操作">
|
<template slot-scope="scope">
|
<div>
|
<el-tooltip
|
class="item"
|
effect="dark"
|
content="点击回放"
|
placement="top"
|
>
|
<i class="el-icon-refresh-right" @click="rePlay(scope)"></i>
|
</el-tooltip>
|
</div>
|
</template>
|
</el-table-column>
|
</el-table>
|
</el-col>
|
|
<el-col :span="24" style="margin-top: 5px">
|
<el-pagination
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange"
|
:current-page="pageNo"
|
:page-sizes="[10, 20, 30, 50]"
|
:page-size="pageSize"
|
layout="total, sizes, prev, pager, next, jumper"
|
:total="totalCount"
|
>
|
</el-pagination>
|
</el-col>
|
</el-row>
|
|
<el-dialog :visible.sync="socketPlay" width="50" @close="socketReplay">
|
<video
|
id="socketVidoPlay"
|
ref="socketVidoPlay"
|
src=""
|
controls
|
preload
|
width="100%"
|
height="300"
|
></video>
|
</el-dialog>
|
</div>
|
</template>
|
<script>
|
import { originalColor } from "@/utils/chartCustomer.js";
|
|
export default {
|
watch: {
|
isUnderWayValue: {
|
handler(n, o) {
|
if (this.timer) {
|
clearTimeout(this.timer);
|
}
|
this.timer = setTimeout(() => {
|
this.getData();
|
}, 300);
|
},
|
deep: true,
|
},
|
search: {
|
handler(n, o) {
|
if (this.timer) {
|
clearTimeout(this.timer);
|
}
|
this.timer = setTimeout(() => {
|
this.getData();
|
}, 300);
|
},
|
deep: true,
|
},
|
determine: {
|
handler(n, o) {
|
if (this.timer) {
|
clearTimeout(this.timer);
|
}
|
this.timer = setTimeout(() => {
|
this.getData();
|
}, 500);
|
},
|
deep: true,
|
},
|
type: {
|
handler(n, o) {
|
if (this.timer) {
|
clearTimeout(this.timer);
|
}
|
this.timer = setTimeout(() => {
|
this.getData();
|
}, 500);
|
},
|
deep: true,
|
},
|
},
|
data() {
|
return {
|
isUnderWayValue: "0",
|
playVideo: null,
|
socketPlay: false,
|
tableH: 0,
|
timer: null,
|
totalCount: 100,
|
pageNo: 1,
|
pageSize: 10,
|
tableData: [],
|
tableH: null,
|
otherAct: [{ item: "查看所有", id: "", type: "primary" }],
|
type: "年度",
|
options: [],
|
|
queryParams: {
|
page: 1,
|
size: 10,
|
VF: "",
|
table: "t_fm_scan_timestamp",
|
},
|
determine: "",
|
search: {
|
valueTime: new Date().getHours() + ":00",
|
valueDay: new Date(),
|
search_fm: "",
|
},
|
loading: false,
|
colors: originalColor,
|
color: [
|
{ color: "#9D96F5", percentage: 10 },
|
{ color: "#FF9F7F", percentage: 20 },
|
{ color: "#FB7293", percentage: 30 },
|
{ color: "#37A2DA", percentage: 40 },
|
{ color: "#67E0E3", percentage: 50 },
|
{ color: "#9FE6B8", percentage: 60 },
|
{ color: "#E690D1", percentage: 80 },
|
{ color: "#E7BCF3", percentage: 100 },
|
],
|
};
|
},
|
mounted() {
|
this.tableH = window.innerHeight - 135;
|
this.getData();
|
},
|
methods: {
|
dateFormatter(time) {
|
if (time) {
|
var year = time.getFullYear();
|
var month = time.getMonth() + 1;
|
var date = time.getDate();
|
var hour = time.getHours();
|
var minute = time.getMinutes();
|
var second = time.getSeconds();
|
return (
|
this.add0(year) +
|
"-" +
|
this.add0(month) +
|
"-" +
|
this.add0(date) +
|
" " +
|
this.add0(hour) +
|
":" +
|
this.add0(minute) +
|
":" +
|
this.add0(second)
|
);
|
} else {
|
return 0;
|
}
|
},
|
socketReplay() {
|
if (this.playVideo) {
|
this.playVideo.pause();
|
this.playVideo = null;
|
}
|
},
|
rePlay(scope) {
|
this.loading = true;
|
if (scope.row.stopTime) {
|
let startTime = this.dateFormatter(
|
new Date(new Date(scope.row.startTime).getTime())
|
);
|
let endTime = this.dateFormatter(
|
new Date(new Date(scope.row.stopTime).getTime() + 1000 * 60 * 180)
|
);
|
|
let param = new URLSearchParams();
|
param.append("method", "mutipleReview");
|
param.append("instruct", 1);
|
param.append("playType", 1);
|
param.append("hls", 1);
|
param.append("key", 123456);
|
param.append("monitorpointId", scope.row.monitorpointId);
|
param.append("frequencyValue", scope.row.frequency);
|
param.append("startTime", startTime);
|
param.append("endTime", endTime);
|
|
this.$post(window.equipmentURL + "FRP/NetRequest.do", param).then(
|
(res) => {
|
if (res.success == "true") {
|
this.socketPlay = true;
|
this.playVideo = this.$refs.socketVidoPlay;
|
if (Hls.isSupported()) {
|
var hls = new Hls();
|
hls.loadSource(res.url);
|
hls.attachMedia(this.playVideo);
|
hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
this.playVideo.play();
|
});
|
this.loading = false;
|
} else if (
|
this.playVideo.canPlayType("application/vnd.apple.mpegurl")
|
) {
|
this.playVideo.src = res.url;
|
this.playVideo.addEventListener("loadedmetadata", function () {
|
this.playVideo.play();
|
});
|
this.loading = false;
|
}
|
} else {
|
this.$message.error(res.msg);
|
this.loading = false;
|
}
|
}
|
);
|
} else {
|
this.$message.warning("尚未有回放");
|
this.loading = false;
|
}
|
},
|
handleSizeChange(size) {
|
this.pageSize = size;
|
this.getData();
|
},
|
handleCurrentChange(page) {
|
this.pageNo = page;
|
this.getData();
|
},
|
getOptions() {
|
this.$getJSON(
|
window.backstageURL +
|
"dataservice/getNoTokenData?bid=getChannelSettingB"
|
).then((res) => {
|
this.options = [];
|
let tmpArr = res.data.data[0];
|
tmpArr.forEach((item) => {
|
let oneOption = {
|
value: item.monitorpointId,
|
label: item.monitorpointName,
|
};
|
this.options.push(oneOption);
|
});
|
});
|
},
|
handleChange(value) {
|
this.queryParams.determine = value;
|
},
|
getData() {
|
this.loading = true;
|
let typeValue = this.formatType(this.type);
|
|
let dateValue =
|
this.search.valueDay == ""
|
? "2021"
|
: this.formatDate(this.search.valueDay);
|
|
let tmeValue =
|
this.type == "时间段" ? this.search.valueTime.split(":")[0] : "";
|
|
this.$getJSON(window.backstageURL + "dataservice/getNoTokenData", {
|
bid: "getRecordHistory",
|
isUnderWay: this.isUnderWayValue,
|
querymode: typeValue,
|
timevalue1: dateValue,
|
timevalue2: tmeValue,
|
monitorpointid: this.determine,
|
frequency: this.search.search_fm,
|
pageno: this.pageNo,
|
pagesize: this.pageSize,
|
}).then((res) => {
|
this.loading = false;
|
this.tableData = res.data.data[0];
|
this.totalCount = Number(res.data.data[1][0].counter);
|
});
|
},
|
|
formatType(type) {
|
if (type == "时间段") {
|
return "time";
|
} else if (type == "单日") {
|
return "day";
|
} else if (type == "单月") {
|
return "month";
|
} else if (type == "年度") {
|
return "year";
|
}
|
},
|
|
formatDate(date) {
|
if (date) {
|
let year = date.getFullYear();
|
let month = date.getMonth() + 1;
|
let day = date.getDate();
|
|
if (this.type == "年度") {
|
return year;
|
} else if (this.type == "单月") {
|
return year + "-" + this.add0(month);
|
} else if (this.type == "单日" || this.type == "时间段") {
|
return year + "-" + this.add0(month) + "-" + this.add0(day);
|
} else {
|
return "";
|
}
|
}
|
},
|
|
add0(val) {
|
return val < 10 ? "0" + val : val;
|
},
|
},
|
};
|
</script>
|
<style lang="scss" scope>
|
</style>
|