|
|
|
@ -834,32 +834,22 @@ export default { |
|
|
|
|
|
|
|
// 单击选择结果模版的结果 |
|
|
|
clickResult(item) { |
|
|
|
let result = []; |
|
|
|
let moreResult = this.moreResult.result || '' |
|
|
|
// console.log('this.moreResult',JSON.stringify(this.moreResult)) |
|
|
|
// console.log('item',item) |
|
|
|
//点击结果前 == 默认结果 |
|
|
|
if (this.moreResult.result == this.moreResult.defaultResult) { |
|
|
|
if (!moreResult || moreResult == this.moreResult.defaultResult ) { |
|
|
|
this.moreResult.result = item.result |
|
|
|
} else { |
|
|
|
|
|
|
|
if (this.moreResult.result) result = this.moreResult.result.split(";"); |
|
|
|
// 不用分隔符时,不判断包含关系 |
|
|
|
if (this.LocalConfig.doctorCheck.isSplitChooseResult == "Y" && result.indexOf(item.result) > -1) |
|
|
|
return; |
|
|
|
if (this.LocalConfig.doctorCheck.isSplitChooseResult == "Y" || result.length == 0) { |
|
|
|
result.push(item.result); |
|
|
|
} else { |
|
|
|
result[result.length - 1] = result[result.length - 1] + item.result; |
|
|
|
} |
|
|
|
|
|
|
|
let ret = ""; |
|
|
|
result.forEach((e, i) => { |
|
|
|
let splitStr = ";"; |
|
|
|
if (i == 0) splitStr = ""; |
|
|
|
ret += splitStr + e; |
|
|
|
}); |
|
|
|
this.moreResult.result = ret; |
|
|
|
this.selection.start = length(item.result) - 1 |
|
|
|
this.selection.end = this.selection.start |
|
|
|
}else if(moreResult.includes(item.result)){ |
|
|
|
// 结果包含已选时,不作处理 |
|
|
|
}else { |
|
|
|
let choosedResult = item.result |
|
|
|
if(this.LocalConfig.doctorCheck.isSplitChooseResult == 'Y') choosedResult = ';' + choosedResult |
|
|
|
this.insertSymbols(choosedResult) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 清除结果值 |
|
|
|
@ -1111,7 +1101,7 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 光标位置插入特殊符号 |
|
|
|
// 光标位置插入特殊符号(插入结果) |
|
|
|
insertSymbols(symbols) { |
|
|
|
let result = this.moreResult.result || ""; |
|
|
|
if (result) { |
|
|
|
@ -1123,8 +1113,8 @@ export default { |
|
|
|
result = symbols; |
|
|
|
} |
|
|
|
this.moreResult.result = result; |
|
|
|
this.selection.start++; |
|
|
|
this.selection.end++; |
|
|
|
this.selection.start = this.selection.start + length(symbols); |
|
|
|
this.selection.end = this.selection.start; |
|
|
|
}, |
|
|
|
// 获取光标位置的函数 |
|
|
|
getCaretPosition() { |
|
|
|
|