21 changed files with 922 additions and 689 deletions
@ -0,0 +1,49 @@ |
|||||
|
package com.zdxt.enforcementcode.controller.app.enterprise; |
||||
|
|
||||
|
import cn.dev33.satoken.annotation.SaCheckPermission; |
||||
|
import com.zdxt.enforcementcode.domain.bo.EnforcementRegistrationBo; |
||||
|
import com.zdxt.enforcementcode.domain.vo.EnforcementRegistrationVo; |
||||
|
import com.zdxt.enforcementcode.service.IEnforcementRegistrationService; |
||||
|
import jakarta.servlet.http.HttpServletResponse; |
||||
|
import jakarta.validation.constraints.NotEmpty; |
||||
|
import jakarta.validation.constraints.NotNull; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import org.dromara.common.core.domain.R; |
||||
|
import org.dromara.common.core.validate.AddGroup; |
||||
|
import org.dromara.common.core.validate.EditGroup; |
||||
|
import org.dromara.common.excel.utils.ExcelUtil; |
||||
|
import org.dromara.common.idempotent.annotation.RepeatSubmit; |
||||
|
import org.dromara.common.log.annotation.Log; |
||||
|
import org.dromara.common.log.enums.BusinessType; |
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
import org.dromara.common.web.core.BaseController; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 企业端-执法登记记录 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
* @date 2026-04-17 |
||||
|
*/ |
||||
|
@Validated |
||||
|
@RequiredArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("/app/enterprise/enforcement_registration") |
||||
|
public class AppEnforcementRegistrationController extends BaseController { |
||||
|
|
||||
|
private final IEnforcementRegistrationService enforcementRegistrationService; |
||||
|
|
||||
|
/** |
||||
|
* 查询企业端-执法登记记录列表 |
||||
|
*/ |
||||
|
//@SaCheckPermission("enforcementcode:registration:list")
|
||||
|
@GetMapping("/list") |
||||
|
public TableDataInfo<EnforcementRegistrationVo> list(EnforcementRegistrationBo bo, PageQuery pageQuery) { |
||||
|
return enforcementRegistrationService.queryPageList(bo, pageQuery); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,105 @@ |
|||||
|
package com.zdxt.enforcementcode.controller.app.enterprise; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import jakarta.servlet.http.HttpServletResponse; |
||||
|
import jakarta.validation.constraints.*; |
||||
|
import cn.dev33.satoken.annotation.SaCheckPermission; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.dromara.common.idempotent.annotation.RepeatSubmit; |
||||
|
import org.dromara.common.log.annotation.Log; |
||||
|
import org.dromara.common.web.core.BaseController; |
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
import org.dromara.common.core.domain.R; |
||||
|
import org.dromara.common.core.validate.AddGroup; |
||||
|
import org.dromara.common.core.validate.EditGroup; |
||||
|
import org.dromara.common.log.enums.BusinessType; |
||||
|
import org.dromara.common.excel.utils.ExcelUtil; |
||||
|
import com.zdxt.enforcementcode.domain.vo.TestEnfDemoVo; |
||||
|
import com.zdxt.enforcementcode.domain.bo.TestEnfDemoBo; |
||||
|
import com.zdxt.enforcementcode.service.ITestEnfDemoService; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
|
||||
|
/** |
||||
|
* enf测试单 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
* @date 2026-04-18 |
||||
|
*/ |
||||
|
@Validated |
||||
|
@RequiredArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("/app/enterprise/enfDemo") |
||||
|
public class TestEnfDemoController extends BaseController { |
||||
|
|
||||
|
private final ITestEnfDemoService testEnfDemoService; |
||||
|
|
||||
|
/** |
||||
|
* 查询enf测试单列表 |
||||
|
*/ |
||||
|
/*@SaCheckPermission("enforcementcode:enfDemo:list")*/ |
||||
|
@GetMapping("/list") |
||||
|
public TableDataInfo<TestEnfDemoVo> list(TestEnfDemoBo bo, PageQuery pageQuery) { |
||||
|
return testEnfDemoService.queryPageList(bo, pageQuery); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 导出enf测试单列表 |
||||
|
*/ |
||||
|
/*@SaCheckPermission("enforcementcode:enfDemo:export")*/ |
||||
|
@Log(title = "enf测试单", businessType = BusinessType.EXPORT) |
||||
|
@PostMapping("/export") |
||||
|
public void export(TestEnfDemoBo bo, HttpServletResponse response) { |
||||
|
List<TestEnfDemoVo> list = testEnfDemoService.queryList(bo); |
||||
|
ExcelUtil.exportExcel(list, "enf测试单", TestEnfDemoVo.class, response); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取enf测试单详细信息 |
||||
|
* |
||||
|
* @param id 主键 |
||||
|
*/ |
||||
|
/*@SaCheckPermission("enforcementcode:enfDemo:query")*/ |
||||
|
@GetMapping("/{id}") |
||||
|
public R<TestEnfDemoVo> getInfo(@NotNull(message = "主键不能为空") |
||||
|
@PathVariable Long id) { |
||||
|
return R.ok(testEnfDemoService.queryById(id)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增enf测试单 |
||||
|
*/ |
||||
|
/*@SaCheckPermission("enforcementcode:enfDemo:add")*/ |
||||
|
@Log(title = "enf测试单", businessType = BusinessType.INSERT) |
||||
|
@RepeatSubmit() |
||||
|
@PostMapping() |
||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody TestEnfDemoBo bo) { |
||||
|
return toAjax(testEnfDemoService.insertByBo(bo)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改enf测试单 |
||||
|
*/ |
||||
|
/*@SaCheckPermission("enforcementcode:enfDemo:edit")*/ |
||||
|
@Log(title = "enf测试单", businessType = BusinessType.UPDATE) |
||||
|
@RepeatSubmit() |
||||
|
@PutMapping() |
||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody TestEnfDemoBo bo) { |
||||
|
return toAjax(testEnfDemoService.updateByBo(bo)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除enf测试单 |
||||
|
* |
||||
|
* @param ids 主键串 |
||||
|
*/ |
||||
|
/*@SaCheckPermission("enforcementcode:enfDemo:remove")*/ |
||||
|
@Log(title = "enf测试单", businessType = BusinessType.DELETE) |
||||
|
@DeleteMapping("/{ids}") |
||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
||||
|
@PathVariable Long[] ids) { |
||||
|
return toAjax(testEnfDemoService.deleteWithValidByIds(List.of(ids), true)); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,78 @@ |
|||||
|
package com.zdxt.enforcementcode.domain; |
||||
|
|
||||
|
import org.dromara.common.tenant.core.TenantEntity; |
||||
|
import com.baomidou.mybatisplus.annotation.*; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
|
||||
|
/** |
||||
|
* enf测试单对象 test_enf_demo |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
* @date 2026-04-18 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@TableName("test_enf_demo") |
||||
|
public class TestEnfDemo extends TenantEntity { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
@TableId(value = "id") |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 文本 |
||||
|
*/ |
||||
|
private String enfText; |
||||
|
|
||||
|
/** |
||||
|
* 长文本 |
||||
|
*/ |
||||
|
private String enfContent; |
||||
|
|
||||
|
/** |
||||
|
* 部门id |
||||
|
*/ |
||||
|
private Long deptId; |
||||
|
|
||||
|
/** |
||||
|
* 用户id |
||||
|
*/ |
||||
|
private Long userId; |
||||
|
|
||||
|
/** |
||||
|
* 排序号 |
||||
|
*/ |
||||
|
private Long orderNum; |
||||
|
|
||||
|
/** |
||||
|
* key键 |
||||
|
*/ |
||||
|
private String testKey; |
||||
|
|
||||
|
/** |
||||
|
* 值 |
||||
|
*/ |
||||
|
private String value; |
||||
|
|
||||
|
/** |
||||
|
* 版本 |
||||
|
*/ |
||||
|
@Version |
||||
|
private Long version; |
||||
|
|
||||
|
/** |
||||
|
* 删除标志 |
||||
|
*/ |
||||
|
@TableLogic |
||||
|
private Long delFlag; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,65 @@ |
|||||
|
package com.zdxt.enforcementcode.domain.bo; |
||||
|
|
||||
|
import com.zdxt.enforcementcode.domain.TestEnfDemo; |
||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity; |
||||
|
import org.dromara.common.core.validate.AddGroup; |
||||
|
import org.dromara.common.core.validate.EditGroup; |
||||
|
import io.github.linpeilie.annotations.AutoMapper; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import jakarta.validation.constraints.*; |
||||
|
|
||||
|
/** |
||||
|
* enf测试单业务对象 test_enf_demo |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
* @date 2026-04-18 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@AutoMapper(target = TestEnfDemo.class, reverseConvertGenerate = false) |
||||
|
public class TestEnfDemoBo extends BaseEntity { |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
@NotNull(message = "主键不能为空", groups = { EditGroup.class }) |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 文本 |
||||
|
*/ |
||||
|
private String enfText; |
||||
|
|
||||
|
/** |
||||
|
* 长文本 |
||||
|
*/ |
||||
|
private String enfContent; |
||||
|
|
||||
|
/** |
||||
|
* 部门id |
||||
|
*/ |
||||
|
private Long deptId; |
||||
|
|
||||
|
/** |
||||
|
* 用户id |
||||
|
*/ |
||||
|
private Long userId; |
||||
|
|
||||
|
/** |
||||
|
* 排序号 |
||||
|
*/ |
||||
|
private Long orderNum; |
||||
|
|
||||
|
/** |
||||
|
* key键 |
||||
|
*/ |
||||
|
private String testKey; |
||||
|
|
||||
|
/** |
||||
|
* 值 |
||||
|
*/ |
||||
|
private String value; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,80 @@ |
|||||
|
package com.zdxt.enforcementcode.domain.vo; |
||||
|
|
||||
|
import com.zdxt.enforcementcode.domain.TestEnfDemo; |
||||
|
import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
||||
|
import cn.idev.excel.annotation.ExcelProperty; |
||||
|
import org.dromara.common.excel.annotation.ExcelDictFormat; |
||||
|
import org.dromara.common.excel.convert.ExcelDictConvert; |
||||
|
import io.github.linpeilie.annotations.AutoMapper; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* enf测试单视图对象 test_enf_demo |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
* @date 2026-04-18 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ExcelIgnoreUnannotated |
||||
|
@AutoMapper(target = TestEnfDemo.class) |
||||
|
public class TestEnfDemoVo implements Serializable { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "主键") |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 文本 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "文本") |
||||
|
private String enfText; |
||||
|
|
||||
|
/** |
||||
|
* 长文本 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "长文本") |
||||
|
private String enfContent; |
||||
|
|
||||
|
/** |
||||
|
* 部门id |
||||
|
*/ |
||||
|
@ExcelProperty(value = "部门id") |
||||
|
private Long deptId; |
||||
|
|
||||
|
/** |
||||
|
* 用户id |
||||
|
*/ |
||||
|
@ExcelProperty(value = "用户id") |
||||
|
private Long userId; |
||||
|
|
||||
|
/** |
||||
|
* 排序号 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "排序号") |
||||
|
private Long orderNum; |
||||
|
|
||||
|
/** |
||||
|
* key键 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "key键") |
||||
|
private String testKey; |
||||
|
|
||||
|
/** |
||||
|
* 值 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "值") |
||||
|
private String value; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,15 @@ |
|||||
|
package com.zdxt.enforcementcode.mapper; |
||||
|
|
||||
|
import com.zdxt.enforcementcode.domain.TestEnfDemo; |
||||
|
import com.zdxt.enforcementcode.domain.vo.TestEnfDemoVo; |
||||
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
||||
|
|
||||
|
/** |
||||
|
* enf测试单Mapper接口 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
* @date 2026-04-18 |
||||
|
*/ |
||||
|
public interface TestEnfDemoMapper extends BaseMapperPlus<TestEnfDemo, TestEnfDemoVo> { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,68 @@ |
|||||
|
package com.zdxt.enforcementcode.service; |
||||
|
|
||||
|
import com.zdxt.enforcementcode.domain.vo.TestEnfDemoVo; |
||||
|
import com.zdxt.enforcementcode.domain.bo.TestEnfDemoBo; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
|
||||
|
import java.util.Collection; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* enf测试单Service接口 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
* @date 2026-04-18 |
||||
|
*/ |
||||
|
public interface ITestEnfDemoService { |
||||
|
|
||||
|
/** |
||||
|
* 查询enf测试单 |
||||
|
* |
||||
|
* @param id 主键 |
||||
|
* @return enf测试单 |
||||
|
*/ |
||||
|
TestEnfDemoVo queryById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 分页查询enf测试单列表 |
||||
|
* |
||||
|
* @param bo 查询条件 |
||||
|
* @param pageQuery 分页参数 |
||||
|
* @return enf测试单分页列表 |
||||
|
*/ |
||||
|
TableDataInfo<TestEnfDemoVo> queryPageList(TestEnfDemoBo bo, PageQuery pageQuery); |
||||
|
|
||||
|
/** |
||||
|
* 查询符合条件的enf测试单列表 |
||||
|
* |
||||
|
* @param bo 查询条件 |
||||
|
* @return enf测试单列表 |
||||
|
*/ |
||||
|
List<TestEnfDemoVo> queryList(TestEnfDemoBo bo); |
||||
|
|
||||
|
/** |
||||
|
* 新增enf测试单 |
||||
|
* |
||||
|
* @param bo enf测试单 |
||||
|
* @return 是否新增成功 |
||||
|
*/ |
||||
|
Boolean insertByBo(TestEnfDemoBo bo); |
||||
|
|
||||
|
/** |
||||
|
* 修改enf测试单 |
||||
|
* |
||||
|
* @param bo enf测试单 |
||||
|
* @return 是否修改成功 |
||||
|
*/ |
||||
|
Boolean updateByBo(TestEnfDemoBo bo); |
||||
|
|
||||
|
/** |
||||
|
* 校验并批量删除enf测试单信息 |
||||
|
* |
||||
|
* @param ids 待删除的主键集合 |
||||
|
* @param isValid 是否进行有效性校验 |
||||
|
* @return 是否删除成功 |
||||
|
*/ |
||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
||||
|
} |
||||
@ -0,0 +1,138 @@ |
|||||
|
package com.zdxt.enforcementcode.service.impl; |
||||
|
|
||||
|
import org.dromara.common.core.utils.MapstructUtils; |
||||
|
import org.dromara.common.core.utils.StringUtils; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import com.zdxt.enforcementcode.domain.bo.TestEnfDemoBo; |
||||
|
import com.zdxt.enforcementcode.domain.vo.TestEnfDemoVo; |
||||
|
import com.zdxt.enforcementcode.domain.TestEnfDemo; |
||||
|
import com.zdxt.enforcementcode.mapper.TestEnfDemoMapper; |
||||
|
import com.zdxt.enforcementcode.service.ITestEnfDemoService; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.util.Collection; |
||||
|
|
||||
|
/** |
||||
|
* enf测试单Service业务层处理 |
||||
|
* |
||||
|
* @author Lion Li |
||||
|
* @date 2026-04-18 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@RequiredArgsConstructor |
||||
|
@Service |
||||
|
public class TestEnfDemoServiceImpl implements ITestEnfDemoService { |
||||
|
|
||||
|
private final TestEnfDemoMapper baseMapper; |
||||
|
|
||||
|
/** |
||||
|
* 查询enf测试单 |
||||
|
* |
||||
|
* @param id 主键 |
||||
|
* @return enf测试单 |
||||
|
*/ |
||||
|
@Override |
||||
|
public TestEnfDemoVo queryById(Long id){ |
||||
|
return baseMapper.selectVoById(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 分页查询enf测试单列表 |
||||
|
* |
||||
|
* @param bo 查询条件 |
||||
|
* @param pageQuery 分页参数 |
||||
|
* @return enf测试单分页列表 |
||||
|
*/ |
||||
|
@Override |
||||
|
public TableDataInfo<TestEnfDemoVo> queryPageList(TestEnfDemoBo bo, PageQuery pageQuery) { |
||||
|
LambdaQueryWrapper<TestEnfDemo> lqw = buildQueryWrapper(bo); |
||||
|
Page<TestEnfDemoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
||||
|
return TableDataInfo.build(result); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询符合条件的enf测试单列表 |
||||
|
* |
||||
|
* @param bo 查询条件 |
||||
|
* @return enf测试单列表 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<TestEnfDemoVo> queryList(TestEnfDemoBo bo) { |
||||
|
LambdaQueryWrapper<TestEnfDemo> lqw = buildQueryWrapper(bo); |
||||
|
return baseMapper.selectVoList(lqw); |
||||
|
} |
||||
|
|
||||
|
private LambdaQueryWrapper<TestEnfDemo> buildQueryWrapper(TestEnfDemoBo bo) { |
||||
|
Map<String, Object> params = bo.getParams(); |
||||
|
LambdaQueryWrapper<TestEnfDemo> lqw = Wrappers.lambdaQuery(); |
||||
|
lqw.orderByAsc(TestEnfDemo::getId); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getEnfText()), TestEnfDemo::getEnfText, bo.getEnfText()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getEnfContent()), TestEnfDemo::getEnfContent, bo.getEnfContent()); |
||||
|
lqw.eq(bo.getDeptId() != null, TestEnfDemo::getDeptId, bo.getDeptId()); |
||||
|
lqw.eq(bo.getUserId() != null, TestEnfDemo::getUserId, bo.getUserId()); |
||||
|
lqw.eq(bo.getOrderNum() != null, TestEnfDemo::getOrderNum, bo.getOrderNum()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getTestKey()), TestEnfDemo::getTestKey, bo.getTestKey()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getValue()), TestEnfDemo::getValue, bo.getValue()); |
||||
|
return lqw; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增enf测试单 |
||||
|
* |
||||
|
* @param bo enf测试单 |
||||
|
* @return 是否新增成功 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Boolean insertByBo(TestEnfDemoBo bo) { |
||||
|
TestEnfDemo add = MapstructUtils.convert(bo, TestEnfDemo.class); |
||||
|
validEntityBeforeSave(add); |
||||
|
boolean flag = baseMapper.insert(add) > 0; |
||||
|
if (flag) { |
||||
|
bo.setId(add.getId()); |
||||
|
} |
||||
|
return flag; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改enf测试单 |
||||
|
* |
||||
|
* @param bo enf测试单 |
||||
|
* @return 是否修改成功 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Boolean updateByBo(TestEnfDemoBo bo) { |
||||
|
TestEnfDemo update = MapstructUtils.convert(bo, TestEnfDemo.class); |
||||
|
validEntityBeforeSave(update); |
||||
|
return baseMapper.updateById(update) > 0; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 保存前的数据校验 |
||||
|
*/ |
||||
|
private void validEntityBeforeSave(TestEnfDemo entity){ |
||||
|
//TODO 做一些数据校验,如唯一约束
|
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 校验并批量删除enf测试单信息 |
||||
|
* |
||||
|
* @param ids 待删除的主键集合 |
||||
|
* @param isValid 是否进行有效性校验 |
||||
|
* @return 是否删除成功 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
||||
|
if(isValid){ |
||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
|
} |
||||
|
return baseMapper.deleteByIds(ids) > 0; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,6 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE mapper |
||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.zdxt.enforcementcode.mapper.TestEnfDemoMapper"> |
||||
|
</mapper> |
||||
@ -0,0 +1,15 @@ |
|||||
|
import { _get, _post, _delete } from "../../http/index"; |
||||
|
|
||||
|
let baseUrl = "/app/enterprise/enfDemo"; |
||||
|
|
||||
|
// 查询enf测试单列表(分页)
|
||||
|
export const getEnfDemoList = (params, success, error) => _get(baseUrl + "/list", params, success, error); |
||||
|
|
||||
|
// 获取enf测试单详情
|
||||
|
export const getEnfDemoDetail = (id, success, error) => _get(baseUrl + "/" + id, null, success, error); |
||||
|
|
||||
|
// 新增enf测试单
|
||||
|
export const addEnfDemo = (params, success, error) => _post(baseUrl, params, success, error); |
||||
|
|
||||
|
// 删除enf测试单
|
||||
|
export const deleteEnfDemo = (ids, success, error) => _delete(baseUrl + "/" + ids, null, success, error); |
||||
@ -0,0 +1,14 @@ |
|||||
|
|
||||
|
const routes = [ |
||||
|
// Demo - 测试单列表
|
||||
|
{ |
||||
|
path: "/demo/enfDemoList", |
||||
|
name: "enfDemoList", |
||||
|
component: () => import("@/views/demo/TestEnfDemoList.vue"), |
||||
|
meta: { |
||||
|
isKeepAlive: false, |
||||
|
}, |
||||
|
} |
||||
|
]; |
||||
|
|
||||
|
export {routes}; |
||||
@ -0,0 +1,170 @@ |
|||||
|
<template> |
||||
|
<div class="demo-list-page"> |
||||
|
<!-- 顶部导航栏 --> |
||||
|
<van-nav-bar title="测试单列表" left-arrow @click-left="onClickLeft" /> |
||||
|
|
||||
|
<!-- 搜索栏 --> |
||||
|
<van-search |
||||
|
v-model="searchText" |
||||
|
placeholder="请输入文本关键字搜索" |
||||
|
show-action |
||||
|
@search="onSearch" |
||||
|
@clear="onClear" |
||||
|
> |
||||
|
<template #action> |
||||
|
<div @click="onSearch">搜索</div> |
||||
|
</template> |
||||
|
</van-search> |
||||
|
|
||||
|
<!-- 可滚动列表区域 --> |
||||
|
<div class="list-container"> |
||||
|
<van-pull-refresh v-model="refreshing" @refresh="onRefresh"> |
||||
|
<van-list |
||||
|
v-model:loading="loading" |
||||
|
:finished="finished" |
||||
|
finished-text="没有更多了" |
||||
|
@load="onLoad" |
||||
|
:offset="50" |
||||
|
> |
||||
|
<!-- 空状态 --> |
||||
|
<van-empty v-if="finished && list.length === 0" description="暂无数据" /> |
||||
|
|
||||
|
<!-- 列表项 --> |
||||
|
<van-cell-group v-else inset style="margin-top: 10px;"> |
||||
|
<van-cell |
||||
|
v-for="item in list" |
||||
|
:key="item.id" |
||||
|
:title="item.enfText || '无标题'" |
||||
|
:label="item.enfContent || '无描述'" |
||||
|
is-link |
||||
|
@click="onItemClick(item)" |
||||
|
> |
||||
|
<template #value> |
||||
|
<van-tag type="primary" plain>{{ item.testKey || '-' }}</van-tag> |
||||
|
</template> |
||||
|
</van-cell> |
||||
|
</van-cell-group> |
||||
|
</van-list> |
||||
|
</van-pull-refresh> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script setup name="TestEnfDemoList"> |
||||
|
import { getEnfDemoList } from '../../api/demo'; |
||||
|
import { showToast } from 'vant'; |
||||
|
import 'vant/es/toast/style'; |
||||
|
|
||||
|
const router = useRouter(); |
||||
|
|
||||
|
// ========== 列表状态 ========== |
||||
|
const list = ref([]); // 列表数据 |
||||
|
const loading = ref(false); // 加载中 |
||||
|
const finished = ref(false); // 是否全部加载完 |
||||
|
const refreshing = ref(false); // 下拉刷新中 |
||||
|
const searchText = ref(''); // 搜索关键字 |
||||
|
|
||||
|
// ========== 分页参数 ========== |
||||
|
const pageNum = ref(1); |
||||
|
const pageSize = ref(20); |
||||
|
|
||||
|
// ========== 加载数据 ========== |
||||
|
const fetchList = () => { |
||||
|
const params = { |
||||
|
pageNum: pageNum.value, |
||||
|
pageSize: pageSize.value, |
||||
|
}; |
||||
|
// 搜索条件:文本字段模糊查询 |
||||
|
if (searchText.value) { |
||||
|
params.enfText = searchText.value; |
||||
|
} |
||||
|
|
||||
|
getEnfDemoList(params, (res) => { |
||||
|
if (res.code === 200) { |
||||
|
const rows = res.rows || []; |
||||
|
const total = res.total || 0; |
||||
|
|
||||
|
if (refreshing.value) { |
||||
|
// 下拉刷新:替换数据 |
||||
|
list.value = rows; |
||||
|
refreshing.value = false; |
||||
|
} else { |
||||
|
// 上滑加载更多:追加数据 |
||||
|
list.value = [...list.value, ...rows]; |
||||
|
} |
||||
|
|
||||
|
// 判断是否加载完全部数据 |
||||
|
if (list.value.length >= total) { |
||||
|
finished.value = true; |
||||
|
} |
||||
|
|
||||
|
loading.value = false; |
||||
|
} else { |
||||
|
loading.value = false; |
||||
|
finished.value = true; |
||||
|
showToast(res.msg || '加载失败'); |
||||
|
} |
||||
|
}, () => { |
||||
|
loading.value = false; |
||||
|
finished.value = true; |
||||
|
refreshing.value = false; |
||||
|
showToast('网络请求失败'); |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
// ========== 触底加载更多 ========== |
||||
|
const onLoad = () => { |
||||
|
if (refreshing.value) return; |
||||
|
fetchList(); |
||||
|
pageNum.value++; |
||||
|
}; |
||||
|
|
||||
|
// ========== 下拉刷新 ========== |
||||
|
const onRefresh = () => { |
||||
|
pageNum.value = 1; |
||||
|
finished.value = false; |
||||
|
loading.value = true; |
||||
|
fetchList(); |
||||
|
pageNum.value++; |
||||
|
}; |
||||
|
|
||||
|
// ========== 搜索 ========== |
||||
|
const onSearch = () => { |
||||
|
pageNum.value = 1; |
||||
|
list.value = []; |
||||
|
finished.value = false; |
||||
|
loading.value = true; |
||||
|
fetchList(); |
||||
|
pageNum.value++; |
||||
|
}; |
||||
|
|
||||
|
// ========== 清空搜索 ========== |
||||
|
const onClear = () => { |
||||
|
searchText.value = ''; |
||||
|
onSearch(); |
||||
|
}; |
||||
|
|
||||
|
// ========== 点击列表项 ========== |
||||
|
const onItemClick = (item) => { |
||||
|
showToast('点击了:' + (item.enfText || item.id)); |
||||
|
}; |
||||
|
|
||||
|
// ========== 返回上一页 ========== |
||||
|
const onClickLeft = () => { |
||||
|
router.back(); |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style lang="less" scoped> |
||||
|
.demo-list-page { |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
height: 100%; |
||||
|
background-color: #f5f5f5; |
||||
|
|
||||
|
.list-container { |
||||
|
flex: 1; |
||||
|
overflow-y: auto; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -1,667 +0,0 @@ |
|||||
<template> |
|
||||
<div class="shop app_content"> |
|
||||
<!-- 导航栏 --> |
|
||||
<!-- <div class="header_body"> |
|
||||
<header-nav |
|
||||
:slefBack="true" |
|
||||
@goBack="goBack" |
|
||||
:titelText="`行政执法信息查询`" |
|
||||
> |
|
||||
</header-nav> |
|
||||
|
|
||||
</div>--> |
|
||||
<van-search |
|
||||
v-model="searchParam.searchValue" |
|
||||
show-action |
|
||||
placeholder="请输入关键字查询" |
|
||||
clearable="true" |
|
||||
clear-icon="clear" |
|
||||
clear-trigger="always" |
|
||||
@clear="clearSearch" |
|
||||
@search="onSearch" |
|
||||
> |
|
||||
<template #action> |
|
||||
<div @click="onClickButton">搜索</div> |
|
||||
</template> |
|
||||
</van-search> |
|
||||
<div class="search-button-list"> |
|
||||
<van-button plain hairline :class="null==data.checkNum?'search-button active':'search-button'" |
|
||||
@click="searchDateType(null)" round type="primary" size="mini"> |
|
||||
全部 |
|
||||
</van-button> |
|
||||
<van-button plain hairline :class="1==data.checkNum?'search-button active':'search-button'" |
|
||||
@click="searchDateType(1)" round type="primary" |
|
||||
size="mini">本月 |
|
||||
</van-button> |
|
||||
<van-button plain hairline :class="2==data.checkNum?'search-button active':'search-button'" |
|
||||
@click="searchDateType(2)" round type="primary" |
|
||||
size="mini">本季 |
|
||||
</van-button> |
|
||||
<van-button plain hairline :class="3==data.checkNum?'search-button active':'search-button'" |
|
||||
@click="searchDateType(3)" round type="primary" |
|
||||
size="mini">本年 |
|
||||
</van-button> |
|
||||
<!-- <van-button plain hairline class="search-button" @click="searchComplaint(4)" round type="primary"--> |
|
||||
<!-- size="mini">投诉--> |
|
||||
<!-- </van-button>--> |
|
||||
<van-button plain hairline :class="9==data.checkNum?'search-button active':'search-button'" |
|
||||
@click="selectDate" round type="primary" size="mini">筛选 |
|
||||
</van-button> |
|
||||
</div> |
|
||||
<div class="search-button-date"> |
|
||||
<span class="date-select" v-show="data.dateShow" @click="selectDate">{{ data.dateSearch }}</span> |
|
||||
<div style="border-color: black;" class="van-hairline--bottom"></div> |
|
||||
<!-- <van-button class="search-button" type="primary" size="mini">统计分析</van-button> --> |
|
||||
<van-popup v-model:show="data.showDatePicker" position="bottom"> |
|
||||
<van-date-picker |
|
||||
title="选择月度" |
|
||||
v-model="data.currentDate" |
|
||||
:min-date="data.minDate" |
|
||||
:max-date="data.maxDate" |
|
||||
:columns-type="data.columnsType" |
|
||||
@confirm="onDateConfirm" |
|
||||
@cancel="cancelSelectDate" |
|
||||
/> |
|
||||
</van-popup> |
|
||||
</div> |
|
||||
|
|
||||
<!-- 中间 --> |
|
||||
<div class="shop-center"> |
|
||||
<van-pull-refresh v-model="data.refreshing" @refresh="onRefresh"> |
|
||||
<van-list v-model:loading="data.loading" :finished="data.finished" finished-text="没有更多了" @load="onLoad"> |
|
||||
<div class="goods_box" v-for="(item, index) in data?.dataList" :key="index"> |
|
||||
<van-swipe-cell class="swipe_cell"> |
|
||||
<div class="card_box"> |
|
||||
<div class="card_box_span" > |
|
||||
<p>执法时间:{{ formattedTimeYYYYmmdd(item.createTime) }}</p> |
|
||||
<!-- <div class="act-btn" v-if="item.uniteCheck != '' && item.uniteCheck != null"> --> |
|
||||
<div class="act-btn" v-if="item.hasUnion == 1"> |
|
||||
<!-- <span class="card_box_action"></span>--> |
|
||||
<span class="joint-mark">联</span> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
|
||||
|
|
||||
<div @click="toDetailView(item.id)"> |
|
||||
<div class="van-hairline--bottom"></div> |
|
||||
<div class="card_box_span card-title"> |
|
||||
<p>{{ item.lawEnforcementItemText }}</p> |
|
||||
</div> |
|
||||
|
|
||||
<div class="card_box_span"> |
|
||||
<p><label class="card_box_label">执法单位:</label> <span>{{ item.bureauDeptName }}</span></p> |
|
||||
</div> |
|
||||
<!-- <div class="card_box_span"> |
|
||||
<p><label class="card_box_label">执法人员:</label> <span>{{ item.lawEnforcer }}</span></p> |
|
||||
</div> |
|
||||
<div class="card_box_span" v-for="(item, index) in item.lawEnforcer2List"> |
|
||||
<p><label class="card_box_label">执法人员:</label> <span>{{ item }}</span></p> |
|
||||
</div>--> |
|
||||
<div class="card_box_span"> |
|
||||
<p> |
|
||||
<label class="card_box_label">执法人员:</label> |
|
||||
<span class="asblock"> |
|
||||
<span>{{ nameCorrect(item.lawEnforcer) }}</span> |
|
||||
<span v-for="(item, index) in item.lawEnforcer2List" :key="index">{{ nameCorrect(item)}}</span> |
|
||||
</span> |
|
||||
</p> |
|
||||
</div> |
|
||||
<div class="card_box_span"> |
|
||||
<p><label class="card_box_label">执法类别:</label> <span>{{ item.checkCategoryText }}</span> |
|
||||
</p> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="btn-list"> |
|
||||
<a @click.stop="toEvaluate(item.id,item.lawEnforcementItemText)" v-if="item.outTimeDayNum<=5 && item.isEvaluate==0"> |
|
||||
<van-icon name="flower-o"/>评价</a> |
|
||||
</div> |
|
||||
|
|
||||
<div class="card_box_action" v-if="item.comOrOpi == 0"> |
|
||||
<!-- <span><van-button @click="toComplaint(item.id, item.lawEnforcementItemText)" type="primary"--> |
|
||||
<!-- size="mini">建议</van-button></span>--> |
|
||||
</div> |
|
||||
</div> |
|
||||
</van-swipe-cell> |
|
||||
</div> |
|
||||
</van-list> |
|
||||
</van-pull-refresh> |
|
||||
</div> |
|
||||
|
|
||||
<!-- 底部 --> |
|
||||
<!-- <div class="shop_footer_body"> |
|
||||
<footer-nav></footer-nav> |
|
||||
</div> --> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script setup name="registrationList"> |
|
||||
import {queryEnterpriseList} from '@/api/enterprise'; |
|
||||
import {nameCorrect} from'@/util/fileUpload'; |
|
||||
|
|
||||
const {useCommon} = $globalStore; |
|
||||
|
|
||||
const router = useRouter(); |
|
||||
|
|
||||
let searchParam = reactive({ |
|
||||
// 分页 |
|
||||
pageNum: 1, |
|
||||
pageSize: 6, |
|
||||
//执法事件 |
|
||||
lawEnforcementIncident: "", |
|
||||
//执法单位 |
|
||||
lawEnforcement: "", |
|
||||
//搜索框 |
|
||||
searchValue: ref(''), |
|
||||
//时间类型 |
|
||||
dateType: null, |
|
||||
// 是否提交 |
|
||||
isSubmit: 1, |
|
||||
//是否投诉 |
|
||||
isComplaint: null, |
|
||||
//企业统一信用码 |
|
||||
enterpriseNumber: ref(useCommon.enterpriseNumber), |
|
||||
//时间搜索 |
|
||||
dateSearch: "", |
|
||||
dataScopeId: useCommon.userId |
|
||||
}); |
|
||||
|
|
||||
const data = reactive({ |
|
||||
cartList: [], |
|
||||
dataList: [], |
|
||||
dateSearch: ref(), |
|
||||
showDatePicker: false, |
|
||||
currentDate: ref(['2024', '01']), |
|
||||
minDate: new Date(2020, 0, 1), |
|
||||
maxDate: new Date(2125, 5, 1), |
|
||||
columnsType: ['year', 'month'], |
|
||||
ga_columns: [], |
|
||||
dateShow: false, |
|
||||
checkNum: null, |
|
||||
loading: false, |
|
||||
finished: false, |
|
||||
refreshing: false, |
|
||||
curPage: 1, |
|
||||
name:"" |
|
||||
}); |
|
||||
|
|
||||
// 设置初始值为当前时间 |
|
||||
onMounted(() => { |
|
||||
// getCard(); |
|
||||
searchParam.enterpriseNumber = useCommon.enterpriseNumber; |
|
||||
// queryList(); |
|
||||
data.dateSearch = nowDate(new Date()); |
|
||||
// queryLinkageDictByValueAndParentId({"value": "check_item", "parentId": "100"}, success => { |
|
||||
// getLinkageByParentIdToItem(success.id) |
|
||||
// }, error => { |
|
||||
// }); |
|
||||
nameCorrect(); |
|
||||
}); |
|
||||
const getLinkageByParentIdToItem = (parentId) => { |
|
||||
// 查询执法要求字典信息 |
|
||||
queryLinkage({"parentId": parentId}, success => { |
|
||||
for (var i = 0; i < success.length; i++) { |
|
||||
data.ga_columns.push({text: success[i].title, value: success[i].id, id: success[i].id}) |
|
||||
} |
|
||||
// queryList(); |
|
||||
searchDateType(null); |
|
||||
}, error => { |
|
||||
}); |
|
||||
} |
|
||||
const queryList = () => { |
|
||||
// searchParam.enterpriseNumber = "92440300MACQUM2M9D"; |
|
||||
//TODO 临时注释 |
|
||||
if (searchParam.enterpriseNumber == '' || searchParam.enterpriseNumber == null) { |
|
||||
console.log("该用户没有关联企业!"); |
|
||||
return; |
|
||||
} |
|
||||
searchParam.pageNum = (data.curPage - 1) * searchParam.pageSize; |
|
||||
queryEnterpriseList(searchParam, success => { |
|
||||
console.log("---- ",success.rows); |
|
||||
data.curPage++; |
|
||||
data.loading = false; // 查出结果停止加载 |
|
||||
if (success.total <= data.dataList.length) { |
|
||||
// 查到最后没数据 |
|
||||
data.finished = true; |
|
||||
return; |
|
||||
} |
|
||||
// data.dataList = success.data; |
|
||||
data.dataList.push(...success.rows); |
|
||||
}, error => { |
|
||||
|
|
||||
}) |
|
||||
} |
|
||||
const setLinkageItem = (id, item) => { |
|
||||
queryLinkageById({"id": id}, success => { |
|
||||
item.lawEnforcementItem = success.title |
|
||||
}, error => { |
|
||||
}); |
|
||||
} |
|
||||
const onSearch = (val) => { |
|
||||
data.curPage = 1; |
|
||||
data.dataList = []; |
|
||||
onRefresh(); |
|
||||
// queryRegistrationList( |
|
||||
// { |
|
||||
// "searchValue": searchParam.searchText |
|
||||
// } |
|
||||
// , success => { |
|
||||
// console.log(success) |
|
||||
// data.dataList = success.data; |
|
||||
// }, error => { |
|
||||
// |
|
||||
// }) |
|
||||
}; |
|
||||
const clearSearch = (val) => { |
|
||||
data.curPage = 1; |
|
||||
data.dataList = []; |
|
||||
onRefresh(); |
|
||||
}; |
|
||||
const onClickButton = () => { |
|
||||
data.curPage = 1; |
|
||||
data.dataList = []; |
|
||||
onRefresh(); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 企业投诉页面 |
|
||||
* @param {*} id |
|
||||
* @param {*} name |
|
||||
*/ |
|
||||
const toComplaintView = (id, name, text, bureauDeptName, bureauDeptId) => { |
|
||||
console.log(id, name) |
|
||||
router.push({ |
|
||||
path: "/enterprise/complaint", |
|
||||
query: { |
|
||||
id: id, |
|
||||
lawEnforcementIncident: name, |
|
||||
lawEnforcementItemText: text, |
|
||||
bureauDeptName: bureauDeptName, |
|
||||
bureauDeptId: bureauDeptId, |
|
||||
comOrOpi: 1, |
|
||||
isSelect: false |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
/** 企业评价页面 */ |
|
||||
const toEvaluate = (id, checkItem) => { |
|
||||
console.log(checkItem); |
|
||||
router.push({ |
|
||||
path: "/evaluate", |
|
||||
query: { |
|
||||
isSelect: false, |
|
||||
id: id, |
|
||||
lawEnforcementItemText: checkItem, |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
/** |
|
||||
* 查看执法登记详情 |
|
||||
* @param {} id |
|
||||
* @param {*} name |
|
||||
*/ |
|
||||
const toDetailView = (id) => { |
|
||||
console.log(id) |
|
||||
router.push( |
|
||||
{ |
|
||||
path: "/registrationDetail", |
|
||||
query: { |
|
||||
id: id, |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
onActivated(() => { |
|
||||
}); |
|
||||
|
|
||||
onDeactivated(() => { |
|
||||
|
|
||||
}); |
|
||||
|
|
||||
/*const countWorkdays = (startDate) => { |
|
||||
let workdays = 0; |
|
||||
endDate = new Date(); |
|
||||
for (let date = new Date(startDate); date <= endDate; date.setDate(date.getDate() + 1)) { |
|
||||
if (date.getDay() % 6 !== 0) { // 假设周末是6 (星期六) 和 0 (星期日) |
|
||||
workdays++; |
|
||||
} |
|
||||
} |
|
||||
return workdays; |
|
||||
}*/ |
|
||||
|
|
||||
// 返回 |
|
||||
/*const goBack = () => { |
|
||||
router.go(-1); |
|
||||
};*/ |
|
||||
|
|
||||
let resetScroll = ref(0); // 滚动记录 |
|
||||
let isLodding = ref(true); // 是否加载中 |
|
||||
let freshMap = reactive({ |
|
||||
refreshLoad: false, // 是否刷新 |
|
||||
listLoading: false, // 是否加载中 |
|
||||
listFinished: false, // 是否加载完成标识 |
|
||||
}); |
|
||||
|
|
||||
//下拉刷新 |
|
||||
const onRefresh = () => { |
|
||||
data.curPage = 1; |
|
||||
// 清空列表数据 |
|
||||
data.dataList = []; |
|
||||
data.finished = false; |
|
||||
|
|
||||
// 重新加载数据 |
|
||||
// 将 loading 设置为 true,表示处于加载状态 |
|
||||
data.loading = true; |
|
||||
onLoad(); |
|
||||
}; |
|
||||
// 触底加载 |
|
||||
const onLoad = () => { |
|
||||
setTimeout(() => { |
|
||||
if (data.refreshing) { |
|
||||
data.refreshing = false; |
|
||||
} |
|
||||
queryList(); |
|
||||
}, 1000); |
|
||||
}; |
|
||||
|
|
||||
|
|
||||
//获取分类下的商品列表 |
|
||||
const getGoodslist = async (onLoad) => { |
|
||||
// const res = await useClassify.classifyGoods(); |
|
||||
// if (res?.code === 20000) { |
|
||||
// goodsList = onLoad ? goodsList.concat(res?.data) : res?.data; |
|
||||
// freshMap.refreshLoad = false; |
|
||||
// freshMap.listLoading = false; |
|
||||
// freshMap.listFinished = res?.listFinished; |
|
||||
// if (goodsList.length > 50) { |
|
||||
// freshMap.listFinished = true; |
|
||||
// } |
|
||||
// } |
|
||||
freshMap.refreshLoad = false; |
|
||||
freshMap.listLoading = false; |
|
||||
freshMap.listFinished = true; |
|
||||
isLodding.value = false; |
|
||||
}; |
|
||||
|
|
||||
const selectDate = () => { |
|
||||
data.checkNum = 9; |
|
||||
data.showDatePicker = true; |
|
||||
} |
|
||||
|
|
||||
const onDateConfirm = (value) => { |
|
||||
data.dateSearch = value.selectedValues[0] + "/" + value.selectedValues[1] |
|
||||
data.showDatePicker = false; |
|
||||
//搜索数据 |
|
||||
searchParam.dateSearch = value.selectedValues[0] + "-" + value.selectedValues[1] |
|
||||
searchParam.dateType = null; |
|
||||
data.dateShow = true; |
|
||||
|
|
||||
data.curPage = 1; |
|
||||
data.dataList = []; |
|
||||
onRefresh(); |
|
||||
} |
|
||||
const nowDate = (time) => { |
|
||||
var year = time.getFullYear(); // 年 |
|
||||
var month = (time.getMonth() + 1).toString().padStart(2, '0'); // 月 |
|
||||
var date = time.getDate().toString().padStart(2, '0'); // 日 |
|
||||
var hour = time.getHours().toString().padStart(2, '0'); // 时 |
|
||||
var minute = time.getMinutes().toString().padStart(2, '0'); // 分 |
|
||||
var second = time.getSeconds().toString().padStart(2, '0'); // 秒 |
|
||||
return ( |
|
||||
year + "/" + month |
|
||||
) |
|
||||
} |
|
||||
|
|
||||
|
|
||||
const searchDateType = (val) => { |
|
||||
data.checkNum = val; |
|
||||
searchParam.dateType = val; |
|
||||
searchParam.isComplaint = null; |
|
||||
searchParam.dateSearch = null; |
|
||||
if (val == null) { |
|
||||
searchParam.dateSearch = null; |
|
||||
} |
|
||||
data.dateShow = false; |
|
||||
|
|
||||
data.curPage = 1; |
|
||||
data.dataList = []; |
|
||||
onRefresh(); |
|
||||
} |
|
||||
const searchComplaint = (val) => { |
|
||||
searchParam.isComplaint = val; |
|
||||
searchParam.dateType = null; |
|
||||
|
|
||||
data.curPage = 1; |
|
||||
data.dataList = []; |
|
||||
onRefresh(); |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style lang="less" scoped> |
|
||||
.shop { |
|
||||
height: 100%; |
|
||||
display: flex; |
|
||||
flex-direction: column; |
|
||||
overflow: hidden; |
|
||||
background-color: #ebf3fb; |
|
||||
|
|
||||
.header_body { |
|
||||
height: 1.33rem; |
|
||||
} |
|
||||
|
|
||||
.shop-center { |
|
||||
flex: 1; |
|
||||
overflow-y: scroll; |
|
||||
position: relative; |
|
||||
|
|
||||
.goods_box { |
|
||||
display: flex; |
|
||||
background-color: #fff; |
|
||||
margin: 0.27rem; |
|
||||
border-radius: 0.2rem; |
|
||||
|
|
||||
.swipe_cell { |
|
||||
width: 100%; |
|
||||
} |
|
||||
|
|
||||
.card_box { |
|
||||
display: flex; |
|
||||
width: 100%; |
|
||||
padding: 0.1rem 0 0.2rem; |
|
||||
flex-direction: column; |
|
||||
|
|
||||
.card_body { |
|
||||
background-color: #fff; |
|
||||
border-radius: 0.27rem; |
|
||||
flex: 1; |
|
||||
} |
|
||||
|
|
||||
.card_box_span { |
|
||||
position: relative; |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
margin: 2% 0; |
|
||||
padding: 0 3%; |
|
||||
color: #666; |
|
||||
font-size: 0.35rem; |
|
||||
line-height: 1.5; |
|
||||
|
|
||||
p { |
|
||||
display: flex; |
|
||||
margin: 0; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.card_box_action { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.shop_footer_body { |
|
||||
//height: 101px; |
|
||||
position: relative; |
|
||||
|
|
||||
.footer-one-btn { |
|
||||
height: 1.33rem; |
|
||||
bottom: 1.34rem; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.search-button-list { |
|
||||
height: 0.7rem; |
|
||||
display: flex; |
|
||||
flex-direction: row; |
|
||||
padding-left: 0.27rem; |
|
||||
margin-top: 0.27rem; |
|
||||
align-items: end; |
|
||||
|
|
||||
.search-button { |
|
||||
width: 15%; |
|
||||
height: 90%; |
|
||||
background: #ebebeb; |
|
||||
border-color: #ebebeb; |
|
||||
color: #999; |
|
||||
font-size: 0.3rem; |
|
||||
line-height: 1.5; |
|
||||
} |
|
||||
|
|
||||
.search-button.active { |
|
||||
background-color: #d9e6fd; |
|
||||
border-color: #75a5fb; |
|
||||
color: #1367fe; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.search-button-date { |
|
||||
display: flex; |
|
||||
flex-direction: row; |
|
||||
align-items: end; |
|
||||
position: relative; |
|
||||
|
|
||||
.date-select { |
|
||||
margin: 3% 0 0 4%; |
|
||||
color: #c1bfbf; |
|
||||
font-size: 0.52rem; |
|
||||
|
|
||||
i { |
|
||||
transform: rotate(90deg); |
|
||||
font-size: 0.4rem; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.search-button { |
|
||||
position: absolute; |
|
||||
top: 1%; |
|
||||
right: 3%; |
|
||||
width: 15%; |
|
||||
height: 100%; |
|
||||
font-size: 0.3rem; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.trbtn { |
|
||||
position: absolute; |
|
||||
top: 0; |
|
||||
right: 4%; |
|
||||
height: 90%; |
|
||||
} |
|
||||
|
|
||||
.trbtn_e { |
|
||||
position: absolute; |
|
||||
top: 0; |
|
||||
right: 16%; |
|
||||
height: 90%; |
|
||||
color: antiquewhite |
|
||||
} |
|
||||
|
|
||||
/deep/ .van-hairline--bottom { |
|
||||
margin: -1% 0 3% 0; |
|
||||
height: 0; |
|
||||
background-color: transparent; |
|
||||
border: 1px; |
|
||||
} |
|
||||
|
|
||||
/deep/ .card_box_span:first-child p { |
|
||||
color: #c1bfbf !important; |
|
||||
} |
|
||||
|
|
||||
.card-title p { |
|
||||
display: block !important; |
|
||||
color: #000; |
|
||||
font-size: 0.40rem; |
|
||||
font-weight: bold; |
|
||||
white-space: nowrap; |
|
||||
overflow: hidden; |
|
||||
text-overflow: ellipsis; |
|
||||
} |
|
||||
|
|
||||
.card_box_label { |
|
||||
color: #323233; |
|
||||
white-space: nowrap; |
|
||||
} |
|
||||
|
|
||||
.asblock, .asblock > span { |
|
||||
display: block; |
|
||||
} |
|
||||
|
|
||||
/deep/ .van-search__content { |
|
||||
height: 0.9rem; |
|
||||
border: 1px solid #ececec; |
|
||||
border-radius: 0.15rem 0 0 0.15rem; |
|
||||
} |
|
||||
|
|
||||
/deep/ .van-search__action { |
|
||||
margin: 0 3% 0 0; |
|
||||
width: 10%; |
|
||||
height: 0.9rem; |
|
||||
background: #1367fe; |
|
||||
border: 0.01rem solid #1367fe; |
|
||||
border-radius: 0 0.15rem 0.15rem 0; |
|
||||
color: #fff; |
|
||||
text-align: center; |
|
||||
line-height: 0.9rem; |
|
||||
} |
|
||||
|
|
||||
.btn-list { |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
justify-content: flex-end; |
|
||||
margin: 0.3rem 3% 0; |
|
||||
width: 94%; |
|
||||
border-top: 1px solid #f4f5f6; |
|
||||
} |
|
||||
|
|
||||
.btn-list a { |
|
||||
margin: 3% 3% 1%; |
|
||||
font-size: 0.35rem; |
|
||||
color: #1367fe; |
|
||||
white-space: nowrap; |
|
||||
} |
|
||||
|
|
||||
.btn-list a i { |
|
||||
margin: 0 0.12rem; |
|
||||
font-size: 0.4rem; |
|
||||
} |
|
||||
|
|
||||
.act-btn { |
|
||||
display: flex; |
|
||||
position: absolute; |
|
||||
top: 0; |
|
||||
right: 0; |
|
||||
white-space: nowrap; |
|
||||
} |
|
||||
|
|
||||
.joint-mark { |
|
||||
display: inline-block; |
|
||||
margin: 0 0.25rem 0 0; |
|
||||
width: 0.5rem; |
|
||||
height: 0.5rem; |
|
||||
background: #2d94fa; |
|
||||
border-radius: 50%; |
|
||||
color: #fff; |
|
||||
font-size: 0.3rem; |
|
||||
line-height: 1.75; |
|
||||
text-align: center; |
|
||||
} |
|
||||
</style> |
|
||||
Loading…
Reference in new issue