整理

上级 591a28b8
.login-container[data-v-1be4e8ce]{background-color:#35495e;height:100%}.login-container .login-box[data-v-1be4e8ce]{width:400px;height:250px;background-color:#fff;border-radius:3px;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);box-shadow:0 0 6px hsla(0,0%,100%,.5)}.login-container .login-box .form-login[data-v-1be4e8ce]{position:absolute;bottom:0;left:0;width:100%;box-sizing:border-box}.form-control[data-v-1be4e8ce]{flex:1}.avatar-box[data-v-1be4e8ce]{position:absolute;width:100%;top:-65px;left:0}.avatar-box .avatar[data-v-1be4e8ce]{width:120px;height:120px;border-radius:50%!important;box-shadow:0 0 6px #efefef}.layout-header-left-img[data-v-0bc02e96]{height:50px}.layout-aside-container[data-v-04b0cce7]{width:200px;height:100%;border-right:1px solid #eaeaea}.left-aside-item[data-v-04b0cce7]{font-size:20px}.el-main{padding:20px 3px!important}.el-header[data-v-5503bb7a]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-5503bb7a]{color:#333}.pagination[data-v-5503bb7a]{margin-top:16px;text-align:right}.arrow-button[data-v-5503bb7a]{display:flex;align-items:center;justify-content:center;border:none;background-color:transparent;cursor:pointer}.custom-icon[data-v-5503bb7a]{font-size:24px;color:#f90;margin-right:6px}.arrow-button.disabled[data-v-5503bb7a]{pointer-events:none;opacity:.1}.el-header[data-v-46e73c50]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-46e73c50]{color:#333}.pagination[data-v-46e73c50]{margin-top:16px;text-align:right}.header-button-item[data-v-46e73c50]{margin-right:15px;font-size:20px}.backtop[data-v-46e73c50]{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[data-v-46e73c50]:hover{background-color:#0050a0}.el-header[data-v-a05e897a]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-a05e897a]{color:#333}.pagination[data-v-a05e897a]{margin-top:16px;text-align:right}.header-button-item[data-v-a05e897a]{margin-right:15px;font-size:20px}.red-title[data-v-a05e897a]{line-height:24px;font-size:18px;color:red}.backtop[data-v-a05e897a]{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}.custom-textarea[data-v-a05e897a]{width:100%;text-align:left}.backtop[data-v-a05e897a]:hover{background-color:#0050a0}.el-header[data-v-277bc25c]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-277bc25c]{color:#333}.pagination[data-v-277bc25c]{margin-top:16px;text-align:right}.header-button-item[data-v-277bc25c]{margin-right:15px;font-size:20px}.red-title[data-v-277bc25c]{line-height:24px;font-size:18px;color:red}.backtop[data-v-277bc25c]{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}.custom-textarea[data-v-277bc25c]{width:100%;text-align:left}.backtop[data-v-277bc25c]:hover{background-color:#0050a0}.el-header[data-v-7f9d4b2f]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-7f9d4b2f]{color:#333}.pagination[data-v-7f9d4b2f]{margin-top:16px;text-align:right}.header-button-item[data-v-7f9d4b2f]{margin-right:15px;font-size:20px}.red-title[data-v-7f9d4b2f]{line-height:24px;font-size:18px;color:red}.backtop[data-v-7f9d4b2f]{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}.custom-textarea[data-v-7f9d4b2f]{width:100%;text-align:left}.backtop[data-v-7f9d4b2f]:hover{background-color:#0050a0}.el-header[data-v-46c1f8ba]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-46c1f8ba]{color:#333}.pagination[data-v-46c1f8ba]{margin-top:16px;text-align:right}.header-button-item[data-v-46c1f8ba]{margin-right:15px;font-size:20px}.red-title[data-v-46c1f8ba]{line-height:24px;font-size:18px;color:red}.backtop[data-v-46c1f8ba]{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}.custom-textarea[data-v-46c1f8ba]{width:100%;text-align:left}.backtop[data-v-46c1f8ba]:hover{background-color:#0050a0}.el-header[data-v-38003344]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-38003344]{color:#333}.pagination[data-v-38003344]{margin-top:16px;text-align:right}.header-button-item[data-v-38003344]{margin-right:15px;font-size:20px}.red-title[data-v-38003344]{line-height:24px;font-size:18px;color:red}.backtop[data-v-38003344]{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}.custom-textarea[data-v-38003344]{width:100%;text-align:left}.backtop[data-v-38003344]:hover{background-color:#0050a0}.el-header[data-v-9d40f752]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-9d40f752]{color:#333}.pagination[data-v-9d40f752]{margin-top:16px;text-align:right}.header-button-item[data-v-9d40f752]{margin-right:15px;font-size:20px}.red-title[data-v-9d40f752]{line-height:24px;font-size:18px;color:red}.backtop[data-v-9d40f752]{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}.custom-textarea[data-v-9d40f752]{width:100%;text-align:left}.backtop[data-v-9d40f752]:hover{background-color:#0050a0}.button-container[data-v-bdbc2b14]{position:fixed;bottom:0;right:0;margin:16px}.container[data-v-19e0b810]{display:flex;justify-content:center;align-items:center;height:30vh} .login-container[data-v-1be4e8ce]{background-color:#35495e;height:100%}.login-container .login-box[data-v-1be4e8ce]{width:400px;height:250px;background-color:#fff;border-radius:3px;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);box-shadow:0 0 6px hsla(0,0%,100%,.5)}.login-container .login-box .form-login[data-v-1be4e8ce]{position:absolute;bottom:0;left:0;width:100%;box-sizing:border-box}.form-control[data-v-1be4e8ce]{flex:1}.avatar-box[data-v-1be4e8ce]{position:absolute;width:100%;top:-65px;left:0}.avatar-box .avatar[data-v-1be4e8ce]{width:120px;height:120px;border-radius:50%!important;box-shadow:0 0 6px #efefef}.layout-header-left-img[data-v-0bc02e96]{height:50px}.layout-aside-container[data-v-5b66f297]{width:200px;height:100%;border-right:1px solid #eaeaea}.left-aside-item[data-v-5b66f297]{font-size:20px}.el-main{padding:20px 3px!important}.el-header[data-v-5503bb7a]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-5503bb7a]{color:#333}.pagination[data-v-5503bb7a]{margin-top:16px;text-align:right}.arrow-button[data-v-5503bb7a]{display:flex;align-items:center;justify-content:center;border:none;background-color:transparent;cursor:pointer}.custom-icon[data-v-5503bb7a]{font-size:24px;color:#f90;margin-right:6px}.arrow-button.disabled[data-v-5503bb7a]{pointer-events:none;opacity:.1}.el-header[data-v-46e73c50]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-46e73c50]{color:#333}.pagination[data-v-46e73c50]{margin-top:16px;text-align:right}.header-button-item[data-v-46e73c50]{margin-right:15px;font-size:20px}.backtop[data-v-46e73c50]{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[data-v-46e73c50]:hover{background-color:#0050a0}.el-header[data-v-a05e897a]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-a05e897a]{color:#333}.pagination[data-v-a05e897a]{margin-top:16px;text-align:right}.header-button-item[data-v-a05e897a]{margin-right:15px;font-size:20px}.red-title[data-v-a05e897a]{line-height:24px;font-size:18px;color:red}.backtop[data-v-a05e897a]{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}.custom-textarea[data-v-a05e897a]{width:100%;text-align:left}.backtop[data-v-a05e897a]:hover{background-color:#0050a0}.el-header[data-v-277bc25c]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-277bc25c]{color:#333}.pagination[data-v-277bc25c]{margin-top:16px;text-align:right}.header-button-item[data-v-277bc25c]{margin-right:15px;font-size:20px}.red-title[data-v-277bc25c]{line-height:24px;font-size:18px;color:red}.backtop[data-v-277bc25c]{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}.custom-textarea[data-v-277bc25c]{width:100%;text-align:left}.backtop[data-v-277bc25c]:hover{background-color:#0050a0}.el-header[data-v-7f9d4b2f]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-7f9d4b2f]{color:#333}.pagination[data-v-7f9d4b2f]{margin-top:16px;text-align:right}.header-button-item[data-v-7f9d4b2f]{margin-right:15px;font-size:20px}.red-title[data-v-7f9d4b2f]{line-height:24px;font-size:18px;color:red}.backtop[data-v-7f9d4b2f]{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}.custom-textarea[data-v-7f9d4b2f]{width:100%;text-align:left}.backtop[data-v-7f9d4b2f]:hover{background-color:#0050a0}.el-header[data-v-570cb36f]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-570cb36f]{color:#333}.pagination[data-v-570cb36f]{margin-top:16px;text-align:right}.header-button-item[data-v-570cb36f]{margin-right:15px;font-size:20px}.red-title[data-v-570cb36f]{line-height:24px;font-size:18px;color:red}.backtop[data-v-570cb36f]{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}.custom-textarea[data-v-570cb36f]{width:100%;text-align:left}.backtop[data-v-570cb36f]:hover{background-color:#0050a0}.el-header[data-v-33b199a6]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-33b199a6]{color:#333}.pagination[data-v-33b199a6]{margin-top:16px;text-align:right}.header-button-item[data-v-33b199a6]{margin-right:15px;font-size:20px}.red-title[data-v-33b199a6]{line-height:24px;font-size:18px;color:red}.backtop[data-v-33b199a6]{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}.custom-textarea[data-v-33b199a6]{width:100%;text-align:left}.backtop[data-v-33b199a6]:hover{background-color:#0050a0}.el-header[data-v-410d989c]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-410d989c]{color:#333}.pagination[data-v-410d989c]{margin-top:16px;text-align:right}.header-button-item[data-v-410d989c]{margin-right:15px;font-size:20px}.red-title[data-v-410d989c]{line-height:24px;font-size:18px;color:red}.backtop[data-v-410d989c]{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}.custom-textarea[data-v-410d989c]{width:100%;text-align:left}.backtop[data-v-410d989c]:hover{background-color:#0050a0}.el-header[data-v-0f57df08]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-0f57df08]{color:#333}.pagination[data-v-0f57df08]{margin-top:16px;text-align:right}.header-button-item[data-v-0f57df08]{margin-right:15px;font-size:20px}.red-title[data-v-0f57df08]{line-height:24px;font-size:18px;color:red}.backtop[data-v-0f57df08]{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}.custom-textarea[data-v-0f57df08]{width:100%;text-align:left}.backtop[data-v-0f57df08]:hover{background-color:#0050a0}.button-container[data-v-bdbc2b14]{position:fixed;bottom:0;right:0;margin:16px}.container[data-v-19e0b810]{display:flex;justify-content:center;align-items:center;height:30vh}
/*! /*!
* Bootstrap v4.5.0 (https://getbootstrap.com/) * Bootstrap v4.5.0 (https://getbootstrap.com/)
......
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/kwan.png"><title>kwan</title><link href="/css/app.8cde8efd.css" rel="preload" as="style"><link href="/css/chunk-vendors.0bfa23eb.css" rel="preload" as="style"><link href="/js/app.c2e5544a.js" rel="preload" as="script"><link href="/js/chunk-vendors.533b9d47.js" rel="preload" as="script"><link href="/css/chunk-vendors.0bfa23eb.css" rel="stylesheet"><link href="/css/app.8cde8efd.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but kwan doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/js/chunk-vendors.533b9d47.js"></script><script src="/js/app.c2e5544a.js"></script></body></html> <!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/kwan.png"><title>kwan</title><link href="/css/app.78b5c797.css" rel="preload" as="style"><link href="/css/chunk-vendors.0bfa23eb.css" rel="preload" as="style"><link href="/js/app.743e7515.js" rel="preload" as="script"><link href="/js/chunk-vendors.533b9d47.js" rel="preload" as="script"><link href="/css/chunk-vendors.0bfa23eb.css" rel="stylesheet"><link href="/css/app.78b5c797.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but kwan doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/js/chunk-vendors.533b9d47.js"></script><script src="/js/app.743e7515.js"></script></body></html>
\ No newline at end of file \ No newline at end of file
因为 它太大了无法显示 source diff 。你可以改为 查看blob
因为 它太大了无法显示 source diff 。你可以改为 查看blob
因为 它太大了无法显示 source diff 。你可以改为 查看blob
import axios from 'axios' import axios from 'axios'
// 创建一个名为 ApiService 的对象,包含您的异步方法 // 创建一个名为 ApiService 的对象,包含您的异步方法
const ApiService = { const ApiService = {
async triplet(articleId) { async triplet(articleId) {
return await axios.get('http://43.139.90.182:8888/csdnArticleInfo/triplet?articleId=' + articleId); return await axios.get('http://43.139.90.182:8888/csdnArticleInfo/triplet?articleId=' + articleId)
}, },
async resetLikes() { async resetLikes() {
return await axios.get('http://43.139.90.182:8888/csdnArticleInfo/fixLikesStatus'); return await axios.get('http://43.139.90.182:8888/csdnArticleInfo/fixLikesStatus')
}, },
async allTriplet(articleIds) { async allTriplet(articleIds) {
return await axios.post('http://43.139.90.182:8888/csdnArticleInfo/multiTriplet', articleIds); return await axios.post('http://43.139.90.182:8888/csdnArticleInfo/multiTriplet', articleIds)
}, },
async onDelete(id) { async onDelete(id) {
return await axios.get('http://43.139.90.182:8888/csdnArticleInfo/delete', { return await axios.get('http://43.139.90.182:8888/csdnArticleInfo/delete', {
params: { params: {
id: id id: id,
} },
}) })
} },
} }
export default ApiService; export default ApiService
...@@ -194,368 +194,368 @@ ...@@ -194,368 +194,368 @@
import axios from 'axios' import axios from 'axios'
import ApiService from '../../api/ApiService' import ApiService from '../../api/ApiService'
export default { export default {
name: 'MyArticleInfo', name: 'MyArticleInfo',
data() { data() {
return { return {
form: { form: {
userName: '', userName: '',
articleId: '', articleId: '',
articleUrl: '', articleUrl: '',
articleScore: '', articleScore: '',
}, },
formInline: { formInline: {
articleId: '', articleId: '',
userName: '', userName: '',
nickName: '', nickName: '',
articleUrl: '', articleUrl: '',
isMyself: null, isMyself: null,
articleScoreStart: 0, articleScoreStart: 0,
articleScoreEnd: 100, articleScoreEnd: 100,
likeStatus: null, likeStatus: null,
collectStatus: null, collectStatus: null,
commentStatus: null, commentStatus: null,
}, },
likeStatus: [ likeStatus: [
{ {
type: -1, type: -1,
name: '全部', name: '全部',
}, },
{ {
type: 0, type: 0,
name: '未处理', name: '未处理',
}, },
{ type: 1, name: '已经点过赞' }, { type: 1, name: '已经点过赞' },
{ type: 2, name: '点赞已满' }, { type: 2, name: '点赞已满' },
{ type: 3, name: '取消点赞' }, { type: 3, name: '取消点赞' },
{ type: 4, name: '文章状态不能点赞' }, { type: 4, name: '文章状态不能点赞' },
{ type: 8, name: '其他错误' }, { type: 8, name: '其他错误' },
{ type: 9, name: '点赞成功' }, { type: 9, name: '点赞成功' },
], ],
collectStatus: [ collectStatus: [
{ {
type: -1, type: -1,
name: '全部', name: '全部',
}, },
{ {
type: 0, type: 0,
name: '未处理', name: '未处理',
}, },
{ type: 1, name: '已经收藏过' }, { type: 1, name: '已经收藏过' },
{ type: 2, name: '收藏已满' }, { type: 2, name: '收藏已满' },
{ type: 3, name: '参数缺失' }, { type: 3, name: '参数缺失' },
{ type: 9, name: '收藏成功' }, { type: 9, name: '收藏成功' },
], ],
commentStatus: [ commentStatus: [
{ {
type: -1, type: -1,
name: '全部', name: '全部',
}, },
{ {
type: 0, type: 0,
name: '未处理', name: '未处理',
}, },
{ type: 1, name: '已经评论过' }, { type: 1, name: '已经评论过' },
{ type: 2, name: '评论已满' }, { type: 2, name: '评论已满' },
{ type: 3, name: '禁言' }, { type: 3, name: '禁言' },
{ type: 4, name: '评论太快' }, { type: 4, name: '评论太快' },
{ type: 5, name: '评论已经到了48条' }, { type: 5, name: '评论已经到了48条' },
{ type: 8, name: '其他错误' }, { type: 8, name: '其他错误' },
{ type: 9, name: '评论成功' }, { type: 9, name: '评论成功' },
], ],
isMyself: [ isMyself: [
{ {
type: -1, type: -1,
name: '全部', name: '全部',
}, },
{ {
type: 0, type: 0,
name: '', name: '',
}, },
{ type: 1, name: '' }, { type: 1, name: '' },
], ],
dialogAddFormVisible: false, dialogAddFormVisible: false,
dialogDelVisible: false, dialogDelVisible: false,
editVisible: false, editVisible: false,
tripletVisible: false, tripletVisible: false,
allTripletDialogVisible: false, allTripletDialogVisible: false,
getScoreFormVisible: false, getScoreFormVisible: false,
resetLikesDialogVisible: false, resetLikesDialogVisible: false,
// 用户列表数据 // 用户列表数据
articleInfoList: [], articleInfoList: [],
loading: false, loading: false,
elementui_page_component_key: 0, elementui_page_component_key: 0,
currentPage: Number(localStorage.getItem('csdnUserPage')) || 1, currentPage: Number(localStorage.getItem('csdnUserPage')) || 1,
pageSize: 8, pageSize: 8,
total: 0, total: 0,
// 新增的内容 // 新增的内容
formLabelWidth: '120px', formLabelWidth: '120px',
currentRowId: null, currentRowId: null,
articleId: null, articleId: null,
multipleSelection: [], multipleSelection: [],
} }
}, },
watch: { watch: {
formInline: { formInline: {
handler(newVal, oldVal) { handler(newVal, oldVal) {
this.currentPage = 1 this.currentPage = 1
localStorage.setItem('csdnUserPage', this.currentPage) localStorage.setItem('csdnUserPage', this.currentPage)
this.articleInfoPage() this.articleInfoPage()
}, },
deep: true, deep: true,
}, },
// 监听currentPage的变化,将新值保存到localStorage中 // 监听currentPage的变化,将新值保存到localStorage中
currentPage(newPage) { currentPage(newPage) {
localStorage.setItem('csdnUserPage', newPage.toString()) localStorage.setItem('csdnUserPage', newPage.toString())
}, },
}, },
created() { created() {
//获取问题类型的枚举 //获取问题类型的枚举
this.articleInfoPage() this.articleInfoPage()
}, },
mounted() { mounted() {
this.currentPage = 1 this.currentPage = 1
}, },
methods: { methods: {
prepareAdd() { prepareAdd() {
this.form.userName = '' this.form.userName = ''
this.form.articleId = '' this.form.articleId = ''
this.dialogAddFormVisible = true this.dialogAddFormVisible = true
}, },
prepareGetScore() { prepareGetScore() {
this.form.articleUrl = '' this.form.articleUrl = ''
this.form.articleScore = '' this.form.articleScore = ''
this.getScoreFormVisible = true this.getScoreFormVisible = true
}, },
prepareResetLikes() { prepareResetLikes() {
this.resetLikesDialogVisible = true this.resetLikesDialogVisible = true
}, },
prepareAllTriplet() { prepareAllTriplet() {
this.allTripletDialogVisible = true this.allTripletDialogVisible = true
}, },
prepareDelete(id) { prepareDelete(id) {
this.currentRowId = id this.currentRowId = id
this.dialogDelVisible = true this.dialogDelVisible = true
}, },
prepareTriplet(articleId) { prepareTriplet(articleId) {
this.articleId = articleId this.articleId = articleId
this.tripletVisible = true this.tripletVisible = true
}, },
preEdit(id, articleId, userName, nickName, articleUrl) { preEdit(id, articleId, userName, nickName, articleUrl) {
this.form.articleId = articleId this.form.articleId = articleId
this.form.userName = userName this.form.userName = userName
this.form.nickName = nickName this.form.nickName = nickName
this.form.articleUrl = articleUrl this.form.articleUrl = articleUrl
this.currentRowId = id this.currentRowId = id
this.editVisible = true this.editVisible = true
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val this.multipleSelection = val
}, },
handleClose(done) { handleClose(done) {
this.$confirm('确认关闭?') this.$confirm('确认关闭?')
.then((_) => { .then((_) => {
done() done()
}) })
.catch((_) => {}) .catch((_) => {})
}, },
handleConfirm(addType) { handleConfirm(addType) {
this.dialogAddFormVisible = false // 关闭对话框 this.dialogAddFormVisible = false // 关闭对话框
this.addUser(addType) // 发送请求 this.addUser(addType) // 发送请求
}, },
async addUser(addType) { async addUser(addType) {
try { try {
this.loading = true this.loading = true
const { data: res } = await axios.post('http://43.139.90.182:8888/csdnArticleInfo/add', { const { data: res } = await axios.post('http://43.139.90.182:8888/csdnArticleInfo/add', {
addType: addType, addType: addType,
userName: this.form.userName, userName: this.form.userName,
articleId: this.form.articleId, articleId: this.form.articleId,
}) })
if (res.code === 200) { if (res.code === 200) {
this.currentPage = 1 this.currentPage = 1
this.form.userName = '' this.form.userName = ''
this.form.articleId = '' this.form.articleId = ''
this.articleInfoPage() this.articleInfoPage()
} else { } else {
this.errorMsg(res.message) this.errorMsg(res.message)
console.error('Received non-200 status code', res) console.error('Received non-200 status code', res)
} }
} catch (error) { } catch (error) {
console.error('An error occurred while adding the questionName:', error) console.error('An error occurred while adding the questionName:', error)
// 异常处理逻辑 // 异常处理逻辑
} finally { } finally {
this.loading = false this.loading = false
} }
}, },
errorMsg(msg) { errorMsg(msg) {
this.$message({ this.$message({
showClose: true, showClose: true,
message: msg, message: msg,
type: 'error', type: 'error',
}) })
}, },
async editConfirm() { async editConfirm() {
try { try {
this.loading = true this.loading = true
const { data: res } = await axios.post('http://43.139.90.182:8888/csdnArticleInfo/update', { const { data: res } = await axios.post('http://43.139.90.182:8888/csdnArticleInfo/update', {
id: this.currentRowId, id: this.currentRowId,
articleId: this.form.articleId, articleId: this.form.articleId,
userName: this.form.userName, userName: this.form.userName,
nickName: this.form.nickName, nickName: this.form.nickName,
articleUrl: this.form.articleUrl, articleUrl: this.form.articleUrl,
}) })
if (res.code === 200) { if (res.code === 200) {
this.form.userName = '' this.form.userName = ''
this.form.nickName = '' this.form.nickName = ''
this.form.articleId = '' this.form.articleId = ''
this.form.articleUrl = '' this.form.articleUrl = ''
this.editVisible = false this.editVisible = false
currentRowId: null currentRowId: null
this.articleInfoPage() this.articleInfoPage()
} else { } else {
console.error('Received non-200 status code', res) console.error('Received non-200 status code', res)
} }
} catch (error) { } catch (error) {
console.error('An error occurred while adding the questionName:', error) console.error('An error occurred while adding the questionName:', error)
// 异常处理逻辑 // 异常处理逻辑
} finally { } finally {
this.loading = false this.loading = false
} }
}, },
async getScore() { async getScore() {
this.loading = true this.loading = true
const { data: res } = await axios.get('http://43.139.90.182:8888/csdnArticleInfo/getScore?articleUrl=' + this.form.articleUrl) const { data: res } = await axios.get('http://43.139.90.182:8888/csdnArticleInfo/getScore?articleUrl=' + this.form.articleUrl)
if (res.code === 200) { if (res.code === 200) {
this.form.articleScore = res.result this.form.articleScore = res.result
} else { } else {
console.error('Received non-200 status code', res) console.error('Received non-200 status code', res)
} }
this.loading = false this.loading = false
}, },
async triplet(articleId) { async triplet(articleId) {
this.loading = true this.loading = true
this.tripletVisible = false this.tripletVisible = false
const { data: res } = await ApiService.triplet(articleId) const { data: res } = await ApiService.triplet(articleId)
if (res.code === 200) { if (res.code === 200) {
this.articleId = null this.articleId = null
this.articleInfoPage() this.articleInfoPage()
} else { } else {
console.error('Received non-200 status code', res) console.error('Received non-200 status code', res)
} }
this.loading = false this.loading = false
}, },
async allTriplet() { async allTriplet() {
this.loading = true this.loading = true
this.allTripletDialogVisible = false this.allTripletDialogVisible = false
if (this.multipleSelection && this.multipleSelection.length === 0) { if (this.multipleSelection && this.multipleSelection.length === 0) {
console.error('请选择需要三连的数据行') console.error('请选择需要三连的数据行')
} else { } else {
let articleIds = this.multipleSelection.map((item) => item.articleId) let articleIds = this.multipleSelection.map((item) => item.articleId)
const { data: res } = await ApiService.allTriplet(articleIds) const { data: res } = await ApiService.allTriplet(articleIds)
if (res.code === 200) { if (res.code === 200) {
this.multipleSelection = [] this.multipleSelection = []
this.articleInfoPage() this.articleInfoPage()
} else { } else {
console.error('Received non-200 status code', res) console.error('Received non-200 status code', res)
} }
} }
this.loading = false this.loading = false
}, },
//重置点赞评论状态 //重置点赞评论状态
async resetLikes() { async resetLikes() {
this.loading = true this.loading = true
this.resetLikesDialogVisible = false this.resetLikesDialogVisible = false
const { data: res } = await ApiService.resetLikes() const { data: res } = await ApiService.resetLikes()
if (res.code === 200) { if (res.code === 200) {
this.articleInfoPage() this.articleInfoPage()
} else { } else {
console.error('Received non-200 status code', res) console.error('Received non-200 status code', res)
} }
this.loading = false this.loading = false
}, },
async onDelete(id) { async onDelete(id) {
this.loading = true this.loading = true
this.dialogDelVisible = false this.dialogDelVisible = false
await ApiService.onDelete(id) await ApiService.onDelete(id)
this.articleInfoPage() this.articleInfoPage()
this.loading = false this.loading = false
}, },
refreshPage() { refreshPage() {
//获取问题类型的枚举 //获取问题类型的枚举
this.articleInfoPage() this.articleInfoPage()
location.reload() location.reload()
}, },
async articleInfoPage() { async articleInfoPage() {
this.loading = true this.loading = true
const { data: res } = await axios.post('http://43.139.90.182:8888/csdnArticleInfo/page', { const { data: res } = await axios.post('http://43.139.90.182:8888/csdnArticleInfo/page', {
page: this.currentPage, page: this.currentPage,
pageSize: this.pageSize, pageSize: this.pageSize,
articleId: this.formInline.articleId, articleId: this.formInline.articleId,
userName: this.formInline.userName, userName: this.formInline.userName,
nickName: this.formInline.nickName, nickName: this.formInline.nickName,
articleScoreStart: this.formInline.articleScoreStart, articleScoreStart: this.formInline.articleScoreStart,
articleScoreEnd: this.formInline.articleScoreEnd, articleScoreEnd: this.formInline.articleScoreEnd,
isMyself: this.formInline.isMyself, isMyself: this.formInline.isMyself,
likeStatus: this.formInline.likeStatus == -1 ? null : this.formInline.likeStatus, likeStatus: this.formInline.likeStatus == -1 ? null : this.formInline.likeStatus,
collectStatus: this.formInline.collectStatus == -1 ? null : this.formInline.collectStatus, collectStatus: this.formInline.collectStatus == -1 ? null : this.formInline.collectStatus,
commentStatus: this.formInline.commentStatus == -1 ? null : this.formInline.commentStatus, commentStatus: this.formInline.commentStatus == -1 ? null : this.formInline.commentStatus,
}) })
if (res.code === 200) { if (res.code === 200) {
this.total = res.result.totalElements this.total = res.result.totalElements
const likeStatusMap = {} const likeStatusMap = {}
this.likeStatus.forEach((option) => { this.likeStatus.forEach((option) => {
likeStatusMap[option.type] = option.name likeStatusMap[option.type] = option.name
}) })
res.result.content.forEach((item) => { res.result.content.forEach((item) => {
item.likeStatusName = likeStatusMap[item.likeStatus] item.likeStatusName = likeStatusMap[item.likeStatus]
}) })
const collectStatusMap = {} const collectStatusMap = {}
this.collectStatus.forEach((option) => { this.collectStatus.forEach((option) => {
collectStatusMap[option.type] = option.name collectStatusMap[option.type] = option.name
}) })
res.result.content.forEach((item) => { res.result.content.forEach((item) => {
item.collectStatusName = collectStatusMap[item.collectStatus] item.collectStatusName = collectStatusMap[item.collectStatus]
}) })
const commentStatusMap = {} const commentStatusMap = {}
this.commentStatus.forEach((option) => { this.commentStatus.forEach((option) => {
commentStatusMap[option.type] = option.name commentStatusMap[option.type] = option.name
}) })
res.result.content.forEach((item) => { res.result.content.forEach((item) => {
item.commentStatusName = commentStatusMap[item.commentStatus] item.commentStatusName = commentStatusMap[item.commentStatus]
}) })
this.articleInfoList = res.result.content this.articleInfoList = res.result.content
} }
this.loading = false this.loading = false
}, },
handleCurrentChange(currentPage) { handleCurrentChange(currentPage) {
this.currentPage = currentPage this.currentPage = currentPage
this.articleInfoPage() this.articleInfoPage()
}, },
handleSizeChange(currentSize) { handleSizeChange(currentSize) {
this.pageSize = currentSize this.pageSize = currentSize
this.articleInfoPage() this.articleInfoPage()
}, },
getTagType(statusName) { getTagType(statusName) {
if (statusName == '未处理') { if (statusName == '未处理') {
return 'info' return 'info'
} else if (statusName == '已经点过赞' || statusName == '已经收藏过' || statusName == '已经评论过') { } else if (statusName == '已经点过赞' || statusName == '已经收藏过' || statusName == '已经评论过') {
return 'success' return 'success'
} else if (statusName == '文章状态不能点赞' || statusName == '收藏已满' || statusName == '评论已满' || statusName == '禁言' || statusName == '评论已经到了48条') { } else if (statusName == '文章状态不能点赞' || statusName == '收藏已满' || statusName == '评论已满' || statusName == '禁言' || statusName == '评论已经到了48条') {
return 'danger' return 'danger'
} else if (statusName == '点赞成功' || statusName == '收藏成功' || statusName == '评论成功') { } else if (statusName == '点赞成功' || statusName == '收藏成功' || statusName == '评论成功') {
return 'success' return 'success'
} else if (statusName == '点赞已满' || statusName == '参数缺失' || statusName == '其他错误' || statusName == '取消点赞' || statusName == '评论太快') { } else if (statusName == '点赞已满' || statusName == '参数缺失' || statusName == '其他错误' || statusName == '取消点赞' || statusName == '评论太快') {
return 'warning' return 'warning'
} }
}, },
}, },
} }
</script> </script>
......
...@@ -92,17 +92,6 @@ ...@@ -92,17 +92,6 @@
</el-dialog> </el-dialog>
</el-form-item> </el-form-item>
<el-form-item>
<el-button size="small" type="primary" @click="prepareMeaasge">私信点赞收藏</el-button>
<el-dialog title="提示" :visible.sync="messageDialogVisible" width="30%" :before-close="handleClose">
<span>确认处理私信点赞收藏吗?</span>
<span slot="footer" class="dialog-footer">
<el-button @click="messageDialogVisible = false">取 消</el-button>
<el-button type="primary" @click.prevent="messageDeal()">确 定</el-button>
</span>
</el-dialog>
</el-form-item>
<el-form-item> <el-form-item>
<el-button size="small" type="warning" @click="prepareResetLikesComment">核验状态</el-button> <el-button size="small" type="warning" @click="prepareResetLikesComment">核验状态</el-button>
<el-dialog title="提示" :visible.sync="resetLikesCommentDialogVisible" width="30%" :before-close="handleClose"> <el-dialog title="提示" :visible.sync="resetLikesCommentDialogVisible" width="30%" :before-close="handleClose">
...@@ -319,7 +308,6 @@ export default { ...@@ -319,7 +308,6 @@ export default {
resetUserDayStatusVisible: false, resetUserDayStatusVisible: false,
blog10DialogVisible: false, blog10DialogVisible: false,
resetLikesCommentDialogVisible: false, resetLikesCommentDialogVisible: false,
messageDialogVisible: false,
// 用户列表数据 // 用户列表数据
csdnUserList: [], csdnUserList: [],
loading: false, loading: false,
...@@ -370,9 +358,6 @@ export default { ...@@ -370,9 +358,6 @@ export default {
prepareAllTriplet() { prepareAllTriplet() {
this.allTripletDialogVisible = true this.allTripletDialogVisible = true
}, },
prepareMeaasge() {
this.messageDialogVisible = true
},
prepareResetUserDayStatus(userName) { prepareResetUserDayStatus(userName) {
this.resetUserDayStatusVisible = true this.resetUserDayStatusVisible = true
this.currentUserName = userName this.currentUserName = userName
...@@ -514,25 +499,6 @@ export default { ...@@ -514,25 +499,6 @@ export default {
} }
this.loading = false this.loading = false
}, },
async messageDeal() {
this.loading = true
this.messageDialogVisible = false
const { data: res1 } = await axios.get('http://43.139.90.182:8888/csdn/message/dealMessage')
if (res1.code === 200) {
this.userPage()
} else {
console.error('Received non-200 status code', res1)
}
const { data: res2 } = await axios.get('http://43.139.90.182:8888/csdn/likeCollect/dealLikeCollect')
if (res2.code === 200) {
this.userPage()
} else {
console.error('Received non-200 status code', res2)
}
this.loading = false
},
async fixUserLikesStatus() { async fixUserLikesStatus() {
this.loading = true this.loading = true
this.resetLikesCommentDialogVisible = false this.resetLikesCommentDialogVisible = false
......
<template>
<div>
<el-container>
<el-main>
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item>
<el-input size="small" clearable v-model="formInline.userName" placeholder="请输入用户名" @keydown.enter.native="messagePage"></el-input>
</el-form-item>
<el-form-item>
<el-input size="small" clearable v-model="formInline.nickName" placeholder="请输入用户昵称" @keydown.enter.native="messagePage"></el-input>
</el-form-item>
<el-form-item>
<el-select size="small" v-model="formInline.hasRepliedInfo" placeholder="请选择收藏状态" @change="messagePage">
<el-option v-for="item in hasRepliedInfo" :key="item.type" :label="item.name" :value="item.type"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button size="small" type="primary" @click="messagePage">查询</el-button>
</el-form-item>
<el-form-item>
<el-button size="small" type="primary" @click="prepareRefreshMessage">刷新私信列表</el-button>
<el-dialog title="提示" :visible.sync="refreshMessageDialogVisible" width="30%" :before-close="handleClose">
<span>确认刷新私信列表吗?</span>
<span slot="footer" class="dialog-footer">
<el-button @click="refreshMessageDialogVisible = false">取 消</el-button>
<el-button type="primary" @click.prevent="refreshMessage()">确 定</el-button>
</span>
</el-dialog>
</el-form-item>
<el-form-item>
<el-button size="small" type="primary" @click="prepareMeaasge">私信点赞收藏</el-button>
<el-dialog title="提示" :visible.sync="messageDialogVisible" width="30%" :before-close="handleClose">
<span>确认处理私信点赞收藏吗?</span>
<span slot="footer" class="dialog-footer">
<el-button @click="messageDialogVisible = false">取 消</el-button>
<el-button type="primary" @click.prevent="messageDeal()">确 定</el-button>
</span>
</el-dialog>
</el-form-item>
</el-form>
<el-table ref="multipleTable" v-loading="loading" :data="csdnMessageList" tooltip-effect="dark" style="width: 100%">
<el-table-column prop="id" label="序号" width="100" sortable></el-table-column>
<el-table-column prop="userName" label="用户名称" show-overflow-tooltip></el-table-column>
<el-table-column prop="nickName" label="用户昵称" show-overflow-tooltip>
<template slot-scope="scope">
<a :href="scope.row.messageUrl" target="_blank">{{ scope.row.nickName }}</a>
</template>
</el-table-column>
<el-table-column prop="hasRepliedName" label="是否回复" show-overflow-tooltip>
<template slot-scope="scope">
<el-tag :type="getTagType(scope.row.hasRepliedName)">{{ scope.row.hasRepliedName }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="content" label="回复内容" show-overflow-tooltip></el-table-column>
<el-table-column label="更新时间">
<template slot-scope="props">
{{ props.row.updateTime | dateFormat }}
</template>
</el-table-column>
<el-table-column prop="操作" label="操作" width="380px">
<template slot-scope="props">
<el-button type="primary" @click="prepareDealMessageOne(props.row.userName)" size="small">私信</el-button>
<el-dialog title="提示" :visible.sync="dealMessageOneVisible" width="30%" :before-close="handleClose">
<span>确认私信吗?</span>
<span slot="footer" class="dialog-footer">
<el-button @click="dealMessageOneVisible = false">取 消</el-button>
<el-button type="primary" @click.prevent="dealMessageOne(currentUserName)">确 定</el-button>
</span>
</el-dialog>
<el-button type="danger" @click="prepareDelete(props.row.id)" size="small">删除</el-button>
<el-dialog title="提示" :visible.sync="deleteDialogVisible" width="30%" :before-close="handleClose">
<span>确认删除?</span>
<span slot="footer" class="dialog-footer">
<el-button @click="deleteDialogVisible = false">取 消</el-button>
<el-button type="primary" @click.prevent="onDelete(currentRowId)">确 定</el-button>
</span>
</el-dialog>
</template>
</el-table-column>
</el-table>
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[8, 50, 100, 200, 400]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"></el-pagination>
</el-main>
<el-backtop class="backtop"></el-backtop>
</el-container>
</div>
</template>
<script>
import axios from 'axios'
export default {
name: 'MyMessage',
data() {
return {
formInline: {
userName: '',
nickName: '',
hasRepliedInfo: null,
},
hasRepliedInfo: [
{
type: -1,
name: '全部',
},
{
type: 0,
name: '未回复',
},
{ type: 1, name: '已回复' },
],
deleteDialogVisible: false,
dealMessageOneVisible: false,
messageDialogVisible: false,
refreshMessageDialogVisible: false,
// 用户列表数据
csdnMessageList: [],
loading: false,
elementui_page_component_key: 0,
currentPage: Number(localStorage.getItem('csdnUserPage')) || 1,
pageSize: 8,
total: 0,
currentRowId: null,
currentUserName: null,
}
},
watch: {
'formInline.userName'(newVal, oldVal) {
if (newVal !== oldVal) {
this.currentPage = 1
localStorage.setItem('csdnUserPage', this.currentPage)
this.messagePage()
}
},
'formInline.nickName'(newVal, oldVal) {
if (newVal !== oldVal) {
this.currentPage = 1
localStorage.setItem('csdnUserPage', this.currentPage)
this.messagePage()
}
},
// 监听currentPage的变化,将新值保存到localStorage中
currentPage(newPage) {
localStorage.setItem('csdnUserPage', newPage.toString())
},
},
created() {
//获取问题类型的枚举
this.messagePage()
},
mounted() {
this.currentPage = 1
},
methods: {
prepareMeaasge() {
this.messageDialogVisible = true
},
prepareRefreshMessage() {
this.refreshMessageDialogVisible = true
},
prepareDelete(id) {
this.currentRowId = id
this.deleteDialogVisible = true
},
prepareDealMessageOne(userName) {
this.currentUserName = userName
this.dealMessageOneVisible = true
},
handleClose(done) {
this.$confirm('确认关闭?')
.then((_) => {
done()
})
.catch((_) => {})
},
handleConfirm(addType) {
this.dialogFormVisible = false // 关闭对话框
this.dialogMutiFormVisible = false
this.addUser(addType) // 发送请求
},
async messagePage() {
this.loading = true
const { data: res } = await axios.post('http://43.139.90.182:8888/csdn/message/page', {
page: this.currentPage,
pageSize: this.pageSize,
userName: this.formInline.userName,
nickName: this.formInline.nickName,
hasReplied: this.formInline.hasRepliedInfo == -1 ? null : this.formInline.hasRepliedInfo,
})
if (res.code === 200) {
this.total = res.result.totalElements
const userWeightMap = {}
this.hasRepliedInfo.forEach((option) => {
userWeightMap[option.type] = option.name
})
res.result.content.forEach((item) => {
item.hasRepliedName = userWeightMap[item.hasReplied]
})
this.csdnMessageList = res.result.content
}
this.loading = false
},
async dealMessageOne(userName) {
this.loading = true
this.dealMessageOneVisible = false
const { data: res } = await axios.get('http://43.139.90.182:8888/csdn/message/dealMessageOne?userName=' + userName)
if (res.code === 200) {
this.currentUserName = null
this.messagePage()
} else {
console.error('Received non-200 status code', res)
}
this.loading = false
},
async messageDeal() {
this.loading = true
this.messageDialogVisible = false
const { data: res1 } = await axios.get('http://43.139.90.182:8888/csdn/message/dealMessage')
if (res1.code === 200) {
this.messagePage()
} else {
console.error('Received non-200 status code', res1)
}
const { data: res2 } = await axios.get('http://43.139.90.182:8888/csdn/likeCollect/dealLikeCollect')
if (res2.code === 200) {
this.messagePage()
} else {
console.error('Received non-200 status code', res2)
}
this.loading = false
},
async refreshMessage() {
this.loading = true
this.refreshMessageDialogVisible = false
const { data: res } = await axios.get('http://43.139.90.182:8888/csdn/message/acquireMessage')
if (res.code === 200) {
this.messagePage()
} else {
console.error('Received non-200 status code', res)
}
this.loading = false
},
async onDelete(id) {
this.loading = true
const { data: res } = await axios.get('http://43.139.90.182:8888/csdn/user/delete', {
params: {
id: id,
},
})
this.deleteDialogVisible = false
this.messagePage()
this.loading = false
},
refreshPage() {
//获取问题类型的枚举
this.messagePage()
location.reload()
},
handleCurrentChange(currentPage) {
this.currentPage = currentPage
this.messagePage()
},
handleSizeChange(currentSize) {
this.pageSize = currentSize
this.messagePage()
},
getTagType(hasRepliedName) {
if (hasRepliedName == '未回复') {
return 'warning'
} else {
return 'success'
}
},
},
}
</script>
<style lang="less" scoped>
.el-header {
background-color: #b3c0d1;
color: #333;
line-height: 60px;
}
.el-aside {
color: #333;
}
.pagination {
margin-top: 16px;
text-align: right;
}
.header-button-item {
margin-right: 15px;
font-size: 20px;
}
.red-title {
line-height: 24px;
font-size: 18px;
color: red;
}
.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;
}
.custom-textarea {
width: 100%;
text-align: left;
}
.backtop:hover {
background-color: #0050a0;
}
</style>
\ No newline at end of file
...@@ -72,172 +72,172 @@ ...@@ -72,172 +72,172 @@
<script> <script>
import axios from 'axios' import axios from 'axios'
export default { export default {
name: 'MyTripletDayInfo', name: 'MyTripletDayInfo',
data() { data() {
return { return {
formInline: { formInline: {
startDate: null, startDate: null,
endDate: null, endDate: null,
}, },
// 用户列表数据 // 用户列表数据
tripletDayInfoList: [], tripletDayInfoList: [],
likeStatus: [ likeStatus: [
{ {
type: -1, type: -1,
name: '全部', name: '全部',
}, },
{ {
type: 0, type: 0,
name: '未处理', name: '未处理',
}, },
{ type: 1, name: '已经点过赞' }, { type: 1, name: '已经点过赞' },
{ type: 2, name: '点赞已满' }, { type: 2, name: '点赞已满' },
{ type: 3, name: '取消点赞' }, { type: 3, name: '取消点赞' },
{ type: 4, name: '文章状态不能点赞' }, { type: 4, name: '文章状态不能点赞' },
{ type: 8, name: '其他错误' }, { type: 8, name: '其他错误' },
{ type: 9, name: '点赞成功' }, { type: 9, name: '点赞成功' },
], ],
collectStatus: [ collectStatus: [
{ {
type: -1, type: -1,
name: '全部', name: '全部',
}, },
{ {
type: 0, type: 0,
name: '未处理', name: '未处理',
}, },
{ type: 1, name: '已经收藏过' }, { type: 1, name: '已经收藏过' },
{ type: 2, name: '收藏已满' }, { type: 2, name: '收藏已满' },
{ type: 3, name: '参数缺失' }, { type: 3, name: '参数缺失' },
{ type: 9, name: '收藏成功' }, { type: 9, name: '收藏成功' },
], ],
commentStatus: [ commentStatus: [
{ {
type: -1, type: -1,
name: '全部', name: '全部',
}, },
{ {
type: 0, type: 0,
name: '未处理', name: '未处理',
}, },
{ type: 1, name: '已经评论过' }, { type: 1, name: '已经评论过' },
{ type: 2, name: '评论已满' }, { type: 2, name: '评论已满' },
{ type: 3, name: '禁言' }, { type: 3, name: '禁言' },
{ type: 4, name: '评论太快' }, { type: 4, name: '评论太快' },
{ type: 5, name: '评论已经到了48条' }, { type: 5, name: '评论已经到了48条' },
{ type: 8, name: '其他错误' }, { type: 8, name: '其他错误' },
{ type: 9, name: '评论成功' }, { type: 9, name: '评论成功' },
], ],
loading: false, loading: false,
resetDialogVisible: false, resetDialogVisible: false,
elementui_page_component_key: 0, elementui_page_component_key: 0,
currentPage: Number(localStorage.getItem('csdnTripletDayInfoPage')) || 1, currentPage: Number(localStorage.getItem('csdnTripletDayInfoPage')) || 1,
pageSize: 9, pageSize: 9,
total: 0, total: 0,
} }
}, },
watch: { watch: {
'formInline.startDate'(newVal, oldVal) { 'formInline.startDate'(newVal, oldVal) {
if (newVal !== oldVal) { if (newVal !== oldVal) {
this.currentPage = 1 this.currentPage = 1
localStorage.setItem('csdnTripletDayInfoPage', this.currentPage) localStorage.setItem('csdnTripletDayInfoPage', this.currentPage)
this.tripletDayInfoPage() this.tripletDayInfoPage()
} }
}, },
'formInline.endDate'(newVal, oldVal) { 'formInline.endDate'(newVal, oldVal) {
if (newVal !== oldVal) { if (newVal !== oldVal) {
this.currentPage = 1 this.currentPage = 1
localStorage.setItem('csdnTripletDayInfoPage', this.currentPage) localStorage.setItem('csdnTripletDayInfoPage', this.currentPage)
this.tripletDayInfoPage() this.tripletDayInfoPage()
} }
}, },
// 监听currentPage的变化,将新值保存到localStorage中 // 监听currentPage的变化,将新值保存到localStorage中
currentPage(newPage) { currentPage(newPage) {
localStorage.setItem('csdnTripletDayInfoPage', newPage.toString()) localStorage.setItem('csdnTripletDayInfoPage', newPage.toString())
}, },
}, },
created() { created() {
//获取问题类型的枚举 //获取问题类型的枚举
this.tripletDayInfoPage() this.tripletDayInfoPage()
}, },
mounted() { mounted() {
this.currentPage = 1 this.currentPage = 1
}, },
methods: { methods: {
prepareReset() { prepareReset() {
this.resetDialogVisible = true this.resetDialogVisible = true
}, },
async tripletDayInfoPage() { async tripletDayInfoPage() {
this.loading = true this.loading = true
const { data: res } = await axios.post('http://43.139.90.182:8888/dayInfo/page', { const { data: res } = await axios.post('http://43.139.90.182:8888/dayInfo/page', {
page: this.currentPage, page: this.currentPage,
pageSize: this.pageSize, pageSize: this.pageSize,
startDate: this.formInline.startDate, startDate: this.formInline.startDate,
endDate: this.formInline.endDate, endDate: this.formInline.endDate,
}) })
if (res.code === 200) { if (res.code === 200) {
this.total = res.result.totalElements this.total = res.result.totalElements
const likeStatusMap = {} const likeStatusMap = {}
this.likeStatus.forEach((option) => { this.likeStatus.forEach((option) => {
likeStatusMap[option.type] = option.name likeStatusMap[option.type] = option.name
}) })
res.result.content.forEach((item) => { res.result.content.forEach((item) => {
item.likeStatusName = likeStatusMap[item.likeStatus] item.likeStatusName = likeStatusMap[item.likeStatus]
}) })
const collectStatusMap = {} const collectStatusMap = {}
this.collectStatus.forEach((option) => { this.collectStatus.forEach((option) => {
collectStatusMap[option.type] = option.name collectStatusMap[option.type] = option.name
}) })
res.result.content.forEach((item) => { res.result.content.forEach((item) => {
item.collectStatusName = collectStatusMap[item.collectStatus] item.collectStatusName = collectStatusMap[item.collectStatus]
}) })
const commentStatusMap = {} const commentStatusMap = {}
this.commentStatus.forEach((option) => { this.commentStatus.forEach((option) => {
commentStatusMap[option.type] = option.name commentStatusMap[option.type] = option.name
}) })
res.result.content.forEach((item) => { res.result.content.forEach((item) => {
item.commentStatusName = commentStatusMap[item.commentStatus] item.commentStatusName = commentStatusMap[item.commentStatus]
}) })
this.tripletDayInfoList = res.result.content this.tripletDayInfoList = res.result.content
} }
this.loading = false this.loading = false
}, },
async reset() { async reset() {
this.loading = true this.loading = true
const { data: res } = await axios.get('http://43.139.90.182:8888/dayInfo/add') const { data: res } = await axios.get('http://43.139.90.182:8888/dayInfo/add')
this.resetDialogVisible = false this.resetDialogVisible = false
this.tripletDayInfoPage() this.tripletDayInfoPage()
this.loading = false this.loading = false
}, },
handleCurrentChange(currentPage) { handleCurrentChange(currentPage) {
this.currentPage = currentPage this.currentPage = currentPage
this.tripletDayInfoPage() this.tripletDayInfoPage()
}, },
refreshPage() { refreshPage() {
//获取问题类型的枚举 //获取问题类型的枚举
this.tripletDayInfoPage() this.tripletDayInfoPage()
location.reload() location.reload()
}, },
getTagType(statusName) { getTagType(statusName) {
if (statusName == '未处理') { if (statusName == '未处理') {
return 'info' return 'info'
} else if (statusName == '已经点过赞' || statusName == '已经收藏过' || statusName == '已经评论过') { } else if (statusName == '已经点过赞' || statusName == '已经收藏过' || statusName == '已经评论过') {
return 'success' return 'success'
} else if (statusName == '文章状态不能点赞' || statusName == '收藏已满' || statusName == '评论已满' || statusName == '禁言' || statusName == '评论已经到了48条') { } else if (statusName == '文章状态不能点赞' || statusName == '收藏已满' || statusName == '评论已满' || statusName == '禁言' || statusName == '评论已经到了48条') {
return 'danger' return 'danger'
} else if (statusName == '点赞成功' || statusName == '收藏成功' || statusName == '评论成功') { } else if (statusName == '点赞成功' || statusName == '收藏成功' || statusName == '评论成功') {
return 'success' return 'success'
} else if (statusName == '点赞已满' || statusName == '参数缺失' || statusName == '其他错误' || statusName == '取消点赞' || statusName == '评论太快') { } else if (statusName == '点赞已满' || statusName == '参数缺失' || statusName == '其他错误' || statusName == '取消点赞' || statusName == '评论太快') {
return 'warning' return 'warning'
} }
}, },
}, },
} }
</script> </script>
......
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
<router-link :to="{ path: '/home/articleInfo' }"> <router-link :to="{ path: '/home/articleInfo' }">
<el-menu-item index="/home/articleInfo">文章管理</el-menu-item> <el-menu-item index="/home/articleInfo">文章管理</el-menu-item>
</router-link> </router-link>
<router-link :to="{ path: '/home/message' }">
<el-menu-item index="/home/message">私信管理</el-menu-item>
</router-link>
</el-menu-item-group> </el-menu-item-group>
</el-submenu> </el-submenu>
<el-submenu index="2"> <el-submenu index="2">
......
...@@ -12,116 +12,129 @@ import Interview from '@/components/menus/MyInterview.vue' ...@@ -12,116 +12,129 @@ import Interview from '@/components/menus/MyInterview.vue'
import Algorithmic from '@/components/menus/MyAlgorithmic.vue' import Algorithmic from '@/components/menus/MyAlgorithmic.vue'
import AphorismPoetry from '@/components/menus/MyAphorismPoetry.vue' import AphorismPoetry from '@/components/menus/MyAphorismPoetry.vue'
import MyCsdnUser from '@/components/menus/MyCsdnUser.vue' import MyCsdnUser from '@/components/menus/MyCsdnUser.vue'
import MyMessage from '@/components/menus/MyMessage.vue'
import MyArticleInfo from '@/components/menus/MyArticleInfo.vue' import MyArticleInfo from '@/components/menus/MyArticleInfo.vue'
import MyTripletDayInfo from '@/components/menus/MyTripletDayInfo.vue' import MyTripletDayInfo from '@/components/menus/MyTripletDayInfo.vue'
import MyChatDetail from '@/components/user/MyChatDetail.vue' import MyChatDetail from '@/components/user/MyChatDetail.vue'
import AddChatDetail from '@/components/user/AddChatDetail.vue' import AddChatDetail from '@/components/user/AddChatDetail.vue'
Vue.use(VueRouter) Vue.use(VueRouter)
const router = new VueRouter({ const router = new VueRouter({
routes: [ routes: [
{ {
path: '/', path: '/',
redirect: '/login' redirect: '/login',
}, },
// 登录的路由规则 // 登录的路由规则
{ {
path: '/login', path: '/login',
component: Login, component: Login,
meta: { meta: {
title: '登录' // 设置默认标题 title: '登录', // 设置默认标题
} },
}, },
// 后台主页的路由规则 // 后台主页的路由规则
{ {
path: '/home', path: '/home',
component: Home, component: Home,
redirect: '/home/interview', redirect: '/home/interview',
children: [ children: [
{ {
path: 'interview', path: 'interview',
component: Interview, component: Interview,
meta: { meta: {
title: '面试题' // 设置默认标题 title: '面试题', // 设置默认标题
} },
}, },
{ {
path: 'algorithmic', path: 'algorithmic',
component: Algorithmic, component: Algorithmic,
meta: { meta: {
title: '算法题' // 设置默认标题 title: '算法题', // 设置默认标题
} },
}, },
{ {
path: 'aphorismpoetry', path: 'aphorismpoetry',
component: AphorismPoetry, component: AphorismPoetry,
meta: { meta: {
title: '名言警句' // 设置默认标题 title: '名言警句', // 设置默认标题
} },
}, },
{ {
path: 'chat', path: 'chat',
component: Chat, component: Chat,
meta: { meta: {
title: 'chatgpt记录' // 设置默认标题 title: 'chatgpt记录', // 设置默认标题
} },
}, { },
path: 'pic', {
component: Pic, path: 'pic',
meta: { component: Pic,
title: '图片' // 设置默认标题 meta: {
} title: '图片', // 设置默认标题
}, { },
path: 'csdnUser', },
component: MyCsdnUser, {
meta: { path: 'csdnUser',
title: '用户管理' // 设置默认标题 component: MyCsdnUser,
} meta: {
}, { title: '用户管理', // 设置默认标题
path: 'tripletDayInfo', },
component: MyTripletDayInfo, },
meta: { {
title: '三连管理' // 设置默认标题 path: 'tripletDayInfo',
} component: MyTripletDayInfo,
}, { meta: {
path: 'articleInfo', title: '三连管理', // 设置默认标题
component: MyArticleInfo, },
meta: { },
title: '文章管理' // 设置默认标题 {
} path: 'articleInfo',
}, { component: MyArticleInfo,
path: 'chatinfo/:id', meta: {
component: MyChatDetail, title: '文章管理', // 设置默认标题
props: true, },
meta: { },
title: 'chat信息' // 设置默认标题 {
} path: 'message',
}, { component: MyMessage,
path: 'addChat', meta: {
component: AddChatDetail, title: '私信管理', // 设置默认标题
meta: { },
title: '添加chat信息' // 设置默认标题 },
} {
}, path: 'chatinfo/:id',
] component: MyChatDetail,
} props: true,
] meta: {
title: 'chat信息', // 设置默认标题
},
},
{
path: 'addChat',
component: AddChatDetail,
meta: {
title: '添加chat信息', // 设置默认标题
},
},
],
},
],
}) })
// 全局前置守卫 // 全局前置守卫
router.beforeEach(function (to, from, next) { router.beforeEach(function (to, from, next) {
if (pathArr.indexOf(to.path) !== -1) { if (pathArr.indexOf(to.path) !== -1) {
const token = localStorage.getItem('token') const token = localStorage.getItem('token')
if (token) { if (token) {
next() next()
} else { } else {
next('/login') next('/login')
} }
} else { } else {
next() next()
} }
}) })
export default router export default router
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册