From 3932a3337b02dae0dd7b0a105ab9b84333113ca5 Mon Sep 17 00:00:00 2001 From: pengjun <158915633@qq.com> Date: Sun, 14 Apr 2024 18:11:48 +0800 Subject: [PATCH] doctor --- src/components/doctorCheck/CheckItemList.vue | 63 +++++++- src/components/doctorCheck/CheckSumSug.vue | 148 ++++++++++-------- .../doctorCheck/PatientRegisterBase.vue | 11 +- src/views/doctorCheck/doctorCheck.vue | 6 +- 4 files changed, 152 insertions(+), 76 deletions(-) diff --git a/src/components/doctorCheck/CheckItemList.vue b/src/components/doctorCheck/CheckItemList.vue index 8a3d0bb..22a2eba 100644 --- a/src/components/doctorCheck/CheckItemList.vue +++ b/src/components/doctorCheck/CheckItemList.vue @@ -30,7 +30,7 @@
- +
@@ -41,8 +41,17 @@
+
特殊符号:
+
+
+ + {{ item.displayName }} + +
+
录入结果:
-
@@ -92,6 +101,12 @@ export default { result: '', index: 0, // 明细序列 }, //结果模版 + + selection: { // 光标位置 + start: 0, end: 0 + }, + symbols:[], //特殊符号 + }; }, @@ -142,6 +157,13 @@ export default { }); } }) + + //获取结果状态提示数据 + getapi('/api/app/common-char/in-filter').then(res => { + if(res.code >= 0){ + this.symbols = res.data.items + } + }) }, // 颜色转换 @@ -308,6 +330,8 @@ export default { this.dialogWinMoreResult = true + this.watchSelection() + }, // 单击选择结果模版的结果 dblclickResult(item) { @@ -434,6 +458,41 @@ export default { }); }, + // 光标位置插入特殊符号 + insertSymbols(symbols){ + let result = this.moreResult.result||'' + if(result){ + result = result.substring(0,this.selection.start) + symbols + result.substring(this.selection.end) + }else{ + result = symbols + } + this.moreResult.result = result + this.selection.start++ + this.selection.end++ + }, + // 获取光标位置的函数 + getCaretPosition() { + let input = document.getElementById('resultBox'); + this.selection.start = input.selectionStart; + this.selection.end = input.selectionEnd; + // console.log('selection',this.selection) + }, + watchSelection() { + this.$nextTick(() => { + let that = this + let resultBox = document.getElementById('resultBox'); //用数组可以读取多个标签的元素 //.inline-input + // 绑定键盘事件到文本框 + resultBox.addEventListener('click', function (event) { + // 获取光标位置 + that.getCaretPosition() + }) + + resultBox.addEventListener('input', function (event) { + // 获取光标位置 + that.getCaretPosition() + }) + }) + }, }, //监听事件 diff --git a/src/components/doctorCheck/CheckSumSug.vue b/src/components/doctorCheck/CheckSumSug.vue index b749523..72ab4a1 100644 --- a/src/components/doctorCheck/CheckSumSug.vue +++ b/src/components/doctorCheck/CheckSumSug.vue @@ -1,28 +1,27 @@