|
|
|
@ -1,8 +1,8 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div @contextmenu.prevent="onContextmenu"> |
|
|
|
<el-table :data="doctorCheck.checkItemList" style="width: 100%" :height="itemTableHeight" border highlight-current-row |
|
|
|
@row-click="itemRowClick" @row-dblclick="itemDblClick" size="small"> |
|
|
|
<el-table :data="doctorCheck.checkItemList" style="width: 100%" :height="itemTableHeight" border |
|
|
|
highlight-current-row @row-click="itemRowClick" @row-dblclick="itemDblClick" size="small"> |
|
|
|
<el-table-column prop="itemName" label="项目" min-width="160" /> |
|
|
|
<el-table-column prop="result" label="结果" min-width="420"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
@ -1099,7 +1099,9 @@ export default { |
|
|
|
// 点击时全选结果 |
|
|
|
input.addEventListener("click", (event) => { |
|
|
|
if (this.LocalConfig.doctorCheck.isSelectAll == 'Y') { |
|
|
|
input.select(); |
|
|
|
// 仅限控制 明细结果全选 |
|
|
|
//input.select(); |
|
|
|
if(input.getAttribute('placeholder') == "请输入结果值") input.select(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
@ -1122,6 +1124,7 @@ export default { |
|
|
|
this.selection.end = this.selection.start; |
|
|
|
//console.log('插入结果后光标',this.selection) |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取光标位置的函数 |
|
|
|
getCaretPosition() { |
|
|
|
let input = document.getElementById("resultBox"); |
|
|
|
@ -1134,15 +1137,21 @@ export default { |
|
|
|
this.$nextTick(() => { |
|
|
|
let that = this; |
|
|
|
let resultBox = document.getElementById("resultBox"); //用数组可以读取多个标签的元素 //.inline-input |
|
|
|
|
|
|
|
|
|
|
|
// 绑定键盘事件到文本框 |
|
|
|
resultBox.addEventListener("click", function (event) { |
|
|
|
event.preventDefault(); |
|
|
|
// 手动聚焦 |
|
|
|
event.target.focus() |
|
|
|
// 获取光标位置 |
|
|
|
that.getCaretPosition(); |
|
|
|
}); |
|
|
|
|
|
|
|
resultBox.addEventListener("input", function (event) { |
|
|
|
event.preventDefault(); |
|
|
|
// 手动聚焦 |
|
|
|
event.target.focus() |
|
|
|
// 获取光标位置 |
|
|
|
that.getCaretPosition(); |
|
|
|
}); |
|
|
|
|