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
35bd7af6
Commit
35bd7af6
authored
Jan 25, 2021
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
493e6cea
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
9 deletions
+74
-9
App.vue
src/App.vue
+1
-1
question.js
src/api/question/question.js
+11
-0
question.vue
src/pages/course/question.vue
+1
-1
questionlist.vue
src/pages/course/questionlist.vue
+61
-7
No files found.
src/App.vue
View file @
35bd7af6
...
...
@@ -12,7 +12,7 @@ export default {
<
style
>
@import
url('~assets/css/font.css')
;
@import
url('//at.alicdn.com/t/font_2077629_
jx56ujw7s6
.css')
;
@import
url('//at.alicdn.com/t/font_2077629_
ctho1lelfhe
.css')
;
html
,
body
,
...
...
src/api/question/question.js
View file @
35bd7af6
...
...
@@ -144,3 +144,14 @@ export function queryQuestionCategory() {
method
:
'post'
,
})
}
/**
* 题目上移下移
*/
export
function
UpdateQuestionSort
(
data
)
{
return
request
({
url
:
'/Question/UpdateQuestionSort'
,
method
:
'post'
,
})
}
src/pages/course/question.vue
View file @
35bd7af6
...
...
@@ -120,7 +120,7 @@
},
{
name
:
'CategoryName'
,
label
:
'
大
类'
,
label
:
'
分
类'
,
field
:
'CategoryName'
,
align
:
'left'
,
},
...
...
src/pages/course/questionlist.vue
View file @
35bd7af6
<
style
>
.page-content
p
{
margin
:
1
6
px
0
0
0
!important
;
margin
:
1
0
px
0
0
0
!important
;
}
.quetion_Title
{
...
...
@@ -8,7 +8,7 @@
text-overflow
:
ellipsis
;
overflow
:
hidden
;
white-space
:
nowrap
;
width
:
28
0px
;
width
:
40
0px
;
}
...
...
@@ -67,8 +67,10 @@
</div>
</
template
>
<
template
v-slot:body-cell-Title=
"props"
>
<div
v-html=
"props.row.Title"
class=
"quetion_Title"
>
</div>
<td
style=
"width:400px;"
>
<div
v-html=
"props.row.Title"
class=
"quetion_Title"
>
</div>
</td>
</
template
>
<
template
v-slot:bottom
>
<q-pagination
class=
"full-width justify-end"
v-model=
"msg.pageIndex"
color=
"primary"
:max=
"pageCount"
...
...
@@ -78,8 +80,14 @@
<q-td
:props=
"props"
>
<q-btn
flat
size=
"xs"
icon=
"edit"
color=
"accent"
style=
"font-weight:400"
label=
"编辑"
@
click=
"EditQuestion(props.row)"
/>
<q-btn
flat
size=
"xs"
icon=
"edit"
color=
"
accent
"
style=
"font-weight:400"
label=
"删除"
<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;display:none;"
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;display:none;"
label=
""
@
click=
"getUpStatus(props.row,2)"
></q-btn>
<q-btn
flat
size=
"xs"
icon=
"iconfont icon-fuzhi"
color=
"accent"
style=
"font-weight:400;display:none;"
label=
""
@
click=
"getCopyItem(props.row)"
></q-btn>
</q-td>
</
template
>
</q-table>
...
...
@@ -98,7 +106,8 @@
queryQuestionTypeList
,
deleteQuestion
,
queryDifficultyType
,
queryQuestionCategory
queryQuestionCategory
,
UpdateQuestionSort
}
from
'../../api/question/question'
;
import
questionForm
from
'../../components/question/question-form'
;
import
questionUpload
from
'../../components/question/question-upload'
;
...
...
@@ -120,7 +129,7 @@
},
{
name
:
'CategoryName'
,
label
:
'
大
类'
,
label
:
'
分
类'
,
field
:
'CategoryName'
,
align
:
'left'
,
},
...
...
@@ -273,6 +282,18 @@
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
}
if
(
index
==
this
.
data
.
length
-
1
){
x
.
isShowLast
=
false
}
else
{
x
.
isShowLast
=
true
}
})
}).
catch
(()
=>
{
this
.
loading
=
false
})
...
...
@@ -299,6 +320,39 @@
this
.
isShowImportUpload
=
false
;
this
.
importType
=
0
;
},
//上移
getUpStatus
(
item
,
num
){
console
.
log
(
item
,
'数据'
);
var
QuestionId
=
item
.
QuestionId
;
var
index
=
-
1
;
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
==
2
){
//下移
var
targetQId
=
this
.
data
[
index
+
1
].
QuestionId
;
}
console
.
log
(
targetQId
,
'targetQId'
);
var
msg
=
{
curQId
:
QuestionId
,
targetQId
:
targetQId
}
UpdateQuestionSort
(
msg
).
then
(
res
=>
{
console
.
log
(
res
,
'数据'
);
if
(
res
.
Code
==
1
)
{
this
.
getQuestionList
();
}
});
},
//复制
getCopyItem
(
item
){
}
}
}
...
...
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