Merge remote-tracking branch 'origin/main'

This commit is contained in:
houwei 2024-10-30 14:06:17 +08:00
commit f82b7d2d10
4 changed files with 460 additions and 444 deletions

File diff suppressed because it is too large Load Diff

View File

@ -21,7 +21,7 @@
background
:pager-count="7"
layout="prev, pager, next, jumper,sizes,total"
@change="getcurrentPage"
@size-change="sizeChangePage"
></el-pagination>
</div>
</div>
@ -49,7 +49,9 @@ const pageSetting = reactive({
pageSizes: [20, 50, 100],
})
const getcurrentPage = () => {}
const sizeChangePage = () => {
pageSetting.current = 1
}
watch(
() => props.type,

View File

@ -128,8 +128,8 @@ import { useI18n } from 'vue-i18n'
import { getAirBlowerListReq, getBelongLineListReq, runAirBlowerReq } from '/@/api/backend/airBlower/request'
import { ElMessage, TableInstance } from 'element-plus'
import { useRouter, useRoute } from 'vue-router'
import { getRealTimeState } from './utils'
const router = useRouter()
const route = useRoute()
const { t } = useI18n()
@ -188,6 +188,10 @@ const airBlowerSelectOptions = reactive<{ [K in SelectTypeKeyUnionType]: { label
label: '电网故障停机',
value: 1111,
},
{
label: '安全链停机',
value: 1112,
},
],
belongLine: [],
})
@ -198,13 +202,15 @@ const selectAirBlower = (type: SelectTypeKeyUnionType) => {
return
} else if (airBlowerSelect.belongLine !== '全部' && airBlowerSelect.iturbineoperationmode !== 987654321) {
if (type === 'iturbineoperationmode' && airBlowerSelect.iturbineoperationmode === 2) {
const type1 = tableData.value.filter((item) => item.iturbineoperationmode === 1)
const type6 = tableData.value.filter((item) => item.iturbineoperationmode === 6)
const type2 = tableData.value.filter((item) => item.iturbineoperationmode === 2)
tableData.value = [...type1, ...type6, ...type2]
const type1 = originTableData.value.filter((item) => item.iturbineoperationmode === 1)
const type6 = originTableData.value.filter((item) => item.iturbineoperationmode === 6)
const type2 = originTableData.value.filter((item) => item.iturbineoperationmode === 2)
const typeAll = [...type1, ...type6, ...type2]
tableData.value = typeAll.filter((item) => item.belongLine === airBlowerSelect.belongLine)
return
}
tableData.value = tableData.value.filter((item) => item[type] === airBlowerSelect[type])
const resData = originTableData.value.filter((item) => item.iturbineoperationmode === airBlowerSelect.iturbineoperationmode)
tableData.value = resData.filter((item) => item.belongLine === airBlowerSelect.belongLine)
return
} else {
if (type === 'belongLine' && airBlowerSelect.belongLine === '全部') {
@ -329,22 +335,6 @@ const tableColumn: TableColumnType[] = [
},
]
const getRealTimeState = (data: any) => {
if (data.attributeMap.iturbineoperationmode) {
if (data.attributeMap.iturbineoperationmode > 1 && data.attributeMap.iturbineoperationmode < 6) {
return 2
}
if (data.attributeMap.iturbineoperationmode === 21) {
return 20
}
return data.attributeMap.iturbineoperationmode
} else if (data.attributeMap.iyplevel === 10) {
return 1110
} else if (data.attributeMap.gridlostdetected === 1) {
return 1111
}
}
const tableRef = ref<TableInstance>()
const tableData = ref<TableDataObjType[]>([])
const originTableData = ref<TableDataObjType[]>([])
@ -352,7 +342,7 @@ const getTableData = () => {
getAirBlowerListReq()
.then((res) => {
const data = res.data.map((item: any) => {
const state = getRealTimeState(item)
const state = getRealTimeState(item.attributeMap)
const ipitchangle = Math.min(item.attributeMap.ipitchangle1, item.attributeMap.ipitchangle2, item.attributeMap.ipitchangle3)
const resVal: any = {}
Object.keys(item.attributeMap).forEach((attrKey) => {

View File

@ -0,0 +1,17 @@
export const getRealTimeState = (data: any) => {
if (data.iturbineoperationmode) {
if (data.iturbineoperationmode > 1 && data.iturbineoperationmode < 6) {
return 2
}
if (data.iturbineoperationmode === 21) {
return 20
}
return data.iturbineoperationmode
} else if (data.iyplevel === 10) {
return 1110
} else if (data.gridlostdetected === 1) {
return 1111
} else if (data.ibplevel === 200) {
return 1112
}
}