Commit 00d60199 authored by mahui's avatar mahui

init

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