Commit 43550ee3 authored by moonby's avatar moonby

240729

parent 8e6b4d6a
...@@ -3,26 +3,26 @@ ...@@ -3,26 +3,26 @@
<div class="div-header"> <div class="div-header">
<el-row> <el-row>
<el-col :span="4"> <el-col :span="4">
<div class="div-button" style="display: flex;"> <div class="div-button" style="display: flex;">
<div class="div-autoRefresh"> <div class="div-autoRefresh">
<el-switch v-model="isHisData" class="switch-autoRefresh" active-text="历史数据" <el-switch v-model="isHisData" class="switch-autoRefresh" active-text="历史数据"
inactive-text="实时数据" inactive-text="实时数据"
style="--el-switch-on-color: #13ce66; --el-switch-off-color: rgb(64, 158, 255)" style="--el-switch-on-color: #13ce66; --el-switch-off-color: rgb(64, 158, 255)"
@change="changeData" /> @change="changeData" />
</div> </div>
</div> </div>
</el-col> </el-col>
<el-col :span="9"> <el-col :span="7">
<div class="div-dropdown text-center"> <div class="div-dropdown text-center">
<span>小区名称&nbsp;:&nbsp;</span> <span>小区名称&nbsp;:&nbsp;</span>
<el-cascader :options="DataInfo.tree" v-model="DataInfo.name" :props="props" collapse-tags <el-cascader :options="DataInfo.tree" v-model="DataInfo.name" :props="props" collapse-tags
clearable :show-all-levels="false" filterable placeholder="请选择" style="min-width: 310px;" /> clearable :show-all-levels="false" filterable placeholder="请选择" style="min-width: 280px;" />
</div> </div>
</el-col> </el-col>
<el-col :span="9"> <el-col :span="11">
<div class="div-time-picker" v-show="isHisData"> <div class="div-time-picker" v-show="isHisData">
<el-form-item label="开始时间:" style="margin-right: 20px;"> <el-form-item label="开始时间:" style="margin-right: 20px;">
<el-config-provider :locale="zhCn"> <el-config-provider :locale="zhCn">
...@@ -42,15 +42,13 @@ ...@@ -42,15 +42,13 @@
<el-col :span="2"> <el-col :span="2">
<div class="div-button"> <div class="div-button">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="3">
</el-col>
<el-col :span="15"> <el-col :span="15">
<el-button class="el-button-button" type="primary" :span="6" @click="SearchData"
<el-button class="el-button-button" type="primary" :span="6" @click="SearchData" icon="Search"> icon="Search">
&nbsp;&nbsp;</el-button> &nbsp;&nbsp;</el-button>
</el-col>
<el-col :span="3">
</el-col> </el-col>
<el-col :span="3"> <el-col :span="3">
</el-col> </el-col>
...@@ -77,9 +75,9 @@ ...@@ -77,9 +75,9 @@
<el-table v-show="isHisData" :data="tableInfo.tableData" :height="tableHeight" v-loading="loading" <el-table v-show="isHisData" :data="tableInfo.tableData" :height="tableHeight" v-loading="loading"
:cell-style="setCellStyle" border highlight-current-row :header-cell-style="setHeaderCellStyle" :cell-style="setCellStyle" border highlight-current-row :header-cell-style="setHeaderCellStyle"
:header-cell-class-name="handleHeadAddClass" @sort-change="sortMethod" > :header-cell-class-name="handleHeadAddClass" @sort-change="sortMethod">
<el-table-column v-for="(item, i) in tableInfo.title.frozenList" :prop="item.field" :label="item.title" <el-table-column v-for="(item, i) in tableInfo.title.frozenList" :prop="item.field" :label="item.title"
:width="item.width" fixed sortable/> :width="item.width" fixed sortable />
<template v-for="(item, i) in tableInfo.title.otherList"> <template v-for="(item, i) in tableInfo.title.otherList">
<el-table-column :prop="item.enName" :label="item.alias" :width="item.width"> <el-table-column :prop="item.enName" :label="item.alias" :width="item.width">
</el-table-column> </el-table-column>
...@@ -259,35 +257,35 @@ var date = new Date(); ...@@ -259,35 +257,35 @@ var date = new Date();
var year = date.getFullYear(); var year = date.getFullYear();
var day = 0; var day = 0;
var dateArr = [ var dateArr = [
date.getMonth() + 1, //月份从0~11,所以加一 date.getMonth() + 1, //月份从0~11,所以加一
date.getDate() -1, date.getDate() - 1,
date.getHours(), date.getHours(),
date.getMinutes(), date.getMinutes(),
date.getSeconds(), date.getSeconds(),
date.getDate() date.getDate()
]; ];
for (var i = 0; i < dateArr.length; i++) { for (var i = 0; i < dateArr.length; i++) {
if (dateArr[i] >= 1 && dateArr[i] <= 9) { if (dateArr[i] >= 1 && dateArr[i] <= 9) {
dateArr[i] = "0" + dateArr[i]; dateArr[i] = "0" + dateArr[i];
} }
} }
day = dateArr[1] - 1; day = dateArr[1] - 1;
if (day >= 1 && day <= 9) { if (day >= 1 && day <= 9) {
day = "0" + day; day = "0" + day;
} }
// var endTime = year + "-" + dateArr[0] + "-" + dateArr[1] + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4]; // var endTime = year + "-" + dateArr[0] + "-" + dateArr[1] + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4];
// var startTime = year + "-" + dateArr[0] + "-" + day + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4]; // var startTime = year + "-" + dateArr[0] + "-" + day + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4];
var startTimeValue = sessionStorage.getItem("DeviceQueryStart"); var startTimeValue = sessionStorage.getItem("DeviceQueryStart");
if(!startTimeValue){ if (!startTimeValue) {
startTimeValue = (year) + "-" + dateArr[0] + "-"+ dateArr[1] + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4]; startTimeValue = (year) + "-" + dateArr[0] + "-" + dateArr[1] + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4];
sessionStorage.setItem("DeviceQueryStart", startTimeValue); sessionStorage.setItem("DeviceQueryStart", startTimeValue);
} }
var endTimeValue = sessionStorage.getItem("DeviceQueryEnd"); var endTimeValue = sessionStorage.getItem("DeviceQueryEnd");
if(!endTimeValue){ if (!endTimeValue) {
endTimeValue = (year) + "-" + dateArr[0] + "-" + dateArr[5] + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4]; endTimeValue = (year) + "-" + dateArr[0] + "-" + dateArr[5] + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4];
sessionStorage.setItem("DeviceQueryEnd", endTimeValue); sessionStorage.setItem("DeviceQueryEnd", endTimeValue);
} }
startTime.value = startTimeValue; startTime.value = startTimeValue;
...@@ -295,14 +293,14 @@ endTime.value = endTimeValue; ...@@ -295,14 +293,14 @@ endTime.value = endTimeValue;
console.log(endTime) console.log(endTime)
function changeStartTime(){ function changeStartTime() {
sessionStorage.setItem("DeviceQueryStart", startTime.value); sessionStorage.setItem("DeviceQueryStart", startTime.value);
} }
function changeEndTime(){ function changeEndTime() {
sessionStorage.setItem("DeviceQueryEnd", endTime.value); sessionStorage.setItem("DeviceQueryEnd", endTime.value);
} }
const props = { multiple: true,emitPath: false } const props = { multiple: true, emitPath: false }
const DataInfo = reactive({ const DataInfo = reactive({
"enterpriseId": enterpriseId.value, "enterpriseId": enterpriseId.value,
tree: [], tree: [],
...@@ -332,6 +330,21 @@ var tableInfo = reactive({ ...@@ -332,6 +330,21 @@ var tableInfo = reactive({
const loading = ref(false); const loading = ref(false);
const value = ref(true); const value = ref(true);
//日期转换字符串
function formatDate(date) {
let year = date.getFullYear();
let month = twoDigits(date.getMonth() + 1); // 月份是从0开始的
let day = twoDigits(date.getDate());
let hour = twoDigits(date.getHours());
let minute = twoDigits(date.getMinutes());
let second = twoDigits(date.getSeconds());
return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
}
function twoDigits(value) {
return value < 10 ? '0' + value : value;
}
//数据控制,根据isHisData的值决定数据控制逻辑,false为实时数据,true为历史数据 //数据控制,根据isHisData的值决定数据控制逻辑,false为实时数据,true为历史数据
...@@ -391,8 +404,9 @@ function init() { ...@@ -391,8 +404,9 @@ function init() {
} }
//数据切换 //数据切换
function changeData() { async function changeData() {
init(); init();
getName();
} }
//实时数据初始化 //实时数据初始化
...@@ -403,15 +417,6 @@ async function initReal() { ...@@ -403,15 +417,6 @@ async function initReal() {
await getRealData(); await getRealData();
//设置总页数 //设置总页数
total.value = tableInfo.realData.length; total.value = tableInfo.realData.length;
var list = [];
tableInfo.realData.forEach(data => {
list.push(data.name);
})
var list2 = [...new Set(list)];
// console.log(list);
setSelect(list2)
} }
//历史数据初始化 //历史数据初始化
async function initHis() { async function initHis() {
...@@ -420,14 +425,6 @@ async function initHis() { ...@@ -420,14 +425,6 @@ async function initHis() {
tableInfo.tableData.length = 0; tableInfo.tableData.length = 0;
tableInfo.hisData.length = 0; tableInfo.hisData.length = 0;
await getHisData(); await getHisData();
//设置总页数
var list = [];
// console.log(tableInfo)
tableInfo.hisData.forEach(data => {
list.push(data.name);
})
var list2 = [...new Set(list)];
setSelect(list2)
} }
//获得数据 //获得数据
...@@ -460,6 +457,25 @@ async function getHisData() { ...@@ -460,6 +457,25 @@ async function getHisData() {
loading.value = false loading.value = false
} }
//获得小区数据
async function getName() {
loading.value = true
await http.post('/api/tiger/TigerHeatUser/GetName').then((result) => {
if (result.status === 0) {
//处理返回数据
var list = [];
result.data.forEach(data => {
list.push(data.name);
})
var list2 = [...new Set(list)];
setSelect(list2)
} else {
// tableInfo.tableData.length = 0;
}
})
loading.value = false
}
//根据参数获得数据 //根据参数获得数据
async function getHisDataByInfo(name, start, end, startPage, pagesCount, sort) { async function getHisDataByInfo(name, start, end, startPage, pagesCount, sort) {
loading.value = true loading.value = true
...@@ -492,14 +508,14 @@ function setShowThisData(data) { ...@@ -492,14 +508,14 @@ function setShowThisData(data) {
//设置搜索栏可选择项 //设置搜索栏可选择项
function setSelect(list) { function setSelect(list) {
DataInfo.tree.length = 0; DataInfo.tree.length = 0;
DataInfo.name.length=0; DataInfo.name.length = 0;
list.forEach(area => { list.forEach(area => {
DataInfo.tree.push({ DataInfo.tree.push({
value: area, value: area,
label: area label: area
}) })
}) })
if(DataInfo.tree.length>0){ if (DataInfo.tree.length > 0) {
DataInfo.name.push(DataInfo.tree[0].value); DataInfo.name.push(DataInfo.tree[0].value);
} }
} }
...@@ -517,10 +533,10 @@ function SearchData() { ...@@ -517,10 +533,10 @@ function SearchData() {
//实时数据,本地搜索 //实时数据,本地搜索
function SearchRealData() { function SearchRealData() {
var data = tableInfo.realData.filter((current, index) => { var data = tableInfo.realData.filter((current, index) => {
if(DataInfo.name.length==0){ if (DataInfo.name.length == 0) {
return true; return true;
} }
if(DataInfo.name.includes(current.name)){ if (DataInfo.name.includes(current.name)) {
return true; return true;
} }
return false; return false;
......
...@@ -15,14 +15,15 @@ ...@@ -15,14 +15,15 @@
</el-col> </el-col>
<el-col :span="9"> <el-col :span="7">
<div class="div-dropdown text-center"> <div class="div-dropdown text-center">
<span>小区名称&nbsp;:&nbsp;</span> <el-form-item label="小区名称:">
<el-cascader :options="DataInfo.tree" v-model="DataInfo.name" :props="props" collapse-tags <el-cascader :options="DataInfo.tree" v-model="DataInfo.name" :props="props" collapse-tags
clearable :show-all-levels="false" filterable placeholder="请选择" style="min-width: 310px;" /> clearable :show-all-levels="false" filterable placeholder="请选择" style="min-width: 280px;" />
</el-form-item>
</div> </div>
</el-col> </el-col>
<el-col :span="9"> <el-col :span="11">
<div class="div-time-picker" v-show="isHisData"> <div class="div-time-picker" v-show="isHisData">
<el-form-item label="开始时间:" style="margin-right: 20px;"> <el-form-item label="开始时间:" style="margin-right: 20px;">
<el-config-provider :locale="zhCn"> <el-config-provider :locale="zhCn">
...@@ -42,10 +43,6 @@ ...@@ -42,10 +43,6 @@
<el-col :span="2"> <el-col :span="2">
<div class="div-button"> <div class="div-button">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="3">
</el-col>
<el-col :span="15"> <el-col :span="15">
<el-button class="el-button-button" type="primary" :span="6" @click="SearchData" icon="Search"> <el-button class="el-button-button" type="primary" :span="6" @click="SearchData" icon="Search">
...@@ -53,6 +50,8 @@ ...@@ -53,6 +50,8 @@
</el-col> </el-col>
<el-col :span="3"> <el-col :span="3">
</el-col>
<el-col :span="3">
</el-col> </el-col>
<el-col :span="3"> <el-col :span="3">
</el-col> </el-col>
...@@ -193,18 +192,15 @@ ...@@ -193,18 +192,15 @@
} }
.div-dropdown { .div-dropdown {
//display: flex;
padding-top: 7px; padding-top: 7px;
height: 50px; height: 50px;
padding-left: 10px; padding-left: 10px;
.el-dropdown-link { .el-dropdown-link {
margin-top: 5px; margin-top: 5px;
color: white; color: white;
} }
} }
...@@ -389,12 +385,12 @@ function init() { ...@@ -389,12 +385,12 @@ function init() {
} else { } else {
initReal(); initReal();
} }
// setSelect();
} }
//数据切换 //数据切换
function changeData() { async function changeData() {
init(); init();
getName();
} }
//实时数据初始化 //实时数据初始化
...@@ -403,17 +399,6 @@ async function initReal() { ...@@ -403,17 +399,6 @@ async function initReal() {
tableInfo.tableData.length = 0; tableInfo.tableData.length = 0;
tableInfo.realData.length = 0; tableInfo.realData.length = 0;
await getRealData(); await getRealData();
//设置总页数
total.value = tableInfo.realData.length;
var list = [];
tableInfo.realData.forEach(data => {
list.push(data.name);
})
var list2 = [...new Set(list)];
// console.log(list);
setSelect(list2)
} }
//历史数据初始化 //历史数据初始化
async function initHis() { async function initHis() {
...@@ -422,15 +407,6 @@ async function initHis() { ...@@ -422,15 +407,6 @@ async function initHis() {
tableInfo.tableData.length = 0; tableInfo.tableData.length = 0;
tableInfo.hisData.length = 0; tableInfo.hisData.length = 0;
await getHisData(); await getHisData();
//设置总页数
var list = [];
// console.log(tableInfo)
tableInfo.hisData.forEach(data => {
list.push(data.name);
})
var list2 = [...new Set(list)];
setSelect(list2)
} }
//获得数据 //获得数据
...@@ -464,6 +440,25 @@ async function getHisData() { ...@@ -464,6 +440,25 @@ async function getHisData() {
loading.value = false loading.value = false
} }
//获得小区数据
async function getName() {
loading.value = true
await http.post('/api/tiger/TigerHeatUser/GetName').then((result) => {
if (result.status === 0) {
//处理返回数据
var list = [];
result.data.forEach(data => {
list.push(data.name);
})
var list2 = [...new Set(list)];
setSelect(list2)
} else {
// tableInfo.tableData.length = 0;
}
})
loading.value = false
}
//根据参数获得数据 //根据参数获得数据
async function getHisDataByInfo(name, start, end, startPage, pagesCount, sort) { async function getHisDataByInfo(name, start, end, startPage, pagesCount, sort) {
loading.value = true loading.value = true
......
...@@ -205,6 +205,12 @@ function getVideoInfo() { ...@@ -205,6 +205,12 @@ function getVideoInfo() {
function initPage() { function initPage() {
getVideoInfo();//视频信息 getVideoInfo();//视频信息
getStats();//下拉列表 getStats();//下拉列表
if(route.query.id){
//设置选择框
VideoInfo.value=route.query.id;
//播放视频
getVideoFromVideoList(route.query.id);
}
} }
//从视频列表中找到当前被选中的换热站对应的所有视频id //从视频列表中找到当前被选中的换热站对应的所有视频id
...@@ -217,7 +223,6 @@ function getVideoFromVideoList(Id) { ...@@ -217,7 +223,6 @@ function getVideoFromVideoList(Id) {
VideoInfo.playVideoList.push(videoId); VideoInfo.playVideoList.push(videoId);
} }
}) })
console.log(VideoInfo);
if (oWebControl) { if (oWebControl) {
playVideoByVideoList(VideoInfo.playVideoList) playVideoByVideoList(VideoInfo.playVideoList)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment