提交 318ff159 authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw

feat: 添加角色数据结构

上级 7bfb85a7
package io.dataease.base.domain;
import java.io.Serializable;
import lombok.Data;
@Data
public class SysRole implements Serializable {
private Long roleId;
private String name;
private String description;
private String createBy;
private String updateBy;
private Long createTime;
private Long updateTime;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package io.dataease.base.mapper;
import io.dataease.base.domain.SysRole;
import io.dataease.base.domain.SysRoleExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface SysRoleMapper {
long countByExample(SysRoleExample example);
int deleteByExample(SysRoleExample example);
int deleteByPrimaryKey(Long roleId);
int insert(SysRole record);
int insertSelective(SysRole record);
List<SysRole> selectByExample(SysRoleExample example);
SysRole selectByPrimaryKey(Long roleId);
int updateByExampleSelective(@Param("record") SysRole record, @Param("example") SysRoleExample example);
int updateByExample(@Param("record") SysRole record, @Param("example") SysRoleExample example);
int updateByPrimaryKeySelective(SysRole record);
int updateByPrimaryKey(SysRole 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.SysRoleMapper">
<resultMap id="BaseResultMap" type="io.dataease.base.domain.SysRole">
<id column="role_id" jdbcType="BIGINT" property="roleId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
</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">
role_id, `name`, description, create_by, update_by, create_time, update_time
</sql>
<select id="selectByExample" parameterType="io.dataease.base.domain.SysRoleExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sys_role
<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.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_role
where role_id = #{roleId,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from sys_role
where role_id = #{roleId,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="io.dataease.base.domain.SysRoleExample">
delete from sys_role
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.dataease.base.domain.SysRole">
insert into sys_role (role_id, `name`, description,
create_by, update_by, create_time,
update_time)
values (#{roleId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.SysRole">
insert into sys_role
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="roleId != null">
role_id,
</if>
<if test="name != null">
`name`,
</if>
<if test="description != null">
description,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="roleId != null">
#{roleId,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.dataease.base.domain.SysRoleExample" resultType="java.lang.Long">
select count(*) from sys_role
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_role
<set>
<if test="record.roleId != null">
role_id = #{record.roleId,jdbcType=BIGINT},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
<if test="record.updateBy != null">
update_by = #{record.updateBy,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update sys_role
set role_id = #{record.roleId,jdbcType=BIGINT},
`name` = #{record.name,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
create_by = #{record.createBy,jdbcType=VARCHAR},
update_by = #{record.updateBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.dataease.base.domain.SysRole">
update sys_role
<set>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
</set>
where role_id = #{roleId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.SysRole">
update sys_role
set `name` = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
update_by = #{updateBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}
where role_id = #{roleId,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
...@@ -39,4 +39,18 @@ CREATE TABLE IF NOT EXISTS `sys_menu` ( ...@@ -39,4 +39,18 @@ CREATE TABLE IF NOT EXISTS `sys_menu` (
UNIQUE KEY `uniq_title` (`title`), UNIQUE KEY `uniq_title` (`title`),
UNIQUE KEY `uniq_name` (`name`), UNIQUE KEY `uniq_name` (`name`),
KEY `inx_pid` (`pid`) KEY `inx_pid` (`pid`)
) ENGINE=InnoDB AUTO_INCREMENT=118 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='系统菜单'; ) ENGINE=InnoDB AUTO_INCREMENT=118 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='系统菜单';
\ No newline at end of file
CREATE TABLE IF NOT EXISTS `sys_role` (
`role_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`name` varchar(255) NOT NULL COMMENT '名称',
`description` varchar(255) DEFAULT NULL COMMENT '描述',
`create_by` varchar(255) DEFAULT NULL COMMENT '创建者',
`update_by` varchar(255) DEFAULT NULL COMMENT '更新者',
`create_time` bigint(13) DEFAULT NULL COMMENT '创建日期',
`update_time` bigint(13) DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`role_id`) USING BTREE,
UNIQUE KEY `uniq_name` (`name`),
KEY `role_name_index` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='角色表';
\ No newline at end of file
...@@ -27,6 +27,11 @@ export default { ...@@ -27,6 +27,11 @@ export default {
component: () => import('@/business/components/settings/sys/menu'), component: () => import('@/business/components/settings/sys/menu'),
meta: {system: true, title: 'commons.menu'} meta: {system: true, title: 'commons.menu'}
}, },
{
path: 'role',
component: () => import('@/business/components/settings/sys/role'),
meta: {system: true, title: 'commons.role'}
},
// { // {
// path: 'systemworkspace', // path: 'systemworkspace',
// component: () => import('@/business/components/settings/system/SystemWorkspace'), // component: () => import('@/business/components/settings/system/SystemWorkspace'),
......
<template>
<div style="height: 100%" v-loading="result.loading">
<el-container style="width: 100%; height: 100%;border: 1px solid #eee">
<el-aside width="30%" style="border: 1px solid #eee">
<el-card class="table-card">
<template v-slot:header>
<ms-table-header :condition.sync="condition" @search="search" @create="create" :create-tip="$t('user.create')" :title="$t('commons.user')"/>
</template>
<el-table border class="adjust-table" :data="tableData" style="width: 100%">
<el-table-column prop="name" label="名称" />
<el-table-column :show-overflow-tooltip="true" width="135px" prop="createTime" label="创建日期">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<ms-table-operator @editClick="edit(scope.row)" @deleteClick="handleDelete(scope.row)"/>
</template>
</el-table-column>
</el-table>
<ms-table-pagination :change="search" :current-page.sync="currentPage" :page-size.sync="pageSize" :total="total"/>
</el-card>
</el-aside>
<el-main style="">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="菜单飞配" name="first">菜单飞配</el-tab-pane>
<el-tab-pane label="数据分配" name="second">数据分配</el-tab-pane>
</el-tabs>
</el-main>
</el-container>
</div>
</template>
<script>
import MsCreateBox from "../CreateBox";
import MsTablePagination from "../../common/pagination/TablePagination";
import MsTableHeader from "../../common/components/MsTableHeader";
import MsTableOperator from "../../common/components/MsTableOperator";
import MsDialogFooter from "../../common/components/MsDialogFooter";
import MsTableOperatorButton from "../../common/components/MsTableOperatorButton";
export default {
name: 'role',
components: {
MsCreateBox,
MsTablePagination,
MsTableHeader,
MsTableOperator,
MsDialogFooter,
MsTableOperatorButton
},
data() {
return {
result: {},
queryPath: '/user/special/list',
deletePath: '/user/special/delete/',
createPath: '/user/special/add',
updatePath: '/user/special/update',
currentPage: 1,
pageSize: 10,
total: 0,
condition: {},
tableData: [],
activeName: 'second'
};
},
methods: {
handleClick(tab, event) {
console.log(tab, event);
},
search(){
this.result = this.$post(this.queryPath, this.condition, response => {
let data = response.data;
this.total = data.itemCount;
this.tableData = data.listObject;
})
},
edit(row){
},
handleDelete(row){
}
}
}
</script>
<style scoped>
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论