节点功能大致完成

This commit is contained in:
qianlan 2021-08-24 13:51:23 +08:00
parent 28e97ce97a
commit 3804b9ad38
22 changed files with 2113 additions and 165 deletions

View File

@ -1,11 +1,9 @@
#!/bin/bash #!/bin/bash
#使用说明,用来提示输入参数 #使用说明,用来提示输入参数
usage() { usage() {
echo "Usage: sh 执行脚本.sh [port|mount|monitor|base|start|stop|stopall|rm|rmiNoneTag]" echo "Usage: sh 执行脚本.sh [port|mount|monitor|base|start|stop|stopall|rm|rmiNoneTag]"
exit 1 exit 1
} }
#开启所需端口(生产环境不推荐开启) #开启所需端口(生产环境不推荐开启)
port(){ port(){
# mysql 端口 # mysql 端口

View File

@ -18,8 +18,6 @@ services:
- /docker/mysql/data/:/var/lib/mysql/ - /docker/mysql/data/:/var/lib/mysql/
# 配置挂载 # 配置挂载
- /docker/mysql/conf/:/etc/mysql/conf.d/ - /docker/mysql/conf/:/etc/mysql/conf.d/
# 主机本机时间文件映射 与本机时间同步
- /etc/localtime:/etc/localtime:ro
command: command:
# 将mysql8.0默认密码策略 修改为 原先 策略 (mysql8.0对其默认策略做了更改 会导致密码无法匹配) # 将mysql8.0默认密码策略 修改为 原先 策略 (mysql8.0对其默认策略做了更改 会导致密码无法匹配)
--default-authentication-plugin=mysql_native_password --default-authentication-plugin=mysql_native_password
@ -37,6 +35,9 @@ services:
# 如果需要指定版本 就把 latest 换成版本号 # 如果需要指定版本 就把 latest 换成版本号
image: nginx:latest image: nginx:latest
container_name: nginx-web container_name: nginx-web
environment:
# 时区上海
TZ: Asia/Shanghai
ports: ports:
- 80:80 - 80:80
- 443:443 - 443:443
@ -49,8 +50,6 @@ services:
- /docker/nginx/html:/usr/share/nginx/html - /docker/nginx/html:/usr/share/nginx/html
# 日志目录 # 日志目录
- /docker/nginx/log:/var/log/nginx - /docker/nginx/log:/var/log/nginx
# 主机本机时间文件映射 与本机时间同步
- /etc/localtime:/etc/localtime:ro
privileged: true privileged: true
restart: always restart: always
networks: networks:
@ -62,16 +61,13 @@ services:
ports: ports:
- 6379:6379 - 6379:6379
environment: environment:
# 设置环境变量 时区上海 编码UTF-8 # 时区上海
TZ: Asia/Shanghai TZ: Asia/Shanghai
LANG: en_US.UTF-8
volumes: volumes:
# 配置文件 # 配置文件
- /docker/redis/conf/redis.conf:/redis.conf:rw - /docker/redis/conf/redis.conf:/redis.conf:rw
# 数据文件 # 数据文件
- /docker/redis/data:/data:rw - /docker/redis/data:/data:rw
# 主机本机时间文件映射 与本机时间同步
- /etc/localtime:/etc/localtime:ro
command: "redis-server --appendonly yes" command: "redis-server --appendonly yes"
privileged: true privileged: true
restart: always restart: always
@ -88,6 +84,8 @@ services:
# 控制台端口 # 控制台端口
- 9001:9001 - 9001:9001
environment: environment:
# 时区上海
TZ: Asia/Shanghai
# 管理后台用户名 # 管理后台用户名
MINIO_ACCESS_KEY: ruoyi MINIO_ACCESS_KEY: ruoyi
# 管理后台密码最小8个字符 # 管理后台密码最小8个字符
@ -97,8 +95,6 @@ services:
- /docker/minio/data:/data - /docker/minio/data:/data
# 映射配置目录 # 映射配置目录
- /docker/minio/config:/root/.minio/ - /docker/minio/config:/root/.minio/
# 主机本机时间文件映射 与本机时间同步
- /etc/localtime:/etc/localtime:ro
command: server --console-address ':9001' /data # 指定容器中的目录 /data command: server --console-address ':9001' /data # 指定容器中的目录 /data
privileged: true privileged: true
restart: always restart: always
@ -109,7 +105,8 @@ services:
ruoyi-server1: ruoyi-server1:
image: "ruoyi/ruoyi-server:2.6.0" image: "ruoyi/ruoyi-server:2.6.0"
environment: environment:
- TZ=Asia/Shanghai # 时区上海
TZ: Asia/Shanghai
volumes: volumes:
# 配置文件 # 配置文件
- /docker/server1/logs/:/ruoyi/server/logs/ - /docker/server1/logs/:/ruoyi/server/logs/
@ -123,7 +120,8 @@ services:
ruoyi-server2: ruoyi-server2:
image: "ruoyi/ruoyi-server:2.6.0" image: "ruoyi/ruoyi-server:2.6.0"
environment: environment:
- TZ=Asia/Shanghai # 时区上海
TZ: Asia/Shanghai
volumes: volumes:
# 配置文件 # 配置文件
- /docker/server2/logs/:/ruoyi/server/logs/ - /docker/server2/logs/:/ruoyi/server/logs/
@ -137,7 +135,8 @@ services:
ruoyi-monitor-admin: ruoyi-monitor-admin:
image: "ruoyi/ruoyi-monitor-admin:2.6.0" image: "ruoyi/ruoyi-monitor-admin:2.6.0"
environment: environment:
- TZ=Asia/Shanghai # 时区上海
TZ: Asia/Shanghai
privileged: true privileged: true
restart: always restart: always
networks: networks:

View File

@ -40,8 +40,9 @@
<minio.version>8.2.0</minio.version> <minio.version>8.2.0</minio.version>
<!-- docker 配置 --> <!-- docker 配置 -->
<docker.registry.url>localhost</docker.registry.url> <docker.registry.url>182.92.67.41</docker.registry.url>
<docker.registry.host>http://${docker.registry.url}:2375</docker.registry.host> <docker.registry.host>https://${docker.registry.url}:2376</docker.registry.host>
<dockerCertPath>D:\DevEnvironment\dockerTls</dockerCertPath>
<docker.namespace>ruoyi</docker.namespace> <docker.namespace>ruoyi</docker.namespace>
<docker.plugin.version>1.2.2</docker.plugin.version> <docker.plugin.version>1.2.2</docker.plugin.version>
</properties> </properties>

View File

@ -2,9 +2,13 @@ package com.ruoyi.web.controller.qianlan;
import java.util.List; import java.util.List;
import java.util.Arrays; import java.util.Arrays;
import java.util.Map;
import com.ruoyi.system.domain.TestNode;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -38,6 +42,33 @@ public class TestNodeController extends BaseController {
private final ITestNodeService iTestNodeService; private final ITestNodeService iTestNodeService;
/**
* 获取根节点的名字用于前端页面展示
*
* @return
*/
@ApiOperation("/查询根节点的名字")
@GetMapping("/listRootName")
public AjaxResult getTags() {
List list = iTestNodeService.getTags();
return AjaxResult.success(list);
}
/**
* 查询节点以children的方式展示
*/
@ApiOperation("/查询节点以children形式展示")
//@PreAuthorize("@ss.hasPermi('system:node:list')")
@GetMapping("/listWithChildren")
public AjaxResult listWithChildren(String nodeName) {
List<TestNode> nodeList = iTestNodeService.queryListWithChildren(nodeName);
if (nodeList == null) {
return AjaxResult.error("查询无果");
} else {
return AjaxResult.success(nodeList);
}
}
/** /**
* 查询节点维护列表 * 查询节点维护列表
*/ */
@ -85,6 +116,17 @@ public class TestNodeController extends BaseController {
return toAjax(iTestNodeService.insertByBo(bo) ? 1 : 0); return toAjax(iTestNodeService.insertByBo(bo) ? 1 : 0);
} }
/**
* 新增多个节点维护
*/
@ApiOperation("新增多个节点维护")
@Log(title = "节点维护", businessType = BusinessType.INSERT)
@RepeatSubmit
@PostMapping("/addMultiple")
public AjaxResult<Void> addMultiple(@RequestBody Map map) {
return iTestNodeService.addMultiple(map);
}
/** /**
* 修改节点维护 * 修改节点维护
*/ */
@ -102,7 +144,7 @@ public class TestNodeController extends BaseController {
*/ */
@ApiOperation("删除节点维护") @ApiOperation("删除节点维护")
@PreAuthorize("@ss.hasPermi('system:node:remove')") @PreAuthorize("@ss.hasPermi('system:node:remove')")
@Log(title = "节点维护" , businessType = BusinessType.DELETE) @Log(title = "节点维护", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空") public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ids) { @PathVariable Long[] ids) {

View File

@ -78,7 +78,7 @@ spring:
# 数据库索引 # 数据库索引
database: 0 database: 0
# 密码 # 密码
password: password: 123456
# 连接超时时间 # 连接超时时间
timeout: 10s timeout: 10s
# 是否开启ssl # 是否开启ssl

View File

@ -89,6 +89,8 @@ spring:
jackson: jackson:
# 日期格式化 # 日期格式化
date-format: yyyy-MM-dd HH:mm:ss date-format: yyyy-MM-dd HH:mm:ss
# 忽略null属性值不传递
default-property-inclusion: non_null
serialization: serialization:
# 格式化输出 # 格式化输出
indent_output: false indent_output: false

View File

@ -22,6 +22,11 @@
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId> <artifactId>ruoyi-common</artifactId>
</dependency> </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>

View File

@ -1,12 +1,14 @@
package com.ruoyi.system.domain; package com.ruoyi.system.domain;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
/** /**
* 节点维护对象 test_node * 节点维护对象 test_node
@ -44,4 +46,9 @@ public class TestNode implements Serializable {
*/ */
private Long pid; private Long pid;
/**
* 子节点
*/
@TableField(exist = false)
private List<TestNode> children;
} }

View File

@ -2,8 +2,8 @@ package com.ruoyi.system.mapper;
import com.ruoyi.system.domain.TestNode; import com.ruoyi.system.domain.TestNode;
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
import org.apache.ibatis.annotations.CacheNamespace; import java.util.List;
/** /**
* 节点维护Mapper接口 * 节点维护Mapper接口
@ -13,4 +13,10 @@ import org.apache.ibatis.annotations.CacheNamespace;
*/ */
public interface TestNodeMapper extends BaseMapperPlus<TestNode> { public interface TestNodeMapper extends BaseMapperPlus<TestNode> {
/**
* 查询节点以children的方式展示
* @param nodeId 前端传来的节点名
* @return 带children的节点list
*/
List<TestNode> queryListWithChildren(Long nodeId);
} }

View File

@ -1,5 +1,6 @@
package com.ruoyi.system.service; package com.ruoyi.system.service;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.TestNode; import com.ruoyi.system.domain.TestNode;
import com.ruoyi.system.domain.vo.TestNodeVo; import com.ruoyi.system.domain.vo.TestNodeVo;
import com.ruoyi.system.domain.bo.TestNodeBo; import com.ruoyi.system.domain.bo.TestNodeBo;
@ -7,6 +8,7 @@ import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 节点维护Service接口 * 节点维护Service接口
@ -15,6 +17,8 @@ import java.util.List;
* @date 2021-08-08 * @date 2021-08-08
*/ */
public interface ITestNodeService extends IServicePlus<TestNode, TestNodeVo> { public interface ITestNodeService extends IServicePlus<TestNode, TestNodeVo> {
/** /**
* 查询单个 * 查询单个
* @return * @return
@ -48,4 +52,24 @@ public interface ITestNodeService extends IServicePlus<TestNode, TestNodeVo> {
* @return * @return
*/ */
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
/**
* 查询节点以children的方式展示
* @param nodeName 前端传来的节点名
* @return 带children的节点list
*/
List<TestNode> queryListWithChildren(String nodeName);
/**
* 获取根节点的名字用于前端页面展示
* @return
*/
List getTags();
/**
* 添加多个节点
* @param map
* @return
*/
AjaxResult<Void> addMultiple(Map map);
} }

View File

@ -2,6 +2,9 @@ package com.ruoyi.system.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -12,6 +15,7 @@ import com.ruoyi.system.domain.TestNode;
import com.ruoyi.system.mapper.TestNodeMapper; import com.ruoyi.system.mapper.TestNodeMapper;
import com.ruoyi.system.service.ITestNodeService; import com.ruoyi.system.service.ITestNodeService;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Collection; import java.util.Collection;
@ -25,8 +29,11 @@ import java.util.Collection;
@Service @Service
public class TestNodeServiceImpl extends ServicePlusImpl<TestNodeMapper, TestNode, TestNodeVo> implements ITestNodeService { public class TestNodeServiceImpl extends ServicePlusImpl<TestNodeMapper, TestNode, TestNodeVo> implements ITestNodeService {
@Autowired
private TestNodeMapper testNodeMapper;
@Override @Override
public TestNodeVo queryById(Long id){ public TestNodeVo queryById(Long id) {
return getVoById(id); return getVoById(id);
} }
@ -64,15 +71,99 @@ public class TestNodeServiceImpl extends ServicePlusImpl<TestNodeMapper, TestNod
* *
* @param entity 实体类数据 * @param entity 实体类数据
*/ */
private void validEntityBeforeSave(TestNode entity){ private void validEntityBeforeSave(TestNode entity) {
//TODO 做一些数据校验,如唯一约束 //TODO 做一些数据校验,如唯一约束
} }
@Override @Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){ if (isValid) {
//TODO 做一些业务上的校验,判断是否需要校验 //TODO 做一些业务上的校验,判断是否需要校验
} }
return removeByIds(ids); return removeByIds(ids);
} }
/**
* 查询节点以children的方式展示
*
* @param nodeName 前端传来的节点名
* @return 带children的节点list
*/
@Override
public List<TestNode> queryListWithChildren(String nodeName) {
List<TestNode> nodeList = testNodeMapper.selectList(new QueryWrapper<TestNode>().like("name", nodeName));
if (nodeList.size() == 0) {
return null;
}
Long id = nodeList.get(0).getId();
//获得根节点下的所有子节点
List<TestNode> testNodeList = testNodeMapper.queryListWithChildren(id);
ArrayList<TestNode> nodeArrayList = new ArrayList<>();
nodeList.get(0).setChildren(testNodeList);
nodeArrayList.add(nodeList.get(0));
return nodeArrayList;
}
/**
* 获取根节点的名字用于前端页面展示
*
* @return
*/
@Override
public List getTags() {
List<TestNode> nodeList = testNodeMapper.selectList(new QueryWrapper<TestNode>().eq("pid", 0));
ArrayList<String> arrayList = new ArrayList();
for (TestNode testNode : nodeList) {
arrayList.add(testNode.getName());
}
return arrayList;
}
/**
* 添加多个节点
*
* @param map
* @return
*/
@Override
public AjaxResult<Void> addMultiple(Map map) {
int insert = 0;
int insert1 = 0;
String name = (String) map.get("name");
String categary = (String) map.get("categary");
Long pid = ((Integer) map.get("pid")).longValue();
String[] nameArray = name.split("#");
if (StrUtil.isNotBlank(categary)) {
String[] categaryArray = categary.split("#");
if (nameArray.length != categaryArray.length) {
return AjaxResult.error("输入数量不匹配,请重新提交");
} else {
for (int i = 0; i < nameArray.length; i++) {
TestNode testNode = new TestNode();
testNode.setName(nameArray[i]);
testNode.setCategary(categaryArray[i]);
testNode.setPid(pid);
if (categaryArray[i].trim().isEmpty()) {
testNode.setCategary(null);
}
testNodeMapper.insert(testNode);
insert++;
}
}
} else {
for (int i = 0; i < nameArray.length; i++) {
TestNode testNode = new TestNode();
testNode.setName(nameArray[i]);
testNode.setPid(pid);
testNodeMapper.insert(testNode);
insert1++;
}
}
if (nameArray.length == insert || nameArray.length == insert1) {
return AjaxResult.success("添加成功");
} else {
return AjaxResult.error("添加失败");
}
}
} }

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.TestNodeMapper"> <mapper namespace="com.ruoyi.system.mapper.TestNodeMapper">
<resultMap type="com.ruoyi.system.domain.TestNode" id="TestNodeResult"> <resultMap type="com.ruoyi.system.domain.TestNode" id="TestNodeResult">
@ -11,5 +11,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="pid" column="pid"/> <result property="pid" column="pid"/>
</resultMap> </resultMap>
<!--递归查询所有节点-->
<resultMap id="nodeWithChildren" type="com.ruoyi.system.domain.TestNode">
<id column="id" property="id"></id>
<result column="name" property="name"></result>
<result column="categary" property="categary"></result>
<collection property="children" ofType="com.ruoyi.system.domain.TestNode"
select="com.ruoyi.system.mapper.TestNodeMapper.queryListWithChildren" column="id">
</collection>
</resultMap>
<!--查询节点以children的方式展示-->
<select id="queryListWithChildren" resultMap="nodeWithChildren">
SELECT n.id id,
n.`name` name,
n.categary categary
FROM test_node n
WHERE n.pid = #{nodeId}
</select>
</mapper> </mapper>

View File

@ -0,0 +1,19 @@
import org.junit.Test;
/**
* @author qianlan
* @version 1.0
* @date 2021/8/18 11:18
*/
public class testNode {
@Test
public void test1(){
String name = "12,3,1,哲, ,90";
String[] nameArray = name.split(",");
System.out.println(nameArray.length);
for (String s : nameArray) {
System.out.println(s);
}
}
}

View File

@ -1,5 +1,14 @@
import request from '@/utils/request' import request from '@/utils/request'
// 查询根节点名字
export function listRootName() {
return request({
url: '/system/node/listRootName',
method: 'get'
})
}
// 查询节点维护列表 // 查询节点维护列表
export function listNode(query) { export function listNode(query) {
return request({ return request({
@ -9,6 +18,15 @@ export function listNode(query) {
}) })
} }
// 根据节点名称查询列表以children形式展示
export function listNodeWithChildren(query) {
return request({
url: '/system/node/listWithChildren',
method: 'get',
params: query
})
}
// 查询节点维护详细 // 查询节点维护详细
export function getNode(id) { export function getNode(id) {
return request({ return request({
@ -26,6 +44,15 @@ export function addNode(data) {
}) })
} }
// 新增多个节点维护
export function addMultipleNode(data) {
return request({
url: '/system/node/addMultiple',
method: 'post',
data: data
})
}
// 修改节点维护 // 修改节点维护
export function updateNode(data) { export function updateNode(data) {
return request({ return request({

View File

@ -0,0 +1,316 @@
<template>
<div id="chart" class="chart">
</div>
</template>
<script>
// ECharts
var echarts = require('echarts/lib/echarts');
//
require('echarts/lib/chart/graph');
//
require('echarts/lib/component/tooltip');
require('echarts/lib/component/title');
export default {
name: 'Charts',
components: {},
mixins: [],
props: {
chartList: {
type: Array,
required: true
}
},
watch: {
chartList: {
handler(val) {
this.formatData(val, true)
}
}
},
data() {
return {
myChart: '',
seriesData: [],
seriesLinks: [],
lastClickId: '',
};
},
computed: {},
methods: {
/**
* 点击节点展开
* @param {*} id
*/
expendNodes(id) {
return new Promise((resolve, reject) => {
let totalList = []
console.log("数据chartList", this.chartList)
//children
if (this.chartList) {
this.chartList.forEach(item => {
console.log("item", item)
console.log("totalList", totalList)
this.getDeepChildrens(totalList, item, 0)
})
}
let list = []
console.log("totalList:", totalList)
for (let item of totalList) {
if (item.parentId.toString() === id) {
const {children, ...reset} = item
list.push({
...reset
})
}
}
if (list.length > 0) {
resolve(list)
} else {
reject()
}
})
},
/**
* 递归数组,把所有children都拆出来到第一层
* @param {*} list
* @param {*} item
*/
getDeepChildrens(list, item, parentId) {
const {children, ...reset} = item
list.push(
{
...reset,
parentId,
}
)
if (children && children.length > 0) {
children.forEach(child => {
this.getDeepChildrens(list, child, item.id)
})
}
},
/**
* 节点点击事件
*/
async nodeClick(params) {
const index = this.seriesData.findIndex(item => item.id === params.data.id)
const info = this.seriesData[index]
if (info.isRoot) return
if (!info.isClicked) {
this.lastClickId = info.id
info.isClicked = true
this.seriesData.splice(index, 1, info)
let result = await this.expendNodes(info.id)
this.formatData(result)
} else { //
info.isClicked = false
this.seriesData.splice(index, 1, info)
this.removeChilds(info.id)
}
},
/**
* 设置echarts配置项,重绘画布
*/
initCharts() {
if (!this.myChart) {
this.myChart = echarts.init(document.getElementById('chart'));
this.myChart.on('click', (params) => {
if (params.dataType === "node") { //
this.nodeClick(params)
console.log('params', params)
}
})
}
//
let option = {
//
animationDurationUpdate: 1500,
animationEasingUpdate: 'quinticInOut',
tooltip: {
show: false
},
series: [
{
type: 'graph',
layout: 'force',
legendHoverLink: true, // hover()
hoverAnimation: true, //
edgeLabel: {
position: 'middle', //
normal: {
formatter: "{c}",
show: true,
}
},
edgeSymbol: ['arrow', ''],
force: {
edgeLength: 120,
repulsion: 500
},
roam: true,
draggable: true,//
itemStyle: {
normal: {
color: '#7f00fa',
cursor: 'pointer',
//color:Math.floor(Math.random()*16777215).toString(16),
// color: ['#fc853e','#28cad8','#9564bf','#bd407e','#28cad8','#fc853e','#e5a214'],
label: {
//formatter: "{c}",
show: true,
position: [-10, -15],
textStyle: { //
color: '#50ff70', //
fontStyle: 'normal',// 'normal' 'italic' 'oblique'
fontWeight: 'bolder',//'normal''bold''bolder''lighter'100 | 200 | 300 | 400...
fontFamily: 'sans-serif', //
fontSize: 13, //
}
},
nodeStyle: {
brushType: "both",
borderColor: "rgba(255,215,0,0.4)",
borderWidth: 1,
},
},
//
emphasis: {
shadowColor: '#00FAE1',
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowBlur: 40,
},
},
lineStyle: {
width: 2,
},
label: {
color: '#00FAE1',
fontSize: 8,
},
symbolSize: 14,//
links: this.seriesLinks,
data: this.seriesData,
cursor: 'pointer',
}
]
};
console.log('option', option)
// 使
this.myChart.setOption(option);
},
/**
* 格式化数据到表格需要的数据
*/
formatData(list, reset = false) {
console.log("list为",list)
let nodes = []
const data = []
const links = []
let target = ''
if (reset) {
this.seriesData = []
this.seriesLinks = []
if (list[0].children != null) {
nodes = [].concat(list[0].children)
}
target = list[0].id + ''
const dataInfo = {
"id": target,
"name": list[0].name,
category: list[0].categary || "",
isClicked: true,
isRoot: true,
symbolSize: 30,
}
data.push(dataInfo)
} else {
nodes = [].concat(list)
target = this.lastClickId
}
nodes.forEach((item, index) => {
// idstring 线
const id = item.id + ''
const dataInfo = {
"id": id,
parentId: target,
category: item.categary || "",
"name": item.name,
isClicked: false,
}
data.push(dataInfo)
if (target != item.id) {
links.push({
value: item.categary || "",
target: target,
source: id,
})
}
})
this.seriesData.push(...data)
this.seriesLinks.push(...links)
this.initCharts()
},
/**
* 点击节点折叠操作
*/
removeChilds(id) {
// data
let list = []
let links = []
let delIds = []
this.getDeleteParentIds(delIds, [id])
this.seriesData.map(item => {
if (!delIds.includes(item.id)) {
list.push(item)
}
})
this.seriesLinks.map(item => {
if (!delIds.includes(item.source) && !delIds.includes(item.target)) {
links.push(item)
}
})
this.seriesData = [].concat(list)
this.seriesLinks = [].concat(links)
this.initCharts()
},
/**
* 递归获取当前节点以下节点id
*/
getDeleteParentIds(delIds, ids) {
let list = []
this.seriesData.map(item => {
if (ids.includes(item.parentId)) {
list.push(item.id)
}
})
if (list.length > 0) {
delIds.push(...list)
this.getDeleteParentIds(delIds, list)
}
}
},
created() {
},
mounted() {
},
beforeDestroy() {
}
}
</script>
<style scoped>
.chart {
height: 100%;
}
</style>

View File

@ -0,0 +1,173 @@
<template>
<div class="container">
<svg class="keywords" @mousemove="listener($event)">
<a href="javascript:void(0)" v-for="(tag,index) in tags" :key="index" @click="nodeClick(tag)">
<text
class="text"
:x="tag.x"
:y="tag.y"
:font-size="20 * (600/(600-tag.z))"
:fill-opacity="((400+tag.z)/600)"
:fill="tag.color"
>{{ tag.text }}
</text>
</a>
</svg>
</div>
</template>
<script>
import {listRootName} from '../../api/system/node'
export default {
name: 'Keywords',
components: {},
mixins: [],
props: {},
data() {
return {
categarys: ["java","前端","灯芯绒","java","前端","灯芯绒","java","前端","灯芯绒"],
tags: [],
RADIUS: 200,
ZRADIUS: 200,
CX: 600,
CY: 300,
speedX: Math.PI / 360,
speedY: Math.PI / 360,
};
},
computed: {},
methods: {
getTagsNames() {
listRootName().then(response => {
this.categarys = response.data;
});
},
/**
* 标签点击
*/
async nodeClick(tag) {
this.$emit('searchData', tag.text)
},
/**
* 初始化标签数据
*/
initTags() {
const tagNames = [...this.categarys]
//
let tags = [];
const length = tagNames.length
for (let i = 0; i < length; i++) {
let tag = {};
let k = -1 + (2 * (i + 1) - 1) / length;
let a = Math.acos(k);
let b = a * Math.sqrt(length * Math.PI);
tag.text = tagNames[i];
tag.x = this.CX + this.RADIUS * Math.sin(a) * Math.cos(b);
tag.y = this.CY + this.RADIUS * Math.sin(a) * Math.sin(b);
tag.z = this.ZRADIUS * Math.cos(a);
tag.color =
"rgb(" +
parseInt(Math.random() * 255) +
"," +
parseInt(Math.random() * 255) +
"," +
parseInt(Math.random() * 255) +
")";
tags.push(tag);
}
this.tags = [].concat(tags);
},
/**
* 自动滚动效果,计算滚动位置
*/
rotateX(speedX) {
var cos = Math.cos(speedX);
var sin = Math.sin(speedX);
for (let tag of this.tags) {
var y1 = (tag.y - this.CY) * cos - tag.z * sin + this.CY;
var z1 = tag.z * cos + (tag.y - this.CY) * sin;
tag.y = y1;
tag.z = z1;
}
},
/**
* 自动滚动效果,计算滚动位置
*/
rotateY(speedY) {
var cos = Math.cos(speedY);
var sin = Math.sin(speedY);
for (let tag of this.tags) {
var x1 = (tag.x - this.CX) * cos - tag.z * sin + this.CX;
var z1 = tag.z * cos + (tag.x - this.CX) * sin;
tag.x = x1;
tag.z = z1;
}
},
/**
* 响应鼠标移动
*/
listener(event) {
//
var x = event.clientX - this.CX;
var y = event.clientY - this.CY;
this.speedX =
x * 0.0001 > 0
? Math.min(this.RADIUS * 0.00002, x * 0.0001)
: Math.max(-this.RADIUS * 0.00002, x * 0.0001);
this.speedY =
y * 0.0001 > 0
? Math.min(this.RADIUS * 0.00002, y * 0.0001)
: Math.max(-this.RADIUS * 0.00002, y * 0.0001);
},
/**
* 监听窗体大小变化
*/
resizeWindow() {
let height = document.body.clientHeight
let width = document.body.clientWidth
width = width * 0.85;
if (width > 1200) {
this.CX = width / 2
}
height = height - 150
this.CY = height / 2;
let radius = Math.min(this.CY, this.CX) / 2
if (radius > 200) {
this.RADIUS = radius
}
this.initTags()
this.$emit('windowResize')
}
},
created() {
},
mounted() {
this.getTagsNames();
this.resizeWindow()
window.addEventListener('resize', this.resizeWindow)
this.initTags()
//使
const interval = setInterval(() => {
this.rotateX(this.speedX);
this.rotateY(this.speedY);
}, 17);
this.$once('hook:beforedestroy', () => {
interval && clearInterval(interval)
window.removeEventListener('resize', this.resizeWindow)
})
},
beforeDestroy() {
}
}
</script>
<style scoped>
.container, .keywords {
width: 100%;
height: 100%;
}
.keywords .text:hover {
font-size: 200%;
}
</style>

View File

@ -0,0 +1,158 @@
<template>
<div class="container">
<div class="center">
<div class="header">
<input
type="text"
class="ipt"
v-model="queryParam.nodeName"
@keydown.enter="search"
placeholder="搜索灯芯绒试试"
/>
<p class="tips">
<span>搜索示例:灯芯绒</span>
</p>
</div>
<div class="canvas">
<Keywords v-show="type === 1" @searchData="searching" @windowResize="windowResize"></Keywords>
<Charts ref="charts" v-show="type === 2" :chartList="listdata"/>
</div>
</div>
</div>
</template>
<script>
import Keywords from "./Keywords";
import Charts from "./Charts";
import {listNodeWithChildren} from '@/api/system/node'
import {Message} from "element-ui";
export default {
name: "KnowledgeGraph",
components: {
Keywords,
Charts,
},
mixins: [],
props: {},
data() {
return {
type: 1,
listdata: [],
queryParam: {
nodeName: ""
}
};
},
computed: {},
methods: {
searching(text) {
this.queryParam.nodeName = text;
this.getDataList();
if (this.listdata != null) {
this.type = 2
}
},
//
getDataList() {
console.log(this.queryParam)
listNodeWithChildren(this.queryParam).then(response => {
this.listdata = [].concat(response.data)
});
},
/**
* 搜索方法,text为空则为点击类别操作,不为空则为输入框搜索
*/
search() {
if (this.queryParam.nodeName == "") {
this.type = 1
} else {
this.getDataList();
if (this.listdata.length == 0) {
this.type = 2
}
}
},
/**
* 窗体大小变化回调
*/
windowResize() {
const charts = this.$refs.charts
charts && charts.myChart && charts.myChart.resize()
},
},
mounted() {
this.type = 1
}
}
</script>
<style scoped>
.container {
overflow: hidden;
position: relative;
min-height: 100vh;
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
background-color: #0b2838;
}
input {
outline: none;
padding-left: 24px;
padding-right: 41px;
}
input::-webkit-input-placeholder {
color: #ccc;
font-size: 14px;
}
input::-moz-placeholder {
color: #ccc;
font-size: 14px;
}
input:-ms-input-placeholder {
color: #ccc;
font-size: 14px;
}
.canvas {
margin-top: 10px;
height: calc(100vh - 110px);
}
.center {
position: relative;
min-width: 1200px;
margin: 0 auto;
width: 100%;
}
.header {
padding-top: 30px;
}
.ipt {
border: 1px solid #9093c7;
border-radius: 20px;
width: 374px;
height: 44px;
line-height: 44px;
box-sizing: border-box;
color: #555;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
}
.tips {
font-size: 14px;
color: #ccc;
line-height: 17px;
margin-top: 5px;
}
</style>

View File

@ -0,0 +1,459 @@
/**
* 图谱数据源
*/
export const data = [
{
id: 10000,
name: '盗墓笔记重启[南派三叔所著小说]',
categary: '百科',
children: [
{
id: 2,
name: '盗墓笔记重启',
categary: '中文名称',
},
{
id: 3,
name: '南派三叔',
categary: '作者',
children: [
{
id: 301,
name: '企业家',
categary: '职业',
children: [
{
id: 30101,
name: '冒险家,创新者',
categary: '特征',
},
{
id: 30102,
name: '掌控者,领导者',
categary: '企业角色',
},
{
id: 30103,
name: 'entrepreneur',
categary: '外文名',
}
]
},
{
id: 302,
name: '南派三叔',
categary: '别名',
},
{
id: 303,
name: '浙江省嘉兴市嘉善县',
categary: '出生地',
},
{
id: 304,
name: '第七届中国作家富豪榜最佳冒险小说奖',
categary: '主要成就',
}
],
},
{
id: 4,
name: '悬疑',
categary: '类型',
},
{
id: 5,
name: '悬疑',
categary: '连载状态',
},
{
id: 6,
name: '连载平台',
categary: '个人微信公众号和互联网上',
},
{
id: 7,
name: '最新章节',
categary: '重启·极海听雷第两百二十四章结局了',
},
{
id: 8,
name: '小说主角',
categary: '吴邪、胖子、张起灵',
},
{
id: 9,
name: '连载状态',
categary: '连载中',
}
]
},
{
id: 20000,
name: '人工智能',
categary: '百科',
children: [{
"id": 1599811251651,
"name": "人工智能",
"categary": "中文名",
"children": [{
"id": 1599811494936,
"name": "YaoMing",
"categary": "外文名"
}, {
"id": 1599811494937,
"name": "明王",
"categary": "别名"
}, {
"id": 1599811494938,
"name": "移动长城",
"categary": "别名"
}, {
"id": 1599811494939,
"name": "小巨人",
"categary": "别名"
}, {
"id": 1599811494930,
"name": "大姚",
"categary": "别名"
}, {
"id": 1599811494931,
"name": "中国",
"categary": "国籍"
}, {
"id": 1599811494932,
"name": "汉族",
"categary": "民族"
}]
}, {
"id": 1599811251652,
"name": "ARTIFICIALINTELLIGENCE",
"categary": "外文名"
}, {
"id": 1599811251653,
"name": "AI",
"categary": "简称"
}, {
"id": 1599811251654,
"name": "1956年",
"categary": "提出时间"
}, {
"id": 1599811251655,
"name": "DARTMOUTH学会",
"categary": "提出地点"
}, {
"id": 1599811251656,
"name": "雨果·德·加里斯的著作",
"categary": "名称来源"
}]
},
{
id: 30000,
name: '姚明[亚洲篮球联合会主席、中国篮球协会主席]',
categary: '百科',
children: [{
"id": 1599811494936,
"name": "YaoMing",
"categary": "外文名"
}, {
"id": 1599811494937,
"name": "明王",
"categary": "别名"
}, {
"id": 1599811494938,
"name": "移动长城",
"categary": "别名"
}, {
"id": 1599811494939,
"name": "小巨人",
"categary": "别名"
}, {
"id": 1599811494930,
"name": "大姚",
"categary": "别名"
}, {
"id": 1599811494931,
"name": "中国",
"categary": "国籍"
}, {
"id": 1599811494932,
"name": "汉族",
"categary": "民族"
}]
},
{
id: 40000,
name: '知识图谱',
categary: '百科',
children: [{
"id": 1599813559392,
"name": "知识图谱",
"categary": "中文名"
}, {
"id": 1599813559393,
"name": "KnowledgeGraph/Vault",
"categary": "外文名"
}, {
"id": 1599813559394,
"name": "科学知识图谱",
"categary": "也称"
}, {
"id": 1599813559395,
"name": "理论与方法与计量学引文分析",
"categary": "应用"
}]
},
{
id: 50000,
name: '刘德华[中国香港男演员、歌手、制片人、填词人]',
categary: '百科',
children: [{
"id": 1599813694131,
"name": "AndyLauLauTakWah",
"categary": "外文名"
}, {
"id": 1599813694132,
"name": "华仔华Dee华哥等",
"categary": "别名"
}, {
"id": 1599813694133,
"name": "中国",
"categary": "国籍"
}, {
"id": 1599813694134,
"name": "汉族",
"categary": "民族"
}, {
"id": 1599813694135,
"name": "天秤座",
"categary": "星座"
}, {
"id": 1599813694136,
"name": "AB型",
"categary": "血型"
}, {
"id": 1599813694137,
"name": "174cm",
"categary": "身高"
}, {
"id": 1599813694138,
"name": "63kg",
"categary": "体重"
}]
},
{
id: 60000,
name: '番茄[茄科茄属植物]',
categary: '百科',
children: [{
"id": 1599813839207,
"name": "Solanumlycopersicum",
"categary": "拉丁学名"
}, {
"id": 1599813839208,
"name": "蕃柿、西红柿、洋柿子",
"categary": "别称"
}, {
"id": 1599813839209,
"name": "植物界",
"categary": "界"
}, {
"id": 1599813839210,
"name": "被子植物门",
"categary": "门"
}, {
"id": 1599813839211,
"name": "双子叶植物纲",
"categary": "纲"
}, {
"id": 1599813839212,
"name": "合瓣花亚纲",
"categary": "亚纲"
}, {
"id": 1599813839213,
"name": "管状花目",
"categary": "目"
}, {
"id": 1599813839214,
"name": "茄科",
"categary": "科"
}]
},
{
id: 70000,
name: '周杰伦',
categary: '百科',
children: [{
"id": 1599813927218,
"name": "JayChou",
"categary": "外文名"
}, {
"id": 1599813927219,
"name": "周董",
"categary": "别名"
}, {
"id": 1599813927220,
"name": "中国",
"categary": "国籍"
}, {
"id": 1599813927221,
"name": "汉族",
"categary": "民族"
}, {
"id": 1599813927222,
"name": "摩羯座",
"categary": "星座"
}, {
"id": 1599813927223,
"name": "O型",
"categary": "血型"
}, {
"id": 1599813927224,
"name": "175cm",
"categary": "身高"
}, {
"id": 1599813927225,
"name": "台湾省新北市",
"categary": "出生地"
}]
},
{
id: 80000,
name: '苏州大学',
categary: '百科',
children: [{
"id": 1599813971854,
"name": "SoochowUniversity",
"categary": "外文名"
}, {
"id": 1599813971855,
"name": "苏大",
"categary": "简称"
}, {
"id": 1599813971856,
"name": "1900年5月18日清光绪二十六年",
"categary": "创办时间"
}, {
"id": 1599813971857,
"name": "公立大学",
"categary": "类别"
}, {
"id": 1599813971858,
"name": "综合类",
"categary": "类型"
}, {
"id": 1599813971859,
"name": "211工程",
"categary": "属性"
}, {
"id": 1599813971860,
"name": "省部共建大学",
"categary": "属性"
}, {
"id": 1599813971861,
"name": "卓越工程师教育培养计划",
"categary": "属性"
}]
},
{
id: 90000,
name: '机器人[自动执行工作的机器装置]',
categary: '百科',
children: [{
"id": 1599814026913,
"name": "Robot",
"categary": "外文名"
}, {
"id": 1599814026914,
"name": "自动执行工作的机器装置",
"categary": "定义"
}, {
"id": 1599814026915,
"name": "人工智能技术",
"categary": "技术"
}, {
"id": 1599814026916,
"name": "微型计算机",
"categary": "驱动装置"
}, {
"id": 1599814026917,
"name": "电能",
"categary": "驱动能源"
}]
}
]
/**
* 模糊查询大类
* @param {*} name
*/
export const search = (name) => {
return new Promise((resolve, reject) => {
let result = []
let list = data.filter(item => item.name.indexOf(name) >= 0)
if (list && list.length > 0) {
result = list || []
}
if (result.length > 0) {
resolve(result)
} else {
reject()
}
})
}
/**
* 点击节点展开
* @param {*} id
*/
export const expendNodes = (id) => {
return new Promise((resolve, reject) => {
let totalList = []
//拆除来所有的children到第一层
data.forEach(item => {
getDeepChildrens(totalList, item, 0)
})
let list = []
for (let item of totalList) {
if (item.parentId.toString() === id) {
const {children, ...reset} = item
list.push({
...reset
})
}
}
if (list.length > 0) {
resolve(list)
} else {
reject()
}
})
}
/**
* 递归数组,把所有children都拆出来到第一层
* @param {*} list
* @param {*} item
*/
function getDeepChildrens(list, item, parentId) {
const {children, ...reset} = item
list.push(
{
...reset,
parentId,
}
)
if (children && children.length > 0) {
children.forEach(child => {
getDeepChildrens(list, child, item.id)
})
}
}
/**
* 分类数据
*/
export const categarys = ["人工智能", "知识图谱", "姚明", "刘德华", "机器人", "周杰伦", "苏州大学", "番茄", "盗墓笔记", "机器人", "人工智能", "知识图谱", "姚明", "刘德华", "机器人", "人工智能", "知识图谱", "姚明", "刘德华", "机器人", "人工智能", "知识图谱", "姚明", "刘德华", "机器人", "人工智能", "知识图谱", "姚明", "刘德华", "机器人"]

View File

@ -0,0 +1,293 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="节点名" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入节点名"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="分类" prop="categary">
<el-input
v-model="queryParams.categary"
placeholder="请输入分类"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="父id" prop="pid">
<el-input
v-model="queryParams.pid"
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"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:node:add']"
>新增</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="nodeList"
row-key="id"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column label="节点名" prop="name" />
<el-table-column label="id" prop="id" />
<el-table-column label="分类" align="center" prop="categary" />
<el-table-column label="父id" align="center" prop="pid" />
<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:node:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)"
v-hasPermi="['system:node:add']"
>新增</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)"
v-hasPermi="['system:node:add']"
>新增多个</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:node:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 添加或修改节点维护对话框 -->
<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="name">
<el-input v-model="form.name" placeholder="请输入节点名" />
</el-form-item>
<el-form-item label="分类" prop="categary">
<el-input v-model="form.categary" placeholder="请输入分类" />
</el-form-item>
<el-form-item label="父id" prop="pid">
<treeselect v-model="form.pid" :options="nodeOptions" :normalizer="normalizer" placeholder="请选择父id" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listNode, getNode, delNode, addNode, updateNode, exportNode } from "@/api/system/node";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "Node",
components: {
Treeselect
},
data() {
return {
// loading
buttonLoading: false,
//
loading: true,
//
showSearch: true,
//
nodeList: [],
//
nodeOptions: [],
//
title: "",
//
open: false,
//
queryParams: {
name: null,
categary: null,
pid: null
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询节点维护列表 */
getList() {
this.loading = true;
listNode(this.queryParams).then(response => {
this.nodeList = this.handleTree(response.data, "id", "pid");
this.loading = false;
});
},
/** 转换节点维护数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.id,
label: node.name,
children: node.children
};
},
/** 查询节点维护下拉树结构 */
getTreeselect() {
listNode().then(response => {
this.nodeOptions = [];
const data = { id: 0, name: '顶级节点', children: [] };
data.children = this.handleTree(response.data, "id", "pid");
this.nodeOptions.push(data);
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
name: null,
categary: null,
pid: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd(row) {
this.reset();
this.getTreeselect();
if (row != null && row.id) {
this.form.pid = row.id;
} else {
this.form.pid = 0;
}
this.open = true;
this.title = "添加节点维护";
},
/** 新增多个按钮操作 */
handleAddMultiple(row) {
this.reset();
this.getTreeselect();
if (row != null && row.id) {
this.form.pid = row.id;
} else {
this.form.pid = 0;
}
this.open = true;
this.title = "添加节点维护";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
this.getTreeselect();
if (row != null) {
this.form.pid = row.id;
}
getNode(row.id).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改节点维护";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.id != null) {
updateNode(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addNode(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$confirm('是否确认删除节点维护编号为"' + row.id + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.loading = true;
return delNode(row.id);
}).then(() => {
this.loading = false;
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
}
}
};
</script>

View File

@ -13,6 +13,7 @@
<el-form-item label="分类" prop="categary"> <el-form-item label="分类" prop="categary">
<el-input <el-input
v-model="queryParams.categary" v-model="queryParams.categary"
placeholder="请输入分类" placeholder="请输入分类"
clearable clearable
size="small" size="small"
@ -43,7 +44,8 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['system:node:add']" v-hasPermi="['system:node:add']"
>新增</el-button> >新增
</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@ -52,13 +54,12 @@
v-loading="loading" v-loading="loading"
:data="nodeList" :data="nodeList"
row-key="id" row-key="id"
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}" :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
> >
<el-table-column label="节点名" prop="name" /> <el-table-column label="节点名" prop="name"/>
<el-table-column label="id" prop="id" /> <el-table-column label="id" prop="id"/>
<el-table-column label="分类" align="center" prop="categary" /> <el-table-column label="分类" align="center" prop="categary"/>
<el-table-column label="父id" align="center" prop="pid" /> <el-table-column label="父id" align="center" prop="pid"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -67,21 +68,32 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:node:edit']" v-hasPermi="['system:node:edit']"
>修改</el-button> >修改
</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-plus" icon="el-icon-plus"
@click="handleAdd(scope.row)" @click="handleAdd(scope.row)"
v-hasPermi="['system:node:add']" v-hasPermi="['system:node:add']"
>新增</el-button> >新增
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAddMultiple(scope.row)"
v-hasPermi="['system:node:add']"
>新增多个
</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['system:node:remove']" v-hasPermi="['system:node:remove']"
>删除</el-button> >删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -90,13 +102,13 @@
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <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 ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="节点名" prop="name"> <el-form-item label="节点名" prop="name">
<el-input v-model="form.name" placeholder="请输入节点名" /> <el-input v-model="form.name" placeholder="请输入节点名"/>
</el-form-item> </el-form-item>
<el-form-item label="分类" prop="categary"> <el-form-item label="分类" prop="categary">
<el-input v-model="form.categary" placeholder="请输入分类" /> <el-input v-model="form.categary" placeholder="请输入分类"/>
</el-form-item> </el-form-item>
<el-form-item label="父id" prop="pid"> <el-form-item label="父id" prop="pid">
<treeselect v-model="form.pid" :options="nodeOptions" :normalizer="normalizer" placeholder="请选择父id" /> <treeselect v-model="form.pid" :options="nodeOptions" :normalizer="normalizer" placeholder="请选择父id"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -104,11 +116,30 @@
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 添加多个节点维护对话框 -->
<el-dialog :title="title" :visible.sync="addMultiple" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="节点名" prop="name">
<el-input v-model="form.name" placeholder="请输入节点名,多个节点名以英文逗号隔开"/>
</el-form-item>
<el-form-item label="分类" prop="categary">
<el-input v-model="form.categary" placeholder="多个分类名以英文逗号隔开,若分类为空以空格代替"/>
</el-form-item>
<el-form-item label="父id" prop="pid">
<treeselect v-model="form.pid" :options="nodeOptions" :normalizer="normalizer" placeholder="请选择父id"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitNewForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listNode, getNode, delNode, addNode, updateNode, exportNode } from "@/api/system/node"; import {listNode, getNode, delNode, addNode, updateNode, exportNode, addMultipleNode} from "@/api/system/node";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@ -133,6 +164,8 @@ export default {
title: "", title: "",
// //
open: false, open: false,
//
addMultiple: false,
// //
queryParams: { queryParams: {
name: null, name: null,
@ -142,8 +175,7 @@ export default {
// //
form: {}, form: {},
// //
rules: { rules: {}
}
}; };
}, },
created() { created() {
@ -173,13 +205,14 @@ export default {
getTreeselect() { getTreeselect() {
listNode().then(response => { listNode().then(response => {
this.nodeOptions = []; this.nodeOptions = [];
const data = { id: 0, name: '顶级节点', children: [] }; const data = {id: 0, name: '顶级节点', children: []};
data.children = this.handleTree(response.data, "id", "pid"); data.children = this.handleTree(response.data, "id", "pid");
this.nodeOptions.push(data); this.nodeOptions.push(data);
}); });
}, },
// //
cancel() { cancel() {
this.addMultiple = false;
this.open = false; this.open = false;
this.reset(); this.reset();
}, },
@ -214,6 +247,18 @@ export default {
this.open = true; this.open = true;
this.title = "添加节点维护"; this.title = "添加节点维护";
}, },
/** 新增多个按钮操作 */
handleAddMultiple(row) {
this.reset();
this.getTreeselect();
if (row != null && row.id) {
this.form.pid = row.id;
} else {
this.form.pid = 0;
}
this.addMultiple = true;
this.title = "添加多个节点维护";
},
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.loading = true; this.loading = true;
@ -254,6 +299,24 @@ export default {
} }
}); });
}, },
submitNewForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
console.log(this.form)
addMultipleNode(this.form).then(response => {
this.msgSuccess("新增成功");
this.addMultiple = false;
this.getList();
}).catch(e => {
console.log(e)
this.addMultiple = false;
}).finally(() => {
this.buttonLoading = false;
});
}
});
},
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
this.$confirm('是否确认删除节点维护编号为"' + row.id + '"的数据项?', "警告", { this.$confirm('是否确认删除节点维护编号为"' + row.id + '"的数据项?', "警告", {
@ -267,7 +330,8 @@ export default {
this.loading = false; this.loading = false;
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {
});
} }
} }
}; };

158
sql/sys_menu.sql Normal file
View File

@ -0,0 +1,158 @@
/*
Navicat MySQL Data Transfer
Source Server :
Source Server Type : MySQL
Source Server Version : 80026
Source Host : localhost:3306
Source Schema : ry-vue
Target Server Type : MySQL
Target Server Version : 80026
File Encoding : 65001
Date: 23/08/2021 13:53:54
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
`menu_id` bigint NOT NULL AUTO_INCREMENT COMMENT '菜单ID',
`menu_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '菜单名称',
`parent_id` bigint NULL DEFAULT 0 COMMENT '父菜单ID',
`order_num` int NULL DEFAULT 0 COMMENT '显示顺序',
`path` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '路由地址',
`component` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '组件路径',
`is_frame` int NULL DEFAULT 1 COMMENT '是否为外链0是 1否',
`is_cache` int NULL DEFAULT 0 COMMENT '是否缓存0缓存 1不缓存',
`menu_type` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '菜单类型M目录 C菜单 F按钮',
`visible` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '菜单状态0显示 1隐藏',
`status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '菜单状态0正常 1停用',
`perms` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限标识',
`icon` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '#' COMMENT '菜单图标',
`create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '创建者',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者',
`update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
`remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '备注',
PRIMARY KEY (`menu_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2006 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '菜单权限表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sys_menu
-- ----------------------------
INSERT INTO `sys_menu` VALUES (1, '系统管理', 0, 1, 'system', NULL, 1, 0, 'M', '0', '0', '', 'system', 'admin', '2021-08-06 15:01:44', '', NULL, '系统管理目录');
INSERT INTO `sys_menu` VALUES (2, '系统监控', 0, 2, 'monitor', NULL, 1, 0, 'M', '0', '0', '', 'monitor', 'admin', '2021-08-06 15:01:44', '', NULL, '系统监控目录');
INSERT INTO `sys_menu` VALUES (3, '系统工具', 0, 3, 'tool', NULL, 1, 0, 'M', '0', '0', '', 'tool', 'admin', '2021-08-06 15:01:44', '', NULL, '系统工具目录');
INSERT INTO `sys_menu` VALUES (4, 'PLUS官网', 0, 4, 'https://gitee.com/JavaLionLi/RuoYi-Vue-Plus', NULL, 0, 0, 'M', '0', '0', '', 'guide', 'admin', '2021-08-06 15:01:44', '', NULL, 'RuoYi-Vue-Plus官网地址');
INSERT INTO `sys_menu` VALUES (5, '测试菜单', 0, 5, 'demo', NULL, 1, 0, 'M', '0', '0', NULL, 'star', 'admin', '2021-05-30 00:34:26', NULL, NULL, '');
INSERT INTO `sys_menu` VALUES (100, '用户管理', 1, 1, 'user', 'system/user/index', 1, 0, 'C', '0', '0', 'system:user:list', 'user', 'admin', '2021-08-06 15:01:44', '', NULL, '用户管理菜单');
INSERT INTO `sys_menu` VALUES (101, '角色管理', 1, 2, 'role', 'system/role/index', 1, 0, 'C', '0', '0', 'system:role:list', 'peoples', 'admin', '2021-08-06 15:01:44', '', NULL, '角色管理菜单');
INSERT INTO `sys_menu` VALUES (102, '菜单管理', 1, 3, 'menu', 'system/menu/index', 1, 0, 'C', '0', '0', 'system:menu:list', 'tree-table', 'admin', '2021-08-06 15:01:44', '', NULL, '菜单管理菜单');
INSERT INTO `sys_menu` VALUES (103, '部门管理', 1, 4, 'dept', 'system/dept/index', 1, 0, 'C', '0', '0', 'system:dept:list', 'tree', 'admin', '2021-08-06 15:01:44', '', NULL, '部门管理菜单');
INSERT INTO `sys_menu` VALUES (104, '岗位管理', 1, 5, 'post', 'system/post/index', 1, 0, 'C', '0', '0', 'system:post:list', 'post', 'admin', '2021-08-06 15:01:44', '', NULL, '岗位管理菜单');
INSERT INTO `sys_menu` VALUES (105, '字典管理', 1, 6, 'dict', 'system/dict/index', 1, 0, 'C', '0', '0', 'system:dict:list', 'dict', 'admin', '2021-08-06 15:01:44', '', NULL, '字典管理菜单');
INSERT INTO `sys_menu` VALUES (106, '参数设置', 1, 7, 'config', 'system/config/index', 1, 0, 'C', '0', '0', 'system:config:list', 'edit', 'admin', '2021-08-06 15:01:44', '', NULL, '参数设置菜单');
INSERT INTO `sys_menu` VALUES (107, '通知公告', 1, 8, 'notice', 'system/notice/index', 1, 0, 'C', '0', '0', 'system:notice:list', 'message', 'admin', '2021-08-06 15:01:44', '', NULL, '通知公告菜单');
INSERT INTO `sys_menu` VALUES (108, '日志管理', 1, 9, 'log', '', 1, 0, 'M', '0', '0', '', 'log', 'admin', '2021-08-06 15:01:44', '', NULL, '日志管理菜单');
INSERT INTO `sys_menu` VALUES (109, '在线用户', 2, 1, 'online', 'monitor/online/index', 1, 0, 'C', '0', '0', 'monitor:online:list', 'online', 'admin', '2021-08-06 15:01:44', '', NULL, '在线用户菜单');
INSERT INTO `sys_menu` VALUES (110, '定时任务', 2, 2, 'job', 'monitor/job/index', 1, 0, 'C', '0', '0', 'monitor:job:list', 'job', 'admin', '2021-08-06 15:01:44', '', NULL, '定时任务菜单');
INSERT INTO `sys_menu` VALUES (111, '数据监控', 2, 3, 'druid', 'monitor/druid/index', 1, 0, 'C', '0', '0', 'monitor:druid:list', 'druid', 'admin', '2021-08-06 15:01:44', '', NULL, '数据监控菜单');
INSERT INTO `sys_menu` VALUES (113, '缓存监控', 2, 5, 'cache', 'monitor/cache/index', 1, 0, 'C', '0', '0', 'monitor:cache:list', 'redis', 'admin', '2021-08-06 15:01:44', '', NULL, '缓存监控菜单');
INSERT INTO `sys_menu` VALUES (114, '表单构建', 3, 1, 'build', 'tool/build/index', 1, 0, 'C', '0', '0', 'tool:build:list', 'build', 'admin', '2021-08-06 15:01:44', '', NULL, '表单构建菜单');
INSERT INTO `sys_menu` VALUES (115, '代码生成', 3, 2, 'gen', 'tool/gen/index', 1, 0, 'C', '0', '0', 'tool:gen:list', 'code', 'admin', '2021-08-06 15:01:44', '', NULL, '代码生成菜单');
INSERT INTO `sys_menu` VALUES (116, '系统接口', 3, 3, 'swagger', 'tool/swagger/index', 1, 0, 'C', '0', '0', 'tool:swagger:list', 'swagger', 'admin', '2021-08-06 15:01:44', '', NULL, '系统接口菜单');
INSERT INTO `sys_menu` VALUES (117, 'Admin监控', 2, 5, 'Admin', 'monitor/admin/index', 1, 0, 'C', '0', '0', 'monitor:admin:list', 'dashboard', 'admin', '2021-08-06 15:01:44', '', NULL, 'Admin监控菜单');
INSERT INTO `sys_menu` VALUES (118, '文件管理', 1, 10, 'oss', 'system/oss/index', 1, 0, 'C', '0', '0', 'system:oss:list', 'upload', 'admin', '2021-08-06 15:02:52', '', NULL, '文件管理菜单');
INSERT INTO `sys_menu` VALUES (500, '操作日志', 108, 1, 'operlog', 'monitor/operlog/index', 1, 0, 'C', '0', '0', 'monitor:operlog:list', 'form', 'admin', '2021-08-06 15:01:44', '', NULL, '操作日志菜单');
INSERT INTO `sys_menu` VALUES (501, '登录日志', 108, 2, 'logininfor', 'monitor/logininfor/index', 1, 0, 'C', '0', '0', 'monitor:logininfor:list', 'logininfor', 'admin', '2021-08-06 15:01:44', '', NULL, '登录日志菜单');
INSERT INTO `sys_menu` VALUES (1001, '用户查询', 100, 1, '', '', 1, 0, 'F', '0', '0', 'system:user:query', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1002, '用户新增', 100, 2, '', '', 1, 0, 'F', '0', '0', 'system:user:add', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1003, '用户修改', 100, 3, '', '', 1, 0, 'F', '0', '0', 'system:user:edit', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1004, '用户删除', 100, 4, '', '', 1, 0, 'F', '0', '0', 'system:user:remove', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1005, '用户导出', 100, 5, '', '', 1, 0, 'F', '0', '0', 'system:user:export', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1006, '用户导入', 100, 6, '', '', 1, 0, 'F', '0', '0', 'system:user:import', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1007, '重置密码', 100, 7, '', '', 1, 0, 'F', '0', '0', 'system:user:resetPwd', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1008, '角色查询', 101, 1, '', '', 1, 0, 'F', '0', '0', 'system:role:query', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1009, '角色新增', 101, 2, '', '', 1, 0, 'F', '0', '0', 'system:role:add', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1010, '角色修改', 101, 3, '', '', 1, 0, 'F', '0', '0', 'system:role:edit', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1011, '角色删除', 101, 4, '', '', 1, 0, 'F', '0', '0', 'system:role:remove', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1012, '角色导出', 101, 5, '', '', 1, 0, 'F', '0', '0', 'system:role:export', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1013, '菜单查询', 102, 1, '', '', 1, 0, 'F', '0', '0', 'system:menu:query', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1014, '菜单新增', 102, 2, '', '', 1, 0, 'F', '0', '0', 'system:menu:add', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1015, '菜单修改', 102, 3, '', '', 1, 0, 'F', '0', '0', 'system:menu:edit', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1016, '菜单删除', 102, 4, '', '', 1, 0, 'F', '0', '0', 'system:menu:remove', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1017, '部门查询', 103, 1, '', '', 1, 0, 'F', '0', '0', 'system:dept:query', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1018, '部门新增', 103, 2, '', '', 1, 0, 'F', '0', '0', 'system:dept:add', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1019, '部门修改', 103, 3, '', '', 1, 0, 'F', '0', '0', 'system:dept:edit', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1020, '部门删除', 103, 4, '', '', 1, 0, 'F', '0', '0', 'system:dept:remove', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1021, '岗位查询', 104, 1, '', '', 1, 0, 'F', '0', '0', 'system:post:query', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1022, '岗位新增', 104, 2, '', '', 1, 0, 'F', '0', '0', 'system:post:add', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1023, '岗位修改', 104, 3, '', '', 1, 0, 'F', '0', '0', 'system:post:edit', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1024, '岗位删除', 104, 4, '', '', 1, 0, 'F', '0', '0', 'system:post:remove', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1025, '岗位导出', 104, 5, '', '', 1, 0, 'F', '0', '0', 'system:post:export', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1026, '字典查询', 105, 1, '#', '', 1, 0, 'F', '0', '0', 'system:dict:query', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1027, '字典新增', 105, 2, '#', '', 1, 0, 'F', '0', '0', 'system:dict:add', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1028, '字典修改', 105, 3, '#', '', 1, 0, 'F', '0', '0', 'system:dict:edit', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1029, '字典删除', 105, 4, '#', '', 1, 0, 'F', '0', '0', 'system:dict:remove', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1030, '字典导出', 105, 5, '#', '', 1, 0, 'F', '0', '0', 'system:dict:export', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1031, '参数查询', 106, 1, '#', '', 1, 0, 'F', '0', '0', 'system:config:query', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1032, '参数新增', 106, 2, '#', '', 1, 0, 'F', '0', '0', 'system:config:add', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1033, '参数修改', 106, 3, '#', '', 1, 0, 'F', '0', '0', 'system:config:edit', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1034, '参数删除', 106, 4, '#', '', 1, 0, 'F', '0', '0', 'system:config:remove', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1035, '参数导出', 106, 5, '#', '', 1, 0, 'F', '0', '0', 'system:config:export', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1036, '公告查询', 107, 1, '#', '', 1, 0, 'F', '0', '0', 'system:notice:query', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1037, '公告新增', 107, 2, '#', '', 1, 0, 'F', '0', '0', 'system:notice:add', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1038, '公告修改', 107, 3, '#', '', 1, 0, 'F', '0', '0', 'system:notice:edit', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1039, '公告删除', 107, 4, '#', '', 1, 0, 'F', '0', '0', 'system:notice:remove', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1040, '操作查询', 500, 1, '#', '', 1, 0, 'F', '0', '0', 'monitor:operlog:query', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1041, '操作删除', 500, 2, '#', '', 1, 0, 'F', '0', '0', 'monitor:operlog:remove', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1042, '日志导出', 500, 4, '#', '', 1, 0, 'F', '0', '0', 'monitor:operlog:export', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1043, '登录查询', 501, 1, '#', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:query', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1044, '登录删除', 501, 2, '#', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:remove', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1045, '日志导出', 501, 3, '#', '', 1, 0, 'F', '0', '0', 'monitor:logininfor:export', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1046, '在线查询', 109, 1, '#', '', 1, 0, 'F', '0', '0', 'monitor:online:query', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1047, '批量强退', 109, 2, '#', '', 1, 0, 'F', '0', '0', 'monitor:online:batchLogout', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1048, '单条强退', 109, 3, '#', '', 1, 0, 'F', '0', '0', 'monitor:online:forceLogout', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1049, '任务查询', 110, 1, '#', '', 1, 0, 'F', '0', '0', 'monitor:job:query', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1050, '任务新增', 110, 2, '#', '', 1, 0, 'F', '0', '0', 'monitor:job:add', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1051, '任务修改', 110, 3, '#', '', 1, 0, 'F', '0', '0', 'monitor:job:edit', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1052, '任务删除', 110, 4, '#', '', 1, 0, 'F', '0', '0', 'monitor:job:remove', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1053, '状态修改', 110, 5, '#', '', 1, 0, 'F', '0', '0', 'monitor:job:changeStatus', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1054, '任务导出', 110, 7, '#', '', 1, 0, 'F', '0', '0', 'monitor:job:export', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1055, '生成查询', 115, 1, '#', '', 1, 0, 'F', '0', '0', 'tool:gen:query', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1056, '生成修改', 115, 2, '#', '', 1, 0, 'F', '0', '0', 'tool:gen:edit', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1057, '生成删除', 115, 3, '#', '', 1, 0, 'F', '0', '0', 'tool:gen:remove', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1058, '导入代码', 115, 2, '#', '', 1, 0, 'F', '0', '0', 'tool:gen:import', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1059, '预览代码', 115, 4, '#', '', 1, 0, 'F', '0', '0', 'tool:gen:preview', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1060, '生成代码', 115, 5, '#', '', 1, 0, 'F', '0', '0', 'tool:gen:code', '#', 'admin', '2021-08-06 15:01:44', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1500, '测试单表', 5, 1, 'demo', 'demo/demo/index', 1, 0, 'C', '0', '0', 'demo:demo:list', '#', 'admin', '2021-05-30 00:39:23', '', NULL, '测试单表菜单');
INSERT INTO `sys_menu` VALUES (1501, '测试单表查询', 1500, 1, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:query', '#', 'admin', '2021-05-30 00:39:23', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1502, '测试单表新增', 1500, 2, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:add', '#', 'admin', '2021-05-30 00:39:23', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1503, '测试单表修改', 1500, 3, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:edit', '#', 'admin', '2021-05-30 00:39:23', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1504, '测试单表删除', 1500, 4, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:remove', '#', 'admin', '2021-05-30 00:39:23', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1505, '测试单表导出', 1500, 5, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:export', '#', 'admin', '2021-05-30 00:39:23', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1506, '测试树表', 5, 1, 'tree', 'demo/tree/index', 1, 0, 'C', '0', '0', 'demo:tree:list', '#', 'admin', '2021-05-30 00:39:30', '', NULL, '测试树表菜单');
INSERT INTO `sys_menu` VALUES (1507, '测试树表查询', 1506, 1, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:query', '#', 'admin', '2021-05-30 00:39:30', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1508, '测试树表新增', 1506, 2, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:add', '#', 'admin', '2021-05-30 00:39:30', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1509, '测试树表修改', 1506, 3, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:edit', '#', 'admin', '2021-05-30 00:39:30', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1510, '测试树表删除', 1506, 4, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:remove', '#', 'admin', '2021-05-30 00:39:30', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1511, '测试树表导出', 1506, 5, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:export', '#', 'admin', '2021-05-30 00:39:30', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1600, '文件查询', 118, 1, '#', '', 1, 0, 'F', '0', '0', 'system:oss:query', '#', 'admin', '2021-08-06 15:02:52', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1601, '文件上传', 118, 2, '#', '', 1, 0, 'F', '0', '0', 'system:oss:upload', '#', 'admin', '2021-08-06 15:02:52', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1602, '文件下载', 118, 3, '#', '', 1, 0, 'F', '0', '0', 'system:oss:download', '#', 'admin', '2021-08-06 15:02:52', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1603, '文件删除', 118, 4, '#', '', 1, 0, 'F', '0', '0', 'system:oss:remove', '#', 'admin', '2021-08-06 15:02:52', '', NULL, '');
INSERT INTO `sys_menu` VALUES (2000, '节点维护', 5, 1, 'node', 'system/node/index', 1, 0, 'C', '0', '0', 'system:node:list', '#', 'admin', '2021-08-08 22:17:41', '', NULL, '节点维护菜单');
INSERT INTO `sys_menu` VALUES (2001, '节点维护查询', 2000, 1, '#', '', 1, 0, 'F', '0', '0', 'system:node:query', '#', 'admin', '2021-08-08 22:17:41', '', NULL, '');
INSERT INTO `sys_menu` VALUES (2002, '节点维护新增', 2000, 2, '#', '', 1, 0, 'F', '0', '0', 'system:node:add', '#', 'admin', '2021-08-08 22:17:41', '', NULL, '');
INSERT INTO `sys_menu` VALUES (2003, '节点维护修改', 2000, 3, '#', '', 1, 0, 'F', '0', '0', 'system:node:edit', '#', 'admin', '2021-08-08 22:17:41', '', NULL, '');
INSERT INTO `sys_menu` VALUES (2004, '节点维护删除', 2000, 4, '#', '', 1, 0, 'F', '0', '0', 'system:node:remove', '#', 'admin', '2021-08-08 22:17:41', '', NULL, '');
INSERT INTO `sys_menu` VALUES (2005, '节点维护导出', 2000, 5, '#', '', 1, 0, 'F', '0', '0', 'system:node:export', '#', 'admin', '2021-08-08 22:17:41', '', NULL, '');
INSERT INTO `sys_menu` VALUES (2006, '展示界面', 0, 6, 'show', 'show/index', 1, 0, 'C', '0', '0', 'show', 'color', 'admin', '2021-08-11 17:25:57', NULL, NULL, '');
SET FOREIGN_KEY_CHECKS = 1;

89
sql/test_node.sql Normal file
View File

@ -0,0 +1,89 @@
/*
Navicat MySQL Data Transfer
Source Server :
Source Server Type : MySQL
Source Server Version : 80026
Source Host : localhost:3306
Source Schema : ry-vue
Target Server Type : MySQL
Target Server Version : 80026
File Encoding : 65001
Date: 23/08/2021 13:55:04
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for test_node
-- ----------------------------
DROP TABLE IF EXISTS `test_node`;
CREATE TABLE `test_node` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '节点名',
`categary` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分类',
`pid` bigint NULL DEFAULT NULL COMMENT '父id',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 73 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of test_node
-- ----------------------------
INSERT INTO `test_node` VALUES (1, 'java', '编程语言', 0);
INSERT INTO `test_node` VALUES (2, 'docker', '容器技术', 1);
INSERT INTO `test_node` VALUES (4, 'springboot', '框架技术', 1);
INSERT INTO `test_node` VALUES (5, '前端', '前端', 0);
INSERT INTO `test_node` VALUES (6, 'vue', '前端框架', 5);
INSERT INTO `test_node` VALUES (12, '灯芯绒', NULL, 0);
INSERT INTO `test_node` VALUES (13, '特点', NULL, 12);
INSERT INTO `test_node` VALUES (14, '厚实且耐磨', NULL, 13);
INSERT INTO `test_node` VALUES (16, '手感弹滑柔软', NULL, 13);
INSERT INTO `test_node` VALUES (17, '绒条清晰圆润', NULL, 13);
INSERT INTO `test_node` VALUES (18, '光泽柔和均匀', NULL, 13);
INSERT INTO `test_node` VALUES (19, '沿绒条方向易撕裂', NULL, 13);
INSERT INTO `test_node` VALUES (20, '面料用途', NULL, 12);
INSERT INTO `test_node` VALUES (21, '秋冬外衣', NULL, 20);
INSERT INTO `test_node` VALUES (22, '鞋帽', NULL, 20);
INSERT INTO `test_node` VALUES (23, '家具装饰布', NULL, 20);
INSERT INTO `test_node` VALUES (24, '窗帘', NULL, 20);
INSERT INTO `test_node` VALUES (25, '沙发', NULL, 20);
INSERT INTO `test_node` VALUES (26, '玩具', NULL, 20);
INSERT INTO `test_node` VALUES (27, '绒条粗细', NULL, 12);
INSERT INTO `test_node` VALUES (28, '细条', NULL, 27);
INSERT INTO `test_node` VALUES (29, '中条', NULL, 27);
INSERT INTO `test_node` VALUES (30, '粗条', NULL, 27);
INSERT INTO `test_node` VALUES (31, '宽条', NULL, 27);
INSERT INTO `test_node` VALUES (32, '灯草绒、条绒、趟绒', '别名', 12);
INSERT INTO `test_node` VALUES (33, '经纱纬纱交织', '组成', 12);
INSERT INTO `test_node` VALUES (34, 'Deng\'xin\'rong', '拼音', 12);
INSERT INTO `test_node` VALUES (48, '常见面料类型', NULL, 12);
INSERT INTO `test_node` VALUES (49, '弹力性', NULL, 48);
INSERT INTO `test_node` VALUES (50, '粘胶型', NULL, 48);
INSERT INTO `test_node` VALUES (51, '涤纶型', NULL, 48);
INSERT INTO `test_node` VALUES (52, '粗细条型', NULL, 48);
INSERT INTO `test_node` VALUES (53, '间歇割型', NULL, 48);
INSERT INTO `test_node` VALUES (54, '飞毛型', NULL, 48);
INSERT INTO `test_node` VALUES (55, '双色型', NULL, 48);
INSERT INTO `test_node` VALUES (56, '防掉毛', NULL, 49);
INSERT INTO `test_node` VALUES (57, '提高服装保型性', NULL, 49);
INSERT INTO `test_node` VALUES (58, '提高服装舒适性', NULL, 49);
INSERT INTO `test_node` VALUES (59, '光泽亮丽', NULL, 50);
INSERT INTO `test_node` VALUES (60, '悬垂性高', NULL, 50);
INSERT INTO `test_node` VALUES (61, '手感光泽', NULL, 50);
INSERT INTO `test_node` VALUES (62, '颜色鲜艳', NULL, 50);
INSERT INTO `test_node` VALUES (63, '颜色鲜艳', NULL, 51);
INSERT INTO `test_node` VALUES (64, '易保养', NULL, 51);
INSERT INTO `test_node` VALUES (65, '洗可穿性', NULL, 51);
INSERT INTO `test_node` VALUES (66, '视觉丰富', NULL, 52);
INSERT INTO `test_node` VALUES (67, '立体感', NULL, 52);
INSERT INTO `test_node` VALUES (68, '偏割', '方式', 52);
INSERT INTO `test_node` VALUES (69, '立体感', NULL, 53);
INSERT INTO `test_node` VALUES (70, '浮雕状', '效果', 53);
INSERT INTO `test_node` VALUES (71, '轻薄透明', NULL, 54);
INSERT INTO `test_node` VALUES (72, '视觉丰富', NULL, 54);
INSERT INTO `test_node` VALUES (73, '浮雕状', '效果', 54);
SET FOREIGN_KEY_CHECKS = 1;