|
@@ -93,17 +93,6 @@
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- 统计图表 -->
|
|
|
- <div class="layui-col-md8">
|
|
|
- <div style="padding-top: 20px" class="layui-card">
|
|
|
- <div id="chart1" style="height:400px;"></div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="layui-col-md4">
|
|
|
- <div style="padding-top: 20px" class="layui-card">
|
|
|
- <div id="chart2" style="height:400px"></div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -114,26 +103,10 @@
|
|
|
base: '../../layuiadmin/' //静态资源所在路径
|
|
|
}).extend({
|
|
|
index: 'lib/index', //主入口模块
|
|
|
- }).use(['index', 'home','echarts'], function() {
|
|
|
+ }).use(['index', 'home'], function() {
|
|
|
var $ = layui.$
|
|
|
,admin = layui.admin
|
|
|
- ,echarts = layui.echarts
|
|
|
,xData = [];
|
|
|
- var chart1 = echarts.init($('#chart1')[0]);
|
|
|
- var chart2 = echarts.init($('#chart2')[0]);
|
|
|
- //echarts容器自适应大小
|
|
|
- var setContain = () => {
|
|
|
- var chartDom1 = document.getElementById("chart1");
|
|
|
- var chartDom2 = document.getElementById("chart2");
|
|
|
- var md8Dom = $(".layui-col-md8");
|
|
|
- var md4Dom = $(".layui-col-md4");
|
|
|
- chartDom1.style.width = md8Dom.clientWidth + 'px';
|
|
|
- chartDom1.style.height = md8Dom.clientHeight + 'px';
|
|
|
- chartDom2.style.width = md4Dom.clientWidth + 'px';
|
|
|
- chartDom2.style.height = md4Dom.clientHeight + 'px';
|
|
|
- };
|
|
|
- // 设置echarts的容器大小
|
|
|
- setContain();
|
|
|
|
|
|
admin.req({
|
|
|
url: '/account/statistics/'
|
|
@@ -144,153 +117,6 @@
|
|
|
$('#general_report').html(res.data.general_report);
|
|
|
}
|
|
|
});
|
|
|
- //设置饼图数据
|
|
|
- // admin.req({
|
|
|
- // url: '/tenant/repair_order/statistics/repair_type/'
|
|
|
- // ,type: 'get'
|
|
|
- // , done: function (res) {
|
|
|
- // if(res.data && res.data.length > 0){
|
|
|
- // res.data.forEach(item=>{
|
|
|
- // xData.push(item.name)
|
|
|
- // })
|
|
|
- // }
|
|
|
- // var option2 = {
|
|
|
- // title: {
|
|
|
- // text: '报修类型占比',
|
|
|
- // x: 'center' //标题居中
|
|
|
- // },
|
|
|
- // tooltip: {
|
|
|
- // // trigger: 'item' //悬浮显示对比
|
|
|
- // },
|
|
|
- // legend: {
|
|
|
- // orient: 'vertical', //类型垂直,默认水平
|
|
|
- // x:'left', //可设定图例在左、右、居中
|
|
|
- // y:'top', //可设定图例在上、下、居中
|
|
|
- // padding:[5,0,0,20],
|
|
|
- // data: xData
|
|
|
- // },
|
|
|
- // series: [{
|
|
|
- // type: 'pie', //饼状
|
|
|
- // radius: '60%', //圆的大小
|
|
|
- // center: ['50%', '50%'], //居中
|
|
|
- // data: res.data
|
|
|
- // }]
|
|
|
- // };
|
|
|
- // chart2.setOption(option2);
|
|
|
- // }
|
|
|
- // });
|
|
|
- // 柱状图和折线图
|
|
|
- // admin.req({
|
|
|
- // url: "/tenant/repair_order/statistics/repair_order/"
|
|
|
- // ,type: 'get'
|
|
|
- // , done: function (res) {
|
|
|
- // var option1 = {
|
|
|
- // title: {
|
|
|
- // text: '报修趋势统计',
|
|
|
- // x: 'center',
|
|
|
- // itemGap:20
|
|
|
- // },
|
|
|
- // tooltip: {
|
|
|
- // trigger: 'axis',
|
|
|
- // axisPointer: {
|
|
|
- // type: 'cross',
|
|
|
- // crossStyle: {
|
|
|
- // color: '#999'
|
|
|
- // }
|
|
|
- // }
|
|
|
- // },
|
|
|
- // toolbox: {
|
|
|
- // feature: {
|
|
|
- // dataView: {show: true, readOnly: false},
|
|
|
- // magicType: {show: true, type: ['line', 'bar']},
|
|
|
- // restore: {show: true},
|
|
|
- // saveAsImage: {show: true}
|
|
|
- // }
|
|
|
- // },
|
|
|
- // legend: {
|
|
|
- // data:['报修量','完工量'],
|
|
|
- // padding:[30,0,0,0]
|
|
|
- // },
|
|
|
- // xAxis: [
|
|
|
- // {
|
|
|
- // type: 'category',
|
|
|
- // data: res.data.order_mouth,
|
|
|
- // axisPointer: {
|
|
|
- // type: 'shadow'
|
|
|
- // },
|
|
|
- // axisLine: {
|
|
|
- // lineStyle: {
|
|
|
- // color: '#009688', // 颜色
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // ],
|
|
|
- // yAxis: [
|
|
|
- // {
|
|
|
- // type: 'value',
|
|
|
- // name: '报修量',
|
|
|
- // min: 0,
|
|
|
- // axisLabel: {
|
|
|
- // formatter: '{value} '
|
|
|
- // },
|
|
|
- // axisLine: {
|
|
|
- // lineStyle: {
|
|
|
- // color: '#009688', // 颜色
|
|
|
- // }
|
|
|
- // }
|
|
|
- // },
|
|
|
- // {
|
|
|
- // type: 'value',
|
|
|
- // name: '完工量',
|
|
|
- // min: 0,
|
|
|
- // axisLabel: {
|
|
|
- // formatter: '{value} '
|
|
|
- // },
|
|
|
- // axisLine: {
|
|
|
- // lineStyle: {
|
|
|
- // color: '#009688', // 颜色
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // ],
|
|
|
- // series: [
|
|
|
- // {
|
|
|
- // name:'报修量',
|
|
|
- // type:'bar',
|
|
|
- // itemStyle: {
|
|
|
- // normal: {
|
|
|
- // color: "#FFB800",
|
|
|
- // lineStyle: {
|
|
|
- // color: "#FFB800"
|
|
|
- // }
|
|
|
- // }
|
|
|
- // },
|
|
|
- // data: res.data.repair_counts
|
|
|
- // },
|
|
|
- // {
|
|
|
- // name:'完工量',
|
|
|
- // type:'line',
|
|
|
- // yAxisIndex: 1,
|
|
|
- // itemStyle: {
|
|
|
- // normal: {
|
|
|
- // color: "#1E9FFF",
|
|
|
- // lineStyle: {
|
|
|
- // color: "#1E9FFF"
|
|
|
- // }
|
|
|
- // }
|
|
|
- // },
|
|
|
- // data:res.data.finish_counts
|
|
|
- // }
|
|
|
- // ]
|
|
|
- // };
|
|
|
- // chart1.setOption(option1);
|
|
|
- // }
|
|
|
- // });
|
|
|
- // window.onresize = function () {//用于使chart自适应高度和宽度
|
|
|
- // setContain();//重置容器高宽
|
|
|
- // chart1.resize();
|
|
|
- // chart2.resize();
|
|
|
- // };
|
|
|
})
|
|
|
</script>
|
|
|
</body>
|