提交 8937020d 作者: 翁进城

Merge branch 'v4' into v4_master

...@@ -68,13 +68,13 @@ $axios.interceptors.response.use( ...@@ -68,13 +68,13 @@ $axios.interceptors.response.use(
// 2. 进行刷新访问令牌 // 2. 进行刷新访问令牌
try { try {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
window.$mmc.app.$emit("refreshToken", { window.$mmc_stl.app.$emit("refreshToken", {
callback(data) { callback(data) {
isRefreshToken = false; isRefreshToken = false;
if (data.code === 0) { if (data.code === 0) {
const token = data.token; const token = data.token;
console.log('store', store); console.log('store', store);
window.$mmc.app.$store.commit('MMCFlightControlCenter/setState', { window.$mmc_stl.app.$store.commit('MMCFlightControlCenter/setState', {
key: 'token', key: 'token',
value: token value: token
}) })
...@@ -157,7 +157,7 @@ function handleAuthorized() { ...@@ -157,7 +157,7 @@ function handleAuthorized() {
MessageBox.alert("登录超时,请重新登录!", "提示", { MessageBox.alert("登录超时,请重新登录!", "提示", {
confirmButtonText: "重新登录", confirmButtonText: "重新登录",
callback: (action) => { callback: (action) => {
window.$mmc.app.$emit("tokenInvalid"); window.$mmc_stl.app.$emit("tokenInvalid");
}, },
}); });
} }
...@@ -31,10 +31,10 @@ export default { ...@@ -31,10 +31,10 @@ export default {
}, },
watch: {}, watch: {},
mounted() { mounted() {
if (!window.$mmc) { if (!window.$mmc_stl) {
window.$mmc = {}; window.$mmc_stl = {};
} }
window.$mmc.viewer = {}; window.$mmc_stl.viewer = {};
this.init_viewer(); this.init_viewer();
}, },
methods: { methods: {
...@@ -88,7 +88,7 @@ export default { ...@@ -88,7 +88,7 @@ export default {
selectionIndicator: false, selectionIndicator: false,
}; };
window.$mmc.viewer = this.viewer = new Cesium.Viewer( window.$mmc_stl.viewer = this.viewer = new Cesium.Viewer(
`layer-container`, `layer-container`,
viewerOptions viewerOptions
); );
...@@ -184,7 +184,7 @@ export default { ...@@ -184,7 +184,7 @@ export default {
}); });
// 加载三维倾斜 // 加载三维倾斜
window.$mmc._3d = []; window.$mmc_stl._3d = [];
/* const token = /* const token =
'r0G6d8tdvfgN_Aad1j28SGqj6ILgt1DNHpP9dK-FNVOVBPgcyaHiEs2z2qyv455bTHU8QaFTbt_Y_AdeAsPp-Q..'; */ 'r0G6d8tdvfgN_Aad1j28SGqj6ILgt1DNHpP9dK-FNVOVBPgcyaHiEs2z2qyv455bTHU8QaFTbt_Y_AdeAsPp-Q..'; */
_3dList.forEach(async (item) => { _3dList.forEach(async (item) => {
...@@ -195,7 +195,7 @@ export default { ...@@ -195,7 +195,7 @@ export default {
// cullEnabled: false // cullEnabled: false
} }
); );
window.$mmc._3d.push(obj); window.$mmc_stl._3d.push(obj);
if (item === "3D-ZQ-JLH") { if (item === "3D-ZQ-JLH") {
// 肇庆九龙湖的模型需要修改海拔, 使其贴地 // 肇庆九龙湖的模型需要修改海拔, 使其贴地
obj.style3D.bottomAltitude = -20; obj.style3D.bottomAltitude = -20;
...@@ -203,11 +203,11 @@ export default { ...@@ -203,11 +203,11 @@ export default {
}); });
this.$store.commit("MMCFlightControlCenter/setState", { this.$store.commit("MMCFlightControlCenter/setState", {
key: "cesium3DModels", key: "cesium3DModels",
value: window.$mmc._3d, value: window.$mmc_stl._3d,
}); });
// 二维影像缓存加载方式 // 二维影像缓存加载方式
window.$mmc._2d = []; window.$mmc_stl._2d = [];
["3D-ZQ-DH", "3D-local3DCache-s3mb"].forEach((item) => { ["3D-ZQ-DH", "3D-local3DCache-s3mb"].forEach((item) => {
this.viewer.scene this.viewer.scene
.open( .open(
...@@ -219,14 +219,14 @@ export default { ...@@ -219,14 +219,14 @@ export default {
} }
) )
.then((obj) => { .then((obj) => {
window.$mmc._2d.push(obj); window.$mmc_stl._2d.push(obj);
}); });
}); });
// 关闭地图深度检测 // 关闭地图深度检测
this.viewer.scene.globe.depthTestAgainstTerrain = false; this.viewer.scene.globe.depthTestAgainstTerrain = false;
// 飞向指定的经纬度 // 飞向指定的经纬度
window.$mmc.flyTo = function (lng, lat) { window.$mmc_stl.flyTo = function (lng, lat) {
this.viewer.camera.flyTo({ this.viewer.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(lng, lat, 1000), destination: Cesium.Cartesian3.fromDegrees(lng, lat, 1000),
}); });
......
...@@ -762,7 +762,7 @@ export default { ...@@ -762,7 +762,7 @@ export default {
this.$store.dispatch("MMCFlightControlCenter/uav/videoTranscribe", { this.$store.dispatch("MMCFlightControlCenter/uav/videoTranscribe", {
playerFormat: this.streamSelect, playerFormat: this.streamSelect,
videoID: 1, // 视频通道ID(需保持唯一) videoID: 1, // 视频通道ID(需保持唯一)
dbID: "929", // 历史记录id // dbID: "929", // 历史记录id
name: "z30Pro", // 挂载名称(如果知道挂载名称,将传名称即可,通道号可以不用传) name: "z30Pro", // 挂载名称(如果知道挂载名称,将传名称即可,通道号可以不用传)
taskID: "", // 任务ID,可传可不传 taskID: "", // 任务ID,可传可不传
recordControl: this.screenRecordingStatus, // 录制开关、true为开启 recordControl: this.screenRecordingStatus, // 录制开关、true为开启
......
...@@ -181,12 +181,12 @@ export default { ...@@ -181,12 +181,12 @@ export default {
alert: this.$alert, alert: this.$alert,
}); });
Vue.component("SymbolIcon", SymbolIcon); Vue.component("SymbolIcon", SymbolIcon);
if (!window.$mmc) { if (!window.$mmc_stl) {
window.$mmc = {}; window.$mmc_stl = {};
} }
window.$mmc.app = this; window.$mmc_stl.app = this;
window.$mmc.$store = this.$store; window.$mmc_stl.$store = this.$store;
window.$mmc.state = () => { window.$mmc_stl.state = () => {
return this.$store.state; return this.$store.state;
}; };
}, },
...@@ -196,7 +196,7 @@ export default { ...@@ -196,7 +196,7 @@ export default {
key: "cesiumViewer", key: "cesiumViewer",
value: this.cesiumViewer, value: this.cesiumViewer,
}); });
window.$mmc.viewer = this.cesiumViewer; window.$mmc_stl.viewer = this.cesiumViewer;
} }
}, },
methods: {}, methods: {},
......
...@@ -31,14 +31,14 @@ export default function main(elementOrSelector, options = {}){ ...@@ -31,14 +31,14 @@ export default function main(elementOrSelector, options = {}){
if(!options.hasMMCSTLVue2){ if(!options.hasMMCSTLVue2){
Vue.use(MMCSTL); Vue.use(MMCSTL);
} }
if(!window.$mmc){ if(!window.$mmc_stl){
window.$mmc = {}; window.$mmc_stl = {};
} }
window.$mmc.$store = new Vuex.Store(store); window.$mmc_stl.$store = new Vuex.Store(store);
return new Vue({ return new Vue({
render: (h) => h(App), render: (h) => h(App),
router, router,
store: window.$mmc.$store, store: window.$mmc_stl.$store,
}).$mount(elementOrSelector); }).$mount(elementOrSelector);
} }
......
...@@ -119,14 +119,14 @@ const actions = { ...@@ -119,14 +119,14 @@ const actions = {
* @param {object} data * @param {object} data
*/ */
subscribe({ state, dispatch }) { subscribe({ state, dispatch }) {
window.$mmc.$store.dispatch("MMCMQTT/subscribe", { window.$mmc_stl.$store.dispatch("MMCMQTT/subscribe", {
topic: "APRON/RECEIVE/" + state.hangar.deviceId, topic: "APRON/RECEIVE/" + state.hangar.deviceId,
callback(ok) { callback(ok) {
ok && ok &&
console.log("mqtt订阅主题", "APRON/RECEIVE/" + state.hangar.deviceId); console.log("mqtt订阅主题", "APRON/RECEIVE/" + state.hangar.deviceId);
}, },
}); });
window.$mmc.$store.dispatch("MMCMQTT/subscribe", { window.$mmc_stl.$store.dispatch("MMCMQTT/subscribe", {
topic: "PROCESS/RECEIVE/" + state.hangar.deviceId, topic: "PROCESS/RECEIVE/" + state.hangar.deviceId,
callback(ok) { callback(ok) {
ok && ok &&
...@@ -142,7 +142,7 @@ const actions = { ...@@ -142,7 +142,7 @@ const actions = {
* @param {} param0 * @param {} param0
*/ */
unsubscribe({ state, dispatch }) { unsubscribe({ state, dispatch }) {
window.$mmc.$store.dispatch("MMCMQTT/unsubscribe", { window.$mmc_stl.$store.dispatch("MMCMQTT/unsubscribe", {
topic: "APRON/RECEIVE/" + state.hangar.deviceId, topic: "APRON/RECEIVE/" + state.hangar.deviceId,
callback(ok) { callback(ok) {
ok && ok &&
...@@ -152,7 +152,7 @@ const actions = { ...@@ -152,7 +152,7 @@ const actions = {
); );
}, },
}); });
window.$mmc.$store.dispatch("MMCMQTT/unsubscribe", { window.$mmc_stl.$store.dispatch("MMCMQTT/unsubscribe", {
topic: "PROCESS/RECEIVE/" + state.hangar.deviceId, topic: "PROCESS/RECEIVE/" + state.hangar.deviceId,
callback(ok) { callback(ok) {
ok && ok &&
...@@ -184,7 +184,7 @@ const actions = { ...@@ -184,7 +184,7 @@ const actions = {
* @param {Function} data.callback * @param {Function} data.callback
*/ */
out({ state, commit, dispatch }, data) { out({ state, commit, dispatch }, data) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc_stl.$store.dispatch("MMCMQTT/publish", {
topic: "PROCESS/OBTAIN/" + state.hangar.deviceId, topic: "PROCESS/OBTAIN/" + state.hangar.deviceId,
data: { data: {
cmdControlType: 2059, cmdControlType: 2059,
...@@ -200,7 +200,7 @@ const actions = { ...@@ -200,7 +200,7 @@ const actions = {
* @param {*} data * @param {*} data
*/ */
in({ state, commit, dispatch }, data) { in({ state, commit, dispatch }, data) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc_stl.$store.dispatch("MMCMQTT/publish", {
topic: "PROCESS/OBTAIN/" + state.hangar.deviceId, topic: "PROCESS/OBTAIN/" + state.hangar.deviceId,
data: { data: {
cmdControlType: 2073, cmdControlType: 2073,
...@@ -216,7 +216,7 @@ const actions = { ...@@ -216,7 +216,7 @@ const actions = {
* @param {*} data * @param {*} data
*/ */
chargeStart({ state, commit, dispatch }, data) { chargeStart({ state, commit, dispatch }, data) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc_stl.$store.dispatch("MMCMQTT/publish", {
topic: "PROCESS/OBTAIN/" + state.hangar.deviceId, topic: "PROCESS/OBTAIN/" + state.hangar.deviceId,
data: { data: {
cmdControlType: 2060, cmdControlType: 2060,
...@@ -232,7 +232,7 @@ const actions = { ...@@ -232,7 +232,7 @@ const actions = {
* @param {*} data * @param {*} data
*/ */
chargeEnd({ state, commit, dispatch }, data) { chargeEnd({ state, commit, dispatch }, data) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc_stl.$store.dispatch("MMCMQTT/publish", {
topic: "PROCESS/OBTAIN/" + state.hangar.deviceId, topic: "PROCESS/OBTAIN/" + state.hangar.deviceId,
data: { data: {
cmdControlType: 2071, cmdControlType: 2071,
...@@ -248,7 +248,7 @@ const actions = { ...@@ -248,7 +248,7 @@ const actions = {
* @param {*} data * @param {*} data
*/ */
warmUp({ state, commit, dispatch }, data) { warmUp({ state, commit, dispatch }, data) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc_stl.$store.dispatch("MMCMQTT/publish", {
topic: "PROCESS/OBTAIN/" + state.hangar.deviceId, topic: "PROCESS/OBTAIN/" + state.hangar.deviceId,
data: { data: {
cmdControlType: 2072, cmdControlType: 2072,
...@@ -264,7 +264,7 @@ const actions = { ...@@ -264,7 +264,7 @@ const actions = {
* @param {*} data * @param {*} data
*/ */
dormancy({ state, commit, dispatch }, data) { dormancy({ state, commit, dispatch }, data) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc_stl.$store.dispatch("MMCMQTT/publish", {
topic: "PROCESS/OBTAIN/" + state.hangar.deviceId, topic: "PROCESS/OBTAIN/" + state.hangar.deviceId,
data: { data: {
cmdControlType: 2061, cmdControlType: 2061,
...@@ -280,7 +280,7 @@ const actions = { ...@@ -280,7 +280,7 @@ const actions = {
* @param {*} data * @param {*} data
*/ */
processExit({ state, commit, dispatch }, data) { processExit({ state, commit, dispatch }, data) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc_stl.$store.dispatch("MMCMQTT/publish", {
topic: "PROCESS/OBTAIN/" + state.hangar.deviceId, topic: "PROCESS/OBTAIN/" + state.hangar.deviceId,
data: { data: {
cmdControlType: 100001, cmdControlType: 100001,
...@@ -307,7 +307,7 @@ const actions = { ...@@ -307,7 +307,7 @@ const actions = {
} */ } */
// 上传航线指令 // 上传航线指令
const waypointList = state.airlineData?.content; const waypointList = state.airlineData?.content;
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc_stl.$store.dispatch("MMCMQTT/publish", {
topic: "PROCESS/OBTAIN/" + state.hangar.deviceId, topic: "PROCESS/OBTAIN/" + state.hangar.deviceId,
data: { data: {
cmdControlType: 100004, cmdControlType: 100004,
...@@ -341,7 +341,7 @@ const actions = { ...@@ -341,7 +341,7 @@ const actions = {
if ( if (
res.data.currentOperator && res.data.currentOperator &&
res.data.currentOperator === res.data.currentOperator ===
window.$mmc.$store.state.MMCFlightControlCenter.userInfo.id window.$mmc_stl.$store.state.MMCFlightControlCenter.userInfo.id
) { ) {
return true; return true;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论