Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
120892808b | ||
|
|
0f5cb1d3c5 | ||
| dbaa42ff7e |
@@ -13,9 +13,11 @@ onMounted(async () => {
|
||||
const response = await fetch('/')
|
||||
const WebSocketUrl:any = response.headers.get('X-WebSocket-Url')
|
||||
const WebSocketUrl2:any = response.headers.get('X-WebSocket-Url2')
|
||||
const WebSocketUrl3:any = response.headers.get('X-WebSocket-Url3')
|
||||
const MqttUrl:any = response.headers.get('X-MqttUrl-Url')
|
||||
localStorage.setItem('WebSocketUrl2', WebSocketUrl2)
|
||||
localStorage.setItem('WebSocketUrl', WebSocketUrl)
|
||||
localStorage.setItem('WebSocketUrl2', WebSocketUrl2)
|
||||
localStorage.setItem('WebSocketUrl3', WebSocketUrl3)
|
||||
localStorage.setItem('MqttUrl', MqttUrl)
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="区域" v-if="area">
|
||||
<Area ref="areaRef" v-model="tableStore.table.params.deptIndex" @change-value="onAreaChange" />
|
||||
<Area ref="areaRef" v-model="tableStore.table.params.deptIndex" @change-value="onAreaChange" />
|
||||
</el-form-item>
|
||||
<slot name="select"></slot>
|
||||
</el-form>
|
||||
@@ -81,7 +81,7 @@ import { mainHeight } from '@/utils/layout'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { Search, RefreshLeft } from '@element-plus/icons-vue'
|
||||
import { defineProps } from 'vue'
|
||||
const emit = defineEmits(['selectChange','areaChange'])
|
||||
const emit = defineEmits(['selectChange', 'areaChange'])
|
||||
const tableStore = inject('tableStore') as TableStore
|
||||
const tableHeader = ref()
|
||||
const datePickerRef = ref()
|
||||
@@ -132,9 +132,8 @@ const headerFormSecondStyleClose = {
|
||||
padding: '0'
|
||||
}
|
||||
|
||||
const onAreaChange = (data) => {
|
||||
|
||||
emit('areaChange', {label: data.label})
|
||||
const onAreaChange = data => {
|
||||
emit('areaChange', { label: data.label })
|
||||
}
|
||||
|
||||
watch(
|
||||
@@ -142,7 +141,6 @@ watch(
|
||||
newVal => {
|
||||
setTimeout(() => {
|
||||
areaRef.value && areaRef.value.change()
|
||||
|
||||
}, 0)
|
||||
}
|
||||
)
|
||||
@@ -238,14 +236,14 @@ const onResetForm = () => {
|
||||
//时间重置成默认值
|
||||
datePickerRef.value?.setTheDate(3)
|
||||
|
||||
if(props.showTimeAll){
|
||||
timeAll.value = false
|
||||
delete tableStore.table.params.searchBeginTime
|
||||
delete tableStore.table.params.searchEndTime
|
||||
delete tableStore.table.params.startTime
|
||||
delete tableStore.table.params.endTime
|
||||
delete tableStore.table.params.timeFlag
|
||||
delete tableStore.table.params.interval
|
||||
if (props.showTimeAll) {
|
||||
timeAll.value = false
|
||||
delete tableStore.table.params.searchBeginTime
|
||||
delete tableStore.table.params.searchEndTime
|
||||
delete tableStore.table.params.startTime
|
||||
delete tableStore.table.params.endTime
|
||||
delete tableStore.table.params.timeFlag
|
||||
delete tableStore.table.params.interval
|
||||
}
|
||||
|
||||
if (props.datePicker && timeAll.value) {
|
||||
@@ -264,7 +262,6 @@ const setTheDate = (val: any) => {
|
||||
}
|
||||
// 导出
|
||||
const onExport = () => {
|
||||
|
||||
tableStore.onTableAction('export', { showAllFlag: true })
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,8 @@ import { ref, reactive, onMounted } from 'vue'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import MQTT from '@/utils/mqtt'
|
||||
// import MQTT from '@/utils/mqtt'
|
||||
import socketClient from '@/utils/webSocketClient'
|
||||
const dictData = useDictData()
|
||||
const event = dictData.getBasicData('Event_Statis')
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
@@ -68,37 +69,72 @@ const handleClose = (done: any) => {
|
||||
drawer.value = false
|
||||
done()
|
||||
}
|
||||
const init = async () => {
|
||||
const mqttClient = new MQTT('/sendEvent')
|
||||
// 设置消息接收回调
|
||||
try {
|
||||
await mqttClient.init()
|
||||
const dataSocket = reactive({
|
||||
socketServe: socketClient.Instance
|
||||
})
|
||||
// const init = async () => {
|
||||
// const mqttClient = new MQTT('/sendEvent')
|
||||
// // 设置消息接收回调
|
||||
// try {
|
||||
// await mqttClient.init()
|
||||
|
||||
// 订阅主题
|
||||
await mqttClient.subscribe()
|
||||
// 设置消息接收回调
|
||||
mqttClient.onMessage((topic, message) => {
|
||||
const msg = JSON.parse(message.toString())
|
||||
// console.log('🚀 ~ init ~ msg:', msg)
|
||||
if (msg.deptList.includes(adminInfo.$state.deptId)) {
|
||||
drawer.value = true
|
||||
isLoading.value = true
|
||||
eventList.value.unshift(msg)
|
||||
setTimeout(() => {
|
||||
isLoading.value = false
|
||||
}, 500)
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
// console.error('MQTT 初始化失败:', error)
|
||||
}
|
||||
// // 订阅主题
|
||||
// await mqttClient.subscribe()
|
||||
// // 设置消息接收回调
|
||||
// mqttClient.onMessage((topic, message) => {
|
||||
// const msg = JSON.parse(message.toString())
|
||||
// // console.log('🚀 ~ init ~ msg:', msg)
|
||||
// if (msg.deptList.includes(adminInfo.$state.deptId)) {
|
||||
// drawer.value = true
|
||||
// isLoading.value = true
|
||||
// eventList.value.unshift(msg)
|
||||
// setTimeout(() => {
|
||||
// isLoading.value = false
|
||||
// }, 500)
|
||||
// }
|
||||
// })
|
||||
// } catch (error) {
|
||||
// // console.error('MQTT 初始化失败:', error)
|
||||
// }
|
||||
// }
|
||||
const socket = async () => {
|
||||
const url = localStorage.getItem('WebSocketUrl3') || 'null' //'ws://192.168.2.130:10203/event/'
|
||||
|
||||
|
||||
// const url = 'ws://192.168.1.68:10203/event/'
|
||||
|
||||
await dataSocket.socketServe.connect(`${url}${adminInfo.id}`)
|
||||
|
||||
await dataSocket.socketServe.registerCallBack('message', (res: any) => {
|
||||
if (res.deptList.includes(adminInfo.$state.deptId)) {
|
||||
drawer.value = true
|
||||
isLoading.value = true
|
||||
eventList.value.unshift(res)
|
||||
setTimeout(() => {
|
||||
isLoading.value = false
|
||||
}, 500)
|
||||
}
|
||||
// logList.value.push({
|
||||
// type: res.code == 500 ? 'error' : '',
|
||||
// time: formatDate(new Date(), 'YYYY-MM-DD hh:mm:ss'),
|
||||
// name: res.message
|
||||
// })
|
||||
})
|
||||
}
|
||||
|
||||
onUnmounted(() => {
|
||||
dataSocket.socketServe?.closeWs()
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
// startMqtt('/sendEvent', (topic, message) => {
|
||||
// const msg = JSON.parse(message.toString())
|
||||
// console.log(msg)
|
||||
// })
|
||||
init()
|
||||
|
||||
setTimeout(() => {
|
||||
socket()
|
||||
}, 3000)
|
||||
})
|
||||
defineExpose({
|
||||
open,
|
||||
|
||||
@@ -11,6 +11,7 @@ const calculateValue = (o: number, value: number, num: number, isMin: boolean) =
|
||||
} else if (value > -1 && value < 0 && isMin == false) {
|
||||
return 0
|
||||
}
|
||||
|
||||
let base
|
||||
if (Math.abs(o) >= 100) {
|
||||
base = 100
|
||||
@@ -19,8 +20,11 @@ const calculateValue = (o: number, value: number, num: number, isMin: boolean) =
|
||||
} else if (Math.abs(o) >= 1) {
|
||||
base = 1
|
||||
} else {
|
||||
base = 0.1
|
||||
const multiple = 1 / 0.1
|
||||
|
||||
base = Math.ceil(Math.abs(o) * multiple) / multiple
|
||||
}
|
||||
|
||||
let calculatedValue
|
||||
if (isMin) {
|
||||
if (value < 0) {
|
||||
@@ -35,18 +39,19 @@ const calculateValue = (o: number, value: number, num: number, isMin: boolean) =
|
||||
calculatedValue = value + num * value
|
||||
}
|
||||
}
|
||||
|
||||
if (base === 0.1) {
|
||||
return parseFloat(calculatedValue.toFixed(1))
|
||||
// return parseFloat(calculatedValue.toFixed(1))
|
||||
return Math.ceil(calculatedValue * 10) / 10
|
||||
} else if (isMin) {
|
||||
return Math.floor(calculatedValue / base) * base
|
||||
} else {
|
||||
return Math.ceil(calculatedValue / base) * base
|
||||
}
|
||||
}
|
||||
|
||||
// 处理y轴最大最小值
|
||||
export const yMethod = (arr: any) => {
|
||||
let num = 0.1
|
||||
let num = 0.2
|
||||
let numList = dataProcessing(arr)
|
||||
let maxValue = 0
|
||||
let minValue = 0
|
||||
@@ -54,12 +59,9 @@ export const yMethod = (arr: any) => {
|
||||
let min = 0
|
||||
maxValue = Math.max(...numList)
|
||||
minValue = Math.min(...numList)
|
||||
const o = maxValue - minValue
|
||||
if (Math.abs(o) >= 300) {
|
||||
num = 0.02
|
||||
}
|
||||
|
||||
const o = maxValue - minValue == 0 ? maxValue : maxValue - minValue
|
||||
min = calculateValue(o, minValue, num, true)
|
||||
|
||||
max = calculateValue(o, maxValue, num, false)
|
||||
// if (-100 >= minValue) {
|
||||
// min = Math.floor((minValue + num * minValue) / 100) * 100
|
||||
@@ -158,8 +160,6 @@ export const exportCSV = (title: object, data: any, filename: string) => {
|
||||
URL.revokeObjectURL(link.href)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 补全时间序列数据中缺失的条目
|
||||
* @param rawData 原始数据,格式为 [["时间字符串", "数值", "单位", "类型"], ...]
|
||||
|
||||
@@ -147,7 +147,39 @@ export const filter = <T = any>(
|
||||
|
||||
return listFilter(tree)
|
||||
}
|
||||
export const filterTree = <T = any>(
|
||||
tree: T[],
|
||||
func: (n: T) => boolean,
|
||||
config: Partial<TreeHelperConfig> = {}
|
||||
): T[] => {
|
||||
config = getConfig(config)
|
||||
const children = config.children as string
|
||||
|
||||
function listFilter(list: T[]) {
|
||||
return list
|
||||
.map((node: any) => ({ ...node }))
|
||||
.filter((node) => {
|
||||
// 1. 如果当前节点匹配 → 直接保留【所有子节点】,不再过滤下级
|
||||
if (func(node)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 2. 如果当前节点不匹配,递归过滤子节点
|
||||
if (node[children]) {
|
||||
const filteredChildren = listFilter(node[children]);
|
||||
if (filteredChildren.length > 0) {
|
||||
node[children] = filteredChildren;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// 3. 都不匹配,过滤掉
|
||||
return false;
|
||||
})
|
||||
}
|
||||
|
||||
return listFilter(tree)
|
||||
}
|
||||
export const forEach = <T = any>(
|
||||
tree: T[],
|
||||
func: (n: T) => any,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Flag } from '@element-plus/icons-vue/dist/types'
|
||||
import { ElMessage, EVENT_CODE } from 'element-plus'
|
||||
|
||||
// 定义消息类型,用于类型检查
|
||||
@@ -43,13 +44,9 @@ export default class SocketService {
|
||||
console.log('您的浏览器不支持WebSocket')
|
||||
return
|
||||
}
|
||||
if (url == 'null' || url == null) return
|
||||
|
||||
setTimeout(() => {
|
||||
// ws://192.168.1.69:10407/mgtt
|
||||
// const url =
|
||||
// (localStorage.getItem('WebSocketUrl') == 'null'
|
||||
// ? 'ws://192.168.1.130:10405'
|
||||
// : localStorage.getItem('WebSocketUrl')) + id
|
||||
this.ws = new WebSocket(url)
|
||||
|
||||
this.ws.onopen = () => this.handleOpen()
|
||||
@@ -90,7 +87,7 @@ export default class SocketService {
|
||||
|
||||
if (event.data == '连接成功') {
|
||||
this.sendHeartbeat()
|
||||
} else if (event.data == 'connect') {
|
||||
} else if (event.data == 'over') {
|
||||
} else if (event.data.length > 10) {
|
||||
let message: MessageType
|
||||
try {
|
||||
@@ -104,7 +101,7 @@ export default class SocketService {
|
||||
|
||||
// 通过接受服务端发送的type字段来回调函数
|
||||
|
||||
if ((message.key || message.code) && this.callBackMapping['message']) {
|
||||
if ((message.key || message.code || message.time) && this.callBackMapping['message']) {
|
||||
this.callBackMapping['message']!(message)
|
||||
} else {
|
||||
console.log('抛弃====>')
|
||||
@@ -112,6 +109,7 @@ export default class SocketService {
|
||||
// 丢弃或继续写你的逻辑
|
||||
}
|
||||
} else {
|
||||
this.callBackMapping['message']!({ Flag: false })
|
||||
ElMessage.error(event.data)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,20 +38,20 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="电网标识">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.powerFlag"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
placeholder="请选择电网标识"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in powerFlagList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.algoDescribe"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-select
|
||||
v-model="tableStore.table.params.powerFlag"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
placeholder="请选择电网标识"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in powerFlagList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.algoDescribe"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端厂家:">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.manufacturer"
|
||||
@@ -88,6 +88,14 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字筛选">
|
||||
<el-input
|
||||
v-model.trim="tableStore.table.params.searchValue"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
placeholder="请输入关键字筛选"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
</div>
|
||||
@@ -96,7 +104,7 @@
|
||||
<el-tab-pane :name="0" :lazy="true" label="稳态指标符合性占比表格">
|
||||
<Table
|
||||
ref="tableRef"
|
||||
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
|
||||
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
|
||||
:scroll-y="{ enabled: true }"
|
||||
v-if="activeName == 0"
|
||||
/>
|
||||
@@ -117,6 +125,7 @@ import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import charts from './components/charts.vue'
|
||||
import { filterTree } from '@/utils/tree'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/area/SteadyState'
|
||||
})
|
||||
@@ -214,7 +223,12 @@ const tableStore = new TableStore({
|
||||
],
|
||||
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = tree2List(tableStore.table.data, Math.random() * 1000)
|
||||
tableStore.table.data = tree2List(
|
||||
filterTree(tableStore.table.data, node => {
|
||||
return node.name.includes(tableStore.table.params.searchValue)
|
||||
}),
|
||||
Math.random() * 1000
|
||||
)
|
||||
tableStore.table.column[0].title = tableStore.table.params.statisticalType.name
|
||||
|
||||
chartsRef.value && chartsRef.value.getTableStoreParams(tableStore.table.params)
|
||||
@@ -230,6 +244,7 @@ tableStore.table.params.manufacturer = []
|
||||
tableStore.table.params.loadType = []
|
||||
tableStore.table.params.powerFlag = 2
|
||||
tableStore.table.params.serverName = 'harmonicBoot'
|
||||
tableStore.table.params.searchValue = ''
|
||||
provide('tableStore', tableStore)
|
||||
const tree2List = (list: any, id?: string) => {
|
||||
//存储结果的数组
|
||||
|
||||
@@ -473,7 +473,7 @@ const makeUpSubmit = () => {
|
||||
logPopUp.value = true
|
||||
}
|
||||
const socket = async (form: any) => {
|
||||
const url = (localStorage.getItem('WebSocketUrl2') || 'ws://192.168.1.67:10405/api/recell/')
|
||||
const url = (localStorage.getItem('WebSocketUrl2') || 'null')//'ws://192.168.1.67:10405/api/recell/')
|
||||
logList.value = []
|
||||
await dataSocket.socketServe.connect(`${url}${adminInfo.id}`)
|
||||
await dataSocket.socketServe.send(form)
|
||||
|
||||
@@ -83,6 +83,14 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字筛选">
|
||||
<el-input
|
||||
v-model.trim="tableStore.table.params.searchValue"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
placeholder="请输入关键字筛选"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
</div>
|
||||
@@ -112,6 +120,7 @@ import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import charts from './components/charts.vue'
|
||||
import { filterTree } from '@/utils/tree'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/area/harmonicDistortionRate'
|
||||
})
|
||||
@@ -200,7 +209,13 @@ const tableStore = new TableStore({
|
||||
],
|
||||
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = tree2List(tableStore.table.data, Math.random() * 1000)
|
||||
tableStore.table.data = tree2List(
|
||||
filterTree(tableStore.table.data, node => {
|
||||
// 筛选条件:name 包含关键词
|
||||
return node.name.includes(tableStore.table.params.searchValue)
|
||||
}),
|
||||
Math.random() * 1000
|
||||
)
|
||||
tableStore.table.column[0].title = tableStore.table.params.statisticalType.name
|
||||
chartsRef.value && chartsRef.value.getTableStoreParams(tableStore.table.params)
|
||||
setTimeout(() => {
|
||||
@@ -215,6 +230,7 @@ tableStore.table.params.manufacturer = []
|
||||
tableStore.table.params.loadType = []
|
||||
tableStore.table.params.powerFlag = sign[0]?.algoDescribe || 0
|
||||
tableStore.table.params.serverName = 'harmonicBoot'
|
||||
tableStore.table.params.searchValue = ''
|
||||
provide('tableStore', tableStore)
|
||||
const tree2List = (list: any, id?: string) => {
|
||||
//存储结果的数组
|
||||
|
||||
@@ -83,6 +83,14 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字筛选">
|
||||
<el-input
|
||||
v-model.trim="tableStore.table.params.searchValue"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
placeholder="请输入关键字筛选"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
</div>
|
||||
@@ -113,6 +121,7 @@ import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import charts from './components/charts.vue'
|
||||
import { filterTree } from '@/utils/tree'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/area/qualifiedRate'
|
||||
})
|
||||
@@ -272,7 +281,13 @@ const tableStore = new TableStore({
|
||||
],
|
||||
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = tree2List(tableStore.table.data, Math.random() * 1000)
|
||||
tableStore.table.data = tree2List(
|
||||
filterTree(tableStore.table.data, node => {
|
||||
// 筛选条件:name 包含关键词
|
||||
return node.name.includes(tableStore.table.params.searchValue)
|
||||
}),
|
||||
Math.random() * 1000
|
||||
)
|
||||
tableStore.table.column[0].title = tableStore.table.params.statisticalType.name
|
||||
|
||||
chartsRef.value && chartsRef.value.getTableStoreParams(tableStore.table.params)
|
||||
@@ -288,6 +303,7 @@ tableStore.table.params.manufacturer = []
|
||||
tableStore.table.params.loadType = []
|
||||
tableStore.table.params.serverName = 'harmonicBoot'
|
||||
tableStore.table.params.powerFlag = sign[0]?.algoDescribe || 0
|
||||
tableStore.table.params.searchValue = ''
|
||||
provide('tableStore', tableStore)
|
||||
// const tree2List = (list: any, pid?: string) => {
|
||||
// //存储结果的数组
|
||||
|
||||
@@ -37,6 +37,14 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字筛选">
|
||||
<el-input
|
||||
v-model.trim="tableStore.table.params.searchValue"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
placeholder="请输入关键字筛选"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
</div>
|
||||
@@ -88,7 +96,7 @@
|
||||
<span style="color: #ffcc33">检修状态</span>
|
||||
</li>
|
||||
<li>
|
||||
<p style="background: #A52a2a">
|
||||
<p style="background: #a52a2a">
|
||||
<svg
|
||||
t="1722910570852"
|
||||
class="icon"
|
||||
@@ -106,7 +114,7 @@
|
||||
></path>
|
||||
</svg>
|
||||
</p>
|
||||
<span style="color: #A52a2a">停运状态</span>
|
||||
<span style="color: #a52a2a">停运状态</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -133,6 +141,7 @@ import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import charts from './components/charts.vue'
|
||||
import { filterTree } from '@/utils/tree'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/area/terminalonlinerate'
|
||||
})
|
||||
@@ -279,7 +288,12 @@ const tableStore = new TableStore({
|
||||
// // tableStore.table.params.searchEndTime = tableHeaderRef.value.datePickerRef.timeValue[1]
|
||||
// },
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = tree2List(tableStore.table.data, Math.random() * 1000)
|
||||
tableStore.table.data = tree2List(
|
||||
filterTree(tableStore.table.data, node => {
|
||||
return node.name.includes(tableStore.table.params.searchValue)
|
||||
}),
|
||||
Math.random() * 1000
|
||||
)
|
||||
tableStore.table.column[0].title = formData.value.statisticalType.name
|
||||
|
||||
chartsRef.value && chartsRef.value.getTableStoreParams(tableStore.table.params)
|
||||
@@ -294,7 +308,7 @@ tableStore.table.params.scale = voltageleveloption
|
||||
tableStore.table.params.manufacturer = terminaloption
|
||||
tableStore.table.params.loadType = interfereoption
|
||||
tableStore.table.params.serverName = 'harmonicBoot'
|
||||
|
||||
tableStore.table.params.searchValue = ''
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
const tree2List = (list: any, id?: string) => {
|
||||
|
||||
@@ -68,14 +68,14 @@ const tableStore = new TableStore({
|
||||
{ field: 'lineScale', title: '电压等级', minWidth: "120px", },
|
||||
{ field: 'lineName', title: '监测点名称', minWidth: "150px", },
|
||||
{ field: 'loadType', title: '干扰源类型', minWidth: "150px", },
|
||||
{ field: 'lineObjectName', title: '监测点对象名称', minWidth: "150px", formatter: (row: any) => { return row.cellValue == null ? '/' : row.cellValue } },
|
||||
{ field: 'lineObjectName', title: '监测点对象名称', minWidth: "180px", formatter: (row: any) => { return row.cellValue == null ? '/' : row.cellValue } },
|
||||
{ field: 'overDay', title: '超标天数', minWidth: "80px", },
|
||||
{ field: 'freqOverDay', title: '频率偏差超标天数', minWidth: "100px", },
|
||||
{ field: 'volDevOverDay', title: '电压偏差超标天数', minWidth: "100px", },
|
||||
{ field: 'volDisOverDay', title: '电压总畸变率超标天数', minWidth: "100px", },
|
||||
{ field: 'volContainOverDay', title: '谐波电压含有率超标天数', minWidth: "110px", },
|
||||
{ field: 'harmVolOverDay', title: '谐波电压超标天数', minWidth: "100px", },
|
||||
{ field: 'harmCurOverDay', title: '谐波电流超标天数', minWidth: "100px", },
|
||||
{ field: 'freqOverDay', title: '频率偏差', minWidth: "100px", },
|
||||
{ field: 'volDevOverDay', title: '电压偏差', minWidth: "100px", },
|
||||
{ field: 'volDisOverDay', title: '电压总畸变率', minWidth: "100px", },
|
||||
{ field: 'volContainOverDay', title: '谐波电压含有率', minWidth: "100px", },
|
||||
{ field: 'harmVolOverDay', title: '谐波电压', minWidth: "100px", },
|
||||
{ field: 'harmCurOverDay', title: '谐波电流', minWidth: "100px", },
|
||||
{
|
||||
title: '各次谐波电压含有率超标天数',
|
||||
children: [
|
||||
@@ -104,10 +104,11 @@ const tableStore = new TableStore({
|
||||
|
||||
],
|
||||
},
|
||||
{ field: 'threeUnbalance', title: '三相电压不平衡度超标天数', minWidth: "110px", },
|
||||
{ field: 'negativeOverDay', title: '负序电流超标天数', minWidth: "100px", },
|
||||
{ field: 'flickerOverDay', title: '闪变超标天数', minWidth: "100px", },
|
||||
{ field: 'monitorNumber', title: '监测点编号', minWidth: "180px", formatter: (row: any) => { return row.cellValue == null ? '/' : row.cellValue } },
|
||||
{ field: 'intHarmOverDay', title: '间谐波电压含有率', minWidth: "100px", },
|
||||
{ field: 'threeUnbalance', title: '三相电压不平衡度', minWidth: "100px", },
|
||||
{ field: 'negativeOverDay', title: '负序电流', minWidth: "100px", },
|
||||
{ field: 'flickerOverDay', title: '闪变', minWidth: "100px", },
|
||||
{ field: 'monitorNumber', title: '监测点编号', minWidth: "100px", formatter: (row: any) => { return row.cellValue == null ? '/' : row.cellValue } },
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -162,14 +162,15 @@
|
||||
<vxe-column field="company" title="供电公司" minWidth="110px"></vxe-column>
|
||||
<vxe-column field="subStation" title="变电站" minWidth="110px"></vxe-column>
|
||||
<vxe-column field="manufacturer" title="终端厂家" minWidth="110px"></vxe-column>
|
||||
<vxe-column field="deviceName" title="终端名称" minWidth="110px"></vxe-column>
|
||||
<vxe-column field="deviceName" title="终端名称" minWidth="130px"></vxe-column>
|
||||
<vxe-column field="ip" title="终端IP" :formatter="formatter" width="120px"></vxe-column>
|
||||
<vxe-column
|
||||
field="lineName"
|
||||
title="监测点名称"
|
||||
:formatter="formatter"
|
||||
minWidth="110px"
|
||||
minWidth="130px"
|
||||
></vxe-column>
|
||||
<vxe-column v-if="VITE_FLAG" field="objName" title="监测对象" minWidth="130px"></vxe-column>
|
||||
<vxe-column field="runFlag" title="运行状态" width="90px">
|
||||
<template #default="{ row }">
|
||||
<el-tag
|
||||
@@ -222,6 +223,7 @@ defineOptions({
|
||||
name: 'harmonic-boot/harmonic/getIntegrityData'
|
||||
})
|
||||
import { useRoute } from 'vue-router'
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME != 'jibei'
|
||||
const route = useRoute()
|
||||
const dictData = useDictData()
|
||||
//字典获取监督对象类型
|
||||
|
||||
@@ -160,8 +160,9 @@
|
||||
<vxe-column field="company" title="供电公司" minWidth="110px"></vxe-column>
|
||||
<vxe-column field="subStation" title="变电站" minWidth="110px"></vxe-column>
|
||||
<vxe-column field="manufacturer" title="终端厂家" minWidth="110px"></vxe-column>
|
||||
<vxe-column field="deviceName" title="终端名称" minWidth="110px"></vxe-column>
|
||||
<vxe-column field="deviceName" title="终端名称" minWidth="130px"></vxe-column>
|
||||
<vxe-column field="ip" title="终端IP" :formatter="formatter" width="120px"></vxe-column>
|
||||
|
||||
<vxe-column field="runFlag" title="运行状态" width="90px">
|
||||
<template #default="{ row }">
|
||||
<el-tag
|
||||
@@ -214,6 +215,7 @@ defineOptions({
|
||||
name: 'harmonic-boot/harmonic/getIntegrityData'
|
||||
})
|
||||
import { useRoute } from 'vue-router'
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME != 'jibei'
|
||||
const route = useRoute()
|
||||
const dictData = useDictData()
|
||||
//字典获取监督对象类型
|
||||
|
||||
@@ -744,16 +744,6 @@ const initEcharts = (color: string, key: number, name: string) => {
|
||||
}
|
||||
//渲染echarts
|
||||
const init = () => {
|
||||
loading.value = true
|
||||
const url = localStorage.getItem('WebSocketUrl') || 'ws://192.168.1.68:10407/api/pushMessage/'
|
||||
echartsDataV1.value = initEcharts('#DAA520', 0, 'A相')
|
||||
echartsDataV2.value = initEcharts('#2E8B57', 0, 'B相')
|
||||
echartsDataV3.value = initEcharts('#A52a2a', 0, 'C相')
|
||||
|
||||
echartsDataA1.value = initEcharts('#DAA520', 1, 'A相')
|
||||
echartsDataA2.value = initEcharts('#2E8B57', 1, 'B相')
|
||||
echartsDataA3.value = initEcharts('#A52a2a', 1, 'C相')
|
||||
|
||||
if (!dataSocket.socketServe) {
|
||||
console.error('WebSocket 客户端实例不存在')
|
||||
return
|
||||
@@ -765,9 +755,22 @@ const init = () => {
|
||||
type: 'warning'
|
||||
})
|
||||
}
|
||||
loading.value = true
|
||||
const url = localStorage.getItem('WebSocketUrl') || 'null' //'ws://192.168.1.68:10407/api/pushMessage/'
|
||||
echartsDataV1.value = initEcharts('#DAA520', 0, 'A相')
|
||||
echartsDataV2.value = initEcharts('#2E8B57', 0, 'B相')
|
||||
echartsDataV3.value = initEcharts('#A52a2a', 0, 'C相')
|
||||
|
||||
echartsDataA1.value = initEcharts('#DAA520', 1, 'A相')
|
||||
echartsDataA2.value = initEcharts('#2E8B57', 1, 'B相')
|
||||
echartsDataA3.value = initEcharts('#A52a2a', 1, 'C相')
|
||||
|
||||
let pids = monitoringPoint.state.pid.split(',')
|
||||
dataSocket.socketServe.connect(`${url}${adminInfo.id},${monitoringPoint.state.lineId},${pids[pids.length - 2]}`)
|
||||
dataSocket.socketServe.registerCallBack('message', (res: any) => {
|
||||
if (res.Flag === false) {
|
||||
return (loading.value = false)
|
||||
}
|
||||
txtContent.value = res.value
|
||||
let data = JSON.parse(res.value)
|
||||
time.value = data.TIME - 0
|
||||
@@ -779,12 +782,12 @@ const init = () => {
|
||||
iRmsA: data.I.A?.IRMS, //A相电流
|
||||
iRmsB: data.I.B?.IRMS, //B相电流
|
||||
iRmsC: data.I.C?.IRMS, //C相电流
|
||||
v1AngA: data.V.A?.VFUND_ANGLE, //A相基波电压相位
|
||||
v1AngB: data.V.B?.VFUND_ANGLE, //B相基波电压相位
|
||||
v1AngC: data.V.C?.VFUND_ANGLE, //C相基波电压相位
|
||||
i1AngA: data.I.A?.I_ANGLE, //A相基波电流相位
|
||||
i1AngB: data.I.B?.I_ANGLE, //B相基波电流相位
|
||||
i1AngC: data.I.C?.I_ANGLE, //C相基波电流相位
|
||||
v1AngA: steAngle(data.V.A?.VFUND_ANGLE), //A相基波电压相位
|
||||
v1AngB: steAngle(data.V.B?.VFUND_ANGLE), //B相基波电压相位
|
||||
v1AngC: steAngle(data.V.C?.VFUND_ANGLE), //C相基波电压相位
|
||||
i1AngA: steAngle(data.I.A?.I_ANGLE), //A相基波电流相位
|
||||
i1AngB: steAngle(data.I.B?.I_ANGLE), //B相基波电流相位
|
||||
i1AngC: steAngle(data.I.C?.I_ANGLE), //C相基波电流相位
|
||||
freq: data.V.T?.FREQ, //频率
|
||||
freqDev: data.V.T?.DELTA_FREQ, //频率偏差
|
||||
vUnbalance: data.V.T?.V_UNBAN, //电压不平衡度
|
||||
@@ -950,6 +953,20 @@ const setRealData = () => {
|
||||
]
|
||||
pieChart6.value.initChart()
|
||||
}
|
||||
const steAngle = (phase: any) => {
|
||||
// 空值判断
|
||||
if (phase === null || phase === undefined) {
|
||||
return null
|
||||
}
|
||||
let normalizedPhase = phase % 360
|
||||
if (normalizedPhase > 180) {
|
||||
normalizedPhase -= 360
|
||||
} else if (normalizedPhase < -180) {
|
||||
normalizedPhase += 360
|
||||
}
|
||||
|
||||
return normalizedPhase
|
||||
}
|
||||
defineExpose({ setRealData })
|
||||
onMounted(() => {
|
||||
init()
|
||||
|
||||
@@ -29,7 +29,11 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据筛选">
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="输入市公司、变电站、用户" />
|
||||
<el-input
|
||||
v-model="tableStore.table.params.searchValue"
|
||||
clearable
|
||||
placeholder="输入市公司、变电站、用户"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="通讯状态:">
|
||||
@@ -102,8 +106,6 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
@@ -115,6 +117,10 @@ import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/run/terminalmessage'
|
||||
})
|
||||
|
||||
const dictData = useDictData()
|
||||
|
||||
const view = ref(true)
|
||||
@@ -159,7 +165,7 @@ const tableStore = new TableStore({
|
||||
{ field: 'manufacturer', title: '厂家', minWidth: 100 },
|
||||
|
||||
{ field: 'devName', title: '终端名称', minWidth: 100 },
|
||||
{ field: 'ip', title: '网络参数' ,width:110 },
|
||||
{ field: 'ip', title: '网络参数', width: 110 },
|
||||
{ field: 'loginTime', title: '投运时间', minWidth: 90 },
|
||||
{ field: 'devType', title: '终端型号', minWidth: 100 },
|
||||
{ field: 'port', title: '端口', minWidth: 60 },
|
||||
@@ -186,8 +192,7 @@ const tableStore = new TableStore({
|
||||
正常: 'success',
|
||||
中断: 'danger'
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
],
|
||||
|
||||
beforeSearchFun: () => {
|
||||
@@ -199,11 +204,11 @@ const tableStore = new TableStore({
|
||||
|
||||
tableStore.table.params.runFlag = []
|
||||
if (tableStore.table.params.runF != null && tableStore.table.params.runF != '') {
|
||||
tableStore.table.params.runFlag = [tableStore.table.params.runF]
|
||||
tableStore.table.params.runFlag = tableStore.table.params.runF
|
||||
}
|
||||
tableStore.table.params.comFlag = []
|
||||
if (tableStore.table.params.comF != null&&tableStore.table.params.comF != '') {
|
||||
tableStore.table.params.comFlag = [tableStore.table.params.comF]
|
||||
if (tableStore.table.params.comF != null && tableStore.table.params.comF != '') {
|
||||
tableStore.table.params.comFlag = tableStore.table.params.comF
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -220,7 +225,6 @@ tableStore.table.params.scale = []
|
||||
tableStore.table.params.manufacturer = []
|
||||
tableStore.table.params.loadType = []
|
||||
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<vxe-column field="lineName" title="监测点" width="120"></vxe-column>
|
||||
<vxe-column field="featureAmplitude" title="暂降(骤升)幅值(%)">
|
||||
<template #default="{ row }">
|
||||
{{ (row.featureAmplitude * 100).toFixed(2) }}
|
||||
{{ row.featureAmplitude.toFixed(2) }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="duration" title="持续时间(s)"></vxe-column>
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
</template>
|
||||
</el-page-header>
|
||||
</el-form-item>
|
||||
<el-form-item label="过滤筛选">
|
||||
<el-form-item label="关键字筛选">
|
||||
<el-input
|
||||
style="width: 240px"
|
||||
v-model="tableStore.table.params.searchValue"
|
||||
clearable
|
||||
placeholder="请输入筛选数据"
|
||||
placeholder="请输入关键字筛选"
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user