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

Merge branch 'dev-completedCtr-20191109' into release

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