reportEvaluationEdit.js 950 B

123456789101112131415161718192021
  1. const EVALUATION_PROCESSING_PROMPT = '评估分析正在进行中,你需要等待1小时左右,我们会在报告生成完成后提示你,你可以去“我的PERILL报告”查阅报告结果。'
  2. function isReportGenerating(item = {}) {
  3. item = item || {}
  4. return String(item.state) === '0' || ['RUNNING', 'PENDING'].indexOf(String(item.status || '')) !== -1
  5. }
  6. function canEditEvaluation(item = {}) {
  7. const reportState = item.reportState === undefined || item.reportState === null ? item.state : item.reportState
  8. return String(item.reportType || '') === '1' && String(reportState) === '1'
  9. && ['RUNNING', 'PENDING'].indexOf(String(item.status || '')) === -1
  10. }
  11. function normalizeEvaluationForm(data = {}) {
  12. return {
  13. overallAssessment: data.overallAssessment || '',
  14. developmentAdvice: data.developmentAdvice || ''
  15. }
  16. }
  17. module.exports = { EVALUATION_PROCESSING_PROMPT, isReportGenerating, canEditEvaluation, normalizeEvaluationForm }