data.config.ts 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. import { BasicColumn, FormSchema } from '/@/components/Table';
  2. import { requestMagicApi } from '/@/api/magicApi';
  3. import { getDataOption } from '/@/api/system/dic';
  4. export const type = {
  5. 0: '菜单',
  6. 1: '目录',
  7. };
  8. export const TableColumns: BasicColumn[] = [
  9. {
  10. title: '学期',
  11. dataIndex: 'baseSemesterIdCn',
  12. },
  13. {
  14. title: '入库单号',
  15. dataIndex: 'orderNumber',
  16. },
  17. {
  18. title: '入库类型',
  19. dataIndex: 'warehouseModeCn',
  20. },
  21. {
  22. title: '书名',
  23. dataIndex: 'bookName',
  24. customRender: ({ text }) => {
  25. return text ? text : '/';
  26. },
  27. },
  28. {
  29. title: '书号(ISSN)',
  30. dataIndex: 'issn',
  31. customRender: ({ text }) => {
  32. return text ? text : '/';
  33. },
  34. },
  35. {
  36. title: '出版社',
  37. dataIndex: 'publishingHouse',
  38. customRender: ({ text }) => {
  39. return text ? text : '/';
  40. },
  41. },
  42. {
  43. title: '作者(主编)',
  44. dataIndex: 'editorInChief',
  45. customRender: ({ text }) => {
  46. return text ? text : '/';
  47. },
  48. },
  49. {
  50. title: '规划教材',
  51. dataIndex: 'isTextbookPlan',
  52. customRender: ({ text }) => {
  53. return text === 1 ? '是' : '否';
  54. },
  55. },
  56. {
  57. title: '教材分类',
  58. dataIndex: 'textbookTypeCn',
  59. },
  60. {
  61. title: '对应课程',
  62. dataIndex: 'courseName',
  63. customRender: ({ text }) => {
  64. return text ? text : '/';
  65. },
  66. },
  67. {
  68. title: '关联学科组',
  69. dataIndex: 'groupName',
  70. customRender: ({ text }) => {
  71. return text ? text : '/';
  72. },
  73. },
  74. {
  75. title: '使用时长',
  76. dataIndex: 'useType',
  77. customRender: ({ record }) => {
  78. return record.useType ? record.useType + '学期' : '';
  79. },
  80. },
  81. {
  82. title: '定价(元)',
  83. dataIndex: 'Price',
  84. },
  85. {
  86. title: '折扣',
  87. dataIndex: 'discount',
  88. },
  89. {
  90. title: '小计(元)',
  91. dataIndex: 'subtotal',
  92. },
  93. {
  94. title: '入库时间',
  95. dataIndex: 'createDateStr',
  96. },
  97. {
  98. title: '入库人员',
  99. dataIndex: 'warehouseUser',
  100. },
  101. {
  102. title: '入库数量',
  103. dataIndex: 'warehouseNumber',
  104. },
  105. {
  106. title: '退还书店数量',
  107. dataIndex: 'returnBookstoreNumber',
  108. },
  109. {
  110. title: '实际入库数量',
  111. dataIndex: 'actualWarehouseNumber',
  112. },
  113. {
  114. title: '实际入库金额(元)',
  115. dataIndex: 'actualTotalPrice',
  116. },
  117. {
  118. title: '已出库数量',
  119. dataIndex: 'issuedNumber',
  120. },
  121. {
  122. title: '退书数量',
  123. dataIndex: 'recedeNumber',
  124. },
  125. {
  126. title: '剩余库存数量',
  127. dataIndex: 'remainNumber',
  128. },
  129. ];
  130. export const Eumns = {
  131. name: '公文名称',
  132. remark: '发文说明',
  133. number: '发文字号',
  134. orgName: '发文部门',
  135. institution: '发文单位意见',
  136. backOpinion: '会办单位意见',
  137. dateOfIssue: '印发日期',
  138. urgency: '紧急程度',
  139. confidentialityPeriod: '保密期限',
  140. tags: '主题词',
  141. printNumber: '打印份数',
  142. };
  143. export const formSchema: FormSchema[] = [
  144. {
  145. field: 'id',
  146. component: 'Input',
  147. label: 'id',
  148. show: false,
  149. },
  150. {
  151. label: '学科组名',
  152. field: 'groupName',
  153. component: 'Input',
  154. required: true,
  155. colProps: { span: 24 },
  156. },
  157. {
  158. label: '组长名称',
  159. field: 'leaderUserId',
  160. component: 'ApiSelect',
  161. componentProps: {
  162. api: requestMagicApi,
  163. params: { url: '/educational/all-teacher' },
  164. valueField: 'teacherUserId',
  165. labelField: 'teacherUserName',
  166. showSearch: true,
  167. filterOption: (input, option) => {
  168. return (
  169. option?.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
  170. option?.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
  171. );
  172. },
  173. },
  174. required: true,
  175. colProps: { span: 24 },
  176. },
  177. {
  178. label: '学科组课程',
  179. field: 'subjectGroupCourseIds',
  180. component: 'ApiSelect',
  181. componentProps: {
  182. api: requestMagicApi,
  183. params: { url: '/educational/subject/option-unselected' },
  184. showSearch: true,
  185. mode: 'multiple',
  186. // 搜索参考
  187. filterOption: (input, option) => {
  188. return (
  189. option?.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
  190. option?.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
  191. );
  192. },
  193. },
  194. required: true,
  195. colProps: { span: 24 },
  196. },
  197. {
  198. label: '备注',
  199. field: 'remark',
  200. component: 'InputTextArea',
  201. colProps: { span: 24 },
  202. },
  203. ];
  204. export const searchFormSchema: FormSchema[] = [
  205. {
  206. label: '学期',
  207. field: 'baseSemesterId',
  208. component: 'ApiSelect',
  209. componentProps: {
  210. getPopupContainer: () => document.body,
  211. api: requestMagicApi,
  212. params: { url: 'baseData/semester/option' },
  213. },
  214. colProps: { span: 8 },
  215. },
  216. {
  217. label: '入库类型',
  218. field: 'warehouseMode',
  219. component: 'ApiSelect',
  220. colProps: { span: 8 },
  221. componentProps: {
  222. getPopupContainer: () => document.body,
  223. api: getDataOption,
  224. params: { code: 'warehouse_mode' },
  225. },
  226. },
  227. {
  228. label: '书名',
  229. field: 'bookName',
  230. component: 'Input',
  231. colProps: { span: 8 },
  232. },
  233. {
  234. label: '书号',
  235. field: 'issn',
  236. component: 'Input',
  237. colProps: { span: 8 },
  238. },
  239. {
  240. label: '单号',
  241. field: 'orderNumber',
  242. component: 'Input',
  243. colProps: { span: 8 },
  244. },
  245. {
  246. label: '教材类型',
  247. field: 'textbookType',
  248. component: 'ApiSelect',
  249. componentProps: {
  250. getPopupContainer: () => document.body,
  251. api: getDataOption,
  252. params: { code: 'textbook_type' },
  253. },
  254. colProps: { span: 8 },
  255. },
  256. // {
  257. // label: '学科组',
  258. // field: 'subjectGroupId',
  259. // component: 'ApiSelect',
  260. // componentProps: {
  261. // getPopupContainer: () => document.body,
  262. // api: requestMagicApi,
  263. // params: { url: '/educational/subjectGroup/list' },
  264. // },
  265. // colProps: { span: 8 },
  266. // },
  267. {
  268. label: '所属学科组',
  269. field: 'groupName',
  270. component: 'Input',
  271. colProps: { span: 8 },
  272. },
  273. {
  274. label: '使用时长',
  275. field: 'useType',
  276. component: 'Select',
  277. colProps: { span: 8 },
  278. componentProps: {
  279. getPopupContainer: () => document.body,
  280. options: [
  281. { label: '一学期', value: 1 },
  282. { label: '二学期', value: 2 },
  283. { label: '三学期', value: 3 },
  284. { label: '四学期', value: 4 },
  285. { label: '五学期', value: 5 },
  286. { label: '六学期', value: 6 },
  287. ],
  288. },
  289. },
  290. {
  291. label: '入库人员',
  292. field: 'warehouseUser',
  293. component: 'Input',
  294. colProps: { span: 8 },
  295. },
  296. {
  297. label: '入库时间',
  298. field: '[startCreateDate,endCreateDate]',
  299. component: 'RangePicker',
  300. colProps: { span: 8 },
  301. componentProps: {
  302. getPopupContainer: () => document.body,
  303. placeholder: ['开始时间', '结束时间'],
  304. format: 'YYYY-MM-DD HH:mm:ss',
  305. showTime: { format: 'HH:mm:ss' },
  306. },
  307. },
  308. {
  309. label: '退还书店',
  310. field: 'returnBookstore',
  311. component: 'Select',
  312. colProps: { span: 8 },
  313. componentProps: {
  314. getPopupContainer: () => document.body,
  315. options: [
  316. { label: '有退书', value: 1 },
  317. { label: '无退书', value: 0 },
  318. ],
  319. },
  320. },
  321. {
  322. label: '退还状态',
  323. field: 'returnState',
  324. component: 'Select',
  325. colProps: { span: 8 },
  326. componentProps: {
  327. getPopupContainer: () => document.body,
  328. options: [
  329. { label: '有退书', value: 1 },
  330. { label: '无退书', value: 0 },
  331. ],
  332. },
  333. },
  334. // {
  335. // field: 'majorSetId',
  336. // label: '专业方向',
  337. // component: 'ApiSelect',
  338. // componentProps: ({}) => {
  339. // return {
  340. // getPopupContainer: () => document.body,
  341. // api: getMajorSetOption,
  342. // };
  343. // },
  344. // colProps: { span: 6 },
  345. // },
  346. // {
  347. // label: '作者(主编)',
  348. // field: 'editorInChief',
  349. // component: 'Input',
  350. // colProps: { span: 6 },
  351. // },
  352. // {
  353. // label: '规划教材',
  354. // field: 'isTextbookPlan',
  355. // component: 'ApiSelect',
  356. // componentProps: {
  357. // getPopupContainer: () => document.body,
  358. // api: getDataOption,
  359. // params: { code: 'judgment_method_1' },
  360. // },
  361. // colProps: { span: 6 },
  362. // },
  363. // {
  364. // label: '对应课程',
  365. // field: 'courseSubjectId',
  366. // component: 'ApiSelect',
  367. // componentProps: ({ formModel }) => {
  368. // return {
  369. // getPopupContainer: () => document.body,
  370. // api: async () => {
  371. // if (!formModel.subjectGroupId) {
  372. // return [];
  373. // }
  374. // const data = await getSubjectGroupInfo({ id: formModel.subjectGroupId });
  375. // return data.subjectGroupCourseList.map((item) => {
  376. // return {
  377. // label: item.courseSubjectIdCN,
  378. // value: item.courseSubjectId,
  379. // };
  380. // });
  381. // },
  382. // showSearch: true,
  383. // // 搜索参考
  384. // filterOption: (input, option) => {
  385. // return (
  386. // option?.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
  387. // option?.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
  388. // );
  389. // },
  390. // };
  391. // },
  392. // colProps: { span: 6 },
  393. // },
  394. // {
  395. // label: '使用班级',
  396. // field: 'classId',
  397. // component: 'ApiSelect',
  398. // componentProps: ({ formModel }) => {
  399. // return {
  400. // getPopupContainer: () => document.body,
  401. // api: requestMagicApi,
  402. // params: { url: `educational/class/option` },
  403. // showSearch: true,
  404. // // mode: 'multiple',
  405. // // 搜索参考
  406. // filterOption: (input, option) => {
  407. // return (
  408. // option?.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
  409. // option?.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
  410. // );
  411. // },
  412. // };
  413. // },
  414. // colProps: { span: 6 },
  415. // },
  416. // {
  417. // label: '规格型号',
  418. // field: 'specificationsModels',
  419. // component: 'Input',
  420. // colProps: { span: 6 },
  421. // },
  422. // {
  423. // label: '使用年级',
  424. // field: 'gradeId',
  425. // component: 'ApiSelect',
  426. // componentProps: {
  427. // getPopupContainer: () => document.body,
  428. // api: requestMagicApi,
  429. // params: { url: '/baseData/grade/option' },
  430. // },
  431. // colProps: { span: 6 },
  432. // },
  433. ];