修改云南测试用例
This commit is contained in:
@@ -7,8 +7,15 @@
|
||||
<script lang="ts" setup>
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import useSetTheme from '@/utils/setTheme'
|
||||
import { onMounted } from 'vue'
|
||||
useSetTheme()
|
||||
|
||||
onMounted(async () => {
|
||||
const response = await fetch('/')
|
||||
const WebSocketUrl:any = response.headers.get('X-WebSocket-Url')
|
||||
const MqttUrl:any = response.headers.get('X-MqttUrl-Url')
|
||||
localStorage.setItem('WebSocketUrl', WebSocketUrl)
|
||||
localStorage.setItem('MqttUrl', MqttUrl)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
@@ -166,3 +166,19 @@ export function updateDeviceProcess(data: any) {
|
||||
data
|
||||
})
|
||||
}
|
||||
//导出台账模板
|
||||
export function downTerminalTemplate() {
|
||||
return createAxios({
|
||||
url: '/device-boot/device/downTerminalTemplate',
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
//导出台账信息
|
||||
export function exportTerminalBase() {
|
||||
return createAxios({
|
||||
url: '/device-boot/device/exportTerminalBase',
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<vxe-table
|
||||
ref="tableRef"
|
||||
height="auto"
|
||||
:key="key"
|
||||
:data="tableStore.table.data"
|
||||
v-loading="tableStore.table.loading"
|
||||
v-bind="Object.assign({}, defaultAttribute, $attrs)"
|
||||
@@ -21,7 +22,6 @@
|
||||
:key="key + '-column'"
|
||||
v-for="(item, key) in tableStore.table.column"
|
||||
:tree-node="item.treeNode"
|
||||
|
||||
>
|
||||
<!-- tableStore 预设的列 render 方案 -->
|
||||
<template v-if="item.render" #default="scope">
|
||||
@@ -76,7 +76,7 @@ const config = useConfig()
|
||||
const tableRef = ref<VxeTableInstance>()
|
||||
const tableStore = inject('tableStore') as TableStoreClass
|
||||
const router = useRouter()
|
||||
|
||||
const key = ref(0)
|
||||
interface Props extends /* @vue-ignore */ Partial<InstanceType<typeof ElTable>> {
|
||||
isGroup?: boolean
|
||||
showOverflow?: boolean
|
||||
@@ -129,6 +129,7 @@ const handleSortChange = ({ column, order }: { column: TableColumn; order: 'asc'
|
||||
tableStore.table.params.pageNum = 1
|
||||
|
||||
tableStore.index()
|
||||
key.value += 1
|
||||
// // 在这里可以根据 column 和 order 进行相应的数据排序操作
|
||||
// if (order === 'asc') {
|
||||
// } else if (order === 'desc') {
|
||||
|
||||
@@ -1,17 +1,24 @@
|
||||
<template>
|
||||
|
||||
<Tree ref="treRef" :data="tree" style="height: 100%" :width="'100%'" :expanded="expanded" />
|
||||
</template>
|
||||
|
||||
<!-- <div class="mb10">
|
||||
<el-button type="primary" icon="el-icon-Download" size="small" @click="exportExcelTemplate" :loading="loading">模版下载</el-button>
|
||||
<el-button type="primary" icon="el-icon-Upload" size="small">导入</el-button>
|
||||
<el-button type="primary" icon="el-icon-Download" size="small" @click="ledgerEverywhere" :loading="loading1">导出</el-button>
|
||||
</div> -->
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick } from 'vue'
|
||||
import Tree from './index.vue'
|
||||
|
||||
import { getTerminalTree } from '@/api/device-boot/Business.ts'
|
||||
import { getTerminalTree,downTerminalTemplate,exportTerminalBase } from '@/api/device-boot/Business'
|
||||
import { useConfig } from '@/stores/config'
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||
defineOptions({
|
||||
name: 'govern/deviceTree'
|
||||
})
|
||||
const loading = ref(false)
|
||||
const loading1 = ref(false)
|
||||
const emit = defineEmits(['init'])
|
||||
const config = useConfig()
|
||||
const expanded: any = ref([])
|
||||
@@ -141,6 +148,44 @@ const info = (id: any) => {
|
||||
})
|
||||
})
|
||||
}
|
||||
// 下载模版
|
||||
const exportExcelTemplate = async() => {
|
||||
loading.value = true
|
||||
downTerminalTemplate().then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.ms-excel'
|
||||
})
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = '终端台账模版'
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
link.remove()
|
||||
})
|
||||
await setTimeout(() => {
|
||||
loading.value = false
|
||||
}, 0)
|
||||
}
|
||||
// 导出台账
|
||||
const ledgerEverywhere = async() => {
|
||||
loading1.value = true
|
||||
exportTerminalBase().then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.ms-excel'
|
||||
})
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = '终端台账'
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
link.remove()
|
||||
})
|
||||
await setTimeout(() => {
|
||||
loading1.value = false
|
||||
}, 0)
|
||||
}
|
||||
info('')
|
||||
|
||||
defineExpose({ info })
|
||||
|
||||
@@ -1,251 +1,238 @@
|
||||
import type { MqttClient, OnMessageCallback, IClientOptions, IClientSubscribeOptions } from 'mqtt';
|
||||
import mqtt from 'mqtt';
|
||||
import type { MqttClient, OnMessageCallback, IClientOptions, IClientSubscribeOptions } from 'mqtt'
|
||||
import mqtt from 'mqtt'
|
||||
|
||||
interface MQTTOptions {
|
||||
protocolId?: string;
|
||||
qos?: 0 | 1 | 2;
|
||||
clean?: boolean;
|
||||
connectTimeout?: number;
|
||||
clientId?: string;
|
||||
username?: string;
|
||||
password?: string;
|
||||
reconnectPeriod?: number; // 重连间隔(ms)
|
||||
maxReconnectTimes?: number; // 最大重连次数
|
||||
protocolId?: string
|
||||
qos?: 0 | 1 | 2
|
||||
clean?: boolean
|
||||
connectTimeout?: number
|
||||
clientId?: string
|
||||
username?: string
|
||||
password?: string
|
||||
reconnectPeriod?: number // 重连间隔(ms)
|
||||
maxReconnectTimes?: number // 最大重连次数
|
||||
}
|
||||
|
||||
class MQTT {
|
||||
private topic: string;
|
||||
private client: MqttClient | null = null;
|
||||
private isConnected: boolean = false;
|
||||
private reconnectCount: number = 0;
|
||||
private maxReconnectTimes: number;
|
||||
private reconnectPeriod: number;
|
||||
private isManuallyDisconnected: boolean = false;
|
||||
private defaultOptions: MQTTOptions = {
|
||||
protocolId: 'MQTT',
|
||||
qos: 2,
|
||||
clean: true,
|
||||
connectTimeout: 30 * 1000,
|
||||
clientId: `mqttjs_${Math.random().toString(16).substr(2, 8)}`,
|
||||
username: 't_user',
|
||||
password: 'njcnpqs',
|
||||
reconnectPeriod: 1000, // 默认1秒重试一次
|
||||
maxReconnectTimes: 3, // 默认最大重连5次
|
||||
};
|
||||
|
||||
constructor(topic: string, options: MQTTOptions = {}) {
|
||||
this.topic = topic;
|
||||
this.maxReconnectTimes = options.maxReconnectTimes || this.defaultOptions.maxReconnectTimes!;
|
||||
this.reconnectPeriod = options.reconnectPeriod || this.defaultOptions.reconnectPeriod!;
|
||||
|
||||
// 合并选项
|
||||
this.defaultOptions = { ...this.defaultOptions, ...options };
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化 MQTT 客户端
|
||||
* @returns Promise<void>
|
||||
*/
|
||||
async init(): Promise<void> {
|
||||
if (this.client) {
|
||||
throw new Error('MQTT 客户端已初始化');
|
||||
private topic: string
|
||||
private client: MqttClient | null = null
|
||||
private isConnected: boolean = false
|
||||
private reconnectCount: number = 0
|
||||
private maxReconnectTimes: number
|
||||
private reconnectPeriod: number
|
||||
private isManuallyDisconnected: boolean = false
|
||||
private defaultOptions: MQTTOptions = {
|
||||
protocolId: 'MQTT',
|
||||
qos: 2,
|
||||
clean: true,
|
||||
connectTimeout: 30 * 1000,
|
||||
clientId: `mqttjs_${Math.random().toString(16).substr(2, 8)}`,
|
||||
username: 't_user',
|
||||
password: 'njcnpqs',
|
||||
reconnectPeriod: 1000, // 默认1秒重试一次
|
||||
maxReconnectTimes: 3 // 默认最大重连5次
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetch('/');
|
||||
const mqttUrl = response.headers.get('X-Mqtt-Url') || 'ws://192.168.1.68:8083/mqtt';
|
||||
constructor(topic: string, options: MQTTOptions = {}) {
|
||||
this.topic = topic
|
||||
this.maxReconnectTimes = options.maxReconnectTimes || this.defaultOptions.maxReconnectTimes!
|
||||
this.reconnectPeriod = options.reconnectPeriod || this.defaultOptions.reconnectPeriod!
|
||||
|
||||
this.client = mqtt.connect(mqttUrl, this.defaultOptions as IClientOptions);
|
||||
this.setupEventListeners();
|
||||
|
||||
// 等待连接成功或超时
|
||||
return new Promise((resolve, reject) => {
|
||||
const timeout = setTimeout(() => {
|
||||
if (!this.isConnected) {
|
||||
reject(new Error('MQTT 连接超时'));
|
||||
}
|
||||
}, this.defaultOptions.connectTimeout);
|
||||
|
||||
this.client?.on('connect', () => {
|
||||
clearTimeout(timeout);
|
||||
this.isConnected = true;
|
||||
this.reconnectCount = 0; // 连接成功重置重连计数
|
||||
resolve();
|
||||
});
|
||||
|
||||
this.client?.on('error', (error) => {
|
||||
clearTimeout(timeout);
|
||||
console.error('MQTT 连接错误:', error);
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('初始化 MQTT 失败:', error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置事件监听器
|
||||
*/
|
||||
private setupEventListeners(): void {
|
||||
if (!this.client) return;
|
||||
|
||||
this.client.on('close', () => {
|
||||
console.log('MQTT 连接已关闭');
|
||||
this.isConnected = false;
|
||||
});
|
||||
|
||||
this.client.on('offline', () => {
|
||||
console.log('MQTT 客户端离线');
|
||||
this.isConnected = false;
|
||||
});
|
||||
|
||||
this.client.on('reconnect', () => {
|
||||
console.log(`MQTT 正在尝试重连 (${this.reconnectCount + 1}/${this.maxReconnectTimes})...`);
|
||||
|
||||
// 检查是否超过最大重连次数
|
||||
if (this.reconnectCount >= this.maxReconnectTimes) {
|
||||
console.log('已达到最大重连次数,停止重连');
|
||||
this.client?.end(true);
|
||||
this.client = null;
|
||||
return;
|
||||
}
|
||||
|
||||
this.reconnectCount++;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 订阅主题
|
||||
* @param subscribeOptions 可选的订阅选项
|
||||
* @returns Promise<void>
|
||||
*/
|
||||
async subscribe(subscribeOptions: IClientSubscribeOptions = {}): Promise<void> {
|
||||
if (!this.client || !this.isConnected) {
|
||||
throw new Error('MQTT 客户端未连接');
|
||||
// 合并选项
|
||||
this.defaultOptions = { ...this.defaultOptions, ...options }
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
this.client?.subscribe(
|
||||
this.topic,
|
||||
{ qos: this.defaultOptions.qos, ...subscribeOptions },
|
||||
(error) => {
|
||||
if (error) {
|
||||
console.error('订阅失败:', error);
|
||||
reject(error);
|
||||
} else {
|
||||
console.log('订阅成功');
|
||||
resolve();
|
||||
}
|
||||
/**
|
||||
* 初始化 MQTT 客户端
|
||||
* @returns Promise<void>
|
||||
*/
|
||||
async init(): Promise<void> {
|
||||
if (this.client) {
|
||||
throw new Error('MQTT 客户端已初始化')
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消订阅
|
||||
* @returns Promise<void>
|
||||
*/
|
||||
async unsubscribe(): Promise<void> {
|
||||
if (!this.client || !this.isConnected) {
|
||||
throw new Error('MQTT 客户端未连接');
|
||||
}
|
||||
try {
|
||||
const mqttUrl = localStorage.getItem('MqttUrl') || 'ws://192.168.1.68:8083/mqtt'
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
this.client?.unsubscribe(this.topic, (error) => {
|
||||
if (error) {
|
||||
console.error('取消订阅失败:', error);
|
||||
reject(error);
|
||||
} else {
|
||||
console.log('取消订阅成功');
|
||||
resolve();
|
||||
this.client = mqtt.connect(mqttUrl, this.defaultOptions as IClientOptions)
|
||||
this.setupEventListeners()
|
||||
|
||||
// 等待连接成功或超时
|
||||
return new Promise((resolve, reject) => {
|
||||
const timeout = setTimeout(() => {
|
||||
if (!this.isConnected) {
|
||||
reject(new Error('MQTT 连接超时'))
|
||||
}
|
||||
}, this.defaultOptions.connectTimeout)
|
||||
|
||||
this.client?.on('connect', () => {
|
||||
clearTimeout(timeout)
|
||||
this.isConnected = true
|
||||
this.reconnectCount = 0 // 连接成功重置重连计数
|
||||
resolve()
|
||||
})
|
||||
|
||||
this.client?.on('error', error => {
|
||||
clearTimeout(timeout)
|
||||
console.error('MQTT 连接错误:', error)
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
} catch (error) {
|
||||
console.error('初始化 MQTT 失败:', error)
|
||||
throw error
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置消息回调
|
||||
* @param callback 消息回调函数
|
||||
*/
|
||||
onMessage(callback: OnMessageCallback): void {
|
||||
if (!this.client) {
|
||||
throw new Error('MQTT 客户端未初始化');
|
||||
}
|
||||
this.client.on('message', callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布消息
|
||||
* @param message 要发布的消息
|
||||
* @param options 发布选项
|
||||
* @returns Promise<void>
|
||||
*/
|
||||
async publish(
|
||||
message: string | Buffer,
|
||||
options: { qos?: 0 | 1 | 2; retain?: boolean } = {}
|
||||
): Promise<void> {
|
||||
if (!this.client || !this.isConnected) {
|
||||
throw new Error('MQTT 客户端未连接');
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
this.client?.publish(
|
||||
this.topic,
|
||||
message,
|
||||
{ qos: this.defaultOptions.qos, ...options },
|
||||
(error) => {
|
||||
if (error) {
|
||||
console.error('消息发布失败:', error);
|
||||
reject(error);
|
||||
} else {
|
||||
console.log('消息发布成功');
|
||||
resolve();
|
||||
}
|
||||
/**
|
||||
* 设置事件监听器
|
||||
*/
|
||||
private setupEventListeners(): void {
|
||||
if (!this.client) return
|
||||
|
||||
this.client.on('close', () => {
|
||||
console.log('MQTT 连接已关闭')
|
||||
this.isConnected = false
|
||||
})
|
||||
|
||||
this.client.on('offline', () => {
|
||||
console.log('MQTT 客户端离线')
|
||||
this.isConnected = false
|
||||
})
|
||||
|
||||
this.client.on('reconnect', () => {
|
||||
console.log(`MQTT 正在尝试重连 (${this.reconnectCount + 1}/${this.maxReconnectTimes})...`)
|
||||
|
||||
// 检查是否超过最大重连次数
|
||||
if (this.reconnectCount >= this.maxReconnectTimes) {
|
||||
console.log('已达到最大重连次数,停止重连')
|
||||
this.client?.end(true)
|
||||
this.client = null
|
||||
return
|
||||
}
|
||||
|
||||
this.reconnectCount++
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 订阅主题
|
||||
* @param subscribeOptions 可选的订阅选项
|
||||
* @returns Promise<void>
|
||||
*/
|
||||
async subscribe(subscribeOptions: IClientSubscribeOptions = {}): Promise<void> {
|
||||
if (!this.client || !this.isConnected) {
|
||||
throw new Error('MQTT 客户端未连接')
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 断开连接
|
||||
* @param force 是否强制断开
|
||||
*/
|
||||
disconnect(force: boolean = false): void {
|
||||
this.isManuallyDisconnected = true;
|
||||
|
||||
if (this.client) {
|
||||
this.client.end(force, () => {
|
||||
console.log('MQTT 连接已断开');
|
||||
this.isConnected = false;
|
||||
this.client = null;
|
||||
});
|
||||
return new Promise((resolve, reject) => {
|
||||
this.client?.subscribe(this.topic, { qos: this.defaultOptions.qos, ...subscribeOptions }, error => {
|
||||
if (error) {
|
||||
console.error('订阅失败:', error)
|
||||
reject(error)
|
||||
} else {
|
||||
console.log('订阅成功')
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查连接状态
|
||||
* @returns boolean
|
||||
*/
|
||||
isConnectedToBroker(): boolean {
|
||||
return this.isConnected;
|
||||
}
|
||||
/**
|
||||
* 取消订阅
|
||||
* @returns Promise<void>
|
||||
*/
|
||||
async unsubscribe(): Promise<void> {
|
||||
if (!this.client || !this.isConnected) {
|
||||
throw new Error('MQTT 客户端未连接')
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前重连次数
|
||||
* @returns number
|
||||
*/
|
||||
getReconnectCount(): number {
|
||||
return this.reconnectCount;
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
this.client?.unsubscribe(this.topic, error => {
|
||||
if (error) {
|
||||
console.error('取消订阅失败:', error)
|
||||
reject(error)
|
||||
} else {
|
||||
console.log('取消订阅成功')
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置重连计数器
|
||||
*/
|
||||
resetReconnectCount(): void {
|
||||
this.reconnectCount = 0;
|
||||
}
|
||||
/**
|
||||
* 设置消息回调
|
||||
* @param callback 消息回调函数
|
||||
*/
|
||||
onMessage(callback: OnMessageCallback): void {
|
||||
if (!this.client) {
|
||||
throw new Error('MQTT 客户端未初始化')
|
||||
}
|
||||
this.client.on('message', callback)
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布消息
|
||||
* @param message 要发布的消息
|
||||
* @param options 发布选项
|
||||
* @returns Promise<void>
|
||||
*/
|
||||
async publish(message: string | Buffer, options: { qos?: 0 | 1 | 2; retain?: boolean } = {}): Promise<void> {
|
||||
if (!this.client || !this.isConnected) {
|
||||
throw new Error('MQTT 客户端未连接')
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
this.client?.publish(this.topic, message, { qos: this.defaultOptions.qos, ...options }, error => {
|
||||
if (error) {
|
||||
console.error('消息发布失败:', error)
|
||||
reject(error)
|
||||
} else {
|
||||
console.log('消息发布成功')
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 断开连接
|
||||
* @param force 是否强制断开
|
||||
*/
|
||||
disconnect(force: boolean = false): void {
|
||||
this.isManuallyDisconnected = true
|
||||
|
||||
if (this.client) {
|
||||
this.client.end(force, () => {
|
||||
console.log('MQTT 连接已断开')
|
||||
this.isConnected = false
|
||||
this.client = null
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查连接状态
|
||||
* @returns boolean
|
||||
*/
|
||||
isConnectedToBroker(): boolean {
|
||||
return this.isConnected
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前重连次数
|
||||
* @returns number
|
||||
*/
|
||||
getReconnectCount(): number {
|
||||
return this.reconnectCount
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置重连计数器
|
||||
*/
|
||||
resetReconnectCount(): void {
|
||||
this.reconnectCount = 0
|
||||
}
|
||||
}
|
||||
|
||||
export default MQTT;
|
||||
export default MQTT
|
||||
|
||||
@@ -44,11 +44,9 @@ export default class SocketService {
|
||||
return
|
||||
}
|
||||
|
||||
const response = await fetch('/')
|
||||
const WebSocketUrl = response.headers.get('X-WebSocket-Url')
|
||||
setTimeout(() => {
|
||||
// ws://192.168.1.69:10407/mgtt/api/pushMessage/
|
||||
const url = (WebSocketUrl || 'ws://192.168.1.68:10407/api/pushMessage/') + id
|
||||
const url = (localStorage.getItem('WebSocketUrl') || 'ws://192.168.1.68:10407/api/pushMessage/') + id
|
||||
this.ws = new WebSocket(url)
|
||||
|
||||
this.ws.onopen = () => this.handleOpen()
|
||||
|
||||
88
src/views/pqs/business/log/frontLog/index.vue
Normal file
88
src/views/pqs/business/log/frontLog/index.vue
Normal file
@@ -0,0 +1,88 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<TableHeader datePicker showExport>
|
||||
<template v-slot:select>
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入筛选数据" clearable />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef"></Table>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, reactive, nextTick } from 'vue'
|
||||
|
||||
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'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
|
||||
defineOptions({
|
||||
name: 'frontLog'
|
||||
})
|
||||
const pushDisplayRef = ref()
|
||||
const dictData = useDictData()
|
||||
const fontdveoption = dictData.getBasicData('Dev_Ops')
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/system-boot/frontLog/query',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{
|
||||
field: 'index',
|
||||
title: '序号',
|
||||
width: '80',
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
// { title: '名称', field: 'name', width: '200' },
|
||||
{
|
||||
title: '进程号',
|
||||
field: 'processNo',
|
||||
width: '80'
|
||||
},
|
||||
|
||||
{
|
||||
title: '业务名称',
|
||||
field: 'businessName',
|
||||
width: '250'
|
||||
},
|
||||
{
|
||||
title: '日志层级',
|
||||
field: 'level',
|
||||
width: '100'
|
||||
},
|
||||
|
||||
{
|
||||
title: '前置业务类型',
|
||||
field: 'frontType',
|
||||
width: '120'
|
||||
},
|
||||
{
|
||||
title: '更改时间',
|
||||
field: 'updateTime',
|
||||
width: '180',
|
||||
sortable: true
|
||||
},
|
||||
|
||||
{ title: '日志详情', field: 'log' }
|
||||
],
|
||||
beforeSearchFun: () => {}
|
||||
})
|
||||
|
||||
const tableRef = ref()
|
||||
provide('tableRef', tableRef)
|
||||
tableStore.table.params.type = ''
|
||||
tableStore.table.params.searchValue = ''
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
const addMenu = () => {}
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -54,8 +54,8 @@
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item style="right: 500px; position: absolute; overflow: hidden">
|
||||
<LocationInformation style="width: 16px; margin-right: 8px; color: #396" />
|
||||
<span style="font-size: 16px; font-weight: bold; color: #396">当前操作节点:</span>
|
||||
<LocationInformation style="width: 16px; margin-right: 8px; color: var(--el-color-primary)" />
|
||||
<span style="font-size: 16px; font-weight: bold; color: var(--el-color-primary)">当前操作节点:</span>
|
||||
</el-form-item>
|
||||
<el-form-item style="right: 0; position: absolute; overflow: hidden">
|
||||
<div class="title" :class="titleList.length > 5 ? 'titleScroll' : ''">
|
||||
|
||||
@@ -120,7 +120,7 @@ const tableStore = new TableStore({
|
||||
{ field: 'gdName', title: '供电公司', minWidth: '120' },
|
||||
{ field: 'subName', title: '变电站', minWidth: '150' },
|
||||
{ field: 'ip', title: '网络参数', minWidth: '110' },
|
||||
{ field: 'scale', title: '电压等级', minWidth: '90' },
|
||||
{ field: 'scale', title: '电压等级', minWidth: '110' },
|
||||
{
|
||||
field: 'advanceType',
|
||||
title: '暂降类型',
|
||||
@@ -140,7 +140,7 @@ const tableStore = new TableStore({
|
||||
{
|
||||
field: 'eventType',
|
||||
title: '暂态统计类型',
|
||||
minWidth: '100',
|
||||
minWidth: '120',
|
||||
formatter: (row: any) => {
|
||||
return eventList.filter(item => item.id === row.cellValue)[0]?.name
|
||||
}
|
||||
@@ -153,7 +153,7 @@ const tableStore = new TableStore({
|
||||
{
|
||||
field: 'featureAmplitude',
|
||||
title: '暂降幅值(%)',
|
||||
minWidth: '90',
|
||||
minWidth: '110',
|
||||
formatter: (row: any) => {
|
||||
return (row.cellValue * 100).toFixed(2)
|
||||
}
|
||||
@@ -161,14 +161,14 @@ const tableStore = new TableStore({
|
||||
{
|
||||
field: 'eventDescribe',
|
||||
title: '暂降深度(%)',
|
||||
minWidth: '90',
|
||||
minWidth: '110',
|
||||
formatter: (row: any) => {
|
||||
let data: any = (100 - row.row.featureAmplitude * 100).toFixed(2)
|
||||
|
||||
return data >= 0 ? data : '/'
|
||||
}
|
||||
},
|
||||
{ field: 'duration', title: '持续时间(s)', minWidth: '80' },
|
||||
{ field: 'duration', title: '持续时间(s)', minWidth: '100' },
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
|
||||
@@ -252,27 +252,27 @@ const tableStore = new TableStore({
|
||||
return row.cellValue == 3.14159 ? '暂无数据' : row.cellValue.toFixed(2)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '评估',
|
||||
field: 'valueOver',
|
||||
align: 'center',
|
||||
effect: 'dark',
|
||||
render: 'tag',
|
||||
custom: {
|
||||
null: 'info',
|
||||
0: 'danger',
|
||||
1: 'success',
|
||||
2: 'primary',
|
||||
3: 'danger'
|
||||
},
|
||||
replaceValue: {
|
||||
null: '暂无评估',
|
||||
0: '暂无评估',
|
||||
1: '优秀',
|
||||
2: '合格',
|
||||
3: '不合格'
|
||||
}
|
||||
}
|
||||
// {
|
||||
// title: '评估',
|
||||
// field: 'valueOver',
|
||||
// align: 'center',
|
||||
// effect: 'dark',
|
||||
// render: 'tag',
|
||||
// custom: {
|
||||
// null: 'info',
|
||||
// 0: 'danger',
|
||||
// 1: 'success',
|
||||
// 2: 'primary',
|
||||
// 3: 'danger'
|
||||
// },
|
||||
// replaceValue: {
|
||||
// null: '暂无评估',
|
||||
// 0: '暂无评估',
|
||||
// 1: '优秀',
|
||||
// 2: '合格',
|
||||
// 3: '不合格'
|
||||
// }
|
||||
// }
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.deptIndex = formData.value.deptIndex
|
||||
|
||||
@@ -98,7 +98,9 @@ import TableStore from '@/utils/tableStore'
|
||||
import waveForm from '@/components/echarts/waveForm.vue'
|
||||
import html2canvas from 'html2canvas'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { yMethod } from '@/utils/echartMethod'
|
||||
import * as echarts from 'echarts' // 全引入
|
||||
import { min } from 'xe-utils'
|
||||
const datePickerRef = ref()
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const checked = ref(monitoringPoint.state.showCheckBox)
|
||||
@@ -131,6 +133,7 @@ const tableStore = new TableStore({
|
||||
method: 'POST',
|
||||
column: []
|
||||
})
|
||||
const tableData = ref([])
|
||||
const tableHeaderRef = ref()
|
||||
const options = ref({})
|
||||
const traceability = ref<any>([])
|
||||
@@ -201,6 +204,7 @@ const init = () => {
|
||||
}
|
||||
const shujuchuli = (res: any) => {
|
||||
let shujuData = res.data
|
||||
tableData.value = res.data
|
||||
shujuData.forEach((item: any, i: number) => {
|
||||
//判断是否存在暂降点
|
||||
|
||||
@@ -269,7 +273,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
maxValue: item.maxValue.toFixed(3),
|
||||
@@ -321,7 +327,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
maxValue: item.maxValue.toFixed(3),
|
||||
@@ -337,7 +345,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
minValue: null,
|
||||
@@ -407,7 +417,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
maxValue: item.maxValue.toFixed(3),
|
||||
@@ -450,7 +462,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
maxValue: item.maxValue.toFixed(3),
|
||||
@@ -465,7 +479,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
minValue: null,
|
||||
@@ -530,7 +546,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
maxValue: item.maxValue.toFixed(3),
|
||||
@@ -573,7 +591,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
maxValue: item.maxValue.toFixed(3),
|
||||
@@ -588,7 +608,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
minValue: null,
|
||||
@@ -653,7 +675,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
minValue: item.minValue > 1 ? (item.minValue - 0.5).toFixed(3) : item.minValue.toFixed(3),
|
||||
@@ -696,7 +720,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
minValue: item.minValue.toFixed(3),
|
||||
@@ -710,7 +736,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
minValue: null,
|
||||
@@ -774,7 +802,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
maxValue: item.maxValue.toFixed(3),
|
||||
@@ -814,7 +844,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
maxValue: item.maxValue.toFixed(3),
|
||||
@@ -830,7 +862,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
minValue: null,
|
||||
@@ -890,7 +924,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
maxValue: item.maxValue.toFixed(3),
|
||||
@@ -927,7 +963,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
minValue: item.minValue.toFixed(3),
|
||||
@@ -941,7 +979,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
minValue: null,
|
||||
@@ -1001,7 +1041,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
minValue: item.minValue.toFixed(3),
|
||||
@@ -1038,7 +1080,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
minValue: item.minValue.toFixed(3),
|
||||
@@ -1052,7 +1096,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
minValue: null,
|
||||
@@ -1107,7 +1153,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
minValue: item.minValue.toFixed(3),
|
||||
@@ -1138,7 +1186,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
minValue: item.minValue.toFixed(3),
|
||||
@@ -1151,7 +1201,9 @@ const shujuchuli = (res: any) => {
|
||||
let shuju = {
|
||||
id: 'qushifenx' + i,
|
||||
title: item.lineName + '--' + item.targetName,
|
||||
wiringMethod: item.wiringMethod || '0',
|
||||
targetName: item.targetName,
|
||||
value: item.value,
|
||||
legend: item.phaiscType,
|
||||
valueName: item.unit[0],
|
||||
minValue: null,
|
||||
@@ -1390,11 +1442,25 @@ const rendering = () => {
|
||||
}
|
||||
const getEcharts = () => {
|
||||
list.value.forEach((item: any, i: number) => {
|
||||
console.log('🚀 ~ getEcharts ~ item:', item)
|
||||
|
||||
const values = item.value && item.value.length > 0 ? item.value.map(k => k[1]) : [0]
|
||||
let [min, max] = yMethod([item.maxValue, item.minValue, ...values])
|
||||
item.option = {
|
||||
backgroundColor: '#fff',
|
||||
title: {
|
||||
left: 'center',
|
||||
text: item.title
|
||||
text: item.title,
|
||||
subtext:
|
||||
item.wiringMethod == '1'
|
||||
? item.targetName == '相电压有效值'
|
||||
? '该监测点为三角型接线,相电压有效值没有数据'
|
||||
: ''
|
||||
: '', // 副标题
|
||||
subtextStyle: {
|
||||
fontSize: 14,
|
||||
color: '#ff0000'
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
@@ -1531,6 +1597,7 @@ const getEcharts = () => {
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
name: '时间',
|
||||
type: 'time',
|
||||
axisLine: {
|
||||
show: true,
|
||||
@@ -1556,9 +1623,12 @@ const getEcharts = () => {
|
||||
{
|
||||
type: 'value',
|
||||
|
||||
// min: item.minValue,
|
||||
min: min,
|
||||
max: max,
|
||||
name: item.valueName,
|
||||
minInterval: 1,
|
||||
// max:10,
|
||||
// min:0,
|
||||
// axisLabel: {
|
||||
// interval: 0,
|
||||
// // formatter: function (value: any) {
|
||||
|
||||
@@ -229,20 +229,20 @@ const init = () => {
|
||||
opacity: 0.35,
|
||||
fontSize: 14
|
||||
},
|
||||
backgroundColor: 'rgba(0,0,0,0.55)'
|
||||
// formatter: function (params: any) {
|
||||
// //console.log(params)
|
||||
// let msg = ''
|
||||
// msg += params[0].name + '<br/>'
|
||||
// for (let i in params) {
|
||||
// if (params[i].data == 1) {
|
||||
// msg += params[i].seriesName + ': 暂无数据<br/>'
|
||||
// } else {
|
||||
// msg += params[i].seriesName + ': ' + params[i].data + '<br/>'
|
||||
// }
|
||||
// }
|
||||
// return msg
|
||||
// }
|
||||
backgroundColor: 'rgba(0,0,0,0.55)',
|
||||
formatter: function (params: any) {
|
||||
//console.log(params)
|
||||
let msg = ''
|
||||
msg += params[0].name + '<br/>'
|
||||
for (let i in params) {
|
||||
if (params[i].data == 3.14159) {
|
||||
msg +=params[i].marker+ params[i].seriesName + ': 暂无数据<br/>'
|
||||
} else {
|
||||
msg += params[i].marker+ params[i].seriesName + ': ' + params[i].data + '<br/>'
|
||||
}
|
||||
}
|
||||
return msg
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
name: '指标类型',
|
||||
|
||||
@@ -63,8 +63,10 @@ const init = () => {
|
||||
formData.searchBeginTime = datePickerRef.value.timeValue[0]
|
||||
formData.searchEndTime = datePickerRef.value.timeValue[1]
|
||||
getHarmInHarmData(formData).then((res: any) => {
|
||||
let xName = ''
|
||||
analysisData.value = []
|
||||
if (formData.harmState === 1) {
|
||||
xName = 'A'
|
||||
analysisData.value.push(
|
||||
{
|
||||
name: '谐波电流幅值(A)',
|
||||
@@ -82,6 +84,7 @@ const init = () => {
|
||||
}
|
||||
)
|
||||
} else {
|
||||
xName = '%'
|
||||
analysisData.value.push(
|
||||
{
|
||||
name: '谐波电压含有率(%)',
|
||||
@@ -101,10 +104,12 @@ const init = () => {
|
||||
}
|
||||
options.value = {
|
||||
xAxis: {
|
||||
name: '次数',
|
||||
type: 'category',
|
||||
data: Array.from({ length: 49 }, (_, i) => `${i + 2}次`)
|
||||
},
|
||||
yAxis: {
|
||||
name: xName,
|
||||
type: 'value'
|
||||
},
|
||||
color: ['#2E8B57', '#DAA520'],
|
||||
|
||||
@@ -29,13 +29,13 @@
|
||||
<span>{{ (pageNum - 1) * pageSize + rowIndex + 1 }}</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="time" title="时间" :formatter="formatter" ></vxe-column>
|
||||
<vxe-column
|
||||
field="targetName"
|
||||
title="指标类型"
|
||||
min-width="100px"
|
||||
></vxe-column>
|
||||
<vxe-column field="phaseType" title="相别" width="80px"></vxe-column>
|
||||
<vxe-column field="time" title="时间" :formatter="formatter"></vxe-column>
|
||||
<vxe-column field="targetName" title="指标类型" min-width="100px"></vxe-column>
|
||||
<vxe-column field="phaseType" title="相别" width="80px">
|
||||
<template v-slot="{ row }">
|
||||
{{ row.phaseType == 'T' ? '/' : row.phaseType }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
|
||||
<vxe-column field="type" title="数据类型" width="105px" :formatter="formatter"></vxe-column>
|
||||
<vxe-column field="val" title="值" width="85px" :formatter="formatter"></vxe-column>
|
||||
|
||||
@@ -31,9 +31,13 @@
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="time" title="时间" width="150px"></vxe-column>
|
||||
<vxe-column field="targetName" title="指标类型" min-width="100px"></vxe-column>
|
||||
<vxe-column field="phaseType" title="相别" width="60px"></vxe-column>
|
||||
<vxe-column field="rangeDesc" title="合理范围" min-width="60px"></vxe-column>
|
||||
<vxe-column field="targetName" title="指标类型" min-width="80px"></vxe-column>
|
||||
<vxe-column field="phaseType" title="相别" width="60px">
|
||||
<template v-slot="{ row }">
|
||||
{{ row.phaseType=='T'?'/':row.phaseType }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="rangeDesc" title="合理范围" min-width="90px"></vxe-column>
|
||||
<vxe-column field="max" title="最大" width="85px" :formatter="formatter"></vxe-column>
|
||||
<vxe-column field="min" title="最小" width="85px" :formatter="formatter"></vxe-column>
|
||||
<vxe-column field="avg" title="平均" width="85px" :formatter="formatter"></vxe-column>
|
||||
|
||||
@@ -107,9 +107,9 @@ const handleCheckedSourceChange = (val: any) => {
|
||||
const info = async (list: any) => {
|
||||
datalist.value = []
|
||||
list.forEach((item: any) => {
|
||||
if (item.eventValue < 2 && item.eventValue > 0) {
|
||||
// if (item.eventValue < 2 && item.eventValue > 0) {
|
||||
datalist.value.push(item)
|
||||
}
|
||||
// }
|
||||
})
|
||||
await gongfunction()
|
||||
|
||||
@@ -302,6 +302,7 @@ const info = async (list: any) => {
|
||||
radioChange(radio.value)
|
||||
}
|
||||
const radioChange = (e: any) => {
|
||||
|
||||
if (e == 'ITIC') {
|
||||
echartList.value = ITIC.value
|
||||
TableData.value[0].totalEvents = pointI.value.length + pointIun.value.length
|
||||
@@ -329,6 +330,7 @@ const gongfunction = () => {
|
||||
if (total == 0) {
|
||||
} else {
|
||||
for (var i = 0; i < datalist.value.length; i++) {
|
||||
|
||||
var point = []
|
||||
var xx = datalist.value[i].persistTime
|
||||
var yy = datalist.value[i].eventValue * 100
|
||||
@@ -413,6 +415,8 @@ const gongfunction = () => {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (xx < 0.05) {
|
||||
standF++
|
||||
pointF.value.push({
|
||||
|
||||
@@ -53,6 +53,8 @@ const tableStore = new TableStore({
|
||||
}
|
||||
},
|
||||
loadCallback: () => {
|
||||
|
||||
|
||||
if (activeName.value == '1') {
|
||||
Statistics.value.info(tableStore.table.data)
|
||||
} else {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<div class="first">
|
||||
<div class="mb10">DISDIP表格(国际发配电联盟UNIPEDE)</div>
|
||||
<div style="flex: 1; overflow: hidden">
|
||||
<vxe-table v-bind="defaultAttribute" height="100%" size="mini" :data="firstData">
|
||||
<vxe-table v-bind="defaultAttribute" height="400px" size="mini" :data="firstData">
|
||||
<vxe-colgroup title="剩余电压" field="name" width="80px"></vxe-colgroup>
|
||||
<vxe-colgroup title="持续时间">
|
||||
<vxe-column field="twentyMs" title="20ms" :formatter="formatter" />
|
||||
@@ -30,7 +30,7 @@
|
||||
<div class="second">
|
||||
<div class="mb10">EC61000-4-11(用电终端的电压暂降抗度)</div>
|
||||
<div style="flex: 1; overflow: hidden">
|
||||
<vxe-table v-bind="defaultAttribute" height="100%" size="mini" :data="secondData">
|
||||
<vxe-table v-bind="defaultAttribute" height="220px" size="mini" :data="secondData">
|
||||
<vxe-colgroup title="剩余电压" field="name" width="80px"></vxe-colgroup>
|
||||
<vxe-colgroup title="持续时间">
|
||||
<vxe-column field="tenTwentyMs" title="10-20ms" :formatter="formatter" />
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
<div v-show="view">
|
||||
<!-- 表头 -->
|
||||
<TableHeader date-picker showExport>
|
||||
<!-- <template v-slot:operation>
|
||||
<template v-slot:operation>
|
||||
<el-button :icon='Download' type='primary' @click='download'>下载波形</el-button>
|
||||
</template> -->
|
||||
</template>
|
||||
</TableHeader>
|
||||
<!-- 表格 -->
|
||||
<Table ref='tableRef' :checkboxConfig='checkboxConfig' />
|
||||
@@ -48,10 +48,10 @@ const tableStore = new TableStore({
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ title: '变电站名称', field: 'subName', minWidth: '130' },
|
||||
{ title: '变电站名称', field: 'subName', minWidth: '140' },
|
||||
{ title: '监测点名称', field: 'lineName', minWidth: '130' },
|
||||
{ title: '网络参数', field: 'ip', minWidth: '130' },
|
||||
{ title: '电压等级(kV)', field: 'voltageScale', width: '100' },
|
||||
{ title: '电压等级(kV)', field: 'voltageScale', width: '120' },
|
||||
{ title: '暂降发生时刻', field: 'startTime', width: '200' },
|
||||
{ title: '暂降类型', field: 'advanceType', minWidth: '130' },
|
||||
{ title: '暂降原因', field: 'advanceReason', minWidth: '130' },
|
||||
@@ -61,12 +61,14 @@ const tableStore = new TableStore({
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '暂降(骤升)幅值(%)', field: 'featureAmplitude', minWidth: '120', formatter: (row: any) => {
|
||||
title: '暂降(骤升)幅值(%)', field: 'featureAmplitude', minWidth: '140',
|
||||
|
||||
formatter: (row: any) => {
|
||||
return (row.cellValue * 100).toFixed(2)
|
||||
},
|
||||
|
||||
},
|
||||
{ title: '持续时间(s)', field: 'duration', minWidth: '80' },
|
||||
{ title: '持续时间(s)', field: 'duration', minWidth: '100' },
|
||||
// { title: '严重度', field: 'severity', minWidth: '80' },
|
||||
{
|
||||
title: '操作',
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
<el-descriptions-item>
|
||||
<!-- <el-button type="primary" size="small" @click="lookPoint">查看监测点</el-button> -->
|
||||
<el-button type="primary" size="small" @click="lookEvent">
|
||||
未处理事件({{ infoWindowPoint.noDealCount }})
|
||||
暂态事件({{ infoWindowPoint.noDealCount }})
|
||||
</el-button>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog draggable class="cn-operate-dialog" v-model="dialogVisible" title="暂降事件列表">
|
||||
<el-dialog draggable width="1100px" v-model="dialogVisible" title="暂降事件列表">
|
||||
<div style="height: 40vh">
|
||||
<vxe-table v-loading="loading" height="auto" auto-resize :data="tableData" v-bind="defaultAttribute">
|
||||
<vxe-column type="seq" title="序号" width="80px"></vxe-column>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<div class="overview-right-item" style="padding-top: 0">
|
||||
<div class="overview-right-item-title">
|
||||
<div style="font-weight: 700">未处理暂态事件</div>
|
||||
<el-button type="primary" size="small" icon="el-icon-Promotion" @click="jump">事件关联分析</el-button>
|
||||
<!-- <el-button type="primary" size="small" icon="el-icon-Promotion" @click="jump">事件关联分析</el-button> -->
|
||||
</div>
|
||||
<div style="flex: 1; overflow: hidden">
|
||||
<vxe-table height="auto" auto-resize :data="tableData" v-bind="defaultAttribute">
|
||||
|
||||
Reference in New Issue
Block a user