| | |
| | | |
| | | function createDefaultModel(): Model { |
| | | return { |
| | | id: '', |
| | | instrumentCode: '', |
| | | instrumentName: '', |
| | | ifStd: '', |
| | | isc: null, |
| | | workShop: '', |
| | | enable: 1, |
| | | del: 0, |
| | | instrumentDes: '' |
| | | id: '', |
| | | instrumentCode: '', |
| | | instrumentName: '', |
| | | ifStd: '', |
| | | isc: null, |
| | | workShop: '', |
| | | enable: 1, |
| | | del: 0, |
| | | instrumentDes: '' |
| | | }; |
| | | } |
| | | |
| | |
| | | |
| | | // request |
| | | if (props.operateType === 'add') { |
| | | const { error } = await fetchCreateInstrument({ id, instrumentCode, instrumentName, ifStd, isc, workShop, enable, del, instrumentDes }); |
| | | const { error } = await fetchCreateInstrument({ |
| | | id, |
| | | instrumentCode, |
| | | instrumentName, |
| | | ifStd, |
| | | isc, |
| | | workShop, |
| | | enable, |
| | | del, |
| | | instrumentDes |
| | | }); |
| | | if (error) return; |
| | | } |
| | | |
| | | if (props.operateType === 'edit') { |
| | | const { error } = await fetchUpdateInstrument({ id, instrumentCode, instrumentName, ifStd, isc, workShop, enable, del, instrumentDes }); |
| | | const { error } = await fetchUpdateInstrument({ |
| | | id, |
| | | instrumentCode, |
| | | instrumentName, |
| | | ifStd, |
| | | isc, |
| | | workShop, |
| | | enable, |
| | | del, |
| | | instrumentDes |
| | | }); |
| | | if (error) return; |
| | | } |
| | | |