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 += ''; + if(index2 === 0){ + html += '' + item.name + ''; + } + html += '' + item2 + ''; + html += ''; + }) + }) + $('#report-box table tbody').empty().append(html); + } } /* 初始化echarts */ function initEcharts(nameList, valueList) { - let fontSize = "16", - fontFamily = "Alibaba PuHuiTi R", - fontColor = "#fff"; - var option = { + let option = { grid: { top: 0, bottom: 0, @@ -38,26 +100,27 @@ function initEcharts(nameList, valueList) { show: false, // orient: 'vertical', // left: 'left', - data: ["直接访问", "邮件营销", "联盟广告", "视频广告", "搜索引擎"], + // data: ["直接访问", "邮件营销", "联盟广告", "视频广告", "搜索引擎"], + data: nameList, }, series: [ { - name: "城市管理(社会治理网格)", + name: "数据应用分析", type: "pie", radius: "65%", center: ["50%", "50%"], label: { show: true, - formatter: "{b} {d}%", }, - data: [ + data: valueList, + /* data: [ { value: 335, name: "直接访问" }, { value: 310, name: "邮件营销" }, { value: 234, name: "联盟广告" }, { value: 135, name: "视频广告" }, { value: 1548, name: "搜索引擎" }, - ], + ], */ }, ], }; diff --git a/pages/dataAnalysis/dataAnalysis.html b/pages/dataAnalysis/dataAnalysis.html index b4f8d1d..93b5ad3 100644 --- a/pages/dataAnalysis/dataAnalysis.html +++ b/pages/dataAnalysis/dataAnalysis.html @@ -33,11 +33,32 @@
  • 环境监测分析
  • 项目管理分析
  • 整体效能分析
  • +
  • 数据分析和报告
  • -
    -
    +
    +
    +
    +
    +
    + +