修改准实时数据数据页面样式

This commit is contained in:
GGJ
2024-11-28 14:01:27 +08:00
parent a008424927
commit da184e1a37
4 changed files with 90 additions and 24 deletions

View File

@@ -1016,10 +1016,11 @@ const handleClick = async (tab?: any) => {
}
//测试项记录
if (dataSet.value.includes('_items')) {
formInline.startTime = datePickerRef.value && datePickerRef.value.timeValue[0]
formInline.endTime = datePickerRef.value && datePickerRef.value.timeValue[1]
setTimeout(() => {
formInline.startTime = datePickerRef.value && datePickerRef.value?.timeValue[0]
formInline.endTime = datePickerRef.value && datePickerRef.value?.timeValue[1]
formInline.id = dataSet.value
await getTestData(formInline)
getTestData(formInline)
.then((res: any) => {
tableData.value = res.data
formInline.total = res.data.total
@@ -1037,6 +1038,7 @@ const handleClick = async (tab?: any) => {
tableLoading.value = false
}, 1500)
})
},100)
}

View File

@@ -1,11 +1,18 @@
<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"></vxe-column>
<div>
<vxe-table auto-resize :data="dataList" v-bind="defaultAttribute" :key="key" :mergeCells="mergeCells" v-if="flag">
<vxe-column v-for="item in column" :field="item.field" :title="item.title" :formatter="formatter"
:width="item.width"></vxe-column>
</vxe-table>
<vxe-table v-if="flag1" auto-resize :data="dataList1"
v-bind="defaultAttribute" :key="key" :mergeCells="mergeCells">
<vxe-column field="otherName" title="名称" width="350"></vxe-column>
<vxe-column field="valueM" title="其他数据"></vxe-column>
</vxe-table>
<el-empty :style="height" description="暂无数据"v-if="!flag && !flag1" ></el-empty>
</div>
</template>
@@ -13,26 +20,57 @@
import { mainHeight } from '@/utils/layout'
import { ref, reactive } from 'vue'
import { defaultAttribute } from '@/components/table/defaultAttribute'
import type { VxeTablePropTypes } from 'vxe-table'
const props = defineProps(['tableData'])
const height = mainHeight(325).height
const dataList = ref([])
const height = mainHeight(325)
const dataList: any = ref([])
const key: any = ref(0)
const column: any = ref([])
const dataList1: any = ref([])
const targetName: any = ref('')
const flag=ref(true)
const flag1=ref(true)
const mergeCells: any = ref<VxeTablePropTypes.MergeCells>([
// { row: 0, col: 1, rowspan: 1, colspan: 3 },
])
const setData = (data: any, targetType: any) => {
let list = JSON.parse(JSON.stringify(data))
dataList1.value = []
dataList.value = []
flag.value=true
flag1.value=true
targetName.value = targetType[0].name
if (targetType[0].name == '基本数据') {
flag.value=false
flag1.value=false
list.forEach((item: any, index: number) => {
if (item.valueA == null && item.valueB == null && item.valueC == null) {
// item.valueA = item.valueM
// mergeCells.value.push({ row: index, col: 1, rowspan: 1, colspan: 3 })
dataList1.value.push(item)
flag1.value=true
} else {
dataList.value.push(item)
flag.value=true
}
})
dataList.value = JSON.parse(JSON.stringify(data))
if (targetType[0].name == '基本数据' ) {
column.value = [
{ field: 'otherName', title: '名称', },
{ field: 'otherName', title: '名称', width: 350 },
{ field: 'valueA', title: 'A相', },
{ field: 'valueB', title: 'B相', },
{ field: 'valueC', title: 'C相', },
{ field: 'valueM', title: '', },
// { field: 'valueM', title: '', },
]
} else {
dataList.value = list
flag.value=true
flag1.value=false
column.value = [
{ field: 'otherName', title: '谐波次数', },
{ field: 'valueA', title: 'A相', },
@@ -43,7 +81,7 @@ const setData = (data: any, targetType: any) => {
key.value += 1
}
const formatter = (row: any) => {
return row.cellValue==null? '/':row.cellValue
return row.cellValue == null ? '/' : row.cellValue
}
defineExpose({ setData })

View File

@@ -1,9 +1,9 @@
<!-- 实时数据 - 谐波频谱页面 -->
<template>
<div class="realtrend" v-loading="loading">
<div class="select">
<div class="select" v-if="!loading">
<div class="mr10">谐波次数 </div>
<el-select v-model="selectValue" v-if="!loading" style="width: 100px">
<el-select v-model="selectValue" style="width: 100px">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
@@ -175,6 +175,11 @@ const init = () => {
value: limitData.value[key]
})
}
if (selectValue.value == '1') {
gbData = gbData.filter((_, index: number) => index % 2 !== 0)
} else if (selectValue.value == '2') {
gbData = gbData.filter((_, index: number) => index % 2 == 0)
}
let xAxisList: any = []
chartsData.value.map((item: any, index: any) => {
chartsYxiasData.value.map((vv: any, vvs: any) => {
@@ -298,10 +303,29 @@ const limitData: any = ref()
const setOverLimitData = (val: any) => {
limitData.value = {}
for (let key in val) {
if (activeName.value == 0) {
if (String(key).includes('uharm')) {
if (key.startsWith('uharm')) {
limitData.value[key] = val[key];
}
}
} else if (activeName.value == 1) {
if (String(key).includes('iharm')) {
limitData.value[key] = val[key]
}
} else {
if (String(key).includes('inuharm')) {
limitData.value[key] = val[key]
}
}
}
}
onMounted(() => { })
defineExpose({ open, setRealTrendData, setOverLimitData })

View File

@@ -222,7 +222,7 @@ const tableStore = new TableStore({
inactiveValue: '0',
activeValue: '1',
onChangeField: (row: any, value: any) => {
console.log("🚀 ~ row:", row)
// console.log("🚀 ~ row:", row)
ElMessageBox.prompt('二次校验密码确认', '', {
confirmButtonText: '确认',
cancelButtonText: '取消',
@@ -230,7 +230,7 @@ const tableStore = new TableStore({
inputType: 'text'
}).then(({ value }) => {
passwordConfirm(value).then(res => {
editEquipmentDelivery({ ...row, usageStatus: row.usageStatus == 1 ? 0 : 1 }).then(res => {
editEquipmentDelivery({ ...row, status: row.status == 5 ? 1 : row.status, usageStatus: row.usageStatus == 1 ? 0 : 1 }).then(res => {
ElMessage.success(row.usageStatus == 1 ? '设备停用成功!' : '设备启用成功!')
tableStore.index()
})
@@ -413,13 +413,14 @@ const tableStore = new TableStore({
click: row => {
// 便携式设备接入
// portableDeviceAccess
loading.value = true
ElMessageBox.confirm('确定接入该设备吗?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
loading.value = true
portableDeviceRegister({
nDid: row.ndid
})
@@ -427,6 +428,7 @@ const tableStore = new TableStore({
loading.value = false
ElMessage.success(res.message)
tableStore.index()
})
.catch(e => {
loading.value = false