修改测试bug

This commit is contained in:
GGJ
2024-12-11 11:33:44 +08:00
parent 22d85dfca1
commit 26c971f3b0
10 changed files with 197 additions and 108 deletions

View File

@@ -54,7 +54,7 @@ interface Props {
showSearch?: boolean
nextFlag?: boolean //控制时间是否可以往后推
theCurrentTime?: boolean //控制时间前3天展示上个月时间
showReset?: boolean //控制时间前3天展示上个月时间
showReset?: boolean //是否显示重置
}
const props = withDefaults(defineProps<Props>(), {

View File

@@ -26,7 +26,7 @@ import { defaultAttribute } from '@/components/table/defaultAttribute'
import { mainHeight } from '@/utils/layout'
const emit = defineEmits(['back'])
const dialogVisible = ref(false)
const tableHeight = mainHeight(550)
const tableHeight = mainHeight(440)
const height = ref(0)
height.value = window.innerHeight < 1080 ? 230 : 450

View File

@@ -109,6 +109,13 @@
:value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="数据来源" v-if="dataSet.includes('_items')">
<el-select v-model="formInline.targetType" >
<el-option v-for="item in dataSource" :key="item.id" :label="item.name"
:value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="关键字" v-if="!dataSet.includes('_')">
<el-input style="width: 160px" v-model="searchValue" autocomplete="off" clearable
@input="handleSearch" placeholder="请输入关键词"></el-input>
@@ -640,6 +647,7 @@ const handleaddDevice = () => {
const deviceId: any = ref('')
const lineId: any = ref('')
const dataLevel: any = ref('')
const dataSource=ref([])
const nodeClick = async (e: anyObj) => {
// console.log("🚀 ~ nodeClick ~ e:", e)
if (e.level == 2) return
@@ -698,6 +706,7 @@ const nodeClick = async (e: anyObj) => {
if (item.type === 'event') {
item.id = item.id + '_event'
}
// 测试项日志
if (item.type === 'items') {
item.id = item.id + '_items'
}

View File

@@ -68,7 +68,7 @@ import { color } from '@/components/echarts/color'
import { ElMessage } from 'element-plus'
const dictData = useDictData()
defineOptions({
name: 'govern/device/control'
// name: 'govern/device/control'
})
const props = defineProps({
TrendList: {
@@ -229,7 +229,7 @@ const init = async () => {
if (item.phase == null) {
key = item.unit
} else {
key = item.unit
key = item.anotherName
}
if (!acc[key]) {
@@ -283,8 +283,17 @@ const init = async () => {
const xname = params[0].value[0]
let str = `${xname}<br>`
params.forEach((el: any, index: any) => {
let marker = ''
if (el.value[3] == 'dashed') {
for (let i = 0; i < 3; i++) {
marker += `<span style="display:inline-block;border: 2px ${el.color} solid;margin-right:5px;width:10px;height:0px;background-color:#ffffff00;"></span>`
}
} else {
marker = `<span style="display:inline-block;border: 2px ${el.color} ${el.value[3]};margin-right:5px;width:40px;height:0px;background-color:#ffffff00;"></span>`
}
let unit = el.value[2] ? el.value[2] : ''
str += `${el.marker}${el.seriesName.split('(')[0]}${el.value[1]}${unit}
str += `${marker}${el.seriesName.split('(')[0]}${el.value[1]}${unit}
<br>`
})
return str
@@ -398,7 +407,7 @@ const init = async () => {
yMethodList.push(cc.statisticalData?.toFixed(2) - 0)
}
seriesList.push([cc.time, cc.statisticalData?.toFixed(2), cc.unit])
seriesList.push([cc.time, cc.statisticalData?.toFixed(2), cc.unit, lineStyle[lineS].type])
})
// console.log(kk);
@@ -412,7 +421,7 @@ const init = async () => {
symbol: 'none',
data: seriesList,
lineStyle: lineStyle[lineS],
yAxisIndex: index
yAxisIndex: setList.indexOf(kk[0].unit)
})
})
let [min, max] = yMethod(yMethodList)
@@ -572,6 +581,7 @@ const countData: any = ref([])
//根据选择的指标处理谐波次数
const formatCountOptions = (list: any) => {
countData.value = []
if (list.length != 0) {
list.map((item: any, index: any) => {
if (!countData.value[index]) {
@@ -632,6 +642,14 @@ const onCountChange = (val: any, index: any) => {
const flag = ref(true)
const onIndexChange = (val: any) => {
num.value += 1
let pp: any = []
indexOptions.value.forEach((item: any) => {
const filteredResult = val.filter(vv => item.id == vv);
if (filteredResult.length > 0) {
pp.push(filteredResult[0]);
}
})
searchForm.value.index = pp
flag.value = true

View File

@@ -1,9 +1,9 @@
<template>
<!-- 测试项日志 -->
<div :style="{ height: height }">
<vxe-table height="auto" auto-resize :data="dataList" v-bind="defaultAttribute" :key="key">
<vxe-column v-for="item in column" :field="item.field" :title="item.title" :formatter="formatter"
:min-width="item.width"></vxe-column>
:min-width="item.width" :sortable="item.sortable"></vxe-column>
<vxe-column title="操作" fixed="right" width="100">
<template v-slot:default="scoped">
<el-button link type="danger" @click="remove(scoped.row)">删除</el-button>
@@ -26,24 +26,25 @@ const voltageLevelList: any = dictData.getBasicData('Dev_Voltage_Stand')
import { deleteItem } from '@/api/cs-device-boot/csGroup'
const volConTypeList = dictData.getBasicData('Dev_Connect')
const emit = defineEmits(['onSubmit'])
const height = mainHeight(325).height
const height = mainHeight(295).height
const dataList = ref([])
const key: any = ref(0)
const column: any = ref([
{ field: 'itemName', title: '名称', width: '100px' },
{ field: 'startTime', title: '数据起始时间', width: '140px' },
{ field: 'endTime', title: '数据结束时间', width: '140px' },
{ field: 'statisticalInterval', title: '统计间隔', width: '100px' },
{ field: 'voltageLevel', title: '电压等级', width: '100px' },
{ field: 'volConType', title: ' 电压接线方式', width: '100px' },
{ field: 'capacitySi', title: '用户协议容量', width: '100px' },
{ field: 'capacitySscb', title: '基准短路容量', width: '100px' },
{ field: 'capacitySscmin', title: '最小短路容量', width: '100px' },
{ field: 'capacitySt', title: '供电设备容量', width: '100px' },
{ field: 'location', title: ' 测试位置', width: '100px' },
{ field: 'startTime', title: '数据起始时间', width: '140px', sortable: true },
{ field: 'endTime', title: '数据结束时间', width: '140px', sortable: true },
{ field: 'itemName', title: '数据来源', width: '100px' },
{ field: 'statisticalInterval', title: '统计间隔', width: '100px', },
{ field: '', title: '时间间隔', width: '140px', },
{ field: 'voltageLevel', title: '电压等级', width: '100px',sortable: true },
{ field: 'volConType', title: ' 电压接线方式', width: '100px', sortable: true },
{ field: 'capacitySi', title: '用户协议容量(MVA)', width: '140px', },
{ field: 'capacitySscb', title: '基准短路容量(MVA)', width: '140px', },
{ field: 'capacitySscmin', title: '最小短路容量(MVA)', width: '140px', },
{ field: 'capacitySt', title: '供电设备容量(MVA)', width: '140px', },
{ field: 'location', title: ' 测试位置', width: '100px', },
{ field: 'ct', title: 'CT', width: '70px' },
{ field: 'pt', title: 'PT', width: '70px' },
{ field: 'ct', title: 'CT', width: '70px', },
{ field: 'pt', title: 'PT', width: '70px', },
])
const setData = (data: any) => {

View File

@@ -1,5 +1,6 @@
<template>
<div class="default-main device-manage" :style="{ height: pageHeight.height }">
<!-- @node-change="nodeClick" -->
<schemeTree @node-change="nodeClick" @node-click="nodeClick" @init="nodeClick" @onAdd="onAdd" @bind="bind"
ref="schemeTreeRef"></schemeTree>
@@ -102,21 +103,23 @@
<div v-if="JSON.stringify(echartsData) != '{}' && deviceData?.records?.length != 0">
<!-- <h3 class="mt10 mb10">历史趋势</h3> -->
<el-tabs type="border-card" class="mt10">
<el-tab-pane label="历史趋势"> <div class="history_trend" v-if="titleList != '(未绑定数据)'">
<el-tab-pane label="历史趋势">
<div class="history_trend" v-if="titleList != '(未绑定数据)'">
<div class="history_header" ref="headerRef">
<!-- <el-form :model="searchForm" class="history_select" id="history_select"> -->
<TableHeader :showSearch="false" ref="tableHeaderRef" @selectChange="selectChange">
<template v-slot:select :key="num">
<el-form-item for="-" label="统计指标">
<el-select style="min-width: 200px" collapse-tags collapse-tags-tooltip
v-model="searchForm.index" placeholder="请选择统计指标" @change="onIndexChange($event)"
multiple :multiple-limit="3">
<el-option v-for="item in indexOptions" :key="item.id" :label="item.name"
:value="item.id"></el-option>
v-model="searchForm.index" placeholder="请选择统计指标"
@change="onIndexChange($event)" multiple :multiple-limit="3">
<el-option v-for="item in indexOptions" :key="item.id"
:label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item for="-" label="统计类型" label-width="80px">
<el-select style="width: 120px" v-model="searchForm.type" placeholder="请选择值类型">
<el-select style="width: 120px" v-model="searchForm.type"
placeholder="请选择值类型">
<el-option v-for="item in typeOptions" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
@@ -143,20 +146,25 @@
<!-- <el-button type="primary" icon="el-icon-Download" @click="handleExport">
数据导出
</el-button> -->
<el-button type="primary" icon="el-icon-Search" @click="init(true)">查询</el-button>
<el-button type="primary" icon="el-icon-Search"
@click="init(true)">查询</el-button>
</template>
</TableHeader>
</div>
<!-- <div class="history_title">
<p>{{ chartTitle }}</p>
</div> -->
<div class="history_chart mt5" v-loading="loading" :style="EcharHeight" :key="EcharHeight.height"
ref="chartRef">
<MyEchart ref="historyChart" v-if="echartsData" :isExport="true" :options="echartsData" />
<div class="history_chart mt5" v-loading="loading" :style="EcharHeight"
:key="EcharHeight.height" ref="chartRef">
<MyEchart ref="historyChart" v-if="echartsData" :isExport="true"
:options="echartsData" />
</div>
</div>
<el-empty :style="EcharHeight" v-else description="未绑定数据" /></el-tab-pane>
<el-tab-pane label="暂态数据">Config</el-tab-pane>
<el-empty :style="EcharHeight" v-else description="未绑定数据" />
</el-tab-pane>
<el-tab-pane label="暂态数据">
暂态数据
</el-tab-pane>
</el-tabs>
@@ -310,6 +318,14 @@ const nodeClick = async (e: anyObj) => {
}
const onIndexChange = (val: any) => {
num.value += 1
let pp: any = []
indexOptions.value.forEach((item: any) => {
const filteredResult = val.filter(vv => item.id == vv);
if (filteredResult.length > 0) {
pp.push(filteredResult[0]);
}
})
searchForm.value.index = pp
// if (val.length == 0) {
// searchForm.value.index = [indexOptions.value[0].id]
// }
@@ -469,7 +485,7 @@ const init = (flag: boolean) => {
if (item.phase == null) {
key = item.unit
} else {
key = item.unit
key = item.anotherName
}
if (!acc[key]) {
acc[key] = []
@@ -493,6 +509,7 @@ const init = (flag: boolean) => {
// textStyle: {
// color: '#000',
// fontSize: '16'
// },
// },
@@ -543,9 +560,18 @@ const init = (flag: boolean) => {
const xname = params[0].value[0]
let str = `${xname}<br>`
params.forEach((el: any, index: any) => {
let marker = ''
str += `${el.marker}${el.seriesName.split('(')[0]}${el.value[1] ? el.value[1] + ' ' + (el.value[2] || '') : '-'
if (el.value[3] == 'dashed') {
for (let i = 0; i < 3; i++) {
marker+= `<span style="display:inline-block;border: 2px ${el.color} solid;margin-right:5px;width:10px;height:0px;background-color:#ffffff00;"></span>`
}
} else {
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] ? el.value[1] + ' ' + (el.value[2] || '') : '-'
}<br>`
})
return str
}
@@ -590,13 +616,15 @@ const init = (flag: boolean) => {
...(index > 0 ? right : null)
})
})
console.log("🚀 ~ result.forEach ~ result:", result)
// console.log("🚀 ~ result.forEach ~ result:", result)
let ABCName = [...new Set(chartsList.map((item: any) => { return item.anotherName == '电压负序分量' ? '电压不平衡' : item.anotherName == '电压正序分量' ? '电压不平衡' : item.anotherName == '电压零序分量' ? '电压不平衡' : item.anotherName }))];
// console.log("🚀 ~ result.forEach ~ result:", result)
result.forEach((item: any, index: any) => {
let yMethodList: any = []
@@ -623,6 +651,10 @@ const init = (flag: boolean) => {
ABCList.forEach((kk: any) => {
let colorName = kk[0].phase?.charAt(0).toUpperCase()
@@ -632,9 +664,9 @@ const init = (flag: boolean) => {
let seriesList: any = []
kk.forEach((cc: any) => {
if (cc.statisticalData !== null) {
yMethodList.push(cc.statisticalData?.toFixed(2) - 0)
yMethodList.push(cc.statisticalData?.toFixed(2))
}
seriesList.push([cc.time, cc.statisticalData?.toFixed(2), cc.unit])
seriesList.push([cc.time, cc.statisticalData?.toFixed(2), cc.unit, lineStyle[lineS].type])
})
echartsData.value.options.series.push({
name: kk[0].phase
@@ -646,7 +678,7 @@ const init = (flag: boolean) => {
symbol: 'none',
lineStyle: lineStyle[lineS],
data: seriesList,
yAxisIndex: index
yAxisIndex: setList.indexOf(kk[0].unit)
})
})
@@ -793,6 +825,7 @@ const countData: any = ref([])
const tableHeaderRef = ref()
//根据选择的指标处理谐波次数
const formatCountOptions = (list: any) => {
countData.value = []
if (list.length != 0) {
list.map((item: any, index: any) => {
if (!countData.value[index]) {
@@ -852,7 +885,7 @@ const formatCountOptions = (list: any) => {
const flag = ref(false)
const selectChange = (e: boolean) => {
flag.value = e
console.log("🚀 ~ handleChange ~ activeColName.value:", activeColName.value, flag.value)
// console.log("🚀 ~ handleChange ~ activeColName.value:", activeColName.value, flag.value)
if (activeColName.value == '0') {
if (flag.value) {
@@ -888,7 +921,11 @@ const handleChange = () => {
watch(
() => searchForm.value.index,
(val: any, oldval: any) => {
if (val) {
let list = val
setTimeout(() => {
formatCountOptions(list)
@@ -902,6 +939,7 @@ watch(
countData.value.splice(key, 1)
}
})
init(false)
}
},

View File

@@ -38,7 +38,7 @@
:show-file-list="false" :auto-upload="false" :on-change="bulkImport">
<el-button type="primary" class="ml10" icon="el-icon-Tickets">批量导入</el-button>
</el-upload>
<el-button type="primary" class="ml10" @click="add" icon="el-icon-Plus">新增设备</el-button>
<el-button type="primary" class="ml10" @click="add" icon="el-icon-Plus">设备出厂管理</el-button>
</template>
</TableHeader>
<Table ref="tableRef"></Table>
@@ -132,7 +132,7 @@ const rules = reactive({
cntractNo: [{ required: true, message: '合同号不能为空', trigger: 'blur' }]
})
const dialogFormVisible = ref(false)
const dialogTitle = ref('新增设备')
const dialogTitle = ref('设备出厂管理')
const loading = ref<boolean>(false)
const devModelOptions: any = ref([])
queryByCode('Device_Type').then(res => {
@@ -249,7 +249,7 @@ const tableStore = new TableStore({
width: 100,
render: 'tag',
custom: {
1: 'primary',
1: 'error',
2: 'success',
// 3: 'primary',
// 4: 'primary',
@@ -270,7 +270,7 @@ const tableStore = new TableStore({
{
title: '操作',
align: 'center',
width: '180',
width: '220',
render: 'buttons',
buttons: [
//直连装置注册
@@ -567,7 +567,7 @@ const bulkImport = (e: any) => {
// 新增
const add = () => {
dialogFormVisible.value = true
dialogTitle.value = '新增设备'
dialogTitle.value = '设备出厂管理'
}
// 确认
@@ -577,7 +577,7 @@ const onSubmit = () => {
ruleFormRef.value.validate((valid: any) => {
if (valid) {
if (dialogTitle.value == '新增设备') {
if (dialogTitle.value == '设备出厂管理') {
addEquipmentDelivery(form).then(res => {
ElMessage.success('新增成功')
if (devTypeOptions.value.filter((item: any) => item.value == form.devType)[0].code == 'Portable') {

View File

@@ -8,11 +8,11 @@
<el-form-item label="编码">
<el-input v-model="form.code" placeholder="请输入编码" />
</el-form-item>
<el-form-item label="类型">
<!-- <el-form-item label="类型">
<el-select v-model="form.type" placeholder="请选择类型">
<el-option v-for="item in options" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item label="备注">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
@@ -49,7 +49,7 @@ const form = reactive({
name: '',
code: '',
remark: '',
type: 2,
// type: 2,
sort: 100,
pid: '',
id: ''

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog class="cn-operate-dialog statistical-type-binding" v-model="dialogVisible" title="绑定指标"
style="width: 1040px" @closed="close">
style="width: 1200px" @closed="close">
<el-scrollbar style="padding-right: 0">
<div class="box">
<div class="box-left">
@@ -42,7 +42,14 @@
}" :options="toData">
<template #default="{ node, data }">
<div style="display: flex; align-items: center">
<el-tooltip placement="bottom" :hide-after="0">
<template #content>
<span>{{ data.label}}</span>
</template>
<div class="hide-txt">{{ data.label }}</div>
</el-tooltip>
<template v-if="node.level === 1">
<div class="ml5">({{ data.children.length }})</div>
<div style="flex: 1"></div>
@@ -337,7 +344,7 @@ const dicDeleteGroup = (data: any) => {
const newGroup = () => {
addRef.value.open('新增菜单', {
addRef.value.open('新建分组', {
sort: toData.value.length ? toData.value[toData.value.length - 1].sort + 1 : 1,
code: '',
pid: pid.value,
@@ -348,7 +355,7 @@ const newGroup = () => {
}
const editGroup = (data: any) => {
getDictTreeById(data.id).then(res => {
addRef.value.open('修改菜单', {
addRef.value.open('修改分组', {
sort: res.data.sort || 100,
code: res.data.code || '',
pid: res.data.pid || '',
@@ -411,7 +418,7 @@ defineExpose({ open })
.statistical-type-binding {
.box {
display: flex;
width: 1000px;
width: 1160px;
height: calc(60vh - 95px);
margin: 0 auto;
text-align: left;
@@ -429,7 +436,8 @@ defineExpose({ open })
.box-left {
height: 100%;
overflow: hidden;
flex: 1;
// flex: 1;
width: 450px;
.el-cascader-menu {
padding-right: 0;
@@ -440,16 +448,19 @@ defineExpose({ open })
}
.el-cascader-panel {
height: 100%;
height: calc(60vh - 140px);
.el-cascader-menu__list {
height: 100% !important;
overflow-y: auto !important;
padding-bottom: 50px !important;
// padding-bottom: 50px !important;
box-sizing: border-box;
}
}
}
.box-right{
flex: 1;
}
.hide-txt {
width: 150px;

View File

@@ -1,11 +1,19 @@
<template>
<div class='default-main'>
<TableHeader>
<TableHeader :showReset='false'>
<template v-slot:operation>
<el-button :icon='Plus' type='primary' @click='addMenu'>新增</el-button>
</template>
</TableHeader>
<el-tabs type="border-card">
<el-tab-pane v-for="item in tabPane" :label="item.name">
<Table ref='tableRef' />
</el-tab-pane>
</el-tabs>
<PopupBinding ref='bindingRef'></PopupBinding>
<PopupAdd ref='addRef' @over='init'></PopupAdd>
</div>
@@ -24,6 +32,7 @@ import { dicDelete } from '@/api/system-boot/dic'
defineOptions({
name: 'govern/setting/statisticalType'
})
const tabPane = [{ name: '在线监测' }, { name: '治理' }, { name: '测试' }]
const tableRef = ref()
const bindingRef = ref()
const addRef = ref()
@@ -39,10 +48,13 @@ const tableStore = new TableStore({
url: '/system-boot/dictTree/query',
method: 'POST',
paramsPOST: true,
publicHeight: 60,
column: [
{ title: '序号', width: 80,formatter: (row: any) => {
{
title: '序号', width: 80, formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
}
},
{ title: '统计类型', field: 'name' },
{
title: '类型', field: 'type',