data.ts 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. // 通用的一些 数据 和类型
  2. import { FileListType } from '@/components/Z3upFiles/data'
  3. import { getDictFu, selectObj } from '@/utils/dataChange'
  4. // 列表字段
  5. export const baseFormData = (can?: { [x: string]: string }) => {
  6. const obj: any = {
  7. pageSize: 10,
  8. pageNum: 1,
  9. businessStartTime: '',
  10. businessEndTime: '',
  11. searchKey: '',
  12. startTime: '',
  13. endTime: '',
  14. status: ''
  15. }
  16. // 修改给后端的字段
  17. if (can) {
  18. for (const key in can) {
  19. if (obj[key] !== undefined) {
  20. obj[can[key]] = obj[key]
  21. delete obj[key]
  22. }
  23. }
  24. }
  25. return obj
  26. }
  27. // 顶部筛选
  28. export const topSearch = (txt: string, can?: { [x: number]: string | string[] }) => {
  29. // const txtObj = {
  30. // 征集: '或线索名称',
  31. // 登记: '、藏品编号或名称',
  32. // 入馆: '、藏品编号或名称'
  33. // }
  34. // const txt2Res = Reflect.get(txtObj, txt)
  35. const txt2Res = txt === '征集' ? '或线索名称' : '、藏品编号或名称'
  36. const canArr = [
  37. ['businessStartTime', 'businessEndTime'],
  38. 'searchKey',
  39. ['startTime', 'endTime'],
  40. 'status'
  41. ]
  42. // 修改给后端的字段
  43. if (can) {
  44. for (const key in can) {
  45. canArr[key] = can[key]
  46. }
  47. }
  48. return [
  49. {
  50. type: 'time',
  51. key: canArr[0],
  52. placeholder: [`${txt}日期开始`, `${txt}日期结束`]
  53. },
  54. {
  55. type: 'input',
  56. key: canArr[1],
  57. placeholder: `请输入申请编号、发起人${txt2Res}`
  58. },
  59. {
  60. type: 'time',
  61. key: canArr[2],
  62. placeholder: ['发起日期开始', '发起日期结束']
  63. },
  64. {
  65. type: 'select',
  66. key: canArr[3],
  67. placeholder: '申请状态',
  68. options: selectObj['订单审批状态'],
  69. style: { width: 200 }
  70. }
  71. ]
  72. }
  73. // 查看页面顶部字段 通用部分
  74. export const rowArrTemp = (txt: string, can?: { [x: number]: string }, txt2?: string) => {
  75. const canArr = ['date', 'num', 'dictIdApply', 'reason', 'remark']
  76. if (can) {
  77. for (const key in can) {
  78. canArr[key] = can[key]
  79. }
  80. }
  81. return [
  82. {
  83. name: `藏品${txt}`,
  84. type: 'txt'
  85. },
  86. {
  87. name: `${txt}日期`,
  88. must: true,
  89. key: canArr[0],
  90. type: 'DatePicker'
  91. },
  92. {
  93. name: '申请编号',
  94. must: true,
  95. key: canArr[1],
  96. type: 'Input',
  97. noNull: true //不允许输入空格
  98. },
  99. {
  100. name: '申请类型',
  101. key: canArr[2],
  102. type: 'Cascader',
  103. options: getDictFu(txt2 ? txt2 : `藏品${txt}`)
  104. },
  105. {
  106. name: '事由说明',
  107. full: true,
  108. key: canArr[3],
  109. type: 'TextArea'
  110. },
  111. {
  112. name: '备注',
  113. full: true,
  114. key: canArr[4],
  115. type: 'TextArea'
  116. }
  117. ]
  118. }
  119. export type TypetableAuditList = {
  120. auditTime?: any
  121. auditorId?: any
  122. auditorName?: any
  123. createTime: string
  124. creatorId: number
  125. creatorName: string
  126. flowId: number
  127. handler?: any
  128. id: number
  129. isAuto: number
  130. isUse: number
  131. moduleIds?: any
  132. name: string
  133. orderId: number
  134. processId: number
  135. rtfOpinion?: any
  136. sort: number
  137. status: number
  138. type?: any
  139. updateTime: string
  140. }
  141. // 列表type
  142. export type Typetable = {
  143. auditUserIds: string
  144. audits: TypetableAuditList[]
  145. createTime: string
  146. creatorId: number
  147. creatorName: string
  148. currentAuditUserIds: string
  149. currentProcessId: number
  150. date: string
  151. dictIdApply?: any
  152. fileIds?: any
  153. files: FileListType[]
  154. files2: FileListType[]
  155. goodIds: string
  156. id: number
  157. nodeProcessId: number
  158. num: string
  159. reason: string
  160. remark: string
  161. snapName?: any
  162. snapNum?: any
  163. snaps: any[]
  164. status: number
  165. type: string
  166. updateTime: string
  167. deptName: string
  168. // 藏品鉴定
  169. member: string
  170. // 库房列表
  171. name: string
  172. }
  173. // 上传的附近路径和文件夹名字
  174. export type FileUpInfoType = {
  175. myUrl: string
  176. dirCode: string
  177. }