|
@@ -9,7 +9,7 @@
|
|
@click="selectResult(item,idx)"
|
|
@click="selectResult(item,idx)"
|
|
>
|
|
>
|
|
<span v-if="((item.description||item.name).indexOf('${'))==-1">{{item.description||item.name}}</span>
|
|
<span v-if="((item.description||item.name).indexOf('${'))==-1">{{item.description||item.name}}</span>
|
|
- <OptionInp v-else :item="item" @handleInp="inpVal($event,idx)" @handleSelec="handleClick(item,idx,false,true)"/>
|
|
|
|
|
|
+ <OptionInp v-else :item="item" @handleInp="inpVal" :inx="idx" @handleSelec="handleClick(item,idx,false,true)"/>
|
|
</li>
|
|
</li>
|
|
</ul>
|
|
</ul>
|
|
<div :class="sure?'realSure sure':'sure'" @click="makeSuer">
|
|
<div :class="sure?'realSure sure':'sure'" @click="makeSuer">
|
|
@@ -20,7 +20,7 @@
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import OptionInp from '../common/OptionInp.vue';
|
|
import OptionInp from '../common/OptionInp.vue';
|
|
- import {concatVal} from '../utils/tools.js';
|
|
|
|
|
|
+ import {concatVal,getExpStr} from '../utils/tools.js';
|
|
export default {
|
|
export default {
|
|
props: ["symptomResult","num"],
|
|
props: ["symptomResult","num"],
|
|
data() {
|
|
data() {
|
|
@@ -63,11 +63,6 @@ export default {
|
|
let detailList = this.result;
|
|
let detailList = this.result;
|
|
let currItem = detailList[index];
|
|
let currItem = detailList[index];
|
|
currItem.value = val;
|
|
currItem.value = val;
|
|
- // 输入框失焦重新拼接父级的value
|
|
|
|
- let temp = concatVal(detailList);
|
|
|
|
- /*this.datas.value = temp.value;
|
|
|
|
- this.datas.valueP = temp.valueP;
|
|
|
|
- this.$emit("updata",this.datas);*/
|
|
|
|
},
|
|
},
|
|
handleClick(it,index,flg,ipt){
|
|
handleClick(it,index,flg,ipt){
|
|
if(flg){
|
|
if(flg){
|
|
@@ -77,8 +72,7 @@ export default {
|
|
document.activeElement.scrollIntoViewIfNeeded(true);
|
|
document.activeElement.scrollIntoViewIfNeeded(true);
|
|
},300)
|
|
},300)
|
|
}
|
|
}
|
|
- const list = this.datas;
|
|
|
|
- let data = list.questionDetailList&&list.questionDetailList.slice(0); //数组深拷贝
|
|
|
|
|
|
+ /*let data = it.questionDetailList&&it.questionDetailList.slice(0); //数组深拷贝
|
|
if(ipt){//输入框单选,输入了内容才算选中,删除内容算取消
|
|
if(ipt){//输入框单选,输入了内容才算选中,删除内容算取消
|
|
for(let i=0;i<data.length; i++){
|
|
for(let i=0;i<data.length; i++){
|
|
if(i==index){
|
|
if(i==index){
|
|
@@ -94,19 +88,25 @@ export default {
|
|
}else{
|
|
}else{
|
|
data[i].select = 0
|
|
data[i].select = 0
|
|
}
|
|
}
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
+ /*}
|
|
let temp = concatVal(data);
|
|
let temp = concatVal(data);
|
|
const newData = Object.assign({},this.datas,{questionDetailList:data,value:temp.value,valueP:temp.valueP});
|
|
const newData = Object.assign({},this.datas,{questionDetailList:data,value:temp.value,valueP:temp.valueP});
|
|
- this.$emit("updata",newData);
|
|
|
|
|
|
+ this.$emit("updata",newData);*/
|
|
},
|
|
},
|
|
makeSuer() {
|
|
makeSuer() {
|
|
if(!this.sure){return}
|
|
if(!this.sure){return}
|
|
let result = this.result;
|
|
let result = this.result;
|
|
let number = this.numPlus,tmpResult='';
|
|
let number = this.numPlus,tmpResult='';
|
|
for (let i = 0; i < result.length; i++) {
|
|
for (let i = 0; i < result.length; i++) {
|
|
|
|
+ const text=result[i].description||result[i].name;
|
|
|
|
+ const msg = getExpStr(text);
|
|
if(result[i].select){
|
|
if(result[i].select){
|
|
- tmpResult=result[i].description||result[i].name
|
|
|
|
|
|
+ if(result[i].name.indexOf("${input")!==-1){
|
|
|
|
+ tmpResult=msg.prefix+(result[i].value||"")+msg.suffix;
|
|
|
|
+ }else{
|
|
|
|
+ tmpResult=text
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.contentResult = tmpResult;
|
|
this.contentResult = tmpResult;
|
|
@@ -114,8 +114,8 @@ export default {
|
|
},
|
|
},
|
|
selectResult(item,idx) {
|
|
selectResult(item,idx) {
|
|
const { select } = item;
|
|
const { select } = item;
|
|
- let result = JSON.parse(JSON.stringify(this.result))
|
|
|
|
- if (select) {//判断是否选中,选中的取消,关联id删除,未选中判断是否互斥
|
|
|
|
|
|
+ let result = JSON.parse(JSON.stringify(this.result));
|
|
|
|
+ if (select) {//判断是否选中,选中的取消,关联id删除
|
|
for (let i = 0; i < result.length; i++) {
|
|
for (let i = 0; i < result.length; i++) {
|
|
if(i == idx){
|
|
if(i == idx){
|
|
result[i].select = false
|
|
result[i].select = false
|
|
@@ -124,8 +124,11 @@ export default {
|
|
}else{
|
|
}else{
|
|
for (let i = 0; i < result.length; i++) {
|
|
for (let i = 0; i < result.length; i++) {
|
|
if(i == idx){
|
|
if(i == idx){
|
|
- result[i].select = true
|
|
|
|
|
|
+ result[i].select = true;
|
|
}else{
|
|
}else{
|
|
|
|
+ /*if(result[i].name.indexOf("${input")!==-1){ //被取消的输入框有内容则
|
|
|
|
+
|
|
|
|
+ }*/
|
|
result[i].select = false
|
|
result[i].select = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -155,15 +158,21 @@ export default {
|
|
margin: 0.15rem;
|
|
margin: 0.15rem;
|
|
float: left;
|
|
float: left;
|
|
color: #666;
|
|
color: #666;
|
|
- &.noBorder{
|
|
|
|
- border: none;
|
|
|
|
- width: 100%;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
.liSelect {
|
|
.liSelect {
|
|
color: #fff;
|
|
color: #fff;
|
|
background-color: #colors[btn];
|
|
background-color: #colors[btn];
|
|
border-color: #colors[btn];
|
|
border-color: #colors[btn];
|
|
}
|
|
}
|
|
|
|
+ .noBorder{
|
|
|
|
+ border: none;
|
|
|
|
+ width: 100%;
|
|
|
|
+ &.liSelect{
|
|
|
|
+ background: none;
|
|
|
|
+ span{
|
|
|
|
+ color: #DFE0E4;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|