const actions = new Map([
[{code:'CE0001'},()=>{//to do something }],
[{code:'CE0002'},()=>{}],
[{code:'CE0003'},()=>{}],
[{code:'CE0004'},()=>{}],
[{code:'CE0005'},()=>{}],
[{code:'CE0006'},()=>{}],
...
])
let action = [...actions].filter(([key,value])=>(key.code == code))
action.forEach(([key,value])=>value.call(this))
网友评论