|
@@ -18,7 +18,7 @@
|
|
|
:key="index"
|
|
:key="index"
|
|
|
@click="handleChange(index, item)"
|
|
@click="handleChange(index, item)"
|
|
|
>
|
|
>
|
|
|
- {{ item.d
|
|
|
|
|
|
|
+ {{ item.d || "未知"
|
|
|
}}{{ item.installationSite ? "-" + item.installationSite : "" }}
|
|
}}{{ item.installationSite ? "-" + item.installationSite : "" }}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -44,10 +44,14 @@ import { ref, onMounted, onUnmounted } from "vue";
|
|
|
// 引入监控数据
|
|
// 引入监控数据
|
|
|
import { watchData } from "@/components/map/watchData";
|
|
import { watchData } from "@/components/map/watchData";
|
|
|
// 引入监控相关的数据接口
|
|
// 引入监控相关的数据接口
|
|
|
-import { getVedio } from "@/api/video/index";
|
|
|
|
|
|
|
+import {
|
|
|
|
|
+ getVedio,
|
|
|
|
|
+ reqVideoLogin,
|
|
|
|
|
+ reqVideoList,
|
|
|
|
|
+ reqVideoPull,
|
|
|
|
|
+} from "@/api/video/index";
|
|
|
// @ts-ignore
|
|
// @ts-ignore
|
|
|
import WasmPlayer from "@easydarwin/easywasmplayer";
|
|
import WasmPlayer from "@easydarwin/easywasmplayer";
|
|
|
-import axios from "axios";
|
|
|
|
|
|
|
|
|
|
const props = defineProps(["currentWatch"]);
|
|
const props = defineProps(["currentWatch"]);
|
|
|
const $emit = defineEmits(["closeDialog"]);
|
|
const $emit = defineEmits(["closeDialog"]);
|
|
@@ -104,17 +108,13 @@ onUnmounted(() => {
|
|
|
|
|
|
|
|
// 登录获取监控权限
|
|
// 登录获取监控权限
|
|
|
const handleLogin = async () => {
|
|
const handleLogin = async () => {
|
|
|
- const res = await axios({
|
|
|
|
|
- url: "http://6.205.66.13:8083/av_ja/videoAdmin/login",
|
|
|
|
|
- method: "post",
|
|
|
|
|
- data: {
|
|
|
|
|
- username: "admin",
|
|
|
|
|
- password: "admin.123456",
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ const res = await reqVideoLogin({
|
|
|
|
|
+ username: "admin",
|
|
|
|
|
+ password: "admin.123456",
|
|
|
});
|
|
});
|
|
|
- console.log(res);
|
|
|
|
|
|
|
+ // console.log(res);
|
|
|
if ((res as any).code === 200) {
|
|
if ((res as any).code === 200) {
|
|
|
- localStorage.setItem("admin_token", res.data.code);
|
|
|
|
|
|
|
+ localStorage.setItem("admin_token", res.data.token);
|
|
|
|
|
|
|
|
// 获取监控列表数据
|
|
// 获取监控列表数据
|
|
|
getVideoList();
|
|
getVideoList();
|
|
@@ -123,18 +123,12 @@ const handleLogin = async () => {
|
|
|
|
|
|
|
|
// 获取监控列表数据
|
|
// 获取监控列表数据
|
|
|
const getVideoList = async () => {
|
|
const getVideoList = async () => {
|
|
|
- const res = await axios({
|
|
|
|
|
- url: "http://6.205.66.13:8083/av_ja/videoAdmin/login",
|
|
|
|
|
- params: {
|
|
|
|
|
- pageNum: 1,
|
|
|
|
|
- pageSize: 100,
|
|
|
|
|
- spot: props.currentWatch,
|
|
|
|
|
- },
|
|
|
|
|
- headers: {
|
|
|
|
|
- admin_token: localStorage.getItem("admin_token"),
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ const res = await reqVideoList({
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 100,
|
|
|
|
|
+ spot: props.currentWatch,
|
|
|
});
|
|
});
|
|
|
- console.log(res);
|
|
|
|
|
|
|
+ // console.log(res);
|
|
|
if ((res as any).code === 200) {
|
|
if ((res as any).code === 200) {
|
|
|
videoList.value = res.data.list;
|
|
videoList.value = res.data.list;
|
|
|
currentD.value = videoList.value[0].d;
|
|
currentD.value = videoList.value[0].d;
|
|
@@ -145,18 +139,11 @@ const getVideoList = async () => {
|
|
|
|
|
|
|
|
// 拉流请求
|
|
// 拉流请求
|
|
|
const addStreamSource = async () => {
|
|
const addStreamSource = async () => {
|
|
|
- const res = await axios({
|
|
|
|
|
- url: "http://6.205.66.13:8083/av_ja/stream/addStreamSource",
|
|
|
|
|
- method: "post",
|
|
|
|
|
- data: {
|
|
|
|
|
- d: currentD.value,
|
|
|
|
|
- nowLine: "1",
|
|
|
|
|
- },
|
|
|
|
|
- headers: {
|
|
|
|
|
- admin_token: localStorage.getItem("admin_token"),
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ const res = await reqVideoPull({
|
|
|
|
|
+ d: currentD.value,
|
|
|
|
|
+ nowLine: "1",
|
|
|
});
|
|
});
|
|
|
- console.log(res);
|
|
|
|
|
|
|
+ // console.log(res);
|
|
|
if ((res as any).code === 200) {
|
|
if ((res as any).code === 200) {
|
|
|
getVideosData(res.data.flv_ws);
|
|
getVideosData(res.data.flv_ws);
|
|
|
}
|
|
}
|