diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue index 97b8daaff5..4e71af110d 100644 --- a/frontend/src/components/canvas/components/Editor/Preview.vue +++ b/frontend/src/components/canvas/components/Editor/Preview.vue @@ -123,10 +123,6 @@ export default { } }, created() { - const terminalInfo = this.$route.query.terminal - if (terminalInfo) { - this.terminal = terminalInfo - } }, computed: { customStyle() { @@ -178,6 +174,7 @@ export default { } }, mounted() { + this._isMobile() const _this = this const erd = elementResizeDetectorMaker() // 监听主div变动事件 @@ -206,6 +203,11 @@ export default { clearInterval(this.timer) }, methods: { + _isMobile() { + console.log('navigator.userAgent:' + navigator.userAgent) + const flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i) + this.terminal = flag ? 'mobile' : 'pc' + }, canvasStyleDataInit() { // 数据刷新计时器 this.searchCount = 0 diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index df7621c24a..d9b2216b9b 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -299,7 +299,6 @@ export default { // 监控缩放比例 previewCanvasScale: { handler(newVal, oldVal) { - console.log('previewCanvasScale:' + JSON.stringify(this.previewCanvasScale)) this.destroyScaleTimeMachine() this.changeScaleIndex++ this.chartScale(this.changeScaleIndex) @@ -317,7 +316,6 @@ export default { // 根据仪表板的缩放比例,修改视图内部参数 mergeScale() { const scale = Math.min(this.previewCanvasScale.scalePointWidth, this.previewCanvasScale.scalePointHeight) * this.scaleCoefficient - console.log('scale:' + scale + ';this.previewCanvasScale:' + JSON.stringify(this.previewCanvasScale)) const customAttrChart = JSON.parse(this.sourceCustomAttrStr) const customStyleChart = JSON.parse(this.sourceCustomStyleStr) recursionTransObj(customAttrTrans, customAttrChart, scale, this.scaleCoefficientType)