|
@@ -20,6 +20,17 @@
|
|
:item="item"
|
|
:item="item"
|
|
:key="item.id"
|
|
:key="item.id"
|
|
@updata="updataData"/>
|
|
@updata="updataData"/>
|
|
|
|
+ <template
|
|
|
|
+ v-if="item.controlType == 3"
|
|
|
|
+ v-for="(part,index) in item.questionDetailList"
|
|
|
|
+ >
|
|
|
|
+ <MultiLineInput
|
|
|
|
+ v-if="item.controlType == 3"
|
|
|
|
+ :msg="part.description||part.name"
|
|
|
|
+ :part="part"
|
|
|
|
+ @updata="updataData($event,item)"
|
|
|
|
+ ></MultiLineInput>
|
|
|
|
+ </template>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -28,6 +39,7 @@ import Radio from '../common/Radio.vue';
|
|
import CheckBox from '../common/CheckBox.vue';
|
|
import CheckBox from '../common/CheckBox.vue';
|
|
import Input from '../common/Input.vue';
|
|
import Input from '../common/Input.vue';
|
|
import ComTextArea from '../common/ComTextArea.vue';
|
|
import ComTextArea from '../common/ComTextArea.vue';
|
|
|
|
+import MultiLineInput from '../common/MultiLineInput.vue';
|
|
import {patt} from '@utils/tools.js'
|
|
import {patt} from '@utils/tools.js'
|
|
// 将获取到的数据源转换成私有数据,处理选择事件。点击完成后统一存到store中,便于回读
|
|
// 将获取到的数据源转换成私有数据,处理选择事件。点击完成后统一存到store中,便于回读
|
|
export default {
|
|
export default {
|
|
@@ -46,16 +58,38 @@ import {patt} from '@utils/tools.js'
|
|
Radio,
|
|
Radio,
|
|
CheckBox,
|
|
CheckBox,
|
|
Input,
|
|
Input,
|
|
- ComTextArea
|
|
|
|
|
|
+ ComTextArea,
|
|
|
|
+ MultiLineInput
|
|
},
|
|
},
|
|
methods:{
|
|
methods:{
|
|
- updataData(data){
|
|
|
|
|
|
+ updataData(data,item){
|
|
const origMapping = this.datas.questionMapping;
|
|
const origMapping = this.datas.questionMapping;
|
|
let mapping = this.checkDatas.questionMapping;
|
|
let mapping = this.checkDatas.questionMapping;
|
|
for(let i in origMapping){
|
|
for(let i in origMapping){
|
|
- if(origMapping[i].id==data.id){
|
|
|
|
- mapping.splice(i,1,data)
|
|
|
|
|
|
+ if(data.controlType==3){//多列类型多一层
|
|
|
|
+ if(mapping[i].id == item.id){
|
|
|
|
+ mapping[i].value = '';
|
|
|
|
+ mapping[i].valueP = '';
|
|
|
|
+ let detList = mapping[i].questionDetailList;
|
|
|
|
+ for(let k in detList){//替换
|
|
|
|
+ if(detList[k].id==data.id){
|
|
|
|
+ detList.splice(k,1,data)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for(let n in detList){//给父级赋值
|
|
|
|
+ if(detList[n].value){
|
|
|
|
+ mapping[i].value += detList[n].value+',';
|
|
|
|
+ mapping[i].valueP += detList[n].valueP+',';
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+ if(origMapping[i].id==data.id){
|
|
|
|
+ mapping.splice(i,1,data)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
// 实时更新清空样式
|
|
// 实时更新清空样式
|
|
if(data.value){
|
|
if(data.value){
|