import req from '@/request' import qs from 'qs' const portal = window.context.portal // 获取巡检台账表格数据 export function tableData(data = {}, query) { return new Promise((resolve, reject) => { let newQuery = {} Object.keys(query).forEach(key => { if (query[key]) newQuery[key] = query[key] }) req.post(portal + `/deviceInspectionResult/v1/statistics?${qs.stringify(newQuery)}`, data) .then(res => resolve(res.data)) .catch(err => reject(err)) }) }