提交 e3572d54 编写于 作者: guangjun.yang's avatar guangjun.yang

Merge branch 'dev-completedCtr-20191109' into release

* dev-completedCtr-20191109:
  完成度控制去掉权限判断
  教培项目编辑项目基本信息提交新增字段
  教培项目中选择项目组件添加学习时长控制
......@@ -756,6 +756,14 @@
>{{tag.name}}</el-tag>
</el-col>
</el-form-item>
<el-form-item label="学习时长控制:" class="time-contrl">
<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 :label="1">是(则项目中各课程须达到课程配置中的观看时长要求才允许通过)</el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-col>
</el-form-item>
<el-form-item label="配置证书:">
<el-col :span="10">
<el-radio-group class="el-configure" v-model="formComponent.configure" :disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6">
......@@ -871,6 +879,16 @@ export default {
callback();
}
};
let checkNormalInt = (rule, value, callback) => {
const val = parseFloat(value);
const isInteger = Number.isInteger(val);
// if((isInteger && val > 0) || checkNeedRule(val)){
if( !value || (isInteger && val >= 0 && val <= 100) ){
callback()
}else{
callback(new Error(`请输入0~100正整数`))
}
}
return {
idTypeValue: 1,
idTypeProject: '',
......@@ -1035,7 +1053,8 @@ export default {
formComponent: {
component: [],
configure: 2,
certificate: ""
certificate: "",
courseRequire: 0, //0:不控制 1:按课程时长配置要求
},
tagsComponent: [],
projectStatus: "",
......@@ -1121,7 +1140,10 @@ export default {
],
certificate: [
{ required: true, message: "请选择证书", trigger: "change" }
]
],
visitTime: [
{required: false, trigger: "change", validator: checkNormalInt,}
],
},
rules: {
projectName: [
......@@ -1324,6 +1346,7 @@ export default {
this.setEditData(editData);
this.idTypeProject = res.data.projectData.idType;
this.projectStatus = res.data.projectData.projectStatus;
this.formComponent.courseRequire = res.data.projectData.courseRequire || 0;
// this.status4Flag = res.data.projectData.status4Flag;
if (this.projectStatus == 1) {
this.showStorage = true;
......@@ -1389,6 +1412,7 @@ export default {
//编辑
projectModel.id = this.formData.id;
projectModel.projectStatus = this.projectStatus;
projectModel.courseRequire = this.formComponent.courseRequire; //课程完成度控制
for (let i = 0; i < attachmentModel.length; i++) {
attachmentModel[i].portalProjectId = this.formData.id;
}
......@@ -1506,6 +1530,7 @@ export default {
status: this.projectStatus,
certificateType: this.formExam.certificateType,
getCertificateRule: [],
courseRequire: this.formComponent.courseRequire,
};
// console.log('排序后',vm.tagsComponent,'param',param);
if(this.formComponent.configure == 1) {
......@@ -3874,9 +3899,23 @@ export default {
position: absolute;
z-index: 999;
}
.el-time-ctr{
.el-radio{
display: block;
padding: 10px 0;
}
}
.el-configure {
width: 200px;
}
.time-contrl{
.el-input__inner{
padding-right: 0;
}
.el-input-group__append{
padding: 0 8px;
}
}
}
}
</style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册