Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-qa
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-qa
Commits
6255941b
提交
6255941b
authored
2月 28, 2022
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改bug
上级
377a5bf5
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
15 行增加
和
79 行删除
+15
-79
List.vue
src/modules/question/views/List.vue
+15
-79
没有找到文件。
src/modules/question/views/List.vue
浏览文件 @
6255941b
...
@@ -2,14 +2,11 @@
...
@@ -2,14 +2,11 @@
<app-card>
<app-card>
<app-list
v-bind=
"tableOptions"
ref=
"list"
@
selection-change=
"handleSelectionChange"
>
<app-list
v-bind=
"tableOptions"
ref=
"list"
@
selection-change=
"handleSelectionChange"
>
<template
v-slot:radio-filter
>
<template
v-slot:radio-filter
>
<el-radio
@
change=
"radioChange"
v-model=
"
radio"
label=
"1"
>
我的题库
</el-radio>
<el-radio
@
change=
"radioChange"
v-model=
"
filterRadio"
:label=
1
>
我的题库
</el-radio>
<el-radio
@
change=
"radioChange"
v-model=
"
radio"
label=
"2"
>
公共题库
</el-radio>
<el-radio
@
change=
"radioChange"
v-model=
"
filterRadio"
:label=
2
>
公共题库
</el-radio>
</
template
>
</
template
>
<
template
v-slot:input-filter
>
<
template
v-slot:input-filter
>
<div
class=
"filter-input"
>
<question-type-cascader
v-model=
"filterInput"
></question-type-cascader>
<el-input
v-model=
"filterInput"
placeholder=
"请选择"
></el-input>
<div
class=
"pop"
@
click=
"dialogVisible = true"
></div>
</div>
</
template
>
</
template
>
<div
class=
"operate-btn"
>
<div
class=
"operate-btn"
>
<el-button
type=
"primary"
icon=
"el-icon-plus"
@
click=
"$router.push({ path: '/question/create' })"
<el-button
type=
"primary"
icon=
"el-icon-plus"
@
click=
"$router.push({ path: '/question/create' })"
...
@@ -23,42 +20,25 @@
...
@@ -23,42 +20,25 @@
<el-button
type=
"text"
@
click=
"handleView(row)"
>
查看详情
</el-button>
<el-button
type=
"text"
@
click=
"handleView(row)"
>
查看详情
</el-button>
<el-button
type=
"text"
@
click=
"handleDelete(row.id)"
>
删除
</el-button>
<el-button
type=
"text"
@
click=
"handleDelete(row.id)"
>
删除
</el-button>
</
template
>
</
template
>
<el-dialog
title=
"提示"
:visible
.
sync=
"dialogVisible"
width=
"30%"
:before-close=
"handleClose"
>
<el-tree
:data=
"treeList"
:props=
"defaultProps"
@
node-click=
"handleNodeClick"
:expand-on-click-node=
"false"
></el-tree>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"handleClose"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"dialogConfirm"
>
确 定
</el-button>
</span>
</el-dialog>
</app-list>
</app-list>
<import-question
:visible
.
sync=
"importDialogVisible"
/>
<import-question
:visible
.
sync=
"importDialogVisible"
/>
</app-card>
</app-card>
</template>
</template>
<
script
>
<
script
>
import
{
getAppList
,
getQuestionCategory
,
deleteQuestion
}
from
'../api'
import
{
getAppList
,
deleteQuestion
}
from
'../api'
import
importQuestion
from
'../components/importQuestion.vue'
import
importQuestion
from
'../components/importQuestion.vue'
import
QuestionTypeCascader
from
'@/components/base/QuestionTypeCascader.vue'
export
default
{
export
default
{
components
:
{
importQuestion
},
components
:
{
importQuestion
,
QuestionTypeCascader
},
data
()
{
data
()
{
return
{
return
{
importDialogVisible
:
false
,
importDialogVisible
:
false
,
// 模板导入弹窗
deleteQuestions
:
[],
deleteQuestions
:
[],
// 批量删除
dialogVisible
:
false
,
treeDialogVisible
:
false
,
// tree弹窗
visible
:
false
,
filterRadio
:
1
,
// 题库筛选
radio
:
'1'
,
filterInput
:
''
,
// tree回显内容
filterInput
:
''
,
defaultProps
:
''
treeList
:
[],
defaultProps
:
''
,
treeValue
:
{
name
:
''
,
id
:
''
}
}
}
},
},
computed
:
{
computed
:
{
...
@@ -120,9 +100,9 @@ export default {
...
@@ -120,9 +100,9 @@ export default {
remote
:
{
remote
:
{
httpRequest
:
getAppList
,
httpRequest
:
getAppList
,
params
:
{
params
:
{
permission
:
this
.
r
adio
,
permission
:
this
.
filterR
adio
,
project_prefix
:
'x1'
,
project_prefix
:
'x1'
,
question_category
:
this
.
treeValue
.
id
question_category
:
this
.
filterInput
},
},
callback
(
data
)
{
callback
(
data
)
{
const
questionType
=
{
const
questionType
=
{
...
@@ -164,7 +144,6 @@ export default {
...
@@ -164,7 +144,6 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{
this
.
getTreeList
()
},
},
methods
:
{
methods
:
{
// 列表选择
// 列表选择
...
@@ -183,36 +162,6 @@ export default {
...
@@ -183,36 +162,6 @@ export default {
this
.
$refs
.
list
.
refetch
()
this
.
$refs
.
list
.
refetch
()
})
})
},
},
// 获取tree列表
getTreeList
()
{
getQuestionCategory
(
'x1'
).
then
(
res
=>
{
if
(
Array
.
isArray
(
res
.
data
))
{
this
.
initTree
(
res
.
data
)
}
})
},
// 过滤数据 变成tree组件需要的数据
initTree
(
data
)
{
this
.
treeList
=
data
.
reduce
((
a
,
b
)
=>
{
b
.
label
=
b
.
category_name
if
(
b
.
children
.
length
)
{
setData
(
b
.
children
)
}
a
.
push
(
b
)
return
a
},
[])
function
setData
(
item
)
{
return
item
.
map
(
element
=>
{
if
(
element
.
children
.
length
)
{
setData
(
element
.
children
)
element
.
label
=
element
.
category_name
}
else
{
element
.
label
=
element
.
category_name
}
return
element
})
}
},
// 创建成功刷新列表
// 创建成功刷新列表
handleCreateSuccess
()
{
handleCreateSuccess
()
{
this
.
$refs
.
list
.
refetch
()
this
.
$refs
.
list
.
refetch
()
...
@@ -221,23 +170,10 @@ export default {
...
@@ -221,23 +170,10 @@ export default {
handleView
(
row
)
{
handleView
(
row
)
{
this
.
$router
.
push
({
path
:
'/question/create'
,
query
:
{
id
:
row
.
id
,
type
:
'view'
}
})
this
.
$router
.
push
({
path
:
'/question/create'
,
query
:
{
id
:
row
.
id
,
type
:
'view'
}
})
},
},
// 编辑
handleSettings
(
row
)
{
handleSettings
(
row
)
{
this
.
$router
.
push
({
path
:
'/question/create'
,
query
:
{
id
:
row
.
id
,
type
:
'edit'
}
})
this
.
$router
.
push
({
path
:
'/question/create'
,
query
:
{
id
:
row
.
id
,
type
:
'edit'
}
})
},
},
handleNodeClick
(
data
)
{
this
.
treeValue
.
name
=
data
.
label
this
.
treeValue
.
id
=
data
.
id
},
handleClose
()
{
this
.
treeValue
.
name
=
''
this
.
treeValue
.
id
=
''
this
.
dialogVisible
=
false
},
dialogConfirm
()
{
this
.
dialogVisible
=
false
this
.
filterInput
=
this
.
treeValue
.
name
this
.
$refs
.
list
.
refetch
()
},
radioChange
()
{
radioChange
()
{
this
.
$refs
.
list
.
refetch
()
this
.
$refs
.
list
.
refetch
()
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论