| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- // 通用的一些 数据 和类型
- import { FileListType } from '@/components/Z3upFiles/data'
- import { getDictFu, selectObj } from '@/utils/dataChange'
- // 列表字段
- export const baseFormData = (can?: { [x: string]: string }) => {
- const obj: any = {
- pageSize: 10,
- pageNum: 1,
- businessStartTime: '',
- businessEndTime: '',
- searchKey: '',
- startTime: '',
- endTime: '',
- status: ''
- }
- // 修改给后端的字段
- if (can) {
- for (const key in can) {
- if (obj[key] !== undefined) {
- obj[can[key]] = obj[key]
- delete obj[key]
- }
- }
- }
- return obj
- }
- // 顶部筛选
- export const topSearch = (txt: string, can?: { [x: number]: string | string[] }) => {
- // const txtObj = {
- // 征集: '或线索名称',
- // 登记: '、藏品编号或名称',
- // 入馆: '、藏品编号或名称'
- // }
- // const txt2Res = Reflect.get(txtObj, txt)
- const txt2Res = txt === '征集' ? '或线索名称' : '、藏品编号或名称'
- const canArr = [
- ['businessStartTime', 'businessEndTime'],
- 'searchKey',
- ['startTime', 'endTime'],
- 'status'
- ]
- // 修改给后端的字段
- if (can) {
- for (const key in can) {
- canArr[key] = can[key]
- }
- }
- return [
- {
- type: 'time',
- key: canArr[0],
- placeholder: [`${txt}日期开始`, `${txt}日期结束`]
- },
- {
- type: 'input',
- key: canArr[1],
- placeholder: `请输入申请编号、发起人${txt2Res}`
- },
- {
- type: 'time',
- key: canArr[2],
- placeholder: ['发起日期开始', '发起日期结束']
- },
- {
- type: 'select',
- key: canArr[3],
- placeholder: '申请状态',
- options: selectObj['订单审批状态'],
- style: { width: 200 }
- }
- ]
- }
- // 查看页面顶部字段 通用部分
- export const rowArrTemp = (txt: string, can?: { [x: number]: string }, txt2?: string) => {
- const canArr = ['date', 'num', 'dictIdApply', 'reason', 'remark']
- if (can) {
- for (const key in can) {
- canArr[key] = can[key]
- }
- }
- return [
- {
- name: `藏品${txt}`,
- type: 'txt'
- },
- {
- name: `${txt}日期`,
- must: true,
- key: canArr[0],
- type: 'DatePicker'
- },
- {
- name: '申请编号',
- must: true,
- key: canArr[1],
- type: 'Input',
- noNull: true //不允许输入空格
- },
- {
- name: '申请类型',
- key: canArr[2],
- type: 'Cascader',
- options: getDictFu(txt2 ? txt2 : `藏品${txt}`)
- },
- {
- name: '事由说明',
- full: true,
- key: canArr[3],
- type: 'TextArea'
- },
- {
- name: '备注',
- full: true,
- key: canArr[4],
- type: 'TextArea'
- }
- ]
- }
- export type TypetableAuditList = {
- auditTime?: any
- auditorId?: any
- auditorName?: any
- createTime: string
- creatorId: number
- creatorName: string
- flowId: number
- handler?: any
- id: number
- isAuto: number
- isUse: number
- moduleIds?: any
- name: string
- orderId: number
- processId: number
- rtfOpinion?: any
- sort: number
- status: number
- type?: any
- updateTime: string
- }
- // 列表type
- export type Typetable = {
- auditUserIds: string
- audits: TypetableAuditList[]
- createTime: string
- creatorId: number
- creatorName: string
- currentAuditUserIds: string
- currentProcessId: number
- date: string
- dictIdApply?: any
- fileIds?: any
- files: FileListType[]
- files2: FileListType[]
- goodIds: string
- id: number
- nodeProcessId: number
- num: string
- reason: string
- remark: string
- snapName?: any
- snapNum?: any
- snaps: any[]
- status: number
- type: string
- updateTime: string
- deptName: string
- // 藏品鉴定
- member: string
- // 库房列表
- name: string
- }
- // 上传的附近路径和文件夹名字
- export type FileUpInfoType = {
- myUrl: string
- dirCode: string
- }
|