优化标签小票打印

This commit is contained in:
gyq
2024-06-24 16:43:54 +08:00
parent 408e0e44c4
commit 87627e7b35
13 changed files with 220 additions and 318 deletions

View File

@@ -1,10 +1,17 @@
<template>
<div class="left_menu_wrap">
<div class="item online">
<div class="item" :class="{ online: socketStore.online }" @click="connectWsHandle">
<el-icon class="icon">
<Monitor />
</el-icon>
<el-text type="success">在线</el-text>
<el-text :type="socketStore.online ? 'success' : ''">
<template v-if="socketStore.online">
在线
</template>
<template v-else>
离线
</template>
</el-text>
</div>
<router-link class="item" :class="{ active: route.path == item.path }" v-for="item in menus" :key="item.path"
:to="item.path">
@@ -29,9 +36,14 @@
<script setup>
import { ref } from 'vue'
import { useRoute } from 'vue-router'
import { useSocket } from '@/store/socket.js'
import more from '@/components/more.vue'
import callNumber from './callNumber.vue'
const emits = defineEmits(['connectWsHandle'])
const socketStore = useSocket()
const route = useRoute()
const moreref = ref(null)
const callNumberRef = ref(null)
@@ -82,6 +94,12 @@ function openCall() {
callNumberRef.value.show()
}
// 手动重新连接ws
function connectWsHandle() {
if (socketStore.online) return
emits('connectWsHandle')
}
defineExpose({
updateCallNumber
})