提交 593042f1 authored 作者: taojinlong's avatar taojinlong

feat: 数据连接

...@@ -13,6 +13,8 @@ public class DatasetGroup implements Serializable { ...@@ -13,6 +13,8 @@ public class DatasetGroup implements Serializable {
private Integer level; private Integer level;
private String type;
private String createBy; private String createBy;
private Long createTime; private Long createTime;
......
...@@ -374,6 +374,76 @@ public class DatasetGroupExample { ...@@ -374,6 +374,76 @@ public class DatasetGroupExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andTypeIsNull() {
addCriterion("`type` is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("`type` is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(String value) {
addCriterion("`type` =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(String value) {
addCriterion("`type` <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(String value) {
addCriterion("`type` >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(String value) {
addCriterion("`type` >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(String value) {
addCriterion("`type` <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(String value) {
addCriterion("`type` <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLike(String value) {
addCriterion("`type` like", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotLike(String value) {
addCriterion("`type` not like", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<String> values) {
addCriterion("`type` in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<String> values) {
addCriterion("`type` not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(String value1, String value2) {
addCriterion("`type` between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(String value1, String value2) {
addCriterion("`type` not between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andCreateByIsNull() { public Criteria andCreateByIsNull() {
addCriterion("create_by is null"); addCriterion("create_by is null");
return (Criteria) this; return (Criteria) this;
......
package io.dataease.base.domain;
import java.io.Serializable;
import lombok.Data;
@Data
public class DatasetScene implements Serializable {
private String id;
private String name;
private String groupId;
private String createBy;
private Long createTime;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<result column="name" jdbcType="VARCHAR" property="name" /> <result column="name" jdbcType="VARCHAR" property="name" />
<result column="pid" jdbcType="VARCHAR" property="pid" /> <result column="pid" jdbcType="VARCHAR" property="pid" />
<result column="level" jdbcType="INTEGER" property="level" /> <result column="level" jdbcType="INTEGER" property="level" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" /> <result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="BIGINT" property="createTime" /> <result column="create_time" jdbcType="BIGINT" property="createTime" />
</resultMap> </resultMap>
...@@ -68,7 +69,7 @@ ...@@ -68,7 +69,7 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, `name`, pid, `level`, create_by, create_time id, `name`, pid, `level`, `type`, create_by, create_time
</sql> </sql>
<select id="selectByExample" parameterType="io.dataease.base.domain.DatasetGroupExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="io.dataease.base.domain.DatasetGroupExample" resultMap="BaseResultMap">
select select
...@@ -102,11 +103,11 @@ ...@@ -102,11 +103,11 @@
</delete> </delete>
<insert id="insert" parameterType="io.dataease.base.domain.DatasetGroup"> <insert id="insert" parameterType="io.dataease.base.domain.DatasetGroup">
insert into dataset_group (id, `name`, pid, insert into dataset_group (id, `name`, pid,
`level`, create_by, create_time `level`, `type`, create_by,
) create_time)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR},
#{level,jdbcType=INTEGER}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT} #{level,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
) #{createTime,jdbcType=BIGINT})
</insert> </insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.DatasetGroup"> <insert id="insertSelective" parameterType="io.dataease.base.domain.DatasetGroup">
insert into dataset_group insert into dataset_group
...@@ -123,6 +124,9 @@ ...@@ -123,6 +124,9 @@
<if test="level != null"> <if test="level != null">
`level`, `level`,
</if> </if>
<if test="type != null">
`type`,
</if>
<if test="createBy != null"> <if test="createBy != null">
create_by, create_by,
</if> </if>
...@@ -143,6 +147,9 @@ ...@@ -143,6 +147,9 @@
<if test="level != null"> <if test="level != null">
#{level,jdbcType=INTEGER}, #{level,jdbcType=INTEGER},
</if> </if>
<if test="type != null">
#{type,jdbcType=VARCHAR},
</if>
<if test="createBy != null"> <if test="createBy != null">
#{createBy,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
</if> </if>
...@@ -172,6 +179,9 @@ ...@@ -172,6 +179,9 @@
<if test="record.level != null"> <if test="record.level != null">
`level` = #{record.level,jdbcType=INTEGER}, `level` = #{record.level,jdbcType=INTEGER},
</if> </if>
<if test="record.type != null">
`type` = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.createBy != null"> <if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR}, create_by = #{record.createBy,jdbcType=VARCHAR},
</if> </if>
...@@ -189,6 +199,7 @@ ...@@ -189,6 +199,7 @@
`name` = #{record.name,jdbcType=VARCHAR}, `name` = #{record.name,jdbcType=VARCHAR},
pid = #{record.pid,jdbcType=VARCHAR}, pid = #{record.pid,jdbcType=VARCHAR},
`level` = #{record.level,jdbcType=INTEGER}, `level` = #{record.level,jdbcType=INTEGER},
`type` = #{record.type,jdbcType=VARCHAR},
create_by = #{record.createBy,jdbcType=VARCHAR}, create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT} create_time = #{record.createTime,jdbcType=BIGINT}
<if test="_parameter != null"> <if test="_parameter != null">
...@@ -207,6 +218,9 @@ ...@@ -207,6 +218,9 @@
<if test="level != null"> <if test="level != null">
`level` = #{level,jdbcType=INTEGER}, `level` = #{level,jdbcType=INTEGER},
</if> </if>
<if test="type != null">
`type` = #{type,jdbcType=VARCHAR},
</if>
<if test="createBy != null"> <if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR}, create_by = #{createBy,jdbcType=VARCHAR},
</if> </if>
...@@ -221,6 +235,7 @@ ...@@ -221,6 +235,7 @@
set `name` = #{name,jdbcType=VARCHAR}, set `name` = #{name,jdbcType=VARCHAR},
pid = #{pid,jdbcType=VARCHAR}, pid = #{pid,jdbcType=VARCHAR},
`level` = #{level,jdbcType=INTEGER}, `level` = #{level,jdbcType=INTEGER},
`type` = #{type,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR}, create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT} create_time = #{createTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
......
package io.dataease.base.mapper;
import io.dataease.base.domain.DatasetScene;
import io.dataease.base.domain.DatasetSceneExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface DatasetSceneMapper {
long countByExample(DatasetSceneExample example);
int deleteByExample(DatasetSceneExample example);
int deleteByPrimaryKey(String id);
int insert(DatasetScene record);
int insertSelective(DatasetScene record);
List<DatasetScene> selectByExample(DatasetSceneExample example);
DatasetScene selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") DatasetScene record, @Param("example") DatasetSceneExample example);
int updateByExample(@Param("record") DatasetScene record, @Param("example") DatasetSceneExample example);
int updateByPrimaryKeySelective(DatasetScene record);
int updateByPrimaryKey(DatasetScene record);
}
\ No newline at end of file
<?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="io.dataease.base.mapper.DatasetSceneMapper">
<resultMap id="BaseResultMap" type="io.dataease.base.domain.DatasetScene">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="group_id" jdbcType="VARCHAR" property="groupId" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, `name`, group_id, create_by, create_time
</sql>
<select id="selectByExample" parameterType="io.dataease.base.domain.DatasetSceneExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from dataset_scene
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from dataset_scene
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from dataset_scene
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.dataease.base.domain.DatasetSceneExample">
delete from dataset_scene
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.dataease.base.domain.DatasetScene">
insert into dataset_scene (id, `name`, group_id,
create_by, create_time)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{groupId,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.DatasetScene">
insert into dataset_scene
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
`name`,
</if>
<if test="groupId != null">
group_id,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="groupId != null">
#{groupId,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.dataease.base.domain.DatasetSceneExample" resultType="java.lang.Long">
select count(*) from dataset_scene
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update dataset_scene
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.groupId != null">
group_id = #{record.groupId,jdbcType=VARCHAR},
</if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update dataset_scene
set id = #{record.id,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
group_id = #{record.groupId,jdbcType=VARCHAR},
create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.dataease.base.domain.DatasetScene">
update dataset_scene
<set>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="groupId != null">
group_id = #{groupId,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.DatasetScene">
update dataset_scene
set `name` = #{name,jdbcType=VARCHAR},
group_id = #{groupId,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
package io.dataease.controller.dataset;
import io.dataease.base.domain.DatasetGroup;
import io.dataease.controller.request.dataset.DataSetGroupRequest;
import io.dataease.dto.dataset.DataSetGroupDTO;
import io.dataease.service.dataset.DataSetGroupService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* @Author gin
* @Date 2021/2/20 8:29 下午
*/
@RestController
@RequestMapping("dataset/group")
public class DataSetGroupController {
@Resource
private DataSetGroupService dataSetGroupService;
@PostMapping("/save")
public DataSetGroupDTO save(@RequestBody DatasetGroup datasetGroup) {
return dataSetGroupService.save(datasetGroup);
}
@PostMapping("/tree")
public List<DataSetGroupDTO> tree(@RequestBody DataSetGroupRequest datasetGroup) {
return dataSetGroupService.tree(datasetGroup);
}
@PostMapping("/delete/{id}")
public void tree(@PathVariable String id) {
dataSetGroupService.delete(id);
}
}
package io.dataease.controller.request.dataset;
import io.dataease.base.domain.DatasetGroup;
import lombok.Data;
/**
* @Author gin
* @Date 2021/2/22 1:30 下午
*/
@Data
public class DataSetGroupRequest extends DatasetGroup {
private String sort;
}
package io.dataease.controller.sys; package io.dataease.controller.sys;
import io.dataease.base.domain.SysDept; import io.dataease.base.domain.SysDept;
import io.dataease.controller.ResultHolder;
import io.dataease.service.sys.DeptService; import io.dataease.service.sys.DeptService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -16,7 +17,7 @@ import java.util.List; ...@@ -16,7 +17,7 @@ import java.util.List;
@RequiredArgsConstructor @RequiredArgsConstructor
@Api(tags = "系统:部门管理") @Api(tags = "系统:部门管理")
@RequestMapping("/api/dept") @RequestMapping("/api/dept")
public class SysDeptController { public class SysDeptController extends ResultHolder {
@Resource @Resource
...@@ -24,9 +25,9 @@ public class SysDeptController { ...@@ -24,9 +25,9 @@ public class SysDeptController {
@ApiOperation("查询部门") @ApiOperation("查询部门")
@PostMapping("/root") @PostMapping("/root")
public List<SysDept> rootData(){ public ResultHolder rootData(){
List<SysDept> root = deptService.root(); List<SysDept> root = deptService.root();
return root; return success(root);
} }
@ApiOperation("新增部门") @ApiOperation("新增部门")
......
package io.dataease.dto.dataset;
import io.dataease.base.domain.DatasetGroup;
import lombok.Data;
import java.util.List;
/**
* @Author gin
* @Date 2021/2/20 8:17 下午
*/
@Data
public class DataSetGroupDTO extends DatasetGroup {
private String label;
private List<DataSetGroupDTO> children;
}
package io.dataease.service.dataset;
import com.alibaba.nacos.common.util.UuidUtils;
import io.dataease.base.domain.DatasetGroup;
import io.dataease.base.domain.DatasetGroupExample;
import io.dataease.base.mapper.DatasetGroupMapper;
import io.dataease.commons.utils.BeanUtils;
import io.dataease.controller.request.dataset.DataSetGroupRequest;
import io.dataease.dto.dataset.DataSetGroupDTO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Author gin
* @Date 2021/2/20 8:10 下午
*/
@Service
public class DataSetGroupService {
@Resource
private DatasetGroupMapper datasetGroupMapper;
public DataSetGroupDTO save(DatasetGroup datasetGroup) {
if (StringUtils.isEmpty(datasetGroup.getId())) {
datasetGroup.setId(UuidUtils.generateUuid());
datasetGroup.setCreateTime(System.currentTimeMillis());
datasetGroupMapper.insert(datasetGroup);
} else {
datasetGroupMapper.updateByPrimaryKey(datasetGroup);
}
DataSetGroupDTO dataSetGroupDTO = new DataSetGroupDTO();
BeanUtils.copyBean(dataSetGroupDTO, datasetGroup);
dataSetGroupDTO.setLabel(dataSetGroupDTO.getName());
return dataSetGroupDTO;
}
public void delete(String id) {
DataSetGroupRequest datasetGroup = new DataSetGroupRequest();
datasetGroup.setId(id);
List<DataSetGroupDTO> tree = tree(datasetGroup);
List<String> ids = new ArrayList<>();
getAllId(tree, ids);
DatasetGroupExample datasetGroupExample = new DatasetGroupExample();
datasetGroupExample.createCriteria().andIdIn(ids);
datasetGroupMapper.deleteByExample(datasetGroupExample);
}
public List<DataSetGroupDTO> tree(DataSetGroupRequest datasetGroup) {
DatasetGroupExample datasetGroupExample = new DatasetGroupExample();
DatasetGroupExample.Criteria criteria = datasetGroupExample.createCriteria();
if (StringUtils.isNotEmpty(datasetGroup.getName())) {
criteria.andNameLike("%" + datasetGroup.getName() + "%");
}
if (StringUtils.isNotEmpty(datasetGroup.getType())) {
criteria.andTypeEqualTo(datasetGroup.getType());
}
if (StringUtils.isNotEmpty(datasetGroup.getId())) {
criteria.andIdEqualTo(datasetGroup.getId());
} else {
criteria.andLevelEqualTo(0);
}
datasetGroupExample.setOrderByClause(datasetGroup.getSort());
List<DatasetGroup> datasetGroups = datasetGroupMapper.selectByExample(datasetGroupExample);
List<DataSetGroupDTO> DTOs = datasetGroups.stream().map(ele -> {
DataSetGroupDTO dto = new DataSetGroupDTO();
BeanUtils.copyBean(dto, ele);
dto.setLabel(ele.getName());
return dto;
}).collect(Collectors.toList());
getAll(DTOs, datasetGroup);
return DTOs;
}
public void getAll(List<DataSetGroupDTO> list, DataSetGroupRequest datasetGroup) {
for (DataSetGroupDTO obj : list) {
DatasetGroupExample datasetGroupExample = new DatasetGroupExample();
DatasetGroupExample.Criteria criteria = datasetGroupExample.createCriteria();
if (StringUtils.isNotEmpty(datasetGroup.getName())) {
criteria.andNameLike("%" + datasetGroup.getName() + "%");
}
if (StringUtils.isNotEmpty(datasetGroup.getType())) {
criteria.andTypeEqualTo(datasetGroup.getType());
}
criteria.andPidEqualTo(obj.getId());
datasetGroupExample.setOrderByClause(datasetGroup.getSort());
List<DatasetGroup> datasetGroups = datasetGroupMapper.selectByExample(datasetGroupExample);
List<DataSetGroupDTO> DTOs = datasetGroups.stream().map(ele -> {
DataSetGroupDTO dto = new DataSetGroupDTO();
BeanUtils.copyBean(dto, ele);
dto.setLabel(ele.getName());
return dto;
}).collect(Collectors.toList());
obj.setChildren(DTOs);
if (CollectionUtils.isNotEmpty(DTOs)) {
getAll(DTOs, datasetGroup);
}
}
}
public List<String> getAllId(List<DataSetGroupDTO> list, List<String> ids) {
for (DataSetGroupDTO dto : list) {
ids.add(dto.getId());
if (CollectionUtils.isNotEmpty(dto.getChildren())) {
getAllId(dto.getChildren(), ids);
}
}
return ids;
}
}
...@@ -340,19 +340,11 @@ CREATE TABLE IF NOT EXISTS `dataset_group` ( ...@@ -340,19 +340,11 @@ CREATE TABLE IF NOT EXISTS `dataset_group` (
`name` varchar(64) NOT NULL COMMENT '名称', `name` varchar(64) NOT NULL COMMENT '名称',
`pid` varchar(50) COMMENT '父级ID', `pid` varchar(50) COMMENT '父级ID',
`level` int(10) COMMENT '当前分组处于第几级', `level` int(10) COMMENT '当前分组处于第几级',
`type` varchar(50) COMMENT 'group or scene',
`create_by` varchar(50) COMMENT '创建人ID', `create_by` varchar(50) COMMENT '创建人ID',
`create_time` bigint(13) COMMENT '创建时间', `create_time` bigint(13) COMMENT '创建时间',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `dataset_scene` (
`id` varchar(50) NOT NULL COMMENT 'ID',
`name` varchar(64) NOT NULL COMMENT '名称',
`group_id` varchar(50) COMMENT 'DataSet Group ID',
`create_by` varchar(50) COMMENT '创建人ID',
`create_time` bigint(13) COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- dataset end -- dataset end
...@@ -46,7 +46,8 @@ ...@@ -46,7 +46,8 @@
"vuedraggable": "^2.24.3", "vuedraggable": "^2.24.3",
"vuex": "^3.1.2", "vuex": "^3.1.2",
"xml-js": "^1.6.11", "xml-js": "^1.6.11",
"yan-progress": "^1.0.3" "yan-progress": "^1.0.3",
"@riophae/vue-treeselect": "0.4.0"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0", "@vue/cli-plugin-babel": "^4.1.0",
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<!-- float right --> <!-- float right -->
<ms-user/> <ms-user/>
<ms-language-switch/> <ms-language-switch/>
<ms-header-org-ws/> <!-- <ms-header-org-ws/> -->
</el-col> </el-col>
</el-row> </el-row>
......
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
.ms-aside-container { .ms-aside-container {
height: calc(100vh - 40px); height: calc(100vh - 40px);
padding: 20px; padding: 20px;
min-width: 260px; min-width: 300px;
max-width: 460px; max-width: 500px;
} }
.ms-main-container { .ms-main-container {
......
...@@ -19,7 +19,7 @@ export default { ...@@ -19,7 +19,7 @@ export default {
}, },
{ {
path: 'organization', path: 'organization',
component: () => import('@/business/components/settings/system/Organization'), component: () => import('@/business/components/settings/sys/dept'),
meta: {system: true, title: 'commons.organization'} meta: {system: true, title: 'commons.organization'}
}, },
// { // {
......
<template>
<fu-search-bar quick-placeholder="按 姓名/邮箱 搜索" :components="components" @exec="search"/>
<!-- <layout-content>
<dynamic-table>
<fu-search-bar quick-placeholder="按 姓名/邮箱 搜索" :components="components" @exec="search"/>
</dynamic-table>
</layout-content> -->
</template>
<script>
// import DynamicTable from "@/components/dynamic-table";
// import LayoutContent from "@/components/layout/LayoutContent";
export default {
name: "UserManagement",
// components: {LayoutContent, DynamicTable},
data() {
return {
components: [
{field: "name", label: "姓名", component: "FuInputComponent", defaultOperator: "eq"},
{field: "email", label: "Email", component: "FuInputComponent"},
{
field: "status",
label: "状态",
component: "FuSelectComponent",
options: [
{label: "运行中", value: "Running"},
{label: "成功", value: "Success"},
{label: "失败", value: "Fail"}
],
multiple: true
},
{field: "create_time", label: "创建时间", component: "FuDateTimeComponent"},
]
}
},
methods: {
search(condition) {
console.log(condition)
}
}
}
</script>
<style scoped>
</style>
import Vue from 'vue'; import Vue from 'vue';
import ElementUI from 'element-ui'; import ElementUI from 'element-ui';
import Fit2CloudUI from 'fit2cloud-ui';
import '../assets/theme/index.css'; import '../assets/theme/index.css';
import icon from "../common/js/icon"; import icon from "../common/js/icon";
import filters from "../common/js/filter"; import filters from "../common/js/filter";
...@@ -31,6 +32,9 @@ Vue.use(icon); ...@@ -31,6 +32,9 @@ Vue.use(icon);
Vue.use(ElementUI, { Vue.use(ElementUI, {
i18n: (key, value) => i18n.t(key, value) i18n: (key, value) => i18n.t(key, value)
}); });
Vue.use(Fit2CloudUI, {
i18n: (key, value) => i18n.t(key, value)
});
Vue.use(filters); Vue.use(filters);
Vue.use(ajax); Vue.use(ajax);
Vue.use(chart); Vue.use(chart);
......
...@@ -1522,6 +1522,21 @@ export default { ...@@ -1522,6 +1522,21 @@ export default {
dataset:{ dataset:{
datalist:'Data List', datalist:'Data List',
add_group:'Add Group', add_group:'Add Group',
add_scene:'Add Scene' add_scene:'Add Scene',
group:'Group',
scene:'Scene',
delete:'Delete',
move_to:'Move',
rename:'Rename',
tips:'Tips',
confirm_delete:'Confirm Delete',
delete_success:'Delete Success',
confirm:'Confirm',
cancel:'Cancel',
search:'Search',
back:'Back',
add_table:'Add Table',
process:'Process',
update:'Update'
} }
}; };
...@@ -1523,6 +1523,21 @@ export default { ...@@ -1523,6 +1523,21 @@ export default {
dataset:{ dataset:{
datalist:'數據列表', datalist:'數據列表',
add_group:'添加分組', add_group:'添加分組',
add_scene:'添加場景' add_scene:'添加場景',
group:'分組',
scene:'場景',
delete:'刪除',
move_to:'移動到',
rename:'重命名',
tips:'提示',
confirm_delete:'確認刪除',
delete_success:'刪除成功',
confirm:'確認',
cancel:'取消',
search:'搜索',
back:'返回',
add_table:'添加表',
process:'進度',
update:'更新'
} }
}; };
...@@ -28,7 +28,8 @@ module.exports = { ...@@ -28,7 +28,8 @@ module.exports = {
} }
}, },
configureWebpack: { configureWebpack: {
devtool: 'source-map', // devtool: 'source-map',
devtool: 'eval-source-map',
resolve: { resolve: {
alias: { alias: {
'@': resolve('src') '@': resolve('src')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论