Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sgaqgl-vue
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
李苏
sgaqgl-vue
Commits
6fa5c6f0
Commit
6fa5c6f0
authored
Dec 17, 2022
by
李苏
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
考试相关
parent
b640fd69
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
625 additions
and
23 deletions
+625
-23
examination.js
src/api/train/examination.js
+35
-0
index.vue
src/views/train/ks/index.vue
+6
-2
ckry.vue
src/views/train/paperManagement/ckry.vue
+143
-0
edit.vue
src/views/train/paperManagement/edit.vue
+9
-2
index.vue
src/views/train/paperManagement/index.vue
+30
-3
selector.vue
src/views/train/paperManagement/selector.vue
+298
-0
index.vue
src/views/train/testPaper/index.vue
+103
-15
edit.vue
src/views/train/tsubject/edit.vue
+1
-1
No files found.
src/api/train/examination.js
View file @
6fa5c6f0
...
...
@@ -138,3 +138,38 @@ method: 'post',
data
:
query
||
{}
})
}
/* 选择考试人员 */
export
function
saveKsry
(
query
)
{
return
request
({
url
:
'aqgl/pxgl/pxsj/saveKsry'
,
method
:
'post'
,
data
:
query
||
{}
})
}
// 查看
export
function
queryKsry
(
query
)
{
return
request
({
url
:
'aqgl/pxgl/pxsj/queryKsry'
,
method
:
'post'
,
data
:
query
||
{}
})
}
export
function
delKsry
(
query
)
{
return
request
({
url
:
'aqgl/pxgl/pxsj/delKsry'
,
method
:
'post'
,
data
:
query
||
{}
})
}
//删除
/* 查看考试记录 */
export
function
queryHistory
(
query
)
{
return
request
({
url
:
'aqgl/pxgl/pxsj/queryHistory '
,
method
:
'post'
,
data
:
query
||
{}
})
}
src/views/train/ks/index.vue
View file @
6fa5c6f0
...
...
@@ -28,8 +28,8 @@
<i
class=
"el-icon-warning-outline"
></i>
已过期
</el-button>
<el-button
v-if=
"scope.row.ksbz=='Y'"
style=
"text-align: center;color: #11EE96;width: 100%;"
@
click
.
native
.
prevent=
"
apiDel
(scope.row)"
type=
"text"
size=
"small"
>
<i
class=
"el-icon-circle-check"
></i>
已交
卷
@
click
.
native
.
prevent=
"
cksj
(scope.row)"
type=
"text"
size=
"small"
>
<i
class=
"el-icon-circle-check"
></i>
查看试
卷
</el-button>
</
template
>
</el-table-column>
...
...
@@ -120,6 +120,10 @@
let
id
=
row
.
id
this
.
$router
.
push
({
path
:
'/paper/'
+
id
,
query
:
{
singleItem
:
row
}})
})
},
cksj
(
row
){
let
id
=
row
.
id
this
.
$router
.
push
({
path
:
'/paper/'
+
id
,
query
:
{
singleItem
:
row
}})
},
/* 基础查询*/
query
:
queryKssj
,
...
...
src/views/train/paperManagement/ckry.vue
0 → 100644
View file @
6fa5c6f0
<
template
>
<DefaultDialog
:app=
'app'
>
<div
class=
"min_full"
slot=
'form'
style=
"height: 550px;border: 0px;"
>
<Selector
:app=
'this'
v-if=
'showDialog&&DialogName=="ksry"'
></Selector>
<!-- 按钮操作-->
<el-row
class=
"tool-bar"
>
<!--
<ViewButton
ref=
"view"
:app=
'this'
></ViewButton>
<AddButton
ref=
"add"
:app=
'this'
></AddButton>
<CopyButton
ref=
"copy"
:app=
'this'
></CopyButton>
<EditButton
ref=
"edit"
:app=
'this'
></EditButton>
-->
<el-button
@
click=
"xzry"
size=
'mini'
type=
"primary"
>
选择人员
</el-button>
<!-- 额外按钮-->
<!-- 表头设置 -->
<!-- 权限-->
</el-row>
<!-- 表格-->
<div
class=
"tablePagers"
style=
"height: 380px;"
>
<TablePager
:showPagination=
'false'
@
getData=
'getData'
:ref=
"'TablePager'"
:app=
'this'
:query=
'query'
@
selectItem=
'selectItem'
:delParams=
"'mxid'"
@
getRow=
'getRow'
>
</TablePager>
</div>
</div>
</DefaultDialog>
</
template
>
<
script
>
/* 引入需要的接口*/
import
Selector
from
'./selector'
import
{
queryKsry
,
// doDtlAdd,
// doDtlUpdate,
delKsry
,
saveKsry
}
from
'@/api/train/examination.js'
;
/* edit页面*/
import
DtlEdit
from
'./dtlEdit.vue'
import
{
tableMixin_noapp
}
from
'common'
export
default
{
props
:[
'app'
],
mixins
:
[
tableMixin_noapp
],
name
:
'aqgl.pxglPxsjmx'
,
/* 初始额外赋值*/
async
mounted
()
{
/* 存储试卷数据*/
this
.
sjdata
=
this
.
app
.
singleItem
//试卷的
this
.
queryParams
.
id
=
this
.
app
.
singleItem
.
id
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'TablePager'
].
pageQuery
()
})
},
data
()
{
return
{
typeObj
:{
'M'
:
'多选题'
,
'S'
:
'单选题'
,
'J'
:
'判断题'
,
'F'
:
'填空题'
},
sjdata
:{},
/*需要的额外参数 */
showDialog
:
false
,
DialogName
:
''
,
type
:
''
,
DialogWidth
:
'85%'
,
DialogTitle
:
'导入试题'
,
/* 基础url*/
baseUrl
:
'/aqgl/pxgl/pxsjmx'
,
/* 查询参数*/
queryParams
:
{
info
:
''
},
/* 表格标题对应参数*/
tableTitle
:
[{
prop
:
'userid'
,
label
:
'用户编码'
,
width
:
'120'
},
{
prop
:
'username'
,
label
:
'姓名'
,
width
:
'160'
},
{
prop
:
'bmmc'
,
label
:
'所属部门'
,
width
:
'160'
},
{
prop
:
'phone'
,
label
:
'电话'
,
width
:
'160'
}
]
}
},
methods
:
{
xzry
(){
if
(
this
.
app
.
selectOne
||
this
.
app
.
clickOne
)
{
this
.
DialogTitle
=
'选择考试人员'
this
.
showDialog
=
true
this
.
DialogName
=
'ksry'
}
else
{
this
.
$warning
(
'请选中一行操作'
);
}
},
drst
(){
this
.
showDialog
=
true
},
/* 基础查询*/
query
:
queryKsry
,
/* 基础增*/
// apiAdd: doDtlAdd,
// /* 基础更新*/
// apiUpdate: doDtlUpdate,
// /* 删除操作*/
apiDelete
:
delKsry
,
/* 初始化赋值操作*/
init
()
{
}
},
components
:
{
DtlEdit
,
Selector
}
}
</
script
>
<
style
scoped
>
</
style
>
src/views/train/paperManagement/edit.vue
View file @
6fa5c6f0
...
...
@@ -8,14 +8,20 @@
<el-input
:readonly=
"readonly"
v-model=
"form.name"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"
12
"
>
<el-col
:span=
"
24
"
>
<el-form-item
label=
"培训ID"
ref=
"pxid"
prop=
"pxid"
>
<el-input
:readonly=
"readonly"
v-model=
"form.pxid"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"公司"
ref=
"gsid"
prop=
"gsid"
>
<RelSelect
:readonly=
"readonly"
filterable
style=
"width: 100%;"
clearable
src=
'jcsj/common/bm/queryGs'
:match=
"
{value:'id',label:'bmmc'}" v-model='form.gsid'>
</RelSelect>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"题库"
ref=
"xmid"
prop=
"xmid"
>
<RelSelect
:readonly=
"readonly"
filterable
style=
"width: 100%;"
clearable
src=
'aqgl/pxgl/pxxm/query'
<RelSelect
linkage
:linkParams=
"
{gsid:form.gsid}"
:readonly="readonly" filterable style="width: 100%;" clearable src='aqgl/pxgl/pxxm/query'
:match="{value:'id',label:'name'}" v-model='form.xmid'>
</RelSelect>
</el-form-item>
</el-col>
...
...
@@ -204,6 +210,7 @@
/* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/
form
:
{
gsid
:
''
,
//ID
id
:
''
,
//考试主题
...
...
src/views/train/paperManagement/index.vue
View file @
6fa5c6f0
<
template
>
<div
class=
"min_full"
>
<Dtl
:app=
'this'
v-if=
'showDialog'
></Dtl>
<Dtl
:app=
'this'
v-if=
'showDialog&&DialogName=="zdst"'
></Dtl>
<Ckry
:app=
'this'
v-if=
'showDialog&&DialogName=="ckry"'
></Ckry>
<!-- 查询条件-->
<div
class=
"search"
v-condition
>
<SearchButton
:app=
'app'
></SearchButton>
...
...
@@ -27,7 +29,7 @@
<el-button
@
click=
"fbsj"
size=
'mini'
type=
"primary"
>
发布试卷
</el-button>
<!-- 额外按钮-->
<!-- 表头设置 -->
<el-button
@
click=
"ckzy"
size=
'mini'
type=
"primary"
>
指定人员
</el-button>
<!-- 权限-->
</el-row>
<!-- 表格-->
...
...
@@ -53,6 +55,8 @@
/* edit页面*/
import
Edit
from
'./edit'
import
Dtl
from
'./dtl'
import
Ckry
from
'./ckry'
import
Selector
from
'./selector'
import
{
tableMixin
}
from
'common'
...
...
@@ -81,6 +85,7 @@
/* 表格标题对应参数*/
tableTitle
:
[
{
label
:
"考试主题"
,
prop
:
"name"
,
fieldType
:
"ftString"
,
width
:
300
},
{
label
:
"公司"
,
prop
:
"gsName"
,
fieldType
:
"ftString"
,
width
:
192
},
{
label
:
"培训ID"
,
prop
:
"pxid"
,
fieldType
:
"ftString"
,
width
:
192
},
{
label
:
"题库"
,
prop
:
"xmid"
,
fieldType
:
"ftString"
,
width
:
192
,
transform
:{
url
:
'aqgl/pxgl/pxxm/query'
,
label
:
'name'
,
value
:
'id'
...
...
@@ -118,6 +123,7 @@
if
(
this
.
singleItem
.
xtms
==
'F'
){
this
.
DialogTitle
=
this
.
singleItem
.
name
this
.
showDialog
=
true
this
.
DialogName
=
'zdst'
}
else
{
this
.
$warning
(
'只能选择固定卷进行修改'
);
...
...
@@ -148,6 +154,27 @@
}
},
xzry
(){
if
(
this
.
app
.
selectOne
||
this
.
app
.
clickOne
)
{
this
.
DialogTitle
=
'选择考试人员'
this
.
showDialog
=
true
this
.
DialogName
=
'ksry'
}
else
{
this
.
$warning
(
'请选中一行操作'
);
}
},
/* 查看人员*/
ckzy
(){
if
(
this
.
app
.
selectOne
||
this
.
app
.
clickOne
)
{
this
.
DialogTitle
=
'考试人员'
this
.
showDialog
=
true
this
.
DialogName
=
'ckry'
}
else
{
this
.
$warning
(
'请选中一行操作'
);
}
},
mnks
(){
if
(
this
.
app
.
selectOne
||
this
.
app
.
clickOne
)
{
this
.
$confirm
(
'确定进行考试吗, 是否继续?'
,
'提示'
,
{
...
...
@@ -179,7 +206,7 @@
}
},
components
:
{
Edit
,
Dtl
Edit
,
Dtl
,
Selector
,
Ckry
}
...
...
src/views/train/paperManagement/selector.vue
0 → 100644
View file @
6fa5c6f0
<
template
>
<DefaultDialog
:app=
'app'
>
<div
slot=
'form'
style=
"height:550px;display: flex;"
>
<div
class=
"min_full"
style=
"width: 200px;border-right: 0px;"
>
<TreeBase
:app=
'this'
@
selected=
'selectedTree'
></TreeBase>
</div>
<div
class=
"min_full"
style=
"width: calc(100% - 200px);height: 550px;"
>
<!-- 查询条件-->
<div
class=
"search"
v-condition
>
<SearchButton
@
click
.
native=
'search'
></SearchButton>
<el-row
:gutter=
"20"
class=
"search-row-1"
>
<el-col
:span=
"6"
class=
"search-col"
>
<div
class=
"search-item"
>
<span
class=
"search-span"
>
用户:
</span>
<el-input
v-model=
"queryParams.usercx"
size=
"small"
class=
"search-input"
></el-input>
</div>
</el-col>
<el-col
:span=
"6"
class=
"search-col"
>
<div
class=
"search-item"
>
<span
class=
"search-span"
>
电话:
</span>
<el-input
v-model=
"queryParams.phone"
size=
"small"
class=
"search-input"
></el-input>
</div>
</el-col>
</el-row>
</div>
<!-- 按钮操作-->
<!-- 表格-->
<div
class=
"tablePagers"
style=
'height:450px'
>
<el-table
height=
'415'
v-loading=
"loading"
ref=
"multipleTable"
:data=
"tableData"
@
select=
"selectChange"
@
select-all=
"selectAllChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
>
</el-table-column>
<el-table-column
v-for=
"(item,index) in tableTitle"
:prop=
"item.prop"
:label=
"item.label"
align=
"center"
>
</el-table-column>
</el-table>
<el-row
type=
"flex"
class=
"pageBanner"
style=
"padding-top: 20px;"
justify=
"center"
>
<el-pagination
background
:total=
"total"
:page-size=
"pageSize"
@
size-change=
"pageSizeChange"
@
current-change=
"currentPageChange"
:current-page=
"currentPage"
:page-sizes=
"[10, 20, 30]"
layout=
"total, sizes, prev, pager, next"
>
</el-pagination>
</el-row>
</div>
</div>
</div>
<div
slot=
"reFooter"
class=
"refooter"
>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"save()"
>
确 入
</el-button>
</span>
</div>
</DefaultDialog>
</
template
>
<
script
>
/* 引入需要的接口*/
import
{
QueryUser
,
QueryApptype
,
AddUser
,
DeleteUser
,
UpdateUser
,
QtUser
,
QueryBm
,
Setcanlogin
,
ResetPassword
}
from
"common/src/api/system/dmgSystem.js"
;
import
{
saveKsry
}
from
"@/api/train/examination.js"
/* edit页面*/
import
{
tableMixin_noapp
}
from
'common'
export
default
{
mixins
:
[
tableMixin_noapp
],
props
:[
'app'
],
/* 初始额外赋值*/
async
mounted
()
{
this
.
selectedList
=
this
.
app
.
tabData
},
data
()
{
return
{
id
:
'id'
,
/* 已选人员列表*/
selectedList
:
[
],
pageSize
:
10
,
// 唯一标识符
id
:
"id"
,
loading
:
false
,
total
:
0
,
currentPage
:
1
,
/*需要的额外参数 */
showDialog
:
false
,
DialogName
:
''
,
type
:
''
,
DialogTitle
:
''
,
/* 基础url*/
/* 查询参数*/
queryParams
:
{
bmid
:
''
,
usercx
:
''
,
phone
:
''
},
tableData
:[],
/* 树的标题 */
treeTitle
:
'部门列表'
,
treeDefaultProps
:
{
children
:
'children'
,
label
:
'bmmc'
},
/* 表格标题对应参数*/
tableTitle
:
[{
prop
:
'userid'
,
label
:
'用户编码'
,
width
:
'120'
},
{
prop
:
'username'
,
label
:
'姓名'
,
width
:
'160'
},
{
prop
:
'bmmc'
,
label
:
'所属部门'
,
width
:
'160'
},
{
prop
:
'phone'
,
label
:
'电话'
,
width
:
'160'
}
]
}
},
methods
:
{
search
(
event
){
console
.
log
(
event
)
event
.
stopPropagation
()
this
.
getData
(
this
.
currentPage
,
this
.
pageSize
);
},
getData
(
page
,
pageSize
)
{
this
.
loading
=
true
;
let
params
=
{
pageSize
:
pageSize
,
pageNo
:
page
}
params
=
{...
params
,...
this
.
queryParams
}
QueryUser
(
params
).
then
(
res
=>
{
this
.
loading
=
false
;
this
.
tableData
=
res
.
data
.
records
||
[]
this
.
total
=
res
.
data
.
total
this
.
updateMark
();
})
},
addItem
(
item
)
{
this
.
selectedList
.
push
(
item
);
},
// 移除选中项
removeItem
(
item
)
{
for
(
let
[
index
,
itemTemp
]
of
this
.
selectedList
.
entries
())
{
if
(
itemTemp
[
this
.
id
]
===
item
[
this
.
id
])
{
this
.
removeItemByIndex
(
index
);
break
;
}
}
},
// 根据下标移除选中项
removeItemByIndex
(
index
,
item
)
{
this
.
selectedList
.
splice
(
index
,
1
);
// 若有item,则是点击标签上的关闭按钮,移除选中项
if
(
item
)
{
this
.
$nextTick
(()
=>
{
this
.
$refs
.
multipleTable
.
toggleRowSelection
(
// 此处必须在 tableData 中查找对应的数据,否则 toggleRowSelection 会失效
this
.
tableData
.
find
((
row
)
=>
{
return
row
[
this
.
id
]
===
item
[
this
.
id
];
}),
false
);
});
}
},
selectChange
(
selectedRows
,
row
)
{
// true为选中, 0或false为取消选中
let
selected
=
selectedRows
.
length
&&
selectedRows
.
indexOf
(
row
)
!==
-
1
;
if
(
selected
)
{
this
.
addItem
(
row
);
}
else
{
this
.
removeItem
(
row
);
}
},
// 全选/取消全选
selectAllChange
(
selectedRows
)
{
let
selectedMarkList
=
this
.
selectedList
.
map
((
item
)
=>
item
[
this
.
id
]);
// 当前页选中行的标记列表
let
pageSelectedMarkList
=
Array
.
isArray
(
selectedRows
)
?
selectedRows
.
map
((
item
)
=>
item
[
this
.
id
])
:
[];
this
.
tableData
.
forEach
((
row
)
=>
{
if
(
pageSelectedMarkList
.
includes
(
row
[
this
.
id
]))
{
if
(
!
selectedMarkList
.
includes
(
row
[
this
.
id
]))
{
this
.
addItem
(
row
);
}
}
else
if
(
selectedMarkList
.
includes
(
row
[
this
.
id
]))
{
this
.
removeItem
(
row
);
}
});
},
// 切换每页显示条数
pageSizeChange
(
newPageSize
)
{
this
.
pageSize
=
newPageSize
;
this
.
getData
(
this
.
currentPage
,
this
.
pageSize
);
},
// 切换页码--翻页
currentPageChange
(
newPage
)
{
this
.
currentPage
=
newPage
;
this
.
getData
(
this
.
currentPage
,
this
.
pageSize
);
},
// 更新勾选标记
updateMark
()
{
let
selectedMarkList
=
this
.
selectedList
.
map
((
item
)
=>
item
[
this
.
id
]);
this
.
tableData
.
forEach
((
row
)
=>
{
if
(
selectedMarkList
.
includes
(
row
[
this
.
id
]))
{
// toggleRowSelection 需在$nextTick中使用!
this
.
$nextTick
(()
=>
{
this
.
$refs
.
multipleTable
.
toggleRowSelection
(
row
);
});
}
});
},
/* 跨页*/
selectedTree
(
e
){
this
.
queryParams
.
bmid
=
e
.
id
||
'root'
this
.
getData
(
this
.
currentPage
,
this
.
pageSize
);
},
/* 基础查询*/
query
:
QueryUser
,
/* 基础增*/
apiAdd
:
AddUser
,
/* 基础更新*/
apiUpdate
:
UpdateUser
,
/* 删除操作*/
apiDelete
:
DeleteUser
,
/* treeQuery */
apiTreeQuery
:
QueryBm
,
/* 初始化赋值操作*/
init
()
{
},
save
(){
let
params
=
{
id
:
this
.
app
.
queryParams
.
id
,
datas
:
this
.
selectedList
}
saveKsry
(
params
).
then
(
res
=>
{
if
(
res
.
success
){
this
.
$success
(
'保存成功'
)
this
.
app
.
$refs
[
'TablePager'
].
pageQuery
()
this
.
app
.
showDialog
=
false
}
})
}
},
components
:{
}
}
</
script
>
<
style
scoped
>
</
style
>
src/views/train/testPaper/index.vue
View file @
6fa5c6f0
...
...
@@ -7,7 +7,7 @@
已阅卷
</div>
<div
class=
"df"
>
100
分
{{
df
}}
分
</div>
</div>
<div
class=
"readover"
style=
"color:red;"
v-if=
'paperType=="T"&&paperState=="E"'
>
...
...
@@ -41,6 +41,8 @@
<
div
style
=
"height: 200px;padding-top: 120px;"
>
<
el
-
button
v
-
if
=
"paperState=='B'"
@
click
=
"submit"
size
=
"mini"
type
=
"primary"
style
=
"float: right;width: 100px;"
>
提交
<
/el-button
>
<
el
-
button
v
-
if
=
"paperState=='E'"
@
click
=
"gobac"
size
=
"mini"
type
=
"primary"
style
=
"float: right;width: 100px;"
>
返回
<
/el-button
>
<!--
练习模式按钮
-->
<
el
-
button
v
-
if
=
"paperType=='T'&&paperState=='E'"
@
click
=
"contlx"
size
=
"mini"
type
=
"primary"
style
=
"float: right;width: 100px;margin-left: 60px;"
>
继续练习
<
/el-button
>
...
...
@@ -60,20 +62,27 @@
doDelete
,
pxxmQuery
,
excelimport
,
}
from
'@/api/train/questionManage'
;
import
{
/* 测试*/
donDtlQuery
,
queryKsnr
,
commit
commit
,
queryHistory
}
from
'@/api/train/examination'
;
import
Subject
from
'./subject'
export
default
{
created
()
{
/* 获取本场考试参数*/
this
.
id
=
this
.
$route
.
params
.
id
this
.
singleItem
=
this
.
$route
.
query
.
singleItem
/* */
if
(
!
this
.
id
||
!
this
.
singleItem
)
{
this
.
$error
(
'参数加载失败,请重新选择试卷'
)
...
...
@@ -84,27 +93,104 @@
const
{
username
,
userid
}
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'allUserInfo'
))
this
.
username
=
username
this
.
userid
=
userid
/* 配置考试时间*/
this
.
title
=
this
.
singleItem
.
name
||
'未知试卷'
this
.
startTime
=
this
.
singleItem
.
kssj
this
.
endTime
=
this
.
singleItem
.
jssj
this
.
kssc
=
this
.
singleItem
.
kssc
*
60
*
1000
/* 配置考试类型*/
this
.
paperType
=
'K'
this
.
paperState
=
'B'
/* 获取试题*/
this
.
fullScreen
()
this
.
apiTranswf
()
this
.
title
=
this
.
singleItem
.
name
||
'未知试卷'
/* 判断进入类型*/
if
(
this
.
singleItem
.
ksbz
==
'Y'
){
let
type
=
{
'S'
:
'DXT'
,
'F'
:
'TKT'
,
'J'
:
'PDT'
,
'M'
:
'DXTS'
}
console
.
log
(
'查看试卷模式'
)
this
.
paperType
=
'K'
this
.
paperState
=
'E'
queryHistory
({
mid
:
this
.
singleItem
.
id
}
).
then
(
res
=>
{
if
(
res
.
data
&&
res
.
data
.
records
){
this
.
df
=
res
.
data
.
records
.
ksjl
.
df
let
oList
=
res
.
data
.
records
.
datas
||
[]
this
.
subjectList
=
oList
.
map
(
item
=>
{
let
newobj
=
Object
.
create
({
}
)
newobj
.
desc
=
item
.
desc
||
'该题没有答案解析!'
newobj
.
id
=
item
.
id
newobj
.
ans
=
item
.
ans
newobj
.
value
=
item
.
userAns
// newobj.score = item.score || 2
item
.
type
==
'S'
&&
(
newobj
.
score
=
this
.
singleItem
.
sscore
)
item
.
type
==
'M'
&&
(
newobj
.
score
=
this
.
singleItem
.
mscore
)
item
.
type
==
'J'
&&
(
newobj
.
score
=
this
.
singleItem
.
jscore
)
item
.
type
==
'F'
&&
(
newobj
.
score
=
this
.
singleItem
.
fscore
)
newobj
.
type
=
type
[
item
.
type
]
newobj
.
subject
=
item
.
cont
||
'未设置问题'
newobj
.
options
=
Object
.
create
({
}
)
item
[
'opta'
]
&&
(
newobj
.
options
.
A
=
item
.
opta
)
item
[
'optb'
]
&&
(
newobj
.
options
.
B
=
item
.
optb
)
item
[
'optc'
]
&&
(
newobj
.
options
.
C
=
item
.
optc
)
item
[
'optd'
]
&&
(
newobj
.
options
.
D
=
item
.
optd
)
item
[
'opte'
]
&&
(
newobj
.
options
.
E
=
item
.
opte
)
item
[
'optf'
]
&&
(
newobj
.
options
.
F
=
item
.
optf
)
return
newobj
}
)
/* */
this
.
rightNum
=
0
this
.
subjectList
.
forEach
((
item
,
index
)
=>
{
/* 其他*/
if
(
item
.
type
!=
'TKT'
)
{
if
(
item
.
ans
==
item
.
value
)
{
item
.
result
=
'right'
item
.
resultName
=
'正确'
this
.
rightNum
++
}
else
{
item
.
result
=
'error'
item
.
resultName
=
'错误'
}
}
else
{
let
nans
=
item
.
ans
.
replace
(
/
\s
*/g
,
""
)
let
nvalue
=
item
.
value
.
replace
(
/
\s
*/g
,
""
)
if
(
nans
==
nvalue
)
{
item
.
result
=
'right'
item
.
resultName
=
'正确'
this
.
rightNum
++
}
else
{
item
.
result
=
'error'
item
.
resultName
=
'错误'
}
/* 填空题*/
}
}
)
}
}
)
}
else
{
/* 配置考试时间*/
this
.
startTime
=
this
.
singleItem
.
kssj
this
.
endTime
=
this
.
singleItem
.
jssj
this
.
kssc
=
this
.
singleItem
.
kssc
*
60
*
1000
/* 配置考试类型*/
this
.
paperType
=
'K'
this
.
paperState
=
'B'
/* 获取试题*/
this
.
fullScreen
()
this
.
apiTranswf
()
}
}
,
mounted
()
{
if
(
this
.
paperState
==
'B'
){
this
.
getRemain
()
}
this
.
getRemain
()
/* 获取*/
}
,
components
:
{
Subject
}
,
methods
:
{
commitAll
(){
let
datas
=
this
.
subjectList
.
map
((
item
=>
{
item
.
userAns
=
item
.
value
||
''
...
...
@@ -280,6 +366,7 @@
if
(
this
.
paperType
==
'T'
&&
this
.
paperState
==
'B'
)
{
this
.
paperState
=
'E'
}
else
{
// this.paperState = 'E'
this
.
commitAll
()
}
...
...
@@ -290,6 +377,7 @@
}
,
data
()
{
return
{
df
:
''
,
username
:
''
,
userid
:
''
,
kssc
:
1000
*
60
*
60
,
...
...
src/views/train/tsubject/edit.vue
View file @
6fa5c6f0
...
...
@@ -12,7 +12,7 @@
<el-row
:gutter=
"20"
>
<el-col
:span=
"24"
>
<el-form-item
label=
"公司"
ref=
"gsid"
prop=
"gsid"
>
<RelSelect
style=
"width: 100%;"
:readonly=
"readonly"
src=
'jcsj/common/bm/queryGs'
:match=
"
{value:'id',label:'bmmc'}" v-model='form.
bm
id' >
</RelSelect>
<RelSelect
style=
"width: 100%;"
:readonly=
"readonly"
src=
'jcsj/common/bm/queryGs'
:match=
"
{value:'id',label:'bmmc'}" v-model='form.
gs
id' >
</RelSelect>
</el-form-item>
</el-col>
</el-row>
...
...
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