1
This commit is contained in:
parent
05c5161894
commit
c6280780a2
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
}
|
@ -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,5 @@ 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);
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
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,5 @@ 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);
|
||||
}
|
||||
|
@ -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,6 +1,8 @@
|
||||
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;
|
||||
@ -24,7 +26,7 @@ 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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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>
|
@ -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,21 @@ 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>
|
||||
</mapper>
|
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'
|
||||
})
|
||||
}
|
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()
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -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