| | |
| | | const newValue = event.target.innerText; |
| | | const parts = newValue.split(':'); |
| | | const result = parts[1]; // 获取冒号后的部分 |
| | | |
| | | // 获取映射中所有的键 |
| | | const keys = Object.keys(propertyMapping); |
| | | |
| | | // 根据 index 获取对应的属性名 |
| | | const propertyName = keys[index]; |
| | | |
| | | // 如果映射中没有该 index,直接返回 |
| | | if (!propertyName) { |
| | | console.warn('Unsupported index:', index); |
| | |
| | | if (propertyName === 'glassNumber' && glassNumber === obj.glassNumber){ |
| | | obj.glassNumber = result; |
| | | } |
| | | if (propertyName === 'custom1' && orderId === obj.orderId){ |
| | | obj.custom1 = result; |
| | | } |
| | | if (propertyName === 'custom2' && orderId === obj.orderId){ |
| | | obj.custom2 = result; |
| | | } |
| | | if (propertyName === 'custom3' && orderId === obj.orderId){ |
| | | obj.custom3 = result; |
| | | } |
| | | if (propertyName === 'custom4' && orderId === obj.orderId){ |
| | | obj.custom4 = result; |
| | | } |
| | | if (propertyName === 'custom5' && orderId === obj.orderId){ |
| | | obj.custom5 = result; |
| | | } |
| | | }); |
| | | } |
| | | |