Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
提交
打开侧边栏
com.pica.cloud.education.frontend
pica.cloud.web-education-admin
提交
af80fcec
提交
af80fcec
编写于
5月 26, 2020
作者:
guangjun.yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改与查看
上级
f16572db
变更
9
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
2431 行增加
和
433 行删除
+2431
-433
course-list.vue
src/components/education/custom/course-list.vue
+38
-34
custom-baseinfo 0526-0910.vue
...components/education/custom/custom-baseinfo 0526-0910.vue
+1066
-0
custom-baseinfo 0526-1058.vue
...components/education/custom/custom-baseinfo 0526-1058.vue
+1000
-0
custom-baseinfo.vue
src/components/education/custom/custom-baseinfo.vue
+50
-156
shopping-cart.vue
src/components/education/custom/shopping-cart.vue
+11
-21
sorted-cart.vue
src/components/education/custom/sorted-cart.vue
+48
-15
customStore.js
src/store/custom/customStore.js
+1
-1
edit-custom.vue
src/views/education/edit-custom.vue
+207
-169
item-manager.vue
src/views/education/item-manager.vue
+10
-37
未找到文件。
src/components/education/custom/course-list.vue
浏览文件 @
af80fcec
...
@@ -34,20 +34,26 @@
...
@@ -34,20 +34,26 @@
@
click=
"toggleChecked(item)"
@
click=
"toggleChecked(item)"
>
>
<div
class=
"img"
>
<div
class=
"img"
>
<img
src=
"../../../assets/custom/test.png
"
alt
/>
<img
:src=
"item.courseImageUrl
"
alt
/>
<span
class=
"level"
>
{{
item
.
typeStr
}}
</span>
<span
class=
"level"
>
{{
item
.
typeStr
}}
</span>
</div>
</div>
<div
class=
"detail"
>
<div
class=
"detail"
>
<span
class=
"title"
>
{{
item
.
courseName
|
shortName
}}
</span>
<span
class=
"title"
>
{{
item
.
courseName
|
shortName
}}
</span>
<div
class=
"chapter"
>
<div
class=
"chapter"
>
<span>
{{
item
.
docName
}}
</span><span
class=
"section-num"
>
{{
item
.
chapterSum
}}
章
{{
item
.
lectureNum
}}
节
{{
item
.
totalTime
}}
分
</span><span
v-if=
"true"
class=
"exam-num"
>
5场考试
</span>
<span>
{{
item
.
docName
|
shortName
(
5
)
}}
</span>
<span
class=
"section-num"
>
{{
item
.
chapterSum
}}
章
{{
item
.
lectureNum
}}
节
{{
item
.
totalTime
}}
分
</span>
<span
v-if=
"item.testCount"
class=
"exam-num"
>
{{
item
.
testCount
}}
场考试
</span>
</div>
</div>
<div
class=
"cost"
>
<div
class=
"cost"
>
<span
class=
"no"
>
免费
</span>
<span
class=
"no"
>
免费
</span>
<span
class=
"num"
>
{{
item
.
joinNum
}}
人已学
</span>
<span
class=
"num"
>
{{
item
.
joinNum
}}
人已学
</span>
</div>
</div>
</div>
</div>
<img
v-show=
"item.checked"
class=
"course-selected"
src=
"../../../assets/custom/icon/icon-selected.png"
alt
/>
<img
v-show=
"item.checked"
class=
"course-selected"
src=
"../../../assets/custom/icon/icon-selected.png"
/>
</li>
</li>
</ul>
</ul>
</div>
</div>
...
@@ -69,75 +75,73 @@
...
@@ -69,75 +75,73 @@
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
ShoppingCart
from
'@/components/education/custom/shopping-cart'
import
ShoppingCart
from
"@/components/education/custom/shopping-cart"
;
import
dialog
from
"@/components/education/custom/dialog"
;
import
dialog
from
"@/components/education/custom/dialog"
;
import
{
mapGetters
,
mapActions
}
from
'vuex'
import
{
mapGetters
,
mapActions
}
from
"vuex"
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
isRise
:
true
,
isRise
:
true
,
isShowCart
:
false
,
isShowCart
:
false
,
dialogObj
:
{
dialogObj
:
{
title
:
'课程数量已达上限'
,
title
:
"课程数量已达上限"
,
visible
:
false
,
visible
:
false
,
message
:
'单个项目最多只能选择30个课程'
,
message
:
"单个项目最多只能选择30个课程"
,
// tip: '单个项目最多只能选择30个课程'
,
tip
:
""
,
hideMsg
:
'我知道了'
hideMsg
:
"我知道了"
}
}
};
};
},
},
computed
:
{
computed
:
{
...
mapGetters
([
'cartList'
,
'courseList'
,
'searchParam'
])
...
mapGetters
([
"cartList"
,
"courseList"
,
"searchParam"
])
},
},
components
:
{
components
:
{
ShoppingCart
,
ShoppingCart
,
dialogComponet
:
dialog
,
dialogComponet
:
dialog
},
},
methods
:
{
methods
:
{
...
mapActions
([
'setCartList'
,
'setSeachParam'
]),
...
mapActions
([
"setCartList"
,
"setSearchParam"
]),
toggleOrder
()
{
toggleOrder
()
{
this
.
isRise
=
!
this
.
isRise
;
this
.
isRise
=
!
this
.
isRise
;
let
dir
=
this
.
isRise
?
1
:
2
;
let
dir
=
this
.
isRise
?
1
:
2
;
this
.
searchParam
.
dir
=
dir
;
this
.
searchParam
.
dir
=
dir
;
this
.
setSeachParam
(
this
.
searchParam
);
this
.
setSea
r
chParam
(
this
.
searchParam
);
},
},
toggleCart
()
{
toggleCart
()
{
this
.
isShowCart
=
!
this
.
isShowCart
;
this
.
isShowCart
=
!
this
.
isShowCart
;
},
},
// 选择当前分页个数
// 选择当前分页个数
handleSizeChange
(
val
)
{
handleSizeChange
(
val
)
{
this
.
searchParam
.
pageSize
=
val
;
this
.
searchParam
.
pageSize
=
val
;
this
.
setSeachParam
(
this
.
searchParam
);
this
.
setSea
r
chParam
(
this
.
searchParam
);
},
},
// 选择当前分页
// 选择当前分页
handleCurrentChange
(
val
)
{
handleCurrentChange
(
val
)
{
this
.
searchParam
.
pageNo
=
val
;
this
.
searchParam
.
pageNo
=
val
;
this
.
setSeachParam
(
this
.
searchParam
);
this
.
setSea
r
chParam
(
this
.
searchParam
);
},
},
// 选择课程(并要处理过滤,删除等)
// 选择课程(并要处理过滤,删除等)
toggleChecked
(
item
)
{
toggleChecked
(
item
)
{
item
.
checked
=
!
item
.
checked
;
item
.
checked
=
!
item
.
checked
;
if
(
item
.
checked
)
{
if
(
item
.
checked
)
{
if
(
this
.
cartList
.
length
>=
30
)
{
if
(
this
.
cartList
.
length
>=
30
)
{
item
.
checked
=
!
item
.
checked
;
item
.
checked
=
!
item
.
checked
;
this
.
dialogObj
.
visible
=
true
;
this
.
dialogObj
.
visible
=
true
;
return
;
return
;
}
}
this
.
cartList
.
push
(
item
);
this
.
cartList
.
push
(
item
);
}
else
{
}
else
{
let
delItemIndex
=
this
.
cartList
.
findIndex
(
course
=>
{
let
delItemIndex
=
this
.
cartList
.
findIndex
(
course
=>
{
return
course
.
courseId
==
item
.
courseId
;
return
course
.
courseId
==
item
.
courseId
;
})
})
;
this
.
cartList
.
splice
(
delItemIndex
,
1
);
this
.
cartList
.
splice
(
delItemIndex
,
1
);
}
}
this
.
setCartList
(
this
.
cartList
);
this
.
setCartList
(
this
.
cartList
);
this
.
$forceUpdate
();
this
.
$forceUpdate
();
},
}
}
}
};
};
</
script
>
</
script
>
...
@@ -193,6 +197,9 @@ export default {
...
@@ -193,6 +197,9 @@ export default {
right: -12px;
right: -12px;
display: inline-block;
display: inline-block;
span {
span {
display: inline-block;
min-width: 18px;
text-align: center;
font-size: 12px;
font-size: 12px;
padding: 2px;
padding: 2px;
background: red;
background: red;
...
@@ -209,7 +216,6 @@ export default {
...
@@ -209,7 +216,6 @@ export default {
z-index: 100;
z-index: 100;
}
}
}
}
}
}
}
}
.list-wrapper {
.list-wrapper {
...
@@ -218,14 +224,12 @@ export default {
...
@@ -218,14 +224,12 @@ export default {
.list {
.list {
display: flex;
display: flex;
flex-direction: row;
flex-direction: row;
// justify-content: space-between;
justify-content: flex-start;
justify-content: flex-start;
flex-wrap: wrap;
flex-wrap: wrap;
padding-bottom: 30px;
padding-bottom: 30px;
// min-height: 1200px;
// max-height: 1200px;
overflow-y: auto;
overflow-y: auto;
.course {
.course {
user-select: none;
cursor: pointer;
cursor: pointer;
position: relative;
position: relative;
top: 0;
top: 0;
...
@@ -284,8 +288,9 @@ export default {
...
@@ -284,8 +288,9 @@ export default {
font-size: 14px;
font-size: 14px;
font-weight: 400;
font-weight: 400;
color: #999999;
color: #999999;
.section-num::before, .exam-num::before {
.section-num::before,
content: '';
.exam-num::before {
content: "";
position: relative;
position: relative;
top: 2.5px;
top: 2.5px;
left: 0;
left: 0;
...
@@ -329,6 +334,5 @@ export default {
...
@@ -329,6 +334,5 @@ export default {
margin: 10px 0;
margin: 10px 0;
margin-right: 230px;
margin-right: 230px;
}
}
}
}
</
style
>
</
style
>
\ No newline at end of file
src/components/education/custom/custom-baseinfo 0526-0910.vue
0 → 100644
浏览文件 @
af80fcec
<!--基础信息-->
<
template
>
<div
class=
"base-message-wrap"
>
<el-form
ref=
"formData"
:model=
"formData"
:rules=
"rules"
label-width=
"150px"
class=
"basic-form"
>
<el-form-item
label=
"项目名称:"
prop=
"projectName"
>
<el-col
:span=
"13"
>
<el-input
size=
"small"
v-model=
"formData.projectName"
placeholder=
"请输入项目名称"
style=
"width:70%;"
ref=
"projectName"
maxlength=
"24"
:disabled=
"isPreview==1"
></el-input>
<span
class=
"word-num"
>
{{
(
formData
.
projectName
).
replace
(
/
\s
+/g
,
""
).
length
}}
/24
</span>
</el-col>
<el-col
:span=
"10"
class=
"curt-position-wrapper"
>
<div
class=
"curt-position"
>
<ShoppingCart
></ShoppingCart>
</div>
</el-col>
</el-form-item>
<el-form-item
label=
"发起机构名称:"
>
<el-col
:span=
"13"
v-for=
"(item, index) in formData.organizationNameList"
:key=
"index"
>
<el-input
size=
"small"
v-model=
"formData.organizationNameList[index]"
placeholder=
"请输入发起机构名称"
style=
"width:70%;"
maxlength=
16
@
input=
"changeOrganizationName"
@
blur =
"blurName"
@
focus =
"focusName(index)"
:disabled=
"isPreview==1"
></el-input>
<span
class=
"word-num"
>
{{
(
formData
.
organizationNameList
[
index
]).
replace
(
/
\s
+/g
,
""
).
length
}}
/16
</span>
<img
@
click=
"plusOrg(index)"
class=
"edit-img"
src=
"../../../assets/image/plus.png"
v-if=
"isPreview!=1"
/>
<img
@
click=
"deleteOrg(index)"
v-if=
"index >= 1 && isPreview!=1"
class=
"edit-img"
src=
"../../../assets/image/trash.png"
/>
</el-col>
<el-popover
v-if=
"formData.creatorOrganizationName"
class=
"popover-content"
:style=
"
{'top': orgListIndex * 41 + 'px'}"
placement="bottom"
:content="organizationContent"
v-model="visibleName"
@click="checkDefault">
<p
@
click=
"checkDefault"
>
我的机构:
{{
formData
.
creatorOrganizationName
}}
</p>
</el-popover>
</el-form-item>
<div>
<el-form-item
label=
"项目时间:"
required
>
<el-col
:span=
"5"
>
<el-form-item
prop=
"projectBegintime"
>
<el-date-picker
v-model=
"formData.projectBegintime"
size=
"small"
type=
"datetime"
placeholder=
"请选择开始时间"
value-format=
"yyyy/MM/dd HH:mm:ss"
format=
"yyyy/MM/dd HH:mm:ss"
:picker-options=
"pickerOptions0"
style=
"width: 100%;"
:disabled=
"formData.status4Flag == 1 || isPreview==1"
></el-date-picker>
</el-form-item>
</el-col>
<el-col
class=
"line"
:span=
"1"
>
~
</el-col>
<el-col
:span=
"5"
>
<el-form-item
label
prop=
"projectEndtime"
>
<el-date-picker
v-model=
"formData.projectEndtime"
size=
"small"
type=
"datetime"
placeholder=
"请选择结束时间"
value-format=
"yyyy/MM/dd HH:mm:ss"
format=
"yyyy/MM/dd HH:mm:ss"
:picker-options=
"pickerOptions1"
default-time=
"00:00:00"
style=
"width: 100%;"
:disabled=
"isPreview==1"
></el-date-picker>
</el-form-item>
</el-col>
</el-form-item>
<p
class=
"time-message"
><i
class=
"el-icon-warning-outline"
></i>
项目有效期为
{{
formData
.
expireDay
}}
天,选择项目起止时间须在有效期内
</p>
</div>
<el-form-item
label=
"列表图片:"
style=
"margin-bottom: 10px"
>
<el-col
:span=
"13"
style=
"height:95px"
>
<div
class=
"url1-selected"
>
<img
:src=
"formData.attachmentUrl1"
alt=
""
>
</div>
</el-col>
<el-col
:span=
"13"
style=
"height:95px"
>
<div
style=
"color:#666666;font-size:14px;"
>
从模版中选择其他列表图片
</div>
<ul
class=
"url1-list"
>
<li
class=
"img-wrapper"
v-for=
"(item, index) in attachMap[1]"
:key=
"index"
@
click=
"selectedAttachUrl(item, 1)"
>
<img
class=
"selected-icon"
:src=
"item.attachmentUrl"
alt=
""
>
<img
class=
"status-icon"
v-show=
"item.checked"
src=
"../../../assets/custom/icon/icon-select.png"
alt
/>
<img
class=
"status-icon"
v-show=
"!item.checked"
src=
"../../../assets/custom/icon/icon-select-no.png"
alt
/>
</li>
</ul>
</el-col>
</el-form-item>
<!--
<div
class=
"basic-item-icon"
>
<span
class=
"require"
>
*
</span>
<el-form-item
label=
"列表图片:"
>
<el-upload
v-model=
"formData.attachmentUrl1"
class=
"bg-uploader"
action=
"#"
:show-file-list=
"false"
:before-upload=
"beforeUploadListPic"
disabled
>
<img
v-if=
"formData.attachmentUrl1"
@
mouseover
.
stop=
"imgMouseOver=true"
:src=
"formData.attachmentUrl1"
class=
"bg-img"
>
<img
v-if=
"!formData.attachmentUrl1"
class=
"bg-img"
src=
"../../../assets/image/small.png"
>
<div
class=
"img-delete"
v-show=
"imgMouseOver && false"
@
click
.
stop=
"deleteImg(1)"
@
mouseout
.
stop=
"imgMouseOver=false"
><i
class=
"el-icon-delete"
></i></div>
<div
class=
"limit-text"
>
<p>
尺寸:230*172
</p>
<p>
限制大小: 500Kb
</p>
<p>
支持.jpg,.png格式
</p>
</div>
</el-upload>
</el-form-item>
<p
class=
"upload-message"
v-if=
"uploadImgMessage"
>
请选择列表图片
</p>
</div>
-->
<!-- @change="changeCover" -->
<el-form-item
label=
"封面类型:"
>
<el-radio-group
size=
"small"
v-model=
"formData.type"
disabled
>
<el-radio
:label=
"1"
>
图片
</el-radio>
<!--
<el-radio
:label=
"2"
>
视频
</el-radio>
-->
</el-radio-group>
</el-form-item>
<!--
<div
class=
"basic-item-icon"
>
<span
class=
"require"
>
*
</span>
<el-form-item
label=
"封面文件:"
>
<el-upload
v-model=
"formData.attachmentUrl2"
class=
"bg-uploader"
action=
"#"
:show-file-list=
"false"
:before-upload=
"beforeUploadCoverPic"
disabled
>
<img
v-if=
"formData.type == 1 && formData.attachmentUrl2"
:src=
"formData.attachmentUrl2"
@
mouseover
.
stop=
"imgMouseOver2=true"
class=
"bg-img"
>
<video
v-if=
"formData.type == 2 && formData.attachmentUrl2"
width=
"100"
controls
class=
"bg-video"
@
mouseover
.
stop=
"imgMouseOver2=true"
>
<source
:src=
"formData.attachmentUrl2"
type=
"video/mp4"
>
浏览器不支持mp4
</video>
<img
v-if=
"!formData.attachmentUrl2"
class=
"bg-img"
src=
"../../../assets/image/small.png"
>
<div
class=
"img-delete"
v-show=
"imgMouseOver2 && false"
@
click
.
stop=
"deleteImg(2)"
@
mouseout
.
stop=
"imgMouseOver2=false"
><i
class=
"el-icon-delete"
></i></div>
<div
v-show=
"formData.type == 1"
class=
"limit-text"
>
<p>
尺寸:750*420
</p>
<p>
限制大小: 2.0 Mb
</p>
<p>
支持.jpg,.png格式
</p>
</div>
<div
v-show=
"formData.type == 2"
class=
"limit-text"
>
<p></p>
<p>
限制大小: 500 Mb
</p>
<p>
支持.mp4
</p>
</div>
</el-upload>
</el-form-item>
<p
class=
"upload-message"
v-if=
"uploadImgMessage2"
>
请选择封面
</p>
</div>
-->
<el-form-item
label=
"封面文件:"
style=
"margin-bottom: 10px"
>
<el-col
:span=
"13"
style=
"height: 95px"
>
<div
class=
"url2-selected"
>
<img
:src=
"formData.attachmentUrl2"
alt=
""
>
</div>
</el-col>
<el-col
:span=
"13"
style=
"height:95px"
>
<div
style=
"color:#666666;font-size:14px;"
>
从模版中选择其他封面图片
</div>
<ul
class=
"url2-list"
>
<li
class=
"img-wrapper"
v-for=
"(item, index) in attachMap[2]"
:key=
"index"
@
click=
"selectedAttachUrl(item, 2)"
>
<img
class=
"selected-icon"
:src=
"item.attachmentUrl"
alt=
""
>
<img
class=
"status-icon"
v-show=
"item.checked"
src=
"../../../assets/custom/icon/icon-select.png"
alt
/>
<img
class=
"status-icon"
v-show=
"!item.checked"
src=
"../../../assets/custom/icon/icon-select-no.png"
alt
/>
</li>
</ul>
</el-col>
</el-form-item>
<el-form-item
label=
"项目简介:"
prop=
"projectIntro"
>
<el-col
:span=
"13"
>
<el-input
size=
"small"
type=
"textarea"
:autosize=
"
{ minRows: 5}"
placeholder="请输入项目简介"
v-model="formData.projectIntro"
style="width:83%;"
:disabled="isPreview==1"
>
</el-input>
<span
class=
"word-num"
>
{{
(
formData
.
projectIntro
).
replace
(
/
\s
+/g
,
""
).
length
}}
/200
</span>
</el-col>
</el-form-item>
</el-form>
<dialog-componet
:dialogObj=
"dialogObj"
@
confirm=
"confirm"
@
hide=
"hide"
></dialog-componet>
</div>
</
template
>
<
script
>
import
{
doUpload
,
getFilePath
}
from
"../../../utils/qiniu-util"
;
import
{
openLoading
,
closeLoading
}
from
"../../../utils/utils"
;
import
ShoppingCart
from
'@/components/education/custom/sorted-cart'
import
{
convertTime
}
from
"../../../utils"
;
import
dialog
from
"./dialog"
;
import
{
mapGetters
}
from
'vuex'
;
let
vm
=
null
;
export
default
{
props
:
{
openTemplateId
:
{
type
:
String
|
Number
,
default
:
''
},
projectId
:
{
type
:
String
|
Number
,
default
:
''
},
editor
:
{
type
:
Boolean
,
default
:
false
}
},
data
()
{
let
checkProjectStr
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
.
indexOf
(
"
\
\"
) != -1) {
//存在
callback(new Error("
请勿输入字符“
\\
”
"));
} else if (value.indexOf("
.
") != -1) {
callback(new Error("
请勿输入字符“
.
”
"));
} else {
callback();
}
};
let checkUserTime= (rule, value, callback) => {
if (value> 1000 || value < 1) {
callback(new Error("
输入长度为
1
-
1000
的有效期
"));
} else {
callback();
}
};
return {
visibleName: false, //是否显示机构提示
orgListIndex: 1,
organizationContent: '',//机构名称
formData: {
id: "", //项目 id 26
projectName: "", //开放模板名称
projectBegintime: "", //模板开始时间
projectEndtime: "", //模板结束时间
projectIntro: "", //开放模板简介
projectType: 4, //类型
type: 1, //封面类型 1图片2视频
projectStatus: 1, //1.草稿 2.未上架 3.审核中/待审核 4.已上架 5.已下架 6.已拒绝/未上架
expireDay: 90, //模板有效期(天)
status4Flag: 0, //0表示没有上过架,1表示上过架
attachmentUrl1: "",
attachmentUrl2: "",
attachmentMore1: {
attachmentExt: "",
attachmentName: "",
attachmentSize: 0
},
attachmentMore2: {
attachmentExt: "",
attachmentName: "",
attachmentSize: 0
},
organizationName: "", // 发起机构名称(多个机构拼接
organizationNameList: [''] //发起机构列表
},
attachmentModel:[ //基础信息的图片视频
{
attachmentExt: '',// 附件格式
attachmentName: '',//附件名称
attachmentSize:'',//附件大小,
attachmentType: 1,//1:图片 2:视频 3:pdf
attachmentUrl: '',//附件链接
id: '', //关联唯一ID
kind: 1, //1:列表图片 2:封面配置 3:附件配置
openTemplateId: ''//开放模板id
},
{
attachmentExt: '',// 附件格式
attachmentName: '',//附件名称
attachmentSize:'',//附件大小,
attachmentType: 1,//1:图片 2:视频 3:pdf
attachmentUrl: '',//附件链接
id: '', //关联唯一ID
kind: 1, //1:列表图片 2:封面配置 3:附件配置
openTemplateId: ''//开放模板id
}
],
pickerOptions0: {
disabledDate: time => {
if (
vm.formData.projectEndtime != "" &&
vm.formData.projectEndtime != null
) {
return (
time.getTime() > new Date(vm.formData.projectEndtime).getTime()
);
}
}
},
pickerOptions1: {
disabledDate: time => {
return (
// time.getTime() < new Date((vm.formData.projectBegintime).replace(/
\
-/g, '/')).getTime() || time.getTime() > new Date((vm.formData.projectBegintime).replace(/
\
-/g, '/')).getTime() + 1000 * 60 * 60 * 24 * vm.formData.expireDay
time.getTime() < new Date(vm.formData.projectBegintime).getTime() || time.getTime() > new Date(vm.formData.projectBegintime).getTime() + 1000 * 60 * 60 * 24 * vm.formData.expireDay
); //减去一天的时间代表可以选择同一天;
}
},
imgMouseOver: false,
imgMouseOver2: false,
uploadImgMessage: false,
uploadImgMessage2: false,
rules: {
projectName: [
{ required: true, message: "
请输入项目名称
" },
{
min: 2,
max: 24,
message: "
输入长度为
2
-
24
的内容,可包含中英文、数字及特殊符号
",
trigger: "
blur
"
},
{ validator: checkProjectStr, trigger: "
blur
" }
],
projectBegintime: [
{
required: true,
message: "
请选择时间
",
trigger: "
change
"
}
],
projectEndtime: [
{
required: true,
message: "
请选择时间
",
trigger: "
change
"
}
],
projectIntro: [
{ required: true, message: "
请填写项目简介
", trigger: "
blur
" },
{ min: 1, max: 200, message: "
超出可输入的最大长度
", trigger: "
blur
" }
]
},
disabled: true,
dialogObj: {
visible: false,
title: '该项目模版已下架',
tip: '',
message: '模版已下架,请重新选择其他项目模版',
confirmMsg: '取消',
hideMsg: '重新选择'
},
isPreview: 0,
attachMap: {
1: [],
2: []
},
}
},
computed: {
...mapGetters(['cartList']),
},
components: {
dialogComponet:dialog,
ShoppingCart
},
created() {
vm = this;
vm.isPreview = vm.$route.query.isPreview ? vm.$route.query.isPreview : 0;
if (vm.editor) {
// 编辑时
vm.disabled = false;
vm.getEditorMessage()
} else{
// 创建时
vm.disabled = true;
vm.getMessage();
}
},
methods: {
// 选择列表或封面图片
selectedAttachUrl(item, index) {
this.attachMap[index].forEach( attach => {
if(item.attachmentUrl == attach.attachmentUrl) {
attach.checked = true;
} else {
attach.checked = false;
}
})
vm.formData['attachmentUrl' + index] = item.attachmentUrl;
vm.$forceUpdate();
console.log(this.attachMap);
},
// 设置已有的基本信息
setBaseMessage(data) {
// data.projectData.projectBegintime = convertTime(data.projectData.projectBegintime);
// data.projectData.projectEndtime = convertTime(data.projectData.projectEndtime);
// vm.formData = Object.assign(vm.formData, data.projectData);
// vm.formData.attachmentUrl1 = data.attachmentData[0].attachmentUrl;
// vm.formData.attachmentMore1 = Object.assign(vm.formData.attachmentMore1, data.attachmentData[0]);
// 暂存为1 下一步为3
vm.formData.projectType = vm.formData.projectType == 0 ? 4 : vm.formData.projectType;
vm.formData.projectBegintime = vm.formData.projectBegintime ? new Date(vm.formData.projectBegintime) : '';
vm.formData.projectEndtime = vm.formData.projectBegintime ? new Date(vm.formData.projectEndtime) : '';
// if (data.attachmentData[1]) {
// vm.formData.attachmentUrl2 = data.attachmentData[1].attachmentUrl;
// vm.formData.type = data.attachmentData[1].attachmentType;
// vm.formData.attachmentMore2 = Object.assign(vm.formData.attachmentMore2, data.attachmentData[1]);
// }
// 不知道是否要使用
// vm.$emit('setStatus4Flag',data.projectData.status4Flag)
},
// // 设置已有的基本信息
// setBaseMessage(data) {
// data.projectData.projectBegintime = convertTime(data.projectData.projectBegintime);
// data.projectData.projectEndtime = convertTime(data.projectData.projectEndtime);
// vm.formData = Object.assign(vm.formData, data.projectData);
// vm.formData.attachmentUrl1 = data.attachmentData[0].attachmentUrl;
// vm.formData.attachmentMore1 = Object.assign(vm.formData.attachmentMore1, data.attachmentData[0]);
// // 暂存为1 下一步为3
// vm.formData.projectType = vm.formData.projectType == 0 ? 3 : vm.formData.projectType;
// vm.formData.projectBegintime = vm.formData.projectBegintime ? new Date(vm.formData.projectBegintime) : '';
// vm.formData.projectEndtime = vm.formData.projectBegintime ? new Date(vm.formData.projectEndtime) : '';
// if (data.attachmentData[1]) {
// vm.formData.attachmentUrl2 = data.attachmentData[1].attachmentUrl;
// vm.formData.type = data.attachmentData[1].attachmentType;
// vm.formData.attachmentMore2 = Object.assign(vm.formData.attachmentMore2, data.attachmentData[1]);
// }
// vm.$emit('setStatus4Flag',data.projectData.status4Flag)
// },
// 创建时,获取机构信息、列表图片等
getMessage() {
openLoading(vm);
vm.GET(`portal/portalInfo/sass/attach`, {typeList: [1,2]})
.then(res => {
closeLoading(vm);
if (res.code == "
000000
") {
this.attachMap = res.data.attachMap;
this.attachMap[1].forEach(item => {
item.checked = false;
});
this.attachMap[2].forEach(item => {
item.checked = false;
});
this.formData.attachmentUrl1 = this.attachMap[1][0].attachmentUrl;
this.formData.attachmentUrl2 = this.attachMap[2][0].attachmentUrl;
this.formData.creatorOrganizationName = res.data.creatorOrganizationName || '';
this.attachMap[1][0].checked = true;
this.attachMap[2][0].checked = true;
console.log('this.attachMap', this.attachMap);
// let data = res.data;
// data.projectData.organizationNameList = [data.projectData.creatorOrganizationName]
// this.$emit('hideSave',res.data.projectData.projectStatus)
// vm.setBaseMessage(res.data);
} else {
vm.$message.info(res.message);
}
})
.catch((err) => {
closeLoading(vm);
vm.$message.warning('请稍后重试');
});
},
// 获取选择模板后的基本信息
// getMessage() {
// openLoading(vm);
// vm.GET(`portal/openTemplateProject/getOpenTemplateInfoForCreate/${vm.openTemplateId}`)
// .then(res => {
// closeLoading(vm);
// if (res.code == "
000000
") {
// let data = res.data;
// data.projectData.organizationNameList = [data.projectData.creatorOrganizationName]
// this.$emit('hideSave',res.data.projectData.projectStatus)
// vm.setBaseMessage(res.data);
// } else {
// vm.$message.info(res.message);
// }
// })
// .catch((err) => {
// closeLoading(vm);
// vm.$message.warning('请稍后重试');
// });
// },
// 获取编辑时的信息
getEditorMessage() {
openLoading(vm);
// vm.GET(`portal/portalInfo/getProjectInfo/${vm.projectId}`)
vm.GET(`portal/portalCustom/getInfo/${vm.projectId}`)
.then(res => {
closeLoading(vm);
if (res.code == "
000000
") {
// this.$emit('hideSave',res.data.projectData.projectStatus)
vm.setBaseMessage(res.data)
} else {
vm.$message.info(res.message);
}
})
.catch((err) => {
closeLoading(vm);
vm.$message.warning('请稍后重试');
});
},
// 增加发起机构
plusOrg(index) {
vm.formData.organizationNameList.splice(index + 1, 0, '');
},
// 删除发起机构
deleteOrg(index) {
vm.formData.organizationNameList.splice(index, 1);
},
// 机构名称输入
changeOrganizationName() {
let textLength = vm.formData.organizationName.length;
// 机构输入提示显示与否
vm.visibleName = textLength == 0;
},
// 离开机构名称焦点
blurName() {
vm.visibleName = false;
setTimeout(() => {
vm.submitForm("
formData
");
}, 200);
},
// 机构名称聚焦
focusName(index) {
let textLength = vm.formData.organizationNameList[index].length;
if (textLength == 0) {
vm.orgListIndex = index + 1;
vm.visibleName = true;
} else {
vm.visibleName = false;
}
},
// 机构选择默认值
checkDefault() {
vm.organizationContent = vm.formData.creatorOrganizationName;
vm.formData.organizationNameList.splice(vm.orgListIndex-1, 1, vm.organizationContent);
vm.visibleName = false;
},
//上传列表图片
// beforeUploadListPic(file) {
// let fileLimit = {
// width: 230,
// height: 172,
// size: 0.5,
// sizeText: "
500
K
",
// key: "
attachmentUrl1
",
// more: "
attachmentMore1
",
// show: "
uploadImgMessage
"
// };
// vm.beforeAvatarUpload(file, fileLimit);
// },
//上传图片校验
// beforeAvatarUpload(file, fileLimit) {
// const isJPG = file.type === "
image
/
jpeg
";
// const isPNG = file.type === "
image
/
png
";
// const isLt2M = file.size / 1024 / 1024 < fileLimit.size;
// if (!isJPG && !isPNG) {
// vm.$message.error("
图片不符合规范,请根据规范上传图片
");
// return;
// }
// if (!isLt2M) {
// vm.$message.error("
图片不符合规范,请根据规范上传图片
");
// return;
// }
// let _img = new FileReader();
// _img.readAsDataURL(file);
// _img.onload = function(theFile) {
// let image = new Image();
// image.src = theFile.target.result;
// image.onload = function() {
// let _vm = this;
// if (
// _vm.width != fileLimit.width ||
// _vm.height != fileLimit.height
// ) {
// vm.$message.error("
图片不符合规范,请根据规范上传图片
");
// } else {
// openLoading(vm);
// doUpload(
// vm,
// file,
// getFilePath(file, null),
// "
preview4
",
// "
progress1
",
// 1
// ).then(function(path) {
// closeLoading(vm);
// console.log(path);
// if (fileLimit.show == "
uploadImgMessage
") {
// vm.uploadImgMessage = false;
// } else if (fileLimit.show == "
uploadImgMessage2
") {
// vm.uploadImgMessage2 = false;
// }
// vm.formData[fileLimit.key] = path.fullPath;
// vm.formData[fileLimit.more] = {
// attachmentName: path.name,
// attachmentExt: path.ext,
// attachmentSize: path.size
// };
// vm.$message.success("
上传成功
");
// });
// }
// };
// };
// return isJPG && isLt2M;
// },
// // 删除图片
// deleteImg(type) {
// if (type == 1) {
// vm.formData.attachmentUrl1 = "";
// vm.imgMouseOver = false;
// } else {
// vm.formData.attachmentUrl2 = "";
// vm.imgMouseOver2 = false;
// }
// },
// //改变封面类型
// changeCover(radio) {
// vm.formData.attachmentUrl2 = "";
// },
// //上传封面图片
// beforeUploadCoverPic(file) {
// let fileLimit = {
// width: 750,
// height: 420,
// size: 2,
// sizeText: "
2.0
M
",
// key: "
attachmentUrl2
",
// more: "
attachmentMore2
",
// show: "
uploadImgMessage2
"
// };
// if (vm.formData.type == 1) {
// vm.beforeAvatarUpload(file, fileLimit);
// } else {
// vm.beforeUploadMp4(file);
// }
// },
// //上传mp4
// beforeUploadMp4(file) {
// console.log(file);
// const isMP4 = file.type === "
video
/
mp4
";
// const isLt = file.size / 1024 / 1024 < 500;
// if (!isLt) {
// vm.$message.error("
视频不符合规范,请根据规范上传视频
");
// return;
// }
// if (!isMP4) {
// vm.$message.error("
视频不符合规范,请根据规范上传视频
");
// } else {
// openLoading(vm);
// doUpload(
// vm,
// file,
// getFilePath(file, null),
// "
preview4
",
// "
progress1
",
// ""
// ).then(function(path) {
// closeLoading(vm);
// console.log(path);
// vm.uploadImgMessage2 = false;
// vm.formData.attachmentUrl2 = path.fullPath;
// vm.$message.success("
上传成功
");
// });
// }
// },
// 点击下一步
nextStep() {
let flag = true;
if (!vm.formData.attachmentUrl1) {
vm.uploadImgMessage = true;
flag = false;
} else {
vm.uploadImgMessage = false;
}
if (!vm.formData.attachmentUrl2) {
vm.uploadImgMessage2 = true;
flag = false;
} else {
vm.uploadImgMessage2 = false;
}
if (vm.submitForm('formData') && flag) {
vm.insertOrupdate();
}
},
// 暂存
save() {
if (vm.$refs['formData'].projectName == '') {
vm.$refs['formData'].validateField('projectName')
} else {
vm.insertOrupdate(1);
};
},
// 新增或者更新基本信息
insertOrupdate(status) {
if(new Date(vm.formData.projectEndtime).getTime() > new Date(vm.formData.projectBegintime).getTime() + 1000 * 60 * 60 * 24 * vm.formData.expireDay) {
vm.$message.warning('项目结束时间应在有效期内');
return;
}
if(new Date(vm.formData.projectEndtime).getTime() <= new Date(vm.formData.projectBegintime).getTime()) {
vm.$message.warning('项目结束时间应大于开始时间');
return;
}
vm.formData.projectBegintime = convertTime(vm.formData.projectBegintime, false);
vm.formData.projectEndtime = convertTime(vm.formData.projectEndtime, false);
if (status) {
vm.formData.projectStatus = status;
}
// 图片或者视频地址
vm.formData.attachmentMore1.attachmentUrl = vm.formData.attachmentUrl1;
vm.formData.attachmentMore2.attachmentUrl = vm.formData.attachmentUrl2;
// 封面类型
vm.formData.attachmentMore2.attachmentType = vm.formData.type;
vm.formData.attachmentMore2.kind = 2;
//整合图片视频
vm.attachmentModel[0] = Object.assign(vm.attachmentModel[0],vm.formData.attachmentMore1);
vm.attachmentModel[1] = Object.assign(vm.attachmentModel[1],vm.formData.attachmentMore2);
let baseobj = {};
baseobj.projectModel = JSON.stringify(vm.formData);
baseobj.attachmentModel = JSON.stringify(vm.attachmentModel);
baseobj.attachmentPDFModel= null;
baseobj.notifyData= null;
baseobj.hotCourseForPortalModelList = vm.cartList;
console.log(baseobj);
openLoading(vm);
vm.POST("
portal
/
portalCustom
/
insertOrUpdate
", baseobj)
.then(res => {
closeLoading(vm);
if (res.code == "
000000
") {
// 暂存不会跳到下一页
if (status == 1) {
vm.$message.info('成功');
return;
}
// 下一步,并将项目id传递给父组件
vm.$emit('next',res.data.id);
} else if (res.code == "
213061
") {
vm.dialogObj.visible = true;
} else {
vm.$message.warning(res.message);
}
})
.catch((err) => {
vm.$message({
type: "
warning
",
message: res.message
});
})
},
//表单校验
submitForm(formName) {
let flag = null;
vm.$refs[formName].validate(valid => {
if (valid) {
flag = true;
} else {
flag = false;
}
});
return flag;
},
// 取消
confirm() {
vm.dialogObj.visible = false;
},
// 确定
hide() {
vm.dialogObj.visible = false;
vm.$emit('backSelectVue')
}
}
}
</
script
>
<
style
>
.subject-slelct
.el-input__inner
{
height
:
32px
;
line-height
:
32px
;
}
</
style
>
<
style
lang=
"scss"
scoped
>
.base-message-wrap
{
padding-top
:
80px
;
.p_label
{
margin-left
:
56px
;
font-size
:
12px
;
color
:
#606266
;
}
.edit-img
{
width
:
20px
;
height
:
20px
;
vertical-align
:
middle
;
margin-left
:
10px
;
}
.day-btn
{
display
:
inline-block
;
width
:
50px
;
height
:
32px
;
line-height
:
32px
;
background
:
#838683
;
text-align
:
center
;
margin-left
:
-3px
;
border-radius
:
0
4px
4px
0
;
z-index
:
100
;
}
.basic-item-icon
{
position
:
relative
;
.require
{
position
:
absolute
;
left
:
67px
;
top
:
11px
;
color
:
#f56c6c
;
}
.upload-message
{
position
:
absolute
;
left
:
160px
;
top
:
105px
;
font-size
:
12px
;
color
:
#f56c6c
;
}
.img-delete
{
position
:
absolute
;
left
:
0px
;
top
:
0px
;
width
:
84px
;
height
:
100px
;
background
:
#000
;
opacity
:
0
.7
;
z-index
:
999
;
i
{
color
:
#fff
;
margin-top
:
39px
;
margin-left
:
0px
;
}
}
}
.word-num
{
font-size
:
12px
;
color
:
#999
;
padding-top
:
5px
;
}
.line
{
margin-left
:
10px
;
width
:
20px
;
}
.bg-uploader
{
img
{
float
:
left
;
}
.bg-img
{
width
:
84px
;
height
:
100px
;
}
.bg-video
{
float
:
left
;
width
:
84px
;
height
:
100px
;
}
.limit-text
{
float
:
left
;
margin-left
:
10px
;
margin-top
:
-10px
;
p
{
font-size
:
12px
;
color
:
#999
;
}
}
}
.el-upload__tip
{
position
:
absolute
;
top
:
-6px
;
left
:
130px
;
}
.choose-button
{
background
:
#fff
;
color
:
#409eff
;
border
:
1px
solid
#409eff
;
}
.el-popover--plain
{
padding
:
18px
20px
;
top
:
40px
;
}
.ueitem
{
position
:
relative
;
}
.ue-warp
{
position
:
absolute
;
width
:
80%
;
height
:
100%
;
background
:
#F5F7FA
;
opacity
:
0
.5
;
top
:
0
;
z-index
:
1000
;
}
}
.el-form-item__content
{
width
:
100%
;
height
:
100%
;
background
:
red
;
}
.popover-content
{
position
:
relative
;
top
:
0
;
left
:
0
;
}
.time-message
{
margin
:
-6px
0
20px
150px
;
font-size
:
14px
;
}
.url1-selected
{
img
{
widows
:
120px
;
height
:
90px
;
}
}
.url1-list
{
display
:
flex
;
flex-direction
:
row
;
.img-wrapper
{
position
:
relative
;
top
:
0
;
left
:
0
;
z-index
:
1
;
.selected-icon
{
width
:
60px
;
height
:
45px
;
margin-right
:
10px
;
}
.status-icon
{
position
:
absolute
;
top
:
5px
;
right
:
15px
;
z-index
:
2
;
widows
:
14px
;
height
:
14px
;
}
}
}
.url2-selected
{
img
{
width
:
160px
;
height
:
90px
;
}
}
.url2-list
{
display
:
flex
;
flex-direction
:
row
;
.img-wrapper
{
position
:
relative
;
top
:
0
;
left
:
0
;
z-index
:
1
;
.selected-icon
{
width
:
80px
;
height
:
45px
;
margin-right
:
10px
;
}
.status-icon
{
position
:
absolute
;
top
:
5px
;
right
:
15px
;
z-index
:
2
;
widows
:
14px
;
height
:
14px
;
}
}
}
.curt-position-wrapper
{
position
:
relative
;
top
:
0
;
left
:
0
;
z-index
:
100
;
.curt-position
{
position
:
absolute
;
top
:
0
;
left
:
0
;
z-index
:
101
;
}
}
</
style
>
\ No newline at end of file
src/components/education/custom/custom-baseinfo 0526-1058.vue
0 → 100644
浏览文件 @
af80fcec
<!--基础信息-->
<
template
>
<div
class=
"base-message-wrap"
>
<el-form
ref=
"formData"
:model=
"formData"
:rules=
"rules"
label-width=
"150px"
class=
"basic-form"
>
<el-form-item
label=
"项目名称:"
prop=
"projectName"
>
<el-col
:span=
"13"
>
<el-input
size=
"small"
v-model=
"formData.projectName"
placeholder=
"请输入项目名称"
style=
"width:70%;"
ref=
"projectName"
maxlength=
"24"
:disabled=
"isPreview==1"
></el-input>
<span
class=
"word-num"
>
{{
(
formData
.
projectName
).
replace
(
/
\s
+/g
,
""
).
length
}}
/24
</span>
</el-col>
<el-col
:span=
"10"
class=
"curt-position-wrapper"
>
<div
class=
"curt-position"
>
<ShoppingCart
></ShoppingCart>
</div>
</el-col>
</el-form-item>
<el-form-item
label=
"发起机构名称:"
>
<el-col
:span=
"13"
v-for=
"(item, index) in formData.organizationNameList"
:key=
"index"
>
<el-input
size=
"small"
v-model=
"formData.organizationNameList[index]"
placeholder=
"请输入发起机构名称"
style=
"width:70%;"
maxlength=
16
@
input=
"changeOrganizationName"
@
blur =
"blurName"
@
focus =
"focusName(index)"
:disabled=
"isPreview==1"
></el-input>
<span
class=
"word-num"
>
{{
(
formData
.
organizationNameList
[
index
]).
replace
(
/
\s
+/g
,
""
).
length
}}
/16
</span>
<img
@
click=
"plusOrg(index)"
class=
"edit-img"
src=
"../../../assets/image/plus.png"
v-if=
"isPreview!=1"
/>
<img
@
click=
"deleteOrg(index)"
v-if=
"index >= 1 && isPreview!=1"
class=
"edit-img"
src=
"../../../assets/image/trash.png"
/>
</el-col>
<el-popover
v-if=
"formData.creatorOrganizationName"
class=
"popover-content"
:style=
"
{'top': orgListIndex * 41 + 'px'}"
placement="bottom"
:content="organizationContent"
v-model="visibleName"
@click="checkDefault">
<p
@
click=
"checkDefault"
>
我的机构:
{{
formData
.
creatorOrganizationName
}}
</p>
</el-popover>
</el-form-item>
<div>
<el-form-item
label=
"项目时间:"
required
>
<el-col
:span=
"5"
>
<el-form-item
prop=
"projectBegintime"
>
<el-date-picker
v-model=
"formData.projectBegintime"
size=
"small"
type=
"datetime"
placeholder=
"请选择开始时间"
value-format=
"yyyy/MM/dd HH:mm:ss"
format=
"yyyy/MM/dd HH:mm:ss"
:picker-options=
"pickerOptions0"
style=
"width: 100%;"
:disabled=
"formData.status4Flag == 1 || isPreview==1"
></el-date-picker>
</el-form-item>
</el-col>
<el-col
class=
"line"
:span=
"1"
>
~
</el-col>
<el-col
:span=
"5"
>
<el-form-item
label
prop=
"projectEndtime"
>
<el-date-picker
v-model=
"formData.projectEndtime"
size=
"small"
type=
"datetime"
placeholder=
"请选择结束时间"
value-format=
"yyyy/MM/dd HH:mm:ss"
format=
"yyyy/MM/dd HH:mm:ss"
:picker-options=
"pickerOptions1"
default-time=
"00:00:00"
style=
"width: 100%;"
:disabled=
"isPreview==1"
></el-date-picker>
</el-form-item>
</el-col>
</el-form-item>
<p
class=
"time-message"
><i
class=
"el-icon-warning-outline"
></i>
项目有效期为
{{
formData
.
expireDay
}}
天,选择项目起止时间须在有效期内
</p>
</div>
<el-form-item
label=
"列表图片:"
style=
"margin-bottom: 10px"
>
<el-col
:span=
"13"
style=
"height:95px"
>
<div
class=
"url1-selected"
>
<img
:src=
"formData.attachmentUrl1"
alt=
""
>
</div>
</el-col>
<el-col
:span=
"13"
style=
"height:95px"
>
<div
style=
"color:#666666;font-size:14px;"
>
从模版中选择其他列表图片
</div>
<ul
class=
"url1-list"
>
<li
class=
"img-wrapper"
v-for=
"(item, index) in attachMap[1]"
:key=
"index"
@
click=
"selectedAttachUrl(item, 1)"
>
<img
class=
"selected-icon"
:src=
"item.attachmentUrl"
alt=
""
>
<img
class=
"status-icon"
v-show=
"item.checked"
src=
"../../../assets/custom/icon/icon-select.png"
alt
/>
<img
class=
"status-icon"
v-show=
"!item.checked"
src=
"../../../assets/custom/icon/icon-select-no.png"
alt
/>
</li>
</ul>
</el-col>
</el-form-item>
<el-form-item
label=
"封面类型:"
>
<el-radio-group
size=
"small"
v-model=
"formData.type"
disabled
>
<el-radio
:label=
"1"
>
图片
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"封面文件:"
style=
"margin-bottom: 10px"
>
<el-col
:span=
"13"
style=
"height: 95px"
>
<div
class=
"url2-selected"
>
<img
:src=
"formData.attachmentUrl2"
alt=
""
>
</div>
</el-col>
<el-col
:span=
"13"
style=
"height:95px"
>
<div
style=
"color:#666666;font-size:14px;"
>
从模版中选择其他封面图片
</div>
<ul
class=
"url2-list"
>
<li
class=
"img-wrapper"
v-for=
"(item, index) in attachMap[2]"
:key=
"index"
@
click=
"selectedAttachUrl(item, 2)"
>
<img
class=
"selected-icon"
:src=
"item.attachmentUrl"
alt=
""
>
<img
class=
"status-icon"
v-show=
"item.checked"
src=
"../../../assets/custom/icon/icon-select.png"
alt
/>
<img
class=
"status-icon"
v-show=
"!item.checked"
src=
"../../../assets/custom/icon/icon-select-no.png"
alt
/>
</li>
</ul>
</el-col>
</el-form-item>
<el-form-item
label=
"项目简介:"
prop=
"projectIntro"
>
<el-col
:span=
"13"
>
<el-input
size=
"small"
type=
"textarea"
:autosize=
"
{ minRows: 5}"
placeholder="请输入项目简介"
v-model="formData.projectIntro"
style="width:83%;"
:disabled="isPreview==1"
>
</el-input>
<span
class=
"word-num"
>
{{
(
formData
.
projectIntro
).
replace
(
/
\s
+/g
,
""
).
length
}}
/200
</span>
</el-col>
</el-form-item>
</el-form>
<dialog-componet
:dialogObj=
"dialogObj"
@
confirm=
"confirm"
@
hide=
"hide"
></dialog-componet>
</div>
</
template
>
<
script
>
import
{
doUpload
,
getFilePath
}
from
"../../../utils/qiniu-util"
;
import
{
openLoading
,
closeLoading
}
from
"../../../utils/utils"
;
import
ShoppingCart
from
'@/components/education/custom/sorted-cart'
import
{
convertTime
}
from
"../../../utils"
;
import
dialog
from
"./dialog"
;
import
{
mapGetters
,
mapActions
}
from
'vuex'
;
let
vm
=
null
;
export
default
{
props
:
{
openTemplateId
:
{
type
:
String
|
Number
,
default
:
''
},
projectId
:
{
type
:
String
|
Number
,
default
:
''
},
editor
:
{
type
:
Boolean
,
default
:
false
}
},
data
()
{
let
checkProjectStr
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
.
indexOf
(
"
\
\"
) != -1) {
//存在
callback(new Error("
请勿输入字符“
\\
”
"));
} else if (value.indexOf("
.
") != -1) {
callback(new Error("
请勿输入字符“
.
”
"));
} else {
callback();
}
};
let checkUserTime= (rule, value, callback) => {
if (value> 1000 || value < 1) {
callback(new Error("
输入长度为
1
-
1000
的有效期
"));
} else {
callback();
}
};
return {
visibleName: false, //是否显示机构提示
orgListIndex: 1,
organizationContent: '',//机构名称
formData: {
id: "", //项目 id 26
projectName: "", //开放模板名称
projectBegintime: "", //模板开始时间
projectEndtime: "", //模板结束时间
projectIntro: "", //开放模板简介
projectType: 4, //类型
type: 1, //封面类型 1图片2视频
projectStatus: 1, //1.草稿 2.未上架 3.审核中/待审核 4.已上架 5.已下架 6.已拒绝/未上架
expireDay: 90, //模板有效期(天)
status4Flag: 0, //0表示没有上过架,1表示上过架
attachmentUrl1: "",
attachmentUrl2: "",
attachmentMore1: {
attachmentExt: "",
attachmentName: "",
attachmentSize: 0
},
attachmentMore2: {
attachmentExt: "",
attachmentName: "",
attachmentSize: 0
},
organizationName: "", // 发起机构名称(多个机构拼接
organizationNameList: [''] //发起机构列表
},
attachmentModel:[ //基础信息的图片视频
{
attachmentExt: '',// 附件格式
attachmentName: '',//附件名称
attachmentSize:'',//附件大小,
attachmentType: 1,//1:图片 2:视频 3:pdf
attachmentUrl: '',//附件链接
id: '', //关联唯一ID
kind: 1, //1:列表图片 2:封面配置 3:附件配置
openTemplateId: ''//开放模板id
},
{
attachmentExt: '',// 附件格式
attachmentName: '',//附件名称
attachmentSize:'',//附件大小,
attachmentType: 1,//1:图片 2:视频 3:pdf
attachmentUrl: '',//附件链接
id: '', //关联唯一ID
kind: 1, //1:列表图片 2:封面配置 3:附件配置
openTemplateId: ''//开放模板id
}
],
pickerOptions0: {
disabledDate: time => {
if (
vm.formData.projectEndtime != "" &&
vm.formData.projectEndtime != null
) {
return (
time.getTime() > new Date(vm.formData.projectEndtime).getTime()
);
}
}
},
pickerOptions1: {
disabledDate: time => {
return (
// time.getTime() < new Date((vm.formData.projectBegintime).replace(/
\
-/g, '/')).getTime() || time.getTime() > new Date((vm.formData.projectBegintime).replace(/
\
-/g, '/')).getTime() + 1000 * 60 * 60 * 24 * vm.formData.expireDay
time.getTime() < new Date(vm.formData.projectBegintime).getTime() || time.getTime() > new Date(vm.formData.projectBegintime).getTime() + 1000 * 60 * 60 * 24 * vm.formData.expireDay
); //减去一天的时间代表可以选择同一天;
}
},
imgMouseOver: false,
imgMouseOver2: false,
uploadImgMessage: false,
uploadImgMessage2: false,
rules: {
projectName: [
{ required: true, message: "
请输入项目名称
" },
{
min: 2,
max: 24,
message: "
输入长度为
2
-
24
的内容,可包含中英文、数字及特殊符号
",
trigger: "
blur
"
},
{ validator: checkProjectStr, trigger: "
blur
" }
],
projectBegintime: [
{
required: true,
message: "
请选择时间
",
trigger: "
change
"
}
],
projectEndtime: [
{
required: true,
message: "
请选择时间
",
trigger: "
change
"
}
],
projectIntro: [
{ required: true, message: "
请填写项目简介
", trigger: "
blur
" },
{ min: 1, max: 200, message: "
超出可输入的最大长度
", trigger: "
blur
" }
]
},
disabled: true,
dialogObj: {
visible: false,
title: '该项目模版已下架',
tip: '',
message: '模版已下架,请重新选择其他项目模版',
confirmMsg: '取消',
hideMsg: '重新选择'
},
isPreview: 0,
attachInfo: {
attachMap: {
1: [],
2: []
},
creatorOrganizationName: "
云鹊医
",
limitKind: 1,
limitValue: 90,
},
attachMap: {
1: [],
2: []
},
}
},
computed: {
...mapGetters(['cartList']),
},
components: {
dialogComponet:dialog,
ShoppingCart
},
created() {
vm = this;
vm.isPreview = vm.$route.query.isPreview ? vm.$route.query.isPreview : 0;
vm.getMessage();
// 编辑时
if (vm.editor) {
vm.disabled = false;
vm.getEditorMessage()
// 创建时
} else{
vm.disabled = true;
// vm.getMessage();
}
},
methods: {
...mapActions(['setCartList']),
// 选择列表或封面图片
selectedAttachUrl(item, index) {
this.attachMap[index].forEach( attach => {
if(item.attachmentUrl == attach.attachmentUrl) {
attach.checked = true;
} else {
attach.checked = false;
}
})
vm.formData['attachmentUrl' + index] = item.attachmentUrl;
vm.$forceUpdate();
},
// 设置已有的基本信息
setBaseMessage(data) {
data.projectData.projectBegintime = convertTime(data.projectData.projectBegintime);
data.projectData.projectEndtime = convertTime(data.projectData.projectEndtime);
vm.formData = Object.assign(vm.formData, data.projectData);
vm.formData.attachmentUrl1 = data.attachmentData[0].attachmentUrl;
vm.formData.attachmentMore1 = Object.assign(vm.formData.attachmentMore1, data.attachmentData[0]);
// 暂存为1 下一步为3
vm.formData.projectType = vm.formData.projectType == 0 ? 4 : vm.formData.projectType;
vm.formData.projectBegintime = vm.formData.projectBegintime ? new Date(vm.formData.projectBegintime) : '';
vm.formData.projectEndtime = vm.formData.projectBegintime ? new Date(vm.formData.projectEndtime) : '';
if (data.attachmentData[1]) {
vm.formData.attachmentUrl2 = data.attachmentData[1].attachmentUrl;
vm.formData.type = data.attachmentData[1].attachmentType;
vm.formData.attachmentMore2 = Object.assign(vm.formData.attachmentMore2, data.attachmentData[1]);
}
// 将所有课程设置到购物车中
console.log(data.hotCourseForPortalModelList.slice())
vm.setCartList(data.hotCourseForPortalModelList.slice());
// 不知道是否要使用
// vm.$emit('setStatus4Flag',data.projectData.status4Flag)
},
// // 设置已有的基本信息
// setBaseMessage(data) {
// data.projectData.projectBegintime = convertTime(data.projectData.projectBegintime);
// data.projectData.projectEndtime = convertTime(data.projectData.projectEndtime);
// vm.formData = Object.assign(vm.formData, data.projectData);
// vm.formData.attachmentUrl1 = data.attachmentData[0].attachmentUrl;
// vm.formData.attachmentMore1 = Object.assign(vm.formData.attachmentMore1, data.attachmentData[0]);
// // 暂存为1 下一步为3
// vm.formData.projectType = vm.formData.projectType == 0 ? 3 : vm.formData.projectType;
// vm.formData.projectBegintime = vm.formData.projectBegintime ? new Date(vm.formData.projectBegintime) : '';
// vm.formData.projectEndtime = vm.formData.projectBegintime ? new Date(vm.formData.projectEndtime) : '';
// if (data.attachmentData[1]) {
// vm.formData.attachmentUrl2 = data.attachmentData[1].attachmentUrl;
// vm.formData.type = data.attachmentData[1].attachmentType;
// vm.formData.attachmentMore2 = Object.assign(vm.formData.attachmentMore2, data.attachmentData[1]);
// }
// vm.$emit('setStatus4Flag',data.projectData.status4Flag)
// },
// 创建时,获取机构信息、列表图片等
getMessage() {
openLoading(vm);
vm.GET(`portal/portalInfo/sass/attach`, {typeList: [1,2]})
.then(res => {
closeLoading(vm);
if (res.code == "
000000
") {
this.attachMap = res.data.attachMap;
this.attachMap[1].forEach(item => {
item.checked = false;
});
this.attachMap[2].forEach(item => {
item.checked = false;
});
this.formData.attachmentUrl1 = this.attachMap[1][0].attachmentUrl;
this.formData.attachmentUrl2 = this.attachMap[2][0].attachmentUrl;
this.formData.creatorOrganizationName = res.data.creatorOrganizationName || '';
this.attachMap[1][0].checked = true;
this.attachMap[2][0].checked = true;
console.log('this.attachMap', this.attachMap);
// let data = res.data;
// data.projectData.organizationNameList = [data.projectData.creatorOrganizationName]
// this.$emit('hideSave',res.data.projectData.projectStatus)
// vm.setBaseMessage(res.data);
} else {
vm.$message.info(res.message);
}
})
.catch((err) => {
closeLoading(vm);
vm.$message.warning('请稍后重试');
});
},
// 获取选择模板后的基本信息
// getMessage() {
// openLoading(vm);
// vm.GET(`portal/openTemplateProject/getOpenTemplateInfoForCreate/${vm.openTemplateId}`)
// .then(res => {
// closeLoading(vm);
// if (res.code == "
000000
") {
// let data = res.data;
// data.projectData.organizationNameList = [data.projectData.creatorOrganizationName]
// this.$emit('hideSave',res.data.projectData.projectStatus)
// vm.setBaseMessage(res.data);
// } else {
// vm.$message.info(res.message);
// }
// })
// .catch((err) => {
// closeLoading(vm);
// vm.$message.warning('请稍后重试');
// });
// },
// 获取编辑时的信息
getEditorMessage() {
openLoading(vm);
// vm.GET(`portal/portalInfo/getProjectInfo/${vm.projectId}`)
vm.GET(`portal/portalCustom/getInfo/${vm.projectId}`)
.then(res => {
closeLoading(vm);
if (res.code == "
000000
") {
// this.$emit('hideSave',res.data.projectData.projectStatus)
vm.setBaseMessage(res.data)
} else {
vm.$message.info(res.message);
}
})
.catch((err) => {
closeLoading(vm);
vm.$message.warning('请稍后重试');
});
},
// 增加发起机构
plusOrg(index) {
vm.formData.organizationNameList.splice(index + 1, 0, '');
},
// 删除发起机构
deleteOrg(index) {
vm.formData.organizationNameList.splice(index, 1);
},
// 机构名称输入
changeOrganizationName() {
let textLength = vm.formData.organizationName.length;
// 机构输入提示显示与否
vm.visibleName = textLength == 0;
},
// 离开机构名称焦点
blurName() {
vm.visibleName = false;
setTimeout(() => {
vm.submitForm("
formData
");
}, 200);
},
// 机构名称聚焦
focusName(index) {
let textLength = vm.formData.organizationNameList[index].length;
if (textLength == 0) {
vm.orgListIndex = index + 1;
vm.visibleName = true;
} else {
vm.visibleName = false;
}
},
// 机构选择默认值
checkDefault() {
vm.organizationContent = vm.formData.creatorOrganizationName;
vm.formData.organizationNameList.splice(vm.orgListIndex-1, 1, vm.organizationContent);
vm.visibleName = false;
},
//上传列表图片
// beforeUploadListPic(file) {
// let fileLimit = {
// width: 230,
// height: 172,
// size: 0.5,
// sizeText: "
500
K
",
// key: "
attachmentUrl1
",
// more: "
attachmentMore1
",
// show: "
uploadImgMessage
"
// };
// vm.beforeAvatarUpload(file, fileLimit);
// },
//上传图片校验
// beforeAvatarUpload(file, fileLimit) {
// const isJPG = file.type === "
image
/
jpeg
";
// const isPNG = file.type === "
image
/
png
";
// const isLt2M = file.size / 1024 / 1024 < fileLimit.size;
// if (!isJPG && !isPNG) {
// vm.$message.error("
图片不符合规范,请根据规范上传图片
");
// return;
// }
// if (!isLt2M) {
// vm.$message.error("
图片不符合规范,请根据规范上传图片
");
// return;
// }
// let _img = new FileReader();
// _img.readAsDataURL(file);
// _img.onload = function(theFile) {
// let image = new Image();
// image.src = theFile.target.result;
// image.onload = function() {
// let _vm = this;
// if (
// _vm.width != fileLimit.width ||
// _vm.height != fileLimit.height
// ) {
// vm.$message.error("
图片不符合规范,请根据规范上传图片
");
// } else {
// openLoading(vm);
// doUpload(
// vm,
// file,
// getFilePath(file, null),
// "
preview4
",
// "
progress1
",
// 1
// ).then(function(path) {
// closeLoading(vm);
// console.log(path);
// if (fileLimit.show == "
uploadImgMessage
") {
// vm.uploadImgMessage = false;
// } else if (fileLimit.show == "
uploadImgMessage2
") {
// vm.uploadImgMessage2 = false;
// }
// vm.formData[fileLimit.key] = path.fullPath;
// vm.formData[fileLimit.more] = {
// attachmentName: path.name,
// attachmentExt: path.ext,
// attachmentSize: path.size
// };
// vm.$message.success("
上传成功
");
// });
// }
// };
// };
// return isJPG && isLt2M;
// },
// // 删除图片
// deleteImg(type) {
// if (type == 1) {
// vm.formData.attachmentUrl1 = "";
// vm.imgMouseOver = false;
// } else {
// vm.formData.attachmentUrl2 = "";
// vm.imgMouseOver2 = false;
// }
// },
// //改变封面类型
// changeCover(radio) {
// vm.formData.attachmentUrl2 = "";
// },
// //上传封面图片
// beforeUploadCoverPic(file) {
// let fileLimit = {
// width: 750,
// height: 420,
// size: 2,
// sizeText: "
2.0
M
",
// key: "
attachmentUrl2
",
// more: "
attachmentMore2
",
// show: "
uploadImgMessage2
"
// };
// if (vm.formData.type == 1) {
// vm.beforeAvatarUpload(file, fileLimit);
// } else {
// vm.beforeUploadMp4(file);
// }
// },
// //上传mp4
// beforeUploadMp4(file) {
// console.log(file);
// const isMP4 = file.type === "
video
/
mp4
";
// const isLt = file.size / 1024 / 1024 < 500;
// if (!isLt) {
// vm.$message.error("
视频不符合规范,请根据规范上传视频
");
// return;
// }
// if (!isMP4) {
// vm.$message.error("
视频不符合规范,请根据规范上传视频
");
// } else {
// openLoading(vm);
// doUpload(
// vm,
// file,
// getFilePath(file, null),
// "
preview4
",
// "
progress1
",
// ""
// ).then(function(path) {
// closeLoading(vm);
// console.log(path);
// vm.uploadImgMessage2 = false;
// vm.formData.attachmentUrl2 = path.fullPath;
// vm.$message.success("
上传成功
");
// });
// }
// },
// 点击下一步
nextStep() {
let flag = true;
if (!vm.formData.attachmentUrl1) {
vm.uploadImgMessage = true;
flag = false;
} else {
vm.uploadImgMessage = false;
}
if (!vm.formData.attachmentUrl2) {
vm.uploadImgMessage2 = true;
flag = false;
} else {
vm.uploadImgMessage2 = false;
}
if (vm.submitForm('formData') && flag) {
vm.insertOrupdate();
}
},
// 暂存
save() {
if (vm.$refs['formData'].projectName == '') {
vm.$refs['formData'].validateField('projectName')
} else {
vm.insertOrupdate(1);
};
},
// 新增或者更新基本信息
insertOrupdate(status) {
if(new Date(vm.formData.projectEndtime).getTime() > new Date(vm.formData.projectBegintime).getTime() + 1000 * 60 * 60 * 24 * vm.formData.expireDay) {
vm.$message.warning('项目结束时间应在有效期内');
return;
}
if(new Date(vm.formData.projectEndtime).getTime() <= new Date(vm.formData.projectBegintime).getTime()) {
vm.$message.warning('项目结束时间应大于开始时间');
return;
}
vm.formData.projectBegintime = convertTime(vm.formData.projectBegintime, false);
vm.formData.projectEndtime = convertTime(vm.formData.projectEndtime, false);
if (status) {
vm.formData.projectStatus = status;
}
// 图片或者视频地址
vm.formData.attachmentMore1.attachmentUrl = vm.formData.attachmentUrl1;
vm.formData.attachmentMore2.attachmentUrl = vm.formData.attachmentUrl2;
// 封面类型
vm.formData.attachmentMore2.attachmentType = vm.formData.type;
vm.formData.attachmentMore2.kind = 2;
//整合图片视频
vm.attachmentModel[0] = Object.assign(vm.attachmentModel[0],vm.formData.attachmentMore1);
vm.attachmentModel[1] = Object.assign(vm.attachmentModel[1],vm.formData.attachmentMore2);
let baseobj = {};
baseobj.projectModel = JSON.stringify(vm.formData);
baseobj.attachmentModel = JSON.stringify(vm.attachmentModel);
baseobj.attachmentPDFModel= null;
baseobj.notifyData= null;
baseobj.hotCourseForPortalModelList = vm.cartList;
console.log(baseobj);
openLoading(vm);
vm.POST("
portal
/
portalCustom
/
insertOrUpdate
", baseobj)
.then(res => {
closeLoading(vm);
if (res.code == "
000000
") {
// 暂存不会跳到下一页
if (status == 1) {
vm.$message.info('成功');
return;
}
// 下一步,并将项目id传递给父组件
vm.$emit('next',res.data.id);
} else if (res.code == "
213061
") {
vm.dialogObj.visible = true;
} else {
vm.$message.warning(res.message);
}
})
.catch((err) => {
vm.$message({
type: "
warning
",
message: res.message
});
})
},
//表单校验
submitForm(formName) {
let flag = null;
vm.$refs[formName].validate(valid => {
if (valid) {
flag = true;
} else {
flag = false;
}
});
return flag;
},
// 取消
confirm() {
vm.dialogObj.visible = false;
},
// 确定
hide() {
vm.dialogObj.visible = false;
vm.$emit('backSelectVue')
}
}
}
</
script
>
<
style
>
.subject-slelct
.el-input__inner
{
height
:
32px
;
line-height
:
32px
;
}
</
style
>
<
style
lang=
"scss"
scoped
>
.base-message-wrap
{
padding-top
:
80px
;
.p_label
{
margin-left
:
56px
;
font-size
:
12px
;
color
:
#606266
;
}
.edit-img
{
width
:
20px
;
height
:
20px
;
vertical-align
:
middle
;
margin-left
:
10px
;
}
.day-btn
{
display
:
inline-block
;
width
:
50px
;
height
:
32px
;
line-height
:
32px
;
background
:
#838683
;
text-align
:
center
;
margin-left
:
-3px
;
border-radius
:
0
4px
4px
0
;
z-index
:
100
;
}
.basic-item-icon
{
position
:
relative
;
.require
{
position
:
absolute
;
left
:
67px
;
top
:
11px
;
color
:
#f56c6c
;
}
.upload-message
{
position
:
absolute
;
left
:
160px
;
top
:
105px
;
font-size
:
12px
;
color
:
#f56c6c
;
}
.img-delete
{
position
:
absolute
;
left
:
0px
;
top
:
0px
;
width
:
84px
;
height
:
100px
;
background
:
#000
;
opacity
:
0
.7
;
z-index
:
999
;
i
{
color
:
#fff
;
margin-top
:
39px
;
margin-left
:
0px
;
}
}
}
.word-num
{
font-size
:
12px
;
color
:
#999
;
padding-top
:
5px
;
}
.line
{
margin-left
:
10px
;
width
:
20px
;
}
.bg-uploader
{
img
{
float
:
left
;
}
.bg-img
{
width
:
84px
;
height
:
100px
;
}
.bg-video
{
float
:
left
;
width
:
84px
;
height
:
100px
;
}
.limit-text
{
float
:
left
;
margin-left
:
10px
;
margin-top
:
-10px
;
p
{
font-size
:
12px
;
color
:
#999
;
}
}
}
.el-upload__tip
{
position
:
absolute
;
top
:
-6px
;
left
:
130px
;
}
.choose-button
{
background
:
#fff
;
color
:
#409eff
;
border
:
1px
solid
#409eff
;
}
.el-popover--plain
{
padding
:
18px
20px
;
top
:
40px
;
}
.ueitem
{
position
:
relative
;
}
.ue-warp
{
position
:
absolute
;
width
:
80%
;
height
:
100%
;
background
:
#F5F7FA
;
opacity
:
0
.5
;
top
:
0
;
z-index
:
1000
;
}
}
.el-form-item__content
{
width
:
100%
;
height
:
100%
;
background
:
red
;
}
.popover-content
{
position
:
relative
;
top
:
0
;
left
:
0
;
}
.time-message
{
margin
:
-6px
0
20px
150px
;
font-size
:
14px
;
}
.url1-selected
{
img
{
widows
:
120px
;
height
:
90px
;
}
}
.url1-list
{
display
:
flex
;
flex-direction
:
row
;
.img-wrapper
{
position
:
relative
;
top
:
0
;
left
:
0
;
z-index
:
1
;
.selected-icon
{
width
:
60px
;
height
:
45px
;
margin-right
:
10px
;
}
.status-icon
{
position
:
absolute
;
top
:
5px
;
right
:
15px
;
z-index
:
2
;
widows
:
14px
;
height
:
14px
;
}
}
}
.url2-selected
{
img
{
width
:
160px
;
height
:
90px
;
}
}
.url2-list
{
display
:
flex
;
flex-direction
:
row
;
.img-wrapper
{
position
:
relative
;
top
:
0
;
left
:
0
;
z-index
:
1
;
.selected-icon
{
width
:
80px
;
height
:
45px
;
margin-right
:
10px
;
}
.status-icon
{
position
:
absolute
;
top
:
5px
;
right
:
15px
;
z-index
:
2
;
widows
:
14px
;
height
:
14px
;
}
}
}
.curt-position-wrapper
{
position
:
relative
;
top
:
0
;
left
:
0
;
z-index
:
100
;
.curt-position
{
position
:
absolute
;
top
:
0
;
left
:
0
;
z-index
:
101
;
}
}
</
style
>
\ No newline at end of file
src/components/education/custom/custom-baseinfo.vue
浏览文件 @
af80fcec
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
</el-col>
</el-col>
<el-col
:span=
"10"
class=
"curt-position-wrapper"
>
<el-col
:span=
"10"
class=
"curt-position-wrapper"
>
<div
class=
"curt-position"
>
<div
class=
"curt-position"
>
<S
hoppingCart
></Shopping
Cart>
<S
ortedCart
:isPreview=
"isPreview"
></Sorted
Cart>
</div>
</div>
</el-col>
</el-col>
</el-form-item>
</el-form-item>
...
@@ -91,7 +91,7 @@
...
@@ -91,7 +91,7 @@
</el-form-item>
</el-form-item>
</el-col>
</el-col>
</el-form-item>
</el-form-item>
<p
class=
"time-message"
><i
class=
"el-icon-warning-outline"
></i>
项目有效期为
{{
formData
.
expireDay
}}
天,选择项目起止时间须在有效期内
</p>
<p
class=
"time-message"
><i
class=
"el-icon-warning-outline"
></i>
项目有效期为
{{
attachInfo
.
limitValue
}}
天,选择项目起止时间须在有效期内
</p>
</div>
</div>
<el-form-item
label=
"列表图片:"
style=
"margin-bottom: 10px"
>
<el-form-item
label=
"列表图片:"
style=
"margin-bottom: 10px"
>
...
@@ -105,7 +105,7 @@
...
@@ -105,7 +105,7 @@
<ul
class=
"url1-list"
>
<ul
class=
"url1-list"
>
<li
<li
class=
"img-wrapper"
class=
"img-wrapper"
v-for=
"(item, index) in attachMap[1]"
v-for=
"(item, index) in attach
Info.attach
Map[1]"
:key=
"index"
:key=
"index"
@
click=
"selectedAttachUrl(item, 1)"
@
click=
"selectedAttachUrl(item, 1)"
>
>
...
@@ -117,35 +117,6 @@
...
@@ -117,35 +117,6 @@
</el-col>
</el-col>
</el-form-item>
</el-form-item>
<!--
<div
class=
"basic-item-icon"
>
<span
class=
"require"
>
*
</span>
<el-form-item
label=
"列表图片:"
>
<el-upload
v-model=
"formData.attachmentUrl1"
class=
"bg-uploader"
action=
"#"
:show-file-list=
"false"
:before-upload=
"beforeUploadListPic"
disabled
>
<img
v-if=
"formData.attachmentUrl1"
@
mouseover
.
stop=
"imgMouseOver=true"
:src=
"formData.attachmentUrl1"
class=
"bg-img"
>
<img
v-if=
"!formData.attachmentUrl1"
class=
"bg-img"
src=
"../../../assets/image/small.png"
>
<div
class=
"img-delete"
v-show=
"imgMouseOver && false"
@
click
.
stop=
"deleteImg(1)"
@
mouseout
.
stop=
"imgMouseOver=false"
><i
class=
"el-icon-delete"
></i></div>
<div
class=
"limit-text"
>
<p>
尺寸:230*172
</p>
<p>
限制大小: 500Kb
</p>
<p>
支持.jpg,.png格式
</p>
</div>
</el-upload>
</el-form-item>
<p
class=
"upload-message"
v-if=
"uploadImgMessage"
>
请选择列表图片
</p>
</div>
-->
<!-- @change="changeCover" -->
<el-form-item
label=
"封面类型:"
>
<el-form-item
label=
"封面类型:"
>
<el-radio-group
<el-radio-group
size=
"small"
size=
"small"
...
@@ -153,57 +124,9 @@
...
@@ -153,57 +124,9 @@
disabled
disabled
>
>
<el-radio
:label=
"1"
>
图片
</el-radio>
<el-radio
:label=
"1"
>
图片
</el-radio>
<!--
<el-radio
:label=
"2"
>
视频
</el-radio>
-->
</el-radio-group>
</el-radio-group>
</el-form-item>
</el-form-item>
<!--
<div
class=
"basic-item-icon"
>
<span
class=
"require"
>
*
</span>
<el-form-item
label=
"封面文件:"
>
<el-upload
v-model=
"formData.attachmentUrl2"
class=
"bg-uploader"
action=
"#"
:show-file-list=
"false"
:before-upload=
"beforeUploadCoverPic"
disabled
>
<img
v-if=
"formData.type == 1 && formData.attachmentUrl2"
:src=
"formData.attachmentUrl2"
@
mouseover
.
stop=
"imgMouseOver2=true"
class=
"bg-img"
>
<video
v-if=
"formData.type == 2 && formData.attachmentUrl2"
width=
"100"
controls
class=
"bg-video"
@
mouseover
.
stop=
"imgMouseOver2=true"
>
<source
:src=
"formData.attachmentUrl2"
type=
"video/mp4"
>
浏览器不支持mp4
</video>
<img
v-if=
"!formData.attachmentUrl2"
class=
"bg-img"
src=
"../../../assets/image/small.png"
>
<div
class=
"img-delete"
v-show=
"imgMouseOver2 && false"
@
click
.
stop=
"deleteImg(2)"
@
mouseout
.
stop=
"imgMouseOver2=false"
><i
class=
"el-icon-delete"
></i></div>
<div
v-show=
"formData.type == 1"
class=
"limit-text"
>
<p>
尺寸:750*420
</p>
<p>
限制大小: 2.0 Mb
</p>
<p>
支持.jpg,.png格式
</p>
</div>
<div
v-show=
"formData.type == 2"
class=
"limit-text"
>
<p></p>
<p>
限制大小: 500 Mb
</p>
<p>
支持.mp4
</p>
</div>
</el-upload>
</el-form-item>
<p
class=
"upload-message"
v-if=
"uploadImgMessage2"
>
请选择封面
</p>
</div>
-->
<el-form-item
label=
"封面文件:"
style=
"margin-bottom: 10px"
>
<el-form-item
label=
"封面文件:"
style=
"margin-bottom: 10px"
>
<el-col
:span=
"13"
style=
"height: 95px"
>
<el-col
:span=
"13"
style=
"height: 95px"
>
<div
class=
"url2-selected"
>
<div
class=
"url2-selected"
>
...
@@ -215,7 +138,7 @@
...
@@ -215,7 +138,7 @@
<ul
class=
"url2-list"
>
<ul
class=
"url2-list"
>
<li
<li
class=
"img-wrapper"
class=
"img-wrapper"
v-for=
"(item, index) in attachMap[2]"
v-for=
"(item, index) in attach
Info.attach
Map[2]"
:key=
"index"
:key=
"index"
@
click=
"selectedAttachUrl(item, 2)"
@
click=
"selectedAttachUrl(item, 2)"
>
>
...
@@ -250,10 +173,10 @@
...
@@ -250,10 +173,10 @@
<
script
>
<
script
>
import
{
doUpload
,
getFilePath
}
from
"../../../utils/qiniu-util"
;
import
{
doUpload
,
getFilePath
}
from
"../../../utils/qiniu-util"
;
import
{
openLoading
,
closeLoading
}
from
"../../../utils/utils"
;
import
{
openLoading
,
closeLoading
}
from
"../../../utils/utils"
;
import
S
hopping
Cart
from
'@/components/education/custom/sorted-cart'
import
S
orted
Cart
from
'@/components/education/custom/sorted-cart'
import
{
convertTime
}
from
"../../../utils"
;
import
{
convertTime
}
from
"../../../utils"
;
import
dialog
from
"./dialog"
;
import
dialog
from
"./dialog"
;
import
{
mapGetters
}
from
'vuex'
;
import
{
mapGetters
,
mapActions
}
from
'vuex'
;
let
vm
=
null
;
let
vm
=
null
;
export
default
{
export
default
{
props
:
{
props
:
{
...
@@ -355,8 +278,8 @@ export default {
...
@@ -355,8 +278,8 @@ export default {
pickerOptions1: {
pickerOptions1: {
disabledDate: time => {
disabledDate: time => {
return (
return (
// time.getTime() < new Date((vm.formData.projectBegintime).replace(/
\
-/g, '/')).getTime() || time.getTime() > new Date((vm.formData.projectBegintime).replace(/
\
-/g, '/')).getTime() + 1000 * 60 * 60 * 24 * vm.
formData.expireDay
// time.getTime() < new Date((vm.formData.projectBegintime).replace(/
\
-/g, '/')).getTime() || time.getTime() > new Date((vm.formData.projectBegintime).replace(/
\
-/g, '/')).getTime() + 1000 * 60 * 60 * 24 * vm.
attachInfo.limitValue
time.getTime() < new Date(vm.formData.projectBegintime).getTime() || time.getTime() > new Date(vm.formData.projectBegintime).getTime() + 1000 * 60 * 60 * 24 * vm.
formData.expireDay
time.getTime() < new Date(vm.formData.projectBegintime).getTime() || time.getTime() > new Date(vm.formData.projectBegintime).getTime() + 1000 * 60 * 60 * 24 * vm.
attachInfo.limitValue
); //减去一天的时间代表可以选择同一天;
); //减去一天的时间代表可以选择同一天;
}
}
},
},
...
@@ -404,6 +327,15 @@ export default {
...
@@ -404,6 +327,15 @@ export default {
hideMsg: '重新选择'
hideMsg: '重新选择'
},
},
isPreview: 0,
isPreview: 0,
attachInfo: {
attachMap: {
1: [],
2: []
},
creatorOrganizationName: "
云鹊医
",
limitKind: 1,
limitValue: 90,
},
attachMap: {
attachMap: {
1: [],
1: [],
2: []
2: []
...
@@ -415,26 +347,29 @@ export default {
...
@@ -415,26 +347,29 @@ export default {
},
},
components: {
components: {
dialogComponet:dialog,
dialogComponet:dialog,
S
hopping
Cart
S
orted
Cart
},
},
created() {
created() {
vm = this;
vm = this;
vm.isPreview = vm.$route.query.isPreview ? vm.$route.query.isPreview : 0;
vm.isPreview = vm.$route.query.isPreview ? vm.$route.query.isPreview : 0;
if (vm.editor) {
vm.getMessage();
// 编辑时
// 编辑时
if (vm.editor) {
vm.disabled = false;
vm.disabled = false;
vm.getEditorMessage()
vm.getEditorMessage()
} else{
// 创建时
// 创建时
} else{
vm.disabled = true;
vm.disabled = true;
vm.getMessage();
//
vm.getMessage();
}
}
},
},
methods: {
methods: {
...mapActions(['setCartList']),
// 选择列表或封面图片
// 选择列表或封面图片
selectedAttachUrl(item, index) {
selectedAttachUrl(item, index) {
this.attachMap[index].forEach( attach => {
// 查看状态,不可重新选择
if( vm.isPreview == 1) return;
this.attachInfo.attachMap[index].forEach( attach => {
if(item.attachmentUrl == attach.attachmentUrl) {
if(item.attachmentUrl == attach.attachmentUrl) {
attach.checked = true;
attach.checked = true;
} else {
} else {
...
@@ -443,27 +378,28 @@ export default {
...
@@ -443,27 +378,28 @@ export default {
})
})
vm.formData['attachmentUrl' + index] = item.attachmentUrl;
vm.formData['attachmentUrl' + index] = item.attachmentUrl;
vm.$forceUpdate();
vm.$forceUpdate();
console.log(this.attachMap);
},
},
// 设置已有的基本信息
// 设置已有的基本信息
setBaseMessage(data) {
setBaseMessage(data) {
//
data.projectData.projectBegintime = convertTime(data.projectData.projectBegintime);
data.projectData.projectBegintime = convertTime(data.projectData.projectBegintime);
//
data.projectData.projectEndtime = convertTime(data.projectData.projectEndtime);
data.projectData.projectEndtime = convertTime(data.projectData.projectEndtime);
//
vm.formData = Object.assign(vm.formData, data.projectData);
vm.formData = Object.assign(vm.formData, data.projectData);
//
vm.formData.attachmentUrl1 = data.attachmentData[0].attachmentUrl;
vm.formData.attachmentUrl1 = data.attachmentData[0].attachmentUrl;
//
vm.formData.attachmentMore1 = Object.assign(vm.formData.attachmentMore1, data.attachmentData[0]);
vm.formData.attachmentMore1 = Object.assign(vm.formData.attachmentMore1, data.attachmentData[0]);
// 暂存为1 下一步为3
// 暂存为1 下一步为3
vm.formData.projectType = vm.formData.projectType == 0 ? 4 : vm.formData.projectType;
vm.formData.projectType = vm.formData.projectType == 0 ? 4 : vm.formData.projectType;
vm.formData.projectBegintime = vm.formData.projectBegintime ? new Date(vm.formData.projectBegintime) : '';
vm.formData.projectBegintime = vm.formData.projectBegintime ? new Date(vm.formData.projectBegintime) : '';
vm.formData.projectEndtime = vm.formData.projectBegintime ? new Date(vm.formData.projectEndtime) : '';
vm.formData.projectEndtime = vm.formData.projectBegintime ? new Date(vm.formData.projectEndtime) : '';
// if (data.attachmentData[1]) {
if (data.attachmentData[1]) {
// vm.formData.attachmentUrl2 = data.attachmentData[1].attachmentUrl;
vm.formData.attachmentUrl2 = data.attachmentData[1].attachmentUrl;
// vm.formData.type = data.attachmentData[1].attachmentType;
vm.formData.type = data.attachmentData[1].attachmentType;
// vm.formData.attachmentMore2 = Object.assign(vm.formData.attachmentMore2, data.attachmentData[1]);
vm.formData.attachmentMore2 = Object.assign(vm.formData.attachmentMore2, data.attachmentData[1]);
// }
}
// 将所有课程设置到购物车中
console.log(data.hotCourseForPortalModelList.slice())
vm.setCartList(data.hotCourseForPortalModelList.slice());
// 不知道是否要使用
// 不知道是否要使用
// vm.$emit('setStatus4Flag',data.projectData.status4Flag)
// vm.$emit('setStatus4Flag',data.projectData.status4Flag)
},
},
...
@@ -496,19 +432,19 @@ export default {
...
@@ -496,19 +432,19 @@ export default {
closeLoading(vm);
closeLoading(vm);
if (res.code == "
000000
") {
if (res.code == "
000000
") {
this.attach
Map = res.data.attachMap
;
this.attach
Info = res.data
;
this.attachMap[1].forEach(item => {
this.attach
Info.attach
Map[1].forEach(item => {
item.checked = false;
item.checked = false;
});
});
this.attachMap[2].forEach(item => {
this.attach
Info.attach
Map[2].forEach(item => {
item.checked = false;
item.checked = false;
});
});
this.formData.attachmentUrl1 = this.attachMap[1][0].attachmentUrl;
this.formData.attachmentUrl1 = this.attach
Info.attach
Map[1][0].attachmentUrl;
this.formData.attachmentUrl2 = this.attachMap[2][0].attachmentUrl;
this.formData.attachmentUrl2 = this.attach
Info.attach
Map[2][0].attachmentUrl;
this.formData.creatorOrganizationName =
res.data
.creatorOrganizationName || '';
this.formData.creatorOrganizationName =
this.attachInfo
.creatorOrganizationName || '';
this.attachMap[1][0].checked = true;
this.attach
Info.attach
Map[1][0].checked = true;
this.attachMap[2][0].checked = true;
this.attach
Info.attach
Map[2][0].checked = true;
console.log('this.attach
Map', this.attachMap
);
console.log('this.attach
Info', this.attachInfo
);
// let data = res.data;
// let data = res.data;
// data.projectData.organizationNameList = [data.projectData.creatorOrganizationName]
// data.projectData.organizationNameList = [data.projectData.creatorOrganizationName]
// this.$emit('hideSave',res.data.projectData.projectStatus)
// this.$emit('hideSave',res.data.projectData.projectStatus)
...
@@ -607,50 +543,8 @@ export default {
...
@@ -607,50 +543,8 @@ export default {
vm.visibleName = false;
vm.visibleName = false;
},
},
//上传列表图片
// beforeUploadListPic(file) {
// let fileLimit = {
// width: 230,
// height: 172,
// size: 0.5,
// sizeText: "
500
K
",
// key: "
attachmentUrl1
",
// more: "
attachmentMore1
",
// show: "
uploadImgMessage
"
// };
// vm.beforeAvatarUpload(file, fileLimit);
// },
//上传图片校验
// beforeAvatarUpload(file, fileLimit) {
// const isJPG = file.type === "
image
/
jpeg
";
// const isPNG = file.type === "
image
/
png
";
// const isLt2M = file.size / 1024 / 1024 < fileLimit.size;
// if (!isJPG && !isPNG) {
// vm.$message.error("
图片不符合规范,请根据规范上传图片
");
// return;
// }
// if (!isLt2M) {
// vm.$message.error("
图片不符合规范,请根据规范上传图片
");
// return;
// }
// let _img = new FileReader();
// _img.readAsDataURL(file);
// _img.onload = function(theFile) {
// let image = new Image();
// image.src = theFile.target.result;
// image.onload = function() {
// let _vm = this;
// if (
// _vm.width != fileLimit.width ||
// _vm.height != fileLimit.height
// ) {
// vm.$message.error("
图片不符合规范,请根据规范上传图片
");
// } else {
// openLoading(vm);
// doUpload(
// vm,
// file,
// getFilePath(file, null),
// getFilePath(file, null),
// "
preview4
",
// "
preview4
",
// "
progress1
",
// "
progress1
",
...
@@ -773,7 +667,7 @@ export default {
...
@@ -773,7 +667,7 @@ export default {
// 新增或者更新基本信息
// 新增或者更新基本信息
insertOrupdate(status) {
insertOrupdate(status) {
if(new Date(vm.formData.projectEndtime).getTime() > new Date(vm.formData.projectBegintime).getTime() + 1000 * 60 * 60 * 24 * vm.
formData.expireDay
) {
if(new Date(vm.formData.projectEndtime).getTime() > new Date(vm.formData.projectBegintime).getTime() + 1000 * 60 * 60 * 24 * vm.
attachInfo.limitValue
) {
vm.$message.warning('项目结束时间应在有效期内');
vm.$message.warning('项目结束时间应在有效期内');
return;
return;
}
}
...
...
src/components/education/custom/shopping-cart.vue
浏览文件 @
af80fcec
...
@@ -5,13 +5,9 @@
...
@@ -5,13 +5,9 @@
<img
@
click=
"close"
src=
"../../../assets/custom/icon/close.png"
alt
/>
<img
@
click=
"close"
src=
"../../../assets/custom/icon/close.png"
alt
/>
</div>
</div>
<ul
class=
"cart-list"
>
<ul
class=
"cart-list"
>
<li
<li
class=
"cart-course"
v-for=
"item in cartList"
:key=
"item.courseId"
>
class=
"cart-course"
v-for=
"item in cartList"
:key=
"item.courseId"
>
<div
class=
"img"
>
<div
class=
"img"
>
<img
src=
"../../../assets/custom/test.png
"
alt
/>
<img
:src=
"item.courseImageUrl
"
alt
/>
<span
class=
"level"
>
{{
item
.
typeStr
}}
</span>
<span
class=
"level"
>
{{
item
.
typeStr
}}
</span>
</div>
</div>
<div
class=
"detail"
>
<div
class=
"detail"
>
...
@@ -32,7 +28,7 @@ export default {
...
@@ -32,7 +28,7 @@ export default {
return
{};
return
{};
},
},
computed
:
{
computed
:
{
...
mapGetters
([
"cartList"
,
'courseList'
])
...
mapGetters
([
"cartList"
,
"courseList"
])
},
},
methods
:
{
methods
:
{
close
()
{
close
()
{
...
@@ -40,15 +36,15 @@ export default {
...
@@ -40,15 +36,15 @@ export default {
},
},
deleteCart
(
item
)
{
deleteCart
(
item
)
{
// 先删除够物车中的课程
// 先删除够物车中的课程
let
delItemIndex
=
this
.
cartList
.
findIndex
(
course
=>
{
let
delItemIndex
=
this
.
cartList
.
findIndex
(
course
=>
{
return
course
.
courseId
==
item
.
courseId
;
return
course
.
courseId
==
item
.
courseId
;
})
})
;
this
.
cartList
.
splice
(
delItemIndex
,
1
);
this
.
cartList
.
splice
(
delItemIndex
,
1
);
// 再查找当前课程列表中是否有,如果有,则将其置为不选中状态
// 再查找当前课程列表中是否有,如果有,则将其置为不选中状态
let
courseIndex
=
this
.
courseList
.
list
.
findIndex
(
course
=>
{
let
courseIndex
=
this
.
courseList
.
list
.
findIndex
(
course
=>
{
return
course
.
courseId
==
item
.
courseId
;
return
course
.
courseId
==
item
.
courseId
;
})
})
;
if
(
courseIndex
>=
0
)
{
if
(
courseIndex
>=
0
)
{
this
.
courseList
.
list
[
courseIndex
].
checked
=
false
;
this
.
courseList
.
list
[
courseIndex
].
checked
=
false
;
}
}
}
}
...
@@ -80,23 +76,17 @@ export default {
...
@@ -80,23 +76,17 @@ export default {
height: 15px;
height: 15px;
}
}
}
}
// .list {
// padding: 15px;
// height: 480px;
// overflow: auto;
// }
.cart-list {
.cart-list {
display: flex;
display: flex;
flex-direction: column;
flex-direction: column;
justify-content: flex-start;
justify-content: flex-start;
// flex-wrap: wrap;
height: 490px;
height: 490px;
overflow: auto;
overflow: auto;
.cart-course {
.cart-course {
user-select: none;
position: relative;
position: relative;
display: flex;
display: flex;
flex-direction: row;
flex-direction: row;
// height: 83px;
width: 410px;
width: 410px;
margin: 15px;
margin: 15px;
align-items: center;
align-items: center;
...
@@ -115,11 +105,11 @@ export default {
...
@@ -115,11 +105,11 @@ export default {
position: relative;
position: relative;
top: 0;
top: 0;
left: 0;
left: 0;
width: 120;
width: 120
px
;
height: 68px;
height: 68px;
margin-right: 15px;
margin-right: 15px;
img {
img {
width: 120;
width: 120
px
;
height: 68px;
height: 68px;
border-radius: 4px;
border-radius: 4px;
}
}
...
...
src/components/education/custom/sorted-cart.vue
浏览文件 @
af80fcec
...
@@ -5,18 +5,36 @@
...
@@ -5,18 +5,36 @@
<span
class=
"sub"
>
可上下拖拽课程行,调整课程在列表页的展示顺序
</span>
<span
class=
"sub"
>
可上下拖拽课程行,调整课程在列表页的展示顺序
</span>
</div>
</div>
<!--
<draggable
v-model=
"myArray"
class=
"cart-list"
>
-->
<div
v-if=
"isPreview == 1"
class=
"cart-list"
>
<draggable
class=
"cart-list"
v-model=
"cartList"
>
<div
class=
"cart-course is-preview"
v-for=
"(item, index) in cartList"
:key=
"index"
>
<div
class=
"cart-course"
v-for=
"item in cartList"
:key=
"item.courseId"
>
<div
class=
"img"
>
<div
class=
"img"
>
<img
src=
"../../../assets/custom/test.png"
alt
/>
<img
:src=
"item.courseImageUrl"
alt
/>
<span
class=
"level"
>
{{
item
.
typeStr
}}
</span>
</div>
<div
class=
"detail"
>
<span
class=
"title"
>
{{
item
.
courseName
|
shortName
}}
</span>
<div
class=
"chapter"
>
<span>
{{
item
.
docName
|
shortName
(
5
)
}}
</span>
<span
class=
"section-num"
>
{{
item
.
chapterSum
}}
章
{{
item
.
lectureNum
}}
节
{{
item
.
totalTime
}}
分
</span><span
v-if=
"true"
class=
"exam-num"
>
{{
item
.
testCount
}}
场考试
</span>
</div>
</div>
<div
class=
"handler"
>
<img
src=
"../../../assets/custom/icon/icon-handle.png"
alt
/>
</div>
</div>
</div>
<draggable
v-if=
"isPreview != 1"
class=
"cart-list"
v-model=
"cartList"
>
<div
class=
"cart-course"
v-for=
"(item, index) in cartList"
:key=
"index"
>
<div
class=
"img"
>
<img
:src=
"item.courseImageUrl"
alt
/>
<span
class=
"level"
>
{{
item
.
typeStr
}}
</span>
<span
class=
"level"
>
{{
item
.
typeStr
}}
</span>
</div>
</div>
<div
class=
"detail"
>
<div
class=
"detail"
>
<span
class=
"title"
>
{{
item
.
courseName
|
shortName
}}
</span>
<span
class=
"title"
>
{{
item
.
courseName
|
shortName
}}
</span>
<div
class=
"chapter"
>
<div
class=
"chapter"
>
<span>
{{
item
.
docName
}}
</span>
<span>
{{
item
.
docName
}}
</span>
<span
class=
"section-num"
>
{{
item
.
chapterSum
}}
章
{{
item
.
lectureNum
}}
节
{{
item
.
totalTime
}}
分
</span>
<span
class=
"section-num"
>
{{
item
.
chapterSum
}}
章
{{
item
.
lectureNum
}}
节
{{
item
.
totalTime
}}
分
</span>
<span
v-if=
"item.testCount"
class=
"exam-num"
>
{{
item
.
testCount
}}
场考试
</span>
</div>
</div>
</div>
</div>
<div
class=
"handler"
>
<div
class=
"handler"
>
...
@@ -27,21 +45,20 @@
...
@@ -27,21 +45,20 @@
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
mapGetters
}
from
"vuex"
;
import
draggable
from
"vuedraggable"
;
import
draggable
from
"vuedraggable"
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{};
return
{};
},
},
props
:
{
isPreview
:
String
},
computed
:
{
computed
:
{
// ...mapGetters(["cartList"]),
cartList
:
{
cartList
:
{
get
()
{
get
()
{
console
.
log
(
'get()'
);
return
this
.
$store
.
state
.
customStore
.
cartList
;
return
this
.
$store
.
state
.
customStore
.
cartList
;
},
},
set
(
value
)
{
set
(
value
)
{
console
.
log
(
'set(value)'
,
value
);
this
.
$store
.
dispatch
(
"setCartList"
,
value
);
this
.
$store
.
dispatch
(
"setCartList"
,
value
);
}
}
}
}
...
@@ -55,12 +72,25 @@ export default {
...
@@ -55,12 +72,25 @@ export default {
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
.sorted-cart-wrapper {
.sorted-cart-wrapper {
position: relative;
top: 0;
left: 0;
z-index: 1;
font-family: PingFang SC !important;
font-family: PingFang SC !important;
width: 4
4
0px;
width: 4
8
0px;
height: 790px;
height: 790px;
background: #fff;
background: #fff;
box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.15);
box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.15);
border-radius: 4px;
border-radius: 4px;
.mask {
position: absolute;
top: 0;
left: 0;
z-index: 2;
width: 440px;
height: 790px;
// background: ;
}
.cart-header {
.cart-header {
display: flex;
display: flex;
flex-direction: column;
flex-direction: column;
...
@@ -95,17 +125,20 @@ export default {
...
@@ -95,17 +125,20 @@ export default {
position: relative;
position: relative;
display: flex;
display: flex;
flex-direction: row;
flex-direction: row;
width: 410px;
//
width: 410px;
margin: 15px;
margin: 15px;
align-items: center;
align-items: center;
border-radius: 4px;
border-radius: 4px;
&.is-preview {
cursor: default;
}
&::after {
&::after {
position: absolute;
position: absolute;
left: 0;
left: 0;
bottom: -15px;
bottom: -15px;
z-index: 1;
z-index: 1;
content: "";
content: "";
width:
410px
;
width:
100%
;
height: 1px;
height: 1px;
background: #e4e7ed;
background: #e4e7ed;
}
}
...
@@ -113,11 +146,11 @@ export default {
...
@@ -113,11 +146,11 @@ export default {
position: relative;
position: relative;
top: 0;
top: 0;
left: 0;
left: 0;
width: 120;
width: 120
px
;
height: 68px;
height: 68px;
margin-right: 15px;
margin-right: 15px;
img {
img {
width: 120;
width: 120
px
;
height: 68px;
height: 68px;
border-radius: 4px;
border-radius: 4px;
}
}
...
@@ -153,7 +186,7 @@ export default {
...
@@ -153,7 +186,7 @@ export default {
}
}
.chapter {
.chapter {
position: absolute;
position: absolute;
bottom: -1
6
px;
bottom: -1
5
px;
left: 0;
left: 0;
font-size: 14px;
font-size: 14px;
font-weight: 400;
font-weight: 400;
...
...
src/store/custom/customStore.js
浏览文件 @
af80fcec
...
@@ -32,7 +32,7 @@ const customStore = {
...
@@ -32,7 +32,7 @@ const customStore = {
},
},
},
},
actions
:
{
actions
:
{
setSeachParam
({
commit
},
searchParam
)
{
setSea
r
chParam
({
commit
},
searchParam
)
{
commit
(
'SET_SEARCH_PARAM'
,
searchParam
);
commit
(
'SET_SEARCH_PARAM'
,
searchParam
);
},
},
setCartList
({
commit
},
cartList
)
{
setCartList
({
commit
},
cartList
)
{
...
...
src/views/education/edit-custom.vue
浏览文件 @
af80fcec
<
template
>
<
template
>
<div
class=
"edit-custom-wrap"
>
<div
class=
"edit-custom-wrap"
>
<bread-crumb
:curmbFirst=
"curmbFirst"
:curmbSecond=
"curmbSecond"
:curmbThird=
"curmbThird"
:jumPathThird=
"jumPathThird"
></bread-crumb>
<bread-crumb
:curmbFirst=
"curmbFirst"
:curmbSecond=
"curmbSecond"
:curmbThird=
"curmbThird"
:jumPathThird=
"jumPathThird"
></bread-crumb>
<div
class=
"add-content screenSet"
id=
"screenSet"
>
<div
class=
"add-content screenSet"
id=
"screenSet"
>
<el-row
class=
"step-content"
>
<el-row
class=
"step-content"
>
...
@@ -25,7 +30,7 @@
...
@@ -25,7 +30,7 @@
<!-- 模板列表
<!-- 模板列表
<div
v-if=
"active == 0"
class=
"tpl-main"
>
<div
v-if=
"active == 0"
class=
"tpl-main"
>
<template-list
@
checkFn=
"checkFn"
></template-list>
<template-list
@
checkFn=
"checkFn"
></template-list>
</div>
-->
</div>
-->
<!-- 选择课程 -->
<!-- 选择课程 -->
<div
v-if=
"active == 0"
class=
"tpl-main"
>
<div
v-if=
"active == 0"
class=
"tpl-main"
>
...
@@ -53,7 +58,11 @@
...
@@ -53,7 +58,11 @@
<select-region
ref=
"selectRegion"
:projectId=
"projectId"
:status4Flag=
"status4Flag"
></select-region>
<select-region
ref=
"selectRegion"
:projectId=
"projectId"
:status4Flag=
"status4Flag"
></select-region>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"设定机构"
name=
"second"
>
<el-tab-pane
label=
"设定机构"
name=
"second"
>
<set-organization
ref=
"setOrganization"
:projectId=
"projectId"
:status4Flag=
"status4Flag"
></set-organization>
<set-organization
ref=
"setOrganization"
:projectId=
"projectId"
:status4Flag=
"status4Flag"
></set-organization>
</el-tab-pane>
</el-tab-pane>
</el-tabs>
</el-tabs>
</div>
</div>
...
@@ -74,25 +83,16 @@ import setOrganization from "@/components/education/template/setOrganization";
...
@@ -74,25 +83,16 @@ import setOrganization from "@/components/education/template/setOrganization";
import
SelectCourseComp
from
"@/components/education/custom/select-course-comp"
;
import
SelectCourseComp
from
"@/components/education/custom/select-course-comp"
;
import
dialog
from
"@/components/education/template/dialog"
;
import
dialog
from
"@/components/education/template/dialog"
;
import
{
openLoading
,
closeLoading
,
resizeHeight
}
from
"@/utils/utils"
;
import
{
openLoading
,
closeLoading
,
resizeHeight
}
from
"@/utils/utils"
;
import
{
mapGetters
,
mapActions
}
from
'vuex'
import
{
mapGetters
,
mapActions
}
from
"vuex"
;
let
vm
=
null
;
let
vm
=
null
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
myArray
:
[
{
id
:
1
,
name
:
'教培项目1'
},
{
id
:
1
,
name
:
'教培项目2'
},
{
id
:
1
,
name
:
'教培项目3'
},
{
id
:
1
,
name
:
'教培项目4'
},
{
id
:
1
,
name
:
'教培项目5'
},
{
id
:
1
,
name
:
'教培项目6'
},
{
id
:
1
,
name
:
'教培项目7'
},
],
curmbFirst
:
"教培项目"
,
curmbFirst
:
"教培项目"
,
curmbSecond
:
"项目管理"
,
curmbSecond
:
"项目管理"
,
jumPathThird
:
'edit-custom'
,
jumPathThird
:
"item-manager"
,
curmbThird
:
'发起项目'
,
curmbThird
:
"发起项目"
,
active
:
0
,
active
:
0
,
formTemplate
:
{
formTemplate
:
{
component
:
[],
component
:
[],
...
@@ -102,62 +102,67 @@ export default {
...
@@ -102,62 +102,67 @@ export default {
activeName
:
"first"
,
activeName
:
"first"
,
canNext
:
false
,
canNext
:
false
,
openTemplateId
:
0
,
// 开放模板ID
openTemplateId
:
0
,
// 开放模板ID
projectId
:
''
,
// 项目id
projectId
:
""
,
// 项目id
status
:
10
,
// 0正常10没有加入机构11审核中12审核失败20存在进行中项目21数量已达上限
status
:
10
,
// 0正常10没有加入机构11审核中12审核失败20存在进行中项目21数量已达上限
editor
:
false
,
// 是否为编辑状态
editor
:
false
,
// 是否为编辑状态
dialogObj
:
{
dialogObj
:
{
visible
:
false
,
visible
:
false
,
title
:
''
,
title
:
""
,
message
:
''
,
message
:
""
,
tip
:
''
,
tip
:
""
,
hideMsg
:
''
hideMsg
:
""
},
},
statusObj
:
{
statusObj
:
{
status_10
:
{
status_10
:
{
title
:
'您暂未加入机构'
,
title
:
"您暂未加入机构"
,
message
:
'请前往云鹊医APP-个人中心-我的资料-填写工作所属机构。加入机构后,可创建项目'
,
message
:
tip
:
'(如为新创建机构,请等待机构审核通过)'
,
"请前往云鹊医APP-个人中心-我的资料-填写工作所属机构。加入机构后,可创建项目"
,
hideMsg
:
'我知道了'
tip
:
"(如为新创建机构,请等待机构审核通过)"
,
hideMsg
:
"我知道了"
},
},
status_11
:
{
status_11
:
{
title
:
'您暂未加入机构'
,
title
:
"您暂未加入机构"
,
message
:
'请前往云鹊医APP-个人中心-我的资料-填写工作所属机构。加入机构后,可创建项目'
,
message
:
tip
:
'(如为新创建机构,请等待机构审核通过)'
,
"请前往云鹊医APP-个人中心-我的资料-填写工作所属机构。加入机构后,可创建项目"
,
hideMsg
:
'我知道了'
tip
:
"(如为新创建机构,请等待机构审核通过)"
,
hideMsg
:
"我知道了"
},
},
status_12
:
{
status_12
:
{
title
:
'您暂未加入机构'
,
title
:
"您暂未加入机构"
,
message
:
'请前往云鹊医APP-个人中心-我的资料-填写工作所属机构。加入机构后,可创建项目'
,
message
:
tip
:
'(如为新创建机构,请等待机构审核通过)'
,
"请前往云鹊医APP-个人中心-我的资料-填写工作所属机构。加入机构后,可创建项目"
,
hideMsg
:
'我知道了'
tip
:
"(如为新创建机构,请等待机构审核通过)"
,
hideMsg
:
"我知道了"
},
},
status_20
:
{
status_20
:
{
title
:
'该项目正在进行中'
,
title
:
"该项目正在进行中"
,
message
:
'不能重复创建,请选择其他模版或者下架正在进行中的项目'
,
message
:
"不能重复创建,请选择其他模版或者下架正在进行中的项目"
,
hideMsg
:
'确定'
hideMsg
:
"确定"
},
},
status_21
:
{
status_21
:
{
title
:
'该项目创建数量已上限'
,
title
:
"该项目创建数量已上限"
,
message
:
'本年度免费创建数已达20次,不能继续创建该项目'
,
message
:
"本年度免费创建数已达20次,不能继续创建该项目"
,
hideMsg
:
'确定'
hideMsg
:
"确定"
}
}
},
},
sendObj
:
{
// 发布
sendObj
:
{
// 发布
visible
:
false
,
visible
:
false
,
title
:
'确定发布吗?'
,
title
:
"确定发布吗?"
,
message
:
'发布后,项目将进入审核中,待审核完成后学员可在云鹊医App上参加培训学习'
,
message
:
tip
:
''
,
"发布后,项目将进入审核中,待审核完成后学员可在云鹊医App上参加培训学习"
,
confirmMsg
:
'取消'
,
tip
:
""
,
hideMsg
:
'确定发布'
confirmMsg
:
"取消"
,
hideMsg
:
"确定发布"
},
},
projectStatus
:
1
,
//1.草稿 2.未上架 3.审核中/待审核 4.已上架 5.已下架 6.已拒绝/未上架
projectStatus
:
1
,
//1.草稿 2.未上架 3.审核中/待审核 4.已上架 5.已下架 6.已拒绝/未上架
status4Flag
:
0
,
//0表示没有上过架,1表示上过架
status4Flag
:
0
,
//0表示没有上过架,1表示上过架
isPreview
:
0
,
// 1表示是查看信息
isPreview
:
0
,
// 1表示是查看信息
maxLimitCreatedCustomProjectCountInYearz
:
20
,
// 同一个用户每年能够创建的项目数
maxLimitCreatedCustomProjectCountInYearz
:
20
// 同一个用户每年能够创建的项目数
}
}
;
},
},
computed
:
{
computed
:
{
...
mapGetters
([
'searchParam'
,
'cartList'
])
...
mapGetters
([
"searchParam"
,
"cartList"
])
},
},
watch
:
{
watch
:
{
searchParam
:
{
searchParam
:
{
...
@@ -176,8 +181,8 @@ export default {
...
@@ -176,8 +181,8 @@ export default {
selectTemplate
,
selectTemplate
,
selectRegion
,
selectRegion
,
setOrganization
,
setOrganization
,
dialogComponet
:
dialog
,
dialogComponet
:
dialog
,
SelectCourseComp
,
SelectCourseComp
},
},
created
()
{
created
()
{
vm
=
this
;
vm
=
this
;
...
@@ -186,40 +191,65 @@ export default {
...
@@ -186,40 +191,65 @@ export default {
},
},
mounted
()
{
mounted
()
{
resizeHeight
();
resizeHeight
();
this
.
getLabelList
();
this
.
initPageParams
();
this
.
getCourseList
(
this
.
searchParam
);
},
},
methods
:
{
methods
:
{
...
mapActions
([
'setCourseList'
,
'setAllLabelList'
,
'setSubLabelList'
]),
...
mapActions
([
"setSearchParam"
,
"setCartList"
,
"setCourseList"
,
"setAllLabelList"
,
"setSubLabelList"
]),
initPageParams
()
{
let
searchParam
=
{
orderBy
:
2
,
dir
:
1
,
grade
:
0
,
pageNo
:
1
,
pageSize
:
10
,
labelIdList
:
[]
};
this
.
setSearchParam
(
searchParam
);
this
.
setCartList
([]);
this
.
setCourseList
([]);
this
.
setAllLabelList
([]);
this
.
setSubLabelList
([]);
this
.
getLabelList
();
this
.
getCourseList
(
searchParam
);
},
getLabelList
()
{
getLabelList
()
{
vm
.
GET
(
"contents/diseases/labelList"
,
{}).
then
(
res
=>
{
vm
.
GET
(
"contents/diseases/labelList"
,
{}).
then
(
res
=>
{
if
(
res
.
code
==
"000000"
)
{
if
(
res
.
code
==
"000000"
)
{
// 先将所有的标签添加checked字段
// 先将所有的标签添加checked字段
let
labelList
=
res
.
data
;
let
labelList
=
res
.
data
;
let
allSubList
=
[];
let
allSubList
=
[];
labelList
.
forEach
(
(
item
,
index
)
=>
{
labelList
.
forEach
((
item
,
index
)
=>
{
item
.
checked
=
false
;
item
.
checked
=
false
;
item
.
subList
.
forEach
(
(
sub
,
subIndex
)
=>
{
item
.
subList
.
forEach
((
sub
,
subIndex
)
=>
{
if
(
subIndex
==
0
)
{
if
(
subIndex
==
0
)
{
sub
.
id
=
`subid-
${
index
}
`
;
sub
.
id
=
`subid-
${
index
}
`
;
}
}
sub
.
parentIndex
=
index
;
sub
.
parentIndex
=
index
;
sub
.
checked
=
false
;
sub
.
checked
=
false
;
if
(
index
==
0
)
{
if
(
index
==
0
)
{
allSubList
.
push
(
sub
);
allSubList
.
push
(
sub
);
}
else
if
(
sub
.
id
!=
0
)
{
}
else
if
(
sub
.
id
!=
0
)
{
allSubList
.
push
(
sub
);
allSubList
.
push
(
sub
);
}
}
})
})
;
})
})
;
allSubList
[
0
].
checked
=
true
;
allSubList
[
0
].
checked
=
true
;
// allSubList[0].id = 'parentid-0'; // 一级的“全部”标签的id
// allSubList[0].id = 'parentid-0'; // 一级的“全部”标签的id
// 添加一级的“全部”标签,并构建其子标签
// 添加一级的“全部”标签,并构建其子标签
labelList
.
unshift
({
labelList
.
unshift
({
name
:
'全部'
,
name
:
"全部"
,
checked
:
true
,
checked
:
true
,
subList
:
allSubList
subList
:
allSubList
})
})
;
this
.
setAllLabelList
(
labelList
);
this
.
setAllLabelList
(
labelList
);
this
.
setSubLabelList
(
allSubList
);
this
.
setSubLabelList
(
allSubList
);
}
}
...
@@ -231,7 +261,7 @@ export default {
...
@@ -231,7 +261,7 @@ export default {
vm
.
GET
(
"contents/diseases/courseListForPortal"
,
searchParam
).
then
(
res
=>
{
vm
.
GET
(
"contents/diseases/courseListForPortal"
,
searchParam
).
then
(
res
=>
{
if
(
res
.
code
==
"000000"
)
{
if
(
res
.
code
==
"000000"
)
{
let
courseList
=
res
.
data
;
let
courseList
=
res
.
data
;
courseList
.
list
.
forEach
(
(
item
)
=>
{
courseList
.
list
.
forEach
(
item
=>
{
item
.
checked
=
false
;
item
.
checked
=
false
;
});
});
this
.
setCourseList
(
courseList
);
this
.
setCourseList
(
courseList
);
...
@@ -240,8 +270,8 @@ export default {
...
@@ -240,8 +270,8 @@ export default {
},
},
// 判断是否为编辑状态
// 判断是否为编辑状态
isEditorFn
(){
isEditorFn
()
{
if
(
vm
.
$route
.
query
.
projectId
)
{
if
(
vm
.
$route
.
query
.
projectId
)
{
vm
.
projectId
=
vm
.
$route
.
query
.
projectId
;
vm
.
projectId
=
vm
.
$route
.
query
.
projectId
;
vm
.
editor
=
true
;
vm
.
editor
=
true
;
vm
.
active
=
1
;
vm
.
active
=
1
;
...
@@ -249,7 +279,7 @@ export default {
...
@@ -249,7 +279,7 @@ export default {
}
}
},
},
isPreviewFn
()
{
isPreviewFn
()
{
if
(
vm
.
$route
.
query
.
isPreview
==
1
&&
vm
.
$route
.
query
.
projectId
)
{
if
(
vm
.
$route
.
query
.
isPreview
==
1
&&
vm
.
$route
.
query
.
projectId
)
{
vm
.
projectId
=
vm
.
$route
.
query
.
projectId
;
vm
.
projectId
=
vm
.
$route
.
query
.
projectId
;
vm
.
isPreview
=
vm
.
$route
.
query
.
isPreview
;
vm
.
isPreview
=
vm
.
$route
.
query
.
isPreview
;
vm
.
active
=
1
;
vm
.
active
=
1
;
...
@@ -259,7 +289,7 @@ export default {
...
@@ -259,7 +289,7 @@ export default {
// 按钮点击下一步
// 按钮点击下一步
nextStep
()
{
nextStep
()
{
if
(
vm
.
active
==
0
)
{
if
(
vm
.
active
==
0
)
{
vm
.
checkSelectCustomCourse
()
vm
.
checkSelectCustomCourse
()
;
// vm.checkSelectTemplate()
// vm.checkSelectTemplate()
return
;
return
;
}
}
...
@@ -293,7 +323,7 @@ export default {
...
@@ -293,7 +323,7 @@ export default {
// 完成
// 完成
complete
()
{
complete
()
{
// 4不弹框
// 4不弹框
if
(
vm
.
projectStatus
!=
4
&&
vm
.
isPreview
!=
1
)
{
if
(
vm
.
projectStatus
!=
4
&&
vm
.
isPreview
!=
1
)
{
vm
.
sendObj
.
visible
=
true
;
vm
.
sendObj
.
visible
=
true
;
}
else
{
}
else
{
// 查看时,点击完成直接跳到列表页
// 查看时,点击完成直接跳到列表页
...
@@ -302,7 +332,7 @@ export default {
...
@@ -302,7 +332,7 @@ export default {
if
(
vm
.
$route
.
query
.
pageNum
)
{
if
(
vm
.
$route
.
query
.
pageNum
)
{
query
=
{
pageNum
:
vm
.
$route
.
query
.
pageNum
};
query
=
{
pageNum
:
vm
.
$route
.
query
.
pageNum
};
}
}
vm
.
$router
.
push
({
path
:
"
edit-custom
"
,
query
:
query
});
vm
.
$router
.
push
({
path
:
"
item-manager
"
,
query
:
query
});
return
;
return
;
}
}
vm
.
hidefn
();
vm
.
hidefn
();
...
@@ -318,13 +348,13 @@ export default {
...
@@ -318,13 +348,13 @@ export default {
projectId
:
vm
.
projectId
,
projectId
:
vm
.
projectId
,
scopeOfAdministrative
:
vm
.
$refs
.
selectRegion
.
setScope
(),
scopeOfAdministrative
:
vm
.
$refs
.
selectRegion
.
setScope
(),
scopeOfDepartment
:
99999999
,
scopeOfDepartment
:
99999999
,
flag
:
fishFn
?
3
:
1
,
//0:下一步 1:暂存
flag
:
fishFn
?
3
:
1
//0:下一步 1:暂存
};
};
openLoading
(
vm
);
openLoading
(
vm
);
vm
.
POST
(
"portal/new/scope"
,
req
)
vm
.
POST
(
"portal/new/scope"
,
req
)
.
then
(
res
=>
{
.
then
(
res
=>
{
closeLoading
(
vm
);
closeLoading
(
vm
);
if
(
res
.
code
==
'000000'
&&
fishFn
)
{
if
(
res
.
code
==
"000000"
&&
fishFn
)
{
fishFn
();
fishFn
();
}
}
if
(
!
fishFn
)
{
if
(
!
fishFn
)
{
...
@@ -339,7 +369,7 @@ export default {
...
@@ -339,7 +369,7 @@ export default {
type
:
"warning"
,
type
:
"warning"
,
message
:
res
.
message
message
:
res
.
message
});
});
})
})
;
},
},
// 完成后更改状态
// 完成后更改状态
changeStatus
()
{
changeStatus
()
{
...
@@ -350,13 +380,13 @@ export default {
...
@@ -350,13 +380,13 @@ export default {
vm
.
POST
(
"portal/portalInfo/changeStatus"
,
req
)
vm
.
POST
(
"portal/portalInfo/changeStatus"
,
req
)
.
then
(
res
=>
{
.
then
(
res
=>
{
vm
.
sendObj
.
visible
=
false
;
vm
.
sendObj
.
visible
=
false
;
if
(
res
.
code
==
'000000'
)
{
if
(
res
.
code
==
"000000"
)
{
let
query
=
{};
let
query
=
{};
if
(
vm
.
$route
.
query
.
pageNum
)
{
if
(
vm
.
$route
.
query
.
pageNum
)
{
query
=
{
pageNum
:
vm
.
$route
.
query
.
pageNum
};
query
=
{
pageNum
:
vm
.
$route
.
query
.
pageNum
};
}
}
console
.
log
(
'vm.$router.push'
)
console
.
log
(
"vm.$router.push"
);
vm
.
$router
.
push
({
path
:
"
edit-custom
"
,
query
:
query
});
vm
.
$router
.
push
({
path
:
"
item-manager
"
,
query
:
query
});
}
else
{
}
else
{
vm
.
$message
({
vm
.
$message
({
type
:
"warning"
,
type
:
"warning"
,
...
@@ -369,11 +399,11 @@ export default {
...
@@ -369,11 +399,11 @@ export default {
type
:
"warning"
,
type
:
"warning"
,
message
:
res
.
message
message
:
res
.
message
});
});
})
})
;
},
},
//切换tabs
//切换tabs
handleClickTabs
(
tab
,
event
)
{
handleClickTabs
(
tab
,
event
)
{
if
(
tab
.
name
==
'second'
)
{
if
(
tab
.
name
==
"second"
)
{
vm
.
setRegion
();
vm
.
setRegion
();
}
}
},
},
...
@@ -391,11 +421,15 @@ export default {
...
@@ -391,11 +421,15 @@ export default {
closeLoading
(
vm
);
closeLoading
(
vm
);
if
(
res
.
code
==
"000000"
)
{
if
(
res
.
code
==
"000000"
)
{
if
(
res
.
data
.
status
==
0
)
{
if
(
res
.
data
.
status
==
0
)
{
vm
.
maxLimitCreatedCustomProjectCountInYear
=
res
.
data
.
maxLimitCreatedCustomProjectCountInYear
;
vm
.
maxLimitCreatedCustomProjectCountInYear
=
res
.
data
.
maxLimitCreatedCustomProjectCountInYear
;
vm
.
active
=
1
;
vm
.
active
=
1
;
return
;
return
;
}
else
{
}
else
{
vm
.
dialogObj
=
Object
.
assign
(
vm
.
dialogObj
,
vm
.
statusObj
[
`status_
${
res
.
data
.
status
}
`
]);
vm
.
dialogObj
=
Object
.
assign
(
vm
.
dialogObj
,
vm
.
statusObj
[
`status_
${
res
.
data
.
status
}
`
]
);
vm
.
dialogObj
.
visible
=
true
;
vm
.
dialogObj
.
visible
=
true
;
return
;
return
;
}
}
...
@@ -403,16 +437,18 @@ export default {
...
@@ -403,16 +437,18 @@ export default {
vm
.
$message
.
info
(
res
.
message
);
vm
.
$message
.
info
(
res
.
message
);
}
}
})
})
.
catch
(
(
err
)
=>
{
.
catch
(
err
=>
{
closeLoading
(
vm
);
closeLoading
(
vm
);
vm
.
$message
.
warning
(
'请稍后重试'
);
vm
.
$message
.
warning
(
"请稍后重试"
);
});
});
},
},
//选中模板后点击下一步时检测(机构和进行中的项目)
//选中模板后点击下一步时检测(机构和进行中的项目)
checkSelectTemplate
()
{
checkSelectTemplate
()
{
openLoading
(
vm
);
openLoading
(
vm
);
vm
.
GET
(
`portal/openTemplateProject/checkAfterSelectOneOpenTemplate/
${
vm
.
openTemplateId
}
`
)
vm
.
GET
(
`portal/openTemplateProject/checkAfterSelectOneOpenTemplate/
${
vm
.
openTemplateId
}
`
)
.
then
(
res
=>
{
.
then
(
res
=>
{
closeLoading
(
vm
);
closeLoading
(
vm
);
if
(
res
.
code
==
"000000"
)
{
if
(
res
.
code
==
"000000"
)
{
...
@@ -420,7 +456,10 @@ export default {
...
@@ -420,7 +456,10 @@ export default {
vm
.
active
=
1
;
vm
.
active
=
1
;
return
;
return
;
}
else
{
}
else
{
vm
.
dialogObj
=
Object
.
assign
(
vm
.
dialogObj
,
vm
.
statusObj
[
`status_
${
res
.
data
.
status
}
`
]);
vm
.
dialogObj
=
Object
.
assign
(
vm
.
dialogObj
,
vm
.
statusObj
[
`status_
${
res
.
data
.
status
}
`
]
);
vm
.
dialogObj
.
visible
=
true
;
vm
.
dialogObj
.
visible
=
true
;
return
;
return
;
}
}
...
@@ -428,9 +467,9 @@ export default {
...
@@ -428,9 +467,9 @@ export default {
vm
.
$message
.
info
(
res
.
message
);
vm
.
$message
.
info
(
res
.
message
);
}
}
})
})
.
catch
(
(
err
)
=>
{
.
catch
(
err
=>
{
closeLoading
(
vm
);
closeLoading
(
vm
);
vm
.
$message
.
warning
(
'请稍后重试'
);
vm
.
$message
.
warning
(
"请稍后重试"
);
});
});
},
},
// 隐藏弹框
// 隐藏弹框
...
@@ -459,7 +498,7 @@ export default {
...
@@ -459,7 +498,7 @@ export default {
vm
.
status4Flag
=
s
;
vm
.
status4Flag
=
s
;
}
}
}
}
}
}
;
</
script
>
</
script
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
...
@@ -470,7 +509,7 @@ export default {
...
@@ -470,7 +509,7 @@ export default {
.top-lin
{
.top-lin
{
position
:
fixed
;
position
:
fixed
;
height
:
30px
;
height
:
30px
;
background
:
#
F0F2F
5
;
background
:
#
f0f2f
5
;
right
:
30px
;
right
:
30px
;
left
:
285px
;
left
:
285px
;
z-index
:
1001
;
z-index
:
1001
;
...
@@ -536,15 +575,15 @@ export default {
...
@@ -536,15 +575,15 @@ export default {
border
:
1px
solid
#449284
!
important
;
border
:
1px
solid
#449284
!
important
;
}
}
.dis-btn
{
.dis-btn
{
width
:
78px
;
width
:
78px
;
height
:
34px
;
height
:
34px
;
background
:
rgba
(
240
,
242
,
245
,
1
)
;
background
:
rgba
(
240
,
242
,
245
,
1
);
border-radius
:
3px
;
border-radius
:
3px
;
font-size
:
14px
;
font-size
:
14px
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-weight
:
400
;
font-weight
:
400
;
color
:
rgba
(
144
,
147
,
153
,
1
)
;
color
:
rgba
(
144
,
147
,
153
,
1
);
line-height
:
34px
;
line-height
:
34px
;
text-align
:
center
;
text-align
:
center
;
cursor
:
pointer
;
cursor
:
pointer
;
}
}
...
@@ -629,7 +668,7 @@ export default {
...
@@ -629,7 +668,7 @@ export default {
.dialog-success
{
.dialog-success
{
p
{
p
{
text-align
:
center
;
text-align
:
center
;
.upload-text
{
.upload-text
{
color
:
#449284
;
color
:
#449284
;
}
}
}
}
...
@@ -653,7 +692,6 @@ export default {
...
@@ -653,7 +692,6 @@ export default {
}
}
}
}
}
}
}
}
.tpl-main
{
.tpl-main
{
padding-top
:
64px
;
padding-top
:
64px
;
...
...
src/views/education/item-manager.vue
浏览文件 @
af80fcec
...
@@ -10,18 +10,6 @@
...
@@ -10,18 +10,6 @@
<el-input
v-model=
"formInline.projectName"
size=
"small"
placeholder=
"请输入项目名称"
></el-input>
<el-input
v-model=
"formInline.projectName"
size=
"small"
placeholder=
"请输入项目名称"
></el-input>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<!--
<el-col
:span=
"8"
>
<el-form-item
label=
"项目时间:"
>
<el-date-picker
v-model=
"formInline.duringTime"
size=
"small"
type=
"daterange"
start-placeholder=
"请选择开始时间"
end-placeholder=
"请选择结束时间"
value-format=
"yyyy-MM-dd HH:mm:ss"
></el-date-picker>
</el-form-item>
</el-col>
-->
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"项目时间:"
>
<el-form-item
label=
"项目时间:"
>
<el-date-picker
<el-date-picker
...
@@ -43,19 +31,6 @@
...
@@ -43,19 +31,6 @@
></el-date-picker>
></el-date-picker>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<!--
<el-col
:span=
"4"
>
<el-form-item
label=
"~"
>
<el-date-picker
v-model=
"formInline.projectEndtime"
size=
"small"
type=
"datetime"
placeholder=
"请选择结束时间"
value-format=
"yyyy-MM-dd HH:mm:ss"
:picker-options=
"pickerOptions1"
default-time=
"23:59:59"
></el-date-picker>
</el-form-item>
</el-col>
-->
<el-col
:span=
"4"
style=
"padding:0;text-align:right;padding-right:15px;"
>
<el-col
:span=
"4"
style=
"padding:0;text-align:right;padding-right:15px;"
>
<el-button
type=
"primary"
size=
"small"
@
click=
"searchList"
>
查询
</el-button>
<el-button
type=
"primary"
size=
"small"
@
click=
"searchList"
>
查询
</el-button>
<el-button
type=
"default"
size=
"small"
@
click=
"resetForm"
style=
"margin-left:0;"
>
重置
</el-button>
<el-button
type=
"default"
size=
"small"
@
click=
"resetForm"
style=
"margin-left:0;"
>
重置
</el-button>
...
@@ -96,7 +71,7 @@
...
@@ -96,7 +71,7 @@
<span
<span
@
click=
"previewTemplate(scope.row, 1)"
@
click=
"previewTemplate(scope.row, 1)"
style=
"color:rgb(2, 130, 132);cursor:pointer;"
style=
"color:rgb(2, 130, 132);cursor:pointer;"
v-if=
"
scope.row.projectType == 3
v-if=
"
(scope.row.projectType == 3 || scope.row.projectType == 4)
&& (scope.row.level == 'L1' || scope.row.level == 'L2') "
&& (scope.row.level == 'L1' || scope.row.level == 'L2') "
>
{{
scope
.
row
.
projectName
}}
</span>
>
{{
scope
.
row
.
projectName
}}
</span>
<span
v-else
>
{{
scope
.
row
.
projectName
}}
</span>
<span
v-else
>
{{
scope
.
row
.
projectName
}}
</span>
...
@@ -106,13 +81,6 @@
...
@@ -106,13 +81,6 @@
<el-table-column
prop=
"projectLeader"
label=
"项目负责人"
align=
"center"
></el-table-column>
<el-table-column
prop=
"projectLeader"
label=
"项目负责人"
align=
"center"
></el-table-column>
<el-table-column
prop=
"projectTypeValue"
label=
"项目类型"
align=
"center"
></el-table-column>
<el-table-column
prop=
"projectTypeValue"
label=
"项目类型"
align=
"center"
></el-table-column>
<el-table-column
prop=
"createdTime"
label=
"创建时间"
width=
"100"
align=
"center"
></el-table-column>
<el-table-column
prop=
"createdTime"
label=
"创建时间"
width=
"100"
align=
"center"
></el-table-column>
<!-- <el-table-column
prop="projectIntro"
label="项目简介"
align="center"
min-width="100"
show-overflow-tooltip
></el-table-column>-->
<el-table-column
prop=
"projectBegintime"
label=
"项目开始时间"
min-width=
"90"
align=
"center"
></el-table-column>
<el-table-column
prop=
"projectBegintime"
label=
"项目开始时间"
min-width=
"90"
align=
"center"
></el-table-column>
<el-table-column
prop=
"projectEndtime"
label=
"项目结束时间"
min-width=
"90"
align=
"center"
></el-table-column>
<el-table-column
prop=
"projectEndtime"
label=
"项目结束时间"
min-width=
"90"
align=
"center"
></el-table-column>
<el-table-column
prop=
"projectStatus"
label=
"状态"
align=
"center"
>
<el-table-column
prop=
"projectStatus"
label=
"状态"
align=
"center"
>
...
@@ -518,9 +486,15 @@ export default {
...
@@ -518,9 +486,15 @@ export default {
},
},
previewTemplate
(
row
,
isPreview
)
{
previewTemplate
(
row
,
isPreview
)
{
if
(
row
.
projectType
==
3
)
{
this
.
$router
.
push
(
this
.
$router
.
push
(
`template-open?projectId=
${
row
.
id
}
&projectType=3&isPreview=
${
isPreview
}
`
`template-open?projectId=
${
row
.
id
}
&projectType=3&isPreview=
${
isPreview
}
`
);
);
}
else
if
(
row
.
projectType
==
4
)
{
this
.
$router
.
push
(
`edit-custom?projectId=
${
row
.
id
}
&projectType=3&isPreview=
${
isPreview
}
`
);
}
},
},
// handleCreateProject(isPreview) {
// handleCreateProject(isPreview) {
...
@@ -735,7 +709,6 @@ export default {
...
@@ -735,7 +709,6 @@ export default {
this
.
formInline
.
pageNo
this
.
formInline
.
pageNo
);
);
}
else
if
(
row
.
projectType
===
4
)
{
}
else
if
(
row
.
projectType
===
4
)
{
debugger
this
.
$router
.
push
(
this
.
$router
.
push
(
"edit-custom?projectType=4&projectId="
+
"edit-custom?projectType=4&projectId="
+
projectId
+
projectId
+
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录