|
|
@@ -6,11 +6,7 @@
|
|
|
type="button"
|
|
|
aria-label="切换显示方向"
|
|
|
@click="orientationSwitched = !orientationSwitched">
|
|
|
- <svg
|
|
|
- class="orientation-toggle__icon"
|
|
|
- aria-hidden="true"
|
|
|
- viewBox="0 0 24 24"
|
|
|
- fill="none">
|
|
|
+ <svg class="orientation-toggle__icon" aria-hidden="true" viewBox="0 0 24 24" fill="none">
|
|
|
<path
|
|
|
d="M20 11a8 8 0 1 0-2.34 5.66M20 4v7h-7"
|
|
|
stroke="currentColor"
|
|
|
@@ -27,6 +23,7 @@ import { WebtopoProjectApi, parseWebtopoDataModel } from '@/api/pms/maotu'
|
|
|
import { IotDeviceApi } from '@/api/pms/device'
|
|
|
import type { IExportJson } from '@/components/mt-edit/components/types'
|
|
|
import { MtPreview } from '@/export'
|
|
|
+import { isAppWebtopoPreview } from '@/utils/auth'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
import { nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
@@ -171,8 +168,12 @@ const onEventCallBack = (type: string, item_id: string, targetProjectId?: number
|
|
|
if (type == 'test-dialog') {
|
|
|
ElMessage.success(`获取到了id:${item_id}`)
|
|
|
} else if (type == 'openWebtopo' && targetProjectId) {
|
|
|
- const routeInfo = router.resolve(`/maotu/preview/${targetProjectId}`)
|
|
|
- window.open(routeInfo.href, '_blank')
|
|
|
+ if (isAppWebtopoPreview()) {
|
|
|
+ router.replace(`/maotu/preview/${targetProjectId}`)
|
|
|
+ } else {
|
|
|
+ const routeInfo = router.resolve(`/maotu/preview/${targetProjectId}`)
|
|
|
+ window.open(routeInfo.href, '_blank')
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|