记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
55391639
Commit
55391639
authored
Jun 20, 2021
by
qinshuangshuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
远程搜索框测试
parent
0d3fbb85
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
465 additions
and
231 deletions
+465
-231
remote_search.css
...admin-web/src/main/resources/static/css/remote_search.css
+35
-0
remote-search.js
...t-admin-web/src/main/resources/static/js/remote-search.js
+172
-0
include.html
...lient-admin-web/src/main/resources/templates/include.html
+223
-219
add.html
.../templates/zhengzai/kylin/performances/recommend/add.html
+35
-12
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/static/css/remote_search.css
0 → 100644
View file @
55391639
.remote_search
{
/*display: none;*/
position
:
absolute
;
left
:
0
;
/*top: 35px;*/
width
:
100%
;
z-index
:
999
;
background
:
#fff
;
max-height
:
200px
;
overflow
:
auto
;
box-shadow
:
0px
0px
8px
#b3c5ff
!important
;
border-radius
:
4px
!important
;
}
.remote_search_top
{
top
:
35px
;
}
.remote_search_bottom
{
bottom
:
35px
;
}
.remote_search
li
{
height
:
32px
;
line-height
:
32px
;
padding
:
0
10px
;
width
:
100%
;
box-sizing
:
border-box
;
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
}
.remote_search
li
:hover
{
background-color
:
#E6F7FF
;
cursor
:
pointer
;
}
\ No newline at end of file
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/static/js/remote-search.js
0 → 100644
View file @
55391639
;(
function
(
$
)
{
//这里放入插件代码
var
RemoteSearch
=
function
(
element
,
options
)
{
this
.
$element
=
$
(
element
);
this
.
options
=
$
.
extend
(
true
,
{},
$
.
fn
.
remoteSearch
.
defaults
,
options
);
this
.
id
=
$
(
element
).
attr
(
'id'
);
this
.
ulID
=
'#'
+
this
.
id
+
'_ul'
;
this
.
ulFoucus
=
false
;
// Method overrides
this
.
render
=
this
.
options
.
render
||
this
.
render
;
this
.
select
=
this
.
options
.
select
||
this
.
select
;
this
.
ajax
=
$
.
extend
({},
$
.
fn
.
remoteSearch
.
defaults
.
ajax
,
this
.
options
.
ajax
);
this
.
listen
();
}
RemoteSearch
.
prototype
=
{
listen
:
function
()
{
this
.
$element
.
on
(
'blur'
,
$
.
proxy
(
this
.
blur
,
this
))
.
on
(
'keyup'
,
$
.
proxy
(
this
.
keyup
,
this
));
this
.
$element
.
parent
(
'div.remote_wrapper'
).
on
(
'click'
,
this
.
ulID
,
$
.
proxy
(
this
.
click
,
this
));
},
blur
:
function
(
e
)
{
var
that
=
this
;
e
.
stopPropagation
();
e
.
preventDefault
();
setTimeout
(
function
()
{
if
(
!
that
.
ulFoucus
)
{
that
.
$element
.
val
(
that
.
$element
.
attr
(
'data-name'
));
that
.
hide
();
}
},
150
)
},
keyup
:
function
(
e
)
{
e
.
stopPropagation
();
e
.
preventDefault
();
switch
(
e
.
keyCode
)
{
case
40
:
// down arrow
case
38
:
// up arrow
break
;
case
9
:
// tab
case
13
:
// enter
break
;
case
27
:
// escape
break
;
default
:
this
.
ajaxer
();
}
},
hide
:
function
()
{
$
(
this
.
ulID
).
remove
();
return
this
;
},
ajaxer
:
function
()
{
var
that
=
this
,
query
=
that
.
$element
.
val
();
// Query changed
that
.
query
=
query
;
// Cancel last timer if set
if
(
that
.
ajax
.
timerId
)
{
clearTimeout
(
that
.
ajax
.
timerId
);
that
.
ajax
.
timerId
=
null
;
}
// Query is good to send, set a timer
that
.
ajax
.
timerId
=
setTimeout
(
function
()
{
var
params
=
{
query
:
query
};
var
jAjax
=
(
that
.
ajax
.
method
===
"post"
)
?
$
.
post
:
$
.
get
;
jAjax
(
that
.
ajax
.
url
,
params
,
function
(
data
){
console
.
log
(
data
);
return
that
.
render
(
data
.
value
);
});
that
.
ajax
.
timerId
=
null
;
},
that
.
ajax
.
timeout
);
return
that
;
},
render
:
function
(
data
)
{
console
.
log
(
data
);
this
.
ulFoucus
=
false
;
var
liList
=
data
||
[];
var
num
=
this
.
_getNum
();
//添加 ul
if
(
$
(
this
.
ulID
).
length
==
0
)
{
this
.
$element
.
after
(
"<ul id='"
+
this
.
id
+
"_ul' class='remote_search remote_search_top'></ul>"
);
};
//添加li
var
str
=
""
;
if
(
num
)
{
if
(
liList
.
length
)
{
for
(
var
i
=
0
;
i
<
liList
.
length
;
i
++
)
{
str
+=
"<li data-id='"
+
liList
[
i
].
performancesId
+
"' data-name='"
+
liList
[
i
].
title
+
"' title='"
+
liList
[
i
].
title
+
"' value='"
+
liList
[
i
].
performancesId
+
"'>"
+
liList
[
i
].
title
+
"</li>"
;
}
}
else
{
str
=
"<li data-id='' data-name=''>搜索无数据</li>"
}
}
else
{
this
.
$element
.
attr
(
'data-name'
,
""
);
this
.
$element
.
attr
(
'data-id'
,
""
);
}
$
(
this
.
ulID
).
html
(
str
);
var
bodyHeight
=
$
(
document
.
body
).
height
();
var
offsetTop
=
this
.
$element
.
offset
().
top
;
var
height
=
$
(
this
.
ulID
).
outerHeight
(
true
);
if
(
offsetTop
+
height
>
bodyHeight
){
$
(
this
.
ulID
).
addClass
(
'remote_search_bottom'
).
removeClass
(
'remote_search_top'
);
}
else
{
$
(
this
.
ulID
).
addClass
(
'remote_search_top'
).
removeClass
(
'remote_search_bottom'
);
}
return
this
;
},
click
:
function
(
e
)
{
e
.
stopPropagation
();
e
.
preventDefault
();
var
dataName
=
$
(
e
.
target
).
attr
(
'data-name'
);
var
dataID
=
$
(
e
.
target
).
attr
(
'data-id'
);
this
.
$element
.
val
(
dataName
);
this
.
$element
.
attr
(
'data-name'
,
dataName
);
this
.
$element
.
attr
(
'data-id'
,
dataID
);
this
.
options
.
chose
(
dataName
,
dataID
);
this
.
ulFoucus
=
true
;
return
this
.
hide
();
},
_getNum
:
function
(){
return
this
.
$element
.
val
().
length
;
}
}
$
.
fn
.
remoteSearch
=
function
(
option
)
{
return
this
.
each
(
function
()
{
var
$this
=
$
(
this
),
data
=
$this
.
data
(
'remoteSearch'
),
options
=
typeof
option
===
'object'
&&
option
;
if
(
!
data
)
{
$this
.
data
(
'remoteSearch'
,
(
data
=
new
RemoteSearch
(
this
,
options
)));
}
if
(
typeof
option
===
'string'
)
{
data
[
option
]();
}
});
}
$
.
fn
.
remoteSearch
.
defaults
=
{
hiddenVal
:
''
,
chose
:
function
()
{
},
ajax
:
{
url
:
null
,
timeout
:
300
,
method
:
'get'
,
timerId
:
null
},
success
:
function
(
res
){
console
.
log
(
'==parent==success=='
);
console
.
log
(
res
);
}
}
$
.
fn
.
remoteSearch
.
Constructor
=
RemoteSearch
;
})(
jQuery
);
\ No newline at end of file
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/include.html
View file @
55391639
...
...
@@ -14,6 +14,8 @@
<link
th:href=
"@{/css/animate.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{/css/style.css?v=20200903}"
rel=
"stylesheet"
/>
<link
th:href=
"@{/ruoyi/css/ry-ui.css?v=4.6.1}"
rel=
"stylesheet"
/>
<!--远程搜索下拉框-->
<link
th:href=
"@{/css/remote_search.css}"
rel=
"stylesheet"
/>
</head>
<!-- 通用JS -->
...
...
@@ -39,6 +41,8 @@
<script
th:src=
"@{/ajax/libs/layui/layui.js?v=20210516}"
></script>
<script
th:src=
"@{/ruoyi/js/common.js?v=4.6.1}"
></script>
<script
th:src=
"@{/ruoyi/js/ry-ui.js?v=4.6.1}"
></script>
<!--远程搜索下拉框-->
<script
th:src=
"@{/js/remote-search.js}"
></script>
</div>
<!-- ztree树插件 -->
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/kylin/performances/recommend/add.html
View file @
55391639
...
...
@@ -7,6 +7,7 @@
<div
class=
"wrapper wrapper-content animated fadeInRight ibox-content"
>
<form
class=
"form-horizontal m"
id=
"form-roadShow-add"
>
<p>
演出名称:
</p>
<!--
<div class="row">
<input name="ids" type="hidden">
<div class="input-group">
...
...
@@ -20,6 +21,11 @@
</div>
</div>
</div>
-->
<div
class=
"remote_wrapper"
style=
"position: relative;"
>
<input
name=
"ids"
type=
"hidden"
>
<input
type=
"text"
id=
"remoteSearch11"
>
</div>
</br>
<p>
推荐排序:
</p>
<div
class=
"row"
>
...
...
@@ -33,6 +39,7 @@
</div>
<th:block
th:include=
"include :: footer"
/>
<th:block
th:include=
"include :: bootstrap-suggest-js"
/>
<script
th:inline=
"javascript"
>
var
prefix
=
ctx
+
"kylin/performances/recommend"
;
$
(
"#form-roadShow-add"
).
validate
({
...
...
@@ -45,18 +52,34 @@
}
}
function
getPerformanceTitle
()
{
var
testBsSuggest
=
$
(
"#suggest-demo-2"
).
bsSuggest
({
url
:
prefix
+
"/performance/status?status=(3,6,7,9,10)&title="
+
document
.
getElementById
(
"suggest-demo-2"
).
value
,
showBtn
:
false
,
idField
:
"performancesId"
,
keyField
:
"title"
}).
on
(
'onDataRequestSuccess'
,
function
(
e
,
result
)
{
}).
on
(
'onSetSelectValue'
,
function
(
e
,
keyword
)
{
document
.
getElementsByName
(
"ids"
)[
0
].
value
=
keyword
.
id
;
}).
on
(
'onUnsetSelectValue'
,
function
(
e
)
{
});
// function getPerformanceTitle() {
// var testBsSuggest = $("#suggest-demo-2").bsSuggest({
// url: prefix + "/performance/status?status=(3,6,7,9,10)&title=" + document.getElementById("suggest-demo-2").value,
// showBtn: false,
// idField: "performancesId",
// keyField: "title"
// }).on('onDataRequestSuccess', function (e, result) {
// }).on('onSetSelectValue', function (e, keyword) {
// document.getElementsByName("ids")[0].value = keyword.id;
// }).on('onUnsetSelectValue', function (e) {
// });
// }
$
(
'#remoteSearch11'
).
remoteSearch
({
ajax
:{
url
:
prefix
+
"/performance/status?status=(3,6,7,9,10)&title="
+
document
.
getElementById
(
"remoteSearch11"
).
value
,
type
:
"get"
},
chose
:
function
(
text
,
val
){
document
.
getElementsByName
(
"ids"
)[
0
].
value
=
val
;
console
.
log
(
'remoteSearch===========chose='
);
console
.
log
(
text
)
console
.
log
(
val
)
},
success
:
function
(){
console
.
log
(
'==success===='
);
}
})
</script>
</body>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment