feat: update responsibleGroup type to string array and initialize in workflow steps
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 7s
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 7s
This commit is contained in:
parent
28395b4f80
commit
56a63185a1
5 changed files with 215 additions and 84 deletions
|
|
@ -60,6 +60,7 @@ async function addStep() {
|
|||
flowData.value.step.push({
|
||||
responsibleInstitution: [],
|
||||
responsiblePersonId: [],
|
||||
responsibleGroup: [],
|
||||
value: [],
|
||||
detail: '',
|
||||
name: '',
|
||||
|
|
@ -166,6 +167,7 @@ function triggerPropertiesDialog(step: WorkFlowPayloadStep) {
|
|||
id="flow-form-dialog"
|
||||
>
|
||||
<FormFlow
|
||||
v-model:user-in-table="userInTable"
|
||||
v-model:flow-data="flowData"
|
||||
v-model:register-branch-id="registerBranchId"
|
||||
@trigger-properties="triggerPropertiesDialog"
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ const columns = [
|
|||
function triggerDialog(type: 'add' | 'edit' | 'view') {
|
||||
if (type === 'add') {
|
||||
registeredBranchId.value = '';
|
||||
userInTable.value = [];
|
||||
formDataWorkflow.value = {
|
||||
status: 'CREATED',
|
||||
name: '',
|
||||
|
|
@ -207,7 +208,7 @@ async function submit() {
|
|||
...formDataWorkflow.value,
|
||||
});
|
||||
} else {
|
||||
await workflowStore.creatWorkflowTemplate({
|
||||
await workflowStore.createWorkflowTemplate({
|
||||
registeredBranchId: registeredBranchId.value,
|
||||
...formDataWorkflow.value,
|
||||
});
|
||||
|
|
@ -223,7 +224,11 @@ function assignFormData(workflowData: WorkflowTemplate) {
|
|||
status: workflowData.status,
|
||||
name: workflowData.name,
|
||||
step: workflowData.step.map((s, i) => {
|
||||
userInTable.value[i] = { name: s.name, responsiblePerson: [] };
|
||||
userInTable.value[i] = {
|
||||
name: s.name,
|
||||
responsiblePerson: [],
|
||||
responsibleGroup: [],
|
||||
};
|
||||
s.responsiblePerson.forEach((p) => {
|
||||
userInTable.value[i].responsiblePerson.push({
|
||||
id: p.user.id,
|
||||
|
|
@ -237,12 +242,16 @@ function assignFormData(workflowData: WorkflowTemplate) {
|
|||
code: p.user.code,
|
||||
});
|
||||
});
|
||||
s.responsibleGroup.forEach((g) => {
|
||||
userInTable.value[i].responsibleGroup.push(g);
|
||||
});
|
||||
return {
|
||||
id: s.id,
|
||||
name: s.name,
|
||||
detail: s.detail,
|
||||
messengerByArea: s.messengerByArea || false,
|
||||
value: s.value.length > 0 ? JSON.parse(JSON.stringify(s.value)) : [],
|
||||
responsibleGroup: s.responsibleGroup.map((g) => g),
|
||||
responsiblePersonId: s.responsiblePerson.map((p) => p.userId),
|
||||
responsibleInstitution: JSON.parse(
|
||||
JSON.stringify(s.responsibleInstitution),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue