Files
xinjiang/SGGL/FineUIPro.Web/common/mainMenu_HSECheck.aspx
T

650 lines
22 KiB
Plaintext

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="mainMenu_HSECheck.aspx.cs" Inherits="FineUIPro.Web.mainMenu_HSECheck" %>
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>首页</title>
<link href="../res/index/css/reset.css" rel="stylesheet" />
<link href="../res/index/css/home.css" rel="stylesheet" />
<link href="../res/index/css/swiper-3.4.2.min.css" rel="stylesheet" />
<style type="text/css">
* {
box-sizing: border-box;
}
.flexV {
flex-direction: column;
}
.wrap {
height: 100%;
padding: 15px;
/*background-color: #EEEED1;*/
background-color: #FFFFFF;
}
.iteml {
margin-left: 5px;
}
.itemb {
margin-bottom: 5px;
}
.bottom-wrap {
padding: 0;
margin-bottom: 5px;
}
.bottom-wrap:last-child {
margin-bottom: 0;
}
.bw-b-bottom {
width: 100%;
height: 100%;
}
.bw-b-bottom-up {
border-radius: 0;
height: 100%;
margin: 0;
box-shadow: none;
}
.bw-item-content {
padding: 5px;
}
.top {
width: 100%;
}
.top .item {
}
.bw-b {
width: 50%;
}
.bw-b-bottom-up {
}
.tab-wrap {
left: auto;
right: 15px;
top: 5px;
font-size: 12px;
}
.tab .t-item {
width: auto;
padding: 5px 10px;
color: #363636;
}
.tit-item {
padding: 0 10px;
justify-content: space-between;
font-size: 12px;
}
.tab-wrap .tab .t-item {
color: #1C1C1C;
}
.tip-item {
margin-left: 10px;
align-items: center;
font-size: 10px;
}
.tip {
width: 25px;
height: 13px;
background-color: #258F76;
border-radius: 2px;
margin-right: 5px;
}
.tip-next {
background-color: #4F4F4F;
}
.myTableClass {
width: 100%;
height: 100%;
overflow: auto;
margin: 2px 1px;
border-collapse: collapse; /* 设置表格边框合并 */
border: 1px solid #BEBEBE;
background: #ffffff;
color: #8B8989; /* 设置表格文字颜色 */
text-align: center; /* 设置表格文字居中 */
font-size: 14px;
}
.tab-title {
height: 48px;
color: #3CB371;
font-size: 16px;
font-weight: 700;
}
.tab-header {
height: 36px;
color: #1C86EE;
font-size: 14px;
font-weight: 600;
}
td, th {
border: 1px solid #BEBEBE;
}
</style>
</head>
<body>
<div class="wrap flex flexV">
<div class="bottom-wrap flex1">
<div class="top flex">
<div class="item flex1 iteml">
<div class="bw-b-bottom">
<div class="bw-b-bottom-up">
<div class="bw-item-content">
<div id="classifyTable" runat="server" style="width: 100%; height: 100%;"></div>
</div>
</div>
</div>
</div>
<div class="item flex2 iteml">
<div class="bw-b-bottom">
<div class="bw-b-bottom-up">
<div class="tab-wrap">
<div class="tab" data-value="2">
<div class="t-item active">本月</div>
<div class="spline"></div>
<div class="t-item">今年</div>
</div>
</div>
<div class="bw-item-content">
<div id="classifyBarChart" style="width: 100%; height: 100%;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="bottom-wrap flex1">
<div class="top flex">
<div class="item flex1 iteml">
<div class="bw-b-bottom">
<div class="bw-b-bottom-up">
<div class="tab-wrap">
<div class="tab" data-value="3">
<div class="t-item active">本月</div>
<div class="spline"></div>
<div class="t-item">今年</div>
</div>
</div>
<div class="bw-item-content">
<div id="s1Pie" style="width: 100%; height: 100%;"></div>
</div>
</div>
</div>
</div>
<div class="item flex1 iteml">
<div class="bw-b-bottom">
<div class="bw-b-bottom-up">
<div class="tab-wrap">
<div class="tab" data-value="4">
<div class="t-item active">本月</div>
<div class="spline"></div>
<div class="t-item">今年</div>
</div>
</div>
<div class="bw-item-content">
<div id="s2Pie" style="width: 100%; height: 100%;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<script type="text/javascript" src="../res/index/js/jquery-3.4.1.min.js"></script>
<script type="text/javascript" src="../res/index/js/swiper-3.4.2.jquery.min.js"></script>
<script type="text/javascript" src="../res/index/js/echarts.min.js"></script>
<script type="text/javascript">
function category_S1Pie(id, sum, pieData, legdata) {
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById(id))
// 指定图表的配置项和数据
var option = {
title: [{
text: '安全管理类统计',
left: 'center'
}],
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b}: {c} ({d}%)'
},
legend: {
orient: 'vertical',
left: 'left',
data: legdata,
},
graphic: {
type: "text",
left: "36%",
top: "52%",
style: {
text: sum,
textAlign: "center",
fill: "#000",
fontSize: 18,
fontWeight: 600
}
},
series: [
{
name: '安全管理类统计',
type: 'pie',
radius: '50%',
data: pieData,
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
}
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
}
var s1Pie =<%=S1Pie %>;
var sum = s1Pie.stack;
var pieData = s1Pie.series[0].pieData;
var legend = s1Pie.series[0].dataString;
category_S1Pie('s1Pie', sum, pieData, legend);
</script>
<script type="text/javascript">
function category_S2Pie(id, sum, pieData, legdata) {
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById(id))
// 指定图表的配置项和数据
var option = {
title: [{
text: '施工作业类统计',
left: 'center'
}],
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b}: {c} ({d}%)'
},
legend: {
orient: 'vertical',
left: 'left',
data: legdata,
},
graphic: {
type: "text",
left: "36%",
top: "52%",
style: {
text: sum,
textAlign: "center",
fill: "#000",
fontSize: 18,
fontWeight: 600
}
},
series: [
{
name: '施工作业类统计',
type: 'pie',
radius: '50%',
data: pieData,
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
}
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
}
var s2Pie =<%=S2Pie %>;
var sum = s2Pie.stack;
var pieData = s2Pie.series[0].pieData;
var legend = s2Pie.series[0].dataString;
category_S2Pie('s2Pie', sum, pieData, legend);
</script>
<script type="text/javascript">
function category_ClassifyBar(id, xArr, data, num) {
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById(id))
// 指定图表的配置项和数据
var option = {
title: {
// left:'center',
text: '按问题分类统计',
textStyle: {
color: '#1C1C1C',
fontSize: 16,
fontWeight: 700
},
show: true
},
tooltip: {},
legend: {
left: '80%',
show: true,
textStyle: {//图例文字的样式
color: '#363636',
fontSize: 12,
}
},
dataZoom: [//底部滚动条
{
type: 'slider',
// start: 0,
// end: 60
maxValueSpan: 10,
show: false,//true:显示、false:隐藏
xAxisIndex: [0],
bottom: 0, height: 10,
backgroundColor: 'rgba(0,0,0,0)',
borderColor: 'none',
brushSelect: false,
textStyle: {
color: 'rgba(0,0,0,0)'
},
selectedDataBackground: {
areaStyle: {
color: 'red',
borderWidth: 0
}
},
handleStyle: { // 缩放手柄的样式
color: "#0a1449"
},
moveHandleStyle: {
color: '#0a1449'
}
}
],
xAxis: {
axisTick: {
show: false
},
axisLine: {
lineStyle: {
color: 'rgba(0,0,0, 0.3)',
}
},
axisLabel: {
show: true,
textStyle: {
color: 'rgba(0,0,0, 0.8)'
},
interval: 0,
rotate: -15,
formatter: function (value) {
var ret = "";//拼接加\n返回的类目项
var maxLength = num;//每项显示文字个数
var valLength = value.length;//X轴类目项的文字个数
var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数
if (rowN > 1)//如果类目项的文字大于maxLength,
{
for (var i = 0; i < rowN; i++) {
var temp = "";//每次截取的字符串
var start = i * maxLength;//开始截取的位置
var end = start + maxLength;//结束截取的位置
//这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧
//temp = value.substring(start, end) + "\n";
temp = value.substring(start, end) + (i == rowN - 1 ? "" : "\n");
ret += temp; //凭借最终的字符串
}
return ret;
}
else {
return value;
}
}
},
type: 'category',
data: xArr,
boundaryGap: [0, 0.01],
},
yAxis: {
axisTick: {
show: false
},
axisLine: {
show: false,
lineStyle: {
color: 'rgba(0,0,0, 0.3)'
}
},
axisLabel: {
show: true,
textStyle: {
color: 'rgba(0,0,0, 0.8)'
}
},
},
series: data,
grid: {
top: '20%',
left: '0%',
right: '0%',
bottom: 40,
containLabel: true,
backgroundColor: 'rgba(0,162,233, 0.01)',
// borderColor: 'rgba(0,162,233, 1)'
},
backgroundColor: 'rgba(0,162,233, 0.01)',
textStyle: {
color: 'rgba(0,0,0, 0.3)'
}
}
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option)
}
var classifyBar =<%=ClassifyBar %>;
var xArr = classifyBar.categories;
var data = [
{
name: '承包商',
type: 'bar',
stack: '总量',
barWidth: 40,
data: classifyBar.series[0].data,
label: { //柱体上显示数值
show: true,//开启显示
position: ['35%', '50%'],//在上方显示
textStyle: {//数值样式
fontSize: '20px',
color: '#363636'
},
formatter: function (params) {
// 当数值为0时返回空字符串,不显示标签
return params.value === 0 ? '' : params.value;
},
},
itemStyle: { normal: { color: 'rgba(255,0,0, 0.5)' } }
},
{
name: '项目部',
type: 'bar',
stack: '总量',
barWidth: 40,
data: classifyBar.series[1].data,
label: { //柱体上显示数值
show: true,//开启显示
position: ['35%', '50%'],//在上方显示
textStyle: {//数值样式
fontSize: '20px',
color: '#363636'
},
formatter: function (params) {
// 当数值为0时返回空字符串,不显示标签
return params.value === 0 ? '' : params.value;
},
},
itemStyle: { normal: { color: 'rgba(0,100,0,0.8)' } }
}
]
category_ClassifyBar('classifyBarChart', xArr, data, classifyBar.xFontNum);
</script>
<script>
$(".tab .t-item").click(function () {
var $this = $(this)
var index = $this.index()
if ($this.hasClass('active') && index == 0) {
return
}
var $tab = $this.closest(".tab")
var value = $tab.attr("data-value")
$tab.find(".t-item").removeClass('active');
$this.addClass('active')
var two =<%=ClassifyBar %>;
var two2 =<%=ClassifyBarYear %>;
var pieS1 =<%=S1Pie %>;
var pieS1Year =<%=S1PieYear %>;
var pieS2 =<%=S2Pie %>;
var pieS2Year =<%=S2PieYear %>;
if (value == 2) {
var xArr = two.categories;
var xFontNum = two.xFontNum;
var data = [
{
name: '承包商',
type: 'bar',
stack: '总量',
barWidth: 40,
data: two.series[0].data,
label: { //柱体上显示数值
show: true,//开启显示
position: ['35%', '50%'],//在上方显示
textStyle: {//数值样式
fontSize: '20px',
color: '#363636'
},
formatter: function (params) {
// 当数值为0时返回空字符串,不显示标签
return params.value === 0 ? '' : params.value;
},
},
itemStyle: { normal: { color: 'rgba(255,0,0, 0.5)' } }
},
{
name: '项目部',
type: 'bar',
stack: '总量',
barWidth: 40,
data: two.series[1].data,
label: { //柱体上显示数值
show: true,//开启显示
position: ['35%', '50%'],//在上方显示
textStyle: {//数值样式
fontSize: '20px',
color: '#363636'
},
formatter: function (params) {
// 当数值为0时返回空字符串,不显示标签
return params.value === 0 ? '' : params.value;
},
},
itemStyle: { normal: { color: 'rgba(0,100,0,0.8)' } }
}
];
if (index == 2) {
xArr = two2.categories;
xFontNum = two2.xFontNum;
data = [
{
name: '承包商',
type: 'bar',
stack: '总量',
barWidth: 40,
data: two2.series[0].data,
label: { //柱体上显示数值
show: true,//开启显示
position: ['35%', '50%'],//在上方显示
textStyle: {//数值样式
fontSize: '20px',
color: '#363636'
},
formatter: function (params) {
// 当数值为0时返回空字符串,不显示标签
return params.value === 0 ? '' : params.value;
},
},
itemStyle: { normal: { color: 'rgba(255,0,0, 0.5)' } }
},
{
name: '项目部',
type: 'bar',
stack: '总量',
barWidth: 40,
data: two2.series[1].data,
label: { //柱体上显示数值
show: true,//开启显示
position: ['35%', '50%'],//在上方显示
textStyle: {//数值样式
fontSize: '20px',
color: '#363636'
},
formatter: function (params) {
// 当数值为0时返回空字符串,不显示标签
return params.value === 0 ? '' : params.value;
},
},
itemStyle: { normal: { color: 'rgba(0,100,0,0.8)' } }
}
]
}
category_ClassifyBar('classifyBarChart', xArr, data, xFontNum);
}
if (value == 3) {
var sum = pieS1.stack;
var pieData = pieS1.series[0].pieData;
var legend = pieS1.series[0].dataString;
if (index == 2) {
sum = pieS1Year.stack;
pieData = pieS1Year.series[0].pieData;
legend = pieS1Year.series[0].dataString;
}
category_S1Pie('s1Pie', sum, pieData, legend);
}
if (value == 4) {
var sum = pieS2.stack;
var pieData = pieS2.series[0].pieData;
var legend = pieS2.series[0].dataString;
if (index == 2) {
sum = pieS2Year.stack;
pieData = pieS2Year.series[0].pieData;
legend = pieS2Year.series[0].dataString;
}
category_S2Pie('s2Pie', sum, pieData, legend);
}
})
</script>
</html>