Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Kwan的解忧杂货铺@新空间代码工作室
vue-kwan-admin
提交
19b7607c
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看板
提交
19b7607c
编写于
7月 12, 2023
作者:
Kwan的解忧杂货铺@新空间代码工作室
🐭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
整理
上级
e9041296
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
116 addition
and
103 deletion
+116
-103
src/components/MyHome.vue
src/components/MyHome.vue
+1
-2
src/components/menus/MyChat.vue
src/components/menus/MyChat.vue
+113
-100
src/components/subcomponents/MyAside.vue
src/components/subcomponents/MyAside.vue
+2
-1
未找到文件。
src/components/MyHome.vue
浏览文件 @
19b7607c
...
...
@@ -20,7 +20,6 @@
import
MyHeader
from
'
./subcomponents/MyHeader.vue
'
// 左侧边栏组件
import
MyAside
from
'
./subcomponents/MyAside.vue
'
export
default
{
name
:
'
MyHome
'
,
// 注册组件
...
...
@@ -46,4 +45,4 @@ export default {
}
}
}
</
style
>
</
style
>
\ No newline at end of file
src/components/menus/MyChat.vue
浏览文件 @
19b7607c
<
template
>
<div>
<el-container>
<el-header
style=
"text-align: right; font-size: 12px"
>
<i
class=
"el-icon-refresh header-button-item"
@
click=
"refreshPage"
></i>
<el-dropdown>
<i
class=
"el-icon-setting header-button-item"
></i>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item>
新增
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<a
href=
"http://qinyingjie.top/"
target=
"_blank"
class=
"header-button-item"
>
kwan
</a>
</el-header>
<div>
<el-container>
<el-header
style=
"text-align: right; font-size: 12px"
>
<i
class=
"el-icon-refresh header-button-item"
@
click=
"refreshPage"
></i>
<el-dropdown>
<i
class=
"el-icon-setting header-button-item"
></i>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item>
新增
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<a
href=
"http://qinyingjie.top/"
target=
"_blank"
class=
"header-button-item"
>
kwan
</a>
</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-column
label=
"创建时间"
width=
"170"
>
<template
slot-scope=
"props"
>
{{
props
.
row
.
createTime
|
dateFormat
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"详情"
label=
"详情"
width=
"100"
>
<
template
slot-scope=
"props"
>
<a
href=
"#"
@
click.prevent=
"gotoDetail(props.row.id)"
>
详情
</a>
</
template
>
</el-table-column>
</el-table>
<el-pagination
class=
"pagination"
background
:key=
"elementui_page_component_key"
:current-page.sync=
"currentPage"
:page-size=
"pageSize"
:total=
"total"
@
current-change=
"handleCurrentChange"
></el-pagination>
</el-main>
</el-container>
</div>
<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-column
label=
"创建时间"
width=
"170"
>
<template
slot-scope=
"props"
>
{{
props
.
row
.
createTime
|
dateFormat
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"详情"
label=
"详情"
width=
"100"
>
<
template
slot-scope=
"props"
>
<a
href=
"#"
@
click.prevent=
"gotoDetail(props.row.id)"
>
详情
</a>
</
template
>
</el-table-column>
</el-table>
<el-pagination
class=
"pagination"
background
:key=
"elementui_page_component_key"
:current-page.sync=
"currentPage"
:page-size=
"pageSize"
:total=
"total"
@
current-change=
"handleCurrentChange"
></el-pagination>
</el-main>
<el-backtop
class=
"backtop"
></el-backtop>
</el-container>
</div>
</template>
<
script
>
import
axios
from
"
axios
"
;
import
axios
from
'
axios
'
;
export
default
{
name
:
"
MyChat
"
,
name
:
'
MyChat
'
,
data
()
{
return
{
// 用户列表数据
userlist
:
[],
loading
:
false
,
elementui_page_component_key
:
0
,
currentPage
:
Number
(
localStorage
.
getItem
(
"
lastPage
"
))
||
1
,
pageSize
:
5
,
total
:
0
,
};
},
data
()
{
return
{
// 用户列表数据
userlist
:
[],
loading
:
false
,
elementui_page_component_key
:
0
,
currentPage
:
Number
(
localStorage
.
getItem
(
'
lastPage
'
))
||
1
,
pageSize
:
5
,
total
:
0
,
};
},
created
()
{
// 调用请求数据的方法
this
.
initCartList
();
},
mounted
()
{
this
.
currentPage
=
Number
(
localStorage
.
getItem
(
"
lastPage
"
))
||
1
;
this
.
elementui_page_component_key
++
;
},
methods
:
{
refreshPage
()
{
location
.
reload
();
created
()
{
// 调用请求数据的方法
this
.
initCartList
();
},
gotoDetail
(
id
)
{
this
.
$router
.
push
(
"
/home/chatinfo/
"
+
id
);
mounted
()
{
this
.
currentPage
=
Number
(
localStorage
.
getItem
(
'
lastPage
'
))
||
1
;
this
.
elementui_page_component_key
++
;
},
methods
:
{
refreshPage
()
{
location
.
reload
();
},
gotoDetail
(
id
)
{
this
.
$router
.
push
(
'
/home/chatinfo/
'
+
id
);
},
async
initCartList
()
{
this
.
loading
=
true
;
const
{
data
:
res
}
=
await
axios
.
get
(
"
http://120.79.36.53:8888/chatbot/page
"
,
{
params
:
{
page
:
this
.
currentPage
,
pageSize
:
this
.
pageSize
,
},
}
);
if
(
res
.
code
===
200
)
{
this
.
userlist
=
res
.
result
.
records
;
this
.
total
=
res
.
result
.
total
;
localStorage
.
setItem
(
"
lastPage
"
,
this
.
currentPage
);
}
this
.
loading
=
false
;
},
async
initCartList
()
{
this
.
loading
=
true
;
const
{
data
:
res
}
=
await
axios
.
get
(
'
http://120.79.36.53:8888/chatbot/page
'
,
{
params
:
{
page
:
this
.
currentPage
,
pageSize
:
this
.
pageSize
,
},
});
if
(
res
.
code
===
200
)
{
this
.
userlist
=
res
.
result
.
records
;
this
.
total
=
res
.
result
.
total
;
localStorage
.
setItem
(
'
lastPage
'
,
this
.
currentPage
);
}
this
.
loading
=
false
;
},
handleCurrentChange
(
currentPage
)
{
this
.
currentPage
=
currentPage
;
this
.
initCartList
();
handleCurrentChange
(
currentPage
)
{
this
.
currentPage
=
currentPage
;
this
.
initCartList
();
},
},
},
};
</
script
>
<
style
lang=
"less"
scoped
>
.el-header {
background-color: #b3c0d1;
color: #333;
line-height: 60px;
background-color: #b3c0d1;
color: #333;
line-height: 60px;
}
.el-aside {
color: #333;
color: #333;
}
.pagination {
margin-top: 16px;
text-align: right;
margin-top: 16px;
text-align: right;
}
.header-button-item {
margin-right: 15px;
font-size: 20px;
margin-right: 15px;
font-size: 20px;
}
.backtop {
position: fixed;
bottom: 50px;
right: 50px;
height: 40px;
width: 40px;
line-height: 40px;
text-align: center;
border-radius: 20px;
background-color: #007aff;
color: #fff;
cursor: pointer;
z-index: 999;
}
.backtop:hover {
background-color: #0050a0;
}
</
style
>
\ No newline at end of file
src/components/subcomponents/MyAside.vue
浏览文件 @
19b7607c
...
...
@@ -47,6 +47,7 @@
<
script
>
export
default
{
name
:
"
MyAside
"
};
</
script
>
<
style
lang=
"less"
scoped
>
.layout-aside-container {
width: 250px;
...
...
@@ -56,4 +57,4 @@ export default { name: "MyAside" };
.left-aside-item {
font-size: 20px;
}
</
style
>
</
style
>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录