9 changed files with 1419 additions and 0 deletions
-
162chenhai-admin/src/main/java/com/chenhai/web/controller/system/SysPolicyInterpretationController.java
-
164chenhai-system/src/main/java/com/chenhai/system/domain/SysPolicyInterpretation.java
-
95chenhai-system/src/main/java/com/chenhai/system/mapper/SysPolicyInterpretationMapper.java
-
95chenhai-system/src/main/java/com/chenhai/system/service/ISysPolicyInterpretationService.java
-
146chenhai-system/src/main/java/com/chenhai/system/service/impl/SysPolicyInterpretationServiceImpl.java
-
154chenhai-system/src/main/resources/mapper/system/SysPolicyInterpretationMapper.xml
-
79chenhai-ui/src/api/system/interpretation.js
-
1chenhai-ui/src/assets/icons/svg/policyInterpretation.svg
-
523chenhai-ui/src/views/system/interpretation/index.vue
@ -0,0 +1,162 @@ |
|||
package com.chenhai.web.controller.system; |
|||
|
|||
import java.io.File; |
|||
import java.io.IOException; |
|||
import java.net.URLEncoder; |
|||
import java.nio.file.Files; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
import com.chenhai.common.config.ChenHaiConfig; |
|||
import com.chenhai.common.utils.StringUtils; |
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.PutMapping; |
|||
import org.springframework.web.bind.annotation.DeleteMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import com.chenhai.common.annotation.Log; |
|||
import com.chenhai.common.core.controller.BaseController; |
|||
import com.chenhai.common.core.domain.AjaxResult; |
|||
import com.chenhai.common.enums.BusinessType; |
|||
import com.chenhai.system.domain.SysPolicyInterpretation; |
|||
import com.chenhai.system.service.ISysPolicyInterpretationService; |
|||
import com.chenhai.common.utils.poi.ExcelUtil; |
|||
import com.chenhai.common.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 政策解读Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-20 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/system/interpretation") |
|||
public class SysPolicyInterpretationController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private ISysPolicyInterpretationService sysPolicyInterpretationService; |
|||
|
|||
/** |
|||
* 查询政策解读列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:interpretation:list')") |
|||
@GetMapping("/list") |
|||
public TableDataInfo list(SysPolicyInterpretation sysPolicyInterpretation) |
|||
{ |
|||
startPage(); |
|||
List<SysPolicyInterpretation> list = sysPolicyInterpretationService.selectSysPolicyInterpretationList(sysPolicyInterpretation); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出政策解读列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:interpretation:export')") |
|||
@Log(title = "政策解读", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(HttpServletResponse response, SysPolicyInterpretation sysPolicyInterpretation) |
|||
{ |
|||
List<SysPolicyInterpretation> list = sysPolicyInterpretationService.selectSysPolicyInterpretationList(sysPolicyInterpretation); |
|||
ExcelUtil<SysPolicyInterpretation> util = new ExcelUtil<SysPolicyInterpretation>(SysPolicyInterpretation.class); |
|||
util.exportExcel(response, list, "政策解读数据"); |
|||
} |
|||
|
|||
/** |
|||
* 获取政策解读详细信息 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:interpretation:query')") |
|||
@GetMapping(value = "/{id}") |
|||
public AjaxResult getInfo(@PathVariable("id") Long id) |
|||
{ |
|||
return success(sysPolicyInterpretationService.selectSysPolicyInterpretationById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增政策解读 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:interpretation:add')") |
|||
@Log(title = "政策解读", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public AjaxResult add(@RequestBody SysPolicyInterpretation sysPolicyInterpretation) |
|||
{ |
|||
return toAjax(sysPolicyInterpretationService.insertSysPolicyInterpretation(sysPolicyInterpretation)); |
|||
} |
|||
|
|||
/** |
|||
* 修改政策解读 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:interpretation:edit')") |
|||
@Log(title = "政策解读", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody SysPolicyInterpretation sysPolicyInterpretation) |
|||
{ |
|||
return toAjax(sysPolicyInterpretationService.updateSysPolicyInterpretation(sysPolicyInterpretation)); |
|||
} |
|||
|
|||
/** |
|||
* 删除政策解读 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:interpretation:remove')") |
|||
@Log(title = "政策解读", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public AjaxResult remove(@PathVariable Long[] ids) |
|||
{ |
|||
return toAjax(sysPolicyInterpretationService.deleteSysPolicyInterpretationByIds(ids)); |
|||
} |
|||
|
|||
/** |
|||
* 上架政策解读 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:interpretation:publish')") |
|||
@Log(title = "政策解读上架", businessType = BusinessType.UPDATE) |
|||
@PutMapping("/publish/{id}") |
|||
public AjaxResult publish(@PathVariable Long id) |
|||
{ |
|||
return toAjax(sysPolicyInterpretationService.publishSysPolicyInterpretation(id)); |
|||
} |
|||
|
|||
/** |
|||
* 批量上架政策解读 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:interpretation:publish')") |
|||
@Log(title = "政策解读批量上架", businessType = BusinessType.UPDATE) |
|||
@PutMapping("/publish") |
|||
public AjaxResult publishBatch(@RequestBody Long[] ids) |
|||
{ |
|||
return toAjax(sysPolicyInterpretationService.publishSysPolicyInterpretationByIds(ids)); |
|||
} |
|||
|
|||
/** |
|||
* 下架政策解读 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:interpretation:unpublish')") |
|||
@Log(title = "政策解读下架", businessType = BusinessType.UPDATE) |
|||
@PutMapping("/unpublish/{id}") |
|||
public AjaxResult unpublish(@PathVariable Long id, @RequestBody Map<String, String> requestBody) |
|||
{ |
|||
String removalReason = requestBody.get("removalReason"); |
|||
return toAjax(sysPolicyInterpretationService.unpublishSysPolicyInterpretation(id, removalReason)); |
|||
} |
|||
|
|||
/** |
|||
* 批量下架政策解读 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:interpretation:unpublish')") |
|||
@Log(title = "政策解读批量下架", businessType = BusinessType.UPDATE) |
|||
@PutMapping("/unpublish") |
|||
public AjaxResult unpublishBatch(@RequestBody Map<String, Object> requestBody) |
|||
{ |
|||
List<Integer> idList = (List<Integer>) requestBody.get("ids"); |
|||
Long[] ids = idList.stream() |
|||
.map(Long::valueOf) |
|||
.toArray(Long[]::new); |
|||
String removalReason = (String) requestBody.get("removalReason"); |
|||
return toAjax(sysPolicyInterpretationService.unpublishSysPolicyInterpretationByIds(ids, removalReason)); |
|||
} |
|||
} |
|||
@ -0,0 +1,164 @@ |
|||
package com.chenhai.system.domain; |
|||
|
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
import com.chenhai.common.annotation.Excel; |
|||
import com.chenhai.common.core.domain.BaseEntity; |
|||
|
|||
/** |
|||
* 政策解读对象 sys_policy_interpretation |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-20 |
|||
*/ |
|||
public class SysPolicyInterpretation extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 主键ID */ |
|||
private Long id; |
|||
|
|||
/** 标题 */ |
|||
@Excel(name = "标题") |
|||
private String title; |
|||
|
|||
/** 政策文件 */ |
|||
@Excel(name = "政策文件") |
|||
private String policyFile; |
|||
|
|||
/** 发布日期 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "发布日期", width = 30, dateFormat = "yyyy-MM-dd") |
|||
private Date releaseDate; |
|||
|
|||
/** 发布单位 */ |
|||
@Excel(name = "发布单位") |
|||
private String issuingAgency; |
|||
|
|||
/** 解读内容 */ |
|||
@Excel(name = "解读内容") |
|||
private String content; |
|||
|
|||
/** 上架状态(0-未上架 1-已上架) */ |
|||
@Excel(name = "上架状态(0-未上架 1-已上架)") |
|||
private String publishStatus; |
|||
|
|||
/** 下架原因 */ |
|||
@Excel(name = "下架原因") |
|||
private String removalReason; |
|||
|
|||
/** 删除标志(0代表存在 2代表删除) */ |
|||
private String delFlag; |
|||
|
|||
public void setId(Long id) |
|||
{ |
|||
this.id = id; |
|||
} |
|||
|
|||
public Long getId() |
|||
{ |
|||
return id; |
|||
} |
|||
|
|||
public void setTitle(String title) |
|||
{ |
|||
this.title = title; |
|||
} |
|||
|
|||
public String getTitle() |
|||
{ |
|||
return title; |
|||
} |
|||
|
|||
public void setPolicyFile(String policyFile) |
|||
{ |
|||
this.policyFile = policyFile; |
|||
} |
|||
|
|||
public String getPolicyFile() |
|||
{ |
|||
return policyFile; |
|||
} |
|||
|
|||
public void setReleaseDate(Date releaseDate) |
|||
{ |
|||
this.releaseDate = releaseDate; |
|||
} |
|||
|
|||
public Date getReleaseDate() |
|||
{ |
|||
return releaseDate; |
|||
} |
|||
|
|||
public void setIssuingAgency(String issuingAgency) |
|||
{ |
|||
this.issuingAgency = issuingAgency; |
|||
} |
|||
|
|||
public String getIssuingAgency() |
|||
{ |
|||
return issuingAgency; |
|||
} |
|||
|
|||
public void setContent(String content) |
|||
{ |
|||
this.content = content; |
|||
} |
|||
|
|||
public String getContent() |
|||
{ |
|||
return content; |
|||
} |
|||
|
|||
public void setPublishStatus(String publishStatus) |
|||
{ |
|||
this.publishStatus = publishStatus; |
|||
} |
|||
|
|||
public String getPublishStatus() |
|||
{ |
|||
return publishStatus; |
|||
} |
|||
|
|||
public void setRemovalReason(String removalReason) |
|||
{ |
|||
this.removalReason = removalReason; |
|||
} |
|||
|
|||
public String getRemovalReason() |
|||
{ |
|||
return removalReason; |
|||
} |
|||
|
|||
public void setDelFlag(String delFlag) |
|||
{ |
|||
this.delFlag = delFlag; |
|||
} |
|||
|
|||
public String getDelFlag() |
|||
{ |
|||
return delFlag; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("id", getId()) |
|||
.append("title", getTitle()) |
|||
.append("policyFile", getPolicyFile()) |
|||
.append("releaseDate", getReleaseDate()) |
|||
.append("issuingAgency", getIssuingAgency()) |
|||
.append("content", getContent()) |
|||
.append("publishStatus", getPublishStatus()) |
|||
.append("removalReason", getRemovalReason()) |
|||
.append("delFlag", getDelFlag()) |
|||
.append("createBy", getCreateBy()) |
|||
.append("createTime", getCreateTime()) |
|||
.append("updateBy", getUpdateBy()) |
|||
.append("updateTime", getUpdateTime()) |
|||
.append("remark", getRemark()) |
|||
.toString(); |
|||
} |
|||
} |
|||
@ -0,0 +1,95 @@ |
|||
package com.chenhai.system.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.chenhai.system.domain.SysPolicyInterpretation; |
|||
|
|||
/** |
|||
* 政策解读Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-20 |
|||
*/ |
|||
public interface SysPolicyInterpretationMapper |
|||
{ |
|||
/** |
|||
* 查询政策解读 |
|||
* |
|||
* @param id 政策解读主键 |
|||
* @return 政策解读 |
|||
*/ |
|||
public SysPolicyInterpretation selectSysPolicyInterpretationById(Long id); |
|||
|
|||
/** |
|||
* 查询政策解读列表 |
|||
* |
|||
* @param sysPolicyInterpretation 政策解读 |
|||
* @return 政策解读集合 |
|||
*/ |
|||
public List<SysPolicyInterpretation> selectSysPolicyInterpretationList(SysPolicyInterpretation sysPolicyInterpretation); |
|||
|
|||
/** |
|||
* 新增政策解读 |
|||
* |
|||
* @param sysPolicyInterpretation 政策解读 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertSysPolicyInterpretation(SysPolicyInterpretation sysPolicyInterpretation); |
|||
|
|||
/** |
|||
* 修改政策解读 |
|||
* |
|||
* @param sysPolicyInterpretation 政策解读 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateSysPolicyInterpretation(SysPolicyInterpretation sysPolicyInterpretation); |
|||
|
|||
/** |
|||
* 删除政策解读 |
|||
* |
|||
* @param id 政策解读主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysPolicyInterpretationById(Long id); |
|||
|
|||
/** |
|||
* 批量删除政策解读 |
|||
* |
|||
* @param ids 需要删除的数据主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysPolicyInterpretationByIds(Long[] ids); |
|||
|
|||
/** |
|||
* 上架政策解读 |
|||
* |
|||
* @param id 政策解读主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int publishSysPolicyInterpretation(Long id); |
|||
|
|||
/** |
|||
* 下架政策解读 |
|||
* |
|||
* @param id 政策解读主键 |
|||
* @param removalReason 下架原因 |
|||
* @return 结果 |
|||
*/ |
|||
public int unpublishSysPolicyInterpretation(Long id, String removalReason); |
|||
|
|||
/** |
|||
* 批量上架政策解读 |
|||
* |
|||
* @param ids 需要上架的政策解读主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int publishSysPolicyInterpretationByIds(Long[] ids); |
|||
|
|||
/** |
|||
* 批量下架政策解读 |
|||
* |
|||
* @param ids 需要下架的政策解读主键集合 |
|||
* @param removalReason 下架原因 |
|||
* @return 结果 |
|||
*/ |
|||
public int unpublishSysPolicyInterpretationByIds(Long[] ids, String removalReason); |
|||
} |
|||
@ -0,0 +1,95 @@ |
|||
package com.chenhai.system.service; |
|||
|
|||
import java.util.List; |
|||
import com.chenhai.system.domain.SysPolicyInterpretation; |
|||
|
|||
/** |
|||
* 政策解读Service接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-20 |
|||
*/ |
|||
public interface ISysPolicyInterpretationService |
|||
{ |
|||
/** |
|||
* 查询政策解读 |
|||
* |
|||
* @param id 政策解读主键 |
|||
* @return 政策解读 |
|||
*/ |
|||
public SysPolicyInterpretation selectSysPolicyInterpretationById(Long id); |
|||
|
|||
/** |
|||
* 查询政策解读列表 |
|||
* |
|||
* @param sysPolicyInterpretation 政策解读 |
|||
* @return 政策解读集合 |
|||
*/ |
|||
public List<SysPolicyInterpretation> selectSysPolicyInterpretationList(SysPolicyInterpretation sysPolicyInterpretation); |
|||
|
|||
/** |
|||
* 新增政策解读 |
|||
* |
|||
* @param sysPolicyInterpretation 政策解读 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertSysPolicyInterpretation(SysPolicyInterpretation sysPolicyInterpretation); |
|||
|
|||
/** |
|||
* 修改政策解读 |
|||
* |
|||
* @param sysPolicyInterpretation 政策解读 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateSysPolicyInterpretation(SysPolicyInterpretation sysPolicyInterpretation); |
|||
|
|||
/** |
|||
* 批量删除政策解读 |
|||
* |
|||
* @param ids 需要删除的政策解读主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysPolicyInterpretationByIds(Long[] ids); |
|||
|
|||
/** |
|||
* 删除政策解读信息 |
|||
* |
|||
* @param id 政策解读主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysPolicyInterpretationById(Long id); |
|||
|
|||
/** |
|||
* 上架政策解读 |
|||
* |
|||
* @param id 政策解读主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int publishSysPolicyInterpretation(Long id); |
|||
|
|||
/** |
|||
* 下架政策解读 |
|||
* |
|||
* @param id 政策解读主键 |
|||
* @param removalReason 下架原因 |
|||
* @return 结果 |
|||
*/ |
|||
public int unpublishSysPolicyInterpretation(Long id, String removalReason); |
|||
|
|||
/** |
|||
* 批量上架政策解读 |
|||
* |
|||
* @param ids 需要上架的政策解读主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int publishSysPolicyInterpretationByIds(Long[] ids); |
|||
|
|||
/** |
|||
* 批量下架政策解读 |
|||
* |
|||
* @param ids 需要下架的政策解读主键集合 |
|||
* @param removalReason 下架原因 |
|||
* @return 结果 |
|||
*/ |
|||
public int unpublishSysPolicyInterpretationByIds(Long[] ids, String removalReason); |
|||
} |
|||
@ -0,0 +1,146 @@ |
|||
package com.chenhai.system.service.impl; |
|||
|
|||
import java.util.List; |
|||
import com.chenhai.common.utils.DateUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import com.chenhai.system.mapper.SysPolicyInterpretationMapper; |
|||
import com.chenhai.system.domain.SysPolicyInterpretation; |
|||
import com.chenhai.system.service.ISysPolicyInterpretationService; |
|||
|
|||
/** |
|||
* 政策解读Service业务层处理 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-01-20 |
|||
*/ |
|||
@Service |
|||
public class SysPolicyInterpretationServiceImpl implements ISysPolicyInterpretationService |
|||
{ |
|||
@Autowired |
|||
private SysPolicyInterpretationMapper sysPolicyInterpretationMapper; |
|||
|
|||
/** |
|||
* 查询政策解读 |
|||
* |
|||
* @param id 政策解读主键 |
|||
* @return 政策解读 |
|||
*/ |
|||
@Override |
|||
public SysPolicyInterpretation selectSysPolicyInterpretationById(Long id) |
|||
{ |
|||
return sysPolicyInterpretationMapper.selectSysPolicyInterpretationById(id); |
|||
} |
|||
|
|||
/** |
|||
* 查询政策解读列表 |
|||
* |
|||
* @param sysPolicyInterpretation 政策解读 |
|||
* @return 政策解读 |
|||
*/ |
|||
@Override |
|||
public List<SysPolicyInterpretation> selectSysPolicyInterpretationList(SysPolicyInterpretation sysPolicyInterpretation) |
|||
{ |
|||
return sysPolicyInterpretationMapper.selectSysPolicyInterpretationList(sysPolicyInterpretation); |
|||
} |
|||
|
|||
/** |
|||
* 新增政策解读 |
|||
* |
|||
* @param sysPolicyInterpretation 政策解读 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertSysPolicyInterpretation(SysPolicyInterpretation sysPolicyInterpretation) |
|||
{ |
|||
sysPolicyInterpretation.setCreateTime(DateUtils.getNowDate()); |
|||
return sysPolicyInterpretationMapper.insertSysPolicyInterpretation(sysPolicyInterpretation); |
|||
} |
|||
|
|||
/** |
|||
* 修改政策解读 |
|||
* |
|||
* @param sysPolicyInterpretation 政策解读 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateSysPolicyInterpretation(SysPolicyInterpretation sysPolicyInterpretation) |
|||
{ |
|||
sysPolicyInterpretation.setUpdateTime(DateUtils.getNowDate()); |
|||
return sysPolicyInterpretationMapper.updateSysPolicyInterpretation(sysPolicyInterpretation); |
|||
} |
|||
|
|||
/** |
|||
* 批量删除政策解读 |
|||
* |
|||
* @param ids 需要删除的政策解读主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteSysPolicyInterpretationByIds(Long[] ids) |
|||
{ |
|||
return sysPolicyInterpretationMapper.deleteSysPolicyInterpretationByIds(ids); |
|||
} |
|||
|
|||
/** |
|||
* 删除政策解读信息 |
|||
* |
|||
* @param id 政策解读主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteSysPolicyInterpretationById(Long id) |
|||
{ |
|||
return sysPolicyInterpretationMapper.deleteSysPolicyInterpretationById(id); |
|||
} |
|||
|
|||
/** |
|||
* 上架政策解读 |
|||
* |
|||
* @param id 政策解读主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int publishSysPolicyInterpretation(Long id) |
|||
{ |
|||
return sysPolicyInterpretationMapper.publishSysPolicyInterpretation(id); |
|||
} |
|||
|
|||
/** |
|||
* 下架政策解读 |
|||
* |
|||
* @param id 政策解读主键 |
|||
* @param removalReason 下架原因 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int unpublishSysPolicyInterpretation(Long id, String removalReason) |
|||
{ |
|||
return sysPolicyInterpretationMapper.unpublishSysPolicyInterpretation(id, removalReason); |
|||
} |
|||
|
|||
/** |
|||
* 批量上架政策解读 |
|||
* |
|||
* @param ids 需要上架的政策解读主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int publishSysPolicyInterpretationByIds(Long[] ids) |
|||
{ |
|||
return sysPolicyInterpretationMapper.publishSysPolicyInterpretationByIds(ids); |
|||
} |
|||
|
|||
/** |
|||
* 批量下架政策解读 |
|||
* |
|||
* @param ids 需要下架的政策解读主键集合 |
|||
* @param removalReason 下架原因 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int unpublishSysPolicyInterpretationByIds(Long[] ids, String removalReason) |
|||
{ |
|||
return sysPolicyInterpretationMapper.unpublishSysPolicyInterpretationByIds(ids, removalReason); |
|||
} |
|||
} |
|||
@ -0,0 +1,154 @@ |
|||
<?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.chenhai.system.mapper.SysPolicyInterpretationMapper"> |
|||
|
|||
<resultMap type="SysPolicyInterpretation" id="SysPolicyInterpretationResult"> |
|||
<result property="id" column="id" /> |
|||
<result property="title" column="title" /> |
|||
<result property="policyFile" column="policy_file" /> |
|||
<result property="releaseDate" column="release_date" /> |
|||
<result property="issuingAgency" column="issuing_agency" /> |
|||
<result property="content" column="content" /> |
|||
<result property="publishStatus" column="publish_status" /> |
|||
<result property="removalReason" column="removal_reason" /> |
|||
<result property="delFlag" column="del_flag" /> |
|||
<result property="createBy" column="create_by" /> |
|||
<result property="createTime" column="create_time" /> |
|||
<result property="updateBy" column="update_by" /> |
|||
<result property="updateTime" column="update_time" /> |
|||
<result property="remark" column="remark" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectSysPolicyInterpretationVo"> |
|||
select id, title, policy_file, release_date, issuing_agency, content, publish_status, removal_reason, del_flag, create_by, create_time, update_by, update_time, remark from sys_policy_interpretation |
|||
</sql> |
|||
|
|||
<select id="selectSysPolicyInterpretationList" parameterType="SysPolicyInterpretation" resultMap="SysPolicyInterpretationResult"> |
|||
<include refid="selectSysPolicyInterpretationVo"/> |
|||
<where> |
|||
<if test="title != null and title != ''"> and title = #{title}</if> |
|||
<if test="policyFile != null and policyFile != ''"> and policy_file = #{policyFile}</if> |
|||
<if test="releaseDate != null "> and release_date = #{releaseDate}</if> |
|||
<if test="issuingAgency != null and issuingAgency != ''"> and issuing_agency = #{issuingAgency}</if> |
|||
<if test="content != null and content != ''"> and content = #{content}</if> |
|||
<if test="publishStatus != null and publishStatus != ''"> and publish_status = #{publishStatus}</if> |
|||
<if test="removalReason != null and removalReason != ''"> and removal_reason = #{removalReason}</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectSysPolicyInterpretationById" parameterType="Long" resultMap="SysPolicyInterpretationResult"> |
|||
<include refid="selectSysPolicyInterpretationVo"/> |
|||
where id = #{id} |
|||
</select> |
|||
|
|||
<insert id="insertSysPolicyInterpretation" parameterType="SysPolicyInterpretation"> |
|||
insert into sys_policy_interpretation |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="id != null">id,</if> |
|||
<if test="title != null">title,</if> |
|||
<if test="policyFile != null">policy_file,</if> |
|||
<if test="releaseDate != null">release_date,</if> |
|||
<if test="issuingAgency != null">issuing_agency,</if> |
|||
<if test="content != null">content,</if> |
|||
<if test="publishStatus != null">publish_status,</if> |
|||
<if test="removalReason != null">removal_reason,</if> |
|||
<if test="delFlag != null">del_flag,</if> |
|||
<if test="createBy != null">create_by,</if> |
|||
<if test="createTime != null">create_time,</if> |
|||
<if test="updateBy != null">update_by,</if> |
|||
<if test="updateTime != null">update_time,</if> |
|||
<if test="remark != null">remark,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="id != null">#{id},</if> |
|||
<if test="title != null">#{title},</if> |
|||
<if test="policyFile != null">#{policyFile},</if> |
|||
<if test="releaseDate != null">#{releaseDate},</if> |
|||
<if test="issuingAgency != null">#{issuingAgency},</if> |
|||
<if test="content != null">#{content},</if> |
|||
<if test="publishStatus != null">#{publishStatus},</if> |
|||
<if test="removalReason != null">#{removalReason},</if> |
|||
<if test="delFlag != null">#{delFlag},</if> |
|||
<if test="createBy != null">#{createBy},</if> |
|||
<if test="createTime != null">#{createTime},</if> |
|||
<if test="updateBy != null">#{updateBy},</if> |
|||
<if test="updateTime != null">#{updateTime},</if> |
|||
<if test="remark != null">#{remark},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateSysPolicyInterpretation" parameterType="SysPolicyInterpretation"> |
|||
update sys_policy_interpretation |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="title != null">title = #{title},</if> |
|||
<if test="policyFile != null">policy_file = #{policyFile},</if> |
|||
<if test="releaseDate != null">release_date = #{releaseDate},</if> |
|||
<if test="issuingAgency != null">issuing_agency = #{issuingAgency},</if> |
|||
<if test="content != null">content = #{content},</if> |
|||
<if test="publishStatus != null">publish_status = #{publishStatus},</if> |
|||
<if test="removalReason != null">removal_reason = #{removalReason},</if> |
|||
<if test="delFlag != null">del_flag = #{delFlag},</if> |
|||
<if test="createBy != null">create_by = #{createBy},</if> |
|||
<if test="createTime != null">create_time = #{createTime},</if> |
|||
<if test="updateBy != null">update_by = #{updateBy},</if> |
|||
<if test="updateTime != null">update_time = #{updateTime},</if> |
|||
<if test="remark != null">remark = #{remark},</if> |
|||
</trim> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<delete id="deleteSysPolicyInterpretationById" parameterType="Long"> |
|||
delete from sys_policy_interpretation where id = #{id} |
|||
</delete> |
|||
|
|||
<delete id="deleteSysPolicyInterpretationByIds" parameterType="String"> |
|||
delete from sys_policy_interpretation where id in |
|||
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
</delete> |
|||
|
|||
<!-- 上架政策解读 --> |
|||
<update id="publishSysPolicyInterpretation"> |
|||
update sys_policy_interpretation |
|||
set publish_status = '1', |
|||
removal_reason = null, |
|||
update_time = sysdate() |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<!-- 下架政策解读 --> |
|||
<update id="unpublishSysPolicyInterpretation"> |
|||
update sys_policy_interpretation |
|||
set publish_status = '0', |
|||
removal_reason = #{removalReason}, |
|||
update_time = sysdate() |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<!-- 批量上架政策解读 --> |
|||
<update id="publishSysPolicyInterpretationByIds"> |
|||
update sys_policy_interpretation |
|||
set publish_status = '1', |
|||
removal_reason = null, |
|||
update_time = sysdate() |
|||
where id in |
|||
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
</update> |
|||
|
|||
<!-- 批量下架政策解读 --> |
|||
<update id="unpublishSysPolicyInterpretationByIds"> |
|||
update sys_policy_interpretation |
|||
set publish_status = '0', |
|||
removal_reason = #{removalReason}, |
|||
update_time = sysdate() |
|||
where id in |
|||
<foreach item="id" collection="ids" open="(" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
</update> |
|||
</mapper> |
|||
@ -0,0 +1,79 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 查询政策解读列表
|
|||
export function listInterpretation(query) { |
|||
return request({ |
|||
url: '/system/interpretation/list', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
|||
|
|||
// 查询政策解读详细
|
|||
export function getInterpretation(id) { |
|||
return request({ |
|||
url: '/system/interpretation/' + id, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 新增政策解读
|
|||
export function addInterpretation(data) { |
|||
return request({ |
|||
url: '/system/interpretation', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 修改政策解读
|
|||
export function updateInterpretation(data) { |
|||
return request({ |
|||
url: '/system/interpretation', |
|||
method: 'put', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 删除政策解读
|
|||
export function delInterpretation(id) { |
|||
return request({ |
|||
url: '/system/interpretation/' + id, |
|||
method: 'delete' |
|||
}) |
|||
} |
|||
|
|||
// 上架政策解读
|
|||
export function publishInterpretation(id) { |
|||
return request({ |
|||
url: '/system/interpretation/publish/' + id, |
|||
method: 'put' |
|||
}) |
|||
} |
|||
|
|||
// 批量上架政策解读
|
|||
export function publishInterpretationBatch(ids) { |
|||
return request({ |
|||
url: '/system/interpretation/publish', |
|||
method: 'put', |
|||
data: ids |
|||
}) |
|||
} |
|||
|
|||
// 下架政策解读
|
|||
export function unpublishInterpretation(data) { |
|||
return request({ |
|||
url: '/system/interpretation/unpublish/' + data.id, |
|||
method: 'put', |
|||
data: { removalReason: data.removalReason } |
|||
}) |
|||
} |
|||
|
|||
// 批量下架政策解读
|
|||
export function unpublishInterpretationBatch(data) { |
|||
return request({ |
|||
url: '/system/interpretation/unpublish', |
|||
method: 'put', |
|||
data: data |
|||
}) |
|||
} |
|||
@ -0,0 +1 @@ |
|||
<svg t="1768905720443" class="icon" viewBox="0 0 1152 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4739" width="200" height="200"><path d="M1116.124722 118.433523h-89.851086V87.115236l-30.454335-14.399213a759.630458 759.630458 0 0 0-278.48077-71.996062 213.180342 213.180342 0 0 0-142.192224 44.925543A212.604373 212.604373 0 0 0 432.954083 0.647965a761.214371 761.214371 0 0 0-278.408775 71.996062l-30.454334 14.831189v31.318287H36.183781a40.821768 40.821768 0 0 0-35.998031 44.421571v816.363355a40.821768 40.821768 0 0 0 35.998031 44.421571h1079.940941a40.893764 40.893764 0 0 0 35.998031-44.421571V162.783098a40.821768 40.821768 0 0 0-35.998031-44.349575z m-137.944456 8.999508v585.68797c-74.515925-31.318287-272.289109-102.378401-379.05927-25.77459v-590.367715A170.846657 170.846657 0 0 1 717.338531 59.180764a727.160233 727.160233 0 0 1 260.769739 68.252267z m-54.429024 626.365746h-316.782676c61.556634-72.356043 214.692259-37.725937 316.71068-0.287985zM432.882087 59.180764a170.702665 170.702665 0 0 1 118.217535 37.797932v590.367715c-106.698165-76.531815-304.471349-5.543697-378.987274 25.77459V127.433031A726.440273 726.440273 0 0 1 432.882087 59.180764z m110.657948 694.330028h-316.782676c101.586444-37.437953 254.938058-72.212051 316.782676 0zM1080.126691 935.084863H72.181813V207.132672h51.621177v605.558884h902.39865V207.132672H1080.126691v727.952191z m0 0" fill="#6CAB86" p-id="4740"></path></svg> |
|||
@ -0,0 +1,523 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
|||
<el-form-item label="标题" prop="title"> |
|||
<el-input |
|||
v-model="queryParams.title" |
|||
placeholder="请输入标题" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="发布日期" prop="releaseDate"> |
|||
<el-date-picker clearable |
|||
v-model="queryParams.releaseDate" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="请选择发布日期"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="发布单位" prop="issuingAgency"> |
|||
<el-input |
|||
v-model="queryParams.issuingAgency" |
|||
placeholder="请输入发布单位" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="上架状态" prop="publishStatus"> |
|||
<el-select v-model="queryParams.publishStatus" placeholder="请选择上架状态" clearable> |
|||
<el-option |
|||
v-for="dict in dict.type.sys_publish_status" |
|||
:key="dict.value" |
|||
:label="dict.label" |
|||
:value="dict.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
|||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<el-row :gutter="10" class="mb8"> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="primary" |
|||
plain |
|||
icon="el-icon-plus" |
|||
size="mini" |
|||
@click="handleAdd" |
|||
v-hasPermi="['system:interpretation:add']" |
|||
>新增</el-button> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="success" |
|||
plain |
|||
icon="el-icon-edit" |
|||
size="mini" |
|||
:disabled="single" |
|||
@click="handleUpdate" |
|||
v-hasPermi="['system:interpretation:edit']" |
|||
>修改</el-button> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="warning" |
|||
plain |
|||
icon="el-icon-top" |
|||
size="mini" |
|||
:disabled="multiple" |
|||
@click="handlePublish" |
|||
v-hasPermi="['system:interpretation:publish']" |
|||
>上架</el-button> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="warning" |
|||
plain |
|||
icon="el-icon-bottom" |
|||
size="mini" |
|||
:disabled="multiple" |
|||
@click="handleUnpublish" |
|||
v-hasPermi="['system:interpretation:unpublish']" |
|||
>下架</el-button> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="danger" |
|||
plain |
|||
icon="el-icon-delete" |
|||
size="mini" |
|||
:disabled="multiple" |
|||
@click="handleDelete" |
|||
v-hasPermi="['system:interpretation:remove']" |
|||
>删除</el-button> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="info" |
|||
plain |
|||
icon="el-icon-upload" |
|||
size="mini" |
|||
@click="handleExport" |
|||
v-hasPermi="['system:interpretation:export']" |
|||
>导出</el-button> |
|||
</el-col> |
|||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
|||
</el-row> |
|||
|
|||
<el-table v-loading="loading" :data="interpretationList" @selection-change="handleSelectionChange"> |
|||
<el-table-column type="selection" width="55" align="center" /> |
|||
<el-table-column label="主键ID" align="center" prop="id" /> |
|||
<el-table-column label="标题" align="center" prop="title" /> |
|||
<el-table-column label="政策文件" align="center" prop="policyFile" width="120"> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-download" |
|||
@click="handleDownload(scope.row)" |
|||
v-if="scope.row.policyFile" |
|||
>下载文件</el-button> |
|||
<span v-else>-</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="发布日期" align="center" prop="releaseDate" width="180"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ parseTime(scope.row.releaseDate, '{y}-{m}-{d}') }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="发布单位" align="center" prop="issuingAgency" /> |
|||
<el-table-column label="解读内容" align="center" prop="content" width="200"> |
|||
<template slot-scope="scope"> |
|||
<div v-html="scope.row.content ? scope.row.content.substring(0, 50) + '...' : '-'"></div> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="上架状态" align="center" prop="publishStatus" width="100"> |
|||
<template slot-scope="scope"> |
|||
<dict-tag :options="dict.type.sys_publish_status" :value="scope.row.publishStatus"/> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="下架原因" align="center" prop="removalReason" width="150"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.removalReason || '-' }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300"> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-edit" |
|||
@click="handleUpdate(scope.row)" |
|||
v-hasPermi="['system:interpretation:edit']" |
|||
>修改</el-button> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-top" |
|||
@click="handleSinglePublish(scope.row)" |
|||
v-hasPermi="['system:interpretation:publish']" |
|||
v-if="scope.row.publishStatus === '0'" |
|||
>上架</el-button> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-bottom" |
|||
@click="handleSingleUnpublish(scope.row)" |
|||
v-hasPermi="['system:interpretation:unpublish']" |
|||
v-if="scope.row.publishStatus === '1'" |
|||
>下架</el-button> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['system:interpretation:remove']" |
|||
>删除</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<pagination |
|||
v-show="total>0" |
|||
:total="total" |
|||
:page.sync="queryParams.pageNum" |
|||
:limit.sync="queryParams.pageSize" |
|||
@pagination="getList" |
|||
/> |
|||
|
|||
<!-- 添加或修改政策解读对话框 --> |
|||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body> |
|||
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
|||
<el-form-item label="标题" prop="title"> |
|||
<el-input v-model="form.title" placeholder="请输入标题" /> |
|||
</el-form-item> |
|||
<el-form-item label="政策文件" prop="policyFile"> |
|||
<file-upload v-model="form.policyFile"/> |
|||
</el-form-item> |
|||
<el-form-item label="发布日期" prop="releaseDate"> |
|||
<el-date-picker clearable |
|||
v-model="form.releaseDate" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="请选择发布日期"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="发布单位" prop="issuingAgency"> |
|||
<el-input v-model="form.issuingAgency" placeholder="请输入发布单位" /> |
|||
</el-form-item> |
|||
<el-form-item label="解读内容"> |
|||
<editor v-model="form.content" :min-height="192"/> |
|||
</el-form-item> |
|||
<el-form-item label="上架状态" prop="publishStatus"> |
|||
<el-radio-group v-model="form.publishStatus"> |
|||
<el-radio |
|||
v-for="dict in dict.type.sys_publish_status" |
|||
:key="dict.value" |
|||
:label="dict.value" |
|||
>{{dict.label}}</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
<el-form-item label="备注" prop="remark"> |
|||
<el-input v-model="form.remark" placeholder="请输入备注" type="textarea" :rows="3" /> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="submitForm">确 定</el-button> |
|||
<el-button @click="cancel">取 消</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
|
|||
<!-- 下架原因输入对话框 --> |
|||
<el-dialog title="下架原因" :visible.sync="unpublishOpen" width="500px" append-to-body> |
|||
<el-form ref="unpublishForm" :model="unpublishForm" :rules="unpublishRules" label-width="80px"> |
|||
<el-form-item label="下架原因" prop="removalReason"> |
|||
<el-input v-model="unpublishForm.removalReason" placeholder="请输入下架原因" type="textarea" :rows="4" /> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="submitUnpublish">确 定</el-button> |
|||
<el-button @click="unpublishOpen = false">取 消</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { listInterpretation, getInterpretation, delInterpretation, addInterpretation, updateInterpretation, publishInterpretation, publishInterpretationBatch, unpublishInterpretation, unpublishInterpretationBatch } from "@/api/system/interpretation" |
|||
|
|||
export default { |
|||
name: "Interpretation", |
|||
dicts: ['sys_publish_status'], |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 政策解读表格数据 |
|||
interpretationList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 是否显示下架原因弹出层 |
|||
unpublishOpen: false, |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
title: null, |
|||
policyFile: null, |
|||
releaseDate: null, |
|||
issuingAgency: null, |
|||
content: null, |
|||
publishStatus: null, |
|||
removalReason: null, |
|||
}, |
|||
// 表单参数 |
|||
form: {}, |
|||
// 下架表单参数 |
|||
unpublishForm: { |
|||
removalReason: '' |
|||
}, |
|||
// 表单校验 |
|||
rules: { |
|||
title: [ |
|||
{ required: true, message: "标题不能为空", trigger: "blur" } |
|||
], |
|||
releaseDate: [ |
|||
{ required: true, message: "发布日期不能为空", trigger: "blur" } |
|||
], |
|||
issuingAgency: [ |
|||
{ required: true, message: "发布单位不能为空", trigger: "blur" } |
|||
] |
|||
}, |
|||
// 下架表单校验 |
|||
unpublishRules: { |
|||
removalReason: [ |
|||
{ required: true, message: "下架原因不能为空", trigger: "blur" }, |
|||
{ min: 2, max: 200, message: '长度在 2 到 200 个字符', trigger: 'blur' } |
|||
] |
|||
}, |
|||
// 当前操作的ID |
|||
currentId: null, |
|||
// 是否为批量操作 |
|||
isBatchUnpublish: false |
|||
} |
|||
}, |
|||
created() { |
|||
this.getList() |
|||
}, |
|||
methods: { |
|||
/** 查询政策解读列表 */ |
|||
getList() { |
|||
this.loading = true |
|||
listInterpretation(this.queryParams).then(response => { |
|||
this.interpretationList = response.rows |
|||
this.total = response.total |
|||
this.loading = false |
|||
}) |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false |
|||
this.reset() |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.form = { |
|||
id: null, |
|||
title: null, |
|||
policyFile: null, |
|||
releaseDate: null, |
|||
issuingAgency: null, |
|||
content: null, |
|||
publishStatus: "0", |
|||
removalReason: null, |
|||
delFlag: null, |
|||
createBy: null, |
|||
createTime: null, |
|||
updateBy: null, |
|||
updateTime: null, |
|||
remark: null |
|||
} |
|||
this.resetForm("form") |
|||
}, |
|||
// 下架表单重置 |
|||
resetUnpublishForm() { |
|||
this.unpublishForm = { |
|||
removalReason: '' |
|||
} |
|||
this.resetForm("unpublishForm") |
|||
this.currentId = null |
|||
this.isBatchUnpublish = false |
|||
}, |
|||
/** 搜索按钮操作 */ |
|||
handleQuery() { |
|||
this.queryParams.pageNum = 1 |
|||
this.getList() |
|||
}, |
|||
/** 重置按钮操作 */ |
|||
resetQuery() { |
|||
this.resetForm("queryForm") |
|||
this.handleQuery() |
|||
}, |
|||
// 多选框选中数据 |
|||
handleSelectionChange(selection) { |
|||
this.ids = selection.map(item => item.id) |
|||
this.single = selection.length !== 1 |
|||
this.multiple = !selection.length |
|||
}, |
|||
/** 新增按钮操作 */ |
|||
handleAdd() { |
|||
this.reset() |
|||
this.open = true |
|||
this.title = "添加政策解读" |
|||
}, |
|||
/** 修改按钮操作 */ |
|||
handleUpdate(row) { |
|||
this.reset() |
|||
const id = row.id || this.ids |
|||
getInterpretation(id).then(response => { |
|||
this.form = response.data |
|||
this.open = true |
|||
this.title = "修改政策解读" |
|||
}) |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate(valid => { |
|||
if (valid) { |
|||
if (this.form.id != null) { |
|||
updateInterpretation(this.form).then(response => { |
|||
this.$modal.msgSuccess("修改成功") |
|||
this.open = false |
|||
this.getList() |
|||
}) |
|||
} else { |
|||
addInterpretation(this.form).then(response => { |
|||
this.$modal.msgSuccess("新增成功") |
|||
this.open = false |
|||
this.getList() |
|||
}) |
|||
} |
|||
} |
|||
}) |
|||
}, |
|||
handleDownload(row) { |
|||
const downloadUrl = process.env.VUE_APP_BASE_API + row.policyFile; |
|||
|
|||
console.log('下载URL:', downloadUrl); |
|||
|
|||
window.open(downloadUrl, '_blank'); |
|||
|
|||
this.$modal.msgSuccess("开始下载"); |
|||
}, |
|||
/** 上架按钮操作 */ |
|||
handlePublish() { |
|||
const ids = this.ids |
|||
this.$modal.confirm('是否确认上架政策解读编号为"' + ids + '"的数据项?').then(function () { |
|||
return publishInterpretationBatch(ids) |
|||
}).then(() => { |
|||
this.getList() |
|||
this.$modal.msgSuccess("上架成功") |
|||
}).catch(() => { |
|||
}) |
|||
}, |
|||
/** 单个上架操作 */ |
|||
handleSinglePublish(row) { |
|||
const id = row.id |
|||
this.$modal.confirm('是否确认上架政策解读"' + row.title + '"?').then(function () { |
|||
return publishInterpretation(id) |
|||
}).then(() => { |
|||
this.getList() |
|||
this.$modal.msgSuccess("上架成功") |
|||
}).catch(() => { |
|||
}) |
|||
}, |
|||
/** 下架按钮操作 */ |
|||
handleUnpublish() { |
|||
this.resetUnpublishForm() |
|||
this.unpublishOpen = true |
|||
this.isBatchUnpublish = true |
|||
}, |
|||
/** 单个下架操作 */ |
|||
handleSingleUnpublish(row) { |
|||
this.resetUnpublishForm() |
|||
this.currentId = row.id |
|||
this.unpublishOpen = true |
|||
this.isBatchUnpublish = false |
|||
}, |
|||
/** 提交下架操作 */ |
|||
submitUnpublish() { |
|||
this.$refs["unpublishForm"].validate(valid => { |
|||
if (valid) { |
|||
if (this.isBatchUnpublish) { |
|||
// 批量下架 |
|||
const data = { |
|||
ids: this.ids, |
|||
removalReason: this.unpublishForm.removalReason |
|||
} |
|||
unpublishInterpretationBatch(data).then(() => { |
|||
this.$modal.msgSuccess("下架成功") |
|||
this.unpublishOpen = false |
|||
this.getList() |
|||
}) |
|||
} else { |
|||
// 单个下架 |
|||
const data = { |
|||
id: this.currentId, |
|||
removalReason: this.unpublishForm.removalReason |
|||
} |
|||
unpublishInterpretation(data).then(() => { |
|||
this.$modal.msgSuccess("下架成功") |
|||
this.unpublishOpen = false |
|||
this.getList() |
|||
}) |
|||
} |
|||
} |
|||
}) |
|||
}, |
|||
/** 删除按钮操作 */ |
|||
handleDelete(row) { |
|||
const ids = row.id || this.ids |
|||
this.$modal.confirm('是否确认删除政策解读编号为"' + ids + '"的数据项?').then(function () { |
|||
return delInterpretation(ids) |
|||
}).then(() => { |
|||
this.getList() |
|||
this.$modal.msgSuccess("删除成功") |
|||
}).catch(() => { |
|||
}) |
|||
}, |
|||
/** 导出按钮操作 */ |
|||
handleExport() { |
|||
this.download('system/interpretation/export', { |
|||
...this.queryParams |
|||
}, `policy_interpretation_${new Date().getTime()}.xlsx`) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.app-container { |
|||
padding: 20px; |
|||
} |
|||
|
|||
.el-table { |
|||
margin-top: 20px; |
|||
} |
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue