不好的示范
spxq (businessKey, originatorId, relationTaskId, processInstanceId) {
if (typeof businessKey === 'undefined') {
businessKey = ''
}
if (typeof originatorId === 'undefined') {
originatorId = ''
}
if (typeof relationTaskId === 'undefined') {
relationTaskId = ''
}
if (typeof processInstanceId === 'undefined') {
relationTaskId = ''
}
let openUrl = 'http://' + window.location.hostname + ':' + window.location.port + '/spxq.html?' +'businessKey=' + businessKey + '&originatorId=' + originatorId + '&relationTaskId=' +relationTaskId + '&processInstanceId=' + processInstanceId+
'&tag=' + this.tag + '&path=wysp'
window.open(openUrl, '_blank'
},
好的示范
不支持es6
spxq (businessKey, originatorId, relationTaskId, processInstanceId) {
let openUrl = 'http://' + window.location.hostname + ':' + window.location.port + '/spxq.html?'+
'businessKey=' + ((typeof businessKey) === 'undefined' ? '' : businessKey) + '&originatorId=' + ((typeof originatorId) === 'undefined' ? '' : originatorId) + '&relationTaskId='+
((typeof relationTaskId) === 'undefined' ? '' : relationTaskId) + '&processInstanceId=' + ((typeof processInstanceId) === 'undefined' ? '' : processInstanceId) + processInstanceId+
'&tag=' + ((typeof this.tag) === 'undefined' ? '' : this.tag) + '&path=wysp'
window.open(openUrl, '_blank')
},
支持es6
spxq (businessKey = '', originatorId = '', relationTaskId = '', processInstanceId = '') {
let openUrl = 'http://' + window.location.hostname + ':' + window.location.port + '/spxq.html?'+
'businessKey=' + businessKey + '&originatorId=' + originatorId + '&relationTaskId=' + relationTaskId + '&processInstanceId=' + processInstanceId + '&tag=' + ((typeof this.tag) === 'undefined' ? '' : this.tag) + '&path=wysp'
window.open(openUrl, '_blank')
},
网友评论