function handleQueryNewsId loadingvalue = true; thisNewsId = formDatanewsId; consolelog-------thisNewsId-=- thisNewsId; getNewsPage newsId thisNewsId page 1 pageSize 10 thendata any = c
The function handleQueryNewsId is used to handle the query for a specific news ID.
- The
loadingvariable is set totrueto indicate that the query is in progress. - The
thisNewsIdvariable is assigned the value offormData.newsId, which is the inputted news ID. - The
getNewsPagefunction is called with the parametersnewsId: thisNewsId,page: 1, andpageSize: 10to retrieve the news page with the specified news ID. - The retrieved data is logged to the console.
- The
newsIdsvariable is assigned an array of news IDs extracted from the retrieved data. - If the
newsIdsarray includes thethisNewsId, it means that the news ID exists. In this case, a message is logged to indicate that the news ID is on sale. - If the
newsIdsarray does not include thethisNewsId, it means that the news ID does not exist. In this case, a message is logged to indicate that the news ID does not exist. - The
newsListvariable is assigned the value ofdata.rows, which contains the retrieved news data. - The
totalvariable is assigned the value ofdata.total, which represents the total number of news pages. - Finally, the
loadingvariable is set tofalseto indicate that the query is complete.
原文地址: https://www.cveoy.top/t/topic/jcaI 著作权归作者所有。请勿转载和采集!