|
|
@ -326,45 +326,62 @@ |
|
|
|
* Storage interface |
|
|
|
* Storage interface |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
_save (sourceType) { |
|
|
|
_save (sourceType) { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
if(this._verifConditions()) { |
|
|
|
this.spinnerLoading = true |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
// Storage store |
|
|
|
this.spinnerLoading = true |
|
|
|
Dag.saveStore().then(res => { |
|
|
|
// Storage store |
|
|
|
if (this.urlParam.id) { |
|
|
|
Dag.saveStore().then(res => { |
|
|
|
/** |
|
|
|
if (this.urlParam.id) { |
|
|
|
* Edit |
|
|
|
/** |
|
|
|
* @param saveInstanceEditDAGChart => Process instance editing |
|
|
|
* Edit |
|
|
|
* @param saveEditDAGChart => Process definition editing |
|
|
|
* @param saveInstanceEditDAGChart => Process instance editing |
|
|
|
*/ |
|
|
|
* @param saveEditDAGChart => Process definition editing |
|
|
|
this[this.type === 'instance' ? 'updateInstance' : 'updateDefinition'](this.urlParam.id).then(res => { |
|
|
|
*/ |
|
|
|
this.$message.success(res.msg) |
|
|
|
this[this.type === 'instance' ? 'updateInstance' : 'updateDefinition'](this.urlParam.id).then(res => { |
|
|
|
this.spinnerLoading = false |
|
|
|
this.$message.success(res.msg) |
|
|
|
resolve() |
|
|
|
this.spinnerLoading = false |
|
|
|
}).catch(e => { |
|
|
|
resolve() |
|
|
|
this.$message.error(e.msg || '') |
|
|
|
}).catch(e => { |
|
|
|
this.spinnerLoading = false |
|
|
|
this.$message.error(e.msg || '') |
|
|
|
reject(e) |
|
|
|
this.spinnerLoading = false |
|
|
|
}) |
|
|
|
reject(e) |
|
|
|
} else { |
|
|
|
}) |
|
|
|
// New |
|
|
|
} else { |
|
|
|
this.saveDAGchart().then(res => { |
|
|
|
// New |
|
|
|
this.$message.success(res.msg) |
|
|
|
this.saveDAGchart().then(res => { |
|
|
|
this.spinnerLoading = false |
|
|
|
this.$message.success(res.msg) |
|
|
|
// source @/conf/home/pages/dag/_source/editAffirmModel/index.js |
|
|
|
this.spinnerLoading = false |
|
|
|
if (sourceType !== 'affirm') { |
|
|
|
// source @/conf/home/pages/dag/_source/editAffirmModel/index.js |
|
|
|
// Jump process definition |
|
|
|
if (sourceType !== 'affirm') { |
|
|
|
this.$router.push({ name: 'projects-definition-list' }) |
|
|
|
// Jump process definition |
|
|
|
} |
|
|
|
this.$router.push({ name: 'projects-definition-list' }) |
|
|
|
resolve() |
|
|
|
} |
|
|
|
}).catch(e => { |
|
|
|
resolve() |
|
|
|
this.$message.error(e.msg || '') |
|
|
|
}).catch(e => { |
|
|
|
this.setName('') |
|
|
|
this.$message.error(e.msg || '') |
|
|
|
this.spinnerLoading = false |
|
|
|
this.setName('') |
|
|
|
reject(e) |
|
|
|
this.spinnerLoading = false |
|
|
|
}) |
|
|
|
reject(e) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
_verifConditions () { |
|
|
|
|
|
|
|
let tasks = this.$store.state.dag.tasks |
|
|
|
|
|
|
|
let bool = true |
|
|
|
|
|
|
|
tasks.map(v=>{ |
|
|
|
|
|
|
|
if(v.type == 'CONDITIONS' && (v.conditionResult.successNode[0] =='' || v.conditionResult.successNode[0] == null || v.conditionResult.failedNode[0] =='' || v.conditionResult.failedNode[0] == null)) { |
|
|
|
|
|
|
|
bool = false |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
if(!bool) { |
|
|
|
|
|
|
|
this.$message.warning(`${i18n.$t('Successful branch flow and failed branch flow are required')}`) |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return true |
|
|
|
}, |
|
|
|
}, |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Global parameter |
|
|
|
* Global parameter |
|
|
|