Merge branch 'dev' of github.com:dataease/dataease into dev
This commit is contained in:
commit
238bc186fb
@ -5,6 +5,7 @@ import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
import io.dataease.auth.api.dto.CurrentUserDto;
|
||||
import io.dataease.base.domain.SysRole;
|
||||
import io.dataease.commons.utils.AuthUtils;
|
||||
import io.dataease.commons.utils.PageUtils;
|
||||
import io.dataease.commons.utils.Pager;
|
||||
@ -116,4 +117,14 @@ public class SysUserController {
|
||||
public List<RoleUserItem> all(){
|
||||
return sysRoleService.allRoles();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation("查询角色")
|
||||
@PostMapping("/roleGrid/{goPage}/{pageSize}")
|
||||
public Pager<List<SysRole>> roleGrid(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody BaseGridRequest request) {
|
||||
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
||||
Pager<List<SysRole>> listPager = PageUtils.setPageInfo(page, sysRoleService.query(request));
|
||||
return listPager;
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,9 +5,11 @@ package io.dataease.service.sys;
|
||||
import io.dataease.base.domain.SysUsersRolesExample;
|
||||
import io.dataease.base.mapper.SysRoleMapper;
|
||||
import io.dataease.base.mapper.SysUsersRolesMapper;*/
|
||||
import io.dataease.base.domain.SysRole;
|
||||
import io.dataease.base.mapper.ext.ExtSysRoleMapper;
|
||||
/*import io.dataease.controller.sys.base.BaseGridRequest;
|
||||
import io.dataease.controller.sys.request.RoleMenusRequest;*/
|
||||
import io.dataease.controller.sys.base.BaseGridRequest;
|
||||
import io.dataease.controller.sys.response.RoleUserItem;
|
||||
import org.springframework.stereotype.Service;
|
||||
/*import org.springframework.transaction.annotation.Transactional;*/
|
||||
@ -55,12 +57,13 @@ public class SysRoleService {
|
||||
return mapper.deleteByPrimaryKey(roleId);
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
public List<SysRole> query(BaseGridRequest request){
|
||||
List<SysRole> result = extSysRoleMapper.query(request.convertExample());
|
||||
|
||||
return result;
|
||||
}
|
||||
/*
|
||||
|
||||
public List<Long> menuIds(Long roleId){
|
||||
return extSysRoleMapper.menuIds(roleId);
|
||||
|
||||
@ -87,8 +87,6 @@ INSERT INTO `dataset_table_function` VALUES (57, 'ROUND', 'ROUND(x,y)', 'doris',
|
||||
INSERT INTO `dataset_table_function` VALUES (58, 'SIGN', 'SIGN(x)', 'doris', 2, '返回参数x的符号,-1表示负数,0表示0,1表示正数');
|
||||
INSERT INTO `dataset_table_function` VALUES (59, 'POW', 'POW(x,y)', 'doris', 2, '返回x的y次乘方的值');
|
||||
INSERT INTO `dataset_table_function` VALUES (60, 'EXP', 'EXP(x)', 'doris', 2, '返回e的x乘方后的值');
|
||||
INSERT INTO `dataset_table_function` VALUES (61, 'LOG', 'LOG(x)', 'doris', 2, '返回x的自然对数,x相对于基数e的对数');
|
||||
INSERT INTO `dataset_table_function` VALUES (62, 'LOG10', 'LOG10(x)', 'doris', 2, '返回x的基数为10的对数');
|
||||
INSERT INTO `dataset_table_function` VALUES (63, 'RADIANS', 'RADIANS(x)', 'doris', 2, '返回x由角度转化为弧度的值');
|
||||
INSERT INTO `dataset_table_function` VALUES (64, 'DEGREES', 'DEGREES(x)', 'doris', 2, '返回x由弧度转化为角度的值');
|
||||
INSERT INTO `dataset_table_function` VALUES (65, 'SIN', 'SIN(x)', 'doris', 2, '返回x的正弦,其中x为给定的弧度值');
|
||||
@ -105,18 +103,11 @@ INSERT INTO `dataset_table_function` VALUES (75, 'RTRIM', 'RTRIM(s)', 'doris', 4
|
||||
INSERT INTO `dataset_table_function` VALUES (76, 'REPLACE', 'REPLACE(s,s1,s2)', 'doris', 4, '返回一个字符串,用字符串s2替代字符串s中所有的字符串s1');
|
||||
INSERT INTO `dataset_table_function` VALUES (77, 'SUBSTRING', 'SUBSTRING(s,n,len)', 'doris', 4, '获取从字符串s中的第n个位置开始长度为len的字符串');
|
||||
INSERT INTO `dataset_table_function` VALUES (78, 'CONCAT', 'CONCAT(s1,s2,...)', 'doris', 4, '返回连接参数产生的字符串,一个或多个待拼接的内容,任意一个为NULL则返回值为NULL');
|
||||
INSERT INTO `dataset_table_function` VALUES (79, 'INSERT', 'INSERT(s1,x,len,s2)', 'doris', 4, '返回字符串s1,其子字符串起始于位置x,被字符串s2取代len个字符');
|
||||
INSERT INTO `dataset_table_function` VALUES (80, 'LOWER', 'LOWER(str)', 'doris', 4, '将str中的字母全部转换成小写');
|
||||
INSERT INTO `dataset_table_function` VALUES (81, 'UPPER', 'UPPER(str)', 'doris', 4, '将字符串中的字母全部转换成大写');
|
||||
INSERT INTO `dataset_table_function` VALUES (82, 'LEFT', 'LEFT(s,n)', 'doris', 4, '返回字符串s从最左边开始的n个字符');
|
||||
INSERT INTO `dataset_table_function` VALUES (83, 'RIGHT', 'RIGHT(s,n)', 'doris', 4, '返回字符串s从最右边开始的n个字符');
|
||||
INSERT INTO `dataset_table_function` VALUES (84, 'REPEAT', 'REPEAT(s,n)', 'doris', 4, '返回一个由重复字符串s组成的字符串,字符串s的数目等于n');
|
||||
INSERT INTO `dataset_table_function` VALUES (85, 'SPACE', 'SPACE(n)', 'doris', 4, '返回一个由n个空格组成的字符串');
|
||||
INSERT INTO `dataset_table_function` VALUES (86, 'REVERSE', 'REVERSE(s)', 'doris', 4, '将字符串s反转');
|
||||
INSERT INTO `dataset_table_function` VALUES (87, 'CURDATE', 'CURDATE()', 'doris', 3, '将当前日期按照\"YYYY-MM-DD\"或者\"YYYYMMDD\"格式的值返回,具体格式根据函数用在字符串或是数字语境中而定');
|
||||
INSERT INTO `dataset_table_function` VALUES (88, 'CURRENT_DATE', 'CURRENT_DATE()', 'doris', 3, '将当前日期按照\"YYYY-MM-DD\"或者\"YYYYMMDD\"格式的值返回,具体格式根据函数用在字符串或是数字语境中而定');
|
||||
INSERT INTO `dataset_table_function` VALUES (89, 'NOW', 'NOW()', 'doris', 3, '返回当前日期和时间值,格式为\"YYYY_MM-DD HH:MM:SS\"或\"YYYYMMDDHHMMSS\",具体格式根据函数用在字符串或数字语境中而定');
|
||||
INSERT INTO `dataset_table_function` VALUES (90, 'SYSDATE', 'SYSDATE()', 'doris', 3, '返回当前日期和时间值,格式为\"YYYY_MM-DD HH:MM:SS\"或\"YYYYMMDDHHMMSS\",具体格式根据函数用在字符串或数字语境中而定');
|
||||
INSERT INTO `dataset_table_function` VALUES (91, 'LOCALTIME', 'LOCALTIME()', 'doris', 3, '返回当前日期和时间值,格式为\"YYYY_MM-DD HH:MM:SS\"或\"YYYYMMDDHHMMSS\",具体格式根据函数用在字符串或数字语境中而定');
|
||||
INSERT INTO `dataset_table_function` VALUES (92, 'CURRENT_TIMESTAMP', 'CURRENT_TIMESTAMP()', 'doris', 3, '返回当前日期和时间值,格式为\"YYYY_MM-DD HH:MM:SS\"或\"YYYYMMDDHHMMSS\",具体格式根据函数用在字符串或数字语境中而定');
|
||||
INSERT INTO `dataset_table_function` VALUES (93, 'UNIX_TIMESTAMP', 'UNIX_TIMESTAMP()', 'doris', 3, '返回一个格林尼治标准时间1970-01-01 00:00:00到现在的秒数');
|
||||
|
||||
@ -89,4 +89,13 @@ export const allRoles = () => {
|
||||
})
|
||||
}
|
||||
|
||||
export default { editPassword, delUser, editUser, addUser, userLists, editStatus, persionInfo, updatePerson, updatePersonPwd, allRoles }
|
||||
export function roleGrid(pageIndex, pageSize, data) {
|
||||
return request({
|
||||
url: '/api/user/roleGrid/' + pageIndex + '/' + pageSize,
|
||||
method: 'post',
|
||||
data,
|
||||
loading: true
|
||||
})
|
||||
}
|
||||
|
||||
export default { editPassword, delUser, editUser, addUser, userLists, editStatus, persionInfo, updatePerson, updatePersonPwd, allRoles, roleGrid }
|
||||
|
||||
@ -297,6 +297,7 @@ export default {
|
||||
}
|
||||
.el-radio{
|
||||
margin:0 2px 0 0!important;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
.el-radio>>>.el-radio__label{
|
||||
padding-left: 0;
|
||||
|
||||
@ -1,30 +1,42 @@
|
||||
<template>
|
||||
<div class="my_table">
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="data"
|
||||
lazy
|
||||
:show-header="true"
|
||||
:load="loadExpandDatas"
|
||||
style="width: 100%"
|
||||
:row-style="{height: '35px'}"
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
row-key="deptId"
|
||||
>
|
||||
<el-table-column :label="$t('panel.all_org')" prop="name" />
|
||||
<el-table-column type="selection" fixd />
|
||||
<!-- <el-table-column label="分享给" prop="deptId" width="80" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox :v-model="scope.row.deptId===0" />
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
</div>
|
||||
<el-col>
|
||||
<el-row class="tree-head">
|
||||
<span style="float: left;padding-left: 10px">{{ $t('panel.all_org') }}</span>
|
||||
|
||||
</el-row>
|
||||
<el-row style="margin-top: 5px">
|
||||
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:data="data"
|
||||
lazy
|
||||
:load="loadTree"
|
||||
style="width: 100%"
|
||||
:props="defaultProps"
|
||||
:default-expanded-keys="expandNodeIds"
|
||||
node-key="deptId"
|
||||
>
|
||||
<span slot-scope="{ node, data }" class="custom-tree-node">
|
||||
<span>
|
||||
<span style="margin-left: 6px">{{ data.name }}</span>
|
||||
</span>
|
||||
<span @click.stop>
|
||||
|
||||
<div>
|
||||
<span class="auth-span">
|
||||
<el-checkbox v-model="data.checked" />
|
||||
</span>
|
||||
</div>
|
||||
</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getDeptTree, loadTable } from '@/api/system/dept'
|
||||
import { saveShare, loadShares } from '@/api/panel/share'
|
||||
import { loadShares } from '@/api/panel/share'
|
||||
export default {
|
||||
name: 'GrantDept',
|
||||
props: {
|
||||
@ -48,7 +60,15 @@ export default {
|
||||
type: 2, // 类型2代表组织
|
||||
shares: [],
|
||||
changeIndex: 0,
|
||||
timeMachine: null
|
||||
timeMachine: null,
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name',
|
||||
isLeaf: (data, node) => {
|
||||
return !data.hasChildren
|
||||
}
|
||||
},
|
||||
expandNodeIds: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -81,9 +101,9 @@ export default {
|
||||
this.timeMachine && clearTimeout(this.timeMachine)
|
||||
this.timeMachine = null
|
||||
},
|
||||
// 加载下一级子节点数据
|
||||
loadExpandDatas(row, treeNode, resolve) {
|
||||
getDeptTree(row.deptId).then(res => {
|
||||
loadTree(node, resolve) {
|
||||
if (!node || !node.data || !node.data.deptId) return
|
||||
getDeptTree(node.data.deptId).then(res => {
|
||||
let data = res.data
|
||||
data = data.map(obj => {
|
||||
if (obj.subCount > 0) {
|
||||
@ -91,17 +111,13 @@ export default {
|
||||
}
|
||||
return obj
|
||||
})
|
||||
// this.maps.set(row.deptId, { row, treeNode, resolve })
|
||||
this.setCheckExpandNodes(data)
|
||||
resolve && resolve(data)
|
||||
this.$nextTick(() => {
|
||||
this.setCheckExpandNodes(data)
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 加载表格数据
|
||||
search(condition) {
|
||||
// this.setTableAttr()
|
||||
|
||||
this.data = []
|
||||
let param = {}
|
||||
if (condition && condition.value) {
|
||||
@ -110,31 +126,41 @@ export default {
|
||||
param = { conditions: [this.defaultCondition] }
|
||||
}
|
||||
|
||||
loadTable(param).then(res => {
|
||||
let data = res.data
|
||||
data = data.map(obj => {
|
||||
if (obj.subCount > 0) {
|
||||
obj.hasChildren = true
|
||||
}
|
||||
return obj
|
||||
})
|
||||
|
||||
if (condition && condition.value) {
|
||||
data = data.map(node => {
|
||||
delete (node.hasChildren)
|
||||
return node
|
||||
this.queryShareNodeIds(() => {
|
||||
loadTable(param).then(res => {
|
||||
let data = res.data
|
||||
data = data.map(obj => {
|
||||
if (obj.subCount > 0) {
|
||||
obj.hasChildren = true
|
||||
}
|
||||
return obj
|
||||
})
|
||||
this.data = this.buildTree(data)
|
||||
this.$nextTick(() => {
|
||||
data.forEach(node => {
|
||||
this.$refs.table.toggleRowExpansion(node, true)
|
||||
|
||||
this.setCheckExpandNodes(data)
|
||||
this.expandNodeIds = []
|
||||
if (condition && condition.value) {
|
||||
// data = data.map(node => {
|
||||
// delete (node.hasChildren)
|
||||
// return node
|
||||
// })
|
||||
this.data = this.buildTree(data)
|
||||
this.$nextTick(() => {
|
||||
// this.expandNodeIds.push()
|
||||
this.expandResult(this.data)
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.data = data
|
||||
}
|
||||
} else {
|
||||
this.data = data
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
this.queryShareNodeIds()
|
||||
expandResult(list) {
|
||||
list.forEach(node => {
|
||||
if (node.children && node.children.length > 0) {
|
||||
this.expandNodeIds.push(node.deptId)
|
||||
this.expandResult(node.children)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@ -159,22 +185,21 @@ export default {
|
||||
},
|
||||
|
||||
getSelected() {
|
||||
// const ids = []
|
||||
// this.searchChecked(ids)
|
||||
// return {
|
||||
// deptIds: ids
|
||||
// }
|
||||
// const ids = []
|
||||
const nodesMap = this.$refs.tree.store.nodesMap
|
||||
|
||||
const ids = Object.values(nodesMap).filter(node => node.data.checked).map(item => item.data.deptId)
|
||||
|
||||
return {
|
||||
deptIds: this.$refs.table.store.states.selection.map(item => item.deptId)
|
||||
deptIds: ids
|
||||
}
|
||||
},
|
||||
|
||||
save(msg) {
|
||||
const rows = this.$refs.table.store.states.selection
|
||||
const request = this.buildRequest(rows)
|
||||
saveShare(request).then(res => {
|
||||
this.$success(msg)
|
||||
return true
|
||||
}).catch(err => {
|
||||
this.$error(err.message)
|
||||
return false
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
},
|
||||
|
||||
@ -196,23 +221,23 @@ export default {
|
||||
const shares = res.data
|
||||
const nodeIds = shares.map(share => share.targetId)
|
||||
this.shares = nodeIds
|
||||
this.$nextTick(() => {
|
||||
this.setCheckNodes()
|
||||
})
|
||||
// this.$nextTick(() => {
|
||||
// this.setCheckNodes()
|
||||
// })
|
||||
callBack && callBack()
|
||||
})
|
||||
},
|
||||
|
||||
setCheckNodes() {
|
||||
this.data.forEach(node => {
|
||||
const nodeId = node.deptId
|
||||
this.shares.includes(nodeId) && this.$refs.table.toggleRowSelection(node, true)
|
||||
})
|
||||
},
|
||||
// setCheckNodes() {
|
||||
// this.data.forEach(node => {
|
||||
// const nodeId = node.deptId
|
||||
// this.shares.includes(nodeId) && (node.checked = true)
|
||||
// })
|
||||
// },
|
||||
setCheckExpandNodes(rows) {
|
||||
rows.forEach(node => {
|
||||
const nodeId = node.deptId
|
||||
this.shares.includes(nodeId) && this.$refs.table.toggleRowSelection(node, true)
|
||||
this.shares.includes(nodeId) && (node.checked = true)
|
||||
})
|
||||
}
|
||||
|
||||
@ -222,6 +247,37 @@ export default {
|
||||
|
||||
<style scoped>
|
||||
|
||||
.custom-tree-node {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
padding-left: 8px;
|
||||
}
|
||||
.tree-main{
|
||||
height: calc(100vh - 210px);
|
||||
border: 1px solid #e6e6e6;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.tree-head{
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
border-bottom: 1px solid #e6e6e6;
|
||||
background-color: #f7f8fa;
|
||||
font-size: 12px;
|
||||
color: #3d4d66 ;
|
||||
}
|
||||
|
||||
.auth-span{
|
||||
float: right;
|
||||
width:50px;
|
||||
margin-right: 30px
|
||||
}
|
||||
.highlights-text {
|
||||
color: #faaa39 !important;
|
||||
}
|
||||
|
||||
.my_table >>> .el-table__row>td{
|
||||
/* 去除表格线 */
|
||||
border: none;
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { roleGrid } from '@/api/system/role'
|
||||
import { roleGrid } from '@/api/system/user'
|
||||
import { formatCondition } from '@/utils/index'
|
||||
import { saveShare, loadShares } from '@/api/panel/share'
|
||||
export default {
|
||||
|
||||
@ -15,10 +15,10 @@
|
||||
</template>
|
||||
|
||||
<el-table-column prop="username" label="ID" />
|
||||
<el-table-column prop="nickName" sortable="custom" :label="$t('commons.nick_name')" />
|
||||
<el-table-column prop="gender" :label="$t('commons.gender')" />
|
||||
<el-table-column :show-overflow-tooltip="true" prop="nickName" sortable="custom" :label="$t('commons.nick_name')" />
|
||||
<el-table-column prop="gender" :label="$t('commons.gender')" width="60" />
|
||||
|
||||
<el-table-column :show-overflow-tooltip="true" prop="phone" :label="$t('commons.phone')" />
|
||||
<!-- <el-table-column :show-overflow-tooltip="true" prop="phone" :label="$t('commons.phone')" /> -->
|
||||
<el-table-column :show-overflow-tooltip="true" prop="email" :label="$t('commons.email')" />
|
||||
<el-table-column :show-overflow-tooltip="true" prop="dept" sortable="custom" :label="$t('commons.organization')">
|
||||
<template slot-scope="scope">
|
||||
@ -43,12 +43,12 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" sortable="custom" :label="$t('commons.status')">
|
||||
<el-table-column prop="status" sortable="custom" :label="$t('commons.status')" width="80">
|
||||
<template v-slot:default="scope">
|
||||
<el-switch v-model="scope.row.enabled" :active-value="1" :inactive-value="0" :disabled="!checkPermission(['user:edit']) || scope.row.isAdmin" inactive-color="#DCDFE6" @change="changeSwitch(scope.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" sortable="custom" :label="$t('commons.create_time')">
|
||||
<el-table-column :show-overflow-tooltip="true" prop="createTime" sortable="custom" :label="$t('commons.create_time')" width="180">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user