humiao 2023-09-27 15:16:39 +08:00
parent 8426c8fc2a
commit 5bf11fa321
2 changed files with 130 additions and 2 deletions

View File

@ -76,6 +76,8 @@
<div class="quick-button" @click="updatePersonalData"></div>
<div class="quick-button" @click="showHistoryLabel"></div>
<div class="quick-button" @click="showMonitoringList"></div>
</div>
<!-- 搜索框 -->
@ -271,7 +273,7 @@
<!-- 任务下发 -->
<taskbox v-show="active == 2"></taskbox>
<!-- -->
<!-- 监控列表 -->
</div>
</div>
@ -366,6 +368,7 @@
</div>
</div>
<monitoring-list ref="monitoringLists"></monitoring-list>
<!-- -->
</div>
</template>
@ -403,6 +406,8 @@ import userpoint from "./widget/userpoint.vue";
import drag from "../../utils/draged";
import editorbox from "./widget/editorbox";
import search from "./widget/search";
import MonitoringList from "./widget/monitoringList.vue";
import videoConfig from "./lib/videoConfig.json";
let BASE_URL = process.env.VUE_APP_BASE_API;
export default {
@ -432,6 +437,7 @@ export default {
userpoint,
editorbox,
search,
MonitoringList,
},
data() {
@ -485,6 +491,7 @@ export default {
tableName: null,
editData: null,
showFields: null,
icvGraphicLayer: null,
};
},
@ -534,6 +541,8 @@ export default {
window.delTaskPoint = this.delTaskPoint;
window.editlayerinfo = this.editlayerinfo;
this.getIcvLocation();
},
methods: {
updatePersonalData() {
@ -569,6 +578,125 @@ export default {
closeWaterlayer() {
this.waterVisible = false;
},
//
showMonitoringList() {
this.$refs.monitoringLists.showVisible();
},
//
async getIcvLocation() {
let that = this;
let token;
//
let facilityList = [];
//
let icvList = [];
// token
let params = {
address: videoConfig.connParams.address,
port: videoConfig.connParams.port,
user: videoConfig.connParams.user,
password: videoConfig.connParams.password,
epid: videoConfig.connParams.epid,
fixaddr: videoConfig.connParams.bfix,
};
await axios({
method: "post",
url: `${videoConfig.q2http_url}login`,
data: params,
}).then((res) => {
let data = res.data;
token = data.token;
});
//
await axios({
method: "get",
url: `${videoConfig.q2http_url}CAS/C_CAS_QueryPUIDSets`,
params: {
offset: 0,
count: 200,
token: token,
},
}).then((res) => {
let data = res.data;
data.map((item) => {
item.id = item.$;
item.label = item.Name;
facilityList.push(item);
});
});
//
console.error(facilityList);
for (let i = 0; i < facilityList.length; i++) {
let items = facilityList[i];
await axios({
method: "post",
url: `${videoConfig.q2http_url}C_CAS_QueryPUIDRes`,
params: {
token: token,
},
data: {
puid: items.id,
},
}).then((res) => {
let data = res.data["Res"];
data.map((item) => {
if (item.Type == "IV") {
item.label = item.Name;
item.id = item.Name;
item.puid = items.id;
icvList.push(item);
}
});
});
}
if (this.icvGraphicLayer) {
this.icvGraphicLayer.clear();
} else {
this.icvGraphicLayer = new this.mars3d.layer.GraphicLayer();
this.globalmap.addLayer(this.icvGraphicLayer);
}
//
axios({
method: "post",
url: `${videoConfig.q2http_url}GPS/C_GS_QueryLastGPSData`,
params: {
token: token,
},
data: {
equipment: icvList,
},
}).then((res) => {
let list = res.data.Res;
console.error(list);
list.map((item) => {
let graphic = new mars3d.graphic.BillboardEntity({
position: [
parseFloat(item.GPS.Longitude),
parseFloat(item.GPS.Latitude),
],
style: {
image: "/img/marktask.png",
clampToGround: true,
scale: 0.4,
label: {
text: "摄像机位置",
font_size: 14,
color: "#ffffff",
pixelOffsetY: 10,
distanceDisplayCondition: true,
},
},
attr: { remark: "摄像机位置", ...item, token: token },
});
graphic.on(mars3d.EventType.click, (e) => {
that.$refs.monitoringLists.loadVideoAndShow(e.target.options.attr);
});
that.icvGraphicLayer.addGraphic(graphic);
// : graphic.addTo(graphicLayer)
});
});
},
//
getTaskList() {
axios({

View File

@ -219,7 +219,7 @@ import flvjs from "flv.js";
import talk from "../lib/talk.js";
import alawmulaw from "../lib/alawmulaw.min.js";
export default {
name: "monitorbox",
name: "monitoringList",
props: {},
data() {
return {