优化

上级 d485919d
此差异已折叠。
因为 它太大了无法显示 source diff 。你可以改为 查看blob
<!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.a37ee1e7.css" rel="preload" as="style"><link href="/css/chunk-vendors.0bfa23eb.css" rel="preload" as="style"><link href="/js/app.fea40924.js" rel="preload" as="script"><link href="/js/chunk-vendors.02cd1fa9.js" rel="preload" as="script"><link href="/css/chunk-vendors.0bfa23eb.css" rel="stylesheet"><link href="/css/app.a37ee1e7.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.02cd1fa9.js"></script><script src="/js/app.fea40924.js"></script></body></html>
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
<template>
<!-- 占位符 -->
<router-view></router-view>
<keep-alive>
<router-view></router-view>
</keep-alive>
</template>
<script>
export default {
name: 'MyApp',
name: 'MyApp',
}
</script>
......
import axios from 'axios'
const BASE_URL = 'http://localhost:80'
// 创建一个名为 ApiService 的对象,包含您的异步方法
const ApiService = {
// 三连日管理
async tripletDayInfoPage(currentPage, pageSize, tripletDate) {
return await axios.post('http://localhost:80/dayInfo/page', {
async tripletDayInfoPage(currentPage, pageSize, formInline) {
return await axios.post(BASE_URL + '/dayInfo/page', {
page: currentPage,
pageSize: pageSize,
startDate: formInline.tripletDate != null ? formInline.tripletDate[0] : '',
endDate: formInline.tripletDate != null ? formInline.tripletDate[1] : '',
weekInfo: formInline.weekInfo != null ? formInline.weekInfo : '',
})
},
async dayRedPackageInfoPage(currentPage, pageSize, tripletDate) {
return await axios.post(BASE_URL + '/csdn/csdnDayInfoRedPackage/page', {
page: currentPage,
pageSize: pageSize,
startDate: tripletDate != null ? tripletDate[0] : '',
......@@ -12,24 +22,27 @@ const ApiService = {
},
async tripletDayReset() {
return await axios.get('http://localhost:80/dayInfo/add')
return await axios.get(BASE_URL + '/dayInfo/add')
},
async sevenDay() {
return await axios.get(BASE_URL + '/dayInfo/sevenDayOverview')
},
// 文章管理
async triplet(articleId) {
return await axios.get('http://localhost:80/csdnArticleInfo/triplet?articleId=' + articleId)
return await axios.get(BASE_URL + '/csdnArticleInfo/triplet?articleId=' + articleId)
},
async syncMyBlog() {
return await axios.get('http://localhost:80/csdnArticleInfo/syncMyBlog')
return await axios.get(BASE_URL + '/csdnArticleInfo/syncMyBlog')
},
async resetLikes() {
return await axios.get('http://localhost:80/csdnArticleInfo/fixLikesStatus')
return await axios.get(BASE_URL + '/csdnArticleInfo/fixLikesStatus')
},
async allTriplet(articleIds) {
return await axios.post('http://localhost:80/csdnArticleInfo/multiTriplet', articleIds)
return await axios.post(BASE_URL + '/csdnArticleInfo/multiTriplet', articleIds)
},
async articleInfoDelete(id) {
return await axios.get('http://localhost:80/csdnArticleInfo/delete', {
return await axios.get(BASE_URL + '/csdnArticleInfo/delete', {
params: {
id: id,
},
......@@ -38,16 +51,16 @@ const ApiService = {
//红包管理
async dealViewCount(id) {
return await axios.get('http://localhost:80/csdn/redPackage/getViewCountById?id=' + id)
return await axios.get(BASE_URL + '/csdn/redPackage/getViewCountById?id=' + id)
},
async getTodayRedPackageDetailInfo() {
return await axios.get('http://localhost:80/csdn/redPackage/detail/getTodayRedPackageDetailInfo')
async receiveRedPacketByOrderNo(id) {
return await axios.get(BASE_URL + '/csdn/redPackage/receiveRedPacketByOrderNo?id=' + id)
},
async syncDetailInfo(id) {
return await axios.get('http://localhost:80/csdn/redPackage/detail/syncDetailInfo?id=' + id)
return await axios.get(BASE_URL + '/csdn/redPackage/detail/syncDetailInfo?id=' + id)
},
async redPackagePage(currentPage, pageSize, formInline) {
return await axios.post('http://localhost:80/csdn/redPackage/page', {
return await axios.post(BASE_URL + '/csdn/redPackage/page', {
page: currentPage,
pageSize: pageSize,
nickName: formInline.nickName,
......@@ -59,8 +72,11 @@ const ApiService = {
msg: formInline.msg == '全部' ? null : formInline.msg,
})
},
async getTodayRedPackageDetailInfo(ids) {
return await axios.post(BASE_URL + '/csdn/redPackage/detail/getTodayRedPackageDetailInfo', ids)
},
async redPackageDetailList(currentPage, pageSize, orderNo, communityId, postId) {
return await axios.post('http://localhost:80/csdn/redPackage/detail/page', {
return await axios.post(BASE_URL + '/csdn/redPackage/detail/page', {
page: currentPage,
pageSize: pageSize,
orderNo: orderNo,
......@@ -70,25 +86,29 @@ const ApiService = {
},
//粉丝管理
async fansInfoPage(currentPage, pageSize, relationType) {
return await axios.post('http://localhost:80/csdn/followFans/page', {
async fansInfoPage(currentPage, pageSize, formInline) {
return await axios.post(BASE_URL + '/csdn/followFans/page', {
page: currentPage,
pageSize: pageSize,
relationType: relationType == '全部' ? '' : relationType,
relationType: formInline.relationType,
userName: formInline.userName,
})
},
async syncFansInfo() {
return await axios.get('http://localhost:80/csdn/followFans/saveFans')
return await axios.get(BASE_URL + '/csdn/followFans/saveFans')
},
async cancleFansNoArticle() {
return await axios.get(BASE_URL + '/csdn/followFans/deleteNoArticle')
},
async syncFollowInfo() {
return await axios.get('http://localhost:80/csdn/followFans/saveFollow')
return await axios.get(BASE_URL + '/csdn/followFans/saveFollow')
},
async cancleFollowInfo() {
return await axios.get('http://localhost:80/csdn/followFans/deleteFollow')
return await axios.get(BASE_URL + '/csdn/followFans/deleteFollow')
},
//我的图片
async queryPic(currentPage, pageSize, picType) {
return await axios.get('http://localhost:80/picInfo/page', {
return await axios.get(BASE_URL + '/picInfo/page', {
params: {
page: currentPage,
pageSize: pageSize,
......@@ -97,10 +117,37 @@ const ApiService = {
})
},
async editPicConfirm(currentRowId, type) {
return await axios.post('http://localhost:80/picInfo/update', {
return await axios.post(BASE_URL + '/picInfo/update', {
id: currentRowId,
type: type,
})
},
//余额管理
async accountManagementPage(currentPage, pageSize, formInline) {
return await axios.post(BASE_URL + '/csdnAccountManagement/page', {
page: currentPage,
pageSize: pageSize,
startDate: formInline.accountDate != null ? formInline.accountDate[0] : '',
endDate: formInline.accountDate != null ? formInline.accountDate[1] : '',
operateType: formInline.operateType != -1 ? formInline.operateType : null,
productName: formInline.productName != '全部' ? formInline.productName : null,
code: formInline.code,
})
},
async addAccountInfo() {
return await axios.get(BASE_URL + '/csdnAccountManagement/addAccountInfo')
},
async add5AccountInfo() {
return await axios.get(BASE_URL + '/csdnAccountManagement/add5AccountInfo')
},
//累计红包管理
async totalIncomePage(currentPage, pageSize, formInline) {
return await axios.post(BASE_URL + '/csdn/totalIncome/page', {
page: currentPage,
pageSize: pageSize,
startDate: formInline.accountDate != null ? formInline.accountDate[0] : '',
endDate: formInline.accountDate != null ? formInline.accountDate[1] : '',
})
},
}
export default ApiService
......@@ -9,7 +9,9 @@
<MyAside></MyAside>
</el-aside>
<el-main style="padding: 0">
<router-view></router-view>
<keep-alive>
<router-view></router-view>
</keep-alive>
</el-main>
</el-container>
</el-container>
......
......@@ -43,7 +43,7 @@ export default {
this.password = ''
},
login() {
if (this.username === 'admin' && this.password === '666666') {
if (this.username === 'admin' && this.password === '888888') {
// 登录成功
// 1. 存储 token
localStorage.setItem('token', 'Bearer xxxx')
......@@ -52,8 +52,16 @@ export default {
} else {
// 登录失败
localStorage.removeItem('token')
this.errorMsg('登录失败,请检查您的用户名或密码;由于用户名密码是写死的,需要在项目中查看!!!')
}
},
errorMsg(msg) {
this.$message({
showClose: true,
message: msg,
type: 'error',
})
},
},
}
</script>
......
<template>
<div>
<el-container>
<el-main>
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item>
<el-date-picker v-model="formInline.accountDate" type="daterange" align="right" unlink-panels range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期" :value-format="'yyyy-MM-dd'" :picker-options="pickerOptions"></el-date-picker>
</el-form-item>
<el-form-item>
<el-select v-model="formInline.operateType" placeholder="请选择类型" @change="accountManagementPage">
<el-option v-for="item in operateTypeArray" :key="item.type" :label="item.name" :value="item.type"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-select v-model="formInline.productName" placeholder="请选择业务" @change="accountManagementPage">
<el-option v-for="type in productName" :key="type" :label="type" :value="type"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-select v-model="formInline.code" placeholder="请选择code" @change="accountManagementPage">
<el-option v-for="type in code" :key="type" :label="type" :value="type"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="accountManagementPage">查询</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="add5AccountInfo">同步5页</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="addAccountInfo">同步全部</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="mall">商城</el-button>
</el-form-item>
<br />
<el-form-item label="当前余额:" class="form-item">
<el-tag style="width: 55px">{{ form.currentAmount }}</el-tag>
</el-form-item>
<el-form-item label="永久有效:" class="form-item">
<el-tag style="width: 55px">{{ form.normalAmount }}</el-tag>
</el-form-item>
<el-form-item label="可过期:" class="form-item">
<el-tag style="width: 55px">{{ form.expireAmount }}</el-tag>
</el-form-item>
<el-form-item label="总收入:" class="form-item">
<el-tag type="success" style="width: 55px">{{ form.totalGetAmount }}</el-tag>
</el-form-item>
<el-form-item label="总支出:" class="form-item">
<el-tag type="warning" style="width: 55px">{{ form.totalPayAmount }}</el-tag>
</el-form-item>
<el-form-item label="当页累计:" class="form-item">
<el-tag style="width: 55px">{{ form.currentTotal }}</el-tag>
</el-form-item>
</el-form>
<el-table border :data="accountManagementList" v-loading="loading">
<el-table-column sortable align="center" prop="id" label="序号" width="100"></el-table-column>
<el-table-column sortable align="center" prop="amount" label="金额" show-overflow-tooltip>
<template slot-scope="scope">
<el-tag :type="isMaxValue(scope.row.amount, 'amount')">{{ scope.row.amount }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="product" label="业务类型" show-overflow-tooltip></el-table-column>
<el-table-column prop="productName" label="业务名称" show-overflow-tooltip></el-table-column>
<el-table-column prop="code" label="业务code" show-overflow-tooltip></el-table-column>
<el-table-column prop="orderNo" label="订单号" show-overflow-tooltip></el-table-column>
<el-table-column sortable prop="expireTime" label="过期时间" show-overflow-tooltip></el-table-column>
<el-table-column align="center" prop="operateType" label="收入支出" show-overflow-tooltip>
<template slot-scope="scope">
<el-tag :type="getTagType(scope.row.operateTypeName)">{{ scope.row.operateTypeName }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="description" label="详情" show-overflow-tooltip></el-table-column>
<el-table-column label="业务时间">
<template slot-scope="props">{{ props.row.time | dateFormat }}</template>
</el-table-column>
</el-table>
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[10, 20, 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'
import ApiService from '../../api/ApiService'
export default {
name: 'MyAccountManagement',
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now()
},
shortcuts: [
{
text: '最近一周',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
picker.$emit('pick', [start, end])
},
},
{
text: '最近一个月',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
picker.$emit('pick', [start, end])
},
},
{
text: '最近三个月',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
picker.$emit('pick', [start, end])
},
},
],
},
productName: ['全部', '红包', '盲盒', '商城iOS支付', 'proceeds_balance', 'VIP'],
code: [7000, 7002],
formInline: {
accountDate: null,
operateType: null,
productName: null,
code: null,
},
form: {
currentAmount: '',
totalGetAmount: '',
totalPayAmount: '',
expireAmount: '',
normalAmount: '',
currentTotal: '',
},
operateTypeArray: [
{
type: -1,
name: '全部',
},
{
type: 1,
name: '收入',
},
{ type: 2, name: '支出' },
],
accountManagementList: [],
loading: false,
elementui_page_component_key: 0,
currentPage: Number(localStorage.getItem('accountManagementPage')) || 1,
pageSize: 10,
total: 0,
}
},
watch: {
formInline: {
handler(newVal, oldVal) {
this.currentPage = 1
localStorage.setItem('accountManagementPage', this.currentPage)
this.accountManagementPage()
},
deep: true,
},
// 监听currentPage的变化,将新值保存到localStorage中
currentPage(newPage) {
localStorage.setItem('accountManagementPage', newPage.toString())
},
},
created() {
//获取问题类型的枚举
this.accountManagementPage()
},
mounted() {
this.currentPage = 1
},
activated() {
this.accountManagementPage()
},
methods: {
async accountManagementPage() {
this.loading = true
const { data: res } = await ApiService.accountManagementPage(this.currentPage, this.pageSize, this.formInline)
if (res.code === 200) {
this.total = res.result.from.totalElements
const userWeightMap = {}
this.operateTypeArray.forEach((option) => {
userWeightMap[option.type] = option.name
})
res.result.from.content.forEach((item) => {
item.operateTypeName = userWeightMap[item.operateType]
})
this.accountManagementList = res.result.from.content
this.form.currentAmount = res.result.currentAmount
this.form.totalGetAmount = res.result.totalGetAmount
this.form.totalPayAmount = res.result.totalPayAmount
this.form.expireAmount = res.result.expireAmount
this.form.normalAmount = res.result.normalAmount
this.form.currentTotal = res.result.currentTotal
}
this.loading = false
},
async addAccountInfo() {
this.loading = true
const { data: res } = await ApiService.addAccountInfo()
if (res.code === 200) {
this.accountManagementPage()
}
this.loading = false
},
async add5AccountInfo() {
this.loading = true
const { data: res } = await ApiService.add5AccountInfo()
if (res.code === 200) {
this.accountManagementPage()
}
this.loading = false
},
handleCurrentChange(currentPage) {
this.currentPage = currentPage
this.accountManagementPage()
},
handleSizeChange(currentSize) {
this.pageSize = currentSize
this.accountManagementPage()
},
isMaxValue(value, tag) {
const maxValue = this.getMaxValue(tag)[tag]
if (value === maxValue) {
if (tag === 'loseRedPackageCount') {
return 'danger'
} else {
return 'success'
}
}
const minValue = this.getMinValue(tag)[tag]
if (value === minValue) {
if (tag === 'loseRedPackageCount') {
return 'success'
} else {
return 'danger'
}
}
return 'primary'
},
getMaxValue(_tag) {
return this.accountManagementList.reduce((maxObj, currentObj) => {
const tagValue = currentObj[_tag]
if (tagValue !== undefined && tagValue > maxObj[_tag]) {
return currentObj
} else {
return maxObj
}
}, this.accountManagementList[0])
},
getMinValue(_tag) {
return this.accountManagementList.reduce((maxObj, currentObj) => {
const tagValue = currentObj[_tag]
if (tagValue !== undefined && tagValue < maxObj[_tag]) {
return currentObj
} else {
return maxObj
}
}, this.accountManagementList[0])
},
refreshPage() {
//获取问题类型的枚举
this.accountManagementPage()
location.reload()
},
getTagType(operateTypeName) {
if (operateTypeName == '收入') {
return 'success'
} else {
return 'danger'
}
},
mall() {
// 新页面打开
window.open('https://mall.csdn.net/search?cat1=379&cat2=385&cat3=431&sort=salesVolume&asc=desc&page=1')
},
},
}
</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
......@@ -8,8 +8,8 @@
<el-input v-model="form.questionName" autocomplete="off" style="width: 100%"></el-input>
</el-form-item>
<el-form-item label="问题类型" :label-width="formLabelWidth" class="form-item">
<el-select v-model="form.questionType" placeholder="请选择活动区域">
<el-option v-for="item in allOptions" :key="item.questionType" :label="item.name" :value="item.questionType"></el-option>
<el-select v-model="form.questionType" placeholder="请选择问题类型">
<el-option v-for="item in allOptions" :key="item" :label="item" :value="item"></el-option>
</el-select>
</el-form-item>
<el-form-item label="重要程度" :label-width="formLabelWidth" class="form-item">
......@@ -66,13 +66,13 @@
</el-dialog>
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item>
<el-input clearable v-model="formInline.questionName" placeholder="请输入问题" @keydown.enter.native="interviewPage"></el-input>
<el-input clearable v-model="formInline.questionName" placeholder="请输入问题" @keydown.enter.native="algorithmPage"></el-input>
</el-form-item>
<el-select v-model="questionType" placeholder="请选择" @change="interviewPage">
<el-option v-for="item in options" :key="item.questionType" :label="item.name" :value="item.questionType"></el-option>
<el-select v-model="formInline.questionType" placeholder="请选择" @change="algorithmPage">
<el-option v-for="item in allOptions" :key="item" :label="item" :value="item"></el-option>
</el-select>
<el-form-item>
<el-button type="primary" @click="interviewPage">查询</el-button>
<el-button type="primary" @click="algorithmPage">查询</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="prepareRandom">随机一题</el-button>
......@@ -85,30 +85,30 @@
</el-form-item>
</el-form>
<el-table border :data="algorithmicList" v-loading="loading">
<el-table-column prop="id" label="序号" width="80" sortable></el-table-column>
<el-table-column prop="questionName" label="算法问题" show-overflow-tooltip></el-table-column>
<el-table-column prop="questionTypeName" label="问题类型" show-overflow-tooltip align="center">
<el-table-column prop="id" label="序号" sortable width="80"></el-table-column>
<el-table-column align="center" prop="questionName" label="算法问题" show-overflow-tooltip>
<template slot-scope="scope">
<span :style="{ color: getColorForValue(scope.row.questionTypeName) }" v-html="scope.row.questionTypeName"></span>
<a :href="scope.row.leetcodeLink" target="_blank">{{ scope.row.questionName }}</a>
</template>
</el-table-column>
<el-table-column prop="degreeOfImportance" label="重要程度" show-overflow-tooltip :width="50"></el-table-column>
<el-table-column prop="degreeOfDifficulty" label="难易程度" show-overflow-tooltip :width="50"></el-table-column>
<el-table-column prop="difficultyOfScore" label="难易分数" show-overflow-tooltip :width="80"></el-table-column>
<el-table-column prop="leetcodeNumber" label="力扣题号" show-overflow-tooltip :width="50"></el-table-column>
<el-table-column label="力扣链接" show-overflow-tooltip>
<el-table-column prop="leetcodeNumber" label="力扣题号" width="100" show-overflow-tooltip></el-table-column>
<el-table-column prop="questionType" label="问题类型" show-overflow-tooltip align="center">
<template slot-scope="scope">
<a :href="scope.row.leetcodeLink" target="_blank">{{ scope.row.leetcodeLink }}</a>
<span :style="{ color: getColorForValue(scope.row.questionType) }" v-html="scope.row.questionType"></span>
</template>
</el-table-column>
<el-table-column label="创建时间" width="170">
<el-table-column sortable prop="degreeOfImportance" label="重要程度" show-overflow-tooltip></el-table-column>
<el-table-column prop="degreeOfDifficulty" label="难易程度" show-overflow-tooltip></el-table-column>
<el-table-column prop="difficultyOfScore" label="难易分数" show-overflow-tooltip></el-table-column>
<el-table-column label="创建时间">
<template slot-scope="props">
{{ props.row.createTime | dateFormat }}
</template>
</el-table-column>
<el-table-column prop="操作" label="操作" width="180">
<el-table-column prop="操作" label="操作">
<template slot-scope="props">
<el-button type="success" @click.prevent="preEdit(props.row.id, props.row.questionName, props.row.questionTypeName, props.row.degreeOfImportance, props.row.degreeOfDifficulty, props.row.difficultyOfScore, props.row.leetcodeNumber, props.row.leetcodeLink)" width="200">编辑</el-button>
<el-button type="success" @click.prevent="preEdit(props.row.id, props.row.questionName, props.row.questionType, props.row.degreeOfImportance, props.row.degreeOfDifficulty, props.row.difficultyOfScore, props.row.leetcodeNumber, props.row.leetcodeLink)" width="200">编辑</el-button>
<el-dialog title="编辑算法问题" :visible.sync="editVisible">
<el-form :model="form">
<el-form-item label="算法问题" :label-width="formLabelWidth" class="form-item">
......@@ -116,7 +116,7 @@
</el-form-item>
<el-form-item label="问题类型" :label-width="formLabelWidth" class="form-item">
<el-select v-model="form.questionType" placeholder="请选择活动区域">
<el-option v-for="item in allOptions" :key="item.questionType" :label="item.name" :value="item.questionType"></el-option>
<el-option v-for="item in allOptions" :key="item" :label="item" :value="item"></el-option>
</el-select>
</el-form-item>
<el-form-item label="重要程度" :label-width="formLabelWidth" class="form-item">
......@@ -179,17 +179,16 @@ export default {
total: 0,
formInline: {
questionName: '',
questionType: '',
},
options: [],
allOptions: [],
questionType: 0,
allOptions: ['hash表', '回溯', '双指针', '二分法', '滑动窗口', '动态规划', '链表', '二叉树'],
// 新增的内容
dialogFormVisible: false,
randomFormVisible: false,
dialogMutiFormVisible: false,
form: {
questionName: '',
questionType: 0,
questionType: '',
degreeOfImportance: 5,
degreeOfDifficulty: 1,
difficultyOfScore: 1200,
......@@ -204,12 +203,13 @@ export default {
}
},
watch: {
'formInline.questionName'(newVal, oldVal) {
if (newVal !== oldVal) {
formInline: {
handler(newVal, oldVal) {
this.currentPage = 1
localStorage.setItem('algorithmLastPage', this.currentPage)
this.getQuestionType()
}
this.algorithmPage()
},
deep: true,
},
// 监听currentPage的变化,将新值保存到localStorage中
currentPage(newPage) {
......@@ -218,9 +218,7 @@ export default {
},
created() {
//获取问题类型的枚举
this.getQuestionType()
//获取问题类型的枚举
this.getAllQuestionType()
this.algorithmPage()
},
mounted() {
this.currentPage = 1
......@@ -228,10 +226,8 @@ export default {
methods: {
prepareAdd() {
this.form.questionName = ''
this.form.questionType = 0
this.form.questionType = ''
this.dialogFormVisible = true
//获取问题类型的枚举
this.getAllQuestionType()
},
prepareRandom() {
this.randomAlgorithmic = []
......@@ -240,7 +236,7 @@ export default {
},
prepareMutiAdd() {
this.form.questionName = ''
this.form.questionType = 0
this.form.questionType = ''
this.dialogMutiFormVisible = true
},
......@@ -248,20 +244,14 @@ export default {
this.currentRowId = id
this.dialogVisible = true
},
preEdit(id, questionName, questionTypeName, degreeOfImportance, degreeOfDifficulty, difficultyOfScore, leetcodeNumber, leetcodeLink) {
preEdit(id, questionName, questionType, degreeOfImportance, degreeOfDifficulty, difficultyOfScore, leetcodeNumber, leetcodeLink) {
this.form.questionName = questionName
this.form.degreeOfImportance = degreeOfImportance
this.form.degreeOfDifficulty = degreeOfDifficulty
this.form.difficultyOfScore = difficultyOfScore
this.form.leetcodeNumber = leetcodeNumber
this.form.leetcodeLink = leetcodeLink
// 定义一个映射(map)来存储 questionType 到 name 的转换
const questionTypeToNameMap = {}
this.options.forEach((option) => {
questionTypeToNameMap[option.name] = option.questionType
})
this.form.questionType = questionTypeToNameMap[questionTypeName]
this.form.questionType = questionType
this.currentRowId = id
this.editVisible = true
},
......@@ -300,7 +290,7 @@ export default {
this.form.difficultyOfScore = 1200
this.form.leetcodeNumber = ''
this.form.leetcodeLink = ''
this.getQuestionType()
this.algorithmPage()
} else {
console.error('Received non-200 status code', res)
this.errorMsg(res.message)
......@@ -337,7 +327,7 @@ export default {
this.form.questionType = 0
this.editVisible = false
currentRowId: null
this.getQuestionType()
this.algorithmPage()
} else {
console.error('Received non-200 status code', res)
}
......@@ -357,52 +347,27 @@ export default {
id: id,
},
})
this.getQuestionType()
this.algorithmPage()
this.loading = false
},
refreshPage() {
//获取问题类型的枚举
this.getQuestionType()
this.algorithmPage()
location.reload()
},
async getQuestionType() {
const { data: res } = await axios.get('http://localhost:80/algorithmicProblem/questionType', { params: {} })
if (res.code === 200) {
this.options = res.result
//获取问题列表
this.interviewPage()
}
},
async getAllQuestionType() {
const { data: res } = await axios.get('http://localhost:80/algorithmicProblem/allQuestionType', { params: {} })
if (res.code === 200) {
this.allOptions = res.result
}
},
async interviewPage() {
async algorithmPage() {
this.loading = true
const { data: res } = await axios.get('http://localhost:80/algorithmicProblem/page', {
params: {
page: this.currentPage,
pageSize: this.pageSize,
questionName: this.formInline.questionName,
questionType: this.questionType,
questionType: this.formInline.questionType,
},
})
if (res.code === 200) {
this.total = res.result.totalElements
// 定义一个映射(map)来存储 questionType 到 name 的转换
const questionTypeToNameMap = {}
this.options.forEach((option) => {
questionTypeToNameMap[option.questionType] = option.name
})
// 修改 algorithmicList 中的每一个元素,将 questionType 转换为 name
res.result.content.forEach((item) => {
item.questionTypeName = questionTypeToNameMap[item.questionType]
})
this.algorithmicList = res.result.content
}
this.loading = false
......@@ -419,7 +384,7 @@ export default {
},
handleCurrentChange(currentPage) {
this.currentPage = currentPage
this.getQuestionType()
this.algorithmPage()
},
getColorForValue(value) {
// 检查颜色映射关系中是否已经有该值对应的颜色
......@@ -436,36 +401,26 @@ export default {
'red',
'blue',
'green',
'yellow',
'purple',
'orange',
'pink',
'brown',
'cyan',
'magenta',
'maroon',
'navy',
'olive',
'teal',
'lime',
'aqua',
'silver',
'gray',
'white',
'indigo',
'violet',
'lavender',
'coral',
'gold',
'salmon',
'turquoise',
'orchid',
'khaki',
'slategray',
'thistle',
'burlywood',
'cadetblue',
'chartreuse',
'chocolate',
'crimson',
'darkblue',
......@@ -491,13 +446,9 @@ export default {
'firebrick',
'forestgreen',
'fuchsia',
'gold',
'greenyellow',
'hotpink',
'indianred',
'lawngreen',
'lightcoral',
'lightgreen',
'lightpink',
'lightsalmon',
'lightseagreen',
......@@ -508,30 +459,22 @@ export default {
'mediumblue',
'mediumorchid',
'mediumpurple',
'mediumseagreen',
'mediumslateblue',
'mediumspringgreen',
'mediumturquoise',
'mediumvioletred',
'midnightblue',
'orangered',
'palegoldenrod',
'palegreen',
'paleturquoise',
'palevioletred',
'peru',
'powderblue',
'rosybrown',
'saddlebrown',
'seagreen',
'sienna',
'skyblue',
'slateblue',
'springgreen',
'tan',
'thistle',
'tomato',
'turquoise',
'violet',
]
const randomIndex = Math.floor(Math.random() * colorArray.length)
......
......@@ -38,7 +38,7 @@
</el-dialog>
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item>
<el-input clearable v-model="formInline.poetryText" placeholder="请输入问题" @keydown.enter.native="interviewPage"></el-input>
<el-input clearable v-model="formInline.poetryText" placeholder="请输入关键字" @keydown.enter.native="interviewPage"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="interviewPage">查询</el-button>
......
......@@ -282,7 +282,7 @@ export default {
{ type: 2, name: '评论已满' },
{ type: 3, name: '禁言' },
{ type: 4, name: '评论太快' },
{ type: 5, name: '评论已经到了42' },
{ type: 5, name: '评论已经到了40' },
{ type: 8, name: '其他错误' },
{ type: 9, name: '评论成功' },
],
......@@ -605,7 +605,7 @@ export default {
return 'info'
} else if (statusName == '已经点过赞' || statusName == '已经收藏过' || statusName == '已经评论过') {
return 'success'
} else if (statusName == '文章状态不能点赞' || statusName == '收藏已满' || statusName == '收藏夹不存在' || statusName == '评论已满' || statusName == '禁言' || statusName == '评论已经到了42') {
} else if (statusName == '文章状态不能点赞' || statusName == '收藏已满' || statusName == '收藏夹不存在' || statusName == '评论已满' || statusName == '禁言' || statusName == '评论已经到了40') {
return 'danger'
} else if (statusName == '点赞成功' || statusName == '收藏成功' || statusName == '评论成功') {
return 'success'
......
......@@ -296,7 +296,7 @@ export default {
{ type: 2, name: '评论已满' },
{ type: 3, name: '禁言' },
{ type: 4, name: '评论太快' },
{ type: 5, name: '评论已经到了42' },
{ type: 5, name: '评论已经到了40' },
{ type: 8, name: '其他错误' },
{ type: 9, name: '评论成功' },
],
......@@ -325,19 +325,13 @@ export default {
}
},
watch: {
'formInline.userName'(newVal, oldVal) {
if (newVal !== oldVal) {
formInline: {
handler(newVal, oldVal) {
this.currentPage = 1
localStorage.setItem('csdnUserPage', this.currentPage)
this.userPage()
}
},
'formInline.nickName'(newVal, oldVal) {
if (newVal !== oldVal) {
this.currentPage = 1
localStorage.setItem('csdnUserPage', this.currentPage)
this.userPage()
}
},
deep: true,
},
// 监听currentPage的变化,将新值保存到localStorage中
currentPage(newPage) {
......@@ -617,7 +611,7 @@ export default {
return 'info'
} else if (statusName == '已经点过赞' || statusName == '已经收藏过' || statusName == '已经评论过') {
return 'success'
} else if (statusName == '文章状态不能点赞' || statusName == '收藏已满' || statusName == '收藏夹不存在' || statusName == '评论已满' || statusName == '禁言' || statusName == '评论已经到了42') {
} else if (statusName == '文章状态不能点赞' || statusName == '收藏已满' || statusName == '收藏夹不存在' || statusName == '评论已满' || statusName == '禁言' || statusName == '评论已经到了40') {
return 'danger'
} else if (statusName == '点赞成功' || statusName == '收藏成功' || statusName == '评论成功') {
return 'success'
......
......@@ -4,7 +4,10 @@
<el-main>
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item>
<el-select size="small" v-model="formInline.relationType" placeholder="请选择关系类型" @change="fansInfoPage">
<el-input size="small" clearable v-model="formInline.userName" placeholder="请输入用户名" @keydown.enter.native="userPage"></el-input>
</el-form-item>
<el-form-item>
<el-select size="small" v-model="formInline.relationType" multiple placeholder="请选择关系类型" @change="fansInfoPage">
<el-option v-for="type in relationType" :key="type" :label="type" :value="type"></el-option>
</el-select>
</el-form-item>
......@@ -41,6 +44,16 @@
</span>
</el-dialog>
</el-form-item>
<el-form-item>
<el-button size="small" type="primary" @click="prepareCancleNoArticle">取消关注无文章</el-button>
<el-dialog title="提示" :visible.sync="noArticleDialogVisible" width="30%" :before-close="handleClose">
<span>确认取消关注无文章吗?</span>
<span slot="footer" class="dialog-footer">
<el-button @click="noArticleDialogVisible = false">取 消</el-button>
<el-button type="primary" @click.prevent="cancleFansNoArticle()">确 定</el-button>
</span>
</el-dialog>
</el-form-item>
</el-form>
<el-table border :data="fansInfoList" v-loading="loading">
<el-table-column prop="id" label="序号" width="100" sortable></el-table-column>
......@@ -64,117 +77,137 @@
<script>
import ApiService from '../../api/ApiService'
export default {
name: 'MyTripletDayInfo',
data() {
return {
formInline: {
relationType: null,
},
relationType: ['全部', '互关', '粉丝', '已关注'],
// 用户列表数据
fansInfoList: [],
loading: false,
syncFansInfoDialogVisible: false,
syncFollowInfoDialogVisible: false,
cancleFollowInfoDialogVisible: false,
elementui_page_component_key: 0,
currentPage: Number(localStorage.getItem('csdnFansInfoPage')) || 1,
pageSize: 9,
total: 0,
}
},
name: 'MyTripletDayInfo',
watch: {
'formInline.relationType'(newVal, oldVal) {
if (newVal !== oldVal) {
this.currentPage = 1
localStorage.setItem('csdnFansInfoPage', this.currentPage)
this.fansInfoPage()
}
},
// 监听currentPage的变化,将新值保存到localStorage中
currentPage(newPage) {
localStorage.setItem('csdnFansInfoPage', newPage.toString())
},
},
created() {
//获取问题类型的枚举
this.fansInfoPage()
},
mounted() {
this.currentPage = 1
},
methods: {
prepareSyncFansInfo() {
this.syncFansInfoDialogVisible = true
},
prepareSyncFollowInfo() {
this.syncFollowInfoDialogVisible = true
},
prepareCancleFollowInfo() {
this.cancleFollowInfoDialogVisible = true
},
handleClose(done) {
this.$confirm('确认关闭?')
.then((_) => {
done()
})
.catch((_) => {})
},
async fansInfoPage() {
this.loading = true
const { data: res } = await ApiService.fansInfoPage(this.currentPage, this.pageSize, this.formInline.relationType)
if (res.code === 200) {
this.total = res.result.totalElements
this.fansInfoList = res.result.content
}
this.loading = false
},
data() {
return {
formInline: {
relationType: [],
userName: '',
},
relationType: ['互关', '粉丝', '已关注'],
// 用户列表数据
fansInfoList: [],
loading: false,
syncFansInfoDialogVisible: false,
syncFollowInfoDialogVisible: false,
cancleFollowInfoDialogVisible: false,
noArticleDialogVisible: false,
elementui_page_component_key: 0,
currentPage: Number(localStorage.getItem('csdnFansInfoPage')) || 1,
pageSize: 9,
total: 0,
}
},
async syncFansInfo() {
this.loading = true
this.syncFansInfoDialogVisible = false
const { data: res } = await ApiService.syncFansInfo()
if (res.code === 200) {
this.fansInfoPage()
}
this.loading = false
},
watch: {
'formInline.relationType'(newVal, oldVal) {
if (newVal !== oldVal) {
this.currentPage = 1
localStorage.setItem('csdnFansInfoPage', this.currentPage)
this.fansInfoPage()
}
},
'formInline.userName'(newVal, oldVal) {
if (newVal !== oldVal) {
this.currentPage = 1
localStorage.setItem('csdnFansInfoPage', this.currentPage)
this.fansInfoPage()
}
},
// 监听currentPage的变化,将新值保存到localStorage中
currentPage(newPage) {
localStorage.setItem('csdnFansInfoPage', newPage.toString())
},
},
created() {
//获取问题类型的枚举
this.fansInfoPage()
},
mounted() {
this.currentPage = 1
},
methods: {
prepareSyncFansInfo() {
this.syncFansInfoDialogVisible = true
},
prepareCancleNoArticle() {
this.noArticleDialogVisible = true
},
prepareSyncFollowInfo() {
this.syncFollowInfoDialogVisible = true
},
prepareCancleFollowInfo() {
this.cancleFollowInfoDialogVisible = true
},
handleClose(done) {
this.$confirm('确认关闭?')
.then((_) => {
done()
})
.catch((_) => {})
},
async fansInfoPage() {
this.loading = true
const { data: res } = await ApiService.fansInfoPage(this.currentPage, this.pageSize, this.formInline)
if (res.code === 200) {
this.total = res.result.totalElements
this.fansInfoList = res.result.content
}
this.loading = false
},
async syncFollowInfo() {
this.loading = true
this.syncFollowInfoDialogVisible = false
const { data: res } = await ApiService.syncFollowInfo()
if (res.code === 200) {
this.fansInfoPage()
}
this.loading = false
},
async cancleFollowInfo() {
this.loading = true
this.cancleFollowInfoDialogVisible = false
const { data: res } = await ApiService.cancleFollowInfo()
if (res.code === 200) {
this.fansInfoPage()
}
this.loading = false
},
async syncFansInfo() {
this.loading = true
this.syncFansInfoDialogVisible = false
const { data: res } = await ApiService.syncFansInfo()
if (res.code === 200) {
this.fansInfoPage()
}
this.loading = false
},
async cancleFansNoArticle() {
this.loading = true
this.noArticleDialogVisible = false
const { data: res } = await ApiService.cancleFansNoArticle()
if (res.code === 200) {
this.fansInfoPage()
}
this.loading = false
},
refreshPage() {
//获取问题类型的枚举
this.fansInfoPage()
location.reload()
},
handleCurrentChange(currentPage) {
this.currentPage = currentPage
this.fansInfoPage()
},
handleSizeChange(currentSize) {
this.pageSize = currentSize
this.fansInfoPage()
},
},
async syncFollowInfo() {
this.loading = true
this.syncFollowInfoDialogVisible = false
const { data: res } = await ApiService.syncFollowInfo()
if (res.code === 200) {
this.fansInfoPage()
}
this.loading = false
},
async cancleFollowInfo() {
this.loading = true
this.cancleFollowInfoDialogVisible = false
const { data: res } = await ApiService.cancleFollowInfo()
if (res.code === 200) {
this.fansInfoPage()
}
this.loading = false
},
refreshPage() {
//获取问题类型的枚举
this.fansInfoPage()
location.reload()
},
handleCurrentChange(currentPage) {
this.currentPage = currentPage
this.fansInfoPage()
},
handleSizeChange(currentSize) {
this.pageSize = currentSize
this.fansInfoPage()
},
},
}
</script>
......
......@@ -2,60 +2,59 @@
<div>
<el-container>
<el-main>
<el-dialog title="新增面试问题" :visible.sync="dialogFormVisible" style="width: 100%">
<el-form :model="form" class="custom-form">
<el-form-item label="面试问题" :label-width="formLabelWidth" class="form-item">
<el-input v-model="form.question" autocomplete="off" style="width: 100%"></el-input>
</el-form-item>
<br />
<el-form-item label="问题类型" :label-width="formLabelWidth" class="form-item">
<el-select v-model="form.questionType" placeholder="请选择活动区域">
<el-option v-for="item in options" :key="item.questionType" :label="item.name" :value="item.questionType"></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary" @click="handleConfirm(0)">确 定</el-button>
</div>
</el-dialog>
<el-dialog class="red-title" :visible.sync="dialogMutiFormVisible">
<div class="red-title" slot="title">批量新增面试问题(多个问题换行填写)</div>
<el-form :model="form" class="custom-form">
<el-form-item label="面试问题" :label-width="formLabelWidth" class="form-item">
<el-input type="textarea" v-model="form.question" autocomplete="off" :rows="5" :cols="30" style="width: 100%"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogMutiFormVisible = false">取 消</el-button>
<el-button type="primary" @click="handleConfirm(1)">确 定</el-button>
</div>
</el-dialog>
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item>
<el-input clearable v-model="formInline.question" placeholder="请输入问题" @keydown.enter.native="interviewPage"></el-input>
</el-form-item>
<el-select v-model="questionType" placeholder="请选择" @change="interviewPage">
<el-option v-for="item in options" :key="item.questionType" :label="item.name" :value="item.questionType"></el-option>
<el-select v-model="formInline.questionType" placeholder="请选择" @change="interviewPage">
<el-option v-for="item in options" :key="item" :label="item" :value="item"></el-option>
</el-select>
<el-form-item>
<el-button type="primary" @click="interviewPage">查询</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="prepareAdd">新增</el-button>
<el-dialog title="新增面试问题" :visible.sync="dialogFormVisible" style="width: 100%">
<el-form :model="form" class="custom-form">
<el-form-item label="面试问题" :label-width="formLabelWidth" class="form-item">
<el-input v-model="form.question" autocomplete="off" style="width: 100%"></el-input>
</el-form-item>
<br />
<el-form-item label="问题类型" :label-width="formLabelWidth" class="form-item">
<el-select v-model="form.questionType" placeholder="请选择问题类型">
<el-option v-for="item in options" :key="item" :label="item" :value="item"></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary" @click="handleConfirm(0)">确 定</el-button>
</div>
</el-dialog>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="prepareMutiAdd">批量新增</el-button>
<el-dialog class="red-title" :visible.sync="dialogMutiFormVisible">
<div class="red-title" slot="title">批量新增面试问题(多个问题换行填写)</div>
<el-form :model="form" class="custom-form">
<el-form-item label="面试问题" :label-width="formLabelWidth" class="form-item">
<el-input type="textarea" v-model="form.question" autocomplete="off" :rows="5" :cols="30" style="width: 100%"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogMutiFormVisible = false">取 消</el-button>
<el-button type="primary" @click="handleConfirm(1)">确 定</el-button>
</div>
</el-dialog>
</el-form-item>
</el-form>
<el-table border :data="userlist" v-loading="loading">
<el-table-column prop="id" label="序号" width="100" sortable></el-table-column>
<el-table-column prop="question" label="面试问题" show-overflow-tooltip></el-table-column>
<!-- <el-table-column prop="questionTypeName" label="问题类型" show-overflow-tooltip align="center"></el-table-column> -->
<el-table-column prop="questionTypeName" label="问题类型" show-overflow-tooltip align="center">
<el-table-column prop="questionType" label="问题类型" show-overflow-tooltip align="center">
<template slot-scope="scope">
<span :style="{ color: getColorForValue(scope.row.questionTypeName) }" v-html="scope.row.questionTypeName"></span>
<span :style="{ color: getColorForValue(scope.row.questionType) }" v-html="scope.row.questionType"></span>
</template>
</el-table-column>
......@@ -66,7 +65,7 @@
</el-table-column>
<el-table-column prop="操作" label="操作" width="180">
<template slot-scope="props">
<el-button type="success" @click.prevent="preEdit(props.row.id, props.row.question, props.row.questionTypeName)" width="200">编辑</el-button>
<el-button type="success" @click.prevent="preEdit(props.row.id, props.row.question, props.row.questionType)" width="200">编辑</el-button>
<el-dialog title="编辑面试问题" :visible.sync="editVisible">
<el-form :model="form">
<el-form-item label="面试问题" :label-width="formLabelWidth">
......@@ -74,7 +73,7 @@
</el-form-item>
<el-form-item label="问题类型" :label-width="formLabelWidth">
<el-select v-model="form.questionType" placeholder="请选择问题类型" style="text-align: left">
<el-option v-for="item in options" :key="item.questionType" :label="item.name" :value="item.questionType"></el-option>
<el-option v-for="item in options" :key="item" :label="item" :value="item"></el-option>
</el-select>
</el-form-item>
</el-form>
......@@ -118,15 +117,15 @@ export default {
total: 0,
formInline: {
question: '',
questionType: '',
},
options: [],
questionType: 0,
options: ['MySQL', 'JVM', '并发编程', '微服务'],
// 新增的内容
dialogFormVisible: false,
dialogMutiFormVisible: false,
form: {
question: '',
questionType: 0,
questionType: '',
},
formLabelWidth: '120px',
dialogVisible: false,
......@@ -140,7 +139,7 @@ export default {
if (newVal !== oldVal) {
this.currentPage = 1
localStorage.setItem('interviewLastPage', this.currentPage)
this.getQuestionType()
this.interviewPage()
}
},
// 监听currentPage的变化,将新值保存到localStorage中
......@@ -150,25 +149,20 @@ export default {
},
created() {
//获取问题列表
this.getQuestionType()
this.interviewPage()
},
mounted() {
this.currentPage = 1
// // 在页面加载时从localStorage中获取currentPage的值
// const storedPage = localStorage.getItem('interviewLastPage')
// if (storedPage) {
// this.currentPage = parseInt(storedPage)
// }
},
methods: {
prepareAdd() {
this.form.question = ''
this.form.questionType = 0
this.form.questionType = ''
this.dialogFormVisible = true
},
prepareMutiAdd() {
this.form.question = ''
this.form.questionType = 0
this.form.questionType = ''
this.dialogMutiFormVisible = true
},
......@@ -176,15 +170,9 @@ export default {
this.currentRowId = id
this.dialogVisible = true
},
preEdit(id, question, questionTypeName) {
preEdit(id, question, questionType) {
this.form.question = question
// 定义一个映射(map)来存储 questionType 到 name 的转换
const questionTypeToNameMap = {}
this.options.forEach((option) => {
questionTypeToNameMap[option.name] = option.questionType
})
this.form.questionType = questionTypeToNameMap[questionTypeName]
this.form.questionType = questionType
this.currentRowId = id
this.editVisible = true
},
......@@ -213,8 +201,8 @@ export default {
if (res.code === 200) {
this.currentPage = 1
this.form.question = ''
this.form.questionType = 0
this.getQuestionType() // 确保这个方法是有效的
this.form.questionType = ''
this.interviewPage() // 确保这个方法是有效的
} else {
console.error('Received non-200 status code', res)
this.errorMsg(res.message)
......@@ -247,7 +235,7 @@ export default {
this.form.questionType = 0
this.editVisible = false
currentRowId: null
this.getQuestionType() // 确保这个方法是有效的
this.interviewPage() // 确保这个方法是有效的
} else {
console.error('Received non-200 status code', res)
}
......@@ -267,24 +255,15 @@ export default {
id: id,
},
})
this.getQuestionType()
this.interviewPage()
this.loading = false
},
refreshPage() {
//获取问题类型的枚举
this.getQuestionType()
this.interviewPage()
location.reload()
},
async getQuestionType() {
const { data: res } = await axios.get('http://localhost:80/interviewQuestion/questionType', { params: {} })
if (res.code === 200) {
this.options = res.result
this.interviewPage()
}
},
async interviewPage() {
this.loading = true
const { data: res } = await axios.get('http://localhost:80/interviewQuestion/page', {
......@@ -292,27 +271,18 @@ export default {
page: this.currentPage,
pageSize: this.pageSize,
question: this.formInline.question,
questionType: this.questionType,
questionType: this.formInline.questionType,
},
})
if (res.code === 200) {
this.total = res.result.totalElements
// 定义一个映射(map)来存储 questionType 到 name 的转换
const questionTypeToNameMap = {}
this.options.forEach((option) => {
questionTypeToNameMap[option.questionType] = option.name
})
// 修改 userlist 中的每一个元素,将 questionType 转换为 name
res.result.content.forEach((user) => {
user.questionTypeName = questionTypeToNameMap[user.questionType] || 'Unknown'
})
this.userlist = res.result.content
}
this.loading = false
},
handleCurrentChange(currentPage) {
this.currentPage = currentPage
this.getQuestionType()
this.interviewPage()
},
getColorForValue(value) {
// 检查颜色映射关系中是否已经有该值对应的颜色
......@@ -329,36 +299,26 @@ export default {
'red',
'blue',
'green',
'yellow',
'purple',
'orange',
'pink',
'brown',
'cyan',
'magenta',
'maroon',
'navy',
'olive',
'teal',
'lime',
'aqua',
'silver',
'gray',
'white',
'indigo',
'violet',
'lavender',
'coral',
'gold',
'salmon',
'turquoise',
'orchid',
'khaki',
'slategray',
'thistle',
'burlywood',
'cadetblue',
'chartreuse',
'chocolate',
'crimson',
'darkblue',
......@@ -384,13 +344,9 @@ export default {
'firebrick',
'forestgreen',
'fuchsia',
'gold',
'greenyellow',
'hotpink',
'indianred',
'lawngreen',
'lightcoral',
'lightgreen',
'lightpink',
'lightsalmon',
'lightseagreen',
......@@ -401,30 +357,22 @@ export default {
'mediumblue',
'mediumorchid',
'mediumpurple',
'mediumseagreen',
'mediumslateblue',
'mediumspringgreen',
'mediumturquoise',
'mediumvioletred',
'midnightblue',
'orangered',
'palegoldenrod',
'palegreen',
'paleturquoise',
'palevioletred',
'peru',
'powderblue',
'rosybrown',
'saddlebrown',
'seagreen',
'sienna',
'skyblue',
'slateblue',
'springgreen',
'tan',
'thistle',
'tomato',
'turquoise',
'violet',
]
const randomIndex = Math.floor(Math.random() * colorArray.length)
......
......@@ -8,6 +8,9 @@
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button size="small" type="primary" @click="queryPic">查询</el-button>
</el-form-item>
<el-form-item>
<el-button size="small" type="primary" @click="prepareAddPic">新增图片</el-button>
<el-dialog title="新增图片" :visible.sync="addPicVisible" style="width: 100%">
......
......@@ -6,20 +6,30 @@
CSDN管理
</template>
<el-menu-item-group>
<template slot="title">常用功能</template>
<router-link :to="{ path: '/home/tripletDayInfo' }">
<el-menu-item index="/home/tripletDayInfo">三连管理</el-menu-item>
<el-menu-item index="/home/tripletDayInfo">阈值管理</el-menu-item>
</router-link>
<router-link :to="{ path: '/home/accountManagement' }">
<el-menu-item index="/home/accountManagement">余额管理</el-menu-item>
</router-link>
</el-menu-item-group>
<el-menu-item-group>
<template slot="title">用户相关</template>
<router-link :to="{ path: '/home/csdnUser' }">
<el-menu-item index="/home/csdnUser">用户管理</el-menu-item>
</router-link>
<router-link :to="{ path: '/home/fansInfo' }">
<el-menu-item index="/home/fansInfo">粉丝管理</el-menu-item>
</router-link>
</el-menu-item-group>
<el-menu-item-group>
<template slot="title">三连相关</template>
<router-link :to="{ path: '/home/articleInfo' }">
<el-menu-item index="/home/articleInfo">文章管理</el-menu-item>
</router-link>
<router-link :to="{ path: '/home/message' }">
<el-menu-item index="/home/message">私信管理</el-menu-item>
</router-link>
<router-link :to="{ path: '/home/fansInfo' }">
<el-menu-item index="/home/fansInfo">粉丝管理</el-menu-item>
</router-link>
</el-menu-item-group>
</el-submenu>
......
......@@ -13,6 +13,7 @@ import Algorithmic from '@/components/menus/MyAlgorithmic.vue'
import AphorismPoetry from '@/components/menus/MyAphorismPoetry.vue'
import MyCsdnUser from '@/components/menus/MyCsdnUser.vue'
import MyFansInfo from '@/components/menus/MyFansInfo.vue'
import MyAccountManagement from '@/components/menus/MyAccountManagement.vue'
import MyMessage from '@/components/menus/MyMessage.vue'
import MyArticleInfo from '@/components/menus/MyArticleInfo.vue'
import MyTripletDayInfo from '@/components/menus/MyTripletDayInfo.vue'
......@@ -32,83 +33,90 @@ const router = new VueRouter({
path: '/login',
component: Login,
meta: {
title: '登录', // 设置默认标题
title: '登录',
},
},
// 后台主页的路由规则
{
path: '/home',
component: Home,
redirect: '/home/csdnUser',
redirect: '/home/tripletDayInfo',
children: [
{
path: 'csdnUser',
component: MyCsdnUser,
path: 'tripletDayInfo',
component: MyTripletDayInfo,
meta: {
title: '用户管理', // 设置默认标题
title: '三连管理',
},
},
{
path: 'tripletDayInfo',
component: MyTripletDayInfo,
path: 'csdnUser',
component: MyCsdnUser,
meta: {
title: '三连管理', // 设置默认标题
title: '用户管理',
},
},
{
path: 'articleInfo',
component: MyArticleInfo,
meta: {
title: '文章管理', // 设置默认标题
title: '文章管理',
},
},
{
path: 'accountManagement',
component: MyAccountManagement,
meta: {
title: '余额管理',
},
},
{
path: 'message',
component: MyMessage,
meta: {
title: '私信管理', // 设置默认标题
title: '私信管理',
},
},
{
path: 'fansInfo',
component: MyFansInfo,
meta: {
title: '粉丝管理', // 设置默认标题
title: '粉丝管理',
},
},
{
path: 'interview',
component: Interview,
meta: {
title: '面试题', // 设置默认标题
title: '面试题',
},
},
{
path: 'algorithmic',
component: Algorithmic,
meta: {
title: '算法题', // 设置默认标题
title: '算法题',
},
},
{
path: 'aphorismpoetry',
component: AphorismPoetry,
meta: {
title: '名言警句', // 设置默认标题
title: '名言警句',
},
},
{
path: 'chat',
component: Chat,
meta: {
title: 'chatgpt记录', // 设置默认标题
title: 'chatgpt记录',
},
},
{
path: 'pic',
component: Pic,
meta: {
title: '图片', // 设置默认标题
title: '图片',
},
},
{
......@@ -116,14 +124,14 @@ const router = new VueRouter({
component: MyChatDetail,
props: true,
meta: {
title: 'chat信息', // 设置默认标题
title: 'chat信息',
},
},
{
path: 'addChat',
component: AddChatDetail,
meta: {
title: '添加chat信息', // 设置默认标题
title: '添加chat信息',
},
},
],
......
export default['/home', '/home/pic']
export default['/home']
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册