pengjun 12 hours ago
parent
commit
95986d4724
  1. 53
      src/components/doctorCheck/CheckItemList.vue

53
src/components/doctorCheck/CheckItemList.vue

@ -1,8 +1,8 @@
<template> <template>
<div> <div>
<div @contextmenu.prevent="onContextmenu"> <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="itemName" label="项目" min-width="160" />
<el-table-column prop="result" label="结果" min-width="420"> <el-table-column prop="result" label="结果" min-width="420">
<template slot-scope="scope"> <template slot-scope="scope">
@ -90,7 +90,7 @@
overflow-y: auto; overflow-y: auto;
height: 300px; height: 300px;
width: 100%; width: 100%;
display: ${LocalConfig.doctorCheck.resultModeDisp||'flex'};
display: ${LocalConfig.doctorCheck.resultModeDisp || 'flex'};
flex-wrap: wrap; flex-wrap: wrap;
align-content: flex-start;` align-content: flex-start;`
"> ">
@ -193,7 +193,7 @@ export default {
components: { components: {
PacsTemplate, PacsTemplate,
}, },
props: ["isCheckPicture", "registerCheckId", "doctor_check_check_charge","refParams"],
props: ["isCheckPicture", "registerCheckId", "doctor_check_check_charge", "refParams"],
data() { data() {
return { return {
pagePriv: { pagePriv: {
@ -228,7 +228,7 @@ export default {
currentRow: -1, // currentRow: -1, //
dialogWinMoreResult: false, dialogWinMoreResult: false,
dialogWinMoreResultTimes:0, //
dialogWinMoreResultTimes: 0, //
dialogWinPacsTemplate: false, dialogWinPacsTemplate: false,
moreResult: { moreResult: {
data: [], data: [],
@ -266,8 +266,8 @@ export default {
isSelectAll: 'N', // isSelectAll: 'N', //
pacsDescFontSize: "14px", // pacsDescFontSize: "14px", //
isSplitChooseResult: "Y", // isSplitChooseResult: "Y", //
hisItemRight:0, //
resultModeDisp:'flex', // flex block
hisItemRight: 0, //
resultModeDisp: 'flex', // flex block
} }
}, },
@ -334,7 +334,7 @@ export default {
}, },
// //
beforeDestroy(){
beforeDestroy() {
if (this.$peisAPI) { if (this.$peisAPI) {
try { try {
// //
@ -757,14 +757,14 @@ export default {
this.moreResult.result = row.result; this.moreResult.result = row.result;
this.moreResult.defaultResult = row.defaultResult; this.moreResult.defaultResult = row.defaultResult;
this.moreResult.index = index; this.moreResult.index = index;
if(!row?.result){
if (!row?.result) {
this.selection.start = 0 this.selection.start = 0
this.selection.end = 0 this.selection.end = 0
}else{
} else {
this.selection.start = row.result.length this.selection.start = row.result.length
this.selection.end = row.result.length this.selection.end = row.result.length
} }
console.log('显示模板初始光标',this.selection)
console.log('显示模板初始光标', this.selection)
// "itemId": "3a0c517f-cbdb-9fff-e300-1f76b3e47580", // "itemId": "3a0c517f-cbdb-9fff-e300-1f76b3e47580",
// "result": "00000", // "result": "00000",
// "diagnosisId": "3a0ed8a2-72d9-ee50-78aa-5b1f474f2921", // "diagnosisId": "3a0ed8a2-72d9-ee50-78aa-5b1f474f2921",
@ -776,7 +776,7 @@ export default {
this.dialogWinMoreResult = true; this.dialogWinMoreResult = true;
// //
if(this.dialogWinMoreResultTimes == 0){
if (this.dialogWinMoreResultTimes == 0) {
this.watchSelection(); this.watchSelection();
this.dialogWinMoreResultTimes++ // this.dialogWinMoreResultTimes++ //
} }
@ -830,21 +830,21 @@ export default {
// //
clickResult(item) { clickResult(item) {
let moreResult = this.moreResult.result || '' let moreResult = this.moreResult.result || ''
let resultIsNum = /^[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?$/.test(item.result);
let resultIsNum = /^[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?$/.test(item.result);
// console.log('this.moreResult',JSON.stringify(this.moreResult)) // console.log('this.moreResult',JSON.stringify(this.moreResult))
// console.log('item',item) // console.log('item',item)
// == // ==
if (!moreResult || moreResult == this.moreResult.defaultResult ) {
if (!moreResult || moreResult == this.moreResult.defaultResult) {
this.moreResult.result = item.result this.moreResult.result = item.result
this.selection.start = item?.result.length||0
this.selection.start = item?.result.length || 0
this.selection.end = this.selection.start this.selection.end = this.selection.start
console.log('=默认结果光标',this.selection)
}else if(moreResult.includes(item.result) && !resultIsNum){
console.log('=默认结果光标', this.selection)
} else if (moreResult.includes(item.result) && !resultIsNum) {
// //
}else {
} else {
let choosedResult = item.result let choosedResult = item.result
if(this.LocalConfig.doctorCheck.isSplitChooseResult == 'Y') choosedResult = ';' + choosedResult
if (this.LocalConfig.doctorCheck.isSplitChooseResult == 'Y') choosedResult = ';' + choosedResult
this.insertSymbols(choosedResult) this.insertSymbols(choosedResult)
} }
@ -993,7 +993,7 @@ export default {
} }
// //
if(i == 0){
if (i == 0) {
this.itemRowClick(e) this.itemRowClick(e)
} }
}); });
@ -1099,7 +1099,9 @@ export default {
// //
input.addEventListener("click", (event) => { input.addEventListener("click", (event) => {
if (this.LocalConfig.doctorCheck.isSelectAll == 'Y') { if (this.LocalConfig.doctorCheck.isSelectAll == 'Y') {
input.select();
//
//input.select();
if(input.getAttribute('placeholder') == "请输入结果值") input.select();
} }
}); });
}); });
@ -1122,27 +1124,34 @@ export default {
this.selection.end = this.selection.start; this.selection.end = this.selection.start;
//console.log('',this.selection) //console.log('',this.selection)
}, },
// //
getCaretPosition() { getCaretPosition() {
let input = document.getElementById("resultBox"); let input = document.getElementById("resultBox");
this.selection.start = input.selectionStart; this.selection.start = input.selectionStart;
this.selection.end = input.selectionEnd; this.selection.end = input.selectionEnd;
console.log('点击后光标',this.selection)
console.log('点击后光标', this.selection)
}, },
watchSelection() { watchSelection() {
this.$nextTick(() => { this.$nextTick(() => {
let that = this; let that = this;
let resultBox = document.getElementById("resultBox"); // //.inline-input let resultBox = document.getElementById("resultBox"); // //.inline-input
// //
resultBox.addEventListener("click", function (event) { resultBox.addEventListener("click", function (event) {
event.preventDefault(); event.preventDefault();
//
event.target.focus()
// //
that.getCaretPosition(); that.getCaretPosition();
}); });
resultBox.addEventListener("input", function (event) { resultBox.addEventListener("input", function (event) {
event.preventDefault(); event.preventDefault();
//
event.target.focus()
// //
that.getCaretPosition(); that.getCaretPosition();
}); });

Loading…
Cancel
Save