| | |
| | | } |
| | | }, |
| | | computed: { |
| | | //时间列表 |
| | | timeList() { |
| | | // console.log("ddddddddd", this.timeListNew, this.$route.query.type); |
| | | if (this.$route.query.type == 'US-stocks') { |
| | | return [ |
| | | { id: '1', time: '1', text: '1s' + this.$t('分'), ts: 1 * 60 * 1000 }, |
| | | { id: '15', time: '15', text: '15' + this.$t('分'), ts: 15 * 60 * 1000 }, |
| | | { id: '30', time: '30', text: '30' + this.$t('分'), ts: 30 * 60 * 1000 }, |
| | | { id: '45', time: '45', text: '45' + this.$t('分'), ts: 45 * 60 * 1000 }, |
| | | { id: '60', time: '60', text: '60' + this.$t('分'), ts: 60 * 60 * 1000 }, |
| | | { id: 'D', time: 'D', text: '1' + this.$t('天'), ts: 1 * 24 * 60 * 60 * 1000 }, |
| | | { id: 'W', time: 'W', text: '1' + this.$t('周'), ts: 7 * 24 * 60 * 60 * 1000 }, |
| | | { id: 'M', time: 'M', text: '1' + this.$t('月'), ts: 30 * 24 * 60 * 60 * 1000 }, |
| | | ] |
| | | } else { |
| | | return [ |
| | | { id: '1min', time: '1min', text: this.$t('分时'), ts: 1 * 60 * 1000 }, |
| | | { id: '1mins', time: '1min', text: '1' + this.$t('分'), ts: 1 * 60 * 1000 }, |
| | | { id: '5min', time: '5min', text: '5' + this.$t('分'), ts: 5 * 60 * 1000 }, |
| | | { id: '15min', time: '15min', text: '15' + this.$t('分'), ts: 15 * 60 * 1000 }, |
| | | { id: '30min', time: '30min', text: '30' + this.$t('分'), ts: 30 * 60 * 1000 }, |
| | | { id: '60min', time: '60min', text: '1' + this.$t('小时'), ts: 60 * 60 * 1000 }, |
| | | { id: '4hour', time: '4hour', text: '4' + this.$t('小时'), ts: 4 * 60 * 60 * 1000 }, |
| | | { id: '1day', time: '1day', text: '1' + this.$t('天'), ts: 24 * 60 * 60 * 1000 }, |
| | | { id: '1week', time: '1week', text: '1' + this.$t('周'), ts: 7 * 24 * 60 * 60 * 1000 }, |
| | | { id: '1mon', time: '1mon', text: '1' + this.$t('月'), ts: 30 * 24 * 60 * 60 * 1000 } |
| | | ] |
| | | } |
| | | return [ |
| | | { id: '1min', time: '1min', text: this.$t('分时'), ts: 1 * 60 * 1000 }, |
| | | { id: '1mins', time: '1min', text: '1' + this.$t('分'), ts: 1 * 60 * 1000 }, |
| | | { id: '5min', time: '5min', text: '5' + this.$t('分'), ts: 5 * 60 * 1000 }, |
| | | { id: '15min', time: '15min', text: '15' + this.$t('分'), ts: 15 * 60 * 1000 }, |
| | | { id: '30min', time: '30min', text: '30' + this.$t('分'), ts: 30 * 60 * 1000 }, |
| | | { id: '60min', time: '60min', text: '1' + this.$t('小时'), ts: 60 * 60 * 1000 }, |
| | | { id: '4hour', time: '4hour', text: '4' + this.$t('小时'), ts: 4 * 60 * 60 * 1000 }, |
| | | { id: '1day', time: '1day', text: '1' + this.$t('天'), ts: 24 * 60 * 60 * 1000 }, |
| | | { id: '1week', time: '1week', text: '1' + this.$t('周'), ts: 7 * 24 * 60 * 60 * 1000 }, |
| | | { id: '1mon', time: '1mon', text: '1' + this.$t('月'), ts: 30 * 24 * 60 * 60 * 1000 } |
| | | ]//时间列表 |
| | | } |
| | | }, |
| | | components: { |
| | |
| | | }, |
| | | fetchData(time) { // 获取数据 |
| | | this.chartLoading = true |
| | | _getKline(this.symbol, this.timeValue.time || '1').then(data => { |
| | | _getKline(this.symbol, this.timeValue.time || '1min').then(data => { |
| | | this.chartLoading = false |
| | | data.map(item => { |
| | | item.timestamp = item.ts |
| | |
| | | }, |
| | | setChartType() { |
| | | let type = 'area' |
| | | if (this.timeValue.id === '1') { |
| | | if (this.timeValue.id === '1min') { |
| | | type = 'area' |
| | | } else { |
| | | type = 'candle_solid' |
| | |
| | | // #kline { |
| | | // // min-height: 828px; |
| | | // height: 1200px; |
| | | // }</style> |
| | | // } |
| | | </style> |