设备监控修改

This commit is contained in:
zhujiyan
2024-10-15 15:30:01 +08:00
parent 70666d4c86
commit a05cc2deab
8 changed files with 239 additions and 65 deletions

View File

@@ -40,7 +40,7 @@
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted, defineProps, defineExpose, onBeforeUnmount } from 'vue'
import { ref, onMounted, defineProps, defineExpose, onBeforeUnmount, inject } from 'vue'
import { getMakeUpData, getAskDirOrFile, offlineDataUploadMakeUp } from '@/api/cs-harmonic-boot/recruitment.ts'
import DatePicker from '@/components/form/datePicker/index.vue'
import { useRouter, useRoute } from 'vue-router'
@@ -141,7 +141,7 @@ const handleIntoDir = (row: any) => {
}
const mqttRef = ref()
const url: any = inject('MQTTURL')
const connectMqtt = () => {
if (mqttRef.value) {
if (mqttRef.value.connected) {
@@ -157,9 +157,6 @@ const connectMqtt = () => {
username: 't_user',
password: 'njcnpqs'
}
// 线上
// const url = 'wss://pqmcn.com:8087/mqtt'
const url = 'ws://192.168.1.24:8085/mqtt'
mqttRef.value = mqtt.connect(url, options)
}
connectMqtt()