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
391b7868
Commit
391b7868
authored
Aug 16, 2021
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
26b67eae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
117 additions
and
13 deletions
+117
-13
question.js
src/api/question/question.js
+25
-1
examEdit.vue
src/pages/exam/examEdit.vue
+92
-12
No files found.
src/api/question/question.js
View file @
391b7868
...
...
@@ -266,4 +266,28 @@ export function queryExaminationTemplatePage(data) {
data
})
}
\ No newline at end of file
/**
* 删除分组及问题
* @param {*} data
*/
export
function
DeletePaperGroup
(
data
)
{
return
request
({
url
:
'/Exam/DeletePaperGroup'
,
method
:
'post'
,
data
})
}
/**
* 删除问题
* @param {*} data
*/
export
function
DeletePaperDetails
(
data
)
{
return
request
({
url
:
'/Exam/DeletePaperDetails'
,
method
:
'post'
,
data
})
}
src/pages/exam/examEdit.vue
View file @
391b7868
...
...
@@ -35,7 +35,6 @@
width
:
61%
;
min-height
:
795px
;
background
:
#fff
;
padding
:
0px
20px
0
0px
;
border-radius
:
3px
;
overflow-y
:
auto
;
border
:
1px
solid
#d9d9d9
;
...
...
@@ -115,8 +114,9 @@
}
.List-bt
{
width
:
3
18
px
;
width
:
3
26
px
;
height
:
27px
;
margin-left
:
1px
;
background
:
#fdfdfd
;
font-size
:
14px
;
line-height
:
27px
;
...
...
@@ -139,6 +139,11 @@
color
:
#333
;
}
.checkUl
{
background
:
#a6a6a6
;
color
:
#333
;
}
.List-ul
li
:hover
.exam_ListSHow
{
display
:
block
;
}
...
...
@@ -260,17 +265,18 @@
v-if=
"gIndex!=0"
></i>
<i
class=
"iconfont icon-xiayi"
@
click
.
stop=
"MoveFatherItem(gIndex,1)"
v-if=
"gIndex!=DataObj.GroupList.length-1"
></i>
<i
class=
"iconfont icon-shanchu2"
style=
"margin-left:5px;"
@
click
.
stop=
"removeFather(gItem,gIndex)"
></i>
</div>
<ul
class=
"List-ul"
v-if=
"gItem.DetailsList&&gItem.DetailsList.length>0"
>
<li
class=
""
style=
"cursor:pointer;"
v-for=
"(dItem,dIndex) in gItem.DetailsList"
:key=
"dIndex
"
@
click=
"ClickItem(dItem
)"
>
{{dIndex+1}}
<span
class=
"exam_DetailList"
@
click=
"ClickItem(dItem)"
v-html=
"dItem.ShowTitle"
></span>
<li
class=
""
style=
"cursor:pointer;"
:class=
"{'checkUl':dIndex==ComCheckIndex&&gIndex==ComOneIndex}
"
v-for=
"(dItem,dIndex) in gItem.DetailsList"
:key=
"dIndex"
@
click=
"ClickItem(dItem,gIndex,dIndex
)"
>
{{dIndex+1}}
<span
class=
"exam_DetailList"
v-html=
"dItem.ShowTitle"
></span>
<span
class=
"exam_ListSHow"
>
<i
class=
"iconfont icon-shangyi2"
@
click
.
stop=
"MoveChildItem(gIndex,dIndex,0)"
style=
"margin-right:5px;"
v-if=
"dIndex!=0"
></i>
<i
class=
"iconfont icon-xiayi"
@
click
.
stop=
"MoveChildItem(gIndex,dIndex,1)"
v-if=
"dIndex!=gItem.DetailsList.length-1"
></i>
<i
class=
"iconfont icon-shanchu2"
@
click
.
stop=
"delExam(gItem.DetailsList,dIndex)"
<i
class=
"iconfont icon-shanchu2"
@
click
.
stop=
"delExam(gItem.DetailsList,dI
tem,dI
ndex)"
style=
"margin-left:5px;font-size:17px;"
></i>
</span>
</li>
...
...
@@ -420,7 +426,9 @@
queryQuestionTypeList
,
queryDifficultyType
,
queryQuestionCategory
,
queryQuestionLevelType
queryQuestionLevelType
,
DeletePaperGroup
,
DeletePaperDetails
}
from
'../../api/question/question'
export
default
{
components
:
{
...
...
@@ -442,6 +450,21 @@
meta
:
{
title
:
"考试"
},
watch
:
{
'ChooseItem.Title'
:
{
handler
(
newValue
)
{
this
.
ChooseItem
.
ShowTitle
=
newValue
;
},
immediate
:
true
},
'ChooseItem.Score'
:{
handler
(
newValue
)
{
this
.
ChooseItem
.
Score
=
newValue
;
this
.
calcPaper
();
},
immediate
:
true
}
},
data
()
{
return
{
config
:
{
...
...
@@ -475,7 +498,9 @@
isShowQuestion
:
false
,
commonIndex
:
-
1
,
examNum
:
0
,
//题量
examScore
:
0
//总分
examScore
:
0
,
//总分
ComOneIndex
:
-
1
,
ComCheckIndex
:
-
1
}
},
created
()
{
...
...
@@ -536,8 +561,31 @@
}
},
//删除题目
delExam
(
item
,
index
)
{
item
.
splice
(
index
,
1
);
delExam
(
gitem
,
item
,
index
)
{
if
(
item
.
Id
==
0
){
gitem
.
splice
(
index
,
1
);
}
else
{
this
.
$q
.
dialog
({
title
:
'提示信息'
,
message
:
'是否确定删除'
,
cancel
:
true
,
persistent
:
true
,
ok
:
"确定"
,
cancel
:
"取消"
,
}).
onOk
(()
=>
{
let
msg
=
{
Id
:
item
.
Id
,
}
DeletePaperDetails
(
msg
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
GetPaperInfo
();
}
})
}).
onCancel
(()
=>
{
});
}
this
.
calcPaper
();
},
//点击修改标题名字和分数
getNameEdit
(
item
,
index
)
{
...
...
@@ -587,6 +635,7 @@
var
tempArray
=
[];
tempArray
.
push
(
questionObj
);
this
.
AddQuestion
(
tempArray
);
this
.
calcPaper
();
},
//添加问题
AddQuestion
(
qArray
)
{
...
...
@@ -710,15 +759,18 @@
if
(
x
.
DetailsList
&&
x
.
DetailsList
.
length
>
0
)
{
this
.
examNum
+=
x
.
DetailsList
.
length
;
x
.
DetailsList
.
forEach
(
y
=>
{
this
.
examScore
+=
y
.
Score
;
this
.
examScore
+=
parseInt
(
y
.
Score
)
;
})
}
})
}
},
//点击问题
ClickItem
(
questionItem
)
{
ClickItem
(
questionItem
,
index
,
index2
)
{
this
.
ComOneIndex
=
index
;
this
.
ComCheckIndex
=
index2
;
this
.
ChooseItem
=
questionItem
;
this
.
$forceUpdate
();
},
//保存题目
SavePaper
()
{
...
...
@@ -780,6 +832,34 @@
});
}
this
.
AddQuestion
(
tempArray
);
},
//删除分组及问题
removeFather
(
item
,
index
)
{
if
(
item
.
GId
==
0
)
{
this
.
DataObj
.
GroupList
.
splice
(
index
,
1
);
}
else
{
this
.
$q
.
dialog
({
title
:
'提示信息'
,
message
:
'是否确定删除'
,
cancel
:
true
,
persistent
:
true
,
ok
:
"确定"
,
cancel
:
"取消"
,
}).
onOk
(()
=>
{
let
msg
=
{
GId
:
item
.
GId
,
QuestionTypeId
:
item
.
QuestionTypeId
}
DeletePaperGroup
(
msg
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
GetPaperInfo
();
}
})
}).
onCancel
(()
=>
{
});
}
this
.
calcPaper
();
}
}
}
...
...
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