Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
inscode
NodeJS_639770
提交
32241acd
N
NodeJS_639770
项目概览
inscode
/
NodeJS_639770
与 Fork 源项目一致
Fork自
inscode / NodeJS
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
NodeJS_639770
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
32241acd
编写于
5月 23, 2024
作者:
D
DebugIsFalse
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 滚动问题
上级
2a429a6b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
28 addition
and
39 deletion
+28
-39
components/i/search/Content.vue
components/i/search/Content.vue
+2
-5
pages/search/[id].vue
pages/search/[id].vue
+26
-34
未找到文件。
components/i/search/Content.vue
浏览文件 @
32241acd
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
<USkeleton
class=
"h-4"
/>
<USkeleton
class=
"h-4"
/>
<USkeleton
class=
"h-4 w-2/3"
/>
<USkeleton
class=
"h-4 w-2/3"
/>
</
template
>
</
template
>
<div
class=
"text-xs pl-5"
v-else
>
找到 {{
sourceCount
}} 条来源
</div>
<div
class=
"text-xs pl-5"
v-else
>
找到 {{
item.source
&&
item.source.length || 0
}} 条来源
</div>
</template>
</template>
<div
class=
"text-base flex items-center gap-1"
v-if=
"item.ansLoading !== undefined"
>
<div
class=
"text-base flex items-center gap-1"
v-if=
"item.ansLoading !== undefined"
>
<UIcon
name=
"i-heroicons-pencil-square"
/>
<UIcon
name=
"i-heroicons-pencil-square"
/>
...
@@ -70,10 +70,6 @@ const props = defineProps({
...
@@ -70,10 +70,6 @@ const props = defineProps({
type
:
Object
,
type
:
Object
,
default
:
(()
=>
{})
default
:
(()
=>
{})
},
},
sourceCount
:
{
type
:
Number
,
default
:
0
},
asking
:
{
asking
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
false
...
@@ -127,4 +123,5 @@ function handleShare () {
...
@@ -127,4 +123,5 @@ function handleShare () {
title
:
'
链接已复制到剪贴板
'
title
:
'
链接已复制到剪贴板
'
})
})
}
}
defineExpose
({
handleCollapse
})
</
script
>
</
script
>
\ No newline at end of file
pages/search/[id].vue
浏览文件 @
32241acd
...
@@ -15,17 +15,20 @@
...
@@ -15,17 +15,20 @@
</div>
</div>
<ISearchContent
<ISearchContent
:item=
"item"
:item=
"item"
:source-count=
"sourceCount"
:asking=
"false"
:asking=
"asking"
:is-last-index=
"false"
:is-last-index=
"data.length - 1 === index"
:index=
"index"
:index=
"index"
/>
/>
<UDivider
v-if=
"index !== data.length - 1"
class=
"pt-3 pb-2"
/>
<UDivider
class=
"pt-3 pb-2"
/>
</
template
>
</
template
>
<div
class=
"grid"
v-if=
"data.length > 0"
>
<h2
class=
"text-3xl"
:id=
"data.length + 1"
>
{{ askingData.question }}
</h2>
</div>
<ISearchContent
<ISearchContent
:item=
"askingData"
:item=
"askingData"
:source-count=
"sourceCount"
:asking=
"asking"
:asking=
"asking"
ref=
"askingRef"
:is-last-index=
"true"
@
regenerate=
"handleReGenerate"
@
regenerate=
"handleReGenerate"
/>
/>
<ISearchRecommendQuestion
<ISearchRecommendQuestion
...
@@ -107,42 +110,40 @@ const handleReGenerate = () => {
...
@@ -107,42 +110,40 @@ const handleReGenerate = () => {
const
data
=
ref
([])
const
data
=
ref
([])
const
askingData
=
ref
({
question
:
state
.
query
,
desLoading
:
true
})
const
askingData
=
ref
({
question
:
state
.
query
,
desLoading
:
true
})
const
recommendQuestions
=
ref
([])
const
recommendQuestions
=
ref
([])
const
askingRef
=
ref
(
null
)
// git url
// git url
const
baseGitUrl
=
computed
(()
=>
{
const
baseGitUrl
=
computed
(()
=>
{
const
endWidthGit
=
state
.
gitPath
.
endsWith
(
'
.git
'
)
const
endWidthGit
=
state
.
gitPath
.
endsWith
(
'
.git
'
)
const
baseUrl
=
endWidthGit
?
state
.
gitPath
.
slice
(
0
,
state
.
gitPath
.
length
-
4
)
:
state
.
gitPath
const
baseUrl
=
endWidthGit
?
state
.
gitPath
.
slice
(
0
,
state
.
gitPath
.
length
-
4
)
:
state
.
gitPath
return
baseUrl
return
baseUrl
})
})
// 正在运行的网络来源
const
sourceCount
=
computed
(()
=>
{
const
{
source
}
=
askingData
.
value
;
if
(
!
source
)
{
return
0
}
return
source
.
length
})
let
asking
=
ref
(
false
)
let
asking
=
ref
(
false
)
// 处理ai generate
let
aiChatController
=
null
// 用户取消操作方法
const
markedEnd
=
'
[DONE]
'
const
createGenerateInitItem
=
(
question
)
=>
{
data
.
value
.
push
(
askingData
.
value
)
askingData
.
value
=
{
question
,
desLoading
:
true
}
}
const
handleContinueAsk
=
(
question
)
=>
{
const
handleContinueAsk
=
(
question
)
=>
{
if
(
asking
.
value
)
return
if
(
asking
.
value
)
return
asking
.
value
=
true
asking
.
value
=
true
askingRef
.
value
.
handleCollapse
(
true
);
createGenerateInitItem
(
question
)
createGenerateInitItem
(
question
)
generateFetchData
(
question
)
generateFetchData
(
question
)
setTimeout
(()
=>
{
setTimeout
(()
=>
{
scrollToView
()
isAutoToBottom
.
value
=
true
isAutoToBottom
.
value
=
true
})
})
}
}
// 处理ai generate
let
aiChatController
=
null
// 用户取消操作方法
const
markedEnd
=
'
[DONE]
'
const
createGenerateInitItem
=
(
question
)
=>
{
// todo 唯一key
data
.
value
.
push
(
askingData
.
value
)
asking
.
value
=
{
question
,
desLoading
:
true
}
}
const
resetAnsLoading
=
()
=>
{
const
resetAnsLoading
=
()
=>
{
Object
.
assign
(
askingData
.
value
,
{
ansLoading
:
false
,
showActions
:
true
})
Object
.
assign
(
askingData
.
value
,
{
ansLoading
:
false
,
showActions
:
true
})
}
}
const
resetAutoBottom
=
()
=>
{
nextTick
(()
=>
{
isAutoToBottom
.
value
=
true
;
})
}
const
handleFormFetchData
=
(
fetchData
)
=>
{
const
handleFormFetchData
=
(
fetchData
)
=>
{
let
message
=
{}
let
message
=
{}
try
{
try
{
...
@@ -158,21 +159,14 @@ const handleFormFetchData = (fetchData) => {
...
@@ -158,21 +159,14 @@ const handleFormFetchData = (fetchData) => {
handleStopGenerate
()
handleStopGenerate
()
}
}
if
(
meta
.
type
===
'
answer
'
)
{
if
(
meta
.
type
===
'
answer
'
)
{
Object
.
assign
(
askingData
.
value
,
{
Object
.
assign
(
askingData
.
value
,
{
ansLoading
:
true
,
desLoading
:
false
,
searchLoading
:
false
,
article
:
message
.
choices
[
0
].
message
.
content
})
ansLoading
:
true
,
desLoading
:
false
,
searchLoading
:
false
,
article
:
message
.
choices
[
0
].
message
.
content
})
return
return
}
}
if
(
meta
.
type
!==
'
log
'
)
return
if
(
meta
.
type
!==
'
log
'
)
return
if
(
meta
.
action
===
'
rephrase_question
'
)
{
if
(
meta
.
action
===
'
rephrase_question
'
)
{
Object
.
assign
(
askingData
.
value
,
{
description
:
choices
[
0
].
message
.
content
,
desLoading
:
true
})
Object
.
assign
(
askingData
.
value
,
{
description
:
choices
[
0
].
message
.
content
,
desLoading
:
true
})
nextTick
(()
=>
{
resetAutoBottom
()
isAutoToBottom
.
value
=
true
})
return
return
}
}
if
(
meta
.
action
===
'
search_file
'
)
{
if
(
meta
.
action
===
'
search_file
'
)
{
...
@@ -186,9 +180,7 @@ const handleFormFetchData = (fetchData) => {
...
@@ -186,9 +180,7 @@ const handleFormFetchData = (fetchData) => {
}
}
})
})
Object
.
assign
(
askingData
.
value
,
{
desLoading
:
true
,
source
,
searchLoading
:
true
,
desLoading
:
false
})
Object
.
assign
(
askingData
.
value
,
{
desLoading
:
true
,
source
,
searchLoading
:
true
,
desLoading
:
false
})
nextTick
(()
=>
{
resetAutoBottom
()
isAutoToBottom
.
value
=
true
})
}
}
}
}
const
handleMessage
=
(
event
)
=>
{
const
handleMessage
=
(
event
)
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录