{"size": 944, "ext": "js", "max_stars_repo_path": "src/views/report/mixins.js", "max_stars_repo_name": "Gage9797/admin", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/views/report/mixins.js", "max_issues_repo_name": "Gage9797/admin", "max_issues_repo_issues_event_min_datetime": "2020-05-11T20:32:26.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T22:13:25.000Z", "max_forks_repo_path": "src/views/report/mixins.js", "max_forks_repo_name": "Gage9797/admin", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 8, "max_forks_count": null, "avg_line_length": 18.5098039216, "max_line_length": 61, "alphanum_fraction": 0.5646186441}
import { formatPrice } from '@/tools';

export default {
	filters: {
		formatPrice (v) {
			return formatPrice(v);
		}
	},
	data () {
		return {
			canUse: false
		};
	},
	computed: {
		requestTimestamp () {
			let start = this.daterange[0].getTime();
			let end = this.daterange[1].getTime();

			return {
				start,
				end
			};
		}
	},
	created () {
		// this.$store
		// 	.dispatch('GetAppInfo')
		// 	.then(({ appVersion, restTime }) => {
		// 		this.canUse = (appVersion === 3 && restTime >= 0);
		// 		this.canUse && (this.search && this.search());
		// 	})
		// 	.catch(err => {
		// 		console.log(err);
		// 	});

		let now = new Date();
		now.setHours(0);
		now.setMinutes(0);
		now.setSeconds(0);

		let sevenDayAgoTimestamp = +now - 30 * 24 * 60 * 60 * 1000;
		let sevenDayAgo = new Date(sevenDayAgoTimestamp);

		this.daterange = [sevenDayAgo, now];

		// 产品说试用版可以用报表了。
		this.canUse = true;
		this.search && this.search();
	}
};
