Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tea-resources-web
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
张伯涛
tea-resources-web
Commits
014bdfd8
Commit
014bdfd8
authored
Mar 30, 2024
by
王飞龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
考试管理添加
parent
5919d194
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
295 additions
and
214 deletions
+295
-214
teaExamExaminationPaper.js
src/api/examination/teaExamExaminationPaper.js
+17
-1
index.vue
src/views/contentManagement/newsInformation/index.vue
+119
-45
questionManagement.vue
...eInformation/examinationManagement/questionManagement.vue
+159
-168
No files found.
src/api/examination/teaExamExaminationPaper.js
View file @
014bdfd8
...
...
@@ -27,6 +27,13 @@ export function getTeaExamExaminationPaper(businessId) {
method
:
'get'
})
}
// 2. 查询试卷表详细信息
export
function
getById
(
businessId
)
{
return
request
({
url
:
'/teaexamexaminationpaper/queryById/'
+
businessId
,
method
:
'get'
})
}
// 3. 新增试卷表
export
function
addTeaExamExaminationPaper
(
data
)
{
...
...
@@ -37,7 +44,16 @@ export function addTeaExamExaminationPaper(data) {
data
:
data
})
}
export
function
upadteBatch
(
data
)
{
return
request
({
url
:
'/teaexamexaminationpaper/upadteBatch'
,
method
:
'put'
,
data
:
data
,
headers
:
{
'Content-Type'
:
'application/json;charset=UTF-8'
// 接口修改传参类型
}
})
}
// 4. 修改试卷表
export
function
updateTeaExamExaminationPaper
(
data
)
{
const
businessId
=
data
.
businessId
...
...
src/views/contentManagement/newsInformation/index.vue
View file @
014bdfd8
...
...
@@ -4,30 +4,38 @@
<div
v-show=
"showSwitch.courseContent"
class=
"courseContent"
>
<div
class=
"search"
style=
"border-bottom: 14px solid #f4f4f4"
>
<el-form
ref=
"queryForm"
style=
"padding: 0 0 0 10px"
:model=
"queryParams"
:inline=
"true"
>
<el-form-item
label=
"标题"
prop=
"title"
>
<el-input
v-model=
"queryParams.title"
placeholder=
"请输入标题"
style=
"margin-right: 15px"
/>
</el-form-item>
<el-form-item
label=
"板块"
prop=
"plate"
>
<el-select
v-model=
"queryParams.plate"
placeholder=
"请选择板块"
>
<el-form-item
label=
""
prop=
"flag"
>
<!-- 发布状态下拉框-->
<el-select
v-model=
"queryParams.flag"
placeholder=
"请选择发布状态"
>
<el-option
v-for=
"item in
plate
Options"
v-for=
"item in
releaseStatus
Options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</el-form-item>
<!--
<el-form-item
label=
"发布日期"
prop=
"releaseDate"
>
-->
<!--
<el-date-picker-->
<!-- v-model="dateRange"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- type="daterange"-->
<!-- range-separator="至"-->
<!-- start-placeholder="开始日期"-->
<!-- end-placeholder="结束日期"-->
<!-- @change="handleChangeTime"-->
<!-- />-->
<!--
</el-form-item>
-->
<!--
<el-form-item
label=
"板块"
prop=
"plate"
>
-->
<!--
<el-select
v-model=
"queryParams.plate"
placeholder=
"请选择板块"
>
-->
<!--
<el-option-->
<!-- v-for="item in plateOptions"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value"-->
<!-- />-->
<!--
</el-select>
-->
<!--
</el-form-item>
-->
<el-form-item
label=
"发布日期"
prop=
"releaseDate"
>
<el-date-picker
v-model=
"dateRange"
value-format=
"yyyy-MM-dd"
type=
"daterange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
@
change=
"handleChangeTime"
/>
</el-form-item>
<el-form-item>
<!-- //查询按钮-->
<el-button
...
...
@@ -55,61 +63,108 @@
:size=
"commonField.smallSize"
@
click=
"handleAdd"
>
{{
commonField
.
addName
}}
</el-button>
<!-- //新增按钮-->
<el-button
:class=
"commonField.addClass"
:type=
"commonField.typePrimary"
:icon=
"commonField.addIcon"
:size=
"commonField.smallSize"
@
click=
"handleExamination"
>
{{
commonField
.
addName
}}
</el-button>
</el-form-item>
</div>
</el-form>
</div><div
style=
"padding:5px 10px"
>
<div
class=
"tableTitle"
>
新闻资讯列表
</div>
<el-table
v-loading=
"fullscreenLoading"
:data=
"tableData"
border
sortable=
"true"
style=
"text-align: left;"
>
<el-table
v-loading=
"fullscreenLoading"
:data=
"tableData"
border
sortable=
"true"
style=
"text-align: left;"
>
<span
slot=
"empty"
>
{{
tableDataTips
}}
</span>
<el-table-column
align=
"left"
prop=
"id"
label=
"序号"
width=
"55px"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
$index
+
1
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"left"
label=
"封面"
prop=
"pictureId"
>
<el-table-column
align=
"left"
prop=
"title"
label=
"新闻标题"
width=
"500"
show-overflow-tooltip
/>
<el-table-column
align=
"left"
prop=
"isForntPage"
label=
"是否为头条新闻"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<div
:id=
"step(scope.$index)"
>
<el-image
:src=
"imagePath+scope.row.path"
:preview-src-list=
"scope.row.srclist"
style=
"width:100%;height:100%;"
@
click=
"handleClickStop(scope.$index)"
@
mouseover=
"justEnter($event)"
@
mouseout=
"justOut($event)"
/>
</div>
<span>
{{
scope
.
row
.
isForntPage
===
1
?
'是'
:
'否'
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"left"
prop=
"isTop"
label=
"是否为置顶新闻"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
isTop
===
1
?
'是'
:
'否'
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"left"
prop=
"isRecommended"
label=
"是否为推荐新闻"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
isRecommended
===
1
?
'是'
:
'否'
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"left"
prop=
"title"
label=
"标题"
width=
"600"
show-overflow-tooltip
/>
<el-table-column
align=
"left"
prop=
"releaseDate"
label=
"发布日期"
show-overflow-tooltip
>
<!-- <el-table-column align="left" label="封面" prop="pictureId">-->
<!-- <template slot-scope="scope">-->
<!-- <div :id="step(scope.$index)">-->
<!-- <el-image :src="imagePath+scope.row.path" :preview-src-list="scope.row.srclist" style="width:100%;height:100%;" @click="handleClickStop(scope.$index)" @mouseover="justEnter($event)" @mouseout="justOut($event)" />-->
<!-- </div>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- 发布状态-->
<el-table-column
align=
"left"
prop=
"releaseStatus"
label=
"发布状态"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
releaseDate
}}
</span>
<span>
{{
scope
.
row
.
flag
===
"1"
?
'已发布'
:
'未发布'
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"left"
label=
"权重"
prop=
"weight"
show-overflow-tooltip
>
<el-table-column
align=
"left"
prop=
"releaseDate"
label=
"发布日期"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
weight
}}
</span>
<span>
{{
scope
.
row
.
releaseDate
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"left"
label=
"板块"
prop=
"plate"
>
<el-table-column
align=
"left"
prop=
"createDate"
label=
"提交时间"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<span>
{{
changPlate
(
scope
.
row
.
plate
)
}}
</span>
<span>
{{
scope
.
row
.
createDate
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"left"
label=
"状态"
prop=
"flag"
>
<el-table-column
align=
"left"
prop=
"createUser"
label=
"提交人"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<el-switch
v-model=
"scope.row.flag"
class=
"switchDisabledStyle"
inactive-value=
"0"
active-value=
"1"
@
click
.
native=
"handleStatusChange(scope.row)"
/>
<span>
{{
scope
.
row
.
nickName
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"操作"
width=
"120"
>
<!-- <el-table-column align="left" label="权重" prop="weight" show-overflow-tooltip>-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ scope.row.weight }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="left" label="板块" prop="plate">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ changPlate (scope.row.plate) }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="left" label="状态" prop="flag">-->
<!-- <template slot-scope="scope">-->
<!-- <el-switch-->
<!-- v-model="scope.row.flag"-->
<!-- class="switchDisabledStyle"-->
<!-- inactive-value="0"-->
<!-- active-value="1"-->
<!-- @click.native="handleStatusChange(scope.row)"-->
<!-- />-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
align=
"center"
label=
"操作"
width=
"150"
>
<
template
slot-scope=
"scope"
>
<el-button
:class=
"commonField.updateClass"
:type=
"commonField.typeParent"
:size=
"commonField.size"
@
click=
"handleView(scope.row)"
>
查看
</el-button>
<el-button
:class=
"commonField.updateClass"
:type=
"commonField.typeParent"
:size=
"commonField.size"
@
click=
"handleUpdate(scope.row)"
>
修改
</el-button>
>
编辑
</el-button>
<el-button
:class=
"commonField.resetPasClass"
:type=
"commonField.typeParent"
...
...
@@ -202,6 +257,17 @@ export default {
value
:
'3'
}
],
// 发布状态
releaseStatusOptions
:
[
{
label
:
'已发布'
,
value
:
'1'
},
{
label
:
'未发布'
,
value
:
'0'
}
],
// 上传提交
uploadList
:
{
...
...
@@ -214,8 +280,7 @@ export default {
queryParams
:
{
page
:
1
,
rows
:
10
,
title
:
''
,
plate
:
''
flag
:
''
},
// pagination
total
:
0
,
...
...
@@ -284,8 +349,7 @@ export default {
this
.
queryParams
=
{
page
:
1
,
rows
:
10
,
title
:
''
,
plate
:
''
flag
:
''
}
this
.
loadData
()
},
...
...
@@ -307,8 +371,8 @@ export default {
const
params
=
{
page
:
_this
.
queryParams
.
page
,
rows
:
_this
.
queryParams
.
rows
,
title
:
_this
.
queryParams
.
title
,
plate
:
_this
.
queryParams
.
plate
,
flag
:
_this
.
queryParams
.
flag
,
//
plate: _this.queryParams.plate,
beginTime
:
_this
.
queryParams
.
beginTime
,
endTime
:
_this
.
queryParams
.
endTime
}
...
...
@@ -352,6 +416,16 @@ export default {
})
})
},
handleExamination
(
data
)
{
console
.
log
(
'data'
,
data
)
this
.
$router
.
push
({
path
:
'/courseInformation/examinationManagement/index'
,
query
:
{
bussinessId
:
'0bfc7e40e2784ea9a7de7c6e6f07d93e'
,
name
:
'测试'
}
})
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
$router
.
push
({
...
...
src/views/courseInformation/examinationManagement/questionManagement.vue
View file @
014bdfd8
...
...
@@ -10,7 +10,7 @@
</el-form-item>
<!-- 状态-->
<el-form-item
label=
"状态"
>
<el-select
v-model=
"queryParams.
title
"
placeholder=
"请选择状态"
clearable
>
<el-select
v-model=
"queryParams.
flag
"
placeholder=
"请选择状态"
clearable
>
<el-option
label=
"未判卷"
value=
"0"
/>
<el-option
label=
"已判卷"
value=
"1"
/>
</el-select>
...
...
@@ -32,19 +32,7 @@
@
click=
"resetQuery"
>
{{
commonField
.
resetName
}}
</el-button>
</el-form-item>
<div
style=
"float: right"
>
<!--
<el-form-item>
-->
<!-- <!– //新增按钮–>-->
<!--
<el-button-->
<!-- :class="commonField.addClass"-->
<!-- :type="commonField.typePrimary"-->
<!-- :icon="commonField.addIcon"-->
<!-- :size="commonField.smallSize"-->
<!-- @click="handleAdd"-->
<!-- >
{{
commonField
.
addName
}}
</el-button>
-->
<!--
</el-form-item>
-->
</div>
<div
style=
"float: right"
/>
</el-form>
</div>
<div
style=
"padding:5px 10px"
>
...
...
@@ -57,7 +45,11 @@
</
template
>
</el-table-column>
<el-table-column
prop=
"answerName"
label=
"填写人"
show-overflow-tooltip
/>
<el-table-column
prop=
"fillingTime"
label=
"填写时间"
/>
<el-table-column
prop=
"fillingTime"
label=
"填写时间"
>
<
template
slot-scope=
"scope"
>
{{
replace
(
scope
.
row
.
fillingTime
)
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"flag"
label=
"状态"
>
<
template
slot-scope=
"scope"
>
{{
statusChange
(
scope
.
row
.
flag
)
}}
...
...
@@ -66,14 +58,14 @@
<!-- 得分-->
<el-table-column
prop=
"score"
label=
"得分"
>
<
template
slot-scope=
"scope"
>
<span
v-if=
"scope.row.flag === '
0
'"
>
{{
scope
.
row
.
score
}}
</span>
<span
v-if=
"scope.row.flag === '
1
'"
>
{{
scope
.
row
.
score
}}
</span>
<span
v-else
>
-
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
width=
"150"
>
<
template
slot-scope=
"scope"
>
<el-button
v-if=
"scope.row.
status
=== '0'"
v-if=
"scope.row.
flag
=== '0'"
:class=
"commonField.updateClass"
:type=
"commonField.typeParent"
:size=
"commonField.size"
...
...
@@ -84,7 +76,7 @@
:class=
"commonField.updateClass"
:type=
"commonField.typeParent"
:size=
"commonField.size"
@
click=
"handle
Update
(scope.row)"
@
click=
"handle
View
(scope.row)"
>
查看
</el-button>
</
template
>
</el-table-column>
...
...
@@ -105,52 +97,55 @@
width=
"55%"
>
<
template
>
<el-form
ref=
"form"
label-width=
"20px
"
>
<
el-form-item
v-for=
"question in questions"
:key=
"question.id"
label=
"
"
>
<el-row>
<el-form
ref=
"form"
:model=
"form"
label-width=
"20px"
:rules=
"rules
"
>
<
div
v-for=
"(item, index) in form"
:key=
"index
"
>
<el-row
class=
"elClass"
>
<el-col
:span=
"24"
>
<div>
{{
question
.
content
}}
</div>
<div>
{{
index
+
1
+
':'
}}{{
item
.
title
}}
</div>
</el-col>
</el-row>
<el-row>
<el-row
class=
"elClass"
>
<el-col
:span=
"24"
>
<div>
填写的答案:
{{
question
.
answer
}}
</div>
<div>
作答:
<span
:style=
"
{ color: item.isRight ? 'green' : 'red'}">
{{
item
.
answer
}}
</span></div>
</el-col>
</el-row>
<el-row>
<el-row
class=
"elClass"
>
<el-col
:span=
"24"
>
<div>
正确答案:
{{
question
.
correct
Answer
}}
</div>
<div>
正确答案:
{{
item
.
standard
Answer
}}
</div>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"2"
>
<div>
得分:
</div>
</el-col>
<el-row
class=
"elClass"
>
<el-col
:span=
"1.5"
style=
"padding-top: 15px"
>
得分:
</el-col>
<el-col
:span=
"22"
>
<!-- 五个单选框-->
<el-radio-group
v-model=
"question.score"
>
<el-radio-button
label=
"0"
></el-radio-button>
<el-radio-button
label=
"1"
></el-radio-button>
<el-radio-button
label=
"2"
></el-radio-button>
<el-radio-button
label=
"3"
></el-radio-button>
<el-radio-button
label=
"4"
></el-radio-button>
</el-radio-group>
<el-form-item
:prop=
"`$
{index}.score`" :rules="[{ required: true, message: '请选择得分', trigger: 'change' }]">
<el-radio-group
v-model=
"item.score"
:disabled=
"item.questionType!==4||!submitIsShow"
>
<el-radio-button
label=
"0"
/>
<el-radio-button
label=
"1"
/>
<el-radio-button
label=
"2"
/>
<el-radio-button
label=
"3"
/>
<el-radio-button
label=
"4"
/>
<el-radio-button
label=
"5"
/>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row
style=
"margin-top: 10px
"
>
<el-col
:span=
"
2
"
>
<el-row
class=
"elClass
"
>
<el-col
:span=
"
1.5"
style=
"padding-top: 15px
"
>
<div>
评价:
</div>
</el-col>
<el-col
:span=
"22"
>
<!-- 评价-->
<el-input
v-model=
"question.comment"
type=
"textarea"
placeholder=
"请输入评价"
/>
<el-form-item
prop=
"remarks"
>
<el-input
v-model=
"item.remarks"
type=
"textarea"
placeholder=
"请输入评价"
:disabled=
"!submitIsShow"
/>
</el-form-item>
</el-col>
</el-row>
</
el-form-item
>
</
div
>
<el-form-item>
<div
style=
"margin-left: 680px;margin-top: 30px"
>
<el-button
@
click=
"
dialogFormVisible = false
"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"addQuestion
"
>
确 定
</el-button>
<el-button
@
click=
"
cancel
"
>
取 消
</el-button>
<el-button
v-if=
"submitIsShow"
type=
"primary"
@
click=
"submit
"
>
确 定
</el-button>
</div>
</el-form-item>
</el-form>
...
...
@@ -161,11 +156,19 @@
<
script
>
import
commonField
from
'@/utils/commonField'
import
{
updateProjectStatus
,
delCmsProject
,
listCmsProject
}
from
'@/api/contentManagement/cmsProject'
import
{
parseTime
}
from
'@/utils'
import
{
listTeaExamExaminationPaper
}
from
'@/api/examination/teaExamExaminationPaper'
import
{
getById
,
listTeaExamExaminationPaper
,
upadteBatch
}
from
'@/api/examination/teaExamExaminationPaper'
export
default
{
name
:
'QuestionManagement'
,
props
:
{
bussinessId
:
{
type
:
String
,
default
:
''
}
},
data
()
{
return
{
imageSrc
:
require
(
'@/assets/image/test.png'
),
...
...
@@ -189,48 +192,14 @@ export default {
// 课程方向
courseDirection
:
[],
formLabelWidth
:
'90px'
,
// 表格
tableData
:
[
{
paperName
:
'财务管理期末考核'
,
studentName
:
'张三'
,
examDate
:
'2024-03-27 06:14 '
,
status
:
'0'
,
score
:
'80'
},
{
paperName
:
'市场营销策略分析'
,
studentName
:
'李四'
,
examDate
:
'2024-03-27 06:14'
,
status
:
'1'
,
score
:
'77'
},
{
paperName
:
'企业战略规划报告'
,
studentName
:
'王五'
,
examDate
:
'2024-03-27 06:14'
,
status
:
'1'
,
score
:
'81'
},
{
paperName
:
'人力资源管理实践'
,
studentName
:
'赵六'
,
examDate
:
'2022-06-18 15:13'
,
status
:
'1'
,
score
:
'80'
},
{
paperName
:
'创业创新实践'
,
studentName
:
'孙七'
,
examDate
:
'2022-06-19 18:00'
,
status
:
'0'
,
score
:
'80'
},
{
paperName
:
'财务管理期末考核'
,
studentName
:
'张三'
,
examDate
:
'2022-06-15 17:40'
,
status
:
'1'
,
score
:
'80'
},
{
paperName
:
'市场营销策略分析'
,
studentName
:
'李四'
,
examDate
:
'2022-06-16 19:14'
,
status
:
'1'
,
score
:
'80'
},
{
paperName
:
'企业战略规划报告'
,
studentName
:
'王五'
,
examDate
:
'2022-06-17 10:13'
,
status
:
'0'
,
score
:
'80'
},
{
paperName
:
'人力资源管理实践'
,
studentName
:
'赵六'
,
examDate
:
'2022-06-18 9:41'
,
status
:
'1'
,
score
:
'80'
},
{
paperName
:
'创业创新实践'
,
studentName
:
'孙七'
,
examDate
:
'2022-06-19 14:13'
,
status
:
'1'
,
score
:
'80'
}
],
questions
:
[
{
id
:
1
,
content
:
'一:计算1+1'
,
answer
:
2
,
correctAnswer
:
2
,
score
:
2
},
{
id
:
2
,
content
:
'二:简述JavaScript的用途'
,
answer
:
'JavaScript用于前端开发'
,
correctAnswer
:
'用于前端开发'
,
score
:
4
},
{
id
:
3
,
content
:
'三:解释什么是RESTful API'
,
answer
:
'RESTful API是一种设计风格'
,
correctAnswer
:
'A'
,
score
:
2
},
{
id
:
4
,
content
:
'四:简述Vue的优点'
,
answer
:
'Vue易学易用'
,
correctAnswer
:
'Vue易学易用'
,
score
:
0
},
{
id
:
5
,
content
:
'五:简述React的优点'
,
answer
:
'C,D'
,
correctAnswer
:
'A,C'
,
score
:
5
},
{
id
:
6
,
content
:
'六:简述Angular的优点'
,
answer
:
'Angular功能强大'
,
correctAnswer
:
2
,
score
:
0
}
],
// 表单验证
rules
:
{
title
:
[
{
required
:
true
,
message
:
'请输入题目编号'
,
trigger
:
'blur'
}
],
type
:
[
{
required
:
true
,
message
:
'请选择题目类型'
,
trigger
:
'change'
}
],
difficulty
:
[
{
required
:
true
,
message
:
'请选择题目难度'
,
trigger
:
'change'
}
],
status
:
[
{
required
:
true
,
message
:
'请选择状态'
,
trigger
:
'change'
}
],
content
:
[
{
required
:
true
,
message
:
'请输入题干'
,
trigger
:
'blur'
}
],
ansewer
:
[
{
required
:
true
,
message
:
'请输入题目答案'
,
trigger
:
'blur'
}
]
},
countScore
:
0
,
// 是否显示确认按钮
submitIsShow
:
true
,
teaexamId
:
''
,
lineindex
:
0
,
teacode
:
''
,
...
...
@@ -255,7 +224,8 @@ export default {
queryParams
:
{
page
:
1
,
rows
:
10
,
title
:
''
answerName
:
''
,
flag
:
''
},
// pagination
total
:
10
,
...
...
@@ -276,6 +246,15 @@ export default {
return
commonField
}
},
watch
:
{
bussinessId
:
{
handler
:
function
(
val
)
{
this
.
courseId
=
val
console
.
log
(
'bussinessId111111111111111111'
,
val
)
},
immediate
:
true
}
},
created
()
{
},
mounted
:
function
()
{
...
...
@@ -290,34 +269,44 @@ export default {
return
'已判卷'
}
},
step
(
index
)
{
return
'step'
+
index
},
updateScore
(
id
,
score
)
{
// 这里可以根据具体需求进行分数的处理,比如保存到数据库或提交到后端
console
.
log
(
`题目
${
id
}
的得分为:
${
score
}
`
)
// 日期格式转换
replace
(
time
)
{
return
parseTime
(
time
,
'{y}/{m}/{d}:{h}:{i}'
)
},
/**
* @description: 点击蒙版关闭预览图片
* @author: gaoyu
* @param: imageId
* @return:
**/
handleClickStop
(
imageId
)
{
this
.
$nextTick
(()
=>
{
var
domImageView
=
document
.
querySelector
(
`#
${
this
.
step
(
imageId
)}
.el-image-viewer__mask`
)
if
(
!
domImageView
)
{
return
submit
()
{
console
.
log
(
'this,form'
,
this
.
form
)
// 表单校验
this
.
$refs
.
form
.
validate
(
valid
=>
{
if
(
valid
)
{
const
result
=
[]
// let countScore = 0
// 遍历给定的对象数组
const
countScore
=
this
.
form
.
reduce
((
total
,
item
)
=>
total
+
Number
(
item
.
score
),
0
)
console
.
log
(
'totalScore'
,
countScore
)
this
.
form
.
forEach
(
item
=>
{
const
{
score
,
remarks
,
questionsId
}
=
item
result
.
push
({
score
,
remarks
,
questionsId
})
// console.log('this.countScore', countScore)
})
// 新增
upadteBatch
({
teaExamExaminationDTOList
:
result
,
businessId
:
this
.
teaexamId
,
countScore
:
countScore
}).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
this
.
$message
({
message
:
'保存成功'
,
type
:
'success'
})
this
.
cancel
()
this
.
loadData
()
}
this
.
countScore
=
0
})
}
else
{
console
.
log
(
'校验失败'
)
}
var
closeButton
=
document
.
querySelector
(
`#
${
this
.
step
(
imageId
)}
.el-image-viewer__close`
)
domImageView
.
addEventListener
(
'click'
,
()
=>
{
closeButton
.
click
()
})
})
},
// 日期格式转换
replace
(
time
)
{
return
parseTime
(
time
,
'{y}/{m}/{d}:{h}:{i}'
)
cancel
()
{
this
.
dialogFormVisible
=
false
},
/** 重置按钮操作 */
...
...
@@ -325,8 +314,9 @@ export default {
this
.
queryParams
=
{
page
:
1
,
rows
:
10
,
title
:
''
,
unit
:
''
answerName
:
''
,
flag
:
''
,
courseId
:
''
}
this
.
loadData
()
},
...
...
@@ -362,7 +352,10 @@ export default {
_this
.
fullscreenLoading
=
true
const
params
=
{
page
:
_this
.
queryParams
.
page
,
rows
:
_this
.
queryParams
.
rows
rows
:
_this
.
queryParams
.
rows
,
answerName
:
_this
.
queryParams
.
answerName
,
flag
:
_this
.
queryParams
.
flag
,
courseId
:
_this
.
courseId
}
listTeaExamExaminationPaper
(
params
).
then
(
res
=>
{
var
pages
=
res
.
rows
// 查询过来的每页数据
...
...
@@ -379,70 +372,60 @@ export default {
}
})
},
// 修改状态
// handleStatusChange(row) {
// const text = row.flag === '1' ? '启用' : '停用'
// const params = {
// businessId: row.businessId,
// flag: row.flag
// }
// this.$confirm('是否确认操作?', '警告', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning'
// }).then(function() {
// return updateProjectStatus(params)
// }).then(() => {
// this.$message({
// message: text + '成功',
// type: 'success'
// })
// })
// },
/** 新增按钮操作 */
handleAdd
()
{
this
.
dialogFormVisible
=
true
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
console
.
log
(
'row'
,
row
)
this
.
teaexamId
=
row
.
businessId
if
(
row
.
flag
===
'1'
)
{
this
.
submitIsShow
=
false
}
else
{
this
.
submitIsShow
=
true
}
console
.
log
(
this
.
submitIsShow
)
// 查询详情
getById
(
row
.
businessId
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
res
.
data
.
forEach
(
item
=>
{
if
(
item
.
questionType
===
4
)
{
item
.
score
=
''
}
else
if
(
item
.
answer
===
item
.
standardAnswer
)
{
item
.
score
=
item
.
mark
item
.
isRight
=
true
}
else
{
item
.
score
=
0
item
.
isRight
=
false
}
})
this
.
form
=
res
.
data
console
.
log
(
'this.form'
,
this
.
form
)
}
})
this
.
dialogFormVisible
=
true
this
.
form
=
row
// console.log('我是修改')
// this.$router.push({
// path: '/contentManagement/centralCase/info/index',
// query: {
// isOperation: '2',
// bussinessId: row.businessId
// }
// })
},
// search
removeCourse
(
row
)
{
const
id
=
row
.
businessId
this
.
$confirm
(
'是否确认操作?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
// 查看方法
handleView
(
row
)
{
this
.
dialogFormVisible
=
true
this
.
submitIsShow
=
false
this
.
teaexamId
=
row
.
businessId
// 查询详情
getById
(
row
.
businessId
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
res
.
data
.
forEach
(
item
=>
{
if
(
item
.
answer
===
item
.
standardAnswer
)
{
item
.
isRight
=
true
}
else
{
item
.
isRight
=
false
}
})
this
.
form
=
res
.
data
}
})
// .then(function() {
// return delCmsProject(id)
// }).then(() => {
// this.loadData()
// this.$message({
// message: '删除成功',
// type: 'success'
// })
// }).catch(function() {
// })
},
// 封面图片预览
justEnter
(
event
)
{
// });
},
justOut
(
event
)
{
// $("#pic").remove();
}
}
}
</
script
>
...
...
@@ -463,6 +446,7 @@ export default {
margin
:
10px
0
10px
0
;
text-align
:
left
!
important
;
}
}
.selectClass
{
width
:
100%
;
...
...
@@ -489,7 +473,14 @@ input::-webkit-outer-spin-button,
input
::-
webkit-inner-spin-button
{
-webkit-appearance
:
none
!
important
;
margin
:
0
;
}
::v-deep
.elClass
{
margin
:
10px
20px
10px
20px
;
}
::v-deep
.el-radio-button__orig-radio
:disabled:checked
+
.el-radio-button__inner
{
background-color
:
#C5FBB7
;
}
</
style
>
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