feat: 项目大屏工地现场视频调整为接口形式

This commit is contained in:
kun 2024-01-29 15:53:10 +08:00
parent b4b0d6fdcb
commit 6674327e5e

View File

@ -66,7 +66,7 @@
</div>
</div>
<div class="blockBox">
<div class="blockTitle" @click="videoPlay">
<div class="blockTitle">
<img src="@/assets/images/hzImg/xm/gdxcsp.png" alt="" class="title" />
</div>
<div class="blockContent" style="height: 260px">
@ -170,6 +170,7 @@ import projectInfoDialog from "./components/projectInfoDialog.vue";
import { screenEntPayment, getEntInspectInfo } from "@/api/modules/huizhou";
import { getpreviewURL } from "@/api/modules/common";
import { GlobalStore } from "@/stores";
import { getvideoEngTreeList } from "@/api/modules/goverment";
const store = GlobalStore();
const playWndBox = ref(null);
@ -182,8 +183,8 @@ const projectData = ref({
let playWndHeight = ref("");
let playWndWidth = ref("");
let myPlugin = ref("");
let cameraIndexCode = ref<string>("");
let playUrl = ref("");
let cameraIndexCode = ref([]);
let playUrl = ref();
let playIndex = ref(0);
const props = defineProps(["engineeringSn"]);
const emits = defineEmits(["change"]);
@ -313,7 +314,18 @@ const playVideo = async () => {
//
const getVideo = async () => {
// await sendRequest({ code: cameraIndexCode.value });
const res = await getpreviewURL({ cameraIndexCode: "a4badb0f00d2443d9bcf270654c8efc1", protocol: "ws" });
const { result }: { result: any } = await getvideoEngTreeList({});
let defaultCode: string = "";
if (result.length > 0) {
defaultCode = result[0].code;
if (!defaultCode) {
cameraIndexCode.value = result[0].children.map((item: any) => {
return item.code;
});
defaultCode = cameraIndexCode.value[0];
}
}
const res = await getpreviewURL({ cameraIndexCode: defaultCode, protocol: "ws" });
playUrl.value = res.result;
playVideo();
console.log(res);