Browse Source

修改工作流按钮组件,支持附件一并提交。

main
likunming 2 months ago
parent
commit
b1b295def7
  1. 4
      io.sc.platform.core.frontend/src/platform/components/toolbar/Toolbar.ts
  2. 24
      io.sc.platform.core.frontend/src/platform/components/workflow/WWorkflowAction.vue

4
io.sc.platform.core.frontend/src/platform/components/toolbar/Toolbar.ts

@ -156,7 +156,7 @@ export class Toolbar {
if (Tools.isUndefinedOrNull(icon)) { if (Tools.isUndefinedOrNull(icon)) {
return undefined; return undefined;
} else if (typeof icon === 'function') { } else if (typeof icon === 'function') {
return icon(this.cm.args); return icon(this.cm.args.value);
} else { } else {
return icon; return icon;
} }
@ -171,7 +171,7 @@ export class Toolbar {
if (Tools.isUndefinedOrNull(label)) { if (Tools.isUndefinedOrNull(label)) {
return ''; return '';
} else if (typeof label === 'function') { } else if (typeof label === 'function') {
return label(this.cm.args); return label(this.cm.args.value);
} else { } else {
return label; return label;
} }

24
io.sc.platform.core.frontend/src/platform/components/workflow/WWorkflowAction.vue

@ -37,6 +37,15 @@ const props = defineProps({
isGobackActionDropdown: { type: Boolean, default: false }, isGobackActionDropdown: { type: Boolean, default: false },
// submit // submit
defaultSubmitButton: { type: Boolean, default: true }, defaultSubmitButton: { type: Boolean, default: true },
//
isContainsFile: { type: Boolean, default: false },
// FormDatagetData
formData: {
type: FormData,
default: () => {
return new FormData();
}
},
}); });
/** /**
@ -117,7 +126,7 @@ const buttonClick = (action) => {
if (value) { if (value) {
DialogManager.confirm(t('lcdp.bpm.completeTask.action.tip', { action: action.title }), () => { DialogManager.confirm(t('lcdp.bpm.completeTask.action.tip', { action: action.title }), () => {
currentActionRef.value = action; currentActionRef.value = action;
axios.post(props.actionUrl + '/' + props.taskId, getData(action)).then((response) => { axios.post(props.actionUrl + '/' + props.taskId, getSubmitData(action)).then((response) => {
if (response.data.code === 0) { if (response.data.code === 0) {
// //
emit('afterSubmit'); emit('afterSubmit');
@ -132,7 +141,7 @@ const buttonClick = (action) => {
}; };
const assigneeSelected = (assignee) => { const assigneeSelected = (assignee) => {
axios.post(props.actionUrl + '/' + props.taskId, getData(currentActionRef.value, assignee)).then((response) => { axios.post(props.actionUrl + '/' + props.taskId, getSubmitData(currentActionRef.value, assignee)).then((response) => {
const rawData = response.data; const rawData = response.data;
if (rawData.code === 0) { if (rawData.code === 0) {
// //
@ -141,6 +150,17 @@ const assigneeSelected = (assignee) => {
}); });
}; };
const getSubmitData = (action, assignee = undefined) => {
const data = getData(action, assignee);
if (props.isContainsFile) {
const formData = props.formData;
formData.append('data', JSON.stringify(data));
return formData;
} else {
return data;
}
};
const getData = (action, assignee) => { const getData = (action, assignee) => {
const data = { const data = {
variables: {}, variables: {},

Loading…
Cancel
Save