Merge branch 'master' of http://124.222.105.7:3000/dianliang/dl_site_system
This commit is contained in:
commit
7a83471684
@ -0,0 +1,74 @@
|
||||
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.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
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.BaseInquiry;
|
||||
import com.ruoyi.base.service.IBaseInquiryService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 在线询盘设置Controller
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-06-24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base/inquiry")
|
||||
public class BaseInquiryController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBaseInquiryService baseInquiryService;
|
||||
|
||||
/**
|
||||
* 获取在线询盘设置详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:inquiry:query')")
|
||||
@GetMapping(value = "/getInquiry")
|
||||
public AjaxResult getInquiry(String tenantId)
|
||||
{
|
||||
return success(baseInquiryService.getInquiry(tenantId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增在线询盘设置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:inquiry:add')")
|
||||
@Log(title = "在线询盘设置", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BaseInquiry baseInquiry)
|
||||
{
|
||||
return toAjax(baseInquiryService.saveOrUpdate(baseInquiry));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改在线询盘设置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:inquiry:edit')")
|
||||
@Log(title = "在线询盘设置", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BaseInquiry baseInquiry)
|
||||
{
|
||||
return toAjax(baseInquiryService.saveOrUpdate(baseInquiry));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,112 @@
|
||||
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.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
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.BasePic;
|
||||
import com.ruoyi.base.service.IBasePicService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 轮播图管理Controller
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-06-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base/pic")
|
||||
public class BasePicController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBasePicService basePicService;
|
||||
|
||||
/**
|
||||
* 查询轮播图管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:pic:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(BasePic basePic,
|
||||
@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize)
|
||||
{
|
||||
Page<BasePic> page = new Page<>(pageNum, pageSize);
|
||||
IPage<BasePic> list = basePicService.queryListPage(basePic,page);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出轮播图管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:pic:export')")
|
||||
@Log(title = "轮播图管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BasePic basePic)
|
||||
{
|
||||
List<BasePic> list = basePicService.list();
|
||||
ExcelUtil<BasePic> util = new ExcelUtil<BasePic>(BasePic.class);
|
||||
util.exportExcel(response, list, "轮播图管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取轮播图管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:pic:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(basePicService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增轮播图管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:pic:add')")
|
||||
@Log(title = "轮播图管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BasePic basePic)
|
||||
{
|
||||
return toAjax(basePicService.save(basePic));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改轮播图管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:pic:edit')")
|
||||
@Log(title = "轮播图管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BasePic basePic)
|
||||
{
|
||||
return toAjax(basePicService.updateById(basePic));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除轮播图管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:pic:remove')")
|
||||
@Log(title = "轮播图管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
List<String> list = new ArrayList<>(Arrays.asList(ids));
|
||||
return toAjax(basePicService.removeByIds(list));
|
||||
}
|
||||
}
|
@ -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.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.base.vo.PicsVO;
|
||||
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.BasePics;
|
||||
import com.ruoyi.base.service.IBasePicsService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 图片库Controller
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-06-24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base/pics")
|
||||
public class BasePicsController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBasePicsService basePicsService;
|
||||
|
||||
/**
|
||||
* 查询图片库列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:pics:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(BasePics basePics,
|
||||
@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize)
|
||||
{
|
||||
Page<BasePics> page = new Page<>(pageNum, pageSize);
|
||||
IPage<BasePics> list = basePicsService.queryListPage(basePics,page);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出图片库列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:pics:export')")
|
||||
@Log(title = "图片库", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BasePics basePics)
|
||||
{
|
||||
List<BasePics> list = basePicsService.list();
|
||||
ExcelUtil<BasePics> util = new ExcelUtil<BasePics>(BasePics.class);
|
||||
util.exportExcel(response, list, "图片库数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取图片库详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:pics:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(basePicsService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增图片库
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:pics:add')")
|
||||
@Log(title = "图片库", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody PicsVO basePics)
|
||||
{
|
||||
List<BasePics> basePicsList = basePics.getFileList();
|
||||
basePicsList.forEach(item->{
|
||||
item.setFileType(basePics.getFileType());
|
||||
item.setTenantId(basePics.getTenantId());
|
||||
});
|
||||
return toAjax(basePicsService.saveBatch(basePicsList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改图片库
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:pics:edit')")
|
||||
@Log(title = "图片库", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BasePics basePics)
|
||||
{
|
||||
return toAjax(basePicsService.updateById(basePics));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除图片库
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:pics:remove')")
|
||||
@Log(title = "图片库", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
List<String> list = new ArrayList<>(Arrays.asList(ids));
|
||||
return toAjax(basePicsService.removeByIds(list));
|
||||
}
|
||||
}
|
@ -39,32 +39,6 @@ public class BaseSiteInfoController extends BaseController
|
||||
@Autowired
|
||||
private IBaseSiteInfoService baseSiteInfoService;
|
||||
|
||||
/**
|
||||
* 查询站点基础信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:info:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(BaseSiteInfo baseSiteInfo,
|
||||
@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize)
|
||||
{
|
||||
Page<BaseSiteInfo> page = new Page<>(pageNum, pageSize);
|
||||
IPage<BaseSiteInfo> list = baseSiteInfoService.queryListPage(baseSiteInfo,page);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出站点基础信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:info:export')")
|
||||
@Log(title = "站点基础信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BaseSiteInfo baseSiteInfo)
|
||||
{
|
||||
List<BaseSiteInfo> list = baseSiteInfoService.list();
|
||||
ExcelUtil<BaseSiteInfo> util = new ExcelUtil<BaseSiteInfo>(BaseSiteInfo.class);
|
||||
util.exportExcel(response, list, "站点基础信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取站点基础信息详细信息
|
||||
@ -98,15 +72,4 @@ public class BaseSiteInfoController extends BaseController
|
||||
return toAjax(baseSiteInfoService.updateById(baseSiteInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除站点基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:info:remove')")
|
||||
@Log(title = "站点基础信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
List<String> list = new ArrayList<>(Arrays.asList(ids));
|
||||
return toAjax(baseSiteInfoService.removeByIds(list));
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,71 @@
|
||||
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_inquiry
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-06-24
|
||||
*/
|
||||
@TableName("dl_base_inquiry")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BaseInquiry extends DlBaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
/** 是否开启填写公司名称 */
|
||||
@Excel(name = "公司名称")
|
||||
private Boolean company;
|
||||
|
||||
/** 公司名称是否必填 */
|
||||
@Excel(name = "公司名称是否必填")
|
||||
private Boolean companyMust;
|
||||
|
||||
/** 是否开启填写电话/WhatsApp */
|
||||
@Excel(name = "电话/WhatsApp")
|
||||
private Boolean tel;
|
||||
|
||||
/** 是否必填 */
|
||||
@Excel(name = "是否必填")
|
||||
private Boolean telMust;
|
||||
|
||||
/** 是否开启填写标题 */
|
||||
@Excel(name = "标题")
|
||||
private Boolean title;
|
||||
|
||||
/** 是否必填 */
|
||||
@Excel(name = "是否必填")
|
||||
private Boolean titleMust;
|
||||
|
||||
/** 是否开启填写姓名 */
|
||||
@Excel(name = "姓名")
|
||||
private Boolean name;
|
||||
|
||||
/** 是否必填 */
|
||||
@Excel(name = "是否必填")
|
||||
private Boolean nameMust;
|
||||
|
||||
/** 提示文字(内容) */
|
||||
@Excel(name = "提示文字", readConverterExp = "内=容")
|
||||
private String content;
|
||||
|
||||
/** 站点唯一编码(租户id) */
|
||||
@Excel(name = "站点唯一编码", readConverterExp = "租=户id")
|
||||
private String tenantId;
|
||||
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
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_pic
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-06-23
|
||||
*/
|
||||
@TableName("dl_base_pic")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BasePic extends DlBaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
/** 标题 */
|
||||
@Excel(name = "标题")
|
||||
private String title;
|
||||
|
||||
/** 排序 */
|
||||
@Excel(name = "排序")
|
||||
private Long sort;
|
||||
|
||||
/** 图片 */
|
||||
@Excel(name = "图片")
|
||||
private String pic;
|
||||
|
||||
/** 站点唯一编码(租户id) */
|
||||
@Excel(name = "站点唯一编码", readConverterExp = "租=户id")
|
||||
private String tenantId;
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.ruoyi.base.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
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_pics
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-06-24
|
||||
*/
|
||||
@TableName("dl_base_pics")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BasePics extends DlBaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
/** 所属分类 */
|
||||
@Excel(name = "所属分类")
|
||||
private String fileType;
|
||||
|
||||
/** 图片名称 */
|
||||
@Excel(name = "图片名称")
|
||||
private String name;
|
||||
|
||||
/** 图片路径 */
|
||||
@Excel(name = "图片路径")
|
||||
private String url;
|
||||
|
||||
/** 图片大小 */
|
||||
@Excel(name = "图片大小")
|
||||
private BigDecimal size;
|
||||
|
||||
/** 图片宽 */
|
||||
@Excel(name = "图片宽")
|
||||
private Long width;
|
||||
|
||||
/** 图片高 */
|
||||
@Excel(name = "图片高")
|
||||
private Long height;
|
||||
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
/** 站点唯一编码(租户id) */
|
||||
@Excel(name = "站点唯一编码", readConverterExp = "租=户id")
|
||||
private String tenantId;
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
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.BaseInquiry;
|
||||
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-06-24
|
||||
*/
|
||||
@Mapper
|
||||
public interface BaseInquiryMapper extends BaseMapper<BaseInquiry>
|
||||
{
|
||||
IPage<BaseInquiry> queryListPage(@Param("entity") BaseInquiry entity, Page<BaseInquiry> page);
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
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.BasePic;
|
||||
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-06-23
|
||||
*/
|
||||
@Mapper
|
||||
public interface BasePicMapper extends BaseMapper<BasePic>
|
||||
{
|
||||
IPage<BasePic> queryListPage(@Param("entity") BasePic entity, Page<BasePic> page);
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
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.BasePics;
|
||||
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-06-24
|
||||
*/
|
||||
@Mapper
|
||||
public interface BasePicsMapper extends BaseMapper<BasePics>
|
||||
{
|
||||
IPage<BasePics> queryListPage(@Param("entity") BasePics entity, Page<BasePics> page);
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
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.BaseInquiry;
|
||||
|
||||
/**
|
||||
* 在线询盘设置Service接口
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-06-24
|
||||
*/
|
||||
public interface IBaseInquiryService extends IService<BaseInquiry>
|
||||
{
|
||||
IPage<BaseInquiry> queryListPage(BaseInquiry pageReqVO, Page<BaseInquiry> page);
|
||||
|
||||
/**
|
||||
* 查询站点询盘设置
|
||||
* @author vinjor-M
|
||||
* @date 11:01 2025/6/24
|
||||
* @param tenantId 租户id
|
||||
* @return com.ruoyi.base.domain.BaseInquiry
|
||||
**/
|
||||
BaseInquiry getInquiry(String tenantId);
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
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.BasePic;
|
||||
|
||||
/**
|
||||
* 轮播图管理Service接口
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-06-23
|
||||
*/
|
||||
public interface IBasePicService extends IService<BasePic>
|
||||
{
|
||||
IPage<BasePic> queryListPage(BasePic pageReqVO, Page<BasePic> page);
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
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.BasePics;
|
||||
|
||||
/**
|
||||
* 图片库Service接口
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-06-24
|
||||
*/
|
||||
public interface IBasePicsService extends IService<BasePics>
|
||||
{
|
||||
IPage<BasePics> queryListPage(BasePics pageReqVO, Page<BasePics> page);
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.ruoyi.base.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.base.domain.BaseSiteInfo;
|
||||
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.BaseInquiryMapper;
|
||||
import com.ruoyi.base.domain.BaseInquiry;
|
||||
import com.ruoyi.base.service.IBaseInquiryService;
|
||||
|
||||
/**
|
||||
* 在线询盘设置Service业务层处理
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-06-24
|
||||
*/
|
||||
@Service
|
||||
public class BaseInquiryServiceImpl extends ServiceImpl<BaseInquiryMapper,BaseInquiry> implements IBaseInquiryService
|
||||
{
|
||||
@Autowired
|
||||
private BaseInquiryMapper baseInquiryMapper;
|
||||
|
||||
@Override
|
||||
public IPage<BaseInquiry> queryListPage(BaseInquiry pageReqVO, Page<BaseInquiry> page) {
|
||||
return baseInquiryMapper.queryListPage(pageReqVO, page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询站点询盘设置
|
||||
*
|
||||
* @param tenantId 租户id
|
||||
* @return com.ruoyi.base.domain.BaseInquiry
|
||||
* @author vinjor-M
|
||||
* @date 11:01 2025/6/24
|
||||
**/
|
||||
@Override
|
||||
public BaseInquiry getInquiry(String tenantId) {
|
||||
LambdaQueryWrapper<BaseInquiry> queryWrapper = new LambdaQueryWrapper<BaseInquiry>()
|
||||
.eq(BaseInquiry::getTenantId,tenantId);
|
||||
List<BaseInquiry> list = this.list(queryWrapper);
|
||||
return list.isEmpty()?null:list.get(0);
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.ruoyi.base.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
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.BasePicMapper;
|
||||
import com.ruoyi.base.domain.BasePic;
|
||||
import com.ruoyi.base.service.IBasePicService;
|
||||
|
||||
/**
|
||||
* 轮播图管理Service业务层处理
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-06-23
|
||||
*/
|
||||
@Service
|
||||
public class BasePicServiceImpl extends ServiceImpl<BasePicMapper,BasePic> implements IBasePicService
|
||||
{
|
||||
@Autowired
|
||||
private BasePicMapper basePicMapper;
|
||||
|
||||
@Override
|
||||
public IPage<BasePic> queryListPage(BasePic pageReqVO, Page<BasePic> page) {
|
||||
return basePicMapper.queryListPage(pageReqVO, page);
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.ruoyi.base.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
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.BasePicsMapper;
|
||||
import com.ruoyi.base.domain.BasePics;
|
||||
import com.ruoyi.base.service.IBasePicsService;
|
||||
|
||||
/**
|
||||
* 图片库Service业务层处理
|
||||
*
|
||||
* @author vinjor-m
|
||||
* @date 2025-06-24
|
||||
*/
|
||||
@Service
|
||||
public class BasePicsServiceImpl extends ServiceImpl<BasePicsMapper,BasePics> implements IBasePicsService
|
||||
{
|
||||
@Autowired
|
||||
private BasePicsMapper basePicsMapper;
|
||||
|
||||
@Override
|
||||
public IPage<BasePics> queryListPage(BasePics pageReqVO, Page<BasePics> page) {
|
||||
return basePicsMapper.queryListPage(pageReqVO, page);
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.ruoyi.base.vo;
|
||||
|
||||
import com.ruoyi.base.domain.BasePics;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class PicsVO extends BasePics {
|
||||
|
||||
/**
|
||||
* 批量传的图片
|
||||
**/
|
||||
private List<BasePics> fileList;
|
||||
}
|
@ -1,7 +1,12 @@
|
||||
package com.ruoyi.web.controller.common;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.imageio.stream.ImageInputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@ -99,6 +104,14 @@ public class CommonController
|
||||
}else if ("aliOss".equals(uploadType)){
|
||||
//阿里oss上传方式
|
||||
String fileUrl = fileService.upload(file);
|
||||
long size = file.getSize()/1024;
|
||||
BufferedImage bufferedImage = ImageIO.read(file.getInputStream());
|
||||
int width = bufferedImage.getWidth();
|
||||
int height = bufferedImage.getHeight();
|
||||
ajax.put("name", file.getOriginalFilename());
|
||||
ajax.put("size", size);
|
||||
ajax.put("width", width);
|
||||
ajax.put("height", height);
|
||||
ajax.put("url", fileUrl);
|
||||
ajax.put("fileName", fileUrl);
|
||||
}
|
||||
|
@ -0,0 +1,45 @@
|
||||
<?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.BaseInquiryMapper">
|
||||
|
||||
<resultMap type="BaseInquiry" id="BaseInquiryResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="company" column="company" />
|
||||
<result property="companyMust" column="company_must" />
|
||||
<result property="tel" column="tel" />
|
||||
<result property="telMust" column="tel_must" />
|
||||
<result property="title" column="title" />
|
||||
<result property="titleMust" column="title_must" />
|
||||
<result property="name" column="name" />
|
||||
<result property="nameMust" column="name_must" />
|
||||
<result property="content" column="content" />
|
||||
<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" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBaseInquiryVo">
|
||||
select id, company, company_must, tel, tel_must, title, title_must, name, name_must, content, tenant_id, creator, create_time, updater, update_time, del_flag from dl_base_inquiry
|
||||
</sql>
|
||||
|
||||
<select id="queryListPage" parameterType="BaseInquiry" resultMap="BaseInquiryResult">
|
||||
<include refid="selectBaseInquiryVo"/>
|
||||
<where>
|
||||
<if test="entity.company != null and entity.company != ''"> and company = #{entity.company}</if>
|
||||
<if test="entity.companyMust != null "> and company_must = #{entity.companyMust}</if>
|
||||
<if test="entity.tel != null and entity.tel != ''"> and tel = #{entity.tel}</if>
|
||||
<if test="entity.telMust != null "> and tel_must = #{entity.telMust}</if>
|
||||
<if test="entity.title != null and entity.title != ''"> and title = #{entity.title}</if>
|
||||
<if test="entity.titleMust != null "> and title_must = #{entity.titleMust}</if>
|
||||
<if test="entity.name != null and entity.name != ''"> and name like concat('%', #{entity.name}, '%')</if>
|
||||
<if test="entity.nameMust != null and entity.nameMust != ''"> and name_must = #{entity.nameMust}</if>
|
||||
<if test="entity.content != null and entity.content != ''"> and content = #{entity.content}</if>
|
||||
<if test="entity.tenantId != null and entity.tenantId != ''"> and tenant_id = #{entity.tenantId}</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,35 @@
|
||||
<?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.BasePicMapper">
|
||||
|
||||
<resultMap type="BasePic" id="BasePicResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="title" column="title" />
|
||||
<result property="sort" column="sort" />
|
||||
<result property="pic" column="pic" />
|
||||
<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" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBasePicVo">
|
||||
select id, title, sort, pic, tenant_id, creator, create_time, updater, update_time, del_flag from dl_base_pic
|
||||
</sql>
|
||||
|
||||
<select id="queryListPage" parameterType="BasePic" resultMap="BasePicResult">
|
||||
<include refid="selectBasePicVo"/>
|
||||
<where>
|
||||
and del_flag='0'
|
||||
<if test="entity.title != null and entity.title != ''"> and title = #{entity.title}</if>
|
||||
<if test="entity.sort != null "> and sort = #{entity.sort}</if>
|
||||
<if test="entity.pic != null and entity.pic != ''"> and pic = #{entity.pic}</if>
|
||||
<if test="entity.tenantId != null and entity.tenantId != ''"> and tenant_id = #{entity.tenantId}</if>
|
||||
</where>
|
||||
ORDER BY sort DESC
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,43 @@
|
||||
<?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.BasePicsMapper">
|
||||
|
||||
<resultMap type="BasePics" id="BasePicsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="fileType" column="file_type" />
|
||||
<result property="name" column="name" />
|
||||
<result property="url" column="url" />
|
||||
<result property="size" column="size" />
|
||||
<result property="width" column="width" />
|
||||
<result property="height" column="height" />
|
||||
<result property="remark" column="remark" />
|
||||
<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" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBasePicsVo">
|
||||
select id, file_type, name, url, size, width, height, remark, tenant_id, creator, create_time, updater, update_time, del_flag from dl_base_pics
|
||||
</sql>
|
||||
|
||||
<select id="queryListPage" parameterType="BasePics" resultMap="BasePicsResult">
|
||||
<include refid="selectBasePicsVo"/>
|
||||
<where>
|
||||
and del_flag='0'
|
||||
<if test="entity.fileType != null and entity.fileType != ''"> and file_type = #{entity.fileType}</if>
|
||||
<if test="entity.name != null and entity.name != ''"> and name like concat('%', #{entity.name}, '%')</if>
|
||||
<if test="entity.url != null and entity.url != ''"> and url = #{entity.url}</if>
|
||||
<if test="entity.size != null "> and size = #{entity.size}</if>
|
||||
<if test="entity.width != null "> and width = #{entity.width}</if>
|
||||
<if test="entity.height != null "> and height = #{entity.height}</if>
|
||||
<if test="entity.remark != null and entity.remark != ''"> and remark = #{entity.remark}</if>
|
||||
<if test="entity.tenantId != null and entity.tenantId != ''"> and tenant_id = #{entity.tenantId}</if>
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
</mapper>
|
45
dl_vue/src/api/base/inquiry.js
Normal file
45
dl_vue/src/api/base/inquiry.js
Normal file
@ -0,0 +1,45 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询在线询盘设置列表
|
||||
export function listInquiry(query) {
|
||||
return request({
|
||||
url: '/base/inquiry/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询在线询盘设置详细
|
||||
export function getInquiry(query) {
|
||||
return request({
|
||||
url: '/base/inquiry/getInquiry',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 新增在线询盘设置
|
||||
export function addInquiry(data) {
|
||||
return request({
|
||||
url: '/base/inquiry',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改在线询盘设置
|
||||
export function updateInquiry(data) {
|
||||
return request({
|
||||
url: '/base/inquiry',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除在线询盘设置
|
||||
export function delInquiry(id) {
|
||||
return request({
|
||||
url: '/base/inquiry/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
44
dl_vue/src/api/base/pic.js
Normal file
44
dl_vue/src/api/base/pic.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询轮播图管理列表
|
||||
export function listPic(query) {
|
||||
return request({
|
||||
url: '/base/pic/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询轮播图管理详细
|
||||
export function getPic(id) {
|
||||
return request({
|
||||
url: '/base/pic/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增轮播图管理
|
||||
export function addPic(data) {
|
||||
return request({
|
||||
url: '/base/pic',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改轮播图管理
|
||||
export function updatePic(data) {
|
||||
return request({
|
||||
url: '/base/pic',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除轮播图管理
|
||||
export function delPic(id) {
|
||||
return request({
|
||||
url: '/base/pic/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
44
dl_vue/src/api/base/pics.js
Normal file
44
dl_vue/src/api/base/pics.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询图片库列表
|
||||
export function listPics(query) {
|
||||
return request({
|
||||
url: '/base/pics/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询图片库详细
|
||||
export function getPics(id) {
|
||||
return request({
|
||||
url: '/base/pics/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增图片库
|
||||
export function addPics(data) {
|
||||
return request({
|
||||
url: '/base/pics',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改图片库
|
||||
export function updatePics(data) {
|
||||
return request({
|
||||
url: '/base/pics',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除图片库
|
||||
export function delPics(id) {
|
||||
return request({
|
||||
url: '/base/pics/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
@ -165,7 +165,7 @@ export default {
|
||||
// 上传成功回调
|
||||
handleUploadSuccess(res, file) {
|
||||
if (res.code === 200) {
|
||||
this.uploadList.push({ name: res.fileName, url: res.fileName });
|
||||
this.uploadList.push({ name: res.name, url: res.fileName,size:res.size,width:res.width,height:res.height });
|
||||
this.uploadedSuccessfully();
|
||||
} else {
|
||||
this.number--;
|
||||
@ -192,6 +192,7 @@ export default {
|
||||
uploadedSuccessfully() {
|
||||
if (this.number > 0 && this.uploadList.length === this.number) {
|
||||
this.fileList = this.fileList.concat(this.uploadList);
|
||||
this.$emit('uploadedImg',this.fileList)
|
||||
this.uploadList = [];
|
||||
this.number = 0;
|
||||
this.$emit("input", this.listToString(this.fileList));
|
||||
|
@ -5,23 +5,24 @@
|
||||
<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">
|
||||
<div class="right-menu" style="display: flex">
|
||||
<template v-if="device!=='mobile'">
|
||||
<div>当前管理站点:{{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" />
|
||||
|
||||
<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>
|
||||
|
||||
@ -48,6 +49,7 @@
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import { getTenantName } from '@/utils/auth'
|
||||
import Breadcrumb from '@/components/Breadcrumb'
|
||||
import TopNav from '@/components/TopNav'
|
||||
import Hamburger from '@/components/Hamburger'
|
||||
@ -68,6 +70,11 @@ export default {
|
||||
RuoYiGit,
|
||||
RuoYiDoc
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tenantName:getTenantName(),
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
|
@ -4,6 +4,8 @@ const TokenKey = 'Admin-Token'
|
||||
|
||||
const TenantIdKey = 'tenantId'
|
||||
|
||||
const TenantNameKey = 'tenantName'
|
||||
|
||||
export function getToken() {
|
||||
return Cookies.get(TokenKey)
|
||||
}
|
||||
@ -27,3 +29,15 @@ export function setTenantId(tenantId) {
|
||||
export function removeTenantId() {
|
||||
return Cookies.remove(TenantIdKey)
|
||||
}
|
||||
|
||||
export function getTenantName() {
|
||||
return Cookies.get(TenantNameKey)
|
||||
}
|
||||
|
||||
export function setTenantName(tenantName) {
|
||||
return Cookies.set(TenantNameKey, tenantName)
|
||||
}
|
||||
|
||||
export function removeTenantName() {
|
||||
return Cookies.remove(TenantNameKey)
|
||||
}
|
||||
|
@ -2,10 +2,10 @@
|
||||
<div class="app-container">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button type="primary" @click="submitForm">保 存</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider></el-divider>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<h1>公司信息</h1>
|
||||
<el-row>
|
||||
@ -86,7 +86,8 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-divider></el-divider>
|
||||
<el-button type="primary" @click="submitForm">保 存</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -150,7 +151,7 @@ export default {
|
||||
this.getDataInfo()
|
||||
},
|
||||
methods: {
|
||||
/** 查询站点基础信息列表 */
|
||||
/** 查询站点基础信息 */
|
||||
getDataInfo() {
|
||||
this.loading = true
|
||||
getInfo({}).then(response => {
|
||||
|
208
dl_vue/src/views/base/inquiry/index.vue
Normal file
208
dl_vue/src/views/base/inquiry/index.vue
Normal file
@ -0,0 +1,208 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-button type="primary" @click="submitForm">保 存</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<!-- 添加或修改在线询盘设置对话框 -->
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="200px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="company">
|
||||
<template v-slot:label>
|
||||
<span>公司名称</span>
|
||||
<el-tooltip class="item" effect="dark" content="开启后代表客户可以填写公司名称" placement="bottom">
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<el-switch
|
||||
v-model="form.company"
|
||||
active-text="开启"
|
||||
inactive-text="关闭"
|
||||
></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="公司名称是否必填">
|
||||
<el-switch
|
||||
v-model="form.companyMust"
|
||||
active-text="必填"
|
||||
inactive-text="非必填"
|
||||
>
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="tel">
|
||||
<template v-slot:label>
|
||||
<span>电话/WhatsApp</span>
|
||||
<el-tooltip class="item" effect="dark" content="开启后代表客户可以填写电话/WhatsApp" placement="bottom">
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<el-switch
|
||||
v-model="form.tel"
|
||||
active-text="开启"
|
||||
inactive-text="关闭"
|
||||
></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="电话/WhatsApp是否必填">
|
||||
<el-switch
|
||||
v-model="form.telMust"
|
||||
active-text="必填"
|
||||
inactive-text="非必填"
|
||||
>
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="title">
|
||||
<template v-slot:label>
|
||||
<span>标题</span>
|
||||
<el-tooltip class="item" effect="dark" content="开启后代表客户可以填写标题" placement="bottom">
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<el-switch
|
||||
v-model="form.title"
|
||||
active-text="开启"
|
||||
inactive-text="关闭"
|
||||
></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="标题是否必填">
|
||||
<el-switch
|
||||
v-model="form.titleMust"
|
||||
active-text="必填"
|
||||
inactive-text="非必填"
|
||||
>
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="name">
|
||||
<template v-slot:label>
|
||||
<span>姓名</span>
|
||||
<el-tooltip class="item" effect="dark" content="开启后代表客户可以填写姓名" placement="bottom">
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<el-switch
|
||||
v-model="form.name"
|
||||
active-text="开启"
|
||||
inactive-text="关闭"
|
||||
></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="标题是否必填">
|
||||
<el-switch
|
||||
v-model="form.nameMust"
|
||||
active-text="必填"
|
||||
inactive-text="非必填"
|
||||
>
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="提示文字" prop="content">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="请输入提示文字"
|
||||
v-model="form.content"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-divider></el-divider>
|
||||
<el-button type="primary" @click="submitForm">保 存</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listInquiry, getInquiry, delInquiry, addInquiry, updateInquiry } from '@/api/base/inquiry'
|
||||
|
||||
export default {
|
||||
name: 'Inquiry',
|
||||
data() {
|
||||
return {
|
||||
// 表单参数
|
||||
form: {
|
||||
id: null,
|
||||
company: null,
|
||||
companyMust: null,
|
||||
tel: null,
|
||||
telMust: null,
|
||||
title: null,
|
||||
titleMust: null,
|
||||
name: null,
|
||||
nameMust: null,
|
||||
content: null,
|
||||
tenantId: null,
|
||||
creator: null,
|
||||
createTime: null,
|
||||
updater: null,
|
||||
updateTime: null,
|
||||
delFlag: null
|
||||
},
|
||||
// 表单校验
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
onCreate(){
|
||||
debugger
|
||||
console.log("onCreate")
|
||||
this.getDataInfo()
|
||||
},
|
||||
created() {
|
||||
this.getDataInfo()
|
||||
},
|
||||
methods: {
|
||||
/** 查询在线询盘设置 */
|
||||
getDataInfo() {
|
||||
getInquiry({}).then(response => {
|
||||
if(200==response.code && response.data){
|
||||
this.form = response.data
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateInquiry(this.form).then(response => {
|
||||
this.$modal.msgSuccess('修改成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addInquiry(this.form).then(response => {
|
||||
this.$modal.msgSuccess('新增成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
282
dl_vue/src/views/base/pic/index.vue
Normal file
282
dl_vue/src/views/base/pic/index.vue
Normal file
@ -0,0 +1,282 @@
|
||||
<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="title">
|
||||
<el-input
|
||||
v-model="queryParams.title"
|
||||
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:pic: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:pic: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:pic: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:pic:export']"-->
|
||||
<!-- >导出</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="picList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="标题" align="center" prop="title" />
|
||||
<el-table-column label="排序" align="center" prop="sort" />
|
||||
<el-table-column label="图片" align="center" prop="pic" width="100">
|
||||
<template slot-scope="scope">
|
||||
<image-preview :src="scope.row.pic" :width="50" :height="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <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:pic:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['base:pic: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="标题" prop="title">
|
||||
<el-input v-model="form.title" placeholder="请输入标题" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<div style="display: flex;align-items: center;justify-content: center">
|
||||
<el-input v-model="form.sort" type="number" placeholder="请输入排序" />
|
||||
<el-tooltip class="item" effect="dark" content="数字越大越靠前" placement="bottom">
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="图片" prop="pic">
|
||||
<image-upload v-model="form.pic" limit="1"/>
|
||||
</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 { listPic, getPic, delPic, addPic, updatePic } from "@/api/base/pic";
|
||||
|
||||
export default {
|
||||
name: "Pic",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 轮播图管理表格数据
|
||||
picList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
title: null,
|
||||
sort: null,
|
||||
pic: null,
|
||||
tenantId: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
title: [
|
||||
{ required: true, message: '请输入标题', trigger: 'blur' },
|
||||
],
|
||||
sort: [
|
||||
{ required: true, message: '请输入排序', trigger: 'blur' },
|
||||
],
|
||||
pic: [
|
||||
{ required: true, message: '请上传图片', trigger: 'blur' },
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询轮播图管理列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listPic(this.queryParams).then(response => {
|
||||
this.picList = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
title: null,
|
||||
sort: null,
|
||||
pic: 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
|
||||
getPic(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) {
|
||||
updatePic(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addPic(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除选中的轮播图?').then(function() {
|
||||
return delPic(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('base/pic/export', {
|
||||
...this.queryParams
|
||||
}, `pic_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
375
dl_vue/src/views/base/pics/index.vue
Normal file
375
dl_vue/src/views/base/pics/index.vue
Normal file
@ -0,0 +1,375 @@
|
||||
<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="fileType">
|
||||
<el-select v-model="queryParams.fileType" placeholder="请选择所属分类" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.file_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="图片名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
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('product')"
|
||||
v-hasPermi="['base:pics:add']"
|
||||
>上传产品图</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd('news')"
|
||||
v-hasPermi="['base:pics:add']"
|
||||
>上传新闻图</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd('other')"
|
||||
v-hasPermi="['base:pics:add']"
|
||||
>上传其他图</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:pics:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<!-- 选择图片的组件-->
|
||||
<!-- <div class="photo-wall">-->
|
||||
<!-- <div class="photo-box" v-for="(photo, index) in picsList"-->
|
||||
<!-- :key="index" :title="photo.name">-->
|
||||
<!-- <el-image-->
|
||||
<!-- :src="photo.url"-->
|
||||
<!-- style="width: 160px; height: 160px"-->
|
||||
<!-- alt="photo"-->
|
||||
<!-- fit="fill"-->
|
||||
<!-- class="photo-image"-->
|
||||
<!-- lazy-->
|
||||
<!-- :preview-src-list="picsList.map(p => p.url)"-->
|
||||
<!-- >-->
|
||||
<!-- <div slot="error" class="image-slot">-->
|
||||
<!-- <i class="el-icon-picture-outline"></i>-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-image>-->
|
||||
<!-- <div class="photo-name" >{{ photo.name }}</div>-->
|
||||
<!-- <div class="photo-checkbox"><el-checkbox size="medium" v-model="photo.checked"></el-checkbox></div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div style="clear: both"></div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<el-table v-loading="loading" :data="picsList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="图片名称" align="center" prop="name" />
|
||||
<el-table-column label="所属分类" align="center" prop="fileType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.file_type" :value="scope.row.fileType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="图片" align="center" prop="url" width="100">
|
||||
<template slot-scope="scope">
|
||||
<image-preview :src="scope.row.url" :width="50" :height="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="图片大小" align="center" prop="size" >
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.size | filterSize}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="图片宽" align="center" prop="width" />
|
||||
<el-table-column label="图片高" align="center" prop="height" />
|
||||
<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-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['base:pics: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="700px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="所属分类" prop="fileType">
|
||||
<el-select v-model="form.fileType" placeholder="请选择所属分类">
|
||||
<el-option
|
||||
v-for="dict in dict.type.file_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="图片" prop="url">
|
||||
<image-upload @uploadedImg="uploadedImg" v-model="form.url" :limit="9"/>
|
||||
</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 { listPics, getPics, delPics, addPics, updatePics } from "@/api/base/pics";
|
||||
|
||||
export default {
|
||||
name: "Pics",
|
||||
dicts: ['file_type'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 图片库表格数据
|
||||
picsList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
fileType: null,
|
||||
name: null,
|
||||
url: null,
|
||||
size: null,
|
||||
width: null,
|
||||
height: null,
|
||||
remark: null,
|
||||
tenantId: null,
|
||||
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
fileList:[]
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
filters:{
|
||||
filterSize:function(size){
|
||||
if (!size){
|
||||
return "";
|
||||
}
|
||||
var num = 1024.00
|
||||
if (size < num){
|
||||
return size + "K";
|
||||
}else if(size < Math.pow(num, 2)){
|
||||
return (size / num).toFixed(2) + "M"; //M
|
||||
}else if(size < Math.pow(num, 3)){
|
||||
return (size / Math.pow(num, 2)).toFixed(2) + "G"; //G
|
||||
}else {
|
||||
return (size / Math.pow(num, 3)).toFixed(2) + "T"; //t
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
formatData (row, column, cellValue) {
|
||||
var size = row.store;
|
||||
|
||||
},
|
||||
/** 查询图片库列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listPics(this.queryParams).then(response => {
|
||||
this.picsList = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
uploadedImg(fileList){
|
||||
this.form.fileList = this.form.fileList.concat(fileList)
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
fileType: null,
|
||||
name: null,
|
||||
url: null,
|
||||
size: null,
|
||||
width: null,
|
||||
height: null,
|
||||
remark: null,
|
||||
tenantId: null,
|
||||
creator: null,
|
||||
createTime: null,
|
||||
updater: null,
|
||||
updateTime: null,
|
||||
delFlag: null,
|
||||
fileList:[]
|
||||
};
|
||||
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(code) {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.form.fileType=code
|
||||
this.title = "添加图片";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getPics(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改图片库";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
console.log(this.form)
|
||||
if (this.form.id != null) {
|
||||
updatePics(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addPics(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 delPics(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('base/pics/export', {
|
||||
...this.queryParams
|
||||
}, `pics_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.photo-wall {
|
||||
margin: auto;
|
||||
}
|
||||
.photo-box{
|
||||
float: left;
|
||||
margin: 20px 10px;
|
||||
position: relative;
|
||||
}
|
||||
.photo-name{
|
||||
padding: 4px 5px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
height: 32px;
|
||||
line-height: 28px;
|
||||
background-color: rgba(194, 194, 194, 0.5); /* 灰色,半透明 */
|
||||
}
|
||||
.photo-checkbox{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
</style>
|
@ -88,7 +88,7 @@
|
||||
|
||||
<script>
|
||||
import { getCodeImg } from "@/api/login";
|
||||
import { setTenantId } from '@/utils/auth'
|
||||
import { setTenantId,setTenantName } from '@/utils/auth'
|
||||
import Cookies from "js-cookie";
|
||||
import { encrypt, decrypt } from '@/utils/jsencrypt'
|
||||
import { listAllSite } from "@/api/base/site";
|
||||
@ -144,7 +144,9 @@ export default {
|
||||
chooseSiteCodeFun(){
|
||||
if(this.chooseSiteCode){
|
||||
this.centerDialogVisible=false
|
||||
let chooseSiteObj = this.options.filter(item=>item.value==this.chooseSiteCode)[0]
|
||||
setTenantId(this.chooseSiteCode)
|
||||
setTenantName(chooseSiteObj.label)
|
||||
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
|
||||
}else{
|
||||
this.$modal.msgWarning("请选择管理的站点");
|
||||
|
Loading…
Reference in New Issue
Block a user