pengjun 2 months ago
parent
commit
44fb416aab
  1. 78
      src/components/common/CommonTab.vue
  2. 14
      src/components/doctorCheck/CheckItemList.vue
  3. 2
      src/components/doctorCheck/CheckPicture.vue

78
src/components/common/CommonTab.vue

@ -1,43 +1,20 @@
<template>
<div class="tags-list" ref="totalLists">
<div
class="arrow-icon"
@click="arrowBack"
style="position: fixed; left: 4px"
>
<el-button
size="medium"
icon="el-icon-arrow-left"
:disabled="isLeftDisabled"
></el-button>
<el-button icon="el-icon-delete" size="medium" :disabled="tags.length==0" @click="clearControlLabel"></el-button>
<div class="arrow-icon" @click="arrowBack" style="position: fixed; left: 4px">
<el-button size="medium" icon="el-icon-arrow-left" :disabled="isLeftDisabled"></el-button>
<el-button icon="el-icon-delete" size="medium" :disabled="tags.length == 0" @click="clearControlLabel"></el-button>
</div>
<div class="tag-style" ref="tagBox">
<div class="scrollWrapper" ref="scrollWrapper" id="nav">
<el-tag
:key="tag.displayName"
size="medium"
v-for="(tag, index) in tags"
:closable="true"
:disable-transitions="false"
@close="handleClose(tag, index)"
@click="changeMenu(tag)"
:effect="$route.name === tag.displayName ? 'dark' : 'plain'"
>
<el-tag :key="tag.displayName" size="medium" v-for="(tag, index) in tags" :closable="true"
:disable-transitions="false" @close="handleClose(tag, index)" @click="changeMenu(tag)"
:effect="$route.name === tag.displayName ? 'dark' : 'plain'">
{{ tag.displayName }}
</el-tag>
</div>
</div>
<div
class="arrow-icon"
@click="arrowForward"
style="position: fixed; right: 4px"
>
<el-button
size="medium"
icon="el-icon-arrow-right"
:disabled="isRightDisabled"
></el-button>
<div class="arrow-icon" @click="arrowForward" style="position: fixed; right: 4px">
<el-button size="medium" icon="el-icon-arrow-right" :disabled="isRightDisabled"></el-button>
</div>
</div>
</template>
@ -138,14 +115,14 @@ export default {
// effect'dark'
const scrollWrapper = this.$refs.scrollWrapper;
const tagElements = scrollWrapper.querySelectorAll('.el-tag');
//
let activeTag = null;
for (let i = 0; i < tagElements.length; i++) {
const tagElement = tagElements[i];
//
const tagText = tagElement.textContent ? tagElement.textContent.trim() : '';
//
if (tagText === this.$route.name) {
activeTag = tagElement;
@ -155,14 +132,14 @@ export default {
if (activeTag) {
const tagPosition = activeTag.offsetLeft;
const tagWidth = activeTag.offsetWidth;
// 使
const scrollTo = tagPosition - (scrollWrapper.clientWidth - tagWidth) / 2;
scrollWrapper.scrollTo({
left: scrollTo,
behavior: 'smooth'
});
//
setTimeout(() => {
this.debouncedUpdateButtonStates();
@ -170,15 +147,34 @@ export default {
}
});
},
handleClose(tag, index) {
let length = this.tags.length - 1;
this.close(tag);
// add by pengj 2026-02-26
if (tag?.displayName == "体检医生诊台" && this.$peisAPI) {
console.log("CommonTab.handleClose", tag)
try {
//
this.$peisAPI.removeAllListeners("event-from-picture-hot-key-main")
this.$peisAPI.removeAllListeners("event-from-picture-and-print-hot-key-main")
this.$peisAPI.removeAllListeners("event-from-picture-print-hot-key-main")
this.$peisAPI.removeAllListeners("event-from-picture-cancel-print-hot-key-main")
this.$peisAPI.removeAllListeners("event-from-picture-delete-hot-key-main")
//
this.$peisAPI.removeAllListeners("serial:data")
} catch (error) {
console.error(error)
}
}
//
if (tag.displayName !== this.$route.name) {
this.handleScroll();
return;
}
//
if (index === length) {
if (this.tags[index - 1]) {
@ -238,6 +234,7 @@ export default {
<style scoped lang="scss">
@import '../../assets/css/global_button.css';
.tags-list {
display: flex;
align-items: center;
@ -250,6 +247,7 @@ export default {
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04);
padding-bottom: 0;
}
.tag-style {
display: flex;
align-items: center;
@ -259,36 +257,44 @@ export default {
position: relative;
margin: 0 64px 0 138px;
}
.scrollWrapper {
display: flex;
align-items: center;
overflow-x: auto;
transition: all 500ms linear;
}
.scrollWrapper::-webkit-scrollbar {
height: 0;
}
.el-tag {
margin: 0 5px;
cursor: pointer;
padding: 0 0px 0 10px;
}
.el-tag .el-tag--info {
background: #fff;
}
::v-deep .el-tag .el-icon-close {
right: 0px;
}
.arrow-icon {
pointer-events: all;
cursor: pointer;
}
.arrow-style {
font-size: 16px;
padding: 0 8px;
position: relative;
top: 8px;
}
.arrow-icon .el-button {
padding: 0px 5px;
height: 28px;

14
src/components/doctorCheck/CheckItemList.vue

@ -313,7 +313,7 @@ export default {
this.onContextMenuDIY(data)
});
//
//
this.$peisAPI.onSerialData((data) => {
this.onSerialData(data)
});
@ -328,6 +328,18 @@ export default {
this.userInfo.user = window.sessionStorage.getItem("user") || null;
},
//
beforeDestroy(){
if (this.$peisAPI) {
try {
//
this.$peisAPI.removeAllListeners("serial:data")
} catch (error) {
console.error(error)
}
}
},
computed: {
...mapState([
"window",

2
src/components/doctorCheck/CheckPicture.vue

@ -324,7 +324,9 @@ export default {
//
beforeDestroy(){
if (this.$peisAPI) {
console.log('采图 beforeDestroy')
try {
//
this.$peisAPI.removeAllListeners("event-from-picture-hot-key-main")
this.$peisAPI.removeAllListeners("event-from-picture-and-print-hot-key-main")
this.$peisAPI.removeAllListeners("event-from-picture-print-hot-key-main")

Loading…
Cancel
Save