forked from github/dataease
feat: 根据设备信息自动识别终端类型
This commit is contained in:
parent
db242ba72b
commit
3222f645a1
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user