From a5186fa7399fa57c2e515a4bfdc1b47c2bbd23d8 Mon Sep 17 00:00:00 2001
From: hhx <1284857778@qq.com>
Date: Tue, 15 Mar 2022 14:12:29 +0800
Subject: [PATCH] commit
---
.../App/Content/scripts/beijing/app.js | 3 +-
.../App/Content/scripts/beijing/info-point.js | 2 +-
.../Content/scripts/beijing/lat-lng-switch.js | 2 +-
.../App/Content/scripts/beijing/map.js | 14 +-
.../Content/scripts/beijing/realtime-panel.js | 38 ++-
.../Content/scripts/beijing/select-point.js | 2 +-
.../App/Content/scripts/menggu/app.js | 5 +-
.../App/Content/scripts/menggu/map.js | 16 +-
.../Content/scripts/menggu/realtime-panel.js | 40 ++-
.../config-management/index.js | 17 +
.../system-management/org-management/index.js | 9 +
.../statistic-analysis/index.js | 303 ++++++++++--------
.../system-management/user-management/edit.js | 4 +-
.../user-management/index.js | 10 +
.../App/Content/scripts/tiananmen/app.js | 7 +-
.../App/Content/scripts/tiananmen/map.js | 4 +
04.系统编码/App/Content/styles/common.css | 22 +-
04.系统编码/App/Content/styles/index.css | 15 +-
.../Beijing/Controls/RealtimeTabPage.cshtml | 2 +
.../App/Views/Beijing/Index.cshtml | 14 +-
.../Menggu/Controls/RealtimeTabPage.cshtml | 16 +-
04.系统编码/App/Views/Menggu/Index.cshtml | 14 +-
.../App/Views/StatisticAnalysis/Index.cshtml | 8 +-
23 files changed, 369 insertions(+), 198 deletions(-)
diff --git a/04.系统编码/App/Content/scripts/beijing/app.js b/04.系统编码/App/Content/scripts/beijing/app.js
index da2e1d4..36d4e87 100644
--- a/04.系统编码/App/Content/scripts/beijing/app.js
+++ b/04.系统编码/App/Content/scripts/beijing/app.js
@@ -24,7 +24,7 @@
var width = $(window).width();
var height = $(window).height();
- $('.main').width(width - 286);
+ $('.main').width(width - (this.IsShrink ? 0 : 286));
$('.main').height(height - 54);
$('.right').height(height - 54);
@@ -80,6 +80,7 @@
$('.real-btn').removeClass('real-btn-toggle');
$('.shadow').removeClass('shadow-toggle');
}
+ this.Map.CenterMap(39.90, 116.40);
};
};
diff --git a/04.系统编码/App/Content/scripts/beijing/info-point.js b/04.系统编码/App/Content/scripts/beijing/info-point.js
index 5b8f6a7..8dc5649 100644
--- a/04.系统编码/App/Content/scripts/beijing/info-point.js
+++ b/04.系统编码/App/Content/scripts/beijing/info-point.js
@@ -18,7 +18,7 @@
this.HideDialog = function () {
$('#dialog-info-point').hide();
- $('#map').css('cursor', 'grab');
+ $('#map').css('cursor', '-webkit-grab');
this.Parent.isMark = false;
};
diff --git a/04.系统编码/App/Content/scripts/beijing/lat-lng-switch.js b/04.系统编码/App/Content/scripts/beijing/lat-lng-switch.js
index fdf1dd3..f51ec19 100644
--- a/04.系统编码/App/Content/scripts/beijing/lat-lng-switch.js
+++ b/04.系统编码/App/Content/scripts/beijing/lat-lng-switch.js
@@ -97,7 +97,6 @@
this.onSecondSwitchClick = function () {
var decimal = $('#second-decimal').val();
$('#second-decimal').removeClass('error');
- console.log(decimal.length)
if (decimal.trim() === '' || Number(decimal) > 180 || Number(decimal) < 0) {
this.showError($('#second-decimal'));
@@ -152,6 +151,7 @@
this.HideDialog = function () {
$('#dialog-lat-lng-switch').hide();
+ $('#map').css('cursor', '-webkit-grab');
this.Parent.isSwitch = false;
};
diff --git a/04.系统编码/App/Content/scripts/beijing/map.js b/04.系统编码/App/Content/scripts/beijing/map.js
index 85f987d..384582d 100644
--- a/04.系统编码/App/Content/scripts/beijing/map.js
+++ b/04.系统编码/App/Content/scripts/beijing/map.js
@@ -61,13 +61,13 @@ var Map = function (parent) {
this.lineColor = null;
this.lineWidth = null;
this.currentButton = {
- cursorSelected: true,
- markSelected: true,
- drawLineSelected: true,
- clearSelected: true,
- tagSelected: true,
- switchSelected: true,
- exportSelected: true
+ cursorSelected: false,
+ markSelected: false,
+ drawLineSelected: false,
+ clearSelected: false,
+ tagSelected: false,
+ switchSelected: false,
+ exportSelected: false
};
this.ForecastPoints = null;
diff --git a/04.系统编码/App/Content/scripts/beijing/realtime-panel.js b/04.系统编码/App/Content/scripts/beijing/realtime-panel.js
index 8757cd1..d44c4ea 100644
--- a/04.系统编码/App/Content/scripts/beijing/realtime-panel.js
+++ b/04.系统编码/App/Content/scripts/beijing/realtime-panel.js
@@ -15,6 +15,7 @@
this.Startup = function () {
this.ResultList.Startup();
this.InitReleaseTime();
+ this.InputChange();
this.OnFileOnchange('#param-upload');
this.OnFileOnchange('#file-input');
@@ -309,7 +310,7 @@
this.getLngLatDegree = function (degree, minute, second) {
var str = parseFloat(minute) + parseFloat(second / 60);
var value = parseFloat(str / 60) + parseFloat(degree);
- return value;
+ return value.toFixed(6);
};
this.getLngLatDecimal = function (value) {
@@ -452,11 +453,46 @@
$('#lat-decimal').show();
$('#lng-degrees').hide();
$('#lat-degrees').hide();
+ $('.degree-text').hide();
} else {
$('#lng-decimal').hide();
$('#lat-decimal').hide();
$('#lng-degrees').show();
$('#lat-degrees').show();
+ $('.degree-text').show();
}
};
+
+ this.InputChange = function () {
+ $('#lng-degree').on('change', this.checkInput.bind(this, $('#lng-minute'), $('#lng-second'), 180));
+ $('#lng-minute').on('change', this.checkInput.bind(this, $('#lng-degree'), $('#lng-second'), 60));
+ $('#lng-second').on('change', this.checkInput.bind(this, $('#lng-degree'), $('#lng-minute'), 60));
+
+ $('#lat-degree').on('change', this.checkInput.bind(this, $('#lat-minute'), $('#lng-second'), 180));
+ $('#lat-minute').on('change', this.checkInput.bind(this, $('#lat-degree'), $('#lng-second'), 60));
+ $('#lat-second').on('change', this.checkInput.bind(this, $('#lat-degree'), $('#lng-minute'), 60));
+ };
+
+ this.checkInput = function (value1, value2, maxNumber, event) {
+ $('#lng-degree-text').text('');
+ $('#lng-degree-text').removeClass('degree-text-error');
+ if ($(event.target).val().trim() === '' || value1.val().trim() === '' || value2.val().trim() === '' || $(event.target).val() > maxNumber || $(event.target).val() < 0) {
+ $('#lng-degree-text').text('请输入正确的值。');
+ $('#lng-degree-text').addClass('degree-text-error');
+ return;
+ }
+
+ if ($(event.target).attr('id') === 'lng-degree')
+ $('#lng-degree-text').text(this.getLngLatDegree($(event.target).val(), value1.val(), value2.val()));
+ else if ($(event.target).attr('id') === 'lng-minute')
+ $('#lng-degree-text').text(this.getLngLatDegree(value1.val(), $(event.target).val(), value2.val()));
+ else if ($(event.target).attr('id') === 'lng-second')
+ $('#lng-degree-text').text(this.getLngLatDegree(value1.val(), value2.val(), $(event.target).val()));
+ else if ($(event.target).attr('id') === 'lat-degree')
+ $('#lng-degree-text').text(this.getLngLatDegree($(event.target).val(), value1.val(), value2.val()));
+ else if ($(event.target).attr('id') === 'lat-minute')
+ $('#lng-degree-text').text(this.getLngLatDegree(value1.val(), $(event.target).val(), value2.val()));
+ else if ($(event.target).attr('id') === 'lat-second')
+ $('#lng-degree-text').text(this.getLngLatDegree(value1.val(), value2.val(), $(event.target).val()));
+ }
};
\ No newline at end of file
diff --git a/04.系统编码/App/Content/scripts/beijing/select-point.js b/04.系统编码/App/Content/scripts/beijing/select-point.js
index 7c1fba2..2a49732 100644
--- a/04.系统编码/App/Content/scripts/beijing/select-point.js
+++ b/04.系统编码/App/Content/scripts/beijing/select-point.js
@@ -16,7 +16,7 @@
this.HideDialog = function () {
$('#dialog-select-point').hide();
- $('#map').css('cursor', 'grab');
+ $('#map').css('cursor', '-webkit-grab');
this.Parent.isSelected = false;
};
diff --git a/04.系统编码/App/Content/scripts/menggu/app.js b/04.系统编码/App/Content/scripts/menggu/app.js
index 577d907..3a5dba9 100644
--- a/04.系统编码/App/Content/scripts/menggu/app.js
+++ b/04.系统编码/App/Content/scripts/menggu/app.js
@@ -22,7 +22,7 @@
var width = $(window).width();
var height = $(window).height();
- $('.main').width(width - 280);
+ $('.main').width(width - (this.IsShrink ? 0 : 286));
$('.main').height(height - 54);
$('.right').height(height - 54);
@@ -72,12 +72,13 @@
$('.real-btn').addClass('real-btn-toggle');
$('.shadow').addClass('shadow-toggle');
} else {
- $('.main').width(width - 280);
+ $('.main').width(width - 286);
$('.shrink').removeClass('shrink-toggle');
$('.right').removeClass('right-toggle');
$('.real-btn').removeClass('real-btn-toggle');
$('.shadow').removeClass('shadow-toggle');
}
+ this.Map.CenterMap(40.854662, 111.746303, 7);
}
};
diff --git a/04.系统编码/App/Content/scripts/menggu/map.js b/04.系统编码/App/Content/scripts/menggu/map.js
index 50b5e5c..b4760b6 100644
--- a/04.系统编码/App/Content/scripts/menggu/map.js
+++ b/04.系统编码/App/Content/scripts/menggu/map.js
@@ -29,12 +29,12 @@ var Map = function (parent) {
this.lineColor = null;
this.lineWidth = null;
this.currentButton = {
- cursorSelected: true,
- markSelected: true,
- drawLineSelected: true,
- clearSelected: true,
- tagSelected: true,
- exportSelected: true
+ cursorSelected: false,
+ markSelected: false,
+ drawLineSelected: false,
+ clearSelected: false,
+ tagSelected: false,
+ exportSelected: false
};
this.InfoPoint = new InfoPoint(this);
@@ -78,8 +78,8 @@ var Map = function (parent) {
this.map.on('mousemove', this.OnMapMove.bind(this));
};
- this.CenterMap = function (lat, lng) {
- this.map.setView([lat, lng], 11);
+ this.CenterMap = function (lat, lng, zoom) {
+ this.map.setView([lat, lng], zoom);
};
this.OnMapMove = function (e) {
diff --git a/04.系统编码/App/Content/scripts/menggu/realtime-panel.js b/04.系统编码/App/Content/scripts/menggu/realtime-panel.js
index ac4f7fb..d4fc102 100644
--- a/04.系统编码/App/Content/scripts/menggu/realtime-panel.js
+++ b/04.系统编码/App/Content/scripts/menggu/realtime-panel.js
@@ -8,6 +8,7 @@
this.Startup = function () {
this.ResultList.Startup();
this.InitReleaseTime();
+ this.InputChange();
$('#calc-btn').on('click', this.OnCalcButtonClick.bind(this));
$('#reset-btn').on('click', this.OnResetButtonClick.bind(this));
@@ -236,7 +237,7 @@
this.TaskInfo.Id = taskId;
this.TaskInfo.Result = result;
- this.Parent.Map.CenterMap(lat, lon);
+ this.Parent.Map.CenterMap(lat, lon, 11);
this.AddTask(this.TaskInfo.Id);
this.LoadData(result);
}.bind(this)
@@ -291,7 +292,7 @@
this.getLngLat = function (degree, minute, second) {
var str = parseFloat(minute) + parseFloat(second / 60);
var value = parseFloat(str / 60) + parseFloat(degree);
- return value;
+ return value.toFixed(6);
};
this.OnTypeSelectClick = function (event) {
@@ -303,11 +304,46 @@
$('#lat-decimal').show();
$('#lng-degrees').hide();
$('#lat-degrees').hide();
+ $('.degree-text').hide();
} else {
$('#lng-decimal').hide();
$('#lat-decimal').hide();
$('#lng-degrees').show();
$('#lat-degrees').show();
+ $('.degree-text').show();
}
};
+
+ this.InputChange = function () {
+ $('#lng-degree').on('change', this.checkInput.bind(this, $('#lng-minute'), $('#lng-second'), 180));
+ $('#lng-minute').on('change', this.checkInput.bind(this, $('#lng-degree'), $('#lng-second'), 60));
+ $('#lng-second').on('change', this.checkInput.bind(this, $('#lng-degree'), $('#lng-minute'), 60));
+
+ $('#lat-degree').on('change', this.checkInput.bind(this, $('#lat-minute'), $('#lng-second'), 180));
+ $('#lat-minute').on('change', this.checkInput.bind(this, $('#lat-degree'), $('#lng-second'), 60));
+ $('#lat-second').on('change', this.checkInput.bind(this, $('#lat-degree'), $('#lng-minute'), 60));
+ };
+
+ this.checkInput = function (value1, value2, maxNumber, event) {
+ $('#lng-degree-text').text('');
+ $('#lng-degree-text').removeClass('degree-text-error');
+ if ($(event.target).val().trim() === '' || value1.val().trim() === '' || value2.val().trim() === '' || $(event.target).val() > maxNumber || $(event.target).val() < 0) {
+ $('#lng-degree-text').text('请输入正确的值。');
+ $('#lng-degree-text').addClass('degree-text-error');
+ return;
+ }
+
+ if ($(event.target).attr('id') === 'lng-degree')
+ $('#lng-degree-text').text(this.getLngLat($(event.target).val(), value1.val(), value2.val()));
+ else if ($(event.target).attr('id') === 'lng-minute')
+ $('#lng-degree-text').text(this.getLngLat(value1.val(), $(event.target).val(), value2.val()));
+ else if ($(event.target).attr('id') === 'lng-second')
+ $('#lng-degree-text').text(this.getLngLat(value1.val(), value2.val(), $(event.target).val()));
+ else if ($(event.target).attr('id') === 'lat-degree')
+ $('#lng-degree-text').text(this.getLngLat($(event.target).val(), value1.val(), value2.val()));
+ else if ($(event.target).attr('id') === 'lat-minute')
+ $('#lng-degree-text').text(this.getLngLat(value1.val(), $(event.target).val(), value2.val()));
+ else if ($(event.target).attr('id') === 'lat-second')
+ $('#lng-degree-text').text(this.getLngLat(value1.val(), value2.val(), $(event.target).val()));
+ }
};
\ No newline at end of file
diff --git a/04.系统编码/App/Content/scripts/system-management/config-management/index.js b/04.系统编码/App/Content/scripts/system-management/config-management/index.js
index 211ffff..7225356 100644
--- a/04.系统编码/App/Content/scripts/system-management/config-management/index.js
+++ b/04.系统编码/App/Content/scripts/system-management/config-management/index.js
@@ -8,6 +8,7 @@
this.Startup = function () {
$('#manage').addClass('active');
+ this.RedirectPage();
this.ReLayout();
this.InitDataGrid();
this.ReLoadTableData();
@@ -21,6 +22,14 @@
window.onresize = this.ReLayout.bind(this);
};
+ this.RedirectPage = function () {
+ var user = document.getElementById('user-info');
+ if (user.getAttribute('class') === 'user-login')
+ window.location.href = '/User/Login';
+ else
+ return;
+ };
+
this.ReLayout = function () {
var width = $(window).width();
var height = $(window).height();
@@ -30,6 +39,14 @@
this.formatLastColumn();
};
+ this.RedirectPage = function () {
+ var user = document.getElementById('user-info');
+ if (user.getAttribute('class') === 'user-login')
+ window.location.href = '/User/Login';
+ else
+ return;
+ };
+
this.InitDataGrid = function () {
$('#task-grid').datagrid({
columns: [[
diff --git a/04.系统编码/App/Content/scripts/system-management/org-management/index.js b/04.系统编码/App/Content/scripts/system-management/org-management/index.js
index bd6ee90..032e3b3 100644
--- a/04.系统编码/App/Content/scripts/system-management/org-management/index.js
+++ b/04.系统编码/App/Content/scripts/system-management/org-management/index.js
@@ -7,6 +7,7 @@
this.Startup = function () {
$('#manage').addClass('active');
+ this.RedirectPage();
this.ReLayout();
this.InitDataGrid();
this.ReLoadTableData();
@@ -24,6 +25,14 @@
window.onresize = this.ReLayout.bind(this);
};
+ this.RedirectPage = function () {
+ var user = document.getElementById('user-info');
+ if (user.getAttribute('class') === 'user-login')
+ window.location.href = '/User/Login';
+ else
+ return;
+ };
+
this.ReLayout = function () {
var width = $(window).width();
var height = $(window).height();
diff --git a/04.系统编码/App/Content/scripts/system-management/statistic-analysis/index.js b/04.系统编码/App/Content/scripts/system-management/statistic-analysis/index.js
index 14d1192..cec9b8c 100644
--- a/04.系统编码/App/Content/scripts/system-management/statistic-analysis/index.js
+++ b/04.系统编码/App/Content/scripts/system-management/statistic-analysis/index.js
@@ -5,6 +5,7 @@
this.Startup = function () {
$('#manage').addClass('active');
+ this.RedirectPage();
this.ReLayout();
this.InitDate();
@@ -15,13 +16,20 @@
window.onresize = this.ReLayout.bind(this);
};
+ this.RedirectPage = function () {
+ var user = document.getElementById('user-info');
+ if (user.getAttribute('class') === 'user-login')
+ window.location.href = '/User/Login';
+ else
+ return;
+ };
+
this.ReLayout = function () {
var width = $(window).width();
var height = $(window).height();
$('.manage-table, .manage-table .datagrid').width(width - 247);
$('.manage-table, .manage-table .datagrid').height(height - 109);
- this.formatLastColumn();
};
this.OnStatisticTypeClick = function (event) {
@@ -30,7 +38,6 @@
};
this.OnQueryButtonClick = function () {
- //this.ReLoadTableData();
this.ReloadChartData();
};
@@ -41,12 +48,16 @@
url: '/StatisticAnalysis/Query',
data: this.GetParams(),
success: function (result) {
+ console.log(JSON.parse(result).rows)
+ var rows = JSON.parse(result).rows;
var type = this.GetParams().typeCode === 'user' ? 'column' : 'spline';
var name = this.GetParams().typeCode === 'user' ? '根据用户' : '根据机构';
- var xAxises = this.GetSeries(JSON.parse(result).rows).xAxises;
- var values = this.GetSeries(JSON.parse(result).rows).series;
+ var xAxises = this.GetSeries(rows, name).xAxises;
+ var values = this.GetSeries(rows, name).series;
+ var pieData = this.GetSeries(rows, name).pieData;
var series = this.GetElementSerie(type, name, values);
- this.InitChart(series, xAxises, JSON.parse(result).rows);
+ this.InitChart(series, xAxises, rows, name);
+ this.InitPieChart(pieData, name);
}.bind(this)
});
};
@@ -55,33 +66,59 @@
return {
type: type,
name: name,
- data: values,
- pointWidth: 30
+ data: values
};
};
- this.GetSeries = function (result) {
+ this.GetSeries = function (result, name) {
var series = [];
var xAxises = [];
+ var count = [];
+ var pieData = [];
+
result.forEach(function (item, index) {
- var time = moment(item.LastComputeTime).format("YYYY-MM-DD");
- xAxises.push(time);
+ count.push(item.ComputeCount);
+ }.bind(this));
+
+ result.forEach(function (item, index) {
+ var sum = count.reduce(function (prev, next) {
+ return prev + next;
+ });
+
+ xAxises.push(name === '根据用户' ? item.UserName : item.OrgName);
series.push(item.ComputeCount);
- });
+ pieData.push({
+ name: name === '根据用户' ? item.UserName : item.OrgName,
+ y: this.formatDecimal(String(item.ComputeCount / sum) / 100) * 100
+ })
+ }.bind(this))
return {
series: series,
- xAxises: xAxises
+ xAxises: xAxises,
+ pieData: pieData
};
};
- this.InitChart = function (series, xAxises, values) {
+ this.formatDecimal = function (value) {
+ console.log(value)
+ value = value.toString()
+ let index = value.indexOf('.')
+ if (index !== -1) {
+ value = value.substring(0, 5 + index + 1)
+ } else {
+ value = value.substring(0)
+ }
+ return parseFloat(value).toFixed(5)
+ };
+
+ this.InitChart = function (series, xAxises, values, name) {
Highcharts.chart('chart', {
chart: {
- backgroundColor: '#002145'
+ backgroundColor: '#052a50'
},
title: {
- text: this.GetParams().fromTime + ' 至 ' + this.GetParams().toTime,
+ text: moment(this.GetParams().fromTime).format('YYYY年MM月DD日') + ' 至 ' + moment(this.GetParams().toTime).format('YYYY年MM月DD日') + name.slice(2) + '计算次数',
style: {
color: '#ffffff',
fontFamily: '微软雅黑'
@@ -91,6 +128,7 @@
text: '计算次数',
style: {
color: '#ffffff',
+ fontSize: '14px',
fontFamily: '微软雅黑'
},
verticalAlign: 'top',
@@ -106,10 +144,12 @@
labels: {
style: {
color: '#ffffff',
+ fontSize: '14px',
fontFamily: '微软雅黑'
},
},
- lineColor: '#234979'
+ lineColor: '#234979',
+ crosshair: true
},
yAxis: {
title: {
@@ -118,48 +158,69 @@
labels: {
style: {
color: '#ffffff',
+ fontSize: '14px',
fontFamily: '微软雅黑'
},
},
gridLineColor: '#234979'
},
tooltip: {
+ useHTML: true,
+ crosshair: true,
backgroundColor: '#002145',
- shadow: true,
style: {
color: '#ffffff',
+ fontSize: '14px',
fontFamily: '微软雅黑'
},
formatter: function () {
- return '' + this.x + '' + '
' +
+ return '' + this.x + '' + '
' +
'计算次数:' + '' + this.y + '' + '次' + '
' +
- '计算用户:' + app.GetNames(values, this.x);
+ '最后计算时间:' + app.GetNames(values, this.x, name);
}
},
legend: {
itemStyle: {
color: '#ffffff',
+ fontSize: '14px',
fontFamily: '微软雅黑'
},
+ itemHoverStyle: {
+ color: '#ffffff',
+ fontSize: '14px',
+ fontFamily: '微软雅黑'
+ }
},
plotOptions: {
column: {
+ pointWidth: 30,
+ borderRadius: 3,
borderColor: ''
+ },
+ series: {
+ color: {
+ linearGradient: {
+ x1: 0,
+ y1: 0,
+ x2: 0,
+ y2: 1
+ },
+ stops: [
+ [0, '#266cb9'],
+ [1, '#00d5f6']
+ ]
+ }
}
},
series: [series]
});
};
- this.GetNames = function (values, time) {
- var names = [];
- var result = values.filter(function (item) {
- return moment(item.LastComputeTime).format("YYYY-MM-DD") === time;
- });
- result.forEach(function (item, index) {
- names.push(item.UserName);
- });
- return names.join('、');
+ this.GetNames = function (values, name, type) {
+ var time = values.find(function (item) {
+ return (type === '根据用户' ? item.UserName : item.OrgName) === name;
+ }).LastComputeTime;
+ return moment(time).format('YYYY-MM-DD');
};
this.ReLoadTableData = function () {
@@ -174,6 +235,81 @@
});
};
+ this.InitPieChart = function (series, name) {
+ var firstColors = ['#00d5f6', '#dc9884', '#8c83dc', '#e4e189', '#97e6af', '#7aa9da', '#b7d2ff', '#88f187', '#e3ea79', '#e29f6f'];
+ var lastColors = ['#266cb9', '#bd3d17', '#3324a9', '#b3ae15', '#229625', '#1538e4', '#b7d2ff', '#3ac720', '#cad619', '#d2691f'];
+ var chart = Highcharts.chart('pie-chart', {
+ chart: {
+ backgroundColor: '#052a50',
+ type: 'pie'
+ },
+ title: {
+ text: moment(this.GetParams().fromTime).format('YYYY年MM月DD日') + ' 至 ' + moment(this.GetParams().toTime).format('YYYY年MM月DD日') + name.slice(2) + '统计占比',
+ style: {
+ color: '#ffffff',
+ fontFamily: '微软雅黑'
+ }
+ },
+ credits: {
+ enabled: false
+ },
+ tooltip: {
+ headerFormat: '{point.key}',
+ pointFormat: '{series.name}: {point.percentage:.2f}%',
+ useHTML: true,
+ crosshair: true,
+ backgroundColor: '#002145',
+ style: {
+ color: '#ffffff',
+ fontSize: '14px',
+ fontFamily: '微软雅黑'
+ }
+ },
+ legend: {
+ itemStyle: {
+ color: '#ffffff',
+ fontFamily: '微软雅黑'
+ },
+ itemHoverStyle: {
+ color: '#ffffff',
+ fontSize: '14px',
+ fontFamily: '微软雅黑'
+ }
+ },
+ plotOptions: {
+ pie: {
+ allowPointSelect: true,
+ borderWidth: 0,
+ cursor: 'pointer',
+ dataLabels: {
+ enabled: false
+ },
+ showInLegend: true
+ }
+ },
+ series: [{
+ name: name + '占比',
+ data: series
+ }]
+ },function (chart) {
+ SetGradientColor(chart);
+ });
+ function SetGradientColor(chart) {
+ var pointsList = chart.series[0].points;
+ for (var i = 0; i < pointsList.length; i++) {
+ chart.series[0].points[i].update({
+ color: {
+ linearGradient: { x1: 0, y1: 1, x2: 0, y2: 0 }, //横向渐变效果 如果将x2和y2值交换将会变成纵向渐变效果
+ stops: [
+ [0, Highcharts.Color(firstColors[i]).setOpacity(1).get('rgba')],
+ [1, lastColors[i]]
+ ]
+ }
+ });
+ }
+ }
+ };
+
this.InitDate = function () {
$('#from-date').datebox({
panelAlign: 'right',
@@ -214,91 +350,6 @@
$("#from-date").datebox('setValue', moment().add(-30, 'days').format('YYYY/MM/DD'));
};
- this.InitDataGrid = function () {
- this.statisticGrid.datagrid({
- columns: [[
- { field: 'UserName', title: '姓名', align: 'center', width: 120 },
- { field: 'OrgName', title: '所属机构', align: 'left', width: 180 },
- { field: 'OrgName2', title: '名称', align: 'left', width: 180, hidden: 'true' },
- { field: 'ComputeCount', title: '计算次数', align: 'center', width: 100 },
- { field: 'LastComputeTime', title: '最后计算时间', align: 'center', width: 160, formatter: this.formatTime.bind(this) },
- { field: 'Null', title: '', align: 'left' }
- ]],
- striped: true,
- singleSelect: false,
- fit: true,
- scrollbarSize: 0,
- pagination: true,
- pageNumber: 1,
- pageSize: 50,
- pageList: [10, 20, 50, 100, 150, 200],
- onSelect: this.OnTaskSelected.bind(this),
- onUnselect: this.OnTaskUnselected.bind(this),
- onBeforeLoad: this.OnTableGridBeforeLoad.bind(this),
- onLoadSuccess: function (data) {
- if (data.total === 0) {
- var body = $('.datagrid-body');
- body.addClass('null-data-body');
- body.append('
暂无数据