|
@@ -153,6 +153,24 @@ export default {
|
|
// if(this.manualJson.filter(i=>i.type==6).length>=1){
|
|
// if(this.manualJson.filter(i=>i.type==6).length>=1){
|
|
// return this.$message.error("一个表单只能添加一个课程组件");
|
|
// return this.$message.error("一个表单只能添加一个课程组件");
|
|
// }
|
|
// }
|
|
|
|
+ function checkType(obj){
|
|
|
|
+ if(obj.filter(i=>i.array).length>0){
|
|
|
|
+ let bol = false;
|
|
|
|
+ obj.forEach(i=>{
|
|
|
|
+ console.log(i.array)
|
|
|
|
+ if(bol)return;
|
|
|
|
+ bol = checkType(i.array);
|
|
|
|
+ })
|
|
|
|
+ return bol;
|
|
|
|
+ }else if(obj.filter(i=>i.type==6).length>=1){
|
|
|
|
+ return true;
|
|
|
|
+ }else{
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(topicType == 6 && checkType(this.manualJson)){
|
|
|
|
+ return this.$message.error("一个表单只能添加一个课程组件");
|
|
|
|
+ }
|
|
if (this.manualJson.length > 0) {
|
|
if (this.manualJson.length > 0) {
|
|
for (var i = 0; i < this.manualJson.length; i++) {
|
|
for (var i = 0; i < this.manualJson.length; i++) {
|
|
if (this.manualJson[i].ttype == 2) {
|
|
if (this.manualJson[i].ttype == 2) {
|