学员端 接口迁移
This commit is contained in:
parent
ac7864f34b
commit
3429e6ac7b
@ -0,0 +1,221 @@
|
||||
package org.jeecg.modules.aiol.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
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.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.config.shiro.IgnoreAuth;
|
||||
import org.jeecg.modules.aiol.entity.AiolActivity;
|
||||
import org.jeecg.modules.aiol.entity.AiolTag;
|
||||
import org.jeecg.modules.aiol.mapper.AiolTagMapper;
|
||||
import org.jeecg.modules.aiol.service.IAiolActivityService;
|
||||
|
||||
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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: 活动
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Tag(name = "活动")
|
||||
@RestController
|
||||
@RequestMapping("/aiol/aiolActivity")
|
||||
@Slf4j
|
||||
public class AiolActivityController extends JeecgController<AiolActivity, IAiolActivityService> {
|
||||
@Autowired
|
||||
private IAiolActivityService aiolActivityService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param aiolActivity
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "活动-分页列表查询")
|
||||
@Operation(summary = "活动-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
@IgnoreAuth
|
||||
public Result<IPage<AiolActivity>> queryPageList(AiolActivity aiolActivity,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
|
||||
|
||||
QueryWrapper<AiolActivity> queryWrapper = QueryGenerator.initQueryWrapper(aiolActivity, req.getParameterMap());
|
||||
Page<AiolActivity> page = new Page<AiolActivity>(pageNo, pageSize);
|
||||
IPage<AiolActivity> pageList = aiolActivityService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param aiolActivity
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "活动-添加")
|
||||
@Operation(summary = "活动-添加")
|
||||
@RequiresPermissions("aiol:aiol_activity:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody AiolActivity aiolActivity) {
|
||||
aiolActivityService.save(aiolActivity);
|
||||
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param aiolActivity
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "活动-编辑")
|
||||
@Operation(summary = "活动-编辑")
|
||||
@RequiresPermissions("aiol:aiol_activity:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody AiolActivity aiolActivity) {
|
||||
aiolActivityService.updateById(aiolActivity);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "活动-通过id删除")
|
||||
@Operation(summary = "活动-通过id删除")
|
||||
@RequiresPermissions("aiol:aiol_activity:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
aiolActivityService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "活动-批量删除")
|
||||
@Operation(summary = "活动-批量删除")
|
||||
@RequiresPermissions("aiol:aiol_activity:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.aiolActivityService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "活动-通过id查询")
|
||||
@Operation(summary = "活动-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<AiolActivity> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
AiolActivity aiolActivity = aiolActivityService.getById(id);
|
||||
if (aiolActivity == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(aiolActivity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param aiolActivity
|
||||
*/
|
||||
@RequiresPermissions("aiol:aiol_activity:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, AiolActivity aiolActivity) {
|
||||
return super.exportXls(request, aiolActivity, AiolActivity.class, "活动");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("aiol:aiol_activity:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, AiolActivity.class);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private AiolTagMapper aiolTagMapper;
|
||||
|
||||
@GetMapping("/selected")
|
||||
@Operation(summary = "查询精选活动")
|
||||
@IgnoreAuth
|
||||
public Result<List<AiolActivity>> getSelectedActivities() {
|
||||
// 1. 从 aiol_tag 表查询 target_type='activity' 的 target_id 列表
|
||||
QueryWrapper<AiolTag> tagWrapper = new QueryWrapper<>();
|
||||
tagWrapper.eq("target_type", "activity");
|
||||
List<AiolTag> tags = aiolTagMapper.selectList(tagWrapper);
|
||||
|
||||
if (tags == null || tags.isEmpty()) {
|
||||
return Result.OK(List.of());
|
||||
}
|
||||
|
||||
// 2. 提取 target_id 列表
|
||||
List<String> activityIds = tags.stream()
|
||||
.map(AiolTag::getTargetId)
|
||||
.filter(id -> id != null && !id.trim().isEmpty())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (activityIds.isEmpty()) {
|
||||
return Result.OK(List.of());
|
||||
}
|
||||
|
||||
// 3. 根据 target_id 列表查询活动数据
|
||||
QueryWrapper<AiolActivity> activityWrapper = new QueryWrapper<>();
|
||||
activityWrapper.in("id", activityIds);
|
||||
List<AiolActivity> activities = aiolActivityService.list(activityWrapper);
|
||||
|
||||
return Result.OK(activities);
|
||||
}
|
||||
}
|
@ -0,0 +1,182 @@
|
||||
package org.jeecg.modules.aiol.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
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.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.aiol.entity.AiolActivitySignup;
|
||||
import org.jeecg.modules.aiol.service.IAiolActivitySignupService;
|
||||
|
||||
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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
/**
|
||||
* @Description: 活动报名
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Tag(name="活动报名")
|
||||
@RestController
|
||||
@RequestMapping("/aiol/aiolActivitySignup")
|
||||
@Slf4j
|
||||
public class AiolActivitySignupController extends JeecgController<AiolActivitySignup, IAiolActivitySignupService> {
|
||||
@Autowired
|
||||
private IAiolActivitySignupService aiolActivitySignupService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param aiolActivitySignup
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "活动报名-分页列表查询")
|
||||
@Operation(summary="活动报名-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<AiolActivitySignup>> queryPageList(AiolActivitySignup aiolActivitySignup,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
|
||||
|
||||
QueryWrapper<AiolActivitySignup> queryWrapper = QueryGenerator.initQueryWrapper(aiolActivitySignup, req.getParameterMap());
|
||||
Page<AiolActivitySignup> page = new Page<AiolActivitySignup>(pageNo, pageSize);
|
||||
IPage<AiolActivitySignup> pageList = aiolActivitySignupService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param aiolActivitySignup
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "活动报名-添加")
|
||||
@Operation(summary="活动报名-添加")
|
||||
@RequiresPermissions("aiol:aiol_activity_signup:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody AiolActivitySignup aiolActivitySignup) {
|
||||
aiolActivitySignupService.save(aiolActivitySignup);
|
||||
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param aiolActivitySignup
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "活动报名-编辑")
|
||||
@Operation(summary="活动报名-编辑")
|
||||
@RequiresPermissions("aiol:aiol_activity_signup:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody AiolActivitySignup aiolActivitySignup) {
|
||||
aiolActivitySignupService.updateById(aiolActivitySignup);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "活动报名-通过id删除")
|
||||
@Operation(summary="活动报名-通过id删除")
|
||||
@RequiresPermissions("aiol:aiol_activity_signup:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
aiolActivitySignupService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "活动报名-批量删除")
|
||||
@Operation(summary="活动报名-批量删除")
|
||||
@RequiresPermissions("aiol:aiol_activity_signup:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.aiolActivitySignupService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "活动报名-通过id查询")
|
||||
@Operation(summary="活动报名-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<AiolActivitySignup> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
AiolActivitySignup aiolActivitySignup = aiolActivitySignupService.getById(id);
|
||||
if(aiolActivitySignup==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(aiolActivitySignup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param aiolActivitySignup
|
||||
*/
|
||||
@RequiresPermissions("aiol:aiol_activity_signup:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, AiolActivitySignup aiolActivitySignup) {
|
||||
return super.exportXls(request, aiolActivitySignup, AiolActivitySignup.class, "活动报名");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("aiol:aiol_activity_signup:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, AiolActivitySignup.class);
|
||||
}
|
||||
|
||||
}
|
@ -14,6 +14,8 @@ import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.config.shiro.IgnoreAuth;
|
||||
import org.jeecg.modules.aiol.dto.CommentWithUserInfo;
|
||||
import org.jeecg.modules.aiol.entity.AiolComment;
|
||||
import org.jeecg.modules.aiol.service.IAiolCommentService;
|
||||
|
||||
@ -179,4 +181,27 @@ public class AiolCommentController extends JeecgController<AiolComment, IAiolCom
|
||||
return super.importExcel(request, response, AiolComment.class);
|
||||
}
|
||||
|
||||
@GetMapping("/course/{courseId}/list")
|
||||
@Operation(summary = "查询课程评论列表", description = "根据课程ID查询课程评论列表,包含用户信息")
|
||||
@IgnoreAuth
|
||||
public Result<List<CommentWithUserInfo>> queryCourseCommentList(@PathVariable("courseId") String courseId) {
|
||||
List<CommentWithUserInfo> list = aiolCommentService.getCommentList("course", courseId);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
// @GetMapping("/activity/{activityId}/list")
|
||||
// @Operation(summary = "查询活动评论列表", description = "根据活动ID查询活动评论列表,包含用户信息")
|
||||
// public Result<List<CommentWithUserInfo>> queryActivityCommentList(@PathVariable("activityId") String activityId) {
|
||||
// List<CommentWithUserInfo> list = commentBizService.getCommentList("activity", activityId);
|
||||
// return Result.OK(list);
|
||||
// }
|
||||
|
||||
// @GetMapping("/{targetType}/{targetId}/list")
|
||||
// @Operation(summary = "查询通用评论列表", description = "根据目标类型和目标ID查询评论列表,包含用户信息")
|
||||
// public Result<List<CommentWithUserInfo>> queryCommentList(
|
||||
// @PathVariable("targetType") String targetType,
|
||||
// @PathVariable("targetId") String targetId) {
|
||||
// List<CommentWithUserInfo> list = commentBizService.getCommentList(targetType, targetId);
|
||||
// return Result.OK(list);
|
||||
// }
|
||||
}
|
||||
|
@ -0,0 +1,182 @@
|
||||
package org.jeecg.modules.aiol.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
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.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.aiol.entity.AiolContentConfig;
|
||||
import org.jeecg.modules.aiol.service.IAiolContentConfigService;
|
||||
|
||||
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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
/**
|
||||
* @Description: 内容配置
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Tag(name="内容配置")
|
||||
@RestController
|
||||
@RequestMapping("/aiol/aiolContentConfig")
|
||||
@Slf4j
|
||||
public class AiolContentConfigController extends JeecgController<AiolContentConfig, IAiolContentConfigService> {
|
||||
@Autowired
|
||||
private IAiolContentConfigService aiolContentConfigService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param aiolContentConfig
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "内容配置-分页列表查询")
|
||||
@Operation(summary="内容配置-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<AiolContentConfig>> queryPageList(AiolContentConfig aiolContentConfig,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
|
||||
|
||||
QueryWrapper<AiolContentConfig> queryWrapper = QueryGenerator.initQueryWrapper(aiolContentConfig, req.getParameterMap());
|
||||
Page<AiolContentConfig> page = new Page<AiolContentConfig>(pageNo, pageSize);
|
||||
IPage<AiolContentConfig> pageList = aiolContentConfigService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param aiolContentConfig
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "内容配置-添加")
|
||||
@Operation(summary="内容配置-添加")
|
||||
@RequiresPermissions("aiol:aiol_content_config:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody AiolContentConfig aiolContentConfig) {
|
||||
aiolContentConfigService.save(aiolContentConfig);
|
||||
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param aiolContentConfig
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "内容配置-编辑")
|
||||
@Operation(summary="内容配置-编辑")
|
||||
@RequiresPermissions("aiol:aiol_content_config:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody AiolContentConfig aiolContentConfig) {
|
||||
aiolContentConfigService.updateById(aiolContentConfig);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "内容配置-通过id删除")
|
||||
@Operation(summary="内容配置-通过id删除")
|
||||
@RequiresPermissions("aiol:aiol_content_config:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
aiolContentConfigService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "内容配置-批量删除")
|
||||
@Operation(summary="内容配置-批量删除")
|
||||
@RequiresPermissions("aiol:aiol_content_config:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.aiolContentConfigService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "内容配置-通过id查询")
|
||||
@Operation(summary="内容配置-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<AiolContentConfig> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
AiolContentConfig aiolContentConfig = aiolContentConfigService.getById(id);
|
||||
if(aiolContentConfig==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(aiolContentConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param aiolContentConfig
|
||||
*/
|
||||
@RequiresPermissions("aiol:aiol_content_config:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, AiolContentConfig aiolContentConfig) {
|
||||
return super.exportXls(request, aiolContentConfig, AiolContentConfig.class, "内容配置");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("aiol:aiol_content_config:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, AiolContentConfig.class);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,166 @@
|
||||
package org.jeecg.modules.aiol.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.config.shiro.IgnoreAuth;
|
||||
import org.jeecg.modules.aiol.dto.CommentWithUserInfo;
|
||||
import org.jeecg.modules.aiol.entity.AiolContentConfig;
|
||||
import org.jeecg.modules.aiol.entity.AiolCourse;
|
||||
import org.jeecg.modules.aiol.mapper.AiolContentConfigMapper;
|
||||
import org.jeecg.modules.aiol.mapper.AiolCourseMapper;
|
||||
import org.jeecg.modules.aiol.service.IAiolCommentService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.data.redis.core.ZSetOperations;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Tag(name = "首页")
|
||||
@RestController
|
||||
@RequestMapping("/aiol/index")
|
||||
@Slf4j
|
||||
public class AiolIndexController {
|
||||
@Autowired
|
||||
private AiolContentConfigMapper contentConfigMapper;
|
||||
@Autowired
|
||||
private IAiolCommentService commentBizService;
|
||||
@Autowired(required = false)
|
||||
private StringRedisTemplate stringRedisTemplate;
|
||||
@Autowired
|
||||
private AiolCourseMapper courseMapper;
|
||||
|
||||
private static final String HOT_SEARCH_ZSET_KEY = "hot:search";
|
||||
|
||||
@GetMapping("/content")
|
||||
@Operation(summary = "查询首页内容")
|
||||
@IgnoreAuth
|
||||
public Result<String> queryContent(@RequestParam String contentKey) {
|
||||
AiolContentConfig contentConfig = contentConfigMapper.selectOne(new QueryWrapper<AiolContentConfig>().eq("content_key", contentKey));
|
||||
if (contentConfig == null) {
|
||||
return Result.error("内容配置不存在");
|
||||
}
|
||||
return Result.OK(contentConfig.getContentValue());
|
||||
}
|
||||
|
||||
@GetMapping("/statistics")
|
||||
@Operation(summary = "查询首页数据统计")
|
||||
@IgnoreAuth
|
||||
public Result<Map<String, Object>> queryStatistics() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
// 定义统计项的配置键
|
||||
String[] statisticsKeys = {"xxsp", "mszj", "pxjc", "zysc", "zxsy"};
|
||||
|
||||
// 从配置表查询每个统计项的值
|
||||
for (String key : statisticsKeys) {
|
||||
AiolContentConfig contentConfig = contentConfigMapper.selectOne(
|
||||
new QueryWrapper<AiolContentConfig>().eq("content_key", key)
|
||||
);
|
||||
|
||||
if (contentConfig != null && contentConfig.getContentValue() != null) {
|
||||
try {
|
||||
// 尝试解析为数字,如果失败则使用默认值0
|
||||
Integer value = Integer.parseInt(contentConfig.getContentValue());
|
||||
map.put(key, value);
|
||||
} catch (NumberFormatException e) {
|
||||
log.warn("配置项 {} 的值 {} 不是有效数字,使用默认值0", key, contentConfig.getContentValue());
|
||||
map.put(key, 0);
|
||||
}
|
||||
} else {
|
||||
log.warn("配置项 {} 不存在,使用默认值0", key);
|
||||
map.put(key, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return Result.OK(map);
|
||||
}
|
||||
|
||||
@GetMapping("/selected_comments")
|
||||
@Operation(summary = "查询精选评论")
|
||||
@IgnoreAuth
|
||||
public Result<List<CommentWithUserInfo>> querySelectedComments() {
|
||||
// 查询精选评论(包含用户信息)
|
||||
List<CommentWithUserInfo> comments = commentBizService.getAllSelectedComments();
|
||||
return Result.OK(comments);
|
||||
}
|
||||
|
||||
@GetMapping("/hot_search")
|
||||
@Operation(summary = "查询热门搜索记录(关键词+搜索次数,Redis ZSet 排名)")
|
||||
@IgnoreAuth
|
||||
public Result<List<Map<String, Object>>> queryHotSearch(@RequestParam(defaultValue = "10") Integer limit) {
|
||||
if (limit == null || limit <= 0) {
|
||||
limit = 10;
|
||||
}
|
||||
if (stringRedisTemplate == null) {
|
||||
return Result.error("Redis 未配置,无法查询热门搜索");
|
||||
}
|
||||
|
||||
Set<ZSetOperations.TypedTuple<String>> tuples = stringRedisTemplate.opsForZSet()
|
||||
.reverseRangeWithScores(HOT_SEARCH_ZSET_KEY, 0, limit - 1);
|
||||
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
if (tuples != null) {
|
||||
for (ZSetOperations.TypedTuple<String> tuple : tuples) {
|
||||
if (tuple == null) {
|
||||
continue;
|
||||
}
|
||||
Map<String, Object> item = new HashMap<>();
|
||||
item.put("keyword", tuple.getValue());
|
||||
item.put("count", tuple.getScore() == null ? 0 : tuple.getScore().longValue());
|
||||
result.add(item);
|
||||
}
|
||||
}
|
||||
return Result.OK(result);
|
||||
}
|
||||
|
||||
@GetMapping("/search")
|
||||
@Operation(summary = "全局搜索(课程:name/description/school)")
|
||||
@IgnoreAuth
|
||||
public Result<List<AiolCourse>> globalSearch(
|
||||
@RequestParam String keyword,
|
||||
@RequestParam(required = false, defaultValue = "20") Integer limit
|
||||
) {
|
||||
if (limit == null || limit <= 0) {
|
||||
limit = 20;
|
||||
}
|
||||
if (limit > 100) {
|
||||
limit = 100;
|
||||
}
|
||||
|
||||
if (keyword == null || keyword.trim().isEmpty()) {
|
||||
return Result.OK(new ArrayList<>());
|
||||
}
|
||||
|
||||
if (keyword.trim().length() < 2) {
|
||||
return Result.error("关键词长度至少为2个字符");
|
||||
}
|
||||
|
||||
// 记录关键词到 Redis 热搜
|
||||
if (stringRedisTemplate != null) {
|
||||
try {
|
||||
stringRedisTemplate.opsForZSet().incrementScore(HOT_SEARCH_ZSET_KEY, keyword.trim(), 1D);
|
||||
} catch (Exception e) {
|
||||
log.warn("记录热搜关键词到 Redis 失败: {}", keyword, e);
|
||||
}
|
||||
}
|
||||
|
||||
String kw = keyword.trim();
|
||||
QueryWrapper<AiolCourse> wrapper = new QueryWrapper<>();
|
||||
wrapper.lambda()
|
||||
.like(AiolCourse::getName, kw)
|
||||
.or()
|
||||
.like(AiolCourse::getDescription, kw)
|
||||
.or()
|
||||
.like(AiolCourse::getSchool, kw);
|
||||
|
||||
List<AiolCourse> list = courseMapper.selectList(wrapper.last("limit " + limit));
|
||||
return Result.OK(list);
|
||||
}
|
||||
}
|
@ -1,20 +1,21 @@
|
||||
package org.jeecg.modules.aiol.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
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.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.config.shiro.IgnoreAuth;
|
||||
import org.jeecg.modules.aiol.constant.EntityLinkConst;
|
||||
import org.jeecg.modules.aiol.entity.AiolResource;
|
||||
import org.jeecg.modules.aiol.service.IAiolEntityLinkService;
|
||||
import org.jeecg.modules.aiol.service.IAiolResourceService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@ -38,6 +39,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: 资源
|
||||
* @Author: jeecg-boot
|
||||
@ -179,4 +181,52 @@ public class AiolResourceController extends JeecgController<AiolResource, IAiolR
|
||||
return super.importExcel(request, response, AiolResource.class);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private IAiolEntityLinkService entityLinkBizService;
|
||||
|
||||
@GetMapping("/feature")
|
||||
@Operation(summary = "查询精品资源")
|
||||
@IgnoreAuth
|
||||
public Result<List<AiolResource>> queryFeatureResource() {
|
||||
List<AiolResource> list = aiolResourceService.list(new QueryWrapper<AiolResource>().eq("iz_featured", 1));
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
@GetMapping("/video")
|
||||
@Operation(summary = "按课程分类查询视频资源")
|
||||
@IgnoreAuth
|
||||
public Result<List<AiolResource>> queryVideoResource(@RequestParam("categoryId") String courseCategoryId) {
|
||||
List<String> targetIds = entityLinkBizService.listTargetIds(EntityLinkConst.SourceType.COURSE_CATEGORY, courseCategoryId, EntityLinkConst.TargetType.RESOURCE);
|
||||
List<AiolResource> list = new ArrayList<>();
|
||||
for (String targetId : targetIds) {
|
||||
AiolResource resource = aiolResourceService.getById(targetId);
|
||||
if (resource.getType() == EntityLinkConst.ResourceType.VIDEO) {
|
||||
list.add(resource);
|
||||
}
|
||||
}
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
@GetMapping("/image")
|
||||
@Operation(summary = "按课程分类查询图片资源")
|
||||
@IgnoreAuth
|
||||
public Result<List<AiolResource>> queryImageResource(@RequestParam("categoryId") String courseCategoryId) {
|
||||
List<String> targetIds = entityLinkBizService.listTargetIds(EntityLinkConst.SourceType.COURSE_CATEGORY, courseCategoryId, EntityLinkConst.TargetType.RESOURCE);
|
||||
List<AiolResource> list = new ArrayList<>();
|
||||
for (String targetId : targetIds) {
|
||||
AiolResource resource = aiolResourceService.getById(targetId);
|
||||
if (resource.getType() == EntityLinkConst.ResourceType.IMAGE) {
|
||||
list.add(resource);
|
||||
}
|
||||
}
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
@PostMapping("/upload")
|
||||
@Operation(summary = "课程视频文件上传", description = "课程视频文件上传,返回各清晰度的m3u8文件地址")
|
||||
public Result<Map<String, String>> upload(@RequestParam("file") MultipartFile file, HttpServletRequest request) throws Exception {
|
||||
if (file == null || file.isEmpty()) return Result.error("没有找到上传的文件");
|
||||
Map<String, String> qualityUrls = aiolResourceService.uploadHls(file, request);
|
||||
return Result.OK(qualityUrls);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package org.jeecg.modules.gen.aioltag.controller;
|
||||
package org.jeecg.modules.aiol.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
@ -14,8 +14,8 @@ import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.gen.aioltag.entity.AiolTag;
|
||||
import org.jeecg.modules.gen.aioltag.service.IAiolTagService;
|
||||
import org.jeecg.modules.aiol.entity.AiolTag;
|
||||
import org.jeecg.modules.aiol.service.IAiolTagService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -41,12 +41,12 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
/**
|
||||
* @Description: 标签
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-28
|
||||
* @Date: 2025-08-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Tag(name="标签")
|
||||
@RestController
|
||||
@RequestMapping("/gen/aioltag/aiolTag")
|
||||
@RequestMapping("/aiol/aiolTag")
|
||||
@Slf4j
|
||||
public class AiolTagController extends JeecgController<AiolTag, IAiolTagService> {
|
||||
@Autowired
|
||||
@ -84,7 +84,7 @@ public class AiolTagController extends JeecgController<AiolTag, IAiolTagService>
|
||||
*/
|
||||
@AutoLog(value = "标签-添加")
|
||||
@Operation(summary="标签-添加")
|
||||
@RequiresPermissions("gen.aioltag:aiol_tag:add")
|
||||
@RequiresPermissions("aiol:aiol_tag:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody AiolTag aiolTag) {
|
||||
aiolTagService.save(aiolTag);
|
||||
@ -100,7 +100,7 @@ public class AiolTagController extends JeecgController<AiolTag, IAiolTagService>
|
||||
*/
|
||||
@AutoLog(value = "标签-编辑")
|
||||
@Operation(summary="标签-编辑")
|
||||
@RequiresPermissions("gen.aioltag:aiol_tag:edit")
|
||||
@RequiresPermissions("aiol:aiol_tag:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody AiolTag aiolTag) {
|
||||
aiolTagService.updateById(aiolTag);
|
||||
@ -115,7 +115,7 @@ public class AiolTagController extends JeecgController<AiolTag, IAiolTagService>
|
||||
*/
|
||||
@AutoLog(value = "标签-通过id删除")
|
||||
@Operation(summary="标签-通过id删除")
|
||||
@RequiresPermissions("gen.aioltag:aiol_tag:delete")
|
||||
@RequiresPermissions("aiol:aiol_tag:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
aiolTagService.removeById(id);
|
||||
@ -130,7 +130,7 @@ public class AiolTagController extends JeecgController<AiolTag, IAiolTagService>
|
||||
*/
|
||||
@AutoLog(value = "标签-批量删除")
|
||||
@Operation(summary="标签-批量删除")
|
||||
@RequiresPermissions("gen.aioltag:aiol_tag:deleteBatch")
|
||||
@RequiresPermissions("aiol:aiol_tag:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.aiolTagService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
@ -160,7 +160,7 @@ public class AiolTagController extends JeecgController<AiolTag, IAiolTagService>
|
||||
* @param request
|
||||
* @param aiolTag
|
||||
*/
|
||||
@RequiresPermissions("gen.aioltag:aiol_tag:exportXls")
|
||||
@RequiresPermissions("aiol:aiol_tag:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, AiolTag aiolTag) {
|
||||
return super.exportXls(request, aiolTag, AiolTag.class, "标签");
|
||||
@ -173,7 +173,7 @@ public class AiolTagController extends JeecgController<AiolTag, IAiolTagService>
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("gen.aioltag:aiol_tag:importExcel")
|
||||
@RequiresPermissions("aiol:aiol_tag:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, AiolTag.class);
|
@ -0,0 +1,105 @@
|
||||
package org.jeecg.modules.aiol.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 com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
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.v3.oas.annotations.media.Schema;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 活动
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("aiol_activity")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description="活动")
|
||||
public class AiolActivity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private java.lang.String id;
|
||||
/**标题*/
|
||||
@Excel(name = "标题", width = 15)
|
||||
@Schema(description = "标题")
|
||||
private java.lang.String title;
|
||||
/**介绍*/
|
||||
@Excel(name = "介绍", width = 15)
|
||||
@Schema(description = "介绍")
|
||||
private java.lang.String introduction;
|
||||
/**说明图片*/
|
||||
@Excel(name = "说明图片", width = 15)
|
||||
@Schema(description = "说明图片")
|
||||
private java.lang.String imgs;
|
||||
/**头图*/
|
||||
@Excel(name = "头图", width = 15)
|
||||
@Schema(description = "头图")
|
||||
private java.lang.String banner;
|
||||
/**介绍视频*/
|
||||
@Excel(name = "介绍视频", width = 15)
|
||||
@Schema(description = "介绍视频")
|
||||
private java.lang.String video;
|
||||
/**报名人数上限*/
|
||||
@Excel(name = "报名人数上限", width = 15)
|
||||
@Schema(description = "报名人数上限")
|
||||
private java.lang.Integer maxNum;
|
||||
/**开始时间*/
|
||||
@Excel(name = "开始时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "开始时间")
|
||||
private java.util.Date startTime;
|
||||
/**结束时间*/
|
||||
@Excel(name = "结束时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "结束时间")
|
||||
private java.util.Date endTime;
|
||||
/**扩展字段*/
|
||||
@Excel(name = "扩展字段", width = 15)
|
||||
@Schema(description = "扩展字段")
|
||||
private java.lang.String extra;
|
||||
/**附件*/
|
||||
@Excel(name = "附件", width = 15)
|
||||
@Schema(description = "附件")
|
||||
private java.lang.String attachment;
|
||||
/**状态*/
|
||||
@Excel(name = "状态", width = 15, dicCode = "course_status")
|
||||
@Dict(dicCode = "course_status")
|
||||
@Schema(description = "状态")
|
||||
private java.lang.String status;
|
||||
/**创建人*/
|
||||
@Schema(description = "创建人")
|
||||
private java.lang.String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
/**更新人*/
|
||||
@Schema(description = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
package org.jeecg.modules.aiol.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 com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
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.v3.oas.annotations.media.Schema;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 活动报名
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("aiol_activity_signup")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description="活动报名")
|
||||
public class AiolActivitySignup implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private java.lang.String id;
|
||||
/**姓名*/
|
||||
@Excel(name = "姓名", width = 15)
|
||||
@Schema(description = "姓名")
|
||||
private java.lang.String name;
|
||||
/**年龄*/
|
||||
@Excel(name = "年龄", width = 15)
|
||||
@Schema(description = "年龄")
|
||||
private java.lang.String age;
|
||||
/**手机号*/
|
||||
@Excel(name = "手机号", width = 15)
|
||||
@Schema(description = "手机号")
|
||||
private java.lang.String phone;
|
||||
/**邮箱*/
|
||||
@Excel(name = "邮箱", width = 15)
|
||||
@Schema(description = "邮箱")
|
||||
private java.lang.String email;
|
||||
/**扩展字段*/
|
||||
@Excel(name = "扩展字段", width = 15)
|
||||
@Schema(description = "扩展字段")
|
||||
private java.lang.String extra;
|
||||
/**附件*/
|
||||
@Excel(name = "附件", width = 15)
|
||||
@Schema(description = "附件")
|
||||
private java.lang.String attachment;
|
||||
/**创建人*/
|
||||
@Schema(description = "创建人")
|
||||
private java.lang.String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
/**更新人*/
|
||||
@Schema(description = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package org.jeecg.modules.aiol.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 com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
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.v3.oas.annotations.media.Schema;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 内容配置
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("aiol_content_config")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description="内容配置")
|
||||
public class AiolContentConfig implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private java.lang.String id;
|
||||
/**配置标识*/
|
||||
@Excel(name = "配置标识", width = 15)
|
||||
@Schema(description = "配置标识")
|
||||
private java.lang.String contentKey;
|
||||
/**配置值*/
|
||||
@Excel(name = "配置值", width = 15)
|
||||
@Schema(description = "配置值")
|
||||
private java.lang.String contentValue;
|
||||
/**值类型*/
|
||||
@Excel(name = "值类型", width = 15)
|
||||
@Schema(description = "值类型")
|
||||
private java.lang.String valueType;
|
||||
/**描述*/
|
||||
@Excel(name = "描述", width = 15)
|
||||
@Schema(description = "描述")
|
||||
private java.lang.String description;
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package org.jeecg.modules.aiol.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 com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
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.v3.oas.annotations.media.Schema;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 标签
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("aiol_tag")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description="标签")
|
||||
public class AiolTag implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private java.lang.String id;
|
||||
/**标签名*/
|
||||
@Excel(name = "标签名", width = 15)
|
||||
@Schema(description = "标签名")
|
||||
private java.lang.String name;
|
||||
/**目标类型*/
|
||||
@Excel(name = "目标类型", width = 15)
|
||||
@Schema(description = "目标类型")
|
||||
private java.lang.String targetType;
|
||||
/**目标id*/
|
||||
@Excel(name = "目标id", width = 15)
|
||||
@Schema(description = "目标id")
|
||||
private java.lang.String targetId;
|
||||
/**描述*/
|
||||
@Excel(name = "描述", width = 15)
|
||||
@Schema(description = "描述")
|
||||
private java.lang.String description;
|
||||
/**创建人*/
|
||||
@Schema(description = "创建人")
|
||||
private java.lang.String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
/**更新人*/
|
||||
@Schema(description = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package org.jeecg.modules.aiol.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.aiol.entity.AiolActivity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 活动
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface AiolActivityMapper extends BaseMapper<AiolActivity> {
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package org.jeecg.modules.aiol.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.aiol.entity.AiolActivitySignup;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 活动报名
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface AiolActivitySignupMapper extends BaseMapper<AiolActivitySignup> {
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package org.jeecg.modules.aiol.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.aiol.entity.AiolContentConfig;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 内容配置
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface AiolContentConfigMapper extends BaseMapper<AiolContentConfig> {
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package org.jeecg.modules.aiol.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.aiol.entity.AiolTag;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 标签
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface AiolTagMapper extends BaseMapper<AiolTag> {
|
||||
|
||||
}
|
@ -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.aiol.mapper.AiolActivityMapper">
|
||||
|
||||
</mapper>
|
@ -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.aiol.mapper.AiolActivitySignupMapper">
|
||||
|
||||
</mapper>
|
@ -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.aiol.mapper.AiolContentConfigMapper">
|
||||
|
||||
</mapper>
|
@ -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.aiol.mapper.AiolTagMapper">
|
||||
|
||||
</mapper>
|
@ -0,0 +1,14 @@
|
||||
package org.jeecg.modules.aiol.service;
|
||||
|
||||
import org.jeecg.modules.aiol.entity.AiolActivity;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 活动
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IAiolActivityService extends IService<AiolActivity> {
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package org.jeecg.modules.aiol.service;
|
||||
|
||||
import org.jeecg.modules.aiol.entity.AiolActivitySignup;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 活动报名
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IAiolActivitySignupService extends IService<AiolActivitySignup> {
|
||||
|
||||
}
|
@ -1,8 +1,11 @@
|
||||
package org.jeecg.modules.aiol.service;
|
||||
|
||||
import org.jeecg.modules.aiol.dto.CommentWithUserInfo;
|
||||
import org.jeecg.modules.aiol.entity.AiolComment;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 评论
|
||||
* @Author: jeecg-boot
|
||||
@ -10,5 +13,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IAiolCommentService extends IService<AiolComment> {
|
||||
/**
|
||||
* 根据目标类型和目标ID查询评论列表(包含用户信息)
|
||||
* @param targetType 目标类型
|
||||
* @param targetId 目标ID
|
||||
* @return
|
||||
*/
|
||||
List<CommentWithUserInfo> getCommentList(String targetType, String targetId);
|
||||
|
||||
/**
|
||||
* 查询所有精选评论列表(包含用户信息)
|
||||
* @return
|
||||
*/
|
||||
List<CommentWithUserInfo> getAllSelectedComments();
|
||||
}
|
||||
|
@ -0,0 +1,14 @@
|
||||
package org.jeecg.modules.aiol.service;
|
||||
|
||||
import org.jeecg.modules.aiol.entity.AiolContentConfig;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 内容配置
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IAiolContentConfigService extends IService<AiolContentConfig> {
|
||||
|
||||
}
|
@ -2,6 +2,10 @@ package org.jeecg.modules.aiol.service;
|
||||
|
||||
import org.jeecg.modules.aiol.entity.AiolResource;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 资源
|
||||
@ -10,5 +14,12 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IAiolResourceService extends IService<AiolResource> {
|
||||
|
||||
/**
|
||||
* 上传视频并切片为 HLS(m3u8+ts),按配置(local|minio|alioss)上传,返回各清晰度的 m3u8 路径/URL
|
||||
* @param file 上传的视频文件
|
||||
* @param request 用于读取 header 或环境配置
|
||||
* @return 各清晰度的 m3u8 路径/URL,Map的key为清晰度名称(如"480p", "720p", "1080p"),value为对应的URL
|
||||
* @throws Exception 处理异常
|
||||
*/
|
||||
Map<String, String> uploadHls(MultipartFile file, HttpServletRequest request) throws Exception;
|
||||
}
|
||||
|
@ -0,0 +1,14 @@
|
||||
package org.jeecg.modules.aiol.service;
|
||||
|
||||
import org.jeecg.modules.aiol.entity.AiolTag;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 标签
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IAiolTagService extends IService<AiolTag> {
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package org.jeecg.modules.aiol.service.impl;
|
||||
|
||||
import org.jeecg.modules.aiol.entity.AiolActivity;
|
||||
import org.jeecg.modules.aiol.mapper.AiolActivityMapper;
|
||||
import org.jeecg.modules.aiol.service.IAiolActivityService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 活动
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class AiolActivityServiceImpl extends ServiceImpl<AiolActivityMapper, AiolActivity> implements IAiolActivityService {
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package org.jeecg.modules.aiol.service.impl;
|
||||
|
||||
import org.jeecg.modules.aiol.entity.AiolActivitySignup;
|
||||
import org.jeecg.modules.aiol.mapper.AiolActivitySignupMapper;
|
||||
import org.jeecg.modules.aiol.service.IAiolActivitySignupService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 活动报名
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class AiolActivitySignupServiceImpl extends ServiceImpl<AiolActivitySignupMapper, AiolActivitySignup> implements IAiolActivitySignupService {
|
||||
|
||||
}
|
@ -1,12 +1,23 @@
|
||||
package org.jeecg.modules.aiol.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.jeecg.modules.aiol.dto.CommentWithUserInfo;
|
||||
import org.jeecg.modules.aiol.entity.AiolComment;
|
||||
import org.jeecg.modules.aiol.entity.AiolUserInfo;
|
||||
import org.jeecg.modules.aiol.mapper.AiolCommentMapper;
|
||||
import org.jeecg.modules.aiol.mapper.AiolUserInfoMapper;
|
||||
import org.jeecg.modules.aiol.service.IAiolCommentService;
|
||||
import org.jeecg.modules.system.entity.SysUser;
|
||||
import org.jeecg.modules.system.mapper.SysUserMapper;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 评论
|
||||
* @Author: jeecg-boot
|
||||
@ -15,5 +26,86 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
*/
|
||||
@Service
|
||||
public class AiolCommentServiceImpl extends ServiceImpl<AiolCommentMapper, AiolComment> implements IAiolCommentService {
|
||||
@Autowired
|
||||
private AiolUserInfoMapper userInfoMapper;
|
||||
@Autowired
|
||||
private SysUserMapper sysUserMapper;
|
||||
|
||||
@Override
|
||||
public List<CommentWithUserInfo> getCommentList(String targetType, String targetId) {
|
||||
// 1. 根据目标类型和目标ID查询评论列表
|
||||
QueryWrapper<AiolComment> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("target_type", targetType)
|
||||
.eq("target_id", targetId)
|
||||
.orderByDesc("iz_top") // 置顶评论在前
|
||||
.orderByDesc("create_time"); // 按时间倒序
|
||||
|
||||
List<AiolComment> comments = this.list(queryWrapper);
|
||||
|
||||
// 2. 根据userid关联查询用户信息,构建包含用户信息的评论列表
|
||||
List<CommentWithUserInfo> result = new ArrayList<>();
|
||||
for (AiolComment comment : comments) {
|
||||
CommentWithUserInfo commentWithUser = new CommentWithUserInfo();
|
||||
// 复制评论基本信息
|
||||
BeanUtils.copyProperties(comment, commentWithUser);
|
||||
|
||||
// 查询用户基本信息
|
||||
SysUser sysUser = sysUserMapper.selectById(comment.getUserId());
|
||||
if (sysUser != null) {
|
||||
commentWithUser.setUserName(sysUser.getRealname());
|
||||
commentWithUser.setUserAvatar(sysUser.getAvatar());
|
||||
|
||||
// 查询用户扩展信息
|
||||
AiolUserInfo userInfo = userInfoMapper.selectOne(
|
||||
new QueryWrapper<AiolUserInfo>().eq("user_id", comment.getUserId())
|
||||
);
|
||||
if (userInfo != null) {
|
||||
commentWithUser.setUserTag(userInfo.getTag());
|
||||
}
|
||||
}
|
||||
|
||||
result.add(commentWithUser);
|
||||
}
|
||||
|
||||
// 3. 返回评论列表
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommentWithUserInfo> getAllSelectedComments() {
|
||||
// 1. 查询所有评论,按置顶和时间排序
|
||||
QueryWrapper<AiolComment> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.orderByDesc("iz_top") // 置顶评论在前
|
||||
.orderByDesc("create_time"); // 按时间倒序
|
||||
|
||||
List<AiolComment> comments = this.list(queryWrapper);
|
||||
|
||||
// 2. 根据userid关联查询用户信息,构建包含用户信息的评论列表
|
||||
List<CommentWithUserInfo> result = new ArrayList<>();
|
||||
for (AiolComment comment : comments) {
|
||||
CommentWithUserInfo commentWithUser = new CommentWithUserInfo();
|
||||
// 复制评论基本信息
|
||||
BeanUtils.copyProperties(comment, commentWithUser);
|
||||
|
||||
// 查询用户基本信息
|
||||
SysUser sysUser = sysUserMapper.selectById(comment.getUserId());
|
||||
if (sysUser != null) {
|
||||
commentWithUser.setUserName(sysUser.getRealname());
|
||||
commentWithUser.setUserAvatar(sysUser.getAvatar());
|
||||
|
||||
// 查询用户扩展信息
|
||||
AiolUserInfo userInfo = userInfoMapper.selectOne(
|
||||
new QueryWrapper<AiolUserInfo>().eq("user_id", comment.getUserId())
|
||||
);
|
||||
if (userInfo != null) {
|
||||
commentWithUser.setUserTag(userInfo.getTag());
|
||||
}
|
||||
}
|
||||
|
||||
result.add(commentWithUser);
|
||||
}
|
||||
|
||||
// 3. 返回评论列表
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,19 @@
|
||||
package org.jeecg.modules.aiol.service.impl;
|
||||
|
||||
import org.jeecg.modules.aiol.entity.AiolContentConfig;
|
||||
import org.jeecg.modules.aiol.mapper.AiolContentConfigMapper;
|
||||
import org.jeecg.modules.aiol.service.IAiolContentConfigService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 内容配置
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class AiolContentConfigServiceImpl extends ServiceImpl<AiolContentConfigMapper, AiolContentConfig> implements IAiolContentConfigService {
|
||||
|
||||
}
|
@ -1,11 +1,34 @@
|
||||
package org.jeecg.modules.aiol.service.impl;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.util.CommonUtils;
|
||||
import org.jeecg.common.util.MinioUtil;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.oss.OssBootUtil;
|
||||
import org.jeecg.modules.aiol.entity.AiolResource;
|
||||
import org.jeecg.modules.aiol.mapper.AiolResourceMapper;
|
||||
import org.jeecg.modules.aiol.service.IAiolResourceService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @Description: 资源
|
||||
@ -14,6 +37,291 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class AiolResourceServiceImpl extends ServiceImpl<AiolResourceMapper, AiolResource> implements IAiolResourceService {
|
||||
|
||||
/**
|
||||
* 视频清晰度配置
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static class VideoQuality {
|
||||
private String name; // 清晰度名称
|
||||
private String outputDir; // 输出目录
|
||||
private int width; // 宽度
|
||||
private int height; // 高度
|
||||
private String bitrate; // 视频比特率
|
||||
private String audioRate; // 音频比特率
|
||||
}
|
||||
|
||||
// 预定义的清晰度配置
|
||||
private static final List<VideoQuality> QUALITY_CONFIGS = Arrays.asList(
|
||||
new VideoQuality("480p", "480p", 854, 480, "1000k", "96k"),
|
||||
new VideoQuality("720p", "720p", 1280, 720, "2500k", "128k"),
|
||||
new VideoQuality("1080p", "1080p", 1920, 1080, "5000k", "192k")
|
||||
);
|
||||
|
||||
private static final int SEGMENT_TIME = 10; // HLS切片时长(秒)
|
||||
private static final ExecutorService executorService = Executors.newFixedThreadPool(3);
|
||||
|
||||
@Override
|
||||
public Map<String, String> uploadHls(MultipartFile file, HttpServletRequest request) throws Exception {
|
||||
// 读取上传类型
|
||||
String configUploadType = SpringContextUtils.getApplicationContext().getEnvironment().getProperty("jeecg.uploadType", "minio");
|
||||
String uploadType = configUploadType;
|
||||
|
||||
// 1) 保存临时原始视频
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
String tmpRoot = System.getProperty("java.io.tmpdir");
|
||||
Path tmpVideoDir = Path.of(tmpRoot, "jeecg", "video", uuid);
|
||||
Path hlsBaseDir = Path.of(tmpRoot, "jeecg", "hls", uuid);
|
||||
Files.createDirectories(tmpVideoDir);
|
||||
Files.createDirectories(hlsBaseDir);
|
||||
|
||||
String original = CommonUtils.getFileName(Objects.requireNonNull(file.getOriginalFilename()));
|
||||
Path tmpVideoFile = tmpVideoDir.resolve(original);
|
||||
Files.copy(file.getInputStream(), tmpVideoFile, StandardCopyOption.REPLACE_EXISTING);
|
||||
|
||||
log.info("开始多清晰度视频处理,文件: {}", original);
|
||||
|
||||
try {
|
||||
// 2) 并行处理多个清晰度
|
||||
List<CompletableFuture<Map<String, String>>> futures = new ArrayList<>();
|
||||
|
||||
for (VideoQuality quality : QUALITY_CONFIGS) {
|
||||
CompletableFuture<Map<String, String>> future = CompletableFuture.supplyAsync(() -> {
|
||||
try {
|
||||
return processVideoQuality(tmpVideoFile, hlsBaseDir, quality, uploadType, uuid);
|
||||
} catch (Exception e) {
|
||||
log.error("处理{}清晰度失败", quality.getName(), e);
|
||||
throw new RuntimeException("处理" + quality.getName() + "清晰度失败: " + e.getMessage());
|
||||
}
|
||||
}, executorService);
|
||||
futures.add(future);
|
||||
}
|
||||
|
||||
// 3) 等待所有清晰度处理完成
|
||||
CompletableFuture<Void> allFutures = CompletableFuture.allOf(
|
||||
futures.toArray(new CompletableFuture[0])
|
||||
);
|
||||
|
||||
// 设置超时时间为30分钟
|
||||
allFutures.get(30, TimeUnit.MINUTES);
|
||||
|
||||
// 4) 收集结果 - 各清晰度的index.m3u8地址
|
||||
Map<String, String> qualityUrls = new HashMap<>();
|
||||
for (CompletableFuture<Map<String, String>> future : futures) {
|
||||
qualityUrls.putAll(future.get());
|
||||
}
|
||||
|
||||
log.info("多清晰度视频处理完成,各清晰度地址: {}", qualityUrls);
|
||||
return qualityUrls;
|
||||
|
||||
} finally {
|
||||
// 清理临时文件
|
||||
deleteQuietly(hlsBaseDir.toFile());
|
||||
deleteQuietly(tmpVideoDir.toFile());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理单个清晰度的视频切片
|
||||
*/
|
||||
private Map<String, String> processVideoQuality(Path inputFile, Path hlsBaseDir, VideoQuality quality, String uploadType, String uuid) throws Exception {
|
||||
log.info("开始处理 {} 清晰度...", quality.getName());
|
||||
|
||||
// 创建清晰度输出目录
|
||||
Path outputDir = hlsBaseDir.resolve(quality.getOutputDir());
|
||||
Files.createDirectories(outputDir);
|
||||
|
||||
Path playlistPath = outputDir.resolve("index.m3u8");
|
||||
|
||||
// 构建FFmpeg命令 - 参考Go代码
|
||||
List<String> args = Arrays.asList(
|
||||
"ffmpeg", "-i", inputFile.toString(),
|
||||
"-vf", String.format("scale=%d:%d", quality.getWidth(), quality.getHeight()),
|
||||
"-c:v", "libx264",
|
||||
"-b:v", quality.getBitrate(),
|
||||
"-c:a", "aac",
|
||||
"-b:a", quality.getAudioRate(),
|
||||
"-hls_time", String.valueOf(SEGMENT_TIME),
|
||||
"-hls_playlist_type", "vod",
|
||||
"-hls_segment_filename", outputDir.resolve("segment%d.ts").toString(),
|
||||
"-y", // 覆盖已存在的文件
|
||||
playlistPath.toString()
|
||||
);
|
||||
|
||||
// 执行FFmpeg并处理日志
|
||||
executeFFmpegWithLogging(args, quality.getName());
|
||||
|
||||
log.info("{} 清晰度处理完成", quality.getName());
|
||||
|
||||
// 上传切片文件
|
||||
return uploadQualityFiles(outputDir, quality, uploadType, uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传单个清晰度的所有文件
|
||||
*/
|
||||
private Map<String, String> uploadQualityFiles(Path outputDir, VideoQuality quality, String uploadType, String uuid) throws Exception {
|
||||
Map<String, String> urls = new HashMap<>();
|
||||
String basePrefix = "video/hls/" + uuid + "/" + quality.getOutputDir();
|
||||
String m3u8Url = "";
|
||||
|
||||
try (Stream<Path> paths = Files.list(outputDir)) {
|
||||
for (Path file : (Iterable<Path>) paths::iterator) {
|
||||
if (!Files.isRegularFile(file)) continue;
|
||||
|
||||
String fileName = file.getFileName().toString();
|
||||
String relativePath = basePrefix + "/" + fileName;
|
||||
|
||||
try (InputStream in = Files.newInputStream(file)) {
|
||||
String fileUrl = "";
|
||||
if ("minio".equals(uploadType)) {
|
||||
fileUrl = MinioUtil.upload(in, relativePath);
|
||||
} else if ("alioss".equals(uploadType)) {
|
||||
OssBootUtil.upload(in, relativePath);
|
||||
fileUrl = relativePath; // 可在网关拼域名
|
||||
} else {
|
||||
// 本地存储
|
||||
String uploadpath = SpringContextUtils.getApplicationContext().getEnvironment().getProperty("jeecg.path.upload");
|
||||
Path target = Path.of(uploadpath, relativePath);
|
||||
Files.createDirectories(target.getParent());
|
||||
Files.copy(file, target, StandardCopyOption.REPLACE_EXISTING);
|
||||
fileUrl = relativePath;
|
||||
}
|
||||
|
||||
if (fileName.endsWith(".m3u8")) {
|
||||
m3u8Url = fileUrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
urls.put(quality.getName(), m3u8Url);
|
||||
return urls;
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行FFmpeg命令并处理日志输出
|
||||
*/
|
||||
private void executeFFmpegWithLogging(List<String> args, String qualityName) throws Exception {
|
||||
// 打印FFmpeg命令
|
||||
log.info("执行FFmpeg命令[{}]: {}", qualityName, String.join(" ", args));
|
||||
|
||||
ProcessBuilder pb = new ProcessBuilder(args);
|
||||
pb.redirectErrorStream(true); // 将错误输出重定向到标准输出
|
||||
Process process = pb.start();
|
||||
|
||||
// 使用单独的线程来读取FFmpeg输出,避免阻塞
|
||||
StringBuilder ffmpegOutput = new StringBuilder();
|
||||
Thread logThread = new Thread(() -> {
|
||||
try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()))) {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
synchronized (ffmpegOutput) {
|
||||
ffmpegOutput.append(line).append("\n");
|
||||
}
|
||||
|
||||
// 输出详细日志到DEBUG级别
|
||||
log.debug("FFmpeg[{}]: {}", qualityName, line);
|
||||
|
||||
// 过滤并输出关键进度信息
|
||||
if (line.contains("frame=") && line.contains("time=")) {
|
||||
// 提取进度信息
|
||||
String progressInfo = extractProgressInfo(line);
|
||||
if (progressInfo != null) {
|
||||
log.info("FFmpeg进度[{}]: {}", qualityName, progressInfo);
|
||||
}
|
||||
}
|
||||
|
||||
// 输出警告和错误信息
|
||||
if (line.toLowerCase().contains("warning") || line.toLowerCase().contains("error")) {
|
||||
log.warn("FFmpeg[{}]: {}", qualityName, line);
|
||||
}
|
||||
|
||||
// 输出关键状态信息
|
||||
if (line.contains("Stream mapping:") || line.contains("Press [q] to stop") ||
|
||||
line.contains("video:") || line.contains("audio:")) {
|
||||
log.info("FFmpeg[{}]: {}", qualityName, line);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("读取FFmpeg输出时发生错误[{}]", qualityName, e);
|
||||
}
|
||||
});
|
||||
|
||||
logThread.setDaemon(true);
|
||||
logThread.start();
|
||||
|
||||
// 等待进程完成
|
||||
boolean finished = process.waitFor(15, TimeUnit.MINUTES);
|
||||
int exitCode = process.exitValue();
|
||||
|
||||
// 等待日志线程完成
|
||||
logThread.join(5000); // 最多等待5秒
|
||||
|
||||
if (!finished || exitCode != 0) {
|
||||
synchronized (ffmpegOutput) {
|
||||
log.error("FFmpeg处理[{}]失败,退出码: {}", qualityName, exitCode);
|
||||
log.error("FFmpeg完整输出[{}]:\n{}", qualityName, ffmpegOutput.toString());
|
||||
}
|
||||
throw new RuntimeException(String.format("FFmpeg处理%s失败,退出码: %d", qualityName, exitCode));
|
||||
}
|
||||
|
||||
log.info("FFmpeg处理[{}]成功完成", qualityName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从FFmpeg输出行中提取进度信息
|
||||
*/
|
||||
private String extractProgressInfo(String line) {
|
||||
try {
|
||||
// FFmpeg进度行格式示例:
|
||||
// frame= 1234 fps= 25 q=23.0 size= 12345kB time=00:01:23.45 bitrate=1234.5kbits/s speed=1.23x
|
||||
if (line.contains("time=") && line.contains("bitrate=")) {
|
||||
// 提取时间和比特率信息
|
||||
String time = "";
|
||||
String bitrate = "";
|
||||
String speed = "";
|
||||
String frame = "";
|
||||
|
||||
String[] parts = line.split("\\s+");
|
||||
for (String part : parts) {
|
||||
if (part.startsWith("time=")) {
|
||||
time = part.substring(5);
|
||||
} else if (part.startsWith("bitrate=")) {
|
||||
bitrate = part.substring(8);
|
||||
} else if (part.startsWith("speed=")) {
|
||||
speed = part.substring(6);
|
||||
} else if (part.startsWith("frame=")) {
|
||||
frame = part.substring(6);
|
||||
}
|
||||
}
|
||||
|
||||
if (!time.isEmpty()) {
|
||||
return String.format("frame=%s time=%s bitrate=%s speed=%s", frame, time, bitrate, speed);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 解析失败时忽略,返回原始行
|
||||
return line.trim();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** 删除临时目录文件 */
|
||||
private static void deleteQuietly(File file) {
|
||||
try {
|
||||
if (file == null || !file.exists()) return;
|
||||
if (file.isDirectory()) {
|
||||
File[] children = file.listFiles();
|
||||
if (children != null) {
|
||||
for (File c : children) deleteQuietly(c);
|
||||
}
|
||||
}
|
||||
file.delete();
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,19 @@
|
||||
package org.jeecg.modules.aiol.service.impl;
|
||||
|
||||
import org.jeecg.modules.aiol.entity.AiolTag;
|
||||
import org.jeecg.modules.aiol.mapper.AiolTagMapper;
|
||||
import org.jeecg.modules.aiol.service.IAiolTagService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 标签
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-31
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class AiolTagServiceImpl extends ServiceImpl<AiolTagMapper, AiolTag> implements IAiolTagService {
|
||||
|
||||
}
|
@ -0,0 +1,133 @@
|
||||
<template>
|
||||
<view>
|
||||
<!--标题和返回-->
|
||||
<cu-custom :bgColor="NavBarColor" isBack :backRouterName="backRouteName">
|
||||
<block slot="backText">返回</block>
|
||||
<block slot="content">活动</block>
|
||||
</cu-custom>
|
||||
<!--表单区域-->
|
||||
<view>
|
||||
<form>
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center">
|
||||
<view class="title"><text space="ensp">标题:</text></view>
|
||||
<input placeholder="请输入标题" v-model="model.title"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center">
|
||||
<view class="title"><text space="ensp">介绍:</text></view>
|
||||
<input placeholder="请输入介绍" v-model="model.introduction"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center">
|
||||
<view class="title"><text space="ensp">说明图片:</text></view>
|
||||
<input placeholder="请输入说明图片" v-model="model.imgs"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center">
|
||||
<view class="title"><text space="ensp">头图:</text></view>
|
||||
<input placeholder="请输入头图" v-model="model.banner"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center">
|
||||
<view class="title"><text space="ensp">介绍视频:</text></view>
|
||||
<input placeholder="请输入介绍视频" v-model="model.video"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center">
|
||||
<view class="title"><text space="ensp">报名人数上限:</text></view>
|
||||
<input type="number" placeholder="请输入报名人数上限" v-model="model.maxNum"/>
|
||||
</view>
|
||||
</view>
|
||||
<my-date label="开始时间:" v-model="model.startTime" placeholder="请输入开始时间"></my-date>
|
||||
<my-date label="结束时间:" v-model="model.endTime" placeholder="请输入结束时间"></my-date>
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center">
|
||||
<view class="title"><text space="ensp">扩展字段:</text></view>
|
||||
<input placeholder="请输入扩展字段" v-model="model.extra"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center">
|
||||
<view class="title"><text space="ensp">附件:</text></view>
|
||||
<input placeholder="请输入附件" v-model="model.attachment"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center">
|
||||
<view class="title"><text space="ensp">状态:</text></view>
|
||||
<input placeholder="请输入状态" v-model="model.status"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding">
|
||||
<button class="cu-btn block bg-blue margin-tb-sm lg" @click="onSubmit">
|
||||
<text v-if="loading" class="cuIcon-loading2 cuIconfont-spin"></text>提交
|
||||
</button>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import myDate from '@/components/my-componets/my-date.vue'
|
||||
|
||||
export default {
|
||||
name: "AiolActivityForm",
|
||||
components:{ myDate },
|
||||
props:{
|
||||
formData:{
|
||||
type:Object,
|
||||
default:()=>{},
|
||||
required:false
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
CustomBar: this.CustomBar,
|
||||
NavBarColor: this.NavBarColor,
|
||||
loading:false,
|
||||
model: {},
|
||||
backRouteName:'index',
|
||||
url: {
|
||||
queryById: "/aiol/aiolActivity/queryById",
|
||||
add: "/aiol/aiolActivity/add",
|
||||
edit: "/aiol/aiolActivity/edit",
|
||||
},
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.initFormData();
|
||||
},
|
||||
methods:{
|
||||
initFormData(){
|
||||
if(this.formData){
|
||||
let dataId = this.formData.dataId;
|
||||
this.$http.get(this.url.queryById,{params:{id:dataId}}).then((res)=>{
|
||||
if(res.data.success){
|
||||
console.log("表单数据",res);
|
||||
this.model = res.data.result;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
onSubmit() {
|
||||
let myForm = {...this.model};
|
||||
this.loading = true;
|
||||
let url = myForm.id?this.url.edit:this.url.add;
|
||||
this.$http.post(url,myForm).then(res=>{
|
||||
console.log("res",res)
|
||||
this.loading = false
|
||||
this.$Router.push({name:this.backRouteName})
|
||||
}).catch(()=>{
|
||||
this.loading = false
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<view>
|
||||
<!--标题和返回-->
|
||||
<cu-custom :bgColor="NavBarColor" isBack>
|
||||
<block slot="backText">返回</block>
|
||||
<block slot="content">活动</block>
|
||||
</cu-custom>
|
||||
<!--滚动加载列表-->
|
||||
<mescroll-body ref="mescrollRef" bottom="88" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback" @up="upCallback">
|
||||
<view class="cu-list menu">
|
||||
<view class="cu-item" v-for="(item,index) in list" :key="index" @click="goHome">
|
||||
<view class="flex" style="width:100%">
|
||||
<text class="text-lg" style="color: #000;">
|
||||
{{ item.createBy}}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</mescroll-body>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
|
||||
import Mixin from "@/common/mixin/Mixin.js";
|
||||
|
||||
export default {
|
||||
name: '活动',
|
||||
mixins: [MescrollMixin,Mixin],
|
||||
data() {
|
||||
return {
|
||||
CustomBar:this.CustomBar,
|
||||
NavBarColor:this.NavBarColor,
|
||||
url: "/aiol/aiolActivity/list",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
goHome(){
|
||||
this.$Router.push({name: "index"})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<view>
|
||||
<!--标题和返回-->
|
||||
<cu-custom :bgColor="NavBarColor" isBack :backRouterName="backRouteName">
|
||||
<block slot="backText">返回</block>
|
||||
<block slot="content">活动报名</block>
|
||||
</cu-custom>
|
||||
<!--表单区域-->
|
||||
<view>
|
||||
<form>
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center">
|
||||
<view class="title"><text space="ensp">姓名:</text></view>
|
||||
<input placeholder="请输入姓名" v-model="model.name"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center">
|
||||
<view class="title"><text space="ensp">年龄:</text></view>
|
||||
<input placeholder="请输入年龄" v-model="model.age"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center">
|
||||
<view class="title"><text space="ensp">手机号:</text></view>
|
||||
<input placeholder="请输入手机号" v-model="model.phone"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center">
|
||||
<view class="title"><text space="ensp">邮箱:</text></view>
|
||||
<input placeholder="请输入邮箱" v-model="model.email"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center">
|
||||
<view class="title"><text space="ensp">扩展字段:</text></view>
|
||||
<input placeholder="请输入扩展字段" v-model="model.extra"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center">
|
||||
<view class="title"><text space="ensp">附件:</text></view>
|
||||
<input placeholder="请输入附件" v-model="model.attachment"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding">
|
||||
<button class="cu-btn block bg-blue margin-tb-sm lg" @click="onSubmit">
|
||||
<text v-if="loading" class="cuIcon-loading2 cuIconfont-spin"></text>提交
|
||||
</button>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import myDate from '@/components/my-componets/my-date.vue'
|
||||
|
||||
export default {
|
||||
name: "AiolActivitySignupForm",
|
||||
components:{ myDate },
|
||||
props:{
|
||||
formData:{
|
||||
type:Object,
|
||||
default:()=>{},
|
||||
required:false
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
CustomBar: this.CustomBar,
|
||||
NavBarColor: this.NavBarColor,
|
||||
loading:false,
|
||||
model: {},
|
||||
backRouteName:'index',
|
||||
url: {
|
||||
queryById: "/aiol/aiolActivitySignup/queryById",
|
||||
add: "/aiol/aiolActivitySignup/add",
|
||||
edit: "/aiol/aiolActivitySignup/edit",
|
||||
},
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.initFormData();
|
||||
},
|
||||
methods:{
|
||||
initFormData(){
|
||||
if(this.formData){
|
||||
let dataId = this.formData.dataId;
|
||||
this.$http.get(this.url.queryById,{params:{id:dataId}}).then((res)=>{
|
||||
if(res.data.success){
|
||||
console.log("表单数据",res);
|
||||
this.model = res.data.result;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
onSubmit() {
|
||||
let myForm = {...this.model};
|
||||
this.loading = true;
|
||||
let url = myForm.id?this.url.edit:this.url.add;
|
||||
this.$http.post(url,myForm).then(res=>{
|
||||
console.log("res",res)
|
||||
this.loading = false
|
||||
this.$Router.push({name:this.backRouteName})
|
||||
}).catch(()=>{
|
||||
this.loading = false
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<view>
|
||||
<!--标题和返回-->
|
||||
<cu-custom :bgColor="NavBarColor" isBack>
|
||||
<block slot="backText">返回</block>
|
||||
<block slot="content">活动报名</block>
|
||||
</cu-custom>
|
||||
<!--滚动加载列表-->
|
||||
<mescroll-body ref="mescrollRef" bottom="88" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback" @up="upCallback">
|
||||
<view class="cu-list menu">
|
||||
<view class="cu-item" v-for="(item,index) in list" :key="index" @click="goHome">
|
||||
<view class="flex" style="width:100%">
|
||||
<text class="text-lg" style="color: #000;">
|
||||
{{ item.createBy}}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</mescroll-body>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
|
||||
import Mixin from "@/common/mixin/Mixin.js";
|
||||
|
||||
export default {
|
||||
name: '活动报名',
|
||||
mixins: [MescrollMixin,Mixin],
|
||||
data() {
|
||||
return {
|
||||
CustomBar:this.CustomBar,
|
||||
NavBarColor:this.NavBarColor,
|
||||
url: "/aiol/aiolActivitySignup/list",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
goHome(){
|
||||
this.$Router.push({name: "index"})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -0,0 +1,101 @@
|
||||
<template>
|
||||
<view>
|
||||
<!--标题和返回-->
|
||||
<cu-custom :bgColor="NavBarColor" isBack :backRouterName="backRouteName">
|
||||
<block slot="backText">返回</block>
|
||||
<block slot="content">内容配置</block>
|
||||
</cu-custom>
|
||||
<!--表单区域-->
|
||||
<view>
|
||||
<form>
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center">
|
||||
<view class="title"><text space="ensp">配置标识:</text></view>
|
||||
<input placeholder="请输入配置标识" v-model="model.contentKey"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center">
|
||||
<view class="title"><text space="ensp">配置值:</text></view>
|
||||
<input placeholder="请输入配置值" v-model="model.contentValue"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center">
|
||||
<view class="title"><text space="ensp">值类型:</text></view>
|
||||
<input placeholder="请输入值类型" v-model="model.valueType"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center">
|
||||
<view class="title"><text space="ensp">描述:</text></view>
|
||||
<input placeholder="请输入描述" v-model="model.description"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding">
|
||||
<button class="cu-btn block bg-blue margin-tb-sm lg" @click="onSubmit">
|
||||
<text v-if="loading" class="cuIcon-loading2 cuIconfont-spin"></text>提交
|
||||
</button>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import myDate from '@/components/my-componets/my-date.vue'
|
||||
|
||||
export default {
|
||||
name: "AiolContentConfigForm",
|
||||
components:{ myDate },
|
||||
props:{
|
||||
formData:{
|
||||
type:Object,
|
||||
default:()=>{},
|
||||
required:false
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
CustomBar: this.CustomBar,
|
||||
NavBarColor: this.NavBarColor,
|
||||
loading:false,
|
||||
model: {},
|
||||
backRouteName:'index',
|
||||
url: {
|
||||
queryById: "/aiol/aiolContentConfig/queryById",
|
||||
add: "/aiol/aiolContentConfig/add",
|
||||
edit: "/aiol/aiolContentConfig/edit",
|
||||
},
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.initFormData();
|
||||
},
|
||||
methods:{
|
||||
initFormData(){
|
||||
if(this.formData){
|
||||
let dataId = this.formData.dataId;
|
||||
this.$http.get(this.url.queryById,{params:{id:dataId}}).then((res)=>{
|
||||
if(res.data.success){
|
||||
console.log("表单数据",res);
|
||||
this.model = res.data.result;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
onSubmit() {
|
||||
let myForm = {...this.model};
|
||||
this.loading = true;
|
||||
let url = myForm.id?this.url.edit:this.url.add;
|
||||
this.$http.post(url,myForm).then(res=>{
|
||||
console.log("res",res)
|
||||
this.loading = false
|
||||
this.$Router.push({name:this.backRouteName})
|
||||
}).catch(()=>{
|
||||
this.loading = false
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<view>
|
||||
<!--标题和返回-->
|
||||
<cu-custom :bgColor="NavBarColor" isBack>
|
||||
<block slot="backText">返回</block>
|
||||
<block slot="content">内容配置</block>
|
||||
</cu-custom>
|
||||
<!--滚动加载列表-->
|
||||
<mescroll-body ref="mescrollRef" bottom="88" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback" @up="upCallback">
|
||||
<view class="cu-list menu">
|
||||
<view class="cu-item" v-for="(item,index) in list" :key="index" @click="goHome">
|
||||
<view class="flex" style="width:100%">
|
||||
<text class="text-lg" style="color: #000;">
|
||||
{{ item.createBy}}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</mescroll-body>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
|
||||
import Mixin from "@/common/mixin/Mixin.js";
|
||||
|
||||
export default {
|
||||
name: '内容配置',
|
||||
mixins: [MescrollMixin,Mixin],
|
||||
data() {
|
||||
return {
|
||||
CustomBar:this.CustomBar,
|
||||
NavBarColor:this.NavBarColor,
|
||||
url: "/aiol/aiolContentConfig/list",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
goHome(){
|
||||
this.$Router.push({name: "index"})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -0,0 +1,101 @@
|
||||
<template>
|
||||
<view>
|
||||
<!--标题和返回-->
|
||||
<cu-custom :bgColor="NavBarColor" isBack :backRouterName="backRouteName">
|
||||
<block slot="backText">返回</block>
|
||||
<block slot="content">标签</block>
|
||||
</cu-custom>
|
||||
<!--表单区域-->
|
||||
<view>
|
||||
<form>
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center">
|
||||
<view class="title"><text space="ensp">标签名:</text></view>
|
||||
<input placeholder="请输入标签名" v-model="model.name"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center">
|
||||
<view class="title"><text space="ensp">目标类型:</text></view>
|
||||
<input placeholder="请输入目标类型" v-model="model.targetType"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center">
|
||||
<view class="title"><text space="ensp">目标id:</text></view>
|
||||
<input placeholder="请输入目标id" v-model="model.targetId"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center">
|
||||
<view class="title"><text space="ensp">描述:</text></view>
|
||||
<input placeholder="请输入描述" v-model="model.description"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding">
|
||||
<button class="cu-btn block bg-blue margin-tb-sm lg" @click="onSubmit">
|
||||
<text v-if="loading" class="cuIcon-loading2 cuIconfont-spin"></text>提交
|
||||
</button>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import myDate from '@/components/my-componets/my-date.vue'
|
||||
|
||||
export default {
|
||||
name: "AiolTagForm",
|
||||
components:{ myDate },
|
||||
props:{
|
||||
formData:{
|
||||
type:Object,
|
||||
default:()=>{},
|
||||
required:false
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
CustomBar: this.CustomBar,
|
||||
NavBarColor: this.NavBarColor,
|
||||
loading:false,
|
||||
model: {},
|
||||
backRouteName:'index',
|
||||
url: {
|
||||
queryById: "/aiol/aiolTag/queryById",
|
||||
add: "/aiol/aiolTag/add",
|
||||
edit: "/aiol/aiolTag/edit",
|
||||
},
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.initFormData();
|
||||
},
|
||||
methods:{
|
||||
initFormData(){
|
||||
if(this.formData){
|
||||
let dataId = this.formData.dataId;
|
||||
this.$http.get(this.url.queryById,{params:{id:dataId}}).then((res)=>{
|
||||
if(res.data.success){
|
||||
console.log("表单数据",res);
|
||||
this.model = res.data.result;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
onSubmit() {
|
||||
let myForm = {...this.model};
|
||||
this.loading = true;
|
||||
let url = myForm.id?this.url.edit:this.url.add;
|
||||
this.$http.post(url,myForm).then(res=>{
|
||||
console.log("res",res)
|
||||
this.loading = false
|
||||
this.$Router.push({name:this.backRouteName})
|
||||
}).catch(()=>{
|
||||
this.loading = false
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<view>
|
||||
<!--标题和返回-->
|
||||
<cu-custom :bgColor="NavBarColor" isBack>
|
||||
<block slot="backText">返回</block>
|
||||
<block slot="content">标签</block>
|
||||
</cu-custom>
|
||||
<!--滚动加载列表-->
|
||||
<mescroll-body ref="mescrollRef" bottom="88" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback" @up="upCallback">
|
||||
<view class="cu-list menu">
|
||||
<view class="cu-item" v-for="(item,index) in list" :key="index" @click="goHome">
|
||||
<view class="flex" style="width:100%">
|
||||
<text class="text-lg" style="color: #000;">
|
||||
{{ item.createBy}}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</mescroll-body>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
|
||||
import Mixin from "@/common/mixin/Mixin.js";
|
||||
|
||||
export default {
|
||||
name: '标签',
|
||||
mixins: [MescrollMixin,Mixin],
|
||||
data() {
|
||||
return {
|
||||
CustomBar:this.CustomBar,
|
||||
NavBarColor:this.NavBarColor,
|
||||
url: "/aiol/aiolTag/list",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
goHome(){
|
||||
this.$Router.push({name: "index"})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -0,0 +1,61 @@
|
||||
import { render } from '@/common/renderUtils';
|
||||
//列表数据
|
||||
export const columns = [
|
||||
{
|
||||
title: '标题',
|
||||
align:"center",
|
||||
dataIndex: 'title'
|
||||
},
|
||||
{
|
||||
title: '介绍',
|
||||
align:"center",
|
||||
dataIndex: 'introduction',
|
||||
},
|
||||
{
|
||||
title: '说明图片',
|
||||
align:"center",
|
||||
dataIndex: 'imgs',
|
||||
customRender:render.renderImage,
|
||||
},
|
||||
{
|
||||
title: '头图',
|
||||
align:"center",
|
||||
dataIndex: 'banner',
|
||||
customRender:render.renderImage,
|
||||
},
|
||||
{
|
||||
title: '介绍视频',
|
||||
align:"center",
|
||||
dataIndex: 'video',
|
||||
},
|
||||
{
|
||||
title: '报名人数上限',
|
||||
align:"center",
|
||||
dataIndex: 'maxNum'
|
||||
},
|
||||
{
|
||||
title: '开始时间',
|
||||
align:"center",
|
||||
dataIndex: 'startTime'
|
||||
},
|
||||
{
|
||||
title: '结束时间',
|
||||
align:"center",
|
||||
dataIndex: 'endTime'
|
||||
},
|
||||
{
|
||||
title: '扩展字段',
|
||||
align:"center",
|
||||
dataIndex: 'extra'
|
||||
},
|
||||
{
|
||||
title: '附件',
|
||||
align:"center",
|
||||
dataIndex: 'attachment',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
align:"center",
|
||||
dataIndex: 'status_dictText'
|
||||
},
|
||||
];
|
@ -0,0 +1,326 @@
|
||||
<route lang="json5" type="page">
|
||||
{
|
||||
layout: 'default',
|
||||
style: {
|
||||
navigationStyle: 'custom',
|
||||
navigationBarTitleText: '活动',
|
||||
},
|
||||
}
|
||||
</route>
|
||||
<template>
|
||||
<PageLayout :navTitle="navTitle" :backRouteName="backRouteName">
|
||||
<scroll-view class="scrollArea" scroll-y>
|
||||
<view class="form-container">
|
||||
<wd-form ref="form" :model="myFormData">
|
||||
<wd-cell-group border>
|
||||
<view class="{ 'mt-14px': 0 == 0 }">
|
||||
<wd-input
|
||||
label-width="100px"
|
||||
v-model="myFormData['title']"
|
||||
:label="get4Label('标题')"
|
||||
name='title'
|
||||
prop='title'
|
||||
placeholder="请选择标题"
|
||||
:rules="[
|
||||
]"
|
||||
clearable
|
||||
/>
|
||||
</view>
|
||||
<view class="{ 'mt-14px': 1 == 0 }">
|
||||
<wd-textarea
|
||||
:label="get4Label('介绍')"
|
||||
labelWidth="100px"
|
||||
type="umeditor"
|
||||
name='introduction'
|
||||
prop='introduction'
|
||||
clearable
|
||||
:maxlength="300"
|
||||
v-model="myFormData['introduction']"
|
||||
></wd-textarea>
|
||||
</view>
|
||||
<view class="{ 'mt-14px': 0 == 0 }">
|
||||
<!-- 图片 -->
|
||||
<wd-cell
|
||||
:title="get4Label('说明图片')"
|
||||
title-width="100px"
|
||||
>
|
||||
<online-image
|
||||
v-model:value="myFormData['imgs']"
|
||||
name='imgs'
|
||||
/>
|
||||
</wd-cell>
|
||||
</view>
|
||||
<view class="{ 'mt-14px': 1 == 0 }">
|
||||
<!-- 图片 -->
|
||||
<wd-cell
|
||||
:title="get4Label('头图')"
|
||||
title-width="100px"
|
||||
>
|
||||
<online-image
|
||||
v-model:value="myFormData['banner']"
|
||||
name='banner'
|
||||
/>
|
||||
</wd-cell>
|
||||
</view>
|
||||
<view class="{ 'mt-14px': 0 == 0 }">
|
||||
<wd-cell
|
||||
:title="get4Label('介绍视频')"
|
||||
title-width="100px"
|
||||
>
|
||||
|
||||
<online-file-custom
|
||||
v-model:value="myFormData['video']"
|
||||
name='video'
|
||||
></online-file-custom>
|
||||
</wd-cell>
|
||||
</view>
|
||||
<view class="{ 'mt-14px': 1 == 0 }">
|
||||
<wd-input
|
||||
label-width="100px"
|
||||
v-model="myFormData['maxNum']"
|
||||
:label="get4Label('报名人数上限')"
|
||||
name='maxNum'
|
||||
prop='maxNum'
|
||||
placeholder="请选择报名人数上限"
|
||||
inputMode="numeric"
|
||||
:rules="[
|
||||
]"
|
||||
clearable
|
||||
/>
|
||||
</view>
|
||||
<view class="{ 'mt-14px': 0 == 0 }">
|
||||
<DateTime
|
||||
:label="get4Label('开始时间')"
|
||||
labelWidth="100px"
|
||||
type="datetime"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
name='startTime'
|
||||
v-model="myFormData['startTime']"
|
||||
></DateTime>
|
||||
</view>
|
||||
<view class="{ 'mt-14px': 1 == 0 }">
|
||||
<DateTime
|
||||
:label="get4Label('结束时间')"
|
||||
labelWidth="100px"
|
||||
type="datetime"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
name='endTime'
|
||||
v-model="myFormData['endTime']"
|
||||
></DateTime>
|
||||
</view>
|
||||
<view class="{ 'mt-14px': 0 == 0 }">
|
||||
<wd-input
|
||||
label-width="100px"
|
||||
v-model="myFormData['extra']"
|
||||
:label="get4Label('扩展字段')"
|
||||
name='extra'
|
||||
prop='extra'
|
||||
placeholder="请选择扩展字段"
|
||||
:rules="[
|
||||
]"
|
||||
clearable
|
||||
/>
|
||||
</view>
|
||||
<view class="{ 'mt-14px': 1 == 0 }">
|
||||
<wd-cell
|
||||
:title="get4Label('附件')"
|
||||
title-width="100px"
|
||||
>
|
||||
|
||||
<online-file-custom
|
||||
v-model:value="myFormData['attachment']"
|
||||
name='attachment'
|
||||
></online-file-custom>
|
||||
</wd-cell>
|
||||
</view>
|
||||
<view class="{ 'mt-14px': 0 == 0 }">
|
||||
<online-radio
|
||||
:label="get4Label('状态')"
|
||||
labelWidth="100px"
|
||||
type="radio"
|
||||
name='status'
|
||||
dict="course_status"
|
||||
v-model="myFormData['status']"
|
||||
></online-radio>
|
||||
</view>
|
||||
</wd-cell-group>
|
||||
</wd-form>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="footer">
|
||||
<wd-button :disabled="loading" block :loading="loading" @click="handleSubmit">提交</wd-button>
|
||||
</view>
|
||||
</PageLayout>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { http } from '@/utils/http'
|
||||
import { useToast } from 'wot-design-uni'
|
||||
import { useRouter } from '@/plugin/uni-mini-router'
|
||||
import { ref, onMounted, computed,reactive } from 'vue'
|
||||
import OnlineImage from '@/components/online/view/online-image.vue'
|
||||
import OnlineFile from '@/components/online/view/online-file.vue'
|
||||
import OnlineFileCustom from '@/components/online/view/online-file-custom.vue'
|
||||
import OnlineSelect from '@/components/online/view/online-select.vue'
|
||||
import OnlineTime from '@/components/online/view/online-time.vue'
|
||||
import OnlineDate from '@/components/online/view/online-date.vue'
|
||||
import OnlineRadio from '@/components/online/view/online-radio.vue'
|
||||
import OnlineCheckbox from '@/components/online/view/online-checkbox.vue'
|
||||
import OnlineMulti from '@/components/online/view/online-multi.vue'
|
||||
import OnlinePopupLinkRecord from '@/components/online/view/online-popup-link-record.vue'
|
||||
import OnlinePca from '@/components/online/view/online-pca.vue'
|
||||
import SelectDept from '@/components/SelectDept/SelectDept.vue'
|
||||
import SelectUser from '@/components/SelectUser/SelectUser.vue'
|
||||
import {duplicateCheck} from "@/service/api";
|
||||
defineOptions({
|
||||
name: 'AiolActivityForm',
|
||||
options: {
|
||||
styleIsolation: 'shared',
|
||||
},
|
||||
})
|
||||
const toast = useToast()
|
||||
const router = useRouter()
|
||||
const form = ref(null)
|
||||
// 定义响应式数据
|
||||
const myFormData = reactive({})
|
||||
const loading = ref(false)
|
||||
const navTitle = ref('新增')
|
||||
const dataId = ref('')
|
||||
const backRouteName = ref('AiolActivityList')
|
||||
// 定义 initForm 方法
|
||||
const initForm = (item) => {
|
||||
console.log('initForm item', item)
|
||||
if(item?.dataId){
|
||||
dataId.value = item.dataId;
|
||||
navTitle.value = item.dataId?'编辑':'新增';
|
||||
initData();
|
||||
}
|
||||
}
|
||||
// 初始化数据
|
||||
const initData = () => {
|
||||
http.get("/aiol/aiolActivity/queryById",{id:dataId.value}).then((res) => {
|
||||
if (res.success) {
|
||||
let obj = res.result
|
||||
Object.assign(myFormData, { ...obj })
|
||||
}else{
|
||||
toast.error(res?.message || '表单加载失败!')
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleSuccess = () => {
|
||||
uni.$emit('refreshList');
|
||||
router.back()
|
||||
}
|
||||
/**
|
||||
* 校验唯一
|
||||
* @param values
|
||||
* @returns {boolean}
|
||||
*/
|
||||
async function fieldCheck(values: any) {
|
||||
const onlyField = [
|
||||
];
|
||||
for (const field of onlyField) {
|
||||
if (values[field]) {
|
||||
// 仅校验有值的字段
|
||||
const res: any = await duplicateCheck({
|
||||
tableName: 'aiol_activity',
|
||||
fieldName: field, // 使用处理后的字段名
|
||||
fieldVal: values[field],
|
||||
dataId: values.id,
|
||||
});
|
||||
if (!res.success) {
|
||||
toast.warning(res.message);
|
||||
return true; // 校验失败
|
||||
}
|
||||
}
|
||||
}
|
||||
return false; // 校验通过
|
||||
}
|
||||
// 提交表单
|
||||
const handleSubmit = async () => {
|
||||
// 判断字段必填和正则
|
||||
if (await fieldCheck(myFormData)) {
|
||||
return
|
||||
}
|
||||
let url = dataId.value?'/aiol/aiolActivity/edit':'/aiol/aiolActivity/add';
|
||||
form.value
|
||||
.validate()
|
||||
.then(({ valid, errors }) => {
|
||||
if (valid) {
|
||||
loading.value = true;
|
||||
http.post(url,myFormData).then((res) => {
|
||||
loading.value = false;
|
||||
if (res.success) {
|
||||
toast.success('保存成功');
|
||||
handleSuccess()
|
||||
}else{
|
||||
toast.error(res?.message || '表单保存失败!')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error, 'error')
|
||||
loading.value = false;
|
||||
})
|
||||
}
|
||||
// 标题
|
||||
const get4Label = computed(() => {
|
||||
return (label) => {
|
||||
return label && label.length > 4 ? label.substring(0, 4) : label;
|
||||
}
|
||||
})
|
||||
|
||||
// 标题
|
||||
const getFormSchema = computed(() => {
|
||||
return (dictTable,dictCode,dictText) => {
|
||||
return {
|
||||
dictCode,
|
||||
dictTable,
|
||||
dictText
|
||||
};
|
||||
}
|
||||
})
|
||||
/**
|
||||
* 获取日期控件的扩展类型
|
||||
* @param picker
|
||||
* @returns {string}
|
||||
*/
|
||||
const getDateExtendType = (picker: string) => {
|
||||
let mapField = {
|
||||
month: 'year-month',
|
||||
year: 'year',
|
||||
quarter: 'quarter',
|
||||
week: 'week',
|
||||
day: 'date',
|
||||
}
|
||||
return picker && mapField[picker]
|
||||
? mapField[picker]
|
||||
: 'date'
|
||||
}
|
||||
//设置pop返回值
|
||||
const setFieldsValue = (data) => {
|
||||
Object.assign(myFormData, {...data })
|
||||
}
|
||||
// onLoad 生命周期钩子
|
||||
onLoad((option) => {
|
||||
initForm(option)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.footer {
|
||||
width: 100%;
|
||||
padding: 10px 20px;
|
||||
padding-bottom: calc(constant(safe-area-inset-bottom) + 10px);
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 10px);
|
||||
}
|
||||
:deep(.wd-cell__label) {
|
||||
font-size: 14px;
|
||||
color: #444;
|
||||
}
|
||||
:deep(.wd-cell__value) {
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,148 @@
|
||||
<route lang="json5" type="page">
|
||||
{
|
||||
layout: 'default',
|
||||
style: {
|
||||
navigationBarTitleText: '活动',
|
||||
navigationStyle: 'custom',
|
||||
},
|
||||
}
|
||||
</route>
|
||||
<template>
|
||||
<PageLayout navTitle="活动" backRouteName="index" routeMethod="pushTab">
|
||||
<view class="wrap">
|
||||
<z-paging
|
||||
ref="paging"
|
||||
:fixed="false"
|
||||
v-model="dataList"
|
||||
@query="queryList"
|
||||
:default-page-size="15"
|
||||
>
|
||||
<template v-for="item in dataList" :key="item.id">
|
||||
<wd-swipe-action>
|
||||
<view class="list" @click="handleEdit(item)">
|
||||
<template v-for="(cItem, cIndex) in columns" :key="cIndex">
|
||||
<view v-if="cIndex < 3" class="box" :style="getBoxStyle">
|
||||
<view class="field ellipsis">{{ cItem.title }}</view>
|
||||
<view class="value cu-text-grey">{{ item[cItem.dataIndex] }}</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<template #right>
|
||||
<view class="action">
|
||||
<view class="button" @click="handleAction('del', item)">删除</view>
|
||||
</view>
|
||||
</template>
|
||||
</wd-swipe-action>
|
||||
</template>
|
||||
</z-paging>
|
||||
<view class="add u-iconfont u-icon-add" @click="handleAdd"></view>
|
||||
</view>
|
||||
</PageLayout>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, computed } from 'vue'
|
||||
import { http } from '@/utils/http'
|
||||
import usePageList from '@/hooks/usePageList'
|
||||
import {columns} from './AiolActivityData';
|
||||
defineOptions({
|
||||
name: 'AiolActivityList',
|
||||
options: {
|
||||
styleIsolation: 'shared',
|
||||
}
|
||||
})
|
||||
//分页加载配置
|
||||
let { toast, router, paging, dataList, queryList } = usePageList('/aiol/aiolActivity/list');
|
||||
|
||||
//样式
|
||||
const getBoxStyle = computed(() => {
|
||||
return { width: "calc(33% - 5px)" }
|
||||
})
|
||||
|
||||
// 其他操作
|
||||
const handleAction = (val, item) => {
|
||||
if (val == 'del') {
|
||||
http.delete("/aiol/aiolActivity/delete?id="+item.id,{id:item.id}).then((res) => {
|
||||
toast.success('删除成功~')
|
||||
paging.value.reload()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// go 新增页
|
||||
const handleAdd = () => {
|
||||
router.push({
|
||||
name: 'AiolActivityForm'
|
||||
})
|
||||
}
|
||||
|
||||
//go 编辑页
|
||||
const handleEdit = (record) => {
|
||||
router.push({
|
||||
name: 'AiolActivityForm',
|
||||
params: {dataId: record.id},
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// 监听刷新列表事件
|
||||
uni.$on('refreshList', () => {
|
||||
queryList(1,10)
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.wrap {
|
||||
height: 100%;
|
||||
}
|
||||
:deep(.wd-swipe-action) {
|
||||
margin-top: 10px;
|
||||
background-color: #fff;
|
||||
}
|
||||
.list {
|
||||
padding: 10px 10px;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.box {
|
||||
width: 33%;
|
||||
.field {
|
||||
margin-bottom: 10px;
|
||||
line-height: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.action {
|
||||
width: 60px;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
color: #fff;
|
||||
&:first-child {
|
||||
background-color: #fa4350;
|
||||
}
|
||||
}
|
||||
}
|
||||
.add {
|
||||
height: 70upx;
|
||||
width: 70upx;
|
||||
text-align: center;
|
||||
line-height: 70upx;
|
||||
background-color: #fff;
|
||||
border-radius: 50%;
|
||||
position: fixed;
|
||||
bottom: 80upx;
|
||||
right: 30upx;
|
||||
box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1);
|
||||
color: #666;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,34 @@
|
||||
import { render } from '@/common/renderUtils';
|
||||
//列表数据
|
||||
export const columns = [
|
||||
{
|
||||
title: '姓名',
|
||||
align:"center",
|
||||
dataIndex: 'name'
|
||||
},
|
||||
{
|
||||
title: '年龄',
|
||||
align:"center",
|
||||
dataIndex: 'age'
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
align:"center",
|
||||
dataIndex: 'phone'
|
||||
},
|
||||
{
|
||||
title: '邮箱',
|
||||
align:"center",
|
||||
dataIndex: 'email'
|
||||
},
|
||||
{
|
||||
title: '扩展字段',
|
||||
align:"center",
|
||||
dataIndex: 'extra'
|
||||
},
|
||||
{
|
||||
title: '附件',
|
||||
align:"center",
|
||||
dataIndex: 'attachment'
|
||||
},
|
||||
];
|
@ -0,0 +1,274 @@
|
||||
<route lang="json5" type="page">
|
||||
{
|
||||
layout: 'default',
|
||||
style: {
|
||||
navigationStyle: 'custom',
|
||||
navigationBarTitleText: '活动报名',
|
||||
},
|
||||
}
|
||||
</route>
|
||||
<template>
|
||||
<PageLayout :navTitle="navTitle" :backRouteName="backRouteName">
|
||||
<scroll-view class="scrollArea" scroll-y>
|
||||
<view class="form-container">
|
||||
<wd-form ref="form" :model="myFormData">
|
||||
<wd-cell-group border>
|
||||
<view class="{ 'mt-14px': 0 == 0 }">
|
||||
<wd-input
|
||||
label-width="100px"
|
||||
v-model="myFormData['name']"
|
||||
:label="get4Label('姓名')"
|
||||
name='name'
|
||||
prop='name'
|
||||
placeholder="请选择姓名"
|
||||
:rules="[
|
||||
]"
|
||||
clearable
|
||||
/>
|
||||
</view>
|
||||
<view class="{ 'mt-14px': 1 == 0 }">
|
||||
<wd-input
|
||||
label-width="100px"
|
||||
v-model="myFormData['age']"
|
||||
:label="get4Label('年龄')"
|
||||
name='age'
|
||||
prop='age'
|
||||
placeholder="请选择年龄"
|
||||
:rules="[
|
||||
]"
|
||||
clearable
|
||||
/>
|
||||
</view>
|
||||
<view class="{ 'mt-14px': 0 == 0 }">
|
||||
<wd-input
|
||||
label-width="100px"
|
||||
v-model="myFormData['phone']"
|
||||
:label="get4Label('手机号')"
|
||||
name='phone'
|
||||
prop='phone'
|
||||
placeholder="请选择手机号"
|
||||
:rules="[
|
||||
]"
|
||||
clearable
|
||||
/>
|
||||
</view>
|
||||
<view class="{ 'mt-14px': 1 == 0 }">
|
||||
<wd-input
|
||||
label-width="100px"
|
||||
v-model="myFormData['email']"
|
||||
:label="get4Label('邮箱')"
|
||||
name='email'
|
||||
prop='email'
|
||||
placeholder="请选择邮箱"
|
||||
:rules="[
|
||||
]"
|
||||
clearable
|
||||
/>
|
||||
</view>
|
||||
<view class="{ 'mt-14px': 0 == 0 }">
|
||||
<wd-input
|
||||
label-width="100px"
|
||||
v-model="myFormData['extra']"
|
||||
:label="get4Label('扩展字段')"
|
||||
name='extra'
|
||||
prop='extra'
|
||||
placeholder="请选择扩展字段"
|
||||
:rules="[
|
||||
]"
|
||||
clearable
|
||||
/>
|
||||
</view>
|
||||
<view class="{ 'mt-14px': 1 == 0 }">
|
||||
<wd-input
|
||||
label-width="100px"
|
||||
v-model="myFormData['attachment']"
|
||||
:label="get4Label('附件')"
|
||||
name='attachment'
|
||||
prop='attachment'
|
||||
placeholder="请选择附件"
|
||||
:rules="[
|
||||
]"
|
||||
clearable
|
||||
/>
|
||||
</view>
|
||||
</wd-cell-group>
|
||||
</wd-form>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="footer">
|
||||
<wd-button :disabled="loading" block :loading="loading" @click="handleSubmit">提交</wd-button>
|
||||
</view>
|
||||
</PageLayout>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { http } from '@/utils/http'
|
||||
import { useToast } from 'wot-design-uni'
|
||||
import { useRouter } from '@/plugin/uni-mini-router'
|
||||
import { ref, onMounted, computed,reactive } from 'vue'
|
||||
import OnlineImage from '@/components/online/view/online-image.vue'
|
||||
import OnlineFile from '@/components/online/view/online-file.vue'
|
||||
import OnlineFileCustom from '@/components/online/view/online-file-custom.vue'
|
||||
import OnlineSelect from '@/components/online/view/online-select.vue'
|
||||
import OnlineTime from '@/components/online/view/online-time.vue'
|
||||
import OnlineDate from '@/components/online/view/online-date.vue'
|
||||
import OnlineRadio from '@/components/online/view/online-radio.vue'
|
||||
import OnlineCheckbox from '@/components/online/view/online-checkbox.vue'
|
||||
import OnlineMulti from '@/components/online/view/online-multi.vue'
|
||||
import OnlinePopupLinkRecord from '@/components/online/view/online-popup-link-record.vue'
|
||||
import OnlinePca from '@/components/online/view/online-pca.vue'
|
||||
import SelectDept from '@/components/SelectDept/SelectDept.vue'
|
||||
import SelectUser from '@/components/SelectUser/SelectUser.vue'
|
||||
import {duplicateCheck} from "@/service/api";
|
||||
defineOptions({
|
||||
name: 'AiolActivitySignupForm',
|
||||
options: {
|
||||
styleIsolation: 'shared',
|
||||
},
|
||||
})
|
||||
const toast = useToast()
|
||||
const router = useRouter()
|
||||
const form = ref(null)
|
||||
// 定义响应式数据
|
||||
const myFormData = reactive({})
|
||||
const loading = ref(false)
|
||||
const navTitle = ref('新增')
|
||||
const dataId = ref('')
|
||||
const backRouteName = ref('AiolActivitySignupList')
|
||||
// 定义 initForm 方法
|
||||
const initForm = (item) => {
|
||||
console.log('initForm item', item)
|
||||
if(item?.dataId){
|
||||
dataId.value = item.dataId;
|
||||
navTitle.value = item.dataId?'编辑':'新增';
|
||||
initData();
|
||||
}
|
||||
}
|
||||
// 初始化数据
|
||||
const initData = () => {
|
||||
http.get("/aiol/aiolActivitySignup/queryById",{id:dataId.value}).then((res) => {
|
||||
if (res.success) {
|
||||
let obj = res.result
|
||||
Object.assign(myFormData, { ...obj })
|
||||
}else{
|
||||
toast.error(res?.message || '表单加载失败!')
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleSuccess = () => {
|
||||
uni.$emit('refreshList');
|
||||
router.back()
|
||||
}
|
||||
/**
|
||||
* 校验唯一
|
||||
* @param values
|
||||
* @returns {boolean}
|
||||
*/
|
||||
async function fieldCheck(values: any) {
|
||||
const onlyField = [
|
||||
];
|
||||
for (const field of onlyField) {
|
||||
if (values[field]) {
|
||||
// 仅校验有值的字段
|
||||
const res: any = await duplicateCheck({
|
||||
tableName: 'aiol_activity_signup',
|
||||
fieldName: field, // 使用处理后的字段名
|
||||
fieldVal: values[field],
|
||||
dataId: values.id,
|
||||
});
|
||||
if (!res.success) {
|
||||
toast.warning(res.message);
|
||||
return true; // 校验失败
|
||||
}
|
||||
}
|
||||
}
|
||||
return false; // 校验通过
|
||||
}
|
||||
// 提交表单
|
||||
const handleSubmit = async () => {
|
||||
// 判断字段必填和正则
|
||||
if (await fieldCheck(myFormData)) {
|
||||
return
|
||||
}
|
||||
let url = dataId.value?'/aiol/aiolActivitySignup/edit':'/aiol/aiolActivitySignup/add';
|
||||
form.value
|
||||
.validate()
|
||||
.then(({ valid, errors }) => {
|
||||
if (valid) {
|
||||
loading.value = true;
|
||||
http.post(url,myFormData).then((res) => {
|
||||
loading.value = false;
|
||||
if (res.success) {
|
||||
toast.success('保存成功');
|
||||
handleSuccess()
|
||||
}else{
|
||||
toast.error(res?.message || '表单保存失败!')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error, 'error')
|
||||
loading.value = false;
|
||||
})
|
||||
}
|
||||
// 标题
|
||||
const get4Label = computed(() => {
|
||||
return (label) => {
|
||||
return label && label.length > 4 ? label.substring(0, 4) : label;
|
||||
}
|
||||
})
|
||||
|
||||
// 标题
|
||||
const getFormSchema = computed(() => {
|
||||
return (dictTable,dictCode,dictText) => {
|
||||
return {
|
||||
dictCode,
|
||||
dictTable,
|
||||
dictText
|
||||
};
|
||||
}
|
||||
})
|
||||
/**
|
||||
* 获取日期控件的扩展类型
|
||||
* @param picker
|
||||
* @returns {string}
|
||||
*/
|
||||
const getDateExtendType = (picker: string) => {
|
||||
let mapField = {
|
||||
month: 'year-month',
|
||||
year: 'year',
|
||||
quarter: 'quarter',
|
||||
week: 'week',
|
||||
day: 'date',
|
||||
}
|
||||
return picker && mapField[picker]
|
||||
? mapField[picker]
|
||||
: 'date'
|
||||
}
|
||||
//设置pop返回值
|
||||
const setFieldsValue = (data) => {
|
||||
Object.assign(myFormData, {...data })
|
||||
}
|
||||
// onLoad 生命周期钩子
|
||||
onLoad((option) => {
|
||||
initForm(option)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.footer {
|
||||
width: 100%;
|
||||
padding: 10px 20px;
|
||||
padding-bottom: calc(constant(safe-area-inset-bottom) + 10px);
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 10px);
|
||||
}
|
||||
:deep(.wd-cell__label) {
|
||||
font-size: 14px;
|
||||
color: #444;
|
||||
}
|
||||
:deep(.wd-cell__value) {
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,148 @@
|
||||
<route lang="json5" type="page">
|
||||
{
|
||||
layout: 'default',
|
||||
style: {
|
||||
navigationBarTitleText: '活动报名',
|
||||
navigationStyle: 'custom',
|
||||
},
|
||||
}
|
||||
</route>
|
||||
<template>
|
||||
<PageLayout navTitle="活动报名" backRouteName="index" routeMethod="pushTab">
|
||||
<view class="wrap">
|
||||
<z-paging
|
||||
ref="paging"
|
||||
:fixed="false"
|
||||
v-model="dataList"
|
||||
@query="queryList"
|
||||
:default-page-size="15"
|
||||
>
|
||||
<template v-for="item in dataList" :key="item.id">
|
||||
<wd-swipe-action>
|
||||
<view class="list" @click="handleEdit(item)">
|
||||
<template v-for="(cItem, cIndex) in columns" :key="cIndex">
|
||||
<view v-if="cIndex < 3" class="box" :style="getBoxStyle">
|
||||
<view class="field ellipsis">{{ cItem.title }}</view>
|
||||
<view class="value cu-text-grey">{{ item[cItem.dataIndex] }}</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<template #right>
|
||||
<view class="action">
|
||||
<view class="button" @click="handleAction('del', item)">删除</view>
|
||||
</view>
|
||||
</template>
|
||||
</wd-swipe-action>
|
||||
</template>
|
||||
</z-paging>
|
||||
<view class="add u-iconfont u-icon-add" @click="handleAdd"></view>
|
||||
</view>
|
||||
</PageLayout>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, computed } from 'vue'
|
||||
import { http } from '@/utils/http'
|
||||
import usePageList from '@/hooks/usePageList'
|
||||
import {columns} from './AiolActivitySignupData';
|
||||
defineOptions({
|
||||
name: 'AiolActivitySignupList',
|
||||
options: {
|
||||
styleIsolation: 'shared',
|
||||
}
|
||||
})
|
||||
//分页加载配置
|
||||
let { toast, router, paging, dataList, queryList } = usePageList('/aiol/aiolActivitySignup/list');
|
||||
|
||||
//样式
|
||||
const getBoxStyle = computed(() => {
|
||||
return { width: "calc(33% - 5px)" }
|
||||
})
|
||||
|
||||
// 其他操作
|
||||
const handleAction = (val, item) => {
|
||||
if (val == 'del') {
|
||||
http.delete("/aiol/aiolActivitySignup/delete?id="+item.id,{id:item.id}).then((res) => {
|
||||
toast.success('删除成功~')
|
||||
paging.value.reload()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// go 新增页
|
||||
const handleAdd = () => {
|
||||
router.push({
|
||||
name: 'AiolActivitySignupForm'
|
||||
})
|
||||
}
|
||||
|
||||
//go 编辑页
|
||||
const handleEdit = (record) => {
|
||||
router.push({
|
||||
name: 'AiolActivitySignupForm',
|
||||
params: {dataId: record.id},
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// 监听刷新列表事件
|
||||
uni.$on('refreshList', () => {
|
||||
queryList(1,10)
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.wrap {
|
||||
height: 100%;
|
||||
}
|
||||
:deep(.wd-swipe-action) {
|
||||
margin-top: 10px;
|
||||
background-color: #fff;
|
||||
}
|
||||
.list {
|
||||
padding: 10px 10px;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.box {
|
||||
width: 33%;
|
||||
.field {
|
||||
margin-bottom: 10px;
|
||||
line-height: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.action {
|
||||
width: 60px;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
color: #fff;
|
||||
&:first-child {
|
||||
background-color: #fa4350;
|
||||
}
|
||||
}
|
||||
}
|
||||
.add {
|
||||
height: 70upx;
|
||||
width: 70upx;
|
||||
text-align: center;
|
||||
line-height: 70upx;
|
||||
background-color: #fff;
|
||||
border-radius: 50%;
|
||||
position: fixed;
|
||||
bottom: 80upx;
|
||||
right: 30upx;
|
||||
box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1);
|
||||
color: #666;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,24 @@
|
||||
import { render } from '@/common/renderUtils';
|
||||
//列表数据
|
||||
export const columns = [
|
||||
{
|
||||
title: '配置标识',
|
||||
align:"center",
|
||||
dataIndex: 'contentKey'
|
||||
},
|
||||
{
|
||||
title: '配置值',
|
||||
align:"center",
|
||||
dataIndex: 'contentValue'
|
||||
},
|
||||
{
|
||||
title: '值类型',
|
||||
align:"center",
|
||||
dataIndex: 'valueType'
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
align:"center",
|
||||
dataIndex: 'description'
|
||||
},
|
||||
];
|
@ -0,0 +1,248 @@
|
||||
<route lang="json5" type="page">
|
||||
{
|
||||
layout: 'default',
|
||||
style: {
|
||||
navigationStyle: 'custom',
|
||||
navigationBarTitleText: '内容配置',
|
||||
},
|
||||
}
|
||||
</route>
|
||||
<template>
|
||||
<PageLayout :navTitle="navTitle" :backRouteName="backRouteName">
|
||||
<scroll-view class="scrollArea" scroll-y>
|
||||
<view class="form-container">
|
||||
<wd-form ref="form" :model="myFormData">
|
||||
<wd-cell-group border>
|
||||
<view class="{ 'mt-14px': 0 == 0 }">
|
||||
<wd-input
|
||||
label-width="100px"
|
||||
v-model="myFormData['contentKey']"
|
||||
:label="get4Label('配置标识')"
|
||||
name='contentKey'
|
||||
prop='contentKey'
|
||||
placeholder="请选择配置标识"
|
||||
:rules="[
|
||||
]"
|
||||
clearable
|
||||
/>
|
||||
</view>
|
||||
<view class="{ 'mt-14px': 1 == 0 }">
|
||||
<wd-input
|
||||
label-width="100px"
|
||||
v-model="myFormData['contentValue']"
|
||||
:label="get4Label('配置值')"
|
||||
name='contentValue'
|
||||
prop='contentValue'
|
||||
placeholder="请选择配置值"
|
||||
:rules="[
|
||||
]"
|
||||
clearable
|
||||
/>
|
||||
</view>
|
||||
<view class="{ 'mt-14px': 0 == 0 }">
|
||||
<wd-input
|
||||
label-width="100px"
|
||||
v-model="myFormData['valueType']"
|
||||
:label="get4Label('值类型')"
|
||||
name='valueType'
|
||||
prop='valueType'
|
||||
placeholder="请选择值类型"
|
||||
:rules="[
|
||||
]"
|
||||
clearable
|
||||
/>
|
||||
</view>
|
||||
<view class="{ 'mt-14px': 1 == 0 }">
|
||||
<wd-input
|
||||
label-width="100px"
|
||||
v-model="myFormData['description']"
|
||||
:label="get4Label('描述')"
|
||||
name='description'
|
||||
prop='description'
|
||||
placeholder="请选择描述"
|
||||
:rules="[
|
||||
]"
|
||||
clearable
|
||||
/>
|
||||
</view>
|
||||
</wd-cell-group>
|
||||
</wd-form>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="footer">
|
||||
<wd-button :disabled="loading" block :loading="loading" @click="handleSubmit">提交</wd-button>
|
||||
</view>
|
||||
</PageLayout>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { http } from '@/utils/http'
|
||||
import { useToast } from 'wot-design-uni'
|
||||
import { useRouter } from '@/plugin/uni-mini-router'
|
||||
import { ref, onMounted, computed,reactive } from 'vue'
|
||||
import OnlineImage from '@/components/online/view/online-image.vue'
|
||||
import OnlineFile from '@/components/online/view/online-file.vue'
|
||||
import OnlineFileCustom from '@/components/online/view/online-file-custom.vue'
|
||||
import OnlineSelect from '@/components/online/view/online-select.vue'
|
||||
import OnlineTime from '@/components/online/view/online-time.vue'
|
||||
import OnlineDate from '@/components/online/view/online-date.vue'
|
||||
import OnlineRadio from '@/components/online/view/online-radio.vue'
|
||||
import OnlineCheckbox from '@/components/online/view/online-checkbox.vue'
|
||||
import OnlineMulti from '@/components/online/view/online-multi.vue'
|
||||
import OnlinePopupLinkRecord from '@/components/online/view/online-popup-link-record.vue'
|
||||
import OnlinePca from '@/components/online/view/online-pca.vue'
|
||||
import SelectDept from '@/components/SelectDept/SelectDept.vue'
|
||||
import SelectUser from '@/components/SelectUser/SelectUser.vue'
|
||||
import {duplicateCheck} from "@/service/api";
|
||||
defineOptions({
|
||||
name: 'AiolContentConfigForm',
|
||||
options: {
|
||||
styleIsolation: 'shared',
|
||||
},
|
||||
})
|
||||
const toast = useToast()
|
||||
const router = useRouter()
|
||||
const form = ref(null)
|
||||
// 定义响应式数据
|
||||
const myFormData = reactive({})
|
||||
const loading = ref(false)
|
||||
const navTitle = ref('新增')
|
||||
const dataId = ref('')
|
||||
const backRouteName = ref('AiolContentConfigList')
|
||||
// 定义 initForm 方法
|
||||
const initForm = (item) => {
|
||||
console.log('initForm item', item)
|
||||
if(item?.dataId){
|
||||
dataId.value = item.dataId;
|
||||
navTitle.value = item.dataId?'编辑':'新增';
|
||||
initData();
|
||||
}
|
||||
}
|
||||
// 初始化数据
|
||||
const initData = () => {
|
||||
http.get("/aiol/aiolContentConfig/queryById",{id:dataId.value}).then((res) => {
|
||||
if (res.success) {
|
||||
let obj = res.result
|
||||
Object.assign(myFormData, { ...obj })
|
||||
}else{
|
||||
toast.error(res?.message || '表单加载失败!')
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleSuccess = () => {
|
||||
uni.$emit('refreshList');
|
||||
router.back()
|
||||
}
|
||||
/**
|
||||
* 校验唯一
|
||||
* @param values
|
||||
* @returns {boolean}
|
||||
*/
|
||||
async function fieldCheck(values: any) {
|
||||
const onlyField = [
|
||||
];
|
||||
for (const field of onlyField) {
|
||||
if (values[field]) {
|
||||
// 仅校验有值的字段
|
||||
const res: any = await duplicateCheck({
|
||||
tableName: 'aiol_content_config',
|
||||
fieldName: field, // 使用处理后的字段名
|
||||
fieldVal: values[field],
|
||||
dataId: values.id,
|
||||
});
|
||||
if (!res.success) {
|
||||
toast.warning(res.message);
|
||||
return true; // 校验失败
|
||||
}
|
||||
}
|
||||
}
|
||||
return false; // 校验通过
|
||||
}
|
||||
// 提交表单
|
||||
const handleSubmit = async () => {
|
||||
// 判断字段必填和正则
|
||||
if (await fieldCheck(myFormData)) {
|
||||
return
|
||||
}
|
||||
let url = dataId.value?'/aiol/aiolContentConfig/edit':'/aiol/aiolContentConfig/add';
|
||||
form.value
|
||||
.validate()
|
||||
.then(({ valid, errors }) => {
|
||||
if (valid) {
|
||||
loading.value = true;
|
||||
http.post(url,myFormData).then((res) => {
|
||||
loading.value = false;
|
||||
if (res.success) {
|
||||
toast.success('保存成功');
|
||||
handleSuccess()
|
||||
}else{
|
||||
toast.error(res?.message || '表单保存失败!')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error, 'error')
|
||||
loading.value = false;
|
||||
})
|
||||
}
|
||||
// 标题
|
||||
const get4Label = computed(() => {
|
||||
return (label) => {
|
||||
return label && label.length > 4 ? label.substring(0, 4) : label;
|
||||
}
|
||||
})
|
||||
|
||||
// 标题
|
||||
const getFormSchema = computed(() => {
|
||||
return (dictTable,dictCode,dictText) => {
|
||||
return {
|
||||
dictCode,
|
||||
dictTable,
|
||||
dictText
|
||||
};
|
||||
}
|
||||
})
|
||||
/**
|
||||
* 获取日期控件的扩展类型
|
||||
* @param picker
|
||||
* @returns {string}
|
||||
*/
|
||||
const getDateExtendType = (picker: string) => {
|
||||
let mapField = {
|
||||
month: 'year-month',
|
||||
year: 'year',
|
||||
quarter: 'quarter',
|
||||
week: 'week',
|
||||
day: 'date',
|
||||
}
|
||||
return picker && mapField[picker]
|
||||
? mapField[picker]
|
||||
: 'date'
|
||||
}
|
||||
//设置pop返回值
|
||||
const setFieldsValue = (data) => {
|
||||
Object.assign(myFormData, {...data })
|
||||
}
|
||||
// onLoad 生命周期钩子
|
||||
onLoad((option) => {
|
||||
initForm(option)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.footer {
|
||||
width: 100%;
|
||||
padding: 10px 20px;
|
||||
padding-bottom: calc(constant(safe-area-inset-bottom) + 10px);
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 10px);
|
||||
}
|
||||
:deep(.wd-cell__label) {
|
||||
font-size: 14px;
|
||||
color: #444;
|
||||
}
|
||||
:deep(.wd-cell__value) {
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,148 @@
|
||||
<route lang="json5" type="page">
|
||||
{
|
||||
layout: 'default',
|
||||
style: {
|
||||
navigationBarTitleText: '内容配置',
|
||||
navigationStyle: 'custom',
|
||||
},
|
||||
}
|
||||
</route>
|
||||
<template>
|
||||
<PageLayout navTitle="内容配置" backRouteName="index" routeMethod="pushTab">
|
||||
<view class="wrap">
|
||||
<z-paging
|
||||
ref="paging"
|
||||
:fixed="false"
|
||||
v-model="dataList"
|
||||
@query="queryList"
|
||||
:default-page-size="15"
|
||||
>
|
||||
<template v-for="item in dataList" :key="item.id">
|
||||
<wd-swipe-action>
|
||||
<view class="list" @click="handleEdit(item)">
|
||||
<template v-for="(cItem, cIndex) in columns" :key="cIndex">
|
||||
<view v-if="cIndex < 3" class="box" :style="getBoxStyle">
|
||||
<view class="field ellipsis">{{ cItem.title }}</view>
|
||||
<view class="value cu-text-grey">{{ item[cItem.dataIndex] }}</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<template #right>
|
||||
<view class="action">
|
||||
<view class="button" @click="handleAction('del', item)">删除</view>
|
||||
</view>
|
||||
</template>
|
||||
</wd-swipe-action>
|
||||
</template>
|
||||
</z-paging>
|
||||
<view class="add u-iconfont u-icon-add" @click="handleAdd"></view>
|
||||
</view>
|
||||
</PageLayout>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, computed } from 'vue'
|
||||
import { http } from '@/utils/http'
|
||||
import usePageList from '@/hooks/usePageList'
|
||||
import {columns} from './AiolContentConfigData';
|
||||
defineOptions({
|
||||
name: 'AiolContentConfigList',
|
||||
options: {
|
||||
styleIsolation: 'shared',
|
||||
}
|
||||
})
|
||||
//分页加载配置
|
||||
let { toast, router, paging, dataList, queryList } = usePageList('/aiol/aiolContentConfig/list');
|
||||
|
||||
//样式
|
||||
const getBoxStyle = computed(() => {
|
||||
return { width: "calc(33% - 5px)" }
|
||||
})
|
||||
|
||||
// 其他操作
|
||||
const handleAction = (val, item) => {
|
||||
if (val == 'del') {
|
||||
http.delete("/aiol/aiolContentConfig/delete?id="+item.id,{id:item.id}).then((res) => {
|
||||
toast.success('删除成功~')
|
||||
paging.value.reload()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// go 新增页
|
||||
const handleAdd = () => {
|
||||
router.push({
|
||||
name: 'AiolContentConfigForm'
|
||||
})
|
||||
}
|
||||
|
||||
//go 编辑页
|
||||
const handleEdit = (record) => {
|
||||
router.push({
|
||||
name: 'AiolContentConfigForm',
|
||||
params: {dataId: record.id},
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// 监听刷新列表事件
|
||||
uni.$on('refreshList', () => {
|
||||
queryList(1,10)
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.wrap {
|
||||
height: 100%;
|
||||
}
|
||||
:deep(.wd-swipe-action) {
|
||||
margin-top: 10px;
|
||||
background-color: #fff;
|
||||
}
|
||||
.list {
|
||||
padding: 10px 10px;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.box {
|
||||
width: 33%;
|
||||
.field {
|
||||
margin-bottom: 10px;
|
||||
line-height: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.action {
|
||||
width: 60px;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
color: #fff;
|
||||
&:first-child {
|
||||
background-color: #fa4350;
|
||||
}
|
||||
}
|
||||
}
|
||||
.add {
|
||||
height: 70upx;
|
||||
width: 70upx;
|
||||
text-align: center;
|
||||
line-height: 70upx;
|
||||
background-color: #fff;
|
||||
border-radius: 50%;
|
||||
position: fixed;
|
||||
bottom: 80upx;
|
||||
right: 30upx;
|
||||
box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1);
|
||||
color: #666;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,24 @@
|
||||
import { render } from '@/common/renderUtils';
|
||||
//列表数据
|
||||
export const columns = [
|
||||
{
|
||||
title: '标签名',
|
||||
align:"center",
|
||||
dataIndex: 'name'
|
||||
},
|
||||
{
|
||||
title: '目标类型',
|
||||
align:"center",
|
||||
dataIndex: 'targetType'
|
||||
},
|
||||
{
|
||||
title: '目标id',
|
||||
align:"center",
|
||||
dataIndex: 'targetId'
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
align:"center",
|
||||
dataIndex: 'description'
|
||||
},
|
||||
];
|
@ -0,0 +1,248 @@
|
||||
<route lang="json5" type="page">
|
||||
{
|
||||
layout: 'default',
|
||||
style: {
|
||||
navigationStyle: 'custom',
|
||||
navigationBarTitleText: '标签',
|
||||
},
|
||||
}
|
||||
</route>
|
||||
<template>
|
||||
<PageLayout :navTitle="navTitle" :backRouteName="backRouteName">
|
||||
<scroll-view class="scrollArea" scroll-y>
|
||||
<view class="form-container">
|
||||
<wd-form ref="form" :model="myFormData">
|
||||
<wd-cell-group border>
|
||||
<view class="{ 'mt-14px': 0 == 0 }">
|
||||
<wd-input
|
||||
label-width="100px"
|
||||
v-model="myFormData['name']"
|
||||
:label="get4Label('标签名')"
|
||||
name='name'
|
||||
prop='name'
|
||||
placeholder="请选择标签名"
|
||||
:rules="[
|
||||
]"
|
||||
clearable
|
||||
/>
|
||||
</view>
|
||||
<view class="{ 'mt-14px': 1 == 0 }">
|
||||
<wd-input
|
||||
label-width="100px"
|
||||
v-model="myFormData['targetType']"
|
||||
:label="get4Label('目标类型')"
|
||||
name='targetType'
|
||||
prop='targetType'
|
||||
placeholder="请选择目标类型"
|
||||
:rules="[
|
||||
]"
|
||||
clearable
|
||||
/>
|
||||
</view>
|
||||
<view class="{ 'mt-14px': 0 == 0 }">
|
||||
<wd-input
|
||||
label-width="100px"
|
||||
v-model="myFormData['targetId']"
|
||||
:label="get4Label('目标id')"
|
||||
name='targetId'
|
||||
prop='targetId'
|
||||
placeholder="请选择目标id"
|
||||
:rules="[
|
||||
]"
|
||||
clearable
|
||||
/>
|
||||
</view>
|
||||
<view class="{ 'mt-14px': 1 == 0 }">
|
||||
<wd-input
|
||||
label-width="100px"
|
||||
v-model="myFormData['description']"
|
||||
:label="get4Label('描述')"
|
||||
name='description'
|
||||
prop='description'
|
||||
placeholder="请选择描述"
|
||||
:rules="[
|
||||
]"
|
||||
clearable
|
||||
/>
|
||||
</view>
|
||||
</wd-cell-group>
|
||||
</wd-form>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="footer">
|
||||
<wd-button :disabled="loading" block :loading="loading" @click="handleSubmit">提交</wd-button>
|
||||
</view>
|
||||
</PageLayout>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { http } from '@/utils/http'
|
||||
import { useToast } from 'wot-design-uni'
|
||||
import { useRouter } from '@/plugin/uni-mini-router'
|
||||
import { ref, onMounted, computed,reactive } from 'vue'
|
||||
import OnlineImage from '@/components/online/view/online-image.vue'
|
||||
import OnlineFile from '@/components/online/view/online-file.vue'
|
||||
import OnlineFileCustom from '@/components/online/view/online-file-custom.vue'
|
||||
import OnlineSelect from '@/components/online/view/online-select.vue'
|
||||
import OnlineTime from '@/components/online/view/online-time.vue'
|
||||
import OnlineDate from '@/components/online/view/online-date.vue'
|
||||
import OnlineRadio from '@/components/online/view/online-radio.vue'
|
||||
import OnlineCheckbox from '@/components/online/view/online-checkbox.vue'
|
||||
import OnlineMulti from '@/components/online/view/online-multi.vue'
|
||||
import OnlinePopupLinkRecord from '@/components/online/view/online-popup-link-record.vue'
|
||||
import OnlinePca from '@/components/online/view/online-pca.vue'
|
||||
import SelectDept from '@/components/SelectDept/SelectDept.vue'
|
||||
import SelectUser from '@/components/SelectUser/SelectUser.vue'
|
||||
import {duplicateCheck} from "@/service/api";
|
||||
defineOptions({
|
||||
name: 'AiolTagForm',
|
||||
options: {
|
||||
styleIsolation: 'shared',
|
||||
},
|
||||
})
|
||||
const toast = useToast()
|
||||
const router = useRouter()
|
||||
const form = ref(null)
|
||||
// 定义响应式数据
|
||||
const myFormData = reactive({})
|
||||
const loading = ref(false)
|
||||
const navTitle = ref('新增')
|
||||
const dataId = ref('')
|
||||
const backRouteName = ref('AiolTagList')
|
||||
// 定义 initForm 方法
|
||||
const initForm = (item) => {
|
||||
console.log('initForm item', item)
|
||||
if(item?.dataId){
|
||||
dataId.value = item.dataId;
|
||||
navTitle.value = item.dataId?'编辑':'新增';
|
||||
initData();
|
||||
}
|
||||
}
|
||||
// 初始化数据
|
||||
const initData = () => {
|
||||
http.get("/aiol/aiolTag/queryById",{id:dataId.value}).then((res) => {
|
||||
if (res.success) {
|
||||
let obj = res.result
|
||||
Object.assign(myFormData, { ...obj })
|
||||
}else{
|
||||
toast.error(res?.message || '表单加载失败!')
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleSuccess = () => {
|
||||
uni.$emit('refreshList');
|
||||
router.back()
|
||||
}
|
||||
/**
|
||||
* 校验唯一
|
||||
* @param values
|
||||
* @returns {boolean}
|
||||
*/
|
||||
async function fieldCheck(values: any) {
|
||||
const onlyField = [
|
||||
];
|
||||
for (const field of onlyField) {
|
||||
if (values[field]) {
|
||||
// 仅校验有值的字段
|
||||
const res: any = await duplicateCheck({
|
||||
tableName: 'aiol_tag',
|
||||
fieldName: field, // 使用处理后的字段名
|
||||
fieldVal: values[field],
|
||||
dataId: values.id,
|
||||
});
|
||||
if (!res.success) {
|
||||
toast.warning(res.message);
|
||||
return true; // 校验失败
|
||||
}
|
||||
}
|
||||
}
|
||||
return false; // 校验通过
|
||||
}
|
||||
// 提交表单
|
||||
const handleSubmit = async () => {
|
||||
// 判断字段必填和正则
|
||||
if (await fieldCheck(myFormData)) {
|
||||
return
|
||||
}
|
||||
let url = dataId.value?'/aiol/aiolTag/edit':'/aiol/aiolTag/add';
|
||||
form.value
|
||||
.validate()
|
||||
.then(({ valid, errors }) => {
|
||||
if (valid) {
|
||||
loading.value = true;
|
||||
http.post(url,myFormData).then((res) => {
|
||||
loading.value = false;
|
||||
if (res.success) {
|
||||
toast.success('保存成功');
|
||||
handleSuccess()
|
||||
}else{
|
||||
toast.error(res?.message || '表单保存失败!')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error, 'error')
|
||||
loading.value = false;
|
||||
})
|
||||
}
|
||||
// 标题
|
||||
const get4Label = computed(() => {
|
||||
return (label) => {
|
||||
return label && label.length > 4 ? label.substring(0, 4) : label;
|
||||
}
|
||||
})
|
||||
|
||||
// 标题
|
||||
const getFormSchema = computed(() => {
|
||||
return (dictTable,dictCode,dictText) => {
|
||||
return {
|
||||
dictCode,
|
||||
dictTable,
|
||||
dictText
|
||||
};
|
||||
}
|
||||
})
|
||||
/**
|
||||
* 获取日期控件的扩展类型
|
||||
* @param picker
|
||||
* @returns {string}
|
||||
*/
|
||||
const getDateExtendType = (picker: string) => {
|
||||
let mapField = {
|
||||
month: 'year-month',
|
||||
year: 'year',
|
||||
quarter: 'quarter',
|
||||
week: 'week',
|
||||
day: 'date',
|
||||
}
|
||||
return picker && mapField[picker]
|
||||
? mapField[picker]
|
||||
: 'date'
|
||||
}
|
||||
//设置pop返回值
|
||||
const setFieldsValue = (data) => {
|
||||
Object.assign(myFormData, {...data })
|
||||
}
|
||||
// onLoad 生命周期钩子
|
||||
onLoad((option) => {
|
||||
initForm(option)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.footer {
|
||||
width: 100%;
|
||||
padding: 10px 20px;
|
||||
padding-bottom: calc(constant(safe-area-inset-bottom) + 10px);
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 10px);
|
||||
}
|
||||
:deep(.wd-cell__label) {
|
||||
font-size: 14px;
|
||||
color: #444;
|
||||
}
|
||||
:deep(.wd-cell__value) {
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,148 @@
|
||||
<route lang="json5" type="page">
|
||||
{
|
||||
layout: 'default',
|
||||
style: {
|
||||
navigationBarTitleText: '标签',
|
||||
navigationStyle: 'custom',
|
||||
},
|
||||
}
|
||||
</route>
|
||||
<template>
|
||||
<PageLayout navTitle="标签" backRouteName="index" routeMethod="pushTab">
|
||||
<view class="wrap">
|
||||
<z-paging
|
||||
ref="paging"
|
||||
:fixed="false"
|
||||
v-model="dataList"
|
||||
@query="queryList"
|
||||
:default-page-size="15"
|
||||
>
|
||||
<template v-for="item in dataList" :key="item.id">
|
||||
<wd-swipe-action>
|
||||
<view class="list" @click="handleEdit(item)">
|
||||
<template v-for="(cItem, cIndex) in columns" :key="cIndex">
|
||||
<view v-if="cIndex < 3" class="box" :style="getBoxStyle">
|
||||
<view class="field ellipsis">{{ cItem.title }}</view>
|
||||
<view class="value cu-text-grey">{{ item[cItem.dataIndex] }}</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<template #right>
|
||||
<view class="action">
|
||||
<view class="button" @click="handleAction('del', item)">删除</view>
|
||||
</view>
|
||||
</template>
|
||||
</wd-swipe-action>
|
||||
</template>
|
||||
</z-paging>
|
||||
<view class="add u-iconfont u-icon-add" @click="handleAdd"></view>
|
||||
</view>
|
||||
</PageLayout>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, computed } from 'vue'
|
||||
import { http } from '@/utils/http'
|
||||
import usePageList from '@/hooks/usePageList'
|
||||
import {columns} from './AiolTagData';
|
||||
defineOptions({
|
||||
name: 'AiolTagList',
|
||||
options: {
|
||||
styleIsolation: 'shared',
|
||||
}
|
||||
})
|
||||
//分页加载配置
|
||||
let { toast, router, paging, dataList, queryList } = usePageList('/aiol/aiolTag/list');
|
||||
|
||||
//样式
|
||||
const getBoxStyle = computed(() => {
|
||||
return { width: "calc(33% - 5px)" }
|
||||
})
|
||||
|
||||
// 其他操作
|
||||
const handleAction = (val, item) => {
|
||||
if (val == 'del') {
|
||||
http.delete("/aiol/aiolTag/delete?id="+item.id,{id:item.id}).then((res) => {
|
||||
toast.success('删除成功~')
|
||||
paging.value.reload()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// go 新增页
|
||||
const handleAdd = () => {
|
||||
router.push({
|
||||
name: 'AiolTagForm'
|
||||
})
|
||||
}
|
||||
|
||||
//go 编辑页
|
||||
const handleEdit = (record) => {
|
||||
router.push({
|
||||
name: 'AiolTagForm',
|
||||
params: {dataId: record.id},
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// 监听刷新列表事件
|
||||
uni.$on('refreshList', () => {
|
||||
queryList(1,10)
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.wrap {
|
||||
height: 100%;
|
||||
}
|
||||
:deep(.wd-swipe-action) {
|
||||
margin-top: 10px;
|
||||
background-color: #fff;
|
||||
}
|
||||
.list {
|
||||
padding: 10px 10px;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.box {
|
||||
width: 33%;
|
||||
.field {
|
||||
margin-bottom: 10px;
|
||||
line-height: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.action {
|
||||
width: 60px;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
color: #fff;
|
||||
&:first-child {
|
||||
background-color: #fa4350;
|
||||
}
|
||||
}
|
||||
}
|
||||
.add {
|
||||
height: 70upx;
|
||||
width: 70upx;
|
||||
text-align: center;
|
||||
line-height: 70upx;
|
||||
background-color: #fff;
|
||||
border-radius: 50%;
|
||||
position: fixed;
|
||||
bottom: 80upx;
|
||||
right: 30upx;
|
||||
box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1);
|
||||
color: #666;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,64 @@
|
||||
import {defHttp} from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/aiol/aiolActivity/list',
|
||||
save='/aiol/aiolActivity/add',
|
||||
edit='/aiol/aiolActivity/edit',
|
||||
deleteOne = '/aiol/aiolActivity/delete',
|
||||
deleteBatch = '/aiol/aiolActivity/deleteBatch',
|
||||
importExcel = '/aiol/aiolActivity/importExcel',
|
||||
exportXls = '/aiol/aiolActivity/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) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
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,179 @@
|
||||
import {BasicColumn} from '/@/components/Table';
|
||||
import {FormSchema} from '/@/components/Table';
|
||||
import { rules} from '/@/utils/helper/validator';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '标题',
|
||||
align:"center",
|
||||
dataIndex: 'title'
|
||||
},
|
||||
{
|
||||
title: '介绍',
|
||||
align:"center",
|
||||
dataIndex: 'introduction',
|
||||
},
|
||||
{
|
||||
title: '说明图片',
|
||||
align:"center",
|
||||
dataIndex: 'imgs',
|
||||
customRender:render.renderImage,
|
||||
},
|
||||
{
|
||||
title: '头图',
|
||||
align:"center",
|
||||
dataIndex: 'banner',
|
||||
customRender:render.renderImage,
|
||||
},
|
||||
{
|
||||
title: '介绍视频',
|
||||
align:"center",
|
||||
dataIndex: 'video',
|
||||
},
|
||||
{
|
||||
title: '报名人数上限',
|
||||
align:"center",
|
||||
dataIndex: 'maxNum'
|
||||
},
|
||||
{
|
||||
title: '开始时间',
|
||||
align:"center",
|
||||
dataIndex: 'startTime'
|
||||
},
|
||||
{
|
||||
title: '结束时间',
|
||||
align:"center",
|
||||
dataIndex: 'endTime'
|
||||
},
|
||||
{
|
||||
title: '扩展字段',
|
||||
align:"center",
|
||||
dataIndex: 'extra'
|
||||
},
|
||||
{
|
||||
title: '附件',
|
||||
align:"center",
|
||||
dataIndex: 'attachment',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
align:"center",
|
||||
dataIndex: 'status_dictText'
|
||||
},
|
||||
];
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
];
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '标题',
|
||||
field: 'title',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '介绍',
|
||||
field: 'introduction',
|
||||
component: 'JEditor',
|
||||
},
|
||||
{
|
||||
label: '说明图片',
|
||||
field: 'imgs',
|
||||
component: 'JImageUpload',
|
||||
componentProps:{
|
||||
fileMax: 0
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '头图',
|
||||
field: 'banner',
|
||||
component: 'JImageUpload',
|
||||
componentProps:{
|
||||
fileMax: 0
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '介绍视频',
|
||||
field: 'video',
|
||||
component: 'JUpload',
|
||||
componentProps:{
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '报名人数上限',
|
||||
field: 'maxNum',
|
||||
component: 'InputNumber',
|
||||
},
|
||||
{
|
||||
label: '开始时间',
|
||||
field: 'startTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss'
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '结束时间',
|
||||
field: 'endTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss'
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '扩展字段',
|
||||
field: 'extra',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '附件',
|
||||
field: 'attachment',
|
||||
component: 'JUpload',
|
||||
componentProps:{
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
field: 'status',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps:{
|
||||
dictCode:"course_status",
|
||||
type: "radio"
|
||||
},
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
{
|
||||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
title: {title: '标题',order: 0,view: 'text', type: 'string',},
|
||||
introduction: {title: '介绍',order: 1,view: 'umeditor', type: 'string',},
|
||||
imgs: {title: '说明图片',order: 2,view: 'image', type: 'string',},
|
||||
banner: {title: '头图',order: 3,view: 'image', type: 'string',},
|
||||
video: {title: '介绍视频',order: 4,view: 'file', type: 'string',},
|
||||
maxNum: {title: '报名人数上限',order: 5,view: 'number', type: 'number',},
|
||||
startTime: {title: '开始时间',order: 6,view: 'datetime', type: 'string',},
|
||||
endTime: {title: '结束时间',order: 7,view: 'datetime', type: 'string',},
|
||||
extra: {title: '扩展字段',order: 8,view: 'text', type: 'string',},
|
||||
attachment: {title: '附件',order: 9,view: 'file', type: 'string',},
|
||||
status: {title: '状态',order: 10,view: 'radio', type: 'string',dictCode: 'course_status',},
|
||||
};
|
||||
|
||||
/**
|
||||
* 流程表单调用这个方法获取formSchema
|
||||
* @param param
|
||||
*/
|
||||
export function getBpmFormSchema(_formData): FormSchema[]{
|
||||
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
|
||||
return formSchema;
|
||||
}
|
@ -0,0 +1,220 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" v-auth="'aiol:aiol_activity:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<a-button type="primary" v-auth="'aiol:aiol_activity:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||
<j-upload-button type="primary" v-auth="'aiol:aiol_activity:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
|
||||
|
||||
<a-dropdown v-if="selectedRowKeys.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 v-auth="'aiol:aiol_activity:deleteBatch'">批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<!-- 高级查询 -->
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
<template v-if="column.dataIndex==='introduction'">
|
||||
<!--富文本件字段回显插槽-->
|
||||
<div v-html="text"></div>
|
||||
</template>
|
||||
<template v-if="column.dataIndex==='video'">
|
||||
<!--文件字段回显插槽-->
|
||||
<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>
|
||||
<template v-if="column.dataIndex==='attachment'">
|
||||
<!--文件字段回显插槽-->
|
||||
<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>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<AiolActivityModal @register="registerModal" @success="handleSuccess"></AiolActivityModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="aiol-aiolActivity" setup>
|
||||
import {ref, reactive, computed, unref} from 'vue';
|
||||
import {BasicTable, useTable, TableAction} from '/@/components/Table';
|
||||
import {useModal} from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage'
|
||||
import AiolActivityModal from './components/AiolActivityModal.vue'
|
||||
import {columns, searchFormSchema, superQuerySchema} from './AiolActivity.data';
|
||||
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './AiolActivity.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getDateByPicker } from '/@/utils';
|
||||
//日期个性化选择
|
||||
const fieldPickers = reactive({
|
||||
});
|
||||
const queryParam = reactive<any>({});
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
const userStore = useUserStore();
|
||||
const { createMessage } = useMessage();
|
||||
//注册model
|
||||
const [registerModal, {openModal}] = useModal();
|
||||
//注册table数据
|
||||
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
|
||||
tableProps:{
|
||||
title: '活动',
|
||||
api: list,
|
||||
columns,
|
||||
canResize:true,
|
||||
formConfig: {
|
||||
//labelWidth: 120,
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter:true,
|
||||
showAdvancedButton:true,
|
||||
fieldMapToNumber: [
|
||||
],
|
||||
fieldMapToTime: [
|
||||
],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed:'right'
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
if (params && fieldPickers) {
|
||||
for (let key in fieldPickers) {
|
||||
if (params[key]) {
|
||||
params[key] = getDateByPicker(params[key], fieldPickers[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name:"活动",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
})
|
||||
|
||||
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
|
||||
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
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}, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record){
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'aiol:aiol_activity:edit'
|
||||
}
|
||||
]
|
||||
}
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record){
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
auth: 'aiol:aiol_activity:delete'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-picker),:deep(.ant-input-number){
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,64 @@
|
||||
import {defHttp} from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/aiol/aiolActivitySignup/list',
|
||||
save='/aiol/aiolActivitySignup/add',
|
||||
edit='/aiol/aiolActivitySignup/edit',
|
||||
deleteOne = '/aiol/aiolActivitySignup/delete',
|
||||
deleteBatch = '/aiol/aiolActivitySignup/deleteBatch',
|
||||
importExcel = '/aiol/aiolActivitySignup/importExcel',
|
||||
exportXls = '/aiol/aiolActivitySignup/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) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
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,100 @@
|
||||
import {BasicColumn} from '/@/components/Table';
|
||||
import {FormSchema} from '/@/components/Table';
|
||||
import { rules} from '/@/utils/helper/validator';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '姓名',
|
||||
align:"center",
|
||||
dataIndex: 'name'
|
||||
},
|
||||
{
|
||||
title: '年龄',
|
||||
align:"center",
|
||||
dataIndex: 'age'
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
align:"center",
|
||||
dataIndex: 'phone'
|
||||
},
|
||||
{
|
||||
title: '邮箱',
|
||||
align:"center",
|
||||
dataIndex: 'email'
|
||||
},
|
||||
{
|
||||
title: '扩展字段',
|
||||
align:"center",
|
||||
dataIndex: 'extra'
|
||||
},
|
||||
{
|
||||
title: '附件',
|
||||
align:"center",
|
||||
dataIndex: 'attachment'
|
||||
},
|
||||
];
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
];
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '姓名',
|
||||
field: 'name',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '年龄',
|
||||
field: 'age',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '手机号',
|
||||
field: 'phone',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '邮箱',
|
||||
field: 'email',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '扩展字段',
|
||||
field: 'extra',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '附件',
|
||||
field: 'attachment',
|
||||
component: 'Input',
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
{
|
||||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
name: {title: '姓名',order: 0,view: 'text', type: 'string',},
|
||||
age: {title: '年龄',order: 1,view: 'text', type: 'string',},
|
||||
phone: {title: '手机号',order: 2,view: 'text', type: 'string',},
|
||||
email: {title: '邮箱',order: 3,view: 'text', type: 'string',},
|
||||
extra: {title: '扩展字段',order: 4,view: 'text', type: 'string',},
|
||||
attachment: {title: '附件',order: 5,view: 'text', type: 'string',},
|
||||
};
|
||||
|
||||
/**
|
||||
* 流程表单调用这个方法获取formSchema
|
||||
* @param param
|
||||
*/
|
||||
export function getBpmFormSchema(_formData): FormSchema[]{
|
||||
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
|
||||
return formSchema;
|
||||
}
|
@ -0,0 +1,206 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" v-auth="'aiol:aiol_activity_signup:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<a-button type="primary" v-auth="'aiol:aiol_activity_signup:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||
<j-upload-button type="primary" v-auth="'aiol:aiol_activity_signup:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
|
||||
|
||||
<a-dropdown v-if="selectedRowKeys.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 v-auth="'aiol:aiol_activity_signup:deleteBatch'">批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<!-- 高级查询 -->
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<AiolActivitySignupModal @register="registerModal" @success="handleSuccess"></AiolActivitySignupModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="aiol-aiolActivitySignup" setup>
|
||||
import {ref, reactive, computed, unref} from 'vue';
|
||||
import {BasicTable, useTable, TableAction} from '/@/components/Table';
|
||||
import {useModal} from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage'
|
||||
import AiolActivitySignupModal from './components/AiolActivitySignupModal.vue'
|
||||
import {columns, searchFormSchema, superQuerySchema} from './AiolActivitySignup.data';
|
||||
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './AiolActivitySignup.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getDateByPicker } from '/@/utils';
|
||||
//日期个性化选择
|
||||
const fieldPickers = reactive({
|
||||
});
|
||||
const queryParam = reactive<any>({});
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
const userStore = useUserStore();
|
||||
const { createMessage } = useMessage();
|
||||
//注册model
|
||||
const [registerModal, {openModal}] = useModal();
|
||||
//注册table数据
|
||||
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
|
||||
tableProps:{
|
||||
title: '活动报名',
|
||||
api: list,
|
||||
columns,
|
||||
canResize:true,
|
||||
formConfig: {
|
||||
//labelWidth: 120,
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter:true,
|
||||
showAdvancedButton:true,
|
||||
fieldMapToNumber: [
|
||||
],
|
||||
fieldMapToTime: [
|
||||
],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed:'right'
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
if (params && fieldPickers) {
|
||||
for (let key in fieldPickers) {
|
||||
if (params[key]) {
|
||||
params[key] = getDateByPicker(params[key], fieldPickers[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name:"活动报名",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
})
|
||||
|
||||
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
|
||||
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
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}, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record){
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'aiol:aiol_activity_signup:edit'
|
||||
}
|
||||
]
|
||||
}
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record){
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
auth: 'aiol:aiol_activity_signup:delete'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-picker),:deep(.ant-input-number){
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,64 @@
|
||||
import {defHttp} from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/aiol/aiolContentConfig/list',
|
||||
save='/aiol/aiolContentConfig/add',
|
||||
edit='/aiol/aiolContentConfig/edit',
|
||||
deleteOne = '/aiol/aiolContentConfig/delete',
|
||||
deleteBatch = '/aiol/aiolContentConfig/deleteBatch',
|
||||
importExcel = '/aiol/aiolContentConfig/importExcel',
|
||||
exportXls = '/aiol/aiolContentConfig/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) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
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,78 @@
|
||||
import {BasicColumn} from '/@/components/Table';
|
||||
import {FormSchema} from '/@/components/Table';
|
||||
import { rules} from '/@/utils/helper/validator';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '配置标识',
|
||||
align:"center",
|
||||
dataIndex: 'contentKey'
|
||||
},
|
||||
{
|
||||
title: '配置值',
|
||||
align:"center",
|
||||
dataIndex: 'contentValue'
|
||||
},
|
||||
{
|
||||
title: '值类型',
|
||||
align:"center",
|
||||
dataIndex: 'valueType'
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
align:"center",
|
||||
dataIndex: 'description'
|
||||
},
|
||||
];
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
];
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '配置标识',
|
||||
field: 'contentKey',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '配置值',
|
||||
field: 'contentValue',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '值类型',
|
||||
field: 'valueType',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '描述',
|
||||
field: 'description',
|
||||
component: 'Input',
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
{
|
||||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
contentKey: {title: '配置标识',order: 0,view: 'text', type: 'string',},
|
||||
contentValue: {title: '配置值',order: 1,view: 'text', type: 'string',},
|
||||
valueType: {title: '值类型',order: 2,view: 'text', type: 'string',},
|
||||
description: {title: '描述',order: 3,view: 'text', type: 'string',},
|
||||
};
|
||||
|
||||
/**
|
||||
* 流程表单调用这个方法获取formSchema
|
||||
* @param param
|
||||
*/
|
||||
export function getBpmFormSchema(_formData): FormSchema[]{
|
||||
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
|
||||
return formSchema;
|
||||
}
|
@ -0,0 +1,206 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" v-auth="'aiol:aiol_content_config:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<a-button type="primary" v-auth="'aiol:aiol_content_config:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||
<j-upload-button type="primary" v-auth="'aiol:aiol_content_config:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
|
||||
|
||||
<a-dropdown v-if="selectedRowKeys.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 v-auth="'aiol:aiol_content_config:deleteBatch'">批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<!-- 高级查询 -->
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<AiolContentConfigModal @register="registerModal" @success="handleSuccess"></AiolContentConfigModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="aiol-aiolContentConfig" setup>
|
||||
import {ref, reactive, computed, unref} from 'vue';
|
||||
import {BasicTable, useTable, TableAction} from '/@/components/Table';
|
||||
import {useModal} from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage'
|
||||
import AiolContentConfigModal from './components/AiolContentConfigModal.vue'
|
||||
import {columns, searchFormSchema, superQuerySchema} from './AiolContentConfig.data';
|
||||
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './AiolContentConfig.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getDateByPicker } from '/@/utils';
|
||||
//日期个性化选择
|
||||
const fieldPickers = reactive({
|
||||
});
|
||||
const queryParam = reactive<any>({});
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
const userStore = useUserStore();
|
||||
const { createMessage } = useMessage();
|
||||
//注册model
|
||||
const [registerModal, {openModal}] = useModal();
|
||||
//注册table数据
|
||||
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
|
||||
tableProps:{
|
||||
title: '内容配置',
|
||||
api: list,
|
||||
columns,
|
||||
canResize:true,
|
||||
formConfig: {
|
||||
//labelWidth: 120,
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter:true,
|
||||
showAdvancedButton:true,
|
||||
fieldMapToNumber: [
|
||||
],
|
||||
fieldMapToTime: [
|
||||
],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed:'right'
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
if (params && fieldPickers) {
|
||||
for (let key in fieldPickers) {
|
||||
if (params[key]) {
|
||||
params[key] = getDateByPicker(params[key], fieldPickers[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name:"内容配置",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
})
|
||||
|
||||
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
|
||||
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
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}, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record){
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'aiol:aiol_content_config:edit'
|
||||
}
|
||||
]
|
||||
}
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record){
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
auth: 'aiol:aiol_content_config:delete'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-picker),:deep(.ant-input-number){
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,64 @@
|
||||
import {defHttp} from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/aiol/aiolTag/list',
|
||||
save='/aiol/aiolTag/add',
|
||||
edit='/aiol/aiolTag/edit',
|
||||
deleteOne = '/aiol/aiolTag/delete',
|
||||
deleteBatch = '/aiol/aiolTag/deleteBatch',
|
||||
importExcel = '/aiol/aiolTag/importExcel',
|
||||
exportXls = '/aiol/aiolTag/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) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
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,78 @@
|
||||
import {BasicColumn} from '/@/components/Table';
|
||||
import {FormSchema} from '/@/components/Table';
|
||||
import { rules} from '/@/utils/helper/validator';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '标签名',
|
||||
align:"center",
|
||||
dataIndex: 'name'
|
||||
},
|
||||
{
|
||||
title: '目标类型',
|
||||
align:"center",
|
||||
dataIndex: 'targetType'
|
||||
},
|
||||
{
|
||||
title: '目标id',
|
||||
align:"center",
|
||||
dataIndex: 'targetId'
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
align:"center",
|
||||
dataIndex: 'description'
|
||||
},
|
||||
];
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
];
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '标签名',
|
||||
field: 'name',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '目标类型',
|
||||
field: 'targetType',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '目标id',
|
||||
field: 'targetId',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '描述',
|
||||
field: 'description',
|
||||
component: 'Input',
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
{
|
||||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
name: {title: '标签名',order: 0,view: 'text', type: 'string',},
|
||||
targetType: {title: '目标类型',order: 1,view: 'text', type: 'string',},
|
||||
targetId: {title: '目标id',order: 2,view: 'text', type: 'string',},
|
||||
description: {title: '描述',order: 3,view: 'text', type: 'string',},
|
||||
};
|
||||
|
||||
/**
|
||||
* 流程表单调用这个方法获取formSchema
|
||||
* @param param
|
||||
*/
|
||||
export function getBpmFormSchema(_formData): FormSchema[]{
|
||||
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
|
||||
return formSchema;
|
||||
}
|
@ -0,0 +1,206 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" v-auth="'aiol:aiol_tag:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<a-button type="primary" v-auth="'aiol:aiol_tag:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||
<j-upload-button type="primary" v-auth="'aiol:aiol_tag:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
|
||||
|
||||
<a-dropdown v-if="selectedRowKeys.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 v-auth="'aiol:aiol_tag:deleteBatch'">批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<!-- 高级查询 -->
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<AiolTagModal @register="registerModal" @success="handleSuccess"></AiolTagModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="aiol-aiolTag" setup>
|
||||
import {ref, reactive, computed, unref} from 'vue';
|
||||
import {BasicTable, useTable, TableAction} from '/@/components/Table';
|
||||
import {useModal} from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage'
|
||||
import AiolTagModal from './components/AiolTagModal.vue'
|
||||
import {columns, searchFormSchema, superQuerySchema} from './AiolTag.data';
|
||||
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './AiolTag.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getDateByPicker } from '/@/utils';
|
||||
//日期个性化选择
|
||||
const fieldPickers = reactive({
|
||||
});
|
||||
const queryParam = reactive<any>({});
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
const userStore = useUserStore();
|
||||
const { createMessage } = useMessage();
|
||||
//注册model
|
||||
const [registerModal, {openModal}] = useModal();
|
||||
//注册table数据
|
||||
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
|
||||
tableProps:{
|
||||
title: '标签',
|
||||
api: list,
|
||||
columns,
|
||||
canResize:true,
|
||||
formConfig: {
|
||||
//labelWidth: 120,
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter:true,
|
||||
showAdvancedButton:true,
|
||||
fieldMapToNumber: [
|
||||
],
|
||||
fieldMapToTime: [
|
||||
],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed:'right'
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
if (params && fieldPickers) {
|
||||
for (let key in fieldPickers) {
|
||||
if (params[key]) {
|
||||
params[key] = getDateByPicker(params[key], fieldPickers[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name:"标签",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
})
|
||||
|
||||
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
|
||||
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
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}, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record){
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'aiol:aiol_tag:edit'
|
||||
}
|
||||
]
|
||||
}
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record){
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
auth: 'aiol:aiol_tag:delete'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-picker),:deep(.ant-input-number){
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,26 @@
|
||||
-- 注意:该页面对应的前台目录为views/aiol文件夹下
|
||||
-- 如果你想更改到其他目录,请修改sql中component字段对应的值
|
||||
|
||||
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
|
||||
VALUES ('202508310532220470', NULL, '活动', '/aiol/aiolActivityList', 'aiol/AiolActivityList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-08-31 17:32:47', NULL, NULL, 0);
|
||||
|
||||
-- 权限控制sql
|
||||
-- 新增
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('202508310532220471', '202508310532220470', '添加活动', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:47', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 编辑
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('202508310532220472', '202508310532220470', '编辑活动', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:47', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 删除
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('202508310532220473', '202508310532220470', '删除活动', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:47', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 批量删除
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('202508310532220474', '202508310532220470', '批量删除活动', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:47', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 导出excel
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('202508310532220475', '202508310532220470', '导出excel_活动', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:47', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 导入excel
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('202508310532220476', '202508310532220470', '导入excel_活动', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:47', NULL, NULL, 0, 0, '1', 0);
|
@ -0,0 +1,26 @@
|
||||
-- 注意:该页面对应的前台目录为views/aiol文件夹下
|
||||
-- 如果你想更改到其他目录,请修改sql中component字段对应的值
|
||||
|
||||
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
|
||||
VALUES ('2025083105325940510', NULL, '活动报名', '/aiol/aiolActivitySignupList', 'aiol/AiolActivitySignupList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-08-31 17:32:51', NULL, NULL, 0);
|
||||
|
||||
-- 权限控制sql
|
||||
-- 新增
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105325950511', '2025083105325940510', '添加活动报名', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity_signup:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:51', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 编辑
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105325950512', '2025083105325940510', '编辑活动报名', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity_signup:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:51', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 删除
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105325950513', '2025083105325940510', '删除活动报名', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity_signup:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:51', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 批量删除
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105325950514', '2025083105325940510', '批量删除活动报名', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity_signup:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:51', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 导出excel
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105325950515', '2025083105325940510', '导出excel_活动报名', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity_signup:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:51', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 导入excel
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105325950516', '2025083105325940510', '导入excel_活动报名', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity_signup:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:51', NULL, NULL, 0, 0, '1', 0);
|
@ -0,0 +1,26 @@
|
||||
-- 注意:该页面对应的前台目录为views/aiol文件夹下
|
||||
-- 如果你想更改到其他目录,请修改sql中component字段对应的值
|
||||
|
||||
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
|
||||
VALUES ('2025083105162700080', NULL, '内容配置', '/aiol/aiolContentConfigList', 'aiol/AiolContentConfigList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-08-31 17:16:08', NULL, NULL, 0);
|
||||
|
||||
-- 权限控制sql
|
||||
-- 新增
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105162700081', '2025083105162700080', '添加内容配置', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_content_config:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:16:08', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 编辑
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105162700082', '2025083105162700080', '编辑内容配置', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_content_config:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:16:08', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 删除
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105162700083', '2025083105162700080', '删除内容配置', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_content_config:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:16:08', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 批量删除
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105162700084', '2025083105162700080', '批量删除内容配置', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_content_config:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:16:08', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 导出excel
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105162700085', '2025083105162700080', '导出excel_内容配置', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_content_config:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:16:08', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 导入excel
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105162700086', '2025083105162700080', '导入excel_内容配置', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_content_config:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:16:08', NULL, NULL, 0, 0, '1', 0);
|
@ -0,0 +1,26 @@
|
||||
-- 注意:该页面对应的前台目录为views/aiol文件夹下
|
||||
-- 如果你想更改到其他目录,请修改sql中component字段对应的值
|
||||
|
||||
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
|
||||
VALUES ('2025083105371050490', NULL, '标签', '/aiol/aiolTagList', 'aiol/AiolTagList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-08-31 17:37:49', NULL, NULL, 0);
|
||||
|
||||
-- 权限控制sql
|
||||
-- 新增
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105371050491', '2025083105371050490', '添加标签', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_tag:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:37:49', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 编辑
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105371050492', '2025083105371050490', '编辑标签', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_tag:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:37:49', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 删除
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105371050493', '2025083105371050490', '删除标签', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_tag:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:37:49', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 批量删除
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105371050494', '2025083105371050490', '批量删除标签', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_tag:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:37:49', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 导出excel
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105371050495', '2025083105371050490', '导出excel_标签', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_tag:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:37:49', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 导入excel
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105371050496', '2025083105371050490', '导入excel_标签', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_tag:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:37:49', NULL, NULL, 0, 0, '1', 0);
|
@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<div style="min-height: 400px">
|
||||
<BasicForm @register="registerForm"></BasicForm>
|
||||
<div style="width: 100%;text-align: center" v-if="!formDisabled">
|
||||
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||
import {computed, defineComponent} from 'vue';
|
||||
import {defHttp} from '/@/utils/http/axios';
|
||||
import { propTypes } from '/@/utils/propTypes';
|
||||
import {getBpmFormSchema} from '../AiolActivity.data';
|
||||
import {saveOrUpdate} from '../AiolActivity.api';
|
||||
|
||||
export default defineComponent({
|
||||
name: "AiolActivityForm",
|
||||
components:{
|
||||
BasicForm
|
||||
},
|
||||
props:{
|
||||
formData: propTypes.object.def({}),
|
||||
formBpm: propTypes.bool.def(true),
|
||||
},
|
||||
setup(props){
|
||||
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
|
||||
labelWidth: 150,
|
||||
schemas: getBpmFormSchema(props.formData),
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: {span: 24}
|
||||
});
|
||||
|
||||
const formDisabled = computed(()=>{
|
||||
if(props.formData.disabled === false){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
let formData = {};
|
||||
const queryByIdUrl = '/aiol/aiolActivity/queryById';
|
||||
async function initFormData(){
|
||||
let params = {id: props.formData.dataId};
|
||||
const data = await defHttp.get({url: queryByIdUrl, params});
|
||||
formData = {...data}
|
||||
//设置表单的值
|
||||
await setFieldsValue(formData);
|
||||
//默认是禁用
|
||||
await setProps({disabled: formDisabled.value})
|
||||
}
|
||||
|
||||
async function submitForm() {
|
||||
let data = getFieldsValue();
|
||||
let params = Object.assign({}, formData, data);
|
||||
console.log('表单数据', params)
|
||||
await saveOrUpdate(params, true)
|
||||
}
|
||||
|
||||
initFormData();
|
||||
|
||||
return {
|
||||
registerForm,
|
||||
formDisabled,
|
||||
submitForm,
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" name="AiolActivityForm" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {ref, computed, unref, reactive} from 'vue';
|
||||
import {BasicModal, useModalInner} from '/@/components/Modal';
|
||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||
import {formSchema} from '../AiolActivity.data';
|
||||
import {saveOrUpdate} from '../AiolActivity.api';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getDateByPicker } from '/@/utils';
|
||||
const { createMessage } = useMessage();
|
||||
// Emits声明
|
||||
const emit = defineEmits(['register','success']);
|
||||
const isUpdate = ref(true);
|
||||
const isDetail = ref(false);
|
||||
//表单配置
|
||||
const [registerForm, { setProps,resetFields, setFieldsValue, validate, scrollToField }] = useForm({
|
||||
labelWidth: 150,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: {span: 24}
|
||||
});
|
||||
//表单赋值
|
||||
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
|
||||
//重置表单
|
||||
await resetFields();
|
||||
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
isDetail.value = !!data?.showFooter;
|
||||
if (unref(isUpdate)) {
|
||||
//表单赋值
|
||||
await setFieldsValue({
|
||||
...data.record,
|
||||
});
|
||||
}
|
||||
// 隐藏底部时禁用整个表单
|
||||
setProps({ disabled: !data?.showFooter })
|
||||
});
|
||||
//日期个性化选择
|
||||
const fieldPickers = reactive({
|
||||
});
|
||||
//设置标题
|
||||
const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑'));
|
||||
//表单提交事件
|
||||
async function handleSubmit(v) {
|
||||
try {
|
||||
let values = await validate();
|
||||
// 预处理日期数据
|
||||
changeDateValue(values);
|
||||
setModalProps({confirmLoading: true});
|
||||
//提交表单
|
||||
await saveOrUpdate(values, isUpdate.value);
|
||||
//关闭弹窗
|
||||
closeModal();
|
||||
//刷新列表
|
||||
emit('success');
|
||||
} catch ({ errorFields }) {
|
||||
if (errorFields) {
|
||||
const firstField = errorFields[0];
|
||||
if (firstField) {
|
||||
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(errorFields);
|
||||
} finally {
|
||||
setModalProps({confirmLoading: false});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理日期值
|
||||
* @param formData 表单数据
|
||||
*/
|
||||
const changeDateValue = (formData) => {
|
||||
if (formData && fieldPickers) {
|
||||
for (let key in fieldPickers) {
|
||||
if (formData[key]) {
|
||||
formData[key] = getDateByPicker(formData[key], fieldPickers[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
/** 时间和数字输入框样式 */
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
:deep(.ant-calendar-picker) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<div style="min-height: 400px">
|
||||
<BasicForm @register="registerForm"></BasicForm>
|
||||
<div style="width: 100%;text-align: center" v-if="!formDisabled">
|
||||
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||
import {computed, defineComponent} from 'vue';
|
||||
import {defHttp} from '/@/utils/http/axios';
|
||||
import { propTypes } from '/@/utils/propTypes';
|
||||
import {getBpmFormSchema} from '../AiolActivitySignup.data';
|
||||
import {saveOrUpdate} from '../AiolActivitySignup.api';
|
||||
|
||||
export default defineComponent({
|
||||
name: "AiolActivitySignupForm",
|
||||
components:{
|
||||
BasicForm
|
||||
},
|
||||
props:{
|
||||
formData: propTypes.object.def({}),
|
||||
formBpm: propTypes.bool.def(true),
|
||||
},
|
||||
setup(props){
|
||||
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
|
||||
labelWidth: 150,
|
||||
schemas: getBpmFormSchema(props.formData),
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: {span: 24}
|
||||
});
|
||||
|
||||
const formDisabled = computed(()=>{
|
||||
if(props.formData.disabled === false){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
let formData = {};
|
||||
const queryByIdUrl = '/aiol/aiolActivitySignup/queryById';
|
||||
async function initFormData(){
|
||||
let params = {id: props.formData.dataId};
|
||||
const data = await defHttp.get({url: queryByIdUrl, params});
|
||||
formData = {...data}
|
||||
//设置表单的值
|
||||
await setFieldsValue(formData);
|
||||
//默认是禁用
|
||||
await setProps({disabled: formDisabled.value})
|
||||
}
|
||||
|
||||
async function submitForm() {
|
||||
let data = getFieldsValue();
|
||||
let params = Object.assign({}, formData, data);
|
||||
console.log('表单数据', params)
|
||||
await saveOrUpdate(params, true)
|
||||
}
|
||||
|
||||
initFormData();
|
||||
|
||||
return {
|
||||
registerForm,
|
||||
formDisabled,
|
||||
submitForm,
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" name="AiolActivitySignupForm" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {ref, computed, unref, reactive} from 'vue';
|
||||
import {BasicModal, useModalInner} from '/@/components/Modal';
|
||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||
import {formSchema} from '../AiolActivitySignup.data';
|
||||
import {saveOrUpdate} from '../AiolActivitySignup.api';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getDateByPicker } from '/@/utils';
|
||||
const { createMessage } = useMessage();
|
||||
// Emits声明
|
||||
const emit = defineEmits(['register','success']);
|
||||
const isUpdate = ref(true);
|
||||
const isDetail = ref(false);
|
||||
//表单配置
|
||||
const [registerForm, { setProps,resetFields, setFieldsValue, validate, scrollToField }] = useForm({
|
||||
labelWidth: 150,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: {span: 24}
|
||||
});
|
||||
//表单赋值
|
||||
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
|
||||
//重置表单
|
||||
await resetFields();
|
||||
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
isDetail.value = !!data?.showFooter;
|
||||
if (unref(isUpdate)) {
|
||||
//表单赋值
|
||||
await setFieldsValue({
|
||||
...data.record,
|
||||
});
|
||||
}
|
||||
// 隐藏底部时禁用整个表单
|
||||
setProps({ disabled: !data?.showFooter })
|
||||
});
|
||||
//日期个性化选择
|
||||
const fieldPickers = reactive({
|
||||
});
|
||||
//设置标题
|
||||
const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑'));
|
||||
//表单提交事件
|
||||
async function handleSubmit(v) {
|
||||
try {
|
||||
let values = await validate();
|
||||
// 预处理日期数据
|
||||
changeDateValue(values);
|
||||
setModalProps({confirmLoading: true});
|
||||
//提交表单
|
||||
await saveOrUpdate(values, isUpdate.value);
|
||||
//关闭弹窗
|
||||
closeModal();
|
||||
//刷新列表
|
||||
emit('success');
|
||||
} catch ({ errorFields }) {
|
||||
if (errorFields) {
|
||||
const firstField = errorFields[0];
|
||||
if (firstField) {
|
||||
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(errorFields);
|
||||
} finally {
|
||||
setModalProps({confirmLoading: false});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理日期值
|
||||
* @param formData 表单数据
|
||||
*/
|
||||
const changeDateValue = (formData) => {
|
||||
if (formData && fieldPickers) {
|
||||
for (let key in fieldPickers) {
|
||||
if (formData[key]) {
|
||||
formData[key] = getDateByPicker(formData[key], fieldPickers[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
/** 时间和数字输入框样式 */
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
:deep(.ant-calendar-picker) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<div style="min-height: 400px">
|
||||
<BasicForm @register="registerForm"></BasicForm>
|
||||
<div style="width: 100%;text-align: center" v-if="!formDisabled">
|
||||
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||
import {computed, defineComponent} from 'vue';
|
||||
import {defHttp} from '/@/utils/http/axios';
|
||||
import { propTypes } from '/@/utils/propTypes';
|
||||
import {getBpmFormSchema} from '../AiolContentConfig.data';
|
||||
import {saveOrUpdate} from '../AiolContentConfig.api';
|
||||
|
||||
export default defineComponent({
|
||||
name: "AiolContentConfigForm",
|
||||
components:{
|
||||
BasicForm
|
||||
},
|
||||
props:{
|
||||
formData: propTypes.object.def({}),
|
||||
formBpm: propTypes.bool.def(true),
|
||||
},
|
||||
setup(props){
|
||||
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
|
||||
labelWidth: 150,
|
||||
schemas: getBpmFormSchema(props.formData),
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: {span: 24}
|
||||
});
|
||||
|
||||
const formDisabled = computed(()=>{
|
||||
if(props.formData.disabled === false){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
let formData = {};
|
||||
const queryByIdUrl = '/aiol/aiolContentConfig/queryById';
|
||||
async function initFormData(){
|
||||
let params = {id: props.formData.dataId};
|
||||
const data = await defHttp.get({url: queryByIdUrl, params});
|
||||
formData = {...data}
|
||||
//设置表单的值
|
||||
await setFieldsValue(formData);
|
||||
//默认是禁用
|
||||
await setProps({disabled: formDisabled.value})
|
||||
}
|
||||
|
||||
async function submitForm() {
|
||||
let data = getFieldsValue();
|
||||
let params = Object.assign({}, formData, data);
|
||||
console.log('表单数据', params)
|
||||
await saveOrUpdate(params, true)
|
||||
}
|
||||
|
||||
initFormData();
|
||||
|
||||
return {
|
||||
registerForm,
|
||||
formDisabled,
|
||||
submitForm,
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" name="AiolContentConfigForm" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {ref, computed, unref, reactive} from 'vue';
|
||||
import {BasicModal, useModalInner} from '/@/components/Modal';
|
||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||
import {formSchema} from '../AiolContentConfig.data';
|
||||
import {saveOrUpdate} from '../AiolContentConfig.api';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getDateByPicker } from '/@/utils';
|
||||
const { createMessage } = useMessage();
|
||||
// Emits声明
|
||||
const emit = defineEmits(['register','success']);
|
||||
const isUpdate = ref(true);
|
||||
const isDetail = ref(false);
|
||||
//表单配置
|
||||
const [registerForm, { setProps,resetFields, setFieldsValue, validate, scrollToField }] = useForm({
|
||||
labelWidth: 150,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: {span: 24}
|
||||
});
|
||||
//表单赋值
|
||||
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
|
||||
//重置表单
|
||||
await resetFields();
|
||||
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
isDetail.value = !!data?.showFooter;
|
||||
if (unref(isUpdate)) {
|
||||
//表单赋值
|
||||
await setFieldsValue({
|
||||
...data.record,
|
||||
});
|
||||
}
|
||||
// 隐藏底部时禁用整个表单
|
||||
setProps({ disabled: !data?.showFooter })
|
||||
});
|
||||
//日期个性化选择
|
||||
const fieldPickers = reactive({
|
||||
});
|
||||
//设置标题
|
||||
const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑'));
|
||||
//表单提交事件
|
||||
async function handleSubmit(v) {
|
||||
try {
|
||||
let values = await validate();
|
||||
// 预处理日期数据
|
||||
changeDateValue(values);
|
||||
setModalProps({confirmLoading: true});
|
||||
//提交表单
|
||||
await saveOrUpdate(values, isUpdate.value);
|
||||
//关闭弹窗
|
||||
closeModal();
|
||||
//刷新列表
|
||||
emit('success');
|
||||
} catch ({ errorFields }) {
|
||||
if (errorFields) {
|
||||
const firstField = errorFields[0];
|
||||
if (firstField) {
|
||||
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(errorFields);
|
||||
} finally {
|
||||
setModalProps({confirmLoading: false});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理日期值
|
||||
* @param formData 表单数据
|
||||
*/
|
||||
const changeDateValue = (formData) => {
|
||||
if (formData && fieldPickers) {
|
||||
for (let key in fieldPickers) {
|
||||
if (formData[key]) {
|
||||
formData[key] = getDateByPicker(formData[key], fieldPickers[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
/** 时间和数字输入框样式 */
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
:deep(.ant-calendar-picker) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<div style="min-height: 400px">
|
||||
<BasicForm @register="registerForm"></BasicForm>
|
||||
<div style="width: 100%;text-align: center" v-if="!formDisabled">
|
||||
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||
import {computed, defineComponent} from 'vue';
|
||||
import {defHttp} from '/@/utils/http/axios';
|
||||
import { propTypes } from '/@/utils/propTypes';
|
||||
import {getBpmFormSchema} from '../AiolTag.data';
|
||||
import {saveOrUpdate} from '../AiolTag.api';
|
||||
|
||||
export default defineComponent({
|
||||
name: "AiolTagForm",
|
||||
components:{
|
||||
BasicForm
|
||||
},
|
||||
props:{
|
||||
formData: propTypes.object.def({}),
|
||||
formBpm: propTypes.bool.def(true),
|
||||
},
|
||||
setup(props){
|
||||
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
|
||||
labelWidth: 150,
|
||||
schemas: getBpmFormSchema(props.formData),
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: {span: 24}
|
||||
});
|
||||
|
||||
const formDisabled = computed(()=>{
|
||||
if(props.formData.disabled === false){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
let formData = {};
|
||||
const queryByIdUrl = '/aiol/aiolTag/queryById';
|
||||
async function initFormData(){
|
||||
let params = {id: props.formData.dataId};
|
||||
const data = await defHttp.get({url: queryByIdUrl, params});
|
||||
formData = {...data}
|
||||
//设置表单的值
|
||||
await setFieldsValue(formData);
|
||||
//默认是禁用
|
||||
await setProps({disabled: formDisabled.value})
|
||||
}
|
||||
|
||||
async function submitForm() {
|
||||
let data = getFieldsValue();
|
||||
let params = Object.assign({}, formData, data);
|
||||
console.log('表单数据', params)
|
||||
await saveOrUpdate(params, true)
|
||||
}
|
||||
|
||||
initFormData();
|
||||
|
||||
return {
|
||||
registerForm,
|
||||
formDisabled,
|
||||
submitForm,
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" name="AiolTagForm" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {ref, computed, unref, reactive} from 'vue';
|
||||
import {BasicModal, useModalInner} from '/@/components/Modal';
|
||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||
import {formSchema} from '../AiolTag.data';
|
||||
import {saveOrUpdate} from '../AiolTag.api';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getDateByPicker } from '/@/utils';
|
||||
const { createMessage } = useMessage();
|
||||
// Emits声明
|
||||
const emit = defineEmits(['register','success']);
|
||||
const isUpdate = ref(true);
|
||||
const isDetail = ref(false);
|
||||
//表单配置
|
||||
const [registerForm, { setProps,resetFields, setFieldsValue, validate, scrollToField }] = useForm({
|
||||
labelWidth: 150,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: {span: 24}
|
||||
});
|
||||
//表单赋值
|
||||
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
|
||||
//重置表单
|
||||
await resetFields();
|
||||
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
isDetail.value = !!data?.showFooter;
|
||||
if (unref(isUpdate)) {
|
||||
//表单赋值
|
||||
await setFieldsValue({
|
||||
...data.record,
|
||||
});
|
||||
}
|
||||
// 隐藏底部时禁用整个表单
|
||||
setProps({ disabled: !data?.showFooter })
|
||||
});
|
||||
//日期个性化选择
|
||||
const fieldPickers = reactive({
|
||||
});
|
||||
//设置标题
|
||||
const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑'));
|
||||
//表单提交事件
|
||||
async function handleSubmit(v) {
|
||||
try {
|
||||
let values = await validate();
|
||||
// 预处理日期数据
|
||||
changeDateValue(values);
|
||||
setModalProps({confirmLoading: true});
|
||||
//提交表单
|
||||
await saveOrUpdate(values, isUpdate.value);
|
||||
//关闭弹窗
|
||||
closeModal();
|
||||
//刷新列表
|
||||
emit('success');
|
||||
} catch ({ errorFields }) {
|
||||
if (errorFields) {
|
||||
const firstField = errorFields[0];
|
||||
if (firstField) {
|
||||
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(errorFields);
|
||||
} finally {
|
||||
setModalProps({confirmLoading: false});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理日期值
|
||||
* @param formData 表单数据
|
||||
*/
|
||||
const changeDateValue = (formData) => {
|
||||
if (formData && fieldPickers) {
|
||||
for (let key in fieldPickers) {
|
||||
if (formData[key]) {
|
||||
formData[key] = getDateByPicker(formData[key], fieldPickers[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
/** 时间和数字输入框样式 */
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
:deep(.ant-calendar-picker) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
@ -16,7 +16,7 @@ import org.jeecg.config.shiro.IgnoreAuth;
|
||||
import org.jeecg.modules.biz.service.ActivityBizService;
|
||||
import org.jeecg.modules.gen.activity.entity.Activity;
|
||||
import org.jeecg.modules.gen.aioltag.entity.AiolTag;
|
||||
import org.jeecg.modules.gen.aioltag.mapper.AiolTagMapper;
|
||||
import org.jeecg.modules.gen.aioltag.mapper.AiolTagMapper1;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
|
||||
@RestController
|
||||
@ -28,7 +28,7 @@ public class ActivityBizController {
|
||||
@Autowired
|
||||
private ActivityBizService activityBizService;
|
||||
@Autowired
|
||||
private AiolTagMapper aiolTagMapper;
|
||||
private AiolTagMapper1 aiolTagMapper;
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "查询活动列表")
|
||||
|
@ -0,0 +1,165 @@
|
||||
package org.jeecg.modules.gen.aioltag.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
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.modules.gen.aioltag.entity.AiolTag;
|
||||
import org.jeecg.modules.gen.aioltag.service.IAiolTagService;
|
||||
|
||||
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.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
/**
|
||||
* @Description: 标签
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-08-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Tag(name="标签")
|
||||
@RestController
|
||||
@RequestMapping("/gen/aioltag/aiolTag")
|
||||
@Slf4j
|
||||
public class AiolTagController1 extends JeecgController<AiolTag, IAiolTagService> {
|
||||
@Autowired
|
||||
private IAiolTagService aiolTagService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param aiolTag
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "标签-分页列表查询")
|
||||
@Operation(summary="标签-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<AiolTag>> queryPageList(AiolTag aiolTag,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
|
||||
|
||||
QueryWrapper<AiolTag> queryWrapper = QueryGenerator.initQueryWrapper(aiolTag, req.getParameterMap());
|
||||
Page<AiolTag> page = new Page<AiolTag>(pageNo, pageSize);
|
||||
IPage<AiolTag> pageList = aiolTagService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param aiolTag
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "标签-添加")
|
||||
@Operation(summary="标签-添加")
|
||||
@RequiresPermissions("gen.aioltag:aiol_tag:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody AiolTag aiolTag) {
|
||||
aiolTagService.save(aiolTag);
|
||||
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param aiolTag
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "标签-编辑")
|
||||
@Operation(summary="标签-编辑")
|
||||
@RequiresPermissions("gen.aioltag:aiol_tag:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody AiolTag aiolTag) {
|
||||
aiolTagService.updateById(aiolTag);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "标签-通过id删除")
|
||||
@Operation(summary="标签-通过id删除")
|
||||
@RequiresPermissions("gen.aioltag:aiol_tag:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
aiolTagService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "标签-批量删除")
|
||||
@Operation(summary="标签-批量删除")
|
||||
@RequiresPermissions("gen.aioltag:aiol_tag:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.aiolTagService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "标签-通过id查询")
|
||||
@Operation(summary="标签-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<AiolTag> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
AiolTag aiolTag = aiolTagService.getById(id);
|
||||
if(aiolTag==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(aiolTag);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param aiolTag
|
||||
*/
|
||||
@RequiresPermissions("gen.aioltag:aiol_tag:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, AiolTag aiolTag) {
|
||||
return super.exportXls(request, aiolTag, AiolTag.class, "标签");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("gen.aioltag:aiol_tag:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, AiolTag.class);
|
||||
}
|
||||
|
||||
}
|
@ -12,6 +12,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
* @Date: 2025-08-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface AiolTagMapper extends BaseMapper<AiolTag> {
|
||||
public interface AiolTagMapper1 extends BaseMapper<AiolTag> {
|
||||
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
package org.jeecg.modules.gen.aioltag.service.impl;
|
||||
|
||||
import org.jeecg.modules.gen.aioltag.entity.AiolTag;
|
||||
import org.jeecg.modules.gen.aioltag.mapper.AiolTagMapper;
|
||||
import org.jeecg.modules.gen.aioltag.mapper.AiolTagMapper1;
|
||||
import org.jeecg.modules.gen.aioltag.service.IAiolTagService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -14,6 +14,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class AiolTagServiceImpl extends ServiceImpl<AiolTagMapper, AiolTag> implements IAiolTagService {
|
||||
public class AiolTagServiceImpl1 extends ServiceImpl<AiolTagMapper1, AiolTag> implements IAiolTagService {
|
||||
|
||||
}
|
64
jeecgboot-vue3/src/views/aiol/AiolActivity.api.ts
Normal file
64
jeecgboot-vue3/src/views/aiol/AiolActivity.api.ts
Normal file
@ -0,0 +1,64 @@
|
||||
import {defHttp} from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/aiol/aiolActivity/list',
|
||||
save='/aiol/aiolActivity/add',
|
||||
edit='/aiol/aiolActivity/edit',
|
||||
deleteOne = '/aiol/aiolActivity/delete',
|
||||
deleteBatch = '/aiol/aiolActivity/deleteBatch',
|
||||
importExcel = '/aiol/aiolActivity/importExcel',
|
||||
exportXls = '/aiol/aiolActivity/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) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
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});
|
||||
}
|
179
jeecgboot-vue3/src/views/aiol/AiolActivity.data.ts
Normal file
179
jeecgboot-vue3/src/views/aiol/AiolActivity.data.ts
Normal file
@ -0,0 +1,179 @@
|
||||
import {BasicColumn} from '/@/components/Table';
|
||||
import {FormSchema} from '/@/components/Table';
|
||||
import { rules} from '/@/utils/helper/validator';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '标题',
|
||||
align:"center",
|
||||
dataIndex: 'title'
|
||||
},
|
||||
{
|
||||
title: '介绍',
|
||||
align:"center",
|
||||
dataIndex: 'introduction',
|
||||
},
|
||||
{
|
||||
title: '说明图片',
|
||||
align:"center",
|
||||
dataIndex: 'imgs',
|
||||
customRender:render.renderImage,
|
||||
},
|
||||
{
|
||||
title: '头图',
|
||||
align:"center",
|
||||
dataIndex: 'banner',
|
||||
customRender:render.renderImage,
|
||||
},
|
||||
{
|
||||
title: '介绍视频',
|
||||
align:"center",
|
||||
dataIndex: 'video',
|
||||
},
|
||||
{
|
||||
title: '报名人数上限',
|
||||
align:"center",
|
||||
dataIndex: 'maxNum'
|
||||
},
|
||||
{
|
||||
title: '开始时间',
|
||||
align:"center",
|
||||
dataIndex: 'startTime'
|
||||
},
|
||||
{
|
||||
title: '结束时间',
|
||||
align:"center",
|
||||
dataIndex: 'endTime'
|
||||
},
|
||||
{
|
||||
title: '扩展字段',
|
||||
align:"center",
|
||||
dataIndex: 'extra'
|
||||
},
|
||||
{
|
||||
title: '附件',
|
||||
align:"center",
|
||||
dataIndex: 'attachment',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
align:"center",
|
||||
dataIndex: 'status_dictText'
|
||||
},
|
||||
];
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
];
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '标题',
|
||||
field: 'title',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '介绍',
|
||||
field: 'introduction',
|
||||
component: 'JEditor',
|
||||
},
|
||||
{
|
||||
label: '说明图片',
|
||||
field: 'imgs',
|
||||
component: 'JImageUpload',
|
||||
componentProps:{
|
||||
fileMax: 0
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '头图',
|
||||
field: 'banner',
|
||||
component: 'JImageUpload',
|
||||
componentProps:{
|
||||
fileMax: 0
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '介绍视频',
|
||||
field: 'video',
|
||||
component: 'JUpload',
|
||||
componentProps:{
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '报名人数上限',
|
||||
field: 'maxNum',
|
||||
component: 'InputNumber',
|
||||
},
|
||||
{
|
||||
label: '开始时间',
|
||||
field: 'startTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss'
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '结束时间',
|
||||
field: 'endTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss'
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '扩展字段',
|
||||
field: 'extra',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '附件',
|
||||
field: 'attachment',
|
||||
component: 'JUpload',
|
||||
componentProps:{
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
field: 'status',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps:{
|
||||
dictCode:"course_status",
|
||||
type: "radio"
|
||||
},
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
{
|
||||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
title: {title: '标题',order: 0,view: 'text', type: 'string',},
|
||||
introduction: {title: '介绍',order: 1,view: 'umeditor', type: 'string',},
|
||||
imgs: {title: '说明图片',order: 2,view: 'image', type: 'string',},
|
||||
banner: {title: '头图',order: 3,view: 'image', type: 'string',},
|
||||
video: {title: '介绍视频',order: 4,view: 'file', type: 'string',},
|
||||
maxNum: {title: '报名人数上限',order: 5,view: 'number', type: 'number',},
|
||||
startTime: {title: '开始时间',order: 6,view: 'datetime', type: 'string',},
|
||||
endTime: {title: '结束时间',order: 7,view: 'datetime', type: 'string',},
|
||||
extra: {title: '扩展字段',order: 8,view: 'text', type: 'string',},
|
||||
attachment: {title: '附件',order: 9,view: 'file', type: 'string',},
|
||||
status: {title: '状态',order: 10,view: 'radio', type: 'string',dictCode: 'course_status',},
|
||||
};
|
||||
|
||||
/**
|
||||
* 流程表单调用这个方法获取formSchema
|
||||
* @param param
|
||||
*/
|
||||
export function getBpmFormSchema(_formData): FormSchema[]{
|
||||
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
|
||||
return formSchema;
|
||||
}
|
220
jeecgboot-vue3/src/views/aiol/AiolActivityList.vue
Normal file
220
jeecgboot-vue3/src/views/aiol/AiolActivityList.vue
Normal file
@ -0,0 +1,220 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" v-auth="'aiol:aiol_activity:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<a-button type="primary" v-auth="'aiol:aiol_activity:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||
<j-upload-button type="primary" v-auth="'aiol:aiol_activity:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
|
||||
|
||||
<a-dropdown v-if="selectedRowKeys.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 v-auth="'aiol:aiol_activity:deleteBatch'">批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<!-- 高级查询 -->
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
<template v-if="column.dataIndex==='introduction'">
|
||||
<!--富文本件字段回显插槽-->
|
||||
<div v-html="text"></div>
|
||||
</template>
|
||||
<template v-if="column.dataIndex==='video'">
|
||||
<!--文件字段回显插槽-->
|
||||
<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>
|
||||
<template v-if="column.dataIndex==='attachment'">
|
||||
<!--文件字段回显插槽-->
|
||||
<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>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<AiolActivityModal @register="registerModal" @success="handleSuccess"></AiolActivityModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="aiol-aiolActivity" setup>
|
||||
import {ref, reactive, computed, unref} from 'vue';
|
||||
import {BasicTable, useTable, TableAction} from '/@/components/Table';
|
||||
import {useModal} from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage'
|
||||
import AiolActivityModal from './components/AiolActivityModal.vue'
|
||||
import {columns, searchFormSchema, superQuerySchema} from './AiolActivity.data';
|
||||
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './AiolActivity.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getDateByPicker } from '/@/utils';
|
||||
//日期个性化选择
|
||||
const fieldPickers = reactive({
|
||||
});
|
||||
const queryParam = reactive<any>({});
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
const userStore = useUserStore();
|
||||
const { createMessage } = useMessage();
|
||||
//注册model
|
||||
const [registerModal, {openModal}] = useModal();
|
||||
//注册table数据
|
||||
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
|
||||
tableProps:{
|
||||
title: '活动',
|
||||
api: list,
|
||||
columns,
|
||||
canResize:true,
|
||||
formConfig: {
|
||||
//labelWidth: 120,
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter:true,
|
||||
showAdvancedButton:true,
|
||||
fieldMapToNumber: [
|
||||
],
|
||||
fieldMapToTime: [
|
||||
],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed:'right'
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
if (params && fieldPickers) {
|
||||
for (let key in fieldPickers) {
|
||||
if (params[key]) {
|
||||
params[key] = getDateByPicker(params[key], fieldPickers[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name:"活动",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
})
|
||||
|
||||
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
|
||||
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
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}, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record){
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'aiol:aiol_activity:edit'
|
||||
}
|
||||
]
|
||||
}
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record){
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
auth: 'aiol:aiol_activity:delete'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-picker),:deep(.ant-input-number){
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
64
jeecgboot-vue3/src/views/aiol/AiolActivitySignup.api.ts
Normal file
64
jeecgboot-vue3/src/views/aiol/AiolActivitySignup.api.ts
Normal file
@ -0,0 +1,64 @@
|
||||
import {defHttp} from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/aiol/aiolActivitySignup/list',
|
||||
save='/aiol/aiolActivitySignup/add',
|
||||
edit='/aiol/aiolActivitySignup/edit',
|
||||
deleteOne = '/aiol/aiolActivitySignup/delete',
|
||||
deleteBatch = '/aiol/aiolActivitySignup/deleteBatch',
|
||||
importExcel = '/aiol/aiolActivitySignup/importExcel',
|
||||
exportXls = '/aiol/aiolActivitySignup/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) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
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});
|
||||
}
|
100
jeecgboot-vue3/src/views/aiol/AiolActivitySignup.data.ts
Normal file
100
jeecgboot-vue3/src/views/aiol/AiolActivitySignup.data.ts
Normal file
@ -0,0 +1,100 @@
|
||||
import {BasicColumn} from '/@/components/Table';
|
||||
import {FormSchema} from '/@/components/Table';
|
||||
import { rules} from '/@/utils/helper/validator';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '姓名',
|
||||
align:"center",
|
||||
dataIndex: 'name'
|
||||
},
|
||||
{
|
||||
title: '年龄',
|
||||
align:"center",
|
||||
dataIndex: 'age'
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
align:"center",
|
||||
dataIndex: 'phone'
|
||||
},
|
||||
{
|
||||
title: '邮箱',
|
||||
align:"center",
|
||||
dataIndex: 'email'
|
||||
},
|
||||
{
|
||||
title: '扩展字段',
|
||||
align:"center",
|
||||
dataIndex: 'extra'
|
||||
},
|
||||
{
|
||||
title: '附件',
|
||||
align:"center",
|
||||
dataIndex: 'attachment'
|
||||
},
|
||||
];
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
];
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '姓名',
|
||||
field: 'name',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '年龄',
|
||||
field: 'age',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '手机号',
|
||||
field: 'phone',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '邮箱',
|
||||
field: 'email',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '扩展字段',
|
||||
field: 'extra',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '附件',
|
||||
field: 'attachment',
|
||||
component: 'Input',
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
{
|
||||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
name: {title: '姓名',order: 0,view: 'text', type: 'string',},
|
||||
age: {title: '年龄',order: 1,view: 'text', type: 'string',},
|
||||
phone: {title: '手机号',order: 2,view: 'text', type: 'string',},
|
||||
email: {title: '邮箱',order: 3,view: 'text', type: 'string',},
|
||||
extra: {title: '扩展字段',order: 4,view: 'text', type: 'string',},
|
||||
attachment: {title: '附件',order: 5,view: 'text', type: 'string',},
|
||||
};
|
||||
|
||||
/**
|
||||
* 流程表单调用这个方法获取formSchema
|
||||
* @param param
|
||||
*/
|
||||
export function getBpmFormSchema(_formData): FormSchema[]{
|
||||
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
|
||||
return formSchema;
|
||||
}
|
206
jeecgboot-vue3/src/views/aiol/AiolActivitySignupList.vue
Normal file
206
jeecgboot-vue3/src/views/aiol/AiolActivitySignupList.vue
Normal file
@ -0,0 +1,206 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" v-auth="'aiol:aiol_activity_signup:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<a-button type="primary" v-auth="'aiol:aiol_activity_signup:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||
<j-upload-button type="primary" v-auth="'aiol:aiol_activity_signup:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
|
||||
|
||||
<a-dropdown v-if="selectedRowKeys.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 v-auth="'aiol:aiol_activity_signup:deleteBatch'">批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<!-- 高级查询 -->
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<AiolActivitySignupModal @register="registerModal" @success="handleSuccess"></AiolActivitySignupModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="aiol-aiolActivitySignup" setup>
|
||||
import {ref, reactive, computed, unref} from 'vue';
|
||||
import {BasicTable, useTable, TableAction} from '/@/components/Table';
|
||||
import {useModal} from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage'
|
||||
import AiolActivitySignupModal from './components/AiolActivitySignupModal.vue'
|
||||
import {columns, searchFormSchema, superQuerySchema} from './AiolActivitySignup.data';
|
||||
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './AiolActivitySignup.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getDateByPicker } from '/@/utils';
|
||||
//日期个性化选择
|
||||
const fieldPickers = reactive({
|
||||
});
|
||||
const queryParam = reactive<any>({});
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
const userStore = useUserStore();
|
||||
const { createMessage } = useMessage();
|
||||
//注册model
|
||||
const [registerModal, {openModal}] = useModal();
|
||||
//注册table数据
|
||||
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
|
||||
tableProps:{
|
||||
title: '活动报名',
|
||||
api: list,
|
||||
columns,
|
||||
canResize:true,
|
||||
formConfig: {
|
||||
//labelWidth: 120,
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter:true,
|
||||
showAdvancedButton:true,
|
||||
fieldMapToNumber: [
|
||||
],
|
||||
fieldMapToTime: [
|
||||
],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed:'right'
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
if (params && fieldPickers) {
|
||||
for (let key in fieldPickers) {
|
||||
if (params[key]) {
|
||||
params[key] = getDateByPicker(params[key], fieldPickers[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name:"活动报名",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
})
|
||||
|
||||
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
|
||||
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
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}, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record){
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'aiol:aiol_activity_signup:edit'
|
||||
}
|
||||
]
|
||||
}
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record){
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
auth: 'aiol:aiol_activity_signup:delete'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-picker),:deep(.ant-input-number){
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
64
jeecgboot-vue3/src/views/aiol/AiolContentConfig.api.ts
Normal file
64
jeecgboot-vue3/src/views/aiol/AiolContentConfig.api.ts
Normal file
@ -0,0 +1,64 @@
|
||||
import {defHttp} from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/aiol/aiolContentConfig/list',
|
||||
save='/aiol/aiolContentConfig/add',
|
||||
edit='/aiol/aiolContentConfig/edit',
|
||||
deleteOne = '/aiol/aiolContentConfig/delete',
|
||||
deleteBatch = '/aiol/aiolContentConfig/deleteBatch',
|
||||
importExcel = '/aiol/aiolContentConfig/importExcel',
|
||||
exportXls = '/aiol/aiolContentConfig/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) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
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});
|
||||
}
|
78
jeecgboot-vue3/src/views/aiol/AiolContentConfig.data.ts
Normal file
78
jeecgboot-vue3/src/views/aiol/AiolContentConfig.data.ts
Normal file
@ -0,0 +1,78 @@
|
||||
import {BasicColumn} from '/@/components/Table';
|
||||
import {FormSchema} from '/@/components/Table';
|
||||
import { rules} from '/@/utils/helper/validator';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '配置标识',
|
||||
align:"center",
|
||||
dataIndex: 'contentKey'
|
||||
},
|
||||
{
|
||||
title: '配置值',
|
||||
align:"center",
|
||||
dataIndex: 'contentValue'
|
||||
},
|
||||
{
|
||||
title: '值类型',
|
||||
align:"center",
|
||||
dataIndex: 'valueType'
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
align:"center",
|
||||
dataIndex: 'description'
|
||||
},
|
||||
];
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
];
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '配置标识',
|
||||
field: 'contentKey',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '配置值',
|
||||
field: 'contentValue',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '值类型',
|
||||
field: 'valueType',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '描述',
|
||||
field: 'description',
|
||||
component: 'Input',
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
{
|
||||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
contentKey: {title: '配置标识',order: 0,view: 'text', type: 'string',},
|
||||
contentValue: {title: '配置值',order: 1,view: 'text', type: 'string',},
|
||||
valueType: {title: '值类型',order: 2,view: 'text', type: 'string',},
|
||||
description: {title: '描述',order: 3,view: 'text', type: 'string',},
|
||||
};
|
||||
|
||||
/**
|
||||
* 流程表单调用这个方法获取formSchema
|
||||
* @param param
|
||||
*/
|
||||
export function getBpmFormSchema(_formData): FormSchema[]{
|
||||
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
|
||||
return formSchema;
|
||||
}
|
206
jeecgboot-vue3/src/views/aiol/AiolContentConfigList.vue
Normal file
206
jeecgboot-vue3/src/views/aiol/AiolContentConfigList.vue
Normal file
@ -0,0 +1,206 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" v-auth="'aiol:aiol_content_config:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<a-button type="primary" v-auth="'aiol:aiol_content_config:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||
<j-upload-button type="primary" v-auth="'aiol:aiol_content_config:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
|
||||
|
||||
<a-dropdown v-if="selectedRowKeys.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 v-auth="'aiol:aiol_content_config:deleteBatch'">批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<!-- 高级查询 -->
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<AiolContentConfigModal @register="registerModal" @success="handleSuccess"></AiolContentConfigModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="aiol-aiolContentConfig" setup>
|
||||
import {ref, reactive, computed, unref} from 'vue';
|
||||
import {BasicTable, useTable, TableAction} from '/@/components/Table';
|
||||
import {useModal} from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage'
|
||||
import AiolContentConfigModal from './components/AiolContentConfigModal.vue'
|
||||
import {columns, searchFormSchema, superQuerySchema} from './AiolContentConfig.data';
|
||||
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './AiolContentConfig.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getDateByPicker } from '/@/utils';
|
||||
//日期个性化选择
|
||||
const fieldPickers = reactive({
|
||||
});
|
||||
const queryParam = reactive<any>({});
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
const userStore = useUserStore();
|
||||
const { createMessage } = useMessage();
|
||||
//注册model
|
||||
const [registerModal, {openModal}] = useModal();
|
||||
//注册table数据
|
||||
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
|
||||
tableProps:{
|
||||
title: '内容配置',
|
||||
api: list,
|
||||
columns,
|
||||
canResize:true,
|
||||
formConfig: {
|
||||
//labelWidth: 120,
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter:true,
|
||||
showAdvancedButton:true,
|
||||
fieldMapToNumber: [
|
||||
],
|
||||
fieldMapToTime: [
|
||||
],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed:'right'
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
if (params && fieldPickers) {
|
||||
for (let key in fieldPickers) {
|
||||
if (params[key]) {
|
||||
params[key] = getDateByPicker(params[key], fieldPickers[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name:"内容配置",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
})
|
||||
|
||||
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
|
||||
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
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}, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record){
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'aiol:aiol_content_config:edit'
|
||||
}
|
||||
]
|
||||
}
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record){
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
auth: 'aiol:aiol_content_config:delete'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-picker),:deep(.ant-input-number){
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
64
jeecgboot-vue3/src/views/aiol/AiolHomeworkSubmit.api.ts
Normal file
64
jeecgboot-vue3/src/views/aiol/AiolHomeworkSubmit.api.ts
Normal file
@ -0,0 +1,64 @@
|
||||
import {defHttp} from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/aiol/aiolHomeworkSubmit/list',
|
||||
save='/aiol/aiolHomeworkSubmit/add',
|
||||
edit='/aiol/aiolHomeworkSubmit/edit',
|
||||
deleteOne = '/aiol/aiolHomeworkSubmit/delete',
|
||||
deleteBatch = '/aiol/aiolHomeworkSubmit/deleteBatch',
|
||||
importExcel = '/aiol/aiolHomeworkSubmit/importExcel',
|
||||
exportXls = '/aiol/aiolHomeworkSubmit/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) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
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});
|
||||
}
|
126
jeecgboot-vue3/src/views/aiol/AiolHomeworkSubmit.data.ts
Normal file
126
jeecgboot-vue3/src/views/aiol/AiolHomeworkSubmit.data.ts
Normal file
@ -0,0 +1,126 @@
|
||||
import {BasicColumn} from '/@/components/Table';
|
||||
import {FormSchema} from '/@/components/Table';
|
||||
import { rules} from '/@/utils/helper/validator';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '作业id',
|
||||
align:"center",
|
||||
dataIndex: 'homeworkId'
|
||||
},
|
||||
{
|
||||
title: '学生id',
|
||||
align:"center",
|
||||
dataIndex: 'studentId'
|
||||
},
|
||||
{
|
||||
title: '作业内容',
|
||||
align:"center",
|
||||
dataIndex: 'content'
|
||||
},
|
||||
{
|
||||
title: '附件',
|
||||
align:"center",
|
||||
dataIndex: 'attachment'
|
||||
},
|
||||
{
|
||||
title: '得分',
|
||||
align:"center",
|
||||
dataIndex: 'score'
|
||||
},
|
||||
{
|
||||
title: '批改意见',
|
||||
align:"center",
|
||||
dataIndex: 'comment'
|
||||
},
|
||||
{
|
||||
title: '批改时间',
|
||||
align:"center",
|
||||
dataIndex: 'gradedTime'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
align:"center",
|
||||
dataIndex: 'status'
|
||||
},
|
||||
];
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
];
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '作业id',
|
||||
field: 'homeworkId',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '学生id',
|
||||
field: 'studentId',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '作业内容',
|
||||
field: 'content',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '附件',
|
||||
field: 'attachment',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '得分',
|
||||
field: 'score',
|
||||
component: 'InputNumber',
|
||||
},
|
||||
{
|
||||
label: '批改意见',
|
||||
field: 'comment',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '批改时间',
|
||||
field: 'gradedTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss'
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
field: 'status',
|
||||
component: 'InputNumber',
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
{
|
||||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
homeworkId: {title: '作业id',order: 0,view: 'text', type: 'string',},
|
||||
studentId: {title: '学生id',order: 1,view: 'text', type: 'string',},
|
||||
content: {title: '作业内容',order: 2,view: 'text', type: 'string',},
|
||||
attachment: {title: '附件',order: 3,view: 'text', type: 'string',},
|
||||
score: {title: '得分',order: 4,view: 'number', type: 'number',},
|
||||
comment: {title: '批改意见',order: 5,view: 'text', type: 'string',},
|
||||
gradedTime: {title: '批改时间',order: 6,view: 'datetime', type: 'string',},
|
||||
status: {title: '状态',order: 7,view: 'number', type: 'number',},
|
||||
};
|
||||
|
||||
/**
|
||||
* 流程表单调用这个方法获取formSchema
|
||||
* @param param
|
||||
*/
|
||||
export function getBpmFormSchema(_formData): FormSchema[]{
|
||||
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
|
||||
return formSchema;
|
||||
}
|
206
jeecgboot-vue3/src/views/aiol/AiolHomeworkSubmitList.vue
Normal file
206
jeecgboot-vue3/src/views/aiol/AiolHomeworkSubmitList.vue
Normal file
@ -0,0 +1,206 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" v-auth="'aiol:aiol_homework_submit:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<a-button type="primary" v-auth="'aiol:aiol_homework_submit:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||
<j-upload-button type="primary" v-auth="'aiol:aiol_homework_submit:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
|
||||
|
||||
<a-dropdown v-if="selectedRowKeys.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 v-auth="'aiol:aiol_homework_submit:deleteBatch'">批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<!-- 高级查询 -->
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<AiolHomeworkSubmitModal @register="registerModal" @success="handleSuccess"></AiolHomeworkSubmitModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="aiol-aiolHomeworkSubmit" setup>
|
||||
import {ref, reactive, computed, unref} from 'vue';
|
||||
import {BasicTable, useTable, TableAction} from '/@/components/Table';
|
||||
import {useModal} from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage'
|
||||
import AiolHomeworkSubmitModal from './components/AiolHomeworkSubmitModal.vue'
|
||||
import {columns, searchFormSchema, superQuerySchema} from './AiolHomeworkSubmit.data';
|
||||
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './AiolHomeworkSubmit.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getDateByPicker } from '/@/utils';
|
||||
//日期个性化选择
|
||||
const fieldPickers = reactive({
|
||||
});
|
||||
const queryParam = reactive<any>({});
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
const userStore = useUserStore();
|
||||
const { createMessage } = useMessage();
|
||||
//注册model
|
||||
const [registerModal, {openModal}] = useModal();
|
||||
//注册table数据
|
||||
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
|
||||
tableProps:{
|
||||
title: '作业提交',
|
||||
api: list,
|
||||
columns,
|
||||
canResize:true,
|
||||
formConfig: {
|
||||
//labelWidth: 120,
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter:true,
|
||||
showAdvancedButton:true,
|
||||
fieldMapToNumber: [
|
||||
],
|
||||
fieldMapToTime: [
|
||||
],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed:'right'
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
if (params && fieldPickers) {
|
||||
for (let key in fieldPickers) {
|
||||
if (params[key]) {
|
||||
params[key] = getDateByPicker(params[key], fieldPickers[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name:"作业提交",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
})
|
||||
|
||||
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
|
||||
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
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}, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
|
||||
}
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record){
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'aiol:aiol_homework_submit:edit'
|
||||
}
|
||||
]
|
||||
}
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record){
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
auth: 'aiol:aiol_homework_submit:delete'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-picker),:deep(.ant-input-number){
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,26 @@
|
||||
-- 注意:该页面对应的前台目录为views/aiol文件夹下
|
||||
-- 如果你想更改到其他目录,请修改sql中component字段对应的值
|
||||
|
||||
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
|
||||
VALUES ('202508310532220470', NULL, '活动', '/aiol/aiolActivityList', 'aiol/AiolActivityList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-08-31 17:32:47', NULL, NULL, 0);
|
||||
|
||||
-- 权限控制sql
|
||||
-- 新增
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('202508310532220471', '202508310532220470', '添加活动', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:47', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 编辑
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('202508310532220472', '202508310532220470', '编辑活动', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:47', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 删除
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('202508310532220473', '202508310532220470', '删除活动', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:47', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 批量删除
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('202508310532220474', '202508310532220470', '批量删除活动', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:47', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 导出excel
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('202508310532220475', '202508310532220470', '导出excel_活动', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:47', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 导入excel
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('202508310532220476', '202508310532220470', '导入excel_活动', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:47', NULL, NULL, 0, 0, '1', 0);
|
@ -0,0 +1,26 @@
|
||||
-- 注意:该页面对应的前台目录为views/aiol文件夹下
|
||||
-- 如果你想更改到其他目录,请修改sql中component字段对应的值
|
||||
|
||||
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
|
||||
VALUES ('2025083105325940510', NULL, '活动报名', '/aiol/aiolActivitySignupList', 'aiol/AiolActivitySignupList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-08-31 17:32:51', NULL, NULL, 0);
|
||||
|
||||
-- 权限控制sql
|
||||
-- 新增
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105325950511', '2025083105325940510', '添加活动报名', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity_signup:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:51', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 编辑
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105325950512', '2025083105325940510', '编辑活动报名', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity_signup:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:51', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 删除
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105325950513', '2025083105325940510', '删除活动报名', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity_signup:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:51', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 批量删除
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105325950514', '2025083105325940510', '批量删除活动报名', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity_signup:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:51', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 导出excel
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105325950515', '2025083105325940510', '导出excel_活动报名', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity_signup:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:51', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 导入excel
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105325950516', '2025083105325940510', '导入excel_活动报名', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_activity_signup:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:32:51', NULL, NULL, 0, 0, '1', 0);
|
@ -0,0 +1,26 @@
|
||||
-- 注意:该页面对应的前台目录为views/aiol文件夹下
|
||||
-- 如果你想更改到其他目录,请修改sql中component字段对应的值
|
||||
|
||||
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
|
||||
VALUES ('2025083105162700080', NULL, '内容配置', '/aiol/aiolContentConfigList', 'aiol/AiolContentConfigList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-08-31 17:16:08', NULL, NULL, 0);
|
||||
|
||||
-- 权限控制sql
|
||||
-- 新增
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105162700081', '2025083105162700080', '添加内容配置', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_content_config:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:16:08', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 编辑
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105162700082', '2025083105162700080', '编辑内容配置', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_content_config:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:16:08', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 删除
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105162700083', '2025083105162700080', '删除内容配置', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_content_config:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:16:08', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 批量删除
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105162700084', '2025083105162700080', '批量删除内容配置', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_content_config:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:16:08', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 导出excel
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105162700085', '2025083105162700080', '导出excel_内容配置', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_content_config:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:16:08', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 导入excel
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083105162700086', '2025083105162700080', '导入excel_内容配置', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_content_config:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 17:16:08', NULL, NULL, 0, 0, '1', 0);
|
@ -0,0 +1,26 @@
|
||||
-- 注意:该页面对应的前台目录为views/aiol文件夹下
|
||||
-- 如果你想更改到其他目录,请修改sql中component字段对应的值
|
||||
|
||||
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
|
||||
VALUES ('2025083111594860520', NULL, '作业提交', '/aiol/aiolHomeworkSubmitList', 'aiol/AiolHomeworkSubmitList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-08-31 11:59:52', NULL, NULL, 0);
|
||||
|
||||
-- 权限控制sql
|
||||
-- 新增
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083111594860521', '2025083111594860520', '添加作业提交', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_homework_submit:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 11:59:52', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 编辑
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083111594860522', '2025083111594860520', '编辑作业提交', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_homework_submit:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 11:59:52', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 删除
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083111594860523', '2025083111594860520', '删除作业提交', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_homework_submit:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 11:59:52', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 批量删除
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083111594870524', '2025083111594860520', '批量删除作业提交', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_homework_submit:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 11:59:52', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 导出excel
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083111594870525', '2025083111594860520', '导出excel_作业提交', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_homework_submit:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 11:59:52', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 导入excel
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2025083111594870526', '2025083111594860520', '导入excel_作业提交', NULL, NULL, 0, NULL, NULL, 2, 'aiol:aiol_homework_submit:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-08-31 11:59:52', NULL, NULL, 0, 0, '1', 0);
|
@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<div style="min-height: 400px">
|
||||
<BasicForm @register="registerForm"></BasicForm>
|
||||
<div style="width: 100%;text-align: center" v-if="!formDisabled">
|
||||
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||
import {computed, defineComponent} from 'vue';
|
||||
import {defHttp} from '/@/utils/http/axios';
|
||||
import { propTypes } from '/@/utils/propTypes';
|
||||
import {getBpmFormSchema} from '../AiolActivity.data';
|
||||
import {saveOrUpdate} from '../AiolActivity.api';
|
||||
|
||||
export default defineComponent({
|
||||
name: "AiolActivityForm",
|
||||
components:{
|
||||
BasicForm
|
||||
},
|
||||
props:{
|
||||
formData: propTypes.object.def({}),
|
||||
formBpm: propTypes.bool.def(true),
|
||||
},
|
||||
setup(props){
|
||||
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
|
||||
labelWidth: 150,
|
||||
schemas: getBpmFormSchema(props.formData),
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: {span: 24}
|
||||
});
|
||||
|
||||
const formDisabled = computed(()=>{
|
||||
if(props.formData.disabled === false){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
let formData = {};
|
||||
const queryByIdUrl = '/aiol/aiolActivity/queryById';
|
||||
async function initFormData(){
|
||||
let params = {id: props.formData.dataId};
|
||||
const data = await defHttp.get({url: queryByIdUrl, params});
|
||||
formData = {...data}
|
||||
//设置表单的值
|
||||
await setFieldsValue(formData);
|
||||
//默认是禁用
|
||||
await setProps({disabled: formDisabled.value})
|
||||
}
|
||||
|
||||
async function submitForm() {
|
||||
let data = getFieldsValue();
|
||||
let params = Object.assign({}, formData, data);
|
||||
console.log('表单数据', params)
|
||||
await saveOrUpdate(params, true)
|
||||
}
|
||||
|
||||
initFormData();
|
||||
|
||||
return {
|
||||
registerForm,
|
||||
formDisabled,
|
||||
submitForm,
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" name="AiolActivityForm" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {ref, computed, unref, reactive} from 'vue';
|
||||
import {BasicModal, useModalInner} from '/@/components/Modal';
|
||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||
import {formSchema} from '../AiolActivity.data';
|
||||
import {saveOrUpdate} from '../AiolActivity.api';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getDateByPicker } from '/@/utils';
|
||||
const { createMessage } = useMessage();
|
||||
// Emits声明
|
||||
const emit = defineEmits(['register','success']);
|
||||
const isUpdate = ref(true);
|
||||
const isDetail = ref(false);
|
||||
//表单配置
|
||||
const [registerForm, { setProps,resetFields, setFieldsValue, validate, scrollToField }] = useForm({
|
||||
labelWidth: 150,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: {span: 24}
|
||||
});
|
||||
//表单赋值
|
||||
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
|
||||
//重置表单
|
||||
await resetFields();
|
||||
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
isDetail.value = !!data?.showFooter;
|
||||
if (unref(isUpdate)) {
|
||||
//表单赋值
|
||||
await setFieldsValue({
|
||||
...data.record,
|
||||
});
|
||||
}
|
||||
// 隐藏底部时禁用整个表单
|
||||
setProps({ disabled: !data?.showFooter })
|
||||
});
|
||||
//日期个性化选择
|
||||
const fieldPickers = reactive({
|
||||
});
|
||||
//设置标题
|
||||
const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑'));
|
||||
//表单提交事件
|
||||
async function handleSubmit(v) {
|
||||
try {
|
||||
let values = await validate();
|
||||
// 预处理日期数据
|
||||
changeDateValue(values);
|
||||
setModalProps({confirmLoading: true});
|
||||
//提交表单
|
||||
await saveOrUpdate(values, isUpdate.value);
|
||||
//关闭弹窗
|
||||
closeModal();
|
||||
//刷新列表
|
||||
emit('success');
|
||||
} catch ({ errorFields }) {
|
||||
if (errorFields) {
|
||||
const firstField = errorFields[0];
|
||||
if (firstField) {
|
||||
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(errorFields);
|
||||
} finally {
|
||||
setModalProps({confirmLoading: false});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理日期值
|
||||
* @param formData 表单数据
|
||||
*/
|
||||
const changeDateValue = (formData) => {
|
||||
if (formData && fieldPickers) {
|
||||
for (let key in fieldPickers) {
|
||||
if (formData[key]) {
|
||||
formData[key] = getDateByPicker(formData[key], fieldPickers[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
/** 时间和数字输入框样式 */
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
:deep(.ant-calendar-picker) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<div style="min-height: 400px">
|
||||
<BasicForm @register="registerForm"></BasicForm>
|
||||
<div style="width: 100%;text-align: center" v-if="!formDisabled">
|
||||
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||
import {computed, defineComponent} from 'vue';
|
||||
import {defHttp} from '/@/utils/http/axios';
|
||||
import { propTypes } from '/@/utils/propTypes';
|
||||
import {getBpmFormSchema} from '../AiolActivitySignup.data';
|
||||
import {saveOrUpdate} from '../AiolActivitySignup.api';
|
||||
|
||||
export default defineComponent({
|
||||
name: "AiolActivitySignupForm",
|
||||
components:{
|
||||
BasicForm
|
||||
},
|
||||
props:{
|
||||
formData: propTypes.object.def({}),
|
||||
formBpm: propTypes.bool.def(true),
|
||||
},
|
||||
setup(props){
|
||||
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
|
||||
labelWidth: 150,
|
||||
schemas: getBpmFormSchema(props.formData),
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: {span: 24}
|
||||
});
|
||||
|
||||
const formDisabled = computed(()=>{
|
||||
if(props.formData.disabled === false){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
let formData = {};
|
||||
const queryByIdUrl = '/aiol/aiolActivitySignup/queryById';
|
||||
async function initFormData(){
|
||||
let params = {id: props.formData.dataId};
|
||||
const data = await defHttp.get({url: queryByIdUrl, params});
|
||||
formData = {...data}
|
||||
//设置表单的值
|
||||
await setFieldsValue(formData);
|
||||
//默认是禁用
|
||||
await setProps({disabled: formDisabled.value})
|
||||
}
|
||||
|
||||
async function submitForm() {
|
||||
let data = getFieldsValue();
|
||||
let params = Object.assign({}, formData, data);
|
||||
console.log('表单数据', params)
|
||||
await saveOrUpdate(params, true)
|
||||
}
|
||||
|
||||
initFormData();
|
||||
|
||||
return {
|
||||
registerForm,
|
||||
formDisabled,
|
||||
submitForm,
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" name="AiolActivitySignupForm" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {ref, computed, unref, reactive} from 'vue';
|
||||
import {BasicModal, useModalInner} from '/@/components/Modal';
|
||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||
import {formSchema} from '../AiolActivitySignup.data';
|
||||
import {saveOrUpdate} from '../AiolActivitySignup.api';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getDateByPicker } from '/@/utils';
|
||||
const { createMessage } = useMessage();
|
||||
// Emits声明
|
||||
const emit = defineEmits(['register','success']);
|
||||
const isUpdate = ref(true);
|
||||
const isDetail = ref(false);
|
||||
//表单配置
|
||||
const [registerForm, { setProps,resetFields, setFieldsValue, validate, scrollToField }] = useForm({
|
||||
labelWidth: 150,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: {span: 24}
|
||||
});
|
||||
//表单赋值
|
||||
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
|
||||
//重置表单
|
||||
await resetFields();
|
||||
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
isDetail.value = !!data?.showFooter;
|
||||
if (unref(isUpdate)) {
|
||||
//表单赋值
|
||||
await setFieldsValue({
|
||||
...data.record,
|
||||
});
|
||||
}
|
||||
// 隐藏底部时禁用整个表单
|
||||
setProps({ disabled: !data?.showFooter })
|
||||
});
|
||||
//日期个性化选择
|
||||
const fieldPickers = reactive({
|
||||
});
|
||||
//设置标题
|
||||
const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑'));
|
||||
//表单提交事件
|
||||
async function handleSubmit(v) {
|
||||
try {
|
||||
let values = await validate();
|
||||
// 预处理日期数据
|
||||
changeDateValue(values);
|
||||
setModalProps({confirmLoading: true});
|
||||
//提交表单
|
||||
await saveOrUpdate(values, isUpdate.value);
|
||||
//关闭弹窗
|
||||
closeModal();
|
||||
//刷新列表
|
||||
emit('success');
|
||||
} catch ({ errorFields }) {
|
||||
if (errorFields) {
|
||||
const firstField = errorFields[0];
|
||||
if (firstField) {
|
||||
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(errorFields);
|
||||
} finally {
|
||||
setModalProps({confirmLoading: false});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理日期值
|
||||
* @param formData 表单数据
|
||||
*/
|
||||
const changeDateValue = (formData) => {
|
||||
if (formData && fieldPickers) {
|
||||
for (let key in fieldPickers) {
|
||||
if (formData[key]) {
|
||||
formData[key] = getDateByPicker(formData[key], fieldPickers[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
/** 时间和数字输入框样式 */
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
:deep(.ant-calendar-picker) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<div style="min-height: 400px">
|
||||
<BasicForm @register="registerForm"></BasicForm>
|
||||
<div style="width: 100%;text-align: center" v-if="!formDisabled">
|
||||
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||
import {computed, defineComponent} from 'vue';
|
||||
import {defHttp} from '/@/utils/http/axios';
|
||||
import { propTypes } from '/@/utils/propTypes';
|
||||
import {getBpmFormSchema} from '../AiolContentConfig.data';
|
||||
import {saveOrUpdate} from '../AiolContentConfig.api';
|
||||
|
||||
export default defineComponent({
|
||||
name: "AiolContentConfigForm",
|
||||
components:{
|
||||
BasicForm
|
||||
},
|
||||
props:{
|
||||
formData: propTypes.object.def({}),
|
||||
formBpm: propTypes.bool.def(true),
|
||||
},
|
||||
setup(props){
|
||||
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
|
||||
labelWidth: 150,
|
||||
schemas: getBpmFormSchema(props.formData),
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: {span: 24}
|
||||
});
|
||||
|
||||
const formDisabled = computed(()=>{
|
||||
if(props.formData.disabled === false){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
let formData = {};
|
||||
const queryByIdUrl = '/aiol/aiolContentConfig/queryById';
|
||||
async function initFormData(){
|
||||
let params = {id: props.formData.dataId};
|
||||
const data = await defHttp.get({url: queryByIdUrl, params});
|
||||
formData = {...data}
|
||||
//设置表单的值
|
||||
await setFieldsValue(formData);
|
||||
//默认是禁用
|
||||
await setProps({disabled: formDisabled.value})
|
||||
}
|
||||
|
||||
async function submitForm() {
|
||||
let data = getFieldsValue();
|
||||
let params = Object.assign({}, formData, data);
|
||||
console.log('表单数据', params)
|
||||
await saveOrUpdate(params, true)
|
||||
}
|
||||
|
||||
initFormData();
|
||||
|
||||
return {
|
||||
registerForm,
|
||||
formDisabled,
|
||||
submitForm,
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user