diff --git a/src/components/rangeConfig.vue b/src/components/rangeConfig.vue index b4a719b..38011b0 100644 --- a/src/components/rangeConfig.vue +++ b/src/components/rangeConfig.vue @@ -87,9 +87,7 @@ import { GraphicData, JlGraphic } from 'src/jl-graphic'; import { saveAlertTypeData, showAlertTypeData } from './alarm/alarmInfoEnum'; import { Section } from 'src/graphics/section/Section'; -const props = defineProps({ - rangeConfigEdit: Number, -}); +defineExpose({ searchById }); const route = useRoute(); const lineStore = useLineStore(); @@ -145,11 +143,6 @@ enum DeviceTypeShow { DEVICE_TYPE_PLATFORM = 'Platform', } -watch(props, () => { - handleState.value = '编辑范围配置'; - searchById(); -}); - watch( () => lineStore.selectedGraphics, (val) => { @@ -187,6 +180,7 @@ watch( ); const myForm = ref(null); +let editId: number; async function onSubmit() { myForm.value?.validate().then(async (res) => { if (res) { @@ -205,7 +199,7 @@ async function onSubmit() { if (handleState.value == '新建范围配置') { await deviceRangeSet(params); } else { - params.id = props.rangeConfigEdit; + params.id = editId; await deviceRangeSet(params); } @@ -223,9 +217,10 @@ async function onSubmit() { }); } -async function searchById() { +async function searchById(id: number) { try { - const id = props.rangeConfigEdit as number; + handleState.value = '编辑范围配置'; + editId = id; const response = await queryDeviceRangeById(id); const datas: GraphicData[] = []; if (response.data.data) { diff --git a/src/layouts/LineLayout.vue b/src/layouts/LineLayout.vue index fda6ebf..35ba279 100644 --- a/src/layouts/LineLayout.vue +++ b/src/layouts/LineLayout.vue @@ -15,13 +15,13 @@
- +