fix:diagram 图片 宽高不对的问题
This commit is contained in:
@@ -47,14 +47,6 @@ import { randomcolor } from '@/components/common/js/radomcolor/randomcolor'
|
||||
export default {
|
||||
name: 'chart-guage',
|
||||
mixins: [chartMixin, chartFormat],
|
||||
watch: {
|
||||
isFullscreen: {
|
||||
immediate: true,
|
||||
handler (n) {
|
||||
console.log(n)
|
||||
}
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
gaugeData: [],
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
<template>
|
||||
<div style="width: 100%;height: 100%" :id="'chartUrl' + chartInfo.id" class="mt-10 url-container" v-show="firstShow">
|
||||
<iframe :id="'urlContainer' + chartInfo.id" frameborder="0" width="100%" height="100%" name="showHere" scrolling=auto style="z-index:5000;padding-bottom:6px;"></iframe>
|
||||
<div style="width: 100%;height: 100%" :id="'chartUrl' + chartId" class="mt-10 url-container" v-show="firstShow">
|
||||
<iframe :id="'urlContainer' + chartId" frameborder="0" width="100%" height="100%" name="showHere" scrolling=auto style="z-index:5000;padding-bottom:6px;"></iframe>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import chartMixin from '@/components/chart/chartMixin'
|
||||
export default {
|
||||
name: 'chart-url',
|
||||
mixins: [chartMixin],
|
||||
props: {
|
||||
chartInfo: {},
|
||||
chartData: {}
|
||||
@@ -20,7 +22,7 @@ export default {
|
||||
setLoadFrame (data) {
|
||||
const that = this
|
||||
this.$nextTick(() => {
|
||||
const iframe = document.querySelector('#urlContainer' + this.chartInfo.id)
|
||||
const iframe = document.querySelector('#urlContainer' + this.chartId)
|
||||
// 处理兼容行问题
|
||||
if (iframe.attachEvent) {
|
||||
iframe.attachEvent('onload', function () {
|
||||
|
||||
@@ -312,7 +312,7 @@ export default {
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
console.info(e)
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1763,8 +1763,8 @@ export default {
|
||||
imageId: item.id,
|
||||
unit: item.unit,
|
||||
rect: {
|
||||
width: res2[index].width,
|
||||
height: res2[index].height
|
||||
width: res2[index].width === -1 ? 100 : res2[index].width,
|
||||
height: res2[index].height === -1 ? 100 : res2[index].height
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1780,8 +1780,8 @@ export default {
|
||||
imageId: item.id,
|
||||
unit: item.unit,
|
||||
rect: {
|
||||
width: res2[index].width,
|
||||
height: res2[index].height
|
||||
width: res2[index].width === -1 ? 100 : res2[index].width,
|
||||
height: res2[index].height === -1 ? 100 : res2[index].height
|
||||
}
|
||||
}
|
||||
}]
|
||||
@@ -1835,8 +1835,8 @@ export default {
|
||||
data: ('data:image/jpeg;base64,' + res.data),
|
||||
// width: res.headers.width === -1 ? 100 : (res.headers.width > 900 ? 900 : res.headers.width),
|
||||
// height: res.headers.height === -1 ? 100 : (res.headers.height > 900 ? 900 : res.headers.height)
|
||||
width: res.headers.width === -1 ? 100 : Number(res.headers.width),
|
||||
height: res.headers.height === -1 ? 100 : Number(res.headers.height)
|
||||
width: (res.headers.width === -1 || res.headers.width === 0) ? 100 : Number(res.headers.width),
|
||||
height: (res.headers.height === -1 || res.headers.height === 0) ? 100 : Number(res.headers.height)
|
||||
}
|
||||
if (imageInfo.width > 900 || imageInfo.height > 900) {
|
||||
if (imageInfo.height > imageInfo.width) {
|
||||
|
||||
@@ -30,7 +30,6 @@ export default {
|
||||
},
|
||||
// 更新path,包含请求参数
|
||||
updatePath (param, path) {
|
||||
console.log(param)
|
||||
const params = lodash.cloneDeep(param)
|
||||
Object.keys(params).forEach(key => {
|
||||
if (!params[key]) {
|
||||
|
||||
@@ -1739,8 +1739,8 @@ export default {
|
||||
imageId: item.id,
|
||||
unit: item.unit,
|
||||
rect: {
|
||||
width: res2[index].width,
|
||||
height: res2[index].height
|
||||
width: res2[index].width === -1 ? 100 : res2[index].width,
|
||||
height: res2[index].height === -1 ? 100 : res2[index].height
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1756,8 +1756,8 @@ export default {
|
||||
imageId: item.id,
|
||||
unit: item.unit,
|
||||
rect: {
|
||||
width: res2[index].width,
|
||||
height: res2[index].height
|
||||
width: res2[index].width === -1 ? 100 : res2[index].width,
|
||||
height: res2[index].height === -1 ? 100 : res2[index].height
|
||||
}
|
||||
}
|
||||
}]
|
||||
|
||||
@@ -243,7 +243,6 @@ export default {
|
||||
})
|
||||
},
|
||||
selectPanel (panel) {
|
||||
console.log(panel)
|
||||
this.panelName = panel.name
|
||||
this.editChart.panelName = panel.name
|
||||
this.panelId = panel.id
|
||||
|
||||
@@ -175,7 +175,6 @@ export default {
|
||||
setCustomTime (timeGroup, timeRange) {
|
||||
if (timeGroup) {
|
||||
this.showTime = this.nowTimeType = this.timeData.find(item => item.id == timeGroup.id)
|
||||
console.log(this.showTime)
|
||||
if (this.showTime) {
|
||||
this.showTime = Object.assign({}, this.showTime)
|
||||
this.$set(this.searchTime, 0, timeGroup.start_time)
|
||||
|
||||
@@ -49,7 +49,6 @@ export default {
|
||||
}
|
||||
},
|
||||
created () {
|
||||
console.log(this.$route.query)
|
||||
this.switchTab = this.$route.query.switchTab || 'exprTemp'
|
||||
},
|
||||
mounted () {
|
||||
|
||||
Reference in New Issue
Block a user