fix: BUG修改

This commit is contained in:
kun 2024-03-05 09:51:18 +08:00
parent aed90281a2
commit bb1955e42b
8 changed files with 77 additions and 23 deletions

View File

@ -130,7 +130,7 @@ const openPeopleCountDialog = (obj:any) => {
const selectWorkerTeamStatistics = async () => {
const res: any = await getWorkerInfoApi({
projectSn: store.sn,
userEnterpriseId: store.userInfo.userEnterpriseId
userEnterpriseId: store.userInfo?.userEnterpriseId
});
teamList.value = res.result;
};
@ -138,7 +138,7 @@ const selectWorkerTeamStatistics = async () => {
const getCrewRealTimeData = async () => {
let data = {
projectSn: store.sn,
userEnterpriseId: store.userInfo.userEnterpriseId
userEnterpriseId: store.userInfo?.userEnterpriseId
};
const res: any = await getRealTimeDataApi(data);
if (res.code == 200) {
@ -432,7 +432,7 @@ const createdEcharts = (yAxisData1: any, yAxisData2: any, yAxisData3: any) => {
const selectPersonTypeAndEduStatistics = async () => {
const res: any = await getPersonTypeAndEduStatisticsApi({
projectSn: store.sn,
userEnterpriseId: store.userInfo.userEnterpriseId
userEnterpriseId: store.userInfo?.userEnterpriseId
});
console.log(res);
memberCountData.value.totalPersonNum = res.result.personType.toaltPerson.totalPerson; //

View File

@ -131,7 +131,7 @@ const getCompanyList = async () => {
let data = {
projectSn: store.sn,
enterpriseName: "",
userEnterpriseId: store.userInfo.userEnterpriseId
userEnterpriseId: store.userInfo?.userEnterpriseId
};
const res: any = await getCompanyDataList(data);
if (res.code == 200) {

View File

@ -149,7 +149,7 @@ const getCompanyList = async () => {
let data = {
projectSn: store.sn,
enterpriseName: "",
userEnterpriseId: store.userInfo.userEnterpriseId
userEnterpriseId: store.userInfo?.userEnterpriseId
};
const res: any = await getCompanyDataList(data);
if (res.code == 200) {
@ -160,7 +160,7 @@ const getCompanyList = async () => {
const getMemberCountList = async (tip: any) => {
let data:any = {
projectSn: store.sn,
userEnterpriseId: store.userInfo.userEnterpriseId,
userEnterpriseId: store.userInfo?.userEnterpriseId,
workerName: searchForm.value.name,
enterpriseId: searchForm.value.belongCompany,
teamId: searchForm.value.belongTeam,

View File

@ -7,7 +7,19 @@
<span :class="activeTab == 0?'active-span':''" @click="changeActive(0)">实时监控</span>
<span :class="activeTab == 1?'active-span':''" @click="changeActive(1)">3D模型</span>
</div>
<div class="href-content">
<div class="href-content" v-if="activeTab == 0">
<el-carousel indicator-position="none" height="450px">
<el-carousel-item v-for="(item,index) in videoList" :key="index">
<video
style="height: 100%; width: 100%"
:id="'videoItem' + index"
muted
autoplay
/>
</el-carousel-item>
</el-carousel>
</div>
<div class="href-content" v-if="activeTab == 1">
<iframe :src="iframeUrl" frameborder="0" style="width: 100%;height: 100%;"></iframe>
</div>
</div>
@ -15,17 +27,47 @@
<script lang="ts" setup>
import { GlobalStore } from "@/stores";
import { ref, reactive, onMounted } from "vue";
import { ref, watch, onMounted, onBeforeUnmount } from "vue";
import Srs from "@/assets/js/srs.sdk";
import { selectProjectVideoListApi } from "@/api/modules/video";
const emits = defineEmits(["openDialog"])
const store = GlobalStore();
const rtcPlayer = ref();
const videoList = ref([] as any);
const activeTab = ref(0)
const iframeUrl = ref('http://jxj.zhgdyun.com:8082/bim/rt-video/srs/srs.html')
const getVideoList = async () => {
let res: any = await selectProjectVideoListApi({
projectSn: store.sn,
all: 1
// all=1
});
videoList.value = res.result.videoList
};
const changeActive = (activeIndex:any) => {
activeTab.value = activeIndex;
iframeUrl.value = activeIndex == 0?'http://jxj.zhgdyun.com:8082/bim/rt-video/srs/srs.html':'http://jxjzw.zhgdyun.com:8082/rt-3dmx'
}
watch(() => activeTab.value, (newVal) => {
if(newVal == 0){
for (let i = 0; i < videoList.value.length; i++) {
let player:any = document.getElementById("videoItem" + i);
//使srs.sdk.js
rtcPlayer.value = new Srs.SrsRtcWhipWhepAsync();
rtcPlayer.value.play(videoList.value[i].videoUrl);
// video
player.srcObject = rtcPlayer.value.stream;
// 使jswebrtc.min.js
// new JSWebrtc.Player(this.url, { video: player, autoplay: true, });
}
}
})
onMounted(() => {
});
getVideoList()
})
onBeforeUnmount(() => {
rtcPlayer.value?.close();
})
</script>
<style lang="scss" scoped>

View File

@ -133,7 +133,7 @@ const getCompanyList = async () => {
let data = {
projectSn: store.sn,
enterpriseName: "",
userEnterpriseId: store.userInfo.userEnterpriseId
userEnterpriseId: store.userInfo?.userEnterpriseId
};
const res: any = await getCompanyDataList(data);
if (res.code == 200) {

View File

@ -121,7 +121,7 @@ const getCompanyList = async () => {
let data = {
projectSn: store.sn,
enterpriseName: "",
userEnterpriseId: store.userInfo.userEnterpriseId
userEnterpriseId: store.userInfo?.userEnterpriseId
};
const res: any = await getCompanyDataList(data);
if (res.code == 200) {

View File

@ -102,7 +102,7 @@
<el-col :span="24">
<div class="col-content">
<span>作业部位</span>
<div class="col-content-item">{{ detailData.workPart || "" }}</div>
<div class="col-content-item" style="height: 60px;">{{ detailData.workPart || "" }}</div>
</div>
</el-col>
</el-row>
@ -110,7 +110,7 @@
<el-col :span="24">
<div class="col-content">
<span>地理位置</span>
<div class="col-content-item">{{ detailData.geographicalLocation || "" }}</div>
<div class="col-content-item" style="height: 60px;">{{ detailData.geographicalLocation || "" }}</div>
</div>
</el-col>
</el-row>
@ -146,7 +146,7 @@
<el-col :span="24">
<div class="col-content">
<span>主要风险</span>
<div class="col-content-item">{{ detailData.mainRisk || "" }}</div>
<div class="col-content-item" style="height: 60px;">{{ detailData.mainRisk || "" }}</div>
</div>
</el-col>
</el-row>
@ -154,13 +154,13 @@
<el-col :span="12">
<div class="col-content">
<span>作业必备条件</span>
<div class="col-content-item">{{ detailData.jobPrerequisite || "" }}</div>
<div class="col-content-item" style="height: 60px;">{{ detailData.jobPrerequisite || "" }}</div>
</div>
</el-col>
<el-col :span="12">
<div class="col-content">
<span>作业过程风险控制措施</span>
<div class="col-content-item">{{ detailData.operationProcessRiskControlMeasure || "" }}</div>
<div class="col-content-item" style="height: 60px;">{{ detailData.operationProcessRiskControlMeasure || "" }}</div>
</div>
</el-col>
</el-row>
@ -168,7 +168,7 @@
<el-col :span="24">
<div class="col-content">
<span>现场风险复测变化情况及补充控制措施</span>
<div class="col-content-item">{{ detailData.riskRetestChangesAndSupplementaryControlMeasure || "" }}</div>
<div class="col-content-item" style="height: 60px;">{{ detailData.riskRetestChangesAndSupplementaryControlMeasure || "" }}</div>
</div>
</el-col>
</el-row>
@ -252,6 +252,7 @@ const activeBtn = (item: any) => {
detailId.value = item.id;
detailData.value = item;
}
console.log(detailData.value.videoList[0].serialNumber)
};
const boxStyle = (item: any) => {
if (item.isActive) {
@ -303,9 +304,11 @@ defineExpose({
openDialog
});
watch(
() => postData.value,
() => {
getDataList();
() => showDialog.value,
(newData) => {
if(newData){
getDataList();
}
}
);
// onMounted(async () => {
@ -327,9 +330,9 @@ watch(
box-sizing: border-box;
padding: 1%;
left: 12%;
top: 7%;
top: 6%;
width: 80%;
height: 81%;
height: 90%;
background: url("@/assets/images/aIEarlyWarning/dialogBg.png") no-repeat;
background-size: 100% 100%;
z-index: 21;
@ -426,7 +429,7 @@ watch(
background-color: #08203a;
color: white;
text-indent: 0.5em;
height: 40px !important;
height: 40px;
overflow-wrap: anywhere;
overflow-y: scroll;
}

View File

@ -29,6 +29,15 @@ export default {
beforeDestroy: function () {
this.rtcPlayer.close();
},
watch: {
// watch
videoUrls(newVal,oldVal) {
console.log(newVal)
this.rtcPlayer = new Srs.SrsRtcWhipWhepAsync();
this.rtcPlayer.play(newVal);
this.player.srcObject = this.rtcPlayer.stream;
}
},
methods: {}
};
</script>