import http from './http' import dicts from './dicts.js' import util from './util.js' const httpCommon = { async queryDict(spacecode,parentCode) { const { code, data } = await http.commonPage('spacedict', { current: 1, size: 100, // type:dicts.UserType parentCode: parentCode || '', spacecode:spacecode||'' }) var options = [] if (code == 0) { if (data.records) { for (var item of data.records) { options.push(item) } } } return options }, async queryMetaByType(type) { // console.log('type?', type) const { code, data } = await http.request('get', 'api/v1.0/spacedictmeta/type-list', { params: { type: type } }) var options = [] if (code == 0) { if (data) { for (var item of data) { // console.log('item',item) options.push({ label: item.name, value: item.code }) } } } return options }, } export default httpCommon