Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zhengyuan-danger-chemistry-manage
Project
Project
Details
Activity
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
耿迪迪
zhengyuan-danger-chemistry-manage
Commits
0bfab4d1
Commit
0bfab4d1
authored
Dec 29, 2022
by
吴卿华
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
ccc30842
a2bbdc18
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
427 additions
and
355 deletions
+427
-355
THiddenLibraryMapper.xml
...src/main/resources/mapper/system/THiddenLibraryMapper.xml
+2
-2
index.vue
...anage-web/src/views/educationPlanExam/textPaper/index.vue
+2
-2
Item.vue
...ews/educationPlanExam/trainingProgram/components/Item.vue
+3
-2
index.vue
...-web/src/views/educationPlanExam/visitorProgram/index.vue
+129
-115
visitorAdd.vue
...src/views/educationPlanExam/visitorProgram/visitorAdd.vue
+105
-173
visitorQuestion.vue
...iews/educationPlanExam/visitorProgram/visitorQuestion.vue
+181
-60
index.vue
danger-manage-web/src/views/system/workCheck/index.vue
+5
-1
No files found.
danger-manage-system/src/main/resources/mapper/system/THiddenLibraryMapper.xml
View file @
0bfab4d1
...
...
@@ -24,8 +24,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"selectTHiddenLibraryList"
parameterType=
"THiddenLibrary"
resultMap=
"THiddenLibraryResult"
>
<include
refid=
"selectTHiddenLibraryVo"
/>
<where>
<if
test=
"deptId != null "
>
and dept_id = #{deptId}
</if>
<if
test=
"riskPoint != null and riskPoint != ''"
>
and risk_point like concat('%', #{riskPoint}, '%')
</if>
<if
test=
"deptId != null "
>
and
h.
dept_id = #{deptId}
</if>
<if
test=
"riskPoint != null and riskPoint != ''"
>
and
h.
risk_point like concat('%', #{riskPoint}, '%')
</if>
</where>
</select>
...
...
danger-manage-web/src/views/educationPlanExam/textPaper/index.vue
View file @
0bfab4d1
...
...
@@ -259,13 +259,13 @@ export default {
}
,
/** 新增按钮操作 */
handleAdd
()
{
this
.
$refs
.
Dia
.
title
=
"新增
培训课程
"
;
this
.
$refs
.
Dia
.
title
=
"新增
考试试卷
"
;
this
.
componentsNum
=
1
;
this
.
courseId
=
null
;
this
.
dilogFlag
=
true
;
}
,
changeLesson
(
courseId
)
{
this
.
$refs
.
Dia
.
title
=
"修改
培训课程
"
;
this
.
$refs
.
Dia
.
title
=
"修改
考试试卷
"
;
this
.
componentsNum
=
1
;
this
.
courseId
=
courseId
;
this
.
dilogFlag
=
true
;
...
...
danger-manage-web/src/views/educationPlanExam/trainingProgram/components/Item.vue
View file @
0bfab4d1
...
...
@@ -27,15 +27,16 @@
<div>
<div
class=
"top"
>
参与培训人员(
{{
personnelOptions
.
length
}}
)
</div>
<div
class=
"bottom"
>
<
el-checkbox-group
class=
""
v-model=
"infoData.postIds"
>
<
!--
<el-checkbox-group
class=
""
v-model=
"infoData.postIds"
>
--
>
<el-checkbox
:disabled=
"!isActive"
v-model=
"personnel.ischeck"
v-for=
"personnel in personnelOptions"
:label=
"personnel.postId"
:key=
"personnel.postId"
>
{{
personnel
.
postName
}}
</el-checkbox
>
<
/el-checkbox-group
>
<
!--
</el-checkbox-group>
--
>
</div>
</div>
</div>
...
...
danger-manage-web/src/views/educationPlanExam/visitorProgram/index.vue
View file @
0bfab4d1
<
template
>
<div
class=
"form-wrapper"
>
<div
style=
"width: 100%;height:100%;"
>
<el-form
:model=
"
ruleForm"
:rules=
"rules"
ref=
"rule
Form"
label-width=
"100px"
class=
"demo-ruleForm"
>
<el-form-item
label=
"培训名称"
prop=
"
n
ame"
>
<el-input
v-model=
"
ruleForm.n
ame"
></el-input>
<el-form
:model=
"
contractTrainForm"
:rules=
"rules"
ref=
"contractTrain
Form"
label-width=
"100px"
class=
"demo-ruleForm"
>
<el-form-item
label=
"培训名称"
prop=
"
courseN
ame"
>
<el-input
v-model=
"
contractTrainForm.courseN
ame"
></el-input>
</el-form-item>
<el-form-item
label=
"培训内容"
prop=
"region"
>
<el-input
type=
"textarea"
v-model=
"ruleForm.region"
rows=
"5"
></el-input>
<el-form-item
label=
"培训内容"
prop=
"courseConent"
>
<el-input
type=
"textarea"
v-model=
"contractTrainForm.courseConent"
rows=
"5"
></el-input>
</el-form-item>
<div
class=
"flex"
>
<el-form-item
label=
"视频上传"
v-if=
"!readOnly"
prop=
"video"
>
<FileUpload
listType=
"picture"
@
resFun=
"getFileInfoVideo"
@
remove=
"listRemoveVideo"
:fileArr=
"fileListVideo"
:fileSize=
"500"
:fileType=
"['mp4']"
/>
<el-input
v-show=
"false"
disabled
v-model=
"contractTrainForm.video"
></el-input>
</el-form-item>
<el-form-item
label=
"附件上传"
v-if=
"!readOnly"
prop=
"enclosure"
>
<FileUpload
listType=
"picture"
@
resFun=
"getFileInfoFile"
@
remove=
"listRemoveFile"
:fileArr=
"fileListFile"
/>
<el-input
v-show=
"false"
disabled
v-model=
"contractTrainForm.enclosure"
></el-input>
</el-form-item>
</div>
</el-form>
</div>
<el-form>
<div
class=
"flex"
>
<el-form-item
label=
"视频上传"
v-if=
"!readOnly"
prop=
"video"
>
<FileUpload
listType=
"picture"
@
resFun=
"getFileInfoVideo"
@
remove=
"listRemoveVideo"
:fileArr=
"fileListVideo"
:fileSize=
"500"
:fileType=
"['mp4']"
/>
<el-input
v-show=
"false"
disabled
v-model=
"form.video"
></el-input>
</el-form-item>
<el-form-item
label=
"附件上传"
v-if=
"!readOnly"
prop=
"enclosure"
>
<FileUpload
listType=
"picture"
@
resFun=
"getFileInfoFile"
@
remove=
"listRemoveFile"
:fileArr=
"fileListFile"
/>
<el-input
v-show=
"false"
disabled
v-model=
"form.enclosure"
></el-input>
</el-form-item>
</div>
</el-form>
<visitorQuestion></visitorQuestion>
<visitorQuestion
ref=
"visitorQuestion"
></visitorQuestion>
</div>
</
template
>
<
script
>
import
FileUpload
from
"@/components/FileUpload"
;
import
uploadfile
from
"@/assets/uploadfile.png"
;
import
visitorQuestion
from
"@/views/educationPlanExam/visitorProgram/visitorQuestion"
;
// import visitorDia from "@/views/educationPlanExam/visitorProgram/visitorDia";
export
default
{
data
()
{
return
{
ruleForm
:
{
name
:
''
,
region
:
''
,
},
form
:
{
video
:
""
,
enclosure
:
""
,
},
fileListVideo
:
[],
fileListFile
:
[],
readOnly
:
false
,
rules
:
{
name
:
[
{
required
:
true
,
message
:
'请输入培训名称'
,
trigger
:
'blur'
}
],
region
:
[
{
required
:
true
,
message
:
'请输入培训内容'
,
trigger
:
'change'
}
],
video
:
[
{
required
:
true
,
trigger
:
"blue"
,
message
:
"视频不能为空"
}
],
enclosure
:
[
{
required
:
true
,
trigger
:
"blur"
,
message
:
"附件不能为空"
},
],
import
FileUpload
from
"@/components/FileUpload"
;
import
uploadfile
from
"@/assets/uploadfile.png"
;
import
visitorQuestion
from
"@/views/educationPlanExam/visitorProgram/visitorQuestion"
;
import
{
listCourse
}
from
"@/api/contractTrain/contractTrain"
;
export
default
{
data
()
{
return
{
contractTrainForm
:
{
courseName
:
''
,
courseConent
:
''
,
video
:
""
,
enclosure
:
""
,
},
fileListVideo
:
[],
fileListFile
:
[],
readOnly
:
false
,
rules
:
{
name
:
[
{
required
:
true
,
message
:
'请输入培训名称'
,
trigger
:
'blur'
}
],
region
:
[
{
required
:
true
,
message
:
'请输入培训内容'
,
trigger
:
'change'
}
],
video
:
[
{
required
:
true
,
trigger
:
"blue"
,
message
:
"视频不能为空"
}
],
enclosure
:
[
{
required
:
true
,
trigger
:
"blur"
,
message
:
"附件不能为空"
},
],
},
};
},
components
:
{
FileUpload
,
visitorQuestion
,
},
created
()
{
this
.
getContractTrainList
();
},
methods
:
{
getContractTrainList
(){
listCourse
().
then
(
res
=>
{
this
.
contractTrainForm
=
res
.
rows
[
0
];
if
(
this
.
contractTrainForm
.
video
){
this
.
fileListVideo
=
[
{
name
:
this
.
contractTrainForm
.
courseName
+
"视频"
,
url
:
uploadfile
,
},
];
}
if
(
this
.
contractTrainForm
.
enclosure
){
this
.
fileListFile
=
[
{
name
:
this
.
contractTrainForm
.
courseName
+
"附件"
,
url
:
uploadfile
,
},
];
}
this
.
$refs
.
visitorQuestion
.
rightNum
=
this
.
contractTrainForm
.
qualifiedNum
;
this
.
$refs
.
visitorQuestion
.
getContractTopicList
(
this
.
contractTrainForm
.
contractorCourseId
)
})
},
submitForm
(
formName
)
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
alert
(
'submit!'
);
}
else
{
console
.
log
(
'error submit!!'
);
return
false
;
}
};
}
)
;
},
components
:
{
FileUpload
,
visitorQuestion
,
getFileInfoVideo
(
res
)
{
this
.
contractTrainForm
.
video
=
res
.
url
;
this
.
fileListVideo
=
[
{
name
:
res
.
fileName
,
url
:
uploadfile
,
},
];
},
created
()
{
if
(
this
.
courseId
)
{
this
.
getLessonById
();
}
listRemoveVideo
(
e
)
{
this
.
fileListVideo
=
[];
this
.
contractTrainForm
.
video
=
""
;
// this.form.videoName = null;
},
getFileInfoFile
(
res
)
{
this
.
contractTrainForm
.
enclosure
=
res
.
url
;
this
.
fileListFile
=
[
{
name
:
res
.
fileName
,
url
:
uploadfile
,
},
];
},
listRemoveFile
(
e
)
{
this
.
fileListFild
=
[];
this
.
contractTrainForm
.
enclosure
=
""
;
// this.form.fileName = null;
},
methods
:
{
submitForm
(
formName
)
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
alert
(
'submit!'
);
}
else
{
console
.
log
(
'error submit!!'
);
return
false
;
}
});
},
getFileInfoVideo
(
res
)
{
this
.
form
.
video
=
res
.
url
;
// this.form.videoName = res.fileName;
this
.
fileListVideo
=
[
{
name
:
res
.
fileName
,
url
:
uploadfile
,
},
];
},
listRemoveVideo
(
e
)
{
this
.
fileListVideo
=
[];
this
.
form
.
video
=
""
;
// this.form.videoName = null;
},
getFileInfoFile
(
res
)
{
this
.
form
.
enclosure
=
res
.
url
;
// this.form.enclosureName = res.fileName;
this
.
fileListFile
=
[
{
name
:
res
.
fileName
,
url
:
uploadfile
,
},
];
},
listRemoveFile
(
e
)
{
this
.
fileListFild
=
[];
this
.
form
.
enclosure
=
""
;
// this.form.fileName = null;
},
}
}
</
script
>
}
</
script
>
<
style
lang=
"scss"
scoped
>
.form-wrapper
{
padding-top
:
30px
;
...
...
@@ -139,4 +153,4 @@ import visitorQuestion from "@/views/educationPlanExam/visitorProgram/visitorQue
justify-content
:
space-around
;
padding
:
20px
30px
;
}
</
style
>
\ No newline at end of file
</
style
>
danger-manage-web/src/views/educationPlanExam/visitorProgram/visitorAdd.vue
View file @
0bfab4d1
...
...
@@ -6,120 +6,118 @@
>
道题
</div>
</div>
<el-form
class=
"form flex"
ref=
"form"
:model=
"form"
label-width=
"auto"
>
<!--
<div
class=
"top flex"
>
-->
<div>
<el-form-item
label=
"题目"
prop=
"topicTitle"
:rules=
"
{
required: true,
message: '必须输入题目内容',
trigger: 'blur',
}"
<el-form
class=
"form flex"
ref=
"form"
:model=
"form"
label-width=
"auto"
>
<!--
<div
class=
"top flex"
>
-->
<div>
<el-form-item
label=
"题目"
prop=
"topicTitle"
:rules=
"
{
required: true,
message: '必须输入题目内容',
trigger: 'blur',
}"
>
<el-input
type=
"textarea"
placeholder=
"多行输入"
resize=
"none"
rows=
"4"
v-model=
"form.topicTitle"
>
</el-input>
</el-form-item>
</div>
<div
class=
"bottom"
>
<!--
<el-form-item
label=
"选项1"
prop=
"title"
>
<el-input
v-model=
"form.title"
placeholder=
"请输入"
></el-input>
</el-form-item>
-->
<el-form-item
v-for=
"(question, index) in form.questions"
:label=
"'选项' + (index + 1)"
:key=
"question.key"
:prop=
"'questions.' + index + '.value'"
:rules=
"
index === 0
?
{
required: true,
message: '第一项不能为空不能为空',
trigger: 'blur',
}
: {}
"
>
<div
class=
"add-select flex"
>
<el-input
type=
"textarea"
placeholder=
"多行输入"
style=
"flex: 1; margin-right: 10px"
rows=
"2"
v-model=
"question.value"
></el-input>
<div
class=
"flex algin-items"
>
<el-button
@
click=
"rightAnswerClick(index)"
class=
"right"
:class=
"
{ active: answerNum === index }"
icon="el-icon-check"
>
设为答案
</el-button>
<el-button
size=
"mini"
type=
"danger"
v-if=
"index > 0"
@
click
.
prevent=
"removeDomain(question)"
plain
icon=
"el-icon-delete"
>
删除
</el-button
>
</div>
</div>
</el-form-item>
<el-form-item
class=
"noAttr"
:label=
"`选项$
{form.questions.length + 1}`"
prop=""
>
<div
class=
"add-select flex"
>
<el-input
type=
"textarea"
placeholder=
"多行输入"
resize=
"none"
rows=
"4"
v-model=
"form.topicTitle"
rows=
"2"
v-model=
"addValue"
style=
"flex: 1; margin-right: 10px"
>
</el-input>
</el-form-item>
</div>
<div
class=
"bottom"
>
<!--
<el-form-item
label=
"选项1"
prop=
"title"
>
<el-input
v-model=
"form.title"
placeholder=
"请输入"
></el-input>
</el-form-item>
-->
<el-form-item
v-for=
"(question, index) in form.questions"
:label=
"'选项' + (index + 1)"
:key=
"question.key"
:prop=
"'questions.' + index + '.value'"
:rules=
"
index === 0
?
{
required: true,
message: '第一项不能为空不能为空',
trigger: 'blur',
}
: {}
"
>
<div
class=
"add-select flex"
>
<el-input
type=
"textarea"
placeholder=
"多行输入"
style=
"flex: 1; margin-right: 10px"
rows=
"2"
v-model=
"question.value"
></el-input>
<div
class=
"flex algin-items"
>
<el-button
@
click=
"rightAnswerClick(index)"
class=
"right"
:class=
"
{ active: answerNum === index }"
icon="el-icon-check"
>
设为答案
</el-button>
<el-button
size=
"mini"
type=
"danger"
v-if=
"index > 0"
@
click
.
prevent=
"removeDomain(question)"
plain
icon=
"el-icon-delete"
>
删除
</el-button
>
</div>
</div>
</el-form-item>
<el-form-item
class=
"noAttr"
:label=
"`选项$
{form.questions.length + 1}`"
prop=""
>
<div
class=
"add-select flex"
>
<el-input
type=
"textarea"
placeholder=
"多行输入"
resize=
"none"
rows=
"2"
v-model=
"addValue"
style=
"flex: 1; margin-right: 10px"
<div
class=
"flex algin-items"
>
<el-button
@
click=
"rightAnswerClick(form.questions.length)"
class=
"right"
:class=
"
{ active: answerNum === form.questions.length }"
icon="el-icon-check"
>
设为答案
</el-button>
<el-button
size=
"mini"
class=
"right1"
@
click
.
prevent=
"add(addValue)"
icon=
"el-icon-plus"
>
新增
</el-button
>
</el-input>
<div
class=
"flex algin-items"
>
<el-button
@
click=
"rightAnswerClick(form.questions.length)"
class=
"right"
:class=
"
{ active: answerNum === form.questions.length }"
icon="el-icon-check"
>
设为答案
</el-button>
<el-button
size=
"mini"
class=
"right1"
@
click
.
prevent=
"add(addValue)"
icon=
"el-icon-plus"
>
新增
</el-button
>
</div>
</div>
</el-form-item>
</div>
</el-form>
</div>
</div>
</el-form-item>
</div>
</el-form>
</div>
</
template
>
<
script
>
import
{
addQuestion
,
...
...
@@ -128,20 +126,13 @@
getQuestion
,
getLessonById
,
}
from
"@/api/educationPlanExam/lessonsProgram.js"
;
export
default
{
name
:
"AnswerLesson"
,
props
:
{
// visible: {
// type: Boolean,
// default: false,
// },
courseId
:
{
type
:
Number
,
},
topicId
:
{
type
:
Number
,
},
},
components
:
{},
data
()
{
...
...
@@ -157,25 +148,9 @@
courseName
:
""
,
};
},
created
()
{
// 如果存在就是修改
// if (this.topicId) {
// checkQuestion(this.topicId).then((res) => {
// console.log(res.data);
// const data = res.data;
// this.form = {
// topicTitle: data.topicTitle,
// questions: JSON.parse(data.topicOption),
// };
// this.answerNum = data.answer;
// });
// }
// 查询是第几道题
// this.getQuestion();
// 获取课程标题
// this.getLessonById(this.courseId);
},
methods
:
{
getQuestion
()
{
...
...
@@ -215,48 +190,6 @@
// 新增选项
add
(
addValue
)
{
this
.
form
.
questions
.
push
({
value
:
addValue
});
console
.
log
();
},
save
(
num
=
2
)
{
return
new
Promise
((
resove
)
=>
{
if
(
!
this
.
answerNum
&&
this
.
answerNum
!==
0
)
{
this
.
$message
({
message
:
"警告,请设置一个正确答案"
,
type
:
"warning"
,
});
return
resove
(
false
);
}
this
.
$refs
.
form
.
validate
((
valid
)
=>
{
if
(
valid
)
{
const
data
=
{};
data
.
topicTitle
=
this
.
form
.
topicTitle
;
data
.
topicOption
=
JSON
.
stringify
(
this
.
form
.
questions
);
data
.
answer
=
this
.
answerNum
;
this
.
addQuestion
(
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
// 把修改的这个归位,变成正常添加
this
.
$emit
(
"update:topicId"
,
null
);
this
.
$message
({
message
:
"添加题目成功"
,
type
:
"success"
,
});
this
.
$parent
.
$parent
.
componentsNumChange
(
num
);
this
.
$parent
.
$parent
.
$parent
.
getList
();
resove
(
true
);
}
});
}
});
});
},
saveAndNext
()
{
this
.
save
(
3
).
then
((
res
)
=>
{
if
(
res
)
{
this
.
reset
();
this
.
questionNextNum
++
;
}
});
},
reset
()
{
this
.
form
=
{
...
...
@@ -287,7 +220,7 @@
overflow-y
:
auto
;
height
:
330px
;
box-sizing
:
border-box
;
.algin-items
{
align-items
:
center
;
width
:
200px
;
...
...
@@ -359,4 +292,3 @@
}
}
</
style
>
\ No newline at end of file
danger-manage-web/src/views/educationPlanExam/visitorProgram/visitorQuestion.vue
View file @
0bfab4d1
...
...
@@ -11,21 +11,52 @@
<div
style=
"color: #1890ff;"
>
题目管理
</div>
<div
class=
"text flex"
>
<div
class=
"left"
>
<el-button
type=
"primary"
plain
@
click=
"dialogVisible = true"
>
{{
saveNextText
}}
</el-button>
目前有
<span></span>
道题
<el-button
type=
"primary"
plain
@
click=
"enterContractTrainTopic"
>
录入考题
</el-button>
目前有
<span>
{{
questionNum
}}
</span>
道题
<span
class=
"warn"
>
温馨提示:发布课程前需要进行考试设置
</span>
</div>
<!--
<div
class=
"right"
>
{{
courseName
}}
</div>
-->
</div>
<!-- 试题列表 -->
<div
class=
"table flex"
>
<div
class=
"th flex"
>
<div
class=
"left"
>
序号
</div>
<div
class=
"middle"
>
题目名称
</div>
<div
class=
"right"
>
操作
</div>
</div>
<div
class=
"td-wrapper"
>
<div
v-for=
"(item, index) in questionList"
:key=
"item.topicId"
class=
"td flex"
>
<div
class=
"left"
>
{{
index
+
1
}}
</div>
<div
class=
"middle zzz"
>
{{
item
.
topicTitle
}}
</div>
<div
class=
"right"
>
<div>
<el-button
@
click=
"editContractTrainTopic(item.topicId)"
icon=
"el-icon-edit"
type=
"text"
>
修改
</el-button
>
<el-button
@
click=
"deleteContractTrainTopic(item.topicId)"
icon=
"el-icon-delete"
type=
"text"
>
删除
</el-button
>
</div>
</div>
</div>
</div>
</div>
<!-- 底部 -->
<div
class=
"d3"
>
<div
class=
"rightNum flex"
>
<div
class=
"left"
>
考试设置
</div>
...
...
@@ -53,58 +84,44 @@
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"saveContractTrian"
>
{{
"确认"
}}
</el-button
>
<el-button>
取消
</el-button>
</div>
</div>
<el-dialog
title=
"录入题目"
:visible
.
sync=
"dialogVisible"
>
<visitorAdd
></visitorAdd
>
>
<visitorAdd
ref=
"visitorAdd"
:key=
"next"
/
>
<span
slot=
"footer"
class=
"dialog-footer"
>
<!--
<el-button>
保存
</el-button>
<el-button
type=
"primary"
@
click=
"dialogVisible = false"
>
确 定
</el-button>
-->
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"save"
>
保存
</el-button
>
<el-button
type=
"primary"
@
click=
"saveAndNext"
>
{{
saveNextText
}}
</el-button>
<el-button
v-if=
"this.componentsNum == 2"
type=
"primary"
>
{{
"确认"
}}
</el-button
>
<el-button
type=
"primary"
@
click=
"saveAndNext"
>
保存并录入下一题
</el-button>
<el-button
@
click=
"dialogVisible = false"
>
取消
</el-button>
</div>
</span>
</el-dialog>
</div>
</
template
>
<
script
>
import
visitorAdd
from
"@/views/educationPlanExam/visitorProgram/visitorAdd"
;
import
visitorAdd
from
"@/views/educationPlanExam/visitorProgram/visitorAdd"
;
import
{
updateCourse
}
from
"@/api/contractTrain/contractTrain"
;
import
{
addTopic
,
listTopic
,
getTopic
,
delTopic
,
updateTopic
}
from
"@/api/contractTrain/contractTrainTopic"
;
export
default
{
name
:
"AnswerLesson"
,
props
:
{
courseId
:
{
type
:
Number
,
},
visible
:
{
type
:
Boolean
,
default
:
false
,
},
componentsNum
:
{
type
:
Number
,
default
:
1
,
},
},
components
:
{
visitorAdd
,
...
...
@@ -113,43 +130,148 @@
return
{
dialogVisible
:
false
,
rightNum
:
0
,
next
:
0
,
questionList
:
[],
questionNum
:
null
,
courseId
:
""
};
},
computed
:
{
saveNextText
()
{
let
text
;
if
(
this
.
componentsNum
==
1
)
{
text
=
"保存并录入题目"
;
}
else
if
(
this
.
componentsNum
==
2
)
{
text
=
"录入考题"
;
methods
:
{
//获取考题列表
getContractTopicList
(
contractorCourseId
){
this
.
courseId
=
contractorCourseId
;
listTopic
({
contractorCourseId
:
contractorCourseId
}).
then
(
res
=>
{
this
.
questionList
=
res
.
rows
.
map
((
item
)
=>
{
return
{
topicId
:
item
.
topicId
,
topicTitle
:
item
.
topicTitle
,
};
});
this
.
questionNum
=
res
.
total
;
})
},
//录入考题
enterContractTrainTopic
(){
this
.
dialogVisible
=
true
;
this
.
$nextTick
(()
=>
{
this
.
$refs
.
visitorAdd
.
questionNextNum
=
this
.
questionNum
+
1
;
})
},
//保存试题
save
(
next
)
{
new
Promise
((
resove
)
=>
{
if
(
!
this
.
$refs
.
visitorAdd
.
answerNum
&&
this
.
$refs
.
visitorAdd
.
answerNum
!==
0
)
{
this
.
$message
({
message
:
"警告,请设置一个正确答案"
,
type
:
"warning"
,
});
return
resove
(
false
);
}
this
.
$refs
.
visitorAdd
.
$refs
.
form
.
validate
((
valid
)
=>
{
if
(
valid
)
{
const
data
=
{};
data
.
contractorCourseId
=
this
.
courseId
;
data
.
topicTitle
=
this
.
$refs
.
visitorAdd
.
form
.
topicTitle
;
data
.
topicOption
=
JSON
.
stringify
(
this
.
$refs
.
visitorAdd
.
form
.
questions
);
data
.
answer
=
this
.
$refs
.
visitorAdd
.
answerNum
;
this
.
addContractTrainTopic
(
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
// 把修改的这个归位,变成正常添加
this
.
$emit
(
"update:topicId"
,
null
);
this
.
$message
({
message
:
"添加题目成功"
,
type
:
"success"
,
});
if
(
next
!=
1
){
this
.
dialogVisible
=
false
;
this
.
getContractTopicList
(
this
.
courseId
)
}
else
{
this
.
next
++
;
}
resove
(
true
);
}
});
}
});
});
},
//保存并录入下一题
saveAndNext
()
{
this
.
save
(
1
);
},
//新增试题
addContractTrainTopic
(
data
){
if
(
this
.
$refs
.
visitorAdd
.
form
.
topicId
)
{
return
updateTopic
({
topicId
:
this
.
$refs
.
visitorAdd
.
form
.
topicId
,
...
data
});
}
else
{
text
=
"保存并录入下一题"
;
return
addTopic
({
contractorCourseId
:
this
.
courseId
,
...
data
})
;
}
return
text
;
},
},
created
()
{
console
.
log
(
"this.courseId"
,
this
.
courseId
);
},
methods
:
{
handleClose
(
done
)
{
this
.
$confirm
(
'确认关闭?'
)
.
then
(
_
=>
{
done
();
})
.
catch
(
_
=>
{});
//试题修改
editContractTrainTopic
(
topicId
){
this
.
dialogVisible
=
true
;
getTopic
(
topicId
).
then
(
res
=>
{
const
data
=
res
.
data
;
this
.
$refs
.
visitorAdd
.
form
=
{
topicId
:
data
.
topicId
,
topicTitle
:
data
.
topicTitle
,
questions
:
JSON
.
parse
(
data
.
topicOption
),
};
this
.
$refs
.
visitorAdd
.
answerNum
=
data
.
answer
;
})
},
save
()
{
// this.answerClear();
this
.
$refs
.
current
.
save
();
//试题删除
deleteContractTrainTopic
(
topicId
){
this
.
$confirm
(
"请确定删除该题"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
,
}).
then
(()
=>
{
return
delTopic
(
topicId
);
}).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
this
.
$message
({
message
:
"删除成功"
,
type
:
"success"
,
});
}
return
this
.
getContractTopicList
(
this
.
courseId
);
})
},
saveRightNum
()
{
if
(
this
.
rightNum
>
this
.
questionList
.
length
)
{
this
.
$message
({
message
:
"答对题目数应小于等于考试题目总数"
,
type
:
"warning"
,
});
return
;
}
updateCourse
({
contractorCourseId
:
this
.
courseId
,
qualifiedNum
:
this
.
rightNum
}).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
this
.
$message
({
message
:
"答题合格数修改成功"
,
type
:
"success"
,
});
}
}
);
},
saveAndNext
()
{
this
.
$refs
.
current
.
saveAndNext
();
},
//保存承包商信息
saveContractTrian
(){
updateCourse
(
this
.
$parent
.
contractTrainForm
).
then
(
res
=>
{
if
(
res
.
code
==
200
){
this
.
$message
({
message
:
"培训信息修改成功"
,
type
:
"success"
,
});
this
.
$parent
.
getContractTrainList
();
}
})
}
},
};
</
script
>
...
...
@@ -162,7 +284,7 @@
padding-bottom
:
7px
;
margin-bottom
:
20px
;
border-bottom
:
1px
solid
#bbbbbb
00
;
.text
{
margin-top
:
13px
;
margin-bottom
:
32px
;
...
...
@@ -179,7 +301,7 @@
margin-left
:
10px
;
}
}
.right
{
width
:
411px
;
line-height
:
28px
;
...
...
@@ -192,7 +314,7 @@
.table
{
flex
:
1
;
height
:
0
;
flex-direction
:
column
;
.th
{
width
:
100%
;
...
...
@@ -200,7 +322,7 @@
line-height
:
70px
;
background
:
#f5f5f5
;
color
:
#606266
;
>
div
{
height
:
100%
;
}
...
...
@@ -260,7 +382,7 @@
height
:
55px
;
box-sizing
:
border-box
;
border
:
1px
solid
#bbbbbb
;
line-height
:
55px
;
line-height
:
55px
;
margin-right
:
20px
;
>
.left
{
width
:
140px
;
...
...
@@ -287,4 +409,3 @@
}
}
</
style
>
\ No newline at end of file
danger-manage-web/src/views/system/workCheck/index.vue
View file @
0bfab4d1
...
...
@@ -240,7 +240,7 @@
<el-form-item
label=
"任务范围"
prop=
"workRange"
>
<el-input
v-model=
"form.workRange"
placeholder=
"请输入任务范围"
/>
</el-form-item>
<el-form-item
label=
"排查库"
>
<el-form-item
label=
"排查库"
prop=
"libraryId"
>
<!--<el-input v-model="form.deptId" placeholder="请输入部门id" />-->
<el-select
v-model=
"form.libraryId"
multiple
filterable
placeholder=
"请选择"
@
change=
"selectLibrary"
>
<el-option
...
...
@@ -609,6 +609,9 @@ export default {
staffId
:
[
{
required
:
true
,
message
:
"责任人不能为空"
,
trigger
:
"blur"
}
],
libraryId
:
[
{
required
:
true
,
message
:
"排查库不可为空"
,
trigger
:
"change"
}
],
// content: [
// { required: true, message: "排查内容不能为空", trigger: "blur" }
// ],
...
...
@@ -700,6 +703,7 @@ export default {
workId
:
null
,
parentId
:
null
,
bookId
:
null
,
libraryId
:
null
,
workCycle
:
null
,
workName
:
null
,
workType
:
null
,
...
...
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