|
|
@ -25,7 +25,7 @@ |
|
|
|
:wrapperClosable="false" |
|
|
|
:wrapperClosable="false" |
|
|
|
> |
|
|
|
> |
|
|
|
<!-- fix the bug that Element-ui(2.13.2) auto focus on the first input --> |
|
|
|
<!-- fix the bug that Element-ui(2.13.2) auto focus on the first input --> |
|
|
|
<div style="width:0px;height:0px;overflow:hidden;"> |
|
|
|
<div style="width: 0px; height: 0px; overflow: hidden"> |
|
|
|
<el-input type="text" /> |
|
|
|
<el-input type="text" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<m-form-model |
|
|
|
<m-form-model |
|
|
@ -69,6 +69,13 @@ |
|
|
|
@closeVersion="closeVersion" |
|
|
|
@closeVersion="closeVersion" |
|
|
|
></m-versions> |
|
|
|
></m-versions> |
|
|
|
</el-drawer> |
|
|
|
</el-drawer> |
|
|
|
|
|
|
|
<m-log |
|
|
|
|
|
|
|
v-if="type === 'instance' && logDialog" |
|
|
|
|
|
|
|
:item="logTaskInstance" |
|
|
|
|
|
|
|
source='dag' |
|
|
|
|
|
|
|
:task-instance-id="logTaskInstance.id" |
|
|
|
|
|
|
|
@close="closeLogDialog" |
|
|
|
|
|
|
|
></m-log> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
@ -82,6 +89,7 @@ |
|
|
|
import mStart from '../../projects/pages/definition/pages/list/_source/start.vue' |
|
|
|
import mStart from '../../projects/pages/definition/pages/list/_source/start.vue' |
|
|
|
import edgeEditModel from './canvas/edgeEditModel.vue' |
|
|
|
import edgeEditModel from './canvas/edgeEditModel.vue' |
|
|
|
import mVersions from '../../projects/pages/definition/pages/list/_source/versions.vue' |
|
|
|
import mVersions from '../../projects/pages/definition/pages/list/_source/versions.vue' |
|
|
|
|
|
|
|
import mLog from './formModel/log.vue' |
|
|
|
|
|
|
|
|
|
|
|
const DEFAULT_NODE_DATA = { |
|
|
|
const DEFAULT_NODE_DATA = { |
|
|
|
id: null, |
|
|
|
id: null, |
|
|
@ -99,7 +107,8 @@ |
|
|
|
mUdp, |
|
|
|
mUdp, |
|
|
|
mStart, |
|
|
|
mStart, |
|
|
|
edgeEditModel, |
|
|
|
edgeEditModel, |
|
|
|
mVersions |
|
|
|
mVersions, |
|
|
|
|
|
|
|
mLog |
|
|
|
}, |
|
|
|
}, |
|
|
|
provide () { |
|
|
|
provide () { |
|
|
|
return { |
|
|
|
return { |
|
|
@ -140,7 +149,11 @@ |
|
|
|
// the task status refresh timer |
|
|
|
// the task status refresh timer |
|
|
|
statusTimer: null, |
|
|
|
statusTimer: null, |
|
|
|
// the process instance id |
|
|
|
// the process instance id |
|
|
|
instanceId: -1 |
|
|
|
instanceId: -1, |
|
|
|
|
|
|
|
// log dialog |
|
|
|
|
|
|
|
logDialog: false, |
|
|
|
|
|
|
|
logTaskInstance: null, |
|
|
|
|
|
|
|
taskInstances: [] |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
mounted () { |
|
|
@ -294,61 +307,63 @@ |
|
|
|
tasks: tasks, |
|
|
|
tasks: tasks, |
|
|
|
locations: locations |
|
|
|
locations: locations |
|
|
|
}) |
|
|
|
}) |
|
|
|
}).then((res) => { |
|
|
|
}) |
|
|
|
if (this.verifyConditions(res.tasks)) { |
|
|
|
.then((res) => { |
|
|
|
this.loading(true) |
|
|
|
if (this.verifyConditions(res.tasks)) { |
|
|
|
const definitionCode = this.definitionCode |
|
|
|
this.loading(true) |
|
|
|
if (definitionCode) { |
|
|
|
const definitionCode = this.definitionCode |
|
|
|
// Edit |
|
|
|
if (definitionCode) { |
|
|
|
return this[ |
|
|
|
// Edit |
|
|
|
this.type === 'instance' ? 'updateInstance' : 'updateDefinition' |
|
|
|
return this[ |
|
|
|
](definitionCode) |
|
|
|
this.type === 'instance' ? 'updateInstance' : 'updateDefinition' |
|
|
|
.then((res) => { |
|
|
|
](definitionCode) |
|
|
|
this.$message({ |
|
|
|
.then((res) => { |
|
|
|
message: res.msg, |
|
|
|
this.$message({ |
|
|
|
type: 'success', |
|
|
|
message: res.msg, |
|
|
|
offset: 80 |
|
|
|
type: 'success', |
|
|
|
}) |
|
|
|
offset: 80 |
|
|
|
if (this.type === 'instance') { |
|
|
|
|
|
|
|
this.$router.push({ |
|
|
|
|
|
|
|
path: `/projects/${this.projectCode}/instance/list` |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.$router.push({ |
|
|
|
|
|
|
|
path: `/projects/${this.projectCode}/definition/list` |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
if (this.type === 'instance') { |
|
|
|
}) |
|
|
|
this.$router.push({ |
|
|
|
.catch((e) => { |
|
|
|
path: `/projects/${this.projectCode}/instance/list` |
|
|
|
this.$message.error(e.msg || '') |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
.finally((e) => { |
|
|
|
this.$router.push({ |
|
|
|
this.loading(false) |
|
|
|
path: `/projects/${this.projectCode}/definition/list` |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
} |
|
|
|
// Create |
|
|
|
}) |
|
|
|
return this.saveDAGchart() |
|
|
|
.catch((e) => { |
|
|
|
.then((res) => { |
|
|
|
this.$message.error(e.msg || '') |
|
|
|
this.$message.success(res.msg) |
|
|
|
}) |
|
|
|
// source @/conf/home/pages/dag/_source/editAffirmModel/index.js |
|
|
|
.finally((e) => { |
|
|
|
if (sourceType !== 'affirm') { |
|
|
|
this.loading(false) |
|
|
|
// Jump process definition |
|
|
|
}) |
|
|
|
this.$router.push({ name: 'projects-definition-list' }) |
|
|
|
} else { |
|
|
|
} |
|
|
|
// Create |
|
|
|
}) |
|
|
|
return this.saveDAGchart() |
|
|
|
.catch((e) => { |
|
|
|
.then((res) => { |
|
|
|
this.setName('') |
|
|
|
this.$message.success(res.msg) |
|
|
|
this.$message.error(e.msg || '') |
|
|
|
// source @/conf/home/pages/dag/_source/editAffirmModel/index.js |
|
|
|
}) |
|
|
|
if (sourceType !== 'affirm') { |
|
|
|
.finally((e) => { |
|
|
|
// Jump process definition |
|
|
|
this.loading(false) |
|
|
|
this.$router.push({ name: 'projects-definition-list' }) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.catch((e) => { |
|
|
|
|
|
|
|
this.setName('') |
|
|
|
|
|
|
|
this.$message.error(e.msg || '') |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.finally((e) => { |
|
|
|
|
|
|
|
this.loading(false) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch((err) => { |
|
|
|
.catch((err) => { |
|
|
|
let msg = typeof err === 'string' ? err : (err.msg || '') |
|
|
|
let msg = typeof err === 'string' ? err : err.msg || '' |
|
|
|
this.$message.error(msg) |
|
|
|
this.$message.error(msg) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
verifyConditions (value) { |
|
|
|
verifyConditions (value) { |
|
|
|
let tasks = value |
|
|
|
let tasks = value |
|
|
@ -432,31 +447,35 @@ |
|
|
|
tasksMap[task.code] = task |
|
|
|
tasksMap[task.code] = task |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const headEdges = tasks.filter(task => !preTaskMap[task.code]).map((task) => { |
|
|
|
const headEdges = tasks |
|
|
|
return { |
|
|
|
.filter((task) => !preTaskMap[task.code]) |
|
|
|
name: '', |
|
|
|
.map((task) => { |
|
|
|
preTaskCode: 0, |
|
|
|
return { |
|
|
|
preTaskVersion: 0, |
|
|
|
name: '', |
|
|
|
postTaskCode: task.code, |
|
|
|
preTaskCode: 0, |
|
|
|
postTaskVersion: task.version || 0, |
|
|
|
preTaskVersion: 0, |
|
|
|
// conditionType and conditionParams are reserved |
|
|
|
postTaskCode: task.code, |
|
|
|
conditionType: 0, |
|
|
|
postTaskVersion: task.version || 0, |
|
|
|
conditionParams: {} |
|
|
|
// conditionType and conditionParams are reserved |
|
|
|
} |
|
|
|
conditionType: 0, |
|
|
|
}) |
|
|
|
conditionParams: {} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
return edges.map(edge => { |
|
|
|
return edges |
|
|
|
return { |
|
|
|
.map((edge) => { |
|
|
|
name: edge.label, |
|
|
|
return { |
|
|
|
preTaskCode: edge.sourceId, |
|
|
|
name: edge.label, |
|
|
|
preTaskVersion: tasksMap[edge.sourceId].version || 0, |
|
|
|
preTaskCode: edge.sourceId, |
|
|
|
postTaskCode: edge.targetId, |
|
|
|
preTaskVersion: tasksMap[edge.sourceId].version || 0, |
|
|
|
postTaskVersion: tasksMap[edge.targetId].version || 0, |
|
|
|
postTaskCode: edge.targetId, |
|
|
|
// conditionType and conditionParams are reserved |
|
|
|
postTaskVersion: tasksMap[edge.targetId].version || 0, |
|
|
|
conditionType: 0, |
|
|
|
// conditionType and conditionParams are reserved |
|
|
|
conditionParams: {} |
|
|
|
conditionType: 0, |
|
|
|
} |
|
|
|
conditionParams: {} |
|
|
|
}).concat(headEdges) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.concat(headEdges) |
|
|
|
}, |
|
|
|
}, |
|
|
|
backfill () { |
|
|
|
backfill () { |
|
|
|
const tasks = this.tasks |
|
|
|
const tasks = this.tasks |
|
|
@ -479,8 +498,10 @@ |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
toSubProcess ({ subProcessCode, subInstanceId }) { |
|
|
|
toSubProcess ({ subProcessCode, subInstanceId }) { |
|
|
|
const tarIdentifier = this.type === 'instance' ? subInstanceId : subProcessCode |
|
|
|
const tarIdentifier = |
|
|
|
const curIdentifier = this.type === 'instance' ? this.instanceId : this.definitionCode |
|
|
|
this.type === 'instance' ? subInstanceId : subProcessCode |
|
|
|
|
|
|
|
const curIdentifier = |
|
|
|
|
|
|
|
this.type === 'instance' ? this.instanceId : this.definitionCode |
|
|
|
let subs = [] |
|
|
|
let subs = [] |
|
|
|
let olds = this.$route.query.subs |
|
|
|
let olds = this.$route.query.subs |
|
|
|
if (olds) { |
|
|
|
if (olds) { |
|
|
@ -532,6 +553,7 @@ |
|
|
|
this.$message(this.$t('Refresh status succeeded')) |
|
|
|
this.$message(this.$t('Refresh status succeeded')) |
|
|
|
const { taskList } = res.data |
|
|
|
const { taskList } = res.data |
|
|
|
if (taskList) { |
|
|
|
if (taskList) { |
|
|
|
|
|
|
|
this.taskInstances = taskList |
|
|
|
taskList.forEach((taskInstance) => { |
|
|
|
taskList.forEach((taskInstance) => { |
|
|
|
this.$refs.canvas.setNodeStatus({ |
|
|
|
this.$refs.canvas.setNodeStatus({ |
|
|
|
code: taskInstance.taskCode, |
|
|
|
code: taskInstance.taskCode, |
|
|
@ -598,42 +620,67 @@ |
|
|
|
this.switchProcessDefinitionVersion({ |
|
|
|
this.switchProcessDefinitionVersion({ |
|
|
|
version: version, |
|
|
|
version: version, |
|
|
|
code: processDefinitionCode |
|
|
|
code: processDefinitionCode |
|
|
|
}).then(res => { |
|
|
|
|
|
|
|
this.$message.success($t('Switch Version Successfully')) |
|
|
|
|
|
|
|
this.closeVersion() |
|
|
|
|
|
|
|
this.definitionDetails.init() |
|
|
|
|
|
|
|
}).catch(e => { |
|
|
|
|
|
|
|
this.$message.error(e.msg || '') |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
.then((res) => { |
|
|
|
|
|
|
|
this.$message.success($t('Switch Version Successfully')) |
|
|
|
|
|
|
|
this.closeVersion() |
|
|
|
|
|
|
|
this.definitionDetails.init() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.catch((e) => { |
|
|
|
|
|
|
|
this.$message.error(e.msg || '') |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
getProcessVersions ({ pageNo, pageSize, processDefinitionCode }) { |
|
|
|
getProcessVersions ({ pageNo, pageSize, processDefinitionCode }) { |
|
|
|
this.getProcessDefinitionVersionsPage({ |
|
|
|
this.getProcessDefinitionVersionsPage({ |
|
|
|
pageNo: pageNo, |
|
|
|
pageNo: pageNo, |
|
|
|
pageSize: pageSize, |
|
|
|
pageSize: pageSize, |
|
|
|
code: processDefinitionCode |
|
|
|
code: processDefinitionCode |
|
|
|
}).then(res => { |
|
|
|
|
|
|
|
this.versionData.processDefinitionVersions = res.data.totalList |
|
|
|
|
|
|
|
this.versionData.total = res.data.total |
|
|
|
|
|
|
|
this.versionData.pageSize = res.data.pageSize |
|
|
|
|
|
|
|
this.versionData.pageNo = res.data.currentPage |
|
|
|
|
|
|
|
}).catch(e => { |
|
|
|
|
|
|
|
this.$message.error(e.msg || '') |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
.then((res) => { |
|
|
|
|
|
|
|
this.versionData.processDefinitionVersions = res.data.totalList |
|
|
|
|
|
|
|
this.versionData.total = res.data.total |
|
|
|
|
|
|
|
this.versionData.pageSize = res.data.pageSize |
|
|
|
|
|
|
|
this.versionData.pageNo = res.data.currentPage |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.catch((e) => { |
|
|
|
|
|
|
|
this.$message.error(e.msg || '') |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
deleteProcessVersion ({ version, processDefinitionCode }) { |
|
|
|
deleteProcessVersion ({ version, processDefinitionCode }) { |
|
|
|
this.deleteProcessDefinitionVersion({ |
|
|
|
this.deleteProcessDefinitionVersion({ |
|
|
|
version: version, |
|
|
|
version: version, |
|
|
|
code: processDefinitionCode |
|
|
|
code: processDefinitionCode |
|
|
|
}).then(res => { |
|
|
|
}) |
|
|
|
this.$message.success(res.msg || '') |
|
|
|
.then((res) => { |
|
|
|
this.getProcessVersions({ |
|
|
|
this.$message.success(res.msg || '') |
|
|
|
pageNo: 1, |
|
|
|
this.getProcessVersions({ |
|
|
|
pageSize: 10, |
|
|
|
pageNo: 1, |
|
|
|
processDefinitionCode: processDefinitionCode |
|
|
|
pageSize: 10, |
|
|
|
|
|
|
|
processDefinitionCode: processDefinitionCode |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.catch((e) => { |
|
|
|
|
|
|
|
this.$message.error(e.msg || '') |
|
|
|
}) |
|
|
|
}) |
|
|
|
}).catch(e => { |
|
|
|
}, |
|
|
|
this.$message.error(e.msg || '') |
|
|
|
/** |
|
|
|
|
|
|
|
* Log dialog |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
closeLogDialog () { |
|
|
|
|
|
|
|
this.logDialog = false |
|
|
|
|
|
|
|
this.logTaskInstance = null |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
showLogDialog (taskDefinitionCode) { |
|
|
|
|
|
|
|
const taskInstance = this.taskInstances.find(taskInstance => { |
|
|
|
|
|
|
|
return taskInstance.taskCode === taskDefinitionCode |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
if (taskInstance) { |
|
|
|
|
|
|
|
this.logTaskInstance = { |
|
|
|
|
|
|
|
id: taskInstance.id, |
|
|
|
|
|
|
|
type: taskInstance.taskType |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.logDialog = true |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|