Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doc_wei
Skyeye
提交
53135e25
S
Skyeye
项目概览
doc_wei
/
Skyeye
通知
1195
Star
154
Fork
127
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Skyeye
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
53135e25
编写于
7月 17, 2022
作者:
doc_wei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
【高级搜索】支持多级下拉框
上级
f234ab95
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
95 addition
and
45 deletion
+95
-45
api/src/main/resources/template/js/apiPage/apiPage.js
api/src/main/resources/template/js/apiPage/apiPage.js
+0
-1
dsform/src/main/resources/template/js/dsFormPage/dsFormPageDesign.js
...main/resources/template/js/dsFormPage/dsFormPageDesign.js
+1
-2
userauth/src/main/resources/template/js/syseveuserstaff/syseveuserstafflist.js
...ources/template/js/syseveuserstaff/syseveuserstafflist.js
+11
-6
userauth/src/main/resources/template/tpl/syseveuserstaff/syseveuserstafflist.html
...ces/template/tpl/syseveuserstaff/syseveuserstafflist.html
+0
-9
web/src/main/resources/template/assets/lib/layui/customer/tableUtil/initTableSearchUtil.js
...ssets/lib/layui/customer/tableUtil/initTableSearchUtil.js
+79
-27
web/src/main/resources/template/assets/lib/winui/css/customer/search-table.css
...s/template/assets/lib/winui/css/customer/search-table.css
+4
-0
未找到文件。
api/src/main/resources/template/js/apiPage/apiPage.js
浏览文件 @
53135e25
...
...
@@ -282,7 +282,6 @@ layui.config({
paramsConfig
:
encodeURIComponent
(
JSON
.
stringify
(
JSON
.
parse
(
jsonEditor
.
getValue
()))),
id
:
searchParamsId
};
console
.
log
(
params
)
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
writeSearchConfigMation
"
,
params
:
params
,
type
:
'
json
'
,
method
:
"
POST
"
,
callback
:
function
(
json
)
{
winui
.
window
.
msg
(
systemLanguage
[
"
com.skyeye.successfulOperation
"
][
languageType
],
{
icon
:
1
,
time
:
2000
});
}});
...
...
dsform/src/main/resources/template/js/dsFormPage/dsFormPageDesign.js
浏览文件 @
53135e25
...
...
@@ -400,8 +400,7 @@ layui.config({
// 初始化限制条件
function
initRequire
(
item
){
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
dsformlimitrequirement006
"
,
params
:{},
type
:
'
json
'
,
callback
:
function
(
json
)
{
var
contentModel
=
getFileContent
(
'
tpl/template/select-option.tpl
'
);
//获取html模板
var
jsonStr
=
getDataUseHandlebars
(
contentModel
,
json
);
//模板和数据结合
var
jsonStr
=
getDataUseHandlebars
(
getFileContent
(
'
tpl/template/select-option.tpl
'
),
json
);
//模板和数据结合
$
(
"
#require
"
).
html
(
jsonStr
);
if
(
!
isNull
(
item
.
requireId
)){
$
(
"
#require
"
).
val
(
item
.
requireId
.
split
(
"
,
"
));
//给这个元素赋值
...
...
userauth/src/main/resources/template/js/syseveuserstaff/syseveuserstafflist.js
浏览文件 @
53135e25
...
...
@@ -61,9 +61,10 @@ layui.config({
},
cols
:
[[
{
title
:
systemLanguage
[
"
com.skyeye.serialNumber
"
][
languageType
],
rowspan
:
'
3
'
,
fixed
:
'
left
'
,
type
:
'
numbers
'
},
{
field
:
'
userName
'
,
title
:
'
姓名
'
,
rowspan
:
'
3
'
,
align
:
'
left
'
,
width
:
1
5
0
,
fixed
:
'
left
'
,
templet
:
function
(
d
)
{
return
'
<a lay-event="details" class="notice-title-click">
'
+
d
.
jobNumber
+
'
'
+
d
.
userName
+
'
</a>
'
;
{
field
:
'
userName
'
,
title
:
'
姓名
'
,
rowspan
:
'
3
'
,
align
:
'
left
'
,
width
:
1
0
0
,
fixed
:
'
left
'
,
templet
:
function
(
d
)
{
return
'
<a lay-event="details" class="notice-title-click">
'
+
d
.
userName
+
'
</a>
'
;
}},
{
field
:
'
jobNumber
'
,
title
:
'
工号
'
,
rowspan
:
'
3
'
,
align
:
'
left
'
,
width
:
100
,
fixed
:
'
left
'
},
{
field
:
'
staffType
'
,
title
:
'
类型
'
,
rowspan
:
'
3
'
,
align
:
'
left
'
,
width
:
90
,
templet
:
function
(
d
)
{
if
(
d
.
staffType
==
1
){
return
'
普通员工
'
;
...
...
@@ -90,7 +91,7 @@ layui.config({
}},
{
field
:
'
userIdCard
'
,
title
:
'
身份证
'
,
rowspan
:
'
3
'
,
align
:
'
center
'
,
width
:
160
},
{
field
:
'
workTimeNum
'
,
title
:
'
考勤班次
'
,
rowspan
:
'
3
'
,
align
:
'
center
'
,
width
:
80
},
{
field
:
'
userSex
'
,
title
:
'
性别
'
,
width
:
6
0
,
rowspan
:
'
3
'
,
align
:
'
center
'
,
templet
:
function
(
d
)
{
{
field
:
'
userSex
'
,
title
:
'
性别
'
,
width
:
8
0
,
rowspan
:
'
3
'
,
align
:
'
center
'
,
templet
:
function
(
d
)
{
if
(
d
.
userSex
==
'
0
'
){
return
"
保密
"
;
}
else
if
(
d
.
userSex
==
'
1
'
){
...
...
@@ -115,12 +116,15 @@ layui.config({
{
field
:
'
jobName
'
,
title
:
'
职位
'
,
align
:
'
left
'
,
width
:
120
}
]
],
done
:
function
(){
done
:
function
(
json
){
if
(
!
loadCompany
){
initCompany
();
}
soulTable
.
render
(
this
);
matchingLanguage
();
initTableSearchUtil
.
initAdvancedSearch
(
this
,
json
.
searchFilter
,
form
,
function
()
{
table
.
reload
(
"
messageTable
"
,
{
page
:
{
curr
:
1
},
where
:
getTableParams
()});
});
}
});
...
...
@@ -151,6 +155,7 @@ layui.config({
systemCommonUtil
.
getSysCompanyList
(
function
(
json
)
{
// 加载企业数据
$
(
"
#companyList
"
).
html
(
getDataUseHandlebars
(
selTemplate
,
json
));
form
.
render
(
'
select
'
);
});
}
...
...
@@ -366,14 +371,14 @@ layui.config({
}
function
getTableParams
(){
return
{
return
$
.
extend
(
true
,
{
userName
:
$
(
"
#userName
"
).
val
(),
userSex
:
$
(
"
#userSex
"
).
val
(),
userIdCard
:
$
(
"
#userIdCard
"
).
val
(),
companyName
:
companyId
,
departmentName
:
departmentId
,
jobName
:
jobId
};
}
,
initTableSearchUtil
.
getSearchValue
(
"
messageTable
"
))
;
}
exports
(
'
syseveuserstafflist
'
,
{});
...
...
userauth/src/main/resources/template/tpl/syseveuserstaff/syseveuserstafflist.html
浏览文件 @
53135e25
...
...
@@ -20,15 +20,6 @@
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"userIdCard"
name=
"userIdCard"
placeholder=
"请输入身份证"
class=
"layui-input"
/>
</div>
<label
class=
"layui-form-label"
>
性别
</label>
<div
class=
"layui-input-inline"
>
<select
id=
"userSex"
name=
"userSex"
>
<option
value=
""
>
全部
</option>
<option
value=
"0"
>
保密
</option>
<option
value=
"1"
>
男
</option>
<option
value=
"2"
>
女
</option>
</select>
</div>
<label
class=
"layui-form-label"
>
公司
</label>
<div
class=
"layui-input-inline"
>
<select
lay-filter=
"companyList"
lay-search=
""
id=
"companyList"
>
...
...
web/src/main/resources/template/assets/lib/layui/customer/tableUtil/initTableSearchUtil.js
浏览文件 @
53135e25
...
...
@@ -33,6 +33,9 @@ var initTableSearchUtil = {
// 初始化监听事件
initTableSearchUtil
.
initEvent
(
form
);
}
if
(
isNull
(
searchParams
))
{
return
;
}
initTableSearchUtil
.
loadSearchSign
(
tableId
,
searchParams
,
form
);
},
...
...
@@ -44,17 +47,35 @@ var initTableSearchUtil = {
* @param form form表单对象
*/
loadSearchSign
:
function
(
tableId
,
searchParams
,
form
)
{
var
fixTh
=
$
(
"
div[lay-id='
"
+
tableId
+
"
'] .layui-table-fixed
"
).
find
(
"
thead
"
).
eq
(
0
).
find
(
"
th
"
);
var
th
=
$
(
"
div[lay-id='
"
+
tableId
+
"
'] .layui-table-header
"
).
find
(
"
thead
"
).
eq
(
0
).
find
(
"
th
"
);
$
.
each
(
searchParams
,
function
(
key
,
value
)
{
$
.
each
(
th
,
function
(
j
,
_th
)
{
var
_this
=
$
(
_th
);
if
(
_this
.
attr
(
"
data-field
"
)
==
key
)
{
var
fieldId
=
key
+
initTableSearchUtil
.
fileIdSuffix
;
// 加载筛选标识
_this
.
find
(
"
.layui-table-cell
"
).
append
(
initTableSearchUtil
.
searchSignHtml
(
tableId
,
fieldId
));
// 现在固定的表头上找,没有找到的话,再去可移动的表头上找
var
findIdent
=
false
;
var
fieldId
=
key
+
initTableSearchUtil
.
fileIdSuffix
;
if
(
$
(
"
span[search-table-id='
"
+
tableId
+
"
'][search-sign='
"
+
fieldId
+
"
']
"
).
length
==
0
)
{
// 固定的标头
$
.
each
(
fixTh
,
function
(
j
,
_th
)
{
var
_this
=
$
(
_th
);
if
(
_this
.
attr
(
"
data-field
"
)
==
key
)
{
// 加载筛选标识
_this
.
find
(
"
.layui-table-cell
"
).
append
(
initTableSearchUtil
.
searchSignHtml
(
tableId
,
fieldId
));
findIdent
=
true
;
}
});
if
(
!
findIdent
)
{
$
.
each
(
th
,
function
(
j
,
_th
)
{
var
_this
=
$
(
_th
);
if
(
_this
.
attr
(
"
data-field
"
)
==
key
)
{
// 加载筛选标识
_this
.
find
(
"
.layui-table-cell
"
).
append
(
initTableSearchUtil
.
searchSignHtml
(
tableId
,
fieldId
));
}
});
}
}
);
}
});
// 展示筛选内容
initTableSearchUtil
.
loadChooseHtml
(
tableId
);
},
/**
...
...
@@ -124,6 +145,8 @@ var initTableSearchUtil = {
*/
getFormUnit
:
function
(
fieldId
,
searchParam
)
{
var
type
=
searchParam
.
dataType
;
// 获取筛选条件
var
operator
=
$
(
"
#sel
"
+
fieldId
).
val
();
if
(
type
===
'
input
'
)
{
// 文本
return
'
<input type="text" id="
'
+
fieldId
+
'
" name="
'
+
fieldId
+
'
" placeholder="请输入要搜索的内容" class="layui-input" />
'
;
...
...
@@ -137,15 +160,20 @@ var initTableSearchUtil = {
// 员工
return
''
;
}
else
if
(
type
===
'
virtualSelect
'
)
{
// 接口-下拉框
d
ataFrom: {"url": "", "valueKey": "", "showKey": ""}
// 接口-下拉框
virtualD
ataFrom: {"url": "", "valueKey": "", "showKey": ""}
return
''
;
}
else
if
(
type
===
'
constantSelect
'
)
{
// 常量-下拉框
d
ataFrom: [{"id": "", "name": ""}]
var
dataFrom
=
searchParam
.
d
ataFrom
;
var
options
=
""
;
// 常量-下拉框
constantD
ataFrom: [{"id": "", "name": ""}]
var
dataFrom
=
searchParam
.
constantD
ataFrom
;
var
options
=
"
<option value=''>全部</option>
"
;
$
.
each
(
dataFrom
,
function
(
i
,
item
)
{
options
+=
'
<option value="
'
+
item
.
id
+
'
">
'
+
item
.
name
+
'
</option>
'
;
});
if
(
operator
==
'
in
'
)
{
return
'
<select id="
'
+
fieldId
+
'
" multiple lay-filter="
'
+
fieldId
+
'
" lay-search="" >
'
+
options
+
'
</select>
'
;
}
return
'
<select id="
'
+
fieldId
+
'
" lay-filter="
'
+
fieldId
+
'
" lay-search="" >
'
+
options
+
'
</select>
'
;
...
...
@@ -184,6 +212,8 @@ var initTableSearchUtil = {
*/
getFormUnitShowValue
:
function
(
fieldId
,
searchParam
)
{
var
type
=
searchParam
.
dataType
;
// 获取筛选条件
var
operator
=
$
(
"
#sel
"
+
fieldId
).
val
();
if
(
type
===
'
input
'
)
{
return
$
(
"
#
"
+
fieldId
).
val
();
}
else
if
(
type
===
'
date
'
)
{
...
...
@@ -196,10 +226,17 @@ var initTableSearchUtil = {
// 员工
return
''
;
}
else
if
(
type
===
'
virtualSelect
'
)
{
// 接口-下拉框
d
ataFrom: {"url": "", "valueKey": "", "showKey": ""}
// 接口-下拉框
virtualD
ataFrom: {"url": "", "valueKey": "", "showKey": ""}
return
$
(
"
#
"
+
fieldId
).
find
(
"
option:selected
"
).
text
();
}
else
if
(
type
===
'
constantSelect
'
)
{
// 常量-下拉框 dataFrom: [{"id": "", "name": ""}]
// 常量-下拉框 constantDataFrom: [{"id": "", "name": ""}]
if
(
operator
==
'
in
'
)
{
var
text
=
[];
$
.
each
(
$
(
"
#
"
+
fieldId
).
find
(
"
option:selected
"
),
function
(
i
,
item
)
{
text
.
push
(
item
.
outerText
);
});
return
text
.
toString
();
}
return
$
(
"
#
"
+
fieldId
).
find
(
"
option:selected
"
).
text
();
}
},
...
...
@@ -233,10 +270,17 @@ var initTableSearchUtil = {
// 员工
return
''
;
}
else
if
(
type
===
'
virtualSelect
'
)
{
// 接口-下拉框
d
ataFrom: {"url": "", "valueKey": "", "showKey": ""}
// 接口-下拉框
virtualD
ataFrom: {"url": "", "valueKey": "", "showKey": ""}
return
$
(
"
#
"
+
fieldId
).
val
();
}
else
if
(
type
===
'
constantSelect
'
)
{
// 常量-下拉框 dataFrom: [{"id": "", "name": ""}]
// 常量-下拉框 constantDataFrom: [{"id": "", "name": ""}]
if
(
operator
==
'
in
'
)
{
var
value
=
[];
$
.
each
(
$
(
"
#
"
+
fieldId
).
val
(),
function
(
i
,
item
)
{
value
.
push
(
"
'
"
+
item
+
"
'
"
);
});
return
value
.
toString
();
}
return
$
(
"
#
"
+
fieldId
).
val
();
}
},
...
...
@@ -253,8 +297,10 @@ var initTableSearchUtil = {
var
tableChooseMap
=
isNull
(
initTableSearchUtil
.
chooseMap
[
tableId
])
?
{}
:
initTableSearchUtil
.
chooseMap
[
tableId
];
var
confimValue
=
tableChooseMap
[
fieldId
];
if
(
!
isNull
(
confimValue
))
{
// 获取筛选条件
var
operator
=
confimValue
.
operator
;
// 设置默认筛选条件
$
(
"
#sel
"
+
fieldId
).
val
(
confimValue
.
operator
);
$
(
"
#sel
"
+
fieldId
).
val
(
operator
);
// 加载搜索框
$
(
"
#searchContent
"
+
fieldId
).
html
(
initTableSearchUtil
.
getFormUnit
(
fieldId
,
paramConfig
));
// 初始化事件,例如:日期的要初始化后才能使用
...
...
@@ -263,22 +309,24 @@ var initTableSearchUtil = {
// 根据类型设置默认值
var
type
=
paramConfig
.
dataType
;
if
(
type
===
'
input
'
)
{
return
$
(
"
#
"
+
fieldId
).
val
(
confimValue
.
showValue
);
$
(
"
#
"
+
fieldId
).
val
(
confimValue
.
showValue
);
}
else
if
(
type
===
'
date
'
)
{
// 日期
return
$
(
"
#
"
+
fieldId
).
val
(
confimValue
.
showValue
);
$
(
"
#
"
+
fieldId
).
val
(
confimValue
.
showValue
);
}
else
if
(
type
===
'
user
'
)
{
// 用户
return
''
;
}
else
if
(
type
===
'
userStaff
'
)
{
// 员工
return
''
;
}
else
if
(
type
===
'
virtualSelect
'
)
{
// 接口-下拉框
d
ataFrom: {"url": "", "valueKey": "", "showKey": ""}
return
$
(
"
#
"
+
fieldId
).
val
(
confimValue
.
hideValue
);
// 接口-下拉框
virtualD
ataFrom: {"url": "", "valueKey": "", "showKey": ""}
$
(
"
#
"
+
fieldId
).
val
(
confimValue
.
hideValue
);
}
else
if
(
type
===
'
constantSelect
'
)
{
// 常量-下拉框 dataFrom: [{"id": "", "name": ""}]
return
$
(
"
#
"
+
fieldId
).
val
(
confimValue
.
hideValue
);
// 常量-下拉框 constantDataFrom: [{"id": "", "name": ""}]
if
(
operator
==
'
in
'
)
{
$
(
"
#
"
+
fieldId
).
val
(
confimValue
.
hideValue
.
replaceAll
(
"
'
"
,
""
).
split
(
'
,
'
));
}
else
{
$
(
"
#
"
+
fieldId
).
val
(
confimValue
.
hideValue
);
}
}
}
},
...
...
@@ -353,6 +401,7 @@ var initTableSearchUtil = {
// 点击确定获取值
var
confimValue
=
{
"
fieldId
"
:
fieldId
,
"
fieldName
"
:
$
(
this
).
attr
(
"
field-name
"
),
"
operator
"
:
$
(
"
#sel
"
+
fieldId
).
val
(),
"
operatorName
"
:
$
(
"
#sel
"
+
fieldId
).
find
(
"
option:selected
"
).
text
(),
...
...
@@ -367,7 +416,7 @@ var initTableSearchUtil = {
// 移除选择框
$
(
"
#searchBox
"
).
remove
();
// 展示筛选内容
initTableSearchUtil
.
loadChooseHtml
(
tableId
,
fieldId
);
initTableSearchUtil
.
loadChooseHtml
(
tableId
);
// 加载回调函数
var
mation
=
initTableSearchUtil
.
tableMap
[
tableId
];
if
(
typeof
(
mation
.
callback
)
==
"
function
"
)
{
...
...
@@ -398,12 +447,15 @@ var initTableSearchUtil = {
* 加载选中列筛选条件的内容
*
* @param tableId 表格id
* @param fieldId 字段列id
*/
loadChooseHtml
:
function
(
tableId
,
fieldId
)
{
loadChooseHtml
:
function
(
tableId
)
{
$
(
"
#
"
+
tableId
)
$
(
"
div[lay-id='
"
+
tableId
+
"
'] .layui-table-search
"
).
removeClass
(
"
layui-table-choose
"
);
var
tableChooseMap
=
isNull
(
initTableSearchUtil
.
chooseMap
[
tableId
])
?
{}
:
initTableSearchUtil
.
chooseMap
[
tableId
];
var
str
=
""
;
$
.
each
(
tableChooseMap
,
function
(
key
,
value
)
{
var
fieldId
=
value
.
fieldId
;
$
(
"
span[search-table-id='
"
+
tableId
+
"
'][search-sign='
"
+
fieldId
+
"
']
"
).
addClass
(
'
layui-table-choose
'
);
str
+=
'
<span class="layui-badge layui-bg-blue skyeye-badge">
'
+
value
.
fieldName
+
'
'
+
value
.
operatorName
+
'
'
+
value
.
showValue
+
''
+
'
<i class="layui-icon layui-unselect layui-tab-close search-del" table-id="
'
+
tableId
+
'
" field-id="
'
+
fieldId
+
'
" title="删除">ဆ</i>
'
+
'
</span>
'
;
...
...
web/src/main/resources/template/assets/lib/winui/css/customer/search-table.css
浏览文件 @
53135e25
...
...
@@ -8,6 +8,10 @@
color
:
#b2b2b2
;
}
.layui-table-choose
{
color
:
#1E9FFF
!important
;
}
.filter-search-box
{
width
:
100%
;
padding-top
:
7px
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录