| 1234567891011121314151617181920212223242526272829303132 |
- import BaseAPI from './BaseAPI';
- /**
- * 数据看板 Service
- * 后端接口:
- * - GET /collect_dashboard/index?date=yyyy-MM-dd 按日看板数据
- * - GET /collect_dashboard/trend?start_date=&end_date= 日期范围趋势数据
- */
- class Dashboard extends BaseAPI {
- constructor() {
- super(``);
- }
- // 查询指定日期的看板数据(不传则默认今天)
- getByDate(data: { date?: string } = {}) {
- return this._get({ path: `/collect_dashboard/index`, data }).then(
- (data) => {
- return data;
- },
- );
- }
- // 查询日期范围内的看板数据(用于趋势图)
- getTrend(data: { start_date?: string; end_date?: string }) {
- return this._get({ path: `/collect_dashboard/trend`, data }).then(
- (data) => {
- return data;
- },
- );
- }
- }
- export default new Dashboard();
|