1
This commit is contained in:
parent
8103fa9252
commit
e267a2121a
@ -332,7 +332,8 @@ public class WebController extends BaseController {
|
||||
@ApiImplicitParam(name = "title", value = "标题", required = false, paramType = "body"),
|
||||
@ApiImplicitParam(name = "content", value = "内容", required = true, paramType = "body"),
|
||||
@ApiImplicitParam(name = "email", value = "email", required = false, paramType = "body"),
|
||||
@ApiImplicitParam(name = "tenantId", value = "公司名称", required = true, paramType = "body")
|
||||
@ApiImplicitParam(name = "tenantId", value = "站点编码", required = true, paramType = "body"),
|
||||
@ApiImplicitParam(name = "equipment", value = "设备类型(移动端|电脑端)", required = true, paramType = "body")
|
||||
})
|
||||
@PostMapping("/inquirySave")
|
||||
public R<String> inquirySave(@ApiIgnore @RequestBody BusiInquiryItem inquiryItem, HttpServletRequest request){
|
||||
|
@ -116,6 +116,7 @@ public class BusiNewController extends BaseController
|
||||
item.setTenantId(prodNewVO.getTenantId());
|
||||
item.setFileType(FILE_TYPE_NEWS);
|
||||
});
|
||||
basePicsService.saveBatch(prodNewVO.getFileList());
|
||||
}
|
||||
busiProdNewService.setAmount(prodNewVO.getTenantId());
|
||||
return success();
|
||||
@ -135,6 +136,7 @@ public class BusiNewController extends BaseController
|
||||
item.setTenantId(prodNewVO.getTenantId());
|
||||
item.setFileType(FILE_TYPE_NEWS);
|
||||
});
|
||||
basePicsService.saveBatch(prodNewVO.getFileList());
|
||||
}
|
||||
return success();
|
||||
}
|
||||
|
@ -124,6 +124,7 @@ public class BusiProdController extends BaseController
|
||||
item.setTenantId(prodNewVO.getTenantId());
|
||||
item.setFileType(FILE_TYPE_PRODUCT);
|
||||
});
|
||||
basePicsService.saveBatch(prodNewVO.getFileList());
|
||||
}
|
||||
busiProdNewService.setAmount(prodNewVO.getTenantId());
|
||||
return success();
|
||||
@ -143,6 +144,7 @@ public class BusiProdController extends BaseController
|
||||
item.setTenantId(prodNewVO.getTenantId());
|
||||
item.setFileType(FILE_TYPE_PRODUCT);
|
||||
});
|
||||
basePicsService.saveBatch(prodNewVO.getFileList());
|
||||
}
|
||||
return success();
|
||||
}
|
||||
|
@ -38,12 +38,25 @@ public class StatisticsController extends BaseController
|
||||
*/
|
||||
@GetMapping("/indexData")
|
||||
public AjaxResult list(String tenantId){
|
||||
Map<String, Map<String,Object>> rtnMap = new HashMap<>();
|
||||
Map<String, Object> rtnMap = new HashMap<>();
|
||||
//文章、产品数量
|
||||
rtnMap.put("prodNews",prodNewService.getIndexData(tenantId));
|
||||
//询盘流量
|
||||
rtnMap.put("ipInquiry",busiThirdItemService.inquiryMap(tenantId));
|
||||
//询盘来源前十国家
|
||||
rtnMap.put("nationalData",busiThirdItemService.nationalData(tenantId));
|
||||
//询盘设备
|
||||
rtnMap.put("equipmentData",busiThirdItemService.equipmentData(tenantId));
|
||||
//近一个月询盘数
|
||||
rtnMap.put("dataList",busiThirdItemService.dataList(tenantId));
|
||||
return success(rtnMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 询盘走势图,指定时间范围
|
||||
*/
|
||||
@GetMapping("/inquiryChart")
|
||||
public AjaxResult inquiryChart(String tenantId,String startDate,String endDate){
|
||||
return success(busiThirdItemService.inquiryChart(tenantId,startDate,endDate));
|
||||
}
|
||||
}
|
||||
|
@ -46,6 +46,9 @@ public class BusiChatMain extends DlBaseEntity
|
||||
/** 聊天记录数 */
|
||||
@Excel(name = "聊天记录数")
|
||||
private Integer nums;
|
||||
/** 设备类型 */
|
||||
@Excel(name = "设备类型")
|
||||
private String equipment;
|
||||
|
||||
/** 浏览器唯一编码(客户方) */
|
||||
@Excel(name = "浏览器唯一编码", readConverterExp = "客=户方")
|
||||
|
@ -75,6 +75,9 @@ public class BusiInquiryItem extends DlBaseEntity
|
||||
@Excel(name = "洲")
|
||||
@ApiModelProperty("洲")
|
||||
private String oceania;
|
||||
/** 设备类型 */
|
||||
@Excel(name = "设备类型")
|
||||
private String equipment;
|
||||
|
||||
/** 页面路径 */
|
||||
@Excel(name = "页面路径")
|
||||
|
@ -4,7 +4,9 @@ import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.busi.domain.BusiChatMain;
|
||||
import com.ruoyi.busi.vo.ChartDataVO;
|
||||
import com.ruoyi.busi.vo.ChatMainVO;
|
||||
import com.ruoyi.busi.vo.ThirdSoftVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@ -30,4 +32,19 @@ public interface BusiChatMainMapper extends BaseMapper<BusiChatMain>
|
||||
* @return java.lang.Integer
|
||||
**/
|
||||
Integer selectIpCount(@Param("tenantId")String tenantId,@Param("startDate")String startDate,@Param("endDate")String endDate);
|
||||
|
||||
List<ChartDataVO> selectNationalSortList(@Param("tenantId")String tenantId);
|
||||
|
||||
/**
|
||||
* 查询询盘设备
|
||||
* @author vinjor-M
|
||||
* @date 10:49 2025/7/16
|
||||
* @param tenantId 站点ID
|
||||
* @return java.util.List<com.ruoyi.busi.vo.ChartDataVO>
|
||||
**/
|
||||
List<ChartDataVO> selectEquipmentSortList(@Param("tenantId")String tenantId);
|
||||
|
||||
List<ThirdSoftVO> selectChatVO(@Param("tenantId")String tenantId);
|
||||
|
||||
List<BusiChatMain> selectLineChart(@Param("tenantId")String tenantId,@Param("startDate")String startDate,@Param("endDate")String endDate);
|
||||
}
|
||||
|
@ -4,7 +4,9 @@ import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.busi.domain.BusiInquiryItem;
|
||||
import com.ruoyi.busi.vo.ChartDataVO;
|
||||
import com.ruoyi.busi.vo.InquiryItemVO;
|
||||
import com.ruoyi.busi.vo.ThirdSoftVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@ -30,4 +32,26 @@ public interface BusiInquiryItemMapper extends BaseMapper<BusiInquiryItem>
|
||||
* @return java.lang.Integer
|
||||
**/
|
||||
Integer selectIpCount(@Param("tenantId")String tenantId,@Param("startDate")String startDate,@Param("endDate")String endDate);
|
||||
|
||||
List<ChartDataVO> selectNationalSortList(@Param("tenantId")String tenantId);
|
||||
|
||||
/**
|
||||
* 查询询盘设备
|
||||
* @author vinjor-M
|
||||
* @date 10:49 2025/7/16
|
||||
* @param tenantId 站点ID
|
||||
* @return java.util.List<com.ruoyi.busi.vo.ChartDataVO>
|
||||
**/
|
||||
List<ChartDataVO> selectEquipmentSortList(@Param("tenantId")String tenantId);
|
||||
|
||||
/**
|
||||
* 查询在线询盘-近30天
|
||||
* @author vinjor-M
|
||||
* @date 16:19 2025/7/16
|
||||
* @param tenantId 站点编码
|
||||
* @return java.util.List<com.ruoyi.busi.vo.ThirdSoftVO>
|
||||
**/
|
||||
List<ThirdSoftVO> selectinquiryItemVO(@Param("tenantId")String tenantId);
|
||||
|
||||
List<BusiInquiryItem> selectLineChart(@Param("tenantId")String tenantId,@Param("startDate")String startDate,@Param("endDate")String endDate);
|
||||
}
|
||||
|
@ -4,6 +4,9 @@ import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.busi.domain.BusiThirdItem;
|
||||
import com.ruoyi.busi.vo.ChartDataVO;
|
||||
import com.ruoyi.busi.vo.IndexInquiryVO;
|
||||
import com.ruoyi.busi.vo.ThirdSoftVO;
|
||||
import com.ruoyi.busi.vo.ThirdVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
@ -29,4 +32,26 @@ public interface BusiThirdItemMapper extends BaseMapper<BusiThirdItem>
|
||||
* @return java.lang.Integer
|
||||
**/
|
||||
Integer selectIpCount(@Param("tenantId")String tenantId,@Param("thirdSoft")String thirdSoft,@Param("startDate")String startDate,@Param("endDate")String endDate);
|
||||
|
||||
/**
|
||||
* 查询盘三方来源国家数量,按国家分组计数
|
||||
* @author vinjor-M
|
||||
* @date 10:49 2025/7/16
|
||||
* @param tenantId 站点ID
|
||||
* @return java.util.List<com.ruoyi.busi.vo.ChartDataVO>
|
||||
**/
|
||||
List<ChartDataVO> selectNationalSortList(@Param("tenantId")String tenantId);
|
||||
|
||||
/**
|
||||
* 查询询盘设备
|
||||
* @author vinjor-M
|
||||
* @date 10:49 2025/7/16
|
||||
* @param tenantId 站点ID
|
||||
* @return java.util.List<com.ruoyi.busi.vo.ChartDataVO>
|
||||
**/
|
||||
List<ChartDataVO> selectEquipmentSortList(@Param("tenantId")String tenantId);
|
||||
|
||||
List<ThirdSoftVO> selectThirdSoft(@Param("tenantId")String tenantId);
|
||||
|
||||
List<BusiThirdItem> selectLineChart(@Param("tenantId")String tenantId,@Param("startDate")String startDate,@Param("endDate")String endDate);
|
||||
}
|
||||
|
@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.busi.domain.BusiThirdItem;
|
||||
import com.ruoyi.busi.vo.ChartDataVO;
|
||||
import com.ruoyi.busi.vo.IndexInquiryVO;
|
||||
import com.ruoyi.busi.vo.ThirdVO;
|
||||
|
||||
/**
|
||||
@ -27,4 +29,42 @@ public interface IBusiThirdItemService extends IService<BusiThirdItem>
|
||||
* @return java.util.Map<java.lang.String,java.lang.Object>
|
||||
**/
|
||||
Map<String,Object> inquiryMap(String tenantId);
|
||||
|
||||
/**
|
||||
* 查询询盘来源前十国家
|
||||
* @author vinjor-M
|
||||
* @date 10:47 2025/7/16
|
||||
* @param tenantId 站点编码
|
||||
* @return java.util.List<com.ruoyi.busi.vo.ChartDataVO>
|
||||
**/
|
||||
List<ChartDataVO> nationalData(String tenantId);
|
||||
|
||||
/**
|
||||
* 查询盘设备
|
||||
* @author vinjor-M
|
||||
* @date 15:15 2025/7/16
|
||||
* @param tenantId 站点编码
|
||||
* @return java.util.List<com.ruoyi.busi.vo.ChartDataVO>
|
||||
**/
|
||||
List<ChartDataVO> equipmentData(String tenantId);
|
||||
|
||||
/**
|
||||
* 首页查询近30天询盘数
|
||||
* @author vinjor-M
|
||||
* @date 15:26 2025/7/16
|
||||
* @param tenantId 站点编码
|
||||
* @return java.util.List<com.ruoyi.busi.vo.IndexInquiryVO>
|
||||
**/
|
||||
List<IndexInquiryVO> dataList(String tenantId);
|
||||
|
||||
/**
|
||||
* 询盘走势
|
||||
* @author vinjor-M
|
||||
* @date 17:12 2025/7/16
|
||||
* @param tenantId 站点编码
|
||||
* @param startDate 开始日期
|
||||
* @param endDate 结束日期
|
||||
* @return java.util.Map<java.lang.String,java.lang.Object>
|
||||
**/
|
||||
Map<String, Object> inquiryChart(String tenantId,String startDate,String endDate);
|
||||
}
|
||||
|
@ -1,18 +1,24 @@
|
||||
package com.ruoyi.busi.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.ruoyi.busi.domain.BusiChatMain;
|
||||
import com.ruoyi.busi.domain.BusiInquiryItem;
|
||||
import com.ruoyi.busi.mapper.BusiChatMainMapper;
|
||||
import com.ruoyi.busi.mapper.BusiInquiryItemMapper;
|
||||
import com.ruoyi.busi.vo.ChartDataVO;
|
||||
import com.ruoyi.busi.vo.IndexInquiryVO;
|
||||
import com.ruoyi.busi.vo.ThirdSoftVO;
|
||||
import com.ruoyi.busi.vo.ThirdVO;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.constant.DictConstants;
|
||||
import com.ruoyi.constant.StrConstants;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -120,4 +126,164 @@ public class BusiThirdItemServiceImpl extends ServiceImpl<BusiThirdItemMapper,Bu
|
||||
rtnMap.put("inquiryNum",formNum+chatNum+teamsNum+whatsAppNum+emailNum);
|
||||
return rtnMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询询盘来源前十国家
|
||||
*
|
||||
* @param tenantId 站点编码
|
||||
* @return java.util.List<com.ruoyi.busi.vo.ChartDataVO>
|
||||
* @author vinjor-M
|
||||
* @date 10:47 2025/7/16
|
||||
**/
|
||||
@Override
|
||||
public List<ChartDataVO> nationalData(String tenantId) {
|
||||
//三方系统跳转
|
||||
List<ChartDataVO> thirdList = busiThirdItemMapper.selectNationalSortList(tenantId);
|
||||
//在线询盘
|
||||
List<ChartDataVO> inquiryList = inquiryItemMapper.selectNationalSortList(tenantId);
|
||||
//在线聊天
|
||||
List<ChartDataVO> chatList = chatMainMapper.selectNationalSortList(tenantId);
|
||||
//数据合并
|
||||
Map<String,ChartDataVO> nationalMap = new HashMap<>();
|
||||
this.dealMapFun(thirdList,nationalMap);
|
||||
this.dealMapFun(inquiryList,nationalMap);
|
||||
this.dealMapFun(chatList,nationalMap);
|
||||
//转list
|
||||
List<ChartDataVO> dataVOList = new ArrayList<>(nationalMap.values())
|
||||
.stream().sorted(Comparator.comparingInt(ChartDataVO::getValue).reversed()).collect(Collectors.toList());
|
||||
return dataVOList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用将数据追加到map的方法
|
||||
* @author vinjor-M
|
||||
* @date 10:58 2025/7/16
|
||||
* @param dataList 数据列表
|
||||
* @param nationalMap 国家map
|
||||
**/
|
||||
private void dealMapFun(List<ChartDataVO> dataList,Map<String,ChartDataVO> nationalMap){
|
||||
dataList.forEach(item->{
|
||||
if(nationalMap.containsKey(item.getName())){
|
||||
ChartDataVO temp = nationalMap.get(item.getName());
|
||||
temp.setValue(temp.getValue()+item.getValue());
|
||||
nationalMap.put(item.getName(),temp);
|
||||
}else{
|
||||
nationalMap.put(item.getName(),item);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询盘设备
|
||||
*
|
||||
* @param tenantId 站点编码
|
||||
* @return java.util.List<com.ruoyi.busi.vo.ChartDataVO>
|
||||
* @author vinjor-M
|
||||
* @date 15:15 2025/7/16
|
||||
**/
|
||||
@Override
|
||||
public List<ChartDataVO> equipmentData(String tenantId) {
|
||||
//三方系统跳转
|
||||
List<ChartDataVO> thirdList = busiThirdItemMapper.selectEquipmentSortList(tenantId);
|
||||
//在线询盘
|
||||
List<ChartDataVO> inquiryList = inquiryItemMapper.selectEquipmentSortList(tenantId);
|
||||
//在线聊天
|
||||
List<ChartDataVO> chatList = chatMainMapper.selectEquipmentSortList(tenantId);
|
||||
//数据合并
|
||||
Map<String,ChartDataVO> nationalMap = new HashMap<>();
|
||||
this.dealMapFun(thirdList,nationalMap);
|
||||
this.dealMapFun(inquiryList,nationalMap);
|
||||
this.dealMapFun(chatList,nationalMap);
|
||||
//转list
|
||||
List<ChartDataVO> dataVOList = new ArrayList<>(nationalMap.values())
|
||||
.stream().sorted(Comparator.comparingInt(ChartDataVO::getValue).reversed()).collect(Collectors.toList());
|
||||
return dataVOList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页查询近30天询盘数
|
||||
*
|
||||
* @param tenantId 站点编码
|
||||
* @return java.util.List<com.ruoyi.busi.vo.IndexInquiryVO>
|
||||
* @author vinjor-M
|
||||
* @date 15:26 2025/7/16
|
||||
**/
|
||||
@Override
|
||||
public List<IndexInquiryVO> dataList(String tenantId) {
|
||||
//三方软件按日期、类型数量列表
|
||||
List<ThirdSoftVO> thirdSoftVOList = busiThirdItemMapper.selectThirdSoft(tenantId);
|
||||
Map<String,List<ThirdSoftVO>> thirdSoftMap = thirdSoftVOList.stream().collect(Collectors.groupingBy(ThirdSoftVO::getDate));
|
||||
//在线询盘的
|
||||
List<ThirdSoftVO> inquiryItemVOList = inquiryItemMapper.selectinquiryItemVO(tenantId);
|
||||
Map<String,List<ThirdSoftVO>> inquiryItemMap = inquiryItemVOList.stream().collect(Collectors.groupingBy(ThirdSoftVO::getDate));
|
||||
//在线聊天的
|
||||
List<ThirdSoftVO> chatVOList = chatMainMapper.selectChatVO(tenantId);
|
||||
Map<String,List<ThirdSoftVO>> chatVOmMap = chatVOList.stream().collect(Collectors.groupingBy(ThirdSoftVO::getDate));
|
||||
//返回数据类型
|
||||
List<IndexInquiryVO> rtnList = new ArrayList<>();
|
||||
// 初始化一个日期变量,设置为今天
|
||||
DateTime date = DateUtil.date();
|
||||
// 遍历近30天,每天输出一次日期
|
||||
for (int i = 0; i < 30; i++) {
|
||||
//当天日期
|
||||
String dateStr = DateUtil.formatDate(date);
|
||||
IndexInquiryVO inquiryVO = new IndexInquiryVO();
|
||||
inquiryVO.setDate(dateStr);
|
||||
//在线询盘数
|
||||
if(inquiryItemMap.containsKey(dateStr)){
|
||||
//有
|
||||
inquiryVO.setXunpan(inquiryItemMap.get(dateStr).get(0).getNum());
|
||||
}else{
|
||||
inquiryVO.setXunpan(0);
|
||||
}
|
||||
//在线聊天数
|
||||
if(chatVOmMap.containsKey(dateStr)){
|
||||
//有
|
||||
inquiryVO.setChat(chatVOmMap.get(dateStr).get(0).getNum());
|
||||
}else{
|
||||
inquiryVO.setChat(0);
|
||||
}
|
||||
if(thirdSoftMap.containsKey(dateStr)){
|
||||
//有数据
|
||||
Map<String,Integer> thisMap = thirdSoftMap.get(dateStr).stream().collect(Collectors.toMap(ThirdSoftVO::getThirdSoft,ThirdSoftVO::getNum));
|
||||
inquiryVO.setTeams(thisMap.getOrDefault(DictConstants.THIRD_SOFT_TEAMS, 0));
|
||||
inquiryVO.setWhatsApp(thisMap.getOrDefault(DictConstants.THIRD_SOFT_WHATSAPP, 0));
|
||||
inquiryVO.setEmail(thisMap.getOrDefault(DictConstants.THIRD_SOFT_EMAIL, 0));
|
||||
}else{
|
||||
inquiryVO.setEmail(0);
|
||||
inquiryVO.setWhatsApp(0);
|
||||
inquiryVO.setTeams(0);
|
||||
}
|
||||
rtnList.add(inquiryVO);
|
||||
// 将日期向前偏移一天
|
||||
date = DateUtil.offsetDay(date, -1);
|
||||
}
|
||||
return rtnList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 询盘走势
|
||||
*
|
||||
* @param tenantId 站点编码
|
||||
* @param startDate 开始日期
|
||||
* @param endDate 结束日期
|
||||
* @return java.util.Map<java.lang.String, java.lang.Object>
|
||||
* @author vinjor-M
|
||||
* @date 17:12 2025/7/16
|
||||
**/
|
||||
@Override
|
||||
public Map<String, Object> inquiryChart(String tenantId, String startDate, String endDate) {
|
||||
//开始日期
|
||||
String startDateStr = startDate+StrConstants.START_DATE;
|
||||
//截止日期
|
||||
String endDateStr = startDate+StrConstants.END_DATE;
|
||||
//先查出这段时间所有三方询盘数据
|
||||
List<BusiThirdItem> thirdItemList = busiThirdItemMapper.selectLineChart(tenantId,startDateStr,endDateStr);
|
||||
//这段时间所有在线询盘数据
|
||||
List<BusiInquiryItem> inquiryItemList = inquiryItemMapper.selectLineChart(tenantId, startDateStr, endDateStr);
|
||||
//这段时间所有在线聊天的数据
|
||||
List<BusiChatMain> chatMainList = chatMainMapper.selectLineChart(tenantId, startDateStr, endDateStr);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,9 @@
|
||||
package com.ruoyi.busi.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ChartDataVO {
|
||||
private String name;
|
||||
private Integer value;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.ruoyi.busi.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 首页询盘数实体
|
||||
* @author vinjor-M
|
||||
* @date 15:25 2025/7/16
|
||||
**/
|
||||
@Data
|
||||
public class IndexInquiryVO {
|
||||
/**
|
||||
* 日期
|
||||
*/
|
||||
private String date;
|
||||
/**
|
||||
* 在线询盘数
|
||||
*/
|
||||
private Integer xunpan;
|
||||
/**
|
||||
* email数
|
||||
*/
|
||||
private Integer email;
|
||||
/**
|
||||
* whatsApp数
|
||||
*/
|
||||
private Integer whatsApp;
|
||||
/**
|
||||
* teams数
|
||||
*/
|
||||
private Integer teams;
|
||||
/**
|
||||
* 在线聊天数
|
||||
*/
|
||||
private Integer chat;
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.ruoyi.busi.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ThirdSoftVO {
|
||||
/**
|
||||
* 日期
|
||||
*/
|
||||
private String date;
|
||||
/**
|
||||
* 三方软件
|
||||
*/
|
||||
private String thirdSoft;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Integer num;
|
||||
}
|
@ -41,6 +41,35 @@ public class DictConstants
|
||||
* 数据类型字典-新闻
|
||||
*/
|
||||
public static final String DATA_TYPE_NEWS ="news";
|
||||
/**
|
||||
* 设备类型字典-KEY
|
||||
*/
|
||||
public static final String EQUIPMENT_TYPE_KEY ="equipment_type";
|
||||
/**
|
||||
* 设备类型字典-移动端
|
||||
*/
|
||||
public static final String EQUIPMENT_TYPE_PHONE ="移动端";
|
||||
/**
|
||||
* 设备类型字典-电脑端
|
||||
*/
|
||||
public static final String EQUIPMENT_TYPE_PC ="电脑端";
|
||||
|
||||
/**
|
||||
* 三方软件类型字典-KEY
|
||||
*/
|
||||
public static final String THIRD_SOFT_KEY ="third_soft";
|
||||
/**
|
||||
* 三方软件类型字典-Teams
|
||||
*/
|
||||
public static final String THIRD_SOFT_TEAMS ="Teams";
|
||||
/**
|
||||
* 三方软件类型字典-WhatsApp
|
||||
*/
|
||||
public static final String THIRD_SOFT_WHATSAPP ="WhatsApp";
|
||||
/**
|
||||
* 三方软件类型字典-Email
|
||||
*/
|
||||
public static final String THIRD_SOFT_EMAIL ="Email";
|
||||
|
||||
|
||||
/**
|
||||
|
@ -30,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<sql id="selectBusiCategoryVo">
|
||||
select id, catg_name, catg_level, catg_type, parent_id, prods_junior, prods_all, title, keyword, description, sort, content, prod_up, prod_down, tenant_id, creator, create_time, updater, update_time, del_flag from dl_busi_category
|
||||
</sql>
|
||||
<select id="selectAllChirdren" resultType="java.lang.String">
|
||||
<select id="selectAllChildren" resultType="java.lang.String">
|
||||
SELECT
|
||||
id
|
||||
FROM
|
||||
|
@ -13,6 +13,7 @@
|
||||
<result property="nums" column="nums"/>
|
||||
<result property="cusCode" column="cus_code"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="equipment" column="equipment"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
<result property="creator" column="creator"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
@ -28,7 +29,7 @@
|
||||
<sql id="selectBusiChatMainVo">
|
||||
select id,
|
||||
prod_id,
|
||||
ip, national, oceania, nums, cus_code, user_id, tenant_id, creator, create_time, updater, update_time, del_flag
|
||||
ip, national, oceania, nums, cus_code, user_id,equipment, tenant_id, creator, create_time, updater, update_time, del_flag
|
||||
from dl_busi_chat_main
|
||||
</sql>
|
||||
|
||||
@ -43,6 +44,7 @@
|
||||
CONCAT('%',#{entity.prodName},'%')
|
||||
</if>
|
||||
<if test="entity.ip != null and entity.ip != ''">and dbcm.ip = #{entity.ip}</if>
|
||||
<if test="entity.equipment != null and entity.equipment != ''">and dbcm.equipment = #{entity.equipment}</if>
|
||||
<if test="entity.national != null and entity.national != ''">and dbcm.national LIKE
|
||||
CONCAT('%',#{entity.national},'%')
|
||||
</if>
|
||||
@ -75,4 +77,57 @@
|
||||
and (create_time <= #{endDate} OR update_time >= #{endDate})
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectNationalSortList" resultType="com.ruoyi.busi.vo.ChartDataVO">
|
||||
SELECT
|
||||
national AS `name`,
|
||||
COUNT( id ) AS `value`
|
||||
FROM
|
||||
dl_busi_chat_main
|
||||
WHERE
|
||||
del_flag = '0'
|
||||
AND tenant_id = #{tenantId}
|
||||
GROUP BY
|
||||
national
|
||||
</select>
|
||||
<select id="selectEquipmentSortList" resultType="com.ruoyi.busi.vo.ChartDataVO">
|
||||
SELECT
|
||||
equipment AS `name`,
|
||||
COUNT( id ) AS `value`
|
||||
FROM
|
||||
dl_busi_chat_main
|
||||
WHERE
|
||||
del_flag = '0'
|
||||
AND tenant_id = #{tenantId}
|
||||
GROUP BY
|
||||
equipment
|
||||
</select>
|
||||
<select id="selectChatVO" resultType="com.ruoyi.busi.vo.ThirdSoftVO">
|
||||
SELECT DATE
|
||||
( create_time ) AS DATE,
|
||||
COUNT( id ) AS num
|
||||
FROM
|
||||
dl_busi_chat_main
|
||||
WHERE
|
||||
create_time >= CURDATE() - INTERVAL 30 DAY
|
||||
AND tenant_id = #{tenantId}
|
||||
GROUP BY
|
||||
DATE ( create_time )
|
||||
ORDER BY
|
||||
create_time
|
||||
</select>
|
||||
<select id="selectLineChart" resultType="com.ruoyi.busi.domain.BusiChatMain">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
dl_busi_chat_main
|
||||
WHERE
|
||||
del_flag = 0
|
||||
AND tenant_id = #{tenantId}
|
||||
<if test="startDate != null and startDate != ''">
|
||||
and (create_time >= #{startDate} OR update_time >= #{startDate})
|
||||
</if>
|
||||
<if test="endDate != null and endDate != ''">
|
||||
and (create_time <= #{endDate} OR update_time >= #{endDate})
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
@ -15,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="ip" column="ip" />
|
||||
<result property="national" column="national" />
|
||||
<result property="oceania" column="oceania" />
|
||||
<result property="equipment" column="equipment" />
|
||||
<result property="pageUrl" column="page_url" />
|
||||
<result property="tenantId" column="tenant_id" />
|
||||
<result property="creator" column="creator" />
|
||||
@ -25,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBusiInquiryItemVo">
|
||||
select id, company_name, name, tel, title, content, email, ip, national, oceania, page_url, tenant_id, creator, create_time, updater, update_time, del_flag from dl_busi_inquiry_item
|
||||
select id, company_name, name, tel, title, content, email, ip, national, oceania,equipment, page_url, tenant_id, creator, create_time, updater, update_time, del_flag from dl_busi_inquiry_item
|
||||
</sql>
|
||||
|
||||
<select id="queryListPage" parameterType="com.ruoyi.busi.vo.InquiryItemVO" resultMap="BusiInquiryItemResult">
|
||||
@ -40,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="entity.ip != null and entity.ip != ''"> and ip = #{entity.ip}</if>
|
||||
<if test="entity.national != null and entity.national != ''"> and national = #{entity.national}</if>
|
||||
<if test="entity.oceania != null and entity.oceania != ''"> and oceania = #{entity.oceania}</if>
|
||||
<if test="entity.equipment != null and entity.equipment != ''"> and equipment = #{entity.equipment}</if>
|
||||
<if test="entity.pageUrl != null and entity.pageUrl != ''"> and page_url = #{entity.pageUrl}</if>
|
||||
<if test="entity.tenantId != null and entity.tenantId != ''"> and tenant_id = #{entity.tenantId}</if>
|
||||
<if test="entity.startDate != null and entity.startDate != ''">and create_time >= #{entity.startDate}</if>
|
||||
@ -61,6 +63,59 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and create_time <= #{endDate}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectNationalSortList" resultType="com.ruoyi.busi.vo.ChartDataVO">
|
||||
SELECT
|
||||
national AS `name`,
|
||||
COUNT( id ) AS `value`
|
||||
FROM
|
||||
dl_busi_inquiry_item
|
||||
WHERE
|
||||
del_flag = '0'
|
||||
AND tenant_id = #{tenantId}
|
||||
GROUP BY
|
||||
national
|
||||
</select>
|
||||
<select id="selectEquipmentSortList" resultType="com.ruoyi.busi.vo.ChartDataVO">
|
||||
SELECT
|
||||
equipment AS `name`,
|
||||
COUNT( id ) AS `value`
|
||||
FROM
|
||||
dl_busi_inquiry_item
|
||||
WHERE
|
||||
del_flag = '0'
|
||||
AND tenant_id = #{tenantId}
|
||||
GROUP BY
|
||||
equipment
|
||||
</select>
|
||||
<select id="selectinquiryItemVO" resultType="com.ruoyi.busi.vo.ThirdSoftVO">
|
||||
SELECT DATE
|
||||
( create_time ) AS DATE,
|
||||
COUNT( id ) AS num
|
||||
FROM
|
||||
dl_busi_inquiry_item
|
||||
WHERE
|
||||
create_time >= CURDATE() - INTERVAL 30 DAY
|
||||
AND tenant_id = #{tenantId}
|
||||
GROUP BY
|
||||
DATE ( create_time )
|
||||
ORDER BY
|
||||
create_time
|
||||
</select>
|
||||
<select id="selectLineChart" resultType="com.ruoyi.busi.domain.BusiInquiryItem">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
dl_busi_inquiry_item
|
||||
WHERE
|
||||
del_flag = 0
|
||||
AND tenant_id = #{tenantId}
|
||||
<if test="startDate != null and startDate != ''">
|
||||
and create_time >= #{startDate}
|
||||
</if>
|
||||
<if test="endDate != null and endDate != ''">
|
||||
and create_time <= #{endDate}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
@ -68,4 +68,58 @@ order by dbti.create_time DESC
|
||||
and create_time <= #{endDate}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectNationalSortList" resultType="com.ruoyi.busi.vo.ChartDataVO">
|
||||
SELECT
|
||||
national AS `name`,
|
||||
COUNT( id ) AS `value`
|
||||
FROM
|
||||
dl_busi_third_item
|
||||
WHERE
|
||||
del_flag = '0'
|
||||
AND tenant_id = #{tenantId}
|
||||
GROUP BY
|
||||
national
|
||||
</select>
|
||||
<select id="selectEquipmentSortList" resultType="com.ruoyi.busi.vo.ChartDataVO">
|
||||
SELECT
|
||||
equipment AS `name`,
|
||||
COUNT( id ) AS `value`
|
||||
FROM
|
||||
dl_busi_third_item
|
||||
WHERE
|
||||
del_flag = '0'
|
||||
AND tenant_id = #{tenantId}
|
||||
GROUP BY
|
||||
equipment
|
||||
</select>
|
||||
<select id="selectThirdSoft" resultType="com.ruoyi.busi.vo.ThirdSoftVO">
|
||||
SELECT DATE
|
||||
( create_time ) AS date,
|
||||
(third_soft) as third_soft,
|
||||
COUNT( id ) AS num
|
||||
FROM
|
||||
dl_busi_third_item
|
||||
WHERE
|
||||
create_time >= CURDATE() - INTERVAL 30 DAY
|
||||
AND tenant_id =#{tenantId}
|
||||
GROUP BY
|
||||
DATE ( create_time ),third_soft
|
||||
ORDER BY
|
||||
create_time
|
||||
</select>
|
||||
<select id="selectLineChart" resultType="com.ruoyi.busi.domain.BusiThirdItem">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
dl_busi_third_item
|
||||
WHERE
|
||||
del_flag = 0
|
||||
AND tenant_id = #{tenantId}
|
||||
<if test="startDate != null and startDate != ''">
|
||||
and create_time >= #{startDate}
|
||||
</if>
|
||||
<if test="endDate != null and endDate != ''">
|
||||
and create_time <= #{endDate}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
@ -41,7 +41,14 @@ export default {
|
||||
/deep/.dl-flex-column {
|
||||
display: flex;
|
||||
justify-content: start;
|
||||
align-items: center
|
||||
align-items: center;
|
||||
}
|
||||
/deep/.dl-flex-row {
|
||||
display: flex;
|
||||
justify-content: start;
|
||||
align-items: start;
|
||||
flex-direction: column;
|
||||
line-height: 14px;
|
||||
}
|
||||
/deep/.dl-flex-column-center {
|
||||
display: flex;
|
||||
|
@ -9,3 +9,12 @@ export function indexData(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 首页数据统计
|
||||
export function inquiryChart(query) {
|
||||
return request({
|
||||
url: '/statistics/inquiryChart',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -114,6 +114,7 @@
|
||||
<el-table-column label="IP" align="center" prop="ip" />
|
||||
<el-table-column label="国家" align="center" prop="national" />
|
||||
<el-table-column label="洲" align="center" prop="oceania" />
|
||||
<el-table-column label="设备类型" align="center" prop="equipment"/>
|
||||
<el-table-column label="负责员工" align="center" prop="userName" />
|
||||
<el-table-column align="center" prop="nums" >
|
||||
<template slot="header" slot-scope="scope">
|
||||
|
@ -3,7 +3,7 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-button @click="back">返 回</el-button>
|
||||
<el-button type="success" @click="submitForm">暂 存</el-button>
|
||||
<el-button type="success" @click="saveTmp">暂 存</el-button>
|
||||
<el-button type="primary" @click="submitForm">发 布</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -269,6 +269,18 @@ export default {
|
||||
/** 暂存 */
|
||||
saveTmp(){
|
||||
this.form.ifPublic=0
|
||||
this.saveData()
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
this.form.ifPublic=1
|
||||
this.saveData()
|
||||
}
|
||||
})
|
||||
},
|
||||
saveData(){
|
||||
if (this.form.id != null) {
|
||||
updateProdNew(this.form).then(response => {
|
||||
this.$modal.msgSuccess('修改成功')
|
||||
@ -285,15 +297,6 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
this.form.ifPublic=1
|
||||
this.saveTmp()
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 图片库上传
|
||||
*/
|
||||
|
@ -3,7 +3,7 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-button @click="back">返 回</el-button>
|
||||
<el-button type="success" @click="submitForm">暂 存</el-button>
|
||||
<el-button type="success" @click="saveTmp">暂 存</el-button>
|
||||
<el-button type="primary" @click="submitForm">发 布</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -12,10 +12,14 @@
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="产品名称" prop="title">
|
||||
<el-input v-model="form.title" placeholder="请输入产品名称"/>
|
||||
<div class="dl-flex-column">
|
||||
<el-input v-model="form.title" placeholder="请输入产品名称"/>
|
||||
<div class="dl-add-catg" style="width: 180px" @click="goCatgView">Google关键词获取</div>
|
||||
</div>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="所属分类" prop="catgId">
|
||||
<div class="dl-flex-column">
|
||||
<treeselect style="width: 200px" v-model="form.catgId" :options="catgOptions" :normalizer="normalizer" :noResultsText="'暂无数据'" placeholder="请选择产品分类" />
|
||||
@ -23,12 +27,29 @@
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="form.sort" type="number" placeholder="请输入排序"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="页面title" prop="prodTitle">
|
||||
<el-input v-model="form.prodTitle" type="textarea" placeholder="请输入页面title"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="页面keyword" prop="prodKeyword">
|
||||
<el-input v-model="form.prodKeyword" type="textarea" placeholder="请输入页面keyword"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="页面description" prop="prodDescription">
|
||||
<el-input v-model="form.prodDescription" type="textarea" placeholder="请输入页面description"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="产品主图" prop="mainPic">
|
||||
@ -43,15 +64,6 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <el-form-item label="页面title" prop="prodTitle">-->
|
||||
<!-- <el-input v-model="form.prodTitle" placeholder="请输入页面title"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="页面keyword" prop="prodKeyword">-->
|
||||
<!-- <el-input v-model="form.prodKeyword" type="textarea" placeholder="请输入内容"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="页面description" prop="prodDescription">-->
|
||||
<!-- <el-input v-model="form.prodDescription" type="textarea" placeholder="请输入内容"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-row>
|
||||
<el-col :span="18">
|
||||
<el-form-item label="产品简介" prop="description">
|
||||
@ -134,8 +146,8 @@ export default {
|
||||
description: null,
|
||||
content: null,
|
||||
sort: null,
|
||||
ifReco: 0,
|
||||
ifPublic: 0,
|
||||
ifReco: false,
|
||||
ifPublic: false,
|
||||
tenantId: null,
|
||||
creator: null,
|
||||
createTime: null,
|
||||
@ -251,7 +263,19 @@ export default {
|
||||
},
|
||||
/** 暂存 */
|
||||
saveTmp(){
|
||||
this.form.ifPublic=0
|
||||
this.form.ifPublic=false
|
||||
this.saveData()
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
this.form.ifPublic=true
|
||||
this.saveData()
|
||||
}
|
||||
})
|
||||
},
|
||||
saveData(){
|
||||
if (this.form.id != null) {
|
||||
updateProdNew(this.form).then(response => {
|
||||
this.$modal.msgSuccess('修改成功')
|
||||
@ -268,15 +292,6 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
this.form.ifPublic=1
|
||||
this.saveTmp()
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 图片库上传
|
||||
*/
|
||||
@ -319,8 +334,12 @@ export default {
|
||||
}
|
||||
.dl-add-catg {
|
||||
cursor: pointer;
|
||||
width: 130px;
|
||||
width: 110px;
|
||||
text-align: center;
|
||||
color: #1890ff;
|
||||
}
|
||||
.dl-tooltip-text{
|
||||
color: #495060;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
|
@ -23,7 +23,7 @@ export default {
|
||||
height: {
|
||||
type: String,
|
||||
default: '300px'
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -31,9 +31,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.initChart()
|
||||
})
|
||||
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (!this.chart) {
|
||||
@ -43,9 +41,23 @@ export default {
|
||||
this.chart = null
|
||||
},
|
||||
methods: {
|
||||
initChart() {
|
||||
initChart(data) {
|
||||
this.chart = echarts.init(this.$el)
|
||||
|
||||
let titleArray = []
|
||||
let dataArray = []
|
||||
data.map((item)=>{
|
||||
titleArray.push(item.name)
|
||||
dataArray.push(
|
||||
{
|
||||
value: item.value,
|
||||
itemStyle: {
|
||||
color: '#1D8FFF'
|
||||
}
|
||||
}
|
||||
)
|
||||
})
|
||||
console.log(titleArray,"titleArray")
|
||||
console.log(dataArray,"dataArray")
|
||||
this.chart.setOption({
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
@ -62,7 +74,7 @@ export default {
|
||||
},
|
||||
xAxis: [{
|
||||
type: 'category',
|
||||
data: ['美国', '德国', '日本', '英国', '法国'],
|
||||
data: titleArray,
|
||||
axisTick: {
|
||||
alignWithLabel: true
|
||||
}
|
||||
@ -78,37 +90,7 @@ export default {
|
||||
type: 'bar',
|
||||
stack: 'vistors',
|
||||
barWidth: '60%',
|
||||
data: [
|
||||
{
|
||||
value: 330,
|
||||
itemStyle: {
|
||||
color: '#1D8FFF'
|
||||
}
|
||||
},
|
||||
{
|
||||
value: 200,
|
||||
itemStyle: {
|
||||
color: '#1D8FFF'
|
||||
}
|
||||
},
|
||||
{
|
||||
value: 150,
|
||||
itemStyle: {
|
||||
color: '#1D8FFF'
|
||||
}
|
||||
},
|
||||
{
|
||||
value: 140,
|
||||
itemStyle: {
|
||||
color: '#1D8FFF'
|
||||
}
|
||||
},
|
||||
{
|
||||
value: 100,
|
||||
itemStyle: {
|
||||
color: '#1D8FFF'
|
||||
}
|
||||
}],
|
||||
data: dataArray,
|
||||
animationDuration
|
||||
}]
|
||||
})
|
||||
|
@ -30,9 +30,6 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.initChart()
|
||||
})
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (!this.chart) {
|
||||
@ -42,9 +39,23 @@ export default {
|
||||
this.chart = null
|
||||
},
|
||||
methods: {
|
||||
initChart() {
|
||||
initChart(data) {
|
||||
this.chart = echarts.init(this.$el, 'macarons')
|
||||
|
||||
let titleArray = []
|
||||
let dataArray = []
|
||||
let colorArray = ['#017EFA','#51CBFF']
|
||||
data.map((item,index)=>{
|
||||
titleArray.push(item.name)
|
||||
dataArray.push(
|
||||
{
|
||||
value: item.value,
|
||||
name:item.name,
|
||||
itemStyle: {
|
||||
color: colorArray[index]
|
||||
}
|
||||
}
|
||||
)
|
||||
})
|
||||
this.chart.setOption({
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
@ -53,7 +64,7 @@ export default {
|
||||
legend: {
|
||||
left: 'center',
|
||||
bottom: '10',
|
||||
data: ['PC端', '移动端']
|
||||
data: titleArray
|
||||
},
|
||||
series: [
|
||||
{
|
||||
@ -62,22 +73,7 @@ export default {
|
||||
roseType: 'radius',
|
||||
radius: [15, 95],
|
||||
center: ['50%', '38%'],
|
||||
data: [
|
||||
{
|
||||
value: 320,
|
||||
name: 'PC端',
|
||||
itemStyle: {
|
||||
color: '#017EFA'
|
||||
}
|
||||
},
|
||||
{
|
||||
value: 240,
|
||||
name: '移动端',
|
||||
itemStyle: {
|
||||
color: '#51CBFF'
|
||||
}
|
||||
}
|
||||
],
|
||||
data:dataArray,
|
||||
animationEasing: 'cubicInOut',
|
||||
animationDuration: 2600
|
||||
}
|
||||
|
@ -129,36 +129,36 @@
|
||||
<div style="width: 100%;padding: 12px 0">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="9">
|
||||
<div class="dl-liuliang-top dl-ip">累计总IP数:<span><countTo :startVal="0" :endVal="320" :duration="3000"/></span></div>
|
||||
<div class="dl-liuliang-top dl-ip" :title="rtnMap.ipInquiry.ipNum">累计总IP数:<span><countTo :startVal="0" :endVal="rtnMap.ipInquiry.ipNum" :duration="3000"/></span></div>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<div class="dl-liuliang-top dl-xunpan">累计询盘数:<span><countTo :startVal="0" :endVal="7150" :duration="3000"/></span></div>
|
||||
<div class="dl-liuliang-top dl-xunpan" :title="rtnMap.ipInquiry.inquiryNum">累计询盘数:<span><countTo :startVal="0" :endVal="rtnMap.ipInquiry.inquiryNum" :duration="3000"/></span></div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="3">
|
||||
<div class="dl-liuliang-bottom dl-ip">今日IP数<span><countTo :startVal="0" :endVal="7150" :duration="3000"/></span></div>
|
||||
<div class="dl-liuliang-bottom dl-ip" :title="rtnMap.ipInquiry.ipNumToday">今日IP数<span><countTo :startVal="0" :endVal="rtnMap.ipInquiry.ipNumToday" :duration="3000"/></span></div>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="dl-liuliang-bottom dl-ip">昨日IP数<span><countTo :startVal="0" :endVal="7150" :duration="3000"/></span></div>
|
||||
<div class="dl-liuliang-bottom dl-ip" :title="rtnMap.ipInquiry.ipNumYesterday">昨日IP数<span><countTo :startVal="0" :endVal="rtnMap.ipInquiry.ipNumYesterday" :duration="3000"/></span></div>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="dl-liuliang-bottom dl-ip">近30日IP数<span><countTo :startVal="0" :endVal="7150" :duration="3000"/></span></div>
|
||||
<div class="dl-liuliang-bottom dl-ip" :title="rtnMap.ipInquiry.ipNumMonth">近30日IP数<span><countTo :startVal="0" :endVal="rtnMap.ipInquiry.ipNumMonth" :duration="3000"/></span></div>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="dl-liuliang-bottom dl-xunpan">在线询盘数<span><countTo :startVal="0" :endVal="7150" :duration="3000"/></span></div>
|
||||
<div class="dl-liuliang-bottom dl-xunpan" :title="rtnMap.ipInquiry.formNum">在线询盘数<span><countTo :startVal="0" :endVal="rtnMap.ipInquiry.formNum" :duration="3000"/></span></div>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="dl-liuliang-bottom dl-xunpan">在线聊天数<span><countTo :startVal="0" :endVal="7150" :duration="3000"/></span></div>
|
||||
<div class="dl-liuliang-bottom dl-xunpan" :title="rtnMap.ipInquiry.chatNum">在线聊天数<span><countTo :startVal="0" :endVal="rtnMap.ipInquiry.chatNum" :duration="3000"/></span></div>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="dl-liuliang-bottom dl-xunpan">Email记录数<span><countTo :startVal="0" :endVal="7150" :duration="3000"/></span></div>
|
||||
<div class="dl-liuliang-bottom dl-xunpan" :title="rtnMap.ipInquiry.emailNum">Email记录数<span><countTo :startVal="0" :endVal="rtnMap.ipInquiry.emailNum" :duration="3000"/></span></div>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="dl-liuliang-bottom dl-xunpan">WhatsApp记录数<span><countTo :startVal="0" :endVal="7150" :duration="3000"/></span></div>
|
||||
<div class="dl-liuliang-bottom dl-xunpan" :title="rtnMap.ipInquiry.whatsAppNum">WhatsApp记录数<span><countTo :startVal="0" :endVal="rtnMap.ipInquiry.whatsAppNum" :duration="3000"/></span></div>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="dl-liuliang-bottom dl-xunpan">Teams记录数<span><countTo :startVal="0" :endVal="7150" :duration="3000"/></span></div>
|
||||
<div class="dl-liuliang-bottom dl-xunpan" :title="rtnMap.ipInquiry.teamsNum">Teams记录数<span><countTo :startVal="0" :endVal="rtnMap.ipInquiry.teamsNum" :duration="3000"/></span></div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
@ -175,7 +175,7 @@
|
||||
<span class="dl-title">询盘来路前十国家</span>
|
||||
</div>
|
||||
<div style="width: 100%;padding: 12px 0;height: 300px">
|
||||
<bar-chart/>
|
||||
<bar-chart ref="barChart" />
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
@ -187,7 +187,7 @@
|
||||
<span class="dl-title">询盘设备</span>
|
||||
</div>
|
||||
<div style="width: 100%;padding: 12px 0;height: 300px">
|
||||
<pie-chart/>
|
||||
<pie-chart ref="pieChart"/>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
@ -204,7 +204,7 @@
|
||||
<el-table
|
||||
:data="dataList"
|
||||
stripe
|
||||
height="250"
|
||||
height="350"
|
||||
style="width: 100%"
|
||||
header-row-class-name="custom-class"
|
||||
row-class-name="custom-row-class"
|
||||
@ -299,16 +299,23 @@ export default {
|
||||
prodEdit:0,
|
||||
newsAdd:0,
|
||||
newsEdit:0,
|
||||
}
|
||||
},
|
||||
ipInquiry:{
|
||||
ipNum:0,
|
||||
ipNumToday:0,
|
||||
ipNumYesterday:0,
|
||||
ipNumMonth:0,
|
||||
formNum:0,
|
||||
chatNum:0,
|
||||
teamsNum:0,
|
||||
whatsAppNum:0,
|
||||
emailNum:0,
|
||||
inquiryNum:0,
|
||||
},
|
||||
nationalData:[],
|
||||
equipmentData:[]
|
||||
},
|
||||
dataList: [{
|
||||
date: '2016-05-03',
|
||||
xunpan: 22,
|
||||
email: 22,
|
||||
whatsApp: 22,
|
||||
teams: 22,
|
||||
chat: 22
|
||||
}]
|
||||
dataList: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -327,6 +334,9 @@ export default {
|
||||
initData(){
|
||||
indexData({}).then(response => {
|
||||
this.rtnMap = response.data
|
||||
this.$refs.barChart.initChart(this.rtnMap.nationalData)
|
||||
this.$refs.pieChart.initChart(this.rtnMap.equipmentData)
|
||||
this.dataList = this.rtnMap.dataList
|
||||
});
|
||||
},
|
||||
goTarget(href) {
|
||||
|
@ -158,7 +158,6 @@
|
||||
<dict-tag :options="dict.type.view_type" :value="scope.row.viewType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="页面路径" align="center" prop="pageUrl"/>
|
||||
<el-table-column label="设备类型" align="center" prop="equipment">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.equipment_type" :value="scope.row.equipment"/>
|
||||
@ -319,11 +318,11 @@ export default {
|
||||
if (this.queryParams.dataRange && this.queryParams.dataRange.length > 1) {
|
||||
this.queryParams.startDate = this.formatDate(this.queryParams.dataRange[0])
|
||||
this.queryParams.endDate = this.formatDate(this.queryParams.dataRange[1])
|
||||
this.getList()
|
||||
} else {
|
||||
this.queryParams.startDate = null
|
||||
this.queryParams.endDate = null
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
/**
|
||||
* 格式化时间戳
|
||||
|
@ -1,10 +1,145 @@
|
||||
<template>
|
||||
<div class="app-container">www</div>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="120px">
|
||||
<el-form-item label="时间范围" prop="dataRange">
|
||||
<el-date-picker
|
||||
v-model="queryParams.dataRange"
|
||||
type="monthrange"
|
||||
align="right"
|
||||
unlink-panels
|
||||
range-separator="至"
|
||||
start-placeholder="开始月份"
|
||||
end-placeholder="结束月份"
|
||||
:picker-options="pickerOptions">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<line-chart ref="lineChart" :chart-data="lineChartData"></line-chart>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const lineChartData = {
|
||||
newVisitis: {
|
||||
expectedData: [100, 120, 161, 134, 105, 160, 165],
|
||||
actualData: [120, 82, 91, 154, 162, 140, 145]
|
||||
},
|
||||
messages: {
|
||||
expectedData: [200, 192, 120, 144, 160, 130, 140],
|
||||
actualData: [180, 160, 151, 106, 145, 150, 130]
|
||||
},
|
||||
purchases: {
|
||||
expectedData: [80, 100, 121, 104, 105, 90, 100],
|
||||
actualData: [120, 90, 100, 138, 142, 130, 130]
|
||||
},
|
||||
shoppings: {
|
||||
expectedData: [130, 140, 141, 142, 145, 150, 160],
|
||||
actualData: [120, 82, 91, 154, 162, 140, 130]
|
||||
}
|
||||
}
|
||||
import { inquiryChart } from "@/api/statistics/statistics";
|
||||
import LineChart from '../../dashboard/LineChart'
|
||||
import PanelGroup from '../../dashboard/PanelGroup'
|
||||
import RaddarChart from '../../dashboard/RaddarChart'
|
||||
export default {
|
||||
name: 'inquiryChart'
|
||||
name: 'inquiryChart',
|
||||
components: { RaddarChart, PanelGroup, LineChart },
|
||||
data() {
|
||||
return {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
dataRange: '',
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
tenantId: null
|
||||
},
|
||||
lineChartData: lineChartData.newVisitis,
|
||||
pickerOptions: {
|
||||
shortcuts: [{
|
||||
text: '本月',
|
||||
onClick(picker) {
|
||||
picker.$emit('pick', [new Date(), new Date()]);
|
||||
}
|
||||
}, {
|
||||
text: '今年至今',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date(new Date().getFullYear(), 0);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}, {
|
||||
text: '最近六个月',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setMonth(start.getMonth() - 6);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}]
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initDateRange()
|
||||
},
|
||||
methods:{
|
||||
initDateRange(){
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setMonth(start.getMonth() - 6);
|
||||
this.queryParams.dataRange = [start,end]
|
||||
this.handleQuery()
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
if (this.queryParams.dataRange && this.queryParams.dataRange.length > 1) {
|
||||
this.queryParams.startDate = this.formatDate(this.queryParams.dataRange[0],false)
|
||||
this.queryParams.endDate = this.formatDate(this.queryParams.dataRange[1],true)
|
||||
console.log(this.queryParams, '12')
|
||||
} else {
|
||||
this.queryParams.startDate = null
|
||||
this.queryParams.endDate = null
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm')
|
||||
this.initDateRange()
|
||||
},
|
||||
/**
|
||||
* 查询数据
|
||||
*/
|
||||
getList(){
|
||||
inquiryChart(this.queryParams).then(response => {
|
||||
this.rtnMap = response.data
|
||||
this.$refs.barChart.initChart(this.rtnMap.nationalData)
|
||||
this.$refs.pieChart.initChart(this.rtnMap.equipmentData)
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 格式化时间戳
|
||||
*/
|
||||
formatDate(timestamp,ifEnd) {
|
||||
const date = new Date(timestamp)
|
||||
const year = date.getFullYear()
|
||||
// 月份是从0开始的,所以要加1
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||
if(ifEnd){
|
||||
//取这个月最后一天
|
||||
const date = new Date(year, month, 0);
|
||||
return `${year}-${month}`+"-"+date.getDate();
|
||||
}else{
|
||||
//取这个月第一天
|
||||
return `${year}-${month}`+"-01"
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user