| | |
| | | .layui-card-header { |
| | | text-align:left; |
| | | } |
| | | |
| | | .layuiadmin-badge { |
| | | float:right; |
| | | margin-top:12px; |
| | | } |
| | | |
| | | .big-font { |
| | | text-align:left; |
| | | font-size: 250%; |
| | |
| | | } |
| | | </style> |
| | | </head> |
| | | |
| | | <body> |
| | | |
| | | <div class="layui-card-body" style="text-align: center;"> |
| | | <div class="layui-row layui-col-space10"> |
| | | <div class="layui-col-sm2 layui-col-md2"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header">在线人数 |
| | | <span class="layui-badge layui-bg-cyan layuiadmin-badge">时</span> |
| | | <div class="layui-card-header">正式医院 |
| | | </div> |
| | | <div class="layui-card-body layuiadmin-card-list"> |
| | | <p class="big-font" id="userCnt"></p> |
| | | <a href="/#!syshospital"> |
| | | <p class="big-font" id="h_hospital">无权查看</p> |
| | | </a> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm2 layui-col-md2"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header">PV |
| | | <span class="layui-badge layui-bg-green layuiadmin-badge">天</span> |
| | | <div class="layui-card-header">产品/套餐总量 |
| | | </div> |
| | | <div class="layui-card-body layuiadmin-card-list"> |
| | | <p class="big-font" id="pv"></p> |
| | | <a href="/#!product"> |
| | | <p class="big-font" id="u_product">无权查看</p> |
| | | </a> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm2 layui-col-md2"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header">UV |
| | | <span class="layui-badge layui-bg-green layuiadmin-badge">天</span> |
| | | <div class="layui-card-header">待审核试用套餐 |
| | | </div> |
| | | <div class="layui-card-body layuiadmin-card-list"> |
| | | <p class="big-font" id="uv"></p> |
| | | <a href="/#!verifyRecharge"> |
| | | <p class="big-font" id="t_product">无权查看</p> |
| | | </a> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3 layui-col-md3"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header">周访问量 |
| | | <span class="layui-badge layui-bg-blue layuiadmin-badge">周</span> |
| | | <div class="layui-card-header">用户反馈 |
| | | </div> |
| | | <div class="layui-card-body layuiadmin-card-list"> |
| | | <p class="big-font" id="weekPv"></p> |
| | | <a href="/#!feedback"> |
| | | <p class="big-font" id="u_feedback">无权查看</p> |
| | | </a> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3 layui-col-md3"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header">月访问量 |
| | | <span class="layui-badge layui-bg-orange layuiadmin-badge">月</span> |
| | | <div class="layui-card-header">数据需求 |
| | | </div> |
| | | <div class="layui-card-body layuiadmin-card-list"> |
| | | <p class="big-font" id="monthPv"></p> |
| | | <a href="/#!dataneed"> |
| | | <p class="big-font" id="d_dataneed">无权查看</p> |
| | | </a> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-row layui-col-space10"> |
| | | <div class="layui-col-sm2 layui-col-md2"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header">H端医生 |
| | | </div> |
| | | <div class="layui-card-body layuiadmin-card-list"> |
| | | <a href="/#!doctor"> |
| | | <p class="big-font" id="h_doctor">无权查看</p> |
| | | </a> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm2 layui-col-md2"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header">C端医生 |
| | | </div> |
| | | <div class="layui-card-body layuiadmin-card-list"> |
| | | <a href="/#!doctor"> |
| | | <p class="big-font" id="c_doctor">无权查看</p> |
| | | </a> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm2 layui-col-md2"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header">待审核医生 |
| | | </div> |
| | | <div class="layui-card-body layuiadmin-card-list"> |
| | | <a href="/#!doctor"> |
| | | <p class="big-font" id="ht_doctor">无权查看</p> |
| | | </a> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3 layui-col-md3"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header">签约医生 |
| | | </div> |
| | | <div class="layui-card-body layuiadmin-card-list"> |
| | | <a href="/#!doctor"> |
| | | <p class="big-font" id="u_signing">无权查看</p> |
| | | </a> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3 layui-col-md3"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header">医答医生 |
| | | </div> |
| | | <div class="layui-card-body layuiadmin-card-list"> |
| | | <a href="/#!doctor"> |
| | | <p class="big-font" id="d_isanswer">无权查看</p> |
| | | </a> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-row layui-col-space10"> |
| | | <div class="layui-col-lg12 layui-col-md12"> |
| | | <div class="layui-card"> |
| | | <div class="card-block"> |
| | | <div id="week-container" style="height:350px"></div> |
| | | <div id="contract" style="height:350px"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> --> |
| | | <div class="layui-row layui-col-space10"> |
| | | <div class="layui-col-lg6 layui-col-md6"> |
| | | <div class="layui-card"> |
| | | <div class="card-block"> |
| | | <div id="browser-container" style="height:300px"></div> |
| | | <div id="products" style="height:300px"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-lg6 layui-col-lg6"> |
| | | <div class="layui-card"> |
| | | <div class="card-block"> |
| | | <div id="operatingSystem-container" style="height:300px"></div> |
| | | <div id="contract" style="height:300px"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | |
| | | <script type="text/javascript"> |
| | | layui.use(['admin'], function () { |
| | | layui.use(['util', 'admin', 'config'], function () { |
| | | let admin = layui.admin; |
| | | |
| | | let browserChart = echarts.init(document.getElementById("browser-container")); |
| | | browserChart.setOption({ |
| | | let config = layui.config; |
| | | let util = layui.util; |
| | | let $ = layui.jquery; |
| | | var counts = 0; |
| | | // 加载医院统计数据 |
| | | var loadHospitalChart = function (datatype) { |
| | | admin.req("api-user/syshospital/chartHospital?datatype=" + datatype, {}, function (data) { |
| | | if (0 === data.code) { |
| | | counts = data.data; |
| | | } |
| | | }, "get"); |
| | | } |
| | | // 加载医生统计数据 |
| | | var loadDoctorChart = function (datatype) { |
| | | admin.req("api-user/sysdoctor/chartDoctor?datatype=" + datatype, {}, function (data) { |
| | | if (0 === data.code) { |
| | | counts = data.data; |
| | | } |
| | | }, "get"); |
| | | } |
| | | // 加载反馈需求审核统计数据 |
| | | var loadOprationChart = function (datatype) { |
| | | admin.req("api-opration/productorderdetail/oprationChart?datatype=" + datatype, {}, |
| | | function (data) { |
| | | if (0 === data.code) { |
| | | counts = data.data; |
| | | } |
| | | }, "get"); |
| | | } |
| | | // 加载合同统计数据 |
| | | var loadProductOrderChart = function (params) { |
| | | admin.req("api-opration/productorderdetail/productOrderChart", params, function (data) { |
| | | if (0 === data.code) { |
| | | counts = data.data; |
| | | } |
| | | }, "get"); |
| | | } |
| | | // 加载套餐使用量统计数据 |
| | | var loadProCountChart = function () { |
| | | admin.req("api-opration/productorderdetail/proCountChart", {}, function (data) { |
| | | if (0 === data.code) { |
| | | return data.data; |
| | | } else { |
| | | return null; |
| | | } |
| | | }, "get"); |
| | | } |
| | | //加载套餐使用图表 |
| | | var loadContractChart = function () { |
| | | var chartcontract = echarts.init(document.getElementById('contract')); |
| | | admin.req("api-opration/productorderdetail/proCountChart", {}, function (data) { |
| | | if (0 === data.code) { |
| | | var listData = data.data; |
| | | var Xdata = new Array(); |
| | | var Ydata = new Array(); |
| | | if (listData != null) { |
| | | for (let index = 0; index < listData.length; index++) { |
| | | Xdata.push(listData[index].units); |
| | | Ydata.push(listData[index].ccount); |
| | | } |
| | | var optionchart = { |
| | | title : { |
| | | text: '浏览器分布', |
| | | subtext: '', |
| | | x:'center' |
| | | text: '套餐使用数量统计(前10个)' |
| | | }, |
| | | tooltip : { |
| | | trigger: 'item', |
| | | formatter: "{a} <br/>{b} : {c} ({d}%)" |
| | | }, |
| | | legend: {}, |
| | | series : [] |
| | | }); |
| | | browserChart.showLoading(); |
| | | |
| | | let osChart = echarts.init(document.getElementById("operatingSystem-container")); |
| | | osChart.setOption({ |
| | | title : { |
| | | text: '系统分布', |
| | | subtext: '', |
| | | x:'center' |
| | | }, |
| | | tooltip : { |
| | | trigger: 'item', |
| | | formatter: "{a} <br/>{b} : {c} ({d}%)" |
| | | }, |
| | | legend: {}, |
| | | series : [] |
| | | }); |
| | | osChart.showLoading(); |
| | | |
| | | let weekChart = echarts.init(document.getElementById("week-container")); |
| | | weekChart.setOption({ |
| | | title: { |
| | | text: '流量趋势' |
| | | }, |
| | | color: ['#3398DB'], |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | type: 'cross', |
| | | label: { |
| | | backgroundColor: '#6a7985' |
| | | } |
| | | axisPointer: { // 坐标轴指示器,坐标轴触发有效 |
| | | type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' |
| | | } |
| | | }, |
| | | legend: { |
| | | data: ['访问量(PV)', '独立用户(UV)'] |
| | | }, |
| | | xAxis: [ |
| | | { |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: [] |
| | | } |
| | | ], |
| | | yAxis: [ |
| | | { |
| | | data: Xdata |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | } |
| | | ], |
| | | series: [] |
| | | }); |
| | | weekChart.showLoading(); |
| | | |
| | | admin.req('api-log/requestStat', {}, function (data) { |
| | | $('#pv').html(data.currDate_pv); |
| | | $('#uv').html(data.currDate_uv); |
| | | $('#weekPv').html(data.currWeek_pv); |
| | | $('#monthPv').html(data.currMonth_pv); |
| | | $('#userCnt').html(data.currHour_uv); |
| | | |
| | | browserChart.hideLoading() |
| | | browserChart.setOption({ |
| | | legend: { |
| | | orient: 'vertical', |
| | | left: 'left', |
| | | data: data.browser_legendData |
| | | }, |
| | | series : [ |
| | | { |
| | | name: '浏览器', |
| | | type: 'pie', |
| | | radius : '55%', |
| | | center: ['50%', '60%'], |
| | | data: data.browser_datas, |
| | | itemStyle: { |
| | | emphasis: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | series: [{ |
| | | name: '使用数量', |
| | | data: Ydata, |
| | | type: 'bar', |
| | | barWidth: '10%', |
| | | showBackground: true |
| | | }] |
| | | }; |
| | | chartcontract.setOption(optionchart, true); |
| | | } |
| | | } |
| | | }, "get"); |
| | | } |
| | | ] |
| | | }); |
| | | |
| | | osChart.hideLoading() |
| | | osChart.setOption({ |
| | | legend: { |
| | | orient: 'vertical', |
| | | left: 'left', |
| | | data: data.operatingSystem_legendData |
| | | //加载合同图表 |
| | | var loadProductChart = function () { |
| | | var chartproducts = echarts.init(document.getElementById('products')); |
| | | admin.req("api-opration/productorderdetail/productOrderChart", { |
| | | datatype: 1, |
| | | startTime: "", |
| | | endTime: "" |
| | | }, function (data) { |
| | | if (0 === data.code) { |
| | | var listData = data.data; |
| | | var Xdata = new Array(); |
| | | var Ydata = new Array(); |
| | | if (listData != null) { |
| | | for (let index = 0; index < listData.length; index++) { |
| | | Xdata.push(listData[index].units); |
| | | Ydata.push(listData[index].ccount); |
| | | } |
| | | var optionchart = { |
| | | title: { |
| | | text: '合同签订统计' |
| | | }, |
| | | series : [ |
| | | { |
| | | name: '操作系统', |
| | | type: 'pie', |
| | | radius : '55%', |
| | | center: ['50%', '60%'], |
| | | data: data.operatingSystem_datas, |
| | | itemStyle: { |
| | | emphasis: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | color: ['#3398DB'], |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | axisPointer: { // 坐标轴指示器,坐标轴触发有效 |
| | | type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }); |
| | | |
| | | weekChart.hideLoading() |
| | | weekChart.setOption({ |
| | | xAxis: [ |
| | | { |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: data.statWeek_items |
| | | } |
| | | ], |
| | | series: [ |
| | | { |
| | | name: '访问量(PV)', |
| | | type: 'line', |
| | | areaStyle: {}, |
| | | label: { |
| | | normal: { |
| | | show: true, |
| | | position: 'top' |
| | | } |
| | | data: Xdata |
| | | }, |
| | | data: data.statWeek_pv |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | { |
| | | name: '独立用户(UV)', |
| | | type: 'line', |
| | | areaStyle: {}, |
| | | data: data.statWeek_uv |
| | | series: [{ |
| | | name: '合同数量', |
| | | data: Ydata, |
| | | type: 'bar', |
| | | barWidth: '10%', |
| | | showBackground: true |
| | | }] |
| | | }; |
| | | chartproducts.setOption(optionchart, true); |
| | | } |
| | | ] |
| | | }); |
| | | }, 'GET'); |
| | | } |
| | | }, "get"); |
| | | } |
| | | |
| | | //先拿到当前登录用户的信息 |
| | | var nowUser = config.getUser(); |
| | | if (!strUtil.isEmpty(nowUser)) { |
| | | var userRole = nowUser.roles; |
| | | for (let index = 0; index < userRole.length; index++) { |
| | | const element = userRole[index]; |
| | | if (element.code == "admin" || |
| | | element.code == "dev_admin" || |
| | | element.code == "pc_admin" || |
| | | element.code == "oprationmanager" || |
| | | element.code == "dev_user" || |
| | | element.code == "shop_admin" || |
| | | element.code == "app_admin") { |
| | | //正式医院 |
| | | loadHospitalChart(0); |
| | | $("#h_hospital").html(counts); |
| | | //产品/套餐总量 |
| | | loadOprationChart(1); |
| | | $("#u_product").html(counts); |
| | | //待审核试用套餐 |
| | | loadOprationChart(0); |
| | | $("#t_product").html(counts); |
| | | //用户反馈 |
| | | loadOprationChart(2); |
| | | $("#u_feedback").html(counts); |
| | | //数据需求 |
| | | loadOprationChart(2); |
| | | $("#d_dataneed").html(counts); |
| | | |
| | | //H端医生 |
| | | loadDoctorChart(4); |
| | | $("#h_doctor").html(counts); |
| | | //C端医生 |
| | | loadDoctorChart(3); |
| | | $("#c_doctor").html(counts); |
| | | //签约医生 |
| | | loadDoctorChart(1); |
| | | $("#u_signing").html(counts); |
| | | //医答医生 |
| | | loadDoctorChart(2); |
| | | $("#d_isanswer").html(counts); |
| | | //待审核医生 |
| | | loadDoctorChart(5); |
| | | $("#ht_doctor").html(counts); |
| | | loadContractChart(); |
| | | loadProductChart(); |
| | | } else if (element.code == "opration") { |
| | | //正式医院 |
| | | loadHospitalChart(0); |
| | | $("#h_hospital").html(counts); |
| | | //用户反馈 |
| | | loadOprationChart(2); |
| | | $("#u_feedback").html(counts); |
| | | //数据需求 |
| | | loadOprationChart(2); |
| | | $("#d_dataneed").html(counts); |
| | | //H端医生 |
| | | loadDoctorChart(4); |
| | | $("#h_doctor").html(counts); |
| | | //C端医生 |
| | | loadDoctorChart(3); |
| | | $("#c_doctor").html(counts); |
| | | //签约医生 |
| | | loadDoctorChart(1); |
| | | $("#u_signing").html(counts); |
| | | //医答医生 |
| | | loadDoctorChart(2); |
| | | $("#d_isanswer").html(counts); |
| | | //待审核医生 |
| | | loadDoctorChart(5); |
| | | $("#ht_doctor").html(counts); |
| | | loadProductChart(); |
| | | } else if (element.code == "sale") { |
| | | //正式医院 |
| | | loadHospitalChart(0); |
| | | $("#h_hospital").html(counts); |
| | | //正式医院 |
| | | loadHospitalChart(0); |
| | | $("#h_hospital").html(counts); |
| | | //用户反馈 |
| | | loadOprationChart(2); |
| | | $("#u_feedback").html(counts); |
| | | //数据需求 |
| | | loadOprationChart(2); |
| | | $("#d_dataneed").html(counts); |
| | | //H端医生 |
| | | loadDoctorChart(4); |
| | | $("#h_doctor").html(counts); |
| | | //C端医生 |
| | | loadDoctorChart(3); |
| | | $("#c_doctor").html(counts); |
| | | //待审核医生 |
| | | loadDoctorChart(5); |
| | | $("#ht_doctor").html(counts); |
| | | //签约医生 |
| | | loadDoctorChart(1); |
| | | $("#u_signing").html(counts); |
| | | //医答医生 |
| | | loadDoctorChart(2); |
| | | loadContractChart(); |
| | | loadProductChart(); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | </script> |
| | | </body> |
| | | |
| | | </html> |