Commit f94c4c3f authored by xinzhedeai's avatar xinzhedeai

dp地址

parent cd6c01a7
......@@ -108,26 +108,26 @@ import cuAmap from "@/components/AMap";
import request from "@/utils/request";
// let resizeTimeout;
// window.addEventListener('resize', function() {
// clearTimeout(resizeTimeout);
// resizeTimeout = setTimeout(function() {
// location.reload();
// // 执行响应逻辑
// }, 200); // 200毫秒后执行
// });
let resizeTimeout;
window.addEventListener('resize', function() {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function() {
location.reload();
// 执行响应逻辑
}, 200); // 200毫秒后执行
});
// function getPxByRem(remValue){// 传入要转换的 rem 值
// // 获取 html 元素
// const htmlElement = document.documentElement;
function getPxByRem(remValue){// 传入要转换的 rem 值
// 获取 html 元素
const htmlElement = document.documentElement;
// // 获取 html 元素的 font-size
// const fontSize = parseFloat(getComputedStyle(htmlElement).fontSize);
// 获取 html 元素的 font-size
const fontSize = parseFloat(getComputedStyle(htmlElement).fontSize);
// // 将 rem 转换为 px
// let pxValue = remValue * fontSize;
// return pxValue
// }
// 将 rem 转换为 px
let pxValue = remValue * fontSize;
return pxValue
}
export default {
......@@ -294,11 +294,12 @@ export default {
chartConfig: {
chart: {
type: "bar",
marginTop: 20,
marginTop: getPxByRem(0.15),
// marginBottom: 10,
// bottom:10,
// left:40,
marginRight: 30,
marginBottom: getPxByRem(0.45),
marginRight: getPxByRem(0.3),
},
xAxis: {
type: "category",
......@@ -749,82 +750,6 @@ export default {
method: "get",
}).then((res) => {
let list = res.body || [];
list = {
names: [
{
name: "上缴税费",
key: "num",
},
],
list: [
{
date: "2021年",
values: {
num: 100,
},
},
{
date: "2023年",
values: {
num: 41,
},
},
{
date: "2024年",
values: {
num: 533,
},
},
{
date: "2025年",
values: {
num: 303,
},
},
{
date: "2026年",
values: {
num: 306,
},
},
{
date: "2027年",
values: {
num: 309,
},
},
{
date: "2028年",
values: {
num: 312,
},
},
{
date: "2029年",
values: {
num: 315,
},
},
{
date: "2030年",
values: {
num: 318,
},
},
{
date: "2031年",
values: {
num: 321,
},
},
{
date: "2032年",
values: {
num: 324,
},
},
],
};
var chartData = Highchart.seriesDataFormat(list, {
datekey: "date",
dataReverse: true,
......@@ -834,10 +759,10 @@ export default {
var opts = {
chartConfig: {
chart: {
marginTop: 40,
marginLeft: 50,
marginBottom: 45,
marginRight: 20,
marginTop: getPxByRem(0.4),
marginLeft: getPxByRem(0.5),// 50,
marginBottom: getPxByRem(0.45),
marginRight: getPxByRem(0.2),
},
xAxis: {
lineWidth: 1, // 设置 Y 轴坐标轴线宽度
......@@ -858,7 +783,7 @@ export default {
// tickLength: 0, // 不显示刻度线
gridLineWidth: 0, // 也可以设置不显示网格线
title: {
text: "(万元)",
text: "万元",
margin: 0,
style: {
color: "#eee",
......@@ -866,8 +791,8 @@ export default {
},
rotation: 0,
align: "high",
y: -15,
x: 45,
y: getPxByRem(-0.15),
x: getPxByRem(0.4),
},
labels: {
style: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment