| @ -0,0 +1,171 @@ | |||
| package org.jeecg.modules.hanHaiMember.controller; | |||
| import java.util.Arrays; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import java.util.stream.Collectors; | |||
| import java.io.IOException; | |||
| import java.io.UnsupportedEncodingException; | |||
| import java.net.URLDecoder; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import org.jeecg.common.api.vo.Result; | |||
| import org.jeecg.common.system.query.QueryGenerator; | |||
| import org.jeecg.common.util.oConvertUtils; | |||
| import org.jeecg.modules.hanHaiMember.entity.HanHaiMember; | |||
| import org.jeecg.modules.hanHaiMember.service.IHanHaiMemberService; | |||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
| import com.baomidou.mybatisplus.core.metadata.IPage; | |||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.jeecgframework.poi.excel.ExcelImportUtil; | |||
| import org.jeecgframework.poi.excel.def.NormalExcelConstants; | |||
| import org.jeecgframework.poi.excel.entity.ExportParams; | |||
| import org.jeecgframework.poi.excel.entity.ImportParams; | |||
| import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | |||
| import org.jeecg.common.system.base.controller.JeecgController; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import org.springframework.web.multipart.MultipartFile; | |||
| import org.springframework.web.multipart.MultipartHttpServletRequest; | |||
| import org.springframework.web.servlet.ModelAndView; | |||
| import com.alibaba.fastjson.JSON; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.jeecg.common.aspect.annotation.AutoLog; | |||
| /** | |||
| * @Description: 用户账户表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Api(tags="用户账户表") | |||
| @RestController | |||
| @RequestMapping("/hanHaiMember/hanHaiMember") | |||
| @Slf4j | |||
| public class HanHaiMemberController extends JeecgController<HanHaiMember, IHanHaiMemberService> { | |||
| @Autowired | |||
| private IHanHaiMemberService hanHaiMemberService; | |||
| /** | |||
| * 分页列表查询 | |||
| * | |||
| * @param hanHaiMember | |||
| * @param pageNo | |||
| * @param pageSize | |||
| * @param req | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "用户账户表-分页列表查询") | |||
| @ApiOperation(value="用户账户表-分页列表查询", notes="用户账户表-分页列表查询") | |||
| @GetMapping(value = "/list") | |||
| public Result<IPage<HanHaiMember>> queryPageList(HanHaiMember hanHaiMember, | |||
| @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | |||
| @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | |||
| HttpServletRequest req) { | |||
| QueryWrapper<HanHaiMember> queryWrapper = QueryGenerator.initQueryWrapper(hanHaiMember, req.getParameterMap()); | |||
| Page<HanHaiMember> page = new Page<HanHaiMember>(pageNo, pageSize); | |||
| IPage<HanHaiMember> pageList = hanHaiMemberService.page(page, queryWrapper); | |||
| return Result.OK(pageList); | |||
| } | |||
| /** | |||
| * 添加 | |||
| * | |||
| * @param hanHaiMember | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "用户账户表-添加") | |||
| @ApiOperation(value="用户账户表-添加", notes="用户账户表-添加") | |||
| @PostMapping(value = "/add") | |||
| public Result<String> add(@RequestBody HanHaiMember hanHaiMember) { | |||
| hanHaiMemberService.save(hanHaiMember); | |||
| return Result.OK("添加成功!"); | |||
| } | |||
| /** | |||
| * 编辑 | |||
| * | |||
| * @param hanHaiMember | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "用户账户表-编辑") | |||
| @ApiOperation(value="用户账户表-编辑", notes="用户账户表-编辑") | |||
| @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) | |||
| public Result<String> edit(@RequestBody HanHaiMember hanHaiMember) { | |||
| hanHaiMemberService.updateById(hanHaiMember); | |||
| return Result.OK("编辑成功!"); | |||
| } | |||
| /** | |||
| * 通过id删除 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "用户账户表-通过id删除") | |||
| @ApiOperation(value="用户账户表-通过id删除", notes="用户账户表-通过id删除") | |||
| @DeleteMapping(value = "/delete") | |||
| public Result<String> delete(@RequestParam(name="id",required=true) String id) { | |||
| hanHaiMemberService.removeById(id); | |||
| return Result.OK("删除成功!"); | |||
| } | |||
| /** | |||
| * 批量删除 | |||
| * | |||
| * @param ids | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "用户账户表-批量删除") | |||
| @ApiOperation(value="用户账户表-批量删除", notes="用户账户表-批量删除") | |||
| @DeleteMapping(value = "/deleteBatch") | |||
| public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | |||
| this.hanHaiMemberService.removeByIds(Arrays.asList(ids.split(","))); | |||
| return Result.OK("批量删除成功!"); | |||
| } | |||
| /** | |||
| * 通过id查询 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "用户账户表-通过id查询") | |||
| @ApiOperation(value="用户账户表-通过id查询", notes="用户账户表-通过id查询") | |||
| @GetMapping(value = "/queryById") | |||
| public Result<HanHaiMember> queryById(@RequestParam(name="id",required=true) String id) { | |||
| HanHaiMember hanHaiMember = hanHaiMemberService.getById(id); | |||
| if(hanHaiMember==null) { | |||
| return Result.error("未找到对应数据"); | |||
| } | |||
| return Result.OK(hanHaiMember); | |||
| } | |||
| /** | |||
| * 导出excel | |||
| * | |||
| * @param request | |||
| * @param hanHaiMember | |||
| */ | |||
| @RequestMapping(value = "/exportXls") | |||
| public ModelAndView exportXls(HttpServletRequest request, HanHaiMember hanHaiMember) { | |||
| return super.exportXls(request, hanHaiMember, HanHaiMember.class, "用户账户表"); | |||
| } | |||
| /** | |||
| * 通过excel导入数据 | |||
| * | |||
| * @param request | |||
| * @param response | |||
| * @return | |||
| */ | |||
| @RequestMapping(value = "/importExcel", method = RequestMethod.POST) | |||
| public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | |||
| return super.importExcel(request, response, HanHaiMember.class); | |||
| } | |||
| } | |||
| @ -0,0 +1,244 @@ | |||
| package org.jeecg.modules.hanHaiMember.entity; | |||
| import java.io.Serializable; | |||
| import java.io.UnsupportedEncodingException; | |||
| import java.util.Date; | |||
| import java.math.BigDecimal; | |||
| import com.baomidou.mybatisplus.annotation.IdType; | |||
| import com.baomidou.mybatisplus.annotation.TableId; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import lombok.Data; | |||
| import com.fasterxml.jackson.annotation.JsonFormat; | |||
| import org.springframework.format.annotation.DateTimeFormat; | |||
| import org.jeecgframework.poi.excel.annotation.Excel; | |||
| import org.jeecg.common.aspect.annotation.Dict; | |||
| import io.swagger.annotations.ApiModel; | |||
| import io.swagger.annotations.ApiModelProperty; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.experimental.Accessors; | |||
| /** | |||
| * @Description: 用户账户表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Data | |||
| @TableName("han_hai_member") | |||
| @Accessors(chain = true) | |||
| @EqualsAndHashCode(callSuper = false) | |||
| @ApiModel(value="han_hai_member对象", description="用户账户表") | |||
| public class HanHaiMember implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| /**id*/ | |||
| @TableId(type = IdType.ASSIGN_ID) | |||
| @ApiModelProperty(value = "id") | |||
| private java.lang.String id; | |||
| /**创建人*/ | |||
| @ApiModelProperty(value = "创建人") | |||
| private java.lang.String createBy; | |||
| /**创建日期*/ | |||
| @ApiModelProperty(value = "创建日期") | |||
| private java.util.Date createTime; | |||
| /**更新人*/ | |||
| @ApiModelProperty(value = "更新人") | |||
| private java.lang.String updateBy; | |||
| /**更新日期*/ | |||
| @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") | |||
| @DateTimeFormat(pattern="yyyy-MM-dd") | |||
| @ApiModelProperty(value = "更新日期") | |||
| private java.util.Date updateTime; | |||
| /**所属部门*/ | |||
| @ApiModelProperty(value = "所属部门") | |||
| private java.lang.String sysOrgCode; | |||
| /**用户昵称*/ | |||
| @Excel(name = "用户昵称", width = 15) | |||
| @ApiModelProperty(value = "用户昵称") | |||
| private java.lang.String nickName; | |||
| /**用户头像*/ | |||
| @Excel(name = "用户头像", width = 15) | |||
| @ApiModelProperty(value = "用户头像") | |||
| private java.lang.String headImage; | |||
| /**真实姓名*/ | |||
| @Excel(name = "真实姓名", width = 15) | |||
| @ApiModelProperty(value = "真实姓名") | |||
| private java.lang.String name; | |||
| /**手机号码*/ | |||
| @Excel(name = "手机号码", width = 15) | |||
| @ApiModelProperty(value = "手机号码") | |||
| private java.lang.String phone; | |||
| /**登录账号*/ | |||
| @Excel(name = "登录账号", width = 15) | |||
| @ApiModelProperty(value = "登录账号") | |||
| private java.lang.String account; | |||
| /**登录密码*/ | |||
| @Excel(name = "登录密码", width = 15) | |||
| @ApiModelProperty(value = "登录密码") | |||
| private java.lang.String password; | |||
| /**登录盐*/ | |||
| @Excel(name = "登录盐", width = 15) | |||
| @ApiModelProperty(value = "登录盐") | |||
| private java.lang.String passwordSalt; | |||
| /**店铺名称备注*/ | |||
| @Excel(name = "店铺名称备注", width = 15) | |||
| @ApiModelProperty(value = "店铺名称备注") | |||
| private java.lang.String shopName; | |||
| /**角色*/ | |||
| @Excel(name = "角色", width = 15, dicCode = "member_role") | |||
| @Dict(dicCode = "member_role") | |||
| @ApiModelProperty(value = "角色") | |||
| private java.lang.Integer role; | |||
| /**ID标识号码*/ | |||
| @Excel(name = "ID标识号码", width = 15) | |||
| @ApiModelProperty(value = "ID标识号码") | |||
| private java.lang.String cardId; | |||
| /**是否冻结*/ | |||
| @Excel(name = "是否冻结", width = 15) | |||
| @ApiModelProperty(value = "是否冻结") | |||
| private java.lang.String frozenFlag; | |||
| /**是否删除*/ | |||
| @Excel(name = "是否删除", width = 15) | |||
| @ApiModelProperty(value = "是否删除") | |||
| private java.lang.String deleteFlag; | |||
| /**登录TOEKN*/ | |||
| @Excel(name = "登录TOEKN", width = 15) | |||
| @ApiModelProperty(value = "登录TOEKN") | |||
| private java.lang.String token; | |||
| /**公众号openid*/ | |||
| @Excel(name = "公众号openid", width = 15) | |||
| @ApiModelProperty(value = "公众号openid") | |||
| private java.lang.String officialOpenid; | |||
| /**小程序标识*/ | |||
| @Excel(name = "小程序标识", width = 15) | |||
| @ApiModelProperty(value = "小程序标识") | |||
| private java.lang.String appletOpenid; | |||
| /**APP标识*/ | |||
| @Excel(name = "APP标识", width = 15) | |||
| @ApiModelProperty(value = "APP标识") | |||
| private java.lang.String appOpenid; | |||
| /**微信UNIONID*/ | |||
| @Excel(name = "微信UNIONID", width = 15) | |||
| @ApiModelProperty(value = "微信UNIONID") | |||
| private java.lang.String wxUnionid; | |||
| /**公众号appid*/ | |||
| @Excel(name = "公众号appid", width = 15) | |||
| @ApiModelProperty(value = "公众号appid") | |||
| private java.lang.String officialAppid; | |||
| /**身份证号码*/ | |||
| @Excel(name = "身份证号码", width = 15) | |||
| @ApiModelProperty(value = "身份证号码") | |||
| private java.lang.String idCard; | |||
| /**发薪平台密码*/ | |||
| @Excel(name = "发薪平台密码", width = 15) | |||
| @ApiModelProperty(value = "发薪平台密码") | |||
| private java.lang.String idCardPassword; | |||
| /**发薪平台加密盐*/ | |||
| @Excel(name = "发薪平台加密盐", width = 15) | |||
| @ApiModelProperty(value = "发薪平台加密盐") | |||
| private java.lang.String idCardSalt; | |||
| /**是否实名认证*/ | |||
| @Excel(name = "是否实名认证", width = 15) | |||
| @ApiModelProperty(value = "是否实名认证") | |||
| private java.lang.Integer idCardOpen; | |||
| /**粉丝人数*/ | |||
| @Excel(name = "粉丝人数", width = 15) | |||
| @ApiModelProperty(value = "粉丝人数") | |||
| private java.lang.Integer intentionNum; | |||
| /**successNum*/ | |||
| @Excel(name = "successNum", width = 15) | |||
| @ApiModelProperty(value = "successNum") | |||
| private java.lang.Integer successNum; | |||
| /**addNum*/ | |||
| @Excel(name = "addNum", width = 15) | |||
| @ApiModelProperty(value = "addNum") | |||
| private java.lang.Integer addNum; | |||
| /**邀请人*/ | |||
| @Excel(name = "邀请人", width = 15, dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") | |||
| @Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") | |||
| @ApiModelProperty(value = "邀请人") | |||
| private java.lang.String shareId; | |||
| /**邀请人*/ | |||
| @Excel(name = "邀请人", width = 15) | |||
| @ApiModelProperty(value = "邀请人") | |||
| private java.lang.String vid; | |||
| /**邀请时间*/ | |||
| @Excel(name = "邀请时间", width = 15) | |||
| @ApiModelProperty(value = "邀请时间") | |||
| private java.util.Date vtime; | |||
| /**用户角色*/ | |||
| @Excel(name = "用户角色", width = 15, dicCode = "member_role") | |||
| @Dict(dicCode = "member_role") | |||
| @ApiModelProperty(value = "用户角色") | |||
| private java.lang.Integer isPay; | |||
| /**是否关注公众号*/ | |||
| @Excel(name = "是否关注公众号", width = 15) | |||
| @ApiModelProperty(value = "是否关注公众号") | |||
| private java.lang.Integer follow; | |||
| /**payRole*/ | |||
| @Excel(name = "payRole", width = 15) | |||
| @ApiModelProperty(value = "payRole") | |||
| private java.math.BigDecimal payRole; | |||
| /**余额*/ | |||
| @Excel(name = "余额", width = 15) | |||
| @ApiModelProperty(value = "余额") | |||
| private java.math.BigDecimal price; | |||
| /**积分*/ | |||
| @Excel(name = "积分", width = 15) | |||
| @ApiModelProperty(value = "积分") | |||
| private java.math.BigDecimal integerPrice; | |||
| /**小程序appid*/ | |||
| @Excel(name = "小程序appid", width = 15) | |||
| @ApiModelProperty(value = "小程序appid") | |||
| private java.lang.String appletAppid; | |||
| /**性别*/ | |||
| @Excel(name = "性别", width = 15) | |||
| @ApiModelProperty(value = "性别") | |||
| private java.lang.String sex; | |||
| /**是否分销商*/ | |||
| @Excel(name = "是否分销商", width = 15) | |||
| @ApiModelProperty(value = "是否分销商") | |||
| private java.lang.String isDai; | |||
| /**出生年*/ | |||
| @Excel(name = "出生年", width = 15, format = "yyyy-MM-dd") | |||
| @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") | |||
| @DateTimeFormat(pattern="yyyy-MM-dd") | |||
| @ApiModelProperty(value = "出生年") | |||
| private java.util.Date yearDate; | |||
| /**地址*/ | |||
| @Excel(name = "地址", width = 15) | |||
| @ApiModelProperty(value = "地址") | |||
| private java.lang.String address; | |||
| /**可提现金额*/ | |||
| @Excel(name = "可提现金额", width = 15) | |||
| @ApiModelProperty(value = "可提现金额") | |||
| private java.math.BigDecimal money; | |||
| /**状态*/ | |||
| @Excel(name = "状态", width = 15) | |||
| @ApiModelProperty(value = "状态") | |||
| private java.lang.String state; | |||
| /**国籍*/ | |||
| @Excel(name = "国籍", width = 15) | |||
| @ApiModelProperty(value = "国籍") | |||
| private java.lang.String city; | |||
| /**邮箱*/ | |||
| @Excel(name = "邮箱", width = 15) | |||
| @ApiModelProperty(value = "邮箱") | |||
| private java.lang.String email; | |||
| /**学历*/ | |||
| @Excel(name = "学历", width = 15) | |||
| @ApiModelProperty(value = "学历") | |||
| private java.lang.String shcool; | |||
| /**院校类型*/ | |||
| @Excel(name = "院校类型", width = 15) | |||
| @ApiModelProperty(value = "院校类型") | |||
| private java.lang.String shcoolType; | |||
| /**工作*/ | |||
| @Excel(name = "工作", width = 15) | |||
| @ApiModelProperty(value = "工作") | |||
| private java.lang.String workValue; | |||
| /**关于我*/ | |||
| @Excel(name = "关于我", width = 15) | |||
| @ApiModelProperty(value = "关于我") | |||
| private java.lang.String details; | |||
| } | |||
| @ -0,0 +1,17 @@ | |||
| package org.jeecg.modules.hanHaiMember.mapper; | |||
| import java.util.List; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import org.jeecg.modules.hanHaiMember.entity.HanHaiMember; | |||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
| /** | |||
| * @Description: 用户账户表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface HanHaiMemberMapper extends BaseMapper<HanHaiMember> { | |||
| } | |||
| @ -0,0 +1,5 @@ | |||
| <?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="org.jeecg.modules.hanHaiMember.mapper.HanHaiMemberMapper"> | |||
| </mapper> | |||
| @ -0,0 +1,14 @@ | |||
| package org.jeecg.modules.hanHaiMember.service; | |||
| import org.jeecg.modules.hanHaiMember.entity.HanHaiMember; | |||
| import com.baomidou.mybatisplus.extension.service.IService; | |||
| /** | |||
| * @Description: 用户账户表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface IHanHaiMemberService extends IService<HanHaiMember> { | |||
| } | |||
| @ -0,0 +1,19 @@ | |||
| package org.jeecg.modules.hanHaiMember.service.impl; | |||
| import org.jeecg.modules.hanHaiMember.entity.HanHaiMember; | |||
| import org.jeecg.modules.hanHaiMember.mapper.HanHaiMemberMapper; | |||
| import org.jeecg.modules.hanHaiMember.service.IHanHaiMemberService; | |||
| import org.springframework.stereotype.Service; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| /** | |||
| * @Description: 用户账户表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Service | |||
| public class HanHaiMemberServiceImpl extends ServiceImpl<HanHaiMemberMapper, HanHaiMember> implements IHanHaiMemberService { | |||
| } | |||
| @ -0,0 +1,274 @@ | |||
| <template> | |||
| <a-card :bordered="false"> | |||
| <!-- 查询区域 --> | |||
| <div class="table-page-search-wrapper"> | |||
| <a-form layout="inline" @keyup.enter.native="searchQuery"> | |||
| <a-row :gutter="24"> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <a-form-item label="用户昵称"> | |||
| <a-input placeholder="请输入用户昵称" v-model="queryParam.nickName"></a-input> | |||
| </a-form-item> | |||
| </a-col> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> | |||
| <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> | |||
| <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> | |||
| <a @click="handleToggleSearch" style="margin-left: 8px"> | |||
| {{ toggleSearchStatus ? '收起' : '展开' }} | |||
| <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> | |||
| </a> | |||
| </span> | |||
| </a-col> | |||
| </a-row> | |||
| </a-form> | |||
| </div> | |||
| <!-- 查询区域-END --> | |||
| <!-- 操作按钮区域 --> | |||
| <div class="table-operator"> | |||
| <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> | |||
| <a-button type="primary" icon="download" @click="handleExportXls('用户账户表')">导出</a-button> | |||
| <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | |||
| <a-button type="primary" icon="import">导入</a-button> | |||
| </a-upload> | |||
| <!-- 高级查询区域 --> | |||
| <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> | |||
| <a-dropdown v-if="selectedRowKeys.length > 0"> | |||
| <a-menu slot="overlay"> | |||
| <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> | |||
| </a-menu> | |||
| <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> | |||
| </a-dropdown> | |||
| </div> | |||
| <!-- table区域-begin --> | |||
| <div> | |||
| <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |||
| <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 | |||
| <a style="margin-left: 24px" @click="onClearSelected">清空</a> | |||
| </div> | |||
| <a-table | |||
| ref="table" | |||
| size="middle" | |||
| :scroll="{x:true}" | |||
| bordered | |||
| rowKey="id" | |||
| :columns="columns" | |||
| :dataSource="dataSource" | |||
| :pagination="ipagination" | |||
| :loading="loading" | |||
| :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" | |||
| class="j-table-force-nowrap" | |||
| @change="handleTableChange"> | |||
| <template slot="htmlSlot" slot-scope="text"> | |||
| <div v-html="text"></div> | |||
| </template> | |||
| <template slot="imgSlot" slot-scope="text,record"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | |||
| <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> | |||
| </template> | |||
| <template slot="fileSlot" slot-scope="text"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |||
| <a-button | |||
| v-else | |||
| :ghost="true" | |||
| type="primary" | |||
| icon="download" | |||
| size="small" | |||
| @click="downloadFile(text)"> | |||
| 下载 | |||
| </a-button> | |||
| </template> | |||
| <span slot="action" slot-scope="text, record"> | |||
| <a @click="handleEdit(record)">编辑</a> | |||
| <a-divider type="vertical" /> | |||
| <a-dropdown> | |||
| <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> | |||
| <a-menu slot="overlay"> | |||
| <a-menu-item> | |||
| <a @click="handleDetail(record)">详情</a> | |||
| </a-menu-item> | |||
| <a-menu-item> | |||
| <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | |||
| <a>删除</a> | |||
| </a-popconfirm> | |||
| </a-menu-item> | |||
| </a-menu> | |||
| </a-dropdown> | |||
| </span> | |||
| </a-table> | |||
| </div> | |||
| <han-hai-member-modal ref="modalForm" @ok="modalFormOk"></han-hai-member-modal> | |||
| </a-card> | |||
| </template> | |||
| <script> | |||
| import '@/assets/less/TableExpand.less' | |||
| import { mixinDevice } from '@/utils/mixin' | |||
| import { JeecgListMixin } from '@/mixins/JeecgListMixin' | |||
| import HanHaiMemberModal from './modules/HanHaiMemberModal' | |||
| export default { | |||
| name: 'HanHaiMemberList', | |||
| mixins:[JeecgListMixin, mixinDevice], | |||
| components: { | |||
| HanHaiMemberModal | |||
| }, | |||
| data () { | |||
| return { | |||
| description: '用户账户表管理页面', | |||
| // 表头 | |||
| columns: [ | |||
| { | |||
| title: '#', | |||
| dataIndex: '', | |||
| key:'rowIndex', | |||
| width:60, | |||
| align:"center", | |||
| customRender:function (t,r,index) { | |||
| return parseInt(index)+1; | |||
| } | |||
| }, | |||
| { | |||
| title:'创建日期', | |||
| align:"center", | |||
| dataIndex: 'createTime' | |||
| }, | |||
| { | |||
| title:'用户昵称', | |||
| align:"center", | |||
| dataIndex: 'nickName' | |||
| }, | |||
| { | |||
| title:'用户头像', | |||
| align:"center", | |||
| dataIndex: 'headImage', | |||
| scopedSlots: {customRender: 'imgSlot'} | |||
| }, | |||
| { | |||
| title:'手机号码', | |||
| align:"center", | |||
| dataIndex: 'phone' | |||
| }, | |||
| { | |||
| title:'小程序标识', | |||
| align:"center", | |||
| dataIndex: 'appletOpenid' | |||
| }, | |||
| { | |||
| title:'性别', | |||
| align:"center", | |||
| dataIndex: 'sex' | |||
| }, | |||
| { | |||
| title:'出生年', | |||
| align:"center", | |||
| dataIndex: 'yearDate', | |||
| customRender:function (text) { | |||
| return !text?"":(text.length>10?text.substr(0,10):text) | |||
| } | |||
| }, | |||
| { | |||
| title:'地址', | |||
| align:"center", | |||
| dataIndex: 'address' | |||
| }, | |||
| { | |||
| title:'状态', | |||
| align:"center", | |||
| dataIndex: 'state' | |||
| }, | |||
| { | |||
| title:'国籍', | |||
| align:"center", | |||
| dataIndex: 'city' | |||
| }, | |||
| { | |||
| title:'邮箱', | |||
| align:"center", | |||
| dataIndex: 'email' | |||
| }, | |||
| { | |||
| title:'学历', | |||
| align:"center", | |||
| dataIndex: 'shcool' | |||
| }, | |||
| { | |||
| title:'院校类型', | |||
| align:"center", | |||
| dataIndex: 'shcoolType' | |||
| }, | |||
| { | |||
| title:'工作', | |||
| align:"center", | |||
| dataIndex: 'workValue' | |||
| }, | |||
| { | |||
| title:'关于我', | |||
| align:"center", | |||
| dataIndex: 'details' | |||
| }, | |||
| { | |||
| title: '操作', | |||
| dataIndex: 'action', | |||
| align:"center", | |||
| fixed:"right", | |||
| width:147, | |||
| scopedSlots: { customRender: 'action' } | |||
| } | |||
| ], | |||
| url: { | |||
| list: "/hanHaiMember/hanHaiMember/list", | |||
| delete: "/hanHaiMember/hanHaiMember/delete", | |||
| deleteBatch: "/hanHaiMember/hanHaiMember/deleteBatch", | |||
| exportXlsUrl: "/hanHaiMember/hanHaiMember/exportXls", | |||
| importExcelUrl: "hanHaiMember/hanHaiMember/importExcel", | |||
| }, | |||
| dictOptions:{}, | |||
| superFieldList:[], | |||
| } | |||
| }, | |||
| created() { | |||
| this.getSuperFieldList(); | |||
| }, | |||
| computed: { | |||
| importExcelUrl: function(){ | |||
| return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | |||
| }, | |||
| }, | |||
| methods: { | |||
| initDictConfig(){ | |||
| }, | |||
| getSuperFieldList(){ | |||
| let fieldList=[]; | |||
| fieldList.push({type:'datetime',value:'createTime',text:'创建日期'}) | |||
| fieldList.push({type:'string',value:'nickName',text:'用户昵称',dictCode:''}) | |||
| fieldList.push({type:'string',value:'headImage',text:'用户头像',dictCode:''}) | |||
| fieldList.push({type:'string',value:'phone',text:'手机号码',dictCode:''}) | |||
| fieldList.push({type:'string',value:'appletOpenid',text:'小程序标识',dictCode:''}) | |||
| fieldList.push({type:'string',value:'sex',text:'性别',dictCode:''}) | |||
| fieldList.push({type:'date',value:'yearDate',text:'出生年'}) | |||
| fieldList.push({type:'string',value:'address',text:'地址',dictCode:''}) | |||
| fieldList.push({type:'string',value:'state',text:'状态',dictCode:''}) | |||
| fieldList.push({type:'string',value:'city',text:'国籍',dictCode:''}) | |||
| fieldList.push({type:'string',value:'email',text:'邮箱',dictCode:''}) | |||
| fieldList.push({type:'string',value:'shcool',text:'学历',dictCode:''}) | |||
| fieldList.push({type:'string',value:'shcoolType',text:'院校类型',dictCode:''}) | |||
| fieldList.push({type:'string',value:'workValue',text:'工作',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'details',text:'关于我',dictCode:''}) | |||
| this.superFieldList = fieldList | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| @import '~@assets/less/common.less'; | |||
| </style> | |||
| @ -0,0 +1,169 @@ | |||
| <template> | |||
| <a-spin :spinning="confirmLoading"> | |||
| <j-form-container :disabled="formDisabled"> | |||
| <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> | |||
| <a-row> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="用户昵称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nickName"> | |||
| <a-input v-model="model.nickName" placeholder="请输入用户昵称" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="用户头像" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="headImage"> | |||
| <j-image-upload isMultiple v-model="model.headImage" ></j-image-upload> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="手机号码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="phone"> | |||
| <a-input v-model="model.phone" placeholder="请输入手机号码" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="小程序标识" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="appletOpenid"> | |||
| <a-input v-model="model.appletOpenid" placeholder="请输入小程序标识" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="性别" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sex"> | |||
| <a-input v-model="model.sex" placeholder="请输入性别" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="出生年" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="yearDate"> | |||
| <j-date placeholder="请选择出生年" v-model="model.yearDate" style="width: 100%" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="address"> | |||
| <a-input v-model="model.address" placeholder="请输入地址" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="state"> | |||
| <a-input v-model="model.state" placeholder="请输入状态" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="国籍" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="city"> | |||
| <a-input v-model="model.city" placeholder="请输入国籍" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="邮箱" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="email"> | |||
| <a-input v-model="model.email" placeholder="请输入邮箱" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="学历" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shcool"> | |||
| <a-input v-model="model.shcool" placeholder="请输入学历" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="院校类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shcoolType"> | |||
| <a-input v-model="model.shcoolType" placeholder="请输入院校类型" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="工作" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workValue"> | |||
| <a-input v-model="model.workValue" placeholder="请输入工作" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="关于我" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="details"> | |||
| <a-textarea v-model="model.details" rows="4" placeholder="请输入关于我" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| </a-row> | |||
| </a-form-model> | |||
| </j-form-container> | |||
| </a-spin> | |||
| </template> | |||
| <script> | |||
| import { httpAction, getAction } from '@/api/manage' | |||
| import { validateDuplicateValue } from '@/utils/util' | |||
| export default { | |||
| name: 'HanHaiMemberForm', | |||
| components: { | |||
| }, | |||
| props: { | |||
| //表单禁用 | |||
| disabled: { | |||
| type: Boolean, | |||
| default: false, | |||
| required: false | |||
| } | |||
| }, | |||
| data () { | |||
| return { | |||
| model:{ | |||
| }, | |||
| labelCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 5 }, | |||
| }, | |||
| wrapperCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 16 }, | |||
| }, | |||
| confirmLoading: false, | |||
| validatorRules: { | |||
| }, | |||
| url: { | |||
| add: "/hanHaiMember/hanHaiMember/add", | |||
| edit: "/hanHaiMember/hanHaiMember/edit", | |||
| queryById: "/hanHaiMember/hanHaiMember/queryById" | |||
| } | |||
| } | |||
| }, | |||
| computed: { | |||
| formDisabled(){ | |||
| return this.disabled | |||
| }, | |||
| }, | |||
| created () { | |||
| //备份model原始值 | |||
| this.modelDefault = JSON.parse(JSON.stringify(this.model)); | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.edit(this.modelDefault); | |||
| }, | |||
| edit (record) { | |||
| this.model = Object.assign({}, record); | |||
| this.visible = true; | |||
| }, | |||
| submitForm () { | |||
| const that = this; | |||
| // 触发表单验证 | |||
| this.$refs.form.validate(valid => { | |||
| if (valid) { | |||
| that.confirmLoading = true; | |||
| let httpurl = ''; | |||
| let method = ''; | |||
| if(!this.model.id){ | |||
| httpurl+=this.url.add; | |||
| method = 'post'; | |||
| }else{ | |||
| httpurl+=this.url.edit; | |||
| method = 'put'; | |||
| } | |||
| httpAction(httpurl,this.model,method).then((res)=>{ | |||
| if(res.success){ | |||
| that.$message.success(res.message); | |||
| that.$emit('ok'); | |||
| }else{ | |||
| that.$message.warning(res.message); | |||
| } | |||
| }).finally(() => { | |||
| that.confirmLoading = false; | |||
| }) | |||
| } | |||
| }) | |||
| }, | |||
| } | |||
| } | |||
| </script> | |||
| @ -0,0 +1,84 @@ | |||
| <template> | |||
| <a-drawer | |||
| :title="title" | |||
| :width="width" | |||
| placement="right" | |||
| :closable="false" | |||
| @close="close" | |||
| destroyOnClose | |||
| :visible="visible"> | |||
| <han-hai-member-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></han-hai-member-form> | |||
| <div class="drawer-footer"> | |||
| <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> | |||
| <a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> | |||
| </div> | |||
| </a-drawer> | |||
| </template> | |||
| <script> | |||
| import HanHaiMemberForm from './HanHaiMemberForm' | |||
| export default { | |||
| name: 'HanHaiMemberModal', | |||
| components: { | |||
| HanHaiMemberForm | |||
| }, | |||
| data () { | |||
| return { | |||
| title:"操作", | |||
| width:800, | |||
| visible: false, | |||
| disableSubmit: false | |||
| } | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.add(); | |||
| }) | |||
| }, | |||
| edit (record) { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.edit(record); | |||
| }); | |||
| }, | |||
| close () { | |||
| this.$emit('close'); | |||
| this.visible = false; | |||
| }, | |||
| submitCallback(){ | |||
| this.$emit('ok'); | |||
| this.visible = false; | |||
| }, | |||
| handleOk () { | |||
| this.$refs.realForm.submitForm(); | |||
| }, | |||
| handleCancel () { | |||
| this.close() | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| <style lang="less" scoped> | |||
| /** Button按钮间距 */ | |||
| .ant-btn { | |||
| margin-left: 30px; | |||
| margin-bottom: 30px; | |||
| float: right; | |||
| } | |||
| .drawer-footer{ | |||
| position: absolute; | |||
| bottom: -8px; | |||
| width: 100%; | |||
| border-top: 1px solid #e8e8e8; | |||
| padding: 10px 16px; | |||
| text-align: right; | |||
| left: 0; | |||
| background: #fff; | |||
| border-radius: 0 0 2px 2px; | |||
| } | |||
| </style> | |||
| @ -0,0 +1,60 @@ | |||
| <template> | |||
| <j-modal | |||
| :title="title" | |||
| :width="width" | |||
| :visible="visible" | |||
| switchFullscreen | |||
| @ok="handleOk" | |||
| :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" | |||
| @cancel="handleCancel" | |||
| cancelText="关闭"> | |||
| <han-hai-member-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></han-hai-member-form> | |||
| </j-modal> | |||
| </template> | |||
| <script> | |||
| import HanHaiMemberForm from './HanHaiMemberForm' | |||
| export default { | |||
| name: 'HanHaiMemberModal', | |||
| components: { | |||
| HanHaiMemberForm | |||
| }, | |||
| data () { | |||
| return { | |||
| title:'', | |||
| width:800, | |||
| visible: false, | |||
| disableSubmit: false | |||
| } | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.add(); | |||
| }) | |||
| }, | |||
| edit (record) { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.edit(record); | |||
| }) | |||
| }, | |||
| close () { | |||
| this.$emit('close'); | |||
| this.visible = false; | |||
| }, | |||
| handleOk () { | |||
| this.$refs.realForm.submitForm(); | |||
| }, | |||
| submitCallback(){ | |||
| this.$emit('ok'); | |||
| this.visible = false; | |||
| }, | |||
| handleCancel () { | |||
| this.close() | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| @ -0,0 +1,61 @@ | |||
| import {defHttp} from '/@/utils/http/axios'; | |||
| import {Modal} from 'ant-design-vue'; | |||
| enum Api { | |||
| list = '/hanHaiMember/hanHaiMember/list', | |||
| save='/hanHaiMember/hanHaiMember/add', | |||
| edit='/hanHaiMember/hanHaiMember/edit', | |||
| deleteOne = '/hanHaiMember/hanHaiMember/delete', | |||
| deleteBatch = '/hanHaiMember/hanHaiMember/deleteBatch', | |||
| importExcel = '/hanHaiMember/hanHaiMember/importExcel', | |||
| exportXls = '/hanHaiMember/hanHaiMember/exportXls', | |||
| } | |||
| /** | |||
| * 导出api | |||
| * @param params | |||
| */ | |||
| export const getExportUrl = Api.exportXls; | |||
| /** | |||
| * 导入api | |||
| */ | |||
| export const getImportUrl = Api.importExcel; | |||
| /** | |||
| * 列表接口 | |||
| * @param params | |||
| */ | |||
| export const list = (params) => | |||
| defHttp.get({url: Api.list, params}); | |||
| /** | |||
| * 删除单个 | |||
| */ | |||
| export const deleteOne = (params,handleSuccess) => { | |||
| return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { | |||
| handleSuccess(); | |||
| }); | |||
| } | |||
| /** | |||
| * 批量删除 | |||
| * @param params | |||
| */ | |||
| export const batchDelete = (params, handleSuccess) => { | |||
| Modal.confirm({ | |||
| title: '确认删除', | |||
| content: '是否删除选中数据', | |||
| okText: '确认', | |||
| cancelText: '取消', | |||
| onOk: () => { | |||
| return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { | |||
| handleSuccess(); | |||
| }); | |||
| } | |||
| }); | |||
| } | |||
| /** | |||
| * 保存或者更新 | |||
| * @param params | |||
| */ | |||
| export const saveOrUpdate = (params, isUpdate) => { | |||
| let url = isUpdate ? Api.edit : Api.save; | |||
| return defHttp.post({url: url, params}); | |||
| } | |||
| @ -0,0 +1,170 @@ | |||
| import {BasicColumn} from '/@/components/Table'; | |||
| import {FormSchema} from '/@/components/Table'; | |||
| import { rules} from '/@/utils/helper/validator'; | |||
| import { render } from '/@/utils/common/renderUtils'; | |||
| //列表数据 | |||
| export const columns: BasicColumn[] = [ | |||
| { | |||
| title: '创建日期', | |||
| align:"center", | |||
| dataIndex: 'createTime' | |||
| }, | |||
| { | |||
| title: '用户昵称', | |||
| align:"center", | |||
| dataIndex: 'nickName' | |||
| }, | |||
| { | |||
| title: '用户头像', | |||
| align:"center", | |||
| dataIndex: 'headImage', | |||
| customRender:render.renderAvatar, | |||
| }, | |||
| { | |||
| title: '手机号码', | |||
| align:"center", | |||
| dataIndex: 'phone' | |||
| }, | |||
| { | |||
| title: '小程序标识', | |||
| align:"center", | |||
| dataIndex: 'appletOpenid' | |||
| }, | |||
| { | |||
| title: '性别', | |||
| align:"center", | |||
| dataIndex: 'sex' | |||
| }, | |||
| { | |||
| title: '出生年', | |||
| align:"center", | |||
| dataIndex: 'yearDate', | |||
| customRender:({text}) =>{ | |||
| return !text?"":(text.length>10?text.substr(0,10):text) | |||
| }, | |||
| }, | |||
| { | |||
| title: '地址', | |||
| align:"center", | |||
| dataIndex: 'address' | |||
| }, | |||
| { | |||
| title: '状态', | |||
| align:"center", | |||
| dataIndex: 'state' | |||
| }, | |||
| { | |||
| title: '国籍', | |||
| align:"center", | |||
| dataIndex: 'city' | |||
| }, | |||
| { | |||
| title: '邮箱', | |||
| align:"center", | |||
| dataIndex: 'email' | |||
| }, | |||
| { | |||
| title: '学历', | |||
| align:"center", | |||
| dataIndex: 'shcool' | |||
| }, | |||
| { | |||
| title: '院校类型', | |||
| align:"center", | |||
| dataIndex: 'shcoolType' | |||
| }, | |||
| { | |||
| title: '工作', | |||
| align:"center", | |||
| dataIndex: 'workValue' | |||
| }, | |||
| { | |||
| title: '关于我', | |||
| align:"center", | |||
| dataIndex: 'details' | |||
| }, | |||
| ]; | |||
| //查询数据 | |||
| export const searchFormSchema: FormSchema[] = [ | |||
| { | |||
| label: "用户昵称", | |||
| field: "nickName", | |||
| component: 'Input', | |||
| colProps: {span: 6}, | |||
| }, | |||
| ]; | |||
| //表单数据 | |||
| export const formSchema: FormSchema[] = [ | |||
| { | |||
| label: '用户昵称', | |||
| field: 'nickName', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '用户头像', | |||
| field: 'headImage', | |||
| component: 'JImageUpload', | |||
| componentProps:{ | |||
| }, | |||
| }, | |||
| { | |||
| label: '手机号码', | |||
| field: 'phone', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '小程序标识', | |||
| field: 'appletOpenid', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '性别', | |||
| field: 'sex', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '出生年', | |||
| field: 'yearDate', | |||
| component: 'DatePicker', | |||
| }, | |||
| { | |||
| label: '地址', | |||
| field: 'address', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '状态', | |||
| field: 'state', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '国籍', | |||
| field: 'city', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '邮箱', | |||
| field: 'email', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '学历', | |||
| field: 'shcool', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '院校类型', | |||
| field: 'shcoolType', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '工作', | |||
| field: 'workValue', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '关于我', | |||
| field: 'details', | |||
| component: 'InputTextArea',//TODO 注意string转换问题 | |||
| }, | |||
| ]; | |||
| @ -0,0 +1,162 @@ | |||
| <template> | |||
| <div> | |||
| <!--引用表格--> | |||
| <BasicTable @register="registerTable" :rowSelection="rowSelection"> | |||
| <!--插槽:table标题--> | |||
| <template #tableTitle> | |||
| <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button> | |||
| <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button> | |||
| <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button> | |||
| <a-dropdown v-if="checkedKeys.length > 0"> | |||
| <template #overlay> | |||
| <a-menu> | |||
| <a-menu-item key="1" @click="batchHandleDelete"> | |||
| <Icon icon="ant-design:delete-outlined"></Icon> | |||
| 删除 | |||
| </a-menu-item> | |||
| </a-menu> | |||
| </template> | |||
| <a-button>批量操作 | |||
| <Icon icon="mdi:chevron-down"></Icon> | |||
| </a-button> | |||
| </a-dropdown> | |||
| </template> | |||
| <!--操作栏--> | |||
| <template #action="{ record }"> | |||
| <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/> | |||
| </template> | |||
| <!--字段回显插槽--> | |||
| <template #htmlSlot="{text}"> | |||
| <div v-html="text"></div> | |||
| </template> | |||
| <template #fileSlot="{text}"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |||
| <a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button> | |||
| </template> | |||
| </BasicTable> | |||
| <!-- 表单区域 --> | |||
| <HanHaiMemberModal @register="registerModal" @success="handleSuccess"></HanHaiMemberModal> | |||
| </div> | |||
| </template> | |||
| <script lang="ts" name="hanHaiMember-hanHaiMember" setup> | |||
| import {ref, computed, unref} from 'vue'; | |||
| import {BasicTable, useTable, TableAction} from '/@/components/Table'; | |||
| import {useModal} from '/@/components/Modal'; | |||
| import { useListPage } from '/@/hooks/system/useListPage' | |||
| import HanHaiMemberModal from './components/HanHaiMemberModal.vue' | |||
| import {columns, searchFormSchema} from './hanHaiMember.data'; | |||
| import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './hanHaiMember.api'; | |||
| const checkedKeys = ref<Array<string | number>>([]); | |||
| //注册model | |||
| const [registerModal, {openModal}] = useModal(); | |||
| //注册table数据 | |||
| const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({ | |||
| tableProps:{ | |||
| title: '用户账户表', | |||
| api: list, | |||
| columns, | |||
| canResize:false, | |||
| formConfig: { | |||
| labelWidth: 120, | |||
| schemas: searchFormSchema, | |||
| autoSubmitOnEnter:true, | |||
| showAdvancedButton:true, | |||
| fieldMapToTime: [ | |||
| ], | |||
| }, | |||
| actionColumn: { | |||
| width: 120, | |||
| }, | |||
| }, | |||
| exportConfig: { | |||
| name:"用户账户表", | |||
| url: getExportUrl, | |||
| }, | |||
| importConfig: { | |||
| url: getImportUrl | |||
| }, | |||
| }) | |||
| const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext | |||
| /** | |||
| * 新增事件 | |||
| */ | |||
| function handleAdd() { | |||
| openModal(true, { | |||
| isUpdate: false, | |||
| showFooter: true, | |||
| }); | |||
| } | |||
| /** | |||
| * 编辑事件 | |||
| */ | |||
| function handleEdit(record: Recordable) { | |||
| openModal(true, { | |||
| record, | |||
| isUpdate: true, | |||
| showFooter: true, | |||
| }); | |||
| } | |||
| /** | |||
| * 详情 | |||
| */ | |||
| function handleDetail(record: Recordable) { | |||
| openModal(true, { | |||
| record, | |||
| isUpdate: true, | |||
| showFooter: false, | |||
| }); | |||
| } | |||
| /** | |||
| * 删除事件 | |||
| */ | |||
| async function handleDelete(record) { | |||
| await deleteOne({id: record.id}, reload); | |||
| } | |||
| /** | |||
| * 批量删除事件 | |||
| */ | |||
| async function batchHandleDelete() { | |||
| await batchDelete({ids: checkedKeys.value}, reload); | |||
| } | |||
| /** | |||
| * 成功回调 | |||
| */ | |||
| function handleSuccess() { | |||
| reload(); | |||
| } | |||
| /** | |||
| * 操作栏 | |||
| */ | |||
| function getTableAction(record){ | |||
| return [ | |||
| { | |||
| label: '编辑', | |||
| onClick: handleEdit.bind(null, record), | |||
| } | |||
| ] | |||
| } | |||
| /** | |||
| * 下拉操作栏 | |||
| */ | |||
| function getDropDownAction(record){ | |||
| return [ | |||
| { | |||
| label: '详情', | |||
| onClick: handleDetail.bind(null, record), | |||
| }, { | |||
| label: '删除', | |||
| popConfirm: { | |||
| title: '是否确认删除', | |||
| confirm: handleDelete.bind(null, record), | |||
| } | |||
| } | |||
| ] | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| </style> | |||
| @ -0,0 +1,58 @@ | |||
| <template> | |||
| <BasicModal v-bind="$attrs" @register="registerModal" :title="title" @ok="handleSubmit"> | |||
| <BasicForm @register="registerForm"/> | |||
| </BasicModal> | |||
| </template> | |||
| <script lang="ts" setup> | |||
| import {ref, computed, unref} from 'vue'; | |||
| import {BasicModal, useModalInner} from '/@/components/Modal'; | |||
| import {BasicForm, useForm} from '/@/components/Form/index'; | |||
| import {formSchema} from '../hanHaiMember.data'; | |||
| import {saveOrUpdate} from '../hanHaiMember.api'; | |||
| // Emits声明 | |||
| const emit = defineEmits(['register','success']); | |||
| const isUpdate = ref(true); | |||
| //表单配置 | |||
| const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({ | |||
| labelWidth: 150, | |||
| schemas: formSchema, | |||
| showActionButtonGroup: false, | |||
| }); | |||
| //表单赋值 | |||
| const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => { | |||
| //重置表单 | |||
| await resetFields(); | |||
| setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter}); | |||
| isUpdate.value = !!data?.isUpdate; | |||
| if (unref(isUpdate)) { | |||
| //表单赋值 | |||
| await setFieldsValue({ | |||
| ...data.record, | |||
| }); | |||
| } | |||
| // 隐藏底部时禁用整个表单 | |||
| setProps({ disabled: !data?.showFooter }) | |||
| }); | |||
| //设置标题 | |||
| const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑')); | |||
| //表单提交事件 | |||
| async function handleSubmit(v) { | |||
| try { | |||
| let values = await validate(); | |||
| setModalProps({confirmLoading: true}); | |||
| //提交表单 | |||
| await saveOrUpdate(values, isUpdate.value); | |||
| //关闭弹窗 | |||
| closeModal(); | |||
| //刷新列表 | |||
| emit('success'); | |||
| } finally { | |||
| setModalProps({confirmLoading: false}); | |||
| } | |||
| } | |||
| </script> | |||
| <style lang="less" scoped> | |||
| </style> | |||
| @ -0,0 +1,171 @@ | |||
| package org.jeecg.modules.popularizeActivity.controller; | |||
| import java.util.Arrays; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import java.util.stream.Collectors; | |||
| import java.io.IOException; | |||
| import java.io.UnsupportedEncodingException; | |||
| import java.net.URLDecoder; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import org.jeecg.common.api.vo.Result; | |||
| import org.jeecg.common.system.query.QueryGenerator; | |||
| import org.jeecg.common.util.oConvertUtils; | |||
| import org.jeecg.modules.popularizeActivity.entity.PopularizeActivity; | |||
| import org.jeecg.modules.popularizeActivity.service.IPopularizeActivityService; | |||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
| import com.baomidou.mybatisplus.core.metadata.IPage; | |||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.jeecgframework.poi.excel.ExcelImportUtil; | |||
| import org.jeecgframework.poi.excel.def.NormalExcelConstants; | |||
| import org.jeecgframework.poi.excel.entity.ExportParams; | |||
| import org.jeecgframework.poi.excel.entity.ImportParams; | |||
| import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | |||
| import org.jeecg.common.system.base.controller.JeecgController; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import org.springframework.web.multipart.MultipartFile; | |||
| import org.springframework.web.multipart.MultipartHttpServletRequest; | |||
| import org.springframework.web.servlet.ModelAndView; | |||
| import com.alibaba.fastjson.JSON; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.jeecg.common.aspect.annotation.AutoLog; | |||
| /** | |||
| * @Description: 活动信息表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Api(tags="活动信息表") | |||
| @RestController | |||
| @RequestMapping("/popularizeActivity/popularizeActivity") | |||
| @Slf4j | |||
| public class PopularizeActivityController extends JeecgController<PopularizeActivity, IPopularizeActivityService> { | |||
| @Autowired | |||
| private IPopularizeActivityService popularizeActivityService; | |||
| /** | |||
| * 分页列表查询 | |||
| * | |||
| * @param popularizeActivity | |||
| * @param pageNo | |||
| * @param pageSize | |||
| * @param req | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "活动信息表-分页列表查询") | |||
| @ApiOperation(value="活动信息表-分页列表查询", notes="活动信息表-分页列表查询") | |||
| @GetMapping(value = "/list") | |||
| public Result<IPage<PopularizeActivity>> queryPageList(PopularizeActivity popularizeActivity, | |||
| @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | |||
| @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | |||
| HttpServletRequest req) { | |||
| QueryWrapper<PopularizeActivity> queryWrapper = QueryGenerator.initQueryWrapper(popularizeActivity, req.getParameterMap()); | |||
| Page<PopularizeActivity> page = new Page<PopularizeActivity>(pageNo, pageSize); | |||
| IPage<PopularizeActivity> pageList = popularizeActivityService.page(page, queryWrapper); | |||
| return Result.OK(pageList); | |||
| } | |||
| /** | |||
| * 添加 | |||
| * | |||
| * @param popularizeActivity | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "活动信息表-添加") | |||
| @ApiOperation(value="活动信息表-添加", notes="活动信息表-添加") | |||
| @PostMapping(value = "/add") | |||
| public Result<String> add(@RequestBody PopularizeActivity popularizeActivity) { | |||
| popularizeActivityService.save(popularizeActivity); | |||
| return Result.OK("添加成功!"); | |||
| } | |||
| /** | |||
| * 编辑 | |||
| * | |||
| * @param popularizeActivity | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "活动信息表-编辑") | |||
| @ApiOperation(value="活动信息表-编辑", notes="活动信息表-编辑") | |||
| @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) | |||
| public Result<String> edit(@RequestBody PopularizeActivity popularizeActivity) { | |||
| popularizeActivityService.updateById(popularizeActivity); | |||
| return Result.OK("编辑成功!"); | |||
| } | |||
| /** | |||
| * 通过id删除 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "活动信息表-通过id删除") | |||
| @ApiOperation(value="活动信息表-通过id删除", notes="活动信息表-通过id删除") | |||
| @DeleteMapping(value = "/delete") | |||
| public Result<String> delete(@RequestParam(name="id",required=true) String id) { | |||
| popularizeActivityService.removeById(id); | |||
| return Result.OK("删除成功!"); | |||
| } | |||
| /** | |||
| * 批量删除 | |||
| * | |||
| * @param ids | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "活动信息表-批量删除") | |||
| @ApiOperation(value="活动信息表-批量删除", notes="活动信息表-批量删除") | |||
| @DeleteMapping(value = "/deleteBatch") | |||
| public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | |||
| this.popularizeActivityService.removeByIds(Arrays.asList(ids.split(","))); | |||
| return Result.OK("批量删除成功!"); | |||
| } | |||
| /** | |||
| * 通过id查询 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "活动信息表-通过id查询") | |||
| @ApiOperation(value="活动信息表-通过id查询", notes="活动信息表-通过id查询") | |||
| @GetMapping(value = "/queryById") | |||
| public Result<PopularizeActivity> queryById(@RequestParam(name="id",required=true) String id) { | |||
| PopularizeActivity popularizeActivity = popularizeActivityService.getById(id); | |||
| if(popularizeActivity==null) { | |||
| return Result.error("未找到对应数据"); | |||
| } | |||
| return Result.OK(popularizeActivity); | |||
| } | |||
| /** | |||
| * 导出excel | |||
| * | |||
| * @param request | |||
| * @param popularizeActivity | |||
| */ | |||
| @RequestMapping(value = "/exportXls") | |||
| public ModelAndView exportXls(HttpServletRequest request, PopularizeActivity popularizeActivity) { | |||
| return super.exportXls(request, popularizeActivity, PopularizeActivity.class, "活动信息表"); | |||
| } | |||
| /** | |||
| * 通过excel导入数据 | |||
| * | |||
| * @param request | |||
| * @param response | |||
| * @return | |||
| */ | |||
| @RequestMapping(value = "/importExcel", method = RequestMethod.POST) | |||
| public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | |||
| return super.importExcel(request, response, PopularizeActivity.class); | |||
| } | |||
| } | |||
| @ -0,0 +1,149 @@ | |||
| package org.jeecg.modules.popularizeActivity.entity; | |||
| import java.io.Serializable; | |||
| import java.io.UnsupportedEncodingException; | |||
| import java.util.Date; | |||
| import java.math.BigDecimal; | |||
| import com.baomidou.mybatisplus.annotation.IdType; | |||
| import com.baomidou.mybatisplus.annotation.TableId; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import lombok.Data; | |||
| import com.fasterxml.jackson.annotation.JsonFormat; | |||
| import org.springframework.format.annotation.DateTimeFormat; | |||
| import org.jeecgframework.poi.excel.annotation.Excel; | |||
| import org.jeecg.common.aspect.annotation.Dict; | |||
| import io.swagger.annotations.ApiModel; | |||
| import io.swagger.annotations.ApiModelProperty; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.experimental.Accessors; | |||
| /** | |||
| * @Description: 活动信息表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Data | |||
| @TableName("popularize_activity") | |||
| @Accessors(chain = true) | |||
| @EqualsAndHashCode(callSuper = false) | |||
| @ApiModel(value="popularize_activity对象", description="活动信息表") | |||
| public class PopularizeActivity implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| /**主键*/ | |||
| @TableId(type = IdType.ASSIGN_ID) | |||
| @ApiModelProperty(value = "主键") | |||
| private java.lang.String id; | |||
| /**创建人*/ | |||
| @ApiModelProperty(value = "创建人") | |||
| private java.lang.String createBy; | |||
| /**创建日期*/ | |||
| @ApiModelProperty(value = "创建日期") | |||
| private java.util.Date createTime; | |||
| /**更新人*/ | |||
| @ApiModelProperty(value = "更新人") | |||
| private java.lang.String updateBy; | |||
| /**更新日期*/ | |||
| @ApiModelProperty(value = "更新日期") | |||
| private java.util.Date updateTime; | |||
| /**活动编号*/ | |||
| @Excel(name = "活动编号", width = 15) | |||
| @ApiModelProperty(value = "活动编号") | |||
| private java.lang.String no; | |||
| /**中文-活动标题*/ | |||
| @Excel(name = "中文-活动标题", width = 15) | |||
| @ApiModelProperty(value = "中文-活动标题") | |||
| private java.lang.String title; | |||
| /**英文-活动标题*/ | |||
| @Excel(name = "英文-活动标题", width = 15) | |||
| @ApiModelProperty(value = "英文-活动标题") | |||
| private java.lang.String enTitle; | |||
| /**活动类型*/ | |||
| @Excel(name = "活动类型", width = 15, dicCode = "no_type") | |||
| @Dict(dicCode = "no_type") | |||
| @ApiModelProperty(value = "活动类型") | |||
| private java.lang.String type; | |||
| /**活动封面*/ | |||
| @Excel(name = "活动封面", width = 15) | |||
| @ApiModelProperty(value = "活动封面") | |||
| private java.lang.String image; | |||
| /**活动时间*/ | |||
| @Excel(name = "活动时间", width = 15) | |||
| @ApiModelProperty(value = "活动时间") | |||
| private java.util.Date startTime; | |||
| /**中文-活动地址*/ | |||
| @Excel(name = "中文-活动地址", width = 15) | |||
| @ApiModelProperty(value = "中文-活动地址") | |||
| private java.lang.String address; | |||
| /**英文-活动地址*/ | |||
| @Excel(name = "英文-活动地址", width = 15) | |||
| @ApiModelProperty(value = "英文-活动地址") | |||
| private java.lang.String enAddress; | |||
| /**活动人数*/ | |||
| @Excel(name = "活动人数", width = 15) | |||
| @ApiModelProperty(value = "活动人数") | |||
| private java.lang.Integer sum; | |||
| /**报名人数*/ | |||
| @Excel(name = "报名人数", width = 15) | |||
| @ApiModelProperty(value = "报名人数") | |||
| private java.lang.Integer num; | |||
| /**报名费用*/ | |||
| @Excel(name = "报名费用", width = 15) | |||
| @ApiModelProperty(value = "报名费用") | |||
| private java.math.BigDecimal price; | |||
| /**主理人*/ | |||
| @Excel(name = "主理人", width = 15, dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") | |||
| @Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") | |||
| @ApiModelProperty(value = "主理人") | |||
| private java.lang.String adminUser; | |||
| /**签到人数*/ | |||
| @Excel(name = "签到人数", width = 15) | |||
| @ApiModelProperty(value = "签到人数") | |||
| private java.lang.Integer openNum; | |||
| /**是否上架*/ | |||
| @Excel(name = "是否上架", width = 15) | |||
| @ApiModelProperty(value = "是否上架") | |||
| private java.lang.String isOpen; | |||
| /**活动状态*/ | |||
| @Excel(name = "活动状态", width = 15, dicCode = "no_state") | |||
| @Dict(dicCode = "no_state") | |||
| @ApiModelProperty(value = "活动状态") | |||
| private java.lang.Integer state; | |||
| /**活动详情*/ | |||
| @Excel(name = "活动详情", width = 15) | |||
| @ApiModelProperty(value = "活动详情") | |||
| private java.lang.String details; | |||
| /**英文-活动详情*/ | |||
| @Excel(name = "英文-活动详情", width = 15) | |||
| @ApiModelProperty(value = "英文-活动详情") | |||
| private java.lang.String enDetails; | |||
| /**中文-注意事项*/ | |||
| @Excel(name = "中文-注意事项", width = 15) | |||
| @ApiModelProperty(value = "中文-注意事项") | |||
| private java.lang.String precautions; | |||
| /**英文-注意事项*/ | |||
| @Excel(name = "英文-注意事项", width = 15) | |||
| @ApiModelProperty(value = "英文-注意事项") | |||
| private java.lang.String enPrecautions; | |||
| /**早鸟票*/ | |||
| @Excel(name = "早鸟票", width = 15) | |||
| @ApiModelProperty(value = "早鸟票") | |||
| private java.math.BigDecimal birdPrice; | |||
| /**单人票*/ | |||
| @Excel(name = "单人票", width = 15) | |||
| @ApiModelProperty(value = "单人票") | |||
| private java.math.BigDecimal personPrice; | |||
| /**尊享票*/ | |||
| @Excel(name = "尊享票", width = 15) | |||
| @ApiModelProperty(value = "尊享票") | |||
| private java.math.BigDecimal expensivePrice; | |||
| /**经度*/ | |||
| @Excel(name = "经度", width = 15) | |||
| @ApiModelProperty(value = "经度") | |||
| private java.lang.String longitude; | |||
| /**纬度*/ | |||
| @Excel(name = "纬度", width = 15) | |||
| @ApiModelProperty(value = "纬度") | |||
| private java.lang.String latitude; | |||
| } | |||
| @ -0,0 +1,17 @@ | |||
| package org.jeecg.modules.popularizeActivity.mapper; | |||
| import java.util.List; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import org.jeecg.modules.popularizeActivity.entity.PopularizeActivity; | |||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
| /** | |||
| * @Description: 活动信息表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface PopularizeActivityMapper extends BaseMapper<PopularizeActivity> { | |||
| } | |||
| @ -0,0 +1,5 @@ | |||
| <?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="org.jeecg.modules.popularizeActivity.mapper.PopularizeActivityMapper"> | |||
| </mapper> | |||
| @ -0,0 +1,14 @@ | |||
| package org.jeecg.modules.popularizeActivity.service; | |||
| import org.jeecg.modules.popularizeActivity.entity.PopularizeActivity; | |||
| import com.baomidou.mybatisplus.extension.service.IService; | |||
| /** | |||
| * @Description: 活动信息表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface IPopularizeActivityService extends IService<PopularizeActivity> { | |||
| } | |||
| @ -0,0 +1,19 @@ | |||
| package org.jeecg.modules.popularizeActivity.service.impl; | |||
| import org.jeecg.modules.popularizeActivity.entity.PopularizeActivity; | |||
| import org.jeecg.modules.popularizeActivity.mapper.PopularizeActivityMapper; | |||
| import org.jeecg.modules.popularizeActivity.service.IPopularizeActivityService; | |||
| import org.springframework.stereotype.Service; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| /** | |||
| * @Description: 活动信息表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Service | |||
| public class PopularizeActivityServiceImpl extends ServiceImpl<PopularizeActivityMapper, PopularizeActivity> implements IPopularizeActivityService { | |||
| } | |||
| @ -0,0 +1,357 @@ | |||
| <template> | |||
| <a-card :bordered="false"> | |||
| <!-- 查询区域 --> | |||
| <div class="table-page-search-wrapper"> | |||
| <a-form layout="inline" @keyup.enter.native="searchQuery"> | |||
| <a-row :gutter="24"> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <a-form-item label="中文-活动标题"> | |||
| <a-input placeholder="请输入中文-活动标题" v-model="queryParam.title"></a-input> | |||
| </a-form-item> | |||
| </a-col> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <a-form-item label="英文-活动标题"> | |||
| <a-input placeholder="请输入英文-活动标题" v-model="queryParam.enTitle"></a-input> | |||
| </a-form-item> | |||
| </a-col> | |||
| <template v-if="toggleSearchStatus"> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <a-form-item label="活动类型"> | |||
| <j-dict-select-tag placeholder="请选择活动类型" v-model="queryParam.type" dictCode="no_type"/> | |||
| </a-form-item> | |||
| </a-col> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <a-form-item label="活动时间"> | |||
| <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择活动时间" v-model="queryParam.startTime"></j-date> | |||
| </a-form-item> | |||
| </a-col> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <a-form-item label="中文-活动地址"> | |||
| <a-input placeholder="请输入中文-活动地址" v-model="queryParam.address"></a-input> | |||
| </a-form-item> | |||
| </a-col> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <a-form-item label="英文-活动地址"> | |||
| <a-input placeholder="请输入英文-活动地址" v-model="queryParam.enAddress"></a-input> | |||
| </a-form-item> | |||
| </a-col> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <a-form-item label="主理人"> | |||
| <j-search-select-tag placeholder="请选择主理人" v-model="queryParam.adminUser" dict="han_hai_member,nick_name,id"/> | |||
| </a-form-item> | |||
| </a-col> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <a-form-item label="是否上架"> | |||
| <j-switch placeholder="请选择是否上架" v-model="queryParam.isOpen" query></j-switch> | |||
| </a-form-item> | |||
| </a-col> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <a-form-item label="活动状态"> | |||
| <j-dict-select-tag placeholder="请选择活动状态" v-model="queryParam.state" dictCode="no_state"/> | |||
| </a-form-item> | |||
| </a-col> | |||
| </template> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> | |||
| <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> | |||
| <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> | |||
| <a @click="handleToggleSearch" style="margin-left: 8px"> | |||
| {{ toggleSearchStatus ? '收起' : '展开' }} | |||
| <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> | |||
| </a> | |||
| </span> | |||
| </a-col> | |||
| </a-row> | |||
| </a-form> | |||
| </div> | |||
| <!-- 查询区域-END --> | |||
| <!-- 操作按钮区域 --> | |||
| <div class="table-operator"> | |||
| <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> | |||
| <a-button type="primary" icon="download" @click="handleExportXls('活动信息表')">导出</a-button> | |||
| <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | |||
| <a-button type="primary" icon="import">导入</a-button> | |||
| </a-upload> | |||
| <!-- 高级查询区域 --> | |||
| <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> | |||
| <a-dropdown v-if="selectedRowKeys.length > 0"> | |||
| <a-menu slot="overlay"> | |||
| <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> | |||
| </a-menu> | |||
| <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> | |||
| </a-dropdown> | |||
| </div> | |||
| <!-- table区域-begin --> | |||
| <div> | |||
| <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |||
| <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 | |||
| <a style="margin-left: 24px" @click="onClearSelected">清空</a> | |||
| </div> | |||
| <a-table | |||
| ref="table" | |||
| size="middle" | |||
| :scroll="{x:true}" | |||
| bordered | |||
| rowKey="id" | |||
| :columns="columns" | |||
| :dataSource="dataSource" | |||
| :pagination="ipagination" | |||
| :loading="loading" | |||
| :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" | |||
| class="j-table-force-nowrap" | |||
| @change="handleTableChange"> | |||
| <template slot="htmlSlot" slot-scope="text"> | |||
| <div v-html="text"></div> | |||
| </template> | |||
| <template slot="imgSlot" slot-scope="text,record"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | |||
| <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> | |||
| </template> | |||
| <template slot="fileSlot" slot-scope="text"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |||
| <a-button | |||
| v-else | |||
| :ghost="true" | |||
| type="primary" | |||
| icon="download" | |||
| size="small" | |||
| @click="downloadFile(text)"> | |||
| 下载 | |||
| </a-button> | |||
| </template> | |||
| <span slot="action" slot-scope="text, record"> | |||
| <a @click="handleEdit(record)">编辑</a> | |||
| <a-divider type="vertical" /> | |||
| <a-dropdown> | |||
| <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> | |||
| <a-menu slot="overlay"> | |||
| <a-menu-item> | |||
| <a @click="handleDetail(record)">详情</a> | |||
| </a-menu-item> | |||
| <a-menu-item> | |||
| <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | |||
| <a>删除</a> | |||
| </a-popconfirm> | |||
| </a-menu-item> | |||
| </a-menu> | |||
| </a-dropdown> | |||
| </span> | |||
| </a-table> | |||
| </div> | |||
| <popularize-activity-modal ref="modalForm" @ok="modalFormOk"></popularize-activity-modal> | |||
| </a-card> | |||
| </template> | |||
| <script> | |||
| import '@/assets/less/TableExpand.less' | |||
| import { mixinDevice } from '@/utils/mixin' | |||
| import { JeecgListMixin } from '@/mixins/JeecgListMixin' | |||
| import PopularizeActivityModal from './modules/PopularizeActivityModal' | |||
| import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' | |||
| export default { | |||
| name: 'PopularizeActivityList', | |||
| mixins:[JeecgListMixin, mixinDevice], | |||
| components: { | |||
| PopularizeActivityModal | |||
| }, | |||
| data () { | |||
| return { | |||
| description: '活动信息表管理页面', | |||
| // 表头 | |||
| columns: [ | |||
| { | |||
| title: '#', | |||
| dataIndex: '', | |||
| key:'rowIndex', | |||
| width:60, | |||
| align:"center", | |||
| customRender:function (t,r,index) { | |||
| return parseInt(index)+1; | |||
| } | |||
| }, | |||
| { | |||
| title:'创建人', | |||
| align:"center", | |||
| dataIndex: 'createBy' | |||
| }, | |||
| { | |||
| title:'创建日期', | |||
| align:"center", | |||
| sorter: true, | |||
| dataIndex: 'createTime' | |||
| }, | |||
| { | |||
| title:'中文-活动标题', | |||
| align:"center", | |||
| dataIndex: 'title' | |||
| }, | |||
| { | |||
| title:'英文-活动标题', | |||
| align:"center", | |||
| dataIndex: 'enTitle' | |||
| }, | |||
| { | |||
| title:'活动类型', | |||
| align:"center", | |||
| dataIndex: 'type_dictText' | |||
| }, | |||
| { | |||
| title:'活动封面', | |||
| align:"center", | |||
| dataIndex: 'image', | |||
| scopedSlots: {customRender: 'imgSlot'} | |||
| }, | |||
| { | |||
| title:'活动时间', | |||
| align:"center", | |||
| dataIndex: 'startTime' | |||
| }, | |||
| { | |||
| title:'中文-活动地址', | |||
| align:"center", | |||
| dataIndex: 'address' | |||
| }, | |||
| { | |||
| title:'英文-活动地址', | |||
| align:"center", | |||
| dataIndex: 'enAddress' | |||
| }, | |||
| { | |||
| title:'活动人数', | |||
| align:"center", | |||
| dataIndex: 'sum' | |||
| }, | |||
| { | |||
| title:'报名人数', | |||
| align:"center", | |||
| dataIndex: 'num' | |||
| }, | |||
| { | |||
| title:'报名费用', | |||
| align:"center", | |||
| dataIndex: 'price' | |||
| }, | |||
| { | |||
| title:'主理人', | |||
| align:"center", | |||
| dataIndex: 'adminUser_dictText' | |||
| }, | |||
| { | |||
| title:'签到人数', | |||
| align:"center", | |||
| dataIndex: 'openNum' | |||
| }, | |||
| { | |||
| title:'是否上架', | |||
| align:"center", | |||
| dataIndex: 'isOpen', | |||
| customRender: (text) => (text ? filterMultiDictText(this.dictOptions['isOpen'], text) : ''), | |||
| }, | |||
| { | |||
| title:'活动状态', | |||
| align:"center", | |||
| dataIndex: 'state_dictText' | |||
| }, | |||
| { | |||
| title:'早鸟票', | |||
| align:"center", | |||
| dataIndex: 'birdPrice' | |||
| }, | |||
| { | |||
| title:'单人票', | |||
| align:"center", | |||
| dataIndex: 'personPrice' | |||
| }, | |||
| { | |||
| title:'尊享票', | |||
| align:"center", | |||
| dataIndex: 'expensivePrice' | |||
| }, | |||
| { | |||
| title:'经度', | |||
| align:"center", | |||
| dataIndex: 'longitude' | |||
| }, | |||
| { | |||
| title:'纬度', | |||
| align:"center", | |||
| dataIndex: 'latitude' | |||
| }, | |||
| { | |||
| title: '操作', | |||
| dataIndex: 'action', | |||
| align:"center", | |||
| fixed:"right", | |||
| width:147, | |||
| scopedSlots: { customRender: 'action' } | |||
| } | |||
| ], | |||
| url: { | |||
| list: "/popularizeActivity/popularizeActivity/list", | |||
| delete: "/popularizeActivity/popularizeActivity/delete", | |||
| deleteBatch: "/popularizeActivity/popularizeActivity/deleteBatch", | |||
| exportXlsUrl: "/popularizeActivity/popularizeActivity/exportXls", | |||
| importExcelUrl: "popularizeActivity/popularizeActivity/importExcel", | |||
| }, | |||
| dictOptions:{}, | |||
| superFieldList:[], | |||
| } | |||
| }, | |||
| created() { | |||
| this.$set(this.dictOptions, 'isOpen', [{text:'是',value:'Y'},{text:'否',value:'N'}]) | |||
| this.getSuperFieldList(); | |||
| }, | |||
| computed: { | |||
| importExcelUrl: function(){ | |||
| return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | |||
| }, | |||
| }, | |||
| methods: { | |||
| initDictConfig(){ | |||
| }, | |||
| getSuperFieldList(){ | |||
| let fieldList=[]; | |||
| fieldList.push({type:'string',value:'createBy',text:'创建人',dictCode:''}) | |||
| fieldList.push({type:'datetime',value:'createTime',text:'创建日期'}) | |||
| fieldList.push({type:'string',value:'title',text:'中文-活动标题',dictCode:''}) | |||
| fieldList.push({type:'string',value:'enTitle',text:'英文-活动标题',dictCode:''}) | |||
| fieldList.push({type:'string',value:'type',text:'活动类型',dictCode:'no_type'}) | |||
| fieldList.push({type:'Text',value:'image',text:'活动封面',dictCode:''}) | |||
| fieldList.push({type:'datetime',value:'startTime',text:'活动时间'}) | |||
| fieldList.push({type:'Text',value:'address',text:'中文-活动地址',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'enAddress',text:'英文-活动地址',dictCode:''}) | |||
| fieldList.push({type:'int',value:'sum',text:'活动人数',dictCode:''}) | |||
| fieldList.push({type:'int',value:'num',text:'报名人数',dictCode:''}) | |||
| fieldList.push({type:'BigDecimal',value:'price',text:'报名费用',dictCode:''}) | |||
| fieldList.push({type:'sel_search',value:'adminUser',text:'主理人',dictTable:"han_hai_member", dictText:'nick_name', dictCode:'id'}) | |||
| fieldList.push({type:'int',value:'openNum',text:'签到人数',dictCode:''}) | |||
| fieldList.push({type:'switch',value:'isOpen',text:'是否上架'}) | |||
| fieldList.push({type:'int',value:'state',text:'活动状态',dictCode:'no_state'}) | |||
| fieldList.push({type:'Text',value:'details',text:'活动详情',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'enDetails',text:'英文-活动详情',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'precautions',text:'中文-注意事项',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'enPrecautions',text:'英文-注意事项',dictCode:''}) | |||
| fieldList.push({type:'BigDecimal',value:'birdPrice',text:'早鸟票',dictCode:''}) | |||
| fieldList.push({type:'BigDecimal',value:'personPrice',text:'单人票',dictCode:''}) | |||
| fieldList.push({type:'BigDecimal',value:'expensivePrice',text:'尊享票',dictCode:''}) | |||
| fieldList.push({type:'string',value:'longitude',text:'经度',dictCode:''}) | |||
| fieldList.push({type:'string',value:'latitude',text:'纬度',dictCode:''}) | |||
| this.superFieldList = fieldList | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| @import '~@assets/less/common.less'; | |||
| </style> | |||
| @ -0,0 +1,214 @@ | |||
| <template> | |||
| <a-spin :spinning="confirmLoading"> | |||
| <j-form-container :disabled="formDisabled"> | |||
| <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> | |||
| <a-row> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="中文-活动标题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="title"> | |||
| <a-input v-model="model.title" placeholder="请输入中文-活动标题" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="英文-活动标题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enTitle"> | |||
| <a-input v-model="model.enTitle" placeholder="请输入英文-活动标题" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="活动类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type"> | |||
| <j-dict-select-tag type="list" v-model="model.type" dictCode="no_type" placeholder="请选择活动类型" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="活动封面" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="image"> | |||
| <j-image-upload isMultiple v-model="model.image" ></j-image-upload> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="活动时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="startTime"> | |||
| <j-date placeholder="请选择活动时间" v-model="model.startTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="中文-活动地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="address"> | |||
| <a-input v-model="model.address" placeholder="请输入中文-活动地址" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="英文-活动地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enAddress"> | |||
| <a-input v-model="model.enAddress" placeholder="请输入英文-活动地址" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="活动人数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sum"> | |||
| <a-input-number v-model="model.sum" placeholder="请输入活动人数" style="width: 100%" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="报名人数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num"> | |||
| <a-input-number v-model="model.num" placeholder="请输入报名人数" style="width: 100%" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="报名费用" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="price"> | |||
| <a-input-number v-model="model.price" placeholder="请输入报名费用" style="width: 100%" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="主理人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="adminUser"> | |||
| <j-search-select-tag v-model="model.adminUser" dict="han_hai_member,nick_name,id" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="签到人数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="openNum"> | |||
| <a-input-number v-model="model.openNum" placeholder="请输入签到人数" style="width: 100%" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="是否上架" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isOpen"> | |||
| <j-switch v-model="model.isOpen" ></j-switch> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="活动状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="state"> | |||
| <j-dict-select-tag type="list" v-model="model.state" dictCode="no_state" placeholder="请选择活动状态" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="活动详情" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="details"> | |||
| <j-editor v-model="model.details" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="英文-活动详情" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enDetails"> | |||
| <j-editor v-model="model.enDetails" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="中文-注意事项" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="precautions"> | |||
| <a-textarea v-model="model.precautions" rows="4" placeholder="请输入中文-注意事项" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="英文-注意事项" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enPrecautions"> | |||
| <a-textarea v-model="model.enPrecautions" rows="4" placeholder="请输入英文-注意事项" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="早鸟票" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="birdPrice"> | |||
| <a-input-number v-model="model.birdPrice" placeholder="请输入早鸟票" style="width: 100%" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="单人票" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="personPrice"> | |||
| <a-input-number v-model="model.personPrice" placeholder="请输入单人票" style="width: 100%" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="尊享票" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="expensivePrice"> | |||
| <a-input-number v-model="model.expensivePrice" placeholder="请输入尊享票" style="width: 100%" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="经度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="longitude"> | |||
| <a-input v-model="model.longitude" placeholder="请输入经度" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="纬度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="latitude"> | |||
| <a-input v-model="model.latitude" placeholder="请输入纬度" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| </a-row> | |||
| </a-form-model> | |||
| </j-form-container> | |||
| </a-spin> | |||
| </template> | |||
| <script> | |||
| import { httpAction, getAction } from '@/api/manage' | |||
| import { validateDuplicateValue } from '@/utils/util' | |||
| export default { | |||
| name: 'PopularizeActivityForm', | |||
| components: { | |||
| }, | |||
| props: { | |||
| //表单禁用 | |||
| disabled: { | |||
| type: Boolean, | |||
| default: false, | |||
| required: false | |||
| } | |||
| }, | |||
| data () { | |||
| return { | |||
| model:{ | |||
| }, | |||
| labelCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 5 }, | |||
| }, | |||
| wrapperCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 16 }, | |||
| }, | |||
| confirmLoading: false, | |||
| validatorRules: { | |||
| }, | |||
| url: { | |||
| add: "/popularizeActivity/popularizeActivity/add", | |||
| edit: "/popularizeActivity/popularizeActivity/edit", | |||
| queryById: "/popularizeActivity/popularizeActivity/queryById" | |||
| } | |||
| } | |||
| }, | |||
| computed: { | |||
| formDisabled(){ | |||
| return this.disabled | |||
| }, | |||
| }, | |||
| created () { | |||
| //备份model原始值 | |||
| this.modelDefault = JSON.parse(JSON.stringify(this.model)); | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.edit(this.modelDefault); | |||
| }, | |||
| edit (record) { | |||
| this.model = Object.assign({}, record); | |||
| this.visible = true; | |||
| }, | |||
| submitForm () { | |||
| const that = this; | |||
| // 触发表单验证 | |||
| this.$refs.form.validate(valid => { | |||
| if (valid) { | |||
| that.confirmLoading = true; | |||
| let httpurl = ''; | |||
| let method = ''; | |||
| if(!this.model.id){ | |||
| httpurl+=this.url.add; | |||
| method = 'post'; | |||
| }else{ | |||
| httpurl+=this.url.edit; | |||
| method = 'put'; | |||
| } | |||
| httpAction(httpurl,this.model,method).then((res)=>{ | |||
| if(res.success){ | |||
| that.$message.success(res.message); | |||
| that.$emit('ok'); | |||
| }else{ | |||
| that.$message.warning(res.message); | |||
| } | |||
| }).finally(() => { | |||
| that.confirmLoading = false; | |||
| }) | |||
| } | |||
| }) | |||
| }, | |||
| } | |||
| } | |||
| </script> | |||
| @ -0,0 +1,84 @@ | |||
| <template> | |||
| <a-drawer | |||
| :title="title" | |||
| :width="width" | |||
| placement="right" | |||
| :closable="false" | |||
| @close="close" | |||
| destroyOnClose | |||
| :visible="visible"> | |||
| <popularize-activity-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></popularize-activity-form> | |||
| <div class="drawer-footer"> | |||
| <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> | |||
| <a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> | |||
| </div> | |||
| </a-drawer> | |||
| </template> | |||
| <script> | |||
| import PopularizeActivityForm from './PopularizeActivityForm' | |||
| export default { | |||
| name: 'PopularizeActivityModal', | |||
| components: { | |||
| PopularizeActivityForm | |||
| }, | |||
| data () { | |||
| return { | |||
| title:"操作", | |||
| width:800, | |||
| visible: false, | |||
| disableSubmit: false | |||
| } | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.add(); | |||
| }) | |||
| }, | |||
| edit (record) { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.edit(record); | |||
| }); | |||
| }, | |||
| close () { | |||
| this.$emit('close'); | |||
| this.visible = false; | |||
| }, | |||
| submitCallback(){ | |||
| this.$emit('ok'); | |||
| this.visible = false; | |||
| }, | |||
| handleOk () { | |||
| this.$refs.realForm.submitForm(); | |||
| }, | |||
| handleCancel () { | |||
| this.close() | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| <style lang="less" scoped> | |||
| /** Button按钮间距 */ | |||
| .ant-btn { | |||
| margin-left: 30px; | |||
| margin-bottom: 30px; | |||
| float: right; | |||
| } | |||
| .drawer-footer{ | |||
| position: absolute; | |||
| bottom: -8px; | |||
| width: 100%; | |||
| border-top: 1px solid #e8e8e8; | |||
| padding: 10px 16px; | |||
| text-align: right; | |||
| left: 0; | |||
| background: #fff; | |||
| border-radius: 0 0 2px 2px; | |||
| } | |||
| </style> | |||
| @ -0,0 +1,60 @@ | |||
| <template> | |||
| <j-modal | |||
| :title="title" | |||
| :width="width" | |||
| :visible="visible" | |||
| switchFullscreen | |||
| @ok="handleOk" | |||
| :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" | |||
| @cancel="handleCancel" | |||
| cancelText="关闭"> | |||
| <popularize-activity-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></popularize-activity-form> | |||
| </j-modal> | |||
| </template> | |||
| <script> | |||
| import PopularizeActivityForm from './PopularizeActivityForm' | |||
| export default { | |||
| name: 'PopularizeActivityModal', | |||
| components: { | |||
| PopularizeActivityForm | |||
| }, | |||
| data () { | |||
| return { | |||
| title:'', | |||
| width:800, | |||
| visible: false, | |||
| disableSubmit: false | |||
| } | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.add(); | |||
| }) | |||
| }, | |||
| edit (record) { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.edit(record); | |||
| }) | |||
| }, | |||
| close () { | |||
| this.$emit('close'); | |||
| this.visible = false; | |||
| }, | |||
| handleOk () { | |||
| this.$refs.realForm.submitForm(); | |||
| }, | |||
| submitCallback(){ | |||
| this.$emit('ok'); | |||
| this.visible = false; | |||
| }, | |||
| handleCancel () { | |||
| this.close() | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| @ -0,0 +1,61 @@ | |||
| import {defHttp} from '/@/utils/http/axios'; | |||
| import {Modal} from 'ant-design-vue'; | |||
| enum Api { | |||
| list = '/popularizeActivity/popularizeActivity/list', | |||
| save='/popularizeActivity/popularizeActivity/add', | |||
| edit='/popularizeActivity/popularizeActivity/edit', | |||
| deleteOne = '/popularizeActivity/popularizeActivity/delete', | |||
| deleteBatch = '/popularizeActivity/popularizeActivity/deleteBatch', | |||
| importExcel = '/popularizeActivity/popularizeActivity/importExcel', | |||
| exportXls = '/popularizeActivity/popularizeActivity/exportXls', | |||
| } | |||
| /** | |||
| * 导出api | |||
| * @param params | |||
| */ | |||
| export const getExportUrl = Api.exportXls; | |||
| /** | |||
| * 导入api | |||
| */ | |||
| export const getImportUrl = Api.importExcel; | |||
| /** | |||
| * 列表接口 | |||
| * @param params | |||
| */ | |||
| export const list = (params) => | |||
| defHttp.get({url: Api.list, params}); | |||
| /** | |||
| * 删除单个 | |||
| */ | |||
| export const deleteOne = (params,handleSuccess) => { | |||
| return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { | |||
| handleSuccess(); | |||
| }); | |||
| } | |||
| /** | |||
| * 批量删除 | |||
| * @param params | |||
| */ | |||
| export const batchDelete = (params, handleSuccess) => { | |||
| Modal.confirm({ | |||
| title: '确认删除', | |||
| content: '是否删除选中数据', | |||
| okText: '确认', | |||
| cancelText: '取消', | |||
| onOk: () => { | |||
| return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { | |||
| handleSuccess(); | |||
| }); | |||
| } | |||
| }); | |||
| } | |||
| /** | |||
| * 保存或者更新 | |||
| * @param params | |||
| */ | |||
| export const saveOrUpdate = (params, isUpdate) => { | |||
| let url = isUpdate ? Api.edit : Api.save; | |||
| return defHttp.post({url: url, params}); | |||
| } | |||
| @ -0,0 +1,319 @@ | |||
| import {BasicColumn} from '/@/components/Table'; | |||
| import {FormSchema} from '/@/components/Table'; | |||
| import { rules} from '/@/utils/helper/validator'; | |||
| import { render } from '/@/utils/common/renderUtils'; | |||
| //列表数据 | |||
| export const columns: BasicColumn[] = [ | |||
| { | |||
| title: '创建人', | |||
| align:"center", | |||
| dataIndex: 'createBy' | |||
| }, | |||
| { | |||
| title: '创建日期', | |||
| align:"center", | |||
| sorter: true, | |||
| dataIndex: 'createTime' | |||
| }, | |||
| { | |||
| title: '中文-活动标题', | |||
| align:"center", | |||
| dataIndex: 'title' | |||
| }, | |||
| { | |||
| title: '英文-活动标题', | |||
| align:"center", | |||
| dataIndex: 'enTitle' | |||
| }, | |||
| { | |||
| title: '活动类型', | |||
| align:"center", | |||
| dataIndex: 'type_dictText' | |||
| }, | |||
| { | |||
| title: '活动封面', | |||
| align:"center", | |||
| dataIndex: 'image', | |||
| customRender:render.renderAvatar, | |||
| }, | |||
| { | |||
| title: '活动时间', | |||
| align:"center", | |||
| dataIndex: 'startTime' | |||
| }, | |||
| { | |||
| title: '中文-活动地址', | |||
| align:"center", | |||
| dataIndex: 'address' | |||
| }, | |||
| { | |||
| title: '英文-活动地址', | |||
| align:"center", | |||
| dataIndex: 'enAddress' | |||
| }, | |||
| { | |||
| title: '活动人数', | |||
| align:"center", | |||
| dataIndex: 'sum' | |||
| }, | |||
| { | |||
| title: '报名人数', | |||
| align:"center", | |||
| dataIndex: 'num' | |||
| }, | |||
| { | |||
| title: '报名费用', | |||
| align:"center", | |||
| dataIndex: 'price' | |||
| }, | |||
| { | |||
| title: '主理人', | |||
| align:"center", | |||
| dataIndex: 'adminUser_dictText' | |||
| }, | |||
| { | |||
| title: '签到人数', | |||
| align:"center", | |||
| dataIndex: 'openNum' | |||
| }, | |||
| { | |||
| title: '是否上架', | |||
| align:"center", | |||
| dataIndex: 'isOpen', | |||
| customRender:({text}) => { | |||
| return render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}]) | |||
| }, | |||
| }, | |||
| { | |||
| title: '活动状态', | |||
| align:"center", | |||
| dataIndex: 'state_dictText' | |||
| }, | |||
| { | |||
| title: '早鸟票', | |||
| align:"center", | |||
| dataIndex: 'birdPrice' | |||
| }, | |||
| { | |||
| title: '单人票', | |||
| align:"center", | |||
| dataIndex: 'personPrice' | |||
| }, | |||
| { | |||
| title: '尊享票', | |||
| align:"center", | |||
| dataIndex: 'expensivePrice' | |||
| }, | |||
| { | |||
| title: '经度', | |||
| align:"center", | |||
| dataIndex: 'longitude' | |||
| }, | |||
| { | |||
| title: '纬度', | |||
| align:"center", | |||
| dataIndex: 'latitude' | |||
| }, | |||
| ]; | |||
| //查询数据 | |||
| export const searchFormSchema: FormSchema[] = [ | |||
| { | |||
| label: "中文-活动标题", | |||
| field: "title", | |||
| component: 'Input', | |||
| colProps: {span: 6}, | |||
| }, | |||
| { | |||
| label: "英文-活动标题", | |||
| field: "enTitle", | |||
| component: 'Input', | |||
| colProps: {span: 6}, | |||
| }, | |||
| { | |||
| label: "活动类型", | |||
| field: "type", | |||
| component: 'JDictSelectTag', | |||
| componentProps:{ | |||
| dictCode:"no_type" | |||
| }, | |||
| colProps: {span: 6}, | |||
| }, | |||
| { | |||
| label: "活动时间", | |||
| field: "startTime", | |||
| component: 'DatePicker', | |||
| componentProps: { | |||
| showTime:true | |||
| }, | |||
| colProps: {span: 6}, | |||
| }, | |||
| { | |||
| label: "中文-活动地址", | |||
| field: "address", | |||
| component: 'Input', | |||
| colProps: {span: 6}, | |||
| }, | |||
| { | |||
| label: "英文-活动地址", | |||
| field: "enAddress", | |||
| component: 'Input', | |||
| colProps: {span: 6}, | |||
| }, | |||
| { | |||
| label: "主理人", | |||
| field: "adminUser", | |||
| component: 'JSearchSelect', | |||
| componentProps:{ | |||
| dict:"han_hai_member,nick_name,id" | |||
| }, | |||
| colProps: {span: 6}, | |||
| }, | |||
| { | |||
| label: "是否上架", | |||
| field: "isOpen", | |||
| component: 'JSwitch', | |||
| componentProps:{ | |||
| }, | |||
| colProps: {span: 6}, | |||
| }, | |||
| { | |||
| label: "活动状态", | |||
| field: "state", | |||
| component: 'JDictSelectTag', | |||
| componentProps:{ | |||
| dictCode:"no_state" | |||
| }, | |||
| colProps: {span: 6}, | |||
| }, | |||
| ]; | |||
| //表单数据 | |||
| export const formSchema: FormSchema[] = [ | |||
| { | |||
| label: '中文-活动标题', | |||
| field: 'title', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '英文-活动标题', | |||
| field: 'enTitle', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '活动类型', | |||
| field: 'type', | |||
| component: 'JDictSelectTag', | |||
| componentProps:{ | |||
| dictCode:"no_type" | |||
| }, | |||
| }, | |||
| { | |||
| label: '活动封面', | |||
| field: 'image', | |||
| component: 'JImageUpload', | |||
| componentProps:{ | |||
| }, | |||
| }, | |||
| { | |||
| label: '活动时间', | |||
| field: 'startTime', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '中文-活动地址', | |||
| field: 'address', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '英文-活动地址', | |||
| field: 'enAddress', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '活动人数', | |||
| field: 'sum', | |||
| component: 'InputNumber', | |||
| }, | |||
| { | |||
| label: '报名人数', | |||
| field: 'num', | |||
| component: 'InputNumber', | |||
| }, | |||
| { | |||
| label: '报名费用', | |||
| field: 'price', | |||
| component: 'InputNumber', | |||
| }, | |||
| { | |||
| label: '主理人', | |||
| field: 'adminUser', | |||
| component: 'JSearchSelect', | |||
| componentProps:{ | |||
| dict:"han_hai_member,nick_name,id" | |||
| }, | |||
| }, | |||
| { | |||
| label: '签到人数', | |||
| field: 'openNum', | |||
| component: 'InputNumber', | |||
| }, | |||
| { | |||
| label: '是否上架', | |||
| field: 'isOpen', | |||
| component: 'JSwitch', | |||
| componentProps:{ | |||
| }, | |||
| }, | |||
| { | |||
| label: '活动状态', | |||
| field: 'state', | |||
| component: 'JDictSelectTag', | |||
| componentProps:{ | |||
| dictCode:"no_state" | |||
| }, | |||
| }, | |||
| { | |||
| label: '活动详情', | |||
| field: 'details', | |||
| component: 'JCodeEditor', //TODO String后缀暂未添加 | |||
| }, | |||
| { | |||
| label: '英文-活动详情', | |||
| field: 'enDetails', | |||
| component: 'JCodeEditor', //TODO String后缀暂未添加 | |||
| }, | |||
| { | |||
| label: '中文-注意事项', | |||
| field: 'precautions', | |||
| component: 'InputTextArea',//TODO 注意string转换问题 | |||
| }, | |||
| { | |||
| label: '英文-注意事项', | |||
| field: 'enPrecautions', | |||
| component: 'InputTextArea',//TODO 注意string转换问题 | |||
| }, | |||
| { | |||
| label: '早鸟票', | |||
| field: 'birdPrice', | |||
| component: 'InputNumber', | |||
| }, | |||
| { | |||
| label: '单人票', | |||
| field: 'personPrice', | |||
| component: 'InputNumber', | |||
| }, | |||
| { | |||
| label: '尊享票', | |||
| field: 'expensivePrice', | |||
| component: 'InputNumber', | |||
| }, | |||
| { | |||
| label: '经度', | |||
| field: 'longitude', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '纬度', | |||
| field: 'latitude', | |||
| component: 'Input', | |||
| }, | |||
| ]; | |||
| @ -0,0 +1,162 @@ | |||
| <template> | |||
| <div> | |||
| <!--引用表格--> | |||
| <BasicTable @register="registerTable" :rowSelection="rowSelection"> | |||
| <!--插槽:table标题--> | |||
| <template #tableTitle> | |||
| <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button> | |||
| <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button> | |||
| <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button> | |||
| <a-dropdown v-if="checkedKeys.length > 0"> | |||
| <template #overlay> | |||
| <a-menu> | |||
| <a-menu-item key="1" @click="batchHandleDelete"> | |||
| <Icon icon="ant-design:delete-outlined"></Icon> | |||
| 删除 | |||
| </a-menu-item> | |||
| </a-menu> | |||
| </template> | |||
| <a-button>批量操作 | |||
| <Icon icon="mdi:chevron-down"></Icon> | |||
| </a-button> | |||
| </a-dropdown> | |||
| </template> | |||
| <!--操作栏--> | |||
| <template #action="{ record }"> | |||
| <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/> | |||
| </template> | |||
| <!--字段回显插槽--> | |||
| <template #htmlSlot="{text}"> | |||
| <div v-html="text"></div> | |||
| </template> | |||
| <template #fileSlot="{text}"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |||
| <a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button> | |||
| </template> | |||
| </BasicTable> | |||
| <!-- 表单区域 --> | |||
| <PopularizeActivityModal @register="registerModal" @success="handleSuccess"></PopularizeActivityModal> | |||
| </div> | |||
| </template> | |||
| <script lang="ts" name="popularizeActivity-popularizeActivity" setup> | |||
| import {ref, computed, unref} from 'vue'; | |||
| import {BasicTable, useTable, TableAction} from '/@/components/Table'; | |||
| import {useModal} from '/@/components/Modal'; | |||
| import { useListPage } from '/@/hooks/system/useListPage' | |||
| import PopularizeActivityModal from './components/PopularizeActivityModal.vue' | |||
| import {columns, searchFormSchema} from './popularizeActivity.data'; | |||
| import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './popularizeActivity.api'; | |||
| const checkedKeys = ref<Array<string | number>>([]); | |||
| //注册model | |||
| const [registerModal, {openModal}] = useModal(); | |||
| //注册table数据 | |||
| const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({ | |||
| tableProps:{ | |||
| title: '活动信息表', | |||
| api: list, | |||
| columns, | |||
| canResize:false, | |||
| formConfig: { | |||
| labelWidth: 120, | |||
| schemas: searchFormSchema, | |||
| autoSubmitOnEnter:true, | |||
| showAdvancedButton:true, | |||
| fieldMapToTime: [ | |||
| ], | |||
| }, | |||
| actionColumn: { | |||
| width: 120, | |||
| }, | |||
| }, | |||
| exportConfig: { | |||
| name:"活动信息表", | |||
| url: getExportUrl, | |||
| }, | |||
| importConfig: { | |||
| url: getImportUrl | |||
| }, | |||
| }) | |||
| const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext | |||
| /** | |||
| * 新增事件 | |||
| */ | |||
| function handleAdd() { | |||
| openModal(true, { | |||
| isUpdate: false, | |||
| showFooter: true, | |||
| }); | |||
| } | |||
| /** | |||
| * 编辑事件 | |||
| */ | |||
| function handleEdit(record: Recordable) { | |||
| openModal(true, { | |||
| record, | |||
| isUpdate: true, | |||
| showFooter: true, | |||
| }); | |||
| } | |||
| /** | |||
| * 详情 | |||
| */ | |||
| function handleDetail(record: Recordable) { | |||
| openModal(true, { | |||
| record, | |||
| isUpdate: true, | |||
| showFooter: false, | |||
| }); | |||
| } | |||
| /** | |||
| * 删除事件 | |||
| */ | |||
| async function handleDelete(record) { | |||
| await deleteOne({id: record.id}, reload); | |||
| } | |||
| /** | |||
| * 批量删除事件 | |||
| */ | |||
| async function batchHandleDelete() { | |||
| await batchDelete({ids: checkedKeys.value}, reload); | |||
| } | |||
| /** | |||
| * 成功回调 | |||
| */ | |||
| function handleSuccess() { | |||
| reload(); | |||
| } | |||
| /** | |||
| * 操作栏 | |||
| */ | |||
| function getTableAction(record){ | |||
| return [ | |||
| { | |||
| label: '编辑', | |||
| onClick: handleEdit.bind(null, record), | |||
| } | |||
| ] | |||
| } | |||
| /** | |||
| * 下拉操作栏 | |||
| */ | |||
| function getDropDownAction(record){ | |||
| return [ | |||
| { | |||
| label: '详情', | |||
| onClick: handleDetail.bind(null, record), | |||
| }, { | |||
| label: '删除', | |||
| popConfirm: { | |||
| title: '是否确认删除', | |||
| confirm: handleDelete.bind(null, record), | |||
| } | |||
| } | |||
| ] | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| </style> | |||
| @ -0,0 +1,58 @@ | |||
| <template> | |||
| <BasicModal v-bind="$attrs" @register="registerModal" :title="title" @ok="handleSubmit"> | |||
| <BasicForm @register="registerForm"/> | |||
| </BasicModal> | |||
| </template> | |||
| <script lang="ts" setup> | |||
| import {ref, computed, unref} from 'vue'; | |||
| import {BasicModal, useModalInner} from '/@/components/Modal'; | |||
| import {BasicForm, useForm} from '/@/components/Form/index'; | |||
| import {formSchema} from '../popularizeActivity.data'; | |||
| import {saveOrUpdate} from '../popularizeActivity.api'; | |||
| // Emits声明 | |||
| const emit = defineEmits(['register','success']); | |||
| const isUpdate = ref(true); | |||
| //表单配置 | |||
| const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({ | |||
| labelWidth: 150, | |||
| schemas: formSchema, | |||
| showActionButtonGroup: false, | |||
| }); | |||
| //表单赋值 | |||
| const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => { | |||
| //重置表单 | |||
| await resetFields(); | |||
| setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter}); | |||
| isUpdate.value = !!data?.isUpdate; | |||
| if (unref(isUpdate)) { | |||
| //表单赋值 | |||
| await setFieldsValue({ | |||
| ...data.record, | |||
| }); | |||
| } | |||
| // 隐藏底部时禁用整个表单 | |||
| setProps({ disabled: !data?.showFooter }) | |||
| }); | |||
| //设置标题 | |||
| const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑')); | |||
| //表单提交事件 | |||
| async function handleSubmit(v) { | |||
| try { | |||
| let values = await validate(); | |||
| setModalProps({confirmLoading: true}); | |||
| //提交表单 | |||
| await saveOrUpdate(values, isUpdate.value); | |||
| //关闭弹窗 | |||
| closeModal(); | |||
| //刷新列表 | |||
| emit('success'); | |||
| } finally { | |||
| setModalProps({confirmLoading: false}); | |||
| } | |||
| } | |||
| </script> | |||
| <style lang="less" scoped> | |||
| </style> | |||
| @ -0,0 +1,171 @@ | |||
| package org.jeecg.modules.popularizeAuthentication.controller; | |||
| import java.util.Arrays; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import java.util.stream.Collectors; | |||
| import java.io.IOException; | |||
| import java.io.UnsupportedEncodingException; | |||
| import java.net.URLDecoder; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import org.jeecg.common.api.vo.Result; | |||
| import org.jeecg.common.system.query.QueryGenerator; | |||
| import org.jeecg.common.util.oConvertUtils; | |||
| import org.jeecg.modules.popularizeAuthentication.entity.PopularizeAuthentication; | |||
| import org.jeecg.modules.popularizeAuthentication.service.IPopularizeAuthenticationService; | |||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
| import com.baomidou.mybatisplus.core.metadata.IPage; | |||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.jeecgframework.poi.excel.ExcelImportUtil; | |||
| import org.jeecgframework.poi.excel.def.NormalExcelConstants; | |||
| import org.jeecgframework.poi.excel.entity.ExportParams; | |||
| import org.jeecgframework.poi.excel.entity.ImportParams; | |||
| import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | |||
| import org.jeecg.common.system.base.controller.JeecgController; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import org.springframework.web.multipart.MultipartFile; | |||
| import org.springframework.web.multipart.MultipartHttpServletRequest; | |||
| import org.springframework.web.servlet.ModelAndView; | |||
| import com.alibaba.fastjson.JSON; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.jeecg.common.aspect.annotation.AutoLog; | |||
| /** | |||
| * @Description: 主理人认证 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Api(tags="主理人认证") | |||
| @RestController | |||
| @RequestMapping("/popularizeAuthentication/popularizeAuthentication") | |||
| @Slf4j | |||
| public class PopularizeAuthenticationController extends JeecgController<PopularizeAuthentication, IPopularizeAuthenticationService> { | |||
| @Autowired | |||
| private IPopularizeAuthenticationService popularizeAuthenticationService; | |||
| /** | |||
| * 分页列表查询 | |||
| * | |||
| * @param popularizeAuthentication | |||
| * @param pageNo | |||
| * @param pageSize | |||
| * @param req | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "主理人认证-分页列表查询") | |||
| @ApiOperation(value="主理人认证-分页列表查询", notes="主理人认证-分页列表查询") | |||
| @GetMapping(value = "/list") | |||
| public Result<IPage<PopularizeAuthentication>> queryPageList(PopularizeAuthentication popularizeAuthentication, | |||
| @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | |||
| @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | |||
| HttpServletRequest req) { | |||
| QueryWrapper<PopularizeAuthentication> queryWrapper = QueryGenerator.initQueryWrapper(popularizeAuthentication, req.getParameterMap()); | |||
| Page<PopularizeAuthentication> page = new Page<PopularizeAuthentication>(pageNo, pageSize); | |||
| IPage<PopularizeAuthentication> pageList = popularizeAuthenticationService.page(page, queryWrapper); | |||
| return Result.OK(pageList); | |||
| } | |||
| /** | |||
| * 添加 | |||
| * | |||
| * @param popularizeAuthentication | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "主理人认证-添加") | |||
| @ApiOperation(value="主理人认证-添加", notes="主理人认证-添加") | |||
| @PostMapping(value = "/add") | |||
| public Result<String> add(@RequestBody PopularizeAuthentication popularizeAuthentication) { | |||
| popularizeAuthenticationService.save(popularizeAuthentication); | |||
| return Result.OK("添加成功!"); | |||
| } | |||
| /** | |||
| * 编辑 | |||
| * | |||
| * @param popularizeAuthentication | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "主理人认证-编辑") | |||
| @ApiOperation(value="主理人认证-编辑", notes="主理人认证-编辑") | |||
| @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) | |||
| public Result<String> edit(@RequestBody PopularizeAuthentication popularizeAuthentication) { | |||
| popularizeAuthenticationService.updateById(popularizeAuthentication); | |||
| return Result.OK("编辑成功!"); | |||
| } | |||
| /** | |||
| * 通过id删除 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "主理人认证-通过id删除") | |||
| @ApiOperation(value="主理人认证-通过id删除", notes="主理人认证-通过id删除") | |||
| @DeleteMapping(value = "/delete") | |||
| public Result<String> delete(@RequestParam(name="id",required=true) String id) { | |||
| popularizeAuthenticationService.removeById(id); | |||
| return Result.OK("删除成功!"); | |||
| } | |||
| /** | |||
| * 批量删除 | |||
| * | |||
| * @param ids | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "主理人认证-批量删除") | |||
| @ApiOperation(value="主理人认证-批量删除", notes="主理人认证-批量删除") | |||
| @DeleteMapping(value = "/deleteBatch") | |||
| public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | |||
| this.popularizeAuthenticationService.removeByIds(Arrays.asList(ids.split(","))); | |||
| return Result.OK("批量删除成功!"); | |||
| } | |||
| /** | |||
| * 通过id查询 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "主理人认证-通过id查询") | |||
| @ApiOperation(value="主理人认证-通过id查询", notes="主理人认证-通过id查询") | |||
| @GetMapping(value = "/queryById") | |||
| public Result<PopularizeAuthentication> queryById(@RequestParam(name="id",required=true) String id) { | |||
| PopularizeAuthentication popularizeAuthentication = popularizeAuthenticationService.getById(id); | |||
| if(popularizeAuthentication==null) { | |||
| return Result.error("未找到对应数据"); | |||
| } | |||
| return Result.OK(popularizeAuthentication); | |||
| } | |||
| /** | |||
| * 导出excel | |||
| * | |||
| * @param request | |||
| * @param popularizeAuthentication | |||
| */ | |||
| @RequestMapping(value = "/exportXls") | |||
| public ModelAndView exportXls(HttpServletRequest request, PopularizeAuthentication popularizeAuthentication) { | |||
| return super.exportXls(request, popularizeAuthentication, PopularizeAuthentication.class, "主理人认证"); | |||
| } | |||
| /** | |||
| * 通过excel导入数据 | |||
| * | |||
| * @param request | |||
| * @param response | |||
| * @return | |||
| */ | |||
| @RequestMapping(value = "/importExcel", method = RequestMethod.POST) | |||
| public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | |||
| return super.importExcel(request, response, PopularizeAuthentication.class); | |||
| } | |||
| } | |||
| @ -0,0 +1,79 @@ | |||
| package org.jeecg.modules.popularizeAuthentication.entity; | |||
| import java.io.Serializable; | |||
| import java.io.UnsupportedEncodingException; | |||
| import java.util.Date; | |||
| import java.math.BigDecimal; | |||
| import com.baomidou.mybatisplus.annotation.IdType; | |||
| import com.baomidou.mybatisplus.annotation.TableId; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import lombok.Data; | |||
| import com.fasterxml.jackson.annotation.JsonFormat; | |||
| import org.springframework.format.annotation.DateTimeFormat; | |||
| import org.jeecgframework.poi.excel.annotation.Excel; | |||
| import org.jeecg.common.aspect.annotation.Dict; | |||
| import io.swagger.annotations.ApiModel; | |||
| import io.swagger.annotations.ApiModelProperty; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.experimental.Accessors; | |||
| /** | |||
| * @Description: 主理人认证 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Data | |||
| @TableName("popularize_authentication") | |||
| @Accessors(chain = true) | |||
| @EqualsAndHashCode(callSuper = false) | |||
| @ApiModel(value="popularize_authentication对象", description="主理人认证") | |||
| public class PopularizeAuthentication implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| /**主键*/ | |||
| @TableId(type = IdType.ASSIGN_ID) | |||
| @ApiModelProperty(value = "主键") | |||
| private java.lang.String id; | |||
| /**创建人*/ | |||
| @ApiModelProperty(value = "创建人") | |||
| private java.lang.String createBy; | |||
| /**创建日期*/ | |||
| @ApiModelProperty(value = "创建日期") | |||
| private java.util.Date createTime; | |||
| /**更新人*/ | |||
| @ApiModelProperty(value = "更新人") | |||
| private java.lang.String updateBy; | |||
| /**更新日期*/ | |||
| @ApiModelProperty(value = "更新日期") | |||
| private java.util.Date updateTime; | |||
| /**姓名*/ | |||
| @Excel(name = "姓名", width = 15) | |||
| @ApiModelProperty(value = "姓名") | |||
| private java.lang.String name; | |||
| /**电话*/ | |||
| @Excel(name = "电话", width = 15) | |||
| @ApiModelProperty(value = "电话") | |||
| private java.lang.String phone; | |||
| /**身份证*/ | |||
| @Excel(name = "身份证", width = 15) | |||
| @ApiModelProperty(value = "身份证") | |||
| private java.lang.String cardNo; | |||
| /**简历附件*/ | |||
| @Excel(name = "简历附件", width = 15) | |||
| @ApiModelProperty(value = "简历附件") | |||
| private java.lang.String image; | |||
| /**状态*/ | |||
| @Excel(name = "状态", width = 15) | |||
| @ApiModelProperty(value = "状态") | |||
| private java.lang.Integer state; | |||
| /**用户*/ | |||
| @Excel(name = "用户", width = 15, dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") | |||
| @Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") | |||
| @ApiModelProperty(value = "用户") | |||
| private java.lang.String userId; | |||
| /**微信二维码*/ | |||
| @Excel(name = "微信二维码", width = 15) | |||
| @ApiModelProperty(value = "微信二维码") | |||
| private java.lang.String img; | |||
| } | |||
| @ -0,0 +1,17 @@ | |||
| package org.jeecg.modules.popularizeAuthentication.mapper; | |||
| import java.util.List; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import org.jeecg.modules.popularizeAuthentication.entity.PopularizeAuthentication; | |||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
| /** | |||
| * @Description: 主理人认证 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface PopularizeAuthenticationMapper extends BaseMapper<PopularizeAuthentication> { | |||
| } | |||
| @ -0,0 +1,5 @@ | |||
| <?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="org.jeecg.modules.popularizeAuthentication.mapper.PopularizeAuthenticationMapper"> | |||
| </mapper> | |||
| @ -0,0 +1,14 @@ | |||
| package org.jeecg.modules.popularizeAuthentication.service; | |||
| import org.jeecg.modules.popularizeAuthentication.entity.PopularizeAuthentication; | |||
| import com.baomidou.mybatisplus.extension.service.IService; | |||
| /** | |||
| * @Description: 主理人认证 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface IPopularizeAuthenticationService extends IService<PopularizeAuthentication> { | |||
| } | |||
| @ -0,0 +1,19 @@ | |||
| package org.jeecg.modules.popularizeAuthentication.service.impl; | |||
| import org.jeecg.modules.popularizeAuthentication.entity.PopularizeAuthentication; | |||
| import org.jeecg.modules.popularizeAuthentication.mapper.PopularizeAuthenticationMapper; | |||
| import org.jeecg.modules.popularizeAuthentication.service.IPopularizeAuthenticationService; | |||
| import org.springframework.stereotype.Service; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| /** | |||
| * @Description: 主理人认证 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Service | |||
| public class PopularizeAuthenticationServiceImpl extends ServiceImpl<PopularizeAuthenticationMapper, PopularizeAuthentication> implements IPopularizeAuthenticationService { | |||
| } | |||
| @ -0,0 +1,216 @@ | |||
| <template> | |||
| <a-card :bordered="false"> | |||
| <!-- 查询区域 --> | |||
| <div class="table-page-search-wrapper"> | |||
| <a-form layout="inline" @keyup.enter.native="searchQuery"> | |||
| <a-row :gutter="24"> | |||
| </a-row> | |||
| </a-form> | |||
| </div> | |||
| <!-- 查询区域-END --> | |||
| <!-- 操作按钮区域 --> | |||
| <div class="table-operator"> | |||
| <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> | |||
| <a-button type="primary" icon="download" @click="handleExportXls('主理人认证')">导出</a-button> | |||
| <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | |||
| <a-button type="primary" icon="import">导入</a-button> | |||
| </a-upload> | |||
| <!-- 高级查询区域 --> | |||
| <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> | |||
| <a-dropdown v-if="selectedRowKeys.length > 0"> | |||
| <a-menu slot="overlay"> | |||
| <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> | |||
| </a-menu> | |||
| <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> | |||
| </a-dropdown> | |||
| </div> | |||
| <!-- table区域-begin --> | |||
| <div> | |||
| <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |||
| <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 | |||
| <a style="margin-left: 24px" @click="onClearSelected">清空</a> | |||
| </div> | |||
| <a-table | |||
| ref="table" | |||
| size="middle" | |||
| :scroll="{x:true}" | |||
| bordered | |||
| rowKey="id" | |||
| :columns="columns" | |||
| :dataSource="dataSource" | |||
| :pagination="ipagination" | |||
| :loading="loading" | |||
| :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" | |||
| class="j-table-force-nowrap" | |||
| @change="handleTableChange"> | |||
| <template slot="htmlSlot" slot-scope="text"> | |||
| <div v-html="text"></div> | |||
| </template> | |||
| <template slot="imgSlot" slot-scope="text,record"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | |||
| <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> | |||
| </template> | |||
| <template slot="fileSlot" slot-scope="text"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |||
| <a-button | |||
| v-else | |||
| :ghost="true" | |||
| type="primary" | |||
| icon="download" | |||
| size="small" | |||
| @click="downloadFile(text)"> | |||
| 下载 | |||
| </a-button> | |||
| </template> | |||
| <span slot="action" slot-scope="text, record"> | |||
| <a @click="handleEdit(record)">编辑</a> | |||
| <a-divider type="vertical" /> | |||
| <a-dropdown> | |||
| <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> | |||
| <a-menu slot="overlay"> | |||
| <a-menu-item> | |||
| <a @click="handleDetail(record)">详情</a> | |||
| </a-menu-item> | |||
| <a-menu-item> | |||
| <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | |||
| <a>删除</a> | |||
| </a-popconfirm> | |||
| </a-menu-item> | |||
| </a-menu> | |||
| </a-dropdown> | |||
| </span> | |||
| </a-table> | |||
| </div> | |||
| <popularize-authentication-modal ref="modalForm" @ok="modalFormOk"></popularize-authentication-modal> | |||
| </a-card> | |||
| </template> | |||
| <script> | |||
| import '@/assets/less/TableExpand.less' | |||
| import { mixinDevice } from '@/utils/mixin' | |||
| import { JeecgListMixin } from '@/mixins/JeecgListMixin' | |||
| import PopularizeAuthenticationModal from './modules/PopularizeAuthenticationModal' | |||
| import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' | |||
| export default { | |||
| name: 'PopularizeAuthenticationList', | |||
| mixins:[JeecgListMixin, mixinDevice], | |||
| components: { | |||
| PopularizeAuthenticationModal | |||
| }, | |||
| data () { | |||
| return { | |||
| description: '主理人认证管理页面', | |||
| // 表头 | |||
| columns: [ | |||
| { | |||
| title: '#', | |||
| dataIndex: '', | |||
| key:'rowIndex', | |||
| width:60, | |||
| align:"center", | |||
| customRender:function (t,r,index) { | |||
| return parseInt(index)+1; | |||
| } | |||
| }, | |||
| { | |||
| title:'创建日期', | |||
| align:"center", | |||
| sorter: true, | |||
| dataIndex: 'createTime' | |||
| }, | |||
| { | |||
| title:'姓名', | |||
| align:"center", | |||
| dataIndex: 'name' | |||
| }, | |||
| { | |||
| title:'电话', | |||
| align:"center", | |||
| dataIndex: 'phone' | |||
| }, | |||
| { | |||
| title:'身份证', | |||
| align:"center", | |||
| dataIndex: 'cardNo' | |||
| }, | |||
| { | |||
| title:'简历附件', | |||
| align:"center", | |||
| dataIndex: 'image', | |||
| scopedSlots: {customRender: 'fileSlot'} | |||
| }, | |||
| { | |||
| title:'状态', | |||
| align:"center", | |||
| dataIndex: 'state' | |||
| }, | |||
| { | |||
| title:'用户', | |||
| align:"center", | |||
| dataIndex: 'userId_dictText' | |||
| }, | |||
| { | |||
| title:'微信二维码', | |||
| align:"center", | |||
| dataIndex: 'img' | |||
| }, | |||
| { | |||
| title: '操作', | |||
| dataIndex: 'action', | |||
| align:"center", | |||
| fixed:"right", | |||
| width:147, | |||
| scopedSlots: { customRender: 'action' } | |||
| } | |||
| ], | |||
| url: { | |||
| list: "/popularizeAuthentication/popularizeAuthentication/list", | |||
| delete: "/popularizeAuthentication/popularizeAuthentication/delete", | |||
| deleteBatch: "/popularizeAuthentication/popularizeAuthentication/deleteBatch", | |||
| exportXlsUrl: "/popularizeAuthentication/popularizeAuthentication/exportXls", | |||
| importExcelUrl: "popularizeAuthentication/popularizeAuthentication/importExcel", | |||
| }, | |||
| dictOptions:{}, | |||
| superFieldList:[], | |||
| } | |||
| }, | |||
| created() { | |||
| this.getSuperFieldList(); | |||
| }, | |||
| computed: { | |||
| importExcelUrl: function(){ | |||
| return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | |||
| }, | |||
| }, | |||
| methods: { | |||
| initDictConfig(){ | |||
| }, | |||
| getSuperFieldList(){ | |||
| let fieldList=[]; | |||
| fieldList.push({type:'datetime',value:'createTime',text:'创建日期'}) | |||
| fieldList.push({type:'string',value:'name',text:'姓名',dictCode:''}) | |||
| fieldList.push({type:'string',value:'phone',text:'电话',dictCode:''}) | |||
| fieldList.push({type:'string',value:'cardNo',text:'身份证',dictCode:''}) | |||
| fieldList.push({type:'string',value:'image',text:'简历附件',dictCode:''}) | |||
| fieldList.push({type:'int',value:'state',text:'状态',dictCode:'no_state_type'}) | |||
| fieldList.push({type:'sel_search',value:'userId',text:'用户',dictTable:"han_hai_member", dictText:'nick_name', dictCode:'id'}) | |||
| fieldList.push({type:'Text',value:'img',text:'微信二维码',dictCode:''}) | |||
| this.superFieldList = fieldList | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| @import '~@assets/less/common.less'; | |||
| </style> | |||
| @ -0,0 +1,134 @@ | |||
| <template> | |||
| <a-spin :spinning="confirmLoading"> | |||
| <j-form-container :disabled="formDisabled"> | |||
| <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> | |||
| <a-row> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name"> | |||
| <a-input v-model="model.name" placeholder="请输入姓名" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="phone"> | |||
| <a-input v-model="model.phone" placeholder="请输入电话" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="身份证" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cardNo"> | |||
| <a-input v-model="model.cardNo" placeholder="请输入身份证" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="简历附件" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="image"> | |||
| <j-upload v-model="model.image" ></j-upload> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="state"> | |||
| <a-input-number v-model="model.state" placeholder="请输入状态" style="width: 100%" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="用户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userId"> | |||
| <j-search-select-tag v-model="model.userId" dict="han_hai_member,nick_name,id" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="微信二维码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="img"> | |||
| <a-input v-model="model.img" placeholder="请输入微信二维码" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| </a-row> | |||
| </a-form-model> | |||
| </j-form-container> | |||
| </a-spin> | |||
| </template> | |||
| <script> | |||
| import { httpAction, getAction } from '@/api/manage' | |||
| import { validateDuplicateValue } from '@/utils/util' | |||
| export default { | |||
| name: 'PopularizeAuthenticationForm', | |||
| components: { | |||
| }, | |||
| props: { | |||
| //表单禁用 | |||
| disabled: { | |||
| type: Boolean, | |||
| default: false, | |||
| required: false | |||
| } | |||
| }, | |||
| data () { | |||
| return { | |||
| model:{ | |||
| }, | |||
| labelCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 5 }, | |||
| }, | |||
| wrapperCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 16 }, | |||
| }, | |||
| confirmLoading: false, | |||
| validatorRules: { | |||
| }, | |||
| url: { | |||
| add: "/popularizeAuthentication/popularizeAuthentication/add", | |||
| edit: "/popularizeAuthentication/popularizeAuthentication/edit", | |||
| queryById: "/popularizeAuthentication/popularizeAuthentication/queryById" | |||
| } | |||
| } | |||
| }, | |||
| computed: { | |||
| formDisabled(){ | |||
| return this.disabled | |||
| }, | |||
| }, | |||
| created () { | |||
| //备份model原始值 | |||
| this.modelDefault = JSON.parse(JSON.stringify(this.model)); | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.edit(this.modelDefault); | |||
| }, | |||
| edit (record) { | |||
| this.model = Object.assign({}, record); | |||
| this.visible = true; | |||
| }, | |||
| submitForm () { | |||
| const that = this; | |||
| // 触发表单验证 | |||
| this.$refs.form.validate(valid => { | |||
| if (valid) { | |||
| that.confirmLoading = true; | |||
| let httpurl = ''; | |||
| let method = ''; | |||
| if(!this.model.id){ | |||
| httpurl+=this.url.add; | |||
| method = 'post'; | |||
| }else{ | |||
| httpurl+=this.url.edit; | |||
| method = 'put'; | |||
| } | |||
| httpAction(httpurl,this.model,method).then((res)=>{ | |||
| if(res.success){ | |||
| that.$message.success(res.message); | |||
| that.$emit('ok'); | |||
| }else{ | |||
| that.$message.warning(res.message); | |||
| } | |||
| }).finally(() => { | |||
| that.confirmLoading = false; | |||
| }) | |||
| } | |||
| }) | |||
| }, | |||
| } | |||
| } | |||
| </script> | |||
| @ -0,0 +1,84 @@ | |||
| <template> | |||
| <a-drawer | |||
| :title="title" | |||
| :width="width" | |||
| placement="right" | |||
| :closable="false" | |||
| @close="close" | |||
| destroyOnClose | |||
| :visible="visible"> | |||
| <popularize-authentication-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></popularize-authentication-form> | |||
| <div class="drawer-footer"> | |||
| <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> | |||
| <a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> | |||
| </div> | |||
| </a-drawer> | |||
| </template> | |||
| <script> | |||
| import PopularizeAuthenticationForm from './PopularizeAuthenticationForm' | |||
| export default { | |||
| name: 'PopularizeAuthenticationModal', | |||
| components: { | |||
| PopularizeAuthenticationForm | |||
| }, | |||
| data () { | |||
| return { | |||
| title:"操作", | |||
| width:800, | |||
| visible: false, | |||
| disableSubmit: false | |||
| } | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.add(); | |||
| }) | |||
| }, | |||
| edit (record) { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.edit(record); | |||
| }); | |||
| }, | |||
| close () { | |||
| this.$emit('close'); | |||
| this.visible = false; | |||
| }, | |||
| submitCallback(){ | |||
| this.$emit('ok'); | |||
| this.visible = false; | |||
| }, | |||
| handleOk () { | |||
| this.$refs.realForm.submitForm(); | |||
| }, | |||
| handleCancel () { | |||
| this.close() | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| <style lang="less" scoped> | |||
| /** Button按钮间距 */ | |||
| .ant-btn { | |||
| margin-left: 30px; | |||
| margin-bottom: 30px; | |||
| float: right; | |||
| } | |||
| .drawer-footer{ | |||
| position: absolute; | |||
| bottom: -8px; | |||
| width: 100%; | |||
| border-top: 1px solid #e8e8e8; | |||
| padding: 10px 16px; | |||
| text-align: right; | |||
| left: 0; | |||
| background: #fff; | |||
| border-radius: 0 0 2px 2px; | |||
| } | |||
| </style> | |||
| @ -0,0 +1,60 @@ | |||
| <template> | |||
| <j-modal | |||
| :title="title" | |||
| :width="width" | |||
| :visible="visible" | |||
| switchFullscreen | |||
| @ok="handleOk" | |||
| :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" | |||
| @cancel="handleCancel" | |||
| cancelText="关闭"> | |||
| <popularize-authentication-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></popularize-authentication-form> | |||
| </j-modal> | |||
| </template> | |||
| <script> | |||
| import PopularizeAuthenticationForm from './PopularizeAuthenticationForm' | |||
| export default { | |||
| name: 'PopularizeAuthenticationModal', | |||
| components: { | |||
| PopularizeAuthenticationForm | |||
| }, | |||
| data () { | |||
| return { | |||
| title:'', | |||
| width:800, | |||
| visible: false, | |||
| disableSubmit: false | |||
| } | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.add(); | |||
| }) | |||
| }, | |||
| edit (record) { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.edit(record); | |||
| }) | |||
| }, | |||
| close () { | |||
| this.$emit('close'); | |||
| this.visible = false; | |||
| }, | |||
| handleOk () { | |||
| this.$refs.realForm.submitForm(); | |||
| }, | |||
| submitCallback(){ | |||
| this.$emit('ok'); | |||
| this.visible = false; | |||
| }, | |||
| handleCancel () { | |||
| this.close() | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| @ -0,0 +1,61 @@ | |||
| import {defHttp} from '/@/utils/http/axios'; | |||
| import {Modal} from 'ant-design-vue'; | |||
| enum Api { | |||
| list = '/popularizeAuthentication/popularizeAuthentication/list', | |||
| save='/popularizeAuthentication/popularizeAuthentication/add', | |||
| edit='/popularizeAuthentication/popularizeAuthentication/edit', | |||
| deleteOne = '/popularizeAuthentication/popularizeAuthentication/delete', | |||
| deleteBatch = '/popularizeAuthentication/popularizeAuthentication/deleteBatch', | |||
| importExcel = '/popularizeAuthentication/popularizeAuthentication/importExcel', | |||
| exportXls = '/popularizeAuthentication/popularizeAuthentication/exportXls', | |||
| } | |||
| /** | |||
| * 导出api | |||
| * @param params | |||
| */ | |||
| export const getExportUrl = Api.exportXls; | |||
| /** | |||
| * 导入api | |||
| */ | |||
| export const getImportUrl = Api.importExcel; | |||
| /** | |||
| * 列表接口 | |||
| * @param params | |||
| */ | |||
| export const list = (params) => | |||
| defHttp.get({url: Api.list, params}); | |||
| /** | |||
| * 删除单个 | |||
| */ | |||
| export const deleteOne = (params,handleSuccess) => { | |||
| return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { | |||
| handleSuccess(); | |||
| }); | |||
| } | |||
| /** | |||
| * 批量删除 | |||
| * @param params | |||
| */ | |||
| export const batchDelete = (params, handleSuccess) => { | |||
| Modal.confirm({ | |||
| title: '确认删除', | |||
| content: '是否删除选中数据', | |||
| okText: '确认', | |||
| cancelText: '取消', | |||
| onOk: () => { | |||
| return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { | |||
| handleSuccess(); | |||
| }); | |||
| } | |||
| }); | |||
| } | |||
| /** | |||
| * 保存或者更新 | |||
| * @param params | |||
| */ | |||
| export const saveOrUpdate = (params, isUpdate) => { | |||
| let url = isUpdate ? Api.edit : Api.save; | |||
| return defHttp.post({url: url, params}); | |||
| } | |||
| @ -0,0 +1,95 @@ | |||
| import {BasicColumn} from '/@/components/Table'; | |||
| import {FormSchema} from '/@/components/Table'; | |||
| import { rules} from '/@/utils/helper/validator'; | |||
| import { render } from '/@/utils/common/renderUtils'; | |||
| //列表数据 | |||
| export const columns: BasicColumn[] = [ | |||
| { | |||
| title: '创建日期', | |||
| align:"center", | |||
| sorter: true, | |||
| dataIndex: 'createTime' | |||
| }, | |||
| { | |||
| title: '姓名', | |||
| align:"center", | |||
| dataIndex: 'name' | |||
| }, | |||
| { | |||
| title: '电话', | |||
| align:"center", | |||
| dataIndex: 'phone' | |||
| }, | |||
| { | |||
| title: '身份证', | |||
| align:"center", | |||
| dataIndex: 'cardNo' | |||
| }, | |||
| { | |||
| title: '简历附件', | |||
| align:"center", | |||
| dataIndex: 'image', | |||
| slots: { customRender: 'fileSlot' }, | |||
| }, | |||
| { | |||
| title: '状态', | |||
| align:"center", | |||
| dataIndex: 'state' | |||
| }, | |||
| { | |||
| title: '用户', | |||
| align:"center", | |||
| dataIndex: 'userId_dictText' | |||
| }, | |||
| { | |||
| title: '微信二维码', | |||
| align:"center", | |||
| dataIndex: 'img' | |||
| }, | |||
| ]; | |||
| //查询数据 | |||
| export const searchFormSchema: FormSchema[] = [ | |||
| ]; | |||
| //表单数据 | |||
| export const formSchema: FormSchema[] = [ | |||
| { | |||
| label: '姓名', | |||
| field: 'name', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '电话', | |||
| field: 'phone', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '身份证', | |||
| field: 'cardNo', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '简历附件', | |||
| field: 'image', | |||
| component: 'JUpload', | |||
| componentProps:{ | |||
| }, | |||
| }, | |||
| { | |||
| label: '状态', | |||
| field: 'state', | |||
| component: 'InputNumber', | |||
| }, | |||
| { | |||
| label: '用户', | |||
| field: 'userId', | |||
| component: 'JSearchSelect', | |||
| componentProps:{ | |||
| dict:"han_hai_member,nick_name,id" | |||
| }, | |||
| }, | |||
| { | |||
| label: '微信二维码', | |||
| field: 'img', | |||
| component: 'Input', | |||
| }, | |||
| ]; | |||
| @ -0,0 +1,162 @@ | |||
| <template> | |||
| <div> | |||
| <!--引用表格--> | |||
| <BasicTable @register="registerTable" :rowSelection="rowSelection"> | |||
| <!--插槽:table标题--> | |||
| <template #tableTitle> | |||
| <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button> | |||
| <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button> | |||
| <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button> | |||
| <a-dropdown v-if="checkedKeys.length > 0"> | |||
| <template #overlay> | |||
| <a-menu> | |||
| <a-menu-item key="1" @click="batchHandleDelete"> | |||
| <Icon icon="ant-design:delete-outlined"></Icon> | |||
| 删除 | |||
| </a-menu-item> | |||
| </a-menu> | |||
| </template> | |||
| <a-button>批量操作 | |||
| <Icon icon="mdi:chevron-down"></Icon> | |||
| </a-button> | |||
| </a-dropdown> | |||
| </template> | |||
| <!--操作栏--> | |||
| <template #action="{ record }"> | |||
| <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/> | |||
| </template> | |||
| <!--字段回显插槽--> | |||
| <template #htmlSlot="{text}"> | |||
| <div v-html="text"></div> | |||
| </template> | |||
| <template #fileSlot="{text}"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |||
| <a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button> | |||
| </template> | |||
| </BasicTable> | |||
| <!-- 表单区域 --> | |||
| <PopularizeAuthenticationModal @register="registerModal" @success="handleSuccess"></PopularizeAuthenticationModal> | |||
| </div> | |||
| </template> | |||
| <script lang="ts" name="popularizeAuthentication-popularizeAuthentication" setup> | |||
| import {ref, computed, unref} from 'vue'; | |||
| import {BasicTable, useTable, TableAction} from '/@/components/Table'; | |||
| import {useModal} from '/@/components/Modal'; | |||
| import { useListPage } from '/@/hooks/system/useListPage' | |||
| import PopularizeAuthenticationModal from './components/PopularizeAuthenticationModal.vue' | |||
| import {columns, searchFormSchema} from './popularizeAuthentication.data'; | |||
| import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './popularizeAuthentication.api'; | |||
| const checkedKeys = ref<Array<string | number>>([]); | |||
| //注册model | |||
| const [registerModal, {openModal}] = useModal(); | |||
| //注册table数据 | |||
| const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({ | |||
| tableProps:{ | |||
| title: '主理人认证', | |||
| api: list, | |||
| columns, | |||
| canResize:false, | |||
| formConfig: { | |||
| labelWidth: 120, | |||
| schemas: searchFormSchema, | |||
| autoSubmitOnEnter:true, | |||
| showAdvancedButton:true, | |||
| fieldMapToTime: [ | |||
| ], | |||
| }, | |||
| actionColumn: { | |||
| width: 120, | |||
| }, | |||
| }, | |||
| exportConfig: { | |||
| name:"主理人认证", | |||
| url: getExportUrl, | |||
| }, | |||
| importConfig: { | |||
| url: getImportUrl | |||
| }, | |||
| }) | |||
| const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext | |||
| /** | |||
| * 新增事件 | |||
| */ | |||
| function handleAdd() { | |||
| openModal(true, { | |||
| isUpdate: false, | |||
| showFooter: true, | |||
| }); | |||
| } | |||
| /** | |||
| * 编辑事件 | |||
| */ | |||
| function handleEdit(record: Recordable) { | |||
| openModal(true, { | |||
| record, | |||
| isUpdate: true, | |||
| showFooter: true, | |||
| }); | |||
| } | |||
| /** | |||
| * 详情 | |||
| */ | |||
| function handleDetail(record: Recordable) { | |||
| openModal(true, { | |||
| record, | |||
| isUpdate: true, | |||
| showFooter: false, | |||
| }); | |||
| } | |||
| /** | |||
| * 删除事件 | |||
| */ | |||
| async function handleDelete(record) { | |||
| await deleteOne({id: record.id}, reload); | |||
| } | |||
| /** | |||
| * 批量删除事件 | |||
| */ | |||
| async function batchHandleDelete() { | |||
| await batchDelete({ids: checkedKeys.value}, reload); | |||
| } | |||
| /** | |||
| * 成功回调 | |||
| */ | |||
| function handleSuccess() { | |||
| reload(); | |||
| } | |||
| /** | |||
| * 操作栏 | |||
| */ | |||
| function getTableAction(record){ | |||
| return [ | |||
| { | |||
| label: '编辑', | |||
| onClick: handleEdit.bind(null, record), | |||
| } | |||
| ] | |||
| } | |||
| /** | |||
| * 下拉操作栏 | |||
| */ | |||
| function getDropDownAction(record){ | |||
| return [ | |||
| { | |||
| label: '详情', | |||
| onClick: handleDetail.bind(null, record), | |||
| }, { | |||
| label: '删除', | |||
| popConfirm: { | |||
| title: '是否确认删除', | |||
| confirm: handleDelete.bind(null, record), | |||
| } | |||
| } | |||
| ] | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| </style> | |||
| @ -0,0 +1,58 @@ | |||
| <template> | |||
| <BasicModal v-bind="$attrs" @register="registerModal" :title="title" @ok="handleSubmit"> | |||
| <BasicForm @register="registerForm"/> | |||
| </BasicModal> | |||
| </template> | |||
| <script lang="ts" setup> | |||
| import {ref, computed, unref} from 'vue'; | |||
| import {BasicModal, useModalInner} from '/@/components/Modal'; | |||
| import {BasicForm, useForm} from '/@/components/Form/index'; | |||
| import {formSchema} from '../popularizeAuthentication.data'; | |||
| import {saveOrUpdate} from '../popularizeAuthentication.api'; | |||
| // Emits声明 | |||
| const emit = defineEmits(['register','success']); | |||
| const isUpdate = ref(true); | |||
| //表单配置 | |||
| const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({ | |||
| labelWidth: 150, | |||
| schemas: formSchema, | |||
| showActionButtonGroup: false, | |||
| }); | |||
| //表单赋值 | |||
| const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => { | |||
| //重置表单 | |||
| await resetFields(); | |||
| setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter}); | |||
| isUpdate.value = !!data?.isUpdate; | |||
| if (unref(isUpdate)) { | |||
| //表单赋值 | |||
| await setFieldsValue({ | |||
| ...data.record, | |||
| }); | |||
| } | |||
| // 隐藏底部时禁用整个表单 | |||
| setProps({ disabled: !data?.showFooter }) | |||
| }); | |||
| //设置标题 | |||
| const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑')); | |||
| //表单提交事件 | |||
| async function handleSubmit(v) { | |||
| try { | |||
| let values = await validate(); | |||
| setModalProps({confirmLoading: true}); | |||
| //提交表单 | |||
| await saveOrUpdate(values, isUpdate.value); | |||
| //关闭弹窗 | |||
| closeModal(); | |||
| //刷新列表 | |||
| emit('success'); | |||
| } finally { | |||
| setModalProps({confirmLoading: false}); | |||
| } | |||
| } | |||
| </script> | |||
| <style lang="less" scoped> | |||
| </style> | |||
| @ -0,0 +1,171 @@ | |||
| package org.jeecg.modules.popularizeCity.controller; | |||
| import java.util.Arrays; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import java.util.stream.Collectors; | |||
| import java.io.IOException; | |||
| import java.io.UnsupportedEncodingException; | |||
| import java.net.URLDecoder; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import org.jeecg.common.api.vo.Result; | |||
| import org.jeecg.common.system.query.QueryGenerator; | |||
| import org.jeecg.common.util.oConvertUtils; | |||
| import org.jeecg.modules.popularizeCity.entity.PopularizeCity; | |||
| import org.jeecg.modules.popularizeCity.service.IPopularizeCityService; | |||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
| import com.baomidou.mybatisplus.core.metadata.IPage; | |||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.jeecgframework.poi.excel.ExcelImportUtil; | |||
| import org.jeecgframework.poi.excel.def.NormalExcelConstants; | |||
| import org.jeecgframework.poi.excel.entity.ExportParams; | |||
| import org.jeecgframework.poi.excel.entity.ImportParams; | |||
| import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | |||
| import org.jeecg.common.system.base.controller.JeecgController; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import org.springframework.web.multipart.MultipartFile; | |||
| import org.springframework.web.multipart.MultipartHttpServletRequest; | |||
| import org.springframework.web.servlet.ModelAndView; | |||
| import com.alibaba.fastjson.JSON; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.jeecg.common.aspect.annotation.AutoLog; | |||
| /** | |||
| * @Description: 城市管理 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Api(tags="城市管理") | |||
| @RestController | |||
| @RequestMapping("/popularizeCity/popularizeCity") | |||
| @Slf4j | |||
| public class PopularizeCityController extends JeecgController<PopularizeCity, IPopularizeCityService> { | |||
| @Autowired | |||
| private IPopularizeCityService popularizeCityService; | |||
| /** | |||
| * 分页列表查询 | |||
| * | |||
| * @param popularizeCity | |||
| * @param pageNo | |||
| * @param pageSize | |||
| * @param req | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "城市管理-分页列表查询") | |||
| @ApiOperation(value="城市管理-分页列表查询", notes="城市管理-分页列表查询") | |||
| @GetMapping(value = "/list") | |||
| public Result<IPage<PopularizeCity>> queryPageList(PopularizeCity popularizeCity, | |||
| @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | |||
| @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | |||
| HttpServletRequest req) { | |||
| QueryWrapper<PopularizeCity> queryWrapper = QueryGenerator.initQueryWrapper(popularizeCity, req.getParameterMap()); | |||
| Page<PopularizeCity> page = new Page<PopularizeCity>(pageNo, pageSize); | |||
| IPage<PopularizeCity> pageList = popularizeCityService.page(page, queryWrapper); | |||
| return Result.OK(pageList); | |||
| } | |||
| /** | |||
| * 添加 | |||
| * | |||
| * @param popularizeCity | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "城市管理-添加") | |||
| @ApiOperation(value="城市管理-添加", notes="城市管理-添加") | |||
| @PostMapping(value = "/add") | |||
| public Result<String> add(@RequestBody PopularizeCity popularizeCity) { | |||
| popularizeCityService.save(popularizeCity); | |||
| return Result.OK("添加成功!"); | |||
| } | |||
| /** | |||
| * 编辑 | |||
| * | |||
| * @param popularizeCity | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "城市管理-编辑") | |||
| @ApiOperation(value="城市管理-编辑", notes="城市管理-编辑") | |||
| @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) | |||
| public Result<String> edit(@RequestBody PopularizeCity popularizeCity) { | |||
| popularizeCityService.updateById(popularizeCity); | |||
| return Result.OK("编辑成功!"); | |||
| } | |||
| /** | |||
| * 通过id删除 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "城市管理-通过id删除") | |||
| @ApiOperation(value="城市管理-通过id删除", notes="城市管理-通过id删除") | |||
| @DeleteMapping(value = "/delete") | |||
| public Result<String> delete(@RequestParam(name="id",required=true) String id) { | |||
| popularizeCityService.removeById(id); | |||
| return Result.OK("删除成功!"); | |||
| } | |||
| /** | |||
| * 批量删除 | |||
| * | |||
| * @param ids | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "城市管理-批量删除") | |||
| @ApiOperation(value="城市管理-批量删除", notes="城市管理-批量删除") | |||
| @DeleteMapping(value = "/deleteBatch") | |||
| public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | |||
| this.popularizeCityService.removeByIds(Arrays.asList(ids.split(","))); | |||
| return Result.OK("批量删除成功!"); | |||
| } | |||
| /** | |||
| * 通过id查询 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "城市管理-通过id查询") | |||
| @ApiOperation(value="城市管理-通过id查询", notes="城市管理-通过id查询") | |||
| @GetMapping(value = "/queryById") | |||
| public Result<PopularizeCity> queryById(@RequestParam(name="id",required=true) String id) { | |||
| PopularizeCity popularizeCity = popularizeCityService.getById(id); | |||
| if(popularizeCity==null) { | |||
| return Result.error("未找到对应数据"); | |||
| } | |||
| return Result.OK(popularizeCity); | |||
| } | |||
| /** | |||
| * 导出excel | |||
| * | |||
| * @param request | |||
| * @param popularizeCity | |||
| */ | |||
| @RequestMapping(value = "/exportXls") | |||
| public ModelAndView exportXls(HttpServletRequest request, PopularizeCity popularizeCity) { | |||
| return super.exportXls(request, popularizeCity, PopularizeCity.class, "城市管理"); | |||
| } | |||
| /** | |||
| * 通过excel导入数据 | |||
| * | |||
| * @param request | |||
| * @param response | |||
| * @return | |||
| */ | |||
| @RequestMapping(value = "/importExcel", method = RequestMethod.POST) | |||
| public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | |||
| return super.importExcel(request, response, PopularizeCity.class); | |||
| } | |||
| } | |||
| @ -0,0 +1,62 @@ | |||
| package org.jeecg.modules.popularizeCity.entity; | |||
| import java.io.Serializable; | |||
| import java.io.UnsupportedEncodingException; | |||
| import java.util.Date; | |||
| import java.math.BigDecimal; | |||
| import com.baomidou.mybatisplus.annotation.IdType; | |||
| import com.baomidou.mybatisplus.annotation.TableId; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import lombok.Data; | |||
| import com.fasterxml.jackson.annotation.JsonFormat; | |||
| import org.springframework.format.annotation.DateTimeFormat; | |||
| import org.jeecgframework.poi.excel.annotation.Excel; | |||
| import org.jeecg.common.aspect.annotation.Dict; | |||
| import io.swagger.annotations.ApiModel; | |||
| import io.swagger.annotations.ApiModelProperty; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.experimental.Accessors; | |||
| /** | |||
| * @Description: 城市管理 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Data | |||
| @TableName("popularize_city") | |||
| @Accessors(chain = true) | |||
| @EqualsAndHashCode(callSuper = false) | |||
| @ApiModel(value="popularize_city对象", description="城市管理") | |||
| public class PopularizeCity implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| /**主键*/ | |||
| @TableId(type = IdType.ASSIGN_ID) | |||
| @ApiModelProperty(value = "主键") | |||
| private java.lang.String id; | |||
| /**创建人*/ | |||
| @ApiModelProperty(value = "创建人") | |||
| private java.lang.String createBy; | |||
| /**创建日期*/ | |||
| @ApiModelProperty(value = "创建日期") | |||
| private java.util.Date createTime; | |||
| /**更新人*/ | |||
| @ApiModelProperty(value = "更新人") | |||
| private java.lang.String updateBy; | |||
| /**更新日期*/ | |||
| @ApiModelProperty(value = "更新日期") | |||
| private java.util.Date updateTime; | |||
| /**中文-城市*/ | |||
| @Excel(name = "中文-城市", width = 15) | |||
| @ApiModelProperty(value = "中文-城市") | |||
| private java.lang.String city; | |||
| /**英文-城市*/ | |||
| @Excel(name = "英文-城市", width = 15) | |||
| @ApiModelProperty(value = "英文-城市") | |||
| private java.lang.String enCity; | |||
| /**排序*/ | |||
| @Excel(name = "排序", width = 15) | |||
| @ApiModelProperty(value = "排序") | |||
| private java.lang.Integer sort; | |||
| } | |||
| @ -0,0 +1,17 @@ | |||
| package org.jeecg.modules.popularizeCity.mapper; | |||
| import java.util.List; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import org.jeecg.modules.popularizeCity.entity.PopularizeCity; | |||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
| /** | |||
| * @Description: 城市管理 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface PopularizeCityMapper extends BaseMapper<PopularizeCity> { | |||
| } | |||
| @ -0,0 +1,5 @@ | |||
| <?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="org.jeecg.modules.popularizeCity.mapper.PopularizeCityMapper"> | |||
| </mapper> | |||
| @ -0,0 +1,14 @@ | |||
| package org.jeecg.modules.popularizeCity.service; | |||
| import org.jeecg.modules.popularizeCity.entity.PopularizeCity; | |||
| import com.baomidou.mybatisplus.extension.service.IService; | |||
| /** | |||
| * @Description: 城市管理 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface IPopularizeCityService extends IService<PopularizeCity> { | |||
| } | |||
| @ -0,0 +1,19 @@ | |||
| package org.jeecg.modules.popularizeCity.service.impl; | |||
| import org.jeecg.modules.popularizeCity.entity.PopularizeCity; | |||
| import org.jeecg.modules.popularizeCity.mapper.PopularizeCityMapper; | |||
| import org.jeecg.modules.popularizeCity.service.IPopularizeCityService; | |||
| import org.springframework.stereotype.Service; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| /** | |||
| * @Description: 城市管理 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Service | |||
| public class PopularizeCityServiceImpl extends ServiceImpl<PopularizeCityMapper, PopularizeCity> implements IPopularizeCityService { | |||
| } | |||
| @ -0,0 +1,203 @@ | |||
| <template> | |||
| <a-card :bordered="false"> | |||
| <!-- 查询区域 --> | |||
| <div class="table-page-search-wrapper"> | |||
| <a-form layout="inline" @keyup.enter.native="searchQuery"> | |||
| <a-row :gutter="24"> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <a-form-item label="中文-城市"> | |||
| <a-input placeholder="请输入中文-城市" v-model="queryParam.city"></a-input> | |||
| </a-form-item> | |||
| </a-col> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <a-form-item label="英文-城市"> | |||
| <a-input placeholder="请输入英文-城市" v-model="queryParam.enCity"></a-input> | |||
| </a-form-item> | |||
| </a-col> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> | |||
| <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> | |||
| <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> | |||
| <a @click="handleToggleSearch" style="margin-left: 8px"> | |||
| {{ toggleSearchStatus ? '收起' : '展开' }} | |||
| <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> | |||
| </a> | |||
| </span> | |||
| </a-col> | |||
| </a-row> | |||
| </a-form> | |||
| </div> | |||
| <!-- 查询区域-END --> | |||
| <!-- 操作按钮区域 --> | |||
| <div class="table-operator"> | |||
| <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> | |||
| <a-button type="primary" icon="download" @click="handleExportXls('城市管理')">导出</a-button> | |||
| <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | |||
| <a-button type="primary" icon="import">导入</a-button> | |||
| </a-upload> | |||
| <!-- 高级查询区域 --> | |||
| <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> | |||
| <a-dropdown v-if="selectedRowKeys.length > 0"> | |||
| <a-menu slot="overlay"> | |||
| <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> | |||
| </a-menu> | |||
| <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> | |||
| </a-dropdown> | |||
| </div> | |||
| <!-- table区域-begin --> | |||
| <div> | |||
| <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |||
| <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 | |||
| <a style="margin-left: 24px" @click="onClearSelected">清空</a> | |||
| </div> | |||
| <a-table | |||
| ref="table" | |||
| size="middle" | |||
| :scroll="{x:true}" | |||
| bordered | |||
| rowKey="id" | |||
| :columns="columns" | |||
| :dataSource="dataSource" | |||
| :pagination="ipagination" | |||
| :loading="loading" | |||
| :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" | |||
| class="j-table-force-nowrap" | |||
| @change="handleTableChange"> | |||
| <template slot="htmlSlot" slot-scope="text"> | |||
| <div v-html="text"></div> | |||
| </template> | |||
| <template slot="imgSlot" slot-scope="text,record"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | |||
| <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> | |||
| </template> | |||
| <template slot="fileSlot" slot-scope="text"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |||
| <a-button | |||
| v-else | |||
| :ghost="true" | |||
| type="primary" | |||
| icon="download" | |||
| size="small" | |||
| @click="downloadFile(text)"> | |||
| 下载 | |||
| </a-button> | |||
| </template> | |||
| <span slot="action" slot-scope="text, record"> | |||
| <a @click="handleEdit(record)">编辑</a> | |||
| <a-divider type="vertical" /> | |||
| <a-dropdown> | |||
| <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> | |||
| <a-menu slot="overlay"> | |||
| <a-menu-item> | |||
| <a @click="handleDetail(record)">详情</a> | |||
| </a-menu-item> | |||
| <a-menu-item> | |||
| <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | |||
| <a>删除</a> | |||
| </a-popconfirm> | |||
| </a-menu-item> | |||
| </a-menu> | |||
| </a-dropdown> | |||
| </span> | |||
| </a-table> | |||
| </div> | |||
| <popularize-city-modal ref="modalForm" @ok="modalFormOk"></popularize-city-modal> | |||
| </a-card> | |||
| </template> | |||
| <script> | |||
| import '@/assets/less/TableExpand.less' | |||
| import { mixinDevice } from '@/utils/mixin' | |||
| import { JeecgListMixin } from '@/mixins/JeecgListMixin' | |||
| import PopularizeCityModal from './modules/PopularizeCityModal' | |||
| export default { | |||
| name: 'PopularizeCityList', | |||
| mixins:[JeecgListMixin, mixinDevice], | |||
| components: { | |||
| PopularizeCityModal | |||
| }, | |||
| data () { | |||
| return { | |||
| description: '城市管理管理页面', | |||
| // 表头 | |||
| columns: [ | |||
| { | |||
| title: '#', | |||
| dataIndex: '', | |||
| key:'rowIndex', | |||
| width:60, | |||
| align:"center", | |||
| customRender:function (t,r,index) { | |||
| return parseInt(index)+1; | |||
| } | |||
| }, | |||
| { | |||
| title:'中文-城市', | |||
| align:"center", | |||
| dataIndex: 'city' | |||
| }, | |||
| { | |||
| title:'英文-城市', | |||
| align:"center", | |||
| dataIndex: 'enCity' | |||
| }, | |||
| { | |||
| title:'排序', | |||
| align:"center", | |||
| dataIndex: 'sort' | |||
| }, | |||
| { | |||
| title: '操作', | |||
| dataIndex: 'action', | |||
| align:"center", | |||
| fixed:"right", | |||
| width:147, | |||
| scopedSlots: { customRender: 'action' } | |||
| } | |||
| ], | |||
| url: { | |||
| list: "/popularizeCity/popularizeCity/list", | |||
| delete: "/popularizeCity/popularizeCity/delete", | |||
| deleteBatch: "/popularizeCity/popularizeCity/deleteBatch", | |||
| exportXlsUrl: "/popularizeCity/popularizeCity/exportXls", | |||
| importExcelUrl: "popularizeCity/popularizeCity/importExcel", | |||
| }, | |||
| dictOptions:{}, | |||
| superFieldList:[], | |||
| } | |||
| }, | |||
| created() { | |||
| this.getSuperFieldList(); | |||
| }, | |||
| computed: { | |||
| importExcelUrl: function(){ | |||
| return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | |||
| }, | |||
| }, | |||
| methods: { | |||
| initDictConfig(){ | |||
| }, | |||
| getSuperFieldList(){ | |||
| let fieldList=[]; | |||
| fieldList.push({type:'string',value:'city',text:'中文-城市',dictCode:''}) | |||
| fieldList.push({type:'string',value:'enCity',text:'英文-城市',dictCode:''}) | |||
| fieldList.push({type:'int',value:'sort',text:'排序',dictCode:''}) | |||
| this.superFieldList = fieldList | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| @import '~@assets/less/common.less'; | |||
| </style> | |||
| @ -0,0 +1,114 @@ | |||
| <template> | |||
| <a-spin :spinning="confirmLoading"> | |||
| <j-form-container :disabled="formDisabled"> | |||
| <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> | |||
| <a-row> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="中文-城市" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="city"> | |||
| <a-input v-model="model.city" placeholder="请输入中文-城市" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="英文-城市" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enCity"> | |||
| <a-input v-model="model.enCity" placeholder="请输入英文-城市" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="排序" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sort"> | |||
| <a-input-number v-model="model.sort" placeholder="请输入排序" style="width: 100%" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| </a-row> | |||
| </a-form-model> | |||
| </j-form-container> | |||
| </a-spin> | |||
| </template> | |||
| <script> | |||
| import { httpAction, getAction } from '@/api/manage' | |||
| import { validateDuplicateValue } from '@/utils/util' | |||
| export default { | |||
| name: 'PopularizeCityForm', | |||
| components: { | |||
| }, | |||
| props: { | |||
| //表单禁用 | |||
| disabled: { | |||
| type: Boolean, | |||
| default: false, | |||
| required: false | |||
| } | |||
| }, | |||
| data () { | |||
| return { | |||
| model:{ | |||
| }, | |||
| labelCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 5 }, | |||
| }, | |||
| wrapperCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 16 }, | |||
| }, | |||
| confirmLoading: false, | |||
| validatorRules: { | |||
| }, | |||
| url: { | |||
| add: "/popularizeCity/popularizeCity/add", | |||
| edit: "/popularizeCity/popularizeCity/edit", | |||
| queryById: "/popularizeCity/popularizeCity/queryById" | |||
| } | |||
| } | |||
| }, | |||
| computed: { | |||
| formDisabled(){ | |||
| return this.disabled | |||
| }, | |||
| }, | |||
| created () { | |||
| //备份model原始值 | |||
| this.modelDefault = JSON.parse(JSON.stringify(this.model)); | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.edit(this.modelDefault); | |||
| }, | |||
| edit (record) { | |||
| this.model = Object.assign({}, record); | |||
| this.visible = true; | |||
| }, | |||
| submitForm () { | |||
| const that = this; | |||
| // 触发表单验证 | |||
| this.$refs.form.validate(valid => { | |||
| if (valid) { | |||
| that.confirmLoading = true; | |||
| let httpurl = ''; | |||
| let method = ''; | |||
| if(!this.model.id){ | |||
| httpurl+=this.url.add; | |||
| method = 'post'; | |||
| }else{ | |||
| httpurl+=this.url.edit; | |||
| method = 'put'; | |||
| } | |||
| httpAction(httpurl,this.model,method).then((res)=>{ | |||
| if(res.success){ | |||
| that.$message.success(res.message); | |||
| that.$emit('ok'); | |||
| }else{ | |||
| that.$message.warning(res.message); | |||
| } | |||
| }).finally(() => { | |||
| that.confirmLoading = false; | |||
| }) | |||
| } | |||
| }) | |||
| }, | |||
| } | |||
| } | |||
| </script> | |||
| @ -0,0 +1,84 @@ | |||
| <template> | |||
| <a-drawer | |||
| :title="title" | |||
| :width="width" | |||
| placement="right" | |||
| :closable="false" | |||
| @close="close" | |||
| destroyOnClose | |||
| :visible="visible"> | |||
| <popularize-city-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></popularize-city-form> | |||
| <div class="drawer-footer"> | |||
| <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> | |||
| <a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> | |||
| </div> | |||
| </a-drawer> | |||
| </template> | |||
| <script> | |||
| import PopularizeCityForm from './PopularizeCityForm' | |||
| export default { | |||
| name: 'PopularizeCityModal', | |||
| components: { | |||
| PopularizeCityForm | |||
| }, | |||
| data () { | |||
| return { | |||
| title:"操作", | |||
| width:800, | |||
| visible: false, | |||
| disableSubmit: false | |||
| } | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.add(); | |||
| }) | |||
| }, | |||
| edit (record) { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.edit(record); | |||
| }); | |||
| }, | |||
| close () { | |||
| this.$emit('close'); | |||
| this.visible = false; | |||
| }, | |||
| submitCallback(){ | |||
| this.$emit('ok'); | |||
| this.visible = false; | |||
| }, | |||
| handleOk () { | |||
| this.$refs.realForm.submitForm(); | |||
| }, | |||
| handleCancel () { | |||
| this.close() | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| <style lang="less" scoped> | |||
| /** Button按钮间距 */ | |||
| .ant-btn { | |||
| margin-left: 30px; | |||
| margin-bottom: 30px; | |||
| float: right; | |||
| } | |||
| .drawer-footer{ | |||
| position: absolute; | |||
| bottom: -8px; | |||
| width: 100%; | |||
| border-top: 1px solid #e8e8e8; | |||
| padding: 10px 16px; | |||
| text-align: right; | |||
| left: 0; | |||
| background: #fff; | |||
| border-radius: 0 0 2px 2px; | |||
| } | |||
| </style> | |||
| @ -0,0 +1,60 @@ | |||
| <template> | |||
| <j-modal | |||
| :title="title" | |||
| :width="width" | |||
| :visible="visible" | |||
| switchFullscreen | |||
| @ok="handleOk" | |||
| :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" | |||
| @cancel="handleCancel" | |||
| cancelText="关闭"> | |||
| <popularize-city-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></popularize-city-form> | |||
| </j-modal> | |||
| </template> | |||
| <script> | |||
| import PopularizeCityForm from './PopularizeCityForm' | |||
| export default { | |||
| name: 'PopularizeCityModal', | |||
| components: { | |||
| PopularizeCityForm | |||
| }, | |||
| data () { | |||
| return { | |||
| title:'', | |||
| width:800, | |||
| visible: false, | |||
| disableSubmit: false | |||
| } | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.add(); | |||
| }) | |||
| }, | |||
| edit (record) { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.edit(record); | |||
| }) | |||
| }, | |||
| close () { | |||
| this.$emit('close'); | |||
| this.visible = false; | |||
| }, | |||
| handleOk () { | |||
| this.$refs.realForm.submitForm(); | |||
| }, | |||
| submitCallback(){ | |||
| this.$emit('ok'); | |||
| this.visible = false; | |||
| }, | |||
| handleCancel () { | |||
| this.close() | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| @ -0,0 +1,61 @@ | |||
| import {defHttp} from '/@/utils/http/axios'; | |||
| import {Modal} from 'ant-design-vue'; | |||
| enum Api { | |||
| list = '/popularizeCity/popularizeCity/list', | |||
| save='/popularizeCity/popularizeCity/add', | |||
| edit='/popularizeCity/popularizeCity/edit', | |||
| deleteOne = '/popularizeCity/popularizeCity/delete', | |||
| deleteBatch = '/popularizeCity/popularizeCity/deleteBatch', | |||
| importExcel = '/popularizeCity/popularizeCity/importExcel', | |||
| exportXls = '/popularizeCity/popularizeCity/exportXls', | |||
| } | |||
| /** | |||
| * 导出api | |||
| * @param params | |||
| */ | |||
| export const getExportUrl = Api.exportXls; | |||
| /** | |||
| * 导入api | |||
| */ | |||
| export const getImportUrl = Api.importExcel; | |||
| /** | |||
| * 列表接口 | |||
| * @param params | |||
| */ | |||
| export const list = (params) => | |||
| defHttp.get({url: Api.list, params}); | |||
| /** | |||
| * 删除单个 | |||
| */ | |||
| export const deleteOne = (params,handleSuccess) => { | |||
| return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { | |||
| handleSuccess(); | |||
| }); | |||
| } | |||
| /** | |||
| * 批量删除 | |||
| * @param params | |||
| */ | |||
| export const batchDelete = (params, handleSuccess) => { | |||
| Modal.confirm({ | |||
| title: '确认删除', | |||
| content: '是否删除选中数据', | |||
| okText: '确认', | |||
| cancelText: '取消', | |||
| onOk: () => { | |||
| return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { | |||
| handleSuccess(); | |||
| }); | |||
| } | |||
| }); | |||
| } | |||
| /** | |||
| * 保存或者更新 | |||
| * @param params | |||
| */ | |||
| export const saveOrUpdate = (params, isUpdate) => { | |||
| let url = isUpdate ? Api.edit : Api.save; | |||
| return defHttp.post({url: url, params}); | |||
| } | |||
| @ -0,0 +1,55 @@ | |||
| import {BasicColumn} from '/@/components/Table'; | |||
| import {FormSchema} from '/@/components/Table'; | |||
| import { rules} from '/@/utils/helper/validator'; | |||
| import { render } from '/@/utils/common/renderUtils'; | |||
| //列表数据 | |||
| export const columns: BasicColumn[] = [ | |||
| { | |||
| title: '中文-城市', | |||
| align:"center", | |||
| dataIndex: 'city' | |||
| }, | |||
| { | |||
| title: '英文-城市', | |||
| align:"center", | |||
| dataIndex: 'enCity' | |||
| }, | |||
| { | |||
| title: '排序', | |||
| align:"center", | |||
| dataIndex: 'sort' | |||
| }, | |||
| ]; | |||
| //查询数据 | |||
| export const searchFormSchema: FormSchema[] = [ | |||
| { | |||
| label: "中文-城市", | |||
| field: "city", | |||
| component: 'Input', | |||
| colProps: {span: 6}, | |||
| }, | |||
| { | |||
| label: "英文-城市", | |||
| field: "enCity", | |||
| component: 'Input', | |||
| colProps: {span: 6}, | |||
| }, | |||
| ]; | |||
| //表单数据 | |||
| export const formSchema: FormSchema[] = [ | |||
| { | |||
| label: '中文-城市', | |||
| field: 'city', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '英文-城市', | |||
| field: 'enCity', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '排序', | |||
| field: 'sort', | |||
| component: 'InputNumber', | |||
| }, | |||
| ]; | |||
| @ -0,0 +1,162 @@ | |||
| <template> | |||
| <div> | |||
| <!--引用表格--> | |||
| <BasicTable @register="registerTable" :rowSelection="rowSelection"> | |||
| <!--插槽:table标题--> | |||
| <template #tableTitle> | |||
| <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button> | |||
| <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button> | |||
| <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button> | |||
| <a-dropdown v-if="checkedKeys.length > 0"> | |||
| <template #overlay> | |||
| <a-menu> | |||
| <a-menu-item key="1" @click="batchHandleDelete"> | |||
| <Icon icon="ant-design:delete-outlined"></Icon> | |||
| 删除 | |||
| </a-menu-item> | |||
| </a-menu> | |||
| </template> | |||
| <a-button>批量操作 | |||
| <Icon icon="mdi:chevron-down"></Icon> | |||
| </a-button> | |||
| </a-dropdown> | |||
| </template> | |||
| <!--操作栏--> | |||
| <template #action="{ record }"> | |||
| <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/> | |||
| </template> | |||
| <!--字段回显插槽--> | |||
| <template #htmlSlot="{text}"> | |||
| <div v-html="text"></div> | |||
| </template> | |||
| <template #fileSlot="{text}"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |||
| <a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button> | |||
| </template> | |||
| </BasicTable> | |||
| <!-- 表单区域 --> | |||
| <PopularizeCityModal @register="registerModal" @success="handleSuccess"></PopularizeCityModal> | |||
| </div> | |||
| </template> | |||
| <script lang="ts" name="popularizeCity-popularizeCity" setup> | |||
| import {ref, computed, unref} from 'vue'; | |||
| import {BasicTable, useTable, TableAction} from '/@/components/Table'; | |||
| import {useModal} from '/@/components/Modal'; | |||
| import { useListPage } from '/@/hooks/system/useListPage' | |||
| import PopularizeCityModal from './components/PopularizeCityModal.vue' | |||
| import {columns, searchFormSchema} from './popularizeCity.data'; | |||
| import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './popularizeCity.api'; | |||
| const checkedKeys = ref<Array<string | number>>([]); | |||
| //注册model | |||
| const [registerModal, {openModal}] = useModal(); | |||
| //注册table数据 | |||
| const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({ | |||
| tableProps:{ | |||
| title: '城市管理', | |||
| api: list, | |||
| columns, | |||
| canResize:false, | |||
| formConfig: { | |||
| labelWidth: 120, | |||
| schemas: searchFormSchema, | |||
| autoSubmitOnEnter:true, | |||
| showAdvancedButton:true, | |||
| fieldMapToTime: [ | |||
| ], | |||
| }, | |||
| actionColumn: { | |||
| width: 120, | |||
| }, | |||
| }, | |||
| exportConfig: { | |||
| name:"城市管理", | |||
| url: getExportUrl, | |||
| }, | |||
| importConfig: { | |||
| url: getImportUrl | |||
| }, | |||
| }) | |||
| const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext | |||
| /** | |||
| * 新增事件 | |||
| */ | |||
| function handleAdd() { | |||
| openModal(true, { | |||
| isUpdate: false, | |||
| showFooter: true, | |||
| }); | |||
| } | |||
| /** | |||
| * 编辑事件 | |||
| */ | |||
| function handleEdit(record: Recordable) { | |||
| openModal(true, { | |||
| record, | |||
| isUpdate: true, | |||
| showFooter: true, | |||
| }); | |||
| } | |||
| /** | |||
| * 详情 | |||
| */ | |||
| function handleDetail(record: Recordable) { | |||
| openModal(true, { | |||
| record, | |||
| isUpdate: true, | |||
| showFooter: false, | |||
| }); | |||
| } | |||
| /** | |||
| * 删除事件 | |||
| */ | |||
| async function handleDelete(record) { | |||
| await deleteOne({id: record.id}, reload); | |||
| } | |||
| /** | |||
| * 批量删除事件 | |||
| */ | |||
| async function batchHandleDelete() { | |||
| await batchDelete({ids: checkedKeys.value}, reload); | |||
| } | |||
| /** | |||
| * 成功回调 | |||
| */ | |||
| function handleSuccess() { | |||
| reload(); | |||
| } | |||
| /** | |||
| * 操作栏 | |||
| */ | |||
| function getTableAction(record){ | |||
| return [ | |||
| { | |||
| label: '编辑', | |||
| onClick: handleEdit.bind(null, record), | |||
| } | |||
| ] | |||
| } | |||
| /** | |||
| * 下拉操作栏 | |||
| */ | |||
| function getDropDownAction(record){ | |||
| return [ | |||
| { | |||
| label: '详情', | |||
| onClick: handleDetail.bind(null, record), | |||
| }, { | |||
| label: '删除', | |||
| popConfirm: { | |||
| title: '是否确认删除', | |||
| confirm: handleDelete.bind(null, record), | |||
| } | |||
| } | |||
| ] | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| </style> | |||
| @ -0,0 +1,58 @@ | |||
| <template> | |||
| <BasicModal v-bind="$attrs" @register="registerModal" :title="title" @ok="handleSubmit"> | |||
| <BasicForm @register="registerForm"/> | |||
| </BasicModal> | |||
| </template> | |||
| <script lang="ts" setup> | |||
| import {ref, computed, unref} from 'vue'; | |||
| import {BasicModal, useModalInner} from '/@/components/Modal'; | |||
| import {BasicForm, useForm} from '/@/components/Form/index'; | |||
| import {formSchema} from '../popularizeCity.data'; | |||
| import {saveOrUpdate} from '../popularizeCity.api'; | |||
| // Emits声明 | |||
| const emit = defineEmits(['register','success']); | |||
| const isUpdate = ref(true); | |||
| //表单配置 | |||
| const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({ | |||
| labelWidth: 150, | |||
| schemas: formSchema, | |||
| showActionButtonGroup: false, | |||
| }); | |||
| //表单赋值 | |||
| const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => { | |||
| //重置表单 | |||
| await resetFields(); | |||
| setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter}); | |||
| isUpdate.value = !!data?.isUpdate; | |||
| if (unref(isUpdate)) { | |||
| //表单赋值 | |||
| await setFieldsValue({ | |||
| ...data.record, | |||
| }); | |||
| } | |||
| // 隐藏底部时禁用整个表单 | |||
| setProps({ disabled: !data?.showFooter }) | |||
| }); | |||
| //设置标题 | |||
| const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑')); | |||
| //表单提交事件 | |||
| async function handleSubmit(v) { | |||
| try { | |||
| let values = await validate(); | |||
| setModalProps({confirmLoading: true}); | |||
| //提交表单 | |||
| await saveOrUpdate(values, isUpdate.value); | |||
| //关闭弹窗 | |||
| closeModal(); | |||
| //刷新列表 | |||
| emit('success'); | |||
| } finally { | |||
| setModalProps({confirmLoading: false}); | |||
| } | |||
| } | |||
| </script> | |||
| <style lang="less" scoped> | |||
| </style> | |||
| @ -0,0 +1,171 @@ | |||
| package org.jeecg.modules.popularizeCollect.controller; | |||
| import java.util.Arrays; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import java.util.stream.Collectors; | |||
| import java.io.IOException; | |||
| import java.io.UnsupportedEncodingException; | |||
| import java.net.URLDecoder; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import org.jeecg.common.api.vo.Result; | |||
| import org.jeecg.common.system.query.QueryGenerator; | |||
| import org.jeecg.common.util.oConvertUtils; | |||
| import org.jeecg.modules.popularizeCollect.entity.PopularizeCollect; | |||
| import org.jeecg.modules.popularizeCollect.service.IPopularizeCollectService; | |||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
| import com.baomidou.mybatisplus.core.metadata.IPage; | |||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.jeecgframework.poi.excel.ExcelImportUtil; | |||
| import org.jeecgframework.poi.excel.def.NormalExcelConstants; | |||
| import org.jeecgframework.poi.excel.entity.ExportParams; | |||
| import org.jeecgframework.poi.excel.entity.ImportParams; | |||
| import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | |||
| import org.jeecg.common.system.base.controller.JeecgController; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import org.springframework.web.multipart.MultipartFile; | |||
| import org.springframework.web.multipart.MultipartHttpServletRequest; | |||
| import org.springframework.web.servlet.ModelAndView; | |||
| import com.alibaba.fastjson.JSON; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.jeecg.common.aspect.annotation.AutoLog; | |||
| /** | |||
| * @Description: 用户收藏 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Api(tags="用户收藏") | |||
| @RestController | |||
| @RequestMapping("/popularizeCollect/popularizeCollect") | |||
| @Slf4j | |||
| public class PopularizeCollectController extends JeecgController<PopularizeCollect, IPopularizeCollectService> { | |||
| @Autowired | |||
| private IPopularizeCollectService popularizeCollectService; | |||
| /** | |||
| * 分页列表查询 | |||
| * | |||
| * @param popularizeCollect | |||
| * @param pageNo | |||
| * @param pageSize | |||
| * @param req | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "用户收藏-分页列表查询") | |||
| @ApiOperation(value="用户收藏-分页列表查询", notes="用户收藏-分页列表查询") | |||
| @GetMapping(value = "/list") | |||
| public Result<IPage<PopularizeCollect>> queryPageList(PopularizeCollect popularizeCollect, | |||
| @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | |||
| @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | |||
| HttpServletRequest req) { | |||
| QueryWrapper<PopularizeCollect> queryWrapper = QueryGenerator.initQueryWrapper(popularizeCollect, req.getParameterMap()); | |||
| Page<PopularizeCollect> page = new Page<PopularizeCollect>(pageNo, pageSize); | |||
| IPage<PopularizeCollect> pageList = popularizeCollectService.page(page, queryWrapper); | |||
| return Result.OK(pageList); | |||
| } | |||
| /** | |||
| * 添加 | |||
| * | |||
| * @param popularizeCollect | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "用户收藏-添加") | |||
| @ApiOperation(value="用户收藏-添加", notes="用户收藏-添加") | |||
| @PostMapping(value = "/add") | |||
| public Result<String> add(@RequestBody PopularizeCollect popularizeCollect) { | |||
| popularizeCollectService.save(popularizeCollect); | |||
| return Result.OK("添加成功!"); | |||
| } | |||
| /** | |||
| * 编辑 | |||
| * | |||
| * @param popularizeCollect | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "用户收藏-编辑") | |||
| @ApiOperation(value="用户收藏-编辑", notes="用户收藏-编辑") | |||
| @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) | |||
| public Result<String> edit(@RequestBody PopularizeCollect popularizeCollect) { | |||
| popularizeCollectService.updateById(popularizeCollect); | |||
| return Result.OK("编辑成功!"); | |||
| } | |||
| /** | |||
| * 通过id删除 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "用户收藏-通过id删除") | |||
| @ApiOperation(value="用户收藏-通过id删除", notes="用户收藏-通过id删除") | |||
| @DeleteMapping(value = "/delete") | |||
| public Result<String> delete(@RequestParam(name="id",required=true) String id) { | |||
| popularizeCollectService.removeById(id); | |||
| return Result.OK("删除成功!"); | |||
| } | |||
| /** | |||
| * 批量删除 | |||
| * | |||
| * @param ids | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "用户收藏-批量删除") | |||
| @ApiOperation(value="用户收藏-批量删除", notes="用户收藏-批量删除") | |||
| @DeleteMapping(value = "/deleteBatch") | |||
| public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | |||
| this.popularizeCollectService.removeByIds(Arrays.asList(ids.split(","))); | |||
| return Result.OK("批量删除成功!"); | |||
| } | |||
| /** | |||
| * 通过id查询 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "用户收藏-通过id查询") | |||
| @ApiOperation(value="用户收藏-通过id查询", notes="用户收藏-通过id查询") | |||
| @GetMapping(value = "/queryById") | |||
| public Result<PopularizeCollect> queryById(@RequestParam(name="id",required=true) String id) { | |||
| PopularizeCollect popularizeCollect = popularizeCollectService.getById(id); | |||
| if(popularizeCollect==null) { | |||
| return Result.error("未找到对应数据"); | |||
| } | |||
| return Result.OK(popularizeCollect); | |||
| } | |||
| /** | |||
| * 导出excel | |||
| * | |||
| * @param request | |||
| * @param popularizeCollect | |||
| */ | |||
| @RequestMapping(value = "/exportXls") | |||
| public ModelAndView exportXls(HttpServletRequest request, PopularizeCollect popularizeCollect) { | |||
| return super.exportXls(request, popularizeCollect, PopularizeCollect.class, "用户收藏"); | |||
| } | |||
| /** | |||
| * 通过excel导入数据 | |||
| * | |||
| * @param request | |||
| * @param response | |||
| * @return | |||
| */ | |||
| @RequestMapping(value = "/importExcel", method = RequestMethod.POST) | |||
| public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | |||
| return super.importExcel(request, response, PopularizeCollect.class); | |||
| } | |||
| } | |||
| @ -0,0 +1,66 @@ | |||
| package org.jeecg.modules.popularizeCollect.entity; | |||
| import java.io.Serializable; | |||
| import java.io.UnsupportedEncodingException; | |||
| import java.util.Date; | |||
| import java.math.BigDecimal; | |||
| import com.baomidou.mybatisplus.annotation.IdType; | |||
| import com.baomidou.mybatisplus.annotation.TableId; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import lombok.Data; | |||
| import com.fasterxml.jackson.annotation.JsonFormat; | |||
| import org.springframework.format.annotation.DateTimeFormat; | |||
| import org.jeecgframework.poi.excel.annotation.Excel; | |||
| import org.jeecg.common.aspect.annotation.Dict; | |||
| import io.swagger.annotations.ApiModel; | |||
| import io.swagger.annotations.ApiModelProperty; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.experimental.Accessors; | |||
| /** | |||
| * @Description: 用户收藏 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Data | |||
| @TableName("popularize_collect") | |||
| @Accessors(chain = true) | |||
| @EqualsAndHashCode(callSuper = false) | |||
| @ApiModel(value="popularize_collect对象", description="用户收藏") | |||
| public class PopularizeCollect implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| /**主键*/ | |||
| @TableId(type = IdType.ASSIGN_ID) | |||
| @ApiModelProperty(value = "主键") | |||
| private java.lang.String id; | |||
| /**创建人*/ | |||
| @ApiModelProperty(value = "创建人") | |||
| private java.lang.String createBy; | |||
| /**创建日期*/ | |||
| @ApiModelProperty(value = "创建日期") | |||
| private java.util.Date createTime; | |||
| /**更新人*/ | |||
| @ApiModelProperty(value = "更新人") | |||
| private java.lang.String updateBy; | |||
| /**更新日期*/ | |||
| @ApiModelProperty(value = "更新日期") | |||
| private java.util.Date updateTime; | |||
| /**类型*/ | |||
| @Excel(name = "类型", width = 15) | |||
| @ApiModelProperty(value = "类型") | |||
| private java.lang.String type; | |||
| /**用户*/ | |||
| @Excel(name = "用户", width = 15) | |||
| @ApiModelProperty(value = "用户") | |||
| private java.lang.String userId; | |||
| /**旅行标题*/ | |||
| @Excel(name = "旅行标题", width = 15) | |||
| @ApiModelProperty(value = "旅行标题") | |||
| private java.lang.String travelId; | |||
| /**活动标题*/ | |||
| @Excel(name = "活动标题", width = 15) | |||
| @ApiModelProperty(value = "活动标题") | |||
| private java.lang.String activityId; | |||
| } | |||
| @ -0,0 +1,17 @@ | |||
| package org.jeecg.modules.popularizeCollect.mapper; | |||
| import java.util.List; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import org.jeecg.modules.popularizeCollect.entity.PopularizeCollect; | |||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
| /** | |||
| * @Description: 用户收藏 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface PopularizeCollectMapper extends BaseMapper<PopularizeCollect> { | |||
| } | |||
| @ -0,0 +1,5 @@ | |||
| <?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="org.jeecg.modules.popularizeCollect.mapper.PopularizeCollectMapper"> | |||
| </mapper> | |||
| @ -0,0 +1,14 @@ | |||
| package org.jeecg.modules.popularizeCollect.service; | |||
| import org.jeecg.modules.popularizeCollect.entity.PopularizeCollect; | |||
| import com.baomidou.mybatisplus.extension.service.IService; | |||
| /** | |||
| * @Description: 用户收藏 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface IPopularizeCollectService extends IService<PopularizeCollect> { | |||
| } | |||
| @ -0,0 +1,19 @@ | |||
| package org.jeecg.modules.popularizeCollect.service.impl; | |||
| import org.jeecg.modules.popularizeCollect.entity.PopularizeCollect; | |||
| import org.jeecg.modules.popularizeCollect.mapper.PopularizeCollectMapper; | |||
| import org.jeecg.modules.popularizeCollect.service.IPopularizeCollectService; | |||
| import org.springframework.stereotype.Service; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| /** | |||
| * @Description: 用户收藏 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Service | |||
| public class PopularizeCollectServiceImpl extends ServiceImpl<PopularizeCollectMapper, PopularizeCollect> implements IPopularizeCollectService { | |||
| } | |||
| @ -0,0 +1,189 @@ | |||
| <template> | |||
| <a-card :bordered="false"> | |||
| <!-- 查询区域 --> | |||
| <div class="table-page-search-wrapper"> | |||
| <a-form layout="inline" @keyup.enter.native="searchQuery"> | |||
| <a-row :gutter="24"> | |||
| </a-row> | |||
| </a-form> | |||
| </div> | |||
| <!-- 查询区域-END --> | |||
| <!-- 操作按钮区域 --> | |||
| <div class="table-operator"> | |||
| <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> | |||
| <a-button type="primary" icon="download" @click="handleExportXls('用户收藏')">导出</a-button> | |||
| <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | |||
| <a-button type="primary" icon="import">导入</a-button> | |||
| </a-upload> | |||
| <!-- 高级查询区域 --> | |||
| <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> | |||
| <a-dropdown v-if="selectedRowKeys.length > 0"> | |||
| <a-menu slot="overlay"> | |||
| <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> | |||
| </a-menu> | |||
| <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> | |||
| </a-dropdown> | |||
| </div> | |||
| <!-- table区域-begin --> | |||
| <div> | |||
| <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |||
| <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 | |||
| <a style="margin-left: 24px" @click="onClearSelected">清空</a> | |||
| </div> | |||
| <a-table | |||
| ref="table" | |||
| size="middle" | |||
| :scroll="{x:true}" | |||
| bordered | |||
| rowKey="id" | |||
| :columns="columns" | |||
| :dataSource="dataSource" | |||
| :pagination="ipagination" | |||
| :loading="loading" | |||
| :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" | |||
| class="j-table-force-nowrap" | |||
| @change="handleTableChange"> | |||
| <template slot="htmlSlot" slot-scope="text"> | |||
| <div v-html="text"></div> | |||
| </template> | |||
| <template slot="imgSlot" slot-scope="text,record"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | |||
| <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> | |||
| </template> | |||
| <template slot="fileSlot" slot-scope="text"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |||
| <a-button | |||
| v-else | |||
| :ghost="true" | |||
| type="primary" | |||
| icon="download" | |||
| size="small" | |||
| @click="downloadFile(text)"> | |||
| 下载 | |||
| </a-button> | |||
| </template> | |||
| <span slot="action" slot-scope="text, record"> | |||
| <a @click="handleEdit(record)">编辑</a> | |||
| <a-divider type="vertical" /> | |||
| <a-dropdown> | |||
| <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> | |||
| <a-menu slot="overlay"> | |||
| <a-menu-item> | |||
| <a @click="handleDetail(record)">详情</a> | |||
| </a-menu-item> | |||
| <a-menu-item> | |||
| <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | |||
| <a>删除</a> | |||
| </a-popconfirm> | |||
| </a-menu-item> | |||
| </a-menu> | |||
| </a-dropdown> | |||
| </span> | |||
| </a-table> | |||
| </div> | |||
| <popularize-collect-modal ref="modalForm" @ok="modalFormOk"></popularize-collect-modal> | |||
| </a-card> | |||
| </template> | |||
| <script> | |||
| import '@/assets/less/TableExpand.less' | |||
| import { mixinDevice } from '@/utils/mixin' | |||
| import { JeecgListMixin } from '@/mixins/JeecgListMixin' | |||
| import PopularizeCollectModal from './modules/PopularizeCollectModal' | |||
| export default { | |||
| name: 'PopularizeCollectList', | |||
| mixins:[JeecgListMixin, mixinDevice], | |||
| components: { | |||
| PopularizeCollectModal | |||
| }, | |||
| data () { | |||
| return { | |||
| description: '用户收藏管理页面', | |||
| // 表头 | |||
| columns: [ | |||
| { | |||
| title: '#', | |||
| dataIndex: '', | |||
| key:'rowIndex', | |||
| width:60, | |||
| align:"center", | |||
| customRender:function (t,r,index) { | |||
| return parseInt(index)+1; | |||
| } | |||
| }, | |||
| { | |||
| title:'类型', | |||
| align:"center", | |||
| dataIndex: 'type' | |||
| }, | |||
| { | |||
| title:'用户', | |||
| align:"center", | |||
| dataIndex: 'userId' | |||
| }, | |||
| { | |||
| title:'旅行标题', | |||
| align:"center", | |||
| dataIndex: 'travelId' | |||
| }, | |||
| { | |||
| title:'活动标题', | |||
| align:"center", | |||
| dataIndex: 'activityId' | |||
| }, | |||
| { | |||
| title: '操作', | |||
| dataIndex: 'action', | |||
| align:"center", | |||
| fixed:"right", | |||
| width:147, | |||
| scopedSlots: { customRender: 'action' } | |||
| } | |||
| ], | |||
| url: { | |||
| list: "/popularizeCollect/popularizeCollect/list", | |||
| delete: "/popularizeCollect/popularizeCollect/delete", | |||
| deleteBatch: "/popularizeCollect/popularizeCollect/deleteBatch", | |||
| exportXlsUrl: "/popularizeCollect/popularizeCollect/exportXls", | |||
| importExcelUrl: "popularizeCollect/popularizeCollect/importExcel", | |||
| }, | |||
| dictOptions:{}, | |||
| superFieldList:[], | |||
| } | |||
| }, | |||
| created() { | |||
| this.getSuperFieldList(); | |||
| }, | |||
| computed: { | |||
| importExcelUrl: function(){ | |||
| return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | |||
| }, | |||
| }, | |||
| methods: { | |||
| initDictConfig(){ | |||
| }, | |||
| getSuperFieldList(){ | |||
| let fieldList=[]; | |||
| fieldList.push({type:'string',value:'type',text:'类型',dictCode:''}) | |||
| fieldList.push({type:'string',value:'userId',text:'用户',dictCode:''}) | |||
| fieldList.push({type:'string',value:'travelId',text:'旅行标题',dictCode:''}) | |||
| fieldList.push({type:'string',value:'activityId',text:'活动标题',dictCode:''}) | |||
| this.superFieldList = fieldList | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| @import '~@assets/less/common.less'; | |||
| </style> | |||
| @ -0,0 +1,119 @@ | |||
| <template> | |||
| <a-spin :spinning="confirmLoading"> | |||
| <j-form-container :disabled="formDisabled"> | |||
| <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> | |||
| <a-row> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type"> | |||
| <a-input v-model="model.type" placeholder="请输入类型" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="用户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userId"> | |||
| <a-input v-model="model.userId" placeholder="请输入用户" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="旅行标题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="travelId"> | |||
| <a-input v-model="model.travelId" placeholder="请输入旅行标题" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="活动标题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="activityId"> | |||
| <a-input v-model="model.activityId" placeholder="请输入活动标题" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| </a-row> | |||
| </a-form-model> | |||
| </j-form-container> | |||
| </a-spin> | |||
| </template> | |||
| <script> | |||
| import { httpAction, getAction } from '@/api/manage' | |||
| import { validateDuplicateValue } from '@/utils/util' | |||
| export default { | |||
| name: 'PopularizeCollectForm', | |||
| components: { | |||
| }, | |||
| props: { | |||
| //表单禁用 | |||
| disabled: { | |||
| type: Boolean, | |||
| default: false, | |||
| required: false | |||
| } | |||
| }, | |||
| data () { | |||
| return { | |||
| model:{ | |||
| }, | |||
| labelCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 5 }, | |||
| }, | |||
| wrapperCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 16 }, | |||
| }, | |||
| confirmLoading: false, | |||
| validatorRules: { | |||
| }, | |||
| url: { | |||
| add: "/popularizeCollect/popularizeCollect/add", | |||
| edit: "/popularizeCollect/popularizeCollect/edit", | |||
| queryById: "/popularizeCollect/popularizeCollect/queryById" | |||
| } | |||
| } | |||
| }, | |||
| computed: { | |||
| formDisabled(){ | |||
| return this.disabled | |||
| }, | |||
| }, | |||
| created () { | |||
| //备份model原始值 | |||
| this.modelDefault = JSON.parse(JSON.stringify(this.model)); | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.edit(this.modelDefault); | |||
| }, | |||
| edit (record) { | |||
| this.model = Object.assign({}, record); | |||
| this.visible = true; | |||
| }, | |||
| submitForm () { | |||
| const that = this; | |||
| // 触发表单验证 | |||
| this.$refs.form.validate(valid => { | |||
| if (valid) { | |||
| that.confirmLoading = true; | |||
| let httpurl = ''; | |||
| let method = ''; | |||
| if(!this.model.id){ | |||
| httpurl+=this.url.add; | |||
| method = 'post'; | |||
| }else{ | |||
| httpurl+=this.url.edit; | |||
| method = 'put'; | |||
| } | |||
| httpAction(httpurl,this.model,method).then((res)=>{ | |||
| if(res.success){ | |||
| that.$message.success(res.message); | |||
| that.$emit('ok'); | |||
| }else{ | |||
| that.$message.warning(res.message); | |||
| } | |||
| }).finally(() => { | |||
| that.confirmLoading = false; | |||
| }) | |||
| } | |||
| }) | |||
| }, | |||
| } | |||
| } | |||
| </script> | |||
| @ -0,0 +1,84 @@ | |||
| <template> | |||
| <a-drawer | |||
| :title="title" | |||
| :width="width" | |||
| placement="right" | |||
| :closable="false" | |||
| @close="close" | |||
| destroyOnClose | |||
| :visible="visible"> | |||
| <popularize-collect-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></popularize-collect-form> | |||
| <div class="drawer-footer"> | |||
| <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> | |||
| <a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> | |||
| </div> | |||
| </a-drawer> | |||
| </template> | |||
| <script> | |||
| import PopularizeCollectForm from './PopularizeCollectForm' | |||
| export default { | |||
| name: 'PopularizeCollectModal', | |||
| components: { | |||
| PopularizeCollectForm | |||
| }, | |||
| data () { | |||
| return { | |||
| title:"操作", | |||
| width:800, | |||
| visible: false, | |||
| disableSubmit: false | |||
| } | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.add(); | |||
| }) | |||
| }, | |||
| edit (record) { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.edit(record); | |||
| }); | |||
| }, | |||
| close () { | |||
| this.$emit('close'); | |||
| this.visible = false; | |||
| }, | |||
| submitCallback(){ | |||
| this.$emit('ok'); | |||
| this.visible = false; | |||
| }, | |||
| handleOk () { | |||
| this.$refs.realForm.submitForm(); | |||
| }, | |||
| handleCancel () { | |||
| this.close() | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| <style lang="less" scoped> | |||
| /** Button按钮间距 */ | |||
| .ant-btn { | |||
| margin-left: 30px; | |||
| margin-bottom: 30px; | |||
| float: right; | |||
| } | |||
| .drawer-footer{ | |||
| position: absolute; | |||
| bottom: -8px; | |||
| width: 100%; | |||
| border-top: 1px solid #e8e8e8; | |||
| padding: 10px 16px; | |||
| text-align: right; | |||
| left: 0; | |||
| background: #fff; | |||
| border-radius: 0 0 2px 2px; | |||
| } | |||
| </style> | |||
| @ -0,0 +1,60 @@ | |||
| <template> | |||
| <j-modal | |||
| :title="title" | |||
| :width="width" | |||
| :visible="visible" | |||
| switchFullscreen | |||
| @ok="handleOk" | |||
| :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" | |||
| @cancel="handleCancel" | |||
| cancelText="关闭"> | |||
| <popularize-collect-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></popularize-collect-form> | |||
| </j-modal> | |||
| </template> | |||
| <script> | |||
| import PopularizeCollectForm from './PopularizeCollectForm' | |||
| export default { | |||
| name: 'PopularizeCollectModal', | |||
| components: { | |||
| PopularizeCollectForm | |||
| }, | |||
| data () { | |||
| return { | |||
| title:'', | |||
| width:800, | |||
| visible: false, | |||
| disableSubmit: false | |||
| } | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.add(); | |||
| }) | |||
| }, | |||
| edit (record) { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.edit(record); | |||
| }) | |||
| }, | |||
| close () { | |||
| this.$emit('close'); | |||
| this.visible = false; | |||
| }, | |||
| handleOk () { | |||
| this.$refs.realForm.submitForm(); | |||
| }, | |||
| submitCallback(){ | |||
| this.$emit('ok'); | |||
| this.visible = false; | |||
| }, | |||
| handleCancel () { | |||
| this.close() | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| @ -0,0 +1,61 @@ | |||
| import {defHttp} from '/@/utils/http/axios'; | |||
| import {Modal} from 'ant-design-vue'; | |||
| enum Api { | |||
| list = '/popularizeCollect/popularizeCollect/list', | |||
| save='/popularizeCollect/popularizeCollect/add', | |||
| edit='/popularizeCollect/popularizeCollect/edit', | |||
| deleteOne = '/popularizeCollect/popularizeCollect/delete', | |||
| deleteBatch = '/popularizeCollect/popularizeCollect/deleteBatch', | |||
| importExcel = '/popularizeCollect/popularizeCollect/importExcel', | |||
| exportXls = '/popularizeCollect/popularizeCollect/exportXls', | |||
| } | |||
| /** | |||
| * 导出api | |||
| * @param params | |||
| */ | |||
| export const getExportUrl = Api.exportXls; | |||
| /** | |||
| * 导入api | |||
| */ | |||
| export const getImportUrl = Api.importExcel; | |||
| /** | |||
| * 列表接口 | |||
| * @param params | |||
| */ | |||
| export const list = (params) => | |||
| defHttp.get({url: Api.list, params}); | |||
| /** | |||
| * 删除单个 | |||
| */ | |||
| export const deleteOne = (params,handleSuccess) => { | |||
| return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { | |||
| handleSuccess(); | |||
| }); | |||
| } | |||
| /** | |||
| * 批量删除 | |||
| * @param params | |||
| */ | |||
| export const batchDelete = (params, handleSuccess) => { | |||
| Modal.confirm({ | |||
| title: '确认删除', | |||
| content: '是否删除选中数据', | |||
| okText: '确认', | |||
| cancelText: '取消', | |||
| onOk: () => { | |||
| return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { | |||
| handleSuccess(); | |||
| }); | |||
| } | |||
| }); | |||
| } | |||
| /** | |||
| * 保存或者更新 | |||
| * @param params | |||
| */ | |||
| export const saveOrUpdate = (params, isUpdate) => { | |||
| let url = isUpdate ? Api.edit : Api.save; | |||
| return defHttp.post({url: url, params}); | |||
| } | |||
| @ -0,0 +1,53 @@ | |||
| import {BasicColumn} from '/@/components/Table'; | |||
| import {FormSchema} from '/@/components/Table'; | |||
| import { rules} from '/@/utils/helper/validator'; | |||
| import { render } from '/@/utils/common/renderUtils'; | |||
| //列表数据 | |||
| export const columns: BasicColumn[] = [ | |||
| { | |||
| title: '类型', | |||
| align:"center", | |||
| dataIndex: 'type' | |||
| }, | |||
| { | |||
| title: '用户', | |||
| align:"center", | |||
| dataIndex: 'userId' | |||
| }, | |||
| { | |||
| title: '旅行标题', | |||
| align:"center", | |||
| dataIndex: 'travelId' | |||
| }, | |||
| { | |||
| title: '活动标题', | |||
| align:"center", | |||
| dataIndex: 'activityId' | |||
| }, | |||
| ]; | |||
| //查询数据 | |||
| export const searchFormSchema: FormSchema[] = [ | |||
| ]; | |||
| //表单数据 | |||
| export const formSchema: FormSchema[] = [ | |||
| { | |||
| label: '类型', | |||
| field: 'type', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '用户', | |||
| field: 'userId', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '旅行标题', | |||
| field: 'travelId', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '活动标题', | |||
| field: 'activityId', | |||
| component: 'Input', | |||
| }, | |||
| ]; | |||
| @ -0,0 +1,162 @@ | |||
| <template> | |||
| <div> | |||
| <!--引用表格--> | |||
| <BasicTable @register="registerTable" :rowSelection="rowSelection"> | |||
| <!--插槽:table标题--> | |||
| <template #tableTitle> | |||
| <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button> | |||
| <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button> | |||
| <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button> | |||
| <a-dropdown v-if="checkedKeys.length > 0"> | |||
| <template #overlay> | |||
| <a-menu> | |||
| <a-menu-item key="1" @click="batchHandleDelete"> | |||
| <Icon icon="ant-design:delete-outlined"></Icon> | |||
| 删除 | |||
| </a-menu-item> | |||
| </a-menu> | |||
| </template> | |||
| <a-button>批量操作 | |||
| <Icon icon="mdi:chevron-down"></Icon> | |||
| </a-button> | |||
| </a-dropdown> | |||
| </template> | |||
| <!--操作栏--> | |||
| <template #action="{ record }"> | |||
| <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/> | |||
| </template> | |||
| <!--字段回显插槽--> | |||
| <template #htmlSlot="{text}"> | |||
| <div v-html="text"></div> | |||
| </template> | |||
| <template #fileSlot="{text}"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |||
| <a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button> | |||
| </template> | |||
| </BasicTable> | |||
| <!-- 表单区域 --> | |||
| <PopularizeCollectModal @register="registerModal" @success="handleSuccess"></PopularizeCollectModal> | |||
| </div> | |||
| </template> | |||
| <script lang="ts" name="popularizeCollect-popularizeCollect" setup> | |||
| import {ref, computed, unref} from 'vue'; | |||
| import {BasicTable, useTable, TableAction} from '/@/components/Table'; | |||
| import {useModal} from '/@/components/Modal'; | |||
| import { useListPage } from '/@/hooks/system/useListPage' | |||
| import PopularizeCollectModal from './components/PopularizeCollectModal.vue' | |||
| import {columns, searchFormSchema} from './popularizeCollect.data'; | |||
| import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './popularizeCollect.api'; | |||
| const checkedKeys = ref<Array<string | number>>([]); | |||
| //注册model | |||
| const [registerModal, {openModal}] = useModal(); | |||
| //注册table数据 | |||
| const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({ | |||
| tableProps:{ | |||
| title: '用户收藏', | |||
| api: list, | |||
| columns, | |||
| canResize:false, | |||
| formConfig: { | |||
| labelWidth: 120, | |||
| schemas: searchFormSchema, | |||
| autoSubmitOnEnter:true, | |||
| showAdvancedButton:true, | |||
| fieldMapToTime: [ | |||
| ], | |||
| }, | |||
| actionColumn: { | |||
| width: 120, | |||
| }, | |||
| }, | |||
| exportConfig: { | |||
| name:"用户收藏", | |||
| url: getExportUrl, | |||
| }, | |||
| importConfig: { | |||
| url: getImportUrl | |||
| }, | |||
| }) | |||
| const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext | |||
| /** | |||
| * 新增事件 | |||
| */ | |||
| function handleAdd() { | |||
| openModal(true, { | |||
| isUpdate: false, | |||
| showFooter: true, | |||
| }); | |||
| } | |||
| /** | |||
| * 编辑事件 | |||
| */ | |||
| function handleEdit(record: Recordable) { | |||
| openModal(true, { | |||
| record, | |||
| isUpdate: true, | |||
| showFooter: true, | |||
| }); | |||
| } | |||
| /** | |||
| * 详情 | |||
| */ | |||
| function handleDetail(record: Recordable) { | |||
| openModal(true, { | |||
| record, | |||
| isUpdate: true, | |||
| showFooter: false, | |||
| }); | |||
| } | |||
| /** | |||
| * 删除事件 | |||
| */ | |||
| async function handleDelete(record) { | |||
| await deleteOne({id: record.id}, reload); | |||
| } | |||
| /** | |||
| * 批量删除事件 | |||
| */ | |||
| async function batchHandleDelete() { | |||
| await batchDelete({ids: checkedKeys.value}, reload); | |||
| } | |||
| /** | |||
| * 成功回调 | |||
| */ | |||
| function handleSuccess() { | |||
| reload(); | |||
| } | |||
| /** | |||
| * 操作栏 | |||
| */ | |||
| function getTableAction(record){ | |||
| return [ | |||
| { | |||
| label: '编辑', | |||
| onClick: handleEdit.bind(null, record), | |||
| } | |||
| ] | |||
| } | |||
| /** | |||
| * 下拉操作栏 | |||
| */ | |||
| function getDropDownAction(record){ | |||
| return [ | |||
| { | |||
| label: '详情', | |||
| onClick: handleDetail.bind(null, record), | |||
| }, { | |||
| label: '删除', | |||
| popConfirm: { | |||
| title: '是否确认删除', | |||
| confirm: handleDelete.bind(null, record), | |||
| } | |||
| } | |||
| ] | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| </style> | |||
| @ -0,0 +1,58 @@ | |||
| <template> | |||
| <BasicModal v-bind="$attrs" @register="registerModal" :title="title" @ok="handleSubmit"> | |||
| <BasicForm @register="registerForm"/> | |||
| </BasicModal> | |||
| </template> | |||
| <script lang="ts" setup> | |||
| import {ref, computed, unref} from 'vue'; | |||
| import {BasicModal, useModalInner} from '/@/components/Modal'; | |||
| import {BasicForm, useForm} from '/@/components/Form/index'; | |||
| import {formSchema} from '../popularizeCollect.data'; | |||
| import {saveOrUpdate} from '../popularizeCollect.api'; | |||
| // Emits声明 | |||
| const emit = defineEmits(['register','success']); | |||
| const isUpdate = ref(true); | |||
| //表单配置 | |||
| const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({ | |||
| labelWidth: 150, | |||
| schemas: formSchema, | |||
| showActionButtonGroup: false, | |||
| }); | |||
| //表单赋值 | |||
| const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => { | |||
| //重置表单 | |||
| await resetFields(); | |||
| setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter}); | |||
| isUpdate.value = !!data?.isUpdate; | |||
| if (unref(isUpdate)) { | |||
| //表单赋值 | |||
| await setFieldsValue({ | |||
| ...data.record, | |||
| }); | |||
| } | |||
| // 隐藏底部时禁用整个表单 | |||
| setProps({ disabled: !data?.showFooter }) | |||
| }); | |||
| //设置标题 | |||
| const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑')); | |||
| //表单提交事件 | |||
| async function handleSubmit(v) { | |||
| try { | |||
| let values = await validate(); | |||
| setModalProps({confirmLoading: true}); | |||
| //提交表单 | |||
| await saveOrUpdate(values, isUpdate.value); | |||
| //关闭弹窗 | |||
| closeModal(); | |||
| //刷新列表 | |||
| emit('success'); | |||
| } finally { | |||
| setModalProps({confirmLoading: false}); | |||
| } | |||
| } | |||
| </script> | |||
| <style lang="less" scoped> | |||
| </style> | |||
| @ -0,0 +1,171 @@ | |||
| package org.jeecg.modules.popularizeCountry.controller; | |||
| import java.util.Arrays; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import java.util.stream.Collectors; | |||
| import java.io.IOException; | |||
| import java.io.UnsupportedEncodingException; | |||
| import java.net.URLDecoder; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import org.jeecg.common.api.vo.Result; | |||
| import org.jeecg.common.system.query.QueryGenerator; | |||
| import org.jeecg.common.util.oConvertUtils; | |||
| import org.jeecg.modules.popularizeCountry.entity.PopularizeCountry; | |||
| import org.jeecg.modules.popularizeCountry.service.IPopularizeCountryService; | |||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
| import com.baomidou.mybatisplus.core.metadata.IPage; | |||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.jeecgframework.poi.excel.ExcelImportUtil; | |||
| import org.jeecgframework.poi.excel.def.NormalExcelConstants; | |||
| import org.jeecgframework.poi.excel.entity.ExportParams; | |||
| import org.jeecgframework.poi.excel.entity.ImportParams; | |||
| import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | |||
| import org.jeecg.common.system.base.controller.JeecgController; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import org.springframework.web.multipart.MultipartFile; | |||
| import org.springframework.web.multipart.MultipartHttpServletRequest; | |||
| import org.springframework.web.servlet.ModelAndView; | |||
| import com.alibaba.fastjson.JSON; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.jeecg.common.aspect.annotation.AutoLog; | |||
| /** | |||
| * @Description: 国籍管理 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Api(tags="国籍管理") | |||
| @RestController | |||
| @RequestMapping("/popularizeCountry/popularizeCountry") | |||
| @Slf4j | |||
| public class PopularizeCountryController extends JeecgController<PopularizeCountry, IPopularizeCountryService> { | |||
| @Autowired | |||
| private IPopularizeCountryService popularizeCountryService; | |||
| /** | |||
| * 分页列表查询 | |||
| * | |||
| * @param popularizeCountry | |||
| * @param pageNo | |||
| * @param pageSize | |||
| * @param req | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "国籍管理-分页列表查询") | |||
| @ApiOperation(value="国籍管理-分页列表查询", notes="国籍管理-分页列表查询") | |||
| @GetMapping(value = "/list") | |||
| public Result<IPage<PopularizeCountry>> queryPageList(PopularizeCountry popularizeCountry, | |||
| @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | |||
| @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | |||
| HttpServletRequest req) { | |||
| QueryWrapper<PopularizeCountry> queryWrapper = QueryGenerator.initQueryWrapper(popularizeCountry, req.getParameterMap()); | |||
| Page<PopularizeCountry> page = new Page<PopularizeCountry>(pageNo, pageSize); | |||
| IPage<PopularizeCountry> pageList = popularizeCountryService.page(page, queryWrapper); | |||
| return Result.OK(pageList); | |||
| } | |||
| /** | |||
| * 添加 | |||
| * | |||
| * @param popularizeCountry | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "国籍管理-添加") | |||
| @ApiOperation(value="国籍管理-添加", notes="国籍管理-添加") | |||
| @PostMapping(value = "/add") | |||
| public Result<String> add(@RequestBody PopularizeCountry popularizeCountry) { | |||
| popularizeCountryService.save(popularizeCountry); | |||
| return Result.OK("添加成功!"); | |||
| } | |||
| /** | |||
| * 编辑 | |||
| * | |||
| * @param popularizeCountry | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "国籍管理-编辑") | |||
| @ApiOperation(value="国籍管理-编辑", notes="国籍管理-编辑") | |||
| @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) | |||
| public Result<String> edit(@RequestBody PopularizeCountry popularizeCountry) { | |||
| popularizeCountryService.updateById(popularizeCountry); | |||
| return Result.OK("编辑成功!"); | |||
| } | |||
| /** | |||
| * 通过id删除 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "国籍管理-通过id删除") | |||
| @ApiOperation(value="国籍管理-通过id删除", notes="国籍管理-通过id删除") | |||
| @DeleteMapping(value = "/delete") | |||
| public Result<String> delete(@RequestParam(name="id",required=true) String id) { | |||
| popularizeCountryService.removeById(id); | |||
| return Result.OK("删除成功!"); | |||
| } | |||
| /** | |||
| * 批量删除 | |||
| * | |||
| * @param ids | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "国籍管理-批量删除") | |||
| @ApiOperation(value="国籍管理-批量删除", notes="国籍管理-批量删除") | |||
| @DeleteMapping(value = "/deleteBatch") | |||
| public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | |||
| this.popularizeCountryService.removeByIds(Arrays.asList(ids.split(","))); | |||
| return Result.OK("批量删除成功!"); | |||
| } | |||
| /** | |||
| * 通过id查询 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "国籍管理-通过id查询") | |||
| @ApiOperation(value="国籍管理-通过id查询", notes="国籍管理-通过id查询") | |||
| @GetMapping(value = "/queryById") | |||
| public Result<PopularizeCountry> queryById(@RequestParam(name="id",required=true) String id) { | |||
| PopularizeCountry popularizeCountry = popularizeCountryService.getById(id); | |||
| if(popularizeCountry==null) { | |||
| return Result.error("未找到对应数据"); | |||
| } | |||
| return Result.OK(popularizeCountry); | |||
| } | |||
| /** | |||
| * 导出excel | |||
| * | |||
| * @param request | |||
| * @param popularizeCountry | |||
| */ | |||
| @RequestMapping(value = "/exportXls") | |||
| public ModelAndView exportXls(HttpServletRequest request, PopularizeCountry popularizeCountry) { | |||
| return super.exportXls(request, popularizeCountry, PopularizeCountry.class, "国籍管理"); | |||
| } | |||
| /** | |||
| * 通过excel导入数据 | |||
| * | |||
| * @param request | |||
| * @param response | |||
| * @return | |||
| */ | |||
| @RequestMapping(value = "/importExcel", method = RequestMethod.POST) | |||
| public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | |||
| return super.importExcel(request, response, PopularizeCountry.class); | |||
| } | |||
| } | |||
| @ -0,0 +1,62 @@ | |||
| package org.jeecg.modules.popularizeCountry.entity; | |||
| import java.io.Serializable; | |||
| import java.io.UnsupportedEncodingException; | |||
| import java.util.Date; | |||
| import java.math.BigDecimal; | |||
| import com.baomidou.mybatisplus.annotation.IdType; | |||
| import com.baomidou.mybatisplus.annotation.TableId; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import lombok.Data; | |||
| import com.fasterxml.jackson.annotation.JsonFormat; | |||
| import org.springframework.format.annotation.DateTimeFormat; | |||
| import org.jeecgframework.poi.excel.annotation.Excel; | |||
| import org.jeecg.common.aspect.annotation.Dict; | |||
| import io.swagger.annotations.ApiModel; | |||
| import io.swagger.annotations.ApiModelProperty; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.experimental.Accessors; | |||
| /** | |||
| * @Description: 国籍管理 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Data | |||
| @TableName("popularize_country") | |||
| @Accessors(chain = true) | |||
| @EqualsAndHashCode(callSuper = false) | |||
| @ApiModel(value="popularize_country对象", description="国籍管理") | |||
| public class PopularizeCountry implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| /**主键*/ | |||
| @TableId(type = IdType.ASSIGN_ID) | |||
| @ApiModelProperty(value = "主键") | |||
| private java.lang.String id; | |||
| /**创建人*/ | |||
| @ApiModelProperty(value = "创建人") | |||
| private java.lang.String createBy; | |||
| /**创建日期*/ | |||
| @ApiModelProperty(value = "创建日期") | |||
| private java.util.Date createTime; | |||
| /**更新人*/ | |||
| @ApiModelProperty(value = "更新人") | |||
| private java.lang.String updateBy; | |||
| /**更新日期*/ | |||
| @ApiModelProperty(value = "更新日期") | |||
| private java.util.Date updateTime; | |||
| /**中文-国家*/ | |||
| @Excel(name = "中文-国家", width = 15) | |||
| @ApiModelProperty(value = "中文-国家") | |||
| private java.lang.String country; | |||
| /**英文-国家*/ | |||
| @Excel(name = "英文-国家", width = 15) | |||
| @ApiModelProperty(value = "英文-国家") | |||
| private java.lang.String enCountry; | |||
| /**排序*/ | |||
| @Excel(name = "排序", width = 15) | |||
| @ApiModelProperty(value = "排序") | |||
| private java.lang.Integer sort; | |||
| } | |||
| @ -0,0 +1,17 @@ | |||
| package org.jeecg.modules.popularizeCountry.mapper; | |||
| import java.util.List; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import org.jeecg.modules.popularizeCountry.entity.PopularizeCountry; | |||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
| /** | |||
| * @Description: 国籍管理 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface PopularizeCountryMapper extends BaseMapper<PopularizeCountry> { | |||
| } | |||
| @ -0,0 +1,5 @@ | |||
| <?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="org.jeecg.modules.popularizeCountry.mapper.PopularizeCountryMapper"> | |||
| </mapper> | |||
| @ -0,0 +1,14 @@ | |||
| package org.jeecg.modules.popularizeCountry.service; | |||
| import org.jeecg.modules.popularizeCountry.entity.PopularizeCountry; | |||
| import com.baomidou.mybatisplus.extension.service.IService; | |||
| /** | |||
| * @Description: 国籍管理 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface IPopularizeCountryService extends IService<PopularizeCountry> { | |||
| } | |||
| @ -0,0 +1,19 @@ | |||
| package org.jeecg.modules.popularizeCountry.service.impl; | |||
| import org.jeecg.modules.popularizeCountry.entity.PopularizeCountry; | |||
| import org.jeecg.modules.popularizeCountry.mapper.PopularizeCountryMapper; | |||
| import org.jeecg.modules.popularizeCountry.service.IPopularizeCountryService; | |||
| import org.springframework.stereotype.Service; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| /** | |||
| * @Description: 国籍管理 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Service | |||
| public class PopularizeCountryServiceImpl extends ServiceImpl<PopularizeCountryMapper, PopularizeCountry> implements IPopularizeCountryService { | |||
| } | |||
| @ -0,0 +1,203 @@ | |||
| <template> | |||
| <a-card :bordered="false"> | |||
| <!-- 查询区域 --> | |||
| <div class="table-page-search-wrapper"> | |||
| <a-form layout="inline" @keyup.enter.native="searchQuery"> | |||
| <a-row :gutter="24"> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <a-form-item label="中文-国家"> | |||
| <a-input placeholder="请输入中文-国家" v-model="queryParam.country"></a-input> | |||
| </a-form-item> | |||
| </a-col> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <a-form-item label="英文-国家"> | |||
| <a-input placeholder="请输入英文-国家" v-model="queryParam.enCountry"></a-input> | |||
| </a-form-item> | |||
| </a-col> | |||
| <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||
| <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> | |||
| <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> | |||
| <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> | |||
| <a @click="handleToggleSearch" style="margin-left: 8px"> | |||
| {{ toggleSearchStatus ? '收起' : '展开' }} | |||
| <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> | |||
| </a> | |||
| </span> | |||
| </a-col> | |||
| </a-row> | |||
| </a-form> | |||
| </div> | |||
| <!-- 查询区域-END --> | |||
| <!-- 操作按钮区域 --> | |||
| <div class="table-operator"> | |||
| <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> | |||
| <a-button type="primary" icon="download" @click="handleExportXls('国籍管理')">导出</a-button> | |||
| <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | |||
| <a-button type="primary" icon="import">导入</a-button> | |||
| </a-upload> | |||
| <!-- 高级查询区域 --> | |||
| <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> | |||
| <a-dropdown v-if="selectedRowKeys.length > 0"> | |||
| <a-menu slot="overlay"> | |||
| <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> | |||
| </a-menu> | |||
| <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> | |||
| </a-dropdown> | |||
| </div> | |||
| <!-- table区域-begin --> | |||
| <div> | |||
| <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |||
| <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 | |||
| <a style="margin-left: 24px" @click="onClearSelected">清空</a> | |||
| </div> | |||
| <a-table | |||
| ref="table" | |||
| size="middle" | |||
| :scroll="{x:true}" | |||
| bordered | |||
| rowKey="id" | |||
| :columns="columns" | |||
| :dataSource="dataSource" | |||
| :pagination="ipagination" | |||
| :loading="loading" | |||
| :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" | |||
| class="j-table-force-nowrap" | |||
| @change="handleTableChange"> | |||
| <template slot="htmlSlot" slot-scope="text"> | |||
| <div v-html="text"></div> | |||
| </template> | |||
| <template slot="imgSlot" slot-scope="text,record"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | |||
| <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> | |||
| </template> | |||
| <template slot="fileSlot" slot-scope="text"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |||
| <a-button | |||
| v-else | |||
| :ghost="true" | |||
| type="primary" | |||
| icon="download" | |||
| size="small" | |||
| @click="downloadFile(text)"> | |||
| 下载 | |||
| </a-button> | |||
| </template> | |||
| <span slot="action" slot-scope="text, record"> | |||
| <a @click="handleEdit(record)">编辑</a> | |||
| <a-divider type="vertical" /> | |||
| <a-dropdown> | |||
| <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> | |||
| <a-menu slot="overlay"> | |||
| <a-menu-item> | |||
| <a @click="handleDetail(record)">详情</a> | |||
| </a-menu-item> | |||
| <a-menu-item> | |||
| <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | |||
| <a>删除</a> | |||
| </a-popconfirm> | |||
| </a-menu-item> | |||
| </a-menu> | |||
| </a-dropdown> | |||
| </span> | |||
| </a-table> | |||
| </div> | |||
| <popularize-country-modal ref="modalForm" @ok="modalFormOk"></popularize-country-modal> | |||
| </a-card> | |||
| </template> | |||
| <script> | |||
| import '@/assets/less/TableExpand.less' | |||
| import { mixinDevice } from '@/utils/mixin' | |||
| import { JeecgListMixin } from '@/mixins/JeecgListMixin' | |||
| import PopularizeCountryModal from './modules/PopularizeCountryModal' | |||
| export default { | |||
| name: 'PopularizeCountryList', | |||
| mixins:[JeecgListMixin, mixinDevice], | |||
| components: { | |||
| PopularizeCountryModal | |||
| }, | |||
| data () { | |||
| return { | |||
| description: '国籍管理管理页面', | |||
| // 表头 | |||
| columns: [ | |||
| { | |||
| title: '#', | |||
| dataIndex: '', | |||
| key:'rowIndex', | |||
| width:60, | |||
| align:"center", | |||
| customRender:function (t,r,index) { | |||
| return parseInt(index)+1; | |||
| } | |||
| }, | |||
| { | |||
| title:'中文-国家', | |||
| align:"center", | |||
| dataIndex: 'country' | |||
| }, | |||
| { | |||
| title:'英文-国家', | |||
| align:"center", | |||
| dataIndex: 'enCountry' | |||
| }, | |||
| { | |||
| title:'排序', | |||
| align:"center", | |||
| dataIndex: 'sort' | |||
| }, | |||
| { | |||
| title: '操作', | |||
| dataIndex: 'action', | |||
| align:"center", | |||
| fixed:"right", | |||
| width:147, | |||
| scopedSlots: { customRender: 'action' } | |||
| } | |||
| ], | |||
| url: { | |||
| list: "/popularizeCountry/popularizeCountry/list", | |||
| delete: "/popularizeCountry/popularizeCountry/delete", | |||
| deleteBatch: "/popularizeCountry/popularizeCountry/deleteBatch", | |||
| exportXlsUrl: "/popularizeCountry/popularizeCountry/exportXls", | |||
| importExcelUrl: "popularizeCountry/popularizeCountry/importExcel", | |||
| }, | |||
| dictOptions:{}, | |||
| superFieldList:[], | |||
| } | |||
| }, | |||
| created() { | |||
| this.getSuperFieldList(); | |||
| }, | |||
| computed: { | |||
| importExcelUrl: function(){ | |||
| return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | |||
| }, | |||
| }, | |||
| methods: { | |||
| initDictConfig(){ | |||
| }, | |||
| getSuperFieldList(){ | |||
| let fieldList=[]; | |||
| fieldList.push({type:'string',value:'country',text:'中文-国家',dictCode:''}) | |||
| fieldList.push({type:'string',value:'enCountry',text:'英文-国家',dictCode:''}) | |||
| fieldList.push({type:'int',value:'sort',text:'排序',dictCode:''}) | |||
| this.superFieldList = fieldList | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| @import '~@assets/less/common.less'; | |||
| </style> | |||
| @ -0,0 +1,114 @@ | |||
| <template> | |||
| <a-spin :spinning="confirmLoading"> | |||
| <j-form-container :disabled="formDisabled"> | |||
| <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> | |||
| <a-row> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="中文-国家" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="country"> | |||
| <a-input v-model="model.country" placeholder="请输入中文-国家" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="英文-国家" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enCountry"> | |||
| <a-input v-model="model.enCountry" placeholder="请输入英文-国家" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24"> | |||
| <a-form-model-item label="排序" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sort"> | |||
| <a-input-number v-model="model.sort" placeholder="请输入排序" style="width: 100%" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| </a-row> | |||
| </a-form-model> | |||
| </j-form-container> | |||
| </a-spin> | |||
| </template> | |||
| <script> | |||
| import { httpAction, getAction } from '@/api/manage' | |||
| import { validateDuplicateValue } from '@/utils/util' | |||
| export default { | |||
| name: 'PopularizeCountryForm', | |||
| components: { | |||
| }, | |||
| props: { | |||
| //表单禁用 | |||
| disabled: { | |||
| type: Boolean, | |||
| default: false, | |||
| required: false | |||
| } | |||
| }, | |||
| data () { | |||
| return { | |||
| model:{ | |||
| }, | |||
| labelCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 5 }, | |||
| }, | |||
| wrapperCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 16 }, | |||
| }, | |||
| confirmLoading: false, | |||
| validatorRules: { | |||
| }, | |||
| url: { | |||
| add: "/popularizeCountry/popularizeCountry/add", | |||
| edit: "/popularizeCountry/popularizeCountry/edit", | |||
| queryById: "/popularizeCountry/popularizeCountry/queryById" | |||
| } | |||
| } | |||
| }, | |||
| computed: { | |||
| formDisabled(){ | |||
| return this.disabled | |||
| }, | |||
| }, | |||
| created () { | |||
| //备份model原始值 | |||
| this.modelDefault = JSON.parse(JSON.stringify(this.model)); | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.edit(this.modelDefault); | |||
| }, | |||
| edit (record) { | |||
| this.model = Object.assign({}, record); | |||
| this.visible = true; | |||
| }, | |||
| submitForm () { | |||
| const that = this; | |||
| // 触发表单验证 | |||
| this.$refs.form.validate(valid => { | |||
| if (valid) { | |||
| that.confirmLoading = true; | |||
| let httpurl = ''; | |||
| let method = ''; | |||
| if(!this.model.id){ | |||
| httpurl+=this.url.add; | |||
| method = 'post'; | |||
| }else{ | |||
| httpurl+=this.url.edit; | |||
| method = 'put'; | |||
| } | |||
| httpAction(httpurl,this.model,method).then((res)=>{ | |||
| if(res.success){ | |||
| that.$message.success(res.message); | |||
| that.$emit('ok'); | |||
| }else{ | |||
| that.$message.warning(res.message); | |||
| } | |||
| }).finally(() => { | |||
| that.confirmLoading = false; | |||
| }) | |||
| } | |||
| }) | |||
| }, | |||
| } | |||
| } | |||
| </script> | |||
| @ -0,0 +1,84 @@ | |||
| <template> | |||
| <a-drawer | |||
| :title="title" | |||
| :width="width" | |||
| placement="right" | |||
| :closable="false" | |||
| @close="close" | |||
| destroyOnClose | |||
| :visible="visible"> | |||
| <popularize-country-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></popularize-country-form> | |||
| <div class="drawer-footer"> | |||
| <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> | |||
| <a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> | |||
| </div> | |||
| </a-drawer> | |||
| </template> | |||
| <script> | |||
| import PopularizeCountryForm from './PopularizeCountryForm' | |||
| export default { | |||
| name: 'PopularizeCountryModal', | |||
| components: { | |||
| PopularizeCountryForm | |||
| }, | |||
| data () { | |||
| return { | |||
| title:"操作", | |||
| width:800, | |||
| visible: false, | |||
| disableSubmit: false | |||
| } | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.add(); | |||
| }) | |||
| }, | |||
| edit (record) { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.edit(record); | |||
| }); | |||
| }, | |||
| close () { | |||
| this.$emit('close'); | |||
| this.visible = false; | |||
| }, | |||
| submitCallback(){ | |||
| this.$emit('ok'); | |||
| this.visible = false; | |||
| }, | |||
| handleOk () { | |||
| this.$refs.realForm.submitForm(); | |||
| }, | |||
| handleCancel () { | |||
| this.close() | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| <style lang="less" scoped> | |||
| /** Button按钮间距 */ | |||
| .ant-btn { | |||
| margin-left: 30px; | |||
| margin-bottom: 30px; | |||
| float: right; | |||
| } | |||
| .drawer-footer{ | |||
| position: absolute; | |||
| bottom: -8px; | |||
| width: 100%; | |||
| border-top: 1px solid #e8e8e8; | |||
| padding: 10px 16px; | |||
| text-align: right; | |||
| left: 0; | |||
| background: #fff; | |||
| border-radius: 0 0 2px 2px; | |||
| } | |||
| </style> | |||
| @ -0,0 +1,60 @@ | |||
| <template> | |||
| <j-modal | |||
| :title="title" | |||
| :width="width" | |||
| :visible="visible" | |||
| switchFullscreen | |||
| @ok="handleOk" | |||
| :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" | |||
| @cancel="handleCancel" | |||
| cancelText="关闭"> | |||
| <popularize-country-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></popularize-country-form> | |||
| </j-modal> | |||
| </template> | |||
| <script> | |||
| import PopularizeCountryForm from './PopularizeCountryForm' | |||
| export default { | |||
| name: 'PopularizeCountryModal', | |||
| components: { | |||
| PopularizeCountryForm | |||
| }, | |||
| data () { | |||
| return { | |||
| title:'', | |||
| width:800, | |||
| visible: false, | |||
| disableSubmit: false | |||
| } | |||
| }, | |||
| methods: { | |||
| add () { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.add(); | |||
| }) | |||
| }, | |||
| edit (record) { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.edit(record); | |||
| }) | |||
| }, | |||
| close () { | |||
| this.$emit('close'); | |||
| this.visible = false; | |||
| }, | |||
| handleOk () { | |||
| this.$refs.realForm.submitForm(); | |||
| }, | |||
| submitCallback(){ | |||
| this.$emit('ok'); | |||
| this.visible = false; | |||
| }, | |||
| handleCancel () { | |||
| this.close() | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| @ -0,0 +1,61 @@ | |||
| import {defHttp} from '/@/utils/http/axios'; | |||
| import {Modal} from 'ant-design-vue'; | |||
| enum Api { | |||
| list = '/popularizeCountry/popularizeCountry/list', | |||
| save='/popularizeCountry/popularizeCountry/add', | |||
| edit='/popularizeCountry/popularizeCountry/edit', | |||
| deleteOne = '/popularizeCountry/popularizeCountry/delete', | |||
| deleteBatch = '/popularizeCountry/popularizeCountry/deleteBatch', | |||
| importExcel = '/popularizeCountry/popularizeCountry/importExcel', | |||
| exportXls = '/popularizeCountry/popularizeCountry/exportXls', | |||
| } | |||
| /** | |||
| * 导出api | |||
| * @param params | |||
| */ | |||
| export const getExportUrl = Api.exportXls; | |||
| /** | |||
| * 导入api | |||
| */ | |||
| export const getImportUrl = Api.importExcel; | |||
| /** | |||
| * 列表接口 | |||
| * @param params | |||
| */ | |||
| export const list = (params) => | |||
| defHttp.get({url: Api.list, params}); | |||
| /** | |||
| * 删除单个 | |||
| */ | |||
| export const deleteOne = (params,handleSuccess) => { | |||
| return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { | |||
| handleSuccess(); | |||
| }); | |||
| } | |||
| /** | |||
| * 批量删除 | |||
| * @param params | |||
| */ | |||
| export const batchDelete = (params, handleSuccess) => { | |||
| Modal.confirm({ | |||
| title: '确认删除', | |||
| content: '是否删除选中数据', | |||
| okText: '确认', | |||
| cancelText: '取消', | |||
| onOk: () => { | |||
| return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { | |||
| handleSuccess(); | |||
| }); | |||
| } | |||
| }); | |||
| } | |||
| /** | |||
| * 保存或者更新 | |||
| * @param params | |||
| */ | |||
| export const saveOrUpdate = (params, isUpdate) => { | |||
| let url = isUpdate ? Api.edit : Api.save; | |||
| return defHttp.post({url: url, params}); | |||
| } | |||
| @ -0,0 +1,55 @@ | |||
| import {BasicColumn} from '/@/components/Table'; | |||
| import {FormSchema} from '/@/components/Table'; | |||
| import { rules} from '/@/utils/helper/validator'; | |||
| import { render } from '/@/utils/common/renderUtils'; | |||
| //列表数据 | |||
| export const columns: BasicColumn[] = [ | |||
| { | |||
| title: '中文-国家', | |||
| align:"center", | |||
| dataIndex: 'country' | |||
| }, | |||
| { | |||
| title: '英文-国家', | |||
| align:"center", | |||
| dataIndex: 'enCountry' | |||
| }, | |||
| { | |||
| title: '排序', | |||
| align:"center", | |||
| dataIndex: 'sort' | |||
| }, | |||
| ]; | |||
| //查询数据 | |||
| export const searchFormSchema: FormSchema[] = [ | |||
| { | |||
| label: "中文-国家", | |||
| field: "country", | |||
| component: 'Input', | |||
| colProps: {span: 6}, | |||
| }, | |||
| { | |||
| label: "英文-国家", | |||
| field: "enCountry", | |||
| component: 'Input', | |||
| colProps: {span: 6}, | |||
| }, | |||
| ]; | |||
| //表单数据 | |||
| export const formSchema: FormSchema[] = [ | |||
| { | |||
| label: '中文-国家', | |||
| field: 'country', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '英文-国家', | |||
| field: 'enCountry', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '排序', | |||
| field: 'sort', | |||
| component: 'InputNumber', | |||
| }, | |||
| ]; | |||
| @ -0,0 +1,162 @@ | |||
| <template> | |||
| <div> | |||
| <!--引用表格--> | |||
| <BasicTable @register="registerTable" :rowSelection="rowSelection"> | |||
| <!--插槽:table标题--> | |||
| <template #tableTitle> | |||
| <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button> | |||
| <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button> | |||
| <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button> | |||
| <a-dropdown v-if="checkedKeys.length > 0"> | |||
| <template #overlay> | |||
| <a-menu> | |||
| <a-menu-item key="1" @click="batchHandleDelete"> | |||
| <Icon icon="ant-design:delete-outlined"></Icon> | |||
| 删除 | |||
| </a-menu-item> | |||
| </a-menu> | |||
| </template> | |||
| <a-button>批量操作 | |||
| <Icon icon="mdi:chevron-down"></Icon> | |||
| </a-button> | |||
| </a-dropdown> | |||
| </template> | |||
| <!--操作栏--> | |||
| <template #action="{ record }"> | |||
| <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/> | |||
| </template> | |||
| <!--字段回显插槽--> | |||
| <template #htmlSlot="{text}"> | |||
| <div v-html="text"></div> | |||
| </template> | |||
| <template #fileSlot="{text}"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |||
| <a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button> | |||
| </template> | |||
| </BasicTable> | |||
| <!-- 表单区域 --> | |||
| <PopularizeCountryModal @register="registerModal" @success="handleSuccess"></PopularizeCountryModal> | |||
| </div> | |||
| </template> | |||
| <script lang="ts" name="popularizeCountry-popularizeCountry" setup> | |||
| import {ref, computed, unref} from 'vue'; | |||
| import {BasicTable, useTable, TableAction} from '/@/components/Table'; | |||
| import {useModal} from '/@/components/Modal'; | |||
| import { useListPage } from '/@/hooks/system/useListPage' | |||
| import PopularizeCountryModal from './components/PopularizeCountryModal.vue' | |||
| import {columns, searchFormSchema} from './popularizeCountry.data'; | |||
| import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './popularizeCountry.api'; | |||
| const checkedKeys = ref<Array<string | number>>([]); | |||
| //注册model | |||
| const [registerModal, {openModal}] = useModal(); | |||
| //注册table数据 | |||
| const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({ | |||
| tableProps:{ | |||
| title: '国籍管理', | |||
| api: list, | |||
| columns, | |||
| canResize:false, | |||
| formConfig: { | |||
| labelWidth: 120, | |||
| schemas: searchFormSchema, | |||
| autoSubmitOnEnter:true, | |||
| showAdvancedButton:true, | |||
| fieldMapToTime: [ | |||
| ], | |||
| }, | |||
| actionColumn: { | |||
| width: 120, | |||
| }, | |||
| }, | |||
| exportConfig: { | |||
| name:"国籍管理", | |||
| url: getExportUrl, | |||
| }, | |||
| importConfig: { | |||
| url: getImportUrl | |||
| }, | |||
| }) | |||
| const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext | |||
| /** | |||
| * 新增事件 | |||
| */ | |||
| function handleAdd() { | |||
| openModal(true, { | |||
| isUpdate: false, | |||
| showFooter: true, | |||
| }); | |||
| } | |||
| /** | |||
| * 编辑事件 | |||
| */ | |||
| function handleEdit(record: Recordable) { | |||
| openModal(true, { | |||
| record, | |||
| isUpdate: true, | |||
| showFooter: true, | |||
| }); | |||
| } | |||
| /** | |||
| * 详情 | |||
| */ | |||
| function handleDetail(record: Recordable) { | |||
| openModal(true, { | |||
| record, | |||
| isUpdate: true, | |||
| showFooter: false, | |||
| }); | |||
| } | |||
| /** | |||
| * 删除事件 | |||
| */ | |||
| async function handleDelete(record) { | |||
| await deleteOne({id: record.id}, reload); | |||
| } | |||
| /** | |||
| * 批量删除事件 | |||
| */ | |||
| async function batchHandleDelete() { | |||
| await batchDelete({ids: checkedKeys.value}, reload); | |||
| } | |||
| /** | |||
| * 成功回调 | |||
| */ | |||
| function handleSuccess() { | |||
| reload(); | |||
| } | |||
| /** | |||
| * 操作栏 | |||
| */ | |||
| function getTableAction(record){ | |||
| return [ | |||
| { | |||
| label: '编辑', | |||
| onClick: handleEdit.bind(null, record), | |||
| } | |||
| ] | |||
| } | |||
| /** | |||
| * 下拉操作栏 | |||
| */ | |||
| function getDropDownAction(record){ | |||
| return [ | |||
| { | |||
| label: '详情', | |||
| onClick: handleDetail.bind(null, record), | |||
| }, { | |||
| label: '删除', | |||
| popConfirm: { | |||
| title: '是否确认删除', | |||
| confirm: handleDelete.bind(null, record), | |||
| } | |||
| } | |||
| ] | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| </style> | |||
| @ -0,0 +1,58 @@ | |||
| <template> | |||
| <BasicModal v-bind="$attrs" @register="registerModal" :title="title" @ok="handleSubmit"> | |||
| <BasicForm @register="registerForm"/> | |||
| </BasicModal> | |||
| </template> | |||
| <script lang="ts" setup> | |||
| import {ref, computed, unref} from 'vue'; | |||
| import {BasicModal, useModalInner} from '/@/components/Modal'; | |||
| import {BasicForm, useForm} from '/@/components/Form/index'; | |||
| import {formSchema} from '../popularizeCountry.data'; | |||
| import {saveOrUpdate} from '../popularizeCountry.api'; | |||
| // Emits声明 | |||
| const emit = defineEmits(['register','success']); | |||
| const isUpdate = ref(true); | |||
| //表单配置 | |||
| const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({ | |||
| labelWidth: 150, | |||
| schemas: formSchema, | |||
| showActionButtonGroup: false, | |||
| }); | |||
| //表单赋值 | |||
| const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => { | |||
| //重置表单 | |||
| await resetFields(); | |||
| setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter}); | |||
| isUpdate.value = !!data?.isUpdate; | |||
| if (unref(isUpdate)) { | |||
| //表单赋值 | |||
| await setFieldsValue({ | |||
| ...data.record, | |||
| }); | |||
| } | |||
| // 隐藏底部时禁用整个表单 | |||
| setProps({ disabled: !data?.showFooter }) | |||
| }); | |||
| //设置标题 | |||
| const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑')); | |||
| //表单提交事件 | |||
| async function handleSubmit(v) { | |||
| try { | |||
| let values = await validate(); | |||
| setModalProps({confirmLoading: true}); | |||
| //提交表单 | |||
| await saveOrUpdate(values, isUpdate.value); | |||
| //关闭弹窗 | |||
| closeModal(); | |||
| //刷新列表 | |||
| emit('success'); | |||
| } finally { | |||
| setModalProps({confirmLoading: false}); | |||
| } | |||
| } | |||
| </script> | |||
| <style lang="less" scoped> | |||
| </style> | |||
| @ -0,0 +1,171 @@ | |||
| package org.jeecg.modules.popularizeEvaluate.controller; | |||
| import java.util.Arrays; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import java.util.stream.Collectors; | |||
| import java.io.IOException; | |||
| import java.io.UnsupportedEncodingException; | |||
| import java.net.URLDecoder; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import org.jeecg.common.api.vo.Result; | |||
| import org.jeecg.common.system.query.QueryGenerator; | |||
| import org.jeecg.common.util.oConvertUtils; | |||
| import org.jeecg.modules.popularizeEvaluate.entity.PopularizeEvaluate; | |||
| import org.jeecg.modules.popularizeEvaluate.service.IPopularizeEvaluateService; | |||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
| import com.baomidou.mybatisplus.core.metadata.IPage; | |||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.jeecgframework.poi.excel.ExcelImportUtil; | |||
| import org.jeecgframework.poi.excel.def.NormalExcelConstants; | |||
| import org.jeecgframework.poi.excel.entity.ExportParams; | |||
| import org.jeecgframework.poi.excel.entity.ImportParams; | |||
| import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | |||
| import org.jeecg.common.system.base.controller.JeecgController; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import org.springframework.web.multipart.MultipartFile; | |||
| import org.springframework.web.multipart.MultipartHttpServletRequest; | |||
| import org.springframework.web.servlet.ModelAndView; | |||
| import com.alibaba.fastjson.JSON; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.jeecg.common.aspect.annotation.AutoLog; | |||
| /** | |||
| * @Description: 评价列表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Api(tags="评价列表") | |||
| @RestController | |||
| @RequestMapping("/popularizeEvaluate/popularizeEvaluate") | |||
| @Slf4j | |||
| public class PopularizeEvaluateController extends JeecgController<PopularizeEvaluate, IPopularizeEvaluateService> { | |||
| @Autowired | |||
| private IPopularizeEvaluateService popularizeEvaluateService; | |||
| /** | |||
| * 分页列表查询 | |||
| * | |||
| * @param popularizeEvaluate | |||
| * @param pageNo | |||
| * @param pageSize | |||
| * @param req | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "评价列表-分页列表查询") | |||
| @ApiOperation(value="评价列表-分页列表查询", notes="评价列表-分页列表查询") | |||
| @GetMapping(value = "/list") | |||
| public Result<IPage<PopularizeEvaluate>> queryPageList(PopularizeEvaluate popularizeEvaluate, | |||
| @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | |||
| @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | |||
| HttpServletRequest req) { | |||
| QueryWrapper<PopularizeEvaluate> queryWrapper = QueryGenerator.initQueryWrapper(popularizeEvaluate, req.getParameterMap()); | |||
| Page<PopularizeEvaluate> page = new Page<PopularizeEvaluate>(pageNo, pageSize); | |||
| IPage<PopularizeEvaluate> pageList = popularizeEvaluateService.page(page, queryWrapper); | |||
| return Result.OK(pageList); | |||
| } | |||
| /** | |||
| * 添加 | |||
| * | |||
| * @param popularizeEvaluate | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "评价列表-添加") | |||
| @ApiOperation(value="评价列表-添加", notes="评价列表-添加") | |||
| @PostMapping(value = "/add") | |||
| public Result<String> add(@RequestBody PopularizeEvaluate popularizeEvaluate) { | |||
| popularizeEvaluateService.save(popularizeEvaluate); | |||
| return Result.OK("添加成功!"); | |||
| } | |||
| /** | |||
| * 编辑 | |||
| * | |||
| * @param popularizeEvaluate | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "评价列表-编辑") | |||
| @ApiOperation(value="评价列表-编辑", notes="评价列表-编辑") | |||
| @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) | |||
| public Result<String> edit(@RequestBody PopularizeEvaluate popularizeEvaluate) { | |||
| popularizeEvaluateService.updateById(popularizeEvaluate); | |||
| return Result.OK("编辑成功!"); | |||
| } | |||
| /** | |||
| * 通过id删除 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "评价列表-通过id删除") | |||
| @ApiOperation(value="评价列表-通过id删除", notes="评价列表-通过id删除") | |||
| @DeleteMapping(value = "/delete") | |||
| public Result<String> delete(@RequestParam(name="id",required=true) String id) { | |||
| popularizeEvaluateService.removeById(id); | |||
| return Result.OK("删除成功!"); | |||
| } | |||
| /** | |||
| * 批量删除 | |||
| * | |||
| * @param ids | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "评价列表-批量删除") | |||
| @ApiOperation(value="评价列表-批量删除", notes="评价列表-批量删除") | |||
| @DeleteMapping(value = "/deleteBatch") | |||
| public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | |||
| this.popularizeEvaluateService.removeByIds(Arrays.asList(ids.split(","))); | |||
| return Result.OK("批量删除成功!"); | |||
| } | |||
| /** | |||
| * 通过id查询 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "评价列表-通过id查询") | |||
| @ApiOperation(value="评价列表-通过id查询", notes="评价列表-通过id查询") | |||
| @GetMapping(value = "/queryById") | |||
| public Result<PopularizeEvaluate> queryById(@RequestParam(name="id",required=true) String id) { | |||
| PopularizeEvaluate popularizeEvaluate = popularizeEvaluateService.getById(id); | |||
| if(popularizeEvaluate==null) { | |||
| return Result.error("未找到对应数据"); | |||
| } | |||
| return Result.OK(popularizeEvaluate); | |||
| } | |||
| /** | |||
| * 导出excel | |||
| * | |||
| * @param request | |||
| * @param popularizeEvaluate | |||
| */ | |||
| @RequestMapping(value = "/exportXls") | |||
| public ModelAndView exportXls(HttpServletRequest request, PopularizeEvaluate popularizeEvaluate) { | |||
| return super.exportXls(request, popularizeEvaluate, PopularizeEvaluate.class, "评价列表"); | |||
| } | |||
| /** | |||
| * 通过excel导入数据 | |||
| * | |||
| * @param request | |||
| * @param response | |||
| * @return | |||
| */ | |||
| @RequestMapping(value = "/importExcel", method = RequestMethod.POST) | |||
| public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | |||
| return super.importExcel(request, response, PopularizeEvaluate.class); | |||
| } | |||
| } | |||
| @ -0,0 +1,78 @@ | |||
| package org.jeecg.modules.popularizeEvaluate.entity; | |||
| import java.io.Serializable; | |||
| import java.io.UnsupportedEncodingException; | |||
| import java.util.Date; | |||
| import java.math.BigDecimal; | |||
| import com.baomidou.mybatisplus.annotation.IdType; | |||
| import com.baomidou.mybatisplus.annotation.TableId; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import lombok.Data; | |||
| import com.fasterxml.jackson.annotation.JsonFormat; | |||
| import org.springframework.format.annotation.DateTimeFormat; | |||
| import org.jeecgframework.poi.excel.annotation.Excel; | |||
| import org.jeecg.common.aspect.annotation.Dict; | |||
| import io.swagger.annotations.ApiModel; | |||
| import io.swagger.annotations.ApiModelProperty; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.experimental.Accessors; | |||
| /** | |||
| * @Description: 评价列表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Data | |||
| @TableName("popularize_evaluate") | |||
| @Accessors(chain = true) | |||
| @EqualsAndHashCode(callSuper = false) | |||
| @ApiModel(value="popularize_evaluate对象", description="评价列表") | |||
| public class PopularizeEvaluate implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| /**主键*/ | |||
| @TableId(type = IdType.ASSIGN_ID) | |||
| @ApiModelProperty(value = "主键") | |||
| private java.lang.String id; | |||
| /**创建人*/ | |||
| @ApiModelProperty(value = "创建人") | |||
| private java.lang.String createBy; | |||
| /**创建日期*/ | |||
| @ApiModelProperty(value = "创建日期") | |||
| private java.util.Date createTime; | |||
| /**更新人*/ | |||
| @ApiModelProperty(value = "更新人") | |||
| private java.lang.String updateBy; | |||
| /**更新日期*/ | |||
| @ApiModelProperty(value = "更新日期") | |||
| private java.util.Date updateTime; | |||
| /**类型*/ | |||
| @Excel(name = "类型", width = 15, dicCode = "order_type") | |||
| @Dict(dicCode = "order_type") | |||
| @ApiModelProperty(value = "类型") | |||
| private java.lang.String type; | |||
| /**用户*/ | |||
| @Excel(name = "用户", width = 15, dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") | |||
| @Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") | |||
| @ApiModelProperty(value = "用户") | |||
| private java.lang.String userId; | |||
| /**分数*/ | |||
| @Excel(name = "分数", width = 15) | |||
| @ApiModelProperty(value = "分数") | |||
| private java.lang.String num; | |||
| /**文本详情*/ | |||
| @Excel(name = "文本详情", width = 15) | |||
| @ApiModelProperty(value = "文本详情") | |||
| private java.lang.String details; | |||
| /**旅行标识*/ | |||
| @Excel(name = "旅行标识", width = 15, dictTable = "popularize_travel", dicText = "title", dicCode = "id") | |||
| @Dict(dictTable = "popularize_travel", dicText = "title", dicCode = "id") | |||
| @ApiModelProperty(value = "旅行标识") | |||
| private java.lang.String travelId; | |||
| /**活动标识*/ | |||
| @Excel(name = "活动标识", width = 15, dictTable = "popularize_activity", dicText = "title", dicCode = "id") | |||
| @Dict(dictTable = "popularize_activity", dicText = "title", dicCode = "id") | |||
| @ApiModelProperty(value = "活动标识") | |||
| private java.lang.String activityId; | |||
| } | |||
| @ -0,0 +1,17 @@ | |||
| package org.jeecg.modules.popularizeEvaluate.mapper; | |||
| import java.util.List; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import org.jeecg.modules.popularizeEvaluate.entity.PopularizeEvaluate; | |||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
| /** | |||
| * @Description: 评价列表 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2024-12-19 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface PopularizeEvaluateMapper extends BaseMapper<PopularizeEvaluate> { | |||
| } | |||