Commit 00d60199 authored by mahui's avatar mahui

init

parent 341e39fa
......@@ -32,4 +32,8 @@ export default {
getMonitorInfo(params) {
return http.post('web/toilet/getMonitorInfo', params)
},
//类型数据
typeData(params) {
return http.post('web/type/typeData', params)
},
}
......@@ -20,90 +20,87 @@
<script>
import EZUIKit from "ezuikit-js";
let player = null;
import api from "@/api/methods/index"
export default {
name: "esu",
props: {
url: String,
accessToken: String,
modelValue: Boolean,
site_id: Number,
},
data(){
return {
next_time:Date.now()
next_time:Date.now(),
url:'',
accessToken:'',
player:null,
}
},
watch:{
url(val){
if(val){
mounted(){
this.$nextTick(()=>{
this.init();
this.getMonitorInfo();
window.addEventListener('onresize',this.resize);
})
}
}
},
methods: {
play() {
const playPromise = player.play();
const playPromise = this.player.play();
playPromise.then((data) => {
console.log("promise 获取 数据", data)
})
},
stop() {
const stopPromise = player.stop();
const stopPromise = this.player.stop();
stopPromise.then((data) => {
console.log("promise 获取 数据", data)
})
},
getOSDTime() {
const getOSDTimePromise = player.getOSDTime();
const getOSDTimePromise = this.player.getOSDTime();
getOSDTimePromise.then((data) => {
console.log("promise 获取 数据", data)
})
},
capturePicture() {
const capturePicturePromise = player.capturePicture(`${new Date().getTime()}`);
const capturePicturePromise = this.player.capturePicture(`${new Date().getTime()}`);
capturePicturePromise.then((data) => {
console.log("promise 获取 数据", data)
})
},
openSound() {
const openSoundPromise = player.openSound();
const openSoundPromise = this.player.openSound();
openSoundPromise.then((data) => {
console.log("promise 获取 数据", data)
})
},
closeSound() {
const openSoundPromise = player.closeSound();
const openSoundPromise = this.player.closeSound();
openSoundPromise.then((data) => {
console.log("promise 获取 数据", data)
})
},
startSave() {
const startSavePromise = player.startSave(`${new Date().getTime()}`);
const startSavePromise = this.player.startSave(`${new Date().getTime()}`);
startSavePromise.then((data) => {
console.log("promise 获取 数据", data)
})
},
stopSave() {
const stopSavePromise = player.stopSave();
const stopSavePromise = this.player.stopSave();
stopSavePromise.then((data) => {
console.log("promise 获取 数据", data)
})
},
ezopenStartTalk() {
player.startTalk();
this.player.startTalk();
},
ezopenStopTalk() {
player.stopTalk();
this.player.stopTalk();
},
fullScreen() {
player.fullScreen();
this.player.fullScreen();
},
destroy() {
const destroyPromise = player.destroy();
const destroyPromise = this.player.destroy();
destroyPromise.then((data) => {
console.log("promise 获取 数据", data)
})
......@@ -113,8 +110,19 @@
this.next_time = Date.now();
}
},
getMonitorInfo() {
api.getMonitorInfo({id:this.site_id}).then((res)=>{
if(res.code==0){
if(res.data.access_token){
this.accessToken = res.data.access_token;
this.url = res.data.camera_url;
this.init();
}
}
});
},
init(){
player = new EZUIKit.EZUIKitPlayer({
this.player = new EZUIKit.EZUIKitPlayer({
id: 'video-container', // 视频容器ID
accessToken: this.accessToken,
url: this.url,
......@@ -125,8 +133,10 @@
// height: 400,
});
this.$nextTick(()=>{
player.play();
});
if(this.player){
this.player.play();
}
})
}
}
};
......
......@@ -86,12 +86,12 @@
<div class="filter-one">
<p class="filter-name">类型筛选</p>
<div class="filter-content">
<el-select v-model="filter.type_name" class="m-2" placeholder="请选择类型" @change="()=>getHistoryDataList()">
<el-select v-model="filter.type_name" class="m-2" clearable placeholder="请选择类型" @change="()=>getHistoryDataList()">
<el-option
v-for="item in [{name:'全部类型',value:'',prop:''},...typeList]"
:key="item.prop"
:label="item.name"
:value="item.prop"
v-for="(item,index) in type"
:key="index"
:label="item.typeName"
:value="item.typeName"
/>
</el-select>
</div>
......@@ -148,7 +148,7 @@
</div>
</div>
<div class="body-one monitor" v-else-if="tab=='monitor'">
<esu :url="detail.url" :accessToken="detail.accessToken"></esu>
<esu :site_id="site_id"></esu>
</div>
<div class="body-one process" v-else-if="tab=='process'">
<div class="process-box">
......@@ -295,9 +295,7 @@
poster:[],
index: 0,
yewei:0,
type:1,
accessToken:'',
url:'',
type:1
},
showBanner:false,
tabs: [
......@@ -335,6 +333,7 @@
time:['',''],
time_order:['','']
},
type:[],
typeList:[
{
name:'液位',
......@@ -450,18 +449,6 @@
}
});
}
function getMonitorInfo() {
state.detail.accessToken = '';
state.detail.url = '';
api.getMonitorInfo({id:props.site_id}).then((res)=>{
if(res.code==0){
if(res.data.access_token){
state.detail.accessToken = res.data.access_token;
state.detail.url = res.data.camera_url;
}
}
});
}
function typeChange(type=1) {
switch (type) {
case 1:
......@@ -483,14 +470,13 @@
state.list.page = 1;
state.list.pageSize = 15;
state.list.total = 0;
state.monitorShow = false;
if(item.value=='base'){
initGauge();
getYewei();
}
if(item.value=='monitor'){
getMonitorInfo();
}
if(item.value=='history'){
getType();
getHistoryDataList();
}
if(item.value=='process'){
......@@ -644,6 +630,18 @@
}
})
}
function getType(){
let p = {
};
api.typeData(p).then((res)=>{
if(res.code==0){
if(Array.isArray(res.data)){
state.type = res.data;
}
}
})
}
function getOrderList(page=1){
let p = {
page:page,
......@@ -1092,9 +1090,6 @@
flex: 1;
overflow-y: auto;
}
.pagination{
margin:0 auto;
}
.row{
height: 60px;
display: flex;
......@@ -1136,6 +1131,9 @@
}
}
}
.pagination{
margin:0 auto;
}
}
.logo{
padding: 10px 20px;
......
......@@ -2,11 +2,14 @@
<div>
<div class="gva-search-box">
<el-form :inline="true" :model="searchInfo" class="demo-form-inline">
<el-form-item label="原始设备ID">
<el-form-item label="原始设备编号">
<el-input v-model="searchInfo.rawDeviceId" placeholder="搜索条件"/>
</el-form-item>
<el-form-item label="数据类型">
<el-input v-model="searchInfo.typeName" placeholder="搜索条件"/>
<el-select v-model="formData.typeName" placeholder="请选择" style="width:100%" clearable>
<el-option v-for="(item,key) in typeList" :key="key" :label="item.name"
:value="item.name"/>
</el-select>
</el-form-item>
<el-form-item>
<el-button size="small" type="primary" icon="search" @click="onSubmit">查询</el-button>
......@@ -15,21 +18,6 @@
</el-form>
</div>
<div class="gva-table-box">
<div class="gva-btn-list">
<!--<el-button size="small" type="primary" icon="plus" @click="openDialog">新增</el-button>-->
<el-popover v-model:visible="deleteVisible" placement="top" width="160">
<p>确定要删除吗?</p>
<div style="text-align: right; margin-top: 8px;">
<el-button size="small" type="primary" link @click="deleteVisible = false">取消</el-button>
<el-button size="small" type="primary" @click="onDelete">确定</el-button>
</div>
<template #reference>
<el-button icon="delete" size="small" style="margin-left: 10px;"
:disabled="!multipleSelection.length" @click="deleteVisible = true">删除
</el-button>
</template>
</el-popover>
</div>
<el-table
ref="multipleTable"
style="flex: 1;"
......@@ -42,10 +30,13 @@
<el-table-column type="selection" width="55"/>
<el-table-column align="left" label="原始设备ID" prop="rawDeviceId" min-width="120"/>
<el-table-column align="left" label="公厕ID" prop="toiletId" min-width="120"/>
<el-table-column align="left" label="公厕名称" prop="toiletId" min-width="180">
<template #default="scope">{{ toiletList.find(one=>one.ID==scope.row.toiletId).name}}</template>
</el-table-column>
<el-table-column align="left" label="数据类型" prop="typeName" min-width="120"/>
<el-table-column align="left" label="数据值单位" prop="unit" min-width="120"/>
<el-table-column align="left" label="数据值" prop="value" min-width="120"/>
<el-table-column align="left" label="创建时间" min-width="180">
<template #default="scope">{{ formatDate(scope.row.CreatedAt) }}</template>
</el-table-column>
......@@ -54,8 +45,6 @@
<el-button type="primary" link icon="edit" size="small" class="table-button"
@click="updateQshMonitorDataFunc(scope.row)">查看
</el-button>
<el-button type="primary" link icon="delete" size="small" @click="deleteRow(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
......@@ -73,11 +62,11 @@
</div>
<el-dialog v-model="dialogFormVisible" :before-close="closeDialog" title="历史数据">
<el-form :model="formData" label-position="right" label-width="120px">
<el-form-item label="原始设备ID:">
<el-form-item label="原始设备编号:">
<el-input v-model="formData.rawDeviceId" clearable placeholder="请输入"/>
</el-form-item>
<el-form-item label="公厕ID:">
<el-input v-model="formData.toiletId" clearable placeholder="请输入"/>
<el-form-item label="公厕名称:">
<el-input :value="toiletList.find(one=>one.ID==formData.toiletId).name" clearable placeholder="请输入"/>
</el-form-item>
<el-form-item label="数据类型:">
<el-input v-model="formData.typeName" clearable placeholder="请输入"/>
......@@ -115,6 +104,13 @@
getQshMonitorDataList
} from '@/api/qshMonitorData'
import {
getQshToiletList
} from '@/api/qshToilet'
import {
getQshTypeList
} from '@/api/qshType'
// 全量引入格式化工具 请按需保留
import {getDictFunc, formatDate, formatBoolean, filterDict} from '@/utils/format'
import {ElMessage, ElMessageBox} from 'element-plus'
......@@ -134,6 +130,8 @@
const total = ref(0)
const pageSize = ref(10)
const tableData = ref([])
const toiletList = ref([])
const typeList = ref([])
const searchInfo = ref({})
// 重置
......@@ -170,7 +168,23 @@
pageSize.value = table.data.pageSize
}
}
// 查询
const getToiletData = async () => {
const table = await getQshToiletList({page: 1, pageSize: 999})
if (table.code === 0) {
toiletList.value = table.data.list
}
}
// 查询
const getTypeList = async () => {
const table = await getQshTypeList({page: 1, pageSize: 999})
if (table.code === 0) {
typeList.value = table.data.list
}
}
getToiletData()
getTypeList()
getTableData()
// ============== 表格控制部分结束 ===============
......
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