Преглед на файлове

waterAnalysisSharingEnginePush water.js 李欣儒 commit at 2020-10-30

李欣儒 преди 4 години
родител
ревизия
8b57b8feb3
променени са 1 файла, в които са добавени 71 реда и са изтрити 0 реда
  1. 71 0
      waterAnalysisSharingEnginePush/externalJs/water.js

+ 71 - 0
waterAnalysisSharingEnginePush/externalJs/water.js

@@ -0,0 +1,71 @@
+//建筑下拉
+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)
+};
+
+// 数据请求传参
+getListData(getSearchParamObj());
+
+function getListData(queryParam = {}) {
+
+    ajaxRequest(WATER_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;
+