+
@@ -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("");
-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);