Merge branch 'master' of http://124.222.105.7:3000/dianliang/dl_site_system
This commit is contained in:
commit
dcb316cda6
@ -0,0 +1,118 @@
|
||||
package com.ruoyi.base.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.base.vo.ManagerVO;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.base.domain.BaseManager;
|
||||
import com.ruoyi.base.service.IBaseManagerService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 站点分配Controller
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-08-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base/manager")
|
||||
public class BaseManagerController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBaseManagerService baseManagerService;
|
||||
|
||||
/**
|
||||
* 查询站点分配列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:manager:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(ManagerVO baseManager,
|
||||
@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize)
|
||||
{
|
||||
Page<BaseManager> page = new Page<>(pageNum, pageSize);
|
||||
IPage<ManagerVO> list = baseManagerService.queryListPage(baseManager,page);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出站点分配列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:manager:export')")
|
||||
@Log(title = "站点分配", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BaseManager baseManager)
|
||||
{
|
||||
List<BaseManager> list = baseManagerService.list();
|
||||
ExcelUtil<BaseManager> util = new ExcelUtil<BaseManager>(BaseManager.class);
|
||||
util.exportExcel(response, list, "站点分配数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取站点分配详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:manager:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(baseManagerService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增站点分配
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:manager:add')")
|
||||
@Log(title = "站点分配", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ManagerVO baseManager) {
|
||||
baseManager.setTenantId(baseManager.getSiteId());
|
||||
LambdaQueryWrapper<BaseManager> lambdaQueryWrapper = new LambdaQueryWrapper<BaseManager>()
|
||||
.eq(BaseManager::getTenantId,baseManager.getSiteId());
|
||||
baseManagerService.remove(lambdaQueryWrapper);
|
||||
return toAjax(baseManagerService.save(baseManager));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改站点分配
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:manager:edit')")
|
||||
@Log(title = "站点分配", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BaseManager baseManager)
|
||||
{
|
||||
return toAjax(baseManagerService.updateById(baseManager));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除站点分配
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:manager:remove')")
|
||||
@Log(title = "站点分配", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
List<String> list = new ArrayList<>(Arrays.asList(ids));
|
||||
return toAjax(baseManagerService.removeByIds(list));
|
||||
}
|
||||
}
|
@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.base.vo.SiteVO;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -48,7 +49,7 @@ public class BaseSiteController extends BaseController {
|
||||
@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<BaseSite> page = new Page<>(pageNum, pageSize);
|
||||
IPage<BaseSite> list = baseSiteService.queryListPage(baseSite, page);
|
||||
IPage<SiteVO> list = baseSiteService.queryListPage(baseSite, page);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@ -61,7 +62,7 @@ public class BaseSiteController extends BaseController {
|
||||
**/
|
||||
@GetMapping("/listAll")
|
||||
public AjaxResult list() {
|
||||
return success(baseSiteService.list());
|
||||
return success(baseSiteService.getMySiteList());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -12,10 +12,7 @@ import com.ruoyi.base.service.IBaseInquiryService;
|
||||
import com.ruoyi.base.service.IBaseNationalService;
|
||||
import com.ruoyi.base.service.IBasePicService;
|
||||
import com.ruoyi.base.service.IBaseSiteInfoService;
|
||||
import com.ruoyi.busi.domain.BusiCategory;
|
||||
import com.ruoyi.busi.domain.BusiChatMain;
|
||||
import com.ruoyi.busi.domain.BusiInquiryItem;
|
||||
import com.ruoyi.busi.domain.BusiProdNew;
|
||||
import com.ruoyi.busi.domain.*;
|
||||
import com.ruoyi.busi.service.*;
|
||||
import com.ruoyi.busi.utils.CommonUtils;
|
||||
import com.ruoyi.busi.vo.BusiCategoryVO;
|
||||
@ -68,13 +65,13 @@ public class WebController extends BaseController {
|
||||
@Autowired
|
||||
private IBusiProdNewService prodNewService;
|
||||
@Autowired
|
||||
private IBaseNationalService nationalService;
|
||||
@Autowired
|
||||
private IBusiInquiryItemService inquiryItemService;
|
||||
@Autowired
|
||||
private IBusiChatMainService busiChatMainService;
|
||||
@Autowired
|
||||
private GoogleKeywordService googleKeywordService;
|
||||
private IBusiPageService pageService;
|
||||
@Autowired
|
||||
private CommonUtils commonUtils;
|
||||
|
||||
/**
|
||||
* 导航栏接口--所有分类
|
||||
@ -156,9 +153,12 @@ public class WebController extends BaseController {
|
||||
@ApiOperation("公司介绍-富文本-首页展示区域")
|
||||
@ApiImplicitParam(name = "tenantId", value = "站点唯一码", required = true, dataType = "string", paramType = "query", dataTypeClass = String.class)
|
||||
@GetMapping("/indexCompanyInfo")
|
||||
public R<String> indexCompanyInfo(@RequestParam(required = true) String tenantId) {
|
||||
public R<Map<String,String>> indexCompanyInfo(@RequestParam(required = true) String tenantId) {
|
||||
BaseSiteInfo baseSiteInfo = siteInfoService.getSiteInfo(tenantId);
|
||||
return R.ok(baseSiteInfo.getCompanyInfo());
|
||||
Map<String,String> map = new HashMap<>();
|
||||
map.put("content",baseSiteInfo.getCompanyInfo());
|
||||
map.put("contentApp",baseSiteInfo.getCompanyInfoApp());
|
||||
return R.ok(map);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -372,14 +372,7 @@ public class WebController extends BaseController {
|
||||
**/
|
||||
@PostMapping("/chatMain")
|
||||
public AjaxResult saveChatMain(@RequestBody BusiChatMain busiChatMain, HttpServletRequest request) {
|
||||
String ip = "";
|
||||
String nationalStr = "";
|
||||
try {
|
||||
ip = CommonUtils.getIpAddr(request);
|
||||
nationalStr = CommonUtils.getAddr(ip);
|
||||
} catch (Exception e) {
|
||||
logger.error("识别所属国家失败");
|
||||
}
|
||||
String ip = CommonUtils.getIpAddr(request);
|
||||
ip = StringUtils.isNotEmpty(ip) ? ip : "未知";
|
||||
BusiChatMain result = busiChatMainService.queryByIpAndCusCode(ip, busiChatMain.getCusCode(), busiChatMain.getProdId());
|
||||
if (result != null) {
|
||||
@ -389,17 +382,10 @@ public class WebController extends BaseController {
|
||||
}
|
||||
return success(result);
|
||||
} else {
|
||||
nationalStr = StringUtils.isNotEmpty(nationalStr) ? nationalStr : "未知";
|
||||
String national = nationalStr.split("\\|")[0];
|
||||
System.out.println(ip + "-----" + nationalStr);
|
||||
String oceania = "未知";
|
||||
Map<String, String> nationalMap = nationalService.getNationalMap();
|
||||
if (nationalMap.containsKey(national)) {
|
||||
oceania = nationalMap.get(national);
|
||||
}
|
||||
busiChatMain.setIp(ip);
|
||||
busiChatMain.setNational(nationalStr);
|
||||
busiChatMain.setOceania(oceania);
|
||||
Map<String,String> ipMap = commonUtils.getIPAndCountry(request);
|
||||
busiChatMain.setIp(ipMap.get("ip"));
|
||||
busiChatMain.setNational(ipMap.get("national"));
|
||||
busiChatMain.setOceania(ipMap.get("oceania"));
|
||||
busiChatMain.setNums(0);
|
||||
busiChatMainService.save(busiChatMain);
|
||||
return success(busiChatMain);
|
||||
@ -441,26 +427,10 @@ public class WebController extends BaseController {
|
||||
})
|
||||
@PostMapping("/inquirySave")
|
||||
public R<String> inquirySave(@ApiIgnore @RequestBody BusiInquiryItem inquiryItem, HttpServletRequest request) {
|
||||
String ip = "";
|
||||
String nationalStr = "";
|
||||
try {
|
||||
ip = CommonUtils.getIpAddr(request);
|
||||
nationalStr = CommonUtils.getAddr(ip);
|
||||
} catch (Exception e) {
|
||||
logger.error("识别所属国家失败");
|
||||
}
|
||||
ip = StringUtils.isNotEmpty(ip) ? ip : "未知";
|
||||
nationalStr = StringUtils.isNotEmpty(nationalStr) ? nationalStr : "未知";
|
||||
String national = nationalStr.split("\\|")[0];
|
||||
System.out.println(ip + "-----" + nationalStr);
|
||||
String oceania = "未知";
|
||||
Map<String, String> nationalMap = nationalService.getNationalMap();
|
||||
if (nationalMap.containsKey(national)) {
|
||||
oceania = nationalMap.get(national);
|
||||
}
|
||||
inquiryItem.setIp(ip);
|
||||
inquiryItem.setNational(national);
|
||||
inquiryItem.setOceania(oceania);
|
||||
Map<String,String> ipMap = commonUtils.getIPAndCountry(request);
|
||||
inquiryItem.setIp(ipMap.get("ip"));
|
||||
inquiryItem.setNational(ipMap.get("national"));
|
||||
inquiryItem.setOceania(ipMap.get("oceania"));
|
||||
inquiryItemService.save(inquiryItem);
|
||||
return R.ok();
|
||||
}
|
||||
@ -480,4 +450,24 @@ public class WebController extends BaseController {
|
||||
public R<List<SiteMapVO>> siteMap(@RequestParam(required = true) String tenantId, @RequestParam(required = true) String catgType){
|
||||
return R.ok(prodNewService.getSiteMap(tenantId,catgType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 记录网页访问次数
|
||||
* @author vinjor-M
|
||||
* @date 10:04 2025/7/8
|
||||
* @return com.ruoyi.common.core.domain.AjaxResult
|
||||
**/
|
||||
@ApiOperation("记录网页访问次数")
|
||||
@ApiImplicitParams(value = {
|
||||
@ApiImplicitParam(name = "url", value = "网页地址", required = true, paramType = "body"),
|
||||
@ApiImplicitParam(name = "tenantId", value = "站点编码", required = true, paramType = "body"),
|
||||
@ApiImplicitParam(name = "equipment", value = "设备类型(移动端|电脑端)", required = true, paramType = "body")
|
||||
})
|
||||
@PostMapping("/pageSave")
|
||||
public R<String> pageSave(@ApiIgnore @RequestBody BusiPage busiPage, HttpServletRequest request) {
|
||||
busiPage.setIp(CommonUtils.getIpAddr(request));
|
||||
busiPage.setCreateTime(new Date());
|
||||
pageService.pageSave(busiPage);
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,39 @@
|
||||
package com.ruoyi.base.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
import com.ruoyi.common.core.domain.DlBaseEntity;
|
||||
|
||||
/**
|
||||
* 站点分配对象 dl_base_manager
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-08-11
|
||||
*/
|
||||
@TableName("dl_base_manager")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BaseManager extends DlBaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
/** 用户id */
|
||||
@Excel(name = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/** 站点唯一编码 */
|
||||
@Excel(name = "站点唯一编码")
|
||||
private String tenantId;
|
||||
|
||||
}
|
@ -97,6 +97,11 @@ public class BaseSiteInfo extends DlBaseEntity
|
||||
@ApiModelProperty("公司介绍")
|
||||
private String companyInfo;
|
||||
|
||||
/** 公司介绍-移动端 */
|
||||
@Excel(name = "公司介绍-移动端")
|
||||
@ApiModelProperty("公司介绍-移动端")
|
||||
private String companyInfoApp;
|
||||
|
||||
/** 站点唯一编码(租户id) */
|
||||
@Excel(name = "站点唯一编码", readConverterExp = "租=户id")
|
||||
@ApiModelProperty("站点唯一编码")
|
||||
|
@ -0,0 +1,25 @@
|
||||
package com.ruoyi.base.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.base.domain.BaseManager;
|
||||
import com.ruoyi.base.vo.ManagerVO;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 站点分配Mapper接口
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-08-11
|
||||
*/
|
||||
@Mapper
|
||||
public interface BaseManagerMapper extends BaseMapper<BaseManager>
|
||||
{
|
||||
IPage<ManagerVO> queryListPage(@Param("entity") ManagerVO entity, Page<BaseManager> page);
|
||||
|
||||
List<SysUser> selectManagerUserByTenantId(@Param("tenantId")String tenantId);
|
||||
}
|
@ -4,6 +4,7 @@ import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.base.domain.BaseSite;
|
||||
import com.ruoyi.base.vo.SiteVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@ -17,5 +18,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface BaseSiteMapper extends BaseMapper<BaseSite>
|
||||
{
|
||||
IPage<BaseSite> queryListPage(@Param("entity") BaseSite entity, Page<BaseSite> page);
|
||||
IPage<SiteVO> queryListPage(@Param("entity") BaseSite entity, Page<BaseSite> page);
|
||||
|
||||
List<BaseSite> selectByUserId(@Param("userId")Long userId);
|
||||
}
|
||||
|
@ -0,0 +1,30 @@
|
||||
package com.ruoyi.base.service;
|
||||
|
||||
import java.util.List;
|
||||
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.base.domain.BaseManager;
|
||||
import com.ruoyi.base.vo.ManagerVO;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
|
||||
/**
|
||||
* 站点分配Service接口
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-08-11
|
||||
*/
|
||||
public interface IBaseManagerService extends IService<BaseManager> {
|
||||
IPage<ManagerVO> queryListPage(ManagerVO pageReqVO, Page<BaseManager> page);
|
||||
|
||||
/**
|
||||
* 根据站点编码查负责的用户
|
||||
* @author vinjor-M
|
||||
* @date 15:33 2025/8/11
|
||||
* @param tenantId TODO
|
||||
* @return java.util.List<com.ruoyi.common.core.domain.entity.SysUser>
|
||||
**/
|
||||
List<SysUser> getManagerUserByTenantId(String tenantId);
|
||||
|
||||
|
||||
}
|
@ -5,6 +5,7 @@ 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.base.domain.BaseSite;
|
||||
import com.ruoyi.base.vo.SiteVO;
|
||||
|
||||
/**
|
||||
* 站点管理Service接口
|
||||
@ -14,5 +15,13 @@ import com.ruoyi.base.domain.BaseSite;
|
||||
*/
|
||||
public interface IBaseSiteService extends IService<BaseSite>
|
||||
{
|
||||
IPage<BaseSite> queryListPage(BaseSite pageReqVO, Page<BaseSite> page);
|
||||
IPage<SiteVO> queryListPage(BaseSite pageReqVO, Page<BaseSite> page);
|
||||
|
||||
/**
|
||||
* 查询本人可以管理的站点
|
||||
* @author vinjor-M
|
||||
* @date 16:17 2025/8/11
|
||||
* @return java.util.List<com.ruoyi.base.domain.BaseSite>
|
||||
**/
|
||||
List<BaseSite> getMySiteList();
|
||||
}
|
||||
|
@ -0,0 +1,46 @@
|
||||
package com.ruoyi.base.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.base.vo.ManagerVO;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.base.mapper.BaseManagerMapper;
|
||||
import com.ruoyi.base.domain.BaseManager;
|
||||
import com.ruoyi.base.service.IBaseManagerService;
|
||||
|
||||
/**
|
||||
* 站点分配Service业务层处理
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-08-11
|
||||
*/
|
||||
@Service
|
||||
public class BaseManagerServiceImpl extends ServiceImpl<BaseManagerMapper,BaseManager> implements IBaseManagerService
|
||||
{
|
||||
@Autowired
|
||||
private BaseManagerMapper baseManagerMapper;
|
||||
|
||||
@Override
|
||||
public IPage<ManagerVO> queryListPage(ManagerVO pageReqVO, Page<BaseManager> page) {
|
||||
return baseManagerMapper.queryListPage(pageReqVO, page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据站点编码查负责的用户
|
||||
*
|
||||
* @param tenantId TODO
|
||||
* @return java.util.List<com.ruoyi.common.core.domain.entity.SysUser>
|
||||
* @author vinjor-M
|
||||
* @date 15:33 2025/8/11
|
||||
**/
|
||||
@Override
|
||||
public List<SysUser> getManagerUserByTenantId(String tenantId) {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -1,9 +1,12 @@
|
||||
package com.ruoyi.base.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.base.vo.SiteVO;
|
||||
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.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -24,7 +27,24 @@ public class BaseSiteServiceImpl extends ServiceImpl<BaseSiteMapper,BaseSite> i
|
||||
private BaseSiteMapper baseSiteMapper;
|
||||
|
||||
@Override
|
||||
public IPage<BaseSite> queryListPage(BaseSite pageReqVO, Page<BaseSite> page) {
|
||||
public IPage<SiteVO> queryListPage(BaseSite pageReqVO, Page<BaseSite> page) {
|
||||
return baseSiteMapper.queryListPage(pageReqVO, page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询本人可以管理的站点
|
||||
*
|
||||
* @return java.util.List<com.ruoyi.base.domain.BaseSite>
|
||||
* @author vinjor-M
|
||||
* @date 16:17 2025/8/11
|
||||
**/
|
||||
@Override
|
||||
public List<BaseSite> getMySiteList() {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
if(1==userId){
|
||||
//超级管理员,查所有站点
|
||||
return this.list();
|
||||
}
|
||||
return baseSiteMapper.selectByUserId(userId);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,25 @@
|
||||
package com.ruoyi.base.vo;
|
||||
|
||||
import com.ruoyi.base.domain.BaseManager;
|
||||
import com.ruoyi.base.domain.BasePics;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class ManagerVO extends BaseManager {
|
||||
/**
|
||||
* 站点名称
|
||||
**/
|
||||
private String siteName;
|
||||
/**
|
||||
* 用户名称
|
||||
**/
|
||||
private String userName;
|
||||
/**
|
||||
* 站点名称
|
||||
**/
|
||||
private String siteId;
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.ruoyi.base.vo;
|
||||
|
||||
import com.ruoyi.base.domain.BaseSite;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class SiteVO extends BaseSite {
|
||||
/**
|
||||
* 站点管理人姓名
|
||||
**/
|
||||
private String managerUser;
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
package com.ruoyi.busi.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.busi.vo.BusiPageVO;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.busi.domain.BusiPage;
|
||||
import com.ruoyi.busi.service.IBusiPageService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 全站网页访问次数统计Controller
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-08-07
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/busi/page")
|
||||
public class BusiPageController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBusiPageService busiPageService;
|
||||
|
||||
/**
|
||||
* 查询全站网页访问次数统计列表---排名前10
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('busi:page:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(BusiPageVO busiPage){
|
||||
return success(busiPageService.queryListNum(busiPage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出全站网页访问次数统计列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('busi:page:export')")
|
||||
@Log(title = "全站网页访问次数统计", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BusiPage busiPage)
|
||||
{
|
||||
List<BusiPage> list = busiPageService.list();
|
||||
ExcelUtil<BusiPage> util = new ExcelUtil<BusiPage>(BusiPage.class);
|
||||
util.exportExcel(response, list, "全站网页访问次数统计数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全站网页访问次数统计详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('busi:page:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(busiPageService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增全站网页访问次数统计
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('busi:page:add')")
|
||||
@Log(title = "全站网页访问次数统计", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BusiPage busiPage)
|
||||
{
|
||||
return toAjax(busiPageService.save(busiPage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改全站网页访问次数统计
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('busi:page:edit')")
|
||||
@Log(title = "全站网页访问次数统计", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BusiPage busiPage)
|
||||
{
|
||||
return toAjax(busiPageService.updateById(busiPage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除全站网页访问次数统计
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('busi:page:remove')")
|
||||
@Log(title = "全站网页访问次数统计", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
List<Long> list = new ArrayList<>(Arrays.asList(ids));
|
||||
return toAjax(busiPageService.removeByIds(list));
|
||||
}
|
||||
}
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.busi.domain.BusiThirdItem;
|
||||
import com.ruoyi.busi.service.IBusiProdNewService;
|
||||
import com.ruoyi.busi.service.IBusiThirdItemService;
|
||||
import com.ruoyi.busi.vo.ChartDataVO;
|
||||
import com.ruoyi.busi.vo.ThirdVO;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
@ -66,4 +67,19 @@ public class StatisticsController extends BaseController
|
||||
public AjaxResult countryChart(String tenantId,String startDate,String endDate){
|
||||
return success(busiThirdItemService.nationalData(tenantId,startDate,endDate,null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 询盘国家列表--分页表格
|
||||
*/
|
||||
@GetMapping("/inquiryCountryList")
|
||||
public AjaxResult inquiryCountryList(@RequestParam(name = "tenantId", defaultValue = "1") String tenantId,
|
||||
@RequestParam(name = "startDate", defaultValue = "1") String startDate,
|
||||
@RequestParam(name = "endDate", defaultValue = "1") String endDate,
|
||||
@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize){
|
||||
List<ChartDataVO> list = busiThirdItemService.nationalData(tenantId,startDate,endDate,null);
|
||||
int startIndex = (pageNum-1)*pageSize;
|
||||
int endIndex = Math.min(startIndex+pageSize,list.size());
|
||||
return success(list.subList(startIndex,endIndex));
|
||||
}
|
||||
}
|
||||
|
@ -84,16 +84,28 @@ public class BusiCategory extends DlBaseEntity
|
||||
@Excel(name = "内容html", readConverterExp = "适=用于单页面+询盘")
|
||||
@ApiModelProperty("内容html")
|
||||
private String content;
|
||||
/** 内容html-移动端(适用于单页面+询盘) */
|
||||
@Excel(name = "内容html-移动端", readConverterExp = "适=用于单页面+询盘")
|
||||
@ApiModelProperty("内容html-移动端")
|
||||
private String contentApp;
|
||||
|
||||
/** 产品上方内容html(适用于产品) */
|
||||
@Excel(name = "产品上方内容html", readConverterExp = "适=用于产品")
|
||||
@ApiModelProperty("产品上方内容html")
|
||||
private String prodUp;
|
||||
/** 产品上方内容html-移动端(适用于产品) */
|
||||
@Excel(name = "产品上方内容html-移动端", readConverterExp = "适=用于产品")
|
||||
@ApiModelProperty("产品上方内容html-移动端")
|
||||
private String prodUpApp;
|
||||
|
||||
/** 产品下方内容html(适用于产品) */
|
||||
@Excel(name = "产品下方内容html", readConverterExp = "适=用于产品")
|
||||
@ApiModelProperty("产品下方内容html")
|
||||
private String prodDown;
|
||||
/** 产品下方内容html-移动端(适用于产品) */
|
||||
@Excel(name = "产品下方内容html-移动端", readConverterExp = "适=用于产品")
|
||||
@ApiModelProperty("产品下方内容html-移动端")
|
||||
private String prodDownApp;
|
||||
|
||||
/** 站点唯一编码(租户id) */
|
||||
@Excel(name = "站点唯一编码", readConverterExp = "租=户id")
|
||||
|
@ -0,0 +1,64 @@
|
||||
package com.ruoyi.busi.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.*;
|
||||
import com.ruoyi.common.core.domain.DlBaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 全站网页访问次数统计对象 dl_busi_page
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-08-07
|
||||
*/
|
||||
@TableName("dl_busi_page")
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "BusiPage", description = "网页访问次数实体")
|
||||
public class BusiPage
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
/** 网页地址 */
|
||||
@Excel(name = "网页地址")
|
||||
@ApiModelProperty("网页地址")
|
||||
private String url;
|
||||
|
||||
/** 设备类型 */
|
||||
@Excel(name = "设备类型")
|
||||
@ApiModelProperty("设备类型")
|
||||
private String equipment;
|
||||
|
||||
/** 来源IP */
|
||||
@Excel(name = "来源IP")
|
||||
private String ip;
|
||||
|
||||
/** 来源国家 */
|
||||
@Excel(name = "来源国家")
|
||||
private String national;
|
||||
/** 洲 */
|
||||
@Excel(name = "洲")
|
||||
private String oceania;
|
||||
|
||||
/** 站点唯一编码(租户id) */
|
||||
@Excel(name = "站点唯一编码", readConverterExp = "租=户id")
|
||||
@ApiModelProperty("站点唯一编码")
|
||||
private String tenantId;
|
||||
/** 创建时间 */
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.ruoyi.busi.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.busi.domain.BusiPage;
|
||||
import com.ruoyi.busi.vo.BusiPageVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 全站网页访问次数统计Mapper接口
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-08-07
|
||||
*/
|
||||
@Mapper
|
||||
public interface BusiPageMapper extends BaseMapper<BusiPage>
|
||||
{
|
||||
IPage<BusiPage> queryListPage(@Param("entity") BusiPage entity, Page<BusiPage> page);
|
||||
|
||||
List<BusiPageVO> selectListCus(@Param("entity")BusiPageVO busiPageVO);
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.ruoyi.busi.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
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.BusiPage;
|
||||
import com.ruoyi.busi.vo.BusiPageVO;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 全站网页访问次数统计Service接口
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-08-07
|
||||
*/
|
||||
public interface IBusiPageService extends IService<BusiPage>
|
||||
{
|
||||
IPage<BusiPage> queryListPage(BusiPage pageReqVO, Page<BusiPage> page);
|
||||
|
||||
/**
|
||||
* 保存网页访问记录
|
||||
* @author vinjor-M
|
||||
* @date 11:13 2025/8/7
|
||||
* @param busiPage TODO
|
||||
**/
|
||||
void pageSave(BusiPage busiPage);
|
||||
|
||||
/**
|
||||
* 查全站访问网页前十
|
||||
* @author vinjor-M
|
||||
* @date 16:52 2025/8/7
|
||||
* @param busiPage TODO
|
||||
* @return java.util.List<com.ruoyi.busi.vo.BusiPageVO>
|
||||
**/
|
||||
List<BusiPageVO> queryListNum(BusiPageVO busiPage);
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
package com.ruoyi.busi.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.busi.utils.CommonUtils;
|
||||
import com.ruoyi.busi.vo.BusiPageVO;
|
||||
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.StrConstants;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.busi.mapper.BusiPageMapper;
|
||||
import com.ruoyi.busi.domain.BusiPage;
|
||||
import com.ruoyi.busi.service.IBusiPageService;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 全站网页访问次数统计Service业务层处理
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-08-07
|
||||
*/
|
||||
@Service
|
||||
public class BusiPageServiceImpl extends ServiceImpl<BusiPageMapper,BusiPage> implements IBusiPageService
|
||||
{
|
||||
@Autowired
|
||||
private BusiPageMapper busiPageMapper;
|
||||
@Autowired
|
||||
private CommonUtils commonUtils;
|
||||
|
||||
@Override
|
||||
public IPage<BusiPage> queryListPage(BusiPage pageReqVO, Page<BusiPage> page) {
|
||||
return busiPageMapper.queryListPage(pageReqVO, page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存网页访问记录
|
||||
*
|
||||
* @param busiPage TODO
|
||||
* @author vinjor-M
|
||||
* @date 11:13 2025/8/7
|
||||
**/
|
||||
@Override
|
||||
public void pageSave(BusiPage busiPage) {
|
||||
// 2. 异步保存到数据库(RuoYi已内置线程池)
|
||||
CompletableFuture.runAsync(() -> {
|
||||
Map<String,String> ipMap = commonUtils.getCountryByIp(busiPage.getIp());
|
||||
busiPage.setNational(ipMap.get("national"));
|
||||
busiPage.setOceania(ipMap.get("oceania"));
|
||||
this.save(busiPage);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查全站访问网页前十
|
||||
*
|
||||
* @param busiPage TODO
|
||||
* @return java.util.List<com.ruoyi.busi.vo.BusiPageVO>
|
||||
* @author vinjor-M
|
||||
* @date 16:52 2025/8/7
|
||||
**/
|
||||
@Override
|
||||
public List<BusiPageVO> queryListNum(BusiPageVO busiPage) {
|
||||
if(StringUtils.isNotEmpty(busiPage.getStartDate())){
|
||||
busiPage.setStartDate(busiPage.getStartDate()+ StrConstants.START_DATE);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(busiPage.getEndDate())){
|
||||
busiPage.setEndDate(busiPage.getEndDate()+StrConstants.END_DATE);
|
||||
}
|
||||
List<BusiPageVO> rtnList = new ArrayList<>();
|
||||
List<BusiPageVO> dataList = busiPageMapper.selectListCus(busiPage);
|
||||
// 1. 按 url 分组并统计数量
|
||||
Map<String, Long> countMap = dataList.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
// 分组字段
|
||||
BusiPageVO::getUrl,
|
||||
// 统计数量
|
||||
Collectors.counting()
|
||||
));
|
||||
// 2. 按数量降序排序,并取前10
|
||||
List<Map.Entry<String, Long>> top10 = countMap.entrySet().stream()
|
||||
// 降序排序
|
||||
.sorted((e1, e2) -> e2.getValue().compareTo(e1.getValue()))
|
||||
// 取前10
|
||||
.limit(10)
|
||||
.collect(Collectors.toList());
|
||||
top10.forEach(item->{
|
||||
BusiPageVO pageVO = new BusiPageVO();
|
||||
pageVO.setUrl(item.getKey());
|
||||
pageVO.setNum(item.getValue());
|
||||
rtnList.add(pageVO);
|
||||
});
|
||||
return rtnList;
|
||||
}
|
||||
}
|
@ -1,9 +1,12 @@
|
||||
package com.ruoyi.busi.utils;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.base.service.IBaseNationalService;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.lionsoul.ip2region.xdb.Searcher;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@ -24,6 +27,9 @@ import java.util.stream.Collectors;
|
||||
@Slf4j
|
||||
public class CommonUtils {
|
||||
|
||||
@Autowired
|
||||
private IBaseNationalService nationalService;
|
||||
|
||||
private static final String UNKNOWN = "unknown";
|
||||
|
||||
/**
|
||||
@ -102,4 +108,60 @@ public class CommonUtils {
|
||||
}
|
||||
return yearMonthList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据请求查询IP、所属国家和洲
|
||||
* @author vinjor-M
|
||||
* @date 15:48 2025/8/7
|
||||
* @return java.util.Map<java.lang.String,java.lang.Object>
|
||||
**/
|
||||
public Map<String,String> getIPAndCountry(HttpServletRequest request){
|
||||
Map<String,String> rtnMap = new HashMap<>();
|
||||
String ip = "";
|
||||
String nationalStr = "";
|
||||
try {
|
||||
ip = CommonUtils.getIpAddr(request);
|
||||
nationalStr = CommonUtils.getAddr(ip);
|
||||
} catch (Exception e) {
|
||||
log.error("识别所属国家失败");
|
||||
}
|
||||
ip = StringUtils.isNotEmpty(ip) ? ip : "未知";
|
||||
nationalStr = StringUtils.isNotEmpty(nationalStr) ? nationalStr : "未知";
|
||||
String national = nationalStr.split("\\|")[0];
|
||||
String oceania = "未知";
|
||||
Map<String, String> nationalMap = nationalService.getNationalMap();
|
||||
if (nationalMap.containsKey(national)) {
|
||||
oceania = nationalMap.get(national);
|
||||
}
|
||||
rtnMap.put("ip",ip);
|
||||
rtnMap.put("national",national);
|
||||
rtnMap.put("oceania",oceania);
|
||||
return rtnMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据IP查询所属国家和洲
|
||||
* @author vinjor-M
|
||||
* @date 15:48 2025/8/7
|
||||
* @return java.util.Map<java.lang.String,java.lang.Object>
|
||||
**/
|
||||
public Map<String,String> getCountryByIp(String ip){
|
||||
Map<String,String> rtnMap = new HashMap<>();
|
||||
String nationalStr = "";
|
||||
try {
|
||||
nationalStr = CommonUtils.getAddr(ip);
|
||||
} catch (Exception e) {
|
||||
log.error("识别所属国家失败");
|
||||
}
|
||||
nationalStr = StringUtils.isNotEmpty(nationalStr) ? nationalStr : "未知";
|
||||
String national = nationalStr.split("\\|")[0];
|
||||
String oceania = "未知";
|
||||
Map<String, String> nationalMap = nationalService.getNationalMap();
|
||||
if (nationalMap.containsKey(national)) {
|
||||
oceania = nationalMap.get(national);
|
||||
}
|
||||
rtnMap.put("national",national);
|
||||
rtnMap.put("oceania",oceania);
|
||||
return rtnMap;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,19 @@
|
||||
package com.ruoyi.busi.vo;
|
||||
|
||||
import com.ruoyi.busi.domain.BusiPage;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class BusiPageVO extends BusiPage {
|
||||
|
||||
/** 时间范围-开始 */
|
||||
private String startDate;
|
||||
/** 时间范围-结束 */
|
||||
private String endDate;
|
||||
/** 访问次数 */
|
||||
private Long num;
|
||||
/** 是否归属中国 */
|
||||
private Boolean ifChina;
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.base.mapper.BaseManagerMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.base.vo.ManagerVO" id="BaseManagerResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="tenantId" column="tenant_id" />
|
||||
<result property="creator" column="creator" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updater" column="updater" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="userName" column="userName" />
|
||||
<result property="siteName" column="siteName" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBaseManagerVo">
|
||||
select id, user_id, tenant_id, creator, create_time, updater, update_time, del_flag from dl_base_manager
|
||||
</sql>
|
||||
|
||||
<select id="queryListPage" parameterType="BaseManager" resultMap="BaseManagerResult">
|
||||
SELECT
|
||||
dbm.*,
|
||||
su.nick_name AS userName,
|
||||
dbs.site_name AS siteName
|
||||
FROM
|
||||
dl_base_manager dbm
|
||||
LEFT JOIN sys_user su ON dbm.user_id = su.user_id
|
||||
LEFT JOIN dl_base_site dbs ON dbm.tenant_id = dbs.id
|
||||
WHERE
|
||||
dbm.del_flag = '0'
|
||||
<if test="entity.userName != null and entity.userName !=''"> and su.nick_name like concat('%',#{entity.userName},'%')</if>
|
||||
</select>
|
||||
<select id="selectManagerUserByTenantId" resultType="com.ruoyi.common.core.domain.entity.SysUser">
|
||||
SELECT
|
||||
su.*
|
||||
FROM
|
||||
dl_base_manager dbm
|
||||
LEFT JOIN sys_user su ON dbm.user_id = su.user_id
|
||||
WHERE dbm.del_flag = '0'
|
||||
AND dbm.tenant_id =#{tenantId}
|
||||
</select>
|
||||
</mapper>
|
@ -19,6 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="qrCode" column="qr_code" />
|
||||
<result property="contactUs" column="contact_us" />
|
||||
<result property="companyInfo" column="company_info" />
|
||||
<result property="companyInfoApp" column="company_info_app" />
|
||||
<result property="tenantId" column="tenant_id" />
|
||||
<result property="creator" column="creator" />
|
||||
<result property="createTime" column="create_time" />
|
||||
@ -28,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBaseSiteInfoVo">
|
||||
select id, company_name, fax_number, brand_name, tel, email, teams, copyright, address, icon, logo, qr_code, contact_us,company_info, tenant_id, creator, create_time, updater, update_time, del_flag from dl_base_site_info
|
||||
select id, company_name, fax_number, brand_name, tel, email, teams, copyright, address, icon, logo, qr_code, contact_us,company_info,company_info_app, tenant_id, creator, create_time, updater, update_time, del_flag from dl_base_site_info
|
||||
</sql>
|
||||
|
||||
<select id="queryListPage" parameterType="BaseSiteInfo" resultMap="BaseSiteInfoResult">
|
||||
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.base.mapper.BaseSiteMapper">
|
||||
|
||||
<resultMap type="BaseSite" id="BaseSiteResult">
|
||||
<resultMap type="com.ruoyi.base.vo.SiteVO" id="BaseSiteResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="siteName" column="site_name" />
|
||||
<result property="siteUrl" column="site_url" />
|
||||
@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updater" column="updater" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="managerUser" column="managerUser" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBaseSiteVo">
|
||||
@ -21,12 +22,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</sql>
|
||||
|
||||
<select id="queryListPage" parameterType="BaseSite" resultMap="BaseSiteResult">
|
||||
<include refid="selectBaseSiteVo"/>
|
||||
<where>
|
||||
and del_flag='0'
|
||||
<if test="entity.siteName != null and entity.siteName != ''"> and site_name like concat('%', #{entity.siteName}, '%')</if>
|
||||
<if test="entity.siteUrl != null and entity.siteUrl != ''"> and site_url = #{entity.siteUrl}</if>
|
||||
<if test="entity.siteContent != null and entity.siteContent != ''"> and site_content = #{entity.siteContent}</if>
|
||||
</where>
|
||||
SELECT
|
||||
dbs.*,
|
||||
GROUP_CONCAT( su.nick_name ) AS managerUser
|
||||
FROM
|
||||
dl_base_site dbs
|
||||
LEFT JOIN dl_base_manager dbm ON dbs.id = dbm.tenant_id
|
||||
AND dbm.del_flag = '0'
|
||||
LEFT JOIN sys_user su ON dbm.user_id = su.user_id
|
||||
WHERE
|
||||
dbs.del_flag = '0'
|
||||
<if test="entity.siteName != null and entity.siteName != ''"> and dbs.site_name like concat('%', #{entity.siteName}, '%')</if>
|
||||
<if test="entity.siteUrl != null and entity.siteUrl != ''"> and dbs.site_url = #{entity.siteUrl}</if>
|
||||
<if test="entity.siteContent != null and entity.siteContent != ''"> and dbs.site_content = #{entity.siteContent}</if>
|
||||
GROUP BY
|
||||
dbs.id
|
||||
|
||||
</select>
|
||||
<select id="selectByUserId" resultType="com.ruoyi.base.domain.BaseSite">
|
||||
SELECT
|
||||
dbs.*
|
||||
FROM
|
||||
dl_base_site dbs
|
||||
LEFT JOIN dl_base_manager dbm ON dbs.id = dbm.tenant_id
|
||||
AND dbm.del_flag = '0'
|
||||
WHERE
|
||||
dbs.del_flag = '0'
|
||||
AND dbm.user_id = #{userId}
|
||||
</select>
|
||||
</mapper>
|
@ -17,8 +17,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="description" column="description" />
|
||||
<result property="sort" column="sort" />
|
||||
<result property="content" column="content" />
|
||||
<result property="contentApp" column="content_app" />
|
||||
<result property="prodUp" column="prod_up" />
|
||||
<result property="prodUpApp" column="prod_up_app" />
|
||||
<result property="prodDown" column="prod_down" />
|
||||
<result property="prodDownApp" column="prod_down_app" />
|
||||
<result property="tenantId" column="tenant_id" />
|
||||
<result property="creator" column="creator" />
|
||||
<result property="createTime" column="create_time" />
|
||||
@ -28,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<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
|
||||
select id, catg_name, catg_level, catg_type, parent_id, prods_junior, prods_all, title, keyword, description, sort, content,content_app, prod_up,prod_up_app, prod_down,prod_down_app, tenant_id, creator, create_time, updater, update_time, del_flag from dl_busi_category
|
||||
</sql>
|
||||
<select id="selectAllChildren" resultType="java.lang.String">
|
||||
SELECT
|
||||
|
@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.busi.mapper.BusiPageMapper">
|
||||
|
||||
<resultMap type="BusiPage" id="BusiPageResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="url" column="url" />
|
||||
<result property="equipment" column="equipment" />
|
||||
<result property="ip" column="ip" />
|
||||
<result property="national" column="national" />
|
||||
<result property="oceania" column="oceania" />
|
||||
<result property="tenantId" column="tenant_id" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBusiPageVo">
|
||||
select id, url, equipment, ip, national,oceania, tenant_id, create_time from dl_busi_page
|
||||
</sql>
|
||||
|
||||
<select id="queryListPage" parameterType="BusiPage" resultMap="BusiPageResult">
|
||||
<include refid="selectBusiPageVo"/>
|
||||
<where>
|
||||
<if test="entity.url != null and entity.url != ''"> and url = #{entity.url}</if>
|
||||
<if test="entity.equipment != null and entity.equipment != ''"> and equipment = #{entity.equipment}</if>
|
||||
<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.tenantId != null and entity.tenantId != ''"> and tenant_id = #{entity.tenantId}</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectListCus" resultType="com.ruoyi.busi.vo.BusiPageVO">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
dl_busi_page
|
||||
WHERE
|
||||
tenant_id = 'main'
|
||||
<if test="entity.ifChina != null and entity.ifChina == true">
|
||||
AND national = '中国'
|
||||
</if>
|
||||
<if test="entity.ifChina != null and entity.ifChina == false">
|
||||
AND national != '中国'
|
||||
</if>
|
||||
<if test="entity.startDate != null and entity.startDate != ''">
|
||||
and create_time >= #{entity.startDate}
|
||||
</if>
|
||||
<if test="entity.endDate != null and entity.endDate != ''">
|
||||
and create_time <= #{entity.endDate}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
@ -5,7 +5,7 @@ VUE_APP_TITLE = 成事达管理平台
|
||||
ENV = 'development'
|
||||
|
||||
# 成事达管理平台/开发环境
|
||||
VUE_APP_BASE_API = 'http://127.0.0.1:8099'
|
||||
VUE_APP_BASE_API = 'http://192.168.1.13:8099'
|
||||
|
||||
# 路由懒加载
|
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
|
44
dl_vue/src/api/base/manager.js
Normal file
44
dl_vue/src/api/base/manager.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询站点分配列表
|
||||
export function listManager(query) {
|
||||
return request({
|
||||
url: '/base/manager/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询站点分配详细
|
||||
export function getManager(id) {
|
||||
return request({
|
||||
url: '/base/manager/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增站点分配
|
||||
export function addManager(data) {
|
||||
return request({
|
||||
url: '/base/manager',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改站点分配
|
||||
export function updateManager(data) {
|
||||
return request({
|
||||
url: '/base/manager',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除站点分配
|
||||
export function delManager(id) {
|
||||
return request({
|
||||
url: '/base/manager/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
44
dl_vue/src/api/busi/page.js
Normal file
44
dl_vue/src/api/busi/page.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询全站网页访问次数统计列表
|
||||
export function listPage(query) {
|
||||
return request({
|
||||
url: '/busi/page/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询全站网页访问次数统计详细
|
||||
export function getPage(id) {
|
||||
return request({
|
||||
url: '/busi/page/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增全站网页访问次数统计
|
||||
export function addPage(data) {
|
||||
return request({
|
||||
url: '/busi/page',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改全站网页访问次数统计
|
||||
export function updatePage(data) {
|
||||
return request({
|
||||
url: '/busi/page',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除全站网页访问次数统计
|
||||
export function delPage(id) {
|
||||
return request({
|
||||
url: '/busi/page/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
@ -1,35 +1,37 @@
|
||||
<template>
|
||||
<div class="navbar">
|
||||
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
|
||||
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container"
|
||||
@toggleClick="toggleSideBar"
|
||||
/>
|
||||
|
||||
<breadcrumb v-if="!topNav" id="breadcrumb-container" class="breadcrumb-container" />
|
||||
<top-nav v-if="topNav" id="topmenu-container" class="topmenu-container" />
|
||||
<breadcrumb v-if="!topNav" id="breadcrumb-container" class="breadcrumb-container"/>
|
||||
<top-nav v-if="topNav" id="topmenu-container" class="topmenu-container"/>
|
||||
|
||||
<div class="right-menu" style="display: flex">
|
||||
<template v-if="device!=='mobile'">
|
||||
<div>当前管理站点:{{tenantName}}</div>
|
||||
<search id="header-search" class="right-menu-item" />
|
||||
<div @click="changeSite">当前管理站点:{{ tenantName }}</div>
|
||||
<search id="header-search" class="right-menu-item"/>
|
||||
|
||||
<!-- <el-tooltip content="源码地址" effect="dark" placement="bottom">-->
|
||||
<!-- <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />-->
|
||||
<!-- </el-tooltip>-->
|
||||
<!-- <el-tooltip content="源码地址" effect="dark" placement="bottom">-->
|
||||
<!-- <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />-->
|
||||
<!-- </el-tooltip>-->
|
||||
|
||||
<!-- <el-tooltip content="文档地址" effect="dark" placement="bottom">-->
|
||||
<!-- <ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />-->
|
||||
<!-- </el-tooltip>-->
|
||||
<!-- <el-tooltip content="文档地址" effect="dark" placement="bottom">-->
|
||||
<!-- <ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />-->
|
||||
<!-- </el-tooltip>-->
|
||||
|
||||
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
||||
<screenfull id="screenfull" class="right-menu-item hover-effect"/>
|
||||
|
||||
<!-- <el-tooltip content="布局大小" effect="dark" placement="bottom">-->
|
||||
<!-- <size-select id="size-select" class="right-menu-item hover-effect" />-->
|
||||
<!-- </el-tooltip>-->
|
||||
<!-- <el-tooltip content="布局大小" effect="dark" placement="bottom">-->
|
||||
<!-- <size-select id="size-select" class="right-menu-item hover-effect" />-->
|
||||
<!-- </el-tooltip>-->
|
||||
|
||||
</template>
|
||||
|
||||
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
|
||||
<div class="avatar-wrapper">
|
||||
<img :src="avatar" class="user-avatar">
|
||||
<i class="el-icon-caret-bottom" />
|
||||
<i class="el-icon-caret-bottom"/>
|
||||
</div>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<router-link to="/user/profile">
|
||||
@ -44,6 +46,7 @@
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -72,9 +75,9 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tenantName:getTenantName(),
|
||||
tenantName: getTenantName(),
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
@ -98,6 +101,8 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
toggleSideBar() {
|
||||
this.$store.dispatch('app/toggleSideBar')
|
||||
@ -111,7 +116,11 @@ export default {
|
||||
this.$store.dispatch('LogOut').then(() => {
|
||||
location.href = '/index'
|
||||
})
|
||||
}).catch(() => {})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
changeSite(){
|
||||
this.$emit("changeSite")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -123,7 +132,7 @@ export default {
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
background: #fff;
|
||||
box-shadow: 0 1px 4px rgba(0,21,41,.08);
|
||||
box-shadow: 0 1px 4px rgba(0, 21, 41, .08);
|
||||
|
||||
.hamburger-container {
|
||||
line-height: 46px;
|
||||
@ -131,7 +140,7 @@ export default {
|
||||
float: left;
|
||||
cursor: pointer;
|
||||
transition: background .3s;
|
||||
-webkit-tap-highlight-color:transparent;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
|
||||
&:hover {
|
||||
background: rgba(0, 0, 0, .025)
|
||||
|
@ -4,7 +4,7 @@
|
||||
<sidebar v-if="!sidebar.hide" class="sidebar-container"/>
|
||||
<div :class="{hasTagsView:needTagsView,sidebarHide:sidebar.hide}" class="main-container">
|
||||
<div :class="{'fixed-header':fixedHeader}">
|
||||
<navbar/>
|
||||
<navbar :key="chooseSiteCode" @changeSite="showChangeSite"/>
|
||||
<tags-view v-if="needTagsView"/>
|
||||
</div>
|
||||
<app-main/>
|
||||
@ -12,6 +12,26 @@
|
||||
<settings/>
|
||||
</right-panel>
|
||||
</div>
|
||||
<el-dialog
|
||||
title="请选择管理的站点"
|
||||
:visible.sync="centerDialogVisible"
|
||||
width="30%"
|
||||
center
|
||||
>
|
||||
<el-select v-model="chooseSiteCode" placeholder="请选择" style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="centerDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="chooseSiteCodeFun">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -21,6 +41,8 @@ import { AppMain, Navbar, Settings, Sidebar, TagsView } from './components'
|
||||
import ResizeMixin from './mixin/ResizeHandler'
|
||||
import { mapState } from 'vuex'
|
||||
import variables from '@/assets/styles/variables.scss'
|
||||
import { listAllSite } from '@/api/base/site'
|
||||
import { getToken,getTenantId,setTenantId, setTenantName } from '@/utils/auth'
|
||||
|
||||
export default {
|
||||
name: 'Layout',
|
||||
@ -32,6 +54,14 @@ export default {
|
||||
Sidebar,
|
||||
TagsView
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
centerDialogVisible: false,
|
||||
//默认主站点
|
||||
chooseSiteCode: 'main',
|
||||
options: [],
|
||||
}
|
||||
},
|
||||
mixins: [ResizeMixin],
|
||||
computed: {
|
||||
...mapState({
|
||||
@ -54,10 +84,40 @@ export default {
|
||||
return variables;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.chooseSiteCode = getTenantId()
|
||||
this.getSiteList()
|
||||
},
|
||||
methods: {
|
||||
handleClickOutside() {
|
||||
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
|
||||
}
|
||||
},
|
||||
showChangeSite(){
|
||||
this.centerDialogVisible = true
|
||||
},
|
||||
getSiteList(){
|
||||
listAllSite().then(response => {
|
||||
if (response.data && response.data.length > 0) {
|
||||
response.data.map((item) => {
|
||||
this.options.push({
|
||||
value: item.id,
|
||||
label: item.siteName
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
chooseSiteCodeFun() {
|
||||
if (this.chooseSiteCode) {
|
||||
this.centerDialogVisible = false
|
||||
let chooseSiteObj = this.options.filter(item => item.value == this.chooseSiteCode)[0]
|
||||
setTenantId(this.chooseSiteCode)
|
||||
setTenantName(chooseSiteObj.label)
|
||||
window.location.reload()
|
||||
} else {
|
||||
this.$modal.msgWarning('请选择管理的站点')
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -89,15 +89,20 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="站点联系方式" prop="contactUs">
|
||||
<editor v-model="form.contactUs" :min-height="200"/>
|
||||
<el-form-item label="公司介绍" prop="companyInfo">
|
||||
<editor v-model="form.companyInfo" :min-height="400"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="公司介绍" prop="companyInfo">
|
||||
<editor v-model="form.companyInfo" :min-height="400"/>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="公司介绍-移动端" prop="contactUs">
|
||||
<editor v-model="form.companyInfoApp" :min-height="200"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="站点联系方式" prop="contactUs">
|
||||
<editor v-model="form.contactUs" :min-height="200"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -130,6 +135,7 @@ export default {
|
||||
qrCode: null,
|
||||
contactUs: null,
|
||||
companyInfo: null,
|
||||
companyInfoApp: null,
|
||||
tenantId: null,
|
||||
creator: null,
|
||||
createTime: null,
|
||||
|
263
dl_vue/src/views/base/manager/index.vue
Normal file
263
dl_vue/src/views/base/manager/index.vue
Normal file
@ -0,0 +1,263 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="用户姓名" prop="userId">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
placeholder="请输入用户姓名"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="站点" prop="tenantId">
|
||||
<el-input
|
||||
v-model="queryParams.tenantId"
|
||||
placeholder="请输入站点唯一编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</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>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['base:manager:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['base:manager:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['base:manager:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['base:manager:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="managerList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="用户" align="center" prop="userId" />
|
||||
<el-table-column label="站点" align="center" prop="tenantId" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['base:manager:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['base:manager:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改站点分配对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="用户id" prop="userId">
|
||||
<el-input v-model="form.userId" placeholder="请输入用户id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="站点唯一编码" prop="tenantId">
|
||||
<el-input v-model="form.tenantId" placeholder="请输入站点唯一编码" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listManager, getManager, delManager, addManager, updateManager } from "@/api/base/manager";
|
||||
|
||||
export default {
|
||||
name: "Manager",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 站点分配表格数据
|
||||
managerList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
userName: null,
|
||||
tenantId: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询站点分配列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listManager(this.queryParams).then(response => {
|
||||
this.managerList = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
userId: null,
|
||||
tenantId: null,
|
||||
creator: null,
|
||||
createTime: null,
|
||||
updater: null,
|
||||
updateTime: null,
|
||||
delFlag: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加站点分配";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getManager(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改站点分配";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateManager(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addManager(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除站点分配编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delManager(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('base/manager/export', {
|
||||
...this.queryParams
|
||||
}, `manager_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -74,6 +74,7 @@
|
||||
<el-table-column label="站点唯一编码" align="center" prop="id" />
|
||||
<el-table-column label="站点名称" align="center" prop="siteName" />
|
||||
<el-table-column label="站点网址" align="center" prop="siteUrl" />
|
||||
<el-table-column label="管理员" align="center" prop="managerUser" />
|
||||
<el-table-column label="站点描述" align="center" prop="siteContent" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
@ -84,6 +85,13 @@
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['base:site:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleManager(scope.row)"
|
||||
v-hasPermi="['base:manager:add']"
|
||||
>分配管理员</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@ -124,14 +132,21 @@
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 选择用户组件-->
|
||||
<select-all-user :multiple="false" ref="select" @ok="chooseUserFun" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import selectAllUser from "@/views/system/user/selectAllUser";
|
||||
import { listSite, getSite, delSite, addSite, updateSite } from "@/api/base/site";
|
||||
import { addManager } from "@/api/base/manager";
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
|
||||
export default {
|
||||
name: "Site",
|
||||
components: { selectAllUser},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
@ -165,7 +180,9 @@ export default {
|
||||
// 表单校验
|
||||
rules: {
|
||||
|
||||
}
|
||||
},
|
||||
//当前处理的数据id
|
||||
dealId:null,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@ -233,6 +250,11 @@ export default {
|
||||
this.title = "修改站点管理";
|
||||
});
|
||||
},
|
||||
/** 分配管理员 */
|
||||
handleManager(row){
|
||||
this.dealId = row.id
|
||||
this.$refs.select.show();
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
@ -268,6 +290,21 @@ export default {
|
||||
this.download('base/site/export', {
|
||||
...this.queryParams
|
||||
}, `site_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/**
|
||||
* 确定选中的用户
|
||||
* @param userIds
|
||||
*/
|
||||
chooseUserFun(userIds){
|
||||
let dataObj={
|
||||
userId:userIds,
|
||||
siteId:this.dealId
|
||||
}
|
||||
addManager(dataObj).then(response => {
|
||||
this.$modal.msgSuccess('分配成功')
|
||||
this.handleQuery()
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -61,19 +61,36 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品下方内容" prop="prodDown">
|
||||
<el-form-item label="产品上方内容-移动端" prop="prodDown">
|
||||
<editor v-model="form.prodUpApp" :min-height="160"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="form.catgType == 'cp'" :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品下方内容" prop="prodUp">
|
||||
<editor v-model="form.prodDown" :min-height="160"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品下方内容-移动端" prop="prodDown">
|
||||
<editor v-model="form.prodDownApp" :min-height="160"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-row v-if="form.catgType == 'dym' || form.catgType == 'xp'">
|
||||
<el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="内容" prop="content">
|
||||
<editor v-model="form.content" :min-height="192"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="内容-移动端" prop="content">
|
||||
<editor v-model="form.contentApp" :min-height="192"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
@ -107,8 +124,11 @@ export default {
|
||||
keyword:"",
|
||||
description:"",
|
||||
prodUp:"",
|
||||
prodUpApp:"",
|
||||
prodDown:"",
|
||||
content:""
|
||||
prodDownApp:"",
|
||||
content:"",
|
||||
contentApp:"",
|
||||
},
|
||||
id:null,
|
||||
//列表页入参
|
||||
@ -176,8 +196,11 @@ export default {
|
||||
keyword:"",
|
||||
description:"",
|
||||
prodUp:"",
|
||||
prodUpApp:"",
|
||||
prodDown:"",
|
||||
content:""
|
||||
prodDownApp:"",
|
||||
content:"",
|
||||
contentApp:"",
|
||||
}
|
||||
}
|
||||
|
||||
|
236
dl_vue/src/views/busi/page/index.vue
Normal file
236
dl_vue/src/views/busi/page/index.vue
Normal file
@ -0,0 +1,236 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="时间范围" prop="dataRange">
|
||||
<el-date-picker
|
||||
v-model="queryParams.dataRange"
|
||||
type="daterange"
|
||||
align="right"
|
||||
unlink-panels
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:picker-options="pickerOptions"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="来自中国">
|
||||
<el-select v-model="queryParams.ifChina" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</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>
|
||||
|
||||
|
||||
<el-table v-loading="loading" :data="pageList" >
|
||||
<el-table-column type="index" width="60" label="序号" align="center"/>
|
||||
<el-table-column label="访问次数" align="center" prop="num" width="100" />
|
||||
<el-table-column label="网页地址" align="center" prop="url" />
|
||||
</el-table>
|
||||
|
||||
<!-- <pagination-->
|
||||
<!-- v-show="total>0"-->
|
||||
<!-- :total="total"-->
|
||||
<!-- :page.sync="queryParams.pageNum"-->
|
||||
<!-- :limit.sync="queryParams.pageSize"-->
|
||||
<!-- @pagination="getList"-->
|
||||
<!-- />-->
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPage, getPage, delPage, addPage, updatePage } from "@/api/busi/page";
|
||||
|
||||
export default {
|
||||
name: "Page",
|
||||
data() {
|
||||
return {
|
||||
options: [{
|
||||
value: null,
|
||||
label: '全部'
|
||||
}, {
|
||||
label: '是',
|
||||
value: true
|
||||
}, {
|
||||
label: '否',
|
||||
value: false
|
||||
}],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 全站网页访问次数统计表格数据
|
||||
pageList: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
dataRange: '',
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
ifChina:null,
|
||||
tenantId: null,
|
||||
},
|
||||
pickerOptions: {
|
||||
shortcuts: [{
|
||||
text: '最近一周',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}, {
|
||||
text: '最近一个月',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}, {
|
||||
text: '最近三个月',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}]
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询全站网页访问次数统计列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listPage(this.queryParams).then(response => {
|
||||
this.pageList = response.data;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
url: null,
|
||||
equipment: null,
|
||||
ip: null,
|
||||
national: null,
|
||||
tenantId: null,
|
||||
createTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
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])
|
||||
}else{
|
||||
this.queryParams.startDate = null
|
||||
this.queryParams.endDate = null
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加全站网页访问次数统计";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getPage(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改全站网页访问次数统计";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updatePage(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addPage(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除全站网页访问次数统计编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delPage(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('busi/page/export', {
|
||||
...this.queryParams
|
||||
}, `page_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/**
|
||||
* 格式化时间戳
|
||||
*/
|
||||
formatDate(timestamp) {
|
||||
const date = new Date(timestamp)
|
||||
const year = date.getFullYear()
|
||||
// 月份是从0开始的,所以要加1
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(date.getDate()).padStart(2, '0')
|
||||
return `${year}-${month}-${day}`
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
@ -287,7 +287,18 @@ export default {
|
||||
this.download('busi/inquiryItem/export', {
|
||||
...this.queryParams
|
||||
}, `inquiryItem_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 格式化时间戳
|
||||
*/
|
||||
formatDate(timestamp) {
|
||||
const date = new Date(timestamp)
|
||||
const year = date.getFullYear()
|
||||
// 月份是从0开始的,所以要加1
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(date.getDate()).padStart(2, '0')
|
||||
return `${year}-${month}-${day}`
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -27,7 +27,7 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-table @row-click="clickRow" ref="table" :data="userList" @selection-change="handleSelectionChange" height="360px">
|
||||
<el-table v-if="multiple" @row-click="clickRow" ref="table" :data="userList" @selection-change="handleSelectionChange" height="360px">
|
||||
<el-table-column type="selection" width="55"></el-table-column>
|
||||
<el-table-column label="用户名称" prop="userName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="用户昵称" prop="nickName" :show-overflow-tooltip="true" />
|
||||
@ -44,6 +44,22 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-table v-else ref="table" :data="userList" height="360px" highlight-current-row @current-change="handleCurrentChange">
|
||||
<el-table-column label="用户名称" prop="userName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="用户昵称" prop="nickName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
@ -69,6 +85,11 @@ export default {
|
||||
dicts: ['sys_normal_disable'],
|
||||
components: { Treeselect },
|
||||
props: {
|
||||
//当前产品的随机产品数组
|
||||
multiple: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -117,8 +138,8 @@ export default {
|
||||
},
|
||||
// 显示弹框
|
||||
show(leaderId) {
|
||||
this.userIds = []
|
||||
if(leaderId){
|
||||
|
||||
this.leaderIds = leaderId.split(",")
|
||||
}
|
||||
this.getList();
|
||||
@ -157,6 +178,11 @@ export default {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 选中某行 */
|
||||
handleCurrentChange(val){
|
||||
this.userIds = []
|
||||
this.userIds.push(val.userId)
|
||||
},
|
||||
/** 选择授权用户操作 */
|
||||
handleSelectUser() {
|
||||
const userIds = this.userIds.join(",");
|
||||
|
Loading…
Reference in New Issue
Block a user