Commit a40e1144 authored by 张伯涛's avatar 张伯涛

地图代码修改

parent 13fb6153
...@@ -589,6 +589,7 @@ import { ...@@ -589,6 +589,7 @@ import {
} from "../api/screenDisplay"; } from "../api/screenDisplay";
import moment from 'moment' import moment from 'moment'
import {defineComponent} from "vue"; import {defineComponent} from "vue";
import store from "@/store/index.js";
export default defineComponent({ export default defineComponent({
components: { components: {
videoComponents, videoComponents,
...@@ -1127,7 +1128,14 @@ export default defineComponent({ ...@@ -1127,7 +1128,14 @@ export default defineComponent({
postServicCenterList() { postServicCenterList() {
postServicCenterList().then((res) => { postServicCenterList().then((res) => {
if (res.success === true) { if (res.success === true) {
this.servicCenterList = res.data; // 获取登录人所属于的服务中心
var result = store.getters.getEnterprise();
const userCenterList = result[0].serviceCenterList
// 过滤接口数据,取两个数组的交集
const finialList = res.data.filter(item1 =>
userCenterList.some(item2 => item1.centerId === item2.serviceCenterId)
);
this.servicCenterList = finialList;
this.servicCenterList.forEach((element, index) => { this.servicCenterList.forEach((element, index) => {
element.markerId = "marker1_" + index; element.markerId = "marker1_" + index;
element.openF = false; element.openF = false;
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
<script setup> <script setup>
// ../OutputFile/VideoWebPlugin.zip // ../OutputFile/VideoWebPlugin.zip
const stopShow = ref(false);
import {ref, reactive, onMounted,defineEmits, onUnmounted, provide, computed, handleError, watch} from 'vue' import {ref, reactive, onMounted,defineEmits, onUnmounted, provide, computed, handleError, watch} from 'vue'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import http from '../api/http' import http from '../api/http'
...@@ -291,10 +292,11 @@ function initPlugin() { ...@@ -291,10 +292,11 @@ function initPlugin() {
oWebControl.JS_SetWindowControlCallback({ // 设置消息回调 oWebControl.JS_SetWindowControlCallback({ // 设置消息回调
cbIntegrationCallBack: cbIntegrationCallBack cbIntegrationCallBack: cbIntegrationCallBack
}); });
if(stopShow.value === false) {
oWebControl.JS_CreateWnd("playWnd", pProps.divWidth, pProps.divHeight).then(function () { //JS_CreateWnd创建视频播放窗口,宽高可设定 oWebControl.JS_CreateWnd("playWnd", pProps.divWidth, pProps.divHeight).then(function () { //JS_CreateWnd创建视频播放窗口,宽高可设定
init(); // 创建播放实例成功后初始化 init(); // 创建播放实例成功后初始化
}); });
}
}, function () { // 启动插件服务失败 }, function () { // 启动插件服务失败
}); });
//playVideo() //playVideo()
...@@ -644,6 +646,7 @@ watch( ...@@ -644,6 +646,7 @@ watch(
const params = JSON.parse(pProps.queryParams) const params = JSON.parse(pProps.queryParams)
// const params = ['31c0d567dd1944d5b4ea3eddf94f740b'] // const params = ['31c0d567dd1944d5b4ea3eddf94f740b']
if(params && params.length > 0) { if(params && params.length > 0) {
stopShow.value = false
hidePlay(); hidePlay();
await initIp();//ip await initIp();//ip
initPlugin(); initPlugin();
...@@ -660,6 +663,7 @@ watch( ...@@ -660,6 +663,7 @@ watch(
() => pProps.stopParams, () => pProps.stopParams,
async (newData) => { async (newData) => {
console.log('停停停停停停停停停停停停') console.log('停停停停停停停停停停停停')
stopShow.value = true
hidePlay(); hidePlay();
} }
) )
......
...@@ -708,10 +708,11 @@ router.beforeEach(async (to, from, next) => { ...@@ -708,10 +708,11 @@ router.beforeEach(async (to, from, next) => {
let hasNewRoutes = false; let hasNewRoutes = false;
//如果用户登录成功,调用Vuex方法,存储用户信息 //如果用户登录成功,调用Vuex方法,存储用户信息
if (userInfo && !isgetOrg) { // if (userInfo && !isgetOrg) {
if (userInfo) {
try { try {
const res = await store.dispatch("getOrg"); const res = await store.dispatch("getOrg");
isgetOrg = true; // isgetOrg = true;
} catch (error) { } catch (error) {
store.commit("clearUserInfo", ""); store.commit("clearUserInfo", "");
return next("/login"); return next("/login");
......
...@@ -13,7 +13,7 @@ function getUserInfo(state) { ...@@ -13,7 +13,7 @@ function getUserInfo(state) {
return state.userInfo; return state.userInfo;
} }
function getEnterprise(state){ function getEnterprise(state){
if (state.enterprise) return state.enterprise; // if (state.enterprise) return state.enterprise;
let enterprise = localStorage.getItem(keys.ENTERPRISE); let enterprise = localStorage.getItem(keys.ENTERPRISE);
if (enterprise) { if (enterprise) {
state.enterprise = JSON.parse(enterprise); state.enterprise = JSON.parse(enterprise);
......
...@@ -767,6 +767,7 @@ export default defineComponent({ ...@@ -767,6 +767,7 @@ export default defineComponent({
if (res == "confirm") { if (res == "confirm") {
store.commit("clearUserInfo", ""); store.commit("clearUserInfo", "");
localStorage.removeItem('AIToken') localStorage.removeItem('AIToken')
localStorage.removeItem('enterprise')
router.push({ path: "/login" }); router.push({ path: "/login" });
} else { } else {
//重置视频插件位置 //重置视频插件位置
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment