diff --git a/css/dataAnalysis/dataAnalysis.css b/css/dataAnalysis/dataAnalysis.css index f01b73d..8fa2c36 100644 --- a/css/dataAnalysis/dataAnalysis.css +++ b/css/dataAnalysis/dataAnalysis.css @@ -30,10 +30,21 @@ body { #right-box { width: 75.85%; height: 99%; - background: url(../../img/alarmMge/alarm.png) no-repeat 0 0 / 100% 100%; + background: url(../../img/alarmMge/dataAnalysis.png) no-repeat 0 0 / 100% 100%; box-sizing: border-box; } +#echarts-box { + width: 100%; + height: 100%; +} + +#report-box { + width: 35%; + height: 90%; + overflow-y: auto; +} + #one-echarts { width: 100%; height: 100%; @@ -61,4 +72,51 @@ body { .nocheck { background: url(../../img/alarmMge/dark.png) no-repeat 0 0 / 100% 100%; -} \ No newline at end of file +} + +#report-box table { + width: 96%; + height: 100%; + margin: 0 2%; + table-layout: fixed; + text-align: center; + border-collapse: collapse; + border-spacing: 0; + box-sizing: border-box; +} + +#report-box table tr td { + width: 50%; + height: 50px; + font-size: 16px; + border: 1px solid #34b9aa; +} +#report-box table thead{ + height: 100px; +} +#report-box table tbody{ + height: calc(100% - 100px); + overflow-y: auto; +} + +::-webkit-scrollbar +{ + width: 6px; + height: 6px; +} +::-webkit-scrollbar-track-piece +{ + background-color: #0d2225; + -webkit-border-radius: 6px; +} +::-webkit-scrollbar-thumb:vertical +{ + height: 5px; + background-color: #0d2225; + -webkit-border-radius: 6px; +} +::-webkit-scrollbar-thumb:horizontal +{ + width: 5px; + background-color: #0d2225; + -webkit-border-radius: 6px; diff --git a/img/alarmMge/dataAnalysis.png b/img/alarmMge/dataAnalysis.png new file mode 100644 index 0000000..a6ee835 Binary files /dev/null and b/img/alarmMge/dataAnalysis.png differ diff --git a/js/pages/dataAnalysis/dataAnalysis.js b/js/pages/dataAnalysis/dataAnalysis.js index 30de7d8..d59f71b 100644 --- a/js/pages/dataAnalysis/dataAnalysis.js +++ b/js/pages/dataAnalysis/dataAnalysis.js @@ -1,5 +1,11 @@ let myChart = echarts.init(document.getElementById("one-echarts")); -initEcharts(); +initData(); +function initData(){ + const bidCode = parent.$('#bidPro').val(); + const paramData = 'bidCode=' + bidCode + '&type=' + '1'; + let montageParam = aqEnnable ? encryptCBC(paramData) : ' &' + encryptCBC(paramData); + loadDataAnalysis(montageParam,1); +} /* 切换数据 */ function changeData(that, type) { @@ -9,17 +15,73 @@ function changeData(that, type) { } }); $(that).removeClass("nocheck").addClass("check"); + if(type !== 10){ + $('#report-box').css('display','none'); + $('#echarts-box').css('width','100%'); + }else{ + $('#report-box').removeAttr('style'); + $('#echarts-box').css('width','58%'); + } myChart.dispose(); myChart = echarts.init(document.getElementById("one-echarts")); - initEcharts(); + const bidCode = parent.$('#bidPro').val(); + const paramData = 'bidCode=' + bidCode + '&type=' + type + ''; + let montageParam = aqEnnable ? encryptCBC(paramData) : ' &' + encryptCBC(paramData); + loadDataAnalysis(montageParam,type); +} + +/* 加载数据分析应用 */ +function loadDataAnalysis(montageParam,type) { + const url = commonUrl + 'screen/largeScreen/dataAnalysis/getDataAnalysisByType?params=' + montageParam; + ajaxRequestGet(url, "GET", true, function () { + }, function (result) { + if (result.code === 200) { + setData(result.data); + } else if (result.code === 500) { + console.error('数据分析应用' + result.msg); + } else if (result.code === 401) { + loginout(1); + } + }, function (xhr, status, error) { + errorFn(xhr, status, error) + }, aqEnnable); + + /* 项目风险赋值 */ + function setData(list) { + let nameList = [],valueList = []; + if(list && list.length > 0){ + $.each(list,function(index,item){ + nameList.push(item.name); + valueList.push({value:item.num,name:item.name}); + }) + } + initEcharts(nameList, valueList); + if(type === 10){ + setReportTable(list); + } + } + // 数据分析报告 + function setReportTable(list){ + let html = ''; + $.each(list,function(index,item){ + let typeName = item.typeName; + let typeNameArr = typeName.split(','); + $.each(typeNameArr,function(index2,item2){ + html += '