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

整理

上级 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/) * 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> <!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 \ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
...@@ -161,299 +161,298 @@ ...@@ -161,299 +161,298 @@
<script> <script>
import axios from 'axios' import axios from 'axios'
export default { export default {
name: 'MyInterview', name: 'MyInterview',
data() { data() {
return { return {
// 用户列表数据 // 用户列表数据
algorithmicList: [], algorithmicList: [],
randomAlgorithmic: { randomAlgorithmic: {
questionName: '', questionName: '',
leetcodeNumber: '', leetcodeNumber: '',
leetcodeLink: '', leetcodeLink: '',
}, },
loading: false, loading: false,
elementui_page_component_key: 0, elementui_page_component_key: 0,
currentPage: Number(localStorage.getItem('lastPage')) || 1, currentPage: Number(localStorage.getItem('lastPage')) || 1,
pageSize: 9, pageSize: 9,
total: 0, total: 0,
formInline: { formInline: {
questionName: '', questionName: '',
}, },
options: [], options: [],
allOptions: [], allOptions: [],
questionType: 0, questionType: 0,
// 新增的内容 // 新增的内容
dialogFormVisible: false, dialogFormVisible: false,
randomFormVisible: false, randomFormVisible: false,
dialogMutiFormVisible: false, dialogMutiFormVisible: false,
form: { form: {
questionName: '', questionName: '',
questionType: 0, questionType: 0,
degreeOfImportance: 5, degreeOfImportance: 5,
degreeOfDifficulty: 1, degreeOfDifficulty: 1,
difficultyOfScore: 1200, difficultyOfScore: 1200,
leetcodeNumber: '', leetcodeNumber: '',
leetcodeLink: '', leetcodeLink: '',
}, },
formLabelWidth: '120px', formLabelWidth: '120px',
dialogVisible: false, dialogVisible: false,
editVisible: false, editVisible: false,
currentRowId: null, currentRowId: null,
} }
}, },
watch: { watch: {
'formInline.questionName'(newVal) { 'formInline.questionName'(newVal) {
if (newVal === '') { if (newVal === '') {
this.currentPage = 1 this.currentPage = 1
localStorage.setItem('lastPage', this.currentPage) localStorage.setItem('lastPage', this.currentPage)
this.interviewPage() this.interviewPage()
} }
}, },
}, },
created() { created() {
//获取问题类型的枚举 //获取问题类型的枚举
this.getQuestionType() this.getQuestionType()
//获取问题类型的枚举 //获取问题类型的枚举
this.getAllQuestionType() this.getAllQuestionType()
//获取问题列表 //获取问题列表
this.interviewPage() this.interviewPage()
}, },
mounted() { mounted() {},
}, methods: {
methods: { prepareAdd() {
prepareAdd() { this.form.questionName = ''
this.form.questionName = '' this.form.questionType = 0
this.form.questionType = 0 this.dialogFormVisible = true
this.dialogFormVisible = true //获取问题类型的枚举
//获取问题类型的枚举 this.getAllQuestionType()
this.getAllQuestionType() },
}, prepareRandom() {
prepareRandom() { this.randomAlgorithmic = []
this.randomAlgorithmic = [] this.randomFormVisible = true
this.randomFormVisible = true this.interviewRandom()
this.interviewRandom() },
}, prepareMutiAdd() {
prepareMutiAdd() { this.form.questionName = ''
this.form.questionName = '' this.form.questionType = 0
this.form.questionType = 0 this.dialogMutiFormVisible = true
this.dialogMutiFormVisible = true },
},
prepareDelete(id) { prepareDelete(id) {
this.currentRowId = id this.currentRowId = id
this.dialogVisible = true this.dialogVisible = true
}, },
preEdit(id, questionName, questionTypeName, degreeOfImportance, degreeOfDifficulty, difficultyOfScore, leetcodeNumber, leetcodeLink) { preEdit(id, questionName, questionTypeName, degreeOfImportance, degreeOfDifficulty, difficultyOfScore, leetcodeNumber, leetcodeLink) {
this.form.questionName = questionName this.form.questionName = questionName
this.form.degreeOfImportance = degreeOfImportance this.form.degreeOfImportance = degreeOfImportance
this.form.degreeOfDifficulty = degreeOfDifficulty this.form.degreeOfDifficulty = degreeOfDifficulty
this.form.difficultyOfScore = difficultyOfScore this.form.difficultyOfScore = difficultyOfScore
this.form.leetcodeNumber = leetcodeNumber this.form.leetcodeNumber = leetcodeNumber
this.form.leetcodeLink = leetcodeLink this.form.leetcodeLink = leetcodeLink
// 定义一个映射(map)来存储 questionType 到 name 的转换 // 定义一个映射(map)来存储 questionType 到 name 的转换
const questionTypeToNameMap = {} const questionTypeToNameMap = {}
this.options.forEach((option) => { this.options.forEach((option) => {
questionTypeToNameMap[option.name] = option.questionType questionTypeToNameMap[option.name] = option.questionType
}) })
this.form.questionType = questionTypeToNameMap[questionTypeName] this.form.questionType = questionTypeToNameMap[questionTypeName]
this.currentRowId = id this.currentRowId = id
this.editVisible = true this.editVisible = true
}, },
handleClose(done) { handleClose(done) {
this.$confirm('确认关闭?') this.$confirm('确认关闭?')
.then((_) => { .then((_) => {
done() done()
}) })
.catch((_) => {}) .catch((_) => {})
}, },
handleConfirm(addType) { handleConfirm(addType) {
this.dialogFormVisible = false // 关闭对话框 this.dialogFormVisible = false // 关闭对话框
this.dialogMutiFormVisible = false this.dialogMutiFormVisible = false
this.addQuestion(addType) // 发送请求 this.addQuestion(addType) // 发送请求
}, },
async addQuestion(addType) { async addQuestion(addType) {
try { try {
this.loading = true this.loading = true
const { data: res } = await axios.post('http://120.79.36.53:8888/algorithmicProblem/add', { const { data: res } = await axios.post('http://120.79.36.53:8888/algorithmicProblem/add', {
addType: addType, addType: addType,
questionName: this.form.questionName, questionName: this.form.questionName,
questionType: this.form.questionType, questionType: this.form.questionType,
degreeOfImportance: this.form.degreeOfImportance, degreeOfImportance: this.form.degreeOfImportance,
degreeOfDifficulty: this.form.degreeOfDifficulty, degreeOfDifficulty: this.form.degreeOfDifficulty,
difficultyOfScore: this.form.difficultyOfScore, difficultyOfScore: this.form.difficultyOfScore,
leetcodeNumber: this.form.leetcodeNumber, leetcodeNumber: this.form.leetcodeNumber,
leetcodeLink: this.form.leetcodeLink, leetcodeLink: this.form.leetcodeLink,
}) })
if (res.code === 200) { if (res.code === 200) {
this.form.questionName = '' this.form.questionName = ''
this.form.questionType = 0 this.form.questionType = 0
this.form.degreeOfImportance = 5 this.form.degreeOfImportance = 5
this.form.degreeOfDifficulty = 1 this.form.degreeOfDifficulty = 1
this.form.difficultyOfScore = 1200 this.form.difficultyOfScore = 1200
this.form.leetcodeNumber = '' this.form.leetcodeNumber = ''
this.form.leetcodeLink = '' this.form.leetcodeLink = ''
this.getQuestionType() this.getQuestionType()
this.interviewPage() this.interviewPage()
} else { } else {
console.error('Received non-200 status code', res) console.error('Received non-200 status code', res)
this.errorMsg(res.message) this.errorMsg(res.message)
} }
} 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://120.79.36.53:8888/algorithmicProblem/update', { const { data: res } = await axios.post('http://120.79.36.53:8888/algorithmicProblem/update', {
id: this.currentRowId, id: this.currentRowId,
questionName: this.form.questionName, questionName: this.form.questionName,
questionType: this.form.questionType, questionType: this.form.questionType,
degreeOfImportance: this.form.degreeOfImportance, degreeOfImportance: this.form.degreeOfImportance,
degreeOfDifficulty: this.form.degreeOfDifficulty, degreeOfDifficulty: this.form.degreeOfDifficulty,
difficultyOfScore: this.form.difficultyOfScore, difficultyOfScore: this.form.difficultyOfScore,
leetcodeNumber: this.form.leetcodeNumber, leetcodeNumber: this.form.leetcodeNumber,
leetcodeLink: this.form.leetcodeLink, leetcodeLink: this.form.leetcodeLink,
}) })
if (res.code === 200) { if (res.code === 200) {
this.form.questionName = '' this.form.questionName = ''
this.form.questionType = 0 this.form.questionType = 0
this.editVisible = false this.editVisible = false
currentRowId: null currentRowId: null
this.getQuestionType() this.getQuestionType()
this.interviewPage() // 确保这个方法是有效的 this.interviewPage() // 确保这个方法是有效的
} 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 onDelete(id) { async onDelete(id) {
this.dialogVisible = false this.dialogVisible = false
this.loading = true this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/delete', { const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/delete', {
params: { params: {
id: id, id: id,
}, },
}) })
this.interviewPage() this.interviewPage()
this.loading = false this.loading = false
}, },
refreshPage() { refreshPage() {
//获取问题类型的枚举 //获取问题类型的枚举
this.getQuestionType() this.getQuestionType()
location.reload() location.reload()
}, },
async getQuestionType() { async getQuestionType() {
const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/questionType', { params: {} }) const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/questionType', { params: {} })
if (res.code === 200) { if (res.code === 200) {
this.options = res.result this.options = res.result
} }
}, },
async getAllQuestionType() { async getAllQuestionType() {
const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/allQuestionType', { params: {} }) const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/allQuestionType', { params: {} })
if (res.code === 200) { if (res.code === 200) {
this.allOptions = res.result this.allOptions = res.result
} }
}, },
async interviewPage() { async interviewPage() {
this.loading = true this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/page', { const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/page', {
params: { params: {
page: this.currentPage, page: this.currentPage,
pageSize: this.pageSize, pageSize: this.pageSize,
questionName: this.formInline.questionName, questionName: this.formInline.questionName,
questionType: this.questionType, questionType: this.questionType,
}, },
}) })
if (res.code === 200) { if (res.code === 200) {
this.total = res.result.totalElements this.total = res.result.totalElements
// 定义一个映射(map)来存储 questionType 到 name 的转换 // 定义一个映射(map)来存储 questionType 到 name 的转换
const questionTypeToNameMap = {} const questionTypeToNameMap = {}
this.options.forEach((option) => { this.options.forEach((option) => {
questionTypeToNameMap[option.questionType] = option.name questionTypeToNameMap[option.questionType] = option.name
}) })
// 修改 algorithmicList 中的每一个元素,将 questionType 转换为 name // 修改 algorithmicList 中的每一个元素,将 questionType 转换为 name
res.result.content.forEach((item) => { res.result.content.forEach((item) => {
item.questionTypeName = questionTypeToNameMap[item.questionType] item.questionTypeName = questionTypeToNameMap[item.questionType]
}) })
this.algorithmicList = res.result.content this.algorithmicList = res.result.content
} }
this.loading = false this.loading = false
}, },
async interviewRandom() { async interviewRandom() {
this.loading = true this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/random', { params: {} }) const { data: res } = await axios.get('http://120.79.36.53:8888/algorithmicProblem/random', { params: {} })
if (res.code === 200) { if (res.code === 200) {
this.randomAlgorithmic.questionName = res.result.questionName this.randomAlgorithmic.questionName = res.result.questionName
this.randomAlgorithmic.leetcodeNumber = res.result.leetcodeNumber this.randomAlgorithmic.leetcodeNumber = res.result.leetcodeNumber
this.randomAlgorithmic.leetcodeLink = res.result.leetcodeLink this.randomAlgorithmic.leetcodeLink = res.result.leetcodeLink
} }
this.loading = false this.loading = false
}, },
getClassForValue(value) { getClassForValue(value) {
if (value === '链表') { if (value === '链表') {
return 'reddish-purple-value' return 'reddish-purple-value'
} else if (value === '数组') { } else if (value === '数组') {
return 'new-orange-value' return 'new-orange-value'
} else if (value === '二叉树') { } else if (value === '二叉树') {
return 'clove-tea-value' return 'clove-tea-value'
} else if (value === '贪心') { } else if (value === '贪心') {
return 'grassy-value' return 'grassy-value'
} else if (value === '动态规划') { } else if (value === '动态规划') {
return 'daylily-value' return 'daylily-value'
} }
// } else if (value === 'Redis') { // } else if (value === 'Redis') {
// return 'balloon-flower-value' // return 'balloon-flower-value'
// } else if (value === '中间件') { // } else if (value === '中间件') {
// return 'pink-value' // return 'pink-value'
// } else if (value === 'Spring') { // } else if (value === 'Spring') {
// return 'purple-value' // return 'purple-value'
// } else if (value === '微服务') { // } else if (value === '微服务') {
// return 'sapphire-blue-value' // return 'sapphire-blue-value'
// } else if (value === '分布式') { // } else if (value === '分布式') {
// return 'green-value' // return 'green-value'
// } else if (value === '项目') { // } else if (value === '项目') {
// return 'black-value' // return 'black-value'
// } else if (value === '算法') { // } else if (value === '算法') {
// return 'rose-hermosa-value' // return 'rose-hermosa-value'
// } else if (value === '反问环节') { // } else if (value === '反问环节') {
// return 'white-dress-value' // return 'white-dress-value'
// } else if (value === '设计模式') { // } else if (value === '设计模式') {
// return 'prunus-gracilis-value' // return 'prunus-gracilis-value'
// } else if (value === '其他') { // } else if (value === '其他') {
// return 'magenta-value' // return 'magenta-value'
else { else {
return 'dark-blue-value' return 'dark-blue-value'
} }
}, },
handleCurrentChange(currentPage) { handleCurrentChange(currentPage) {
this.currentPage = currentPage this.currentPage = currentPage
this.interviewPage() this.interviewPage()
}, },
}, },
} }
</script> </script>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册