Commit 87b1abf5 authored by hubaoshan's avatar hubaoshan

getData() 父调子方法Bug

parent cdbc9194
......@@ -80,6 +80,9 @@ function getDataNew(item) {
Page.rows = res.pageSize
})
}
defineExpose({
getData
});
</script>
<template>
......
......@@ -92,6 +92,9 @@ function getDataNew(item) {
historyPage.rows = res.pageSize
})
}
defineExpose({
getData
});
</script>
<template>
......
......@@ -31,7 +31,8 @@ const getData = () => {
if (childComponentRef.value && childComponentRef.value.getData) {
console.log('能不能成功啊')
childComponentRef.value.getData(); // 调用子组件的 getData 方法
}
}else{
console.log('啊,不行啊')}
};
const {proxy} = getCurrentInstance();
// 列表
......@@ -97,6 +98,13 @@ const search = () => {
beginTime: queryParams.beginTime,
endTime: queryParams.endTime,
})
if(item.alarmStatus === undefined || item.alarmType === undefined || item.beginTime == null || item.endTime == null || item.stationId === undefined){
item.alarmStatus = ''
item.endTime = ''
item.stationId = ''
item.beginTime = ''
item.alarmType = ''
}
if (selectedBtn.value === 1) {
childParams.value = item
} else if (selectedBtn.value === 2) {
......@@ -111,7 +119,6 @@ function getNumber() {
getAlarmNumData().then(res => {
console.log('123123123123-----------', res.data)
alarmNum.value = res.data
iop.value = res.data
})
}
......@@ -167,12 +174,14 @@ const handleExport = () => {
// 重置
const resetSearch = () => {
console.log("怎么不执行重置啊?")
queryParams.alarmStatus = ''
queryParams.beginTime = ''
queryParams.endTime = ''
queryParams.alarmType = ''
queryParams.stationId = ''
searchData.value = {}
searchData.value = []
getData()
}
const loading = ref(true);
......@@ -308,7 +317,7 @@ watch(
</el-form-item>
<el-form-item>
<el-button type="primary" @click="search" class="add-search-btn">查询</el-button>
<el-button type="primary" @click="resetSearch" class="add-search-btn" v-if="selectedBtn !== 3">重置</el-button>
<el-button type="primary" @click="resetSearch()" class="add-search-btn" v-if="selectedBtn !== 3">重置</el-button>
<el-button type="primary" @click="handleExport()" class="add-search-btn">导出</el-button>
</el-form-item>
</el-form>
......
......@@ -163,6 +163,9 @@ function getSupplys() {
}
getSupplys()
defineExpose({
getData
});
</script>
<template>
......
......@@ -159,6 +159,9 @@ function getSupplys() {
}
getSupplys()
defineExpose({
getData
});
</script>
<template>
......
......@@ -93,6 +93,13 @@ const search = () => {
beginTime: queryParams.beginTime,
endTime: queryParams.endTime,
}
if(item.alarmStatus === undefined || item.alarmType === undefined || item.beginTime == null || item.endTime == null || item.stationId === undefined){
item.alarmStatus = ''
item.endTime = ''
item.stationId = ''
item.beginTime = ''
item.alarmType = ''
}
if (selectedBtn.value === 1) {
childParams.value = item
} else if (selectedBtn.value === 2) {
......@@ -170,7 +177,8 @@ const resetSearch = () => {
queryParams.endTime = ''
queryParams.alarmType = ''
queryParams.stationId = ''
searchData.value = {}
searchData.value = []
getData()
}
const loading = ref(true);
......
......@@ -134,6 +134,9 @@ function getSupplys(){
}
}
getSupplys()
defineExpose({
getData
});
</script>
<template>
......
......@@ -157,6 +157,9 @@ function getSupplys() {
}
getSupplys()
defineExpose({
getData
});
</script>
<template>
......
......@@ -117,7 +117,13 @@ const search = () => {
beginTime: queryParams.beginTime,
endTime: queryParams.endTime,
}
if(item.alarmStatus === undefined || item.alarmType === undefined || item.beginTime == null || item.endTime == null || item.stationId === undefined){
item.alarmStatus = ''
item.endTime = ''
item.stationId = ''
item.beginTime = ''
item.alarmType = ''
}
if (selectedBtn.value === 1) {
childParams.value = item
} else if (selectedBtn.value === 2) {
......@@ -195,7 +201,8 @@ const resetSearch = () => {
queryParams.endTime = ''
queryParams.alarmType = ''
queryParams.stationId = ''
searchData.value = {}
searchData.value = []
getData()
}
const options = ref([]);
const enterpriseId = ref();
......
......@@ -184,7 +184,7 @@ const resetSearch = () => {
queryParams.endTime = ''
queryParams.alarmType = ''
queryParams.stationId = ''
searchData.value = {}
searchData.value = []
};
const options = ref([]);
const enterpriseId = ref();
......
......@@ -156,6 +156,9 @@ function getSupplys() {
}
getSupplys()
defineExpose({
getData
});
</script>
<template>
......
......@@ -159,6 +159,9 @@ function getSupplys() {
}
getSupplys()
defineExpose({
getData
});
</script>
<template>
......
......@@ -125,6 +125,13 @@ const search = () => {
beginTime: queryParams.beginTime,
endTime: queryParams.endTime,
}
if(item.alarmStatus === undefined || item.alarmType === undefined || item.beginTime == null || item.endTime == null || item.stationId === undefined){
item.alarmStatus = ''
item.endTime = ''
item.stationId = ''
item.beginTime = ''
item.alarmType = ''
}
if (selectedBtn.value === 1) {
childParams.value = item
} else if (selectedBtn.value === 2) {
......@@ -202,7 +209,8 @@ const resetSearch = () => {
queryParams.endTime = ''
queryParams.alarmType = ''
queryParams.stationId = ''
searchData.value = {}
searchData.value = []
getData()
};
const options = ref([]);
const enterpriseId = ref();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment