Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yma16
可视化 csdn 数据
提交
5b2223c8
可
可视化 csdn 数据
项目概览
yma16
/
可视化 csdn 数据
该项目与 Fork 源项目分叉
Fork自
inscode / VueJS
通知
17
Star
15
Fork
10
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
可
可视化 csdn 数据
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
5b2223c8
编写于
10月 25, 2023
作者:
Q
qq_38870145
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Auto Commit
上级
5c33170f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
42 addition
and
31 deletion
+42
-31
src/components/commit/Commit.vue
src/components/commit/Commit.vue
+42
-31
未找到文件。
src/components/commit/Commit.vue
浏览文件 @
5b2223c8
...
@@ -4,7 +4,7 @@ import { getRemoteCsdnCommit, askGpt } from '../../service/csdnApi.js'
...
@@ -4,7 +4,7 @@ import { getRemoteCsdnCommit, askGpt } from '../../service/csdnApi.js'
import
{
message
}
from
'
ant-design-vue
'
;
import
{
message
}
from
'
ant-design-vue
'
;
const
state
:
any
=
reactive
({
const
state
:
any
=
reactive
({
loading
:
false
,
loading
:
false
,
analysis
:
''
,
analysis
:
''
,
text
:
''
,
text
:
''
,
articleId
:
'
133955447
'
,
articleId
:
'
133955447
'
,
page
:
1
,
page
:
1
,
...
@@ -24,7 +24,7 @@ const getCommit = async () => {
...
@@ -24,7 +24,7 @@ const getCommit = async () => {
console
.
log
(
result
,
'
result
'
)
console
.
log
(
result
,
'
result
'
)
const
{
data
}
=
result
?.
data
const
{
data
}
=
result
?.
data
if
(
data
?.
list
)
{
if
(
data
?.
list
)
{
state
.
text
=
data
.
list
.
map
((
item
:
any
)
=>
item
.
info
.
content
).
join
(
'
,
'
)
state
.
text
=
data
.
list
.
map
((
item
:
any
)
=>
item
.
info
.
content
).
join
(
'
,
'
)
}
}
}
}
catch
(
e
)
{
catch
(
e
)
{
...
@@ -36,64 +36,75 @@ const getCommit = async () => {
...
@@ -36,64 +36,75 @@ const getCommit = async () => {
}
}
const
analysisCommit
=
async
()
=>
{
const
analysisCommit
=
async
()
=>
{
state
.
loading
=
true
try
{
try
{
console
.
log
(
'
state.text
'
,
state
.
text
)
console
.
log
(
'
state.text
'
,
state
.
text
)
const
res
=
await
askGpt
({
const
res
=
await
askGpt
({
content
:
'
帮我分析总结这些评论
'
+
state
.
text
content
:
'
帮我分析总结这些评论
'
+
state
.
text
})
})
if
(
res
?.
data
?.
data
?.
result
)
{
if
(
res
?.
data
?.
data
?.
result
)
{
state
.
analysis
=
res
?.
data
?.
data
?.
result
state
.
analysis
=
res
?.
data
?.
data
?.
result
}
}
}
}
catch
(
e
)
{
catch
(
e
)
{
message
.
warn
(
JSON
.
stringify
(
e
))
message
.
warn
(
JSON
.
stringify
(
e
))
}
}
finally
{
state
.
loading
=
false
}
}
}
</
script
>
</
script
>
<
template
>
<
template
>
<a-spin
:spinning=
"state.loading"
>
<a-spin
:spinning=
"state.loading"
>
<div>
<div>
<div
style=
"display: flex;"
>
<div>
<div
style=
"width:50%"
>
<div
style=
"max-width:450px;"
>
<div>
<a-row
justify=
"space-between"
>
articleId:
<a-input
v-model:value=
"state.articleId"
/>
<a-col
:span=
"8"
>
</div>
(文章id)articleId:
<a-input
v-model:value=
"state.articleId"
placeholder=
"'文章id'"
/>
<div>
</a-col>
page:
<a-input
v-model:value=
"state.page"
/>
<a-col
:span=
"8"
>
</div>
(页数)page:
<a-input
v-model:value=
"state.page"
placeholder=
"页数"
/>
</a-col>
</a-row>
<a-row
justify=
"space-between"
>
<a-col
:span=
"8"
>
(页大小)pageSize:
<a-input
v-model:value=
"state.pageSize"
placeholder=
"总页数"
/>
</a-col>
<a-col
:span=
"8"
>
(收藏)unfold:
<a-input
v-model:value=
"state.unfold"
placeholder=
"收藏"
/>
</a-col>
</a-row>
<div>
<a-row
justify=
"space-between"
>
pageSize:
<a-input
v-model:value=
"state.pageSize"
/>
<a-col
:span=
"8"
>
</div>
(评论id)commitId:
<a-input
v-model:value=
"state.commitId"
placeholder=
"评论id"
/>
<div>
</a-col>
unfold:
<a-input
v-model:value=
"state.unfold"
/>
</a-row>
</div>
<div>
commitId:
<a-input
v-model:value=
"state.commitId"
/>
</div>
</div>
</div>
<div
style=
"width:
50%
;display: flex;justify-content: center;align-items: center;"
>
<div
style=
"width:
100%;margin-top:10px
;display: flex;justify-content: center;align-items: center;"
>
<a-button
@
click=
"getCommit"
>
获取评论
</a-button>
<a-button
@
click=
"getCommit"
type=
"primary"
>
获取评论
</a-button>
</div>
</div>
</div>
</div>
<div>
<div>
<div
class=
"des
"
>
<div
style=
"margin:10px 0;
"
>
评论
<a-tag
color=
"blue"
>
评论
</a-tag>
</div>
</div>
<a-textarea
v-model:value=
"state.text"
placeholder=
"评论"
:disabled=
"state.loading"
<a-textarea
v-model:value=
"state.text"
placeholder=
"评论"
:disabled=
"state.loading"
:auto-size=
"
{ minRows: 2, maxRows:
5
}" />
:auto-size=
"
{ minRows: 2, maxRows:
20
}" />
</div>
</div>
<div
style=
"margin-top:10px;;width:100%;display: flex;justify-content: center;align-items: center;"
>
<div
style=
"margin-top:10px;;width:100%;display: flex;justify-content: center;align-items: center;"
>
<a-button
@
click=
"analysisCommit"
>
文心一言分析评论
</a-button>
<a-button
@
click=
"analysisCommit"
type=
"primary"
>
文心一言分析评论
</a-button>
</div>
</div>
<div
style=
"margin-top:10px;"
>
<div
style=
"margin-top:10px;"
>
<div
class=
"des
"
>
<div
style=
"margin:10px 0;
"
>
生成的评论总结
<a-tag
color=
"blue"
>
文心一言生成的总结
</a-tag>
</div>
</div>
<a-textarea
v-model:value=
"state.analysis"
placeholder=
"生成的文章总结"
readonly
<a-textarea
v-model:value=
"state.analysis"
placeholder=
"生成的文章总结"
readonly
:auto-size=
"
{ minRows: 2, maxRows:
5
}" />
:auto-size=
"
{ minRows: 2, maxRows:
20
}" />
</div>
</div>
</div>
</div>
</a-spin>
</a-spin>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录