Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pms-dispatch-assistant
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
姜耀祖
pms-dispatch-assistant
Commits
47061475
Commit
47061475
authored
May 08, 2025
by
姜耀祖
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
无限循环滚动
parent
5249104a
Pipeline
#21194
passed with stages
in 4 minutes and 3 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
21 deletions
+37
-21
ai-chat.html
src/main/resources/static/pages/langchain/ai-chat.html
+2
-2
ai-chat-vue.js
src/main/resources/static/pages/langchain/js/ai-chat-vue.js
+35
-19
No files found.
src/main/resources/static/pages/langchain/ai-chat.html
View file @
47061475
...
...
@@ -58,8 +58,8 @@
<div
class=
"fist-loading"
v-if=
"fistLoading"
>
<p>
快速查找专家
</p>
<div
class=
"expert-guides-container"
>
<div
class=
"expert-guides-scroll"
:style=
"
{ transform: `translateY(-${scrollOffset}px)` }
"
>
<div
v-for=
"(item, index) in
g
uides"
:key=
"index"
class=
"expert-guide-item"
@
click=
"questionClick(item)"
>
<div
class=
"expert-guides-scroll"
:style=
"
scrollStyle
"
>
<div
v-for=
"(item, index) in
extendedG
uides"
:key=
"index"
class=
"expert-guide-item"
@
click=
"questionClick(item)"
>
<p>
{{ item }}
</p>
</div>
</div>
...
...
src/main/resources/static/pages/langchain/js/ai-chat-vue.js
View file @
47061475
...
...
@@ -41,19 +41,20 @@ require(['jquery', 'vue', 'utils','marked','markdown', 'global'], function ($, V
showOrgDropdown
:
false
,
questions
:[],
guides
:[
'请帮我推荐几位南京地区的网络规划方面的专家'
,
'推荐既懂运维规划又熟悉移动产品体系的专家'
,
'我需要私有云多中心容灾规划领域的专家'
,
'帮我找几位熟悉5G网络优化的专家'
,
'推荐几位通信网基础设施资源清查方面的专家'
,
'请帮我找工业互联网平台研发与部署的专家'
,
'推荐几位对IT系统集成有深入了解的专家'
,
'请寻找精通云计算架构设计与实施的专家'
,
'有没有熟悉网络安全与风险评估的专家'
,
'推荐几位专注于数据中心规划与建设的专家'
'请帮我推荐几位南京地区的网络规划方面的专家
1
'
,
'推荐既懂运维规划又熟悉移动产品体系的专家
2
'
,
'我需要私有云多中心容灾规划领域的专家
3
'
,
'帮我找几位熟悉5G网络优化的专家
4
'
,
'推荐几位通信网基础设施资源清查方面的专家
5
'
,
'请帮我找工业互联网平台研发与部署的专家
6
'
,
'推荐几位对IT系统集成有深入了解的专家
7
'
,
'请寻找精通云计算架构设计与实施的专家
8
'
,
'有没有熟悉网络安全与风险评估的专家
9
'
,
'推荐几位专注于数据中心规划与建设的专家
10
'
],
scrollOffset
:
0
,
scrollInterval
:
null
,
transitioning
:
true
,
// 历史对话分类
historySections
:
[
],
...
...
@@ -66,6 +67,16 @@ require(['jquery', 'vue', 'utils','marked','markdown', 'global'], function ($, V
computed
:
{
isDarkTheme
()
{
return
this
.
theme
===
'dark'
;
},
extendedGuides
()
{
// 克隆前3项到末尾
return
[...
this
.
guides
,
...
this
.
guides
.
slice
(
0
,
3
)];
},
scrollStyle
()
{
return
{
transform
:
`translateY(-
${
this
.
scrollOffset
}
px)`
,
transition
:
this
.
transitioning
?
'transform 0.5s ease'
:
'none'
,
};
}
},
created
:
function
()
{
...
...
@@ -113,18 +124,23 @@ require(['jquery', 'vue', 'utils','marked','markdown', 'global'], function ($, V
methods
:
{
// 自动滚动相关方法
startAutoScroll
:
function
()
{
const
itemHeight
=
80
;
const
visibleItems
=
3
;
const
totalItems
=
this
.
guides
.
length
;
this
.
scrollInterval
=
setInterval
(()
=>
{
const
itemHeight
=
80
;
const
totalItems
=
this
.
guides
.
length
;
const
visibleItems
=
3
;
this
.
transitioning
=
true
;
this
.
scrollOffset
+=
itemHeight
;
// 计算下一个滚动位置
if
(
this
.
scrollOffset
<
(
totalItems
-
visibleItems
)
*
itemHeight
)
{
this
.
scrollOffset
+=
itemHeight
;
}
else
{
this
.
scrollOffset
=
0
;
// 滚动到顶部
// 判断是否滚动到克隆项部分(即第 totalItems 行之后)
if
(
this
.
scrollOffset
>=
itemHeight
*
(
totalItems
))
{
// 短暂延迟后瞬间回到原始位置
setTimeout
(()
=>
{
this
.
transitioning
=
false
;
this
.
scrollOffset
=
0
;
},
500
);
// 等待动画结束
}
},
2000
);
// 每2秒滚动一次
},
2000
);
},
stopAutoScroll
:
function
()
{
if
(
this
.
scrollInterval
)
{
...
...
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