123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- /*
- 电气火灾数据对接
- */
- //建筑下拉
- getNameList();
- function getNameList(queryParam = {}) {
- ajaxRequest(GET_NAME_LIST_DATA, "POST", queryParam, function(result) {
- let data = result.RESULT;
- let items = '';
- data.forEach(function(item, key) {
- items += `<option value="${item.owner_id}">${item.owner_name}</option>`
- })
- $('#building').html(items);
- }, function(errorMsg) {
- // alert("请求数据失败!");
- }, 2)
- };
- //日期筛选
- layui.use('laydate', function() {
- var laydate = layui.laydate;
- ///年月选择器
- laydate.render({
- elem: '#chooseTime',
- type: 'month',
- max: -30, //7天后
- trigger: 'click', //呼出事件改成click
- done: function(value, date, endDate) {
- setTimeout(function() {
- getListData(getSearchParamObj());
- }, 100)
- }
- });
- });
- //建筑筛选
- $("#building").change(function() {
- setTimeout(function() {
- getListData(getSearchParamObj());
- }, 100)
- });
- // 数据请求传参
- getListData(getSearchParamObj());
- function getListData(queryParam = {}) {
- ajaxRequest(ELE_FIRE_DATA, "POST", queryParam, function(result) {
- if (result.totalCount != 0) {
- /*
- 主页面数据对接 start
- */
- //数据统计
- var data_statistics = result.RESULT[0].data_statistics;
- $('.total').html(data_statistics.alarm_number);
- $('.solved').html(data_statistics.processing_number);
- $('.unsolve').html(data_statistics.unprocessed_number);
- // 环状饼图定制 (数据统计计算)
- (function() {
- // 实例化对象
- var myChart = echarts.init(document.querySelector(".bar-3d .chart"));
- // 生成扇形的曲面参数方程,用于 series-surface.parametricEquation
- function getParametricEquation(startRatio, endRatio, isSelected, isHovered, k, height) {
- // 计算
- let midRatio = (startRatio + endRatio) / 2;
- let startRadian = startRatio * Math.PI * 2;
- let endRadian = endRatio * Math.PI * 2;
- let midRadian = midRatio * Math.PI * 2;
- // 如果只有一个扇形,则不实现选中效果。
- if (startRatio === 0 && endRatio === 1) {
- isSelected = false;
- }
- // 通过扇形内径/外径的值,换算出辅助参数 k(默认值 1/3)
- k = typeof k !== 'undefined' ? k : 1 / 3;
- // 计算选中效果分别在 x 轴、y 轴方向上的位移(未选中,则位移均为 0)
- let offsetX = isSelected ? Math.cos(midRadian) * 0.1 : 0;
- let offsetY = isSelected ? Math.sin(midRadian) * 0.1 : 0;
- // 计算高亮效果的放大比例(未高亮,则比例为 1)
- let hoverRate = isHovered ? 1.05 : 1;
- // 返回曲面参数方程
- return {
|