(field: IFieldMeta)
| 75 | } |
| 76 | |
| 77 | parseOneField(field: IFieldMeta) { |
| 78 | const itemValue = this.getItem(field.name) as any; |
| 79 | if (!itemValue) { |
| 80 | return null; |
| 81 | } |
| 82 | //文本 |
| 83 | if (field.type === 1) { |
| 84 | return this.exportText(itemValue); |
| 85 | } |
| 86 | //数字 |
| 87 | if ( |
| 88 | field.type === 2 || |
| 89 | field.type === 99004 || |
| 90 | field.type === 99003 || |
| 91 | field.type === 99002 || |
| 92 | field.type === 13 |
| 93 | ) { |
| 94 | return this.exportNumber(itemValue); |
| 95 | } |
| 96 | //单选 |
| 97 | if (field.type === 3) { |
| 98 | const labelId = this.findSelectLabelId(field, itemValue); |
| 99 | return this.exportSelect(itemValue, labelId); |
| 100 | } |
| 101 | // //多选 |
| 102 | if (field.type === 4) { |
| 103 | const labelMeta = itemValue.map((v: string) => { |
| 104 | const labelId = this.findSelectLabelId(field, v); |
| 105 | return [v, labelId]; |
| 106 | }); |
| 107 | return labelMeta.map((v: any) => this.exportSelect(v[0], v[1])); |
| 108 | } |
| 109 | // 复选框 |
| 110 | if (field.type === 7) { |
| 111 | return this.exportBoolean(itemValue); |
| 112 | } |
| 113 | // url |
| 114 | if (field.type === 15) { |
| 115 | return this.exportUrl(itemValue); |
| 116 | } |
| 117 | return null; |
| 118 | } |
| 119 | |
| 120 | get recordFormat() { |
| 121 | const fields = this.tableInfo.fields; |
no test coverage detected