| | |
| | | this.getStock(); |
| | | }, |
| | | methods: { |
| | | filterSH(val) { |
| | | if (val === "sh") { |
| | | return 1; |
| | | } else if (val === "bj" || val === "sz") { |
| | | return 0; |
| | | } |
| | | }, |
| | | handleGoToKlineDetail1(item) { |
| | | console.log(item); |
| | | const obj = { |
| | | pid: item.code || "", |
| | | type: item.stock_type || "", |
| | | }; |
| | | window.localStorage.setItem("kLine", JSON.stringify(obj)); |
| | | // return; |
| | | var codes = item.code; |
| | | var names = item.name; |
| | | var ifZhishu = "0"; |
| | | var ifUs = |
| | | item.stock_type === "us" ? "1" : item.stock_type === "hk" ? "2" : ""; |
| | | this.$router.push({ |
| | | path: "/kline", |
| | | query: { |
| | | name: names, |
| | | code: codes, |
| | | if_us: ifUs, |
| | | if_zhishu: ifZhishu, |
| | | sok: item.type ? item.type : this.filterSH(item.stock_type), |
| | | type: item.stock_type, |
| | | }, |
| | | }); |
| | | }, |
| | | getStock: handleDt.debounce(async function (pageNum) { |
| | | let stockType = "IN"; |
| | | let pageNumVal = 1; |