首页页面及后台
This commit is contained in:
parent
f4f5d393bb
commit
1785db0a5f
|
|
@ -41,7 +41,6 @@ public class HomeController {
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
@PostMapping(value = "getATeamNumForEcharts")
|
@PostMapping(value = "getATeamNumForEcharts")
|
||||||
@DecryptAndVerify(decryptedClass = ToolsManageDto.class)
|
|
||||||
public Map<String,Object> getATeamNumForEcharts(HomeVo vo) {
|
public Map<String,Object> getATeamNumForEcharts(HomeVo vo) {
|
||||||
Map<String,Object> map=new HashMap<>();
|
Map<String,Object> map=new HashMap<>();
|
||||||
try{
|
try{
|
||||||
|
|
@ -52,7 +51,6 @@ public class HomeController {
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
@PostMapping(value = "getATeamCostForEcharts")
|
@PostMapping(value = "getATeamCostForEcharts")
|
||||||
@DecryptAndVerify(decryptedClass = ToolsManageDto.class)
|
|
||||||
public Map<String,Object> getATeamCostForEcharts(HomeVo vo) {
|
public Map<String,Object> getATeamCostForEcharts(HomeVo vo) {
|
||||||
Map<String,Object> map=new HashMap<>();
|
Map<String,Object> map=new HashMap<>();
|
||||||
try{
|
try{
|
||||||
|
|
@ -63,7 +61,6 @@ public class HomeController {
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
@PostMapping(value = "getCostRank")
|
@PostMapping(value = "getCostRank")
|
||||||
@DecryptAndVerify(decryptedClass = ToolsManageDto.class)
|
|
||||||
public Map<String,Object> getCostRank(HomeVo vo) {
|
public Map<String,Object> getCostRank(HomeVo vo) {
|
||||||
Map<String,Object> map=new HashMap<>();
|
Map<String,Object> map=new HashMap<>();
|
||||||
try{
|
try{
|
||||||
|
|
|
||||||
|
|
@ -33,4 +33,6 @@ public interface HomeDao {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<HomeVo> getCostRank(HomeVo vo);
|
List<HomeVo> getCostRank(HomeVo vo);
|
||||||
|
|
||||||
|
List<HomeVo> getTeams(HomeVo vo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @className:ExperDeviceVo
|
* @className:ExperDeviceVo
|
||||||
|
|
@ -16,6 +17,7 @@ import java.util.Date;
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class HomeVo {
|
public class HomeVo {
|
||||||
|
private String id;
|
||||||
/**
|
/**
|
||||||
* 待派工
|
* 待派工
|
||||||
*/
|
*/
|
||||||
|
|
@ -82,4 +84,6 @@ public class HomeVo {
|
||||||
private String cooperateDate;
|
private String cooperateDate;
|
||||||
|
|
||||||
private String updateDate;
|
private String updateDate;
|
||||||
|
private String type;
|
||||||
|
private List<HomeVo> listData;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,13 @@ import com.bonus.aqgqj.basis.dao.ToolsManageDao;
|
||||||
import com.bonus.aqgqj.basis.entity.dto.ToolsManageDto;
|
import com.bonus.aqgqj.basis.entity.dto.ToolsManageDto;
|
||||||
import com.bonus.aqgqj.basis.entity.vo.HomeVo;
|
import com.bonus.aqgqj.basis.entity.vo.HomeVo;
|
||||||
import com.bonus.aqgqj.basis.service.HomeService;
|
import com.bonus.aqgqj.basis.service.HomeService;
|
||||||
|
import com.bonus.aqgqj.utils.DateTimeHelper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.HashMap;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.List;
|
import java.util.*;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 工器具个体管理
|
* @description 工器具个体管理
|
||||||
|
|
@ -28,7 +28,7 @@ public class HomeServiceImpl implements HomeService {
|
||||||
Map<String, Object> map=new HashMap<>();
|
Map<String, Object> map=new HashMap<>();
|
||||||
try{
|
try{
|
||||||
List<HomeVo> list=dao.getApprovalNum(vo);
|
List<HomeVo> list=dao.getApprovalNum(vo);
|
||||||
HomeVo hvo=new HomeVo();
|
HomeVo hvo=list.get(0);
|
||||||
map.put("data",hvo);
|
map.put("data",hvo);
|
||||||
map.put("code","200");
|
map.put("code","200");
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
|
@ -41,9 +41,48 @@ public class HomeServiceImpl implements HomeService {
|
||||||
public Map<String, Object> getATeamNumForEcharts(HomeVo vo) {
|
public Map<String, Object> getATeamNumForEcharts(HomeVo vo) {
|
||||||
Map<String, Object> map=new HashMap<>();
|
Map<String, Object> map=new HashMap<>();
|
||||||
try{
|
try{
|
||||||
List<HomeVo> list=dao.getATeamNumForEcharts(vo);
|
List<String> dates=new ArrayList<>();
|
||||||
HomeVo hvo=new HomeVo();
|
List<HomeVo> teamlist=dao.getTeams(vo);
|
||||||
map.put("data",hvo);
|
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
Date date=new Date();
|
||||||
|
if("1".equals(vo.getType())){
|
||||||
|
Calendar calendar = Calendar.getInstance(); // 获取当前日期和时间
|
||||||
|
for (int i = 1; i <= 14; i++) {
|
||||||
|
calendar.add(Calendar.DAY_OF_MONTH, -1); // 使用add方法减去指定的天数
|
||||||
|
date = calendar.getTime();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
Calendar calendar = Calendar.getInstance(); // 获取当前日期和时间
|
||||||
|
for (int i = 1; i <= 6; i++) {
|
||||||
|
calendar.add(Calendar.DAY_OF_MONTH, -1); // 使用add方法减去指定的天数
|
||||||
|
date = calendar.getTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dates=DateTimeHelper.getDatesBetween(sdf.format(date), sdf.format(new Date()));
|
||||||
|
List<HomeVo> lists=new ArrayList<>();
|
||||||
|
List<HomeVo> listsalls=new ArrayList<>();
|
||||||
|
for(HomeVo teamvo:teamlist){
|
||||||
|
List<HomeVo> list=dao.getATeamNumForEcharts(teamvo);
|
||||||
|
if(list==null||list.size()==0){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
lists=new ArrayList<>();
|
||||||
|
for(String daetr:dates){
|
||||||
|
HomeVo hvod=new HomeVo();
|
||||||
|
hvod.setTeamName(teamvo.getTeamName());
|
||||||
|
hvod.setTestData(daetr);
|
||||||
|
hvod.setTestNum("0");
|
||||||
|
for(HomeVo hvo:list){
|
||||||
|
if(daetr.equals(hvo.getTestData())){
|
||||||
|
hvod.setTestNum(hvo.getTestNum());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lists.add(hvod);
|
||||||
|
}
|
||||||
|
teamvo.setListData(lists);
|
||||||
|
listsalls.add(teamvo);
|
||||||
|
}
|
||||||
|
map.put("data",listsalls);
|
||||||
map.put("code","200");
|
map.put("code","200");
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
@ -56,8 +95,7 @@ public class HomeServiceImpl implements HomeService {
|
||||||
Map<String, Object> map=new HashMap<>();
|
Map<String, Object> map=new HashMap<>();
|
||||||
try{
|
try{
|
||||||
List<HomeVo> list=dao.getATeamCostForEcharts(vo);
|
List<HomeVo> list=dao.getATeamCostForEcharts(vo);
|
||||||
HomeVo hvo=new HomeVo();
|
map.put("data",list);
|
||||||
map.put("data",hvo);
|
|
||||||
map.put("code","200");
|
map.put("code","200");
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
@ -70,8 +108,7 @@ public class HomeServiceImpl implements HomeService {
|
||||||
Map<String, Object> map=new HashMap<>();
|
Map<String, Object> map=new HashMap<>();
|
||||||
try{
|
try{
|
||||||
List<HomeVo> list=dao.getCostRank(vo);
|
List<HomeVo> list=dao.getCostRank(vo);
|
||||||
HomeVo hvo=new HomeVo();
|
map.put("data",list);
|
||||||
map.put("data",hvo);
|
|
||||||
map.put("code","200");
|
map.put("code","200");
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
||||||
|
|
@ -780,4 +780,57 @@ public class DateTimeHelper {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 获取本周周日日期
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getWeekSun(Date date){
|
||||||
|
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
Calendar c = Calendar.getInstance();
|
||||||
|
c.setTime(date);
|
||||||
|
// 如果是周日直接返回
|
||||||
|
if (c.get(Calendar.DAY_OF_WEEK) == 1) {
|
||||||
|
return sdf.format(date);
|
||||||
|
}
|
||||||
|
//System.out.println(c.get(Calendar.DAY_OF_WEEK));
|
||||||
|
c.add(Calendar.DATE, 7 - c.get(Calendar.DAY_OF_WEEK) + 1);
|
||||||
|
return sdf.format(c.getTime());
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取本周周一日期
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getWeekMon(Date date) {
|
||||||
|
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
Calendar c = Calendar.getInstance();
|
||||||
|
c.setTime(date);
|
||||||
|
if (c.get(Calendar.DAY_OF_WEEK) == 1) {
|
||||||
|
c.add(Calendar.DAY_OF_MONTH, -1);
|
||||||
|
}
|
||||||
|
c.add(Calendar.DATE, c.getFirstDayOfWeek() - c.get(Calendar.DAY_OF_WEEK) + 1);
|
||||||
|
return sdf.format(c.getTime());
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*获取两日期间的日期
|
||||||
|
* @param startStr
|
||||||
|
* @param endStr
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<String> getDatesBetween(String startStr, String endStr) {
|
||||||
|
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
List<String> strs=new ArrayList<>();
|
||||||
|
try{
|
||||||
|
Date startDate=sdf.parse(startStr);
|
||||||
|
Date endDate=sdf.parse(endStr);
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(startDate);
|
||||||
|
while (calendar.getTime().before(endDate) || calendar.getTime().equals(endDate)) {
|
||||||
|
strs.add(sdf.format(calendar.getTime()));
|
||||||
|
calendar.add(Calendar.DATE, 1);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
|
||||||
|
}
|
||||||
|
return strs;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,14 @@
|
||||||
) ts
|
) ts
|
||||||
</select>
|
</select>
|
||||||
<select id="getATeamNumForEcharts" parameterType="com.bonus.aqgqj.basis.entity.vo.HomeVo" resultType="com.bonus.aqgqj.basis.entity.vo.HomeVo">
|
<select id="getATeamNumForEcharts" parameterType="com.bonus.aqgqj.basis.entity.vo.HomeVo" resultType="com.bonus.aqgqj.basis.entity.vo.HomeVo">
|
||||||
|
SELECT testData,COUNT(1) AS testNum from (
|
||||||
select tt.team_name as teamName,ts.id,DATE_FORMAT(ts.dispatch_time, '%Y-%m-%d') as testData from tb_sample ts
|
select tt.team_name as teamName,ts.id,DATE_FORMAT(ts.dispatch_time, '%Y-%m-%d') as testData from tb_sample ts
|
||||||
where ts.del_flag='0'
|
LEFT JOIN tb_team tt on ts.team_id=tt.id
|
||||||
|
where ts.del_flag='0' and tt.id=#{id}
|
||||||
|
) aa group by testData
|
||||||
|
</select>
|
||||||
|
<select id="getTeams" parameterType="com.bonus.aqgqj.basis.entity.vo.HomeVo" resultType="com.bonus.aqgqj.basis.entity.vo.HomeVo">
|
||||||
|
select id,team_name as teamname from tb_team where del_flag='0'
|
||||||
</select>
|
</select>
|
||||||
<select id="getATeamCostForEcharts" parameterType="com.bonus.aqgqj.basis.entity.vo.HomeVo" resultType="com.bonus.aqgqj.basis.entity.vo.HomeVo">
|
<select id="getATeamCostForEcharts" parameterType="com.bonus.aqgqj.basis.entity.vo.HomeVo" resultType="com.bonus.aqgqj.basis.entity.vo.HomeVo">
|
||||||
select
|
select
|
||||||
|
|
@ -30,6 +36,30 @@
|
||||||
) aa group by teamName
|
) aa group by teamName
|
||||||
</select>
|
</select>
|
||||||
<select id="getCostRank" parameterType="com.bonus.aqgqj.basis.entity.vo.HomeVo" resultType="com.bonus.aqgqj.basis.entity.vo.HomeVo">
|
<select id="getCostRank" parameterType="com.bonus.aqgqj.basis.entity.vo.HomeVo" resultType="com.bonus.aqgqj.basis.entity.vo.HomeVo">
|
||||||
|
select aa.custom_name userName,aa.custom_user as contacts,aa.custom_phone as contactPhone,aa.orderNum,bb.totalCost,cc.cooperateDate from (
|
||||||
|
select ec.id,ec.custom_name,ec.custom_user,ec.custom_phone,sum(te.dev_num) as orderNum from
|
||||||
|
tb_custom ec
|
||||||
|
left join tb_sample ts on ec.id=ts.custom_id
|
||||||
|
left join tb_exper te on ts.id=te.sample_id
|
||||||
|
left join tb_exper_items teis on te.id=teis.exper_id
|
||||||
|
group by ec.custom_name,ec.custom_user,ec.custom_phone
|
||||||
|
) aa
|
||||||
|
left join (
|
||||||
|
select ec.id,ec.custom_name,ec.custom_user,ec.custom_phone,sum(teis.amount) as totalCost from
|
||||||
|
tb_custom ec
|
||||||
|
left join tb_sample ts on ec.id=ts.custom_id
|
||||||
|
left join tb_exper te on ts.id=te.sample_id
|
||||||
|
left join tb_exper_items teis on te.id=teis.exper_id
|
||||||
|
group by ec.custom_name,ec.custom_user,ec.custom_phone
|
||||||
|
) bb on aa.id=bb.id
|
||||||
|
left join (
|
||||||
|
select ec.id,ec.custom_name,ec.custom_user,ec.custom_phone,max(ts.create_time) as cooperateDate from
|
||||||
|
tb_custom ec
|
||||||
|
left join tb_sample ts on ec.id=ts.custom_id
|
||||||
|
left join tb_exper te on ts.id=te.sample_id
|
||||||
|
left join tb_exper_items teis on te.id=teis.exper_id
|
||||||
|
group by ec.custom_name,ec.custom_user,ec.custom_phone
|
||||||
|
) cc on aa.id=cc.id
|
||||||
|
where cooperateDate is not null order by totalCost desc
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -7,7 +7,7 @@ layui.use(['form', 'layer', 'table', 'laydate','carousel','util'], function () {
|
||||||
util=layui.util;
|
util=layui.util;
|
||||||
console.log("测试")
|
console.log("测试")
|
||||||
initApproe();
|
initApproe();
|
||||||
echartsone();
|
echartsone(0);
|
||||||
echartstwo();
|
echartstwo();
|
||||||
iniTable();
|
iniTable();
|
||||||
// layui-table-body
|
// layui-table-body
|
||||||
|
|
@ -19,10 +19,6 @@ function initApproe(){
|
||||||
var reviewNUm =0;
|
var reviewNUm =0;
|
||||||
var examineNum =0;
|
var examineNum =0;
|
||||||
var approvalNum =0;
|
var approvalNum =0;
|
||||||
var objs=$(".updateDate");
|
|
||||||
$.each(objs, function (index, item) {
|
|
||||||
$(item).html("2024-07-26")
|
|
||||||
})
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: dataUrl + "/home/getApprovalNum",
|
url: dataUrl + "/home/getApprovalNum",
|
||||||
headers: {
|
headers: {
|
||||||
|
|
@ -31,13 +27,21 @@ function initApproe(){
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
async: true,
|
async: true,
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
if (result.code === 200) {
|
if (result.code == 200) {
|
||||||
if (result.data) {
|
if (result.data) {
|
||||||
|
$("#dispatchWorkNum").html(result.data.dispatchWorkNum);
|
||||||
|
$("#testNum").html(result.data.testNum);
|
||||||
|
$("#reloadReviewNUm").html(result.data.reloadReviewNUm);
|
||||||
|
$("#reviewNUm").html(result.data.reviewNUm);
|
||||||
|
$("#examineNum").html(result.data.examineNum);
|
||||||
|
$("#approvalNum").html(result.data.approvalNum);
|
||||||
|
|
||||||
|
var objs=$(".updateDate");
|
||||||
|
$.each(objs, function (index, item) {
|
||||||
|
$(item).html(result.data.updateDate)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, error: function (xhr) {
|
|
||||||
// error(xhr);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -61,19 +65,34 @@ var totalHeight ;
|
||||||
var visibleHeight ;
|
var visibleHeight ;
|
||||||
var currentScrollTop = 0;
|
var currentScrollTop = 0;
|
||||||
function iniTable(){
|
function iniTable(){
|
||||||
|
$.ajax({
|
||||||
|
url: dataUrl + "/home/getCostRank",
|
||||||
|
headers: {
|
||||||
|
"token": tokens
|
||||||
|
},
|
||||||
|
type: 'POST',
|
||||||
|
async: false,
|
||||||
|
success: function (result) {
|
||||||
|
if (result.code == 200) {
|
||||||
|
if (result.data) {
|
||||||
|
data=result.data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
table.render({
|
table.render({
|
||||||
elem: '#table-box',
|
elem: '#table-box',
|
||||||
data:data,
|
data:data,
|
||||||
limit: 10000,
|
limit: 10000,
|
||||||
page:false,
|
page:false,
|
||||||
cols: [[
|
cols: [[
|
||||||
{type: 'numbers', title: '排名', width: '10%',align:"center"}//序号列
|
{field: 'num',type:'numbers',align:'center',title: '排名', width:'10%'}
|
||||||
,{field: 'username', title: '用户名称', width: '20%',align:"center"}
|
,{field: 'userName', title: '用户名称', width: '20%',align:"center"}
|
||||||
,{field: 'fee', title: '总金额(元)', width: '15%',align:"center"}
|
,{field: 'totalCost', title: '总金额(元)', width: '15%',align:"center"}
|
||||||
,{field: 'dingdan', title: '订单量', width: '12%',align:"center"}
|
,{field: 'orderNum', title: '订单量', width: '12%',align:"center"}
|
||||||
,{field: 'name', title: '联系人', width: '12%',align:"center"}
|
,{field: 'contacts', title: '联系人', width: '12%',align:"center"}
|
||||||
,{field: 'phone', title: '联系电话', width: '15%',align:"center"}
|
,{field: 'contactPhone', title: '联系电话', width: '15%',align:"center"}
|
||||||
,{field: 'gettime', title: '最近合作时间', width: '15%',align:"center"}
|
,{field: 'cooperateDate', title: '最近合作时间', width: '15%',align:"center"}
|
||||||
]]
|
]]
|
||||||
});
|
});
|
||||||
scrollableDiv = $('#table-box + div .layui-table-body'); // 假设你的滚动容器类名为.scrollable
|
scrollableDiv = $('#table-box + div .layui-table-body'); // 假设你的滚动容器类名为.scrollable
|
||||||
|
|
@ -103,8 +122,59 @@ function scrolldiv() {
|
||||||
scrollableDiv.scrollTop(currentScrollTop);
|
scrollableDiv.scrollTop(currentScrollTop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function echartsone(){
|
function getchick(type){
|
||||||
|
echartsone(type)
|
||||||
|
}
|
||||||
|
var colors=['#0052D9','#B5C7FF','#21C7FF','#21d7dd','#11C7FF']
|
||||||
|
function echartsone(type){
|
||||||
var myChart = echarts.init(document.getElementById('echartsone'));
|
var myChart = echarts.init(document.getElementById('echartsone'));
|
||||||
|
var datearr=[];
|
||||||
|
var seriesdata=[];
|
||||||
|
var daydata=[];
|
||||||
|
$.ajax({
|
||||||
|
url: dataUrl + "/home/getATeamNumForEcharts",
|
||||||
|
headers: {
|
||||||
|
"token": tokens
|
||||||
|
},
|
||||||
|
data:{type:type},
|
||||||
|
type: 'POST',
|
||||||
|
async: false,
|
||||||
|
success: function (result) {
|
||||||
|
if (result.code == 200) {
|
||||||
|
if (result.data) {
|
||||||
|
var listData=result.data[0].listData;
|
||||||
|
$.each(listData, function (index, item) {
|
||||||
|
daydata.push(item.testData)
|
||||||
|
})
|
||||||
|
$.each(result.data, function (index, itemd) {
|
||||||
|
var dot={
|
||||||
|
name: '实验一班',
|
||||||
|
type: 'line',
|
||||||
|
data: [10, 11, 13, 11, 12, 12, 9],
|
||||||
|
lineStyle: {
|
||||||
|
color: '#0052D9',
|
||||||
|
width: 2,
|
||||||
|
type: 'solid'
|
||||||
|
},
|
||||||
|
// 设置散点(线中的点)颜色
|
||||||
|
itemStyle: {
|
||||||
|
color: '#0052D9'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
dot.name=itemd.listData[0].teamName;
|
||||||
|
var testnum=[];
|
||||||
|
$.each(itemd.listData, function (index, item) {
|
||||||
|
testnum.push(item.testNum)
|
||||||
|
})
|
||||||
|
dot.data=testnum;
|
||||||
|
dot.lineStyle.color=colors[index];
|
||||||
|
dot.itemStyle.color=colors[index];
|
||||||
|
seriesdata.push(dot);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
option = {
|
option = {
|
||||||
title: {
|
title: {
|
||||||
text: ''
|
text: ''
|
||||||
|
|
@ -127,7 +197,7 @@ function echartsone(){
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
boundaryGap: false,
|
boundaryGap: false,
|
||||||
data: ['2024-07-01', '2024-07-02', '2024-07-03', '2024-07-04', '2024-07-05', '2024-07-06', '2024-07-07']
|
data: daydata
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
|
|
@ -135,40 +205,33 @@ function echartsone(){
|
||||||
formatter: '{value}'
|
formatter: '{value}'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
series: [
|
series: seriesdata
|
||||||
{
|
|
||||||
name: '实验一班',
|
|
||||||
type: 'line',
|
|
||||||
data: [10, 11, 13, 11, 12, 12, 9],
|
|
||||||
lineStyle: {
|
|
||||||
color: '#0052D9',
|
|
||||||
width: 2,
|
|
||||||
type: 'solid'
|
|
||||||
},
|
|
||||||
// 设置散点(线中的点)颜色
|
|
||||||
itemStyle: {
|
|
||||||
color: '#0052D9'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '实验二班',
|
|
||||||
type: 'line',
|
|
||||||
data: [1, 2, 2, 5, 3, 2, 4],
|
|
||||||
lineStyle: {
|
|
||||||
color: '#B5C7FF',
|
|
||||||
width: 2,
|
|
||||||
type: 'solid'
|
|
||||||
},
|
|
||||||
// 设置散点(线中的点)颜色
|
|
||||||
itemStyle: {
|
|
||||||
color: '#B5C7FF'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
};
|
||||||
myChart.setOption(option);
|
myChart.setOption(option);
|
||||||
}
|
}
|
||||||
function echartstwo(){
|
function echartstwo(){
|
||||||
|
var datearr=[];
|
||||||
|
$.ajax({
|
||||||
|
url: dataUrl + "/home/getATeamCostForEcharts",
|
||||||
|
headers: {
|
||||||
|
"token": tokens
|
||||||
|
},
|
||||||
|
type: 'POST',
|
||||||
|
async: false,
|
||||||
|
success: function (result) {
|
||||||
|
if (result.code == 200) {
|
||||||
|
if (result.data) {
|
||||||
|
$.each(result.data, function (index, item) {
|
||||||
|
var dat={};
|
||||||
|
dat.value= item.testCost;
|
||||||
|
dat.name=item.teamName;
|
||||||
|
datearr.push(dat);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
console.log(datearr,"datearr")
|
||||||
var myChart = echarts.init(document.getElementById('echartstwo'));
|
var myChart = echarts.init(document.getElementById('echartstwo'));
|
||||||
option = {
|
option = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
|
|
@ -186,10 +249,7 @@ function echartstwo(){
|
||||||
type: 'pie',
|
type: 'pie',
|
||||||
radius: '50%',
|
radius: '50%',
|
||||||
color: ['#0052D9', '#B5C7FF'],
|
color: ['#0052D9', '#B5C7FF'],
|
||||||
data: [
|
data: datearr
|
||||||
{ value: 1048, name: '试验一班' },
|
|
||||||
{ value: 735, name: '试验二班' }
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="three">
|
<div class="three">
|
||||||
<div class="three-one">
|
<div class="three-one">
|
||||||
<div><span>班组工作情况统计(试验数)</span><button>近15天</button><button>本周</button></div>
|
<div><span>班组工作情况统计(试验数)</span><button onclick="getchick(1)">近15天</button><button onclick="getchick(0)">本周</button></div>
|
||||||
<div id="echartsone"></div>
|
<div id="echartsone"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="three-two">
|
<div class="three-two">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue