新增便签ruoyi-note模块
This commit is contained in:
8
pom.xml
8
pom.xml
@ -181,6 +181,13 @@
|
||||
<version>${ruoyi.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- note系统模块-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-note</artifactId>
|
||||
<version>${ruoyi.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
@ -199,6 +206,7 @@
|
||||
<module>ruoyi-generator</module>
|
||||
<module>ruoyi-common</module>
|
||||
<module>ruoyi-yunbookmark</module>
|
||||
<module>ruoyi-note</module>
|
||||
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
@ -0,0 +1,103 @@
|
||||
package com.ruoyi.web.controller.note;
|
||||
|
||||
import java.util.List;
|
||||
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.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.note.domain.NmNoteContent;
|
||||
import com.ruoyi.note.service.INmNoteContentService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 文章内容Controller
|
||||
*
|
||||
* @author wang
|
||||
* @date 2020-09-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/note/content")
|
||||
public class NmNoteContentController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private INmNoteContentService nmNoteContentService;
|
||||
|
||||
/**
|
||||
* 查询文章内容列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('note:content:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(NmNoteContent nmNoteContent)
|
||||
{
|
||||
startPage();
|
||||
List<NmNoteContent> list = nmNoteContentService.selectNmNoteContentList(nmNoteContent);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出文章内容列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('note:content:export')")
|
||||
@Log(title = "文章内容", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(NmNoteContent nmNoteContent)
|
||||
{
|
||||
List<NmNoteContent> list = nmNoteContentService.selectNmNoteContentList(nmNoteContent);
|
||||
ExcelUtil<NmNoteContent> util = new ExcelUtil<NmNoteContent>(NmNoteContent.class);
|
||||
return util.exportExcel(list, "content");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文章内容详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('note:content:query')")
|
||||
@GetMapping(value = "/{noteId}")
|
||||
public AjaxResult getInfo(@PathVariable("noteId") Long noteId)
|
||||
{
|
||||
return AjaxResult.success(nmNoteContentService.selectNmNoteContentById(noteId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文章内容
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('note:content:add')")
|
||||
@Log(title = "文章内容", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody NmNoteContent nmNoteContent)
|
||||
{
|
||||
return toAjax(nmNoteContentService.insertNmNoteContent(nmNoteContent));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文章内容
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('note:content:edit')")
|
||||
@Log(title = "文章内容", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody NmNoteContent nmNoteContent)
|
||||
{
|
||||
return toAjax(nmNoteContentService.updateNmNoteContent(nmNoteContent));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文章内容
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('note:content:remove')")
|
||||
@Log(title = "文章内容", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{noteIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] noteIds)
|
||||
{
|
||||
return toAjax(nmNoteContentService.deleteNmNoteContentByIds(noteIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,124 @@
|
||||
package com.ruoyi.web.controller.note;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
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.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.note.domain.NmNote;
|
||||
import com.ruoyi.note.service.INmNoteService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 便签管理Controller
|
||||
*
|
||||
* @author wang
|
||||
* @date 2020-09-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/note/note")
|
||||
public class NmNoteController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private INmNoteService nmNoteService;
|
||||
|
||||
|
||||
/**
|
||||
* 查看栏目下 用户的便签
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('note:note:list')")
|
||||
@GetMapping("/selectBymenuNote")
|
||||
public TableDataInfo selectBymenuNote(NmNote nmNote)
|
||||
{
|
||||
SysUser sysUser=getAuthUser();
|
||||
nmNote.setUserId(sysUser.getUserId());
|
||||
startPage();
|
||||
List<NmNote> list = nmNoteService.selectNmNoteList(nmNote);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询便签管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('note:note:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(NmNote nmNote)
|
||||
{
|
||||
startPage();
|
||||
List<NmNote> list = nmNoteService.selectNmNoteList(nmNote);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出便签管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('note:note:export')")
|
||||
@Log(title = "便签管理", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(NmNote nmNote)
|
||||
{
|
||||
List<NmNote> list = nmNoteService.selectNmNoteList(nmNote);
|
||||
ExcelUtil<NmNote> util = new ExcelUtil<NmNote>(NmNote.class);
|
||||
return util.exportExcel(list, "note");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取便签管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('note:note:query')")
|
||||
@GetMapping(value = "/{noteId}")
|
||||
public AjaxResult getInfo(@PathVariable("noteId") Long noteId)
|
||||
{
|
||||
return AjaxResult.success(nmNoteService.selectNmNoteById(noteId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增便签管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('note:note:add')")
|
||||
@Log(title = "便签管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody NmNote nmNote)
|
||||
{
|
||||
return toAjax(nmNoteService.insertNmNote(nmNote));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改便签管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('note:note:edit')")
|
||||
@Log(title = "便签管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody NmNote nmNote)
|
||||
{
|
||||
return toAjax(nmNoteService.updateNmNote(nmNote));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除便签管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('note:note:remove')")
|
||||
@Log(title = "便签管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{noteIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] noteIds)
|
||||
{
|
||||
return toAjax(nmNoteService.deleteNmNoteByIds(noteIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
package com.ruoyi.web.controller.note;
|
||||
|
||||
import java.util.List;
|
||||
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.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.note.domain.NmNoteTag;
|
||||
import com.ruoyi.note.service.INmNoteTagService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 便签标签Controller
|
||||
*
|
||||
* @author wang
|
||||
* @date 2020-09-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/note/tag")
|
||||
public class NmNoteTagController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private INmNoteTagService nmNoteTagService;
|
||||
|
||||
/**
|
||||
* 查询便签标签列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('note:tag:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(NmNoteTag nmNoteTag)
|
||||
{
|
||||
startPage();
|
||||
List<NmNoteTag> list = nmNoteTagService.selectNmNoteTagList(nmNoteTag);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出便签标签列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('note:tag:export')")
|
||||
@Log(title = "便签标签", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(NmNoteTag nmNoteTag)
|
||||
{
|
||||
List<NmNoteTag> list = nmNoteTagService.selectNmNoteTagList(nmNoteTag);
|
||||
ExcelUtil<NmNoteTag> util = new ExcelUtil<NmNoteTag>(NmNoteTag.class);
|
||||
return util.exportExcel(list, "tag");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取便签标签详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('note:tag:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(nmNoteTagService.selectNmNoteTagById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增便签标签
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('note:tag:add')")
|
||||
@Log(title = "便签标签", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody NmNoteTag nmNoteTag)
|
||||
{
|
||||
return toAjax(nmNoteTagService.insertNmNoteTag(nmNoteTag));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改便签标签
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('note:tag:edit')")
|
||||
@Log(title = "便签标签", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody NmNoteTag nmNoteTag)
|
||||
{
|
||||
return toAjax(nmNoteTagService.updateNmNoteTag(nmNoteTag));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除便签标签
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('note:tag:remove')")
|
||||
@Log(title = "便签标签", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(nmNoteTagService.deleteNmNoteTagByIds(ids));
|
||||
}
|
||||
}
|
@ -44,17 +44,7 @@ public class BaseController
|
||||
return user.getUser();
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @auther: Wang
|
||||
// * @date: 2020/08/17 20:19
|
||||
// * 功能描述:获取当前用户UserID
|
||||
// */
|
||||
// protected Long getAuthUserId()
|
||||
// {
|
||||
// Authentication auth = SecurityContextHolder.getContext().getAuthentication();
|
||||
// LoginUser user = (LoginUser) auth.getPrincipal();
|
||||
// return user.getUser().getUserId();
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* 将前台传递过来的日期格式的字符串,自动转化为Date类型
|
||||
|
@ -74,6 +74,12 @@
|
||||
<artifactId>ruoyi-yunbookmark</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 便签模块-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-note</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
28
ruoyi-note/pom.xml
Normal file
28
ruoyi-note/pom.xml
Normal file
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
<artifactId>ruoyi-note</artifactId>
|
||||
|
||||
<description>
|
||||
note系统模块
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
263
ruoyi-note/src/main/java/com/ruoyi/note/domain/NmNote.java
Normal file
263
ruoyi-note/src/main/java/com/ruoyi/note/domain/NmNote.java
Normal file
@ -0,0 +1,263 @@
|
||||
package com.ruoyi.note.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 便签管理对象 nm_note
|
||||
*
|
||||
* @author wang
|
||||
* @date 2020-09-12
|
||||
*/
|
||||
public class NmNote
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** Note便签ID */
|
||||
@Excel(name = "Note便签ID")
|
||||
private Long noteId;
|
||||
|
||||
/** 用户ID */
|
||||
@Excel(name = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/** 便签标题(自动截取) */
|
||||
@Excel(name = "便签标题(自动截取)")
|
||||
private String title;
|
||||
|
||||
/** 摘要(前50字) 循环展示 */
|
||||
@Excel(name = "摘要(前50字) 循环展示")
|
||||
private String description;
|
||||
|
||||
/** 所属分组Id */
|
||||
@Excel(name = "所属分组Id")
|
||||
private Integer menuId;
|
||||
|
||||
/** 背景颜色 '白','红','黄','蓝','紫' */
|
||||
@Excel(name = "背景颜色 '白','红','黄','蓝','紫'")
|
||||
private String background;
|
||||
|
||||
/** 字数 */
|
||||
@Excel(name = "字数")
|
||||
private Integer noteCount;
|
||||
|
||||
/** 排序(小到大) */
|
||||
@Excel(name = "排序(小到大)")
|
||||
private Integer noteSort;
|
||||
|
||||
/** 便签状态 */
|
||||
@Excel(name = "便签状态")
|
||||
private Integer isState;
|
||||
|
||||
/** 阅读进度 */
|
||||
@Excel(name = "阅读进度")
|
||||
private Integer readProgress;
|
||||
|
||||
/** 是否星标 */
|
||||
@Excel(name = "是否星标")
|
||||
private Integer isStar;
|
||||
|
||||
/** 是否删除 */
|
||||
@Excel(name = "是否删除")
|
||||
private Integer isDelete;
|
||||
|
||||
/** 是否置顶 */
|
||||
@Excel(name = "是否置顶")
|
||||
private Integer topFlag;
|
||||
|
||||
/** 是否分享(判断是否可以随意访问) */
|
||||
@Excel(name = "是否分享(判断是否可以随意访问)")
|
||||
private Integer isShare;
|
||||
|
||||
/** 是否加密 */
|
||||
@Excel(name = "是否加密")
|
||||
private Integer isEncryption;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
public void setNoteId(Long noteId)
|
||||
{
|
||||
this.noteId = noteId;
|
||||
}
|
||||
|
||||
public Long getNoteId()
|
||||
{
|
||||
return noteId;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setTitle(String title)
|
||||
{
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getTitle()
|
||||
{
|
||||
return title;
|
||||
}
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
public void setMenuId(Integer menuId)
|
||||
{
|
||||
this.menuId = menuId;
|
||||
}
|
||||
|
||||
public Integer getMenuId()
|
||||
{
|
||||
return menuId;
|
||||
}
|
||||
public void setBackground(String background)
|
||||
{
|
||||
this.background = background;
|
||||
}
|
||||
|
||||
public String getBackground()
|
||||
{
|
||||
return background;
|
||||
}
|
||||
public void setNoteCount(Integer noteCount)
|
||||
{
|
||||
this.noteCount = noteCount;
|
||||
}
|
||||
|
||||
public Integer getNoteCount()
|
||||
{
|
||||
return noteCount;
|
||||
}
|
||||
public void setNoteSort(Integer noteSort)
|
||||
{
|
||||
this.noteSort = noteSort;
|
||||
}
|
||||
|
||||
public Integer getNoteSort()
|
||||
{
|
||||
return noteSort;
|
||||
}
|
||||
public void setIsState(Integer isState)
|
||||
{
|
||||
this.isState = isState;
|
||||
}
|
||||
|
||||
public Integer getIsState()
|
||||
{
|
||||
return isState;
|
||||
}
|
||||
public void setReadProgress(Integer readProgress)
|
||||
{
|
||||
this.readProgress = readProgress;
|
||||
}
|
||||
|
||||
public Integer getReadProgress()
|
||||
{
|
||||
return readProgress;
|
||||
}
|
||||
public void setIsStar(Integer isStar)
|
||||
{
|
||||
this.isStar = isStar;
|
||||
}
|
||||
|
||||
public Integer getIsStar()
|
||||
{
|
||||
return isStar;
|
||||
}
|
||||
public void setIsDelete(Integer isDelete)
|
||||
{
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public Integer getIsDelete()
|
||||
{
|
||||
return isDelete;
|
||||
}
|
||||
public void setTopFlag(Integer topFlag)
|
||||
{
|
||||
this.topFlag = topFlag;
|
||||
}
|
||||
|
||||
public Integer getTopFlag()
|
||||
{
|
||||
return topFlag;
|
||||
}
|
||||
public void setIsShare(Integer isShare)
|
||||
{
|
||||
this.isShare = isShare;
|
||||
}
|
||||
|
||||
public Integer getIsShare()
|
||||
{
|
||||
return isShare;
|
||||
}
|
||||
public void setIsEncryption(Integer isEncryption)
|
||||
{
|
||||
this.isEncryption = isEncryption;
|
||||
}
|
||||
|
||||
public Integer getIsEncryption()
|
||||
{
|
||||
return isEncryption;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("noteId", getNoteId())
|
||||
.append("userId", getUserId())
|
||||
.append("title", getTitle())
|
||||
.append("description", getDescription())
|
||||
.append("menuId", getMenuId())
|
||||
.append("background", getBackground())
|
||||
.append("noteCount", getNoteCount())
|
||||
.append("noteSort", getNoteSort())
|
||||
.append("isState", getIsState())
|
||||
.append("readProgress", getReadProgress())
|
||||
.append("isStar", getIsStar())
|
||||
.append("isDelete", getIsDelete())
|
||||
.append("topFlag", getTopFlag())
|
||||
.append("isShare", getIsShare())
|
||||
.append("isEncryption", getIsEncryption())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.ruoyi.note.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 文章内容对象 nm_note_content
|
||||
*
|
||||
* @author wang
|
||||
* @date 2020-09-12
|
||||
*/
|
||||
public class NmNoteContent extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 便签主键ID */
|
||||
private Long noteId;
|
||||
|
||||
/** markdown编辑器内容 */
|
||||
@Excel(name = "markdown编辑器内容")
|
||||
private String markdownContent;
|
||||
|
||||
/** ueditor编辑器内容 */
|
||||
@Excel(name = "ueditor编辑器内容")
|
||||
private String ueditorContent;
|
||||
|
||||
public void setNoteId(Long noteId)
|
||||
{
|
||||
this.noteId = noteId;
|
||||
}
|
||||
|
||||
public Long getNoteId()
|
||||
{
|
||||
return noteId;
|
||||
}
|
||||
public void setMarkdownContent(String markdownContent)
|
||||
{
|
||||
this.markdownContent = markdownContent;
|
||||
}
|
||||
|
||||
public String getMarkdownContent()
|
||||
{
|
||||
return markdownContent;
|
||||
}
|
||||
public void setUeditorContent(String ueditorContent)
|
||||
{
|
||||
this.ueditorContent = ueditorContent;
|
||||
}
|
||||
|
||||
public String getUeditorContent()
|
||||
{
|
||||
return ueditorContent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("noteId", getNoteId())
|
||||
.append("markdownContent", getMarkdownContent())
|
||||
.append("ueditorContent", getUeditorContent())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.ruoyi.note.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 便签标签对象 nm_note_tag
|
||||
*
|
||||
* @author wang
|
||||
* @date 2020-09-12
|
||||
*/
|
||||
public class NmNoteTag extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
private Long id;
|
||||
|
||||
/** 便签id */
|
||||
@Excel(name = "便签id")
|
||||
private Long noteId;
|
||||
|
||||
/** 标签Id */
|
||||
@Excel(name = "标签Id")
|
||||
private Long tagId;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setNoteId(Long noteId)
|
||||
{
|
||||
this.noteId = noteId;
|
||||
}
|
||||
|
||||
public Long getNoteId()
|
||||
{
|
||||
return noteId;
|
||||
}
|
||||
public void setTagId(Long tagId)
|
||||
{
|
||||
this.tagId = tagId;
|
||||
}
|
||||
|
||||
public Long getTagId()
|
||||
{
|
||||
return tagId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("noteId", getNoteId())
|
||||
.append("tagId", getTagId())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.note.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.note.domain.NmNoteContent;
|
||||
|
||||
/**
|
||||
* 文章内容Mapper接口
|
||||
*
|
||||
* @author wang
|
||||
* @date 2020-09-12
|
||||
*/
|
||||
public interface NmNoteContentMapper
|
||||
{
|
||||
/**
|
||||
* 查询文章内容
|
||||
*
|
||||
* @param noteId 文章内容ID
|
||||
* @return 文章内容
|
||||
*/
|
||||
public NmNoteContent selectNmNoteContentById(Long noteId);
|
||||
|
||||
/**
|
||||
* 查询文章内容列表
|
||||
*
|
||||
* @param nmNoteContent 文章内容
|
||||
* @return 文章内容集合
|
||||
*/
|
||||
public List<NmNoteContent> selectNmNoteContentList(NmNoteContent nmNoteContent);
|
||||
|
||||
/**
|
||||
* 新增文章内容
|
||||
*
|
||||
* @param nmNoteContent 文章内容
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertNmNoteContent(NmNoteContent nmNoteContent);
|
||||
|
||||
/**
|
||||
* 修改文章内容
|
||||
*
|
||||
* @param nmNoteContent 文章内容
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateNmNoteContent(NmNoteContent nmNoteContent);
|
||||
|
||||
/**
|
||||
* 删除文章内容
|
||||
*
|
||||
* @param noteId 文章内容ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNmNoteContentById(Long noteId);
|
||||
|
||||
/**
|
||||
* 批量删除文章内容
|
||||
*
|
||||
* @param noteIds 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNmNoteContentByIds(Long[] noteIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.note.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.note.domain.NmNote;
|
||||
|
||||
/**
|
||||
* 便签管理Mapper接口
|
||||
*
|
||||
* @author wang
|
||||
* @date 2020-09-12
|
||||
*/
|
||||
public interface NmNoteMapper
|
||||
{
|
||||
/**
|
||||
* 查询便签管理
|
||||
*
|
||||
* @param noteId 便签管理ID
|
||||
* @return 便签管理
|
||||
*/
|
||||
public NmNote selectNmNoteById(Long noteId);
|
||||
|
||||
/**
|
||||
* 查询便签管理列表
|
||||
*
|
||||
* @param nmNote 便签管理
|
||||
* @return 便签管理集合
|
||||
*/
|
||||
public List<NmNote> selectNmNoteList(NmNote nmNote);
|
||||
|
||||
/**
|
||||
* 新增便签管理
|
||||
*
|
||||
* @param nmNote 便签管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertNmNote(NmNote nmNote);
|
||||
|
||||
/**
|
||||
* 修改便签管理
|
||||
*
|
||||
* @param nmNote 便签管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateNmNote(NmNote nmNote);
|
||||
|
||||
/**
|
||||
* 删除便签管理
|
||||
*
|
||||
* @param noteId 便签管理ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNmNoteById(Long noteId);
|
||||
|
||||
/**
|
||||
* 批量删除便签管理
|
||||
*
|
||||
* @param noteIds 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNmNoteByIds(Long[] noteIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.note.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.note.domain.NmNoteTag;
|
||||
|
||||
/**
|
||||
* 便签标签Mapper接口
|
||||
*
|
||||
* @author wang
|
||||
* @date 2020-09-12
|
||||
*/
|
||||
public interface NmNoteTagMapper
|
||||
{
|
||||
/**
|
||||
* 查询便签标签
|
||||
*
|
||||
* @param id 便签标签ID
|
||||
* @return 便签标签
|
||||
*/
|
||||
public NmNoteTag selectNmNoteTagById(Long id);
|
||||
|
||||
/**
|
||||
* 查询便签标签列表
|
||||
*
|
||||
* @param nmNoteTag 便签标签
|
||||
* @return 便签标签集合
|
||||
*/
|
||||
public List<NmNoteTag> selectNmNoteTagList(NmNoteTag nmNoteTag);
|
||||
|
||||
/**
|
||||
* 新增便签标签
|
||||
*
|
||||
* @param nmNoteTag 便签标签
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertNmNoteTag(NmNoteTag nmNoteTag);
|
||||
|
||||
/**
|
||||
* 修改便签标签
|
||||
*
|
||||
* @param nmNoteTag 便签标签
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateNmNoteTag(NmNoteTag nmNoteTag);
|
||||
|
||||
/**
|
||||
* 删除便签标签
|
||||
*
|
||||
* @param id 便签标签ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNmNoteTagById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除便签标签
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNmNoteTagByIds(Long[] ids);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.note.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.note.domain.NmNoteContent;
|
||||
|
||||
/**
|
||||
* 文章内容Service接口
|
||||
*
|
||||
* @author wang
|
||||
* @date 2020-09-12
|
||||
*/
|
||||
public interface INmNoteContentService
|
||||
{
|
||||
/**
|
||||
* 查询文章内容
|
||||
*
|
||||
* @param noteId 文章内容ID
|
||||
* @return 文章内容
|
||||
*/
|
||||
public NmNoteContent selectNmNoteContentById(Long noteId);
|
||||
|
||||
/**
|
||||
* 查询文章内容列表
|
||||
*
|
||||
* @param nmNoteContent 文章内容
|
||||
* @return 文章内容集合
|
||||
*/
|
||||
public List<NmNoteContent> selectNmNoteContentList(NmNoteContent nmNoteContent);
|
||||
|
||||
/**
|
||||
* 新增文章内容
|
||||
*
|
||||
* @param nmNoteContent 文章内容
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertNmNoteContent(NmNoteContent nmNoteContent);
|
||||
|
||||
/**
|
||||
* 修改文章内容
|
||||
*
|
||||
* @param nmNoteContent 文章内容
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateNmNoteContent(NmNoteContent nmNoteContent);
|
||||
|
||||
/**
|
||||
* 批量删除文章内容
|
||||
*
|
||||
* @param noteIds 需要删除的文章内容ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNmNoteContentByIds(Long[] noteIds);
|
||||
|
||||
/**
|
||||
* 删除文章内容信息
|
||||
*
|
||||
* @param noteId 文章内容ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNmNoteContentById(Long noteId);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.note.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.note.domain.NmNote;
|
||||
|
||||
/**
|
||||
* 便签管理Service接口
|
||||
*
|
||||
* @author wang
|
||||
* @date 2020-09-12
|
||||
*/
|
||||
public interface INmNoteService
|
||||
{
|
||||
/**
|
||||
* 查询便签管理
|
||||
*
|
||||
* @param noteId 便签管理ID
|
||||
* @return 便签管理
|
||||
*/
|
||||
public NmNote selectNmNoteById(Long noteId);
|
||||
|
||||
/**
|
||||
* 查询便签管理列表
|
||||
*
|
||||
* @param nmNote 便签管理
|
||||
* @return 便签管理集合
|
||||
*/
|
||||
public List<NmNote> selectNmNoteList(NmNote nmNote);
|
||||
|
||||
/**
|
||||
* 新增便签管理
|
||||
*
|
||||
* @param nmNote 便签管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertNmNote(NmNote nmNote);
|
||||
|
||||
/**
|
||||
* 修改便签管理
|
||||
*
|
||||
* @param nmNote 便签管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateNmNote(NmNote nmNote);
|
||||
|
||||
/**
|
||||
* 批量删除便签管理
|
||||
*
|
||||
* @param noteIds 需要删除的便签管理ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNmNoteByIds(Long[] noteIds);
|
||||
|
||||
/**
|
||||
* 删除便签管理信息
|
||||
*
|
||||
* @param noteId 便签管理ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNmNoteById(Long noteId);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.note.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.note.domain.NmNoteTag;
|
||||
|
||||
/**
|
||||
* 便签标签Service接口
|
||||
*
|
||||
* @author wang
|
||||
* @date 2020-09-12
|
||||
*/
|
||||
public interface INmNoteTagService
|
||||
{
|
||||
/**
|
||||
* 查询便签标签
|
||||
*
|
||||
* @param id 便签标签ID
|
||||
* @return 便签标签
|
||||
*/
|
||||
public NmNoteTag selectNmNoteTagById(Long id);
|
||||
|
||||
/**
|
||||
* 查询便签标签列表
|
||||
*
|
||||
* @param nmNoteTag 便签标签
|
||||
* @return 便签标签集合
|
||||
*/
|
||||
public List<NmNoteTag> selectNmNoteTagList(NmNoteTag nmNoteTag);
|
||||
|
||||
/**
|
||||
* 新增便签标签
|
||||
*
|
||||
* @param nmNoteTag 便签标签
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertNmNoteTag(NmNoteTag nmNoteTag);
|
||||
|
||||
/**
|
||||
* 修改便签标签
|
||||
*
|
||||
* @param nmNoteTag 便签标签
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateNmNoteTag(NmNoteTag nmNoteTag);
|
||||
|
||||
/**
|
||||
* 批量删除便签标签
|
||||
*
|
||||
* @param ids 需要删除的便签标签ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNmNoteTagByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除便签标签信息
|
||||
*
|
||||
* @param id 便签标签ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNmNoteTagById(Long id);
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package com.ruoyi.note.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.note.mapper.NmNoteContentMapper;
|
||||
import com.ruoyi.note.domain.NmNoteContent;
|
||||
import com.ruoyi.note.service.INmNoteContentService;
|
||||
|
||||
/**
|
||||
* 文章内容Service业务层处理
|
||||
*
|
||||
* @author wang
|
||||
* @date 2020-09-12
|
||||
*/
|
||||
@Service
|
||||
public class NmNoteContentServiceImpl implements INmNoteContentService
|
||||
{
|
||||
@Autowired
|
||||
private NmNoteContentMapper nmNoteContentMapper;
|
||||
|
||||
/**
|
||||
* 查询文章内容
|
||||
*
|
||||
* @param noteId 文章内容ID
|
||||
* @return 文章内容
|
||||
*/
|
||||
@Override
|
||||
public NmNoteContent selectNmNoteContentById(Long noteId)
|
||||
{
|
||||
return nmNoteContentMapper.selectNmNoteContentById(noteId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文章内容列表
|
||||
*
|
||||
* @param nmNoteContent 文章内容
|
||||
* @return 文章内容
|
||||
*/
|
||||
@Override
|
||||
public List<NmNoteContent> selectNmNoteContentList(NmNoteContent nmNoteContent)
|
||||
{
|
||||
return nmNoteContentMapper.selectNmNoteContentList(nmNoteContent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文章内容
|
||||
*
|
||||
* @param nmNoteContent 文章内容
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertNmNoteContent(NmNoteContent nmNoteContent)
|
||||
{
|
||||
return nmNoteContentMapper.insertNmNoteContent(nmNoteContent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文章内容
|
||||
*
|
||||
* @param nmNoteContent 文章内容
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateNmNoteContent(NmNoteContent nmNoteContent)
|
||||
{
|
||||
return nmNoteContentMapper.updateNmNoteContent(nmNoteContent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文章内容
|
||||
*
|
||||
* @param noteIds 需要删除的文章内容ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteNmNoteContentByIds(Long[] noteIds)
|
||||
{
|
||||
return nmNoteContentMapper.deleteNmNoteContentByIds(noteIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文章内容信息
|
||||
*
|
||||
* @param noteId 文章内容ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteNmNoteContentById(Long noteId)
|
||||
{
|
||||
return nmNoteContentMapper.deleteNmNoteContentById(noteId);
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.ruoyi.note.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.note.mapper.NmNoteMapper;
|
||||
import com.ruoyi.note.domain.NmNote;
|
||||
import com.ruoyi.note.service.INmNoteService;
|
||||
|
||||
/**
|
||||
* 便签管理Service业务层处理
|
||||
*
|
||||
* @author wang
|
||||
* @date 2020-09-12
|
||||
*/
|
||||
@Service
|
||||
public class NmNoteServiceImpl implements INmNoteService
|
||||
{
|
||||
@Autowired
|
||||
private NmNoteMapper nmNoteMapper;
|
||||
|
||||
/**
|
||||
* 查询便签管理
|
||||
*
|
||||
* @param noteId 便签管理ID
|
||||
* @return 便签管理
|
||||
*/
|
||||
@Override
|
||||
public NmNote selectNmNoteById(Long noteId)
|
||||
{
|
||||
return nmNoteMapper.selectNmNoteById(noteId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询便签管理列表
|
||||
*
|
||||
* @param nmNote 便签管理
|
||||
* @return 便签管理
|
||||
*/
|
||||
@Override
|
||||
public List<NmNote> selectNmNoteList(NmNote nmNote)
|
||||
{
|
||||
return nmNoteMapper.selectNmNoteList(nmNote);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增便签管理
|
||||
*
|
||||
* @param nmNote 便签管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertNmNote(NmNote nmNote)
|
||||
{
|
||||
nmNote.setCreateTime(DateUtils.getNowDate());
|
||||
return nmNoteMapper.insertNmNote(nmNote);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改便签管理
|
||||
*
|
||||
* @param nmNote 便签管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateNmNote(NmNote nmNote)
|
||||
{
|
||||
nmNote.setUpdateTime(DateUtils.getNowDate());
|
||||
return nmNoteMapper.updateNmNote(nmNote);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除便签管理
|
||||
*
|
||||
* @param noteIds 需要删除的便签管理ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteNmNoteByIds(Long[] noteIds)
|
||||
{
|
||||
return nmNoteMapper.deleteNmNoteByIds(noteIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除便签管理信息
|
||||
*
|
||||
* @param noteId 便签管理ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteNmNoteById(Long noteId)
|
||||
{
|
||||
return nmNoteMapper.deleteNmNoteById(noteId);
|
||||
}
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package com.ruoyi.note.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.note.mapper.NmNoteTagMapper;
|
||||
import com.ruoyi.note.domain.NmNoteTag;
|
||||
import com.ruoyi.note.service.INmNoteTagService;
|
||||
|
||||
/**
|
||||
* 便签标签Service业务层处理
|
||||
*
|
||||
* @author wang
|
||||
* @date 2020-09-12
|
||||
*/
|
||||
@Service
|
||||
public class NmNoteTagServiceImpl implements INmNoteTagService
|
||||
{
|
||||
@Autowired
|
||||
private NmNoteTagMapper nmNoteTagMapper;
|
||||
|
||||
/**
|
||||
* 查询便签标签
|
||||
*
|
||||
* @param id 便签标签ID
|
||||
* @return 便签标签
|
||||
*/
|
||||
@Override
|
||||
public NmNoteTag selectNmNoteTagById(Long id)
|
||||
{
|
||||
return nmNoteTagMapper.selectNmNoteTagById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询便签标签列表
|
||||
*
|
||||
* @param nmNoteTag 便签标签
|
||||
* @return 便签标签
|
||||
*/
|
||||
@Override
|
||||
public List<NmNoteTag> selectNmNoteTagList(NmNoteTag nmNoteTag)
|
||||
{
|
||||
return nmNoteTagMapper.selectNmNoteTagList(nmNoteTag);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增便签标签
|
||||
*
|
||||
* @param nmNoteTag 便签标签
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertNmNoteTag(NmNoteTag nmNoteTag)
|
||||
{
|
||||
return nmNoteTagMapper.insertNmNoteTag(nmNoteTag);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改便签标签
|
||||
*
|
||||
* @param nmNoteTag 便签标签
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateNmNoteTag(NmNoteTag nmNoteTag)
|
||||
{
|
||||
return nmNoteTagMapper.updateNmNoteTag(nmNoteTag);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除便签标签
|
||||
*
|
||||
* @param ids 需要删除的便签标签ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteNmNoteTagByIds(Long[] ids)
|
||||
{
|
||||
return nmNoteTagMapper.deleteNmNoteTagByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除便签标签信息
|
||||
*
|
||||
* @param id 便签标签ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteNmNoteTagById(Long id)
|
||||
{
|
||||
return nmNoteTagMapper.deleteNmNoteTagById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.note.mapper.NmNoteContentMapper">
|
||||
|
||||
<resultMap type="NmNoteContent" id="NmNoteContentResult">
|
||||
<result property="noteId" column="note_id" />
|
||||
<result property="markdownContent" column="markdown_content" />
|
||||
<result property="ueditorContent" column="ueditor_content" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectNmNoteContentVo">
|
||||
select note_id, markdown_content, ueditor_content from nm_note_content
|
||||
</sql>
|
||||
|
||||
<select id="selectNmNoteContentList" parameterType="NmNoteContent" resultMap="NmNoteContentResult">
|
||||
<include refid="selectNmNoteContentVo"/>
|
||||
<where>
|
||||
<if test="noteId != null "> and note_id = #{noteId}</if>
|
||||
<if test="markdownContent != null and markdownContent != ''"> and markdown_content = #{markdownContent}</if>
|
||||
<if test="ueditorContent != null and ueditorContent != ''"> and ueditor_content = #{ueditorContent}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectNmNoteContentById" parameterType="Long" resultMap="NmNoteContentResult">
|
||||
<include refid="selectNmNoteContentVo"/>
|
||||
where note_id = #{noteId}
|
||||
</select>
|
||||
|
||||
<insert id="insertNmNoteContent" parameterType="NmNoteContent">
|
||||
insert into nm_note_content
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="noteId != null">note_id,</if>
|
||||
<if test="markdownContent != null">markdown_content,</if>
|
||||
<if test="ueditorContent != null">ueditor_content,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="noteId != null">#{noteId},</if>
|
||||
<if test="markdownContent != null">#{markdownContent},</if>
|
||||
<if test="ueditorContent != null">#{ueditorContent},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateNmNoteContent" parameterType="NmNoteContent">
|
||||
update nm_note_content
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="markdownContent != null">markdown_content = #{markdownContent},</if>
|
||||
<if test="ueditorContent != null">ueditor_content = #{ueditorContent},</if>
|
||||
</trim>
|
||||
where note_id = #{noteId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteNmNoteContentById" parameterType="Long">
|
||||
delete from nm_note_content where note_id = #{noteId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteNmNoteContentByIds" parameterType="String">
|
||||
delete from nm_note_content where note_id in
|
||||
<foreach item="noteId" collection="array" open="(" separator="," close=")">
|
||||
#{noteId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
134
ruoyi-note/src/main/resources/mapper/note/NmNoteMapper.xml
Normal file
134
ruoyi-note/src/main/resources/mapper/note/NmNoteMapper.xml
Normal file
@ -0,0 +1,134 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.note.mapper.NmNoteMapper">
|
||||
|
||||
<resultMap type="NmNote" id="NmNoteResult">
|
||||
<result property="noteId" column="note_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="title" column="title" />
|
||||
<result property="description" column="description" />
|
||||
<result property="menuId" column="menu_id" />
|
||||
<result property="background" column="background" />
|
||||
<result property="noteCount" column="note_count" />
|
||||
<result property="noteSort" column="note_sort" />
|
||||
<result property="isState" column="is_state" />
|
||||
<result property="readProgress" column="read_progress" />
|
||||
<result property="isStar" column="is_star" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
<result property="topFlag" column="top_flag" />
|
||||
<result property="isShare" column="is_share" />
|
||||
<result property="isEncryption" column="is_encryption" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectNmNoteVo">
|
||||
select note_id, user_id, title, description, menu_id, background, note_count, note_sort, is_state, read_progress, is_star, is_delete, top_flag, is_share, is_encryption, create_time, update_time from nm_note
|
||||
</sql>
|
||||
|
||||
<select id="selectNmNoteList" parameterType="NmNote" resultMap="NmNoteResult">
|
||||
<include refid="selectNmNoteVo"/>
|
||||
<where>
|
||||
<if test="noteId != null "> and note_id = #{noteId}</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
<if test="menuId != null "> and menu_id = #{menuId}</if>
|
||||
<if test="background != null and background != ''"> and background = #{background}</if>
|
||||
<if test="noteCount != null "> and note_count = #{noteCount}</if>
|
||||
<if test="noteSort != null "> and note_sort = #{noteSort}</if>
|
||||
<if test="isState != null "> and is_state = #{isState}</if>
|
||||
<if test="readProgress != null "> and read_progress = #{readProgress}</if>
|
||||
<if test="isStar != null "> and is_star = #{isStar}</if>
|
||||
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
|
||||
<if test="topFlag != null "> and top_flag = #{topFlag}</if>
|
||||
<if test="isShare != null "> and is_share = #{isShare}</if>
|
||||
<if test="isEncryption != null "> and is_encryption = #{isEncryption}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectNmNoteById" parameterType="Long" resultMap="NmNoteResult">
|
||||
<include refid="selectNmNoteVo"/>
|
||||
where note_id = #{noteId}
|
||||
</select>
|
||||
|
||||
<insert id="insertNmNote" parameterType="NmNote">
|
||||
insert into nm_note
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="noteId != null">note_id,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="title != null">title,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="menuId != null">menu_id,</if>
|
||||
<if test="background != null">background,</if>
|
||||
<if test="noteCount != null">note_count,</if>
|
||||
<if test="noteSort != null">note_sort,</if>
|
||||
<if test="isState != null">is_state,</if>
|
||||
<if test="readProgress != null">read_progress,</if>
|
||||
<if test="isStar != null">is_star,</if>
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
<if test="topFlag != null">top_flag,</if>
|
||||
<if test="isShare != null">is_share,</if>
|
||||
<if test="isEncryption != null">is_encryption,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="noteId != null">#{noteId},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="title != null">#{title},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="menuId != null">#{menuId},</if>
|
||||
<if test="background != null">#{background},</if>
|
||||
<if test="noteCount != null">#{noteCount},</if>
|
||||
<if test="noteSort != null">#{noteSort},</if>
|
||||
<if test="isState != null">#{isState},</if>
|
||||
<if test="readProgress != null">#{readProgress},</if>
|
||||
<if test="isStar != null">#{isStar},</if>
|
||||
<if test="isDelete != null">#{isDelete},</if>
|
||||
<if test="topFlag != null">#{topFlag},</if>
|
||||
<if test="isShare != null">#{isShare},</if>
|
||||
<if test="isEncryption != null">#{isEncryption},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateNmNote" parameterType="NmNote">
|
||||
update nm_note
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="title != null">title = #{title},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="menuId != null">menu_id = #{menuId},</if>
|
||||
<if test="background != null">background = #{background},</if>
|
||||
<if test="noteCount != null">note_count = #{noteCount},</if>
|
||||
<if test="noteSort != null">note_sort = #{noteSort},</if>
|
||||
<if test="isState != null">is_state = #{isState},</if>
|
||||
<if test="readProgress != null">read_progress = #{readProgress},</if>
|
||||
<if test="isStar != null">is_star = #{isStar},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
<if test="topFlag != null">top_flag = #{topFlag},</if>
|
||||
<if test="isShare != null">is_share = #{isShare},</if>
|
||||
<if test="isEncryption != null">is_encryption = #{isEncryption},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where note_id = #{noteId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteNmNoteById" parameterType="Long">
|
||||
delete from nm_note where note_id = #{noteId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteNmNoteByIds" parameterType="String">
|
||||
delete from nm_note where note_id in
|
||||
<foreach item="noteId" collection="array" open="(" separator="," close=")">
|
||||
#{noteId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.note.mapper.NmNoteTagMapper">
|
||||
|
||||
<resultMap type="NmNoteTag" id="NmNoteTagResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="noteId" column="note_id" />
|
||||
<result property="tagId" column="tag_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectNmNoteTagVo">
|
||||
select id, note_id, tag_id from nm_note_tag
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="selectNmNoteTagList" parameterType="NmNoteTag" resultMap="NmNoteTagResult">
|
||||
<include refid="selectNmNoteTagVo"/>
|
||||
<where>
|
||||
<if test="noteId != null "> and note_id = #{noteId}</if>
|
||||
<if test="tagId != null "> and tag_id = #{tagId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectNmNoteTagById" parameterType="Long" resultMap="NmNoteTagResult">
|
||||
<include refid="selectNmNoteTagVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertNmNoteTag" parameterType="NmNoteTag" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into nm_note_tag
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="noteId != null">note_id,</if>
|
||||
<if test="tagId != null">tag_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="noteId != null">#{noteId},</if>
|
||||
<if test="tagId != null">#{tagId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateNmNoteTag" parameterType="NmNoteTag">
|
||||
update nm_note_tag
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="noteId != null">note_id = #{noteId},</if>
|
||||
<if test="tagId != null">tag_id = #{tagId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteNmNoteTagById" parameterType="Long">
|
||||
delete from nm_note_tag where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteNmNoteTagByIds" parameterType="String">
|
||||
delete from nm_note_tag where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
53
ruoyi-ui/src/api/note/content.js
Normal file
53
ruoyi-ui/src/api/note/content.js
Normal file
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询文章内容列表
|
||||
export function listContent(query) {
|
||||
return request({
|
||||
url: '/note/content/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询文章内容详细
|
||||
export function getContent(noteId) {
|
||||
return request({
|
||||
url: '/note/content/' + noteId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增文章内容
|
||||
export function addContent(data) {
|
||||
return request({
|
||||
url: '/note/content',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改文章内容
|
||||
export function updateContent(data) {
|
||||
return request({
|
||||
url: '/note/content',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除文章内容
|
||||
export function delContent(noteId) {
|
||||
return request({
|
||||
url: '/note/content/' + noteId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出文章内容
|
||||
export function exportContent(query) {
|
||||
return request({
|
||||
url: '/note/content/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
53
ruoyi-ui/src/api/note/note.js
Normal file
53
ruoyi-ui/src/api/note/note.js
Normal file
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询便签管理列表
|
||||
export function listNote(query) {
|
||||
return request({
|
||||
url: '/note/note/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询便签管理详细
|
||||
export function getNote(noteId) {
|
||||
return request({
|
||||
url: '/note/note/' + noteId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增便签管理
|
||||
export function addNote(data) {
|
||||
return request({
|
||||
url: '/note/note',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改便签管理
|
||||
export function updateNote(data) {
|
||||
return request({
|
||||
url: '/note/note',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除便签管理
|
||||
export function delNote(noteId) {
|
||||
return request({
|
||||
url: '/note/note/' + noteId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出便签管理
|
||||
export function exportNote(query) {
|
||||
return request({
|
||||
url: '/note/note/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
53
ruoyi-ui/src/api/note/tag.js
Normal file
53
ruoyi-ui/src/api/note/tag.js
Normal file
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询便签标签列表
|
||||
export function listTag(query) {
|
||||
return request({
|
||||
url: '/note/tag/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询便签标签详细
|
||||
export function getTag(id) {
|
||||
return request({
|
||||
url: '/note/tag/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增便签标签
|
||||
export function addTag(data) {
|
||||
return request({
|
||||
url: '/note/tag',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改便签标签
|
||||
export function updateTag(data) {
|
||||
return request({
|
||||
url: '/note/tag',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除便签标签
|
||||
export function delTag(id) {
|
||||
return request({
|
||||
url: '/note/tag/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出便签标签
|
||||
export function exportTag(query) {
|
||||
return request({
|
||||
url: '/note/tag/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
279
ruoyi-ui/src/views/note/content/index.vue
Normal file
279
ruoyi-ui/src/views/note/content/index.vue
Normal file
@ -0,0 +1,279 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
||||
<el-form-item label="便签主键ID" prop="noteId">
|
||||
<el-input
|
||||
v-model="queryParams.noteId"
|
||||
placeholder="请输入便签主键ID"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="markdown编辑器内容" prop="markdownContent">
|
||||
<el-input
|
||||
v-model="queryParams.markdownContent"
|
||||
placeholder="请输入markdown编辑器内容"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="ueditor编辑器内容" prop="ueditorContent">
|
||||
<el-input
|
||||
v-model="queryParams.ueditorContent"
|
||||
placeholder="请输入ueditor编辑器内容"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['note:content:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['note:content:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['note:content:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['note:content:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="contentList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="便签主键ID" align="center" prop="noteId" />
|
||||
<el-table-column label="markdown编辑器内容" align="center" prop="markdownContent" />
|
||||
<el-table-column label="ueditor编辑器内容" align="center" prop="ueditorContent" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['note:content:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['note:content:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改文章内容对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="markdown编辑器内容" prop="markdownContent">
|
||||
<el-input v-model="form.markdownContent" placeholder="请输入markdown编辑器内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="ueditor编辑器内容" prop="ueditorContent">
|
||||
<el-input v-model="form.ueditorContent" placeholder="请输入ueditor编辑器内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listContent, getContent, delContent, addContent, updateContent, exportContent } from "@/api/note/content";
|
||||
|
||||
export default {
|
||||
name: "Content",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 文章内容表格数据
|
||||
contentList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
noteId: undefined,
|
||||
markdownContent: undefined,
|
||||
ueditorContent: undefined
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询文章内容列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listContent(this.queryParams).then(response => {
|
||||
this.contentList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
noteId: undefined,
|
||||
markdownContent: undefined,
|
||||
ueditorContent: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.noteId)
|
||||
this.single = selection.length!=1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加文章内容";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const noteId = row.noteId || this.ids
|
||||
getContent(noteId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改文章内容";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.noteId != undefined) {
|
||||
updateContent(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addContent(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const noteIds = row.noteId || this.ids;
|
||||
this.$confirm('是否确认删除文章内容编号为"' + noteIds + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return delContent(noteIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(function() {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$confirm('是否确认导出所有文章内容数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return exportContent(queryParams);
|
||||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
}).catch(function() {});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
539
ruoyi-ui/src/views/note/note/index.vue
Normal file
539
ruoyi-ui/src/views/note/note/index.vue
Normal file
@ -0,0 +1,539 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
||||
<el-form-item label="Note便签ID" prop="noteId">
|
||||
<el-input
|
||||
v-model="queryParams.noteId"
|
||||
placeholder="请输入Note便签ID"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户ID" prop="userId">
|
||||
<el-input
|
||||
v-model="queryParams.userId"
|
||||
placeholder="请输入用户ID"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="便签标题(自动截取)" prop="title">
|
||||
<el-input
|
||||
v-model="queryParams.title"
|
||||
placeholder="请输入便签标题(自动截取)"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="摘要(前50字) 循环展示" prop="description">
|
||||
<el-input
|
||||
v-model="queryParams.description"
|
||||
placeholder="请输入摘要(前50字) 循环展示"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属分组Id" prop="menuId">
|
||||
<el-input
|
||||
v-model="queryParams.menuId"
|
||||
placeholder="请输入所属分组Id"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="背景颜色 '白','红','黄','蓝','紫'" prop="background">
|
||||
<el-select v-model="queryParams.background" placeholder="请选择背景颜色 '白','红','黄','蓝','紫'" clearable size="small">
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="字数" prop="noteCount">
|
||||
<el-input
|
||||
v-model="queryParams.noteCount"
|
||||
placeholder="请输入字数"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序(小到大)" prop="noteSort">
|
||||
<el-input
|
||||
v-model="queryParams.noteSort"
|
||||
placeholder="请输入排序(小到大)"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="便签状态" prop="isState">
|
||||
<el-input
|
||||
v-model="queryParams.isState"
|
||||
placeholder="请输入便签状态"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="阅读进度" prop="readProgress">
|
||||
<el-input
|
||||
v-model="queryParams.readProgress"
|
||||
placeholder="请输入阅读进度"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否星标" prop="isStar">
|
||||
<el-select v-model="queryParams.isStar" placeholder="请选择是否星标" clearable size="small">
|
||||
<el-option
|
||||
v-for="dict in isStarOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否删除" prop="isDelete">
|
||||
<el-select v-model="queryParams.isDelete" placeholder="请选择是否删除" clearable size="small">
|
||||
<el-option
|
||||
v-for="dict in isDeleteOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否置顶" prop="topFlag">
|
||||
<el-select v-model="queryParams.topFlag" placeholder="请选择是否置顶" clearable size="small">
|
||||
<el-option
|
||||
v-for="dict in topFlagOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否分享(判断是否可以随意访问)" prop="isShare">
|
||||
<el-select v-model="queryParams.isShare" placeholder="请选择是否分享(判断是否可以随意访问)" clearable size="small">
|
||||
<el-option
|
||||
v-for="dict in isShareOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否加密" prop="isEncryption">
|
||||
<el-select v-model="queryParams.isEncryption" placeholder="请选择是否加密" clearable size="small">
|
||||
<el-option
|
||||
v-for="dict in isEncryptionOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</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"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['note:note:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['note:note:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['note:note:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['note:note:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="noteList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="Note便签ID" align="center" prop="noteId" />
|
||||
<el-table-column label="用户ID" align="center" prop="userId" />
|
||||
<el-table-column label="便签标题(自动截取)" align="center" prop="title" />
|
||||
<el-table-column label="摘要(前50字) 循环展示" align="center" prop="description" />
|
||||
<el-table-column label="所属分组Id" align="center" prop="menuId" />
|
||||
<el-table-column label="背景颜色 '白','红','黄','蓝','紫'" align="center" prop="background" />
|
||||
<el-table-column label="字数" align="center" prop="noteCount" />
|
||||
<el-table-column label="排序(小到大)" align="center" prop="noteSort" />
|
||||
<el-table-column label="便签状态" align="center" prop="isState" />
|
||||
<el-table-column label="阅读进度" align="center" prop="readProgress" />
|
||||
<el-table-column label="是否星标" align="center" prop="isStar" :formatter="isStarFormat" />
|
||||
<el-table-column label="是否删除" align="center" prop="isDelete" :formatter="isDeleteFormat" />
|
||||
<el-table-column label="是否置顶" align="center" prop="topFlag" :formatter="topFlagFormat" />
|
||||
<el-table-column label="是否分享(判断是否可以随意访问)" align="center" prop="isShare" :formatter="isShareFormat" />
|
||||
<el-table-column label="是否加密" align="center" prop="isEncryption" :formatter="isEncryptionFormat" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['note:note:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['note:note:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改便签管理对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="用户ID" prop="userId">
|
||||
<el-input v-model="form.userId" placeholder="请输入用户ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="便签标题(自动截取)" prop="title">
|
||||
<el-input v-model="form.title" placeholder="请输入便签标题(自动截取)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="摘要(前50字) 循环展示" prop="description">
|
||||
<el-input v-model="form.description" placeholder="请输入摘要(前50字) 循环展示" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属分组Id" prop="menuId">
|
||||
<el-input v-model="form.menuId" placeholder="请输入所属分组Id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="背景颜色 '白','红','黄','蓝','紫'">
|
||||
<el-select v-model="form.background" placeholder="请选择背景颜色 '白','红','黄','蓝','紫'">
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="字数" prop="noteCount">
|
||||
<el-input v-model="form.noteCount" placeholder="请输入字数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序(小到大)" prop="noteSort">
|
||||
<el-input v-model="form.noteSort" placeholder="请输入排序(小到大)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="便签状态" prop="isState">
|
||||
<el-input v-model="form.isState" placeholder="请输入便签状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="阅读进度" prop="readProgress">
|
||||
<el-input v-model="form.readProgress" placeholder="请输入阅读进度" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否星标">
|
||||
<el-radio-group v-model="form.isStar">
|
||||
<el-radio
|
||||
v-for="dict in isStarOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="parseInt(dict.dictValue)"
|
||||
>{{dict.dictLabel}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否删除">
|
||||
<el-radio-group v-model="form.isDelete">
|
||||
<el-radio
|
||||
v-for="dict in isDeleteOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="parseInt(dict.dictValue)"
|
||||
>{{dict.dictLabel}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否置顶">
|
||||
<el-radio-group v-model="form.topFlag">
|
||||
<el-radio
|
||||
v-for="dict in topFlagOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="parseInt(dict.dictValue)"
|
||||
>{{dict.dictLabel}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否分享(判断是否可以随意访问)">
|
||||
<el-radio-group v-model="form.isShare">
|
||||
<el-radio
|
||||
v-for="dict in isShareOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="parseInt(dict.dictValue)"
|
||||
>{{dict.dictLabel}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否加密">
|
||||
<el-radio-group v-model="form.isEncryption">
|
||||
<el-radio
|
||||
v-for="dict in isEncryptionOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="parseInt(dict.dictValue)"
|
||||
>{{dict.dictLabel}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listNote, getNote, delNote, addNote, updateNote, exportNote } from "@/api/note/note";
|
||||
|
||||
export default {
|
||||
name: "Note",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 便签管理表格数据
|
||||
noteList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 是否星标字典
|
||||
isStarOptions: [],
|
||||
// 是否删除字典
|
||||
isDeleteOptions: [],
|
||||
// 是否置顶字典
|
||||
topFlagOptions: [],
|
||||
// 是否分享(判断是否可以随意访问)字典
|
||||
isShareOptions: [],
|
||||
// 是否加密字典
|
||||
isEncryptionOptions: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
noteId: undefined,
|
||||
userId: undefined,
|
||||
title: undefined,
|
||||
description: undefined,
|
||||
menuId: undefined,
|
||||
background: undefined,
|
||||
noteCount: undefined,
|
||||
noteSort: undefined,
|
||||
isState: undefined,
|
||||
readProgress: undefined,
|
||||
isStar: undefined,
|
||||
isDelete: undefined,
|
||||
topFlag: undefined,
|
||||
isShare: undefined,
|
||||
isEncryption: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getDicts("sys_yes_no").then(response => {
|
||||
this.isStarOptions = response.data;
|
||||
});
|
||||
this.getDicts("sys_yes_no").then(response => {
|
||||
this.isDeleteOptions = response.data;
|
||||
});
|
||||
this.getDicts("sys_yes_no").then(response => {
|
||||
this.topFlagOptions = response.data;
|
||||
});
|
||||
this.getDicts("sys_yes_no").then(response => {
|
||||
this.isShareOptions = response.data;
|
||||
});
|
||||
this.getDicts("sys_yes_no").then(response => {
|
||||
this.isEncryptionOptions = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
/** 查询便签管理列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listNote(this.queryParams).then(response => {
|
||||
this.noteList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 是否星标字典翻译
|
||||
isStarFormat(row, column) {
|
||||
return this.selectDictLabel(this.isStarOptions, row.isStar);
|
||||
},
|
||||
// 是否删除字典翻译
|
||||
isDeleteFormat(row, column) {
|
||||
return this.selectDictLabel(this.isDeleteOptions, row.isDelete);
|
||||
},
|
||||
// 是否置顶字典翻译
|
||||
topFlagFormat(row, column) {
|
||||
return this.selectDictLabel(this.topFlagOptions, row.topFlag);
|
||||
},
|
||||
// 是否分享(判断是否可以随意访问)字典翻译
|
||||
isShareFormat(row, column) {
|
||||
return this.selectDictLabel(this.isShareOptions, row.isShare);
|
||||
},
|
||||
// 是否加密字典翻译
|
||||
isEncryptionFormat(row, column) {
|
||||
return this.selectDictLabel(this.isEncryptionOptions, row.isEncryption);
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
noteId: undefined,
|
||||
userId: undefined,
|
||||
title: undefined,
|
||||
description: undefined,
|
||||
menuId: undefined,
|
||||
background: undefined,
|
||||
noteCount: undefined,
|
||||
noteSort: undefined,
|
||||
isState: undefined,
|
||||
readProgress: undefined,
|
||||
isStar: "0",
|
||||
isDelete: "0",
|
||||
topFlag: "0",
|
||||
isShare: "0",
|
||||
isEncryption: "0",
|
||||
createTime: undefined,
|
||||
updateTime: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.noteId)
|
||||
this.single = selection.length!=1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加便签管理";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const noteId = row.noteId || this.ids
|
||||
getNote(noteId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改便签管理";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.noteId != undefined) {
|
||||
updateNote(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addNote(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const noteIds = row.noteId || this.ids;
|
||||
this.$confirm('是否确认删除便签管理编号为"' + noteIds + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return delNote(noteIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(function() {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$confirm('是否确认导出所有便签管理数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return exportNote(queryParams);
|
||||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
}).catch(function() {});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
269
ruoyi-ui/src/views/note/tag/index.vue
Normal file
269
ruoyi-ui/src/views/note/tag/index.vue
Normal file
@ -0,0 +1,269 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
||||
<el-form-item label="便签id" prop="noteId">
|
||||
<el-input
|
||||
v-model="queryParams.noteId"
|
||||
placeholder="请输入便签id"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="标签Id" prop="tagId">
|
||||
<el-input
|
||||
v-model="queryParams.tagId"
|
||||
placeholder="请输入标签Id"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['note:tag:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['note:tag:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['note:tag:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['note:tag:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="tagList" @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="便签id" align="center" prop="noteId" />
|
||||
<el-table-column label="标签Id" align="center" prop="tagId" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['note:tag:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['note:tag:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改便签标签对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="便签id" prop="noteId">
|
||||
<el-input v-model="form.noteId" placeholder="请输入便签id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标签Id" prop="tagId">
|
||||
<el-input v-model="form.tagId" placeholder="请输入标签Id" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listTag, getTag, delTag, addTag, updateTag, exportTag } from "@/api/note/tag";
|
||||
|
||||
export default {
|
||||
name: "Tag",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 便签标签表格数据
|
||||
tagList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
noteId: undefined,
|
||||
tagId: undefined
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询便签标签列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listTag(this.queryParams).then(response => {
|
||||
this.tagList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
noteId: undefined,
|
||||
tagId: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!=1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加便签标签";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getTag(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改便签标签";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != undefined) {
|
||||
updateTag(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addTag(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$confirm('是否确认删除便签标签编号为"' + ids + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return delTag(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(function() {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$confirm('是否确认导出所有便签标签数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return exportTag(queryParams);
|
||||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
}).catch(function() {});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Reference in New Issue
Block a user