You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.6 KiB
38 lines
1.6 KiB
import { getStorage, requestGet, requestOptions, requestPost, requestTableList, } from '@component/utils'; |
|
import LRU from 'lru-cache'; |
|
import { isArray, map, omit } from 'lodash'; |
|
export const cacheData = new LRU({}); |
|
//考评模板列表 |
|
export const getTemplateList = () => { |
|
const organId = getStorage('organId'); |
|
if (cacheData.has(`template${organId}`)) { |
|
return Promise.resolve(cacheData.get(`template${organId}`)); |
|
} |
|
return requestGet(process.env.REACT_APP_API_URL, `checkTemplate/getList`, { |
|
insuranceId: organId, |
|
}, ['templateId', 'templateName']).then((result) => { |
|
if (isArray(result)) { |
|
const data = map(result, (item) => { |
|
return { |
|
value: item === null || item === void 0 ? void 0 : item.templateId, |
|
label: item === null || item === void 0 ? void 0 : item.templateName, |
|
key: item === null || item === void 0 ? void 0 : item.templateId, |
|
}; |
|
}); |
|
cacheData.set(`template${organId}`, data); |
|
return data; |
|
} |
|
}); |
|
}; |
|
//考评模板详情 |
|
export const getTemplate = (params) => { |
|
return requestGet(process.env.REACT_APP_API_URL, 'checkTemplate/show', params); |
|
}; |
|
//回访表单提交 |
|
export const onSubmit = (params) => { |
|
return requestPost(process.env.REACT_APP_API_URL, 'organVisit/addVisit', params); |
|
}; |
|
//获取机构评价 |
|
export const getOrganVisit = (params) => { |
|
return requestGet(process.env.REACT_APP_API_URL, `organVisit/getVisitByOrganId/${params === null || params === void 0 ? void 0 : params.organId}`, {}); |
|
};
|
|
|