|
@@ -173,9 +173,13 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
|
|
},
|
|
},
|
|
clearData(){//清空
|
|
clearData(){//清空
|
|
const datas = this.checkDatas.questionMapping;
|
|
const datas = this.checkDatas.questionMapping;
|
|
|
|
+ let reqFlag = false;//必填项标识
|
|
for(let i in datas){
|
|
for(let i in datas){
|
|
datas[i].value = "";
|
|
datas[i].value = "";
|
|
datas[i].valueP = "";
|
|
datas[i].valueP = "";
|
|
|
|
+ if(datas[i].required==1){
|
|
|
|
+ reqFlag = true;
|
|
|
|
+ }
|
|
let detaiList = datas[i].questionDetailList;
|
|
let detaiList = datas[i].questionDetailList;
|
|
if(detaiList.length>0){
|
|
if(detaiList.length>0){
|
|
for(let k in detaiList){
|
|
for(let k in detaiList){
|
|
@@ -193,8 +197,13 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
|
|
if(this.checkDatas.select ==1){return}
|
|
if(this.checkDatas.select ==1){return}
|
|
let msg = this.checkDatas.name;
|
|
let msg = this.checkDatas.name;
|
|
let msgP = (this.checkDatas.description||this.checkDatas.name);
|
|
let msgP = (this.checkDatas.description||this.checkDatas.name);
|
|
- // 没有点过完成直接选择然后清空,外层不会处于选中状态,故添加{select:1}
|
|
|
|
- this.$store.commit('setDatas',{data:Object.assign({},this.checkDatas,{select:1}),pId:this.checkDatas.id,type:this.data.moduleType,ppId:this.data.ppId});
|
|
|
|
|
|
+ // 没有点过完成直接选择然后清空,外层不会处于选中状态,故没有必填项时添加{select:1}
|
|
|
|
+ if(reqFlag){
|
|
|
|
+ this.$store.commit('setDatas',{data:this.checkDatas,pId:this.checkDatas.id,type:this.data.moduleType,ppId:this.data.ppId});
|
|
|
|
+ }else{
|
|
|
|
+ this.$store.commit('setDatas',{data:Object.assign({},this.checkDatas,{select:1}),pId:this.checkDatas.id,type:this.data.moduleType,ppId:this.data.ppId});
|
|
|
|
+ }
|
|
|
|
+
|
|
this.$store.commit('setText',{text:msg,textP:msgP,pId:this.checkDatas.id,type:this.data.moduleType,flag:true,order:this.data.order,arrFlag:true,index:this.data.index});
|
|
this.$store.commit('setText',{text:msg,textP:msgP,pId:this.checkDatas.id,type:this.data.moduleType,flag:true,order:this.data.order,arrFlag:true,index:this.data.index});
|
|
},
|
|
},
|
|
check(){// 校验是否有已填项
|
|
check(){// 校验是否有已填项
|