风机列表:命令请求修改,单风机页面切换

This commit is contained in:
高云鹏 2024-10-25 16:36:35 +08:00
parent 06bc07bfcd
commit 74aa49980f
2 changed files with 26 additions and 2 deletions

View File

@ -20,7 +20,7 @@ export const runAirBlowerReq = (data: {
opValue: 1 | 0
}[]) => {
return createAxios({
url: '/windTurbinesControl',
url: '/api/page/turbines/windTurbinesControl',
method: 'post',
data: data
})

View File

@ -101,7 +101,7 @@
<div>{{ scope.row[item.prop] }}</div>
</template>
<template v-if="item.prop === 'name'" #default="scope">
<div class="tableColumnClick">{{ scope.row[item.prop] }}</div>
<div class="tableColumnClick" @click="openWindTurbine(scope.row)">{{ scope.row[item.prop] }}</div>
</template>
</el-table-column>
</template>
@ -117,6 +117,9 @@ import { reactive, ref, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import { getAirBlowerListReq, getBelongLineListReq, runAirBlowerReq } from '/@/api/backend/airBlower/request'
import { ElMessage } from 'element-plus'
import { useRouter, useRoute } from 'vue-router'
const router = useRouter()
const route = useRoute()
const { t } = useI18n()
@ -394,6 +397,27 @@ watch(autoUpdate, (newVal: boolean) => {
}
})
const openWindTurbine = (row: TableDataObjType) => {
if (!router.hasRoute('windTurbine')) {
router.addRoute('admin', {
path: '/windTurbine',
name: 'windTurbine',
component: () => import('/@/views/backend/WindBlower/index.vue'),
meta: {
title: '风机详情',
},
})
}
console.log(router.getRoutes());
router.push({
name: 'windTurbine',
query: {
irn: row.irn,
},
})
}
getTableData()
getBlongLineList()
</script>