Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Kwan的解忧杂货铺@新空间代码工作室
vue-kwan-admin
提交
87a83646
V
vue-kwan-admin
项目概览
Kwan的解忧杂货铺@新空间代码工作室
/
vue-kwan-admin
通知
38
Star
6
Fork
3
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-kwan-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
87a83646
编写于
10月 17, 2023
作者:
Kwan的解忧杂货铺@新空间代码工作室
🐭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
整理
上级
57cce4a8
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
699 addition
and
692 deletion
+699
-692
src/components/menus/MyAlgorithmic.vue
src/components/menus/MyAlgorithmic.vue
+375
-373
src/components/menus/MyAphorismPoetry.vue
src/components/menus/MyAphorismPoetry.vue
+8
-5
src/components/menus/MyInterview.vue
src/components/menus/MyInterview.vue
+316
-314
未找到文件。
src/components/menus/MyAlgorithmic.vue
浏览文件 @
87a83646
此差异已折叠。
点击以展开。
src/components/menus/MyAphorismPoetry.vue
浏览文件 @
87a83646
...
...
@@ -144,11 +144,12 @@ export default {
this
.
interviewPage
()
},
mounted
()
{
// 在页面加载时从localStorage中获取currentPage的值
const
storedPage
=
localStorage
.
getItem
(
'
poetryLastPage
'
)
if
(
storedPage
)
{
this
.
currentPage
=
parseInt
(
storedPage
)
}
this
.
currentPage
=
1
// // 在页面加载时从localStorage中获取currentPage的值
// const storedPage = localStorage.getItem('poetryLastPage')
// if (storedPage) {
// this.currentPage = parseInt(storedPage)
// }
},
methods
:
{
prepareAdd
()
{
...
...
@@ -203,6 +204,8 @@ export default {
})
if
(
res
.
code
===
200
)
{
this
.
form
.
poetryText
=
''
this
.
currentPage
=
1
this
.
interviewPage
()
}
else
{
console
.
error
(
'
Received non-200 status code
'
,
res
)
this
.
errorMsg
(
res
.
message
)
...
...
src/components/menus/MyInterview.vue
浏览文件 @
87a83646
...
...
@@ -105,330 +105,332 @@
<
script
>
import
axios
from
'
axios
'
export
default
{
name
:
'
MyInterview
'
,
name
:
'
MyInterview
'
,
data
()
{
return
{
// 用户列表数据
userlist
:
[],
loading
:
false
,
elementui_page_component_key
:
0
,
currentPage
:
Number
(
localStorage
.
getItem
(
'
interviewLastPage
'
))
||
1
,
pageSize
:
9
,
total
:
0
,
formInline
:
{
question
:
''
,
},
options
:
[],
questionType
:
0
,
// 新增的内容
dialogFormVisible
:
false
,
dialogMutiFormVisible
:
false
,
form
:
{
question
:
''
,
questionType
:
0
,
},
formLabelWidth
:
'
120px
'
,
dialogVisible
:
false
,
editVisible
:
false
,
currentRowId
:
null
,
colorMap
:
{},
// 创建一个空的颜色映射关系对象
}
},
watch
:
{
'
formInline.question
'
(
newVal
)
{
if
(
newVal
===
''
)
{
this
.
currentPage
=
1
localStorage
.
setItem
(
'
interviewLastPage
'
,
this
.
currentPage
)
this
.
getQuestionType
()
}
},
// 监听currentPage的变化,将新值保存到localStorage中
currentPage
(
newPage
)
{
localStorage
.
setItem
(
'
interviewLastPage
'
,
newPage
.
toString
())
},
},
created
()
{
//获取问题列表
this
.
getQuestionType
()
},
mounted
()
{
// 在页面加载时从localStorage中获取currentPage的值
const
storedPage
=
localStorage
.
getItem
(
'
interviewLastPage
'
)
if
(
storedPage
)
{
this
.
currentPage
=
parseInt
(
storedPage
)
}
},
methods
:
{
prepareAdd
()
{
this
.
form
.
question
=
''
this
.
form
.
questionType
=
0
this
.
dialogFormVisible
=
true
},
prepareMutiAdd
()
{
this
.
form
.
question
=
''
this
.
form
.
questionType
=
0
this
.
dialogMutiFormVisible
=
true
},
data
()
{
return
{
// 用户列表数据
userlist
:
[],
loading
:
false
,
elementui_page_component_key
:
0
,
currentPage
:
Number
(
localStorage
.
getItem
(
'
interviewLastPage
'
))
||
1
,
pageSize
:
9
,
total
:
0
,
formInline
:
{
question
:
''
,
},
options
:
[],
questionType
:
0
,
// 新增的内容
dialogFormVisible
:
false
,
dialogMutiFormVisible
:
false
,
form
:
{
question
:
''
,
questionType
:
0
,
},
formLabelWidth
:
'
120px
'
,
dialogVisible
:
false
,
editVisible
:
false
,
currentRowId
:
null
,
colorMap
:
{},
// 创建一个空的颜色映射关系对象
}
},
watch
:
{
'
formInline.question
'
(
newVal
)
{
if
(
newVal
===
''
)
{
this
.
currentPage
=
1
localStorage
.
setItem
(
'
interviewLastPage
'
,
this
.
currentPage
)
this
.
getQuestionType
()
}
},
// 监听currentPage的变化,将新值保存到localStorage中
currentPage
(
newPage
)
{
localStorage
.
setItem
(
'
interviewLastPage
'
,
newPage
.
toString
())
},
},
created
()
{
//获取问题列表
this
.
getQuestionType
()
},
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
.
dialogFormVisible
=
true
},
prepareMutiAdd
()
{
this
.
form
.
question
=
''
this
.
form
.
questionType
=
0
this
.
dialogMutiFormVisible
=
true
},
prepareDelete
(
id
)
{
this
.
currentRowId
=
id
this
.
dialogVisible
=
true
},
preEdit
(
id
,
question
,
questionTypeName
)
{
this
.
form
.
question
=
question
prepareDelete
(
id
)
{
this
.
currentRowId
=
id
this
.
dialogVisible
=
true
},
preEdit
(
id
,
question
,
questionTypeName
)
{
this
.
form
.
question
=
question
// 定义一个映射(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
async
addQuestion
(
addType
)
{
try
{
this
.
loading
=
true
const
{
data
:
res
}
=
await
axios
.
post
(
'
http://120.79.36.53:8888/interviewQuestion/add
'
,
{
addType
:
addType
,
question
:
this
.
form
.
question
,
questionType
:
this
.
form
.
questionType
,
})
if
(
res
.
code
===
200
)
{
this
.
form
.
question
=
''
this
.
form
.
questionType
=
0
this
.
getQuestionType
()
// 确保这个方法是有效的
}
else
{
console
.
error
(
'
Received non-200 status code
'
,
res
)
this
.
errorMsg
(
res
.
message
)
}
}
catch
(
error
)
{
console
.
error
(
'
An error occurred while adding the question:
'
,
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/interviewQuestion/add
'
,
{
addType
:
addType
,
question
:
this
.
form
.
question
,
questionType
:
this
.
form
.
questionType
,
})
if
(
res
.
code
===
200
)
{
this
.
currentPage
=
1
this
.
form
.
question
=
''
this
.
form
.
questionType
=
0
this
.
getQuestionType
()
// 确保这个方法是有效的
}
else
{
console
.
error
(
'
Received non-200 status code
'
,
res
)
this
.
errorMsg
(
res
.
message
)
}
}
catch
(
error
)
{
console
.
error
(
'
An error occurred while adding the question:
'
,
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/interviewQuestion/update
'
,
{
id
:
this
.
currentRowId
,
question
:
this
.
form
.
question
,
questionType
:
this
.
form
.
questionType
,
})
if
(
res
.
code
===
200
)
{
this
.
form
.
question
=
''
this
.
form
.
questionType
=
0
this
.
editVisible
=
false
currentRowId
:
null
this
.
getQuestionType
()
// 确保这个方法是有效的
}
else
{
console
.
error
(
'
Received non-200 status code
'
,
res
)
}
}
catch
(
error
)
{
console
.
error
(
'
An error occurred while adding the question:
'
,
error
)
// 异常处理逻辑
}
finally
{
this
.
loading
=
false
}
},
const
{
data
:
res
}
=
await
axios
.
post
(
'
http://120.79.36.53:8888/interviewQuestion/update
'
,
{
id
:
this
.
currentRowId
,
question
:
this
.
form
.
question
,
questionType
:
this
.
form
.
questionType
,
})
if
(
res
.
code
===
200
)
{
this
.
form
.
question
=
''
this
.
form
.
questionType
=
0
this
.
editVisible
=
false
currentRowId
:
null
this
.
getQuestionType
()
// 确保这个方法是有效的
}
else
{
console
.
error
(
'
Received non-200 status code
'
,
res
)
}
}
catch
(
error
)
{
console
.
error
(
'
An error occurred while adding the question:
'
,
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/interviewQuestion/delete
'
,
{
params
:
{
id
:
id
,
},
})
this
.
getQuestionType
()
this
.
loading
=
false
},
async
onDelete
(
id
)
{
this
.
dialogVisible
=
false
this
.
loading
=
true
const
{
data
:
res
}
=
await
axios
.
get
(
'
http://120.79.36.53:8888/interviewQuestion/delete
'
,
{
params
:
{
id
:
id
,
},
})
this
.
getQuestionType
()
this
.
loading
=
false
},
refreshPage
()
{
//获取问题类型的枚举
this
.
getQuestionType
()
location
.
reload
()
},
refreshPage
()
{
//获取问题类型的枚举
this
.
getQuestionType
()
location
.
reload
()
},
async
getQuestionType
()
{
const
{
data
:
res
}
=
await
axios
.
get
(
'
http://120.79.36.53:8888/interviewQuestion/questionType
'
,
{
params
:
{}
})
if
(
res
.
code
===
200
)
{
this
.
options
=
res
.
result
this
.
interviewPage
()
}
},
async
getQuestionType
()
{
const
{
data
:
res
}
=
await
axios
.
get
(
'
http://120.79.36.53:8888/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://120.79.36.53:8888/interviewQuestion/page
'
,
{
params
:
{
page
:
this
.
currentPage
,
pageSize
:
this
.
pageSize
,
question
:
this
.
formInline
.
question
,
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
})
// 修改 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
()
},
getColorForValue
(
value
)
{
// 检查颜色映射关系中是否已经有该值对应的颜色
if
(
!
this
.
colorMap
[
value
])
{
// 如果没有,随机生成一个颜色并将其关联到该值
this
.
colorMap
[
value
]
=
this
.
getRandomColor
()
}
// 返回值对应的颜色
return
this
.
colorMap
[
value
]
},
getRandomColor
()
{
// 从颜色数组中随机选取一个颜色
const
colorArray
=
[
'
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
'
,
'
darkcyan
'
,
'
darkgoldenrod
'
,
'
darkgray
'
,
'
darkgreen
'
,
'
darkkhaki
'
,
'
darkmagenta
'
,
'
darkolivegreen
'
,
'
darkorange
'
,
'
darkorchid
'
,
'
darkred
'
,
'
darksalmon
'
,
'
darkseagreen
'
,
'
darkslateblue
'
,
'
darkslategray
'
,
'
darkturquoise
'
,
'
darkviolet
'
,
'
deeppink
'
,
'
deepskyblue
'
,
'
dodgerblue
'
,
'
firebrick
'
,
'
forestgreen
'
,
'
fuchsia
'
,
'
gold
'
,
'
greenyellow
'
,
'
hotpink
'
,
'
indianred
'
,
'
lawngreen
'
,
'
lightcoral
'
,
'
lightgreen
'
,
'
lightpink
'
,
'
lightsalmon
'
,
'
lightseagreen
'
,
'
lightskyblue
'
,
'
lightslategray
'
,
'
lightsteelblue
'
,
'
mediumaquamarine
'
,
'
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
)
return
colorArray
[
randomIndex
]
},
},
async
interviewPage
()
{
this
.
loading
=
true
const
{
data
:
res
}
=
await
axios
.
get
(
'
http://120.79.36.53:8888/interviewQuestion/page
'
,
{
params
:
{
page
:
this
.
currentPage
,
pageSize
:
this
.
pageSize
,
question
:
this
.
formInline
.
question
,
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
})
// 修改 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
()
},
getColorForValue
(
value
)
{
// 检查颜色映射关系中是否已经有该值对应的颜色
if
(
!
this
.
colorMap
[
value
])
{
// 如果没有,随机生成一个颜色并将其关联到该值
this
.
colorMap
[
value
]
=
this
.
getRandomColor
()
}
// 返回值对应的颜色
return
this
.
colorMap
[
value
]
},
getRandomColor
()
{
// 从颜色数组中随机选取一个颜色
const
colorArray
=
[
'
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
'
,
'
darkcyan
'
,
'
darkgoldenrod
'
,
'
darkgray
'
,
'
darkgreen
'
,
'
darkkhaki
'
,
'
darkmagenta
'
,
'
darkolivegreen
'
,
'
darkorange
'
,
'
darkorchid
'
,
'
darkred
'
,
'
darksalmon
'
,
'
darkseagreen
'
,
'
darkslateblue
'
,
'
darkslategray
'
,
'
darkturquoise
'
,
'
darkviolet
'
,
'
deeppink
'
,
'
deepskyblue
'
,
'
dodgerblue
'
,
'
firebrick
'
,
'
forestgreen
'
,
'
fuchsia
'
,
'
gold
'
,
'
greenyellow
'
,
'
hotpink
'
,
'
indianred
'
,
'
lawngreen
'
,
'
lightcoral
'
,
'
lightgreen
'
,
'
lightpink
'
,
'
lightsalmon
'
,
'
lightseagreen
'
,
'
lightskyblue
'
,
'
lightslategray
'
,
'
lightsteelblue
'
,
'
mediumaquamarine
'
,
'
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
)
return
colorArray
[
randomIndex
]
},
},
}
</
script
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录