提交 19b7607c 编写于 作者: 檀越@新空间's avatar 檀越@新空间 🐭

整理

上级 e9041296
......@@ -20,7 +20,6 @@
import MyHeader from './subcomponents/MyHeader.vue'
// 左侧边栏组件
import MyAside from './subcomponents/MyAside.vue'
export default {
name: 'MyHome',
// 注册组件
......
......@@ -15,11 +15,7 @@
<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="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">
......@@ -42,14 +38,15 @@
@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 {
......@@ -57,7 +54,7 @@ export default {
userlist: [],
loading: false,
elementui_page_component_key: 0,
currentPage: Number(localStorage.getItem("lastPage")) || 1,
currentPage: Number(localStorage.getItem('lastPage')) || 1,
pageSize: 5,
total: 0,
};
......@@ -68,7 +65,7 @@ export default {
this.initCartList();
},
mounted() {
this.currentPage = Number(localStorage.getItem("lastPage")) || 1;
this.currentPage = Number(localStorage.getItem('lastPage')) || 1;
this.elementui_page_component_key++;
},
methods: {
......@@ -76,24 +73,21 @@ export default {
location.reload();
},
gotoDetail(id) {
this.$router.push("/home/chatinfo/" + 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",
{
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);
localStorage.setItem('lastPage', this.currentPage);
}
this.loading = false;
},
......@@ -125,4 +119,23 @@ export default {
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
......@@ -47,6 +47,7 @@
<script>
export default { name: "MyAside" };
</script>
<style lang="less" scoped>
.layout-aside-container {
width: 250px;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册