Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Kwan的解忧杂货铺@新空间代码工作室
vue-kwan-admin
提交
b8328147
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看板
提交
b8328147
编写于
9月 09, 2023
作者:
Kwan的解忧杂货铺@新空间代码工作室
🐭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
面试题优化
上级
ce9577fa
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
112 addition
and
25 deletion
+112
-25
src/components/menus/MyInterview.vue
src/components/menus/MyInterview.vue
+112
-25
未找到文件。
src/components/menus/MyInterview.vue
浏览文件 @
b8328147
...
...
@@ -23,7 +23,7 @@
<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"
style=
"width: 100%"
></el-input>
<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"
>
...
...
@@ -33,13 +33,13 @@
</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=
"in
itCartList
"
></el-input>
<el-input
clearable
v-model=
"formInline.question"
placeholder=
"请输入问题"
@
keydown.enter.native=
"in
terviewPage
"
></el-input>
</el-form-item>
<el-select
v-model=
"questionType"
placeholder=
"请选择"
@
change=
"in
itCartList
"
>
<el-select
v-model=
"questionType"
placeholder=
"请选择"
@
change=
"in
terviewPage
"
>
<el-option
v-for=
"item in options"
:key=
"item.questionType"
:label=
"item.name"
:value=
"item.questionType"
></el-option>
</el-select>
<el-form-item>
<el-button
type=
"primary"
@
click=
"in
itCartList
"
>
查询
</el-button>
<el-button
type=
"primary"
@
click=
"in
terviewPage
"
>
查询
</el-button>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"prepareAdd"
>
新增
</el-button>
...
...
@@ -51,7 +51,14 @@
<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>
-->
<el-table-column
prop=
"questionTypeName"
label=
"问题类型"
show-overflow-tooltip
align=
"center"
>
<template
slot-scope=
"scope"
>
<span
:class=
"getClassForValue(scope.row.questionTypeName)"
v-html=
"scope.row.questionTypeName"
></span>
</
template
>
</el-table-column>
<el-table-column
label=
"创建时间"
width=
"170"
>
<
template
slot-scope=
"props"
>
{{
props
.
row
.
createTime
|
dateFormat
}}
...
...
@@ -63,10 +70,10 @@
<el-dialog
title=
"编辑面试问题"
:visible.sync=
"editVisible"
>
<el-form
:model=
"form"
>
<el-form-item
label=
"面试问题"
:label-width=
"formLabelWidth"
>
<el-input
v-model=
"form.question"
autocomplete=
"off
"
style=
"text-align: left"
></el-input>
<el-input
class=
"custom-textarea"
type=
"textarea"
v-model=
"form.question"
autocomplete=
"off"
:rows=
"5"
:cols=
"30
"
style=
"text-align: left"
></el-input>
</el-form-item>
<el-form-item
label=
"问题类型"
:label-width=
"formLabelWidth"
>
<el-select
v-model=
"form.questionType"
placeholder=
"请选择
活动区域
"
style=
"text-align: left"
>
<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-select>
</el-form-item>
...
...
@@ -132,15 +139,17 @@ export default {
if
(
newVal
===
''
)
{
this
.
currentPage
=
1
localStorage
.
setItem
(
'
lastPage
'
,
this
.
currentPage
)
this
.
in
itCartList
()
this
.
in
terviewPage
()
}
},
},
mounted
()
{},
created
()
{
//获取问题类型的枚举
this
.
getQuestionType
()
this
.
initCartList
()
//获取问题列表
this
.
interviewPage
()
},
mounted
()
{},
methods
:
{
prepareAdd
()
{
this
.
form
.
question
=
''
...
...
@@ -194,7 +203,7 @@ export default {
if
(
res
.
code
===
200
)
{
this
.
form
.
question
=
''
this
.
form
.
questionType
=
0
this
.
in
itCartList
()
// 确保这个方法是有效的
this
.
in
terviewPage
()
// 确保这个方法是有效的
}
else
{
console
.
error
(
'
Received non-200 status code
'
,
res
)
this
.
errorMsg
(
res
.
message
)
...
...
@@ -227,7 +236,7 @@ export default {
this
.
form
.
questionType
=
0
this
.
editVisible
=
false
currentRowId
:
null
this
.
in
itCartList
()
// 确保这个方法是有效的
this
.
in
terviewPage
()
// 确保这个方法是有效的
}
else
{
console
.
error
(
'
Received non-200 status code
'
,
res
)
}
...
...
@@ -247,29 +256,23 @@ export default {
id
:
id
,
},
})
this
.
in
itCartList
()
this
.
in
terviewPage
()
this
.
loading
=
false
},
refreshPage
()
{
//获取问题类型的枚举
this
.
getQuestionType
()
location
.
reload
()
},
gotoDetail
(
id
)
{
this
.
$router
.
push
(
'
/home/chatinfo/
'
+
id
)
},
addChat
()
{
this
.
$router
.
push
(
'
/home/addChat/
'
)
},
async
getQuestionType
()
{
this
.
loading
=
true
const
{
data
:
res
}
=
await
axios
.
get
(
'
http://localhost:8080/interviewQuestion/questionType
'
,
{
params
:
{}
})
if
(
res
.
code
===
200
)
{
this
.
options
=
res
.
result
}
this
.
loading
=
false
},
async
in
itCartList
()
{
async
in
terviewPage
()
{
this
.
loading
=
true
const
{
data
:
res
}
=
await
axios
.
get
(
'
http://localhost:8080/interviewQuestion/page
'
,
{
params
:
{
...
...
@@ -280,7 +283,6 @@ export default {
},
})
if
(
res
.
code
===
200
)
{
this
.
userlist
=
res
.
result
.
content
this
.
total
=
res
.
result
.
totalElements
// 定义一个映射(map)来存储 questionType 到 name 的转换
const
questionTypeToNameMap
=
{}
...
...
@@ -288,15 +290,51 @@ export default {
questionTypeToNameMap
[
option
.
questionType
]
=
option
.
name
})
// 修改 userlist 中的每一个元素,将 questionType 转换为 name
this
.
userlis
t
.
forEach
((
user
)
=>
{
res
.
result
.
conten
t
.
forEach
((
user
)
=>
{
user
.
questionTypeName
=
questionTypeToNameMap
[
user
.
questionType
]
||
'
Unknown
'
})
this
.
userlist
=
res
.
result
.
content
}
this
.
loading
=
false
},
getClassForValue
(
value
)
{
// 根据值返回相应的类名
// 您可以根据需要编写逻辑来决定何时使用相同的类名
// 这里只是一个示例
if
(
value
===
'
基础知识
'
)
{
return
'
reddish-purple-value
'
}
else
if
(
value
===
'
集合
'
)
{
return
'
new-orange-value
'
}
else
if
(
value
===
'
JVM
'
)
{
return
'
clove-tea-value
'
}
else
if
(
value
===
'
并发编程
'
)
{
return
'
grassy-value
'
}
else
if
(
value
===
'
MySql
'
)
{
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
'
magenta-value
'
}
else
{
return
'
dark-blue-value
'
}
},
handleCurrentChange
(
currentPage
)
{
this
.
currentPage
=
currentPage
this
.
in
itCartList
()
this
.
in
terviewPage
()
},
},
}
...
...
@@ -342,6 +380,55 @@ export default {
cursor: pointer;
z-index: 999;
}
.reddish-purple-value {
color: #eb6ea5; /* 相同值的颜色 */
}
.new-orange-value {
color: #59b9c6; /* 相同值的颜色 */
}
.clove-tea-value {
color: #b4866b; /* 不同值的颜色 */
}
.grassy-value {
color: #c3d825; /* 不同值的颜色 */
}
.daylily-value {
color: #f8b862; /* 不同值的颜色 */
}
.balloon-flower-value {
color: #4d5aaf; /* 不同值的颜色 */
}
.pink-value {
color: #f47983; /* 不同值的颜色 */
}
.purple-value {
color: #8d4bbb; /* 不同值的颜色 */
}
.sapphire-blue-value {
color: #4b5cc4; /* 不同值的颜色 */
}
.green-value {
// #7367F0
color: #ce9ffc; /* 不同值的颜色 */
}
.black-value {
color: #000000; /* 不同值的颜色 */
}
.magenta-value {
color: #ff0097; /* 不同值的颜色 */
}
.dark-blue-value {
color: #3eede7; /* 不同值的颜色 */
}
.rose-hermosa-value {
color: #ff6fd8; /* 不同值的颜色 */
}
.custom-textarea {
width: 100%;
text-align: left;
}
.backtop:hover {
background-color: #0050a0;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录