20 changed files with 1532 additions and 11 deletions
@ -0,0 +1,141 @@ |
|||
package com.ruoyi.web.controller.system; |
|||
|
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
|
|||
import com.ruoyi.api.service.impl.PointService; |
|||
import com.ruoyi.common.utils.Neo4jUtil; |
|||
import com.ruoyi.system.mapper.ZhyPointRelationshipMapper; |
|||
import com.ruoyi.system.service.IZhyPointRelationshipService; |
|||
import org.neo4j.driver.v1.StatementResult; |
|||
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.system.domain.ZhyPoint; |
|||
import com.ruoyi.system.service.IZhyPointService; |
|||
import com.ruoyi.common.utils.poi.ExcelUtil; |
|||
import com.ruoyi.common.core.page.TableDataInfo; |
|||
|
|||
|
|||
/** |
|||
* 知识点管理Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2025-09-18 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/system/SysPoint") |
|||
public class ZhyPointController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private IZhyPointService zhyPointService; |
|||
@Autowired |
|||
IZhyPointRelationshipService zhyPointRelationshipService; |
|||
@Autowired |
|||
ZhyPointRelationshipMapper zhyPointRelationshipMapper; |
|||
@Autowired |
|||
Neo4jUtil neo4jUtil; |
|||
@Autowired |
|||
PointService pointService; |
|||
/** |
|||
* 查询知识点管理列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:SysPoint:list')") |
|||
@GetMapping("/list") |
|||
public TableDataInfo list(ZhyPoint zhyPoint) |
|||
{ |
|||
startPage(); |
|||
List<ZhyPoint> list = zhyPointService.selectZhyPointList(zhyPoint); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出知识点管理列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:SysPoint:export')") |
|||
@Log(title = "知识点管理", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(HttpServletResponse response, ZhyPoint zhyPoint) |
|||
{ |
|||
List<ZhyPoint> list = zhyPointService.selectZhyPointList(zhyPoint); |
|||
ExcelUtil<ZhyPoint> util = new ExcelUtil<ZhyPoint>(ZhyPoint.class); |
|||
util.exportExcel(response, list, "知识点管理数据"); |
|||
} |
|||
|
|||
/** |
|||
* 获取知识点管理详细信息 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:SysPoint:query')") |
|||
@GetMapping(value = "/{id}") |
|||
public AjaxResult getInfo(@PathVariable("id") Long id) |
|||
{ |
|||
return success(zhyPointService.selectZhyPointById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增知识点管理 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:SysPoint:add')") |
|||
@Log(title = "知识点管理", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public AjaxResult add(@RequestBody ZhyPoint zhyPoint) |
|||
{ |
|||
Map<String, Object> data = new HashMap<>(); |
|||
data.put("type", zhyPoint.getType1()); |
|||
int neo4jId = pointService.createPoint(zhyPoint.getPointName(), data); |
|||
zhyPoint.setUuid(Long.valueOf(neo4jId)); |
|||
return toAjax(zhyPointService.insertZhyPoint(zhyPoint)); |
|||
} |
|||
|
|||
/** |
|||
* 修改知识点管理 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:SysPoint:edit')") |
|||
@Log(title = "知识点管理", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody ZhyPoint zhyPoint) |
|||
{ |
|||
|
|||
|
|||
return toAjax(zhyPointService.updateZhyPoint(zhyPoint)); |
|||
} |
|||
|
|||
/** |
|||
* 删除知识点管理 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:SysPoint:remove')") |
|||
@Log(title = "知识点管理", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public AjaxResult remove(@PathVariable Long[] ids) |
|||
{ |
|||
for (int i = 0;i<ids.length;i++){ |
|||
Long DBid = ids[i]; |
|||
ZhyPoint zhyPoint = zhyPointService.selectZhyPointById(DBid); |
|||
if (zhyPoint.getType1().equals("author")){ |
|||
zhyPointRelationshipMapper.deleteZhyPointRelationshipByAuthor(zhyPoint.getPointName()); |
|||
} |
|||
if (zhyPoint.getType1().equals("keyword")){ |
|||
zhyPointRelationshipMapper.deleteZhyPointRelationshipByKeyword(zhyPoint.getPointName()); |
|||
} |
|||
if (zhyPoint.getType1().equals("agency")){ |
|||
zhyPointRelationshipMapper.deleteZhyPointRelationshipByAgency(zhyPoint.getPointName()); |
|||
} |
|||
pointService.deletePointAndRSByInternalId(zhyPoint.getUuid()); |
|||
} |
|||
|
|||
return toAjax(zhyPointService.deleteZhyPointByIds(ids)); |
|||
} |
|||
} |
|||
@ -0,0 +1,157 @@ |
|||
package com.ruoyi.web.controller.system; |
|||
|
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
|
|||
import com.ruoyi.api.mapper.ZhyPointMapper; |
|||
import com.ruoyi.api.service.impl.PointService; |
|||
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.system.domain.ZhyPointRelationship; |
|||
import com.ruoyi.system.service.IZhyPointRelationshipService; |
|||
import com.ruoyi.common.utils.poi.ExcelUtil; |
|||
import com.ruoyi.common.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 知识点关系Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2025-09-20 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/system/relationship1") |
|||
public class ZhyPointRelationshipController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private IZhyPointRelationshipService zhyPointRelationshipService; |
|||
|
|||
|
|||
|
|||
@Autowired |
|||
PointService pointService; |
|||
@Autowired |
|||
ZhyPointMapper zhyPointMapper; |
|||
/** |
|||
* 查询知识点关系列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:relationship:list')") |
|||
@GetMapping("/list") |
|||
public TableDataInfo list(ZhyPointRelationship zhyPointRelationship) |
|||
{ |
|||
startPage(); |
|||
List<ZhyPointRelationship> list = zhyPointRelationshipService.selectZhyPointRelationshipList(zhyPointRelationship); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出知识点关系列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:relationship:export')") |
|||
@Log(title = "知识点关系", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(HttpServletResponse response, ZhyPointRelationship zhyPointRelationship) |
|||
{ |
|||
List<ZhyPointRelationship> list = zhyPointRelationshipService.selectZhyPointRelationshipList(zhyPointRelationship); |
|||
ExcelUtil<ZhyPointRelationship> util = new ExcelUtil<ZhyPointRelationship>(ZhyPointRelationship.class); |
|||
util.exportExcel(response, list, "知识点关系数据"); |
|||
} |
|||
|
|||
/** |
|||
* 获取知识点关系详细信息 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:relationship:query')") |
|||
@GetMapping(value = "/{id}") |
|||
public AjaxResult getInfo(@PathVariable("id") Long id) |
|||
{ |
|||
return success(zhyPointRelationshipService.selectZhyPointRelationshipById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增知识点关系 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:relationship:add')") |
|||
@Log(title = "知识点关系", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public AjaxResult add(@RequestBody ZhyPointRelationship zhyPointRelationship) |
|||
{ |
|||
List<Map> point = zhyPointMapper.selectPointByName(zhyPointRelationship.getStart()); |
|||
int startid = Integer.valueOf(String.valueOf(point.get(0).get("uuid"))); |
|||
String startType = String.valueOf(point.get(0).get("type1")); |
|||
|
|||
List<Map> point2 = zhyPointMapper.selectPointByName(zhyPointRelationship.getEnd()); |
|||
int endid = Integer.valueOf(String.valueOf(point2.get(0).get("uuid"))); |
|||
String endType = String.valueOf(point2.get(0).get("type1")); |
|||
|
|||
String RType = ""; |
|||
|
|||
if (startType.equals("author")){ |
|||
if (endType.equals("agency")){ |
|||
RType = "相关机构"; |
|||
} |
|||
if (endType.equals("keyword")){ |
|||
RType = "相关作者"; |
|||
} |
|||
} |
|||
if (startType.equals("agency")){ |
|||
if (endType.equals("author")){ |
|||
RType = "相关机构"; |
|||
} |
|||
if (endType.equals("keyword")){ |
|||
RType = "相关"; |
|||
} |
|||
} |
|||
if (startType.equals("keyword")){ |
|||
if (endType.equals("author")){ |
|||
RType = "相关作者"; |
|||
} |
|||
if (endType.equals("agency")){ |
|||
RType = "相关"; |
|||
} |
|||
} |
|||
Map map = new HashMap(); |
|||
map.put("relType",RType); |
|||
int uuid = pointService.createReletionship(startid,endid,RType,map); |
|||
zhyPointRelationship.setRelationshipId(Long.valueOf(uuid)); |
|||
return toAjax(zhyPointRelationshipService.insertZhyPointRelationship(zhyPointRelationship)); |
|||
} |
|||
|
|||
/** |
|||
* 修改知识点关系 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:relationship:edit')") |
|||
@Log(title = "知识点关系", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody ZhyPointRelationship zhyPointRelationship) |
|||
{ |
|||
return toAjax(zhyPointRelationshipService.updateZhyPointRelationship(zhyPointRelationship)); |
|||
} |
|||
|
|||
/** |
|||
* 删除知识点关系 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:relationship:remove')") |
|||
@Log(title = "知识点关系", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public AjaxResult remove(@PathVariable Long[] ids) |
|||
{ |
|||
for (int i =0;i<ids.length;i++){ |
|||
ZhyPointRelationship zhyPointRelationship = zhyPointRelationshipService.selectZhyPointRelationshipById(ids[i]); |
|||
pointService.deleteRSById(zhyPointRelationship.getRelationshipId()); |
|||
} |
|||
return toAjax(zhyPointRelationshipService.deleteZhyPointRelationshipByIds(ids)); |
|||
} |
|||
} |
|||
@ -0,0 +1,78 @@ |
|||
package com.ruoyi.system.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; |
|||
|
|||
/** |
|||
* 知识点管理对象 sys_point |
|||
* |
|||
* @author ruoyi |
|||
* @date 2025-09-18 |
|||
*/ |
|||
public class ZhyPoint extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** $column.columnComment */ |
|||
private Long id; |
|||
|
|||
/** 知识点名称 */ |
|||
@Excel(name = "知识点名称") |
|||
private String pointName; |
|||
|
|||
/** neo4j ID */ |
|||
private Long uuid; |
|||
|
|||
/** 类型 */ |
|||
@Excel(name = "类型") |
|||
private String type1; |
|||
|
|||
public void setId(Long id) |
|||
{ |
|||
this.id = id; |
|||
} |
|||
|
|||
public Long getId() |
|||
{ |
|||
return id; |
|||
} |
|||
public void setPointName(String pointName) |
|||
{ |
|||
this.pointName = pointName; |
|||
} |
|||
|
|||
public String getPointName() |
|||
{ |
|||
return pointName; |
|||
} |
|||
public void setUuid(Long uuid) |
|||
{ |
|||
this.uuid = uuid; |
|||
} |
|||
|
|||
public Long getUuid() |
|||
{ |
|||
return uuid; |
|||
} |
|||
public void setType1(String type1) |
|||
{ |
|||
this.type1 = type1; |
|||
} |
|||
|
|||
public String getType1() |
|||
{ |
|||
return type1; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("id", getId()) |
|||
.append("pointName", getPointName()) |
|||
.append("uuid", getUuid()) |
|||
.append("type1", getType1()) |
|||
.toString(); |
|||
} |
|||
} |
|||
@ -0,0 +1,139 @@ |
|||
package com.ruoyi.system.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; |
|||
|
|||
/** |
|||
* 知识点关系对象 zhy_point_relationship |
|||
* |
|||
* @author ruoyi |
|||
* @date 2025-09-20 |
|||
*/ |
|||
public class ZhyPointRelationship extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** $column.columnComment */ |
|||
private Long id; |
|||
private String start; |
|||
private String end; |
|||
|
|||
public String getStart() { |
|||
return start; |
|||
} |
|||
|
|||
public void setStart(String start) { |
|||
this.start = start; |
|||
} |
|||
|
|||
public String getEnd() { |
|||
return end; |
|||
} |
|||
|
|||
public void setEnd(String end) { |
|||
this.end = end; |
|||
} |
|||
|
|||
/** $column.columnComment */ |
|||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") |
|||
private String author; |
|||
|
|||
/** $column.columnComment */ |
|||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") |
|||
private String keyword; |
|||
|
|||
/** $column.columnComment */ |
|||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") |
|||
private String agency; |
|||
|
|||
/** $column.columnComment */ |
|||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") |
|||
private Long relationshipId; |
|||
|
|||
/** $column.columnComment */ |
|||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") |
|||
private String url; |
|||
|
|||
/** $column.columnComment */ |
|||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") |
|||
private String title; |
|||
|
|||
public void setId(Long id) |
|||
{ |
|||
this.id = id; |
|||
} |
|||
|
|||
public Long getId() |
|||
{ |
|||
return id; |
|||
} |
|||
public void setAuthor(String author) |
|||
{ |
|||
this.author = author; |
|||
} |
|||
|
|||
public String getAuthor() |
|||
{ |
|||
return author; |
|||
} |
|||
public void setKeyword(String keyword) |
|||
{ |
|||
this.keyword = keyword; |
|||
} |
|||
|
|||
public String getKeyword() |
|||
{ |
|||
return keyword; |
|||
} |
|||
public void setAgency(String agency) |
|||
{ |
|||
this.agency = agency; |
|||
} |
|||
|
|||
public String getAgency() |
|||
{ |
|||
return agency; |
|||
} |
|||
public void setRelationshipId(Long relationshipId) |
|||
{ |
|||
this.relationshipId = relationshipId; |
|||
} |
|||
|
|||
public Long getRelationshipId() |
|||
{ |
|||
return relationshipId; |
|||
} |
|||
public void setUrl(String url) |
|||
{ |
|||
this.url = url; |
|||
} |
|||
|
|||
public String getUrl() |
|||
{ |
|||
return url; |
|||
} |
|||
public void setTitle(String title) |
|||
{ |
|||
this.title = title; |
|||
} |
|||
|
|||
public String getTitle() |
|||
{ |
|||
return title; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("id", getId()) |
|||
.append("author", getAuthor()) |
|||
.append("keyword", getKeyword()) |
|||
.append("agency", getAgency()) |
|||
.append("relationshipId", getRelationshipId()) |
|||
.append("url", getUrl()) |
|||
.append("title", getTitle()) |
|||
.toString(); |
|||
} |
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
package com.ruoyi.system.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.system.domain.ZhyPoint; |
|||
|
|||
/** |
|||
* 知识点管理Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2025-09-18 |
|||
*/ |
|||
public interface SysPointMapper |
|||
{ |
|||
/** |
|||
* 查询知识点管理 |
|||
* |
|||
* @param id 知识点管理主键 |
|||
* @return 知识点管理 |
|||
*/ |
|||
public ZhyPoint selectZhyPointById(Long id); |
|||
|
|||
/** |
|||
* 查询知识点管理列表 |
|||
* |
|||
* @param zhyPoint 知识点管理 |
|||
* @return 知识点管理集合 |
|||
*/ |
|||
public List<ZhyPoint> selectZhyPointList(ZhyPoint zhyPoint); |
|||
|
|||
/** |
|||
* 新增知识点管理 |
|||
* |
|||
* @param zhyPoint 知识点管理 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertZhyPoint(ZhyPoint zhyPoint); |
|||
|
|||
/** |
|||
* 修改知识点管理 |
|||
* |
|||
* @param zhyPoint 知识点管理 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateZhyPoint(ZhyPoint zhyPoint); |
|||
|
|||
/** |
|||
* 删除知识点管理 |
|||
* |
|||
* @param id 知识点管理主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteZhyPointById(Long id); |
|||
|
|||
/** |
|||
* 批量删除知识点管理 |
|||
* |
|||
* @param ids 需要删除的数据主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteZhyPointByIds(Long[] ids); |
|||
} |
|||
@ -0,0 +1,65 @@ |
|||
package com.ruoyi.system.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.system.domain.ZhyPointRelationship; |
|||
|
|||
/** |
|||
* 知识点关系Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2025-09-20 |
|||
*/ |
|||
public interface ZhyPointRelationshipMapper |
|||
{ |
|||
/** |
|||
* 查询知识点关系 |
|||
* |
|||
* @param id 知识点关系主键 |
|||
* @return 知识点关系 |
|||
*/ |
|||
public ZhyPointRelationship selectZhyPointRelationshipById(Long id); |
|||
|
|||
/** |
|||
* 查询知识点关系列表 |
|||
* |
|||
* @param zhyPointRelationship 知识点关系 |
|||
* @return 知识点关系集合 |
|||
*/ |
|||
public List<ZhyPointRelationship> selectZhyPointRelationshipList(ZhyPointRelationship zhyPointRelationship); |
|||
|
|||
/** |
|||
* 新增知识点关系 |
|||
* |
|||
* @param zhyPointRelationship 知识点关系 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertZhyPointRelationship(ZhyPointRelationship zhyPointRelationship); |
|||
|
|||
/** |
|||
* 修改知识点关系 |
|||
* |
|||
* @param zhyPointRelationship 知识点关系 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateZhyPointRelationship(ZhyPointRelationship zhyPointRelationship); |
|||
|
|||
/** |
|||
* 删除知识点关系 |
|||
* |
|||
* @param id 知识点关系主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteZhyPointRelationshipById(Long id); |
|||
|
|||
public int deleteZhyPointRelationshipByAuthor(String author); |
|||
public int deleteZhyPointRelationshipByKeyword(String keyword); |
|||
public int deleteZhyPointRelationshipByAgency(String agency); |
|||
|
|||
/** |
|||
* 批量删除知识点关系 |
|||
* |
|||
* @param ids 需要删除的数据主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteZhyPointRelationshipByIds(Long[] ids); |
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
package com.ruoyi.system.service; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.system.domain.ZhyPointRelationship; |
|||
|
|||
/** |
|||
* 知识点关系Service接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2025-09-20 |
|||
*/ |
|||
public interface IZhyPointRelationshipService |
|||
{ |
|||
/** |
|||
* 查询知识点关系 |
|||
* |
|||
* @param id 知识点关系主键 |
|||
* @return 知识点关系 |
|||
*/ |
|||
public ZhyPointRelationship selectZhyPointRelationshipById(Long id); |
|||
|
|||
/** |
|||
* 查询知识点关系列表 |
|||
* |
|||
* @param zhyPointRelationship 知识点关系 |
|||
* @return 知识点关系集合 |
|||
*/ |
|||
public List<ZhyPointRelationship> selectZhyPointRelationshipList(ZhyPointRelationship zhyPointRelationship); |
|||
|
|||
/** |
|||
* 新增知识点关系 |
|||
* |
|||
* @param zhyPointRelationship 知识点关系 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertZhyPointRelationship(ZhyPointRelationship zhyPointRelationship); |
|||
|
|||
/** |
|||
* 修改知识点关系 |
|||
* |
|||
* @param zhyPointRelationship 知识点关系 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateZhyPointRelationship(ZhyPointRelationship zhyPointRelationship); |
|||
|
|||
/** |
|||
* 批量删除知识点关系 |
|||
* |
|||
* @param ids 需要删除的知识点关系主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteZhyPointRelationshipByIds(Long[] ids); |
|||
|
|||
/** |
|||
* 删除知识点关系信息 |
|||
* |
|||
* @param id 知识点关系主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteZhyPointRelationshipById(Long id); |
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
package com.ruoyi.system.service; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.system.domain.ZhyPoint; |
|||
|
|||
/** |
|||
* 知识点管理Service接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2025-09-18 |
|||
*/ |
|||
public interface IZhyPointService |
|||
{ |
|||
/** |
|||
* 查询知识点管理 |
|||
* |
|||
* @param id 知识点管理主键 |
|||
* @return 知识点管理 |
|||
*/ |
|||
public ZhyPoint selectZhyPointById(Long id); |
|||
|
|||
/** |
|||
* 查询知识点管理列表 |
|||
* |
|||
* @param zhyPoint 知识点管理 |
|||
* @return 知识点管理集合 |
|||
*/ |
|||
public List<ZhyPoint> selectZhyPointList(ZhyPoint zhyPoint); |
|||
|
|||
/** |
|||
* 新增知识点管理 |
|||
* |
|||
* @param zhyPoint 知识点管理 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertZhyPoint(ZhyPoint zhyPoint); |
|||
|
|||
/** |
|||
* 修改知识点管理 |
|||
* |
|||
* @param zhyPoint 知识点管理 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateZhyPoint(ZhyPoint zhyPoint); |
|||
|
|||
/** |
|||
* 批量删除知识点管理 |
|||
* |
|||
* @param ids 需要删除的知识点管理主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteZhyPointByIds(Long[] ids); |
|||
|
|||
/** |
|||
* 删除知识点管理信息 |
|||
* |
|||
* @param id 知识点管理主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteZhyPointById(Long id); |
|||
} |
|||
@ -0,0 +1,93 @@ |
|||
package com.ruoyi.system.service.impl; |
|||
|
|||
import java.util.List; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import com.ruoyi.system.mapper.ZhyPointRelationshipMapper; |
|||
import com.ruoyi.system.domain.ZhyPointRelationship; |
|||
import com.ruoyi.system.service.IZhyPointRelationshipService; |
|||
|
|||
/** |
|||
* 知识点关系Service业务层处理 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2025-09-20 |
|||
*/ |
|||
@Service |
|||
public class ZhyPointRelationshipServiceImpl implements IZhyPointRelationshipService |
|||
{ |
|||
@Autowired |
|||
private ZhyPointRelationshipMapper zhyPointRelationshipMapper; |
|||
|
|||
/** |
|||
* 查询知识点关系 |
|||
* |
|||
* @param id 知识点关系主键 |
|||
* @return 知识点关系 |
|||
*/ |
|||
@Override |
|||
public ZhyPointRelationship selectZhyPointRelationshipById(Long id) |
|||
{ |
|||
return zhyPointRelationshipMapper.selectZhyPointRelationshipById(id); |
|||
} |
|||
|
|||
/** |
|||
* 查询知识点关系列表 |
|||
* |
|||
* @param zhyPointRelationship 知识点关系 |
|||
* @return 知识点关系 |
|||
*/ |
|||
@Override |
|||
public List<ZhyPointRelationship> selectZhyPointRelationshipList(ZhyPointRelationship zhyPointRelationship) |
|||
{ |
|||
return zhyPointRelationshipMapper.selectZhyPointRelationshipList(zhyPointRelationship); |
|||
} |
|||
|
|||
/** |
|||
* 新增知识点关系 |
|||
* |
|||
* @param zhyPointRelationship 知识点关系 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertZhyPointRelationship(ZhyPointRelationship zhyPointRelationship) |
|||
{ |
|||
return zhyPointRelationshipMapper.insertZhyPointRelationship(zhyPointRelationship); |
|||
} |
|||
|
|||
/** |
|||
* 修改知识点关系 |
|||
* |
|||
* @param zhyPointRelationship 知识点关系 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateZhyPointRelationship(ZhyPointRelationship zhyPointRelationship) |
|||
{ |
|||
return zhyPointRelationshipMapper.updateZhyPointRelationship(zhyPointRelationship); |
|||
} |
|||
|
|||
/** |
|||
* 批量删除知识点关系 |
|||
* |
|||
* @param ids 需要删除的知识点关系主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteZhyPointRelationshipByIds(Long[] ids) |
|||
{ |
|||
return zhyPointRelationshipMapper.deleteZhyPointRelationshipByIds(ids); |
|||
} |
|||
|
|||
/** |
|||
* 删除知识点关系信息 |
|||
* |
|||
* @param id 知识点关系主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteZhyPointRelationshipById(Long id) |
|||
{ |
|||
return zhyPointRelationshipMapper.deleteZhyPointRelationshipById(id); |
|||
} |
|||
} |
|||
@ -0,0 +1,93 @@ |
|||
package com.ruoyi.system.service.impl; |
|||
|
|||
import java.util.List; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import com.ruoyi.system.mapper.SysPointMapper; |
|||
import com.ruoyi.system.domain.ZhyPoint; |
|||
import com.ruoyi.system.service.IZhyPointService; |
|||
|
|||
/** |
|||
* 知识点管理Service业务层处理 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2025-09-18 |
|||
*/ |
|||
@Service |
|||
public class ZhyPointServiceImpl implements IZhyPointService |
|||
{ |
|||
@Autowired |
|||
private SysPointMapper zhyPointMapper; |
|||
|
|||
/** |
|||
* 查询知识点管理 |
|||
* |
|||
* @param id 知识点管理主键 |
|||
* @return 知识点管理 |
|||
*/ |
|||
@Override |
|||
public ZhyPoint selectZhyPointById(Long id) |
|||
{ |
|||
return zhyPointMapper.selectZhyPointById(id); |
|||
} |
|||
|
|||
/** |
|||
* 查询知识点管理列表 |
|||
* |
|||
* @param zhyPoint 知识点管理 |
|||
* @return 知识点管理 |
|||
*/ |
|||
@Override |
|||
public List<ZhyPoint> selectZhyPointList(ZhyPoint zhyPoint) |
|||
{ |
|||
return zhyPointMapper.selectZhyPointList(zhyPoint); |
|||
} |
|||
|
|||
/** |
|||
* 新增知识点管理 |
|||
* |
|||
* @param zhyPoint 知识点管理 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertZhyPoint(ZhyPoint zhyPoint) |
|||
{ |
|||
return zhyPointMapper.insertZhyPoint(zhyPoint); |
|||
} |
|||
|
|||
/** |
|||
* 修改知识点管理 |
|||
* |
|||
* @param zhyPoint 知识点管理 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateZhyPoint(ZhyPoint zhyPoint) |
|||
{ |
|||
return zhyPointMapper.updateZhyPoint(zhyPoint); |
|||
} |
|||
|
|||
/** |
|||
* 批量删除知识点管理 |
|||
* |
|||
* @param ids 需要删除的知识点管理主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteZhyPointByIds(Long[] ids) |
|||
{ |
|||
return zhyPointMapper.deleteZhyPointByIds(ids); |
|||
} |
|||
|
|||
/** |
|||
* 删除知识点管理信息 |
|||
* |
|||
* @param id 知识点管理主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteZhyPointById(Long id) |
|||
{ |
|||
return zhyPointMapper.deleteZhyPointById(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.system.mapper.SysPointMapper"> |
|||
|
|||
<resultMap type="ZhyPoint" id="ZhyPointResult"> |
|||
<result property="id" column="id" /> |
|||
<result property="pointName" column="point_name" /> |
|||
<result property="uuid" column="uuid" /> |
|||
<result property="type1" column="type1" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectZhyPointVo"> |
|||
select id, point_name, uuid, type1 from zhy_point |
|||
</sql> |
|||
|
|||
<select id="selectZhyPointList" parameterType="ZhyPoint" resultMap="ZhyPointResult"> |
|||
<include refid="selectZhyPointVo"/> |
|||
<where> |
|||
<if test="pointName != null and pointName != ''"> and point_name like concat('%', #{pointName}, '%')</if> |
|||
<if test="uuid != null "> and uuid = #{uuid}</if> |
|||
<if test="type1 != null and type1 != ''"> and type1 = #{type1}</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectZhyPointById" parameterType="Long" resultMap="ZhyPointResult"> |
|||
<include refid="selectZhyPointVo"/> |
|||
where id = #{id} |
|||
</select> |
|||
|
|||
<insert id="insertZhyPoint" parameterType="ZhyPoint" useGeneratedKeys="true" keyProperty="id"> |
|||
insert into zhy_point |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="pointName != null">point_name,</if> |
|||
<if test="uuid != null">uuid,</if> |
|||
<if test="type1 != null">type1,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="pointName != null">#{pointName},</if> |
|||
<if test="uuid != null">#{uuid},</if> |
|||
<if test="type1 != null">#{type1},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateZhyPoint" parameterType="ZhyPoint"> |
|||
update zhy_point |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="pointName != null">point_name = #{pointName},</if> |
|||
<if test="uuid != null">uuid = #{uuid},</if> |
|||
<if test="type1 != null">type1 = #{type1},</if> |
|||
</trim> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<delete id="deleteZhyPointById" parameterType="Long"> |
|||
delete from zhy_point where id = #{id} |
|||
</delete> |
|||
|
|||
<delete id="deleteZhyPointByIds" parameterType="String"> |
|||
delete from zhy_point where id in |
|||
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
</delete> |
|||
</mapper> |
|||
@ -0,0 +1,90 @@ |
|||
<?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.system.mapper.ZhyPointRelationshipMapper"> |
|||
|
|||
<resultMap type="ZhyPointRelationship" id="ZhyPointRelationshipResult"> |
|||
<result property="id" column="id" /> |
|||
<result property="author" column="author" /> |
|||
<result property="keyword" column="keyword" /> |
|||
<result property="agency" column="agency" /> |
|||
<result property="relationshipId" column="relationship_id" /> |
|||
<result property="url" column="url" /> |
|||
<result property="title" column="title" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectZhyPointRelationshipVo"> |
|||
select id, author, keyword, agency, relationship_id, url, title from zhy_point_relationship |
|||
</sql> |
|||
|
|||
<select id="selectZhyPointRelationshipList" parameterType="ZhyPointRelationship" resultMap="ZhyPointRelationshipResult"> |
|||
<include refid="selectZhyPointRelationshipVo"/> |
|||
<where> |
|||
<if test="author != null and author != ''"> and author = #{author}</if> |
|||
<if test="keyword != null and keyword != ''"> and keyword = #{keyword}</if> |
|||
<if test="agency != null and agency != ''"> and agency = #{agency}</if> |
|||
<if test="relationshipId != null "> and relationship_id = #{relationshipId}</if> |
|||
<if test="url != null and url != ''"> and url = #{url}</if> |
|||
<if test="title != null and title != ''"> and title = #{title}</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectZhyPointRelationshipById" parameterType="Long" resultMap="ZhyPointRelationshipResult"> |
|||
<include refid="selectZhyPointRelationshipVo"/> |
|||
where id = #{id} |
|||
</select> |
|||
|
|||
<insert id="insertZhyPointRelationship" parameterType="ZhyPointRelationship" useGeneratedKeys="true" keyProperty="id"> |
|||
insert into zhy_point_relationship |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="author != null">author,</if> |
|||
<if test="keyword != null">keyword,</if> |
|||
<if test="agency != null">agency,</if> |
|||
<if test="relationshipId != null">relationship_id,</if> |
|||
<if test="url != null">url,</if> |
|||
<if test="title != null">title,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="author != null">#{author},</if> |
|||
<if test="keyword != null">#{keyword},</if> |
|||
<if test="agency != null">#{agency},</if> |
|||
<if test="relationshipId != null">#{relationshipId},</if> |
|||
<if test="url != null">#{url},</if> |
|||
<if test="title != null">#{title},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateZhyPointRelationship" parameterType="ZhyPointRelationship"> |
|||
update zhy_point_relationship |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="author != null">author = #{author},</if> |
|||
<if test="keyword != null">keyword = #{keyword},</if> |
|||
<if test="agency != null">agency = #{agency},</if> |
|||
<if test="relationshipId != null">relationship_id = #{relationshipId},</if> |
|||
<if test="url != null">url = #{url},</if> |
|||
<if test="title != null">title = #{title},</if> |
|||
</trim> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<delete id="deleteZhyPointRelationshipById" parameterType="Long"> |
|||
delete from zhy_point_relationship where id = #{id} |
|||
</delete> |
|||
<delete id="deleteZhyPointRelationshipByAuthor" > |
|||
delete from zhy_point_relationship where author = #{param1} |
|||
</delete> |
|||
<delete id="deleteZhyPointRelationshipByKeyword" > |
|||
delete from zhy_point_relationship where keyword = #{param1} |
|||
</delete> |
|||
<delete id="deleteZhyPointRelationshipByAgency" > |
|||
delete from zhy_point_relationship where agency = #{param1} |
|||
</delete> |
|||
|
|||
<delete id="deleteZhyPointRelationshipByIds" parameterType="String"> |
|||
delete from zhy_point_relationship where id in |
|||
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
</delete> |
|||
</mapper> |
|||
@ -0,0 +1,44 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 查询知识点管理列表
|
|||
export function listSysPoint(query) { |
|||
return request({ |
|||
url: '/system/SysPoint/list', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
|||
|
|||
// 查询知识点管理详细
|
|||
export function getSysPoint(id) { |
|||
return request({ |
|||
url: '/system/SysPoint/' + id, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 新增知识点管理
|
|||
export function addSysPoint(data) { |
|||
return request({ |
|||
url: '/system/SysPoint', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 修改知识点管理
|
|||
export function updateSysPoint(data) { |
|||
return request({ |
|||
url: '/system/SysPoint', |
|||
method: 'put', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 删除知识点管理
|
|||
export function delSysPoint(id) { |
|||
return request({ |
|||
url: '/system/SysPoint/' + id, |
|||
method: 'delete' |
|||
}) |
|||
} |
|||
@ -0,0 +1,44 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 查询知识点关系列表
|
|||
export function listRelationship(query) { |
|||
return request({ |
|||
url: '/system/relationship1/list', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
|||
|
|||
// 查询知识点关系详细
|
|||
export function getRelationship(id) { |
|||
return request({ |
|||
url: '/system/relationship1/' + id, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 新增知识点关系
|
|||
export function addRelationship(data) { |
|||
return request({ |
|||
url: '/system/relationship1', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 修改知识点关系
|
|||
export function updateRelationship(data) { |
|||
return request({ |
|||
url: '/system/relationship1', |
|||
method: 'put', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 删除知识点关系
|
|||
export function delRelationship(id) { |
|||
return request({ |
|||
url: '/system/relationship1/' + id, |
|||
method: 'delete' |
|||
}) |
|||
} |
|||
@ -0,0 +1,272 @@ |
|||
<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="pointName"> |
|||
<el-input |
|||
v-model="queryParams.pointName" |
|||
placeholder="请输入知识点名称" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<!-- <el-form-item label="neo4j ID" prop="uuid">--> |
|||
<!-- <el-input--> |
|||
<!-- v-model="queryParams.uuid"--> |
|||
<!-- placeholder="请输入neo4j ID"--> |
|||
<!-- clearable--> |
|||
<!-- @keyup.enter.native="handleQuery"--> |
|||
<!-- />--> |
|||
<!-- </el-form-item>--> |
|||
<el-form-item label="类型" prop="type1"> |
|||
<el-input |
|||
v-model="queryParams.type1" |
|||
placeholder="请输入类型" |
|||
clearable |
|||
@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" |
|||
plain |
|||
icon="el-icon-plus" |
|||
size="mini" |
|||
@click="handleAdd" |
|||
v-hasPermi="['system:SysPoint: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:SysPoint:edit']"--> |
|||
<!-- >修改</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:SysPoint:remove']" |
|||
>删除</el-button> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="warning" |
|||
plain |
|||
icon="el-icon-download" |
|||
size="mini" |
|||
@click="handleExport" |
|||
v-hasPermi="['system:SysPoint:export']" |
|||
>导出</el-button> |
|||
</el-col> |
|||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
|||
</el-row> |
|||
|
|||
<el-table v-loading="loading" :data="SysPointList" @selection-change="handleSelectionChange"> |
|||
<el-table-column type="selection" width="55" align="center" /> |
|||
<!-- <el-table-column label="${comment}" align="center" prop="id" />--> |
|||
<el-table-column label="知识点名称" align="center" prop="pointName" /> |
|||
<el-table-column label="类型" align="center" prop="type1" /> |
|||
<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="['system:SysPoint:edit']"--> |
|||
<!-- >修改</el-button>--> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['system:SysPoint: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="知识点名称" prop="pointName"> |
|||
<el-input v-model="form.pointName" placeholder="请输入知识点名称" /> |
|||
</el-form-item> |
|||
<el-form-item label="neo4j ID" prop="uuid"> |
|||
<el-input v-model="form.uuid" placeholder="请输入neo4j ID" /> |
|||
</el-form-item> |
|||
<el-form-item label="类型" prop="type1"> |
|||
<el-input v-model="form.type1" placeholder="请输入类型" /> |
|||
</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 { listSysPoint, getSysPoint, delSysPoint, addSysPoint, updateSysPoint } from "@/api/system/SysPoint"; |
|||
|
|||
export default { |
|||
name: "SysPoint", |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 知识点管理表格数据 |
|||
SysPointList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
pointName: null, |
|||
uuid: null, |
|||
type1: null |
|||
}, |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
} |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
}, |
|||
methods: { |
|||
/** 查询知识点管理列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
listSysPoint(this.queryParams).then(response => { |
|||
this.SysPointList = response.rows; |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
}); |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false; |
|||
this.reset(); |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.form = { |
|||
id: null, |
|||
pointName: null, |
|||
uuid: null, |
|||
type1: null |
|||
}; |
|||
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 |
|||
getSysPoint(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) { |
|||
updateSysPoint(this.form).then(response => { |
|||
this.$modal.msgSuccess("修改成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
}); |
|||
} else { |
|||
addSysPoint(this.form).then(response => { |
|||
this.$modal.msgSuccess("新增成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
}); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
/** 删除按钮操作 */ |
|||
handleDelete(row) { |
|||
const ids = row.id || this.ids; |
|||
this.$modal.confirm('是否确认删除知识点管理编号为"' + ids + '"的数据项?').then(function() { |
|||
return delSysPoint(ids); |
|||
}).then(() => { |
|||
this.getList(); |
|||
this.$modal.msgSuccess("删除成功"); |
|||
}).catch(() => {}); |
|||
}, |
|||
/** 导出按钮操作 */ |
|||
handleExport() { |
|||
this.download('system/SysPoint/export', { |
|||
...this.queryParams |
|||
}, `SysPoint_${new Date().getTime()}.xlsx`) |
|||
} |
|||
} |
|||
}; |
|||
</script> |
|||
Loading…
Reference in new issue