修改准实时数据数据页面样式
This commit is contained in:
@@ -1016,10 +1016,11 @@ const handleClick = async (tab?: any) => {
|
|||||||
}
|
}
|
||||||
//测试项记录
|
//测试项记录
|
||||||
if (dataSet.value.includes('_items')) {
|
if (dataSet.value.includes('_items')) {
|
||||||
formInline.startTime = datePickerRef.value && datePickerRef.value.timeValue[0]
|
setTimeout(() => {
|
||||||
formInline.endTime = datePickerRef.value && datePickerRef.value.timeValue[1]
|
formInline.startTime = datePickerRef.value && datePickerRef.value?.timeValue[0]
|
||||||
|
formInline.endTime = datePickerRef.value && datePickerRef.value?.timeValue[1]
|
||||||
formInline.id = dataSet.value
|
formInline.id = dataSet.value
|
||||||
await getTestData(formInline)
|
getTestData(formInline)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
tableData.value = res.data
|
tableData.value = res.data
|
||||||
formInline.total = res.data.total
|
formInline.total = res.data.total
|
||||||
@@ -1037,6 +1038,7 @@ const handleClick = async (tab?: any) => {
|
|||||||
tableLoading.value = false
|
tableLoading.value = false
|
||||||
}, 1500)
|
}, 1500)
|
||||||
})
|
})
|
||||||
|
},100)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
|
|
||||||
<div :style="{ height: height }">
|
<div>
|
||||||
<vxe-table height="auto" auto-resize :data="dataList" v-bind="defaultAttribute" :key="key">
|
<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"
|
<vxe-column v-for="item in column" :field="item.field" :title="item.title" :formatter="formatter"
|
||||||
:formatter="formatter"></vxe-column>
|
:width="item.width"></vxe-column>
|
||||||
|
|
||||||
</vxe-table>
|
</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>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
@@ -13,26 +20,57 @@
|
|||||||
import { mainHeight } from '@/utils/layout'
|
import { mainHeight } from '@/utils/layout'
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||||
|
import type { VxeTablePropTypes } from 'vxe-table'
|
||||||
const props = defineProps(['tableData'])
|
const props = defineProps(['tableData'])
|
||||||
const height = mainHeight(325).height
|
const height = mainHeight(325)
|
||||||
const dataList = ref([])
|
const dataList: any = ref([])
|
||||||
const key: any = ref(0)
|
const key: any = ref(0)
|
||||||
const column: any = ref([])
|
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) => {
|
const setData = (data: any, targetType: any) => {
|
||||||
|
let list = JSON.parse(JSON.stringify(data))
|
||||||
|
dataList1.value = []
|
||||||
dataList.value = JSON.parse(JSON.stringify(data))
|
dataList.value = []
|
||||||
|
flag.value=true
|
||||||
|
flag1.value=true
|
||||||
|
targetName.value = targetType[0].name
|
||||||
if (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
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
column.value = [
|
column.value = [
|
||||||
{ field: 'otherName', title: '名称', },
|
{ field: 'otherName', title: '名称', width: 350 },
|
||||||
{ field: 'valueA', title: 'A相', },
|
{ field: 'valueA', title: 'A相', },
|
||||||
{ field: 'valueB', title: 'B相', },
|
{ field: 'valueB', title: 'B相', },
|
||||||
{ field: 'valueC', title: 'C相', },
|
{ field: 'valueC', title: 'C相', },
|
||||||
{ field: 'valueM', title: '', },
|
// { field: 'valueM', title: '', },
|
||||||
]
|
]
|
||||||
} else {
|
} else {
|
||||||
|
dataList.value = list
|
||||||
|
flag.value=true
|
||||||
|
|
||||||
|
flag1.value=false
|
||||||
column.value = [
|
column.value = [
|
||||||
{ field: 'otherName', title: '谐波次数', },
|
{ field: 'otherName', title: '谐波次数', },
|
||||||
{ field: 'valueA', title: 'A相', },
|
{ field: 'valueA', title: 'A相', },
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<!-- 实时数据 - 谐波频谱页面 -->
|
<!-- 实时数据 - 谐波频谱页面 -->
|
||||||
<template>
|
<template>
|
||||||
<div class="realtrend" v-loading="loading">
|
<div class="realtrend" v-loading="loading">
|
||||||
<div class="select">
|
<div class="select" v-if="!loading">
|
||||||
<div class="mr10">谐波次数 </div>
|
<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-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
@@ -175,6 +175,11 @@ const init = () => {
|
|||||||
value: limitData.value[key]
|
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 = []
|
let xAxisList: any = []
|
||||||
chartsData.value.map((item: any, index: any) => {
|
chartsData.value.map((item: any, index: any) => {
|
||||||
chartsYxiasData.value.map((vv: any, vvs: any) => {
|
chartsYxiasData.value.map((vv: any, vvs: any) => {
|
||||||
@@ -298,10 +303,29 @@ const limitData: any = ref()
|
|||||||
const setOverLimitData = (val: any) => {
|
const setOverLimitData = (val: any) => {
|
||||||
limitData.value = {}
|
limitData.value = {}
|
||||||
for (let key in val) {
|
for (let key in val) {
|
||||||
|
if (activeName.value == 0) {
|
||||||
if (String(key).includes('uharm')) {
|
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]
|
limitData.value[key] = val[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
onMounted(() => { })
|
onMounted(() => { })
|
||||||
defineExpose({ open, setRealTrendData, setOverLimitData })
|
defineExpose({ open, setRealTrendData, setOverLimitData })
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ const tableStore = new TableStore({
|
|||||||
inactiveValue: '0',
|
inactiveValue: '0',
|
||||||
activeValue: '1',
|
activeValue: '1',
|
||||||
onChangeField: (row: any, value: any) => {
|
onChangeField: (row: any, value: any) => {
|
||||||
console.log("🚀 ~ row:", row)
|
// console.log("🚀 ~ row:", row)
|
||||||
ElMessageBox.prompt('二次校验密码确认', '', {
|
ElMessageBox.prompt('二次校验密码确认', '', {
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
@@ -230,7 +230,7 @@ const tableStore = new TableStore({
|
|||||||
inputType: 'text'
|
inputType: 'text'
|
||||||
}).then(({ value }) => {
|
}).then(({ value }) => {
|
||||||
passwordConfirm(value).then(res => {
|
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 ? '设备停用成功!' : '设备启用成功!')
|
ElMessage.success(row.usageStatus == 1 ? '设备停用成功!' : '设备启用成功!')
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
})
|
})
|
||||||
@@ -413,13 +413,14 @@ const tableStore = new TableStore({
|
|||||||
click: row => {
|
click: row => {
|
||||||
// 便携式设备接入
|
// 便携式设备接入
|
||||||
// portableDeviceAccess
|
// portableDeviceAccess
|
||||||
loading.value = true
|
|
||||||
ElMessageBox.confirm('确定接入该设备吗?', '提示', {
|
ElMessageBox.confirm('确定接入该设备吗?', '提示', {
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
loading.value = true
|
||||||
portableDeviceRegister({
|
portableDeviceRegister({
|
||||||
nDid: row.ndid
|
nDid: row.ndid
|
||||||
})
|
})
|
||||||
@@ -427,6 +428,7 @@ const tableStore = new TableStore({
|
|||||||
loading.value = false
|
loading.value = false
|
||||||
ElMessage.success(res.message)
|
ElMessage.success(res.message)
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
|
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
|
|||||||
Reference in New Issue
Block a user