index.ts 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. /**
  2. * 静态数据与全局常量配置
  3. */
  4. // 缓存相关的 Key
  5. export const CACHE_KEY = {
  6. TOKEN: 'ACCESS_TOKEN', //token
  7. SCITOKEN: 'SCITOKEN', //科技专项活动token
  8. USER_INFO: 'USER_INFO', //用户信息
  9. REMEMBER_USER: 'REMEMBER_USER', // 记住用户名
  10. PERMS: 'PERMS', // 权限
  11. ROLES: 'ROLES' // 角色
  12. };
  13. // 分页默认参数
  14. export const PAGE_CONFIG = {
  15. DEFAULT_PAGE_NUM: 1,
  16. DEFAULT_PAGE_SIZE: 10
  17. };
  18. // 内部项目状态选项
  19. export const spontaneityProjectStatusOptions = [
  20. { dictLabel: '全部状态', dictValue: '' },
  21. { dictLabel: '待立项', dictValue: '05', type: 'primary' },
  22. { dictLabel: '立项', dictValue: '10', type: 'primary' },
  23. { dictLabel: '在研', dictValue: '20', type: 'primary' },
  24. { dictLabel: '结题验收', dictValue: '30', type: 'success' },
  25. { dictLabel: '中止', dictValue: '40', type: 'error' },
  26. { dictLabel: '临近结题', dictValue: '50', type: 'warning' },
  27. ];
  28. // 纵向项目状态
  29. export const verticalProjectStatusOptions = [
  30. { dictLabel: '全部状态', dictValue: '' },
  31. { dictLabel: '待立项', dictValue: '06', type: 'primary' },
  32. { dictLabel: '立项', dictValue: '10', type: 'primary' },
  33. { dictLabel: '在研', dictValue: '20', type: 'primary' },
  34. { dictLabel: '结题验收', dictValue: '30', type: 'success' },
  35. { dictLabel: '中止', dictValue: '40', type: 'error' },
  36. { dictLabel: '临近结题', dictValue: '50', type: 'warning' },
  37. ];
  38. // 横向项目状态选项
  39. export const horizontalProjectStatusOptions = [
  40. { dictLabel: '全部状态', dictValue: '' },
  41. { dictLabel: '待立项', dictValue: '06', type: 'primary' },
  42. { dictLabel: '立项', dictValue: '10', type: 'primary' },
  43. { dictLabel: '在研', dictValue: '20', type: 'primary' },
  44. { dictLabel: '结题验收', dictValue: '30', type: 'success' },
  45. { dictLabel: '中止', dictValue: '40', type: 'error' },
  46. { dictLabel: '临近结题', dictValue: '50', type: 'warning' },
  47. ];
  48. // 安评项目状态选项
  49. export const safetyProjectStatusOptions = [
  50. { dictLabel: '全部状态', dictValue: '' },
  51. { dictLabel: '待立项', dictValue: '06', type: 'primary' },
  52. { dictLabel: '立项', dictValue: '10', type: 'primary' },
  53. { dictLabel: '在研', dictValue: '20', type: 'primary' },
  54. { dictLabel: '结题验收', dictValue: '30', type: 'success' },
  55. { dictLabel: '中止', dictValue: '40', type: 'error' },
  56. { dictLabel: '临近结题', dictValue: '50', type: 'warning' },
  57. ];
  58. // 变更类型选项
  59. export const changeTypeOptions = [
  60. { dictLabel: '成员变更', dictValue: '10' },
  61. { dictLabel: '预算变更', dictValue: '20' },
  62. { dictLabel: '延期变更', dictValue: '30' },
  63. { dictLabel: '经费变更', dictValue: '40' },
  64. { dictLabel: '中止变更', dictValue: '50' },
  65. { dictLabel: '经费调剂', dictValue: '60' },
  66. ];
  67. // 审批状态选项
  68. export const approvalStatusOptions = [
  69. { dictLabel: '待提交', dictValue: '10' },
  70. { dictLabel: '审批中', dictValue: '20' },
  71. { dictLabel: '审批通过', dictValue: '30' },
  72. { dictLabel: '审批退回', dictValue: '40' }
  73. ];
  74. // 临床研究选项 (针对横向项目)
  75. export const isClinicalTrialOptions = [
  76. { dictLabel: '临床试验', dictValue: '10' },
  77. { dictLabel: '横向其他', dictValue: '20' }
  78. ];
  79. // 审批流节点结果选项
  80. export const flowApprovalResultOptions = [
  81. { dictLabel: '通过', dictValue: 'pass', type: 'success' },
  82. { dictLabel: '拒绝', dictValue: 'rejection', type: 'error' },
  83. { dictLabel: '退回', dictValue: 'back', type: 'warning' },
  84. { dictLabel: '审批中', dictValue: 'processing', type: 'primary' }
  85. ];
  86. // 审批流审核方式选项
  87. export const flowApprovalModelOptions = [
  88. { dictLabel: '会签', dictValue: '10' },
  89. { dictLabel: '或签', dictValue: '20' }
  90. ];
  91. // 中检状态选项
  92. export const inspApprovalStatusOptions = [
  93. { dictLabel: '待提交', dictValue: '10', type: 'info' },
  94. { dictLabel: '审批中', dictValue: '20', type: 'primary' },
  95. { dictLabel: '审批通过', dictValue: '30', type: 'success' },
  96. { dictLabel: '审批退回', dictValue: '40', type: 'error' }
  97. ];
  98. // 待办页面 Tab 分类
  99. export const TODO_TAB_LIST = [
  100. { name: '待我审批', type: 'approval' as const },
  101. { name: '我发起的', type: 'start' as const },
  102. { name: '审批历史', type: 'history' as const }
  103. ];
  104. // 首页常用功能导航列表
  105. export const HOME_NAV_LIST = [
  106. { name: '科研项目', path: '/pages/project/index', icon: '/static/imgs/fund-claim.png', permission: 'project:list' },
  107. // { name: '经费认领', path: '/pages/fund/claim/index', icon: '/static/imgs/fund-claim.png' },
  108. { name: '经费入账', path: '/pages/fund/claim-records/index', icon: '/static/imgs/fund-entry.png', permission: 'fund:claim:records:list' },
  109. { name: '经费支出', path: '/pages/fund/reimbursement/index', icon: '/static/imgs/fund-reimburse.png', permission: 'fund:reimbursement:list' },
  110. { name: '科研成果', path: '/pages/achievement/index', icon: '/static/imgs/fund-reimburse.png', permission: 'achievement:list' },
  111. // { name: '考核奖励', path: '/pages/fund/reimbursement-remind/index', icon: '/static/imgs/fund-reimburse.png' },
  112. { name: '业务审批', path: '/pages/todo/index', icon: '/static/imgs/home-tech.png', permission: 'todo:list' }
  113. ];
  114. // 首页模拟通知公告列表
  115. export const NOTICE_LIST_MOCK = [
  116. { id: 1, title: '公告标题', date: '发布日期' },
  117. { id: 2, title: '公告标题', date: '发布日期' },
  118. { id: 3, title: '公告标题', date: '发布日期' }
  119. ];
  120. // 默认分页数量
  121. export const DEFAULT_PAGE_SIZE = 25;
  122. export const projectRoleOptions = [
  123. { dictLabel: '负责人', dictValue: '10' },
  124. { dictLabel: '主要参与人', dictValue: '20' },
  125. { dictLabel: '一般参与人', dictValue: '30' }
  126. ];
  127. // 人员类型选项
  128. export const memberTypeOptions = [
  129. { dictLabel: '本院人员', dictValue: '10' },
  130. { dictLabel: '非本院人员', dictValue: '20' },
  131. { dictLabel: '研究生', dictValue: '30' }
  132. ];
  133. /**
  134. * 根据项目类型标识获取显示名称
  135. * @param type 项目类型标识 (vertical/horizontal/spontaneity)
  136. * @returns 项目分类中文名称
  137. */
  138. export const getProjectTypeName = (type: string) => {
  139. const map: Record<string, string> = {
  140. 'vertical': '纵向项目',
  141. 'horizontal': '横向项目',
  142. 'spontaneity': '校内项目',
  143. 'safety': '安评项目',
  144. '10': '纵向项目',
  145. '20': '横向项目',
  146. '30': '校内项目',
  147. '70': '安评项目'
  148. };
  149. return map[type] || '未知项目';
  150. };
  151. // 论文类型选项
  152. export const paperTypeOptions = [
  153. { dictValue: '10', dictLabel: '学术专著' },
  154. { dictValue: '20', dictLabel: '编著' },
  155. { dictValue: '30', dictLabel: '译著' },
  156. { dictValue: '40', dictLabel: '科普读物' },
  157. { dictValue: '50', dictLabel: '行业指南' },
  158. { dictValue: '60', dictLabel: '教材' }
  159. ];
  160. // 著作类别选项
  161. export const workClassOptions = [
  162. { dictValue: '10', dictLabel: '学术专著' },
  163. { dictValue: '20', dictLabel: '编著' },
  164. { dictValue: '30', dictLabel: '译著' },
  165. { dictValue: '40', dictLabel: '科普读物' },
  166. { dictValue: '50', dictLabel: '行业指南' },
  167. { dictValue: '60', dictLabel: '教材' }
  168. ];
  169. // 专利类型选项
  170. export const patentClassOptions = [
  171. { dictValue: '10', dictLabel: '实用新型' },
  172. { dictValue: '20', dictLabel: '外观新型' },
  173. { dictValue: '30', dictLabel: '发明专利' },
  174. { dictValue: '40', dictLabel: '计算机软件著作权' }
  175. ];
  176. // 获奖级别选项
  177. export const awardLevelOptions = [
  178. { dictValue: '10', dictLabel: '学校级' },
  179. { dictValue: '20', dictLabel: '地市级' },
  180. { dictValue: '30', dictLabel: '省级奖' },
  181. { dictValue: '40', dictLabel: '部级奖' },
  182. { dictValue: '50', dictLabel: '国家级' }
  183. ];
  184. // 获奖等级选项
  185. export const awardGradeOptions = [
  186. { dictValue: '10', dictLabel: '特等奖' },
  187. { dictValue: '20', dictLabel: '一等奖' },
  188. { dictValue: '30', dictLabel: '二等奖' },
  189. { dictValue: '40', dictLabel: '三等奖' },
  190. { dictValue: '50', dictLabel: '四等奖' },
  191. { dictValue: '90', dictLabel: '其他' }
  192. ];
  193. // 奖励类别选项
  194. export const awardClassOptions = [
  195. { dictValue: '10', dictLabel: '国家最高科学技术奖' },
  196. { dictValue: '20', dictLabel: '其他奖项' }
  197. ];
  198. // 奖励类型选项
  199. export const awardTypeOptions = [
  200. { dictValue: '10', dictLabel: '成果奖' },
  201. { dictValue: '20', dictLabel: '人才奖' }
  202. ];
  203. // 合作类型选项
  204. export const cooperationTypeOptions = [
  205. { dictValue: '10', dictLabel: '独立申请' },
  206. { dictValue: '20', dictLabel: '联合申请' }
  207. ];
  208. /**
  209. * 根据选项列表和值获取对应的 Label
  210. * @param options 选项列表
  211. * @param value 字典值
  212. */
  213. export const getStatusLabel = (options: any[], value: string | number) => {
  214. const item = options.find(opt => String(opt.dictValue) === String(value));
  215. return item ? item.dictLabel : (value || '-');
  216. };