修改测试bug

This commit is contained in:
guanj
2026-01-23 09:24:13 +08:00
parent 823d5f4475
commit def48e9c84
16 changed files with 196 additions and 123 deletions

View File

@@ -3,7 +3,7 @@ import createAxios from '@/utils/request'
// 获取设备补召页面数据
export function getMakeUpData(data: any) {
return createAxios({
url: '/cs-harmonic-boot/offlineDataUpload/makeUpData?lineId='+data,
url: '/cs-harmonic-boot/offlineDataUpload/makeUpData?lineId=' + data,
method: 'POST'
})
}
@@ -30,7 +30,14 @@ export function offlineDataUploadMakeUp(data: any) {
export function getListByIds() {
return createAxios({
url: '/cs-harmonic-boot/pqSensitiveUser/getListByIds',
method: 'POST',
method: 'POST'
})
}
// 根据id集合获取敏感负荷用户列表
export function getList(data) {
return createAxios({
url: '/cs-harmonic-boot/pqSensitiveUser/getList',
method: 'POST',
data
})
}

View File

@@ -17,7 +17,7 @@ import { yMethod } from '@/utils/echartMethod'
const prop = defineProps({
width: { type: [String, Number] },
height: { type: [String, Number] },
timeKey: { type: Array as () => string[] },
timeKey: { type: Array as () => string[] },
timeValue: { type: Object }
})
@@ -47,6 +47,7 @@ const init = () => {
tooltip: {
trigger: 'axis',
formatter: (params: any) => {
console.log('🚀 ~ init ~ params:', params)
if (!params || params.length === 0) return ''
// 使用第一个项目的轴标签作为时间标题
@@ -100,28 +101,33 @@ const initData = async (row: any) => {
}
// 处理每条相位数据
const seriesData = res.data.map((item: any) => {
const values = xAxisData.map((time: string, index: number) => {
// 将传入的日期与时间拼接成完整的时间字符串
const fullTime = `${row.time} ${time}`
const value = parseFloat(item.value.split(',')[index]) || 0
return [fullTime, value]
const seriesData = res.data
.filter(item => item.valueType == 'max')
.sort((a, b) => {
return a.phasic.localeCompare(b.phasic)
})
.map((item: any) => {
const values = xAxisData.map((time: string, index: number) => {
// 将传入的日期与时间拼接成完整的时间字符串
const fullTime = `${row.time} ${time}`
const value = parseFloat(item.value.split(',')[index]) || 0
return [fullTime, value]
})
return {
name: `${item.phasic}`,
type: 'line',
showSymbol: false,
smooth: true,
data: values,
itemStyle: {
normal: {
// 根据相位设置对应颜色
color: phaseColors[item.phasic] || config.layout.elementUiPrimary[0]
return {
name: `${item.phasic}`,
type: 'line',
showSymbol: false,
smooth: true,
data: values,
itemStyle: {
normal: {
// 根据相位设置对应颜色
color: phaseColors[item.phasic] || config.layout.elementUiPrimary[0]
}
}
}
}
})
})
echartList.value.yAxis.max = max
echartList.value.yAxis.min = min
// 更新图表配置

View File

@@ -10,8 +10,8 @@
ref="TableHeaderRef"
>
<template v-slot:select>
<el-form-item label="关键">
<el-input v-model="tableStore.table.params.keywords" clearable placeholder="请输关键字" />
<el-form-item label="关键字筛选">
<el-input v-model="tableStore.table.params.keywords" clearable placeholder="请输入监测点名称" />
</el-form-item>
</template>
</TableHeader>

View File

@@ -201,7 +201,7 @@ const setEchart = () => {
result += `<br/>${item.marker}${item.seriesName}: ${valueText}`
} else {
// 对于功率数据,正常显示数值
result += `<br/>${item.marker}${item.seriesName}: ${item.value[1]}`
result += `<br/>${item.marker}${item.seriesName}: ${item.value[1]} ${item.value[2]}`
}
})
return result
@@ -292,7 +292,8 @@ const setEchart = () => {
item.time,
item.statisticalData !== null && item.statisticalData !== undefined
? parseFloat(item.statisticalData.toFixed(2))
: null
: null,
item.unit
]
})
@@ -302,7 +303,8 @@ const setEchart = () => {
item.time,
item.statisticalData !== null && item.statisticalData !== undefined
? parseFloat(item.statisticalData.toFixed(2))
: null
: null,
item.unit
]
})

View File

@@ -93,7 +93,8 @@ import { useConfig } from '@/stores/config'
import { queryByCode, queryCsDictTree } from '@/api/system-boot/dictTree'
import { getListByIds } from '@/api/harmonic-boot/cockpit/cockpit'
import { getTime } from '@/utils/formatTime'
import { yMethod, exportCSV } from '@/utils/echartMethod'
import { max } from 'lodash'
const prop = defineProps({
w: { type: [String, Number] },
h: { type: [String, Number] },
@@ -262,6 +263,11 @@ const setEchart = () => {
titleText = afterData[0].anotherName
}
// statisticalData
// chartsListBefore.value.map((item: any) => item.statisticalData)
// chartsListAfter.value = tableStore.table.data.after
// 构建图例数据
const legendData = series.map((item: any, index: number) => {
let color = config.layout.elementUiPrimary[0]
@@ -291,7 +297,10 @@ const setEchart = () => {
}
}
})
let [min, max] = yMethod(
[...chartsListBefore.value.map((item: any) => item.statisticalData),
...chartsListAfter.value.map((item: any) => item.statisticalData)]
)
echartList.value = {
title: {
text: titleText
@@ -316,12 +325,13 @@ const setEchart = () => {
const xname = params[0].value[0]
let str = `${xname}<br>`
params.forEach((el: any, index: any) => {
console.log('🚀 ~ setEchart ~ el:', el)
let marker = ''
marker = `<span style="display:inline-block;border: 2px ${el.color} ${el.value[3]};margin-right:5px;width:40px;height:0px;background-color:#ffffff00;"></span>`
str += `${marker}${el.seriesName.split('(')[0]}${
el.value[1] != null ? el.value[1] + ' ' + (el.value[2] == 'null' ? '' : el.value[2]) : '-'
el.value[1] != null ? el.value[1] + ' ' + (el.value[2] == null ? '' : el.value[2]) : '-'
}<br>`
})
return str
@@ -350,7 +360,9 @@ const setEchart = () => {
}
},
yAxis: {
name: beforeData.length > 0 ? beforeData[0].unit : afterData.length > 0 ? afterData[0].unit : ''
name: beforeData.length > 0 ? beforeData[0].unit : afterData.length > 0 ? afterData[0].unit : '',
max: max,
min: min,
},
grid: {
left: '10px',
@@ -439,7 +451,7 @@ const shouldShowHarmonicCount = () => {
return (
currentIndicator &&
(currentIndicator.name.includes('电压谐波含有率') || currentIndicator.name.includes('电流谐波含有率'))
(currentIndicator.name.includes('幅值') || currentIndicator.name.includes('含有率'))
)
}
@@ -448,9 +460,9 @@ const getHarmonicTypeName = () => {
const currentIndicator = indicatorList.value.find((item: any) => item.id === tableStore.table.params.indicator)
if (currentIndicator) {
if (currentIndicator.name.includes('电压谐波含有率')) {
if (currentIndicator.name.includes('电压')) {
return '电压'
} else if (currentIndicator.name.includes('电流谐波含有率')) {
} else if (currentIndicator.name.includes('电流')) {
return '电流'
}
}

View File

@@ -52,6 +52,7 @@ getDeviceTree().then(res => {
item2.icon = 'el-icon-List'
item2.color = config.getColorVal('elementUiPrimary')
item2.children.forEach((item3: any) => {
item3.pName = '治理设备'
item3.icon = 'el-icon-Platform'
item3.level = 2
item3.color = config.getColorVal('elementUiPrimary')
@@ -95,6 +96,7 @@ getDeviceTree().then(res => {
item2.icon = 'el-icon-List'
item2.color = config.getColorVal('elementUiPrimary')
item2.children.forEach((item3: any) => {
item3.pName = '监测设备'
item3.icon = 'el-icon-Platform'
item3.color = config.getColorVal('elementUiPrimary')
if (item3.comFlag === 1) {

View File

@@ -25,7 +25,7 @@ import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import popupApi from './popupApi.vue'
import { deleteMenu } from '@/api/user-boot/function'
import { ElMessage } from 'element-plus'
defineOptions({
name: 'auth/menu/api'
})
@@ -95,6 +95,8 @@ const tableStore = new TableStore({
},
click: row => {
deleteMenu(row.id).then(() => {
ElMessage.success('删除成功!')
tableStore.index()
})
}

View File

@@ -17,7 +17,7 @@ import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import popupMenu from './popupMenu.vue'
import { delMenu } from '@/api/systerm'
import { ElMessage } from 'element-plus'
defineOptions({
name: 'auth/menu/menu'
})
@@ -89,6 +89,8 @@ const tableStore = new TableStore({
},
click: row => {
delMenu(row.id).then(() => {
ElMessage.success('删除成功!')
emits('init')
})
}

View File

@@ -58,7 +58,7 @@
import { ref, inject } from 'vue'
import { reactive } from 'vue'
import { update, add } from '@/api/user-boot/function'
import { ElMessage } from 'element-plus'
defineOptions({
name: 'auth/menu/popupApi'
})
@@ -114,11 +114,15 @@ const submit = async () => {
formRef.value.validate(async valid => {
if (valid) {
if (form.id) {
await update(form)
await update(form).then(() => {
ElMessage.success('修改成功!')
})
} else {
let obj = JSON.parse(JSON.stringify(form))
delete obj.id
await add(obj)
await add(obj).then(() => {
ElMessage.success('新增成功!')
})
}
emits('init')
dialogVisible.value = false

View File

@@ -56,7 +56,7 @@ import { reactive } from 'vue'
import TableStore from '@/utils/tableStore'
import IconSelector from '@/components/baInput/components/iconSelector.vue'
import { updateMenu, addMenu } from '@/api/systerm'
import { ElMessage } from 'element-plus'
defineOptions({
name: 'auth/menu/popupMenu'
})
@@ -118,14 +118,18 @@ const submit = async () => {
if (valid) {
if (form.id) {
form.pid = form.pid || '0'
await updateMenu(form)
await updateMenu(form).then(() => {
ElMessage.success('编辑成功!')
})
} else {
form.code = 'menu'
form.pid = form.pid || '0'
let obj = JSON.parse(JSON.stringify(form))
delete obj.id
await addMenu(obj)
await addMenu(obj).then(() => {
ElMessage.success('新增成功!')
})
}
emits('init')
dialogVisible.value = false

View File

@@ -57,33 +57,33 @@ const tabsList = ref([
])
const rankOptions = ref([
{
value: '1',
label: '1级'
value: '1,7',
label: '1级(ERROR)'
},
{
value: '2',
label: '2级'
value: '2,6',
label: '2级(WARN)'
},
{
value: '3',
label: '3级'
value: '3,4,5',
label: '3级(DEBUG,NORMAL)'
},
{
value: '4',
label: 'DEBUG'
},
{
value: '5',
label: 'NORMAL'
},
{
value: '6',
label: 'WARN'
},
{
value: '7',
label: 'ERROR'
}
// {
// value: '4',
// label: 'DEBUG'
// },
// {
// value: '5',
// label: 'NORMAL'
// },
// {
// value: '6',
// label: 'WARN'
// },
// {
// value: '7',
// label: 'ERROR'
// }
])
const tableStore = new TableStore({

View File

@@ -1,7 +1,7 @@
<template>
<TableHeader datePicker ref="refheader" showExport>
<template v-slot:select>
<el-form-item label="关键">
<el-form-item label="关键字筛选">
<el-input
maxlength="32"
show-word-limit
@@ -36,34 +36,34 @@ const props = defineProps(['deviceTree'])
const refheader = ref()
const rankOptions = ref([
{
value: '1',
label: '1级'
{
value: '1,7',
label: '1级(ERROR)'
},
{
value: '2',
label: '2级'
value: '2,6',
label: '2级(WARN)'
},
{
value: '3',
label: '3级'
value: '3,4,5',
label: '3级(DEBUG,NORMAL)'
},
{
value: '4',
label: 'DEBUG'
},
{
value: '5',
label: 'NORMAL'
},
{
value: '6',
label: 'WARN'
},
{
value: '7',
label: 'ERROR'
}
// {
// value: '4',
// label: 'DEBUG'
// },
// {
// value: '5',
// label: 'NORMAL'
// },
// {
// value: '6',
// label: 'WARN'
// },
// {
// value: '7',
// label: 'ERROR'
// }
])
const tableStore = new TableStore({
url: '/cs-harmonic-boot/eventUser/frontWarnInfo',

View File

@@ -158,6 +158,7 @@ const nodeClick = async (e: anyObj) => {
getDevCapacity(formInline.devId)
.then(res => {
devCapacity.value = res.data
search()
})
.catch(() => {

View File

@@ -646,7 +646,7 @@
:controls="false"
:min="1"
style="width: 48%"
oninput="value=value.replace(/[^\d]/g,'')"
oninput="value=value.replace(/[^\d]/g,'')"
v-model.number="lineItem.ptRatio"
:disabled="
!(
@@ -671,7 +671,7 @@
:controls="false"
:min="1"
style="width: 48%"
oninput="value=value.replace(/[^\d]/g,'')"
oninput="value=value.replace(/[^\d]/g,'')"
v-model.number="lineItem.pt2Ratio"
:disabled="
!(
@@ -696,7 +696,7 @@
:controls="false"
:min="1"
style="width: 48%"
oninput="value=value.replace(/[^\d]/g,'')"
oninput="value=value.replace(/[^\d]/g,'')"
v-model.number="lineItem.ctRatio"
:disabled="
!(
@@ -721,7 +721,7 @@
:controls="false"
:min="1"
style="width: 48%"
oninput="value=value.replace(/[^\d]/g,'')"
oninput="value=value.replace(/[^\d]/g,'')"
v-model.number="lineItem.ct2Ratio"
:disabled="
!(
@@ -1079,7 +1079,7 @@ import MacAddressInput from '@/components/form/mac/MacAddressInput.vue'
import { auditEngineering } from '@/api/cs-device-boot/edData'
import { convertToObject } from 'typescript'
import { Loading } from '@element-plus/icons-vue'
import { getListByIds } from '@/api/cs-harmonic-boot/recruitment'
import { getList } from '@/api/cs-harmonic-boot/recruitment'
import { getDicDataByTypeCode } from '@/api/system-boot/csDictData'
defineOptions({
@@ -2858,8 +2858,11 @@ const area = async () => {
console.error('查询过程中出现错误:', error)
})
getListByIds().then(res => {
userList.value = res.data
getList({
pageNum: 1,
pageSize: 2000
}).then(res => {
userList.value = res.data.records
})
}

View File

@@ -37,14 +37,16 @@
</div>
</div>
</el-collapse-item>
</el-collapse>
<div class="view_bot">
<vxe-table border height="" :data="realList" :column-config="{ resizable: true, tooltip: true }"
:tooltip-config="{ enterable: true }">
<vxe-table
border
height=""
:data="realList"
:column-config="{ resizable: true, tooltip: true }"
:tooltip-config="{ enterable: true }"
>
<vxe-colgroup align="center" :title="`电压有效值(${voltageUnit})`">
<vxe-column align="center" field="vRmsA" title="A相"></vxe-column>
<vxe-column align="center" field="vRmsB" title="B相"></vxe-column>
@@ -67,8 +69,13 @@
</vxe-colgroup>
</vxe-table>
<br />
<vxe-table border height="" :data="realList" :column-config="{ resizable: true, tooltip: true }"
:tooltip-config="{ enterable: true }">
<vxe-table
border
height=""
:data="realList"
:column-config="{ resizable: true, tooltip: true }"
:tooltip-config="{ enterable: true }"
>
<vxe-column align="center" field="freq" width="140" title="频率(Hz)"></vxe-column>
<vxe-column align="center" field="freqDev" width="120" title="频率偏差(Hz)"></vxe-column>
<vxe-column align="center" width="180" field="vUnbalance" title="电压不平衡度(%)"></vxe-column>
@@ -85,8 +92,13 @@
</vxe-colgroup>
</vxe-table>
<br />
<vxe-table border height="" :data="realList" :column-config="{ resizable: true, tooltip: true }"
:tooltip-config="{ enterable: true }">
<vxe-table
border
height=""
:data="realList"
:column-config="{ resizable: true, tooltip: true }"
:tooltip-config="{ enterable: true }"
>
<vxe-colgroup align="center" title="电压偏差(%)">
<vxe-column align="center" field="vDevA" title="A相"></vxe-column>
<vxe-column align="center" field="vDevB" title="B相"></vxe-column>
@@ -110,8 +122,13 @@
</vxe-colgroup>
</vxe-table>
<br />
<vxe-table border height="" :data="realList" :column-config="{ resizable: true, tooltip: true }"
:tooltip-config="{ enterable: true }">
<vxe-table
border
height=""
:data="realList"
:column-config="{ resizable: true, tooltip: true }"
:tooltip-config="{ enterable: true }"
>
<vxe-colgroup align="center" :title="`无功功率(${reactivePowerUnit})`">
<vxe-column align="center" field="qA" title="A相"></vxe-column>
<vxe-column align="center" field="qB" title="B相"></vxe-column>
@@ -142,10 +159,6 @@
</vxe-colgroup>
</vxe-table>
</div>
</div>
</template>
<script lang="ts" setup>
@@ -171,7 +184,7 @@ const echartsDataA1: any = ref({})
const echartsDataA2: any = ref({})
const echartsDataA3: any = ref({})
const currentDataLevel = ref('Primary')
const currentDataLevel = ref('Primary')
const previousDataLevel = ref('')
//渲染中间相角图
@@ -264,10 +277,17 @@ const initRadioCharts = () => {
}
},
// // 指针设置
// pointer: {
// length: '80%',
// width: 3
// },
// 指针设置
pointer: {
length: '80%',
width: 3
icon: 'path://m368.01136,209.80637l173.00807,-193.72679c19.14653,-21.43943 50.16392,-21.43943 69.31045,0l172.93149,193.72679c1.22537,1.37213 1.22537,3.51607 0,4.8882l-47.63657,53.34133c-1.22538,1.37213 -3.14003,1.37213 -4.36541,0l-113.65381,-127.26452c-1.91465,-2.14395 -5.20785,-0.60031 -5.20785,2.40122l0,731.94254c0,1.88667 -1.37855,3.43031 -3.06345,3.43031l-67.39579,0c-1.6849,0 -3.06345,-1.54364 -3.06345,-3.43031l0,-731.94254c0,-3.08728 -3.2932,-4.54517 -5.20785,-2.40122l-113.65381,127.26452c-1.22538,1.37213 -3.14003,1.37213 -4.36541,0l-47.63657,-53.34133c-1.22537,-1.37213 -1.22537,-3.51607 0,-4.88819l0,-0.00001M539,861.23064h73v800h-73z',
length: '90%',
width: 15,
opacity: 1
},
detail: {
show: false
@@ -364,10 +384,17 @@ const initRadioCharts = () => {
}
},
// // 指针设置
// pointer: {
// length: '90%',
// width: 6
// },
// 指针设置
pointer: {
icon: 'path://m368.01136,209.80637l173.00807,-193.72679c19.14653,-21.43943 50.16392,-21.43943 69.31045,0l172.93149,193.72679c1.22537,1.37213 1.22537,3.51607 0,4.8882l-47.63657,53.34133c-1.22538,1.37213 -3.14003,1.37213 -4.36541,0l-113.65381,-127.26452c-1.91465,-2.14395 -5.20785,-0.60031 -5.20785,2.40122l0,731.94254c0,1.88667 -1.37855,3.43031 -3.06345,3.43031l-67.39579,0c-1.6849,0 -3.06345,-1.54364 -3.06345,-3.43031l0,-731.94254c0,-3.08728 -3.2932,-4.54517 -5.20785,-2.40122l-113.65381,127.26452c-1.22538,1.37213 -3.14003,1.37213 -4.36541,0l-47.63657,-53.34133c-1.22537,-1.37213 -1.22537,-3.51607 0,-4.88819l0,-0.00001M539,861.23064h73v800h-73z',
length: '90%',
width: 6
width: 15,
opacity: 1
},
detail: {
show: false
@@ -549,25 +576,25 @@ const realList = ref<any>([])
// 计算电压单位
const voltageUnit = computed(() => {
return currentDataLevel.value === 'Primary' ? 'kV' : 'V'
return currentDataLevel.value === 'Primary' ? 'kV' : 'V'
})
// 计算功率单位
const powerUnit = computed(() => {
return currentDataLevel.value === 'Primary' ? 'kW' : 'W'
return currentDataLevel.value === 'Primary' ? 'kW' : 'W'
})
// 计算无功功率单位
const reactivePowerUnit = computed(() => {
return currentDataLevel.value === 'Primary' ? 'kVar' : 'Var'
return currentDataLevel.value === 'Primary' ? 'kVar' : 'Var'
})
// 计算视在功率单位
const apparentPowerUnit = computed(() => {
return currentDataLevel.value === 'Primary' ? 'kVA' : 'VA'
return currentDataLevel.value === 'Primary' ? 'kVA' : 'VA'
})
const setRealData = (val: any,dataLevel:string) => {
const setRealData = (val: any, dataLevel: string) => {
// 只有当 dataLevel 真正改变时才更新
if (dataLevel !== previousDataLevel.value) {
currentDataLevel.value = dataLevel
@@ -808,7 +835,6 @@ onMounted(() => {
}
:deep(.view_bot) {
.vxe-table--render-default .vxe-body--column:not(.col--ellipsis),
.vxe-table--render-default .vxe-footer--column:not(.col--ellipsis),
.vxe-table--render-default .vxe-header--column:not(.col--ellipsis) {

View File

@@ -15,7 +15,7 @@
</el-button> -->
<el-button
icon="el-icon-Refresh"
v-if="showButtom"
v-if="showButtom && pName == '治理设备'"
@click="handleRestartDevice"
type="primary"
:loading="deviceRestartLoading"
@@ -115,7 +115,7 @@ import { defaultAttribute } from '@/components/table/defaultAttribute'
const pageHeight = mainHeight(20)
const adminInfo = useAdminInfo()
const showButtom = ref(adminInfo.roleCode.includes('operation_manager') || adminInfo.roleCode.includes('root'))
const pName = ref('')
const loading = ref(true)
const nDid = ref<string>('')
const tableLoading = ref(false)
@@ -137,11 +137,13 @@ const deviceTypeChange = (val: any, obj: any) => {
}
// 树节点点击
const nodeClick = (e: anyObj) => {
console.log('🚀 ~ nodeClick ~ e:', e)
if (!e) {
loading.value = false
return
}
if (e.level == 2) {
pName.value = e.pName
nDid.value = e.ndid
loading.value = true
getDeviceData(e.id, 'rt', '').then((res: any) => {