修改mqtt连接方式
This commit is contained in:
29
src/App.vue
29
src/App.vue
@@ -7,15 +7,30 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
import useSetTheme from '@/utils/setTheme'
|
import useSetTheme from '@/utils/setTheme'
|
||||||
import { provide, getCurrentInstance } from 'vue'
|
import { provide, onMounted, ref } from 'vue'
|
||||||
//线上mqtt
|
//线上mqtt
|
||||||
// 27服务器项目使用的MQTT:ws://pqmcn.com:8073/mqtt
|
|
||||||
// 102服务器项目使用的MQTT:wss://pqmcn.com:8087/mqtt
|
let buildUrl = 'wss://pqmcn.com:8087/mqtt'//102
|
||||||
// let buildUrl = 'wss://pqmcn.com:8087/mqtt'//102
|
// let buildUrl = 'ws://pqmcn.com:8073/mqtt'//27
|
||||||
let buildUrl = 'ws://pqmcn.com:8073/mqtt'//27
|
|
||||||
|
|
||||||
|
// 从 Nginx 获取 MQTT URL
|
||||||
|
const fetchMqttUrl = async () => {
|
||||||
|
|
||||||
|
const response = await fetch('/')
|
||||||
|
const mqttUrl = response.headers.get('X-MQTT-URL')
|
||||||
|
|
||||||
|
window.localStorage.setItem('MQTTURL', mqttUrl || buildUrl)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//本地mqtt
|
//本地mqtt
|
||||||
let devUrl = 'ws://192.168.1.24:8085/mqtt'
|
// let devUrl = 'ws://192.168.1.24:8085/mqtt'
|
||||||
provide('MQTTURL', buildUrl)
|
|
||||||
|
onMounted(() => {
|
||||||
|
fetchMqttUrl()
|
||||||
|
})
|
||||||
|
// provide('MQTTURL', buildUrl.value)
|
||||||
useSetTheme()
|
useSetTheme()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1466,7 +1466,7 @@ export default {
|
|||||||
//minInterval: 1,
|
//minInterval: 1,
|
||||||
type: "value",
|
type: "value",
|
||||||
axisLine: {
|
axisLine: {
|
||||||
show: false,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: _this.DColor ? "#fff" : echartsColor.thread,
|
color: _this.DColor ? "#fff" : echartsColor.thread,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ export default {
|
|||||||
' 暂降(骤升)幅值:' +
|
' 暂降(骤升)幅值:' +
|
||||||
(featureAmplitude) +
|
(featureAmplitude) +
|
||||||
'% 持续时间:' +
|
'% 持续时间:' +
|
||||||
(this.boxoList.persistTime ? this.boxoList.persistTime.toFixed(2) : '-') +
|
(this.boxoList.persistTime || this.boxoList.evtParamTm || '-') +
|
||||||
's'
|
's'
|
||||||
} else {
|
} else {
|
||||||
this.titles =
|
this.titles =
|
||||||
|
|||||||
@@ -1,49 +1,46 @@
|
|||||||
const dataProcessing = (arr: any[]) => {
|
const dataProcessing = (arr: any[]) => {
|
||||||
return arr
|
return arr
|
||||||
.filter(item => typeof item == 'number' || (typeof item == 'string' && !isNaN(parseFloat(item))))
|
.filter(item => typeof item === 'number' || (typeof item === 'string' && !isNaN(parseFloat(item))))
|
||||||
.map(item => (typeof item == 'number' ? item : parseFloat(item)))
|
.map(item => (typeof item === 'number' ? item : parseFloat(item)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理y轴最大最小值
|
// 处理y轴最大最小值
|
||||||
export const yMethod = (arr: any) => {
|
export const yMethod = (arr: any) => {
|
||||||
const numList = dataProcessing(arr);
|
let numList = dataProcessing(arr)
|
||||||
const maxValue = Math.max(...numList);
|
let maxValue = 0
|
||||||
const minValue = Math.min(...numList);
|
let minValue = 0
|
||||||
|
let max = 0
|
||||||
const calculateBoundary = (value: number, base: number) => {
|
let min = 0
|
||||||
return Math[value > 0? 'ceil' : 'floor'](value / base) * base;
|
maxValue = Math.max(...numList)
|
||||||
};
|
minValue = Math.min(...numList)
|
||||||
|
|
||||||
let max: number;
|
|
||||||
let min: number;
|
|
||||||
if (maxValue > 1000 || minValue < -1000) {
|
if (maxValue > 1000 || minValue < -1000) {
|
||||||
max = calculateBoundary(maxValue, 100);
|
max = Math.ceil(maxValue / 100) * 100
|
||||||
min = minValue == 0? 0 : calculateBoundary(minValue, 100);
|
if (minValue == 0) {
|
||||||
} else if (maxValue < 60 && minValue > 40) {
|
min = 0
|
||||||
max = 60;
|
} else {
|
||||||
min = 40;
|
min = Math.floor(minValue / 100) * 100
|
||||||
} else if (maxValue == minValue) {
|
|
||||||
if (maxValue < 10 && minValue > 0) {
|
|
||||||
max = calculateBoundary(maxValue, 10);
|
|
||||||
min = calculateBoundary(minValue, 10);
|
|
||||||
} else if (maxValue!== 0 && minValue!== 0) {
|
|
||||||
max = calculateBoundary(maxValue / 10 + 1, 10);
|
|
||||||
min = calculateBoundary(minValue / 10 - 1, 10);
|
|
||||||
}
|
}
|
||||||
|
} else if (maxValue < 60 && minValue > 40) {
|
||||||
|
max = 60
|
||||||
|
min = 40
|
||||||
|
} else if (maxValue == minValue && maxValue < 10 && minValue > 0) {
|
||||||
|
max = Math.ceil(maxValue / 10) * 10
|
||||||
|
min = Math.floor(minValue / 10) * 10
|
||||||
|
} else if (maxValue == minValue && maxValue != 0 && minValue != 0) {
|
||||||
|
max = Math.ceil(maxValue / 10 + 1) * 10
|
||||||
|
min = Math.floor(minValue / 10 - 1) * 10
|
||||||
} else {
|
} else {
|
||||||
max = calculateBoundary(maxValue, 10);
|
max = Math.ceil(maxValue / 10) * 10
|
||||||
min = calculateBoundary(minValue, 10);
|
min = Math.floor(minValue / 10) * 10
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maxValue > 0 && maxValue < 1) {
|
if (maxValue > 0 && maxValue < 1) {
|
||||||
max = 1;
|
max = 1
|
||||||
|
} else if (max == 0 && minValue > -1 && minValue < 0) {
|
||||||
|
min = -1
|
||||||
}
|
}
|
||||||
if (max == 0 && minValue > -1 && minValue < 0) {
|
return [min, max]
|
||||||
min = -1;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return [min, max];
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* title['A相','B相',]
|
* title['A相','B相',]
|
||||||
@@ -51,7 +48,7 @@ export const yMethod = (arr: any) => {
|
|||||||
*/
|
*/
|
||||||
// 导出csv文件
|
// 导出csv文件
|
||||||
const convertToCSV = (title: object, data: any) => {
|
const convertToCSV = (title: object, data: any) => {
|
||||||
// console.log('🚀 ~ convertToCSV ~ data:', data)
|
console.log('🚀 ~ convertToCSV ~ data:', data)
|
||||||
let csv = ''
|
let csv = ''
|
||||||
// 添加列头
|
// 添加列头
|
||||||
csv += ',' + title.join(',') + '\n'
|
csv += ',' + title.join(',') + '\n'
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { requestPayload } from '@/utils/request'
|
|||||||
import { Method } from 'axios'
|
import { Method } from 'axios'
|
||||||
import { mainHeight } from '@/utils/layout'
|
import { mainHeight } from '@/utils/layout'
|
||||||
import { filtration } from './tableMethod'
|
import { filtration } from './tableMethod'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
interface TableStoreParams {
|
interface TableStoreParams {
|
||||||
url: string // 请求地址
|
url: string // 请求地址
|
||||||
pk?: string
|
pk?: string
|
||||||
@@ -183,6 +183,11 @@ export default class TableStore {
|
|||||||
'export',
|
'export',
|
||||||
() => {
|
() => {
|
||||||
// this.index()
|
// this.index()
|
||||||
|
ElMessage({
|
||||||
|
message: '正在导出,请稍等...',
|
||||||
|
type: 'info',
|
||||||
|
duration: 1000
|
||||||
|
})
|
||||||
let params = { ...this.table.params, pageNum: 1, pageSize: this.table.total }
|
let params = { ...this.table.params, pageNum: 1, pageSize: this.table.total }
|
||||||
createAxios(
|
createAxios(
|
||||||
Object.assign(
|
Object.assign(
|
||||||
|
|||||||
@@ -2,16 +2,16 @@
|
|||||||
<div class="default-main">
|
<div class="default-main">
|
||||||
<el-tabs v-model.trim="activeName" type="border-card" class="demo-tabs">
|
<el-tabs v-model.trim="activeName" type="border-card" class="demo-tabs">
|
||||||
<el-tab-pane label="设备告警" name="1">
|
<el-tab-pane label="设备告警" name="1">
|
||||||
<Device v-if="activeName == '1'" :deviceTree="deviceTree" />
|
<Device v-if="activeName == '1'" :deviceTree="deviceTree" :key="key" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="稳态越限告警" name="2">
|
<el-tab-pane label="稳态越限告警" name="2">
|
||||||
<Steady v-if="activeName == '2'" :deviceTree="deviceTree" />
|
<Steady v-if="activeName == '2'" :deviceTree="deviceTree" :key="key" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="暂态事件" name="3">
|
<el-tab-pane label="暂态事件" name="3">
|
||||||
<Transient v-if="activeName == '3'" :deviceTree="deviceTree" />
|
<Transient v-if="activeName == '3'" :deviceTree="deviceTree" :key="key" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="异常事件" name="4">
|
<el-tab-pane label="异常事件" name="4">
|
||||||
<Abnormal v-if="activeName == '4'" :deviceTree="deviceTree" />
|
<Abnormal v-if="activeName == '4'" :deviceTree="deviceTree" :key="key" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</div>
|
</div>
|
||||||
@@ -28,6 +28,7 @@ defineOptions({
|
|||||||
})
|
})
|
||||||
const deviceTree = ref([])
|
const deviceTree = ref([])
|
||||||
const activeName = ref('1')
|
const activeName = ref('1')
|
||||||
|
const key = ref(0)
|
||||||
getDeviceTree().then(res => {
|
getDeviceTree().then(res => {
|
||||||
res.data.forEach((item: any) => {
|
res.data.forEach((item: any) => {
|
||||||
item.value = item.id
|
item.value = item.id
|
||||||
@@ -43,6 +44,7 @@ getDeviceTree().then(res => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
deviceTree.value = res.data
|
deviceTree.value = res.data
|
||||||
|
key.value += 1
|
||||||
})
|
})
|
||||||
onMounted(() => { })
|
onMounted(() => { })
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ const zblist = ref<any[]>([])
|
|||||||
const init = () => {
|
const init = () => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
queryByCode('Harmonic_Type').then(res => {
|
queryByCode('Harmonic_Type').then(res => {
|
||||||
queryCsDictTree(res.data.id).then(res => {
|
queryCsDictTree(res.data?.id).then(res => {
|
||||||
zblist.value = res.data.map((item: any) => {
|
zblist.value = res.data.map((item: any) => {
|
||||||
return {
|
return {
|
||||||
value: item.id,
|
value: item.id,
|
||||||
@@ -302,11 +302,11 @@ const search = () => {
|
|||||||
} else {
|
} else {
|
||||||
echartsData.value = null
|
echartsData.value = null
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}, 0)
|
}).catch(() => {
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="default-main">
|
<div class="default-main">
|
||||||
<div class="analyze-dvr" v-show="view" :style="{ height: pageHeight.height }" v-loading="loading">
|
<div class="analyze-dvr" v-show="!isWaveCharts" :style="{ height: pageHeight.height }" v-loading="loading">
|
||||||
<DeviceTree @node-click="nodeClick" @init="nodeClick"></DeviceTree>
|
<DeviceTree @node-click="nodeClick" @init="nodeClick"></DeviceTree>
|
||||||
<div class="analyze-dvr-right" v-if="tableStore.table.params.deviceId">
|
<div class="analyze-dvr-right" v-if="tableStore.table.params.deviceId">
|
||||||
<Table v-if="view" ref="tableRef"></Table>
|
<Table v-if="view" ref="tableRef"></Table>
|
||||||
</div>
|
</div>
|
||||||
<el-empty v-else description="请选择设备" class="analyze-dvr-right" />
|
<el-empty v-else description="请选择设备" class="analyze-dvr-right" />
|
||||||
</div>
|
</div>
|
||||||
<div :style="{ height: pageHeight.height }" style="padding: 10px; overflow: hidden" v-if="!view">
|
<waveFormAnalysis v-loading="loading" v-if="isWaveCharts" ref="waveFormAnalysisRef"
|
||||||
|
@handleHideCharts="isWaveCharts = false" :wp="wp" style="padding: 10px;"/>
|
||||||
|
<!-- <div :style="{ height: pageHeight.height }" style="padding: 10px; overflow: hidden" v-if="!view">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<div v-if="view2" style="display: flex">
|
<div v-if="view2" style="display: flex">
|
||||||
@@ -38,20 +40,21 @@
|
|||||||
</rmsboxi>
|
</rmsboxi>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<!-- <xiebofenxi ref="child" :bxshuju="bxshuju" @backfh="back"></xiebofenxi> -->
|
</div> -->
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, provide, onMounted } from 'vue'
|
import { ref, nextTick, provide, onMounted } from 'vue'
|
||||||
import { mainHeight } from '@/utils/layout'
|
import { mainHeight } from '@/utils/layout'
|
||||||
import DeviceTree from '@/components/tree/govern/deviceTree.vue'
|
import DeviceTree from '@/components/tree/govern/deviceTree.vue'
|
||||||
import TableStore from '@/utils/tableStore'
|
import TableStore from '@/utils/tableStore'
|
||||||
import Table from '@/components/table/index.vue'
|
import Table from '@/components/table/index.vue'
|
||||||
|
import waveFormAnalysis from '@/views/govern/device/control/tabs/components/waveFormAnalysis.vue';
|
||||||
import { analyseWave } from '@/api/common'
|
import { analyseWave } from '@/api/common'
|
||||||
import shushiboxi from '@/components/echarts/shushiboxi.vue'
|
import shushiboxi from '@/components/echarts/shushiboxi.vue'
|
||||||
import rmsboxi from '@/components/echarts/rmsboxi.vue'
|
import rmsboxi from '@/components/echarts/rmsboxi.vue'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'govern/analyze/DVR'
|
name: 'govern/analyze/DVR'
|
||||||
})
|
})
|
||||||
@@ -60,11 +63,12 @@ const loading = ref(false)
|
|||||||
const view = ref(true)
|
const view = ref(true)
|
||||||
const view2 = ref(false)
|
const view2 = ref(false)
|
||||||
const showBoxi = ref(true)
|
const showBoxi = ref(true)
|
||||||
|
const isWaveCharts = ref(false)
|
||||||
const bxactiveName = ref('ssbx')
|
const bxactiveName = ref('ssbx')
|
||||||
const boxoList = ref({})
|
const boxoList: any = ref({})
|
||||||
const wp = ref({})
|
const wp = ref({})
|
||||||
const value = ref(1)
|
const value = ref(1)
|
||||||
|
const waveFormAnalysisRef = ref()
|
||||||
const options = ref([
|
const options = ref([
|
||||||
{
|
{
|
||||||
value: 1,
|
value: 1,
|
||||||
@@ -79,7 +83,8 @@ const tableStore = new TableStore({
|
|||||||
url: '/cs-harmonic-boot/eventUser/queryEventpageWeb',
|
url: '/cs-harmonic-boot/eventUser/queryEventpageWeb',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
column: [
|
column: [
|
||||||
{ title: '事件描述', field: 'evtParamPosition' },
|
{ title: '事件描述', field: 'showName' },
|
||||||
|
{ title: '发生位置', field: 'evtParamPosition' },
|
||||||
{ title: '持续时间(s)', field: 'evtParamTm' },
|
{ title: '持续时间(s)', field: 'evtParamTm' },
|
||||||
{ title: '暂降深度', field: 'evtParamVVaDepth' },
|
{ title: '暂降深度', field: 'evtParamVVaDepth' },
|
||||||
{ title: '发生时刻', field: 'startTime' },
|
{ title: '发生时刻', field: 'startTime' },
|
||||||
@@ -100,20 +105,31 @@ const tableStore = new TableStore({
|
|||||||
},
|
},
|
||||||
|
|
||||||
click: async row => {
|
click: async row => {
|
||||||
row.loading = true
|
row.loading1 = true
|
||||||
boxoList.value = row
|
loading.value = true
|
||||||
|
isWaveCharts.value = true
|
||||||
await analyseWave(row.id)
|
await analyseWave(row.id)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
row.loading = false
|
row.loading1 = false
|
||||||
if (res != undefined) {
|
if (res != undefined) {
|
||||||
|
boxoList.value = row
|
||||||
|
boxoList.value.featureAmplitude = row.evtParamVVaDepth != '-' ? row.evtParamVVaDepth - 0 : null
|
||||||
|
// boxoList.value.systemType = 'WX'
|
||||||
wp.value = res.data
|
wp.value = res.data
|
||||||
view.value = false
|
|
||||||
view2.value = true
|
|
||||||
}
|
}
|
||||||
|
loading.value = false
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
row.loading = false
|
row.loading1 = false
|
||||||
|
loading.value = false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
nextTick(() => {
|
||||||
|
waveFormAnalysisRef.value && waveFormAnalysisRef.value.getWpData(wp.value, boxoList.value, true)
|
||||||
|
waveFormAnalysisRef.value && waveFormAnalysisRef.value.setHeight(false, 150)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -127,7 +143,28 @@ const tableStore = new TableStore({
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
name: 'edit',
|
||||||
|
title: '波形下载',
|
||||||
|
type: 'primary',
|
||||||
|
icon: 'el-icon-Check',
|
||||||
|
loading: 'loading2',
|
||||||
|
render: 'basicButton',
|
||||||
|
disabled: row => {
|
||||||
|
// && row.evtParamTm < 20
|
||||||
|
return !row.wavePath
|
||||||
|
},
|
||||||
|
click: row => {
|
||||||
|
row.loading2 = true
|
||||||
|
const url = window.location.origin + '/api/cs-harmonic-boot/event/getFileZip?eventId=' + row.id
|
||||||
|
window.open(url, '_self')
|
||||||
|
setTimeout(() => {
|
||||||
|
ElMessage.success('波形下载成功!')
|
||||||
|
row.loading2 = false
|
||||||
|
}, 1500)
|
||||||
|
}
|
||||||
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -790,7 +790,7 @@ const trendRef: any = ref()
|
|||||||
//暂态事件组件
|
//暂态事件组件
|
||||||
const eventRef: any = ref()
|
const eventRef: any = ref()
|
||||||
const mqttRef = ref()
|
const mqttRef = ref()
|
||||||
const url: any = inject('MQTTURL')
|
const url: any = window.localStorage.getItem('MQTTURL')
|
||||||
const connectMqtt = () => {
|
const connectMqtt = () => {
|
||||||
if (mqttRef.value) {
|
if (mqttRef.value) {
|
||||||
if (mqttRef.value.connected) {
|
if (mqttRef.value.connected) {
|
||||||
@@ -806,6 +806,8 @@ const connectMqtt = () => {
|
|||||||
username: 't_user',
|
username: 't_user',
|
||||||
password: 'njcnpqs'
|
password: 'njcnpqs'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
mqttRef.value = mqtt.connect(url, options)
|
mqttRef.value = mqtt.connect(url, options)
|
||||||
}
|
}
|
||||||
const getRealDataMqttMsg = async () => {
|
const getRealDataMqttMsg = async () => {
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ const clearRadioRowEvent = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const mqttRef = ref()
|
const mqttRef = ref()
|
||||||
const url: any = inject('MQTTURL')
|
const url: any = window.localStorage.getItem('MQTTURL')
|
||||||
const connectMqtt = () => {
|
const connectMqtt = () => {
|
||||||
if (mqttRef.value) {
|
if (mqttRef.value) {
|
||||||
if (mqttRef.value.connected) {
|
if (mqttRef.value.connected) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<!-- 暂态事件-波形解析组件 -->
|
<!-- 暂态事件-波形分析组件 -->
|
||||||
<template>
|
<template>
|
||||||
<div class="home">
|
<div class="home">
|
||||||
<div class="home_header">
|
<div class="home_header">
|
||||||
@@ -132,8 +132,10 @@ const handleBack = () => {
|
|||||||
emit('handleHideCharts')
|
emit('handleHideCharts')
|
||||||
}
|
}
|
||||||
const setHeight = (h: any, vh: any) => {
|
const setHeight = (h: any, vh: any) => {
|
||||||
|
if (h != false) {
|
||||||
|
parentHeight.value = h
|
||||||
|
}
|
||||||
|
|
||||||
parentHeight.value = h
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
bxecharts.value = mainHeight(vh).height
|
bxecharts.value = mainHeight(vh).height
|
||||||
}, 100)
|
}, 100)
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
<div class="view">
|
<div class="view">
|
||||||
<TableHeader datePicker ref="headerRef" v-if="!isWaveCharts" :showReset="false"></TableHeader>
|
<TableHeader datePicker ref="headerRef" v-if="!isWaveCharts" :showReset="false"></TableHeader>
|
||||||
<Table ref="tableRef" v-if="!isWaveCharts" />
|
<Table ref="tableRef" v-if="!isWaveCharts" />
|
||||||
<waveFormAnalysis v-loading="loading" v-if="isWaveCharts" ref="waveFormAnalysisRef" @handleHideCharts="isWaveCharts = false"
|
<waveFormAnalysis v-loading="loading" v-if="isWaveCharts" ref="waveFormAnalysisRef"
|
||||||
:wp="wp" />
|
@handleHideCharts="isWaveCharts = false" :wp="wp" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
@@ -79,7 +79,7 @@ const tableStore: any = new TableStore({
|
|||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
title: '波形解析',
|
title: '波形分析',
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
icon: 'el-icon-Check',
|
icon: 'el-icon-Check',
|
||||||
render: 'basicButton',
|
render: 'basicButton',
|
||||||
|
|||||||
@@ -523,7 +523,7 @@ watch(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
const mqttRef = ref()
|
const mqttRef = ref()
|
||||||
const url: any = inject('MQTTURL')
|
const url: any = window.localStorage.getItem('MQTTURL')
|
||||||
const connectMqtt = () => {
|
const connectMqtt = () => {
|
||||||
if (mqttRef.value) {
|
if (mqttRef.value) {
|
||||||
if (mqttRef.value.connected) {
|
if (mqttRef.value.connected) {
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ const tableStore = new TableStore({
|
|||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
title: '波形解析',
|
title: '波形分析',
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
icon: 'el-icon-Check',
|
icon: 'el-icon-Check',
|
||||||
render: 'basicButton',
|
render: 'basicButton',
|
||||||
@@ -103,7 +103,7 @@ const tableStore = new TableStore({
|
|||||||
boxoList.value = row
|
boxoList.value = row
|
||||||
boxoList.value.systemType = 'WX'
|
boxoList.value.systemType = 'WX'
|
||||||
wp.value = res.data
|
wp.value = res.data
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
loading.value = false
|
loading.value = false
|
||||||
|
|||||||
@@ -201,6 +201,7 @@ const tableStore = new TableStore({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ title: '设备名称', field: 'name' },
|
{ title: '设备名称', field: 'name' },
|
||||||
|
{ title: '网络设备ID', field: 'ndid' },
|
||||||
{
|
{
|
||||||
title: '设备类型',
|
title: '设备类型',
|
||||||
field: 'devType',
|
field: 'devType',
|
||||||
@@ -208,6 +209,7 @@ const tableStore = new TableStore({
|
|||||||
return devTypeOptions.value.filter((item: any) => item.value == row.cellValue)[0]?.label
|
return devTypeOptions.value.filter((item: any) => item.value == row.cellValue)[0]?.label
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: '设备型号',
|
title: '设备型号',
|
||||||
field: 'devModel',
|
field: 'devModel',
|
||||||
@@ -223,7 +225,7 @@ const tableStore = new TableStore({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ title: '录入时间', field: 'createTime' },
|
{ title: '录入时间', field: 'createTime' },
|
||||||
{ title: '网络设备ID', field: 'ndid' },
|
|
||||||
{
|
{
|
||||||
title: '使用状态',
|
title: '使用状态',
|
||||||
render: 'switch',
|
render: 'switch',
|
||||||
@@ -257,7 +259,7 @@ const tableStore = new TableStore({
|
|||||||
}
|
}
|
||||||
}).then(({ value }) => {
|
}).then(({ value }) => {
|
||||||
passwordConfirm(value).then(res => {
|
passwordConfirm(value).then(res => {
|
||||||
editEquipmentDelivery({ ...row, status: row.status == 5 ? 1 : row.status, usageStatus: row.usageStatus == 1 ? 0 : 1 }).then(res => {
|
editEquipmentDelivery({ ...row, status: row.status == 5 ? 1 : row.status == 6 ? 2 : row.status, usageStatus: row.usageStatus == 1 ? 0 : 1 }).then(res => {
|
||||||
ElMessage.success(row.usageStatus == 1 ? '设备停用成功!' : '设备启用成功!')
|
ElMessage.success(row.usageStatus == 1 ? '设备停用成功!' : '设备启用成功!')
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -79,10 +79,13 @@ const preservation = () => {
|
|||||||
ruleForm.value.validate((valid: boolean) => {
|
ruleForm.value.validate((valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
emit('submitForm', formdata.value, title.value)
|
emit('submitForm', formdata.value, title.value)
|
||||||
formVisible.value = false
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const shutDown = () => {
|
||||||
|
formVisible.value = false
|
||||||
|
}
|
||||||
|
|
||||||
// 关闭
|
// 关闭
|
||||||
const closeDialog = () => {
|
const closeDialog = () => {
|
||||||
@@ -99,6 +102,6 @@ const open = (text: string, row?: any) => {
|
|||||||
|
|
||||||
formVisible.value = true
|
formVisible.value = true
|
||||||
}
|
}
|
||||||
defineExpose({ open })
|
defineExpose({ open,shutDown })
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|||||||
@@ -1,19 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="default-main">
|
<div class="default-main">
|
||||||
<div class="mb10" style="display: flex; justify-content: flex-end">
|
<div class="mb10" style="display: flex; justify-content: flex-end">
|
||||||
<el-upload
|
<el-upload ref="upload" action="" :auto-upload="false" :show-file-list="false" :limit="1"
|
||||||
ref="upload"
|
:on-change="beforeUpload">
|
||||||
action=""
|
|
||||||
:auto-upload="false"
|
|
||||||
:show-file-list="false"
|
|
||||||
:limit="1"
|
|
||||||
:on-change="beforeUpload"
|
|
||||||
>
|
|
||||||
<el-button icon="el-icon-Upload" type="primary" class="mr10">导入excel</el-button>
|
<el-button icon="el-icon-Upload" type="primary" class="mr10">导入excel</el-button>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<el-button @click="downloadExcel" class="" type="primary" icon="el-icon-Download">导出excel</el-button>
|
<el-button @click="downloadExcel" class="" type="primary" icon="el-icon-Download">导出excel</el-button>
|
||||||
<el-button type="primary" icon="el-icon-Check" @click="preservation">保存</el-button>
|
<el-button type="primary" icon="el-icon-Check" @click="preservation">保存</el-button>
|
||||||
<el-button icon="el-icon-ArrowLeftBold" @click="emit('shutDown')">返回</el-button>
|
<el-button icon="el-icon-ArrowLeftBold" @click="emit('shutDown')">返回</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="display: flex">
|
<div style="display: flex">
|
||||||
@@ -123,16 +117,25 @@ const submitForm = (formdata: any, text: string) => {
|
|||||||
params.append('name', formdata.name)
|
params.append('name', formdata.name)
|
||||||
params.append('reportType', formdata.reportType)
|
params.append('reportType', formdata.reportType)
|
||||||
params.append('reportForm', formdata.reportForm)
|
params.append('reportForm', formdata.reportForm)
|
||||||
|
ElMessage.info('正在保存请稍等!')
|
||||||
if (text == '新增报表模板') {
|
if (text == '新增报表模板') {
|
||||||
addTemplate(params).then(res => {
|
addTemplate(params).then(res => {
|
||||||
ElMessage.success('新增成功!')
|
ElMessage.success('新增成功!')
|
||||||
|
formFer.value.shutDown()
|
||||||
emit('shutDown')
|
emit('shutDown')
|
||||||
|
}).catch(err => {
|
||||||
|
ElMessage.error('保存失败!')
|
||||||
|
formFer.value.shutDown()
|
||||||
})
|
})
|
||||||
} else if (text == '编辑报表模板') {
|
} else if (text == '编辑报表模板') {
|
||||||
params.append('id', list.value.id)
|
params.append('id', list.value.id)
|
||||||
dateTemplateup(params).then(res => {
|
dateTemplateup(params).then(res => {
|
||||||
ElMessage.success('编辑成功!')
|
ElMessage.success('编辑成功!')
|
||||||
|
formFer.value.shutDown()
|
||||||
emit('shutDown')
|
emit('shutDown')
|
||||||
|
}).catch(err => {
|
||||||
|
ElMessage.error('保存失败!')
|
||||||
|
formFer.value.shutDown()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -147,7 +150,7 @@ const open = async (text: string, row?: any) => {
|
|||||||
info()
|
info()
|
||||||
}
|
}
|
||||||
defineExpose({ open })
|
defineExpose({ open })
|
||||||
onMounted(() => {})
|
onMounted(() => { })
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
:deep(.el-tab-pane) {
|
:deep(.el-tab-pane) {
|
||||||
|
|||||||
@@ -99,6 +99,9 @@ const open = (text: string, row?: any) => {
|
|||||||
|
|
||||||
formVisible.value = true
|
formVisible.value = true
|
||||||
}
|
}
|
||||||
defineExpose({ open })
|
const shutDown = () => {
|
||||||
|
formVisible.value = false
|
||||||
|
}
|
||||||
|
defineExpose({ open,shutDown})
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|||||||
@@ -125,16 +125,25 @@ const submitForm = (formdata: any, text: string) => {
|
|||||||
params.append('name', formdata.name)
|
params.append('name', formdata.name)
|
||||||
params.append('reportType', formdata.reportType)
|
params.append('reportType', formdata.reportType)
|
||||||
params.append('reportForm', formdata.reportForm)
|
params.append('reportForm', formdata.reportForm)
|
||||||
|
ElMessage.info('正在保存请稍等!')
|
||||||
if (text == '新增报表模板') {
|
if (text == '新增报表模板') {
|
||||||
addTemplate(params).then(res => {
|
addTemplate(params).then(res => {
|
||||||
ElMessage.success('新增成功!')
|
ElMessage.success('新增成功!')
|
||||||
|
formFer.value.shutDown()
|
||||||
emit('shutDown')
|
emit('shutDown')
|
||||||
|
}).catch(err => {
|
||||||
|
ElMessage.error('保存失败!')
|
||||||
|
formFer.value.shutDown()
|
||||||
})
|
})
|
||||||
} else if (text == '编辑报表模板') {
|
} else if (text == '编辑报表模板') {
|
||||||
params.append('id', list.value.id)
|
params.append('id', list.value.id)
|
||||||
dateTemplateup(params).then(res => {
|
dateTemplateup(params).then(res => {
|
||||||
ElMessage.success('编辑成功!')
|
ElMessage.success('编辑成功!')
|
||||||
|
formFer.value.shutDown()
|
||||||
emit('shutDown')
|
emit('shutDown')
|
||||||
|
}).catch(err => {
|
||||||
|
ElMessage.error('保存失败!')
|
||||||
|
formFer.value.shutDown()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user