整理

上级 9234181a
.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-container[data-v-36ae6cf9]{height:60px;border-bottom:1px solid #eaeaea}.layout-header-left-img[data-v-36ae6cf9]{height:50px}.layout-aside-container[data-v-4d18659a]{width:250px;height:100%;border-right:1px solid #eaeaea}.left-aside-item[data-v-4d18659a]{font-size:20px}.home-container[data-v-e41dbfec]{height:100%;display:flex;flex-direction:column}.home-container .home-main-box[data-v-e41dbfec]{height:100%;display:flex}.home-container .home-main-box .home-main-body[data-v-e41dbfec]{padding:15px;flex:1}.el-header[data-v-15b8f4b2]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-15b8f4b2]{color:#333}.pagination[data-v-15b8f4b2]{margin-top:16px;text-align:right}.arrow-button[data-v-15b8f4b2]{display:flex;align-items:center;justify-content:center;border:none;background-color:transparent;cursor:pointer}.custom-icon[data-v-15b8f4b2]{font-size:24px;color:#f90;margin-right:6px}.arrow-button.disabled[data-v-15b8f4b2]{pointer-events:none;opacity:.1}.el-header[data-v-6e64ea6a]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-6e64ea6a]{color:#333}.pagination[data-v-6e64ea6a]{margin-top:16px;text-align:right}.header-button-item[data-v-6e64ea6a]{margin-right:15px;font-size:20px}.backtop[data-v-6e64ea6a]{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-6e64ea6a]:hover{background-color:#0050a0}.el-header[data-v-153268c2]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-153268c2]{color:#333}.pagination[data-v-153268c2]{margin-top:16px;text-align:right}.header-button-item[data-v-153268c2]{margin-right:15px;font-size:20px}.red-title[data-v-153268c2]{line-height:24px;font-size:18px;color:red}.backtop[data-v-153268c2]{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}.reddish-purple-value[data-v-153268c2]{color:#eb6ea5}.new-orange-value[data-v-153268c2]{color:#59b9c6}.clove-tea-value[data-v-153268c2]{color:#b4866b}.grassy-value[data-v-153268c2]{color:#c3d825}.daylily-value[data-v-153268c2]{color:#f8b862}.balloon-flower-value[data-v-153268c2]{color:#4d5aaf}.pink-value[data-v-153268c2]{color:#f47983}.purple-value[data-v-153268c2]{color:#8d4bbb}.sapphire-blue-value[data-v-153268c2]{color:#4b5cc4}.green-value[data-v-153268c2]{color:#ce9ffc}.black-value[data-v-153268c2]{color:#000}.magenta-value[data-v-153268c2]{color:#ff0097}.dark-blue-value[data-v-153268c2]{color:#3eede7}.rose-hermosa-value[data-v-153268c2]{color:#ff6fd8}.white-dress-value[data-v-153268c2]{color:#83ccd2}.prunus-gracilis-value[data-v-153268c2]{color:#5a79ba}.custom-textarea[data-v-153268c2]{width:100%;text-align:left}.backtop[data-v-153268c2]:hover{background-color:#0050a0}.el-header[data-v-2c67c0ac]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-2c67c0ac]{color:#333}.pagination[data-v-2c67c0ac]{margin-top:16px;text-align:right}.header-button-item[data-v-2c67c0ac]{margin-right:15px;font-size:20px}.red-title[data-v-2c67c0ac]{line-height:24px;font-size:18px;color:red}.backtop[data-v-2c67c0ac]{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}.reddish-purple-value[data-v-2c67c0ac]{color:#eb6ea5}.new-orange-value[data-v-2c67c0ac]{color:#59b9c6}.clove-tea-value[data-v-2c67c0ac]{color:#b4866b}.grassy-value[data-v-2c67c0ac]{color:#c3d825}.daylily-value[data-v-2c67c0ac]{color:#f8b862}.balloon-flower-value[data-v-2c67c0ac]{color:#4d5aaf}.pink-value[data-v-2c67c0ac]{color:#f47983}.purple-value[data-v-2c67c0ac]{color:#8d4bbb}.sapphire-blue-value[data-v-2c67c0ac]{color:#4b5cc4}.green-value[data-v-2c67c0ac]{color:#ce9ffc}.black-value[data-v-2c67c0ac]{color:#000}.magenta-value[data-v-2c67c0ac]{color:#ff0097}.dark-blue-value[data-v-2c67c0ac]{color:#3eede7}.rose-hermosa-value[data-v-2c67c0ac]{color:#ff6fd8}.white-dress-value[data-v-2c67c0ac]{color:#83ccd2}.prunus-gracilis-value[data-v-2c67c0ac]{color:#5a79ba}.custom-textarea[data-v-2c67c0ac]{width:100%;text-align:left}.backtop[data-v-2c67c0ac]:hover{background-color:#0050a0}.button-container[data-v-9d5d30a4]{position:fixed;bottom:0;right:0;margin:16px}.container[data-v-ddc6c3e0]{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-container[data-v-36ae6cf9]{height:60px;border-bottom:1px solid #eaeaea}.layout-header-left-img[data-v-36ae6cf9]{height:50px}.layout-aside-container[data-v-4d18659a]{width:250px;height:100%;border-right:1px solid #eaeaea}.left-aside-item[data-v-4d18659a]{font-size:20px}.home-container[data-v-e41dbfec]{height:100%;display:flex;flex-direction:column}.home-container .home-main-box[data-v-e41dbfec]{height:100%;display:flex}.home-container .home-main-box .home-main-body[data-v-e41dbfec]{padding:15px;flex:1}.el-header[data-v-15b8f4b2]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-15b8f4b2]{color:#333}.pagination[data-v-15b8f4b2]{margin-top:16px;text-align:right}.arrow-button[data-v-15b8f4b2]{display:flex;align-items:center;justify-content:center;border:none;background-color:transparent;cursor:pointer}.custom-icon[data-v-15b8f4b2]{font-size:24px;color:#f90;margin-right:6px}.arrow-button.disabled[data-v-15b8f4b2]{pointer-events:none;opacity:.1}.el-header[data-v-6e64ea6a]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-6e64ea6a]{color:#333}.pagination[data-v-6e64ea6a]{margin-top:16px;text-align:right}.header-button-item[data-v-6e64ea6a]{margin-right:15px;font-size:20px}.backtop[data-v-6e64ea6a]{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-6e64ea6a]:hover{background-color:#0050a0}.el-header[data-v-153268c2]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-153268c2]{color:#333}.pagination[data-v-153268c2]{margin-top:16px;text-align:right}.header-button-item[data-v-153268c2]{margin-right:15px;font-size:20px}.red-title[data-v-153268c2]{line-height:24px;font-size:18px;color:red}.backtop[data-v-153268c2]{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}.reddish-purple-value[data-v-153268c2]{color:#eb6ea5}.new-orange-value[data-v-153268c2]{color:#59b9c6}.clove-tea-value[data-v-153268c2]{color:#b4866b}.grassy-value[data-v-153268c2]{color:#c3d825}.daylily-value[data-v-153268c2]{color:#f8b862}.balloon-flower-value[data-v-153268c2]{color:#4d5aaf}.pink-value[data-v-153268c2]{color:#f47983}.purple-value[data-v-153268c2]{color:#8d4bbb}.sapphire-blue-value[data-v-153268c2]{color:#4b5cc4}.green-value[data-v-153268c2]{color:#ce9ffc}.black-value[data-v-153268c2]{color:#000}.magenta-value[data-v-153268c2]{color:#ff0097}.dark-blue-value[data-v-153268c2]{color:#3eede7}.rose-hermosa-value[data-v-153268c2]{color:#ff6fd8}.white-dress-value[data-v-153268c2]{color:#83ccd2}.prunus-gracilis-value[data-v-153268c2]{color:#5a79ba}.custom-textarea[data-v-153268c2]{width:100%;text-align:left}.backtop[data-v-153268c2]:hover{background-color:#0050a0}.el-header[data-v-3ad359cc]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-3ad359cc]{color:#333}.pagination[data-v-3ad359cc]{margin-top:16px;text-align:right}.header-button-item[data-v-3ad359cc]{margin-right:15px;font-size:20px}.red-title[data-v-3ad359cc]{line-height:24px;font-size:18px;color:red}.backtop[data-v-3ad359cc]{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}.reddish-purple-value[data-v-3ad359cc]{color:#eb6ea5}.new-orange-value[data-v-3ad359cc]{color:#59b9c6}.clove-tea-value[data-v-3ad359cc]{color:#b4866b}.grassy-value[data-v-3ad359cc]{color:#c3d825}.daylily-value[data-v-3ad359cc]{color:#f8b862}.balloon-flower-value[data-v-3ad359cc]{color:#4d5aaf}.pink-value[data-v-3ad359cc]{color:#f47983}.purple-value[data-v-3ad359cc]{color:#8d4bbb}.sapphire-blue-value[data-v-3ad359cc]{color:#4b5cc4}.green-value[data-v-3ad359cc]{color:#ce9ffc}.black-value[data-v-3ad359cc]{color:#000}.magenta-value[data-v-3ad359cc]{color:#ff0097}.dark-blue-value[data-v-3ad359cc]{color:#3eede7}.rose-hermosa-value[data-v-3ad359cc]{color:#ff6fd8}.white-dress-value[data-v-3ad359cc]{color:#83ccd2}.prunus-gracilis-value[data-v-3ad359cc]{color:#5a79ba}.custom-textarea[data-v-3ad359cc]{width:100%;text-align:left}.backtop[data-v-3ad359cc]:hover{background-color:#0050a0}.button-container[data-v-9d5d30a4]{position:fixed;bottom:0;right:0;margin:16px}.container[data-v-ddc6c3e0]{display:flex;justify-content:center;align-items:center;height:30vh}
/*!
* 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>kwan66</title><link href="/css/app.814ec3a2.css" rel="preload" as="style"><link href="/css/chunk-vendors.bedbfba9.css" rel="preload" as="style"><link href="/js/app.55396b68.js" rel="preload" as="script"><link href="/js/chunk-vendors.48475ebe.js" rel="preload" as="script"><link href="/css/chunk-vendors.bedbfba9.css" rel="stylesheet"><link href="/css/app.814ec3a2.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but kwan66 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/js/chunk-vendors.48475ebe.js"></script><script src="/js/app.55396b68.js"></script></body></html>
\ No newline at end of file
<!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>kwan66</title><link href="/css/app.4e509543.css" rel="preload" as="style"><link href="/css/chunk-vendors.bedbfba9.css" rel="preload" as="style"><link href="/js/app.802db8f4.js" rel="preload" as="script"><link href="/js/chunk-vendors.48475ebe.js" rel="preload" as="script"><link href="/css/chunk-vendors.bedbfba9.css" rel="stylesheet"><link href="/css/app.4e509543.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but kwan66 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/js/chunk-vendors.48475ebe.js"></script><script src="/js/app.802db8f4.js"></script></body></html>
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -161,299 +161,298 @@
<script>
import axios from 'axios'
export default {
name: 'MyInterview',
name: 'MyInterview',
data() {
return {
// 用户列表数据
algorithmicList: [],
randomAlgorithmic: {
questionName: '',
leetcodeNumber: '',
leetcodeLink: '',
},
loading: false,
elementui_page_component_key: 0,
currentPage: Number(localStorage.getItem('lastPage')) || 1,
pageSize: 9,
total: 0,
formInline: {
questionName: '',
},
options: [],
allOptions: [],
questionType: 0,
// 新增的内容
dialogFormVisible: false,
randomFormVisible: false,
dialogMutiFormVisible: false,
form: {
questionName: '',
questionType: 0,
degreeOfImportance: 5,
degreeOfDifficulty: 1,
difficultyOfScore: 1200,
leetcodeNumber: '',
leetcodeLink: '',
},
formLabelWidth: '120px',
dialogVisible: false,
editVisible: false,
currentRowId: null,
}
},
watch: {
'formInline.questionName'(newVal) {
if (newVal === '') {
this.currentPage = 1
localStorage.setItem('lastPage', this.currentPage)
this.interviewPage()
}
},
},
created() {
//获取问题类型的枚举
this.getQuestionType()
//获取问题类型的枚举
this.getAllQuestionType()
//获取问题列表
this.interviewPage()
},
mounted() {
},
methods: {
prepareAdd() {
this.form.questionName = ''
this.form.questionType = 0
this.dialogFormVisible = true
//获取问题类型的枚举
this.getAllQuestionType()
},
prepareRandom() {
this.randomAlgorithmic = []
this.randomFormVisible = true
this.interviewRandom()
},
prepareMutiAdd() {
this.form.questionName = ''
this.form.questionType = 0
this.dialogMutiFormVisible = true
},
data() {
return {
// 用户列表数据
algorithmicList: [],
randomAlgorithmic: {
questionName: '',
leetcodeNumber: '',
leetcodeLink: '',
},
loading: false,
elementui_page_component_key: 0,
currentPage: Number(localStorage.getItem('lastPage')) || 1,
pageSize: 9,
total: 0,
formInline: {
questionName: '',
},
options: [],
allOptions: [],
questionType: 0,
// 新增的内容
dialogFormVisible: false,
randomFormVisible: false,
dialogMutiFormVisible: false,
form: {
questionName: '',
questionType: 0,
degreeOfImportance: 5,
degreeOfDifficulty: 1,
difficultyOfScore: 1200,
leetcodeNumber: '',
leetcodeLink: '',
},
formLabelWidth: '120px',
dialogVisible: false,
editVisible: false,
currentRowId: null,
}
},
watch: {
'formInline.questionName'(newVal) {
if (newVal === '') {
this.currentPage = 1
localStorage.setItem('lastPage', this.currentPage)
this.interviewPage()
}
},
},
created() {
//获取问题类型的枚举
this.getQuestionType()
//获取问题类型的枚举
this.getAllQuestionType()
//获取问题列表
this.interviewPage()
},
mounted() {},
methods: {
prepareAdd() {
this.form.questionName = ''
this.form.questionType = 0
this.dialogFormVisible = true
//获取问题类型的枚举
this.getAllQuestionType()
},
prepareRandom() {
this.randomAlgorithmic = []
this.randomFormVisible = true
this.interviewRandom()
},
prepareMutiAdd() {
this.form.questionName = ''
this.form.questionType = 0
this.dialogMutiFormVisible = true
},
prepareDelete(id) {
this.currentRowId = id
this.dialogVisible = true
},
preEdit(id, questionName, questionTypeName, 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
prepareDelete(id) {
this.currentRowId = id
this.dialogVisible = true
},
preEdit(id, questionName, questionTypeName, 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.currentRowId = id
this.editVisible = true
},
handleClose(done) {
this.$confirm('确认关闭?')
.then((_) => {
done()
})
.catch((_) => {})
},
handleConfirm(addType) {
this.dialogFormVisible = false // 关闭对话框
this.dialogMutiFormVisible = false
this.addQuestion(addType) // 发送请求
},
// 定义一个映射(map)来存储 questionType 到 name 的转换
const questionTypeToNameMap = {}
this.options.forEach((option) => {
questionTypeToNameMap[option.name] = option.questionType
})
this.form.questionType = questionTypeToNameMap[questionTypeName]
this.currentRowId = id
this.editVisible = true
},
handleClose(done) {
this.$confirm('确认关闭?')
.then((_) => {
done()
})
.catch((_) => {})
},
handleConfirm(addType) {
this.dialogFormVisible = false // 关闭对话框
this.dialogMutiFormVisible = false
this.addQuestion(addType) // 发送请求
},
async addQuestion(addType) {
try {
this.loading = true
const { data: res } = await axios.post('http://120.79.36.53:8888/algorithmicProblem/add', {
addType: addType,
questionName: this.form.questionName,
questionType: this.form.questionType,
degreeOfImportance: this.form.degreeOfImportance,
degreeOfDifficulty: this.form.degreeOfDifficulty,
difficultyOfScore: this.form.difficultyOfScore,
leetcodeNumber: this.form.leetcodeNumber,
leetcodeLink: this.form.leetcodeLink,
})
if (res.code === 200) {
this.form.questionName = ''
this.form.questionType = 0
this.form.degreeOfImportance = 5
this.form.degreeOfDifficulty = 1
this.form.difficultyOfScore = 1200
this.form.leetcodeNumber = ''
this.form.leetcodeLink = ''
this.getQuestionType()
this.interviewPage()
} else {
console.error('Received non-200 status code', res)
this.errorMsg(res.message)
}
} catch (error) {
console.error('An error occurred while adding the questionName:', error)
// 异常处理逻辑
} finally {
this.loading = false
}
},
errorMsg(msg) {
this.$message({
showClose: true,
message: msg,
type: 'error',
})
},
async editConfirm() {
try {
this.loading = true
const { data: res } = await axios.post('http://120.79.36.53:8888/algorithmicProblem/update', {
id: this.currentRowId,
questionName: this.form.questionName,
questionType: this.form.questionType,
degreeOfImportance: this.form.degreeOfImportance,
degreeOfDifficulty: this.form.degreeOfDifficulty,
difficultyOfScore: this.form.difficultyOfScore,
leetcodeNumber: this.form.leetcodeNumber,
leetcodeLink: this.form.leetcodeLink,
})
if (res.code === 200) {
this.form.questionName = ''
this.form.questionType = 0
this.editVisible = false
currentRowId: null
this.getQuestionType()
this.interviewPage() // 确保这个方法是有效的
} else {
console.error('Received non-200 status code', res)
}
} catch (error) {
console.error('An error occurred while adding the questionName:', error)
// 异常处理逻辑
} finally {
this.loading = false
}
},
async addQuestion(addType) {
try {
this.loading = true
const { data: res } = await axios.post('http://120.79.36.53:8888/algorithmicProblem/add', {
addType: addType,
questionName: this.form.questionName,
questionType: this.form.questionType,
degreeOfImportance: this.form.degreeOfImportance,
degreeOfDifficulty: this.form.degreeOfDifficulty,
difficultyOfScore: this.form.difficultyOfScore,
leetcodeNumber: this.form.leetcodeNumber,
leetcodeLink: this.form.leetcodeLink,
})
if (res.code === 200) {
this.form.questionName = ''
this.form.questionType = 0
this.form.degreeOfImportance = 5
this.form.degreeOfDifficulty = 1
this.form.difficultyOfScore = 1200
this.form.leetcodeNumber = ''
this.form.leetcodeLink = ''
this.getQuestionType()
this.interviewPage()
} else {
console.error('Received non-200 status code', res)
this.errorMsg(res.message)
}
} catch (error) {
console.error('An error occurred while adding the questionName:', error)
// 异常处理逻辑
} finally {
this.loading = false
}
},
errorMsg(msg) {
this.$message({
showClose: true,
message: msg,
type: 'error',
})
},
async editConfirm() {
try {
this.loading = true
const { data: res } = await axios.post('http://120.79.36.53:8888/algorithmicProblem/update', {
id: this.currentRowId,
questionName: this.form.questionName,
questionType: this.form.questionType,
degreeOfImportance: this.form.degreeOfImportance,
degreeOfDifficulty: this.form.degreeOfDifficulty,
difficultyOfScore: this.form.difficultyOfScore,
leetcodeNumber: this.form.leetcodeNumber,
leetcodeLink: this.form.leetcodeLink,
})
if (res.code === 200) {
this.form.questionName = ''
this.form.questionType = 0
this.editVisible = false
currentRowId: null
this.getQuestionType()
this.interviewPage() // 确保这个方法是有效的
} else {
console.error('Received non-200 status code', res)
}
} catch (error) {
console.error('An error occurred while adding the questionName:', error)
// 异常处理逻辑
} finally {
this.loading = false
}
},
async onDelete(id) {
this.dialogVisible = false
this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/delete', {
params: {
id: id,
},
})
this.interviewPage()
this.loading = false
},
refreshPage() {
//获取问题类型的枚举
this.getQuestionType()
location.reload()
},
async onDelete(id) {
this.dialogVisible = false
this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/delete', {
params: {
id: id,
},
})
this.interviewPage()
this.loading = false
},
refreshPage() {
//获取问题类型的枚举
this.getQuestionType()
location.reload()
},
async getQuestionType() {
const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/questionType', { params: {} })
if (res.code === 200) {
this.options = res.result
}
},
async getQuestionType() {
const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/questionType', { params: {} })
if (res.code === 200) {
this.options = res.result
}
},
async getAllQuestionType() {
const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/allQuestionType', { params: {} })
if (res.code === 200) {
this.allOptions = res.result
}
},
async getAllQuestionType() {
const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/allQuestionType', { params: {} })
if (res.code === 200) {
this.allOptions = res.result
}
},
async interviewPage() {
this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/page', {
params: {
page: this.currentPage,
pageSize: this.pageSize,
questionName: this.formInline.questionName,
questionType: this.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
},
async interviewRandom() {
this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/random', { params: {} })
if (res.code === 200) {
this.randomAlgorithmic.questionName = res.result.questionName
this.randomAlgorithmic.leetcodeNumber = res.result.leetcodeNumber
this.randomAlgorithmic.leetcodeLink = res.result.leetcodeLink
}
this.loading = false
},
getClassForValue(value) {
if (value === '链表') {
return 'reddish-purple-value'
} else if (value === '数组') {
return 'new-orange-value'
} else if (value === '二叉树') {
return 'clove-tea-value'
} else if (value === '贪心') {
return 'grassy-value'
} else if (value === '动态规划') {
return 'daylily-value'
}
// } else if (value === 'Redis') {
// return 'balloon-flower-value'
// } else if (value === '中间件') {
// return 'pink-value'
// } else if (value === 'Spring') {
// return 'purple-value'
// } else if (value === '微服务') {
// return 'sapphire-blue-value'
// } else if (value === '分布式') {
// return 'green-value'
// } else if (value === '项目') {
// return 'black-value'
// } else if (value === '算法') {
// return 'rose-hermosa-value'
// } else if (value === '反问环节') {
// return 'white-dress-value'
// } else if (value === '设计模式') {
// return 'prunus-gracilis-value'
// } else if (value === '其他') {
// return 'magenta-value'
else {
return 'dark-blue-value'
}
},
async interviewPage() {
this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/page', {
params: {
page: this.currentPage,
pageSize: this.pageSize,
questionName: this.formInline.questionName,
questionType: this.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
},
async interviewRandom() {
this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/random', { params: {} })
if (res.code === 200) {
this.randomAlgorithmic.questionName = res.result.questionName
this.randomAlgorithmic.leetcodeNumber = res.result.leetcodeNumber
this.randomAlgorithmic.leetcodeLink = res.result.leetcodeLink
}
this.loading = false
},
getClassForValue(value) {
if (value === '链表') {
return 'reddish-purple-value'
} else if (value === '数组') {
return 'new-orange-value'
} else if (value === '二叉树') {
return 'clove-tea-value'
} else if (value === '贪心') {
return 'grassy-value'
} else if (value === '动态规划') {
return 'daylily-value'
}
// } else if (value === 'Redis') {
// return 'balloon-flower-value'
// } else if (value === '中间件') {
// return 'pink-value'
// } else if (value === 'Spring') {
// return 'purple-value'
// } else if (value === '微服务') {
// return 'sapphire-blue-value'
// } else if (value === '分布式') {
// return 'green-value'
// } else if (value === '项目') {
// return 'black-value'
// } else if (value === '算法') {
// return 'rose-hermosa-value'
// } else if (value === '反问环节') {
// return 'white-dress-value'
// } else if (value === '设计模式') {
// return 'prunus-gracilis-value'
// } else if (value === '其他') {
// return 'magenta-value'
else {
return 'dark-blue-value'
}
},
handleCurrentChange(currentPage) {
this.currentPage = currentPage
this.interviewPage()
},
},
handleCurrentChange(currentPage) {
this.currentPage = currentPage
this.interviewPage()
},
},
}
</script>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册