Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Kwan的解忧杂货铺@新空间代码工作室
vue-kwan-admin
提交
96eef36b
V
vue-kwan-admin
项目概览
Kwan的解忧杂货铺@新空间代码工作室
/
vue-kwan-admin
通知
38
Star
6
Fork
3
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-kwan-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
96eef36b
编写于
7月 12, 2023
作者:
Kwan的解忧杂货铺@新空间代码工作室
🐭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
整理
上级
32dc6d23
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
92 addition
and
94 deletion
+92
-94
src/components/menus/MyChat.vue
src/components/menus/MyChat.vue
+5
-5
src/components/menus/MyUsers.vue
src/components/menus/MyUsers.vue
+11
-11
src/components/user/MyChatDetail.vue
src/components/user/MyChatDetail.vue
+76
-78
未找到文件。
src/components/menus/MyChat.vue
浏览文件 @
96eef36b
...
...
@@ -13,10 +13,10 @@
</el-header>
<el-main>
<el-table
:data=
"userlist"
v-loading=
"loading"
>
<el-table-column
prop=
"id"
label=
"序号"
width=
"50"
></el-table-column>
<el-table-column
prop=
"question"
label=
"问题"
width=
"240"
></el-table-column>
<el-table-column
prop=
"response"
label=
"答案"
></el-table-column>
<el-table
border
:data=
"userlist"
v-loading=
"loading"
>
<el-table-column
prop=
"id"
label=
"序号"
width=
"50"
sortable
></el-table-column>
<el-table-column
prop=
"question"
label=
"问题"
width=
"240"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop=
"response"
label=
"答案"
show-overflow-tooltip
></el-table-column>
<el-table-column
label=
"创建时间"
width=
"170"
>
<template
slot-scope=
"props"
>
{{
props
.
row
.
createTime
|
dateFormat
}}
...
...
@@ -55,7 +55,7 @@ export default {
loading
:
false
,
elementui_page_component_key
:
0
,
currentPage
:
Number
(
localStorage
.
getItem
(
'
lastPage
'
))
||
1
,
pageSize
:
5
,
pageSize
:
14
,
total
:
0
,
};
},
...
...
src/components/menus/MyUsers.vue
浏览文件 @
96eef36b
...
...
@@ -31,27 +31,27 @@
<
script
>
export
default
{
name
:
'
MyUser
'
,
name
:
"
MyUser
"
,
data
()
{
return
{
// 用户列表数据
userlist
:
[
{
id
:
1
,
name
:
'
嬴政
'
,
age
:
18
,
position
:
'
始皇帝
'
},
{
id
:
2
,
name
:
'
李斯
'
,
age
:
35
,
position
:
'
丞相
'
},
{
id
:
3
,
name
:
'
吕不韦
'
,
age
:
50
,
position
:
'
商人
'
},
{
id
:
4
,
name
:
'
赵姬
'
,
age
:
48
,
position
:
'
王太后
'
}
]
}
{
id
:
1
,
name
:
"
嬴政
"
,
age
:
18
,
position
:
"
始皇帝
"
},
{
id
:
2
,
name
:
"
李斯
"
,
age
:
35
,
position
:
"
丞相
"
},
{
id
:
3
,
name
:
"
吕不韦
"
,
age
:
50
,
position
:
"
商人
"
},
{
id
:
4
,
name
:
"
赵姬
"
,
age
:
48
,
position
:
"
王太后
"
},
]
,
}
;
},
methods
:
{
gotoDetail
(
id
)
{
// /home/userinfo/1
// /home/userinfo/2
// /home/userinfo/3
this
.
$router
.
push
(
'
/home/userinfo/
'
+
id
)
}
}
}
this
.
$router
.
push
(
"
/home/userinfo/
"
+
id
);
}
,
}
,
}
;
</
script
>
<
style
lang=
"less"
scoped
></
style
>
\ No newline at end of file
src/components/user/MyChatDetail.vue
浏览文件 @
96eef36b
<
template
>
<div>
<el-button
@
click=
"$router.back()"
>
后退
</el-button>
<h4
class=
"text-center"
>
ChatGpt问答详情 ---
{{
id
}}
</h4>
<el-container>
<el-main>
<el-table
:data=
"list"
>
<el-table-column
label=
"序号"
width=
"50"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
id
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"问题"
width=
"240"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
question
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"回答"
>
<
template
slot-scope=
"scope"
>
<span
id=
"td-response"
>
{{
scope
.
row
.
response
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"创建时间"
width=
"170"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
createTime
|
dateFormat
}}
</span>
</
template
>
</el-table-column>
</el-table>
</el-main>
</el-container>
<div
class=
"button-container"
>
<el-button
@
click=
"copyCode"
>
复制回答
</el-button>
</div>
</div>
<div>
<el-button
@
click=
"$router.back()"
>
后退
</el-button>
<h4
class=
"text-center"
>
ChatGpt问答详情 ---
{{
id
}}
</h4>
<el-container>
<el-main>
<el-table
border
:data=
"list"
>
<el-table-column
label=
"序号"
width=
"50"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
id
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"问题"
width=
"240"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
question
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"回答"
>
<
template
slot-scope=
"scope"
>
<span
id=
"td-response"
>
{{
scope
.
row
.
response
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"创建时间"
width=
"170"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
createTime
|
dateFormat
}}
</span>
</
template
>
</el-table-column>
</el-table>
</el-main>
</el-container>
<div
class=
"button-container"
>
<el-button
@
click=
"copyCode"
>
复制回答
</el-button>
</div>
</div>
</template>
<
script
>
// 导入 axios 请求库
import
axios
from
"
axios
"
;
import
axios
from
'
axios
'
;
export
default
{
name
:
"
MyChatDetail
"
,
props
:
[
"
id
"
],
data
()
{
return
{
list
:
[],
};
},
created
()
{
// 调用请求数据的方法
this
.
initChatList
();
},
methods
:
{
// // 封装请求列表数据的方法
async
initChatList
()
{
// 调用 axios 的 get 方法,请求列表数据
const
{
data
:
res
}
=
await
axios
.
get
(
"
http://120.79.36.53:8888/chatbot/
"
+
this
.
id
);
// 只要请求回来的数据,在页面渲染期间要用到,则必须转存到 data 中
if
(
res
.
code
===
200
)
{
this
.
list
=
[
{
id
:
res
.
result
.
id
,
question
:
res
.
result
.
question
,
response
:
res
.
result
.
response
,
createTime
:
res
.
result
.
createTime
,
},
];
}
name
:
'
MyChatDetail
'
,
props
:
[
'
id
'
],
data
()
{
return
{
list
:
[],
};
},
copyCode
()
{
const
codeBlock
=
document
.
getElementById
(
"
td-response
"
);
const
range
=
document
.
createRange
();
range
.
selectNode
(
codeBlock
);
const
selection
=
window
.
getSelection
();
selection
.
removeAllRanges
();
selection
.
addRange
(
range
);
document
.
execCommand
(
"
copy
"
);
selection
.
removeAllRanges
();
this
.
$message
.
success
(
"
代码已复制到剪贴板
"
);
created
()
{
// 调用请求数据的方法
this
.
initChatList
();
},
methods
:
{
// // 封装请求列表数据的方法
async
initChatList
()
{
// 调用 axios 的 get 方法,请求列表数据
const
{
data
:
res
}
=
await
axios
.
get
(
'
http://120.79.36.53:8888/chatbot/
'
+
this
.
id
);
// 只要请求回来的数据,在页面渲染期间要用到,则必须转存到 data 中
if
(
res
.
code
===
200
)
{
this
.
list
=
[
{
id
:
res
.
result
.
id
,
question
:
res
.
result
.
question
,
response
:
res
.
result
.
response
,
createTime
:
res
.
result
.
createTime
,
},
];
}
},
copyCode
()
{
const
codeBlock
=
document
.
getElementById
(
'
td-response
'
);
const
range
=
document
.
createRange
();
range
.
selectNode
(
codeBlock
);
const
selection
=
window
.
getSelection
();
selection
.
removeAllRanges
();
selection
.
addRange
(
range
);
document
.
execCommand
(
'
copy
'
);
selection
.
removeAllRanges
();
this
.
$message
.
success
(
'
代码已复制到剪贴板
'
);
},
},
},
};
</
script
>
<
style
lang=
"less"
scoped
>
.button-container {
position: fixed;
bottom: 0;
right: 0;
margin: 16px;
position: fixed;
bottom: 0;
right: 0;
margin: 16px;
}
</
style
>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录