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
f7b9295f
Commit
f7b9295f
authored
Dec 16, 2022
by
纪泽龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
题库管理页面的增加删除修改。
parent
a40306a3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
286 additions
and
175 deletions
+286
-175
main.js
danger-manage-web/src/main.js
+4
-1
Lesson.vue
...iews/educationPlanExam/questionBank/components/Lesson.vue
+149
-86
QuestionList.vue
...ducationPlanExam/questionBank/components/QuestionList.vue
+8
-7
index.vue
...ge-web/src/views/educationPlanExam/questionBank/index.vue
+124
-80
vue.config.js
danger-manage-web/vue.config.js
+1
-1
No files found.
danger-manage-web/src/main.js
View file @
f7b9295f
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-06-16 14:52:17
* @Date: 2022-06-16 14:52:17
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-
09-20 23:37:42
* @LastEditTime: 2022-
12-15 14:39:18
* @FilePath: /danger-manage-web/src/main.js
* @FilePath: /danger-manage-web/src/main.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
*/
...
@@ -48,11 +48,14 @@ import VueVideoPlayer from 'vue-video-player'
...
@@ -48,11 +48,14 @@ import VueVideoPlayer from 'vue-video-player'
// require videojs style
// require videojs style
import
'video.js/dist/video-js.css'
import
'video.js/dist/video-js.css'
// import 'vue-video-player/src/custom-theme.css'
// import 'vue-video-player/src/custom-theme.css'
Vue
.
use
(
VueVideoPlayer
,
/* {
Vue
.
use
(
VueVideoPlayer
,
/* {
options: global default options,
options: global default options,
events: global videojs events
events: global videojs events
} */
)
} */
)
// require('video.js/dist/video-js.css')
// require('video.js/dist/video-js.css')
// require('vue-video-player/src/custom-theme.css')
// require('vue-video-player/src/custom-theme.css')
// Vue.use(VideoPlayer)
// Vue.use(VideoPlayer)
...
...
danger-manage-web/src/views/educationPlanExam/questionBank/components/Lesson.vue
View file @
f7b9295f
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 10:59:44
* @Date: 2022-09-22 10:59:44
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-
09-28 17:52:32
* @LastEditTime: 2022-
12-16 16:43:06
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/Lession.vue
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/Lession.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
-->
...
@@ -16,38 +16,40 @@
...
@@ -16,38 +16,40 @@
:rules=
"rules"
:rules=
"rules"
>
>
<div
class=
"top flex"
>
<div
class=
"top flex"
>
<el-form-item
label=
"
课程标题"
prop=
"course
Name"
>
<el-form-item
label=
"
题库名称"
prop=
"bank
Name"
>
<el-input
style=
"width:
500px"
v-model=
"form.course
Name"
></el-input>
<el-input
style=
"width:
300px"
v-model=
"form.bank
Name"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"课程类型"
prop=
"courseType"
>
<el-form-item
<el-select
label=
"归属部门"
v-model=
"form.courseType"
prop=
"deptId"
placeholder=
"请选择隐患等级"
label-width=
"140px"
clearable
ref=
"treeItem"
size=
"small"
>
>
<Treeselect
<el-option
class=
"tree"
v-for=
"course in courseOptions"
v-model=
"form.deptId"
:key=
"course.planId"
:options=
"deptOptions"
:label=
"course.planName"
:show-count=
"true"
:value=
"course.planId"
placeholder=
"请选择归属部门"
/>
@
open=
"treeOpen"
</el-select>
@
close=
"treeClose"
@
select=
"select"
/>
</el-form-item>
</el-form-item>
</div>
</div>
<!--
</div>
-->
<!--
</div>
-->
<el-form-item
label=
"课程内容"
prop=
"courseConent"
>
<
!--
<
el-form-item
label=
"课程内容"
prop=
"courseConent"
>
<Editor
v-model=
"form.courseConent"
:min-height=
"192"
/>
<Editor
v-model=
"form.courseConent"
:min-height=
"192"
/>
<el-input
<el-input
v-show=
"false"
v-show=
"false"
disabled
disabled
v-model=
"form.courseConent"
v-model=
"form.courseConent"
></el-input>
></el-input>
</el-form-item>
</el-form-item>
-->
<div
class=
"flex"
>
<
!--
<
div
class=
"flex"
>
<el-form-item
label=
"视频上传"
v-if=
"!readOnly"
prop=
"video"
>
<el-form-item
label=
"视频上传"
v-if=
"!readOnly"
prop=
"video"
>
<FileUpload
<FileUpload
listType=
"picture"
listType=
"picture"
...
@@ -68,7 +70,7 @@
...
@@ -68,7 +70,7 @@
/>
/>
<el-input
v-show=
"false"
disabled
v-model=
"form.enclosure"
></el-input>
<el-input
v-show=
"false"
disabled
v-model=
"form.enclosure"
></el-input>
</el-form-item>
</el-form-item>
</div>
</div>
-->
</el-form>
</el-form>
</div>
</div>
</
template
>
</
template
>
...
@@ -83,7 +85,18 @@ import {
...
@@ -83,7 +85,18 @@ import {
getLessonById
,
getLessonById
,
changeLesson
,
changeLesson
,
}
from
"@/api/educationPlanExam/lessonsProgram"
;
}
from
"@/api/educationPlanExam/lessonsProgram"
;
import
{
listBank
,
addBank
,
updateBank
,
getBank
,
}
from
"@/api/system/questionBank.js"
;
// 所有部门
import
{
treeselect
}
from
"@/api/system/dept"
;
import
Treeselect
from
"@riophae/vue-treeselect"
;
import
"@riophae/vue-treeselect/dist/vue-treeselect.css"
;
export
default
{
export
default
{
name
:
""
,
name
:
""
,
props
:
{
props
:
{
...
@@ -94,84 +107,123 @@ export default {
...
@@ -94,84 +107,123 @@ export default {
components
:
{
components
:
{
Editor
,
Editor
,
FileUpload
,
FileUpload
,
Treeselect
,
},
},
data
()
{
data
()
{
return
{
return
{
form
:
{
form
:
{
courseName
:
""
,
bankName
:
""
,
courseType
:
""
,
// courseType: "",
courseConent
:
""
,
// courseConent: "",
video
:
""
,
// video: "",
enclosure
:
""
,
// enclosure: "",
deptId
:
null
,
},
},
// 归属部门列表
deptOptions
:
[],
fileListVideo
:
[],
fileListVideo
:
[],
fileListFile
:
[],
fileListFile
:
[],
readOnly
:
false
,
readOnly
:
false
,
rules
:
{
rules
:
{
course
Name
:
[
bank
Name
:
[
{
required
:
true
,
trigger
:
"blur"
,
message
:
"课程名称不能为空"
},
{
required
:
true
,
trigger
:
"blur"
,
message
:
"课程名称不能为空"
},
],
],
courseType
:
[
deptId
:
[
{
required
:
true
,
trigger
:
"change"
,
message
:
"课程类型不能为空"
},
{
required
:
true
,
trigger
:
"blur"
,
message
:
"请选择所属部门"
},
],
courseConent
:
[
{
required
:
true
,
trigger
:
"blur"
,
message
:
"课程内容不能为空"
},
],
video
:
[{
required
:
true
,
trigger
:
"blue"
,
message
:
"视频不能为空"
}],
enclosure
:
[
{
required
:
true
,
trigger
:
"blur"
,
message
:
"附件不能为空"
},
],
],
// courseType: [
// { required: true, trigger: "change", message: "课程类型不能为空" },
// ],
// courseConent: [
// { required: true, trigger: "blur", message: "课程内容不能为空" },
// ],
// video: [{ required: true, trigger: "blue", message: "视频不能为空" }],
// enclosure: [
// { required: true, trigger: "blur", message: "附件不能为空" },
// ],
},
},
};
};
},
},
computed
:
{
computed
:
{
// 获取课程类型
// 获取课程类型
...
mapGetters
([
"courseOptions"
]),
//
...mapGetters(["courseOptions"]),
},
},
created
()
{
created
()
{
if
(
this
.
courseId
)
{
if
(
this
.
courseId
)
{
this
.
getLessonById
();
this
.
getLessonById
();
}
}
// 归属部门列表
this
.
getTreeselect
();
},
},
mounted
()
{},
mounted
()
{},
methods
:
{
methods
:
{
// 添加课程
// 添加课程
addLessons
(
data
)
{
addLessons
(
data
)
{
console
.
log
(
"this.courseId"
,
this
.
courseId
);
if
(
!
this
.
courseId
)
{
if
(
!
this
.
courseId
)
{
console
.
log
(
"添加"
);
console
.
log
(
"添加"
);
return
add
Lessons
(
data
);
return
add
Bank
(
data
);
}
else
{
}
else
{
console
.
log
(
"修改"
);
console
.
log
(
"修改"
);
return
changeLesson
({
course
Id
:
this
.
courseId
,
...
data
});
return
updateBank
({
bank
Id
:
this
.
courseId
,
...
data
});
}
}
},
},
/** 查询部门下拉树结构 */
getTreeselect
()
{
treeselect
().
then
((
response
)
=>
{
this
.
deptOptions
=
response
.
data
;
console
.
log
(
this
.
deptOptions
);
});
},
// 当树形组件打开
treeOpen
()
{
document
.
querySelector
(
".vue-treeselect__control"
).
style
.
borderColor
=
""
;
},
// 当属性组件关闭
treeClose
(
a
,
b
)
{
if
(
!
a
)
{
// 手动添加报红功能,没值的时候报红
document
.
querySelector
(
".vue-treeselect__control"
).
style
.
borderColor
=
"red"
;
this
.
save
();
}
else
{
document
.
querySelector
(
".vue-treeselect__control"
).
style
.
borderColor
=
""
;
this
.
$refs
.
treeItem
.
clearValidate
();
}
},
select
()
{},
// 复现
// 复现
getLessonById
()
{
getLessonById
()
{
getLessonById
(
this
.
courseId
).
then
((
res
)
=>
{
getBank
(
this
.
courseId
).
then
((
res
)
=>
{
console
.
log
(
"res"
,
res
);
if
(
res
.
code
==
200
)
{
if
(
res
.
code
==
200
)
{
const
data
=
res
.
data
;
const
{
courseName
,
courseType
,
courseConent
,
video
,
enclosure
}
=
data
;
this
.
form
=
{
this
.
form
=
{
courseName
,
bankName
:
res
.
data
.
bankName
,
courseType
,
deptId
:
res
.
data
.
deptId
,
courseConent
,
video
,
enclosure
,
};
};
this
.
fileListVideo
=
[
// const data = res.data;
{
// const { bankName, courseType, courseConent, video, enclosure } =
name
:
courseName
+
"视频"
,
// data;
url
:
uploadfile
,
// this.form = {
},
// bankName,
];
// courseType,
this
.
fileListFile
=
[
// courseConent,
{
// video,
name
:
courseName
+
"附件"
,
// enclosure,
url
:
uploadfile
,
// };
},
// this.fileListVideo = [
];
// {
// name: bankName + "视频",
// url: uploadfile,
// },
// ];
// this.fileListFile = [
// {
// name: bankName + "附件",
// url: uploadfile,
// },
// ];
}
}
});
});
},
},
...
@@ -207,35 +259,46 @@ export default {
...
@@ -207,35 +259,46 @@ export default {
},
},
save
(
num
=
2
)
{
save
(
num
=
2
)
{
// 因为富文本编辑器会残留
<
p
><
br
><
/p>,所以要清
空
// 因为富文本编辑器会残留
<
p
><
br
><
/p>,所以要清
空
if
(
this
.
form
.
courseConent
===
"<p><br></p>"
)
{
//
if (this.form.courseConent === "
<
p
><
br
><
/p>"
)
{
this
.
form
.
courseConent
=
""
;
//
this.form.courseConent = "";
}
//
}
this
.
$refs
.
form
.
validate
((
valid
)
=>
{
this
.
$refs
.
form
.
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
// console.log(this.form);
this
.
addLessons
({
...
this
.
form
}).
then
((
res
)
=>
{
this
.
addLessons
({
...
this
.
form
}).
then
((
res
)
=>
{
// 如果添加会传回来,就用传回来的,如果是修改本身就有,就用本身的
// 如果添加会传回来,就用传回来的,如果是修改本身就有,就用本身的
const
courseId
=
res
.
data
||
this
.
courseId
;
// console.log('res',res)
if
(
res
.
code
==
200
)
{
const
courseId
=
this
.
courseId
||
res
;
// 这样调比较纯函数一点
// if (res.code == 200) {
if
(
num
==
2
)
{
// 这样调比较纯函数一点
this
.
$message
({
if
(
num
==
2
)
{
message
:
"保存课程成功"
,
this
.
$message
({
type
:
"success"
,
message
:
"保存题库成功"
,
});
type
:
"success"
,
}
else
if
(
num
==
3
)
{
});
this
.
$message
({
}
else
if
(
num
==
3
)
{
message
:
"保存课程成功,请开始录入题目"
,
this
.
$message
({
type
:
"success"
,
message
:
"保存题库成功,请开始录入题目"
,
});
type
:
"success"
,
}
});
this
.
$parent
.
$parent
.
componentsNumChange
(
num
);
this
.
$parent
.
$parent
.
changeCourseId
(
courseId
);
this
.
$parent
.
$parent
.
$parent
.
getList
();
return
true
;
}
}
this
.
$parent
.
$parent
.
componentsNumChange
(
num
);
this
.
$parent
.
$parent
.
changeCourseId
(
courseId
);
this
.
$parent
.
$parent
.
$parent
.
getList
();
return
true
;
// }
});
});
}
else
{
if
(
!
this
.
form
.
deptId
)
{
document
.
querySelector
(
".vue-treeselect__control"
).
style
.
borderColor
=
"red"
;
}
else
{
document
.
querySelector
(
".vue-treeselect__control"
).
style
.
borderColor
=
""
;
this
.
$refs
.
treeItem
.
clearValidate
();
}
}
}
});
});
},
},
...
@@ -250,8 +313,8 @@ export default {
...
@@ -250,8 +313,8 @@ export default {
.form-wrapper
{
.form-wrapper
{
padding-top
:
22px
;
padding-top
:
22px
;
width
:
100%
;
width
:
100%
;
height
:
55
0px
;
height
:
10
0px
;
overflow
:
hidden
;
//
overflow: hidden;
// padding-bottom: 10px;
// padding-bottom: 10px;
margin-bottom
:
20px
;
margin-bottom
:
20px
;
...
...
danger-manage-web/src/views/educationPlanExam/questionBank/components/QuestionList.vue
View file @
f7b9295f
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 17:56:05
* @Date: 2022-09-22 17:56:05
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-
09-28 17:54:16
* @LastEditTime: 2022-
12-16 10:23:13
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/QuestionList.vue
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/QuestionList.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
-->
...
@@ -10,9 +10,9 @@
...
@@ -10,9 +10,9 @@
<div
ref=
"myBody"
class=
"add-question flex"
>
<div
ref=
"myBody"
class=
"add-question flex"
>
<div
class=
"text flex"
>
<div
class=
"text flex"
>
<div
class=
"left"
>
<div
class=
"left"
>
目前有
<span>
{{
questionNum
}}
</span
目前有
<span>
{{
questionNum
||
0
}}
</span
>
道题
>
道题
<
span
class=
"warn"
>
温馨提示:发布课程前需要进行考试设置
</span
>
<
!--
<span
class=
"warn"
>
温馨提示:发布课程前需要进行考试设置
</span>
--
>
</div>
</div>
<div
class=
"right"
>
{{
courseName
}}
</div>
<div
class=
"right"
>
{{
courseName
}}
</div>
</div>
</div>
...
@@ -51,8 +51,9 @@
...
@@ -51,8 +51,9 @@
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"rightNum flex"
>
<!--
<div
class=
"rightNum flex"
>
<div
class=
"left"
>
考试设置
</div>
<div
class=
"left"
>
录入考题
</div>
<div
class=
"middle flex"
>
<div
class=
"middle flex"
>
<div
class=
"left-text"
>
答对题目大于
</div>
<div
class=
"left-text"
>
答对题目大于
</div>
<div>
<div>
...
@@ -72,8 +73,8 @@
...
@@ -72,8 +73,8 @@
type=
"success"
type=
"success"
>
保存
</el-button
>
保存
</el-button
>
>
</div>
</div>
</div>
</div>
-->
</div>
</div>
</
template
>
</
template
>
...
...
danger-manage-web/src/views/educationPlanExam/questionBank/index.vue
View file @
f7b9295f
...
@@ -69,32 +69,33 @@
...
@@ -69,32 +69,33 @@
</el-row>
</el-row>
<el-table
v-loading=
"loading"
:data=
"lessonsList"
>
<el-table
v-loading=
"loading"
:data=
"lessonsList"
>
<el-table-column
label=
"课程标题"
align=
"center"
prop=
"courseName"
/>
<el-table-column
label=
"题库序号"
align=
"center"
prop=
"bankNum"
/>
<el-table-column
label=
"课程类别"
align=
"center"
prop=
"courseType"
>
<el-table-column
label=
"题库名称"
align=
"center"
prop=
"bankName"
>
</el-table-column>
<el-table-column
label=
"所属单位"
align=
"center"
prop=
"courseType"
>
<template
v-slot=
"scope"
>
<template
v-slot=
"scope"
>
<div>
<div>
{{
{{
selectList
(
deptOptions
,
scope
.
row
.
deptId
)
||
'-'
}}
scope
.
row
.
courseType
&&
courseOptions
.
filter
(
(
item
)
=>
item
.
planId
==
scope
.
row
.
courseType
)[
0
]
&&
courseOptions
.
filter
(
(
item
)
=>
item
.
planId
==
scope
.
row
.
courseType
)[
0
].
planName
}}
</div>
</div>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"课程状态"
align=
"center"
prop=
"status"
>
<
template
v-slot=
"scope"
>
<div>
{{
[
"未发布"
,
"已发布"
][
scope
.
row
.
status
]
}}
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"附件"
align=
"center"
prop=
"enclosure"
>
<el-table-column
label=
"附件"
align=
"center"
prop=
"enclosure"
>
<
template
v-slot=
"{ row: { enclosure } }"
>
<
template
v-slot=
"{ row: { enclosure } }"
>
<a
v-if=
"enclosure && enclosure.indexOf('.txt')>=0"
@
click=
"downloadText(enclosure)"
class=
"down-load"
>
下载附件
</a>
<a
v-if=
"enclosure && enclosure.indexOf('.txt') >= 0"
@
click=
"downloadText(enclosure)"
class=
"down-load"
>
下载附件
</a
>
<a
v-else
:href=
"enclosure"
class=
"down-load"
>
下载附件
</a>
<a
v-else
:href=
"enclosure"
class=
"down-load"
>
下载附件
</a>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"视频"
align=
"center"
prop=
"video"
>
<
!-- <
el-table-column label="视频" align="center" prop="video">
<template v-slot="{ row: { courseName, video } }">
<template v-slot="{ row: { courseName, video } }">
<a @click="downLoadVideo(video, courseName)" class="down-load"
<a @click="downLoadVideo(video, courseName)" class="down-load"
>下载视频</a
>下载视频</a
...
@@ -106,15 +107,15 @@
...
@@ -106,15 +107,15 @@
align="center"
align="center"
prop="releaseTime"
prop="releaseTime"
:formatter="formatter"
:formatter="formatter"
/>
/>
-->
<el-table-column
<el-table-column
label=
"考试题"
label=
"考试题
数量
"
align=
"center"
align=
"center"
prop=
"topicNum"
prop=
"topicNum"
width=
"180"
width=
"180"
>
>
<
template
v-slot=
"{ row: { topicNum,
course
Id } }"
>
<
template
v-slot=
"{ row: { topicNum,
bank
Id } }"
>
<div
@
click=
"checkQuestion(
course
Id)"
class=
"timuNum"
>
<div
@
click=
"checkQuestion(
bank
Id)"
class=
"timuNum"
>
<div
v-if=
"topicNum > 0"
>
{{
`已录入${topicNum
}
题`
}}
<
/div
>
<div
v-if=
"topicNum > 0"
>
{{
`已录入${topicNum
}
题`
}}
<
/div
>
<
div
v
-
else
>
未录入
<
/div
>
<
div
v
-
else
>
未录入
<
/div
>
<
/div
>
<
/div
>
...
@@ -125,31 +126,30 @@
...
@@ -125,31 +126,30 @@
align
=
"center"
align
=
"center"
class
-
name
=
"small-padding fixed-width"
class
-
name
=
"small-padding fixed-width"
>
>
<
template
v
-
slot
=
"{ row: {
status, course
Id
}
}
"
>
<
template
v
-
slot
=
"{ row: {
bank
Id
}
}
"
>
<!--
<
div
>
{{
status
}}
<
/div> --
>
<!--
<
div
>
{{
status
}}
<
/div> --
>
<
el
-
button
<
el
-
button
v
-
if
=
"status == 0"
size
=
"mini"
size
=
"mini"
type
=
"text"
type
=
"text"
icon
=
"el-icon-edit"
icon
=
"el-icon-edit"
@
click
=
"change
Lesson(course
Id)"
@
click
=
"change
Bank(bank
Id)"
>
修改
<
/el-butto
n
>
编辑
<
/el-butto
n
>
>
<
el
-
button
<
el
-
button
size
=
"mini"
size
=
"mini"
type
=
"text"
type
=
"text"
icon
=
"el-icon-delete"
icon
=
"el-icon-delete"
@
click
=
"delet
Lesson(course
Id)"
@
click
=
"delet
Bank(bank
Id)"
>
删除
<
/el-butto
n
>
删除
<
/el-butto
n
>
>
<
el
-
button
<
!--
<
el
-
button
v
-
if
=
"status == 0"
v
-
if
=
"status == 0"
size
=
"mini"
size
=
"mini"
type
=
"text"
type
=
"text"
icon
=
"el-icon-delete"
icon
=
"el-icon-delete"
@
click
=
"issueLesson(
course
Id)"
@
click
=
"issueLesson(
bank
Id)"
>
发布
<
/el-butto
n
>
发布
<
/el-butto
n
>
>
-->
<
/template
>
<
/template
>
<
/el-table-column
>
<
/el-table-column
>
<
/el-table
>
<
/el-table
>
...
@@ -164,9 +164,11 @@
...
@@ -164,9 +164,11 @@
<
Dia
<
Dia
ref
=
"Dia"
ref
=
"Dia"
:
componentsNum
.
sync
=
"componentsNum"
:
componentsNum
.
sync
=
"componentsNum"
:
courseId
.
sync
=
"
course
Id"
:
courseId
.
sync
=
"
bank
Id"
:
visible
.
sync
=
"dilogFlag"
:
visible
.
sync
=
"dilogFlag"
/>
/>
<
el
-
dialog
>
<
/el-dialog
>
<
/div
>
<
/div
>
<
/template
>
<
/template
>
...
@@ -177,6 +179,10 @@ import {
...
@@ -177,6 +179,10 @@ import {
issue
,
issue
,
deleteLesson
,
deleteLesson
,
}
from
"@/api/educationPlanExam/lessonsProgram.js"
;
}
from
"@/api/educationPlanExam/lessonsProgram.js"
;
import
{
listBank
,
delBank
}
from
"@/api/system/questionBank.js"
;
// 部门列表
import
{
treeselect
}
from
"@/api/system/dept"
;
// 获取课程类型
// 获取课程类型
import
{
getPlanList
}
from
"@/api/educationPlanExam/trainingProgram"
;
import
{
getPlanList
}
from
"@/api/educationPlanExam/trainingProgram"
;
import
{
mapGetters
,
mapMutations
}
from
"vuex"
;
import
{
mapGetters
,
mapMutations
}
from
"vuex"
;
...
@@ -211,7 +217,12 @@ export default {
...
@@ -211,7 +217,12 @@ export default {
dilogFlag
:
false
,
dilogFlag
:
false
,
componentsNum
:
1
,
componentsNum
:
1
,
// 点击的id,如果是新增为空
// 点击的id,如果是新增为空
courseId
:
null
,
bankId
:
null
,
// 题库id
deptId
:
null
,
// 归属部门列表
deptOptions
:
[],
}
;
}
;
}
,
}
,
computed
:
{
computed
:
{
...
@@ -219,11 +230,36 @@ export default {
...
@@ -219,11 +230,36 @@ export default {
}
,
}
,
created
()
{
created
()
{
this
.
getPlanList
();
this
.
getPlanList
();
this
.
getTreeselect
();
this
.
getList
();
this
.
getList
();
}
,
}
,
methods
:
{
methods
:
{
...
mapMutations
({
setOptions
:
"SET_COURSE_OPTIONS"
}
),
...
mapMutations
({
setOptions
:
"SET_COURSE_OPTIONS"
}
),
/** 查询部门下拉树结构 */
getTreeselect
()
{
treeselect
().
then
((
response
)
=>
{
this
.
deptOptions
=
response
.
data
;
// console.log("123", this.deptOptions);
// console.log(this.selectList(this.deptOptions, 175));
}
);
}
,
// 递归查值的方法
selectList
(
list
,
id
)
{
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
)
{
let
item
=
list
[
i
];
if
(
item
.
id
==
id
)
{
return
item
.
label
;
}
else
{
if
(
Array
.
isArray
(
item
.
children
))
{
let
a
=
this
.
selectList
(
item
.
children
,
id
);
if
(
a
)
{
return
a
;
}
}
}
}
}
,
// 获取课程类别,也就是计划名称
// 获取课程类别,也就是计划名称
getPlanList
()
{
getPlanList
()
{
getPlanList
().
then
((
res
)
=>
{
getPlanList
().
then
((
res
)
=>
{
...
@@ -241,10 +277,18 @@ export default {
...
@@ -241,10 +277,18 @@ export default {
/** 查询课程列表 */
/** 查询课程列表 */
getList
()
{
getList
()
{
this
.
loading
=
true
;
this
.
loading
=
true
;
getLessons
(
this
.
queryParams
)
listBank
(
this
.
queryParams
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
// console.log(res);
console
.
log
(
res
);
this
.
lessonsList
=
res
.
rows
;
this
.
lessonsList
=
res
.
rows
.
map
((
item
,
index
)
=>
{
return
{
bankNum
:
index
+
1
+
(
this
.
queryParams
.
pageNum
-
1
)
*
this
.
queryParams
.
pageSize
,
...
item
,
}
;
}
);
this
.
total
=
res
.
total
;
this
.
total
=
res
.
total
;
}
)
}
)
.
finally
(()
=>
{
.
finally
(()
=>
{
...
@@ -257,23 +301,23 @@ export default {
...
@@ -257,23 +301,23 @@ export default {
}
,
}
,
/** 新增按钮操作 */
/** 新增按钮操作 */
handleAdd
()
{
handleAdd
()
{
this
.
$refs
.
Dia
.
title
=
"新增
课程
"
;
this
.
$refs
.
Dia
.
title
=
"新增
题库
"
;
this
.
componentsNum
=
1
;
this
.
componentsNum
=
1
;
this
.
course
Id
=
null
;
this
.
bank
Id
=
null
;
this
.
dilogFlag
=
true
;
this
.
dilogFlag
=
true
;
}
,
}
,
change
Lesson
(
course
Id
)
{
change
Bank
(
bank
Id
)
{
this
.
$refs
.
Dia
.
title
=
"修改
课程
"
;
this
.
$refs
.
Dia
.
title
=
"修改
题库
"
;
this
.
componentsNum
=
1
;
this
.
componentsNum
=
1
;
this
.
courseId
=
course
Id
;
this
.
bankId
=
bank
Id
;
this
.
dilogFlag
=
true
;
this
.
dilogFlag
=
true
;
}
,
}
,
// 直接查看考题
// 直接查看考题
checkQuestion
(
course
Id
)
{
checkQuestion
(
bank
Id
)
{
// 要查看考题的id
// 要查看考题的id
this
.
courseId
=
course
Id
;
this
.
bankId
=
bank
Id
;
console
.
log
(
this
.
course
Id
);
console
.
log
(
this
.
bank
Id
);
// 2代表列表组件
// 2代表列表组件
this
.
componentsNum
=
2
;
this
.
componentsNum
=
2
;
this
.
dilogFlag
=
true
;
this
.
dilogFlag
=
true
;
...
@@ -293,14 +337,14 @@ export default {
...
@@ -293,14 +337,14 @@ export default {
releaseTime
:
""
,
releaseTime
:
""
,
}
;
}
;
}
,
}
,
delet
Lesson
(
course
Id
)
{
delet
Bank
(
bank
Id
)
{
this
.
$confirm
(
"请确定删除"
,
{
this
.
$confirm
(
"请确定删除"
,
{
confirmButtonText
:
"确定"
,
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
,
type
:
"warning"
,
}
)
}
)
.
then
(()
=>
{
.
then
(()
=>
{
return
del
eteLesson
(
course
Id
);
return
del
Bank
(
bank
Id
);
}
)
}
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
if
(
res
.
code
==
200
)
{
...
@@ -314,43 +358,43 @@ export default {
...
@@ -314,43 +358,43 @@ export default {
.
catch
(()
=>
{
}
);
.
catch
(()
=>
{
}
);
}
,
}
,
// 发布
// 发布
issueLesson
(
course
Id
)
{
// issueLesson(bank
Id)
{
this
.
$confirm
(
"请确定发布"
,
{
//
this.$confirm("请确定发布",
{
confirmButtonText
:
"确定"
,
//
confirmButtonText: "确定",
cancelButtonText
:
"取消"
,
//
cancelButtonText: "取消",
type
:
"warning"
,
//
type: "warning",
}
)
//
}
)
.
then
(()
=>
{
//
.then(() =>
{
// 判断是否录入答题合格数
//
// 判断是否录入答题合格数
return
getLessonById
(
course
Id
);
// return getLessonById(bank
Id);
}
)
//
}
)
.
then
((
res
)
=>
{
//
.then((res) =>
{
if
(
res
.
data
.
qualifiedNum
>
0
)
{
//
if (res.data.qualifiedNum > 0)
{
return
true
;
//
return true;
}
//
}
}
)
//
}
)
.
then
((
res
)
=>
{
//
.then((res) =>
{
if
(
res
)
{
//
if (res)
{
// 成功就发布
//
// 成功就发布
return
issue
({
course
Id
}
);
// return issue(
{
bank
Id
}
);
}
else
{
//
}
else
{
this
.
$message
({
//
this.$message(
{
message
:
"请先录入答题合格数"
,
//
message: "请先录入答题合格数",
type
:
"warning"
,
//
type: "warning",
}
);
//
}
);
}
//
}
}
)
//
}
)
.
then
((
res
)
=>
{
//
.then((res) =>
{
if
(
res
.
code
==
200
)
{
//
if (res.code == 200)
{
this
.
$message
({
//
this.$message(
{
message
:
"发布成功"
,
//
message: "发布成功",
type
:
"success"
,
//
type: "success",
}
);
//
}
);
this
.
getList
();
//
this.getList();
}
//
}
}
)
//
}
)
.
catch
(()
=>
{
}
);
//
.catch(() =>
{
}
);
}
,
//
}
,
formatter
(
row
,
column
,
cellValue
,
index
)
{
formatter
(
row
,
column
,
cellValue
,
index
)
{
// console.log(row, column, cellValue, index);
// console.log(row, column, cellValue, index);
if
(
!
cellValue
)
return
"-"
;
if
(
!
cellValue
)
return
"-"
;
...
...
danger-manage-web/vue.config.js
View file @
f7b9295f
...
@@ -35,7 +35,7 @@ module.exports = {
...
@@ -35,7 +35,7 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy
// detail: https://cli.vuejs.org/config/#devserver-proxy
[
process
.
env
.
VUE_APP_BASE_API
]:
{
[
process
.
env
.
VUE_APP_BASE_API
]:
{
target
:
process
.
env
.
VUE_APP_TARGET
,
target
:
process
.
env
.
VUE_APP_TARGET
,
//target: `http://192.168.31.87
:8908/dangerManage`,
target
:
`http://192.168.2.2
:8908/dangerManage`
,
changeOrigin
:
true
,
changeOrigin
:
true
,
pathRewrite
:
{
pathRewrite
:
{
[
'^'
+
process
.
env
.
VUE_APP_BASE_API
]:
''
[
'^'
+
process
.
env
.
VUE_APP_BASE_API
]:
''
...
...
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