修改测试bug

This commit is contained in:
GGJ
2024-11-13 09:21:26 +08:00
parent 27e0dd3abd
commit 2101d03126
12 changed files with 90 additions and 63 deletions

View File

@@ -44,7 +44,10 @@ const initChart = () => {
left: 'center', left: 'center',
// textStyle: { // textStyle: {
color: '#000', color: '#000',
fontSize: 18, textStyle: {
color: '#000',
fontSize: '18'
},
// }, // },
...(props.options?.title || null) ...(props.options?.title || null)
}, },
@@ -69,8 +72,8 @@ const initChart = () => {
...(props.options?.tooltip || null) ...(props.options?.tooltip || null)
}, },
toolbox: { toolbox: {
right: 20, right: 10,
top: 20, top: 0,
feature: { feature: {
saveAsImage: { saveAsImage: {
title: '保存图片' title: '保存图片'
@@ -81,8 +84,8 @@ const initChart = () => {
...(props.options?.toolbox || null) ...(props.options?.toolbox || null)
}, },
legend: { legend: {
right: 20, right: 40,
top: 0, top: 10,
itemGap: 10, itemGap: 10,
itemStyle: {}, itemStyle: {},
// textStyle: { // textStyle: {

View File

@@ -129,7 +129,6 @@ const computedSearchRow = () => {
headerFormSecond.value.$el.appendChild(elFormItem[i]) headerFormSecond.value.$el.appendChild(elFormItem[i])
} }
} }
console.log("🚀 ~ computedSearchRow ~ headerFormSecond.value.$el.scrollHeight :", headerFormSecond.value.$el.scrollHeight )
// 判断是否需要折叠 // 判断是否需要折叠
if (headerFormSecond.value.$el.scrollHeight > 0) { if (headerFormSecond.value.$el.scrollHeight > 0) {

View File

@@ -67,7 +67,11 @@ const tableStore = new TableStore({
{ title: '设备名称', field: 'equipmentName', align: 'center' }, { title: '设备名称', field: 'equipmentName', align: 'center' },
{ title: '工程名称', field: 'engineeringName', align: 'center' }, { title: '工程名称', field: 'engineeringName', align: 'center' },
{ title: '项目名称', field: 'projectName', align: 'center' }, { title: '项目名称', field: 'projectName', align: 'center' },
{ title: '告警代码', field: 'code', align: 'center' }, { title: '告警代码', field: 'code', align: 'center',formatter: (row: any) => {
console.log("🚀 ~ row:", row)
return row.cellValue ? row.cellValue : '/'
}},
{ title: '事件描述', field: 'showName', align: 'center' }, { title: '事件描述', field: 'showName', align: 'center' },
{ title: '发生时刻', field: 'startTime', align: 'center' } { title: '发生时刻', field: 'startTime', align: 'center' }
], ],

View File

@@ -120,7 +120,13 @@ const init = () => {
echartsData.value = { echartsData.value = {
options: { options: {
legend: {
right: 70,
top: 5,
data: res.data.map((item: any[]) => {
return item[0]?.anotherName
})
},
grid: { grid: {
top: '60px', top: '60px',
left: '10px', left: '10px',
@@ -176,11 +182,7 @@ const init = () => {
backgroundColor: 'rgba(0,0,0,0.35)', backgroundColor: 'rgba(0,0,0,0.35)',
borderWidth: 0 borderWidth: 0
}, },
legend: {
data: res.data.map((item: any[]) => {
return item[0]?.anotherName
})
},
yAxis: { yAxis: {
name: `单位:(${arr[0].unit == null ? ' / ' : arr[0].unit})`, name: `单位:(${arr[0].unit == null ? ' / ' : arr[0].unit})`,
type: 'value', type: 'value',
@@ -271,6 +273,7 @@ const init = () => {
if ((echartsData.value.legend = ['A相', 'B相', 'C相'])) { if ((echartsData.value.legend = ['A相', 'B相', 'C相'])) {
echartsData.value.color = ['#FFCC00', '#009900', '#CC0000'] echartsData.value.color = ['#FFCC00', '#009900', '#CC0000']
} }
} else { } else {
echartsData.value = null echartsData.value = null
} }

View File

@@ -12,7 +12,7 @@
</el-form-item> </el-form-item>
</template> </template>
<template #operation> <template #operation>
<!-- <el-button type="primary" :icon="Search" @click="handleSearch">查询</el-button> --> <el-button type="primary" :icon="Search" @click="handleSearch">查询</el-button>
<el-button type="primary" :icon="Setting" @click="handleUpDevice">补召</el-button> <el-button type="primary" :icon="Setting" @click="handleUpDevice">补召</el-button>
<el-button :icon="Back" @click="go(-1)">返回</el-button> <el-button :icon="Back" @click="go(-1)">返回</el-button>
</template> </template>
@@ -54,10 +54,13 @@ import { mainHeight } from '@/utils/layout'
import { VxeUI, VxeTableInstance, VxeTableEvents } from 'vxe-table' import { VxeUI, VxeTableInstance, VxeTableEvents } from 'vxe-table'
import { import {
Back, Back,
Setting Setting, Search
} from '@element-plus/icons-vue' } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import mqtt from 'mqtt' import mqtt from 'mqtt'
defineOptions({
name: 'supplementaryRecruitment'
})
const checkList: any = ref([]) const checkList: any = ref([])
// const props = defineProps(['lineId']) // const props = defineProps(['lineId'])
const { go } = useRouter() // 路由 const { go } = useRouter() // 路由
@@ -161,6 +164,9 @@ const connectMqtt = () => {
} }
mqttRef.value = mqtt.connect(url, options) mqttRef.value = mqtt.connect(url, options)
} }
const handleSearch = () => {
getMakeUpDataList(route.value)
}
connectMqtt() connectMqtt()
mqttRef.value.on('connect', () => { mqttRef.value.on('connect', () => {
// ElMessage.success('连接mqtt服务器成功!') // ElMessage.success('连接mqtt服务器成功!')

View File

@@ -60,7 +60,7 @@ const tableStore: any = new TableStore({
}, },
{ {
field: 'featureAmplitude', field: 'featureAmplitude',
title: '暂降幅值(%)', title: '暂降(聚升)幅值(%)',
minWidth: 100, minWidth: 100,
formatter: (row: any) => { formatter: (row: any) => {
row.cellValue = row.cellValue + '' ? row.cellValue.toFixed(2) : '/' row.cellValue = row.cellValue + '' ? row.cellValue.toFixed(2) : '/'

View File

@@ -2,8 +2,8 @@
<div> <div>
<!-- 历史趋势数据 --> <!-- 历史趋势数据 -->
<div> <div>
<TableHeader ref="tableHeaderRef" :showSearch="false" @selectChange="selectChange" :key="numKey"> <TableHeader ref="tableHeaderRef" :showSearch="false" @selectChange="selectChange" >
<template v-slot:select :key="num"> <template v-slot:select >
<el-form-item> <el-form-item>
<DatePicker ref="datePickerRef"></DatePicker> <DatePicker ref="datePickerRef"></DatePicker>
</el-form-item> </el-form-item>
@@ -230,7 +230,8 @@ const init = async () => {
itemGap: 10, itemGap: 10,
type: 'scroll', // 开启滚动分页 type: 'scroll', // 开启滚动分页
// orient: 'vertical', // 垂直排列 // orient: 'vertical', // 垂直排列
top: 10, top: 5,
right: 70,
width: 400, width: 400,
height: 50 height: 50
@@ -599,21 +600,10 @@ const onCountChange = (val: any, index: any) => {
} }
} }
const flag = ref(true) const flag = ref(true)
const numKey = ref(0)
const onIndexChange = (val: any) => { const onIndexChange = (val: any) => {
num.value += 1 num.value += 1
flag.value = true flag.value = true
setTimeout(() => {
countData.value.forEach((item: any) => {
if (item.countOptions.length > 0) {
flag.value = false
return
}
})
if (flag.value) {
numKey.value += 1
}
}, 500)
// if (val.length == 0) { // if (val.length == 0) {
// searchForm.value.index = [indexOptions.value[0].id] // searchForm.value.index = [indexOptions.value[0].id]

View File

@@ -12,13 +12,14 @@
label-width="140px" label-width="140px"
:rules="rules1" :rules="rules1"
ref="ruleFormRef1" ref="ruleFormRef1"
class="form-one"
v-if="popupType == 0 || popupType == 1" v-if="popupType == 0 || popupType == 1"
> >
<el-form-item label="方案名称:" prop="itemName"> <el-form-item label="方案名称:" prop="itemName">
<el-input style="width: 100% !important;" v-model="form.itemName" placeholder="请输入方案名称" /> <el-input v-model="form.itemName" placeholder="请输入方案名称" />
</el-form-item> </el-form-item>
<el-form-item label="方案描述:" prop="describe"> <el-form-item label="方案描述:" prop="describe">
<el-input style="width: 100% !important;" type="textarea" v-model="form.describe" placeholder="请输入方案描述" /> <el-input type="textarea" v-model="form.describe" placeholder="请输入方案描述" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- 测试项信息&数据绑定页面 --> <!-- 测试项信息&数据绑定页面 -->

View File

@@ -104,7 +104,7 @@
<div class="history_header" ref="headerRef"> <div class="history_header" ref="headerRef">
<!-- <el-form :model="searchForm" class="history_select" id="history_select"> --> <!-- <el-form :model="searchForm" class="history_select" id="history_select"> -->
<TableHeader :showSearch="false" ref="tableHeaderRef" @selectChange="selectChange"> <TableHeader :showSearch="false" ref="tableHeaderRef" @selectChange="selectChange">
<template v-slot:select > <template v-slot:select :key="num">
<el-form-item for="-" label="统计指标"> <el-form-item for="-" label="统计指标">
<el-select style="min-width: 200px" collapse-tags collapse-tags-tooltip <el-select style="min-width: 200px" collapse-tags collapse-tags-tooltip
v-model="searchForm.index" placeholder="请选择统计指标" @change="onIndexChange($event)" v-model="searchForm.index" placeholder="请选择统计指标" @change="onIndexChange($event)"
@@ -128,7 +128,7 @@
<el-form-item for="-" v-for="(item, index) in countData" :key="index" <el-form-item for="-" v-for="(item, index) in countData" :key="index"
:label="item.name.includes('次数') ? item.name : item.name.includes('幅值') ? item.name.slice(0, -2) + '次数' : item.name + '谐波次数'" :label="item.name.includes('次数') ? item.name : item.name.includes('幅值') ? item.name.slice(0, -2) + '次数' : item.name + '谐波次数'"
v-show="item.countOptions.length != 0"> v-show="item.countOptions.length != 0">
<!-- multiple -->
<el-select v-model="item.count" collapse-tags collapse-tags-tooltip <el-select v-model="item.count" collapse-tags collapse-tags-tooltip
placeholder="请选择谐波次数" style="width: 120px"> placeholder="请选择谐波次数" style="width: 120px">
<el-option v-for="vv in item.countOptions" :key="vv" :label="vv" <el-option v-for="vv in item.countOptions" :key="vv" :label="vv"
@@ -138,9 +138,9 @@
</template> </template>
<template v-slot:operation> <template v-slot:operation>
<el-button type="primary" icon="el-icon-Download" @click="handleExport"> <!-- <el-button type="primary" icon="el-icon-Download" @click="handleExport">
数据导出 数据导出
</el-button> </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> </template>
</TableHeader> </TableHeader>
@@ -179,7 +179,7 @@ import { useConfig } from '@/stores/config'
import { getDeviceList } from '@/api/cs-device-boot/planData' import { getDeviceList } from '@/api/cs-device-boot/planData'
const dictData = useDictData() const dictData = useDictData()
defineOptions({ defineOptions({
name: 'govern/device/planData/index' // name: 'govern/device/planData/index'
}) })
const num = ref(0) const num = ref(0)
const config = useConfig() const config = useConfig()
@@ -190,7 +190,7 @@ const voltageLevelList = dictData.getBasicData('Dev_Voltage_Stand')
const volConTypeList = dictData.getBasicData('Dev_Connect') const volConTypeList = dictData.getBasicData('Dev_Connect')
//值类型 //值类型
const pageHeight = mainHeight(20) const pageHeight = mainHeight(20)
const EcharHeight = ref(mainHeight(458)) const EcharHeight = ref(mainHeight(468))
const loading = ref(false) const loading = ref(false)
const searchForm: any = ref({}) const searchForm: any = ref({})
const typeOptions = [ const typeOptions = [
@@ -463,9 +463,28 @@ const init = (flag: boolean) => {
} }
echartsData.value = { echartsData.value = {
title:{
text:chartTitle.value, title: {
left:'0', text: chartTitle.value,
left: '0',
textStyle: {
color: '#000',
fontSize: '16'
},
},
toolbox: {
featureProps: {
myTool1: {
show: true,
title: '下载csv',
icon: 'path://M588.8 551.253333V512H352v39.253333h236.373333z m0 78.933334v-39.253334H352v39.253334h236.373333z m136.533333 78.933333V334.933333l-157.866666-157.866666H273.066667A59.306667 59.306667 0 0 0 213.333333 236.373333v551.253334a59.306667 59.306667 0 0 0 59.306667 59.306666h274.773333v42.666667H853.333333v-180.48zM568.746667 234.666667l100.266666 100.693333h-81.066666a20.053333 20.053333 0 0 1-19.626667-20.053333z m-20.48 573.013333H273.066667a19.2 19.2 0 0 1-17.493334-19.626667V236.373333a19.2 19.2 0 0 1 19.626667-19.626666h256v98.133333a58.88 58.88 0 0 0 58.88 59.306667h96.426667v334.933333h-98.133334v-39.68H352v39.68h196.266667z m100.266666 23.04a37.973333 37.973333 0 0 1-32 15.786667 38.826667 38.826667 0 0 1-32.426666-15.786667 53.76 53.76 0 0 1-10.24-32.853333 42.666667 42.666667 0 0 1 42.666666-47.786667 35.84 35.84 0 0 1 37.546667 29.866667h-12.8a23.893333 23.893333 0 0 0-24.746667-19.2c-17.066667 0-29.013333 14.08-29.013333 35.84s11.52 37.546667 28.586667 37.546666a26.453333 26.453333 0 0 0 26.453333-25.6h12.8a39.253333 39.253333 0 0 1-7.253333 22.186667z m59.733334 15.786667a35.84 35.84 0 0 1-40.106667-34.56H682.666667a23.893333 23.893333 0 0 0 26.88 23.04c12.8 0 22.613333-6.4 22.613333-15.786667s-4.266667-11.52-14.506667-13.653333l-21.333333-5.12c-17.066667-4.266667-24.32-11.52-24.32-23.893334s12.8-26.453333 34.133333-26.453333a31.573333 31.573333 0 0 1 35.413334 30.293333h-13.653334a19.626667 19.626667 0 0 0-22.613333-18.773333c-12.8 0-20.48 5.12-20.48 12.8s5.12 11.093333 17.066667 13.653333l14.933333 2.986667a42.666667 42.666667 0 0 1 20.906667 8.96 23.893333 23.893333 0 0 1 7.68 17.92c-0.426667 17.066667-14.506667 28.16-37.12 28.16z m88.746666 0h-14.506666l-32.426667-92.16h14.08l19.626667 59.733333 6.4 20.053333c0-9.386667 3.413333-12.8 5.546666-20.053333l19.2-59.733333h14.08z',
onclick: e => {
handleExport()
}
}
}
}, },
legend: { legend: {
itemWidth: 20, itemWidth: 20,
@@ -473,8 +492,8 @@ const init = (flag: boolean) => {
itemGap: 15, itemGap: 15,
type: 'scroll', // 开启滚动分页 type: 'scroll', // 开启滚动分页
// orient: 'vertical', // 垂直排列 // orient: 'vertical', // 垂直排列
top: 10, top: 5,
right: 70,
width: 400, width: 400,
height: 50 height: 50
}, },
@@ -522,6 +541,7 @@ const init = (flag: boolean) => {
yAxis: [{}], yAxis: [{}],
options: { options: {
series: [] series: []
} }
} }
@@ -788,35 +808,35 @@ const formatCountOptions = (list: any) => {
const flag = ref(false) const flag = ref(false)
const selectChange = (e: boolean) => { const selectChange = (e: boolean) => {
flag.value = e flag.value = e
if (activeColName.value == '0') { if (activeColName.value == '0') {
if (flag.value) { if (flag.value) {
EcharHeight.value = mainHeight(502) EcharHeight.value = mainHeight(512)
} else { } else {
EcharHeight.value = mainHeight(458) EcharHeight.value = mainHeight(468)
} }
} else { } else {
if (flag.value) { if (flag.value) {
EcharHeight.value = mainHeight(332) EcharHeight.value = mainHeight(342)
} else { } else {
EcharHeight.value = mainHeight(280) EcharHeight.value = mainHeight(290)
} }
} }
} }
const handleChange = () => { const handleChange = () => {
console.log("🚀 ~ handleChange ~ activeColName.value:", activeColName.value,flag.value) console.log("🚀 ~ handleChange ~ activeColName.value:", activeColName.value, flag.value)
if (activeColName.value == '0') { if (activeColName.value == '0') {
if (flag.value) { if (flag.value) {
EcharHeight.value = mainHeight(502) EcharHeight.value = mainHeight(512)
} else { } else {
EcharHeight.value = mainHeight(458) EcharHeight.value = mainHeight(468)
} }
} else { } else {
if (flag.value) { if (flag.value) {
EcharHeight.value = mainHeight(332) EcharHeight.value = mainHeight(342)
} else { } else {
EcharHeight.value = mainHeight(280) EcharHeight.value = mainHeight(290)
} }
} }
} }

View File

@@ -78,7 +78,8 @@ const tableStore = new TableStore({
tableStore.table.data.forEach((item: any) => { tableStore.table.data.forEach((item: any) => {
item.data1 ? (item.data = JSON.parse(item.data1)) : '' item.data1 ? (item.data = JSON.parse(item.data1)) : ''
item.celldata.forEach((k: any) => { item.celldata.forEach((k: any) => {
item.data[k.r][k.c].v ? (item.data[k.r][k.c].v = k.v) : ''
item.data[k.r][k.c].v ? (item.data[k.r][k.c] = k.v ) : ''
}) })
}) })
console.log(tableStore.table.data) console.log(tableStore.table.data)
@@ -108,15 +109,15 @@ onMounted(() => {
// getTemplateByDept({ id: dictData.state.area[0].id }).then((res: any) => { // getTemplateByDept({ id: dictData.state.area[0].id }).then((res: any) => {
// templatePolicy.value = res.data // templatePolicy.value = res.data
// }) // })
const stencil=(val: any) => { const stencil = (val: any) => {
console.log("🚀 ~ Policy ~ val:", val) console.log("🚀 ~ Policy ~ val:", val)
templatePolicy.value =val templatePolicy.value = val
Template.value =val[0] Template.value = val[0]
reportForm.value =val[0]?.reportForm reportForm.value = val[0]?.reportForm
} }

View File

@@ -87,7 +87,7 @@ const open = async (row: any) => {
await viewCustomReportTemplateById({ id: row.id }).then((Response:any) => { await viewCustomReportTemplateById({ id: row.id }).then((Response:any) => {
Response.forEach((item: any) => { Response.forEach((item: any) => {
item.celldata.forEach((k: any) => { item.celldata.forEach((k: any) => {
item.data[k.r][k.c].v = k.v item.data[k.r][k.c].v ? (item.data[k.r][k.c] = k.v ) : ''
}) })
}) })
options.value.data = Response options.value.data = Response

View File

@@ -87,7 +87,7 @@ const open = async (row: any) => {
await viewCustomReportTemplateById({ id: row.id }).then((Response:any) => { await viewCustomReportTemplateById({ id: row.id }).then((Response:any) => {
Response.forEach((item: any) => { Response.forEach((item: any) => {
item.celldata.forEach((k: any) => { item.celldata.forEach((k: any) => {
item.data[k.r][k.c].v = k.v item.data[k.r][k.c].v ? (item.data[k.r][k.c] = k.v ) : ''
}) })
}) })
options.value.data = Response options.value.data = Response