36 changed files with 825 additions and 194 deletions
@ -1,48 +1,24 @@ |
|||||
import { i18n } from '@/platform/plugin'; |
import { i18n } from '@/platform/plugin'; |
||||
|
|
||||
const yesNo = (includeEmpty: boolean = true) => { |
const yesNo = () => { |
||||
if (includeEmpty) { |
return [ |
||||
return [ |
{ value: true, label: i18n.global.t('yes') }, |
||||
{ value: null, label: '' }, |
{ value: false, label: i18n.global.t('no') }, |
||||
{ value: true, label: i18n.global.t('yes') }, |
]; |
||||
{ value: false, label: i18n.global.t('no') }, |
|
||||
]; |
|
||||
} else { |
|
||||
return [ |
|
||||
{ value: true, label: i18n.global.t('yes') }, |
|
||||
{ value: false, label: i18n.global.t('no') }, |
|
||||
]; |
|
||||
} |
|
||||
}; |
}; |
||||
|
|
||||
const trueFalse = (includeEmpty: boolean = true) => { |
const trueFalse = () => { |
||||
if (includeEmpty) { |
return [ |
||||
return [ |
{ value: true, label: i18n.global.t('true') }, |
||||
{ value: null, label: '' }, |
{ value: false, label: i18n.global.t('false') }, |
||||
{ value: true, label: i18n.global.t('true') }, |
]; |
||||
{ value: false, label: i18n.global.t('false') }, |
|
||||
]; |
|
||||
} else { |
|
||||
return [ |
|
||||
{ value: true, label: i18n.global.t('true') }, |
|
||||
{ value: false, label: i18n.global.t('false') }, |
|
||||
]; |
|
||||
} |
|
||||
}; |
}; |
||||
|
|
||||
const successFailed = (includeEmpty: boolean = true) => { |
const successFailed = () => { |
||||
if (includeEmpty) { |
return [ |
||||
return [ |
{ value: 'success', label: i18n.global.t('success') }, |
||||
{ value: null, label: '' }, |
{ value: 'failed', label: i18n.global.t('failed') }, |
||||
{ value: 'success', label: i18n.global.t('success') }, |
]; |
||||
{ value: 'failed', label: i18n.global.t('failed') }, |
|
||||
]; |
|
||||
} else { |
|
||||
return [ |
|
||||
{ value: 'success', label: i18n.global.t('success') }, |
|
||||
{ value: 'failed', label: i18n.global.t('failed') }, |
|
||||
]; |
|
||||
} |
|
||||
}; |
}; |
||||
|
|
||||
export { yesNo, trueFalse, successFailed }; |
export { yesNo, trueFalse, successFailed }; |
||||
|
@ -0,0 +1,87 @@ |
|||||
|
<template> |
||||
|
<w-dialog |
||||
|
ref="dialogRef" |
||||
|
:title="$t('lcdp.bpm.jumpTask.dialog.title')" |
||||
|
width="400px" |
||||
|
height="250px" |
||||
|
:can-maximize="false" |
||||
|
:buttons="[ |
||||
|
{ |
||||
|
label: $t('submit'), |
||||
|
noCaps: true, |
||||
|
click: () => { |
||||
|
const data = formRef.getData(); |
||||
|
axios |
||||
|
.post(Environment.apiContextPath('/api/flowable/process/operation/jump'), { |
||||
|
taskId: data.taskId, |
||||
|
targetActivityId: data.targetActivityId, |
||||
|
targetAssignee: data.targetAssignee, |
||||
|
}) |
||||
|
.then(() => { |
||||
|
NotifyManager.success(); |
||||
|
close(); |
||||
|
}); |
||||
|
}, |
||||
|
}, |
||||
|
]" |
||||
|
> |
||||
|
<w-form |
||||
|
ref="formRef" |
||||
|
:cols-num="1" |
||||
|
:fields="[ |
||||
|
{ name: 'taskId', label: $t('lcdp.bpm.jumpTask.form.entity.taskId'), type: 'text', defaultValue: taskIdRef, hidden: true }, |
||||
|
{ |
||||
|
name: 'targetActivityId', |
||||
|
label: $t('lcdp.bpm.jumpTask.form.entity.targetActivityId'), |
||||
|
type: 'select', |
||||
|
required: true, |
||||
|
options: activityListRef, |
||||
|
'onUpdate:modelValue': (value) => { |
||||
|
axios.get(Environment.apiContextPath('/api/flowable/process/query/candidate?taskId=' + taskIdRef + '&activityId=' + value)).then((response) => { |
||||
|
candidateListRef.splice(0, candidateListRef.length); |
||||
|
for (const item of response.data) { |
||||
|
candidateListRef.push({ label: item.userName + '(' + item.loginName + ')', value: item.loginName }); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
}, |
||||
|
{ name: 'targetAssignee', label: $t('lcdp.bpm.jumpTask.form.entity.targetAssignee'), type: 'select', options: candidateListRef }, |
||||
|
]" |
||||
|
class="p-2" |
||||
|
></w-form> |
||||
|
</w-dialog> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import { ref } from 'vue'; |
||||
|
import { axios, Environment, NotifyManager, Tools } from 'platform-core'; |
||||
|
|
||||
|
const dialogRef = ref(); |
||||
|
const formRef = ref(); |
||||
|
const taskIdRef = ref(); |
||||
|
const activityListRef = ref(); |
||||
|
const candidateListRef = ref<any[]>([]); |
||||
|
|
||||
|
const open = (taskId: string) => { |
||||
|
if (taskId) { |
||||
|
taskIdRef.value = taskId; |
||||
|
axios.get(Environment.apiContextPath('/api/flowable/process/query/activity/' + taskId)).then((response) => { |
||||
|
const activityList: any[] = []; |
||||
|
for (const item of response.data) { |
||||
|
activityList.push({ label: item.name, value: item.id }); |
||||
|
} |
||||
|
activityListRef.value = activityList; |
||||
|
}); |
||||
|
} |
||||
|
dialogRef.value.show(); |
||||
|
}; |
||||
|
|
||||
|
const close = () => { |
||||
|
dialogRef.value.hide(); |
||||
|
}; |
||||
|
|
||||
|
defineExpose({ |
||||
|
open, |
||||
|
close, |
||||
|
}); |
||||
|
</script> |
@ -0,0 +1,98 @@ |
|||||
|
<template> |
||||
|
<w-dialog ref="dialogRef" :title="$t('lcdp.bpm.variables.grid.title')" width="1024px" height="750px" :can-maximize="false"> |
||||
|
<w-grid |
||||
|
ref="gridRef" |
||||
|
class="px-1" |
||||
|
:title="$t('lcdp.bpm.task.grid.title')" |
||||
|
:checkbox-selection="false" |
||||
|
:fetch-data-url="Environment.apiContextPath('/api/flowable/process/query/variable?procInstId=' + procInstIdRef)" |
||||
|
:pageable="true" |
||||
|
:pagination="{ sortBy: 'createTime', descending: true }" |
||||
|
:toolbar-actions="['refresh', 'separator', 'view', 'separator', 'export']" |
||||
|
:columns="[ |
||||
|
{ width: 200, name: 'name', label: $t('name') }, |
||||
|
{ width: 100, name: 'type', label: $t('type') }, |
||||
|
{ |
||||
|
width: 500, |
||||
|
name: 'value', |
||||
|
label: $t('value'), |
||||
|
format: (value, record) => { |
||||
|
if (record.type == 'boolean') { |
||||
|
if (record.longValue == 1) { |
||||
|
return 'true'; |
||||
|
} else { |
||||
|
return 'false'; |
||||
|
} |
||||
|
} else if (record.type == 'integer') { |
||||
|
return record.longValue; |
||||
|
} else if (record.type == 'double') { |
||||
|
return record.doubleValue; |
||||
|
} else if (record.type == 'string') { |
||||
|
return record.text; |
||||
|
} else { |
||||
|
return value; |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
{ width: 100, name: 'doubleValue', label: $t('lcdp.bpm.variables.grid.entity.doubleValue') }, |
||||
|
{ width: 100, name: 'longValue', label: $t('lcdp.bpm.variables.grid.entity.longValue') }, |
||||
|
{ width: 100, name: 'rev', label: $t('lcdp.bpm.variables.grid.entity.rev') }, |
||||
|
{ width: 100, name: 'executionId', label: $t('lcdp.bpm.variables.grid.entity.executionId') }, |
||||
|
{ width: 100, name: 'procInstId', label: $t('lcdp.bpm.variables.grid.entity.procInstId') }, |
||||
|
{ width: 100, name: 'taskId', label: $t('lcdp.bpm.variables.grid.entity.taskId') }, |
||||
|
{ width: 100, name: 'scopeId', label: $t('lcdp.bpm.variables.grid.entity.scopeId') }, |
||||
|
{ width: 100, name: 'subScopeId', label: $t('lcdp.bpm.variables.grid.entity.subScopeId') }, |
||||
|
{ width: 100, name: 'scopeType', label: $t('lcdp.bpm.variables.grid.entity.scopeType') }, |
||||
|
{ width: 100, name: 'byteArrayId', label: $t('lcdp.bpm.variables.grid.entity.byteArrayId') }, |
||||
|
{ width: 100, name: 'text', label: $t('lcdp.bpm.variables.grid.entity.text') }, |
||||
|
{ width: 100, name: 'text2', label: $t('lcdp.bpm.variables.grid.entity.text2') }, |
||||
|
]" |
||||
|
:viewer="{ |
||||
|
panel: { |
||||
|
columnNum: 1, |
||||
|
fields: [ |
||||
|
{ name: 'id', label: $t('id') }, |
||||
|
{ name: 'name', label: $t('name') }, |
||||
|
{ name: 'type', label: $t('type') }, |
||||
|
{ name: 'value', label: $t('value') }, |
||||
|
{ name: 'doubleValue', label: $t('lcdp.bpm.variables.grid.entity.doubleValue') }, |
||||
|
{ name: 'longValue', label: $t('lcdp.bpm.variables.grid.entity.longValue') }, |
||||
|
{ name: 'rev', label: $t('lcdp.bpm.variables.grid.entity.rev') }, |
||||
|
{ name: 'executionId', label: $t('lcdp.bpm.variables.grid.entity.executionId') }, |
||||
|
{ name: 'procInstId', label: $t('lcdp.bpm.variables.grid.entity.procInstId') }, |
||||
|
{ name: 'taskId', label: $t('lcdp.bpm.variables.grid.entity.taskId') }, |
||||
|
{ name: 'scopeId', label: $t('lcdp.bpm.variables.grid.entity.scopeId') }, |
||||
|
{ name: 'subScopeId', label: $t('lcdp.bpm.variables.grid.entity.subScopeId') }, |
||||
|
{ name: 'scopeType', label: $t('lcdp.bpm.variables.grid.entity.scopeType') }, |
||||
|
{ name: 'byteArrayId', label: $t('lcdp.bpm.variables.grid.entity.byteArrayId') }, |
||||
|
{ name: 'text', label: $t('lcdp.bpm.variables.grid.entity.text') }, |
||||
|
{ name: 'text2', label: $t('lcdp.bpm.variables.grid.entity.text2') }, |
||||
|
], |
||||
|
}, |
||||
|
}" |
||||
|
></w-grid> |
||||
|
</w-dialog> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import { ref } from 'vue'; |
||||
|
import { Environment } from 'platform-core'; |
||||
|
|
||||
|
const dialogRef = ref(); |
||||
|
const gridRef = ref(); |
||||
|
const procInstIdRef = ref(''); |
||||
|
|
||||
|
const open = (procInstId: string, name: string) => { |
||||
|
procInstIdRef.value = procInstId; |
||||
|
dialogRef.value.show(); |
||||
|
}; |
||||
|
|
||||
|
const close = () => { |
||||
|
dialogRef.value.hide(); |
||||
|
}; |
||||
|
|
||||
|
defineExpose({ |
||||
|
open, |
||||
|
close, |
||||
|
}); |
||||
|
</script> |
Loading…
Reference in new issue