Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
1992e84b
提交
1992e84b
authored
3月 10, 2021
作者:
fit2cloud-chenyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:用户列表完善
上级
afec128f
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
148 行增加
和
137 行删除
+148
-137
ExtSysUserMapper.xml
...ain/java/io/dataease/base/mapper/ext/ExtSysUserMapper.xml
+10
-1
UserGridRequest.java
...a/io/dataease/controller/sys/request/UserGridRequest.java
+8
-0
index.vue
frontend/src/components/business/condition-table/index.vue
+95
-0
index.js
frontend/src/lang/index.js
+7
-2
zh.js
frontend/src/lang/zh.js
+1
-0
auth.js
frontend/src/utils/auth.js
+2
-0
index.js
frontend/src/utils/index.js
+14
-0
permission.js
frontend/src/utils/permission.js
+9
-0
validate.js
frontend/src/utils/validate.js
+2
-0
index.vue
frontend/src/views/system/user/index.vue
+0
-0
index1.vue
frontend/src/views/system/user/index1.vue
+0
-134
index_back.vue
frontend/src/views/system/user/index_back.vue
+0
-0
没有找到文件。
backend/src/main/java/io/dataease/base/mapper/ext/ExtSysUserMapper.xml
浏览文件 @
1992e84b
...
...
@@ -33,8 +33,17 @@
left join sys_role r on r.role_id = ur.role_id
left join sys_dept d on d.dept_id = u.dept_id
<where>
<if
test=
"request.quick != null and request.name == null"
>
AND u.nick_name like CONCAT('%', #{request.quick},'%')
</if>
<if
test=
"request.name != null"
>
AND u.name like CONCAT('%', #{request.name},'%')
AND u.nick_name like CONCAT('%', #{request.name},'%')
</if>
<if
test=
"request.enabled != null"
>
AND u.enabled = #{request.enabled}
</if>
<if
test=
"request.deptId != null"
>
AND u.dept_id = #{request.deptId}
</if>
</where>
order by u.update_time desc
...
...
backend/src/main/java/io/dataease/controller/sys/request/UserGridRequest.java
浏览文件 @
1992e84b
package
io
.
dataease
.
controller
.
sys
.
request
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
UserGridRequest
implements
Serializable
{
@ApiModelProperty
(
"快速检索"
)
private
String
quick
;
@ApiModelProperty
(
"名称"
)
private
String
name
;
@ApiModelProperty
(
"组织"
)
private
String
deptId
;
@ApiModelProperty
(
"状态"
)
private
String
enabled
;
}
frontend/src/components/business/condition-table/index.vue
0 → 100644
浏览文件 @
1992e84b
<
template
>
<div>
<!--
<el-switch
v-model=
"value"
active-text=
"当前用户"
/>
-->
<treeselect
v-model=
"value"
:options=
"options"
:load-options=
"loadData"
style=
"width: 200px"
/>
</div>
</
template
>
<
script
>
import
{
ComplexCondition
}
from
'fit2cloud-ui/src/components/search-bar/model'
import
{
getDeptTree
}
from
'@/api/system/dept'
import
{
LOAD_CHILDREN_OPTIONS
,
LOAD_ROOT_OPTIONS
}
from
'@riophae/vue-treeselect'
import
Treeselect
from
'@riophae/vue-treeselect'
import
'@riophae/vue-treeselect/dist/vue-treeselect.css'
export
default
{
components
:
{
Treeselect
},
props
:
{
// eslint-disable-next-line vue/require-default-prop
field
:
String
,
// eslint-disable-next-line vue/require-default-prop
label
:
String
,
// eslint-disable-next-line vue/require-default-prop
defaultOperator
:
String
// eslint-disable-next-line vue/require-default-prop
// options: Array
// eslint-disable-next-line vue/require-default-prop
// loadData: Function
},
data
()
{
return
{
value
:
undefined
,
operator
:
'dept'
,
operatorLabel
:
'组织'
,
options
:
null
}
},
computed
:
{
valueLabel
()
{
return
this
.
value
}
},
// 自定义搜索控件的2个方法
methods
:
{
init
()
{
// 初始化方法,在打开复合搜索界面时会被调用
// 例如清空之前填写的内容
this
.
value
=
undefined
},
getCondition
()
{
// 点击确认时调用
const
{
field
,
label
,
operator
,
operatorLabel
,
value
,
valueLabel
}
=
this
// 必须返回ComplexCondition类型的对象
return
new
ComplexCondition
({
field
,
label
,
operator
,
operatorLabel
,
value
,
valueLabel
})
},
// 获取弹窗内部门数据
loadData
({
action
,
parentNode
,
callback
})
{
if
(
action
===
LOAD_ROOT_OPTIONS
)
{
const
_self
=
this
!
this
.
options
&&
getDeptTree
(
'0'
).
then
(
res
=>
{
_self
.
options
=
res
.
data
.
map
(
node
=>
_self
.
normalizer
(
node
))
callback
()
})
}
if
(
action
===
LOAD_CHILDREN_OPTIONS
)
{
const
_self
=
this
getDeptTree
(
parentNode
.
id
).
then
(
res
=>
{
parentNode
.
children
=
res
.
data
.
map
(
function
(
obj
)
{
return
_self
.
normalizer
(
obj
)
})
callback
()
})
}
},
normalizer
(
node
)
{
if
(
node
.
hasChildren
)
{
node
.
children
=
null
}
return
{
id
:
node
.
deptId
,
label
:
node
.
name
,
children
:
node
.
children
}
}
}
}
</
script
>
<
style
scoped
>
</
style
>
frontend/src/lang/index.js
浏览文件 @
1992e84b
...
...
@@ -11,17 +11,22 @@ import zhLocale from './zh'
import
twLocale
from
'./tw'
import
esLocale
from
'./es'
import
jaLocale
from
'./ja'
import
fuZh
from
'fit2cloud-ui/src/locale/lang/zh-CN'
// 加载fit2cloud的内容
import
fuEn
from
'fit2cloud-ui/src/locale/lang/en_US'
// 加载fit2cloud的内容
Vue
.
use
(
VueI18n
)
const
messages
=
{
en
:
{
...
enLocale
,
...
elementEnLocale
...
elementEnLocale
,
...
fuEn
},
zh
:
{
...
zhLocale
,
...
elementZhLocale
...
elementZhLocale
,
...
fuZh
},
tw
:
{
...
twLocale
,
...
...
frontend/src/lang/zh.js
浏览文件 @
1992e84b
...
...
@@ -424,6 +424,7 @@ export default {
input_email
:
'请输入邮箱'
,
input_password
:
'请输入密码'
,
input_phone
:
'请输入电话号码'
,
input_roles
:
'请选择角色'
,
special_characters_are_not_supported
:
'不支持特殊字符'
,
mobile_number_format_is_incorrect
:
'手机号码格式不正确'
,
email_format_is_incorrect
:
'邮箱格式不正确'
,
...
...
frontend/src/utils/auth.js
浏览文件 @
1992e84b
import
Cookies
from
'js-cookie'
import
Config
from
'@/settings'
const
TokenKey
=
Config
.
TokenKey
export
function
getToken
()
{
...
...
@@ -13,3 +14,4 @@ export function setToken(token) {
export
function
removeToken
()
{
return
Cookies
.
remove
(
TokenKey
)
}
frontend/src/utils/index.js
浏览文件 @
1992e84b
...
...
@@ -136,3 +136,17 @@ export function param2Obj(url) {
'"}'
)
}
export
function
formatCondition
(
param
)
{
if
(
!
param
)
{
return
null
}
const
condition
=
{}
for
(
const
key
in
param
)
{
if
(
Object
.
hasOwnProperty
.
call
(
param
,
key
))
{
const
element
=
param
[
key
]
condition
[
element
.
field
]
=
element
.
value
}
}
return
condition
}
frontend/src/utils/permission.js
0 → 100644
浏览文件 @
1992e84b
import
store
from
'@/store'
export
function
checkPermission
(
pers
)
{
const
permissions
=
store
.
getters
.
permissions
const
hasPermission
=
pers
.
every
(
needP
=>
{
const
result
=
permissions
.
includes
(
needP
)
return
result
})
return
hasPermission
}
frontend/src/utils/validate.js
浏览文件 @
1992e84b
...
...
@@ -18,3 +18,5 @@ export function validUsername(str) {
const
valid_map
=
[
'admin'
,
'cyw'
]
return
valid_map
.
indexOf
(
str
.
trim
())
>=
0
}
export
const
PHONE_REGEX
=
'^1[3|4|5|7|8][0-9]{9}$'
frontend/src/views/system/user/index.vue
浏览文件 @
1992e84b
差异被折叠。
点击展开。
frontend/src/views/system/user/index1.vue
deleted
100644 → 0
浏览文件 @
afec128f
<
template
>
<layout-content>
<complex-table
:data=
"data"
:columns=
"columns"
:buttons=
"buttons"
:header=
"header"
:search-config=
"searchConfig"
:pagination-config=
"paginationConfig"
@
select=
"select"
@
search=
"search"
>
<template
#
buttons
>
<fu-table-button
icon=
"el-icon-circle-plus-outline"
:label=
"$t('user.create')"
@
click=
"add"
/>
</
template
>
<el-table-column
type=
"selection"
fix
/>
<el-table-column
prop=
"username"
label=
"ID"
/>
<el-table-column
prop=
"nickName"
:label=
"$t('commons.name')"
width=
"200"
/>
<el-table-column
prop=
"gender"
label=
"性别"
/>
<el-table-column
:show-overflow-tooltip=
"true"
prop=
"phone"
width=
"100"
label=
"电话"
/>
<el-table-column
:show-overflow-tooltip=
"true"
width=
"135"
prop=
"email"
:label=
"$t('commons.email')"
/>
<el-table-column
:show-overflow-tooltip=
"true"
prop=
"dept"
:label=
"$t('commons.organization')"
>
<
template
slot-scope=
"scope"
>
<div>
{{
scope
.
row
.
dept
.
deptName
}}
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"status"
:label=
"$t('commons.status')"
width=
"120"
>
<
template
v-slot:default=
"scope"
>
<el-switch
v-model=
"scope.row.enabled"
:active-value=
"1"
:inactive-value=
"0"
inactive-color=
"#DCDFE6"
@
change=
"changeSwitch(scope.row)"
/>
</
template
>
</el-table-column>
<el-table-column
prop=
"createTime"
:label=
"$t('commons.create_time')"
>
<
template
v-slot:default=
"scope"
>
<span>
{{
scope
.
row
.
createTime
|
timestampFormatDate
}}
</span>
</
template
>
</el-table-column>
<fu-table-operations
:buttons=
"buttons"
label=
"操作"
fix
/>
</complex-table>
</layout-content>
</template>
<
script
>
import
LayoutContent
from
'@/components/business/LayoutContent'
import
{
userLists
}
from
'@/api/system/user'
import
ComplexTable
from
'@/components/business/complex-table'
import
CustomCondition
from
'./CustomCondtion'
// import { GridButton } from '@/components/GridButton'
// import { checkPermission } from '@/utils/permisstion'
const
buttonClick
=
function
(
row
)
{
console
.
log
(
this
.
label
+
': '
+
row
.
id
)
}
export
default
{
name
:
'UserManagement'
,
components
:
{
ComplexTable
,
LayoutContent
},
data
()
{
return
{
header
:
''
,
columns
:
[],
buttons
:
[
{
label
:
'编辑'
,
icon
:
'el-icon-edit'
,
click
:
this
.
edit
},
{
label
:
'执行'
,
icon
:
'el-icon-video-play'
,
click
:
buttonClick
},
{
label
:
'删除'
,
icon
:
'el-icon-delete'
,
type
:
'danger'
,
click
:
buttonClick
},
{
label
:
'删除(权限)'
,
icon
:
'el-icon-delete'
,
type
:
'danger'
,
click
:
buttonClick
// show: checkPermission('editor') // 必须有editor权限才能看到
},
{
label
:
'复制'
,
icon
:
'el-icon-document-copy'
,
click
:
buttonClick
},
{
label
:
'定时任务'
,
icon
:
'el-icon-timer'
,
click
:
buttonClick
}
],
searchConfig
:
{
quickPlaceholder
:
'按 姓名/邮箱 搜索'
,
components
:
[
{
field
:
'name'
,
label
:
'姓名'
,
component
:
'FuComplexInput'
,
defaultOperator
:
'eq'
},
{
field
:
'email'
,
label
:
'Email'
,
component
:
'FuComplexInput'
},
{
field
:
'status'
,
label
:
'状态'
,
component
:
'FuComplexSelect'
,
options
:
[
{
label
:
'运行中'
,
value
:
'Running'
},
{
label
:
'成功'
,
value
:
'Success'
},
{
label
:
'失败'
,
value
:
'Fail'
}
],
multiple
:
true
},
{
field
:
'create_time'
,
label
:
'创建时间'
,
component
:
'FuComplexDateTime'
},
{
field
:
'user'
,
component
:
CustomCondition
}
// 如何自定义搜索控件,看CustomCondition
]
},
paginationConfig
:
{
currentPage
:
1
,
pageSize
:
10
,
total
:
0
},
data
:
[]
}
},
created
()
{
this
.
search
()
},
methods
:
{
select
(
selection
)
{
console
.
log
(
selection
)
},
edit
(
row
)
{
console
.
log
(
'编辑: '
,
row
)
},
add
()
{
},
search
(
condition
)
{
console
.
log
(
condition
)
// demo只查看搜索条件,没有搜索的实现
const
{
currentPage
,
pageSize
}
=
this
.
paginationConfig
userLists
(
currentPage
,
pageSize
,
{}).
then
(
response
=>
{
this
.
data
=
response
.
data
.
listObject
this
.
paginationConfig
.
total
=
response
.
data
.
itemCount
})
}
}
}
</
script
>
<
style
scoped
>
</
style
>
frontend/src/views/system/user/index_back.vue
0 → 100644
浏览文件 @
1992e84b
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论