Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
罗超
confucius
Commits
587d3386
Commit
587d3386
authored
Jan 26, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
04aec0d4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
102 additions
and
52 deletions
+102
-52
question-form.vue
src/components/question/question-form.vue
+7
-1
question-upload.vue
src/components/question/question-upload.vue
+14
-8
questionlist-form.vue
src/components/question/questionlist-form.vue
+62
-33
question.vue
src/pages/course/question.vue
+14
-5
routes.js
src/router/routes.js
+5
-5
No files found.
src/components/question/question-form.vue
View file @
587d3386
...
...
@@ -273,7 +273,11 @@
default
:
null
},
CourseId
:
{
type
:
String
,
type
:
String
,
//课程编号
default
:
"0"
,
},
BankId
:
{
type
:
String
,
//题库编号
default
:
"0"
,
}
},
...
...
@@ -287,6 +291,7 @@
objOption
:
{
QuestionId
:
0
,
//问题编号
CourseId
:
0
,
//课程编号
BankId
:
0
,
//题库编号
Title
:
""
,
//问题名称
DifficultyType
:
1
,
//难易程度
AnswerParse
:
""
,
//答案解析JSON
...
...
@@ -402,6 +407,7 @@
//初始化表单
initObj
()
{
this
.
objOption
.
CourseId
=
this
.
CourseId
;
this
.
objOption
.
BankId
=
this
.
BankId
;
if
(
this
.
setingObj
&&
this
.
setingObj
.
QuestionId
>
0
)
{
queryQuestionInfo
({
QuestionId
:
this
.
setingObj
.
QuestionId
...
...
src/components/question/question-upload.vue
View file @
587d3386
...
...
@@ -55,12 +55,12 @@
<
template
v-if=
" subItem.QuestionKey=='single'||subItem.QuestionKey=='multiple'|| subItem.QuestionKey=='single-number'"
v-for=
"childItem in subItem.SubAnwser"
>
<template
v-if=
"childItem.Content.indexOf('
<img
')
>
0">
<span>
{{
childItem
.
Name
}}
.
<b
v-html=
"childItem.Content"
></b></span>
</
template
>
<
template
v-else
>
<span>
{{
childItem
.
Name
}}
.
{{
childItem
.
Content
}}
</span>
</
template
>
<template
v-if=
"childItem.Content.indexOf('
<img
')
>
0">
<span>
{{
childItem
.
Name
}}
.
<b
v-html=
"childItem.Content"
></b></span>
</
template
>
<
template
v-else
>
<span>
{{
childItem
.
Name
}}
.
{{
childItem
.
Content
}}
</span>
</
template
>
<br
/>
</template>
</span>
...
...
@@ -142,7 +142,11 @@
default
:
0
//1-模板导入(Excel),2-智能导入(Word)
},
CourseId
:
{
type
:
String
,
type
:
String
,
//课程编号
default
:
"0"
,
},
BankId
:
{
type
:
String
,
//题库编号
default
:
"0"
,
}
},
...
...
@@ -233,6 +237,7 @@
var
fileParams
=
{
Analysis
:
1
,
CourseId
:
this
.
CourseId
,
BankId
:
this
.
BankId
,
Uid
:
this
.
getLocalStorage
().
Id
}
if
(
this
.
importType
==
2
)
{
...
...
@@ -255,7 +260,8 @@
setQuestion
()
{
if
(
this
.
questionData
&&
this
.
questionData
.
length
>
0
)
{
this
.
questionData
.
forEach
(
item
=>
{
item
.
CourseId
=
this
.
CourseId
item
.
CourseId
=
this
.
CourseId
;
item
.
BankId
=
this
.
BankId
;
})
this
.
saveCourseLoading
=
true
;
saveQuestionBeatch
(
this
.
questionData
).
then
(
res
=>
{
...
...
src/components/question/questionlist-form.vue
View file @
587d3386
...
...
@@ -21,7 +21,7 @@
<q-input
@
change=
"research"
clearable
standout=
"bg-primary text-white"
v-model=
"msg.Title"
label=
"关键字"
@
clear=
"research"
maxlength=
"20"
/>
</div>
<div
class=
"col-3"
>
<div
class=
"col-3"
>
<q-select
@
input=
"research"
standout=
"bg-primary text-white"
option-value=
"Id"
option-label=
"Name"
v-model=
"msg.QCategoryId"
:options=
"questionCategoryList"
emit-value
map-options
label=
"分类"
multiple
clearable
/>
...
...
@@ -82,19 +82,19 @@
@
click=
"EditQuestion(props.row)"
/>
<q-btn
flat
size=
"xs"
icon=
"edit"
color=
"negative"
style=
"font-weight:400"
label=
"删除"
@
click=
"setQuestionStatus(props.row)"
></q-btn>
<q-btn
flat
size=
"xs"
icon=
"iconfont icon-shangyi2"
v-if=
"props.row.isShowFirst"
color=
"accent"
title=
"上移"
style=
"font-weight:400;"
label=
""
@
click=
"getUpStatus(props.row,1)"
></q-btn>
<q-btn
flat
size=
"xs"
icon=
"iconfont icon-xiayi"
v-if=
"props.row.isShowLast"
color=
"accent"
title=
"下移"
style=
"font-weight:400;"
label=
""
@
click=
"getUpStatus(props.row,2)"
></q-btn>
<q-btn
flat
size=
"xs"
icon=
"iconfont icon-shangyi2"
v-if=
"props.row.isShowFirst"
color=
"accent"
title=
"上移"
style=
"font-weight:400;"
label=
""
@
click=
"getUpStatus(props.row,1)"
></q-btn>
<q-btn
flat
size=
"xs"
icon=
"iconfont icon-xiayi"
v-if=
"props.row.isShowLast"
color=
"accent"
title=
"下移"
style=
"font-weight:400;"
label=
""
@
click=
"getUpStatus(props.row,2)"
></q-btn>
<q-btn
flat
size=
"xs"
icon=
"iconfont icon-fuzhi"
color=
"accent"
style=
"font-weight:400;"
label=
""
@
click=
"getCopyItem(props.row)"
></q-btn>
</q-td>
</
template
>
</q-table>
<question-form
v-if=
"isShowQuestionForm"
:CourseId=
"msg.CourseId"
:
seting-obj=
"questionObj"
@
close=
"closeQuestion
"
@
success=
"refreshQuestion"
>
<question-form
v-if=
"isShowQuestionForm"
:CourseId=
"msg.CourseId"
:
BankId=
"msg.BankId"
:seting-obj=
"questionObj
"
@
close=
"closeQuestion"
@
success=
"refreshQuestion"
>
</question-form>
<question-upload
v-if=
"isShowImportUpload"
:CourseId=
"msg.CourseId"
:importType=
"importType"
<question-upload
v-if=
"isShowImportUpload"
:CourseId=
"msg.CourseId"
:
BankId=
"msg.BankId"
:
importType=
"importType"
@
close=
"closeQuestion"
@
success=
"refreshQuestion"
>
</question-upload>
</div>
...
...
@@ -107,11 +107,17 @@
deleteQuestion
,
queryDifficultyType
,
queryQuestionCategory
,
setQuestionSort
setQuestionSort
,
CopyQuestion
}
from
'../../api/question/question'
;
import
questionForm
from
'../question/question-form'
;
import
questionUpload
from
'../question/question-upload'
;
export
default
{
props
:
{
queryMsg
:
{
type
:
Object
,
}
},
meta
:
{
title
:
"题库列表"
},
...
...
@@ -122,6 +128,12 @@
data
()
{
return
{
columns
:
[{
name
:
'Number'
,
label
:
'编号'
,
field
:
'Number'
,
align
:
'left'
},
{
name
:
'Title'
,
label
:
'题目'
,
field
:
'Title'
,
...
...
@@ -170,11 +182,12 @@
pageSize
:
12
,
rowsPerPage
:
12
,
CourseId
:
0
,
BankId
:
0
,
Title
:
""
,
PointName
:
""
,
//知识点
QuestionTypeId
:
[],
//题型
DifficultyType
:
[],
//难易程度
QCategoryId
:
[],
//分类
QCategoryId
:
[],
//分类
},
pageCount
:
0
,
questionTypeList
:
[],
//问题类型列表
...
...
@@ -187,8 +200,11 @@
}
},
created
()
{
if
(
this
.
$route
.
query
)
{
this
.
msg
.
CourseId
=
this
.
$route
.
query
.
CourseId
if
(
this
.
queryMsg
.
BankId
)
{
this
.
msg
.
BankId
=
this
.
queryMsg
.
BankId
;
}
if
(
this
.
queryMsg
.
CourseId
)
{
this
.
msg
.
CourseId
=
this
.
queryMsg
.
CourseId
;
}
this
.
getQuestionType
();
this
.
getDifficultyType
();
...
...
@@ -282,16 +298,16 @@
this
.
loading
=
false
;
this
.
data
=
res
.
Data
.
PageData
;
this
.
pageCount
=
res
.
Data
.
PageCount
;
this
.
data
.
forEach
((
x
,
index
)
=>
{
if
(
index
==
0
)
{
x
.
isShowFirst
=
false
}
else
{
x
.
isShowFirst
=
true
this
.
data
.
forEach
((
x
,
index
)
=>
{
if
(
index
==
0
)
{
x
.
isShowFirst
=
false
}
else
{
x
.
isShowFirst
=
true
}
if
(
index
==
this
.
data
.
length
-
1
)
{
x
.
isShowLast
=
false
}
else
{
x
.
isShowLast
=
true
if
(
index
==
this
.
data
.
length
-
1
)
{
x
.
isShowLast
=
false
}
else
{
x
.
isShowLast
=
true
}
})
}).
catch
(()
=>
{
...
...
@@ -321,24 +337,24 @@
this
.
importType
=
0
;
},
//上移
getUpStatus
(
item
,
num
)
{
getUpStatus
(
item
,
num
)
{
var
QuestionId
=
item
.
QuestionId
;
var
index
=
-
1
;
for
(
var
i
=
0
;
i
<
this
.
data
.
length
;
i
++
)
{
if
(
this
.
data
[
i
].
QuestionId
==
QuestionId
)
{
index
=
i
;
for
(
var
i
=
0
;
i
<
this
.
data
.
length
;
i
++
)
{
if
(
this
.
data
[
i
].
QuestionId
==
QuestionId
)
{
index
=
i
;
break
;
}
}
if
(
num
==
1
)
{
//上移
var
targetQId
=
this
.
data
[
index
-
1
].
QuestionId
;
if
(
num
==
1
)
{
//上移
var
targetQId
=
this
.
data
[
index
-
1
].
QuestionId
;
}
if
(
num
==
2
)
{
//下移
var
targetQId
=
this
.
data
[
index
+
1
].
QuestionId
;
if
(
num
==
2
)
{
//下移
var
targetQId
=
this
.
data
[
index
+
1
].
QuestionId
;
}
var
msg
=
{
curQId
:
QuestionId
,
targetQId
:
targetQId
curQId
:
QuestionId
,
targetQId
:
targetQId
}
setQuestionSort
(
msg
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
...
...
@@ -347,8 +363,21 @@
});
},
//复制
getCopyItem
(
item
){
getCopyItem
(
item
)
{
CopyQuestion
({
QuestionId
:
item
.
QuestionId
}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
'复制成功!'
,
position
:
'top'
})
this
.
getQuestionList
();
}
});
}
}
}
...
...
src/pages/course/question.vue
View file @
587d3386
<
template
>
<div>
<questionlist-form></questionlist-form>
<questionlist-form
:queryMsg=
"qMsg"
></questionlist-form>
</div>
</
template
>
<
script
>
import
questionlistForm
from
'../../components/question/questionlist-form'
;
export
default
{
meta
:
{
title
:
"题库列表"
},
...
...
@@ -14,14 +15,22 @@
},
data
()
{
return
{
qMsg
:
{
BankId
:
0
,
CourseId
:
0
}
}
},
created
()
{
if
(
this
.
$route
.
query
&&
this
.
$route
.
query
.
CourseId
)
{
this
.
qMsg
.
CourseId
=
this
.
$route
.
query
.
CourseId
}
if
(
this
.
$route
.
query
&&
this
.
$route
.
query
.
BankId
)
{
this
.
qMsg
.
BankId
=
this
.
$route
.
query
.
BankId
}
},
mounted
()
{
},
methods
:
{
}
mounted
()
{},
methods
:
{}
}
</
script
>
src/router/routes.js
View file @
587d3386
...
...
@@ -451,6 +451,11 @@ const routes = [{
component
:
()
=>
import
(
"pages/course/questionlist.vue"
)
},
{
path
:
"/course/question"
,
//题库列表
component
:
()
=>
import
(
"pages/course/question.vue"
)
},
{
path
:
"/course/courseinfo"
,
component
:
()
=>
import
(
"pages/course/courseinfo.vue"
),
...
...
@@ -464,11 +469,6 @@ const routes = [{
component
:
()
=>
import
(
"pages/course/chapter.vue"
)
},
{
path
:
"/course/question"
,
//课程题库列表
component
:
()
=>
import
(
"pages/course/question.vue"
)
},
{
path
:
"/course/coursejob"
,
//作业管理
component
:
()
=>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment