|
@@ -109,30 +109,37 @@ export default {
|
|
this.$refs.tree.filter(val);
|
|
this.$refs.tree.filter(val);
|
|
},
|
|
},
|
|
},
|
|
},
|
|
- props: {
|
|
|
|
- id: {
|
|
|
|
- type: String,
|
|
|
|
- default: "",
|
|
|
|
- },
|
|
|
|
- byList: {
|
|
|
|
- type: Array,
|
|
|
|
- default: [],
|
|
|
|
- },
|
|
|
|
- zjid: {
|
|
|
|
- type: String,
|
|
|
|
- default: null,
|
|
|
|
- },
|
|
|
|
- qx: {
|
|
|
|
- type: String,
|
|
|
|
- default: null,
|
|
|
|
- },
|
|
|
|
- dataList: {
|
|
|
|
- type: Array,
|
|
|
|
- default: [],
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
|
|
+ // props: {
|
|
|
|
+ // id: {
|
|
|
|
+ // type: String,
|
|
|
|
+ // default: "",
|
|
|
|
+ // },
|
|
|
|
+ // byList: {
|
|
|
|
+ // type: Array,
|
|
|
|
+ // default: [],
|
|
|
|
+ // },
|
|
|
|
+ // zjid: {
|
|
|
|
+ // type: String,
|
|
|
|
+ // default: null,
|
|
|
|
+ // },
|
|
|
|
+ // qx: {
|
|
|
|
+ // type: String,
|
|
|
|
+ // default: null,
|
|
|
|
+ // },
|
|
|
|
+ // dataList: {
|
|
|
|
+ // type: Array,
|
|
|
|
+ // default: [],
|
|
|
|
+ // },
|
|
|
|
+ // },
|
|
|
|
+ props: ["id", "byList", "qx", "dataList", "data"],
|
|
mounted() {
|
|
mounted() {
|
|
- this.getData();
|
|
|
|
|
|
+ if (!this.data) {
|
|
|
|
+ this.getData();
|
|
|
|
+ } else {
|
|
|
|
+ this.url = this.data.mp4;
|
|
|
|
+ this.name = this.data.sbmc;
|
|
|
|
+ }
|
|
|
|
+
|
|
this.getAreaList();
|
|
this.getAreaList();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -224,34 +231,51 @@ export default {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- getData() {
|
|
|
|
|
|
+ async getVideoData(id) {
|
|
|
|
+ const res = await getCameraUrl(id);
|
|
|
|
+ if (res.data.data && res.data.data.length > 0) {
|
|
|
|
+ return res.data.data[0];
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ },
|
|
|
|
+ async getData() {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
- // TO-DO
|
|
|
|
- getCameraUrl(this.id).then((res) => {
|
|
|
|
|
|
+ const data = await this.getVideoData(this.id);
|
|
|
|
+ // console.log(data);
|
|
|
|
+ this.loading = false;
|
|
|
|
+ if (data != null) {
|
|
this.loading = false;
|
|
this.loading = false;
|
|
- this.url = res.data.data[0].mp4;
|
|
|
|
- this.name = res.data.data[0].deviceName;
|
|
|
|
- // if (!this.url && this.byList && this.byList.length > 0) {
|
|
|
|
- // this.loading = true;
|
|
|
|
- // getCameraUrl(this.byList[this.byList.length - 1].sbbm).then(
|
|
|
|
- // (res2) => {
|
|
|
|
- // this.loading = false;
|
|
|
|
- // this.url = res2.data.data[0].mp4;
|
|
|
|
- // this.name = res2.data.data[0].deviceName;
|
|
|
|
- // if (!this.url) {
|
|
|
|
- // this.loading = true;
|
|
|
|
- // getCameraUrl(this.byList[this.byList.length - 2].sbbm).then(
|
|
|
|
- // (res3) => {
|
|
|
|
- // this.loading = false;
|
|
|
|
- // this.url = res3.mp4;
|
|
|
|
- // this.name = res3.data.data[0].deviceName;
|
|
|
|
- // }
|
|
|
|
- // );
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // );
|
|
|
|
- // }
|
|
|
|
- });
|
|
|
|
|
|
+ this.url = data.mp4;
|
|
|
|
+ this.name = data.deviceName;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // // TO-DO
|
|
|
|
+ // getCameraUrl(this.id).then((res) => {
|
|
|
|
+ // console.log(res);
|
|
|
|
+ // this.loading = false;
|
|
|
|
+ // this.url = res.data.data[0].mp4;
|
|
|
|
+ // this.name = res.data.data[0].deviceName;
|
|
|
|
+ // // if (!this.url && this.byList && this.byList.length > 0) {
|
|
|
|
+ // // this.loading = true;
|
|
|
|
+ // // getCameraUrl(this.byList[this.byList.length - 1].sbbm).then(
|
|
|
|
+ // // (res2) => {
|
|
|
|
+ // // this.loading = false;
|
|
|
|
+ // // this.url = res2.data.data[0].mp4;
|
|
|
|
+ // // this.name = res2.data.data[0].deviceName;
|
|
|
|
+ // // if (!this.url) {
|
|
|
|
+ // // this.loading = true;
|
|
|
|
+ // // getCameraUrl(this.byList[this.byList.length - 2].sbbm).then(
|
|
|
|
+ // // (res3) => {
|
|
|
|
+ // // this.loading = false;
|
|
|
|
+ // // this.url = res3.mp4;
|
|
|
|
+ // // this.name = res3.data.data[0].deviceName;
|
|
|
|
+ // // }
|
|
|
|
+ // // );
|
|
|
|
+ // // }
|
|
|
|
+ // // }
|
|
|
|
+ // // );
|
|
|
|
+ // // }
|
|
|
|
+ // });
|
|
// console.log(this.id);
|
|
// console.log(this.id);
|
|
// this.url =
|
|
// this.url =
|
|
// "https://ycjk.cq119.gov.cn/rtp/77746e2c33126146cb83c81be23d0492.live.mp4?deviceId=50015200002000000001&key=";
|
|
// "https://ycjk.cq119.gov.cn/rtp/77746e2c33126146cb83c81be23d0492.live.mp4?deviceId=50015200002000000001&key=";
|