BaseShipArchive.data.ts 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. import { BasicColumn } from '/@/components/Table';
  2. import { FormSchema } from '/@/components/Table';
  3. import { defHttp } from '/@/utils/http/axios';
  4. //列表数据
  5. export const columns: BasicColumn[] = [
  6. {
  7. title: 'IMO',
  8. align: 'center',
  9. dataIndex: 'imo',
  10. },
  11. {
  12. title: '船名称(ship name)',
  13. align: 'center',
  14. dataIndex: 'shipName',
  15. },
  16. {
  17. title: 'hull number',
  18. align: 'center',
  19. dataIndex: 'hullNumber',
  20. },
  21. {
  22. title: '船类型(ship type)',
  23. align: 'center',
  24. dataIndex: 'shipType',
  25. },
  26. {
  27. title: '船厂(ship factory)',
  28. align: 'center',
  29. dataIndex: 'shipFactory',
  30. },
  31. {
  32. title: '造船日期(ship date)',
  33. align: 'center',
  34. dataIndex: 'shipDate',
  35. },
  36. {
  37. title: '关联客户(relate customer)',
  38. align: 'center',
  39. dataIndex: 'relateCustomer',
  40. },
  41. ];
  42. //查询数据
  43. export const searchFormSchema: FormSchema[] = [
  44. {
  45. label: 'IMO',
  46. field: 'imo',
  47. component: 'JInput',
  48. labelWidth: 180,
  49. // colProps: {span: 8},
  50. },
  51. {
  52. label: '船名称(ship name)',
  53. field: 'shipName',
  54. labelWidth: 150,
  55. component: 'JInput',
  56. // colProps: {span: 8},
  57. },
  58. {
  59. label: 'hull number',
  60. field: 'hullNumber',
  61. component: 'JInput',
  62. labelWidth: 150,
  63. //colProps: {span: 6},
  64. },
  65. {
  66. label: '船厂(ship factory)',
  67. field: 'shipFactory',
  68. component: 'JDictSelectTag',
  69. labelWidth: 180,
  70. componentProps: {
  71. dictCode: 'ship_factory',
  72. showSearch: true,
  73. },
  74. //colProps: {span: 6},
  75. },
  76. {
  77. label: '关联客户(relate customer)',
  78. field: 'relateCustomer',
  79. component: 'JSelect',
  80. componentProps: {
  81. getOptionUrl: () => defHttp.get({ url: '/cuspCode/cuspCustomerProfile/list?pageSize=-1'}),
  82. showField:"currency_dictText+name"
  83. },
  84. labelWidth: 180,
  85. colProps: {span: 12},
  86. },
  87. {
  88. label: '序列号(serial number)',
  89. field: 'serialNumber',
  90. component: 'JInput',
  91. labelWidth: 150,
  92. //colProps: {span: 6},
  93. },
  94. {
  95. label: '造船日期(ship date)',
  96. field: 'shipDate',
  97. component: 'RangePicker',
  98. labelWidth: 180,
  99. componentProps: {
  100. valueType: 'Date',
  101. showTime: false,
  102. },
  103. //colProps: {span: 6},
  104. },
  105. {
  106. label: '船类型(ship type)',
  107. field: 'shipType',
  108. component: 'JDictSelectTag',
  109. labelWidth: 180,
  110. componentProps: {
  111. dictCode: 'ship_type',
  112. showSearch: true,
  113. },
  114. //colProps: {span: 6},
  115. },
  116. {
  117. label: '状态(status)',
  118. field: 'status',
  119. component: 'JDictSelectTag',
  120. componentProps: {
  121. dictCode: 'valid_status',
  122. },
  123. //colProps: {span: 6},
  124. },
  125. ];
  126. //表单数据
  127. export const formSchema: FormSchema[] = [
  128. {
  129. label: 'IMO',
  130. field: 'imo',
  131. component: 'Input',
  132. componentProps: {
  133. AutoComplete: 'off',
  134. },
  135. // required: true,
  136. },
  137. {
  138. label: '船名称(ship name)',
  139. field: 'shipName',
  140. component: 'Input',
  141. required: true,
  142. componentProps: ({ formModel }) => {
  143. return {
  144. AutoComplete: 'off',
  145. onblur: ({ currentTarget }) => {
  146. const stringLog = currentTarget.value;
  147. let newString = '';
  148. for (let i = 0; i < stringLog.length; i++) {
  149. if (/^[A-Za-z]$/.test(stringLog[i]) && /^[a-z]$/.test(stringLog[i])) {
  150. newString = newString + stringLog[i].toUpperCase();
  151. } else {
  152. newString = newString + stringLog[i];
  153. }
  154. }
  155. formModel.shipName = newString;
  156. },
  157. };
  158. },
  159. },
  160. {
  161. label: 'hull number',
  162. field: 'hullNumber',
  163. component: 'Input',
  164. componentProps: {
  165. AutoComplete: 'off',
  166. },
  167. },
  168. {
  169. label: '船类型(ship type)',
  170. field: 'shipType',
  171. component: 'JDictSelectTag',
  172. componentProps: {
  173. dictCode: 'ship_type',
  174. showSearch: true,
  175. getPopupContainer: (node) => document.body,
  176. },
  177. },
  178. {
  179. label: '船厂(ship factory)',
  180. field: 'shipFactory',
  181. component: 'JDictSelectTag',
  182. componentProps: {
  183. dictCode: 'ship_factory',
  184. showSearch: true,
  185. getPopupContainer: (node) => document.body,
  186. },
  187. },
  188. {
  189. label: '造船日期(ship date)',
  190. field: 'shipDate',
  191. component: 'MonthPicker',
  192. componentProps: {
  193. showTime: false,
  194. valueFormat: 'YYYY-MM',
  195. getPopupContainer: (node) => document.body,
  196. },
  197. },
  198. {
  199. label: '状态(status)',
  200. field: 'status',
  201. component: 'JDictSelectTag',
  202. defaultValue: 1,
  203. componentProps: {
  204. dictCode: 'valid_status',
  205. stringToNumber: true,
  206. },
  207. },
  208. // TODO 主键隐藏字段,目前写死为ID
  209. {
  210. label: '',
  211. field: 'id',
  212. component: 'Input',
  213. show: false,
  214. },
  215. ];
  216. // 高级查询数据
  217. export const superQuerySchema = {
  218. status: { title: '状态(1-启用,0-停用)', order: 0, view: 'number', type: 'number', dictCode: '' },
  219. imo: { title: '唯一编号', order: 2, view: 'text', type: 'string' },
  220. shipName: { title: '船名称', order: 3, view: 'text', type: 'string' },
  221. hullNumber: { title: 'hull number', order: 4, view: 'text', type: 'string' },
  222. shipType: { title: '船类型', order: 5, view: 'list', type: 'string', dictCode: '' },
  223. shipFactory: { title: '船厂', order: 6, view: 'list', type: 'string', dictCode: '' },
  224. shipDate: { title: '造船日期', order: 7, view: 'datetime', type: 'string' },
  225. notes: { title: '备注', order: 8, view: 'text', type: 'string' },
  226. };
  227. /**
  228. * 流程表单调用这个方法获取formSchema
  229. * @param param
  230. */
  231. export function getBpmFormSchema(_formData): FormSchema[] {
  232. // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
  233. return formSchema;
  234. }