|
|
|
@ -356,7 +356,7 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
|
this.getIndustryOptions()
|
|
|
|
this.getIndustryOptions()
|
|
|
|
this.getDailyTradeList()
|
|
|
|
this.getLastTradeDate()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
// ========================= 通用方法 =========================
|
|
|
|
// ========================= 通用方法 =========================
|
|
|
|
@ -368,15 +368,30 @@ export default {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 获取最后一个交易日 */
|
|
|
|
|
|
|
|
getLastTradeDate() {
|
|
|
|
|
|
|
|
stockdataApi.getLastTradeDate().then(response => {
|
|
|
|
|
|
|
|
const lastTradeDate = response.data
|
|
|
|
|
|
|
|
if (lastTradeDate) {
|
|
|
|
|
|
|
|
// 设置所有日期筛选器的默认值
|
|
|
|
|
|
|
|
this.dailyTradeQuery.tradeDate = lastTradeDate
|
|
|
|
|
|
|
|
this.industryIndexQuery.tradeDate = lastTradeDate
|
|
|
|
|
|
|
|
this.stockHighLowQuery.tradeDate = lastTradeDate
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 在获取到最后交易日后,再调用查询方法,确保日期已经设置
|
|
|
|
|
|
|
|
this.getDailyTradeList()
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
/** Tab 切换 */
|
|
|
|
/** Tab 切换 */
|
|
|
|
handleTabClick(tab) {
|
|
|
|
handleTabClick(tab) {
|
|
|
|
if (tab.name === 'dailyTrade' && this.dailyTradeList.length === 0) {
|
|
|
|
if (tab.name === 'dailyTrade') {
|
|
|
|
this.getDailyTradeList()
|
|
|
|
this.getDailyTradeList()
|
|
|
|
} else if (tab.name === 'stockBasic' && this.stockBasicList.length === 0) {
|
|
|
|
} else if (tab.name === 'stockBasic') {
|
|
|
|
this.getStockBasicList()
|
|
|
|
this.getStockBasicList()
|
|
|
|
} else if (tab.name === 'industryIndex' && this.industryIndexList.length === 0) {
|
|
|
|
} else if (tab.name === 'industryIndex') {
|
|
|
|
this.getIndustryIndexList()
|
|
|
|
this.getIndustryIndexList()
|
|
|
|
} else if (tab.name === 'stockHighLow' && this.stockHighLowList.length === 0) {
|
|
|
|
} else if (tab.name === 'stockHighLow') {
|
|
|
|
this.getStockHighLowList()
|
|
|
|
this.getStockHighLowList()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|