/* try {
require("../jquery")
} catch (error) {
console.log(error)
}
*/
/**
* 页面加载时
*/
window.onload = function () {
$(".top :first-child").addClass("cycle")
$(".allItem :first-child").addClass("allItemColor")
$(".fourTitle").children().eq(0).addClass("fourTitleColor")
console.log("mm", $(".echart012").width())
}
/**
* 头部四个标题点击事件
*/
$(".top")
.children()
.click(function () {
$(".top").children().removeClass("cycle")
$(this).addClass("cycle")
})
/**
* 在库项目按钮切换
*/
$(".allItem span").click(function () {
$(".allItem span").removeClass("allItemColor")
$(this).addClass("allItemColor")
$(".threeCard, .threeEchart").children().css("display", "none")
if (this.innerText == "在库项目") {
$(".threeCard").children().eq(0).css("display", "flex")
$(".echart1").css("display", "block")
} else if (this.innerText == "在建项目") {
$(".threeCard").children().eq(1).css("display", "flex")
$(".echart2").css("display", "block")
} else {
$(".threeCard").children().eq(2).css("display", "flex")
$(".echart3").css("display", "block")
}
})
/**
* echart图表重设高度
*/
$(".threeEchart").children().css("width", $(".threeEchart").width())
$(".fourEchart").children().css("width", $(".fourEchart").width())
$(".echart_architecture").children().css("width", $(".echart_architecture").width())
/**
* 建筑业企业按钮切换
*/
$(".fourTitle")
.children()
.click(function () {
$(".fourTitle").children().removeClass("fourTitleColor")
$(this).addClass("fourTitleColor")
$(".fourContent ,.fourEchart ,.echart_architecture").children().css("display", "none")
if (this.innerText == "建筑业企业") {
$(".register,.echart4,.echart5").css("display", "block")
} else if (this.innerText == "服务业企业") {
$(".credit, .echart011, .echart6").css("display", "block")
} else if (this.innerText == "勘察设计企业") {
$(".survey, .echart014, .echart7").css("display", "block")
} else {
$(".supervision, .echart015, .echart8").css("display", "block")
}
})
var myChart012 = echarts.init(document.querySelector(".echart012"))
// 小饼图
var url3 = "http://118.178.224.202:8024/api/new10"
$.get(url3,function(data){
console.log("饼图数据",data)
let myChart13 = echarts.init(document.querySelector(".echart013"))
var shengnei = data.data[0].in
var shengwai = data.data[0].out
var all = Number(shengnei) + Number(shengwai)
$("#jianzhuY").html(all)
$("#province_inner").html(shengnei)
$("#province_outer").html(shengwai)
let option13 = {
labelLine: {
show: false,
},
label: {
show: false,
},
tooltip: {
trigger: "item",
show: true,
showContent: true,
formatter: `{a}
{b}: {c}({d}%)`,
},
avoidLabelOverlap: true,
series: [
{
name: "财政收入",
type: "pie",
radius: "50%",
emphasis: {
labelLine: {
show: false,
},
},
data: [
{
value: shengnei,
name: "税收收入",
itemStyle: {
color: "#fecc5d",
},
// formatter: "{c}",
labelLine: {
show: false,
},
},
{
value: shengwai,
name: "非税收收入",
itemStyle: {
color: "#fc8452",
},
labelLine: {
show: false,
},
},
],
},
],
}
myChart13.setOption(option13)
})
/**
* 建筑业项目
*/
let myChart1 = echarts.init(document.querySelector(".echart1"))
let myChart2 = echarts.init(document.querySelector(".echart2"))
let myChart3 = echarts.init(document.querySelector(".echart3"))
$.get("http://118.178.224.202:8024/api/constructionpermit/zk-count", function (data) {
let area = data.data.map(function (item) {
return item.area
})
let value = data.data.map(function (item) {
return item.count
})
let sum = 0
value.forEach(function (item) {
sum += item
})
$("#zaiku").text(sum)
let option1 = {
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
},
},
legend: {
left: "0%",
top: 0,
selectedMode: false,
itemWidth: 15,
itemHeight:10,
textStyle: {
color: "#6e7178",
fontSize: 13,
},
},
grid: {
left: 0,
bottom: 0,
top: 40,
right: 0,
},
xAxis: {
type: "value",
boundaryGap: [0, 0.01],
max: 180,
axisTick: {
show: false,
},
axisLine: {
lineStyle: {
color: "#e1e1e1",
},
},
axisLabel: {
color: "black",
},
splitLine: {
show: false,
},
show: false,
},
yAxis: {
type: "category",
data: area,
axisTick: {
show: false,
lineStyle: {
color: "#1A95D2",
},
},
axisLine: {
show: false,
},
axisLabel: {
fontSize: 14,
verticalAlign: "bottom",
align: "left",
lineHeight: 28,
margin: -0,
color: "#6e7178",
},
},
series: [
{
name: "在库项目",
type: "bar",
data: value,
itemStyle: {
color: "#83BBFF",
borderRadius: 5,
},
barWidth: 10,
showBackground: {
show: true,
},
backgroundStyle: {
color: "#E6F1FF",
borderRadius: 5,
},
label: {
show: true,
position: "left",
align: "right",
formatter: "{c}个",
offset: [$(".echart012").width(), -13],
fontSize: 14,
color: "#6e7178",
},
},
],
}
myChart1.setOption(option1)
})
$.get("http://118.178.224.202:8024/api/constructionpermit/zj-count", function (data) {
let area = data.data.map(function (item) {
return item.area
})
let value = data.data.map(function (item) {
return item.count
})
let sum = 0
value.forEach(function (item) {
sum += item
})
$("#zaijian").text(sum)
$("#kaoqin").text(sum)
let option2 = {
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
},
},
legend: {
left: "0",
top: 0,
selectedMode: false,
itemWidth: 15,
itemHeight:10,
textStyle: {
color: "#6e7178",
fontSize: 13,
},
},
grid: {
left: 0,
bottom: 0,
top: 40,
right: 0,
},
xAxis: {
type: "value",
boundaryGap: [0, 0.01],
max: 180,
axisTick: {
show: false,
},
axisLine: {
lineStyle: {
color: "#e1e1e1",
},
},
axisLabel: {
color: "black",
},
splitLine: {
show: false,
},
show: false,
},
yAxis: {
type: "category",
data: area,
axisTick: {
show: false,
lineStyle: {
color: "#1A95D2",
},
},
axisLine: {
show: false,
},
axisLabel: {
fontSize: 14,
verticalAlign: "bottom",
lineHeight: 28,
align: "left",
color: "#6e7178",
margin: 0,
},
},
series: [
{
name: "在建项目",
type: "bar",
data: value,
itemStyle: {
color: "#83BBFF",
borderRadius: 5,
},
barWidth: 10,
showBackground: {
show: true,
},
backgroundStyle: {
color: "#E6F1FF",
borderRadius: 5,
},
label: {
show: true,
position: "left",
align: "right",
formatter: "{c}个",
offset: [$(".echart012").width(), -13],
fontSize: 14,
color: "#6e7178",
},
},
],
}
myChart2.setOption(option2)
let option3 = {
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
},
},
legend: {
left: "0%",
top: 0,
selectedMode: false,
itemWidth: 15,
itemHeight:10,
textStyle: {
color: "#6e7178",
fontSize: 13,
},
},
grid: {
left: 0,
bottom: 0,
top: 40,
right: 00,
},
xAxis: {
type: "value",
boundaryGap: [0, 0.01],
max: 180,
axisTick: {
show: false,
},
axisLine: {
lineStyle: {
color: "#e1e1e1",
},
},
axisLabel: {
color: "black",
},
splitLine: {
show: false,
},
show: false,
},
yAxis: {
type: "category",
data: area,
axisTick: {
show: false,
lineStyle: {
color: "#1A95D2",
},
},
axisLine: {
show: false,
},
axisLabel: {
fontSize: 14,
verticalAlign: "bottom",
align: "left",
lineHeight: 28,
margin: -0,
color: "#6e7178",
},
},
series: [
{
name: "实名制考勤项目",
type: "bar",
data: value,
itemStyle: {
color: "#83BBFF",
borderRadius: 5,
},
barWidth: 10,
showBackground: {
show: true,
},
backgroundStyle: {
color: "#E6F1FF",
borderRadius: 5,
},
label: {
show: true,
position: "left",
formatter: "{c}个",
align: "right",
offset: [$(".echart012").width(), -13],
fontSize: 14,
color: "#6e7178",
},
},
],
}
myChart3.setOption(option3)
})
let myChart4 = echarts.init(document.querySelector(".echart4"))
/**
* @建筑业企业图表
*/
// let myChart011 = echarts.init(document.querySelector(".echart011"))
let myChart14 = echarts.init(document.querySelector(".echart014"))
let myChart15 = echarts.init(document.querySelector(".echart015"))
let myChart5 = echarts.init(document.querySelector(".echart5"))
// let myChart6 = echarts.init(document.querySelector(".echart6"))
let myChart7 = echarts.init(document.querySelector(".echart7"))
let myChart8 = echarts.init(document.querySelector(".echart8"))
var myColor = ["#3388ff", "#fecc5d", "#fc8452", "#3ba272", "#F5B453"]
$.get("http://118.178.224.202:8024/api/construction", function ({ data }) {
console.log(("得到的12中的数据",data))
var option012 = {
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
},
formatter: `