diff --git a/nezha-fronted/src/components/chart/chart/chartAutotopology.vue b/nezha-fronted/src/components/chart/chart/chartAutotopology.vue index 72a265a2e..0b96e814e 100644 --- a/nezha-fronted/src/components/chart/chart/chartAutotopology.vue +++ b/nezha-fronted/src/components/chart/chart/chartAutotopology.vue @@ -8,6 +8,7 @@ { + // this.$get('/stat', params).then(res => { + // if (res.code === 200) { + // chartData.push(res.data.result) + // } else { + // chartData.push({ error: res.msg || res.error || res }) + // this.isError = true + // } + // this.chartData = chartData + // this.loading = false + // }) + this.sendAjax('/stat', params).then(res => { if (res.code === 200) { chartData.push(res.data.result) } else { @@ -530,6 +541,41 @@ export default { color = '#23bf9a' } return color + }, + sendAjax (url, params) { + // 构造表单数据 + return new Promise(resolve => { + let nowUrl = url + Object.keys(params).forEach((key, index) => { + if (index == 0) { + nowUrl += '?' + key + '=' + params[key] + } else { + nowUrl += '&' + key + '=' + params[key] + } + }) + const formData = new FormData() + formData.append('username', 'johndoe') + formData.append('id', 123456) + // 创建xhr对象 + const xhr = new XMLHttpRequest() + // 设置xhr请求的超时时间 + xhr.timeout = 3000 + // 设置响应返回的数据格式 + xhr.responseType = '' + // 创建一个 post 请求,采用异步 + xhr.open('get', 'http://192.168.44.100/' + nowUrl, true) + xhr.setRequestHeader('Authorization', localStorage.getItem('nz-token')); + // 注册相关事件回调处理函数 + xhr.onload = function (e) { + if (this.status == 200 || this.status == 304) { + // alert(this.responseText) + resolve(JSON.parse(this.responseText)) + } + } + xhr.onerror = function(e) { console.log(e) }; + // 发送数据 + xhr.send() + }) } }, watch: { diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue b/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue index b94cf882c..7e18df206 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue @@ -762,7 +762,6 @@ export default { document.body.style.height = 'auto' // document.getElementsByTagName('html')[0].style.overflow = 'visible' const position = dom.getBoundingClientRect() - console.log(position) this.getPdf(dom, -1 * position.left, -1 * position.top,this.searchTime) // this.getPdf(dom, 0, 0) }, 2000) diff --git a/nezha-fronted/src/components/common/js/htmlToPdf.js b/nezha-fronted/src/components/common/js/htmlToPdf.js index 49d2af70a..237a30e01 100644 --- a/nezha-fronted/src/components/common/js/htmlToPdf.js +++ b/nezha-fronted/src/components/common/js/htmlToPdf.js @@ -31,7 +31,6 @@ export default { // a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的宽高 const imgWidth = 595.28 const imgHeight = 592.28 / contentWidth * contentHeight - console.log(canvas) // canvas.paddingTop = '30px' const pageDataImg = canvas.toDataURL('image/jpeg', 1.0) const img = new Image() diff --git a/nezha-fronted/src/components/common/project/topologyL5.vue b/nezha-fronted/src/components/common/project/topologyL5.vue index f4d137b3a..0fac1b74e 100644 --- a/nezha-fronted/src/components/common/project/topologyL5.vue +++ b/nezha-fronted/src/components/common/project/topologyL5.vue @@ -157,7 +157,7 @@
-
+
-
+
@@ -1751,7 +1751,6 @@ export default { Promise.all(promiseArr).then((res2, header) => { this.iconArray = [...res.data.list] this.iconArray.forEach((item, index) => { - console.log(res2[index]) item.image = res2[index].data || res2[index] if (!getTopologyImg(item.id)) { setTopologyImg(item.id, item.image)