feat: 弹窗功能添加以及BUG修改

This commit is contained in:
kun 2024-03-02 09:32:13 +08:00
parent e83fcfc461
commit fe752a70da
5 changed files with 84 additions and 35 deletions

View File

@ -27,7 +27,7 @@ let dialogTitle = ref("" as any);
function openDialog(obj: any) { function openDialog(obj: any) {
console.log("type", obj); console.log("type", obj);
if(obj.type == 1){ if(obj.type == 1){
dialogTitle.value = "人数统计数据"; dialogTitle.value = obj.tip + '人数统计数据';
} else if(obj.type == 2) { } else if(obj.type == 2) {
dialogTitle.value = "历史报警数据"; dialogTitle.value = "历史报警数据";
} }

View File

@ -15,7 +15,7 @@
<i>{{ attendancePerson }}</i> <i>{{ attendancePerson }}</i>
</div> </div>
</div> </div>
<div class="numberPeople" @click="openDialogData('总人数')"> <div class="numberPeople" @click="openDialogData('总')">
<div class="text"><i>总人数</i></div> <div class="text"><i>总人数</i></div>
<div class="num"> <div class="num">
<i>{{ toaltPerson }}</i> <i>{{ toaltPerson }}</i>

View File

@ -52,24 +52,38 @@
<el-button @click="getMemberCountList('search')">查询</el-button> <el-button @click="getMemberCountList('search')">查询</el-button>
</div> </div>
<div class="tabList"> <div class="tabList">
<div>报警类型</div> <div>序号</div>
<div>报警名称</div> <div>照片</div>
<div>设备名称</div> <div>姓名</div>
<div>报警值</div> <div>联系电话</div>
<div>阈值</div> <div>所属部门</div>
<div>超标时间</div> <div>进场日期</div>
<div>超标量</div> <div>在职状态</div>
<div>身份证号</div>
<div>人员类型</div>
<div>所属企业</div>
</div> </div>
<el-scrollbar class="listBox" ref="refScrollbar"> <el-scrollbar class="listBox" ref="refScrollbar">
<div v-for="(item, index) in partyMemberList" class="listStyle" :key="item.id"> <div v-for="(item, index) in partyMemberList" class="listStyle" :key="item.id">
<div>{{ alarmTypeList[item.type] }}</div> <div>{{index + 1}}</div>
<div>{{ item.alarmTypeName }}</div> <div class="list-img">
<div>{{ item.deviceName }}</div> <el-image
<div>{{ item.avgData }}</div> fit="contain"
<div>{{ item.alarmValue }}</div> class="el-img"
<div>{{ item.tempAlarmTime }}</div> :src="BASEURL + item.fieldAcquisitionUrl"
<div>{{ item.exceedVal }}</div> :preview-src-list="[BASEURL + item.fieldAcquisitionUrl]"
>
</el-image>
</div>
<div>{{item.workerName}}</div>
<div>{{item.phoneNumber}}</div>
<div>{{item.phoneNumber}}</div>
<div>{{item.personType == 1?item.teamName:item.personType == 2?item.departmentName:''}}</div>
<div>{{item.phoneNumber}}</div>
<div>身份证号</div>
<div>人员类型</div>
<div>所属企业</div>
</div> </div>
<div class="notoDta" v-if="partyMemberList.length == 0"> <div class="notoDta" v-if="partyMemberList.length == 0">
<img src="@/assets/images/noData.png" alt="" /> <img src="@/assets/images/noData.png" alt="" />
@ -86,6 +100,7 @@ import { GlobalStore } from "@/stores";
import { getCompanyDataList, getMemberInfoList } from "@/api/modules/labor"; import { getCompanyDataList, getMemberInfoList } from "@/api/modules/labor";
const store = GlobalStore(); const store = GlobalStore();
const props = defineProps(["tip"]); const props = defineProps(["tip"]);
const BASEURL = import.meta.env.VITE_API_URL;
const onlineWorkList = ref([ const onlineWorkList = ref([
{ name: "在职", value: 1 }, { name: "在职", value: 1 },
{ name: "离职", value: 2 } { name: "离职", value: 2 }
@ -145,7 +160,7 @@ const getMemberCountList = async (tip:any) => {
onMounted(async () => { onMounted(async () => {
await getCompanyList(); await getCompanyList();
// await getHistoryAlarmList('search'); await getMemberCountList('search');
refScrollbar.value.wrapRef.addEventListener("scroll", (e: any) => { refScrollbar.value.wrapRef.addEventListener("scroll", (e: any) => {
// console.log("", e); // console.log("", e);
const scrollTop = e.target.scrollTop; const scrollTop = e.target.scrollTop;

View File

@ -0,0 +1,39 @@
<!--ckplayer 视频播放-->
<template>
<div style="height: 100%">
<video :id="'videoItem' + name" style="width: 100%; height: 100%; object-fit: fill" controls :autoplay="autoPlay" muted />
</div>
</template>
<script>
export default {
props: ["videoUrls", "autoPlay", "poster", "deviceIp", "name"],
data() {
return {
player: "",
webRtcServer: null
};
},
// watch: {
// name: {
// handler(newName, oldName) {
// console.log(this.videoUrls, this.deviceIp, this.autoPlay, this.name);
// let webRtcServer = null;
// webRtcServer = new WebRtcStreamer("videoItem" + this.name, this.deviceIp);
// webRtcServer.connect(this.videoUrls);
// },
// immediate: true
// }
// },
mounted: function () {
console.log(this.videoUrls, this.deviceIp, this.autoPlay, this.name);
let webRtcServer = this.webRtcServer;
webRtcServer = new WebRtcStreamer("videoItem" + this.name, this.deviceIp);
webRtcServer.connect(this.videoUrls);
},
beforeDestroy: function () {
this.webRtcServer.disconnect();
},
methods: {}
};
</script>

View File

@ -1,38 +1,33 @@
<!--ckplayer 视频播放--> <!--ckplayer 视频播放-->
<template> <template>
<div style="height: 100%"> <div style="height: 100%">
<video :id="'videoItem' + name" style="width: 100%; height: 100%; object-fit: fill" controls :autoplay="autoPlay" muted /> <video :id="'videoItem' + name" controls autoplay style="width: 100%; height: 100%; object-fit: fill" />
</div> </div>
</template> </template>
<script> <script>
import Srs from "@/assets/js/srs.sdk";
export default { export default {
props: ["videoUrls", "autoPlay", "poster", "deviceIp", "name"], props: ["videoUrls", "autoPlay", "poster", "deviceIp", "name"],
data() { data() {
return { return {
player: "", player: "",
webRtcServer: null rtcPlayer: null
}; };
}, },
// watch: {
// name: {
// handler(newName, oldName) {
// console.log(this.videoUrls, this.deviceIp, this.autoPlay, this.name);
// let webRtcServer = null;
// webRtcServer = new WebRtcStreamer("videoItem" + this.name, this.deviceIp);
// webRtcServer.connect(this.videoUrls);
// },
// immediate: true
// }
// },
mounted: function () { mounted: function () {
console.log(this.videoUrls, this.deviceIp, this.autoPlay, this.name); console.log(this.videoUrls, this.deviceIp, this.autoPlay, this.name, 666);
let webRtcServer = this.webRtcServer; this.player = document.getElementById("videoItem" + this.name);
webRtcServer = new WebRtcStreamer("videoItem" + this.name, this.deviceIp); //使srs.sdk.js
webRtcServer.connect(this.videoUrls); this.rtcPlayer = new Srs.SrsRtcWhipWhepAsync();
this.rtcPlayer.play(this.videoUrls);
// video
this.player.srcObject = this.rtcPlayer.stream;
// 使jswebrtc.min.js
// new JSWebrtc.Player(this.url, { video: player, autoplay: true, });
}, },
beforeDestroy: function () { beforeDestroy: function () {
this.webRtcServer.disconnect(); this.rtcPlayer.close();
}, },
methods: {} methods: {}
}; };