@@ -171,7 +172,7 @@ import {dialogBig} from '@/utils/elementBind'
import {type Device} from '@/api/device/interface/device'
import {ElMessage, type FormItemRule} from 'element-plus'
import {addPqDev, updatePqDev} from '@/api/device/device'
-import {computed, reactive, type Ref, ref} from 'vue'
+import {computed, reactive, type Ref, ref, watchEffect, nextTick} from 'vue'
import {useDictStore} from '@/stores/modules/dict'
import {CirclePlus, Delete, EditPen} from '@element-plus/icons-vue'
// 使用 dayjs 库格式化
@@ -196,7 +197,7 @@ const scene = ref('')
const dialogFormRef = ref()
const createDateTitle = ref('')
const activeTab = ref('0') // '0' 对应第一个 tab
-
+const monitorTableHeight = ref(375) // 默认高度
const pqChannelArray = ref([
{
value: '1',
@@ -206,6 +207,15 @@ const pqChannelArray = ref([
const disabledDate = (time: Date) => {
return time.getTime() > Date.now()
}
+const onTabChange = (tabName: string | number) => {
+ const name = tabName.toString(); // 统一转为字符串处理
+ if (name === '1') {
+ const formElement = dialogFormRef.value.$el as HTMLElement
+ const formHeight = formElement.offsetHeight
+ monitorTableHeight.value = formHeight - 88
+ }
+}
+
function useMetaInfo() {
const dialogVisible = ref(false)
diff --git a/frontend/src/views/machine/device/components/monitorTab.vue b/frontend/src/views/machine/device/components/monitorTab.vue
index c6e5229..08e4663 100644
--- a/frontend/src/views/machine/device/components/monitorTab.vue
+++ b/frontend/src/views/machine/device/components/monitorTab.vue
@@ -1,14 +1,13 @@
-
-