resources.js 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. export const RESOURCE_MAP = {
  2. acupoints: {
  3. title: '穴位管理',
  4. apiPath: '/acupoints',
  5. searchApiPath: '/acupoints/search',
  6. exportApiPath: '/acupoints/export',
  7. batchDeleteApiPath: '/acupoints/batch-delete',
  8. columns: [
  9. { prop: 'id', label: 'ID', width: 80 },
  10. { prop: 'code', label: '编码', width: 120 },
  11. { prop: 'name', label: '名称', width: 100 },
  12. { prop: 'meridian', label: '所属经络', width: 140 },
  13. { prop: 'efficacy', label: '功效', minWidth: 160 },
  14. { prop: 'side', label: '侧别', width: 80 },
  15. { prop: 'status', label: '状态', width: 80 },
  16. { prop: 'createTime', label: '创建时间', width: 170 },
  17. ],
  18. formFields: [
  19. { prop: 'code', label: '穴位编码', type: 'input', required: true },
  20. { prop: 'name', label: '穴位名称', type: 'input', required: true },
  21. { prop: 'meridian', label: '所属经络', type: 'select', options: ['督脉', '足太阳膀胱经', '手太阳小肠经', '其他'] },
  22. { prop: 'efficacy', label: '功效(逗号分隔)', type: 'input' },
  23. { prop: 'positioning', label: '定位方式', type: 'select', options: ['relative', 'absolute'] },
  24. { prop: 'offsetCun', label: '纵向偏移(寸)', type: 'input' },
  25. { prop: 'cunType', label: '指寸类型', type: 'select', options: ['cun1', 'cun1_5', 'cun3'] },
  26. { prop: 'side', label: '侧别', type: 'select', options: ['center', 'both', 'left', 'right'] },
  27. { prop: 'lateralOffset', label: '横向偏移(寸)', type: 'input' },
  28. { prop: 'targetGender', label: '适用性别', type: 'select', options: ['all', 'male', 'female'] },
  29. { prop: 'status', label: '状态', type: 'select', options: ['active', 'pending'] },
  30. { prop: 'source', label: '来源', type: 'select', options: ['preset', 'expert'] },
  31. ],
  32. searchFields: [
  33. { prop: 'name', label: '穴位名称', type: 'input' },
  34. { prop: 'meridian', label: '所属经络', type: 'select', options: ['', '督脉', '足太阳膀胱经', '手太阳小肠经'] },
  35. { prop: 'positioning', label: '定位方式', type: 'select', options: ['', 'relative', 'absolute'] },
  36. { prop: 'status', label: '状态', type: 'select', options: ['', 'active', 'pending'] },
  37. ],
  38. },
  39. 'moxa-techniques': {
  40. title: '艾灸手法',
  41. apiPath: '/moxa-techniques',
  42. searchApiPath: '/moxa-techniques/search',
  43. columns: [
  44. { prop: 'id', label: 'ID', width: 80 },
  45. { prop: 'code', label: '编码', minWidth: 100 },
  46. { prop: 'name', label: '名称', minWidth: 120 },
  47. { prop: 'movementPattern', label: '运动模式', minWidth: 120 },
  48. { prop: 'tempMin', label: '最低温度', width: 100 },
  49. { prop: 'tempMax', label: '最高温度', width: 100 },
  50. { prop: 'status', label: '状态', width: 80 },
  51. ],
  52. formFields: [
  53. { prop: 'code', label: '编码', type: 'input', required: true },
  54. { prop: 'name', label: '名称', type: 'input', required: true },
  55. { prop: 'isDefault', label: '默认手法', type: 'select', options: [{ label: '否', value: 0 }, { label: '是', value: 1 }] },
  56. { prop: 'description', label: '描述', type: 'textarea' },
  57. { prop: 'movementPattern', label: '运动模式', type: 'select', options: ['fixed', 'vertical', 'circular', 'point', 'oneclick'], required: true },
  58. { prop: 'tempMin', label: '最低温度(°C)', type: 'input' },
  59. { prop: 'tempMax', label: '最高温度(°C)', type: 'input' },
  60. { prop: 'durationMin', label: '最短时间(秒)', type: 'number' },
  61. { prop: 'durationMax', label: '最长时间(秒)', type: 'number' },
  62. { prop: 'movementAmplitude', label: '运动幅度(mm)', type: 'input' },
  63. { prop: 'movementSpeed', label: '运动速度(mm/s)', type: 'input' },
  64. { prop: 'status', label: '状态', type: 'select', options: ['active', 'disabled'] },
  65. { prop: 'remark', label: '备注', type: 'textarea' },
  66. ],
  67. searchFields: [
  68. { prop: 'name', label: '名称', type: 'input' },
  69. { prop: 'movementPattern', label: '运动模式', type: 'select', options: ['', 'fixed', 'vertical', 'circular', 'point', 'oneclick'] },
  70. { prop: 'status', label: '状态', type: 'select', options: ['', 'active', 'disabled'] },
  71. ],
  72. },
  73. users: {
  74. title: '用户管理',
  75. apiPath: '/users',
  76. searchApiPath: '/users/search',
  77. exportApiPath: '/users/export',
  78. batchDeleteApiPath: '/users/batch-delete',
  79. columns: [
  80. { prop: 'id', label: 'ID', width: 80 },
  81. { prop: 'name', label: '姓名', minWidth: 100 },
  82. { prop: 'gender', label: '性别', width: 70 },
  83. { prop: 'age', label: '年龄', width: 70 },
  84. { prop: 'phone', label: '手机号', width: 130 },
  85. { prop: 'shoulderWidth', label: '肩宽(cm)', width: 90 },
  86. { prop: 'bodyLength', label: '身长(cm)', width: 90 },
  87. { prop: 'acupointTableStatus', label: '穴位表', minWidth: 100 },
  88. { prop: 'createTime', label: '注册时间', width: 170 },
  89. ],
  90. formFields: [
  91. { prop: 'name', label: '姓名', type: 'input', required: true },
  92. { prop: 'gender', label: '性别', type: 'select', options: ['male', 'female'], required: true },
  93. { prop: 'age', label: '年龄', type: 'number', required: true },
  94. { prop: 'phone', label: '手机号', type: 'input', required: true },
  95. { prop: 'shoulderWidth', label: '肩宽(cm)', type: 'input', required: true },
  96. { prop: 'bodyLength', label: '身长(cm)', type: 'input', required: true },
  97. { prop: 'fingerCun1', label: '一寸(cm)', type: 'input' },
  98. { prop: 'fingerCun1_5', label: '1.5寸(cm)', type: 'input' },
  99. { prop: 'fingerCun3', label: '三寸(cm)', type: 'input' },
  100. ],
  101. searchFields: [
  102. { prop: 'keyword', label: '姓名/手机号', type: 'input' },
  103. { prop: 'gender', label: '性别', type: 'select', options: ['', 'male', 'female'] },
  104. { prop: 'acupointTableStatus', label: '穴位表状态', type: 'select', options: ['', 'GENERATED', 'NOT_GENERATED'] },
  105. { prop: 'deviceCode', label: '设备编号', type: 'input' },
  106. ],
  107. extraActions: ['generateAcupoint', 'manageDevices'],
  108. },
  109. devices: {
  110. title: '设备管理',
  111. apiPath: '/devices',
  112. searchApiPath: '/devices/search',
  113. exportApiPath: '/devices/export',
  114. batchDeleteApiPath: '/devices/batch-delete',
  115. columns: [
  116. { prop: 'id', label: 'ID', width: 80 },
  117. { prop: 'deviceCode', label: '设备编号', minWidth: 120 },
  118. { prop: 'deviceName', label: '设备名称', minWidth: 140 },
  119. { prop: 'model', label: '型号', width: 100 },
  120. { prop: 'serialNumber', label: '序列号', minWidth: 140 },
  121. { prop: 'firmwareVersion', label: '固件版本', width: 100 },
  122. { prop: 'status', label: '状态', width: 80 },
  123. ],
  124. formFields: [
  125. { prop: 'deviceCode', label: '设备编号', type: 'input', required: true },
  126. { prop: 'deviceName', label: '设备名称', type: 'input', required: true },
  127. { prop: 'model', label: '设备型号', type: 'select', options: ['AJY-2026', 'AJY-2025'], required: true },
  128. { prop: 'serialNumber', label: '序列号', type: 'input', required: true },
  129. { prop: 'firmwareVersion', label: '固件版本', type: 'input' },
  130. { prop: 'status', label: '状态', type: 'select', options: ['online', 'offline'] },
  131. { prop: 'remark', label: '备注', type: 'textarea' },
  132. ],
  133. searchFields: [
  134. { prop: 'deviceCode', label: '设备编号', type: 'input' },
  135. { prop: 'deviceName', label: '设备名称', type: 'input' },
  136. { prop: 'status', label: '在线状态', type: 'select', options: ['', 'online', 'offline'] },
  137. { prop: 'userName', label: '绑定用户', type: 'input' },
  138. ],
  139. extraActions: ['manageUsers'],
  140. },
  141. schemes: {
  142. title: '方案管理',
  143. apiPath: '/schemes',
  144. searchApiPath: '/schemes/search',
  145. batchDeleteApiPath: '/schemes/batch-delete',
  146. columns: [
  147. { prop: 'id', label: 'ID', width: 80 },
  148. { prop: 'schemeName', label: '方案名称', minWidth: 140 },
  149. { prop: 'mode', label: '模式', width: 120 },
  150. { prop: 'efficacyType', label: '功效类型', width: 90 },
  151. { prop: 'creatorName', label: '创作人', width: 100 },
  152. { prop: 'status', label: '状态', width: 80 },
  153. { prop: 'createTime', label: '创建时间', width: 170 },
  154. ],
  155. formFields: [
  156. { prop: 'schemeName', label: '方案名称', type: 'input', required: true },
  157. { prop: 'mode', label: '模式', type: 'select', options: ['ONE_CLICK', 'PROFESSIONAL', 'CUSTOM', 'EXPERT'], required: true },
  158. { prop: 'efficacyType', label: '功效类型', type: 'select', options: ['', '驱寒', '祛湿', '祛风', '化瘀', '活血', '化痰', '养颜', '扶阳'] },
  159. { prop: 'creatorType', label: '创作人类型', type: 'select', options: ['admin', 'user', 'expert'], required: true },
  160. { prop: 'creatorName', label: '创作人名称', type: 'input' },
  161. { prop: 'symptoms', label: '适用症状(逗号分隔)', type: 'input' },
  162. { prop: 'targetGender', label: '适用性别', type: 'select', options: ['all', 'male', 'female'] },
  163. { prop: 'ageMin', label: '最小年龄', type: 'number' },
  164. { prop: 'ageMax', label: '最大年龄', type: 'number' },
  165. { prop: 'description', label: '方案描述', type: 'textarea' },
  166. { prop: 'status', label: '状态', type: 'select', options: ['draft', 'published', 'archived'] },
  167. ],
  168. searchFields: [
  169. { prop: 'schemeName', label: '方案名称', type: 'input' },
  170. { prop: 'mode', label: '模式', type: 'select', options: ['', 'ONE_CLICK', 'PROFESSIONAL', 'CUSTOM', 'EXPERT'] },
  171. { prop: 'efficacyType', label: '功效类型', type: 'select', options: ['', '驱寒', '祛湿', '祛风', '化瘀', '活血', '化痰', '养颜', '扶阳'] },
  172. { prop: 'status', label: '状态', type: 'select', options: ['', 'draft', 'published', 'archived'] },
  173. { prop: 'creatorName', label: '创作人', type: 'input' },
  174. ],
  175. extraActions: ['viewDetail', 'publish', 'archive'],
  176. },
  177. }
  178. export function getResourceConfig(key) {
  179. return RESOURCE_MAP[key]
  180. }