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
20ef7234
Commit
20ef7234
authored
Nov 28, 2022
by
李苏
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11.28
parent
ef6ad19e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
695 additions
and
11 deletions
+695
-11
scgw.js
src/api/basicData/scgw.js
+19
-0
index.js
src/router/index.js
+28
-3
edit.vue
src/views/basicData/scgw/edit.vue
+10
-1
index.vue
src/views/basicData/scgw/index.vue
+95
-2
index.vue
src/views/dangerManagement/yhtj/index.vue
+5
-5
index.vue
src/views/train/onlinExaminations/index.vue
+138
-0
index.vue
src/views/train/testPaper/index.vue
+244
-0
subject.vue
src/views/train/testPaper/subject.vue
+156
-0
No files found.
src/api/basicData/scgw.js
View file @
20ef7234
...
@@ -73,3 +73,22 @@ export function doImp(query) {
...
@@ -73,3 +73,22 @@ export function doImp(query) {
data
:
query
||
{}
data
:
query
||
{}
})
})
}
}
/* 导出 */
export
function
excelExport
(
query
)
{
return
request
({
responseType
:
"blob"
,
url
:
'aqgl/jcsj/scgw/excel/export'
,
method
:
'post'
,
data
:
query
||
{}
})
}
/* 导入 */
export
function
excelimport
(
query
)
{
return
request
({
'Content-type'
:
'multipart/form-data'
,
url
:
'aqgl/jcsj/scgw/import'
,
method
:
'post'
,
data
:
query
||
{}
})
}
src/router/index.js
View file @
20ef7234
...
@@ -724,8 +724,7 @@ export const powerRoutes=[
...
@@ -724,8 +724,7 @@ export const powerRoutes=[
path
:
"assessment"
path
:
"assessment"
},
},
{
{
commonComponent
:
'trainRecord'
,
component
:
'train/trainRecord/index'
,
component
:()
=>
import
(
"@/views/train/trainRecord/index"
),
hidden
:
false
,
hidden
:
false
,
meta
:{
meta
:{
"title"
:
"培训记录管理"
,
"title"
:
"培训记录管理"
,
...
@@ -736,7 +735,33 @@ export const powerRoutes=[
...
@@ -736,7 +735,33 @@ export const powerRoutes=[
},
},
name
:
'trainRecord'
,
name
:
'trainRecord'
,
path
:
"trainRecord"
path
:
"trainRecord"
}
/*,
},
{
component
:
'train/onlinExaminations/index'
,
hidden
:
false
,
meta
:{
"title"
:
"在线考试管理"
,
"icon"
:
""
,
"noCache"
:
false
,
"link"
:
null
,
"mkid"
:
'test'
,
},
name
:
'onlinExaminations'
,
path
:
"onlinExaminations"
},
{
component
:
'train/testPaper/index'
,
hidden
:
false
,
meta
:{
"title"
:
"考试试卷"
,
"icon"
:
""
,
"noCache"
:
false
,
"link"
:
null
,
"mkid"
:
'test'
,
},
name
:
'testPaper'
,
path
:
"testPaper"
},
/*,
{
{
commonComponent:'questionManage',
commonComponent:'questionManage',
component:() => import( "@/views/train/questionManage/index"),
component:() => import( "@/views/train/questionManage/index"),
...
...
src/views/basicData/scgw/edit.vue
View file @
20ef7234
...
@@ -9,11 +9,19 @@
...
@@ -9,11 +9,19 @@
</el-form-item>
</el-form-item>
</el-col>
</el-col>
</el-row>
</el-row>
<el-row
:gutter=
"20"
>
<el-col
:span=
"24"
>
<el-form-item
label=
"公司"
ref=
"gsid"
prop=
"gsid"
>
<!--
<el-input
:readonly=
"readonly"
v-model=
"form.name"
></el-input>
-->
<RelSelect
:readonly=
"readonly"
filterable
style=
"width: 100%;"
src=
'/jcsj/common/bm/queryGs'
:match=
"
{value:'id',label:'bmmc'}" v-model='form.gsid' >
</RelSelect>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter=
"20"
>
<el-row
:gutter=
"20"
>
<el-col
:span=
"24"
>
<el-col
:span=
"24"
>
<el-form-item
label=
"所属部门"
ref=
"bmid"
prop=
"bmid"
>
<el-form-item
label=
"所属部门"
ref=
"bmid"
prop=
"bmid"
>
<!--
<el-input
:readonly=
"readonly"
v-model=
"form.name"
></el-input>
-->
<!--
<el-input
:readonly=
"readonly"
v-model=
"form.name"
></el-input>
-->
<RelSelect
style=
"width: 100%;"
src=
'kzzx/bm/query
'
:match=
"
{value:'id',label:'bmmc'}" v-model='form.bmid' >
</RelSelect>
<RelSelect
:readonly=
"readonly"
filterable
linkage
:linkParams=
"
{pid:form.gsid}" style="width: 100%;" src='jcsj/common/bm/queryBz
' :match="{value:'id',label:'bmmc'}" v-model='form.bmid' >
</RelSelect>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
</el-row>
</el-row>
...
@@ -63,6 +71,7 @@
...
@@ -63,6 +71,7 @@
/* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/
/* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/
form
:
{
form
:
{
gsid
:
''
,
bmid
:
''
,
bmid
:
''
,
//ID
//ID
id
:
''
,
id
:
''
,
...
...
src/views/basicData/scgw/index.vue
View file @
20ef7234
...
@@ -24,6 +24,8 @@
...
@@ -24,6 +24,8 @@
<FieldButton
:app=
'app'
></FieldButton>
<FieldButton
:app=
'app'
></FieldButton>
<ExcelButton
:app=
'app'
></ExcelButton>
<ExcelButton
:app=
'app'
></ExcelButton>
<el-button
size=
'mini'
@
click
.
native=
"doPerson"
type=
"primary"
>
岗位人员管理
</el-button>
<el-button
size=
'mini'
@
click
.
native=
"doPerson"
type=
"primary"
>
岗位人员管理
</el-button>
<el-button
size=
'mini'
@
click
.
native=
"drexcel"
type=
"primary"
>
导入模板
</el-button>
<el-button
size=
'mini'
@
click
.
native=
"dcexcel"
type=
"primary"
>
导出模板
</el-button>
<!-- 额外按钮-->
<!-- 额外按钮-->
<!-- 表头设置 -->
<!-- 表头设置 -->
...
@@ -47,7 +49,9 @@
...
@@ -47,7 +49,9 @@
doQuery
,
doQuery
,
doAdd
,
doAdd
,
doUpdate
,
doUpdate
,
doDelete
doDelete
,
excelExport
,
excelimport
}
from
'@/api/basicData/scgw.js'
;
}
from
'@/api/basicData/scgw.js'
;
/* edit页面*/
/* edit页面*/
import
Edit
from
'./edit'
import
Edit
from
'./edit'
...
@@ -60,7 +64,7 @@
...
@@ -60,7 +64,7 @@
/* 初始额外赋值*/
/* 初始额外赋值*/
async
mounted
()
{
async
mounted
()
{
this
.
$refs
[
'TablePager'
].
pageQuery
()
this
.
$refs
[
'TablePager'
].
pageQuery
()
},
},
data
()
{
data
()
{
...
@@ -90,6 +94,95 @@
...
@@ -90,6 +94,95 @@
}
}
},
},
methods
:
{
methods
:
{
drexcel
(){
let
that
=
this
let
input
=
document
.
createElement
(
'input'
);
input
.
type
=
'file'
input
.
onchange
=
function
(){
let
file
=
input
.
files
[
0
];
if
(
file
){
let
name
=
file
.
name
let
type
=
file
.
type
let
formData
=
new
FormData
();
formData
.
append
(
'name'
,
name
)
formData
.
append
(
'type'
,
type
)
formData
.
append
(
'file'
,
file
)
excelimport
(
formData
).
then
(
res
=>
{
try
{
document
.
body
.
removeChild
(
input
)}
catch
(
e
){
console
.
log
(
e
)
}
if
(
res
.
success
){
that
.
$success
(
'上传成功'
)
that
.
$refs
.
TablePager
.
pageQuery
()
}
})
}
}
input
.
click
()
},
/* 下载*/
downLoad
(
data
,
title
)
{
let
a
=
document
.
createElement
(
'a'
);
a
.
download
=
title
;
a
.
style
.
display
=
'none'
;
let
blob
=
new
Blob
([
data
],
{
type
:
'application/vnd.ms-excel;charset=UTF-8'
,
});
a
.
href
=
URL
.
createObjectURL
(
blob
);
document
.
body
.
appendChild
(
a
);
a
.
click
();
document
.
body
.
removeChild
(
a
);
},
dcexcel
(){
// var fields = [
// {label: "岗位编码", prop: "code", fieldType: "ftString",width:240},
// {label: "岗位名称", prop: "name", fieldType: "ftString",width:300},
// {label: "所属部门", prop: "bmName", fieldType: "ftString",width:300},
// {label: "负责人编码", prop: "fzrid", fieldType: "ftString",width:192},
// {label: "负责人", prop: "fzrName", fieldType: "ftString",width:192},
// {label: "备注", prop: "bz", fieldType: "ftString",width:300},
// {label: "维护人", prop: "whr", fieldType: "ftString"},
// {label: "维护时间", prop: "whsj", fieldType: "ftDateTime"}
// ]
var
f
=
[]
// fields.forEach((item, index) => {
// let newObj = {
// caption: item.label,
// name: item.prop,
// width: item.width||200
// }
// f[index] = newObj
// })
var
file
=
'岗位模板'
;
var
type
=
".xlsx"
;
var
filename
=
file
.
replace
(
/.*
(\/
|
\\)
/
,
""
);
var
fileExt
=
(
/
[
.
]
/
.
exec
(
filename
))
?
/
[^
.
]
+$/
.
exec
(
filename
.
toLowerCase
())
:
''
;
var
es
=
filename
+
type
;
if
(
fileExt
)
{
switch
(
fileExt
[
0
])
{
case
'xlsx'
:
es
=
filename
;
break
;
case
"xls"
:
es
=
filename
;
break
;
default
:
es
=
filename
+
type
;
break
}
}
var
formData
=
{
condition
:
JSON
.
stringify
(
this
.
queryParams
||
{}),
fileName
:
es
,
fields
:
JSON
.
stringify
(
f
)
};
excelExport
(
formData
).
then
(
e
=>
{
this
.
downLoad
(
e
,
es
)
})
},
doPerson
(){
doPerson
(){
if
(
this
.
app
.
selectOne
||
this
.
app
.
clickOne
)
{
if
(
this
.
app
.
selectOne
||
this
.
app
.
clickOne
)
{
this
.
DialogWidth
=
'70vw'
this
.
DialogWidth
=
'70vw'
...
...
src/views/dangerManagement/yhtj/index.vue
View file @
20ef7234
...
@@ -121,7 +121,7 @@
...
@@ -121,7 +121,7 @@
let
yclCountList
=
[]
let
yclCountList
=
[]
this
.
tabData
.
forEach
(
item
=>
{
this
.
tabData
.
forEach
(
item
=>
{
fxdList
.
push
(
item
.
fxdName
)
fxdList
.
push
(
item
.
fxdName
)
wclCountList
.
push
(
item
.
wclCount
)
wclCountList
.
push
(
item
.
wclCount
+
item
.
yclCount
)
yclCountList
.
push
(
item
.
yclCount
)
yclCountList
.
push
(
item
.
yclCount
)
})
})
...
@@ -155,8 +155,8 @@
...
@@ -155,8 +155,8 @@
type
:
'bar'
,
type
:
'bar'
,
barWidth
:
'20px'
,
barWidth
:
'20px'
,
itemStyle
:
{
itemStyle
:
{
color
:
'#
91cc75
'
,
color
:
'#
f00000
'
,
shadowColor
:
'#
91cc75
'
,
shadowColor
:
'#
f00000
'
,
borderType
:
'dashed'
,
borderType
:
'dashed'
,
}
}
...
@@ -167,8 +167,8 @@
...
@@ -167,8 +167,8 @@
data
:
yclCountList
,
data
:
yclCountList
,
type
:
'bar'
,
type
:
'bar'
,
itemStyle
:
{
itemStyle
:
{
color
:
'#
f00000
'
,
color
:
'#
91cc75
'
,
shadowColor
:
'#
f00000
'
,
shadowColor
:
'#
91cc75
'
,
borderType
:
'dashed'
,
borderType
:
'dashed'
,
},
},
...
...
src/views/train/onlinExaminations/index.vue
0 → 100644
View file @
20ef7234
<
template
>
<div
class=
"examMain"
:title=
"subject"
>
<!-- 试题题目-->
<template
v-if=
"type!='TKT'"
>
<span>
{{
`${index
}
.`
}}
<
/span
>
<
span
>
{{
type
|
typeName
}}
<
/span
>
<
span
>
{{
subject
}}
{{
score
}}
<
/span
>
<
br
>
<
/template
>
<!--
填空题
-->
<
template
v
-
if
=
"type=='TKT'"
>
<
span
>
{{
`${index
}
.`
}}
<
/span
>
<
span
>
{{
'TKT'
|
typeName
}}
<
/span
>
<
span
v
-
html
=
"transTKT(subject,getValue)"
><
/span><span>{{score
}}
</
span
>
<
/template
>
<!--
答案选项
-->
<!--
单选
-->
<
div
v
-
if
=
"type=='DXT'"
class
=
"options"
>
<
div
class
=
"item"
:
key
=
"index"
v
-
for
=
"(item,index) in options"
>
<
el
-
radio
v
-
model
=
"value"
:
label
=
"index"
>
{{
`${index
}
.${item
}
`
}}
<
/el-radio
>
<
/div
>
<
/div
>
<!--
多选
-->
<
div
v
-
if
=
"type=='DXTS'"
class
=
"options"
>
<
div
class
=
"item"
:
key
=
"index"
v
-
for
=
"(item,index) in options"
>
<!--
<
el
-
radio
v
-
model
=
"value"
:
label
=
"index"
>
{{
`${index
}
.${item
}
`
}}
<
/el-radio> --
>
<
el
-
checkbox
-
group
v
-
model
=
"valueList"
>
<
el
-
checkbox
:
label
=
"index"
>
{{
`${index
}
.${item
}
`
}}
<
/el-checkbox
>
<
/el-checkbox-group
>
<
/div
>
<
/div
>
<
/div
>
<
/template
>
<
script
>
export
default
{
mounted
()
{
this
.
type
==
'TKT'
&&
$
(
this
.
$el
).
find
(
'[name=tktinput]'
).
change
(
e
=>
{
this
.
value
=
$
(
this
.
$el
).
find
(
'[name=tktinput]'
).
val
()
||
''
}
)
}
,
props
:{
app
:{
type
:
Object
,
default
:
function
(){
return
{
}
}
}
,
index
:{
default
:
1
}
,
subject
:{
type
:
String
,
default
:
'对于线性表(7,34,55,25,64,46,20,10)进行散列存储时,若选用H(K)=K %9作为散列函数,则散列地址为1的元素有( )个。'
}
,
score
:{
type
:
String
,
default
:
'(2分)'
}
,
type
:{
type
:
String
,
default
:
'DXT'
}
,
options
:{
type
:
Object
,
default
:()
=>
{
return
{
A
:
'1个'
,
B
:
'2个'
,
C
:
'3个'
,
D
:
'4个'
}
}
}
}
,
data
(){
return
{
value
:
''
,
valueList
:[],
}
}
,
methods
:{
transTKT
(
val
,
fn
){
let
template
=
`<input type='text' name='tktinput' class='tktinput'>`
let
nval
=
val
.
replace
(
'( )'
,
template
)
return
nval
}
}
,
filters
:{
typeName
(
val
){
let
typeArry
=
{
'DXT'
:
'(单选题)'
,
'DXTS'
:
'(多选题)'
,
'TKT'
:
'(填空题)'
}
let
nval
=
typeArry
[
val
]
return
nval
||
'其他'
}
}
}
<
/script
>
<
style
lang
=
"scss"
scope
>
input
{
border
:
none
;
outline
:
none
;
}
input
:
focus
{
border
:
none
;
}
.
tktinput
:
focus
{
border
:
0
px
;
border
-
bottom
:
1
px
solid
#
eee
;
}
.
tktinput
{
border
:
0
px
;
border
-
bottom
:
1
px
solid
#
eee
;
}
.
examMain
{
height
:
100
%
;
width
:
100
%
;
font
-
size
:
14
px
;
overflow
:
auto
;
.
options
{
padding
:
10
px
;
width
:
100
%
;
display
:
flex
;
flex
-
wrap
:
wrap
;
.
item
{
width
:
50
%
;
line
-
height
:
20
px
;
}
}
}
<
/style
>
src/views/train/testPaper/index.vue
0 → 100644
View file @
20ef7234
<
template
>
<div
class=
"testpaper"
>
<div
class=
"title"
>
{{
title
}}
<span
style=
"position: absolute;right: 40px;;font-size: 14px;font-weight: 300;"
>
{{
`剩余时间:${parseInt(remaining/(60*1000))
}
分钟${parseInt((remaining%(60*1000))/1000)
}
秒`
}}
<
/span
>
<
/div
>
<
div
class
=
"info"
>
<
div
class
=
"infoItem"
>
<
span
>
姓名
:{{
'周楠楠'
}}
<
/span
>
<
/div
>
<
div
class
=
"infoItem"
>
<
span
>
证件号
:{{
'221718301528'
}}
<
/span
>
<
/div
>
<
div
class
=
"infoItem"
>
<
span
>
开始时间
:{{
$moment
(
startTime
).
format
(
'YYYY-MM-DD HH:mm:ss '
)
}}
<
/span
>
<
/div
>
<
div
class
=
"infoItem"
>
<
span
>
结束时间
:{{
$moment
(
endTime
).
format
(
'YYYY-MM-DD HH:mm:ss '
)
}}
<
/span
>
<
/div
>
<
/div
>
<
Subject
:
app
=
'that'
v
-
for
=
'(item,index) in subjectList'
:
key
=
"index"
:
index
=
'index+1'
:
subject
=
'item.subject'
:
score
=
'item.score'
:
type
=
'item.type'
:
options
=
'item.options'
><
/Subject
>
<
div
style
=
"height: 50px;"
>
<
el
-
button
@
click
=
"submit"
size
=
"mini"
type
=
"primary"
style
=
"float: right;width: 100px;"
>
提交
<
/el-button
>
<
/div
>
<
/div
>
<
/template
>
<
script
>
import
Subject
from
'./subject'
export
default
{
mounted
()
{
this
.
getRemain
()
}
,
components
:{
Subject
}
,
methods
:{
getRemain
(){
let
setNum
=
setTimeout
(()
=>
{
let
time
=
new
Date
().
getTime
()
let
remindTime
=
this
.
endTime
-
time
this
.
remaining
=
remindTime
if
(
this
.
remaining
>
0
){
this
.
getRemain
()
}
}
,
1000
)
}
,
submit
(){
this
.
subjectList
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
value
&&
item
.
value
.
length
>
0
){
}
else
{
this
.
$warning
(
`第${index+1
}
题未作答`
)
throw
new
Error
(
`第${index+1
}
题未作答`
)
}
}
)
/* 提交试卷*/
this
.
$confirm
(
'是否提交试卷, 是否继续?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}
).
then
(()
=>
{
console
.
log
(
this
.
subjectList
)
this
.
$message
({
type
:
'success'
,
message
:
'试卷提交成功!'
}
);
}
).
catch
(()
=>
{
this
.
$message
({
type
:
'info'
,
message
:
'已取消'
}
);
}
);
}
}
,
data
(){
return
{
startTime
:
new
Date
().
getTime
(),
endTime
:
new
Date
().
getTime
()
+
1000
*
120
*
60
,
remaining
:
''
,
title
:
'专八仪表考试测试1128(在线考试)'
,
that
:
this
,
subjectList
:[
{
id
:
'AE89'
,
subject
:
'下列营养物质中在人体不能产生能量的为'
,
score
:
'2'
,
type
:
'DXT'
,
options
:{
A
:
'蔗糖'
,
B
:
'果糖'
,
C
:
'木质素'
,
D
:
'酪蛋白'
}
}
,
{
id
:
'AE891'
,
subject
:
'从业人员在职业活动中,以公平、对等的态度对待领导、同事和顾客等人的行为是()'
,
score
:
'5'
,
type
:
'TKT'
,
options
:{
}
}
,
{
id
:
'AE8914'
,
subject
:
'对于线性表(7,34,55,25,64,46,20,10)进行散列存储时,若选用H(K)=K %9作为散列函数,则散列地址为1的元素有()个。'
,
score
:
'2'
,
type
:
'DXTS'
,
options
:{
A
:
'1个'
,
B
:
'2个'
,
C
:
'3个'
,
D
:
'4个'
,
E
:
'5个'
}
}
,
{
id
:
'AE89'
,
subject
:
'下列营养物质中在人体不能产生能量的为'
,
score
:
'2'
,
type
:
'DXT'
,
options
:{
A
:
'蔗糖'
,
B
:
'果糖'
,
C
:
'木质素'
,
D
:
'酪蛋白'
}
}
,
{
id
:
'AE891'
,
subject
:
'从业人员在职业活动中,以公平、对等的态度对待领导、同事和顾客等人的行为是()'
,
score
:
'5'
,
type
:
'TKT'
,
options
:{
}
}
,
{
id
:
'AE8914'
,
subject
:
'对于线性表(7,34,55,25,64,46,20,10)进行散列存储时,若选用H(K)=K %9作为散列函数,则散列地址为1的元素有()个。'
,
score
:
'2'
,
type
:
'DXTS'
,
options
:{
A
:
'1个'
,
B
:
'2个'
,
C
:
'3个'
,
D
:
'4个'
,
E
:
'5个'
}
}
,
{
id
:
'AE89'
,
subject
:
'下列营养物质中在人体不能产生能量的为'
,
score
:
'2'
,
type
:
'DXT'
,
options
:{
A
:
'蔗糖'
,
B
:
'果糖'
,
C
:
'木质素'
,
D
:
'酪蛋白'
}
}
,
{
id
:
'AE891'
,
subject
:
'众所周知,()是世界上最帅的人。'
,
score
:
'5'
,
type
:
'TKT'
,
options
:{
}
}
,
{
id
:
'AE8914'
,
subject
:
'对于线性表(7,34,55,25,64,46,20,10)进行散列存储时,若选用H(K)=K %9作为散列函数,则散列地址为1的元素有()个。'
,
score
:
'2'
,
type
:
'DXTS'
,
options
:{
A
:
'1个'
,
B
:
'2个'
,
C
:
'3个'
,
D
:
'4个'
,
E
:
'5个'
}
}
,
{
id
:
'AE89'
,
subject
:
'下列营养物质中在人体不能产生能量的为'
,
score
:
'2'
,
type
:
'DXT'
,
options
:{
A
:
'蔗糖'
,
B
:
'果糖'
,
C
:
'木质素'
,
D
:
'酪蛋白'
}
}
,
{
id
:
'AE891'
,
subject
:
'从业人员在职业活动中,以公平、对等的态度对待领导、同事和顾客等人的行为是()'
,
score
:
'5'
,
type
:
'TKT'
,
options
:{
}
}
,
{
id
:
'AE8914'
,
subject
:
'对于线性表(7,34,55,25,64,46,20,10)进行散列存储时,若选用H(K)=K %9作为散列函数,则散列地址为1的元素有()个。'
,
score
:
'2'
,
type
:
'DXTS'
,
options
:{
A
:
'1个'
,
B
:
'2个'
,
C
:
'3个'
,
D
:
'4个'
,
E
:
'5个'
}
}
]
}
}
}
<
/script
>
<
style
lang
=
"scss"
>
.
testpaper
{
.
info
{
display
:
flex
;
line
-
height
:
80
px
;
font
-
size
:
13
px
;
font
-
weight
:
700
;
text
-
align
:
center
;
.
infoItem
{
width
:
25
%
;
}
}
.
title
{
line
-
height
:
30
px
;
text
-
align
:
center
;
width
:
100
%
;
font
-
size
:
18
px
;
font
-
weight
:
800
;
}
padding
-
left
:
111
px
;
padding
-
right
:
111
px
;
}
<
/style
>
src/views/train/testPaper/subject.vue
0 → 100644
View file @
20ef7234
<
template
>
<div
class=
"examMain"
:title=
"subject"
>
<!-- 试题题目-->
<template
v-if=
"type!='TKT'"
>
<span>
{{
`${index
}
.`
}}
<
/span
>
<
span
>
{{
type
|
typeName
}}
<
/span
>
<
span
>
{{
subject
}}
{{
score
|
typeScore
}}
<
/span
>
<
br
>
<
/template
>
<!--
填空题
-->
<
template
v
-
if
=
"type=='TKT'"
>
<
span
>
{{
`${index
}
.`
}}
<
/span
>
<
span
>
{{
'TKT'
|
typeName
}}
<
/span
>
<
span
v
-
html
=
"transTKT(subject)"
><
/span><span>{{score|typeScore
}}
</
span
>
<
/template
>
<!--
答案选项
-->
<!--
单选
-->
<
div
v
-
if
=
"type=='DXT'"
class
=
"options"
>
<
div
class
=
"item"
:
key
=
"index"
v
-
for
=
"(item,index) in options"
>
<
el
-
radio
v
-
model
=
"value"
:
label
=
"index"
>
{{
`${index
}
.${item
}
`
}}
<
/el-radio
>
<
/div
>
<
/div
>
<!--
多选
-->
<
div
v
-
if
=
"type=='DXTS'"
class
=
"options"
>
<
div
class
=
"item"
:
key
=
"index"
v
-
for
=
"(item,index) in options"
>
<
el
-
checkbox
-
group
v
-
model
=
"valueList"
>
<
el
-
checkbox
:
label
=
"index"
>
{{
`${index
}
.${item
}
`
}}
<
/el-checkbox
>
<
/el-checkbox-group
>
<
/div
>
<
/div
>
<
/div
>
<
/template
>
<
script
>
export
default
{
updated
()
{
if
(
this
.
type
==
'DXTS'
){
this
.
app
.
subjectList
[
this
.
index
-
1
].
value
=
this
.
valueList
}
else
{
this
.
app
.
subjectList
[
this
.
index
-
1
].
value
=
this
.
value
}
}
,
mounted
()
{
this
.
type
==
'TKT'
&&
$
(
this
.
$el
).
find
(
'[name=tktinput]'
).
change
(
e
=>
{
this
.
value
=
$
(
this
.
$el
).
find
(
'[name=tktinput]'
).
val
()
||
''
this
.
app
.
subjectList
[
this
.
index
-
1
].
value
=
this
.
value
}
)
}
,
props
:{
app
:{
type
:
Object
,
default
:()
=>
{
return
{
}
}
}
,
index
:{
default
:
1
}
,
subject
:{
type
:
String
,
default
:
'对于线性表(7,34,55,25,64,46,20,10)进行散列存储时,若选用H(K)=K %9作为散列函数,则散列地址为1的元素有()个。'
}
,
score
:{
type
:
String
,
default
:
'2'
}
,
type
:{
type
:
String
,
default
:
'DXT'
}
,
options
:{
type
:
Object
,
default
:()
=>
{
return
{
A
:
'1个'
,
B
:
'2个'
,
C
:
'3个'
,
D
:
'4个'
}
}
}
}
,
data
(){
return
{
value
:
''
,
valueList
:[],
}
}
,
methods
:{
transTKT
(
val
,
fn
){
let
template
=
`<input type='text' name='tktinput' class='tktinput'>`
let
nval
=
val
.
replace
(
'()'
,
template
)
return
nval
}
}
,
filters
:{
typeName
(
val
){
let
typeArry
=
{
'DXT'
:
'(单选题)'
,
'DXTS'
:
'(多选题)'
,
'TKT'
:
'(填空题)'
}
let
nval
=
typeArry
[
val
]
return
nval
||
'其他'
}
,
typeScore
(
val
){
let
nval
=
`(${val
}
分)`
return
nval
}
}
}
<
/script
>
<
style
lang
=
"scss"
scope
>
.
el
-
radio__label
{
font
-
size
:
13
px
;
color
:
rgb
(
119
,
119
,
119
);
}
input
{
border
:
none
;
outline
:
none
;
}
input
:
focus
{
border
:
none
;
}
.
tktinput
:
focus
{
border
:
0
px
;
border
-
bottom
:
1
px
solid
#
eee
;
}
.
tktinput
{
border
:
0
px
;
border
-
bottom
:
1
px
solid
#
eee
;
color
:
#
888
;
}
.
examMain
{
margin
-
top
:
30
px
;
height
:
100
%
;
width
:
100
%
;
font
-
size
:
14
px
;
overflow
:
auto
;
.
options
{
padding
:
10
px
;
width
:
100
%
;
display
:
flex
;
flex
-
wrap
:
wrap
;
.
item
{
padding
-
left
:
20
%
;
width
:
50
%
;
line
-
height
:
20
px
;
}
}
}
<
/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