Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
提交
打开侧边栏
com.pica.cloud.education.frontend
pica.cloud.web-education-admin
提交
585892a0
提交
585892a0
编写于
3月 15, 2019
作者:
huangwensu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增组件问题修复
上级
c84f99e6
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
34 行增加
和
25 行删除
+34
-25
create-component.vue
src/views/education/create-component.vue
+34
-25
未找到文件。
src/views/education/create-component.vue
浏览文件 @
585892a0
...
...
@@ -154,7 +154,7 @@
v-for=
"(itemTest,indexTest) in testIdSelect"
:key=
"indexTest"
:label=
"itemTest.onlineExamName"
:value=
"itemTest.id"
>
:value=
"itemTest.id
+ ''
"
>
</el-option>
</el-select>
</el-form-item>
...
...
@@ -178,7 +178,7 @@
v-for=
"(itemCertificate,indexCertificate) in certificateIdSelect"
:key=
"indexCertificate"
:label=
"itemCertificate.name"
:value=
"itemCertificate.id"
>
:value=
"itemCertificate.id
+ ''
"
>
</el-option>
</el-select>
</el-form-item>
...
...
@@ -206,7 +206,7 @@
v-for=
"(itemCourse,indexCourse) in courseIdSelect"
:key=
"indexCourse"
:label=
"itemCourse.name"
:value=
"itemCourse.id"
>
:value=
"itemCourse.id
+ ''
"
>
</el-option>
</el-select>
</el-form-item>
...
...
@@ -287,7 +287,7 @@ import BreadCrumb from '../../components/breadcrumb.vue'
import
{
doUpload
,
getFilePath
}
from
"../../utils/qiniuUtil"
import
{
validateWord150
}
from
"../../utils/validate.js"
import
{
mapGetters
}
from
'vuex'
import
{
openLoading
,
closeLoading
}
from
'../../utils/utils'
;
import
{
openLoading
,
closeLoading
,
isNotEmptyUtils
}
from
'../../utils/utils'
;
let
vm
=
null
// 判断组件是否重名
let
validateRepeatWord
=
function
(
rule
,
value
,
callback
,
message
)
{
...
...
@@ -385,6 +385,7 @@ export default {
dialogData
:
[],
portalComponent
:
{
idType
:
1
,
organizationId
:
''
,
name
:
''
,
id
:
''
,
introduce
:
''
,
...
...
@@ -518,13 +519,13 @@ export default {
}
else
{
vm
.
isStorage
=
false
}
vm
.
submitBasic
(
url
)
vm
.
submitBasic
(
flag
,
url
)
}
else
{
// 下一步
vm
.
isStorage
=
false
vm
.
portalComponent
.
status
=
''
vm
.
$refs
.
basicInfoForm
.
validate
((
valid
)
=>
{
if
(
valid
)
{
vm
.
submitBasic
(
url
)
vm
.
submitBasic
(
flag
,
url
)
}
else
{
return
false
;
}
...
...
@@ -534,17 +535,20 @@ export default {
componentName
()
{
vm
.
isStorage
=
false
},
submitBasic
(
url
)
{
submitBasic
(
flag
,
url
)
{
vm
.
portalComponent
.
idType
=
vm
.
idType
vm
.
POST
(
url
,{
model
:
vm
.
portalComponent
}).
then
((
res
)
=>
{
if
(
res
.
code
==
'000000'
)
{
if
(
!
vm
.
componentId
)
{
vm
.
componentId
=
res
.
data
}
vm
.
stepNum
=
2
vm
.
getTemplateData
()
vm
.
getModuleData
()
vm
.
getTestListData
()
vm
.
getCourseData
()
if
(
flag
==
2
)
{
vm
.
stepNum
=
2
vm
.
getTemplateData
()
vm
.
getModuleData
()
vm
.
getTestListData
()
vm
.
getCourseData
()
}
}
})
},
...
...
@@ -720,6 +724,7 @@ export default {
vm
.
templetIndex
=
vm
.
componentList
.
moduleModelList
[
index
].
templetModelList
.
length
vm
.
componentList
.
moduleModelList
[
index
].
templetModelList
.
push
({
name
:
item
.
name
,
type
:
item
.
type
,
partModelList
:
[]
})
for
(
let
i
=
0
;
i
<
item
.
partConfigModelList
.
length
;
i
++
)
{
...
...
@@ -757,8 +762,8 @@ export default {
partContentModelList
:
[{
id
:
''
,
seqNo
:
''
,
content
_
1
:
''
,
content
_
2
:
''
content1
:
''
,
content2
:
''
}]
})
}
...
...
@@ -859,12 +864,12 @@ export default {
}
}
},
// 完成
// 完成
(暂存)
finishConponent
(
flag
)
{
let
req
=
null
if
(
vm
.
componentList
.
moduleModelList
&&
vm
.
componentList
.
moduleModelList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
vm
.
componentList
.
moduleModelList
.
length
;
i
++
)
{
if
(
flag
==
2
)
{
if
(
flag
==
2
)
{
// 完成
req
=
{
id
:
vm
.
componentId
,
status
:
2
...
...
@@ -877,22 +882,22 @@ export default {
vm
.
$message
.
info
(
"请给第"
+
parseInt
(
i
+
1
)
+
"个模块添加有效模板后再保存"
)
return
}
}
else
{
}
else
{
// 暂存
req
=
{
id
:
vm
.
componentId
,
status
:
1
}
}
vm
.
componentList
.
moduleModelList
[
i
].
componentId
=
vm
.
componentId
vm
.
finishModule
(
req
)
}
vm
.
finishModule
(
req
,
flag
)
}
else
{
vm
.
$message
.
info
(
"请添加有效模块后再保存"
)
return
}
},
finishModule
(
req
)
{
vm
.
POST
(
'portalComponent/insertOrUpdatePortalModule'
,{
model
:
vm
.
componentList
.
moduleModelList
}).
then
((
res
)
=>
{
finishModule
(
req
,
flag
)
{
vm
.
POST
(
'portalComponent/insertOrUpdatePortalModule'
,{
model
:
vm
.
componentList
.
moduleModelList
,
status
:
flag
}).
then
((
res
)
=>
{
if
(
res
.
code
==
'000000'
)
{
vm
.
enableComponent
(
req
)
}
...
...
@@ -931,14 +936,14 @@ export default {
}
}
},
// 确定选择
模板
// 确定选择
预设模块
submitDialog
()
{
vm
.
columnFormVisible
=
false
let
flag
=
fals
e
if
(
vm
.
dialogData
&&
vm
.
dialogData
.
length
>
0
)
{
let
flag
=
tru
e
if
(
isNotEmptyUtils
(
vm
.
dialogData
)
)
{
for
(
let
i
=
0
;
i
<
vm
.
componentList
.
moduleModelList
.
length
;
i
++
)
{
if
(
vm
.
componentList
.
moduleModelList
[
i
].
id
==
vm
.
dialogData
.
id
)
{
flag
=
tru
e
flag
=
fals
e
vm
.
$confirm
(
'该模块已经被添加到本组件,是否还需要再添加一次?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
...
...
@@ -946,7 +951,9 @@ export default {
type
:
'warning'
}).
then
(()
=>
{
vm
.
dialogData
.
moduleType
=
2
vm
.
dialogData
.
mappingId
=
''
vm
.
componentList
.
moduleModelList
.
push
(
vm
.
dialogData
)
vm
.
firstTab
=
vm
.
componentList
.
moduleModelList
.
length
+
''
}).
catch
(()
=>
{
vm
.
$message
({
type
:
'info'
,
...
...
@@ -956,9 +963,11 @@ export default {
break
}
}
if
(
!
flag
)
{
if
(
flag
)
{
vm
.
dialogData
.
moduleType
=
2
vm
.
dialogData
.
mappingId
=
''
vm
.
componentList
.
moduleModelList
.
push
(
vm
.
dialogData
)
vm
.
firstTab
=
vm
.
componentList
.
moduleModelList
.
length
+
''
}
}
}
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录