| | |
| | | } |
| | | return {}; |
| | | }, |
| | | normalizeVisualValue: function (value) { |
| | | if (value == null || value === '') { |
| | | return value; |
| | | } |
| | | if (Array.isArray(value) || Object.prototype.toString.call(value) === '[object Object]') { |
| | | try { |
| | | return JSON.stringify(value); |
| | | } catch (e) { |
| | | return String(value); |
| | | } |
| | | } |
| | | return value; |
| | | }, |
| | | transformData: function (protocol, type) { |
| | | if (!protocol) { |
| | | return {}; |
| | |
| | | targetStaNo: protocol.targetStaNo, |
| | | autoing: protocol.autoing, |
| | | loading: protocol.loading, |
| | | ioMode: protocol.ioMode, |
| | | inEnable: protocol.inEnable, |
| | | outEnable: protocol.outEnable, |
| | | emptyMk: protocol.emptyMk, |
| | | fullPlt: protocol.fullPlt, |
| | | runBlock: protocol.runBlock, |
| | | enableIn: protocol.enableIn, |
| | | inBarcodeError: protocol.inBarcodeError, |
| | | palletHeight: protocol.palletHeight, |
| | | barcode: protocol.barcode, |
| | | weight: protocol.weight, |
| | | taskWriteIdx: protocol.taskWriteIdx, |
| | | taskBufferItems: Array.isArray(protocol.taskBufferItems) ? protocol.taskBufferItems : [], |
| | | error: protocol.error, |
| | | errorMsg: protocol.errorMsg, |
| | | extend: protocol.extend |
| | | systemWarning: this.normalizeVisualValue(protocol.systemWarning), |
| | | extend: this.normalizeVisualValue(protocol.extend) |
| | | }; |
| | | } |
| | | return protocol; |