diff --git a/src/components/ESelectSingle/index.vue b/src/components/ESelectSingle/index.vue index 19d506e..27010df 100644 --- a/src/components/ESelectSingle/index.vue +++ b/src/components/ESelectSingle/index.vue @@ -1,7 +1,6 @@ - @@ -38,12 +37,15 @@ const stnmId = ref('') - const handleChange = (id,name) => { - console.log(id,name) - return + const handleChange = (val) => { stnmId.value = val - emit('stationChange', val, options.value, stnm.value) - emit('loadingChange', false); + const selectedOption = options.value.find(option => option.stnmId === val) + if (selectedOption) { + stnm.value = selectedOption.stnm || selectedOption.name || '' + emit('stationChange', val, options.value, stnm.value) + } else { + emit('stationChange', val, options.value, '') + } emit('loadingChange', false); } const options = ref([]) diff --git a/src/views/report/waterZl/index.vue b/src/views/report/waterZl/index.vue index 6d4f251..e11fe04 100644 --- a/src/views/report/waterZl/index.vue +++ b/src/views/report/waterZl/index.vue @@ -99,8 +99,9 @@ loading.value = loadingState; } // 新增处理站点变化的函数 - const handleStationChange = (stnmId) => { + const handleStationChange = (stnmId, options, stnm) => { queryParams.stnmId = stnmId + selectStnm.value = stnm if (stnmId == undefined) { proxy.$modal.msgWarning("请选择站点后查询"); return