New file |
| | |
| | | package com.zy.crm.common.entity; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class UserYear{ |
| | | |
| | | private Integer count; |
| | | |
| | | private Integer year; |
| | | |
| | | private Integer month; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.crm.common.entity.UserYear; |
| | | import com.zy.crm.common.web.BaseController; |
| | | import com.zy.crm.manager.entity.ContractSales; |
| | | import com.zy.crm.manager.entity.Plan; |
| | | import com.zy.crm.manager.entity.PlanType; |
| | | import com.zy.crm.manager.entity.ProcessPermissions; |
| | |
| | | import com.zy.crm.system.entity.User; |
| | | import com.zy.crm.system.service.UserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class BIController extends BaseController { |
| | |
| | | // 传入用户id查询规划单 区分,通过区分出来的规划单类型查询 规划申请单 |
| | | // |
| | | EntityWrapper<Plan> wrapper = new EntityWrapper<>(); |
| | | wrapper.setSqlSelect("user_id"); |
| | | wrapper.eq("settle",2).eq("assistant_host_sign",0).groupBy("user_id"); |
| | | wrapper.setSqlSelect("user_id","director","count(id) count"); |
| | | wrapper.eq("settle",2).eq("assistant_host_sign",0).groupBy("user_id,director"); |
| | | List<Map<String, Object>> maps = planService.selectMaps(wrapper); |
| | | for (Map<String, Object> map : maps) { |
| | | String user_id = map.get("user_id").toString(); |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(user_id); |
| | | if (!Cools.isEmpty(user)) { |
| | | map.put("userId$",String.valueOf(user.getNickname())); |
| | | } |
| | | } |
| | | return R.ok().add(maps); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R getPlanByUser() { |
| | | PlanType planType = new PlanType(); |
| | | planType.setType(1); |
| | | planType.setType(1); |
| | | planType.setType(2); |
| | | planType.setHostId(1L); |
| | | User planLeader = planTypeService.findPlanLeader(planType); |
| | | List<User> users = userService.selectList(new EntityWrapper<User>().eq("dept_id", planLeader.getDeptId())); |
| | | List<ProcessPermissions> processPermissionsList = processPermissionsService.selectList(new EntityWrapper<ProcessPermissions>().eq("process_memo", 101)); |
| | |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | |
| | | for (User user:users){ |
| | | if (user.getUsername().equals("周夏天") || user.getUsername().equals("梁昌民")) { |
| | | continue; |
| | | } |
| | | List<Plan> plans = planService.selctPlanListByDirector(user.getId()); |
| | | String userList = ""; |
| | | for (Plan plan:plans){ |
| | | userList = userList+","+plan.getUserId$(); |
| | | if (plans.indexOf(plan)==plans.size()-1){ |
| | | userList = userList+plan.getUserId$(); |
| | | continue; |
| | | } |
| | | userList = plan.getUserId$() +","+ userList; |
| | | } |
| | | int director = planService.selectCount(new EntityWrapper<Plan>().eq("director", user.getId())); |
| | | |
| | |
| | | map.put("anfme", director); |
| | | result.add(map); |
| | | } |
| | | return R.ok().add(result); |
| | | } |
| | | |
| | | // List<PlanType> planTypes = planTypeService.selectList(new EntityWrapper<PlanType>().eq("type", "1").eq("host_id",1)); |
| | | // for (PlanType planType2:planTypes){ |
| | | // |
| | | // } |
| | | |
| | | // 传入用户id查询规划单 区分,通过区分出来的规划单类型查询 规划申请单 |
| | | // |
| | | @RequestMapping(value = "/pending/sum/auth") |
| | | @ManagerAuth |
| | | public R getAllPlan() { |
| | | EntityWrapper<Plan> wrapper = new EntityWrapper<>(); |
| | | wrapper.setSqlSelect("user_id"); |
| | | wrapper.eq("settle",2).eq("assistant_host_sign",0).groupBy("user_id"); |
| | | wrapper.setSqlSelect("count(0) count","MONTH(create_time) month"); |
| | | wrapper.groupBy("MONTH(create_time)"); |
| | | List<Map<String, Object>> maps = planService.selectMaps(wrapper); |
| | | return R.ok().add(maps); |
| | | } |
| | | |
| | | @RequestMapping(value = "/user/sumyear/auth") |
| | | @ManagerAuth |
| | | public R getUserYear() { |
| | | PlanType planType = new PlanType(); |
| | | planType.setType(2); |
| | | planType.setHostId(1L); |
| | | User planLeader = planTypeService.findPlanLeader(planType); |
| | | List<User> users = userService.selectList(new EntityWrapper<User>().eq("dept_id", planLeader.getDeptId())); |
| | | List<Map<String, Object>> maps = new ArrayList<>(); |
| | | for (User user : users) { |
| | | if (user.getUsername().equals("周夏天") || user.getUsername().equals("梁昌民")) { |
| | | continue; |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("user", user); |
| | | map.put("obj", planService.selectUserYear(user.getId())); |
| | | maps.add(map); |
| | | } |
| | | return R.ok().add(maps); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.zy.crm.common.entity.UserYear; |
| | | import com.zy.crm.manager.entity.Plan; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | @Repository |
| | |
| | | |
| | | List<Plan> selctPlanListByDirector(Long userId); |
| | | |
| | | List<Plan> getApproval(Integer settle, Integer assistantHostSign); |
| | | |
| | | List<Object> selectMonth(); |
| | | |
| | | List<UserYear> selectUserYear(Long userId); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.crm.common.entity.UserYear; |
| | | import com.zy.crm.manager.entity.Plan; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface PlanService extends IService<Plan> { |
| | | |
| | |
| | | |
| | | List<Plan> selctPlanListByDirector(Long userId); |
| | | |
| | | List<Plan> getApproval(Integer settle, Integer assistantHostSign); |
| | | |
| | | List<Object> selectMonth(); |
| | | |
| | | List<UserYear> selectUserYear(Long userId); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.core.common.Cools; |
| | | import com.zy.crm.common.entity.UserYear; |
| | | import com.zy.crm.manager.entity.CompanyMoney; |
| | | import com.zy.crm.manager.entity.Plan; |
| | | import com.zy.crm.manager.mapper.PlanMapper; |
| | | import com.zy.crm.manager.service.PlanService; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service("planService") |
| | | public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements PlanService { |
| | |
| | | return this.baseMapper.selctPlanListByDirector(userId); |
| | | } |
| | | |
| | | @Override |
| | | public List<Plan> getApproval(Integer settle, Integer assistantHostSign){ |
| | | return this.baseMapper.getApproval(settle,assistantHostSign); |
| | | } |
| | | |
| | | @Override |
| | | public List<Object> selectMonth(){ |
| | | return this.baseMapper.selectMonth(); |
| | | } |
| | | |
| | | @Override |
| | | public List<UserYear> selectUserYear(Long user){ |
| | | return this.baseMapper.selectUserYear(user); |
| | | } |
| | | |
| | | } |
| | |
| | | and settle < settle_size |
| | | </select> |
| | | |
| | | <select id="selctPlanListByDirector" resultType="java.lang.Integer"> |
| | | <select id="selctPlanListByDirector" resultMap="BaseResultMap"> |
| | | select DISTINCT user_id from man_plan |
| | | where 1=1 |
| | | and director = #{director} |
| | | </select> |
| | | |
| | | <select id="getApproval" resultMap="BaseResultMap"> |
| | | SELECT user_id,status2,host_id,director,dept_id,plan_type,order_id,COUNT(*) num |
| | | FROM man_plan |
| | | WHERE settle = #{settle} AND assistant_host_sign = #{assistantHostSign} |
| | | GROUP BY user_id,status2,host_id,director,dept_id,plan_type,order_id |
| | | </select> |
| | | |
| | | <select id="selectMonth" resultMap="BaseResultMap"> |
| | | SELECT count(0) as count, MONTH(create_time) as month FROM man_plan |
| | | where 1=1 |
| | | group by MONTH(create_time) |
| | | </select> |
| | | |
| | | <select id="selectUserYear" resultType="com.zy.crm.common.entity.UserYear"> |
| | | select COUNT(1) as count,YEAR(p.create_time) as year |
| | | from (select DISTINCT m.plan_id,m.user_id from man_plan_foll as m where m.user_id = #{userId}) as f |
| | | LEFT JOIN man_plan as p on (f.plan_id = p.id) |
| | | where f.user_id = #{userId} |
| | | group by YEAR(p.create_time) |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | border-radius: 15%; |
| | | background-color: #4acc96; |
| | | } |
| | | #innder { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | font-size: 1.5rem; |
| | | font-family: electronicFont; |
| | | color: orange; |
| | | } |
| | |
| | | |
| | | $(function () { |
| | | $(function () { |
| | | echarts_1(); |
| | | echarts_4(); |
| | | //echarts_4(); |
| | | |
| | | function echarts_1() { |
| | | // 基于准备好的dom,初始化echarts实例 |
| | | var myChart = echarts.init(document.getElementById('echart1')); |
| | |
| | | myChart.resize(); |
| | | }); |
| | | } |
| | | |
| | | function echarts_2() { |
| | | // 基于准备好的dom,初始化echarts实例 |
| | | var myChart = echarts.init(document.getElementById('echart2')); |
| | |
| | | myChart.resize(); |
| | | }); |
| | | } |
| | | |
| | | function echarts_5() { |
| | | // 基于准备好的dom,初始化echarts实例 |
| | | var myChart = echarts.init(document.getElementById('echart5')); |
| | |
| | | }, |
| | | legend: { |
| | | top:'0%', |
| | | data:['安卓','IOS'], |
| | | data: ['规划量'], |
| | | textStyle: { |
| | | color: 'rgba(255,255,255,.5)', |
| | | fontSize:'12', |
| | |
| | | offset: 20, |
| | | |
| | | |
| | | |
| | | }], |
| | | |
| | | yAxis: [{ |
| | |
| | | }], |
| | | series: [ |
| | | { |
| | | name: '安卓', |
| | | type: 'line', |
| | | smooth: true, |
| | | symbol: 'circle', |
| | | symbolSize: 5, |
| | | showSymbol: false, |
| | | lineStyle: { |
| | | |
| | | normal: { |
| | | color: '#0184d5', |
| | | width: 2 |
| | | } |
| | | }, |
| | | areaStyle: { |
| | | normal: { |
| | | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ |
| | | offset: 0, |
| | | color: 'rgba(1, 132, 213, 0.4)' |
| | | }, { |
| | | offset: 0.8, |
| | | color: 'rgba(1, 132, 213, 0.1)' |
| | | }], false), |
| | | shadowColor: 'rgba(0, 0, 0, 0.1)', |
| | | } |
| | | }, |
| | | itemStyle: { |
| | | normal: { |
| | | color: '#0184d5', |
| | | borderColor: 'rgba(221, 220, 107, .1)', |
| | | borderWidth: 12 |
| | | } |
| | | }, |
| | | data: [3, 4, 3, 4, 3, 4, 3, 6, 2, 4, 2, 4,3, 4, 3, 4, 3, 4, 3, 6, 2, 4, 2, 4] |
| | | |
| | | }, |
| | | { |
| | | name: 'IOS', |
| | | name: '规划量', |
| | | type: 'line', |
| | | smooth: true, |
| | | symbol: 'circle', |
| | |
| | | borderWidth: 12 |
| | | } |
| | | }, |
| | | data: [5, 3, 5, 6, 1, 5, 3, 5, 6, 4, 6, 4, 8, 3, 5, 6, 1, 5, 3, 7, 2, 5, 1, 4] |
| | | data: [1,2,3,4,5,6,7,8,9,10,11,12] |
| | | |
| | | }, |
| | | |
| | |
| | | myChart.resize(); |
| | | }); |
| | | } |
| | | |
| | | function echarts_6() { |
| | | // 基于准备好的dom,初始化echarts实例 |
| | | var myChart = echarts.init(document.getElementById('echart6')); |
| | |
| | | myChart.resize(); |
| | | }); |
| | | } |
| | | |
| | | function echarts_31() { |
| | | // 基于准备好的dom,初始化echarts实例 |
| | | var myChart = echarts.init(document.getElementById('fb1')); |
| | |
| | | myChart.resize(); |
| | | }); |
| | | } |
| | | |
| | | function echarts_32() { |
| | | // 基于准备好的dom,初始化echarts实例 |
| | | var myChart = echarts.init(document.getElementById('fb2')); |
| | |
| | | myChart.resize(); |
| | | }); |
| | | } |
| | | |
| | | function echarts_33() { |
| | | // 基于准备好的dom,初始化echarts实例 |
| | | var myChart = echarts.init(document.getElementById('fb3')); |
| | |
| | | }); |
| | | </script> |
| | | <script type="text/javascript" src="../../static/js/echarts/echarts.min.js"></script> |
| | | <script language="JavaScript" src="../../static/js/BI/js.js"></script> |
| | | <!--<script language="JavaScript" src="../../static/js/BI/js.js"></script>--> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <body> |
| | | <div class="canvas" style="opacity: .2"> |
| | | <iframe frameborder="0" src="./bg-index.html" style="width: 100%; height: 100%"></iframe> |
| | |
| | | <div class="swiper-head-item">审核员:梁昌民</div> |
| | | <div class="swiper-head-item">待审核项目</div> |
| | | </div> |
| | | <div class="swiper"> |
| | | <div class="swiper-wrapper"> |
| | | <div style="display: flex;height: 81%"> |
| | | <!--业务员滚动--> |
| | | <div style="flex: 1;"> |
| | | <div id="swiper1" class="swiper" style="height: 100%;"> |
| | | <div id="box1" class="swiper-wrapper"> |
| | | <div class="swiper-slide"> |
| | | <div class="swiper-item"> |
| | | <div class="swiper-item-item">张双龙</div> |
| | | <div class="swiper-item-item">1</div> |
| | | <div class="swiper-item-item"> |
| | | <span class="swiper-item-lable">20</span> |
| | | <div class="swiper-item" style=""> |
| | | <div class="swiper-item-item">${k.userId$}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="swiper-slide"> |
| | | <div class="swiper-item"> |
| | | <div class="swiper-item-item">张双龙</div> |
| | | <div class="swiper-item-item">1</div> |
| | | <div class="swiper-item-item"> |
| | | <span class="swiper-item-lable">20</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="swiper-slide"> |
| | | <div class="swiper-item"> |
| | | <div class="swiper-item-item">张双龙</div> |
| | | <div class="swiper-item-item">1</div> |
| | | <div class="swiper-item-item"> |
| | | <span class="swiper-item-lable">20</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="swiper-slide"> |
| | | <div class="swiper-item"> |
| | | <div class="swiper-item-item">张双龙</div> |
| | | <div class="swiper-item-item">1</div> |
| | | <div class="swiper-item-item"> |
| | | <span class="swiper-item-lable">20</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="swiper-slide"> |
| | | <div class="swiper-item"> |
| | | <div class="swiper-item-item">张双龙</div> |
| | | <div class="swiper-item-item">1</div> |
| | | <div class="swiper-item-item"> |
| | | <span class="swiper-item-lable">20</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="swiper-slide"> |
| | | <div class="swiper-item"> |
| | | <div class="swiper-item-item">张双龙</div> |
| | | <div class="swiper-item-item">1</div> |
| | | <div class="swiper-item-item"> |
| | | <span class="swiper-item-lable">20</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="swiper-slide"> |
| | | <div class="swiper-item"> |
| | | <div class="swiper-item-item">张双龙</div> |
| | | <div class="swiper-item-item">1</div> |
| | | <div class="swiper-item-item"> |
| | | <span class="swiper-item-lable">20</span> |
| | | </div> |
| | | </div> |
| | | <!--中间区域--> |
| | | <div style="flex: 1;" ></div> |
| | | <!--<div></div>--> |
| | | <!--待审核项目总数--> |
| | | <div style="flex: 1;" id="innder">3</div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | |
| | | <div class="boxfoot"></div> |
| | | </div> |
| | | <div class="boxall" style="width: 49.7%;height: 3.2rem"> |
| | | <div class="alltitle">待规划项目</div> |
| | | <div class="swiper-head"> |
| | | <div class="swiper-head-item">规划员</div> |
| | | <div class="swiper-head-item" id="planId">规划员</div> |
| | | <div class="swiper-head-item">规划中业务员</div> |
| | | <div class="swiper-head-item">待规划总数</div> |
| | | </div> |
| | | <div class="swiper"> |
| | | <div class="swiper-wrapper"> |
| | | <div class="swiper-slide"> |
| | | <div class="swiper-item"> |
| | | <div class="swiper-item-item">史喜超</div> |
| | | <div class="swiper-item-item">张卢,张双龙,刘青</div> |
| | | <div class="swiper-item-item"> |
| | | <span class="swiper-item-lable">5</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div id="swiper2" class="swiper"> |
| | | <div id="box2" class="swiper-wrapper"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="boxfoot"></div> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="back"></div> |
| | | |
| | | |
| | | <script type="text/javascript" src="../../static/js/BI/china.js"></script> |
| | | <!--<script type="text/javascript" src="../../static/js/BI/area_echarts.js"></script>--> |
| | | <script src="../../static/swiper/swiper-bundle.min.js"></script> |
| | | <script> |
| | | var mySwiper = new Swiper('.swiper', { |
| | | setTimeout(()=>{ |
| | | getPendingApproval() |
| | | getPendingUser() |
| | | getAllPlan() |
| | | getSumyear() |
| | | },0) |
| | | /* |
| | | * 待审核项目 |
| | | * */ |
| | | let getPendingApproval = function() { |
| | | $.ajax({ |
| | | url: baseUrl + "/pending/approval/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success(res){ |
| | | console.log(res) |
| | | let newList = '', count = 0; |
| | | for (let k of res.data) { |
| | | let list = `<div class="swiper-slide"> |
| | | <div class="swiper-item" > |
| | | <div class="swiper-item-item">${k.userId$}</div> |
| | | </div> |
| | | </div>` |
| | | newList = newList + list |
| | | count = count + k.count |
| | | } |
| | | $("#box1").html(newList) |
| | | $("#innder").html(count) |
| | | runder() |
| | | } |
| | | }) |
| | | } |
| | | /* |
| | | * 待规划项目 |
| | | * */ |
| | | let getPendingUser = function() { |
| | | $.ajax({ |
| | | url: baseUrl + "/pending/user/approval/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success(res){ |
| | | //console.log(res) |
| | | let newList = '' |
| | | let len = res.data.length |
| | | for (let k of res.data) { |
| | | let list = `<div class="swiper-slide"> |
| | | <div class="swiper-item" style="border-bottom: 1px solid #dedede"> |
| | | <div class="swiper-item-item">${k.user}</div> |
| | | <div class="swiper-item-item">${k.value}</div> |
| | | <div class="swiper-item-item"> |
| | | <span class="swiper-item-lable">${k.anfme}</span> |
| | | </div> |
| | | </div> |
| | | </div>` |
| | | newList = newList + list |
| | | } |
| | | $("#box2").html(newList) |
| | | $("#planId").html(`规划员(${len})人`) |
| | | runder2() |
| | | } |
| | | }) |
| | | } |
| | | function runder() { |
| | | var mySwiper = new Swiper('#swiper1', { |
| | | direction: 'vertical', |
| | | grabCursor: true, |
| | | loop: true, |
| | |
| | | delay: 3000,//1秒切换一次 |
| | | }, |
| | | }) |
| | | setTimeout(()=>{ |
| | | getPending() |
| | | },1000) |
| | | let getPending = function() { |
| | | } |
| | | function runder2() { |
| | | var mySwiper = new Swiper('#swiper2', { |
| | | direction: 'vertical', |
| | | grabCursor: true, |
| | | loop: true, |
| | | slidesPerView: 5, |
| | | slidesPerGroup: 1, |
| | | loopedSlides: 5, |
| | | speed: 1000, |
| | | autoplay: { |
| | | delay: 3000,//1秒切换一次 |
| | | }, |
| | | }) |
| | | } |
| | | let getAllPlan = function() { |
| | | $.ajax({ |
| | | url: baseUrl + "/pending/approval/auth", |
| | | url: baseUrl + "/pending/sum/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success(res){ |
| | | let monthData = [] |
| | | let flag = false |
| | | for (let i = 1; i <= 12; i++) { |
| | | let data = null |
| | | for (let k of res.data) { |
| | | if (k.month == i) { |
| | | data = k.count |
| | | flag = true |
| | | break |
| | | } else { |
| | | flag = false |
| | | } |
| | | } |
| | | if (flag) { |
| | | monthData.push(data) |
| | | } else { |
| | | monthData.push(0) |
| | | } |
| | | } |
| | | option.series[0].data = monthData |
| | | myChart.setOption(option); |
| | | myChart.resize(); |
| | | } |
| | | }) |
| | | } |
| | | var myChart = echarts.init(document.getElementById('echart4')); |
| | | |
| | | option = { |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | lineStyle: { |
| | | color: '#dddc6b' |
| | | } |
| | | } |
| | | }, |
| | | legend: { |
| | | top: '0%', |
| | | data: ['规划量'], |
| | | textStyle: { |
| | | color: 'rgba(255,255,255,.5)', |
| | | fontSize: '12', |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '10', |
| | | top: '30', |
| | | right: '10', |
| | | bottom: '10', |
| | | containLabel: true |
| | | }, |
| | | |
| | | xAxis: [{ |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | axisLabel: { |
| | | textStyle: { |
| | | color: "rgba(255,255,255,.6)", |
| | | fontSize: 12, |
| | | }, |
| | | }, |
| | | axisLine: { |
| | | lineStyle: { |
| | | color: 'rgba(255,255,255,.2)' |
| | | } |
| | | |
| | | }, |
| | | |
| | | data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], |
| | | |
| | | }, { |
| | | |
| | | axisPointer: {show: false}, |
| | | axisLine: {show: false}, |
| | | position: 'bottom', |
| | | offset: 20, |
| | | |
| | | |
| | | }], |
| | | |
| | | yAxis: [{ |
| | | type: 'value', |
| | | axisTick: {show: false}, |
| | | axisLine: { |
| | | lineStyle: { |
| | | color: 'rgba(255,255,255,.1)' |
| | | } |
| | | }, |
| | | axisLabel: { |
| | | textStyle: { |
| | | color: "rgba(255,255,255,.6)", |
| | | fontSize: 12, |
| | | }, |
| | | }, |
| | | |
| | | splitLine: { |
| | | lineStyle: { |
| | | color: 'rgba(255,255,255,.1)' |
| | | } |
| | | } |
| | | }], |
| | | series: [ |
| | | { |
| | | name: '规划量', |
| | | type: 'line', |
| | | smooth: true, |
| | | symbol: 'circle', |
| | | symbolSize: 5, |
| | | //showSymbol: false, |
| | | label: { |
| | | show: true, |
| | | position: 'top' |
| | | }, |
| | | lineStyle: { |
| | | |
| | | normal: { |
| | | color: '#00d887', |
| | | width: 2 |
| | | } |
| | | }, |
| | | areaStyle: { |
| | | normal: { |
| | | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ |
| | | offset: 0, |
| | | color: 'rgba(0, 216, 135, 0.4)' |
| | | }, { |
| | | offset: 0.8, |
| | | color: 'rgba(0, 216, 135, 0.1)' |
| | | }], false), |
| | | shadowColor: 'rgba(0, 0, 0, 0.1)', |
| | | } |
| | | }, |
| | | itemStyle: { |
| | | normal: { |
| | | color: '#00d887', |
| | | borderColor: 'rgba(221, 220, 107, .1)', |
| | | borderWidth: 12 |
| | | } |
| | | }, |
| | | data: [1,2,3,4,5,6,7,8,9,10,11,12] |
| | | |
| | | }, |
| | | ] |
| | | |
| | | }; |
| | | |
| | | // 使用刚指定的配置项和数据显示图表。 |
| | | |
| | | window.addEventListener("resize", function () { |
| | | myChart.resize(); |
| | | }); |
| | | |
| | | let getSumyear = function() { |
| | | $.ajax({ |
| | | url: baseUrl + "/user/sumyear/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success(res){ |
| | | console.log(res) |
| | | for(let k in res.data) { |
| | | |
| | | let user = [] |
| | | let count = [] |
| | | for (let k of res.data) { |
| | | user.push(k.user.username) |
| | | for (let n of k.obj) { |
| | | if(n.year == 2023) { |
| | | count.push(n.count) |
| | | } |
| | | } |
| | | } |
| | | option2.xAxis[0].data = user |
| | | option2.series[0].data = count |
| | | myChart2.setOption(option2); |
| | | myChart2.resize(); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | var myChart2 = echarts.init(document.getElementById('echart1')); |
| | | option2 = { |
| | | // backgroundColor: '#00265f', |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | type: 'shadow' |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '0%', |
| | | top: '10px', |
| | | right: '0%', |
| | | bottom: '4%', |
| | | containLabel: true |
| | | }, |
| | | xAxis: [{ |
| | | type: 'category', |
| | | data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], |
| | | axisLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | color: "rgba(255,255,255,.1)", |
| | | width: 1, |
| | | type: "solid" |
| | | }, |
| | | }, |
| | | |
| | | axisTick: { |
| | | show: false, |
| | | }, |
| | | axisLabel: { |
| | | interval: 0, |
| | | // rotate:50, |
| | | show: true, |
| | | splitNumber: 15, |
| | | textStyle: { |
| | | color: "rgba(255,255,255,.6)", |
| | | fontSize: '12', |
| | | }, |
| | | }, |
| | | }], |
| | | yAxis: [{ |
| | | type: 'value', |
| | | axisLabel: { |
| | | //formatter: '{value} %' |
| | | show: true, |
| | | textStyle: { |
| | | color: "rgba(255,255,255,.6)", |
| | | fontSize: '12', |
| | | }, |
| | | }, |
| | | axisTick: { |
| | | show: false, |
| | | }, |
| | | axisLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | color: "rgba(255,255,255,.1 )", |
| | | width: 1, |
| | | type: "solid" |
| | | }, |
| | | }, |
| | | splitLine: { |
| | | lineStyle: { |
| | | color: "rgba(255,255,255,.1)", |
| | | } |
| | | } |
| | | }], |
| | | series: [ |
| | | { |
| | | type: 'bar', |
| | | data: [200, 300, 300, 900, 1500, 1200, 600], |
| | | barWidth: '35%', //柱子宽度 |
| | | // barGap: 1, //柱子之间间距 |
| | | itemStyle: { |
| | | normal: { |
| | | color: '#2f89cf', |
| | | opacity: 1, |
| | | barBorderRadius: 5, |
| | | |
| | | } |
| | | }, |
| | | label: { |
| | | show: true, |
| | | position: 'inside' |
| | | }, |
| | | } |
| | | |
| | | ] |
| | | }; |
| | | |
| | | // 使用刚指定的配置项和数据显示图表。 |
| | | window.addEventListener("resize", function () { |
| | | myChart2.resize(); |
| | | }); |
| | | |
| | | </script> |
| | | </body> |
| | | </html> |