Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
提交
打开侧边栏
com.pica.cloud.education.frontend
pica.cloud.web-education-admin
提交
84a15cb6
提交
84a15cb6
编写于
4月 13, 2020
作者:
haochangdi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成基本的联调
上级
146f4f10
变更
9
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
1275 行增加
和
342 行删除
+1275
-342
baseMessage.vue
src/components/education/template/baseMessage.vue
+103
-166
dialog.vue
src/components/education/template/dialog.vue
+2
-2
selectRegion.vue
src/components/education/template/selectRegion.vue
+55
-26
selectTemplate.vue
src/components/education/template/selectTemplate.vue
+98
-16
setOrganization.vue
src/components/education/template/setOrganization.vue
+5
-7
templateList.vue
src/components/education/template/templateList.vue
+4
-3
templateMessage.vue
src/components/education/template/templateMessage.vue
+792
-0
template-editor.vue
src/views/education/template-editor.vue
+53
-65
template-open.vue
src/views/education/template-open.vue
+163
-57
未找到文件。
src/components/education/template/baseMessage.vue
浏览文件 @
84a15cb6
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
v-model=
"formData.openTemplateName"
v-model=
"formData.openTemplateName"
placeholder=
"请输入模板名称"
placeholder=
"请输入模板名称"
style=
"width:70%;"
style=
"width:70%;"
maxlength=
"24"
:disabled=
"disabled"
:disabled=
"disabled"
></el-input>
></el-input>
<span
class=
"word-num"
>
{{
(
formData
.
openTemplateName
).
replace
(
/
\s
+/g
,
""
).
length
}}
/24
</span>
<span
class=
"word-num"
>
{{
(
formData
.
openTemplateName
).
replace
(
/
\s
+/g
,
""
).
length
}}
/24
</span>
...
@@ -38,17 +39,17 @@
...
@@ -38,17 +39,17 @@
<img
@
click=
"plusOrg(index)"
class=
"edit-img"
src=
"../../../assets/image/plus.png"
/>
<img
@
click=
"plusOrg(index)"
class=
"edit-img"
src=
"../../../assets/image/plus.png"
/>
<img
@
click=
"deleteOrg(index)"
v-if=
"index >= 1"
class=
"edit-img"
src=
"../../../assets/image/trash.png"
/>
<img
@
click=
"deleteOrg(index)"
v-if=
"index >= 1"
class=
"edit-img"
src=
"../../../assets/image/trash.png"
/>
</el-col>
</el-col>
<el-popover
<
!--
<
el-popover
class=
"popover-content"
:style=
"
{'top': orgListIndex * 41 + 'px'}"
class=
"popover-content"
:style=
"
{'top': orgListIndex * 41 + 'px'}"
placement="bottom"
placement="bottom"
:content="organizationContent"
:content="organizationContent"
v-model="visibleName"
v-model="visibleName"
@click="checkDefault">
@click="checkDefault">
<p
@
click=
"checkDefault"
>
我的机构:
{{
organizationContent
}}
</p>
<p
@
click=
"checkDefault"
>
我的机构:
{{
organizationContent
}}
</p>
</el-popover>
</el-popover>
-->
</el-form-item>
</el-form-item>
<el-form-item
label=
"有效期:"
prop=
"expireDay"
v-if=
"!projectManger"
>
<el-form-item
label=
"有效期:"
prop=
"expireDay"
>
<el-col
:span=
"13"
>
<el-col
:span=
"13"
>
<el-input
<el-input
size=
"small"
size=
"small"
...
@@ -62,49 +63,25 @@
...
@@ -62,49 +63,25 @@
</el-col>
</el-col>
</el-form-item>
</el-form-item>
<el-form-item
label=
"项目时间:"
required
v-if=
"projectManger"
>
<el-form-item
label=
"所属学科"
prop=
"subjectId"
>
<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"
:picker-options=
"pickerOptions0"
style=
"width: 100%;"
:disabled=
"disabled"
></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"
:picker-options=
"pickerOptions1"
default-time=
"23:59:59"
style=
"width: 100%;"
:disabled=
"disabled"
></el-date-picker>
</el-form-item>
</el-col>
</el-form-item>
<el-form-item
label=
"所属学科"
prop=
"subjectLevelList"
>
<el-col
:span=
"13"
>
<el-col
:span=
"13"
>
<el-cascader
<
!--
<
el-cascader
class=
"subject-slelct"
class=
"subject-slelct"
v-model=
"formData.subjectLevelList"
v-model=
"formData.subjectLevelList"
:options=
"options"
:options=
"options"
:props=
"
{ checkStrictly: true }"
:props=
"
{ checkStrictly: true }"
@change="handleChange"
@change="handleChange"
:disabled="disabled"
:disabled="disabled"
>
</el-cascader>
>
</el-cascader>
-->
<el-select
v-model=
"formData.subjectId"
placeholder=
"请选择"
:disabled=
"disabled"
>
<el-option
v-for=
"item in options"
:key=
"item.key"
:label=
"item.value"
:value=
"item.id"
>
</el-option>
</el-select>
</el-col>
</el-col>
</el-form-item>
</el-form-item>
...
@@ -210,7 +187,7 @@
...
@@ -210,7 +187,7 @@
</el-col>
</el-col>
</el-form-item>
</el-form-item>
<el-form-item
label=
"项目详情"
required
prop=
"openTemplateDetail"
v-if=
"!projectManger"
:class=
"
{ueitem: disabled}">
<el-form-item
label=
"项目详情"
required
prop=
"openTemplateDetail"
:class=
"
{ueitem: disabled}">
<vue-ueditor-wrap
<vue-ueditor-wrap
ref=
"ueditor"
ref=
"ueditor"
v-model=
"formData.openTemplateDetail"
v-model=
"formData.openTemplateDetail"
...
@@ -232,15 +209,19 @@ import VueUeditorWrap from 'vue-ueditor-wrap'
...
@@ -232,15 +209,19 @@ import VueUeditorWrap from 'vue-ueditor-wrap'
let
vm
=
null
;
let
vm
=
null
;
export
default
{
export
default
{
props
:
{
props
:
{
// formData
: {
messageObj
:
{
//
type: Object,
type
:
Object
,
//
default:() => {
default
:()
=>
{
//
return null
return
null
//
}
}
//
},
},
projectMange
r
:
{
isEdito
r
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
true
},
newBuild
:
{
type
:
Boolean
,
default
:
true
}
}
},
},
data
()
{
data
()
{
...
@@ -269,8 +250,6 @@ export default {
...
@@ -269,8 +250,6 @@ export default {
formData: {
formData: {
id: "", //开放模板id 26
id: "", //开放模板id 26
openTemplateName: "", //开放模板名称
openTemplateName: "", //开放模板名称
projectBegintime: "", //模板开始时间
projectEndtime: "", //模板结束时间
openTemplateIntro: "", //开放模板简介
openTemplateIntro: "", //开放模板简介
type: 1, //封面类型 1图片2视频
type: 1, //封面类型 1图片2视频
expireDay: "", // 开放有效期
expireDay: "", // 开放有效期
...
@@ -317,25 +296,6 @@ export default {
...
@@ -317,25 +296,6 @@ export default {
}
}
],
],
baseobj: {},
baseobj: {},
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).getTime()
); //减去一天的时间代表可以选择同一天;
}
},
imgMouseOver: false,
imgMouseOver: false,
imgMouseOver2: false,
imgMouseOver2: false,
uploadImgMessage: false,
uploadImgMessage: false,
...
@@ -390,21 +350,7 @@ export default {
...
@@ -390,21 +350,7 @@ export default {
{ required: true, message: "
请输入有效期
", trigger: "
blur
" },
{ required: true, message: "
请输入有效期
", trigger: "
blur
" },
{ validator: checkUserTime, trigger: "
blur
" }
{ validator: checkUserTime, trigger: "
blur
" }
],
],
projectBegintime: [
subjectId: { required: true, message: "
请选择学科
", trigger: "
change
" },
{
required: true,
message: "
请选择时间
",
trigger: "
change
"
}
],
projectEndtime: [
{
required: true,
message: "
请选择时间
",
trigger: "
change
"
}
],
subjectLevelList: { required: true, message: "
请选择学科
", trigger: "
change
" },
openTemplateIntro: [
openTemplateIntro: [
{ required: true, message: "
请填写项目简介
", trigger: "
blur
" },
{ required: true, message: "
请填写项目简介
", trigger: "
blur
" },
{ min: 1, max: 200, message: "
超出可输入的最大长度
", trigger: "
blur
" }
{ min: 1, max: 200, message: "
超出可输入的最大长度
", trigger: "
blur
" }
...
@@ -421,28 +367,33 @@ export default {
...
@@ -421,28 +367,33 @@ export default {
},
},
created() {
created() {
vm = this;
vm = this;
// 新建
if (vm.newBuild) {
vm.getSubjectList();
vm.getSubjectList();
vm.getBaseMessage();
},
methods: {
// 获取已有的基本信息
getBaseMessage() {
let id = 26; // 开放模板id
// openLoading(vm);
vm.GET(`portal/openTemplate/getOpenTemplateInfo/${id}`).then(res => {
// closeLoading(vm);
if (res.code == "
000000
") {
this.formData = Object.assign(this.formData, res.data.portalOpenTemplateModel);
this.formData.attachmentUrl1 = res.data.attachmentData[0].attachmentUrl;
this.formData.attachmentMore1 = Object.assign(this.formData.attachmentMore1, res.data.attachmentData[0]);
this.formData.attachmentUrl2 = res.data.attachmentData[1].attachmentType == 1 ? res.data.attachmentData[1].attachmentUrl : '';
this.formData.attachmentUrl3 = res.data.attachmentData[1].attachmentType == 2 ? res.data.attachmentData[1].attachmentUrl : '';
this.formData.attachmentMore2 = Object.assign(this.formData.attachmentMore2, res.data.attachmentData[1]);
this.disabled = true;
} else {
} else {
vm.$message.info(res.message);
// 非新建但可编辑
if (vm.isEditor) {
vm.getSubjectList();
vm.setBaseMessage();
} else {
// 非新建不可编辑
vm.disabled = true;
vm.getSubjectList();
vm.setBaseMessage();
}
}
});
}
},
methods: {
// 设置已有的基本信息
setBaseMessage() {
vm.formData = Object.assign(vm.formData, vm.messageObj.portalOpenTemplateModel);
vm.formData.attachmentUrl1 = vm.messageObj.attachmentData[0].attachmentUrl;
vm.formData.attachmentMore1 = Object.assign(vm.formData.attachmentMore1, vm.messageObj.attachmentData[0]);
// vm.formData.attachmentUrl2 = vm.messageObj.attachmentData[1].attachmentType == 1 ? vm.messageObj.attachmentData[1].attachmentUrl : '';
// vm.formData.attachmentUrl3 = vm.messageObj.attachmentData[1].attachmentType == 2 ? vm.messageObj.attachmentData[1].attachmentUrl : '';
vm.formData.attachmentUrl2 = vm.messageObj.attachmentData[1].attachmentUrl;
vm.formData.attachmentMore2 = Object.assign(vm.formData.attachmentMore2, vm.messageObj.attachmentData[1]);
vm.formData.type = vm.messageObj.attachmentData[1].attachmentType;
},
},
// 增加发起机构
// 增加发起机构
plusOrg(index) {
plusOrg(index) {
...
@@ -479,18 +430,19 @@ export default {
...
@@ -479,18 +430,19 @@ export default {
checkDefault() {
checkDefault() {
vm.formData.organizationNameList.splice(vm.orgListIndex-1, 1, vm.organizationContent);
vm.formData.organizationNameList.splice(vm.orgListIndex-1, 1, vm.organizationContent);
vm.visibleName = false;
vm.visibleName = false;
},
handleChange(value) {
},
},
//上传列表图片
//上传列表图片
beforeUploadListPic(file) {
beforeUploadListPic(file) {
let fileLimit = {
let fileLimit = {
width: 48,
height: 48,
size: 0.5,
size: 0.5,
sizeText: "
500
K
",
sizeText: "
500
K
",
key: "
attachmentUrl1
",
key: "
attachmentUrl1
",
more: "
attachmentMore1
",
more: "
attachmentMore1
",
show: "
uploadImgMessage
"
show: "
uploadImgMessage
"
};
};
vm.beforeAvatarUpload(file, fileLimit);
vm.beforeAvatarUpload(file, fileLimit);
},
},
//上传图片校验
//上传图片校验
...
@@ -498,13 +450,17 @@ export default {
...
@@ -498,13 +450,17 @@ export default {
const isJPG = file.type === "
image
/
jpeg
";
const isJPG = file.type === "
image
/
jpeg
";
const isPNG = file.type === "
image
/
png
";
const isPNG = file.type === "
image
/
png
";
const isLt2M = file.size / 1024 / 1024 < fileLimit.size;
const isLt2M = file.size / 1024 / 1024 < fileLimit.size;
// if (file.width != fileLimit.width || file.height != fileLimit.height) {
// vm.$message.error("
图片不符合规范,请根据规范上传图片
");
// return;
// }
if (!isJPG && !isPNG) {
if (!isJPG && !isPNG) {
vm.$message.error("
图片不符合规范,请根据规范上传图片
");
vm.$message.error("
图片不符合规范,请根据规范上传图片
");
//
return;
return;
}
}
if (!isLt2M) {
if (!isLt2M) {
vm.$message.error("
图片不符合规范,请根据规范上传图片
");
vm.$message.error("
图片不符合规范,请根据规范上传图片
");
//
return;
return;
}
}
let _img = new FileReader();
let _img = new FileReader();
_img.readAsDataURL(file);
_img.readAsDataURL(file);
...
@@ -565,8 +521,8 @@ export default {
...
@@ -565,8 +521,8 @@ export default {
//上传封面图片
//上传封面图片
beforeUploadCoverPic(file) {
beforeUploadCoverPic(file) {
let fileLimit = {
let fileLimit = {
//
width: 750,
width: 750,
//
height: 420,
height: 420,
size: 2,
size: 2,
sizeText: "
2.0
M
",
sizeText: "
2.0
M
",
key: "
attachmentUrl2
",
key: "
attachmentUrl2
",
...
@@ -623,18 +579,19 @@ export default {
...
@@ -623,18 +579,19 @@ export default {
} else {
} else {
vm.uploadImgMessage2 = false;
vm.uploadImgMessage2 = false;
}
}
// if (vm.submitForm('formData') && flag) {
if (vm.submitForm('formData') && flag) {
// vm.insertOrupdate();
// }
vm.insertOrupdate();
vm.insertOrupdate();
}
// vm.insertOrupdate();
},
},
// 新增或者更新基本信息
// 新增或者更新基本信息
insertOrupdate() {
insertOrupdate() {
vm.setSubject
Id
();
vm.setSubject
LevelList
();
vm.
formData.subjectName = vm.
setSubjectName();
vm.setSubjectName();
// 图片或者视频地址
// 图片或者视频地址
vm.formData.attachmentMore1.attachmentUrl = vm.formData.attachmentUrl1;
vm.formData.attachmentMore1.attachmentUrl = vm.formData.attachmentUrl1;
vm.formData.attachmentMore2.attachmentUrl = vm.formData.type == 1 ? vm.formData.attachmentUrl2 : vm.formData.attachmentUrl3;
// vm.formData.attachmentMore2.attachmentUrl = vm.formData.type == 1 ? vm.formData.attachmentUrl2 : vm.formData.attachmentUrl3;
vm.formData.attachmentMore2.attachmentUrl = vm.formData.attachmentUrl2;
// 封面类型
// 封面类型
vm.formData.attachmentMore2.attachmentType = vm.formData.type;
vm.formData.attachmentMore2.attachmentType = vm.formData.type;
vm.formData.attachmentMore2.kind = 2;
vm.formData.attachmentMore2.kind = 2;
...
@@ -648,7 +605,7 @@ export default {
...
@@ -648,7 +605,7 @@ export default {
closeLoading(vm);
closeLoading(vm);
if (res.code == "
000000
") {
if (res.code == "
000000
") {
// 将产生的模板id:openTemplateId传给下一步
// 将产生的模板id:openTemplateId传给下一步
this
.$emit('next',res.data.openTemplateModel.id);
vm
.$emit('next',res.data.openTemplateModel.id);
} else {
} else {
vm.$message.info(res.message);
vm.$message.info(res.message);
}
}
...
@@ -666,43 +623,15 @@ export default {
...
@@ -666,43 +623,15 @@ export default {
});
});
return flag;
return flag;
},
},
// 保存富文本数据
setEditorMsge(msg) {
if (!msg) {
vm.$message.error('请将富文本填写完整!');
return;
}
vm.editData.openTemplateDetail = msg;
openLoading(vm);
let req = {
openTemplateDetail: vm.editData.openTemplateDetail,
id: vm.id
};
vm.$axios
.post(
localStorage.getItem("
msUrl
") + "
v2
/
qualityContent
/
updateRichContent
",
req
)
.then(function(res) {
closeLoading(vm);
if (res.data.code == '000000') {
vm.$message.success('保存富文本成功');
} else {
vm.$message.error(res.data.message);
}
})
.catch(function(error) {
closeLoading(vm);
vm.$message.error(error);
});
},
// 获取学科列表
// 获取学科列表
getSubjectList() {
getSubjectList() {
let req = {};
let req = {};
vm.GET("
/
portal
/
openTemplat
e
/
labelList
", req).then(res => {
vm.GET("
aggregate
/
cm
e
/
labelList
", req).then(res => {
if (res.code == '000000') {
if (res.code == '000000') {
vm.changeName(res.data);
vm.options = res.data;
vm.options = res.data;
console.log('====================================');
console.log(vm.options);
console.log('====================================');
}
}
});
});
},
},
...
@@ -720,29 +649,30 @@ export default {
...
@@ -720,29 +649,30 @@ export default {
// 获取学科对应的label
// 获取学科对应的label
setSubjectName() {
setSubjectName() {
for (const item of vm.options) {
for (const item of vm.options) {
if (item.value == vm.formData.subjectLevelList[0]) {
if (item.id == vm.formData.subjectId) {
if (!vm.formData.subjectLevelList[1] || vm.formData.subjectLevelList[1] == 0) {
// if (!vm.formData.subjectLevelList[1] || vm.formData.subjectLevelList[1] == 0) {
return item.label;
// return item.label;
} else {
// } else {
for (const j of item.children){
// for (const j of item.children){
if (j.value == vm.formData.subjectLevelList[1]) {
// if (j.value == vm.formData.subjectLevelList[1]) {
return j.label;
// return j.label;
}
// }
}
// }
}
// }
vm.formData.subjectName = item.value;
}
}
}
}
},
},
// 设置学科id
// 设置学科id
setSubjectId() {
setSubjectLevelList() {
vm.formData.subjectId = (vm.formData.subjectLevelList.length > 1)&& vm.formData.subjectLevelList[1] != 0 ? vm.formData.subjectLevelList[1] : vm.formData.subjectLevelList[0]
// vm.formData.subjectId = (vm.formData.subjectLevelList.length > 1)&& vm.formData.subjectLevelList[1] != 0 ? vm.formData.subjectLevelList[1] : vm.formData.subjectLevelList[0]
vm.formData.subjectLevelList = [vm.formData.subjectId];
}
}
}
}
}
}
</
script
>
</
script
>
<
style
>
<
style
>
.
subject-slelct
.el-input__inner
{
.
base-message-wrap
.el-input__inner
{
height
:
32px
;
height
:
32px
;
line-height
:
32px
;
line-height
:
32px
;
}
}
...
@@ -764,14 +694,17 @@ export default {
...
@@ -764,14 +694,17 @@ export default {
}
}
.day-btn
{
.day-btn
{
display
:
inline-block
;
display
:
inline-block
;
width
:
50
px
;
width
:
68
px
;
height
:
32px
;
height
:
32px
;
line-height
:
32px
;
line-height
:
32px
;
background
:
#
83868
3
;
background
:
#
D5D3D
3
;
text-align
:
center
;
text-align
:
center
;
margin-left
:
-3px
;
margin-left
:
-3px
;
border-radius
:
0
4px
4px
0
;
border-radius
:
0
4px
4px
0
;
z-index
:
100
;
z-index
:
100
;
font-size
:
14px
;
color
:
#909399
;
vertical-align
:
middle
;
}
}
.basic-item-icon
{
.basic-item-icon
{
position
:
relative
;
position
:
relative
;
...
@@ -873,4 +806,8 @@ export default {
...
@@ -873,4 +806,8 @@ export default {
top
:
0
;
top
:
0
;
left
:
0
;
left
:
0
;
}
}
.time-message
{
margin
:
-19px
0
20px
150px
;
font-size
:
14px
;
}
</
style
>
</
style
>
src/components/education/template/dialog.vue
浏览文件 @
84a15cb6
...
@@ -9,8 +9,8 @@
...
@@ -9,8 +9,8 @@
center
>
center
>
<p
style=
"text-align: center;"
>
{{
dialogObj
.
message
}}
</p>
<p
style=
"text-align: center;"
>
{{
dialogObj
.
message
}}
</p>
<span
slot=
"footer"
class=
"dialog-footer"
>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"confirm"
>
确 定
</el-button>
<el-button
@
click=
"confirm"
v-if=
"dialogObj.confirmMsg"
>
{{
dialogObj
.
confirmMsg
}}
</el-button>
<el-button
type=
"primary"
@
click=
"hide"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"hide"
v-if=
"dialogObj.hideMsg"
>
{{
dialogObj
.
hideMsg
}}
</el-button>
</span>
</span>
</el-dialog>
</el-dialog>
</div>
</div>
...
...
src/components/education/template/selectRegion.vue
浏览文件 @
84a15cb6
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
</el-tree>
</el-tree>
</el-col>
</el-col>
<el-col
:span=
"11"
>
<el-col
:span=
"11"
>
<p
class=
"area-p"
@
click=
"getScope('administrative')"
>
<p
class=
"area-p"
>
项目范围包含下列区域所有机构和人员(
{{
tagsRegion
.
length
}}
)
项目范围包含下列区域所有机构和人员(
{{
tagsRegion
.
length
}}
)
</p>
</p>
<el-tag
<el-tag
...
@@ -58,6 +58,12 @@ import {
...
@@ -58,6 +58,12 @@ import {
}
from
"@/utils/education/educationApi"
;
}
from
"@/utils/education/educationApi"
;
import
Sortable
from
"sortablejs"
;
import
Sortable
from
"sortablejs"
;
export
default
{
export
default
{
props
:
{
projectId
:
{
type
:
String
|
Number
,
default
:
''
}
},
data
()
{
data
()
{
return
{
return
{
scopeReq
:
{},
// 区域范围
scopeReq
:
{},
// 区域范围
...
@@ -69,8 +75,7 @@ export default {
...
@@ -69,8 +75,7 @@ export default {
isLeaf
:
"isLeaf"
isLeaf
:
"isLeaf"
},
},
treeData
:
[],
treeData
:
[],
tagsRegion
:
[],
tagsRegion
:
[]
projectId
:
173
}
}
},
},
created
()
{
created
()
{
...
@@ -190,22 +195,6 @@ export default {
...
@@ -190,22 +195,6 @@ export default {
}
}
}
}
},
},
//行政范围改变更新设定机构
// updateOrganizationAndPerson(allSelectedKeys) {
// console.log('====================================');
// console.log(allSelectedKeys);
// console.log('====================================');
// console.log('=========================updateOrganizationAndPerson')
// this.tableOrganization = [];
// this.tablePerson = [];
// this.lookedOrganization = [];
// this.changedOrganization = [];
// this.changedOrganization2 = [];
// },
// getCheckedKeys() {
// console.log('=========================getCheckedKeys')
// console.log(this.$refs.tree.getCheckedKeys());
// },
//添加子节点
//添加子节点
append
(
data
,
node
)
{
append
(
data
,
node
)
{
console
.
log
(
'=========================append'
)
console
.
log
(
'=========================append'
)
...
@@ -267,15 +256,11 @@ export default {
...
@@ -267,15 +256,11 @@ export default {
console
.
log
(
treeKeyList
);
console
.
log
(
treeKeyList
);
this
.
$refs
.
tree
.
setCheckedKeys
(
treeKeyList
);
this
.
$refs
.
tree
.
setCheckedKeys
(
treeKeyList
);
},
},
//设定的行政范围内容
//设定的行政范围内容(传给设定机构的范围)
getScope
(
type
)
{
getScope
(
type
)
{
console
.
log
(
'========================getScope'
);
let
scope
=
""
;
let
scope
=
""
;
let
arr
=
[];
for
(
let
i
=
0
;
i
<
this
.
tagsRegion
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
tagsRegion
.
length
;
i
++
)
{
scope
+=
this
.
tagsRegion
[
i
].
key
;
scope
+=
this
.
tagsRegion
[
i
].
key
;
arr
.
push
(
this
.
tagsRegion
[
i
].
key
)
if
(
i
<
this
.
tagsRegion
.
length
-
1
)
{
if
(
i
<
this
.
tagsRegion
.
length
-
1
)
{
scope
+=
"|"
;
scope
+=
"|"
;
}
}
...
@@ -283,9 +268,53 @@ export default {
...
@@ -283,9 +268,53 @@ export default {
if
(
scope
==
""
)
{
if
(
scope
==
""
)
{
return
null
;
return
null
;
}
}
this
.
$emit
(
'setRegion'
,
arr
);
return
scope
;
return
scope
;
},
//设定的行政范围内容(完成或是暂存时传给后台的数据格式)
setScope
(
type
)
{
let
noChangeTree
=
this
.
getTreeCheck
();
let
scope
=
""
;
if
(
this
.
allSelectedKeys
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
this
.
allSelectedKeys
.
length
;
i
++
)
{
scope
+=
this
.
allSelectedKeys
[
i
].
key
+
":"
+
this
.
allSelectedKeys
[
i
].
type
;
if
(
i
<
this
.
allSelectedKeys
.
length
-
1
)
{
scope
+=
"|"
;
}
}
}
else
{
// let noChangeTree = this.getTreeCheck();
console
.
log
(
'noChangeTree值'
,
noChangeTree
);
if
(
noChangeTree
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
noChangeTree
.
length
;
i
++
)
{
scope
+=
noChangeTree
[
i
].
key
+
":"
+
noChangeTree
[
i
].
type
;
if
(
i
<
noChangeTree
.
length
-
1
)
{
scope
+=
"|"
;
}
}
}
}
else
{
//选全国项目
if
(
this
.
tagsRegion
.
length
>
0
&&
this
.
tagsRegion
[
0
].
key
==
'000'
)
{
scope
=
'000:1'
;
console
.
log
(
this
.
tagsRegion
,
'scope'
,
scope
);
}
}
}
//console.log(scope);
if
(
scope
==
""
)
{
return
null
;
}
return
scope
;
},
getTreeCheck
()
{
//重构归并树
let
checkedTree
=
operationData
.
getSimpleCheckedNodes
(
this
.
$refs
.
tree
.
store
);
let
halfCheckedTree
=
this
.
$refs
.
tree
.
getHalfCheckedKeys
()
let
allSelectedKeys
=
operationData
.
setSelectedKeys
(
checkedTree
,
halfCheckedTree
);
vm
.
allSelectedKeys
=
allSelectedKeys
;
//重构内容
return
allSelectedKeys
;
},
}
}
}
}
</
script
>
</
script
>
...
...
src/components/education/template/selectTemplate.vue
浏览文件 @
84a15cb6
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
style=
"width: 350px"
style=
"width: 350px"
placeholder=
"请选择组件"
placeholder=
"请选择组件"
@
change=
"changeValue"
@
change=
"changeValue"
:disabled=
"disabled"
>
>
<el-option
<el-option
v-for=
"item in optionsComponent"
v-for=
"item in optionsComponent"
...
@@ -48,7 +49,7 @@
...
@@ -48,7 +49,7 @@
<el-form-item
required
label=
"学习时长:"
class=
"time-contrl"
>
<el-form-item
required
label=
"学习时长:"
class=
"time-contrl"
>
<el-col
:span=
"10"
>
<el-col
:span=
"10"
>
<el-radio-group
class=
"el-time-ctr"
v-model=
"formComponent.courseRequire"
:disabled=
"
projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6
"
>
<el-radio-group
class=
"el-time-ctr"
v-model=
"formComponent.courseRequire"
:disabled=
"
disabled
"
>
<el-radio
:label=
"1"
>
是(必须达到课程配置的观看时长要求才算通过)
</el-radio>
<el-radio
:label=
"1"
>
是(必须达到课程配置的观看时长要求才算通过)
</el-radio>
<el-radio
:label=
"0"
>
否
</el-radio>
<el-radio
:label=
"0"
>
否
</el-radio>
</el-radio-group>
</el-radio-group>
...
@@ -69,7 +70,7 @@
...
@@ -69,7 +70,7 @@
placeholder=
"请选择"
placeholder=
"请选择"
style=
"width: 350px"
style=
"width: 350px"
@
change=
"updateCertificateType"
@
change=
"updateCertificateType"
:disabled=
"
projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6
"
:disabled=
"
disabled
"
>
>
<el-option
<el-option
v-for=
"item in certificateTypeList"
v-for=
"item in certificateTypeList"
...
@@ -82,7 +83,7 @@
...
@@ -82,7 +83,7 @@
</el-form-item>
</el-form-item>
<el-form-item
required
label=
"累计学习时长大于等于:"
v-show=
"formExam.passType == 3"
:class=
"customError.passTotalLearnTime.className"
>
<el-form-item
required
label=
"累计学习时长大于等于:"
v-show=
"formExam.passType == 3"
:class=
"customError.passTotalLearnTime.className"
>
<el-input
placeholder=
"请输入"
:disabled=
"
projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6
"
v-model=
"formComponent.passTotalLearnTime"
style=
"width:200px"
@
input=
"focusFun($event,'passTotalLearnTime')"
>
<el-input
placeholder=
"请输入"
:disabled=
"
disabled
"
v-model=
"formComponent.passTotalLearnTime"
style=
"width:200px"
@
input=
"focusFun($event,'passTotalLearnTime')"
>
<template
slot=
"append"
>
分钟
</
template
>
<template
slot=
"append"
>
分钟
</
template
>
</el-input>
</el-input>
<div
class=
"el-form-item__error"
v-if=
"customError.passTotalLearnTime.error != ''"
>
{{customError.passTotalLearnTime.error}}
</div>
<div
class=
"el-form-item__error"
v-if=
"customError.passTotalLearnTime.error != ''"
>
{{customError.passTotalLearnTime.error}}
</div>
...
@@ -94,7 +95,7 @@
...
@@ -94,7 +95,7 @@
<div
class=
"mini-source"
style=
"overflow: hidden;"
>
<div
class=
"mini-source"
style=
"overflow: hidden;"
>
<el-form-item
label=
"项目中最高"
label-width=
"80px"
style=
"float: left;"
:class=
"customError.passExamCount.className"
class=
"min-label"
>
<el-form-item
label=
"项目中最高"
label-width=
"80px"
style=
"float: left;"
:class=
"customError.passExamCount.className"
class=
"min-label"
>
<div
class=
"source-item"
>
<div
class=
"source-item"
>
<el-input
placeholder=
"请输入数字"
:disabled=
"
projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6
"
size=
"mini"
v-model=
"formComponent.passExamCount"
style=
"width:150px"
@
input=
"focusFun($event,'passExamCount')"
>
<el-input
placeholder=
"请输入数字"
:disabled=
"
disabled
"
size=
"mini"
v-model=
"formComponent.passExamCount"
style=
"width:150px"
@
input=
"focusFun($event,'passExamCount')"
>
<
template
slot=
"append"
>
门
</
template
>
<
template
slot=
"append"
>
门
</
template
>
</el-input>
</el-input>
</div>
</div>
...
@@ -103,7 +104,7 @@
...
@@ -103,7 +104,7 @@
<div
style=
"float: left;padding:0 5px;line-height: 26px;font-size: 12px;color:#606266"
>
考试成绩的平均分大于等于
</div>
<div
style=
"float: left;padding:0 5px;line-height: 26px;font-size: 12px;color:#606266"
>
考试成绩的平均分大于等于
</div>
<el-form-item
label=
""
label-width=
"0px"
style=
"float: left;"
:class=
"customError.passAverageScore.className"
class=
"min-label"
>
<el-form-item
label=
""
label-width=
"0px"
style=
"float: left;"
:class=
"customError.passAverageScore.className"
class=
"min-label"
>
<div
class=
"source-item"
>
<div
class=
"source-item"
>
<el-input
placeholder=
"请输入数字"
:disabled=
"
projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6
"
size=
"mini"
v-model=
"formComponent.passAverageScore"
style=
"width:150px"
@
input=
"focusFun($event,'passAverageScore')"
>
<el-input
placeholder=
"请输入数字"
:disabled=
"
disabled
"
size=
"mini"
v-model=
"formComponent.passAverageScore"
style=
"width:150px"
@
input=
"focusFun($event,'passAverageScore')"
>
<
template
slot=
"append"
>
分
</
template
>
<
template
slot=
"append"
>
分
</
template
>
</el-input>
</el-input>
</div>
</div>
...
@@ -116,7 +117,7 @@
...
@@ -116,7 +117,7 @@
<el-form-item
required
label=
"配置证书:"
>
<el-form-item
required
label=
"配置证书:"
>
<el-col
:span=
"10"
>
<el-col
:span=
"10"
>
<el-radio-group
class=
"el-configure"
v-model=
"formComponent.configure"
:disabled=
"
projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6
"
>
<el-radio-group
class=
"el-configure"
v-model=
"formComponent.configure"
:disabled=
"
disabled
"
>
<el-radio
:label=
"1"
>
是
</el-radio>
<el-radio
:label=
"1"
>
是
</el-radio>
<el-radio
:label=
"2"
>
否
</el-radio>
<el-radio
:label=
"2"
>
否
</el-radio>
</el-radio-group>
</el-radio-group>
...
@@ -131,7 +132,7 @@
...
@@ -131,7 +132,7 @@
<div
class=
"configure-item"
>
<div
class=
"configure-item"
>
<el-form-item
label=
"平均分:"
label-width=
"65px"
style=
"float: left;"
:class=
"item.minClass"
class=
"min-label"
>
<el-form-item
label=
"平均分:"
label-width=
"65px"
style=
"float: left;"
:class=
"item.minClass"
class=
"min-label"
>
<el-col
:span=
"5"
>
<el-col
:span=
"5"
>
<el-input
:disabled=
"
projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6
"
placeholder=
"请输入数字"
size=
"mini"
v-model=
"item.rangeMin"
style=
"width:215px"
@
input=
"focusFun($event,'rangeMin',index)"
>
<el-input
:disabled=
"
disabled
"
placeholder=
"请输入数字"
size=
"mini"
v-model=
"item.rangeMin"
style=
"width:215px"
@
input=
"focusFun($event,'rangeMin',index)"
>
<
template
slot=
"append"
>
分
</
template
>
<
template
slot=
"append"
>
分
</
template
>
</el-input>
</el-input>
</el-col>
</el-col>
...
@@ -140,7 +141,7 @@
...
@@ -140,7 +141,7 @@
<div
style=
"float: left;padding:0 5px;line-height: 26px;"
>
~
</div>
<div
style=
"float: left;padding:0 5px;line-height: 26px;"
>
~
</div>
<el-form-item
label-width=
"0"
style=
"float: left;margin-left:0px;"
:class=
"item.maxClass"
class=
"min-label"
>
<el-form-item
label-width=
"0"
style=
"float: left;margin-left:0px;"
:class=
"item.maxClass"
class=
"min-label"
>
<el-col
:span=
"5"
>
<el-col
:span=
"5"
>
<el-input
:disabled=
"
projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6
"
placeholder=
"请输入数字"
size=
"mini"
v-model=
"item.rangeMax"
style=
"width:215px"
@
input=
"focusFun($event,'rangeMax',index)"
>
<el-input
:disabled=
"
disabled
"
placeholder=
"请输入数字"
size=
"mini"
v-model=
"item.rangeMax"
style=
"width:215px"
@
input=
"focusFun($event,'rangeMax',index)"
>
<
template
slot=
"append"
>
分
</
template
>
<
template
slot=
"append"
>
分
</
template
>
</el-input>
</el-input>
</el-col>
</el-col>
...
@@ -155,7 +156,7 @@
...
@@ -155,7 +156,7 @@
size=
"mini"
size=
"mini"
style=
"width: 450px;"
style=
"width: 450px;"
@
change=
"updateCertificate(index)"
@
change=
"updateCertificate(index)"
:disabled=
"
projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6
"
:disabled=
"
disabled
"
>
>
<el-option
<el-option
v-for=
"item in optionsCertificate"
v-for=
"item in optionsCertificate"
...
@@ -168,8 +169,8 @@
...
@@ -168,8 +169,8 @@
</el-form-item>
</el-form-item>
</div>
</div>
<div
class=
"configure-option"
>
<div
class=
"configure-option"
>
<el-button
size=
"mini"
@
click=
"addCertificate"
icon=
"el-icon-plus"
circle
:disabled=
"
projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6
"
></el-button>
<el-button
size=
"mini"
@
click=
"addCertificate"
icon=
"el-icon-plus"
circle
:disabled=
"
disabled
"
></el-button>
<el-button
size=
"mini"
@
click=
"reduceCertificate(index)"
icon=
"el-icon-minus"
circle
:disabled=
"
projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6
"
></el-button>
<el-button
size=
"mini"
@
click=
"reduceCertificate(index)"
icon=
"el-icon-minus"
circle
:disabled=
"
disabled
"
></el-button>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -180,7 +181,7 @@
...
@@ -180,7 +181,7 @@
v-model=
"formComponent.certificate"
v-model=
"formComponent.certificate"
placeholder=
"请选择证书"
placeholder=
"请选择证书"
style=
"width: 350px"
style=
"width: 350px"
:disabled=
"
projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6
"
:disabled=
"
disabled
"
>
>
<el-option
<el-option
v-for=
"item in optionsCertificate"
v-for=
"item in optionsCertificate"
...
@@ -209,6 +210,20 @@ export default {
...
@@ -209,6 +210,20 @@ export default {
openTemplateId
:
{
openTemplateId
:
{
type
:
String
|
Number
,
type
:
String
|
Number
,
deault
:
0
deault
:
0
},
messageObj
:
{
type
:
Object
,
default
:()
=>
{
return
null
}
},
isEditor
:
{
type
:
Boolean
,
default
:
true
},
newBuild
:
{
type
:
Boolean
,
default
:
true
}
}
},
},
data
()
{
data
()
{
...
@@ -302,7 +317,7 @@ export default {
...
@@ -302,7 +317,7 @@ export default {
],
],
showRules1
:
[{
required
:
true
,
message
:
"请输入门数"
,
trigger
:
"blur"
}]
showRules1
:
[{
required
:
true
,
message
:
"请输入门数"
,
trigger
:
"blur"
}]
},
},
disabled
:
tru
e
disabled
:
fals
e
};
};
},
},
computed
:
{
computed
:
{
...
@@ -310,8 +325,16 @@ export default {
...
@@ -310,8 +325,16 @@ export default {
},
},
created
()
{
created
()
{
vm
=
this
;
vm
=
this
;
this
.
getComponentInfo
();
vm
.
idType
=
localStorage
.
getItem
(
"storageIdType"
);
vm
.
getComponentInfo
();
if
(
!
vm
.
newBuild
){
vm
.
setEditData
(
this
.
messageObj
);
}
if
(
!
vm
.
newBuild
&&
!
vm
.
isEditor
)
{
this
.
disabled
=
true
;
}
else
{
this
.
disabled
=
false
;
}
},
},
// 挂载到Dom完成时
// 挂载到Dom完成时
mounted
:
function
()
{
mounted
:
function
()
{
...
@@ -483,8 +506,67 @@ export default {
...
@@ -483,8 +506,67 @@ export default {
//console.log('this.tagsComponent',this.tagsComponent);
//console.log('this.tagsComponent',this.tagsComponent);
},
},
// 如有数据时 初始化
// 如有数据时 初始化
setEditData
(
editData
)
{
//设置选择项目组件页
let
componentEdit
=
[];
let
certificateEdit
=
0
;
for
(
let
i
=
0
;
i
<
editData
.
componentData
.
length
;
i
++
)
{
componentEdit
.
push
(
editData
.
componentData
[
i
].
relevanceId
);
}
this
.
formComponent
.
component
=
componentEdit
;
this
.
initTags
(
componentEdit
);
if
(
editData
.
certificateData
.
length
>
0
)
{
this
.
formComponent
.
configure
=
1
;
this
.
formComponent
.
certificate
=
editData
.
certificateData
[
0
].
relevanceId
;
}
if
(
editData
.
certificateRule
.
length
>
0
)
{
this
.
formComponent
.
configure
=
1
;
}
//初始化考试平均分配置数据
this
.
formExam
.
certificateType
=
editData
.
portalOpenTemplateModel
.
certificateType
;
this
.
formExam
.
passType
=
editData
.
portalOpenTemplateModel
.
passType
;
this
.
formExam
.
exam
=
editData
.
certificateRule
;
if
(
this
.
formExam
.
exam
.
length
>
0
)
{
for
(
let
k
=
0
;
k
<
this
.
formExam
.
exam
.
length
;
k
++
)
{
this
.
formExam
.
exam
[
k
].
certClass
=
""
;
this
.
formExam
.
exam
[
k
].
certError
=
""
;
this
.
formExam
.
exam
[
k
].
minClass
=
""
;
this
.
formExam
.
exam
[
k
].
minError
=
""
;
this
.
formExam
.
exam
[
k
].
maxClass
=
""
;
this
.
formExam
.
exam
[
k
].
maxError
=
""
;
}
}
console
.
log
(
this
.
formExam
.
exam
);
this
.
formComponent
.
passAverageScore
=
editData
.
portalOpenTemplateModel
.
passAverageScore
>
0
?
editData
.
portalOpenTemplateModel
.
passAverageScore
:
""
;
this
.
formComponent
.
passExamCount
=
editData
.
portalOpenTemplateModel
.
passExamCount
>
0
?
editData
.
portalOpenTemplateModel
.
passExamCount
:
""
;
this
.
formComponent
.
passTotalLearnTime
=
editData
.
portalOpenTemplateModel
.
passTotalLearnTime
;
if
(
this
.
formExam
.
exam
.
length
==
0
)
{
this
.
formExam
.
exam
=
[
{
examCount
:
1
,
rangeMin
:
""
,
rangeMax
:
""
,
certificateId
:
""
,
certificateName
:
""
,
minClass
:
""
,
minError
:
""
,
maxClass
:
""
,
maxError
:
""
,
certClass
:
""
,
certError
:
""
}
];
}
},
initTags
(
value
)
{
initTags
(
value
)
{
console
.
log
(
'=================initTags'
);
//console.log('value',value,'optionsComponent',this.optionsComponent);
//console.log('value',value,'optionsComponent',this.optionsComponent);
this
.
tagsComponent
=
[];
this
.
tagsComponent
=
[];
let
len
=
0
;
let
len
=
0
;
...
...
src/components/education/template/setOrganization.vue
浏览文件 @
84a15cb6
...
@@ -177,8 +177,7 @@ export default {
...
@@ -177,8 +177,7 @@ export default {
formOrganization
:
{
formOrganization
:
{
name
:
""
,
name
:
""
,
administrativeId
:
"0"
,
administrativeId
:
"0"
,
// administrativeIdList: ["0"],
administrativeIdList
:
[
"0"
],
administrativeIdList
:[
110
],
level
:
"-1"
,
level
:
"-1"
,
chechAll
:
true
,
chechAll
:
true
,
pageNum
:
1
,
pageNum
:
1
,
...
@@ -240,21 +239,21 @@ export default {
...
@@ -240,21 +239,21 @@ export default {
created
()
{
created
()
{
vm
=
this
;
vm
=
this
;
vm
.
idType
=
localStorage
.
getItem
(
"storageIdType"
);
vm
.
idType
=
localStorage
.
getItem
(
"storageIdType"
);
this
.
getOrganization
();
//
this.getOrganization();
this
.
getRegionOption
();
this
.
getRegionOption
();
this
.
listLevels
();
this
.
listLevels
();
},
},
methods
:
{
methods
:
{
//查询机构列表
//查询机构列表
getOrganization
()
{
getOrganization
(
r
)
{
console
.
log
(
'=========================getOrganization'
)
console
.
log
(
'=========================getOrganization'
)
let
req
=
{
let
req
=
{
projectId
:
this
.
projectId
,
projectId
:
this
.
projectId
,
administrativeId
:
""
,
administrativeId
:
""
,
hospitalLevel
:
""
,
hospitalLevel
:
""
,
hospitalLevel
:
""
,
hospitalLevel
:
""
,
// scope:
'000',: this.getScope("administrative")
,
// scope:
this.regio == '' ? null : this.regio
,
scope
:
'000'
,
scope
:
r
?
r
:
null
,
pageNum
:
this
.
formOrganization
.
pageNum
,
pageNum
:
this
.
formOrganization
.
pageNum
,
pageSize
:
this
.
formOrganization
.
pageSize
pageSize
:
this
.
formOrganization
.
pageSize
};
};
...
@@ -340,7 +339,6 @@ export default {
...
@@ -340,7 +339,6 @@ export default {
},
},
//获取地区select
//获取地区select
getRegionOption
()
{
getRegionOption
()
{
console
.
log
(
'=========================getRegionOption'
)
let
req
=
{};
let
req
=
{};
openLoading
(
vm
);
openLoading
(
vm
);
vm
.
GET
(
"basic-data/position/provinces"
,
req
).
then
(
res
=>
{
vm
.
GET
(
"basic-data/position/provinces"
,
req
).
then
(
res
=>
{
...
...
src/components/education/template/templateList.vue
浏览文件 @
84a15cb6
...
@@ -317,13 +317,12 @@ export default {
...
@@ -317,13 +317,12 @@ export default {
}
}
}
}
.box-right
{
.box-right
{
margin-right
:
24px
;
text-align
:
center
;
width
:
100
px
;
width
:
98
px
;
height
:
50px
;
height
:
50px
;
font-size
:
14px
;
font-size
:
14px
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-weight
:
400
;
font-weight
:
400
;
text-align
:
right
;
color
:rgba
(
68
,
146
,
132
,
1
)
;
color
:rgba
(
68
,
146
,
132
,
1
)
;
line-height
:
50px
;
line-height
:
50px
;
...
@@ -334,6 +333,8 @@ export default {
...
@@ -334,6 +333,8 @@ export default {
.dialog-list-wrap
{
.dialog-list-wrap
{
.el-dialog
{
.el-dialog
{
width
:
800px
;
width
:
800px
;
max-height
:
1000px
;
overflow
:
scroll
;
}
}
.dialog-line
{
.dialog-line
{
width
:
750px
;
width
:
750px
;
...
...
src/components/education/template/templateMessage.vue
0 → 100644
浏览文件 @
84a15cb6
<!--基础信息-->
<
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"
></el-input>
<span
class=
"word-num"
>
{{
(
formData
.
projectName
).
replace
(
/
\s
+/g
,
""
).
length
}}
/24
</span>
</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)"
></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"
/>
<img
@
click=
"deleteOrg(index)"
v-if=
"index >= 1"
class=
"edit-img"
src=
"../../../assets/image/trash.png"
/>
</el-col>
<el-popover
class=
"popover-content"
:style=
"
{'top': orgListIndex * 41 + 'px'}"
placement="bottom"
:content="organizationContent"
v-model="visibleName"
@click="checkDefault">
<p
@
click=
"checkDefault"
>
我的机构:
{{
organizationContent
}}
</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"
:picker-options=
"pickerOptions0"
style=
"width: 100%;"
></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"
:picker-options=
"pickerOptions1"
default-time=
"23:59:59"
style=
"width: 100%;"
></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>
<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=
"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 && !disabled"
@
click
.
stop=
"deleteImg(1)"
@
mouseout
.
stop=
"imgMouseOver=false"
><i
class=
"el-icon-delete"
></i></div>
<div
class=
"limit-text"
>
<p>
尺寸:48*48
</p>
<p>
限制大小: 500Kb
</p>
<p>
支持.jpg,.png格式
</p>
</div>
</el-upload>
</el-form-item>
<p
class=
"upload-message"
v-if=
"uploadImgMessage"
>
请选择列表图片
</p>
</div>
<el-form-item
label=
"封面类型:"
>
<el-radio-group
size=
"small"
v-model=
"formData.type"
@
change=
"changeCover"
:disabled=
"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=
"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 && !disabled"
@
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=
"项目简介:"
prop=
"projectIntro"
>
<el-col
:span=
"13"
>
<el-input
size=
"small"
type=
"textarea"
:autosize=
"
{ minRows: 5}"
placeholder="请输入项目简介"
v-model="formData.projectIntro"
style="width:83%;"
:disabled="disabled"
>
</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
dialog
from
"./dialog"
;
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: 'hcd',//机构名称
formData: {
id: "", //项目 id 26
projectName: "", //开放模板名称
projectBegintime: "", //模板开始时间
projectEndtime: "", //模板结束时间
projectIntro: "", //开放模板简介
type: 1, //封面类型 1图片2视频
projectStatus: 3, //1.草稿 2.未上架 3.审核中/待审核 4.已上架 5.已下架 6.已拒绝/未上架
expireDay: 1, //模板有效期(天)
attachmentUrl1: "",
attachmentUrl2: "",
attachmentUrl3: "",
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).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: '该项目模版已下架',
message: '模版已下架,请重新选择其他项目模版',
confirmMsg: '取消',
hideMsg: '重新选择'
},
}
},
components: {
dialogComponet:dialog
},
created() {
vm = this;
if (vm.editor) {
// 编辑时
vm.disabled = false;
vm.getEditorMessage()
} else{
// 创建时
vm.disabled = true;
vm.getMessage();
}
},
methods: {
// 设置已有的基本信息
setBaseMessage(data) {
this.formData = Object.assign(this.formData, data.projectData);
this.formData.attachmentUrl1 = data.attachmentData[0].attachmentUrl;
this.formData.attachmentMore1 = Object.assign(this.formData.attachmentMore1, data.attachmentData[0]);
this.formData.projectBegintime = this.formData.projectBegintime ? new Date(this.formData.projectBegintime) : '';
this.formData.projectEndtime = this.formData.projectBegintime ? new Date(this.formData.projectEndtime) : '';
if (data.attachmentData[1]) {
// this.formData.attachmentUrl2 = data.attachmentData[1].attachmentType == 1 ? data.attachmentData[1].attachmentUrl : '';
// this.formData.attachmentUrl3 = data.attachmentData[1].attachmentType == 2 ? data.attachmentData[1].attachmentUrl : '';
this.formData.attachmentUrl2 = data.attachmentData[1].attachmentUrl;
this.formData.type = data.attachmentData[1].attachmentType;
this.formData.attachmentMore2 = Object.assign(this.formData.attachmentMore2, data.attachmentData[1]);
}
},
// 获取选择模板后的基本信息
getMessage() {
openLoading(vm);
vm.GET(`portal/openTemplateProject/getOpenTemplateInfoForCreate/${vm.openTemplateId}`)
.then(res => {
closeLoading(vm);
if (res.code == "
000000
") {
this.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}`)
.then(res => {
closeLoading(vm);
if (res.code == "
000000
") {
this.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.formData.organizationNameList.splice(vm.orgListIndex-1, 1, vm.organizationContent);
vm.visibleName = false;
},
//上传列表图片
beforeUploadListPic(file) {
let fileLimit = {
width: 48,
height: 48,
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 (file.width != fileLimit.width || file.height != fileLimit.height) {
// vm.$message.error("
图片不符合规范,请根据规范上传图片
");
// return;
// }
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 = vm;
if ( false
// _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(3);
}
},
// 暂存
save() {
if (this.$refs['formData'].projectName == '') {
this.$refs['formData'].validateField('projectName')
} else {
vm.insertOrupdate(1);
};
},
// 新增或者更新基本信息
insertOrupdate(status) {
// 暂存为1 下一步为3
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;
openLoading(vm);
vm.POST("
portal
/
portalInfo
/
insertOrUpdate
", baseobj).then(res => {
closeLoading(vm);
if (res.code == "
000000
" && status == 3) {
// 下一步,并将项目id传递
this.$emit('next',res.data.id);
} else if (res.code == "
213061
") {
vm.dialogObj.visible = true;
} else {
vm.$message.info(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;
this.$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
;
}
</
style
>
src/views/education/template-editor.vue
浏览文件 @
84a15cb6
<
template
>
<
template
>
<div
class=
"template-editor-wrap"
>
<div
class=
"template-editor-wrap"
>
<bread-crumb
:curmbFirst=
"curmbFirst"
:curmbSecond=
"curmbSecond"
:curmbThird=
"curmbThird"
></bread-crumb>
<bread-crumb
:curmbFirst=
"curmbFirst"
:curmbSecond=
"curmbSecond"
:curmbThird=
"curmbThird"
></bread-crumb>
<div
class=
"add-content screenSet"
id=
"screenSet"
v-if=
"editor"
>
<div
class=
"add-content screenSet"
id=
"screenSet"
v-if=
"editor"
>
<div
class=
"top-lin"
></div>
<div
class=
"top-lin"
></div>
<step-content
<step-content
...
@@ -9,41 +10,46 @@
...
@@ -9,41 +10,46 @@
@
nextStep=
"nextStep"
@
nextStep=
"nextStep"
@
complete=
"complete"
@
complete=
"complete"
/>
/>
<!-- 基础组件 -->
<!-- 基础组件 -->
<base-message
<base-message
ref=
"baseMessage"
ref=
"baseMessage"
v-if=
"active == 0 && formData"
v-if=
"active == 0 && ((!newBuild && editor && messageObj.portalOpenTemplateModel) || newBuild)"
:projectManger=
"projectManger"
:isEditor=
"editor"
:messageObj=
"messageObj"
:newBuild=
"newBuild"
@
next=
"next"
@
next=
"next"
/>
/>
<!-- 选择项目组件 -->
<!-- 选择项目组件 -->
<select-template
<select-template
ref=
"selectTemplate"
ref=
"selectTemplate"
v-if=
"active == 1"
v-if=
"active == 1 && ((!newBuild && editor && messageObj.portalOpenTemplateModel) || newBuild)"
:isEditor=
"editor"
:openTemplateId=
"openTemplateId"
:openTemplateId=
"openTemplateId"
:messageObj=
"messageObj"
:newBuild=
"newBuild"
/>
/>
<!-- 选择行政区 -->
<!--
<select-region
v-if=
"active == 1"
></select-region>
-->
<!-- 设定机构 -->
<!--
<set-Organization
v-if=
"active == 0"
></set-Organization>
-->
</div>
</div>
<div
class=
"add-content screenSet"
id=
"screenSet"
v-else
>
<div
class=
"add-content screenSet"
id=
"screenSet"
v-else
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleClick"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleClick"
>
<el-tab-pane
label=
"基础信息"
name=
"first"
>
<el-tab-pane
label=
"基础信息"
name=
"first"
>
<base-message
<base-message
v-if=
"messageObj.portalOpenTemplateModel"
ref=
"baseMessage"
ref=
"baseMessage"
:projectManger=
"projectManger"
:isEditor=
"editor"
:messageObj=
"messageObj"
:newBuild=
"newBuild"
@
next=
"next"
@
next=
"next"
/>
/>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"选中组件"
name=
"second"
>
<el-tab-pane
label=
"选中组件"
name=
"second"
>
<select-template
<select-template
v-if=
"messageObj.portalOpenTemplateModel"
ref=
"selectTemplate"
ref=
"selectTemplate"
:isEditor=
"editor"
:openTemplateId=
"openTemplateId"
:openTemplateId=
"openTemplateId"
:messageObj=
"messageObj"
:newBuild=
"newBuild"
/>
/>
</el-tab-pane>
</el-tab-pane>
</el-tabs>
</el-tabs>
...
@@ -58,6 +64,7 @@ import baseMessage from "../../components/education/template/baseMessage";
...
@@ -58,6 +64,7 @@ import baseMessage from "../../components/education/template/baseMessage";
import
selectTemplate
from
"../../components/education/template/selectTemplate"
;
import
selectTemplate
from
"../../components/education/template/selectTemplate"
;
import
selectRegion
from
"../../components/education/template/selectRegion"
;
import
selectRegion
from
"../../components/education/template/selectRegion"
;
import
setOrganization
from
"../../components/education/template/setOrganization"
;
import
setOrganization
from
"../../components/education/template/setOrganization"
;
import
{
openLoading
,
closeLoading
}
from
"../../utils/utils"
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
...
@@ -65,57 +72,12 @@ export default {
...
@@ -65,57 +72,12 @@ export default {
curmbSecond
:
"模板管理"
,
curmbSecond
:
"模板管理"
,
curmbThird
:
'新建项目模板'
,
curmbThird
:
'新建项目模板'
,
active
:
0
,
active
:
0
,
fished
:
false
,
fished
:
false
,
// 是到到最后一步
projectManger
:
false
,
messageObj
:
{},
formData
:
{
openTemplateId
:
''
,
openTemplateName
:
""
,
//开放模板名称
projectBegintime
:
""
,
//模板开始时间
projectEndtime
:
""
,
//模板结束时间
openTemplateIntro
:
""
,
//开放模板简介
type
:
1
,
//封面类型 1图片2视频
expireDay
:
""
,
// 开放有效期
subjectId
:
""
,
//开放模板所属学科ID
subjectName
:
""
,
//开放模板所属学科名称
attachmentUrl1
:
""
,
attachmentUrl2
:
""
,
attachmentUrl3
:
""
,
attachmentMore1
:
{},
attachmentMore2
:
{},
organizationName
:
""
,
// 发起机构名称(多个机构拼接
organizationNameList
:
[
''
],
//发起机构列表
openTemplateDetail
:
''
//开放模板详情
},
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
}
],
baseobj
:
{},
formTemplate
:
{
component
:
[],
configure
:
2
,
certificate
:
""
},
openTemplateId
:
26
,
activeName
:
'first'
,
activeName
:
'first'
,
editor
:
true
// 是否为编辑状态
editor
:
true
,
// 是否为编辑状态 还是查看状态
newBuild
:
true
// 是否为新建状态
}
}
},
},
components
:
{
components
:
{
...
@@ -127,7 +89,22 @@ export default {
...
@@ -127,7 +89,22 @@ export default {
setOrganization
setOrganization
},
},
created
()
{
created
()
{
this
.
fished
=
this
.
active
==
0
?
false
:
true
if
(
!
this
.
$route
.
query
.
id
)
{
this
.
newBuild
=
true
;
this
.
editor
=
true
;
}
else
if
(
this
.
$route
.
query
.
isEdit
==
1
)
{
this
.
openTemplateId
=
this
.
$route
.
query
.
id
;
this
.
newBuild
=
false
;
this
.
editor
=
true
;
}
else
{
this
.
openTemplateId
=
this
.
$route
.
query
.
id
;
this
.
newBuild
=
false
;
this
.
editor
=
false
;
}
this
.
fished
=
this
.
active
==
0
?
false
:
true
;
if
(
!
this
.
newBuild
)
{
this
.
getBaseMessage
()
}
},
},
methods
:
{
methods
:
{
//用于存储基本信息
//用于存储基本信息
...
@@ -148,8 +125,19 @@ export default {
...
@@ -148,8 +125,19 @@ export default {
this
.
$refs
.
selectTemplate
.
componentDraft
(
3
);
this
.
$refs
.
selectTemplate
.
componentDraft
(
3
);
},
},
handleClick
()
{
handleClick
()
{
},
// 获取已有的基本信息
getBaseMessage
()
{
openLoading
(
this
);
this
.
GET
(
`portal/openTemplate/getOpenTemplateInfo/
${
this
.
openTemplateId
}
`
).
then
(
res
=>
{
closeLoading
(
this
);
if
(
res
.
code
==
"000000"
)
{
this
.
messageObj
=
res
.
data
}
else
{
this
.
$message
.
info
(
res
.
message
);
}
}
});
},
}
}
}
}
</
script
>
</
script
>
...
...
src/views/education/template-open.vue
浏览文件 @
84a15cb6
...
@@ -16,47 +16,53 @@
...
@@ -16,47 +16,53 @@
</el-steps>
</el-steps>
</el-col>
</el-col>
<el-col
:span=
"5"
:offset=
"5"
>
<el-col
:span=
"5"
:offset=
"5"
>
<el-button
v-if=
"!canNext"
size=
"small"
type=
"info"
plain
>
下一步
</el-button>
<div
v-if=
"!canNext"
class=
"dis-btn"
>
下一步
</div>
<el-button
v-if=
"active!=0"
size=
"small"
@
click=
"save"
>
暂存
</el-button>
<el-button
v-if=
"active!==2 && canNext"
size=
"small"
type=
"primary"
@
click=
"nextStep"
>
下一步
</el-button>
<el-button
v-if=
"active!==2 && canNext"
size=
"small"
type=
"primary"
@
click=
"nextStep"
>
下一步
</el-button>
<el-button
v-if=
"active==2"
size=
"small"
type=
"primary"
@
click=
"complete"
>
完成
</el-button>
<el-button
v-if=
"active==2"
size=
"small"
type=
"primary"
@
click=
"complete"
>
完成
</el-button>
</el-col>
</el-col>
</el-row>
</el-row>
<!-- 模板列表 -->
<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>
<!-- 模板列表 -->
<!-- 填写项目信息-->
<!-- 填写项目信息-->
<base-message
<template-message
ref=
"baseMessage"
ref=
"templateMessage"
v-if=
"active == 1 && formData"
v-if=
"active == 1"
:formData=
"formData"
:openTemplateId=
"openTemplateId"
:projectManger=
"projectManger"
:projectId=
"projectId"
:editor=
"editor"
@
next=
"next"
@
backSelectVue=
"backSelectVue"
/>
/>
<!-- 选择学员 -->
<!-- 选择学员 -->
<div
class=
"three-step"
v-
else-
if=
"active === 2"
>
<div
class=
"three-step"
v-if=
"active === 2"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleClickTabs"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleClickTabs"
>
<el-tab-pane
label=
"设定行政范围"
name=
"first"
>
<el-tab-pane
label=
"设定行政范围"
name=
"first"
>
<select-region
@
setRegion=
"setRegion
"
></select-region>
<select-region
ref=
"selectRegion"
:projectId=
"projectId
"
></select-region>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"设定机构"
name=
"second"
>
<el-tab-pane
label=
"设定机构"
name=
"second"
>
<set-
Organization
></set-O
rganization>
<set-
organization
ref=
"setOrganization"
></set-o
rganization>
</el-tab-pane>
</el-tab-pane>
</el-tabs>
</el-tabs>
</div>
</div>
</div>
</div>
<dialog-componet
:dialogObj=
"dialogObj"
@
hide=
"hide"
></dialog-componet>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
BreadCrumb
from
"../../components/breadcrumb.vue"
;
import
BreadCrumb
from
"../../components/breadcrumb.vue"
;
import
baseMessage
from
"../../components/education/template/bas
eMessage"
;
import
templateMessage
from
"../../components/education/template/templat
eMessage"
;
import
selectTemplate
from
"../../components/education/template/selectTemplate"
;
import
selectTemplate
from
"../../components/education/template/selectTemplate"
;
import
selectRegion
from
"../../components/education/template/selectRegion"
;
import
selectRegion
from
"../../components/education/template/selectRegion"
;
import
setOrganization
from
"../../components/education/template/setOrganization"
;
import
setOrganization
from
"../../components/education/template/setOrganization"
;
import
templateList
from
"../../components/education/template/templateList"
;
import
templateList
from
"../../components/education/template/templateList"
;
import
dialog
from
"../../components/education/template/dialog"
;
import
{
openLoading
,
closeLoading
}
from
"../../utils/utils"
;
import
{
openLoading
,
closeLoading
}
from
"../../utils/utils"
;
import
*
as
commonUtil
from
"../../utils/utils"
;
import
*
as
commonUtil
from
"../../utils/utils"
;
let
vm
=
null
;
let
vm
=
null
;
...
@@ -67,32 +73,6 @@ export default {
...
@@ -67,32 +73,6 @@ export default {
curmbSecond
:
"项目管理"
,
curmbSecond
:
"项目管理"
,
curmbThird
:
'发起项目'
,
curmbThird
:
'发起项目'
,
active
:
0
,
active
:
0
,
fished
:
false
,
projectManger
:
true
,
formData
:
{
projectName
:
""
,
projectBegintime
:
""
,
projectEndtime
:
""
,
projectIntro
:
""
,
type
:
1
,
useTime
:
""
,
xueke
:
""
,
attachmentUrl1
:
""
,
attachmentUrl2
:
""
,
attachmentUrl3
:
""
,
attachmentMore1
:
{},
attachmentMore2
:
{},
scopeType
:
0
,
organizationName
:
""
,
organizationNameList
:
[
''
],
sendOption
:
1
,
receiveOption
:
1
,
visibleFlag
:
1
,
learnableFlag
:
2
,
authorityType
:
1
,
allowLearn
:
2
,
richContent
:
''
},
formTemplate
:
{
formTemplate
:
{
component
:
[],
component
:
[],
configure
:
2
,
configure
:
2
,
...
@@ -100,17 +80,53 @@ export default {
...
@@ -100,17 +80,53 @@ export default {
},
},
activeName
:
"first"
,
activeName
:
"first"
,
canNext
:
false
,
canNext
:
false
,
openTemplateId
:
''
,
openTemplateId
:
0
,
// 开放模板ID
r
:
[]
//设定行政范围和设定机构相互影响的行政范围
projectId
:
''
,
// 项目id
status
:
10
,
// 0正常10没有加入机构11审核中12审核失败20存在进行中项目21数量已达上限
editor
:
false
,
// 是否为编辑状态
dialogObj
:
{
visible
:
false
,
title
:
''
,
message
:
''
,
hideMsg
:
''
},
statusObj
:
{
status_10
:
{
title
:
'您暂未加入机构'
,
message
:
'请前往云鹊医App-个人中心完善机构信息,加入机构后,可创建项目'
,
hideMsg
:
'我知道了'
},
status_11
:
{
title
:
'您创建的机构正在审核中'
,
message
:
'请前往云鹊医App-个人中心查看审核进度,审核通过后,可创建机构'
,
hideMsg
:
'我知道了'
},
status_12
:
{
title
:
'您创建的机构审核不通过'
,
message
:
'请前往云鹊医App-个人中心完善机构信息,加入机构后,可创建项目'
,
hideMsg
:
'我知道了'
},
status_20
:
{
title
:
'该项目正在进行中'
,
message
:
'不能重复创建,请选择其他模版或者下架正在进行中的项目'
,
hideMsg
:
'确定'
},
status_21
:
{
title
:
'该项目创建数量已上限'
,
message
:
'本年度免费创建数已达'
,
hideMsg
:
'确定'
}
}
}
}
},
},
components
:
{
components
:
{
BreadCrumb
,
BreadCrumb
,
bas
eMessage
,
templat
eMessage
,
selectTemplate
,
selectTemplate
,
selectRegion
,
selectRegion
,
setOrganization
,
setOrganization
,
templateList
templateList
,
dialogComponet
:
dialog
},
},
created
()
{
created
()
{
vm
=
this
;
vm
=
this
;
...
@@ -121,21 +137,83 @@ export default {
...
@@ -121,21 +137,83 @@ export default {
methods
:
{
methods
:
{
// 下一步
// 下一步
nextStep
()
{
nextStep
()
{
// let flag = this.$refs.baseMessage.nextStep();
if
(
this
.
active
==
0
)
{
// if (!flag) {
// let flag = this.checkSelectTemplate();
// return;
let
flag
=
true
;
// }
if
(
flag
)
{
this
.
active
++
;
this
.
active
=
1
;
}
return
;
}
if
(
this
.
active
==
1
)
{
this
.
$refs
.
templateMessage
.
nextStep
();
return
;
}
},
// 填写项目信息组件的下一步回调
next
(
id
)
{
this
.
projectId
=
id
;
this
.
active
=
2
;
},
// 暂存
save
()
{
if
(
this
.
active
==
1
)
{
if
(
this
.
active
==
1
)
{
this
.
fished
=
true
;
this
.
$refs
.
templateMessage
.
save
();
}
else
if
(
this
.
active
==
2
)
{
this
.
regionComplete
();
}
}
},
},
// 完成
complete
()
{
complete
()
{
console
.
log
(
'完成'
);
this
.
regionComplete
(
this
.
changeStatus
());
},
// 选择学元范围暂存
regionComplete
(
fishFn
)
{
let
req
=
{
projectId
:
this
.
projectId
,
scopeOfAdministrative
:
this
.
$refs
.
selectRegion
.
setScope
(),
scopeOfDepartment
:
99999999
,
flag
:
fishFn
?
3
:
1
,
//0:下一步 1:暂存
};
openLoading
(
vm
);
vm
.
POST
(
"portal/new/scope"
,
req
).
then
(
res
=>
{
closeLoading
(
vm
);
if
(
res
.
code
==
'000000'
&&
fishFn
)
{
fishFn
();
}
if
(
!
fishFn
)
{
vm
.
$message
({
type
:
"info"
,
message
:
res
.
message
});
}
});
},
// 完成后更改状态
changeStatus
()
{
let
req
=
{
projectId
:
this
.
projectId
,
changeStatus
:
3
//待审核
};
vm
.
POST
(
"portal/portalInfo/changeStatus"
,
req
)
.
then
(
res
=>
{
vm
.
$message
({
type
:
"info"
,
message
:
res
.
message
});
})
.
catch
(()
=>
{
vm
.
$message
({
type
:
"warning"
,
message
:
res
.
message
});
})
},
},
//切换tabs
//切换tabs
handleClickTabs
(
tab
,
event
)
{
handleClickTabs
(
tab
,
event
)
{
// this.activeName = tab.name;
if
(
tab
.
name
==
'second'
)
{
this
.
setRegion
();
}
},
},
// 模板列表选中
// 模板列表选中
checkFn
(
id
)
{
checkFn
(
id
)
{
...
@@ -149,7 +227,13 @@ export default {
...
@@ -149,7 +227,13 @@ export default {
.
then
(
res
=>
{
.
then
(
res
=>
{
closeLoading
(
vm
);
closeLoading
(
vm
);
if
(
res
.
code
==
"000000"
)
{
if
(
res
.
code
==
"000000"
)
{
console
.
log
()
if
(
res
.
data
.
status
==
0
)
{
return
true
;
}
else
{
this
.
dialogObj
=
Object
.
assign
(
this
.
dialogObj
,
this
.
statusObj
[
`status_
${
res
.
data
.
status
}
`
]);
this
.
dialogObj
.
visible
=
true
;
return
false
;
}
}
else
{
}
else
{
vm
.
$message
.
info
(
res
.
message
);
vm
.
$message
.
info
(
res
.
message
);
}
}
...
@@ -159,12 +243,21 @@ export default {
...
@@ -159,12 +243,21 @@ export default {
vm
.
$message
.
warning
(
'请稍后重试'
);
vm
.
$message
.
warning
(
'请稍后重试'
);
});
});
},
},
// 设定行政范围和设定机构范围相互影响
// 隐藏弹框
setRegion
(
r
)
{
hide
()
{
this
.
r
=
r
;
this
.
dialogObj
.
visible
=
false
;
console
.
log
(
'===================================='
);
},
console
.
log
(
r
);
// 获取行政范围
console
.
log
(
'===================================='
);
setRegion
()
{
this
.
getOrganizationList
(
this
.
$refs
.
selectRegion
.
getScope
());
},
// 查询行政范围的设定机构列表
getOrganizationList
(
r
)
{
this
.
$refs
.
setOrganization
.
getOrganization
(
r
);
},
// 返回选择模板页
backSelectVue
()
{
this
.
active
=
0
;
}
}
}
}
}
}
...
@@ -240,6 +333,19 @@ export default {
...
@@ -240,6 +333,19 @@ export default {
color
:
#449284
;
color
:
#449284
;
border
:
1px
solid
#449284
!
important
;
border
:
1px
solid
#449284
!
important
;
}
}
.dis-btn
{
width
:
78px
;
height
:
34px
;
background
:rgba
(
240
,
242
,
245
,
1
)
;
border-radius
:
3px
;
font-size
:
14px
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-weight
:
400
;
color
:rgba
(
144
,
147
,
153
,
1
)
;
line-height
:
34px
;
text-align
:
center
;
cursor
:
pointer
;
}
}
}
.add-content
{
.add-content
{
background
:
#fff
;
background
:
#fff
;
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录