@steedos-labs/plugin-workflow 3.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +706 -0
- package/README.md +9 -0
- package/main/default/applications/admin.app.yml +32 -0
- package/main/default/applications/approve_workflow.app.yml +89 -0
- package/main/default/client/instance.client.js +145 -0
- package/main/default/client/instanceAmisView.client.js +257 -0
- package/main/default/client/instanceFile.client.js +169 -0
- package/main/default/client/object_workflows.client.js +7 -0
- package/main/default/client/socket.client.js +40 -0
- package/main/default/client/workflow.client.js +18 -0
- package/main/default/manager/approve_manager.js +36 -0
- package/main/default/manager/export.js +182 -0
- package/main/default/manager/flow_manager.js +46 -0
- package/main/default/manager/form_manager.js +47 -0
- package/main/default/manager/handlers_manager.js +796 -0
- package/main/default/manager/import.js +710 -0
- package/main/default/manager/index.js +23 -0
- package/main/default/manager/instance_manager.js +182 -0
- package/main/default/manager/instance_tasks_manager.js +285 -0
- package/main/default/manager/permission_manager.js +140 -0
- package/main/default/manager/push_manager.js +905 -0
- package/main/default/manager/step_manager.js +54 -0
- package/main/default/manager/uuflow_manager.js +4278 -0
- package/main/default/manager/workflow_manager.js +774 -0
- package/main/default/objectTranslations/flow_positions.en/flow_positions.en.objectTranslation.yml +19 -0
- package/main/default/objectTranslations/flow_positions.zh-CN/flow_positions.zh-CN.objectTranslation.yml +19 -0
- package/main/default/objectTranslations/flow_roles.en/flow_roles.en.objectTranslation.yml +11 -0
- package/main/default/objectTranslations/flow_roles.zh-CN/flow_roles.zh-CN.objectTranslation.yml +14 -0
- package/main/default/objectTranslations/flows.en/flows.en.objectTranslation.yml +317 -0
- package/main/default/objectTranslations/flows.zh-CN/flows.zh-CN.objectTranslation.yml +314 -0
- package/main/default/objects/approvals.object.yml +99 -0
- package/main/default/objects/categories.object.yml +52 -0
- package/main/default/objects/cfs.instances.filerecord.object.yml +16 -0
- package/main/default/objects/flow_positions.object.yml +79 -0
- package/main/default/objects/flow_roles.object.yml +63 -0
- package/main/default/objects/flows/buttons/del.button.yml +154 -0
- package/main/default/objects/flows/buttons/design_form_layout.button.js +35 -0
- package/main/default/objects/flows/buttons/design_form_layout.button.yml +4 -0
- package/main/default/objects/flows/buttons/distributeAdmin.button.yml +88 -0
- package/main/default/objects/flows/buttons/newexport.button.yml +45 -0
- package/main/default/objects/flows/buttons/newimport.button.yml +92 -0
- package/main/default/objects/flows/buttons/showDesign.button.js +33 -0
- package/main/default/objects/flows/buttons/showDesign.button.yml +6 -0
- package/main/default/objects/flows/flows.object.yml +941 -0
- package/main/default/objects/forms/fields/amis_schema.field.yml +7 -0
- package/main/default/objects/forms/forms.object.yml +266 -0
- package/main/default/objects/instance_number_rules.object.yml +85 -0
- package/main/default/objects/instance_tasks/buttons/instance_new.button.js +14 -0
- package/main/default/objects/instance_tasks/buttons/instance_new.button.yml +96 -0
- package/main/default/objects/instance_tasks/fields/applicant.field.yml +5 -0
- package/main/default/objects/instance_tasks/fields/applicant_name.field.yml +4 -0
- package/main/default/objects/instance_tasks/fields/applicant_organization_name.field.yml +4 -0
- package/main/default/objects/instance_tasks/fields/category.field.yml +5 -0
- package/main/default/objects/instance_tasks/fields/category_name.field.yml +4 -0
- package/main/default/objects/instance_tasks/fields/cost_time.field.yml +4 -0
- package/main/default/objects/instance_tasks/fields/deadline.field.yml +6 -0
- package/main/default/objects/instance_tasks/fields/description.field.yml +4 -0
- package/main/default/objects/instance_tasks/fields/distribute_from_instance.field.yml +5 -0
- package/main/default/objects/instance_tasks/fields/due_date.field.yml +4 -0
- package/main/default/objects/instance_tasks/fields/extras.field.yml +6 -0
- package/main/default/objects/instance_tasks/fields/finish_date.field.yml +5 -0
- package/main/default/objects/instance_tasks/fields/flow.field.yml +8 -0
- package/main/default/objects/instance_tasks/fields/flow_name.field.yml +4 -0
- package/main/default/objects/instance_tasks/fields/form.field.yml +5 -0
- package/main/default/objects/instance_tasks/fields/forward_from_instance.field.yml +5 -0
- package/main/default/objects/instance_tasks/fields/handler.field.yml +5 -0
- package/main/default/objects/instance_tasks/fields/handler_name.field.yml +4 -0
- package/main/default/objects/instance_tasks/fields/handler_organization.field.yml +5 -0
- package/main/default/objects/instance_tasks/fields/handler_organization_fullname.field.yml +4 -0
- package/main/default/objects/instance_tasks/fields/handler_organization_name.field.yml +4 -0
- package/main/default/objects/instance_tasks/fields/instance.field.yml +6 -0
- package/main/default/objects/instance_tasks/fields/instance_name.field.yml +13 -0
- package/main/default/objects/instance_tasks/fields/instance_state.field.yml +13 -0
- package/main/default/objects/instance_tasks/fields/is_archived.field.yml +4 -0
- package/main/default/objects/instance_tasks/fields/is_error.field.yml +4 -0
- package/main/default/objects/instance_tasks/fields/is_finished.field.yml +4 -0
- package/main/default/objects/instance_tasks/fields/is_latest_approve.field.yml +6 -0
- package/main/default/objects/instance_tasks/fields/is_read.field.yml +4 -0
- package/main/default/objects/instance_tasks/fields/keywords.field.yml +5 -0
- package/main/default/objects/instance_tasks/fields/next_steps.$.step.field.yml +4 -0
- package/main/default/objects/instance_tasks/fields/next_steps.$.users.field.yml +6 -0
- package/main/default/objects/instance_tasks/fields/next_steps.field.yml +4 -0
- package/main/default/objects/instance_tasks/fields/read_date.field.yml +4 -0
- package/main/default/objects/instance_tasks/fields/remind_date.field.yml +6 -0
- package/main/default/objects/instance_tasks/fields/reminded_count.field.yml +6 -0
- package/main/default/objects/instance_tasks/fields/sign_show.field.yml +4 -0
- package/main/default/objects/instance_tasks/fields/start_date.field.yml +5 -0
- package/main/default/objects/instance_tasks/fields/step.field.yml +4 -0
- package/main/default/objects/instance_tasks/fields/step_name.field.yml +4 -0
- package/main/default/objects/instance_tasks/fields/submit_date.field.yml +5 -0
- package/main/default/objects/instance_tasks/fields/submitter.field.yml +5 -0
- package/main/default/objects/instance_tasks/fields/submitter_name.field.yml +6 -0
- package/main/default/objects/instance_tasks/fields/trace.field.yml +6 -0
- package/main/default/objects/instance_tasks/fields/type.field.yml +2 -0
- package/main/default/objects/instance_tasks/fields/user.field.yml +5 -0
- package/main/default/objects/instance_tasks/fields/user_name.field.yml +4 -0
- package/main/default/objects/instance_tasks/fields/values.field.yml +5 -0
- package/main/default/objects/instance_tasks/instance_tasks.object.yml +7 -0
- package/main/default/objects/instance_tasks/listviews/inbox.listview.yml +41 -0
- package/main/default/objects/instance_tasks/listviews/outbox.listview.yml +38 -0
- package/main/default/objects/instance_tasks/permissions/admin.permission.yml +8 -0
- package/main/default/objects/instance_tasks/permissions/user.permission.yml +10 -0
- package/main/default/objects/instance_tasks/tabs/object_instance_tasks.tab.yml +7 -0
- package/main/default/objects/instance_tasks/tabs/object_instances.tab.yml +7 -0
- package/main/default/objects/instances/buttons/instance_cc.button.yml +160 -0
- package/main/default/objects/instances/buttons/instance_delete.button.yml +77 -0
- package/main/default/objects/instances/buttons/instance_delete_many.button.yml +124 -0
- package/main/default/objects/instances/buttons/instance_distribute.button.yml +310 -0
- package/main/default/objects/instances/buttons/instance_filter_flow.button.js +13 -0
- package/main/default/objects/instances/buttons/instance_filter_flow.button.yml +75 -0
- package/main/default/objects/instances/buttons/instance_flow_chart.button.yml +38 -0
- package/main/default/objects/instances/buttons/instance_forward.button.yml +163 -0
- package/main/default/objects/instances/buttons/instance_hide.button.yml +6 -0
- package/main/default/objects/instances/buttons/instance_new.button.js +16 -0
- package/main/default/objects/instances/buttons/instance_new.button.yml +108 -0
- package/main/default/objects/instances/buttons/instance_print.button.todo.yml +40 -0
- package/main/default/objects/instances/buttons/instance_query.button.js +17 -0
- package/main/default/objects/instances/buttons/instance_query.button.yml +186 -0
- package/main/default/objects/instances/buttons/instance_reassign.button.yml +123 -0
- package/main/default/objects/instances/buttons/instance_related.button.yml +166 -0
- package/main/default/objects/instances/buttons/instance_relocate.button.yml +127 -0
- package/main/default/objects/instances/buttons/instance_remind.button.yml +7 -0
- package/main/default/objects/instances/buttons/instance_reopen.button.yml +7 -0
- package/main/default/objects/instances/buttons/instance_retrieve.button.yml +7 -0
- package/main/default/objects/instances/buttons/instance_return.button.yml +121 -0
- package/main/default/objects/instances/buttons/instance_save.button.yml +78 -0
- package/main/default/objects/instances/buttons/instance_submit.button.yml +37 -0
- package/main/default/objects/instances/buttons/instance_terminate.button.yml +143 -0
- package/main/default/objects/instances/buttons/view_instance.button.yml +56 -0
- package/main/default/objects/instances/fields/keywords.field.yml +5 -0
- package/main/default/objects/instances/instances.object.yml +295 -0
- package/main/default/objects/instances/listviews/completed.listview.yml +38 -0
- package/main/default/objects/instances/listviews/draft.listview.yml +27 -0
- package/main/default/objects/instances/listviews/lookup.listview.yml +17 -0
- package/main/default/objects/instances/listviews/monitor.listview.yml +39 -0
- package/main/default/objects/instances/listviews/pending.listview.yml +38 -0
- package/main/default/objects/instances_statistic.object.yml +121 -0
- package/main/default/objects/object_workflows.action.js +28 -0
- package/main/default/objects/object_workflows.object.yml +263 -0
- package/main/default/objects/process_delegation_rules.object.yml +71 -0
- package/main/default/objects/space_user_signs.object.yml +61 -0
- package/main/default/objects/webhooks.object.yml +78 -0
- package/main/default/pages/flowdetail.page.amis.json +719 -0
- package/main/default/pages/flowdetail.page.yml +14 -0
- package/main/default/pages/flows_form.page.amis.json +25 -0
- package/main/default/pages/flows_form.page.yml +12 -0
- package/main/default/pages/instance_detail.page.amis.json +149 -0
- package/main/default/pages/instance_detail.page.yml +12 -0
- package/main/default/pages/instance_tasks_detail.page.amis.json +158 -0
- package/main/default/pages/instance_tasks_detail.page.yml +12 -0
- package/main/default/pages/instance_tasks_list.page.amis.json +280 -0
- package/main/default/pages/instance_tasks_list.page.yml +12 -0
- package/main/default/pages/instances_list.page.amis.json +278 -0
- package/main/default/pages/instances_list.page.yml +12 -0
- package/main/default/routes/am.router.js +1074 -0
- package/main/default/routes/amis_form_design.ejs +434 -0
- package/main/default/routes/amis_form_design.router.js +79 -0
- package/main/default/routes/api_cc.router.js +43 -0
- package/main/default/routes/api_cc_submit.router.js +59 -0
- package/main/default/routes/api_designer_startup.router.js +159 -0
- package/main/default/routes/api_flow_permission.router.js +29 -0
- package/main/default/routes/api_formula_organizations.router.js +72 -0
- package/main/default/routes/api_formula_users.router.js +73 -0
- package/main/default/routes/api_get_object_workflows.router.js +46 -0
- package/main/default/routes/api_object_workflow_drafts.router.js +48 -0
- package/main/default/routes/api_sub_table_sort.router.js +113 -0
- package/main/default/routes/api_workflow_approve_save.router.js +151 -0
- package/main/default/routes/api_workflow_archive.router.js +82 -0
- package/main/default/routes/api_workflow_box_filter.router.js +27 -0
- package/main/default/routes/api_workflow_draft.router.js +60 -0
- package/main/default/routes/api_workflow_drafts.router.js +72 -0
- package/main/default/routes/api_workflow_engine.router.js +104 -0
- package/main/default/routes/api_workflow_export.router.js +197 -0
- package/main/default/routes/api_workflow_forcesync.router.js +61 -0
- package/main/default/routes/api_workflow_forward.router.js +672 -0
- package/main/default/routes/api_workflow_forward_refill.router.js +127 -0
- package/main/default/routes/api_workflow_forward_table_refill.router.js +283 -0
- package/main/default/routes/api_workflow_instance.router.js +110 -0
- package/main/default/routes/api_workflow_instance_change_related.router.js +54 -0
- package/main/default/routes/api_workflow_instance_check_is_removed.router.js +58 -0
- package/main/default/routes/api_workflow_instance_forward.router.js +610 -0
- package/main/default/routes/api_workflow_instance_return.router.js +202 -0
- package/main/default/routes/api_workflow_instance_save.router.js +33 -0
- package/main/default/routes/api_workflow_instance_terminate.router.js +216 -0
- package/main/default/routes/api_workflow_nav.router.js +335 -0
- package/main/default/routes/api_workflow_next_step.router.js +218 -0
- package/main/default/routes/api_workflow_next_step_users.router.js +212 -0
- package/main/default/routes/api_workflow_open_cfs.router.js +352 -0
- package/main/default/routes/api_workflow_open_drafts.router.js +183 -0
- package/main/default/routes/api_workflow_open_get.router.js +123 -0
- package/main/default/routes/api_workflow_open_get_by_stepname.router.js +136 -0
- package/main/default/routes/api_workflow_open_pending.router.js +252 -0
- package/main/default/routes/api_workflow_open_save.router.js +112 -0
- package/main/default/routes/api_workflow_open_submit.router.js +147 -0
- package/main/default/routes/api_workflow_print.ejs +143 -0
- package/main/default/routes/api_workflow_print.router.js +42 -0
- package/main/default/routes/api_workflow_reassign.router.js +247 -0
- package/main/default/routes/api_workflow_redirect.router.js +39 -0
- package/main/default/routes/api_workflow_relocate.router.js +60 -0
- package/main/default/routes/api_workflow_remove.router.js +103 -0
- package/main/default/routes/api_workflow_retrieve.router.js +294 -0
- package/main/default/routes/api_workflow_space_changeset.router.js +72 -0
- package/main/default/routes/api_workflow_submit.router.js +91 -0
- package/main/default/routes/api_workflow_terminate.router.js +217 -0
- package/main/default/routes/api_workflow_v2_remove.router.js +83 -0
- package/main/default/routes/designer.router.js +201 -0
- package/main/default/routes/export.router.js +147 -0
- package/main/default/routes/export_table_template.router.js +125 -0
- package/main/default/routes/flow.settings.router.js +110 -0
- package/main/default/routes/flow_form_design.ejs +441 -0
- package/main/default/routes/flow_form_design.router.js +127 -0
- package/main/default/routes/getContactInfoForUser.router.js +59 -0
- package/main/default/routes/getFormulaUserObjects.router.js +63 -0
- package/main/default/routes/getNameForUser.router.js +57 -0
- package/main/default/routes/getSpaceUsers.router.js +64 -0
- package/main/default/routes/import.router.js +174 -0
- package/main/default/routes/init_formula_values.router.js +69 -0
- package/main/default/routes/nextStepUsers.router.js +220 -0
- package/main/default/routes/object_workflows.router.js +128 -0
- package/main/default/server/ejs/export_instances.ejs +424 -0
- package/main/default/services/flows.service.js +279 -0
- package/main/default/services/instance.service.js +319 -0
- package/main/default/tabs/admin_categories.tab.yml +21 -0
- package/main/default/tabs/admin_flow_positions.tab.yml +21 -0
- package/main/default/tabs/admin_flow_roles.tab.yml +21 -0
- package/main/default/tabs/admin_flows.tab.yml +21 -0
- package/main/default/tabs/admin_instance_number_rules.tab.yml +23 -0
- package/main/default/tabs/admin_instances_statistic.tab.yml +24 -0
- package/main/default/tabs/admin_process_delegation_rules.tab.yml +24 -0
- package/main/default/tabs/admin_roles.tab.yml +21 -0
- package/main/default/tabs/admin_space_user_signs.tab.yml +25 -0
- package/main/default/tabs/admin_webhooks.tab.yml +21 -0
- package/main/default/translations/en.translation.yml +2 -0
- package/main/default/translations/zh-CN.translation.yml +2 -0
- package/main/default/triggers/amis_form_design.trigger.js +538 -0
- package/main/default/triggers/flows.trigger.js +97 -0
- package/main/default/triggers/instance_tasks.trigger.js +37 -0
- package/main/default/triggers/instances.trigger.js +36 -0
- package/main/default/utils/collection.js +17 -0
- package/main/default/utils/convert.js +11 -0
- package/main/default/utils/designerManager.js +639 -0
- package/main/default/utils/trigger.js +63 -0
- package/main/default/utils/workingTime.js +125 -0
- package/main/default/uuflowManager/index.js +47 -0
- package/package.json +23 -0
- package/package.service.js +142 -0
- package/package.service.yml +6 -0
- package/public/applications/designer/5410/cloudkit/error_catcher/5410/en-us/javascript-strings.js +1 -0
- package/public/applications/designer/5410/cloudkit/error_catcher/5410/en-us/javascript.js +1 -0
- package/public/applications/designer/5410/cloudkit/error_catcher/5410/zh-cn/javascript-strings.js +1 -0
- package/public/applications/designer/5410/cloudkit/error_catcher/5410/zh-cn/javascript.js +1 -0
- package/public/applications/designer/5410/cloudkit/runtime/5410/en-us/resources/iCloud.cab +0 -0
- package/public/applications/designer/5410/cloudkit/runtime/5410/zh-cn/resources/iCloud.cab +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/load_views/images/attachment_delete.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/load_views/images/attachment_delete@2x.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/month_calendar/images/backgrounds/spinner30x360-12frames.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/month_calendar/images/blue-sky.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/month_calendar/images/bosque_wood.jpg +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/month_calendar/images/collection/spinner_normal_20px.gif +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/month_calendar/images/collection/spinner_normal_20px@2x.gif +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/month_calendar/images/collection/spinner_selected_20px.gif +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/month_calendar/images/collection/spinner_selected_20px@2x.gif +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/month_calendar/images/packed-1.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/month_calendar/images/packed-2.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/month_calendar/images/packed-3.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/month_calendar/images/packed-4.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/month_calendar/images/packed-5.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/month_calendar/images/packed-6.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/month_calendar/images/packed-7.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/month_calendar/images/packed-8.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/month_calendar/images/packed-9.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/month_calendar/images/spinner.gif +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/month_calendar/images/spinner30x360-12frames.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/month_calendar/images/spinner@2x.gif +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/month_calendar/stylesheet-1.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/notification_center/backGround.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/notification_center/email.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/notification_center/exit.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/notification_center/icon.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/notification_center/icon_enter.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/notification_center/list_line.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/notification_center/point.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/notification_center/top_title.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/searchbox/clear_search.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/searchbox/clear_search_active.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/searchbox/search_background.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/searchbox/search_background@2x.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/select_user/images/PersonalUserSelect.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/select_user/images/packed-8.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/select_user/images/search.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/select_user/images/tokenBlue.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/select_user/images/tokenBlue@2x.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/select_user/images/tokenBlueSelected.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/select_user/images/tokenBlueSelected@2x.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/select_user/images/tokenGreen.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/select_user/images/tokenGreen@2x.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/select_user/images/tokenGreenSelected.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/source/resources/select_user/images/tokenGreenSelected@2x.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/stylesheet-no-repeat.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/stylesheet-no-repeat@2x.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/stylesheet-repeat-x.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/stylesheet-repeat-x@2x.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/stylesheet.css +26 -0
- package/public/applications/designer/5410/coresteed/5410/en-us/stylesheet@2x.css +56 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/load_views/images/attachment_delete.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/load_views/images/attachment_delete@2x.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/month_calendar/images/backgrounds/spinner30x360-12frames.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/month_calendar/images/blue-sky.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/month_calendar/images/bosque_wood.jpg +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/month_calendar/images/collection/spinner_normal_20px.gif +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/month_calendar/images/collection/spinner_normal_20px@2x.gif +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/month_calendar/images/collection/spinner_selected_20px.gif +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/month_calendar/images/collection/spinner_selected_20px@2x.gif +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/month_calendar/images/packed-1.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/month_calendar/images/packed-2.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/month_calendar/images/packed-3.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/month_calendar/images/packed-4.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/month_calendar/images/packed-5.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/month_calendar/images/packed-6.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/month_calendar/images/packed-7.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/month_calendar/images/packed-8.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/month_calendar/images/packed-9.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/month_calendar/images/spinner.gif +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/month_calendar/images/spinner30x360-12frames.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/month_calendar/images/spinner@2x.gif +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/month_calendar/stylesheet-1.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/notification_center/backGround.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/notification_center/email.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/notification_center/exit.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/notification_center/icon.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/notification_center/icon_enter.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/notification_center/list_line.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/notification_center/point.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/notification_center/top_title.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/searchbox/clear_search.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/searchbox/clear_search_active.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/searchbox/search_background.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/searchbox/search_background@2x.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/select_user/images/PersonalUserSelect.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/select_user/images/packed-8.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/select_user/images/search.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/select_user/images/tokenBlue.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/select_user/images/tokenBlue@2x.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/select_user/images/tokenBlueSelected.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/select_user/images/tokenBlueSelected@2x.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/select_user/images/tokenGreen.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/select_user/images/tokenGreen@2x.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/select_user/images/tokenGreenSelected.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/source/resources/select_user/images/tokenGreenSelected@2x.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/stylesheet-no-repeat.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/stylesheet-no-repeat@2x.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/stylesheet-repeat-x.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/stylesheet-repeat-x@2x.png +0 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/stylesheet.css +26 -0
- package/public/applications/designer/5410/coresteed/5410/zh-cn/stylesheet@2x.css +56 -0
- package/public/applications/designer/5410/coreweb/date_formatter/5410/en-us/javascript-strings.js +1 -0
- package/public/applications/designer/5410/coreweb/date_formatter/5410/en-us/javascript.js +1 -0
- package/public/applications/designer/5410/coreweb/date_formatter/5410/zh-cn/javascript-strings.js +1 -0
- package/public/applications/designer/5410/coreweb/date_formatter/5410/zh-cn/javascript.js +1 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/resources/css3pie/PIE.htc +85 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/resources/fontawesome/fonts/FontAwesome.otf +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/resources/fontawesome/fonts/fontawesome-webfont.eot +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/resources/fontawesome/fonts/fontawesome-webfont.svg +565 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/resources/fontawesome/fonts/fontawesome-webfont.ttf +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/resources/fontawesome/fonts/fontawesome-webfont.woff +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/resources/fontawesome/fonts/fontawesome-webfont.woff2 +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/alert/me-icon-alert.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/alert/me-icon-alert@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/alert/me-icon-info.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/alert/me-icon-info@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/chat/bubble1.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/chat/bubble2.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/chat/bubbleOrangeReceived.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/chat/bubbleOrangeReceived@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/chat/bubbleOrangeSent.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/chat/bubbleOrangeSent@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/chat/bubbleWhite.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/chat/bubbleWhite@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/chat/bubbleWhiteSelected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/chat/bubbleWhiteSelected@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/chat/newBubbleBlue.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/chat/newBubbleBlue@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/chat/newBubbleBlueSelected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/chat/newBubbleBlueSelected@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/chat/newBubbleGreenSelected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/chat/newBubbleGreenSelected@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/chat/newGreenBubble.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/chat/newGreenBubble@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/disclosure/disclosure_closed.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/disclosure/disclosure_closed_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/disclosure/disclosure_open.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/disclosure/disclosure_open_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/images/ios8.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/images/ios8@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/images/packed-1.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/images/packed-1@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/images/packed-2.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/images/packed-2@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/images/packed-3.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/images/packed-3@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/images/packed-4.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/images/packed-4@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/ios/notification/images/ios_notification_spinner.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/ios/sectioned/UISectionedBackground.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/ios/sectioned/UISectionedBackground@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/list/sel.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/menu/checkmark.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/menu/checkmark_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/menu/down.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/menu/menu.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/menu/menu_item.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/menu/up.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/panel-pane/navigation_bar.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/panel-pane/navigation_bar@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/panel-pane/tab_bar.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/panel-pane/window.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/panel-pane/window@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/panel-pane/window_background.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/panel-pane/window_background@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/picker/panel.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/picker/pointers.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/picker/popover_empty.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/picker/popover_pointers_notoolbar.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/progress/progress_view_content.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/progress/progress_view_indeterminate_content.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/progress/progress_view_track.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/radio/radio_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/radio/radio_mixed.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/radio/radio_mixed_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/radio/radio_selected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/radio/radio_selected_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/radio/radio_unselected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/sectioned/sel.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/sectioned/sel@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/sectioned/sel_higher.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/sectioned/sel_higher@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/18px/segmented_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/18px/segmented_normal.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/18px/segmented_selected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/18px/segmented_selected_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/24px/segmented_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/24px/segmented_normal.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/24px/segmented_selected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/24px/segmented_selected_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/24px/segmented_vertical_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/24px/segmented_vertical_normal.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/24px/segmented_vertical_selected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/24px/segmented_vertical_selected_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/30px/segmented_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/30px/segmented_normal.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/30px/segmented_selected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/30px/segmented_selected_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/30px/segmented_vertical_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/30px/segmented_vertical_normal.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/30px/segmented_vertical_selected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/30px/segmented_vertical_selected_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/44px/segmented_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/44px/segmented_normal.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/44px/segmented_selected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/segmented/44px/segmented_selected_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/select/active_select.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/select/normal_select.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/select/select_after.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_16px_141414.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_16px_1f1f1f.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_16px_2f2f2f.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_16px_464646.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_16px_d6d6d7.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_16px_d6d6d7@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_16px_dark_linen.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_16px_dfe1e3.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_16px_dfe1e3@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_16px_ebebeb.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_16px_f3f5f5.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_16px_f3f5f5@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_16px_f8f8f8.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_16px_f8f8f8@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_16px_fafafa.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_16px_fafafa@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_16px_ffffff.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_16px_ffffff@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_16px_ffffff_50pct.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_16px_message_window.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_16px_message_window@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_16px_sidebar_sel.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_16px_white_linen.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_18px_d6d6d7.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_18px_e8ebf2.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_18px_e8ebf2@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_20px_d3d5dc.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_20px_d3d5dc@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_20px_d6d6d7.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_24px_141414.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_24px_1f1f1f.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_24px_2f2f2f.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_24px_30466a.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_24px_30466a@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_24px_464646.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_24px_d6d6d7.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_24px_dfe1e3.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_24px_e9ddc5.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_24px_f3f5f5.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_24px_f3f5f5@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_24px_f8f8f8.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_24px_fafafa.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_24px_fafafa@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_24px_ffffff.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_24px_ffffff_50pct.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_32px_141414.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_32px_1f1f1f.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_32px_2b3d5e.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_32px_2b3d5e@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_32px_2f2f2f.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_32px_464646.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_32px_d6d6d7.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_32px_d6d6d7@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_32px_dark_linen.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_32px_dfe1e3.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_32px_f3f5f5.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_32px_f3f5f5@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_32px_f8f8f8.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_32px_fafafa.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_32px_ffffff.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_32px_ffffff@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_32px_ffffff_50pct.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_32px_white_linen.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_42px_ffffff.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/spinners/images/spinner_42px_ffffff@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/token/tokenBlue.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/token/tokenBlue@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/token/tokenBlueSelected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/token/tokenBlueSelected@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/token/tokenGreen.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/token/tokenGreen@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/token/tokenGreenSelected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/token/tokenGreenSelected@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/window/navigation_bar.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/window/navigation_bar@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/window/tab_bar.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/window/window.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/window/window@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/window/window_background.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/source/resources/window/window_background@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/stylesheet-no-repeat.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/stylesheet-no-repeat@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/stylesheet-repeat-x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/stylesheet-repeat-x@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/stylesheet-repeat-y.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/stylesheet-repeat-y@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/stylesheet-resources/chat/bubble1.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/stylesheet-resources/chat/bubble1@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/stylesheet-resources/chat/bubble2.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/stylesheet-resources/chat/bubble2@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/stylesheet-resources/chat/bubbleWhite.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/stylesheet-resources/chat/bubbleWhite@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/stylesheet-resources/chat/newBubbleBlue.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/stylesheet-resources/chat/newBubbleBlue@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/stylesheet-resources/menu/menu.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/stylesheet-resources/menu/menu@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/stylesheet.css +262 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/en-us/stylesheet@2x.css +364 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/resources/css3pie/PIE.htc +85 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/resources/fontawesome/fonts/FontAwesome.otf +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/resources/fontawesome/fonts/fontawesome-webfont.eot +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/resources/fontawesome/fonts/fontawesome-webfont.svg +565 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/resources/fontawesome/fonts/fontawesome-webfont.ttf +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/resources/fontawesome/fonts/fontawesome-webfont.woff +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/resources/fontawesome/fonts/fontawesome-webfont.woff2 +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/alert/me-icon-alert.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/alert/me-icon-alert@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/alert/me-icon-info.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/alert/me-icon-info@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/chat/bubble1.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/chat/bubble2.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/chat/bubbleOrangeReceived.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/chat/bubbleOrangeReceived@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/chat/bubbleOrangeSent.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/chat/bubbleOrangeSent@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/chat/bubbleWhite.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/chat/bubbleWhite@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/chat/bubbleWhiteSelected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/chat/bubbleWhiteSelected@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/chat/newBubbleBlue.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/chat/newBubbleBlue@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/chat/newBubbleBlueSelected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/chat/newBubbleBlueSelected@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/chat/newBubbleGreenSelected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/chat/newBubbleGreenSelected@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/chat/newGreenBubble.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/chat/newGreenBubble@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/disclosure/disclosure_closed.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/disclosure/disclosure_closed_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/disclosure/disclosure_open.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/disclosure/disclosure_open_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/images/ios8.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/images/ios8@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/images/packed-1.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/images/packed-1@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/images/packed-2.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/images/packed-2@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/images/packed-3.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/images/packed-3@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/images/packed-4.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/images/packed-4@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/ios/notification/images/ios_notification_spinner.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/ios/sectioned/UISectionedBackground.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/ios/sectioned/UISectionedBackground@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/list/sel.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/menu/checkmark.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/menu/checkmark_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/menu/down.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/menu/menu.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/menu/menu_item.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/menu/up.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/panel-pane/navigation_bar.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/panel-pane/navigation_bar@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/panel-pane/tab_bar.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/panel-pane/window.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/panel-pane/window@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/panel-pane/window_background.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/panel-pane/window_background@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/picker/panel.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/picker/pointers.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/picker/popover_empty.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/picker/popover_pointers_notoolbar.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/progress/progress_view_content.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/progress/progress_view_indeterminate_content.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/progress/progress_view_track.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/radio/radio_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/radio/radio_mixed.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/radio/radio_mixed_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/radio/radio_selected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/radio/radio_selected_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/radio/radio_unselected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/sectioned/sel.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/sectioned/sel@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/sectioned/sel_higher.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/sectioned/sel_higher@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/18px/segmented_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/18px/segmented_normal.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/18px/segmented_selected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/18px/segmented_selected_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/24px/segmented_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/24px/segmented_normal.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/24px/segmented_selected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/24px/segmented_selected_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/24px/segmented_vertical_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/24px/segmented_vertical_normal.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/24px/segmented_vertical_selected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/24px/segmented_vertical_selected_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/30px/segmented_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/30px/segmented_normal.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/30px/segmented_selected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/30px/segmented_selected_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/30px/segmented_vertical_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/30px/segmented_vertical_normal.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/30px/segmented_vertical_selected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/30px/segmented_vertical_selected_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/44px/segmented_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/44px/segmented_normal.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/44px/segmented_selected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/segmented/44px/segmented_selected_active.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/select/active_select.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/select/normal_select.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/select/select_after.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_16px_141414.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_16px_1f1f1f.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_16px_2f2f2f.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_16px_464646.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_16px_d6d6d7.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_16px_d6d6d7@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_16px_dark_linen.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_16px_dfe1e3.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_16px_dfe1e3@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_16px_ebebeb.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_16px_f3f5f5.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_16px_f3f5f5@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_16px_f8f8f8.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_16px_f8f8f8@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_16px_fafafa.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_16px_fafafa@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_16px_ffffff.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_16px_ffffff@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_16px_ffffff_50pct.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_16px_message_window.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_16px_message_window@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_16px_sidebar_sel.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_16px_white_linen.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_18px_d6d6d7.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_18px_e8ebf2.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_18px_e8ebf2@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_20px_d3d5dc.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_20px_d3d5dc@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_20px_d6d6d7.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_24px_141414.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_24px_1f1f1f.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_24px_2f2f2f.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_24px_30466a.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_24px_30466a@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_24px_464646.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_24px_d6d6d7.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_24px_dfe1e3.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_24px_e9ddc5.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_24px_f3f5f5.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_24px_f3f5f5@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_24px_f8f8f8.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_24px_fafafa.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_24px_fafafa@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_24px_ffffff.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_24px_ffffff_50pct.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_32px_141414.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_32px_1f1f1f.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_32px_2b3d5e.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_32px_2b3d5e@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_32px_2f2f2f.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_32px_464646.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_32px_d6d6d7.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_32px_d6d6d7@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_32px_dark_linen.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_32px_dfe1e3.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_32px_f3f5f5.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_32px_f3f5f5@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_32px_f8f8f8.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_32px_fafafa.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_32px_ffffff.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_32px_ffffff@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_32px_ffffff_50pct.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_32px_white_linen.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_42px_ffffff.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/spinners/images/spinner_42px_ffffff@2x.gif +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/token/tokenBlue.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/token/tokenBlue@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/token/tokenBlueSelected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/token/tokenBlueSelected@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/token/tokenGreen.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/token/tokenGreen@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/token/tokenGreenSelected.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/token/tokenGreenSelected@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/window/navigation_bar.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/window/navigation_bar@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/window/tab_bar.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/window/window.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/window/window@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/window/window_background.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/source/resources/window/window_background@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/stylesheet-no-repeat.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/stylesheet-no-repeat@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/stylesheet-repeat-x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/stylesheet-repeat-x@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/stylesheet-repeat-y.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/stylesheet-repeat-y@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/stylesheet-resources/chat/bubble1.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/stylesheet-resources/chat/bubble1@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/stylesheet-resources/chat/bubble2.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/stylesheet-resources/chat/bubble2@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/stylesheet-resources/chat/bubbleWhite.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/stylesheet-resources/chat/bubbleWhite@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/stylesheet-resources/chat/newBubbleBlue.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/stylesheet-resources/chat/newBubbleBlue@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/stylesheet-resources/menu/menu.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/stylesheet-resources/menu/menu@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/stylesheet.css +262 -0
- package/public/applications/designer/5410/coreweb/steedos_theme_v3/5410/zh-cn/stylesheet@2x.css +364 -0
- package/public/applications/designer/5410/coreweb/views/5410/en-us/source/resources/images/loading.png +0 -0
- package/public/applications/designer/5410/coreweb/views/5410/en-us/source/resources/images/loading@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/views/5410/en-us/source/resources/images/spinner.png +0 -0
- package/public/applications/designer/5410/coreweb/views/5410/en-us/source/resources/images/spinner_white_32.png +0 -0
- package/public/applications/designer/5410/coreweb/views/5410/en-us/source/resources/images/spinning.png +0 -0
- package/public/applications/designer/5410/coreweb/views/5410/en-us/source/resources/images/spinning@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/views/5410/zh-cn/source/resources/images/loading.png +0 -0
- package/public/applications/designer/5410/coreweb/views/5410/zh-cn/source/resources/images/loading@2x.png +0 -0
- package/public/applications/designer/5410/coreweb/views/5410/zh-cn/source/resources/images/spinner.png +0 -0
- package/public/applications/designer/5410/coreweb/views/5410/zh-cn/source/resources/images/spinner_white_32.png +0 -0
- package/public/applications/designer/5410/coreweb/views/5410/zh-cn/source/resources/images/spinning.png +0 -0
- package/public/applications/designer/5410/coreweb/views/5410/zh-cn/source/resources/images/spinning@2x.png +0 -0
- package/public/applications/designer/5410/en-us/index.html +64 -0
- package/public/applications/designer/5410/en-us/javascript-packed.js +87 -0
- package/public/applications/designer/5410/en-us/source/resources/button/18px/active_button.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/18px/normal_button.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/18px/selected_active_button.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/18px/selected_button.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/24px/active_button.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/24px/active_button_capsule.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/24px/active_button_pointer.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/24px/normal_button.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/24px/normal_button_capsule.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/24px/normal_button_pointer.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/24px/selected_active_button.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/24px/selected_active_button_capsule.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/24px/selected_active_button_pointer.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/24px/selected_button.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/24px/selected_button_capsule.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/24px/selected_button_pointer.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/30px/active_button.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/30px/active_button_pointer.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/30px/normal_button.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/30px/normal_button_pointer.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/30px/selected_active_button.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/30px/selected_active_button_pointer.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/30px/selected_button.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/30px/selected_button_pointer.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/44px/active_button.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/44px/normal_button.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/44px/selected_active_button.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/button/44px/selected_button.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/images/navbar.png +0 -0
- package/public/applications/designer/5410/en-us/source/resources/images/navbar@2x.png +0 -0
- package/public/applications/designer/5410/en-us/stylesheet-no-repeat.png +0 -0
- package/public/applications/designer/5410/en-us/stylesheet-no-repeat@2x.png +0 -0
- package/public/applications/designer/5410/en-us/stylesheet-packed.css +439 -0
- package/public/applications/designer/5410/en-us/stylesheet-repeat-x.png +0 -0
- package/public/applications/designer/5410/en-us/stylesheet-repeat-x@2x.png +0 -0
- package/public/applications/designer/5410/en-us/stylesheet.css +69 -0
- package/public/applications/designer/5410/en-us/stylesheet@2x-packed.css +583 -0
- package/public/applications/designer/5410/en-us/stylesheet@2x.css +78 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/delete.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/delete_button.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/button_archive.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/button_concurrentEnd.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/button_concurrentStart.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/button_condition.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/button_counterSign.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/button_delete.gif +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/button_end.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/button_link.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/button_notify.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/button_sign.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/button_start.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/button_submit.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/canvas_bg.gif +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/canvas_bg.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/condition_32x32.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/countersign1_32x32.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/countersign_32x32.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/delete_button_16.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/delete_button_20.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/delete_button_32.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/end_32x32.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/ico_archive.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/ico_archive_nor.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/ico_concurrentEnd.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/ico_concurrentStart.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/ico_condition.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/ico_delete.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/ico_end.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/ico_link.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/ico_notify.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/ico_sign.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/ico_start.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/ico_submit.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/link_button_16.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/link_button_20.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/link_button_32.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/sign1_32x32.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/sign_32x32.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/start_32x32.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/submit_32x32.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/images/warning_sma.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/link_button.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/pickup-add-active.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/source/resources/pickup-add.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/stylesheet-no-repeat.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/stylesheet-no-repeat@2x.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/stylesheet-resources/images/canvas_bg.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/stylesheet-resources/images/canvas_bg@2x.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/en-us/stylesheet.css +22 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/delete.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/delete_button.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/button_archive.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/button_concurrentEnd.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/button_concurrentStart.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/button_condition.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/button_counterSign.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/button_delete.gif +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/button_end.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/button_link.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/button_notify.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/button_sign.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/button_start.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/button_submit.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/canvas_bg.gif +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/canvas_bg.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/condition_32x32.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/countersign1_32x32.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/countersign_32x32.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/delete_button_16.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/delete_button_20.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/delete_button_32.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/end_32x32.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/ico_archive.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/ico_archive_nor.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/ico_concurrentEnd.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/ico_concurrentStart.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/ico_condition.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/ico_delete.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/ico_end.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/ico_link.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/ico_notify.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/ico_sign.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/ico_start.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/ico_submit.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/link_button_16.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/link_button_20.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/link_button_32.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/sign1_32x32.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/sign_32x32.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/start_32x32.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/submit_32x32.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/images/warning_sma.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/link_button.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/pickup-add-active.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/source/resources/pickup-add.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/stylesheet-no-repeat.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/stylesheet-no-repeat@2x.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/stylesheet-resources/images/canvas_bg.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/stylesheet-resources/images/canvas_bg@2x.png +0 -0
- package/public/applications/designer/5410/flowdesigner/5410/zh-cn/stylesheet.css +22 -0
- package/public/applications/designer/5410/formdesigner/5410/en-us/source/resources/bg_wood.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/en-us/source/resources/bg_wood@2x.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/en-us/source/resources/checkbox_checked.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/en-us/source/resources/checkbox_checked_active.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/en-us/source/resources/checkbox_mixed.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/en-us/source/resources/checkbox_mixed_active.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/en-us/source/resources/checkbox_unchecked.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/en-us/source/resources/checkbox_unchecked_active.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/en-us/source/resources/currency.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/en-us/source/resources/datePicker.gif +0 -0
- package/public/applications/designer/5410/formdesigner/5410/en-us/source/resources/datePicker.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/en-us/source/resources/delete_button.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/en-us/source/resources/delete_button@2x.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/en-us/source/resources/percentage.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/en-us/source/resources/sprite.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/en-us/source/resources/warning_sma.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/en-us/stylesheet-no-repeat.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/en-us/stylesheet-no-repeat@2x.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/en-us/stylesheet.css +5 -0
- package/public/applications/designer/5410/formdesigner/5410/en-us/stylesheet@2x.css +8 -0
- package/public/applications/designer/5410/formdesigner/5410/zh-cn/source/resources/bg_wood.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/zh-cn/source/resources/bg_wood@2x.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/zh-cn/source/resources/checkbox_checked.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/zh-cn/source/resources/checkbox_checked_active.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/zh-cn/source/resources/checkbox_mixed.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/zh-cn/source/resources/checkbox_mixed_active.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/zh-cn/source/resources/checkbox_unchecked.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/zh-cn/source/resources/checkbox_unchecked_active.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/zh-cn/source/resources/currency.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/zh-cn/source/resources/datePicker.gif +0 -0
- package/public/applications/designer/5410/formdesigner/5410/zh-cn/source/resources/datePicker.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/zh-cn/source/resources/delete_button.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/zh-cn/source/resources/delete_button@2x.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/zh-cn/source/resources/percentage.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/zh-cn/source/resources/sprite.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/zh-cn/source/resources/warning_sma.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/zh-cn/stylesheet-no-repeat.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/zh-cn/stylesheet-no-repeat@2x.png +0 -0
- package/public/applications/designer/5410/formdesigner/5410/zh-cn/stylesheet.css +5 -0
- package/public/applications/designer/5410/formdesigner/5410/zh-cn/stylesheet@2x.css +8 -0
- package/public/applications/designer/5410/index.html +64 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/cap.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/downbutton.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-alert-16.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-alert-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-alert-48.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-bookmark-16.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-bookmark-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-cancel-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-document-16.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-document-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-down-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-error-48.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-favorite-16.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-favorite-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-folder-16.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-folder-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-group-16.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-group-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-help-16.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-help-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-info-16.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-info-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-info-48.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-left-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-options-16.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-options-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-redo-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-right-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-tools-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-trash-16.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-trash-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-undo-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-up-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-user-16.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/icons/sc-icon-user-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/thumb-bottom.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/thumb-center.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/thumb-top.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/track.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/source/resources/images/upbutton.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/stylesheet-no-repeat.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/stylesheet-no-repeat@2x.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/en-us/stylesheet.css +35 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/cap.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/downbutton.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-alert-16.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-alert-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-alert-48.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-bookmark-16.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-bookmark-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-cancel-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-document-16.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-document-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-down-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-error-48.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-favorite-16.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-favorite-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-folder-16.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-folder-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-group-16.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-group-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-help-16.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-help-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-info-16.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-info-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-info-48.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-left-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-options-16.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-options-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-redo-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-right-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-tools-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-trash-16.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-trash-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-undo-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-up-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-user-16.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/icons/sc-icon-user-24.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/thumb-bottom.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/thumb-center.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/thumb-top.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/track.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/source/resources/images/upbutton.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/stylesheet-no-repeat.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/stylesheet-no-repeat@2x.png +0 -0
- package/public/applications/designer/5410/sproutcore/desktop/5410/zh-cn/stylesheet.css +35 -0
- package/public/applications/designer/5410/sproutcore/foundation/5410/en-us/resources/images/favicon.ico +0 -0
- package/public/applications/designer/5410/sproutcore/foundation/5410/en-us/source/resources/blank.gif +0 -0
- package/public/applications/designer/5410/sproutcore/foundation/5410/en-us/source/resources/images/sproutcore-logo.png +0 -0
- package/public/applications/designer/5410/sproutcore/foundation/5410/en-us/source/resources/images/sproutcore-startup-landscape.jpg +0 -0
- package/public/applications/designer/5410/sproutcore/foundation/5410/en-us/source/resources/images/sproutcore-startup-landscape.png +0 -0
- package/public/applications/designer/5410/sproutcore/foundation/5410/en-us/source/resources/images/sproutcore-startup-portrait.jpg +0 -0
- package/public/applications/designer/5410/sproutcore/foundation/5410/en-us/source/resources/images/sproutcore-startup-portrait.png +0 -0
- package/public/applications/designer/5410/sproutcore/foundation/5410/en-us/source/resources/images/sproutcore-startup.png +0 -0
- package/public/applications/designer/5410/sproutcore/foundation/5410/en-us/source/resources/images/sproutcore.png +0 -0
- package/public/applications/designer/5410/sproutcore/foundation/5410/en-us/stylesheet.css +2 -0
- package/public/applications/designer/5410/sproutcore/foundation/5410/zh-cn/resources/images/favicon.ico +0 -0
- package/public/applications/designer/5410/sproutcore/foundation/5410/zh-cn/source/resources/blank.gif +0 -0
- package/public/applications/designer/5410/sproutcore/foundation/5410/zh-cn/source/resources/images/sproutcore-logo.png +0 -0
- package/public/applications/designer/5410/sproutcore/foundation/5410/zh-cn/source/resources/images/sproutcore-startup-landscape.jpg +0 -0
- package/public/applications/designer/5410/sproutcore/foundation/5410/zh-cn/source/resources/images/sproutcore-startup-landscape.png +0 -0
- package/public/applications/designer/5410/sproutcore/foundation/5410/zh-cn/source/resources/images/sproutcore-startup-portrait.jpg +0 -0
- package/public/applications/designer/5410/sproutcore/foundation/5410/zh-cn/source/resources/images/sproutcore-startup-portrait.png +0 -0
- package/public/applications/designer/5410/sproutcore/foundation/5410/zh-cn/source/resources/images/sproutcore-startup.png +0 -0
- package/public/applications/designer/5410/sproutcore/foundation/5410/zh-cn/source/resources/images/sproutcore.png +0 -0
- package/public/applications/designer/5410/sproutcore/foundation/5410/zh-cn/stylesheet.css +2 -0
- package/public/applications/designer/5410/sproutcore/yuireset/5410/en-us/stylesheet.css +2 -0
- package/public/applications/designer/5410/sproutcore/yuireset/5410/zh-cn/stylesheet.css +2 -0
- package/public/applications/designer/5410/zh-cn/index.html +64 -0
- package/public/applications/designer/5410/zh-cn/javascript-packed.js +87 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/18px/active_button.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/18px/normal_button.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/18px/selected_active_button.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/18px/selected_button.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/24px/active_button.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/24px/active_button_capsule.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/24px/active_button_pointer.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/24px/normal_button.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/24px/normal_button_capsule.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/24px/normal_button_pointer.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/24px/selected_active_button.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/24px/selected_active_button_capsule.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/24px/selected_active_button_pointer.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/24px/selected_button.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/24px/selected_button_capsule.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/24px/selected_button_pointer.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/30px/active_button.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/30px/active_button_pointer.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/30px/normal_button.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/30px/normal_button_pointer.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/30px/selected_active_button.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/30px/selected_active_button_pointer.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/30px/selected_button.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/30px/selected_button_pointer.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/44px/active_button.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/44px/normal_button.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/44px/selected_active_button.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/button/44px/selected_button.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/images/navbar.png +0 -0
- package/public/applications/designer/5410/zh-cn/source/resources/images/navbar@2x.png +0 -0
- package/public/applications/designer/5410/zh-cn/stylesheet-no-repeat.png +0 -0
- package/public/applications/designer/5410/zh-cn/stylesheet-no-repeat@2x.png +0 -0
- package/public/applications/designer/5410/zh-cn/stylesheet-packed.css +439 -0
- package/public/applications/designer/5410/zh-cn/stylesheet-repeat-x.png +0 -0
- package/public/applications/designer/5410/zh-cn/stylesheet-repeat-x@2x.png +0 -0
- package/public/applications/designer/5410/zh-cn/stylesheet.css +69 -0
- package/public/applications/designer/5410/zh-cn/stylesheet@2x-packed.css +583 -0
- package/public/applications/designer/5410/zh-cn/stylesheet@2x.css +78 -0
- package/public/applications/designer/current/en-us/index.html +64 -0
- package/public/applications/designer/current/index.html +64 -0
- package/public/applications/designer/current/zh-cn/index.html +64 -0
- package/public/applications/designer/index.html +64 -0
- package/public/workflow/index.css +369 -0
- package/src/instance_record_queue.js +1171 -0
- package/src/rests/api_workflow_instance_batch_remove.js +70 -0
- package/src/rests/getInstanceServiceSchema.js +72 -0
- package/src/rests/index.js +13 -0
- package/src/rests/updateFormFields.js +110 -0
- package/src/schema/instance_form_schema.amis.js +120 -0
- package/src/schema/steedos_form_schema.amis.js +205 -0
- package/src/schema/steedos_form_schema.table.amis.js +123 -0
- package/src/util/index.js +125 -0
|
@@ -0,0 +1,4278 @@
|
|
|
1
|
+
const {
|
|
2
|
+
insert_instance_tasks,
|
|
3
|
+
insert_many_instance_tasks,
|
|
4
|
+
update_instance_tasks,
|
|
5
|
+
update_many_instance_tasks,
|
|
6
|
+
remove_many_instance_tasks,
|
|
7
|
+
} = require('./instance_tasks_manager');
|
|
8
|
+
const Cookies = require("cookies");
|
|
9
|
+
const _eval = require('eval');
|
|
10
|
+
const HandlersManager = require('./handlers_manager');
|
|
11
|
+
const PermissionManager = require('./permission_manager');
|
|
12
|
+
const WorkflowManager = require('./workflow_manager');
|
|
13
|
+
const { getCollection, _makeNewID } = require('../utils/collection');
|
|
14
|
+
const WorkingTime = require('../utils/workingTime');
|
|
15
|
+
const pushManager = require('./push_manager');
|
|
16
|
+
const { t } = require('@steedos/i18n')
|
|
17
|
+
const moment = require('moment')
|
|
18
|
+
const { getObject } = require('@steedos/objectql');
|
|
19
|
+
|
|
20
|
+
const UUFlowManager = {};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Check user authorization
|
|
24
|
+
* @param {Object} req - Request object
|
|
25
|
+
* @param {Object} res - Response object
|
|
26
|
+
* @returns {Object} User object if authorized
|
|
27
|
+
* @throws {Error} If unauthorized
|
|
28
|
+
*/
|
|
29
|
+
UUFlowManager.check_authorization = async function (req, res) {
|
|
30
|
+
const query = req.query;
|
|
31
|
+
let userId = query["X-User-Id"];
|
|
32
|
+
let authToken = query["X-Auth-Token"];
|
|
33
|
+
|
|
34
|
+
if (!userId || !authToken) {
|
|
35
|
+
const cookies = new Cookies(req, res);
|
|
36
|
+
userId = cookies.get("X-User-Id");
|
|
37
|
+
authToken = cookies.get("X-Auth-Token");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (!userId || !authToken) {
|
|
41
|
+
throw new Error(401);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const hashedToken = Accounts._hashLoginToken(authToken);
|
|
45
|
+
const usersCollection = await getCollection('users');
|
|
46
|
+
const user = await usersCollection.findOne({
|
|
47
|
+
_id: userId,
|
|
48
|
+
"services.resume.loginTokens.hashedToken": hashedToken
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
if (!user) {
|
|
52
|
+
throw new Error(401);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return user;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Check if next step users are valid
|
|
60
|
+
* @param {Array} selected - Selected users
|
|
61
|
+
* @param {Array} scope - Allowed users
|
|
62
|
+
* @param {Object} nextStep - Next step configuration
|
|
63
|
+
* @returns {Boolean} True if valid
|
|
64
|
+
*/
|
|
65
|
+
UUFlowManager.checkNestStepUsersIsValid = function (selected = [], scope = [], nextStep = null) {
|
|
66
|
+
if (nextStep?.allow_pick_approve_users) {
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
return _.difference(selected, scope).length === 0;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Get instance by ID
|
|
74
|
+
* @param {String} instance_id - Instance ID
|
|
75
|
+
* @returns {Object} Instance object
|
|
76
|
+
* @throws {Error} If instance not found
|
|
77
|
+
*/
|
|
78
|
+
UUFlowManager.getInstance = async function (instance_id) {
|
|
79
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
80
|
+
console.time('UUFlowManager.getInstance');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const instancesCollection = await getCollection('instances');
|
|
84
|
+
const ins = await instancesCollection.findOne({_id: instance_id});
|
|
85
|
+
|
|
86
|
+
if (!ins) {
|
|
87
|
+
throw new Error(`申请单ID:${instance_id}有误或此申请单已经被删除`);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
91
|
+
console.timeEnd('UUFlowManager.getInstance');
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return ins;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Get space by ID
|
|
99
|
+
* @param {String} space_id - Space ID
|
|
100
|
+
* @returns {Object} Space object
|
|
101
|
+
* @throws {Error} If space not found
|
|
102
|
+
*/
|
|
103
|
+
UUFlowManager.getSpace = async function (space_id) {
|
|
104
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
105
|
+
console.time('UUFlowManager.getSpace');
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const spacesCollection = await getCollection('spaces');
|
|
109
|
+
const space = await spacesCollection.findOne({_id: space_id});
|
|
110
|
+
|
|
111
|
+
if (!space) {
|
|
112
|
+
throw new Error("space_id有误或此space已经被删除");
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
116
|
+
console.timeEnd('UUFlowManager.getSpace');
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return space;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Get space user
|
|
124
|
+
* @param {String} space_id - Space ID
|
|
125
|
+
* @param {String} user_id - User ID
|
|
126
|
+
* @param {Object} options - MongoDB find options
|
|
127
|
+
* @returns {Object} Space user object
|
|
128
|
+
* @throws {Error} If space user not found
|
|
129
|
+
*/
|
|
130
|
+
UUFlowManager.getSpaceUser = async function (space_id, user_id, options = {}) {
|
|
131
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
132
|
+
console.time('UUFlowManager.getSpaceUser');
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const spaceUsersCollection = await getCollection('space_users');
|
|
136
|
+
const space_user = await spaceUsersCollection.findOne({
|
|
137
|
+
space: space_id,
|
|
138
|
+
user: user_id
|
|
139
|
+
}, options);
|
|
140
|
+
|
|
141
|
+
if (!space_user) {
|
|
142
|
+
throw new Error("user_id对应的用户不属于当前space");
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
146
|
+
console.timeEnd('UUFlowManager.getSpaceUser');
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return space_user;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Get flow by ID
|
|
154
|
+
* @param {String} flow_id - Flow ID
|
|
155
|
+
* @param {Object} options - MongoDB find options
|
|
156
|
+
* @returns {Object} Flow object
|
|
157
|
+
* @throws {Error} If flow not found
|
|
158
|
+
*/
|
|
159
|
+
UUFlowManager.getFlow = async function (flow_id, options = {}) {
|
|
160
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
161
|
+
const now = new Date().toISOString();
|
|
162
|
+
console.time('UUFlowManager.getFlow' + now);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const flowsCollection = await getCollection('flows');
|
|
166
|
+
const flow = await flowsCollection.findOne({_id: flow_id}, options);
|
|
167
|
+
|
|
168
|
+
if (!flow) {
|
|
169
|
+
throw new Error("id有误或此流程已经被删除");
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
173
|
+
console.timeEnd('UUFlowManager.getFlow' + now);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return flow;
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Get flow version
|
|
181
|
+
* @param {Object} flow - Flow object
|
|
182
|
+
* @param {String} flow_version - Flow version ID
|
|
183
|
+
* @returns {Object} Flow version object
|
|
184
|
+
* @throws {Error} If version not found
|
|
185
|
+
*/
|
|
186
|
+
UUFlowManager.getFlowVersion = function (flow, flow_version) {
|
|
187
|
+
let flow_v = null;
|
|
188
|
+
|
|
189
|
+
if (flow_version === flow.current._id) {
|
|
190
|
+
flow_v = flow.current;
|
|
191
|
+
} else {
|
|
192
|
+
flow_v = _.find(flow.historys, (flow_h) => flow_version === flow_h._id);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (!flow_v) {
|
|
196
|
+
throw new Error('未找到流程对应的版本');
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return flow_v;
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Get step from steps array
|
|
204
|
+
* @param {Array} steps - Steps array
|
|
205
|
+
* @param {String} stepId - Step ID
|
|
206
|
+
* @returns {Object} Step object
|
|
207
|
+
*/
|
|
208
|
+
UUFlowManager.getStepFromSteps = function (steps, stepId) {
|
|
209
|
+
return _.find(steps, (step) => step._id === stepId);
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Get space user organization info
|
|
214
|
+
* @param {Object} space_user - Space user object
|
|
215
|
+
* @returns {Object} Organization info
|
|
216
|
+
*/
|
|
217
|
+
UUFlowManager.getSpaceUserOrgInfo = async function (space_user) {
|
|
218
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
219
|
+
console.time('UUFlowManager.getSpaceUserOrgInfo');
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const info = {
|
|
223
|
+
organization: space_user.organization,
|
|
224
|
+
organization_name: '',
|
|
225
|
+
organization_fullname: ''
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
const organizationsCollection = await getCollection('organizations');
|
|
229
|
+
const org = await organizationsCollection.findOne({_id: space_user.organization}, {
|
|
230
|
+
projection: {
|
|
231
|
+
name: 1,
|
|
232
|
+
fullname: 1
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
if (org) {
|
|
237
|
+
info.organization_name = org.name;
|
|
238
|
+
info.organization_fullname = org.fullname;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
242
|
+
console.timeEnd('UUFlowManager.getSpaceUserOrgInfo');
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
return info;
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Get trace from instance
|
|
250
|
+
* @param {Object} instance - Instance object
|
|
251
|
+
* @param {String} trace_id - Trace ID
|
|
252
|
+
* @returns {Object} Trace object
|
|
253
|
+
* @throws {Error} If trace not found
|
|
254
|
+
*/
|
|
255
|
+
UUFlowManager.getTrace = function (instance, trace_id) {
|
|
256
|
+
const trace = _.find(instance.traces, (t) => t._id === trace_id);
|
|
257
|
+
|
|
258
|
+
if (!trace) {
|
|
259
|
+
throw new Error("trace_id有误");
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return trace;
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Get approve from trace
|
|
267
|
+
* @param {Object} trace - Trace object
|
|
268
|
+
* @param {String} approve_id - Approve ID
|
|
269
|
+
* @returns {Object} Approve object
|
|
270
|
+
* @throws {Error} If approve not found
|
|
271
|
+
*/
|
|
272
|
+
UUFlowManager.getApprove = function (trace, approve_id) {
|
|
273
|
+
const approve = _.find(trace.approves, (t) => t._id === approve_id);
|
|
274
|
+
|
|
275
|
+
if (!approve) {
|
|
276
|
+
throw new Error("trace_id有误");
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
return approve;
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Check if trace is not finished
|
|
284
|
+
* @param {Object} trace - Trace object
|
|
285
|
+
* @throws {Error} If trace is finished
|
|
286
|
+
*/
|
|
287
|
+
UUFlowManager.isTraceNotFinished = function (trace) {
|
|
288
|
+
if (trace.is_finished !== false) {
|
|
289
|
+
throw new Error("可能已有人对此文件做了处理。请点击已审核,查看文件的最新状态");
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Check if approve is not finished
|
|
295
|
+
* @param {Object} approve - Approve object
|
|
296
|
+
* @throws {Error} If approve is finished
|
|
297
|
+
*/
|
|
298
|
+
UUFlowManager.isApproveNotFinished = function (approve) {
|
|
299
|
+
if (approve.is_finished !== false) {
|
|
300
|
+
throw new Error("当前步骤不为未完成状态,不能进行此操作");
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Check if instance is pending
|
|
306
|
+
* @param {Object} instance - Instance object
|
|
307
|
+
* @param {String} lang - Language code
|
|
308
|
+
* @throws {Error} If instance is not pending
|
|
309
|
+
*/
|
|
310
|
+
UUFlowManager.isInstancePending = function (instance, lang = "zh-CN") {
|
|
311
|
+
if (instance.state !== "pending") {
|
|
312
|
+
throw new Error(t('instance.remindMessage.update_failed', {}, lang));
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Check if user is handler or agent
|
|
318
|
+
* @param {Object} approve - Approve object
|
|
319
|
+
* @param {String} user_id - User ID
|
|
320
|
+
* @throws {Error} If user is not handler or agent
|
|
321
|
+
*/
|
|
322
|
+
UUFlowManager.isHandlerOrAgent = function (approve, user_id) {
|
|
323
|
+
if (approve.user !== user_id && approve.agent !== user_id) {
|
|
324
|
+
throw new Error("不是当前步骤对应的处理人或其代理人,不能进行此操作");
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Check if instance is draft
|
|
330
|
+
* @param {Object} instance - Instance object
|
|
331
|
+
* @param {String} lang - Language code
|
|
332
|
+
* @throws {Error} If instance is not draft
|
|
333
|
+
*/
|
|
334
|
+
UUFlowManager.isInstanceDraft = function (instance, lang = "zh-CN") {
|
|
335
|
+
if (instance.state !== "draft") {
|
|
336
|
+
throw new Error(t('instance.remindMessage.update_failed', {}, lang));
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Check if user is instance submitter
|
|
342
|
+
* @param {Object} instance - Instance object
|
|
343
|
+
* @param {String} current_user_id - User ID
|
|
344
|
+
* @throws {Error} If user is not submitter
|
|
345
|
+
*/
|
|
346
|
+
UUFlowManager.isInstanceSubmitter = function (instance, current_user_id) {
|
|
347
|
+
if (instance.submitter !== current_user_id) {
|
|
348
|
+
throw new Error('当前用户不是申请单对应的提交人,不能进行此操作');
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Check if user is submitter, applicant or space admin
|
|
354
|
+
* @param {Object} instance - Instance object
|
|
355
|
+
* @param {String} current_user_id - User ID
|
|
356
|
+
* @param {Object} space - Space object
|
|
357
|
+
* @throws {Error} If user doesn't have permission
|
|
358
|
+
*/
|
|
359
|
+
UUFlowManager.isInstanceSubmitterOrApplicantOrSpaceAdmin = function (instance, current_user_id, space) {
|
|
360
|
+
if (instance.submitter !== current_user_id &&
|
|
361
|
+
instance.applicant !== current_user_id &&
|
|
362
|
+
!space.admins.includes(current_user_id)) {
|
|
363
|
+
throw new Error("当前用户不是申请单对应的提交人或申请人或工作区管理员");
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Get step from instance and flow
|
|
369
|
+
* @param {Object} instance - Instance object
|
|
370
|
+
* @param {Object} flow - Flow object
|
|
371
|
+
* @param {String} step_id - Step ID
|
|
372
|
+
* @returns {Object} Step object
|
|
373
|
+
* @throws {Error} If step not found
|
|
374
|
+
*/
|
|
375
|
+
UUFlowManager.getStep = function (instance, flow, step_id) {
|
|
376
|
+
// console.log('getStep: ', instance, flow, step_id)
|
|
377
|
+
const flow_rev = instance.flow_version;
|
|
378
|
+
let isExistStep = null;
|
|
379
|
+
|
|
380
|
+
if (flow.current._id === flow_rev) {
|
|
381
|
+
isExistStep = _.find(flow.current.steps, (step) => step._id === step_id);
|
|
382
|
+
} else {
|
|
383
|
+
_.each(flow.historys, (history) => {
|
|
384
|
+
if (history._id === flow_rev) {
|
|
385
|
+
isExistStep = _.find(history.steps, (step) => step._id === step_id);
|
|
386
|
+
return false; // Break loop
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
if (!isExistStep) {
|
|
392
|
+
throw new Error("不能获取step");
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
return isExistStep;
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* Check if judge value is legal
|
|
400
|
+
* @param {String} judge - Judge value
|
|
401
|
+
* @throws {Error} If judge is invalid
|
|
402
|
+
*/
|
|
403
|
+
UUFlowManager.isJudgeLegal = function (judge) {
|
|
404
|
+
const validJudges = ["approved", "rejected", "readed", "submitted"];
|
|
405
|
+
if (!validJudges.includes(judge)) {
|
|
406
|
+
throw new Error("judge有误");
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Check if user is space admin
|
|
412
|
+
* @param {String} space_id - Space ID
|
|
413
|
+
* @param {String} user_id - User ID
|
|
414
|
+
* @throws {Error} If user is not admin
|
|
415
|
+
*/
|
|
416
|
+
UUFlowManager.isSpaceAdmin = async function (space_id, user_id) {
|
|
417
|
+
const spacesCollection = await getCollection('spaces');
|
|
418
|
+
const space = await spacesCollection.findOne({
|
|
419
|
+
_id: space_id
|
|
420
|
+
}, {
|
|
421
|
+
projection: {
|
|
422
|
+
admins: 1
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
if (!space?.admins?.includes(user_id)) {
|
|
427
|
+
throw new Error("当前用户不是工作区管理员,不能进行此操作");
|
|
428
|
+
}
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Get user by ID
|
|
433
|
+
* @param {String} user_id - User ID
|
|
434
|
+
* @param {Object} options - MongoDB find options
|
|
435
|
+
* @returns {Object} User object
|
|
436
|
+
* @throws {Error} If user not found
|
|
437
|
+
*/
|
|
438
|
+
UUFlowManager.getUser = async function (user_id, options = {}) {
|
|
439
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
440
|
+
console.time('UUFlowManager.getUser');
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
const usersCollection = await getCollection('users');
|
|
444
|
+
const user = await usersCollection.findOne({_id: user_id}, options);
|
|
445
|
+
|
|
446
|
+
if (!user) {
|
|
447
|
+
throw new Error("用户ID有误或此用户已经被删除");
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
451
|
+
console.timeEnd('UUFlowManager.getUser');
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
return user;
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Get organization by ID
|
|
459
|
+
* @param {String} orgId - Organization ID
|
|
460
|
+
* @param {Object} options - MongoDB find options
|
|
461
|
+
* @returns {Object} Organization object
|
|
462
|
+
* @throws {Error} If organization not found
|
|
463
|
+
*/
|
|
464
|
+
UUFlowManager.getOrganization = async function (orgId, options = {}) {
|
|
465
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
466
|
+
console.time('UUFlowManager.getOrganization');
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
const organizationsCollection = await getCollection('organizations');
|
|
470
|
+
const orgDoc = await organizationsCollection.findOne({_id: orgId}, options);
|
|
471
|
+
|
|
472
|
+
if (!orgDoc) {
|
|
473
|
+
throw new Error("组织ID有误或此组织已经被删除");
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
477
|
+
console.timeEnd('UUFlowManager.getOrganization');
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
return orgDoc;
|
|
481
|
+
};
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Get user organization
|
|
485
|
+
* @param {String} user_id - User ID
|
|
486
|
+
* @param {String} space_id - Space ID
|
|
487
|
+
* @returns {Object} Organization object
|
|
488
|
+
*/
|
|
489
|
+
UUFlowManager.getUserOrganization = async function (user_id, space_id) {
|
|
490
|
+
const organizationsCollection = await getCollection('organizations');
|
|
491
|
+
return await organizationsCollection.findOne({
|
|
492
|
+
space: space_id,
|
|
493
|
+
users: user_id
|
|
494
|
+
});
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Get user roles
|
|
499
|
+
* @param {String} user_id - User ID
|
|
500
|
+
* @param {String} space_id - Space ID
|
|
501
|
+
* @returns {Array} Array of role names
|
|
502
|
+
*/
|
|
503
|
+
UUFlowManager.getUserRoles = async function (user_id, space_id) {
|
|
504
|
+
const role_names = [];
|
|
505
|
+
|
|
506
|
+
const positionsCollection = await getCollection('flow_positions');
|
|
507
|
+
const positionsCursor = await positionsCollection.find({
|
|
508
|
+
space: space_id,
|
|
509
|
+
users: user_id
|
|
510
|
+
}, {
|
|
511
|
+
projection: {
|
|
512
|
+
role: 1
|
|
513
|
+
}
|
|
514
|
+
});
|
|
515
|
+
|
|
516
|
+
const positions = await positionsCursor.toArray();
|
|
517
|
+
|
|
518
|
+
const flowRolesCollection = await getCollection('flow_roles');
|
|
519
|
+
for (const position of positions) {
|
|
520
|
+
const role = await flowRolesCollection.findOne({
|
|
521
|
+
_id: position.role
|
|
522
|
+
}, {
|
|
523
|
+
projection: {
|
|
524
|
+
name: 1
|
|
525
|
+
}
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
if (role) {
|
|
529
|
+
role_names.push(role.name);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
return role_names;
|
|
534
|
+
};
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* Check if flow is enabled
|
|
538
|
+
* @param {Object} flow - Flow object
|
|
539
|
+
* @throws {Error} If flow is not enabled
|
|
540
|
+
*/
|
|
541
|
+
UUFlowManager.isFlowEnabled = function (flow) {
|
|
542
|
+
if (flow.state !== "enabled") {
|
|
543
|
+
throw new Error("流程未启用,操作失败");
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Check if flow matches space
|
|
549
|
+
* @param {Object} flow - Flow object
|
|
550
|
+
* @param {String} space_id - Space ID
|
|
551
|
+
* @throws {Error} If flow doesn't belong to space
|
|
552
|
+
*/
|
|
553
|
+
UUFlowManager.isFlowSpaceMatched = function (flow, space_id) {
|
|
554
|
+
if (flow.space !== space_id) {
|
|
555
|
+
throw new Error("流程和工作区ID不匹配");
|
|
556
|
+
}
|
|
557
|
+
};
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* Calculate condition for conditional step
|
|
561
|
+
* @param {Object} values - Form values
|
|
562
|
+
* @param {String} condition_str - Condition string
|
|
563
|
+
* @returns {Boolean} Condition result
|
|
564
|
+
*/
|
|
565
|
+
UUFlowManager.calculateCondition = function (values, condition_str) {
|
|
566
|
+
try {
|
|
567
|
+
const __values = values;
|
|
568
|
+
|
|
569
|
+
// Helper functions for condition calculation
|
|
570
|
+
const sum = (subform_field) => {
|
|
571
|
+
if (!subform_field) {
|
|
572
|
+
throw new Error("参数为空");
|
|
573
|
+
}
|
|
574
|
+
if (!Array.isArray(subform_field)) {
|
|
575
|
+
throw new Error("参数不是数组类型");
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
return subform_field.reduce((total, field_value) => {
|
|
579
|
+
return total + Number(String(field_value));
|
|
580
|
+
}, 0);
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
const average = (subform_field) => {
|
|
584
|
+
if (!subform_field) {
|
|
585
|
+
throw new Error("参数为空");
|
|
586
|
+
}
|
|
587
|
+
if (!Array.isArray(subform_field)) {
|
|
588
|
+
throw new Error("参数不是数组类型");
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
return sum(subform_field) / subform_field.length;
|
|
592
|
+
};
|
|
593
|
+
|
|
594
|
+
const count = (subform_field) => {
|
|
595
|
+
if (!subform_field) {
|
|
596
|
+
throw new Error("参数为空");
|
|
597
|
+
}
|
|
598
|
+
return subform_field.length;
|
|
599
|
+
};
|
|
600
|
+
|
|
601
|
+
const max = (subform_field) => {
|
|
602
|
+
if (!subform_field) {
|
|
603
|
+
throw new Error("参数为空");
|
|
604
|
+
}
|
|
605
|
+
if (!Array.isArray(subform_field)) {
|
|
606
|
+
throw new Error("参数不是数组类型");
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
const sub_field = subform_field.map(field_value => Number(String(field_value)));
|
|
610
|
+
return Math.max(...sub_field);
|
|
611
|
+
};
|
|
612
|
+
|
|
613
|
+
const min = (subform_field) => {
|
|
614
|
+
if (!subform_field) {
|
|
615
|
+
throw new Error("参数为空");
|
|
616
|
+
}
|
|
617
|
+
if (!Array.isArray(subform_field)) {
|
|
618
|
+
throw new Error("参数不是数组类型");
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
const sub_field = subform_field.map(field_value => Number(String(field_value)));
|
|
622
|
+
return Math.min(...sub_field);
|
|
623
|
+
};
|
|
624
|
+
|
|
625
|
+
return eval(condition_str);
|
|
626
|
+
} catch (error) {
|
|
627
|
+
console.error(error.stack);
|
|
628
|
+
return false;
|
|
629
|
+
}
|
|
630
|
+
};
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Set form field variables for condition calculation
|
|
634
|
+
* @param {Array} fields - Form fields
|
|
635
|
+
* @param {Object} __values - Form values
|
|
636
|
+
* @param {String} space_id - Space ID
|
|
637
|
+
*/
|
|
638
|
+
UUFlowManager.setFormFieldVariable = async function (fields, __values, space_id) {
|
|
639
|
+
try {
|
|
640
|
+
for (const field of fields) {
|
|
641
|
+
if (field.type === "table") { // Subform
|
|
642
|
+
const subform_fields_all = field.fields;
|
|
643
|
+
for (const current_field of subform_fields_all) {
|
|
644
|
+
const values_arr = [];
|
|
645
|
+
|
|
646
|
+
if (["number", "percentage", "currency"].includes(current_field.type)) {
|
|
647
|
+
for (const sub_field of (__values[field.code] || [])) {
|
|
648
|
+
values_arr.push(sub_field[current_field.code]);
|
|
649
|
+
}
|
|
650
|
+
} else if (current_field.type === "checkbox") {
|
|
651
|
+
for (const sub_field of (__values[field.code] || [])) {
|
|
652
|
+
if (sub_field[current_field.code] === "true") {
|
|
653
|
+
values_arr.push(true);
|
|
654
|
+
} else if (sub_field[current_field.code] === "false") {
|
|
655
|
+
values_arr.push(false);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
} else {
|
|
659
|
+
for (const sub_field of (__values[field.code] || [])) {
|
|
660
|
+
values_arr.push(sub_field[current_field.code] || "");
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
__values[current_field.code] = values_arr;
|
|
665
|
+
}
|
|
666
|
+
} else if (field.type === "group") { // Group selection
|
|
667
|
+
if (field.is_multiselect) {
|
|
668
|
+
if (__values[field.code]?.length > 0) {
|
|
669
|
+
const group_id = [];
|
|
670
|
+
const group_name = [];
|
|
671
|
+
const group_fullname = [];
|
|
672
|
+
|
|
673
|
+
for (const group of __values[field.code]) {
|
|
674
|
+
group_id.push(group.id);
|
|
675
|
+
group_name.push(group.name);
|
|
676
|
+
group_fullname.push(group.fullname);
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
__values[field.code] = {
|
|
680
|
+
id: group_id,
|
|
681
|
+
name: group_name,
|
|
682
|
+
fullname: group_fullname
|
|
683
|
+
};
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
} else if (field.type === "user") { // User selection
|
|
687
|
+
if (field.is_multiselect) {
|
|
688
|
+
if (__values[field.code]?.length > 0) {
|
|
689
|
+
const user_id = [];
|
|
690
|
+
const user_name = [];
|
|
691
|
+
const organization = {
|
|
692
|
+
user_organization_fullname: [],
|
|
693
|
+
user_organization_name: []
|
|
694
|
+
};
|
|
695
|
+
let user_roles = [];
|
|
696
|
+
|
|
697
|
+
for (const select_user of __values[field.code]) {
|
|
698
|
+
user_id.push(select_user.id);
|
|
699
|
+
user_name.push(select_user.name);
|
|
700
|
+
|
|
701
|
+
const organization_selectuser = await UUFlowManager.getUserOrganization(select_user.id, space_id);
|
|
702
|
+
const role_selectuser = await UUFlowManager.getUserRoles(select_user.id, space_id);
|
|
703
|
+
|
|
704
|
+
if (organization_selectuser) {
|
|
705
|
+
organization.user_organization_fullname.push(organization_selectuser.fullname);
|
|
706
|
+
organization.user_organization_name.push(organization_selectuser.name);
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
if (role_selectuser) {
|
|
710
|
+
user_roles = user_roles.concat(role_selectuser);
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
__values[field.code] = {
|
|
715
|
+
id: user_id,
|
|
716
|
+
name: user_name,
|
|
717
|
+
organization: organization,
|
|
718
|
+
roles: user_roles
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
} else {
|
|
722
|
+
if (__values[field.code]) {
|
|
723
|
+
const organization_selectuser = await UUFlowManager.getUserOrganization(__values[field.code].id, space_id);
|
|
724
|
+
const role_selectuser = await UUFlowManager.getUserRoles(__values[field.code].id, space_id);
|
|
725
|
+
|
|
726
|
+
if (organization_selectuser) {
|
|
727
|
+
__values[field.code].organization = {
|
|
728
|
+
fullname: organization_selectuser.fullname,
|
|
729
|
+
name: organization_selectuser.name
|
|
730
|
+
};
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
__values[field.code].roles = role_selectuser;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
} else if (["number", "percentage", "currency"].includes(field.type)) { // Numeric types
|
|
737
|
+
__values[field.code] = __values[field.code] ? Number(__values[field.code]) : 0;
|
|
738
|
+
} else if (field.type === "checkbox") { // Checkbox
|
|
739
|
+
if (__values[field.code] === "true") {
|
|
740
|
+
__values[field.code] = true;
|
|
741
|
+
} else if (__values[field.code] === "false") {
|
|
742
|
+
__values[field.code] = false;
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
} catch (error) {
|
|
747
|
+
console.error(error.stack);
|
|
748
|
+
}
|
|
749
|
+
};
|
|
750
|
+
|
|
751
|
+
function isSkipStep(instance, step) {
|
|
752
|
+
return instance.skip_steps?.includes(step._id);
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* Get next steps for instance
|
|
757
|
+
* @param {Object} instance - Instance object
|
|
758
|
+
* @param {Object} flow - Flow object
|
|
759
|
+
* @param {Object} step - Current step object
|
|
760
|
+
* @param {String} judge - Judge value (approved/rejected)
|
|
761
|
+
* @param {Object} values - Form values
|
|
762
|
+
* @returns {Array} Array of next step IDs
|
|
763
|
+
*/
|
|
764
|
+
UUFlowManager.getNextSteps = async function (instance, flow, step, judge, values) {
|
|
765
|
+
const step_type = step.step_type;
|
|
766
|
+
let nextSteps = [];
|
|
767
|
+
|
|
768
|
+
if (step_type === "condition") {
|
|
769
|
+
// Get values for condition calculation
|
|
770
|
+
let __values = values !== undefined ? values : UUFlowManager.getUpdatedValues(instance);
|
|
771
|
+
|
|
772
|
+
// Get current and start approve
|
|
773
|
+
let current_approve = null;
|
|
774
|
+
let start_approve = null;
|
|
775
|
+
|
|
776
|
+
for (const trace of instance.traces) {
|
|
777
|
+
if (trace.is_finished === false) {
|
|
778
|
+
current_approve = trace.approves[0];
|
|
779
|
+
}
|
|
780
|
+
if (!trace.previous_trace_ids || trace.previous_trace_ids.length === 0) {
|
|
781
|
+
start_approve = trace.approves[0];
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
// Set variables for condition evaluation
|
|
786
|
+
__values["applicant"] = {
|
|
787
|
+
roles: await UUFlowManager.getUserRoles(instance.applicant, instance.space),
|
|
788
|
+
name: instance.applicant_name,
|
|
789
|
+
organization: {
|
|
790
|
+
fullname: instance.applicant_organization_fullname,
|
|
791
|
+
name: instance.applicant_organization_name
|
|
792
|
+
}
|
|
793
|
+
};
|
|
794
|
+
|
|
795
|
+
__values["submitter"] = {
|
|
796
|
+
roles: await UUFlowManager.getUserRoles(start_approve.handler, instance.space),
|
|
797
|
+
name: start_approve.handler_name,
|
|
798
|
+
organization: {
|
|
799
|
+
fullname: start_approve.handler_organization_fullname,
|
|
800
|
+
name: start_approve.handler_organization_name
|
|
801
|
+
}
|
|
802
|
+
};
|
|
803
|
+
|
|
804
|
+
__values["approver"] = {
|
|
805
|
+
roles: await UUFlowManager.getUserRoles(current_approve.handler, instance.space),
|
|
806
|
+
name: current_approve.handler_name,
|
|
807
|
+
organization: {
|
|
808
|
+
fullname: current_approve.handler_organization_fullname,
|
|
809
|
+
name: current_approve.handler_organization_name
|
|
810
|
+
}
|
|
811
|
+
};
|
|
812
|
+
|
|
813
|
+
// Get form and form version
|
|
814
|
+
const form = await UUFlowManager.getForm(instance.form);
|
|
815
|
+
let formVersion = null;
|
|
816
|
+
|
|
817
|
+
if (instance.form_version === form.current._id) {
|
|
818
|
+
formVersion = form.current;
|
|
819
|
+
} else {
|
|
820
|
+
formVersion = _.find(form.historys, (history) => instance.form_version === history._id);
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
// Set form field variables
|
|
824
|
+
await UUFlowManager.setFormFieldVariable(formVersion.fields, __values, instance.space);
|
|
825
|
+
|
|
826
|
+
// Evaluate conditions
|
|
827
|
+
const reg = /(\{[^{}]*\})/g;
|
|
828
|
+
const prefix = "__values";
|
|
829
|
+
|
|
830
|
+
for (const step_line of step.lines) {
|
|
831
|
+
if (step_line.state === "submitted") {
|
|
832
|
+
const step_line_condition = step_line.condition.replace(reg, (vowel) => {
|
|
833
|
+
return prefix + vowel.replace(/\{\s*/, "[\"").replace(/\s*\}/, "\"]").replace(/\s*\.\s*/g, "\"][\"");
|
|
834
|
+
});
|
|
835
|
+
const allow = UUFlowManager.calculateCondition(__values, step_line_condition);
|
|
836
|
+
if (allow) {
|
|
837
|
+
nextSteps.push(step_line.to_step);
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
} else if (step_type === "end") {
|
|
842
|
+
return [];
|
|
843
|
+
} else if (["submit", "start", "counterSign"].includes(step_type)) {
|
|
844
|
+
const lines = step.lines.filter((line) => line.state === "submitted");
|
|
845
|
+
|
|
846
|
+
if (lines.length === 0) {
|
|
847
|
+
throw new Error("流程的连线配置有误");
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
nextSteps = lines.map((line) => line.to_step);
|
|
851
|
+
} else if (step_type === "sign") {
|
|
852
|
+
if (judge === "approved") {
|
|
853
|
+
const lines = step.lines.filter((line) => line.state === "approved");
|
|
854
|
+
|
|
855
|
+
if (lines.length === 0) {
|
|
856
|
+
throw new Error("流程的连线配置有误");
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
nextSteps = lines.map((line) => line.to_step);
|
|
860
|
+
} else if (judge === "rejected") {
|
|
861
|
+
const lines = step.lines.filter((line) => line.state === "rejected");
|
|
862
|
+
const rejectedSteps = lines.map((line) => line.to_step);
|
|
863
|
+
|
|
864
|
+
// Get all finished trace steps
|
|
865
|
+
const trace_steps = [];
|
|
866
|
+
for (const trace of instance.traces) {
|
|
867
|
+
if (trace.is_finished === true) {
|
|
868
|
+
const flowVersions = [flow.current].concat(flow.historys || []);
|
|
869
|
+
|
|
870
|
+
for (const flowVer of flowVersions) {
|
|
871
|
+
if (flowVer._id === instance.flow_version) {
|
|
872
|
+
for (const flow_ver_step of flowVer.steps) {
|
|
873
|
+
if (flow_ver_step._id === trace.step && flow_ver_step.step_type !== "condition") {
|
|
874
|
+
trace_steps.push(trace.step);
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
// Get start and end steps from flow
|
|
883
|
+
const flow_steps = [];
|
|
884
|
+
if (instance.flow_version === flow.current._id) {
|
|
885
|
+
for (const flow_step of flow.current.steps) {
|
|
886
|
+
if (flow_step.step_type === "start" || flow_step.step_type === "end") {
|
|
887
|
+
flow_steps.push(flow_step._id);
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
} else {
|
|
891
|
+
for (const history of flow.historys) {
|
|
892
|
+
for (const history_step of history.steps) {
|
|
893
|
+
if (history_step.step_type === "start" || history_step.step_type === "end") {
|
|
894
|
+
flow_steps.push(history_step._id);
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
nextSteps = _.union(rejectedSteps, trace_steps, flow_steps);
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
// If next steps include condition steps, get their subsequent steps
|
|
905
|
+
const version_steps = {};
|
|
906
|
+
const flowVersions = [flow.current].concat(flow.historys || []);
|
|
907
|
+
|
|
908
|
+
for (const flowVer of flowVersions) {
|
|
909
|
+
if (flowVer._id === instance.flow_version) {
|
|
910
|
+
for (const flow_ver_step of flowVer.steps) {
|
|
911
|
+
version_steps[flow_ver_step._id] = flow_ver_step;
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
nextSteps = _.uniq(nextSteps);
|
|
917
|
+
|
|
918
|
+
for (const next_step_id of nextSteps) {
|
|
919
|
+
const _next_step = version_steps[next_step_id];
|
|
920
|
+
if (_next_step?.step_type === "condition" && _next_step.lines) {
|
|
921
|
+
for (const line of _next_step.lines) {
|
|
922
|
+
if (line.to_step) {
|
|
923
|
+
nextSteps.push(line.to_step);
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
nextSteps = _.uniq(nextSteps);
|
|
930
|
+
let rev_nextSteps = [];
|
|
931
|
+
|
|
932
|
+
for (const nextStepId of nextSteps) {
|
|
933
|
+
const _step = await UUFlowManager.getStep(instance, flow, nextStepId);
|
|
934
|
+
|
|
935
|
+
if (isSkipStep(instance, _step)) {
|
|
936
|
+
if (!judge && _step.step_type === 'sign') {
|
|
937
|
+
judge = 'approved';
|
|
938
|
+
}
|
|
939
|
+
rev_nextSteps = rev_nextSteps.concat(await UUFlowManager.getNextSteps(instance, flow, _step, judge));
|
|
940
|
+
} else {
|
|
941
|
+
rev_nextSteps.push(nextStepId);
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
// Include steps with always_enter_step = false and their next steps
|
|
946
|
+
const flowVersion = await UUFlowManager.getFlowVersion(flow, instance.flow_version);
|
|
947
|
+
const flowVersionSteps = flowVersion.steps;
|
|
948
|
+
|
|
949
|
+
for (const step of flowVersionSteps) {
|
|
950
|
+
if (step.always_enter_step === false) {
|
|
951
|
+
for (const line of step.lines) {
|
|
952
|
+
const toStepId = line.to_step;
|
|
953
|
+
rev_nextSteps.push(toStepId);
|
|
954
|
+
const toStep = await UUFlowManager.getStepFromSteps(flowVersionSteps, toStepId);
|
|
955
|
+
|
|
956
|
+
if (toStep?.step_type === "condition") {
|
|
957
|
+
for (const condLine of toStep.lines) {
|
|
958
|
+
rev_nextSteps.push(condLine.to_step);
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
return _.uniq(rev_nextSteps);
|
|
966
|
+
};
|
|
967
|
+
|
|
968
|
+
/**
|
|
969
|
+
* Get updated values from instance
|
|
970
|
+
* @param {Object} instance - Instance object
|
|
971
|
+
* @param {String} approve_id - Approve ID (optional)
|
|
972
|
+
* @returns {Object} Updated values
|
|
973
|
+
*/
|
|
974
|
+
UUFlowManager.getUpdatedValues = function (instance, approve_id) {
|
|
975
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
976
|
+
console.time('UUFlowManager.getUpdatedValues');
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
// Get the newest approve
|
|
980
|
+
let trace_approve = null;
|
|
981
|
+
|
|
982
|
+
for (const trace of instance.traces) {
|
|
983
|
+
if (trace.is_finished === false) {
|
|
984
|
+
if (approve_id) {
|
|
985
|
+
trace_approve = _.find(trace.approves, (approve) => approve._id === approve_id);
|
|
986
|
+
} else {
|
|
987
|
+
trace_approve = _.find(trace.approves, (approve) =>
|
|
988
|
+
approve.is_finished === false &&
|
|
989
|
+
approve.type !== 'cc' &&
|
|
990
|
+
approve.type !== 'distribute'
|
|
991
|
+
);
|
|
992
|
+
}
|
|
993
|
+
break;
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
// Get the newest values
|
|
998
|
+
let newest_values = null;
|
|
999
|
+
|
|
1000
|
+
if (!instance.values) {
|
|
1001
|
+
newest_values = trace_approve?.values;
|
|
1002
|
+
} else if (!trace_approve?.values) {
|
|
1003
|
+
newest_values = instance.values;
|
|
1004
|
+
} else {
|
|
1005
|
+
newest_values = _.extend(_.clone(instance.values), trace_approve.values);
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
1009
|
+
console.timeEnd('UUFlowManager.getUpdatedValues');
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
return newest_values;
|
|
1013
|
+
};
|
|
1014
|
+
|
|
1015
|
+
/**
|
|
1016
|
+
* Get form by ID
|
|
1017
|
+
* @param {String} form_id - Form ID
|
|
1018
|
+
* @param {Object} options - MongoDB find options
|
|
1019
|
+
* @returns {Object} Form object
|
|
1020
|
+
* @throws {Error} If form not found
|
|
1021
|
+
*/
|
|
1022
|
+
UUFlowManager.getForm = async function (form_id, options = {}) {
|
|
1023
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
1024
|
+
console.time('UUFlowManager.getForm');
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
const formsCollection = await getCollection('forms');
|
|
1028
|
+
const form = await formsCollection.findOne({_id: form_id}, options);
|
|
1029
|
+
|
|
1030
|
+
if (!form) {
|
|
1031
|
+
throw new Error('表单ID有误或此表单已经被删除');
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
1035
|
+
console.timeEnd('UUFlowManager.getForm');
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
return form;
|
|
1039
|
+
};
|
|
1040
|
+
|
|
1041
|
+
/**
|
|
1042
|
+
* Get form version
|
|
1043
|
+
* @param {Object} form - Form object
|
|
1044
|
+
* @param {String} form_version - Form version ID
|
|
1045
|
+
* @returns {Object} Form version object
|
|
1046
|
+
* @throws {Error} If version not found
|
|
1047
|
+
*/
|
|
1048
|
+
UUFlowManager.getFormVersion = function (form, form_version) {
|
|
1049
|
+
let form_v = null;
|
|
1050
|
+
|
|
1051
|
+
if (form_version === form.current._id) {
|
|
1052
|
+
form_v = form.current;
|
|
1053
|
+
} else {
|
|
1054
|
+
form_v = _.find(form.historys, (form_h) => form_version === form_h._id);
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
if (!form_v) {
|
|
1058
|
+
throw new Error('未找到表单对应的版本');
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
return form_v;
|
|
1062
|
+
};
|
|
1063
|
+
|
|
1064
|
+
////////////////////////////////
|
|
1065
|
+
|
|
1066
|
+
/**
|
|
1067
|
+
* Get category by ID
|
|
1068
|
+
* @param {String} category_id - Category ID
|
|
1069
|
+
* @param {Object} options - MongoDB find options
|
|
1070
|
+
* @returns {Object} Category object
|
|
1071
|
+
*/
|
|
1072
|
+
UUFlowManager.getCategory = async function (category_id, options = {}) {
|
|
1073
|
+
const categoriesCollection = await getCollection('categories');
|
|
1074
|
+
return await categoriesCollection.findOne({_id: category_id}, options);
|
|
1075
|
+
};
|
|
1076
|
+
|
|
1077
|
+
/**
|
|
1078
|
+
* Get instance name based on naming formula
|
|
1079
|
+
* @param {Object} instance - Instance object
|
|
1080
|
+
* @param {Object} vals - Form values (optional)
|
|
1081
|
+
* @returns {String} Instance name
|
|
1082
|
+
*/
|
|
1083
|
+
UUFlowManager.getInstanceName = async function (instance, vals) {
|
|
1084
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
1085
|
+
console.time('UUFlowManager.getInstanceName');
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
const default_value = `${instance.flow_name} ${instance.code}`.trim();
|
|
1089
|
+
const form_id = instance.form;
|
|
1090
|
+
const form_version = instance.form_version;
|
|
1091
|
+
|
|
1092
|
+
// Get form and form version
|
|
1093
|
+
const form = await UUFlowManager.getForm(form_id);
|
|
1094
|
+
const form_v = await UUFlowManager.getFormVersion(form, form_version);
|
|
1095
|
+
|
|
1096
|
+
// Return default name if no naming formula
|
|
1097
|
+
if (!form_v.name_forumla) {
|
|
1098
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
1099
|
+
console.timeEnd('UUFlowManager.getInstanceName');
|
|
1100
|
+
}
|
|
1101
|
+
return default_value;
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
// Prepare values for formula evaluation
|
|
1105
|
+
const values = _.clone(vals || instance.values) || {};
|
|
1106
|
+
const applicant = await WorkflowManager.getFormulaUserObject(instance.space, instance.applicant);
|
|
1107
|
+
|
|
1108
|
+
// Add standard fields to values
|
|
1109
|
+
values["applicant"] = applicant;
|
|
1110
|
+
values["applicant_name"] = instance.applicant_name;
|
|
1111
|
+
values["applicant_organization"] = instance.applicant_organization;
|
|
1112
|
+
values["applicant_organization_fullname"] = instance.applicant_organization_fullname;
|
|
1113
|
+
values["applicant_organization_name"] = instance.applicant_organization_name;
|
|
1114
|
+
values["submit_date"] = moment(instance.submit_date).utcOffset(0, false).format("YYYY-MM-DD");
|
|
1115
|
+
|
|
1116
|
+
// Process select fields to show labels instead of values
|
|
1117
|
+
if (form_v.fields) {
|
|
1118
|
+
for (const field of form_v.fields) {
|
|
1119
|
+
if (["select", "multiSelect", "radio"].includes(field.type)) {
|
|
1120
|
+
const fieldOptions = field.options?.split("\n").map((n) => {
|
|
1121
|
+
const itemSplits = n.split(":");
|
|
1122
|
+
return {
|
|
1123
|
+
label: itemSplits[0],
|
|
1124
|
+
value: itemSplits[1] || n
|
|
1125
|
+
};
|
|
1126
|
+
}) || [];
|
|
1127
|
+
|
|
1128
|
+
const value = values[field.code];
|
|
1129
|
+
switch (field.type) {
|
|
1130
|
+
case 'select':
|
|
1131
|
+
case 'radio':
|
|
1132
|
+
const selectedOption = fieldOptions.find((item) => item.value == value);
|
|
1133
|
+
if (selectedOption) {
|
|
1134
|
+
values[field.code] = selectedOption.label;
|
|
1135
|
+
}
|
|
1136
|
+
break;
|
|
1137
|
+
case 'multiSelect':
|
|
1138
|
+
const splitedValues = typeof value === 'string' ? value.split(",") : value;
|
|
1139
|
+
if (Array.isArray(splitedValues)) {
|
|
1140
|
+
const selectedOptions = fieldOptions.filter((item) => splitedValues.includes(item.value));
|
|
1141
|
+
if (selectedOptions.length) {
|
|
1142
|
+
values[field.code] = selectedOptions.map((item) => item.label).join(",");
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
break;
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
let rev = default_value;
|
|
1152
|
+
if (form_v.name_forumla) {
|
|
1153
|
+
try {
|
|
1154
|
+
// Prepare the formula script
|
|
1155
|
+
let iscript = form_v.name_forumla;
|
|
1156
|
+
if (iscript.includes("{applicant.")) {
|
|
1157
|
+
iscript = iscript.replace(/\{applicant./g, "(applicant.").replace(/\}/g, " || '')");
|
|
1158
|
+
}
|
|
1159
|
+
iscript = iscript.replace(/\{/g, "(values.").replace(/\}/g, " || '')");
|
|
1160
|
+
|
|
1161
|
+
// Create and evaluate the naming function
|
|
1162
|
+
const script = `module.exports = function (applicant, values, flow, form) { return ${iscript} }`;
|
|
1163
|
+
const func = _eval(script, "getInstanceName");
|
|
1164
|
+
rev = func(applicant, values, null, form) || default_value;
|
|
1165
|
+
|
|
1166
|
+
// Remove special characters from the name
|
|
1167
|
+
rev = rev.replace(/\?|\*|\:|\"|\<|\>|\\|\/|\|/g, "");
|
|
1168
|
+
} catch (error) {
|
|
1169
|
+
console.error('Error evaluating instance name formula:', error);
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
1174
|
+
console.timeEnd('UUFlowManager.getInstanceName');
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
return rev.trim();
|
|
1178
|
+
};
|
|
1179
|
+
|
|
1180
|
+
/**
|
|
1181
|
+
* Filter approve values based on permissions
|
|
1182
|
+
* @param {Object} approve_values - Approve values
|
|
1183
|
+
* @param {Object} permissions - Permissions object
|
|
1184
|
+
* @param {String} form_id - Form ID
|
|
1185
|
+
* @param {String} form_version - Form version ID
|
|
1186
|
+
* @returns {Object} Filtered approve values
|
|
1187
|
+
*/
|
|
1188
|
+
UUFlowManager.getApproveValues = async function (approve_values, permissions, form_id, form_version) {
|
|
1189
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
1190
|
+
console.time('UUFlowManager.getApproveValues');
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
// Return empty object if no permissions
|
|
1194
|
+
if (permissions === null) {
|
|
1195
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
1196
|
+
console.timeEnd('UUFlowManager.getApproveValues');
|
|
1197
|
+
}
|
|
1198
|
+
return {};
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
// Get form and form version
|
|
1202
|
+
const form = await UUFlowManager.getForm(form_id);
|
|
1203
|
+
const form_v = await UUFlowManager.getFormVersion(form, form_version);
|
|
1204
|
+
|
|
1205
|
+
// Filter fields based on permissions
|
|
1206
|
+
for (const field of form_v.fields || []) {
|
|
1207
|
+
if (field.type === "section") {
|
|
1208
|
+
// Handle section fields
|
|
1209
|
+
for (const sectionField of field.fields || []) {
|
|
1210
|
+
if (!sectionField.formula && (permissions[sectionField.code] === null || permissions[sectionField.code] !== "editable")) {
|
|
1211
|
+
delete approve_values[sectionField.code];
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
} else if (!field.formula && (permissions[field.code] === null || permissions[field.code] !== "editable")) {
|
|
1215
|
+
// Handle regular fields
|
|
1216
|
+
delete approve_values[field.code];
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
1221
|
+
console.timeEnd('UUFlowManager.getApproveValues');
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
return approve_values;
|
|
1225
|
+
};
|
|
1226
|
+
|
|
1227
|
+
/**
|
|
1228
|
+
* Main workflow engine function
|
|
1229
|
+
* @param {Object} approve_from_client - Approve data from client
|
|
1230
|
+
* @param {Object} current_user_info - Current user info
|
|
1231
|
+
* @param {String} current_user - Current user ID
|
|
1232
|
+
* @param {Boolean} auto_submitted - If the action was auto-submitted
|
|
1233
|
+
* @returns {Object} Updated instance
|
|
1234
|
+
*/
|
|
1235
|
+
UUFlowManager.workflow_engine = async function (approve_from_client, current_user_info, current_user, auto_submitted = false) {
|
|
1236
|
+
// Extract data from approve_from_client
|
|
1237
|
+
const {
|
|
1238
|
+
instance: instance_id,
|
|
1239
|
+
trace: trace_id,
|
|
1240
|
+
_id: approve_id,
|
|
1241
|
+
values = {},
|
|
1242
|
+
next_steps,
|
|
1243
|
+
judge,
|
|
1244
|
+
description,
|
|
1245
|
+
geolocation
|
|
1246
|
+
} = approve_from_client;
|
|
1247
|
+
|
|
1248
|
+
// Get instance, space, flow and related data
|
|
1249
|
+
const instance = await UUFlowManager.getInstance(instance_id);
|
|
1250
|
+
const space_id = instance.space;
|
|
1251
|
+
const flow_id = instance.flow;
|
|
1252
|
+
const space = await UUFlowManager.getSpace(space_id);
|
|
1253
|
+
const applicant_id = instance.applicant;
|
|
1254
|
+
const flow = await UUFlowManager.getFlow(flow_id);
|
|
1255
|
+
const space_user = await UUFlowManager.getSpaceUser(space_id, current_user);
|
|
1256
|
+
const space_user_org_info = await UUFlowManager.getSpaceUserOrgInfo(space_user);
|
|
1257
|
+
const trace = await UUFlowManager.getTrace(instance, trace_id);
|
|
1258
|
+
const approve = await UUFlowManager.getApprove(trace, approve_id);
|
|
1259
|
+
|
|
1260
|
+
// Validate instance state and permissions
|
|
1261
|
+
UUFlowManager.isTraceNotFinished(trace);
|
|
1262
|
+
UUFlowManager.isApproveNotFinished(approve);
|
|
1263
|
+
UUFlowManager.isInstancePending(instance);
|
|
1264
|
+
UUFlowManager.isHandlerOrAgent(approve, current_user);
|
|
1265
|
+
|
|
1266
|
+
// Get current step info
|
|
1267
|
+
const step = await UUFlowManager.getStep(instance, flow, trace.step);
|
|
1268
|
+
const step_type = step.step_type;
|
|
1269
|
+
const instance_trace = _.find(instance.traces, (t) => t._id === trace_id);
|
|
1270
|
+
const trace_approves = instance_trace.approves;
|
|
1271
|
+
|
|
1272
|
+
// Prepare update object for temporary save
|
|
1273
|
+
const setObj = {};
|
|
1274
|
+
let key_str = "";
|
|
1275
|
+
|
|
1276
|
+
// Find the approve to update
|
|
1277
|
+
for (let i = 0; i < trace_approves.length; i++) {
|
|
1278
|
+
if (trace_approves[i]._id === approve_id) {
|
|
1279
|
+
key_str = `traces.$.approves.${i}.`;
|
|
1280
|
+
setObj[`${key_str}geolocation`] = geolocation;
|
|
1281
|
+
|
|
1282
|
+
// Set judge and description based on step type
|
|
1283
|
+
if (["start", "submit"].includes(step_type)) {
|
|
1284
|
+
setObj[`${key_str}judge`] = "submitted";
|
|
1285
|
+
setObj[`${key_str}description`] = description;
|
|
1286
|
+
} else if (["sign", "counterSign"].includes(step_type)) {
|
|
1287
|
+
// For counterSign without judge, default to 'submitted'
|
|
1288
|
+
if (step_type === "counterSign" && !judge) {
|
|
1289
|
+
judge = 'submitted';
|
|
1290
|
+
}
|
|
1291
|
+
UUFlowManager.isJudgeLegal(judge);
|
|
1292
|
+
setObj[`${key_str}judge`] = judge;
|
|
1293
|
+
setObj[`${key_str}description`] = description;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
// Set common fields
|
|
1297
|
+
setObj[`${key_str}next_steps`] = next_steps;
|
|
1298
|
+
setObj[`${key_str}is_read`] = true;
|
|
1299
|
+
if (!trace_approves[i].read_date) {
|
|
1300
|
+
setObj[`${key_str}read_date`] = new Date();
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
// Filter approve values based on permissions
|
|
1304
|
+
setObj[`${key_str}values`] = await UUFlowManager.getApproveValues(
|
|
1305
|
+
values,
|
|
1306
|
+
step.permissions,
|
|
1307
|
+
instance.form,
|
|
1308
|
+
instance.form_version
|
|
1309
|
+
);
|
|
1310
|
+
|
|
1311
|
+
// Set modified info
|
|
1312
|
+
setObj.modified = new Date();
|
|
1313
|
+
setObj.modified_by = current_user;
|
|
1314
|
+
|
|
1315
|
+
// Update instance
|
|
1316
|
+
const instancesCollection = await getCollection('instances');
|
|
1317
|
+
await instancesCollection.updateOne(
|
|
1318
|
+
{ _id: instance_id, "traces._id": trace_id },
|
|
1319
|
+
{ $set: setObj }
|
|
1320
|
+
);
|
|
1321
|
+
|
|
1322
|
+
// Update instance tasks
|
|
1323
|
+
await update_instance_tasks(instance_id, trace_id, approve_id);
|
|
1324
|
+
break;
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
// Reload instance and revalidate after update
|
|
1329
|
+
const updatedInstance = await UUFlowManager.getInstance(instance_id);
|
|
1330
|
+
const updatedTrace = await UUFlowManager.getTrace(updatedInstance, trace_id);
|
|
1331
|
+
const updatedApprove = await UUFlowManager.getApprove(updatedTrace, approve_id);
|
|
1332
|
+
|
|
1333
|
+
UUFlowManager.isTraceNotFinished(updatedTrace);
|
|
1334
|
+
UUFlowManager.isApproveNotFinished(updatedApprove);
|
|
1335
|
+
UUFlowManager.isInstancePending(updatedInstance);
|
|
1336
|
+
UUFlowManager.isHandlerOrAgent(updatedApprove, current_user);
|
|
1337
|
+
|
|
1338
|
+
// Prepare final update object
|
|
1339
|
+
const updateObj = { $set: {} };
|
|
1340
|
+
|
|
1341
|
+
// Validate next steps
|
|
1342
|
+
if (!next_steps || next_steps.length === 0) {
|
|
1343
|
+
throw new Error('还未指定下一步和处理人,操作失败');
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
if (next_steps.length > 1) {
|
|
1347
|
+
throw new Error('不能指定多个后续步骤');
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
// Validate next step users
|
|
1351
|
+
for (const next_step_user of next_steps[0].users || []) {
|
|
1352
|
+
await UUFlowManager.getSpaceUser(space_id, next_step_user);
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
// Handle different step types
|
|
1356
|
+
if (["start", "submit", "condition"].includes(step_type)) {
|
|
1357
|
+
Object.assign(updateObj, await UUFlowManager.engine_step_type_is_start_or_submit_or_condition(
|
|
1358
|
+
instance_id, trace_id, approve_id, next_steps,
|
|
1359
|
+
space_user_org_info, judge, updatedInstance, flow, step,
|
|
1360
|
+
current_user, current_user_info, auto_submitted
|
|
1361
|
+
));
|
|
1362
|
+
} else if (step_type === "sign") {
|
|
1363
|
+
Object.assign(updateObj, await UUFlowManager.engine_step_type_is_sign(
|
|
1364
|
+
instance_id, trace_id, approve_id, next_steps,
|
|
1365
|
+
space_user_org_info, judge, updatedInstance, flow, step,
|
|
1366
|
+
current_user, current_user_info, description, auto_submitted
|
|
1367
|
+
));
|
|
1368
|
+
} else if (step_type === "counterSign") {
|
|
1369
|
+
Object.assign(updateObj, await UUFlowManager.engine_step_type_is_counterSign(
|
|
1370
|
+
instance_id, trace_id, approve_id, next_steps,
|
|
1371
|
+
space_user_org_info, judge, updatedInstance, flow, step,
|
|
1372
|
+
current_user, current_user_info, auto_submitted
|
|
1373
|
+
));
|
|
1374
|
+
} else if (step_type === "end") {
|
|
1375
|
+
throw new Error('end结点出现approve,服务器错误');
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
// Calculate keywords and extras
|
|
1379
|
+
const form = await UUFlowManager.getForm(updatedInstance.form);
|
|
1380
|
+
updateObj.$set.keywords = await UUFlowManager.caculateKeywords(updateObj.$set.values, form, updatedInstance.form_version);
|
|
1381
|
+
updateObj.$set.extras = await UUFlowManager.caculateExtras(updateObj.$set.values, form, updatedInstance.form_version);
|
|
1382
|
+
|
|
1383
|
+
// Update instance
|
|
1384
|
+
const instancesCollection = await getCollection('instances');
|
|
1385
|
+
await instancesCollection.updateOne({ _id: instance_id }, updateObj);
|
|
1386
|
+
|
|
1387
|
+
// Insert new instance tasks if needed
|
|
1388
|
+
if (updateObj.$push?.traces?.approves) {
|
|
1389
|
+
const newTrace = updateObj.$push.traces;
|
|
1390
|
+
const approveIds = newTrace.approves.map(a => a._id);
|
|
1391
|
+
await insert_many_instance_tasks(instance_id, newTrace._id, approveIds);
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
// Get final updated instance
|
|
1395
|
+
const finalInstance = await UUFlowManager.getInstance(instance_id);
|
|
1396
|
+
const finalInstanceTrace = _.find(finalInstance.traces, t => t._id === trace_id);
|
|
1397
|
+
const next_step_id = next_steps[0].step;
|
|
1398
|
+
const next_step = await UUFlowManager.getStep(finalInstance, flow, next_step_id);
|
|
1399
|
+
const next_step_type = next_step.step_type;
|
|
1400
|
+
|
|
1401
|
+
// Send notifications based on instance state
|
|
1402
|
+
if (finalInstance.state === "completed") {
|
|
1403
|
+
if (finalInstance.final_decision === "approved") {
|
|
1404
|
+
await pushManager.send_instance_notification("approved_completed_applicant", finalInstance, description, current_user_info);
|
|
1405
|
+
} else if (finalInstance.final_decision === "rejected") {
|
|
1406
|
+
await pushManager.send_instance_notification("rejected_completed_applicant", finalInstance, description, current_user_info);
|
|
1407
|
+
} else {
|
|
1408
|
+
await pushManager.send_instance_notification("submit_completed_applicant", finalInstance, description, current_user_info);
|
|
1409
|
+
}
|
|
1410
|
+
} else if (finalInstance.state === "pending") {
|
|
1411
|
+
if (finalInstanceTrace.judge === "rejected" && finalInstanceTrace.is_finished === true) {
|
|
1412
|
+
if (next_step_type === 'start') {
|
|
1413
|
+
await pushManager.send_instance_notification("submit_pending_rejected_applicant_inbox", finalInstance, description, current_user_info);
|
|
1414
|
+
} else {
|
|
1415
|
+
await pushManager.send_instance_notification("submit_pending_rejected_applicant", finalInstance, description, current_user_info);
|
|
1416
|
+
await pushManager.send_instance_notification("submit_pending_rejected_inbox", finalInstance, description, current_user_info);
|
|
1417
|
+
}
|
|
1418
|
+
} else if (!finalInstanceTrace.is_finished) {
|
|
1419
|
+
// Do nothing for unfinished traces
|
|
1420
|
+
} else {
|
|
1421
|
+
await pushManager.send_instance_notification("submit_pending_inbox", finalInstance, description, current_user_info);
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
// Send message to current user and trigger webhook
|
|
1426
|
+
await pushManager.send_message_current_user(current_user_info);
|
|
1427
|
+
|
|
1428
|
+
let to_users = finalInstance.inbox_users;
|
|
1429
|
+
const last_trace = _.last(finalInstance.traces);
|
|
1430
|
+
const last_step = await UUFlowManager.getStep(finalInstance, flow, last_trace.step);
|
|
1431
|
+
|
|
1432
|
+
if (last_step.step_type === "counterSign" && _.where(last_trace.approves, { is_finished: true }).length > 0) {
|
|
1433
|
+
to_users = [];
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
await pushManager.triggerWebhook(flow_id, finalInstance, approve_from_client, 'engine_submit', current_user, to_users);
|
|
1437
|
+
await UUFlowManager.distributedInstancesRemind(finalInstance);
|
|
1438
|
+
|
|
1439
|
+
return finalInstance;
|
|
1440
|
+
};
|
|
1441
|
+
|
|
1442
|
+
/**
|
|
1443
|
+
* Handle workflow engine for start/submit/condition steps
|
|
1444
|
+
* @param {String} instance_id - Instance ID
|
|
1445
|
+
* @param {String} trace_id - Trace ID
|
|
1446
|
+
* @param {String} approve_id - Approve ID
|
|
1447
|
+
* @param {Array} next_steps - Next steps data
|
|
1448
|
+
* @param {Object} space_user_org_info - Space user org info
|
|
1449
|
+
* @param {String} judge - Judge value
|
|
1450
|
+
* @param {Object} instance - Instance object
|
|
1451
|
+
* @param {Object} flow - Flow object
|
|
1452
|
+
* @param {Object} step - Current step object
|
|
1453
|
+
* @param {String} current_user - Current user ID
|
|
1454
|
+
* @param {Object} current_user_info - Current user info
|
|
1455
|
+
* @param {Boolean} auto_submitted - If auto-submitted
|
|
1456
|
+
* @returns {Object} Update object
|
|
1457
|
+
*/
|
|
1458
|
+
UUFlowManager.engine_step_type_is_start_or_submit_or_condition = async function (
|
|
1459
|
+
instance_id, trace_id, approve_id, next_steps,
|
|
1460
|
+
space_user_org_info, judge, instance, flow, step,
|
|
1461
|
+
current_user, current_user_info, auto_submitted
|
|
1462
|
+
) {
|
|
1463
|
+
const setObj = {};
|
|
1464
|
+
const updateObj = {};
|
|
1465
|
+
const setTraceObj = {};
|
|
1466
|
+
const space_id = instance.space;
|
|
1467
|
+
|
|
1468
|
+
// Validate next steps
|
|
1469
|
+
const nextSteps = await UUFlowManager.getNextSteps(instance, flow, step, "");
|
|
1470
|
+
for (const approve_next_step of next_steps) {
|
|
1471
|
+
if (!nextSteps.includes(approve_next_step.step)) {
|
|
1472
|
+
throw new Error(`approve中next_steps.step:${approve_next_step.step} 不合法`);
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
// Get next step info
|
|
1477
|
+
const next_step_id = next_steps[0].step;
|
|
1478
|
+
const next_step = await UUFlowManager.getStep(instance, flow, next_step_id);
|
|
1479
|
+
const next_step_type = next_step.step_type;
|
|
1480
|
+
const next_step_name = next_step.name;
|
|
1481
|
+
|
|
1482
|
+
// Handle end step
|
|
1483
|
+
if (next_step_type === "end") {
|
|
1484
|
+
const instance_traces = instance.traces;
|
|
1485
|
+
|
|
1486
|
+
// Update current trace and approve
|
|
1487
|
+
for (let i = 0; i < instance_traces.length; i++) {
|
|
1488
|
+
if (instance_traces[i]._id === trace_id) {
|
|
1489
|
+
setTraceObj[`traces.${i}.is_finished`] = true;
|
|
1490
|
+
setTraceObj[`traces.${i}.finish_date`] = new Date();
|
|
1491
|
+
setTraceObj[`traces.${i}.judge`] = judge;
|
|
1492
|
+
|
|
1493
|
+
for (let h = 0; h < instance_traces[i].approves.length; h++) {
|
|
1494
|
+
if (instance_traces[i].approves[h]._id === approve_id) {
|
|
1495
|
+
const approveFinishDate = new Date();
|
|
1496
|
+
setTraceObj[`traces.${i}.approves.${h}.is_finished`] = true;
|
|
1497
|
+
setTraceObj[`traces.${i}.approves.${h}.handler`] = current_user;
|
|
1498
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_name`] = current_user_info.name;
|
|
1499
|
+
setTraceObj[`traces.${i}.approves.${h}.finish_date`] = approveFinishDate;
|
|
1500
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_organization`] = space_user_org_info.organization;
|
|
1501
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_organization_name`] = space_user_org_info.organization_name;
|
|
1502
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_organization_fullname`] = space_user_org_info.organization_fullname;
|
|
1503
|
+
setTraceObj[`traces.${i}.approves.${h}.cost_time`] = approveFinishDate - instance_traces[i].approves[h].start_date;
|
|
1504
|
+
setTraceObj[`traces.${i}.approves.${h}.auto_submitted`] = auto_submitted;
|
|
1505
|
+
break;
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
break;
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
// Create new trace for end step
|
|
1513
|
+
const newTrace = {
|
|
1514
|
+
_id: _makeNewID(),
|
|
1515
|
+
instance: instance_id,
|
|
1516
|
+
previous_trace_ids: [trace_id],
|
|
1517
|
+
is_finished: true,
|
|
1518
|
+
step: next_step_id,
|
|
1519
|
+
name: next_step_name,
|
|
1520
|
+
start_date: new Date(),
|
|
1521
|
+
finish_date: new Date()
|
|
1522
|
+
};
|
|
1523
|
+
|
|
1524
|
+
// Prepare instance update
|
|
1525
|
+
setObj.state = "completed";
|
|
1526
|
+
setObj.modified = new Date();
|
|
1527
|
+
setObj.modified_by = current_user;
|
|
1528
|
+
setObj.values = await UUFlowManager.getUpdatedValues(instance);
|
|
1529
|
+
setObj.name = await UUFlowManager.getInstanceName(instance);
|
|
1530
|
+
|
|
1531
|
+
const instance_trace = _.find(instance.traces, t => t._id === trace_id);
|
|
1532
|
+
const trace_approve = _.find(instance_trace.approves, a => a._id === approve_id);
|
|
1533
|
+
|
|
1534
|
+
updateObj.$addToSet = {
|
|
1535
|
+
outbox_users: {
|
|
1536
|
+
$each: [trace_approve.handler, trace_approve.user]
|
|
1537
|
+
}
|
|
1538
|
+
};
|
|
1539
|
+
updateObj.$push = { traces: newTrace };
|
|
1540
|
+
|
|
1541
|
+
setObj.inbox_users = [];
|
|
1542
|
+
setObj.finish_date = new Date();
|
|
1543
|
+
setObj.current_step_name = next_step_name;
|
|
1544
|
+
setObj.final_decision = 'approved';
|
|
1545
|
+
setObj.current_step_auto_submit = false;
|
|
1546
|
+
} else {
|
|
1547
|
+
// Handle non-end steps
|
|
1548
|
+
const next_step_users = next_steps[0].users;
|
|
1549
|
+
|
|
1550
|
+
if (!next_step_users || next_step_users.length === 0) {
|
|
1551
|
+
throw new Error("未指定下一步处理人");
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
if (next_step_users.length > 1 && next_step.step_type !== "counterSign") {
|
|
1555
|
+
throw new Error("不能指定多个处理人");
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
// Validate next users
|
|
1559
|
+
const next_user_ids = await HandlersManager.getHandlers(instance_id, next_step_id, current_user);
|
|
1560
|
+
if (!UUFlowManager.checkNestStepUsersIsValid(next_step_users, next_user_ids, next_step)) {
|
|
1561
|
+
throw new Error("指定的下一步处理人有误");
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
// Update current trace and approve
|
|
1565
|
+
const instance_traces = instance.traces;
|
|
1566
|
+
for (let i = 0; i < instance_traces.length; i++) {
|
|
1567
|
+
if (instance_traces[i]._id === trace_id) {
|
|
1568
|
+
setTraceObj[`traces.${i}.is_finished`] = true;
|
|
1569
|
+
setTraceObj[`traces.${i}.finish_date`] = new Date();
|
|
1570
|
+
setTraceObj[`traces.${i}.judge`] = judge;
|
|
1571
|
+
|
|
1572
|
+
for (let h = 0; h < instance_traces[i].approves.length; h++) {
|
|
1573
|
+
if (instance_traces[i].approves[h]._id === approve_id) {
|
|
1574
|
+
const approveFinishDate = new Date();
|
|
1575
|
+
setTraceObj[`traces.${i}.approves.${h}.is_finished`] = true;
|
|
1576
|
+
setTraceObj[`traces.${i}.approves.${h}.handler`] = current_user;
|
|
1577
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_name`] = current_user_info.name;
|
|
1578
|
+
setTraceObj[`traces.${i}.approves.${h}.finish_date`] = approveFinishDate;
|
|
1579
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_organization`] = space_user_org_info.organization;
|
|
1580
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_organization_name`] = space_user_org_info.organization_name;
|
|
1581
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_organization_fullname`] = space_user_org_info.organization_fullname;
|
|
1582
|
+
setTraceObj[`traces.${i}.approves.${h}.cost_time`] = approveFinishDate - instance_traces[i].approves[h].start_date;
|
|
1583
|
+
setTraceObj[`traces.${i}.approves.${h}.auto_submitted`] = auto_submitted;
|
|
1584
|
+
break;
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
break;
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
// Create new trace for next step
|
|
1592
|
+
const newTrace = {
|
|
1593
|
+
_id: _makeNewID(),
|
|
1594
|
+
instance: instance_id,
|
|
1595
|
+
previous_trace_ids: [trace_id],
|
|
1596
|
+
is_finished: false,
|
|
1597
|
+
step: next_step_id,
|
|
1598
|
+
name: next_step_name,
|
|
1599
|
+
start_date: new Date(),
|
|
1600
|
+
due_date: UUFlowManager.getDueDate(next_step.timeout_hours, space_id),
|
|
1601
|
+
approves: []
|
|
1602
|
+
};
|
|
1603
|
+
|
|
1604
|
+
// Add approves for next step users
|
|
1605
|
+
const updated_values = await UUFlowManager.getUpdatedValues(instance);
|
|
1606
|
+
const usersCollection = await getCollection('users');
|
|
1607
|
+
const spaceUsersCollection = await getCollection('space_users');
|
|
1608
|
+
|
|
1609
|
+
for (let idx = 0; idx < next_step_users.length; idx++) {
|
|
1610
|
+
const next_step_user_id = next_step_users[idx];
|
|
1611
|
+
const user_info = await usersCollection.findOne(
|
|
1612
|
+
{ _id: next_step_user_id },
|
|
1613
|
+
{ projection: { name: 1 } }
|
|
1614
|
+
);
|
|
1615
|
+
|
|
1616
|
+
const newApprove = {
|
|
1617
|
+
_id: _makeNewID(),
|
|
1618
|
+
instance: instance_id,
|
|
1619
|
+
trace: newTrace._id,
|
|
1620
|
+
is_finished: false,
|
|
1621
|
+
user: next_step_user_id,
|
|
1622
|
+
user_name: user_info.name
|
|
1623
|
+
};
|
|
1624
|
+
|
|
1625
|
+
// Check for agent
|
|
1626
|
+
let handler_id = next_step_user_id;
|
|
1627
|
+
let handler_info = user_info;
|
|
1628
|
+
const agent = await UUFlowManager.getAgent(space_id, next_step_user_id);
|
|
1629
|
+
|
|
1630
|
+
if (agent) {
|
|
1631
|
+
next_step_users[idx] = agent;
|
|
1632
|
+
handler_id = agent;
|
|
1633
|
+
handler_info = await usersCollection.findOne(
|
|
1634
|
+
{ _id: agent },
|
|
1635
|
+
{ projection: { name: 1 } }
|
|
1636
|
+
);
|
|
1637
|
+
newApprove.agent = agent;
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
newApprove.handler = handler_id;
|
|
1641
|
+
newApprove.handler_name = handler_info.name;
|
|
1642
|
+
|
|
1643
|
+
const next_step_space_user = await spaceUsersCollection.findOne({
|
|
1644
|
+
space: space_id,
|
|
1645
|
+
user: handler_id
|
|
1646
|
+
});
|
|
1647
|
+
|
|
1648
|
+
const next_step_user_org_info = await UUFlowManager.getSpaceUserOrgInfo(next_step_space_user);
|
|
1649
|
+
|
|
1650
|
+
newApprove.handler_organization = next_step_user_org_info.organization;
|
|
1651
|
+
newApprove.handler_organization_name = next_step_user_org_info.organization_name;
|
|
1652
|
+
newApprove.handler_organization_fullname = next_step_user_org_info.organization_fullname;
|
|
1653
|
+
newApprove.start_date = new Date();
|
|
1654
|
+
newApprove.due_date = newTrace.due_date;
|
|
1655
|
+
newApprove.is_read = false;
|
|
1656
|
+
newApprove.is_error = false;
|
|
1657
|
+
newApprove.values = {};
|
|
1658
|
+
|
|
1659
|
+
UUFlowManager.setRemindInfo(updated_values, newApprove);
|
|
1660
|
+
newTrace.approves.push(newApprove);
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
// Prepare instance update
|
|
1664
|
+
setObj.state = "pending";
|
|
1665
|
+
setObj.modified = new Date();
|
|
1666
|
+
setObj.modified_by = current_user;
|
|
1667
|
+
setObj.values = updated_values;
|
|
1668
|
+
setObj.name = await UUFlowManager.getInstanceName(instance);
|
|
1669
|
+
|
|
1670
|
+
const instance_trace = _.find(instance.traces, t => t._id === trace_id);
|
|
1671
|
+
const trace_approve = _.find(instance_trace.approves, a => a._id === approve_id);
|
|
1672
|
+
|
|
1673
|
+
updateObj.$addToSet = {
|
|
1674
|
+
outbox_users: {
|
|
1675
|
+
$each: [trace_approve.handler, trace_approve.user]
|
|
1676
|
+
}
|
|
1677
|
+
};
|
|
1678
|
+
|
|
1679
|
+
setObj.inbox_users = next_step_users;
|
|
1680
|
+
updateObj.$push = { traces: newTrace };
|
|
1681
|
+
setObj.current_step_name = next_step_name;
|
|
1682
|
+
setObj.current_step_auto_submit = await UUFlowManager.getCurrentStepAutoSubmit(flow.timeout_auto_submit, next_step.lines);
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
// Apply trace updates
|
|
1686
|
+
const instancesCollection = await getCollection('instances');
|
|
1687
|
+
await instancesCollection.updateOne(
|
|
1688
|
+
{ _id: instance_id },
|
|
1689
|
+
{ $set: setTraceObj }
|
|
1690
|
+
);
|
|
1691
|
+
|
|
1692
|
+
// Update instance tasks
|
|
1693
|
+
await update_instance_tasks(instance_id, trace_id, approve_id);
|
|
1694
|
+
|
|
1695
|
+
// Combine all updates
|
|
1696
|
+
updateObj.$set = setObj;
|
|
1697
|
+
return updateObj;
|
|
1698
|
+
};
|
|
1699
|
+
|
|
1700
|
+
/////////////
|
|
1701
|
+
UUFlowManager.engine_step_type_is_sign = async function (
|
|
1702
|
+
instance_id,
|
|
1703
|
+
trace_id,
|
|
1704
|
+
approve_id,
|
|
1705
|
+
next_steps,
|
|
1706
|
+
space_user_org_info,
|
|
1707
|
+
judge,
|
|
1708
|
+
instance,
|
|
1709
|
+
flow,
|
|
1710
|
+
step,
|
|
1711
|
+
current_user,
|
|
1712
|
+
current_user_info,
|
|
1713
|
+
description,
|
|
1714
|
+
auto_submitted
|
|
1715
|
+
) {
|
|
1716
|
+
const db = {
|
|
1717
|
+
instances: await getCollection('instances'),
|
|
1718
|
+
users: await getCollection('users'),
|
|
1719
|
+
space_users: await getCollection('space_users')
|
|
1720
|
+
};
|
|
1721
|
+
|
|
1722
|
+
let updateObj = {};
|
|
1723
|
+
let setObj = {};
|
|
1724
|
+
let setTraceObj = {};
|
|
1725
|
+
const space_id = instance.space;
|
|
1726
|
+
|
|
1727
|
+
// 验证approve的judge是否为空
|
|
1728
|
+
if (!judge) {
|
|
1729
|
+
throw new Error('单签结点还未选择处理意见,操作失败');
|
|
1730
|
+
}
|
|
1731
|
+
|
|
1732
|
+
if (judge === "approved") {
|
|
1733
|
+
// 验证next_steps.step是否合法,判断next_steps.step是否在其中
|
|
1734
|
+
const nextSteps = await UUFlowManager.getNextSteps(instance, flow, step, "approved");
|
|
1735
|
+
|
|
1736
|
+
// 判断next_steps.step是否在nextSteps中,若不在则不合法
|
|
1737
|
+
next_steps.forEach(approve_next_step => {
|
|
1738
|
+
if (!nextSteps.includes(approve_next_step["step"])) {
|
|
1739
|
+
throw new Error('指定的下一步有误');
|
|
1740
|
+
}
|
|
1741
|
+
});
|
|
1742
|
+
|
|
1743
|
+
// 若合法,执行流转
|
|
1744
|
+
const next_step_id = next_steps[0]["step"];
|
|
1745
|
+
const next_step = await UUFlowManager.getStep(instance, flow, next_step_id);
|
|
1746
|
+
const next_step_type = next_step["step_type"];
|
|
1747
|
+
const next_step_name = next_step["name"];
|
|
1748
|
+
|
|
1749
|
+
// 判断next_step是否为结束结点
|
|
1750
|
+
if (next_step_type === "end") {
|
|
1751
|
+
// 若是结束结点
|
|
1752
|
+
const instance_traces = instance.traces;
|
|
1753
|
+
|
|
1754
|
+
for (let i = 0; i < instance_traces.length; i++) {
|
|
1755
|
+
if (instance_traces[i]._id === trace_id) {
|
|
1756
|
+
// 更新当前trace记录
|
|
1757
|
+
setTraceObj[`traces.${i}.is_finished`] = true;
|
|
1758
|
+
setTraceObj[`traces.${i}.finish_date`] = new Date();
|
|
1759
|
+
setTraceObj[`traces.${i}.judge`] = judge;
|
|
1760
|
+
|
|
1761
|
+
for (let h = 0; h < instance_traces[i].approves.length; h++) {
|
|
1762
|
+
if (instance_traces[i].approves[h]._id === approve_id) {
|
|
1763
|
+
// 更新当前trace.approve记录
|
|
1764
|
+
const approveFinishDate = new Date();
|
|
1765
|
+
setTraceObj[`traces.${i}.approves.${h}.is_finished`] = true;
|
|
1766
|
+
setTraceObj[`traces.${i}.approves.${h}.handler`] = current_user;
|
|
1767
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_name`] = current_user_info.name;
|
|
1768
|
+
setTraceObj[`traces.${i}.approves.${h}.finish_date`] = approveFinishDate;
|
|
1769
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_organization`] = space_user_org_info["organization"];
|
|
1770
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_organization_name`] = space_user_org_info["organization_name"];
|
|
1771
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_organization_fullname`] = space_user_org_info["organization_fullname"];
|
|
1772
|
+
setTraceObj[`traces.${i}.approves.${h}.cost_time`] = approveFinishDate - instance_traces[i].approves[h].start_date;
|
|
1773
|
+
setTraceObj[`traces.${i}.approves.${h}.auto_submitted`] = auto_submitted;
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
// 插入下一步trace记录
|
|
1780
|
+
const newTrace = {
|
|
1781
|
+
_id: _makeNewID(),
|
|
1782
|
+
instance: instance_id,
|
|
1783
|
+
previous_trace_ids: [trace_id],
|
|
1784
|
+
is_finished: true,
|
|
1785
|
+
step: next_step_id,
|
|
1786
|
+
name: next_step_name,
|
|
1787
|
+
start_date: new Date(),
|
|
1788
|
+
finish_date: new Date()
|
|
1789
|
+
};
|
|
1790
|
+
|
|
1791
|
+
// 更新instance记录
|
|
1792
|
+
setObj.state = "completed";
|
|
1793
|
+
setObj.final_decision = judge;
|
|
1794
|
+
setObj.modified = new Date();
|
|
1795
|
+
setObj.modified_by = current_user;
|
|
1796
|
+
setObj.values = await UUFlowManager.getUpdatedValues(instance);
|
|
1797
|
+
instance.values = setObj.values;
|
|
1798
|
+
setObj.name = await UUFlowManager.getInstanceName(instance);
|
|
1799
|
+
|
|
1800
|
+
const instance_trace = instance_traces.find(trace => trace._id === trace_id);
|
|
1801
|
+
const trace_approve = instance_trace.approves.find(approve => approve._id === approve_id);
|
|
1802
|
+
|
|
1803
|
+
updateObj.$addToSet = {
|
|
1804
|
+
outbox_users: {
|
|
1805
|
+
$each: [trace_approve.handler, trace_approve.user]
|
|
1806
|
+
}
|
|
1807
|
+
};
|
|
1808
|
+
|
|
1809
|
+
updateObj.$push = {
|
|
1810
|
+
traces: newTrace
|
|
1811
|
+
};
|
|
1812
|
+
|
|
1813
|
+
setObj.inbox_users = [];
|
|
1814
|
+
setObj.finish_date = new Date();
|
|
1815
|
+
setObj.current_step_name = next_step_name;
|
|
1816
|
+
setObj.current_step_auto_submit = false;
|
|
1817
|
+
} else {
|
|
1818
|
+
// 若不是结束结点
|
|
1819
|
+
// 先判断nextsteps.step.users是否为空
|
|
1820
|
+
const next_step_users = next_steps[0]["users"];
|
|
1821
|
+
|
|
1822
|
+
if (!next_step_users || next_step_users.length === 0) {
|
|
1823
|
+
throw new Error('未指定下一步处理人');
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
if (next_step_users.length > 1 && next_step["step_type"] !== "counterSign") {
|
|
1827
|
+
throw new Error('不能指定多个处理人');
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
// 验证next_user是否合法
|
|
1831
|
+
const next_user_ids = await HandlersManager.getHandlers(instance_id, next_step_id, current_user);
|
|
1832
|
+
|
|
1833
|
+
if (!UUFlowManager.checkNestStepUsersIsValid(next_step_users, next_user_ids, next_step)) {
|
|
1834
|
+
throw new Error('指定的下一步处理人有误');
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
// 若合法,执行流转操作
|
|
1838
|
+
const instance_traces = instance.traces;
|
|
1839
|
+
|
|
1840
|
+
for (let i = 0; i < instance_traces.length; i++) {
|
|
1841
|
+
if (instance_traces[i]._id === trace_id) {
|
|
1842
|
+
// 更新当前trace记录
|
|
1843
|
+
setTraceObj[`traces.${i}.is_finished`] = true;
|
|
1844
|
+
setTraceObj[`traces.${i}.finish_date`] = new Date();
|
|
1845
|
+
setTraceObj[`traces.${i}.judge`] = judge;
|
|
1846
|
+
|
|
1847
|
+
for (let h = 0; h < instance_traces[i].approves.length; h++) {
|
|
1848
|
+
if (instance_traces[i].approves[h]._id === approve_id) {
|
|
1849
|
+
// 更新当前trace.approve记录
|
|
1850
|
+
const approveFinishDate = new Date();
|
|
1851
|
+
setTraceObj[`traces.${i}.approves.${h}.is_finished`] = true;
|
|
1852
|
+
setTraceObj[`traces.${i}.approves.${h}.handler`] = current_user;
|
|
1853
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_name`] = current_user_info.name;
|
|
1854
|
+
setTraceObj[`traces.${i}.approves.${h}.finish_date`] = approveFinishDate;
|
|
1855
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_organization`] = space_user_org_info["organization"];
|
|
1856
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_organization_name`] = space_user_org_info["organization_name"];
|
|
1857
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_organization_fullname`] = space_user_org_info["organization_fullname"];
|
|
1858
|
+
setTraceObj[`traces.${i}.approves.${h}.cost_time`] = approveFinishDate - instance_traces[i].approves[h].start_date;
|
|
1859
|
+
setTraceObj[`traces.${i}.approves.${h}.auto_submitted`] = auto_submitted;
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
// 插入下一步trace记录
|
|
1866
|
+
const newTrace = {
|
|
1867
|
+
_id: _makeNewID(),
|
|
1868
|
+
instance: instance_id,
|
|
1869
|
+
previous_trace_ids: [trace_id],
|
|
1870
|
+
is_finished: false,
|
|
1871
|
+
step: next_step_id,
|
|
1872
|
+
name: next_step_name,
|
|
1873
|
+
start_date: new Date(),
|
|
1874
|
+
due_date: UUFlowManager.getDueDate(next_step.timeout_hours, space_id),
|
|
1875
|
+
approves: []
|
|
1876
|
+
};
|
|
1877
|
+
|
|
1878
|
+
const updated_values = await UUFlowManager.getUpdatedValues(instance);
|
|
1879
|
+
|
|
1880
|
+
for (let idx = 0; idx < next_step_users.length; idx++) {
|
|
1881
|
+
const next_step_user_id = next_step_users[idx];
|
|
1882
|
+
// 插入下一步trace.approve记录
|
|
1883
|
+
const newApprove = {
|
|
1884
|
+
_id: _makeNewID(),
|
|
1885
|
+
instance: instance_id,
|
|
1886
|
+
trace: newTrace._id,
|
|
1887
|
+
is_finished: false,
|
|
1888
|
+
user: next_step_user_id
|
|
1889
|
+
};
|
|
1890
|
+
|
|
1891
|
+
const user_info = await db.users.findOne(
|
|
1892
|
+
{ _id: next_step_user_id },
|
|
1893
|
+
{ fields: { name: 1 } }
|
|
1894
|
+
);
|
|
1895
|
+
|
|
1896
|
+
newApprove.user_name = user_info.name;
|
|
1897
|
+
let handler_id = next_step_user_id;
|
|
1898
|
+
let handler_info = user_info;
|
|
1899
|
+
|
|
1900
|
+
const agent = await UUFlowManager.getAgent(space_id, next_step_user_id);
|
|
1901
|
+
if (agent) {
|
|
1902
|
+
next_step_users[idx] = agent;
|
|
1903
|
+
handler_id = agent;
|
|
1904
|
+
handler_info = await db.users.findOne(
|
|
1905
|
+
{ _id: agent },
|
|
1906
|
+
{ fields: { name: 1 } }
|
|
1907
|
+
);
|
|
1908
|
+
newApprove.agent = agent;
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
newApprove.handler = handler_id;
|
|
1912
|
+
newApprove.handler_name = handler_info.name;
|
|
1913
|
+
|
|
1914
|
+
const next_step_space_user = await db.space_users.findOne({
|
|
1915
|
+
space: space_id,
|
|
1916
|
+
user: handler_id
|
|
1917
|
+
});
|
|
1918
|
+
|
|
1919
|
+
// 获取next_step_user所在的部门信息
|
|
1920
|
+
const next_step_user_org_info = await UUFlowManager.getSpaceUserOrgInfo(next_step_space_user);
|
|
1921
|
+
newApprove.handler_organization = next_step_user_org_info["organization"];
|
|
1922
|
+
newApprove.handler_organization_name = next_step_user_org_info["organization_name"];
|
|
1923
|
+
newApprove.handler_organization_fullname = next_step_user_org_info["organization_fullname"];
|
|
1924
|
+
newApprove.start_date = new Date();
|
|
1925
|
+
newApprove.due_date = newTrace.due_date;
|
|
1926
|
+
newApprove.is_read = false;
|
|
1927
|
+
newApprove.is_error = false;
|
|
1928
|
+
newApprove.values = {};
|
|
1929
|
+
|
|
1930
|
+
UUFlowManager.setRemindInfo(updated_values, newApprove);
|
|
1931
|
+
newTrace.approves.push(newApprove);
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1934
|
+
// 更新instance记录
|
|
1935
|
+
setObj.final_decision = judge;
|
|
1936
|
+
setObj.modified = new Date();
|
|
1937
|
+
setObj.modified_by = current_user;
|
|
1938
|
+
setObj.values = updated_values;
|
|
1939
|
+
instance.values = setObj.values;
|
|
1940
|
+
setObj.name = await UUFlowManager.getInstanceName(instance);
|
|
1941
|
+
|
|
1942
|
+
const instance_trace = instance_traces.find(trace => trace._id === trace_id);
|
|
1943
|
+
const trace_approve = instance_trace.approves.find(approve => approve._id === approve_id);
|
|
1944
|
+
|
|
1945
|
+
setObj.inbox_users = next_step_users;
|
|
1946
|
+
updateObj.$addToSet = {
|
|
1947
|
+
outbox_users: {
|
|
1948
|
+
$each: [trace_approve.handler, trace_approve.user]
|
|
1949
|
+
}
|
|
1950
|
+
};
|
|
1951
|
+
|
|
1952
|
+
updateObj.$push = {
|
|
1953
|
+
traces: newTrace
|
|
1954
|
+
};
|
|
1955
|
+
|
|
1956
|
+
setObj.state = "pending";
|
|
1957
|
+
setObj.current_step_name = next_step_name;
|
|
1958
|
+
setObj.current_step_auto_submit = await UUFlowManager.getCurrentStepAutoSubmit(flow.timeout_auto_submit, next_step.lines);
|
|
1959
|
+
}
|
|
1960
|
+
} else if (judge === "rejected") {
|
|
1961
|
+
if (!description) {
|
|
1962
|
+
throw new Error('请填写驳回理由');
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1965
|
+
// 验证next_steps.step是否合法,判断next_steps.step是否在其中
|
|
1966
|
+
const nextSteps = await UUFlowManager.getNextSteps(instance, flow, step, "rejected");
|
|
1967
|
+
|
|
1968
|
+
// 判断next_steps.step是否在nextSteps中,若不在则不合法
|
|
1969
|
+
next_steps.forEach(approve_next_step => {
|
|
1970
|
+
if (!nextSteps.includes(approve_next_step["step"])) {
|
|
1971
|
+
throw new Error('指定的下一步有误');
|
|
1972
|
+
}
|
|
1973
|
+
});
|
|
1974
|
+
|
|
1975
|
+
// 若合法,执行流转
|
|
1976
|
+
const next_step_id = next_steps[0]["step"];
|
|
1977
|
+
const next_step = await UUFlowManager.getStep(instance, flow, next_step_id);
|
|
1978
|
+
const next_step_type = next_step["step_type"];
|
|
1979
|
+
const next_step_name = next_step["name"];
|
|
1980
|
+
|
|
1981
|
+
// 判断next_step是否为结束结点
|
|
1982
|
+
if (next_step_type === "end") {
|
|
1983
|
+
// 若是结束结点
|
|
1984
|
+
const instance_traces = instance.traces;
|
|
1985
|
+
|
|
1986
|
+
for (let i = 0; i < instance_traces.length; i++) {
|
|
1987
|
+
if (instance_traces[i]._id === trace_id) {
|
|
1988
|
+
// 更新当前trace记录
|
|
1989
|
+
setTraceObj[`traces.${i}.is_finished`] = true;
|
|
1990
|
+
setTraceObj[`traces.${i}.finish_date`] = new Date();
|
|
1991
|
+
setTraceObj[`traces.${i}.judge`] = judge;
|
|
1992
|
+
|
|
1993
|
+
for (let h = 0; h < instance_traces[i].approves.length; h++) {
|
|
1994
|
+
if (instance_traces[i].approves[h]._id === approve_id) {
|
|
1995
|
+
// 更新当前trace.approve记录
|
|
1996
|
+
const approveFinishDate = new Date();
|
|
1997
|
+
setTraceObj[`traces.${i}.approves.${h}.is_finished`] = true;
|
|
1998
|
+
setTraceObj[`traces.${i}.approves.${h}.handler`] = current_user;
|
|
1999
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_name`] = current_user_info.name;
|
|
2000
|
+
setTraceObj[`traces.${i}.approves.${h}.finish_date`] = approveFinishDate;
|
|
2001
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_organization`] = space_user_org_info["organization"];
|
|
2002
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_organization_name`] = space_user_org_info["organization_name"];
|
|
2003
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_organization_fullname`] = space_user_org_info["organization_fullname"];
|
|
2004
|
+
setTraceObj[`traces.${i}.approves.${h}.cost_time`] = approveFinishDate - instance_traces[i].approves[h].start_date;
|
|
2005
|
+
setTraceObj[`traces.${i}.approves.${h}.auto_submitted`] = auto_submitted;
|
|
2006
|
+
}
|
|
2007
|
+
}
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
|
|
2011
|
+
// 插入下一步trace记录
|
|
2012
|
+
const newTrace = {
|
|
2013
|
+
_id: _makeNewID(),
|
|
2014
|
+
instance: instance_id,
|
|
2015
|
+
previous_trace_ids: [trace_id],
|
|
2016
|
+
is_finished: true,
|
|
2017
|
+
step: next_step_id,
|
|
2018
|
+
name: next_step_name,
|
|
2019
|
+
start_date: new Date(),
|
|
2020
|
+
finish_date: new Date()
|
|
2021
|
+
};
|
|
2022
|
+
|
|
2023
|
+
// 更新instance记录
|
|
2024
|
+
setObj.state = "completed";
|
|
2025
|
+
setObj.final_decision = judge;
|
|
2026
|
+
setObj.modified = new Date();
|
|
2027
|
+
setObj.modified_by = current_user;
|
|
2028
|
+
setObj.values = await UUFlowManager.getUpdatedValues(instance);
|
|
2029
|
+
instance.values = setObj.values;
|
|
2030
|
+
setObj.name = await UUFlowManager.getInstanceName(instance);
|
|
2031
|
+
|
|
2032
|
+
const instance_trace = instance_traces.find(trace => trace._id === trace_id);
|
|
2033
|
+
const trace_approve = instance_trace.approves.find(approve => approve._id === approve_id);
|
|
2034
|
+
|
|
2035
|
+
updateObj.$addToSet = {
|
|
2036
|
+
outbox_users: {
|
|
2037
|
+
$each: [trace_approve.handler, trace_approve.user]
|
|
2038
|
+
}
|
|
2039
|
+
};
|
|
2040
|
+
|
|
2041
|
+
updateObj.$push = {
|
|
2042
|
+
traces: newTrace
|
|
2043
|
+
};
|
|
2044
|
+
|
|
2045
|
+
setObj.inbox_users = [];
|
|
2046
|
+
setObj.finish_date = new Date();
|
|
2047
|
+
setObj.current_step_name = next_step_name;
|
|
2048
|
+
setObj.current_step_auto_submit = false;
|
|
2049
|
+
} else {
|
|
2050
|
+
// 若不是结束结点
|
|
2051
|
+
// 先判断nextsteps.step.users是否为空
|
|
2052
|
+
const next_step_users = next_steps[0]["users"];
|
|
2053
|
+
|
|
2054
|
+
if (!next_step_users || next_step_users.length === 0) {
|
|
2055
|
+
throw new Error('未指定下一步处理人');
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2058
|
+
if (next_step_users.length > 1 && next_step["step_type"] !== "counterSign") {
|
|
2059
|
+
throw new Error('不能指定多个处理人');
|
|
2060
|
+
}
|
|
2061
|
+
|
|
2062
|
+
// 验证next_user是否合法
|
|
2063
|
+
const next_user_ids = await HandlersManager.getHandlers(instance_id, next_step_id, current_user);
|
|
2064
|
+
|
|
2065
|
+
if (!UUFlowManager.checkNestStepUsersIsValid(next_step_users, next_user_ids, next_step)) {
|
|
2066
|
+
throw new Error('指定的下一步处理人有误');
|
|
2067
|
+
}
|
|
2068
|
+
|
|
2069
|
+
// 若合法,执行流转操作
|
|
2070
|
+
const instance_traces = instance.traces;
|
|
2071
|
+
|
|
2072
|
+
for (let i = 0; i < instance_traces.length; i++) {
|
|
2073
|
+
if (instance_traces[i]._id === trace_id) {
|
|
2074
|
+
// 更新当前trace记录
|
|
2075
|
+
setTraceObj[`traces.${i}.is_finished`] = true;
|
|
2076
|
+
setTraceObj[`traces.${i}.finish_date`] = new Date();
|
|
2077
|
+
setTraceObj[`traces.${i}.judge`] = judge;
|
|
2078
|
+
|
|
2079
|
+
for (let h = 0; h < instance_traces[i].approves.length; h++) {
|
|
2080
|
+
if (instance_traces[i].approves[h]._id === approve_id) {
|
|
2081
|
+
// 更新当前trace.approve记录
|
|
2082
|
+
const approveFinishDate = new Date();
|
|
2083
|
+
setTraceObj[`traces.${i}.approves.${h}.is_finished`] = true;
|
|
2084
|
+
setTraceObj[`traces.${i}.approves.${h}.handler`] = current_user;
|
|
2085
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_name`] = current_user_info.name;
|
|
2086
|
+
setTraceObj[`traces.${i}.approves.${h}.finish_date`] = approveFinishDate;
|
|
2087
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_organization`] = space_user_org_info["organization"];
|
|
2088
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_organization_name`] = space_user_org_info["organization_name"];
|
|
2089
|
+
setTraceObj[`traces.${i}.approves.${h}.handler_organization_fullname`] = space_user_org_info["organization_fullname"];
|
|
2090
|
+
setTraceObj[`traces.${i}.approves.${h}.cost_time`] = approveFinishDate - instance_traces[i].approves[h].start_date;
|
|
2091
|
+
setTraceObj[`traces.${i}.approves.${h}.auto_submitted`] = auto_submitted;
|
|
2092
|
+
}
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
|
|
2097
|
+
// 插入下一步trace记录
|
|
2098
|
+
const newTrace = {
|
|
2099
|
+
_id: _makeNewID(),
|
|
2100
|
+
instance: instance_id,
|
|
2101
|
+
previous_trace_ids: [trace_id],
|
|
2102
|
+
is_finished: false,
|
|
2103
|
+
step: next_step_id,
|
|
2104
|
+
name: next_step_name,
|
|
2105
|
+
start_date: new Date(),
|
|
2106
|
+
due_date: UUFlowManager.getDueDate(next_step.timeout_hours, space_id),
|
|
2107
|
+
approves: []
|
|
2108
|
+
};
|
|
2109
|
+
|
|
2110
|
+
const updated_values = await UUFlowManager.getUpdatedValues(instance);
|
|
2111
|
+
|
|
2112
|
+
for (let idx = 0; idx < next_step_users.length; idx++) {
|
|
2113
|
+
const next_step_user_id = next_step_users[idx];
|
|
2114
|
+
// 插入下一步trace.approve记录
|
|
2115
|
+
const newApprove = {
|
|
2116
|
+
_id: _makeNewID(),
|
|
2117
|
+
instance: instance_id,
|
|
2118
|
+
trace: newTrace._id,
|
|
2119
|
+
is_finished: false,
|
|
2120
|
+
user: next_step_user_id
|
|
2121
|
+
};
|
|
2122
|
+
|
|
2123
|
+
const user_info = await db.users.findOne(
|
|
2124
|
+
{ _id: next_step_user_id },
|
|
2125
|
+
{ fields: { name: 1 } }
|
|
2126
|
+
);
|
|
2127
|
+
|
|
2128
|
+
newApprove.user_name = user_info.name;
|
|
2129
|
+
let handler_id = next_step_user_id;
|
|
2130
|
+
let handler_info = user_info;
|
|
2131
|
+
|
|
2132
|
+
const agent = await UUFlowManager.getAgent(space_id, next_step_user_id);
|
|
2133
|
+
if (agent) {
|
|
2134
|
+
next_step_users[idx] = agent;
|
|
2135
|
+
handler_id = agent;
|
|
2136
|
+
handler_info = await db.users.findOne(
|
|
2137
|
+
{ _id: agent },
|
|
2138
|
+
{ fields: { name: 1 } }
|
|
2139
|
+
);
|
|
2140
|
+
newApprove.agent = agent;
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2143
|
+
newApprove.handler = handler_id;
|
|
2144
|
+
newApprove.handler_name = handler_info.name;
|
|
2145
|
+
|
|
2146
|
+
const next_step_space_user = await db.space_users.findOne({
|
|
2147
|
+
space: space_id,
|
|
2148
|
+
user: handler_id
|
|
2149
|
+
});
|
|
2150
|
+
|
|
2151
|
+
// 获取next_step_user所在的部门信息
|
|
2152
|
+
const next_step_user_org_info = await UUFlowManager.getSpaceUserOrgInfo(next_step_space_user);
|
|
2153
|
+
newApprove.handler_organization = next_step_user_org_info["organization"];
|
|
2154
|
+
newApprove.handler_organization_name = next_step_user_org_info["organization_name"];
|
|
2155
|
+
newApprove.handler_organization_fullname = next_step_user_org_info["organization_fullname"];
|
|
2156
|
+
newApprove.start_date = new Date();
|
|
2157
|
+
newApprove.due_date = newTrace.due_date;
|
|
2158
|
+
newApprove.is_read = false;
|
|
2159
|
+
newApprove.is_error = false;
|
|
2160
|
+
newApprove.values = {};
|
|
2161
|
+
|
|
2162
|
+
UUFlowManager.setRemindInfo(updated_values, newApprove);
|
|
2163
|
+
newTrace.approves.push(newApprove);
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
// 更新instance记录
|
|
2167
|
+
setObj.final_decision = judge;
|
|
2168
|
+
setObj.modified = new Date();
|
|
2169
|
+
setObj.modified_by = current_user;
|
|
2170
|
+
setObj.values = updated_values;
|
|
2171
|
+
instance.values = setObj.values;
|
|
2172
|
+
setObj.name = await UUFlowManager.getInstanceName(instance);
|
|
2173
|
+
|
|
2174
|
+
const instance_trace = instance_traces.find(trace => trace._id === trace_id);
|
|
2175
|
+
const trace_approve = instance_trace.approves.find(approve => approve._id === approve_id);
|
|
2176
|
+
|
|
2177
|
+
setObj.inbox_users = next_step_users;
|
|
2178
|
+
updateObj.$addToSet = {
|
|
2179
|
+
outbox_users: {
|
|
2180
|
+
$each: [trace_approve.handler, trace_approve.user]
|
|
2181
|
+
}
|
|
2182
|
+
};
|
|
2183
|
+
|
|
2184
|
+
updateObj.$push = {
|
|
2185
|
+
traces: newTrace
|
|
2186
|
+
};
|
|
2187
|
+
|
|
2188
|
+
setObj.state = "pending";
|
|
2189
|
+
setObj.current_step_name = next_step_name;
|
|
2190
|
+
setObj.current_step_auto_submit = await UUFlowManager.getCurrentStepAutoSubmit(flow.timeout_auto_submit, next_step.lines);
|
|
2191
|
+
}
|
|
2192
|
+
}
|
|
2193
|
+
|
|
2194
|
+
await db.instances.update({_id: instance_id}, { $set: setTraceObj });
|
|
2195
|
+
// 更新instance_tasks
|
|
2196
|
+
await update_instance_tasks(instance_id, trace_id, approve_id);
|
|
2197
|
+
|
|
2198
|
+
updateObj.$set = setObj;
|
|
2199
|
+
return updateObj;
|
|
2200
|
+
};
|
|
2201
|
+
////////////
|
|
2202
|
+
UUFlowManager.engine_step_type_is_counterSign = async function (
|
|
2203
|
+
instance_id,
|
|
2204
|
+
trace_id,
|
|
2205
|
+
approve_id,
|
|
2206
|
+
next_steps,
|
|
2207
|
+
space_user_org_info,
|
|
2208
|
+
judge,
|
|
2209
|
+
instance,
|
|
2210
|
+
flow,
|
|
2211
|
+
step,
|
|
2212
|
+
current_user,
|
|
2213
|
+
current_user_info,
|
|
2214
|
+
auto_submitted
|
|
2215
|
+
) {
|
|
2216
|
+
const db = {
|
|
2217
|
+
instances: await getCollection('instances'),
|
|
2218
|
+
users: await getCollection('users'),
|
|
2219
|
+
space_users: await getCollection('space_users')
|
|
2220
|
+
};
|
|
2221
|
+
|
|
2222
|
+
let setObj = {};
|
|
2223
|
+
let updateObj = {};
|
|
2224
|
+
let setTraceObj = {};
|
|
2225
|
+
const space_id = instance.space;
|
|
2226
|
+
const finishedApproveIds = [];
|
|
2227
|
+
|
|
2228
|
+
// 验证approve的judge是否为空
|
|
2229
|
+
if (!judge) {
|
|
2230
|
+
throw new Error('请选择核准或驳回。');
|
|
2231
|
+
}
|
|
2232
|
+
|
|
2233
|
+
if (step.oneClickApproval && ['approved', 'readed'].includes(judge)) {
|
|
2234
|
+
// 验证next_steps.step是否合法,判断next_steps.step是否在其中
|
|
2235
|
+
const nextSteps = await UUFlowManager.getNextSteps(instance, flow, step, "approved");
|
|
2236
|
+
// 判断next_steps.step是否在nextSteps中,若不在则不合法
|
|
2237
|
+
next_steps.forEach(approve_next_step => {
|
|
2238
|
+
if (!nextSteps.includes(approve_next_step["step"])) {
|
|
2239
|
+
throw new Error('指定的下一步有误');
|
|
2240
|
+
}
|
|
2241
|
+
});
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2244
|
+
// 若合法,执行流转
|
|
2245
|
+
const next_step_id = next_steps[0]["step"];
|
|
2246
|
+
const next_step = await UUFlowManager.getStep(instance, flow, next_step_id);
|
|
2247
|
+
const next_step_type = next_step["step_type"];
|
|
2248
|
+
const next_step_name = next_step["name"];
|
|
2249
|
+
const instance_traces = instance.traces;
|
|
2250
|
+
let isAllApproveFinished = true;
|
|
2251
|
+
|
|
2252
|
+
for (let i = 0; i < instance_traces.length; i++) {
|
|
2253
|
+
if (instance_traces[i]._id === trace_id) {
|
|
2254
|
+
for (let h = 0; h < instance_traces[i].approves.length; h++) {
|
|
2255
|
+
if (instance_traces[i].approves[h].type !== 'cc' && instance_traces[i].approves[h].type !== 'distribute') {
|
|
2256
|
+
if (instance_traces[i].approves[h]._id === approve_id ||
|
|
2257
|
+
((step.oneClickApproval && ['approved', 'readed'].includes(judge)) ||
|
|
2258
|
+
(step.oneClickRejection && 'rejected' === judge))) {
|
|
2259
|
+
// 更新当前trace.approve记录
|
|
2260
|
+
const approveFinishDate = new Date();
|
|
2261
|
+
setTraceObj[`traces.${i}.approves.${h}.is_finished`] = true;
|
|
2262
|
+
setTraceObj[`traces.${i}.approves.${h}.finish_date`] = approveFinishDate;
|
|
2263
|
+
setTraceObj[`traces.${i}.approves.${h}.cost_time`] = approveFinishDate - instance_traces[i].approves[h].start_date;
|
|
2264
|
+
setTraceObj[`traces.${i}.approves.${h}.auto_submitted`] = auto_submitted;
|
|
2265
|
+
finishedApproveIds.push(instance_traces[i].approves[h]._id);
|
|
2266
|
+
}
|
|
2267
|
+
else if (instance_traces[i].approves[h].is_finished === false) {
|
|
2268
|
+
isAllApproveFinished = false;
|
|
2269
|
+
}
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
if (isAllApproveFinished === true) {
|
|
2276
|
+
for (let i = 0; i < instance_traces.length; i++) {
|
|
2277
|
+
if (instance_traces[i]._id === trace_id) {
|
|
2278
|
+
// 更新当前trace记录
|
|
2279
|
+
setTraceObj[`traces.${i}.is_finished`] = true;
|
|
2280
|
+
setTraceObj[`traces.${i}.finish_date`] = new Date();
|
|
2281
|
+
setTraceObj[`traces.${i}.judge`] = "submitted";
|
|
2282
|
+
}
|
|
2283
|
+
}
|
|
2284
|
+
|
|
2285
|
+
// 判断next_step是否为结束结点
|
|
2286
|
+
if (next_step_type === "end") {
|
|
2287
|
+
// 插入下一步trace记录
|
|
2288
|
+
const newTrace = {
|
|
2289
|
+
_id: _makeNewID(),
|
|
2290
|
+
instance: instance_id,
|
|
2291
|
+
previous_trace_ids: [trace_id],
|
|
2292
|
+
is_finished: true,
|
|
2293
|
+
step: next_step_id,
|
|
2294
|
+
name: next_step_name,
|
|
2295
|
+
start_date: new Date(),
|
|
2296
|
+
finish_date: new Date()
|
|
2297
|
+
};
|
|
2298
|
+
|
|
2299
|
+
// 更新instance记录
|
|
2300
|
+
setObj.state = "completed";
|
|
2301
|
+
setObj.modified = new Date();
|
|
2302
|
+
setObj.modified_by = current_user;
|
|
2303
|
+
|
|
2304
|
+
const instance_trace = instance_traces.find(trace => trace._id === trace_id);
|
|
2305
|
+
const trace_approve = instance_trace.approves.find(approve => approve._id === approve_id);
|
|
2306
|
+
|
|
2307
|
+
setObj.inbox_users = [];
|
|
2308
|
+
updateObj.$addToSet = {
|
|
2309
|
+
outbox_users: {
|
|
2310
|
+
$each: [trace_approve.handler, trace_approve.user]
|
|
2311
|
+
}
|
|
2312
|
+
};
|
|
2313
|
+
|
|
2314
|
+
updateObj.$push = {
|
|
2315
|
+
traces: newTrace
|
|
2316
|
+
};
|
|
2317
|
+
|
|
2318
|
+
setObj.finish_date = new Date();
|
|
2319
|
+
const updated_values = await UUFlowManager.getUpdatedValues(await UUFlowManager.getInstance(instance_id), approve_id);
|
|
2320
|
+
setObj.values = updated_values;
|
|
2321
|
+
setObj.name = await UUFlowManager.getInstanceName(instance);
|
|
2322
|
+
setObj.current_step_name = next_step_name;
|
|
2323
|
+
|
|
2324
|
+
let final_decision = '';
|
|
2325
|
+
if (step.oneClickApproval && ['approved', 'readed'].includes(judge)) {
|
|
2326
|
+
// 如果开启了一键核准并且选择了核准则设置final_decision为approved
|
|
2327
|
+
final_decision = 'approved';
|
|
2328
|
+
} else if (step.oneClickRejection && 'rejected' === judge) {
|
|
2329
|
+
// 如果开启了一键驳回并且选择了驳回则设置final_decision为rejected
|
|
2330
|
+
final_decision = 'rejected';
|
|
2331
|
+
}
|
|
2332
|
+
|
|
2333
|
+
setObj.final_decision = final_decision || 'approved'; // 会签到结束默认为approved
|
|
2334
|
+
setObj.current_step_auto_submit = false;
|
|
2335
|
+
} else {
|
|
2336
|
+
// 若不是结束结点
|
|
2337
|
+
// 先判断nextsteps.step.users是否为空
|
|
2338
|
+
const next_step_users = next_steps[0]["users"];
|
|
2339
|
+
|
|
2340
|
+
if (!next_step_users || next_step_users.length === 0) {
|
|
2341
|
+
throw new Error('未指定下一步处理人');
|
|
2342
|
+
}
|
|
2343
|
+
|
|
2344
|
+
if (next_step_users.length > 1 && next_step["step_type"] !== "counterSign") {
|
|
2345
|
+
throw new Error('不能指定多个处理人');
|
|
2346
|
+
}
|
|
2347
|
+
|
|
2348
|
+
// 验证next_user是否合法
|
|
2349
|
+
const next_user_ids = await HandlersManager.getHandlers(instance_id, next_step_id, current_user);
|
|
2350
|
+
|
|
2351
|
+
if (!UUFlowManager.checkNestStepUsersIsValid(next_step_users, next_user_ids, next_steps)) {
|
|
2352
|
+
throw new Error('指定的下一步处理人有误');
|
|
2353
|
+
}
|
|
2354
|
+
|
|
2355
|
+
// 插入下一步trace记录
|
|
2356
|
+
const newTrace = {
|
|
2357
|
+
_id: _makeNewID(),
|
|
2358
|
+
instance: instance_id,
|
|
2359
|
+
previous_trace_ids: [trace_id],
|
|
2360
|
+
is_finished: false,
|
|
2361
|
+
step: next_step_id,
|
|
2362
|
+
name: next_step_name,
|
|
2363
|
+
start_date: new Date(),
|
|
2364
|
+
due_date: UUFlowManager.getDueDate(next_step.timeout_hours, space_id),
|
|
2365
|
+
approves: []
|
|
2366
|
+
};
|
|
2367
|
+
|
|
2368
|
+
for (let idx = 0; idx < next_step_users.length; idx++) {
|
|
2369
|
+
const next_step_user_id = next_step_users[idx];
|
|
2370
|
+
// 插入下一步trace.approve记录
|
|
2371
|
+
const newApprove = {
|
|
2372
|
+
_id: _makeNewID(),
|
|
2373
|
+
instance: instance_id,
|
|
2374
|
+
trace: newTrace._id,
|
|
2375
|
+
is_finished: false,
|
|
2376
|
+
user: next_step_user_id
|
|
2377
|
+
};
|
|
2378
|
+
|
|
2379
|
+
const user_info = await db.users.findOne(
|
|
2380
|
+
{ _id: next_step_user_id },
|
|
2381
|
+
{ fields: { name: 1 } }
|
|
2382
|
+
);
|
|
2383
|
+
|
|
2384
|
+
newApprove.user_name = user_info.name;
|
|
2385
|
+
let handler_id = next_step_user_id;
|
|
2386
|
+
let handler_info = user_info;
|
|
2387
|
+
|
|
2388
|
+
const agent = await UUFlowManager.getAgent(space_id, next_step_user_id);
|
|
2389
|
+
if (agent) {
|
|
2390
|
+
next_step_users[idx] = agent;
|
|
2391
|
+
handler_id = agent;
|
|
2392
|
+
handler_info = await db.users.findOne(
|
|
2393
|
+
{ _id: agent },
|
|
2394
|
+
{ fields: { name: 1 } }
|
|
2395
|
+
);
|
|
2396
|
+
newApprove.agent = agent;
|
|
2397
|
+
}
|
|
2398
|
+
|
|
2399
|
+
newApprove.handler = handler_id;
|
|
2400
|
+
newApprove.handler_name = handler_info.name;
|
|
2401
|
+
|
|
2402
|
+
const next_step_space_user = await db.space_users.findOne({
|
|
2403
|
+
space: space_id,
|
|
2404
|
+
user: handler_id
|
|
2405
|
+
});
|
|
2406
|
+
|
|
2407
|
+
// 获取next_step_user所在的部门信息
|
|
2408
|
+
const next_step_user_org_info = await UUFlowManager.getSpaceUserOrgInfo(next_step_space_user);
|
|
2409
|
+
newApprove.handler_organization = next_step_user_org_info["organization"];
|
|
2410
|
+
newApprove.handler_organization_name = next_step_user_org_info["organization_name"];
|
|
2411
|
+
newApprove.handler_organization_fullname = next_step_user_org_info["organization_fullname"];
|
|
2412
|
+
newApprove.start_date = new Date();
|
|
2413
|
+
newApprove.due_date = newTrace.due_date;
|
|
2414
|
+
newApprove.is_read = false;
|
|
2415
|
+
newApprove.is_error = false;
|
|
2416
|
+
newApprove.values = {};
|
|
2417
|
+
|
|
2418
|
+
UUFlowManager.setRemindInfo(instance.values, newApprove);
|
|
2419
|
+
newTrace.approves.push(newApprove);
|
|
2420
|
+
}
|
|
2421
|
+
|
|
2422
|
+
// 更新instance记录
|
|
2423
|
+
setObj.modified = new Date();
|
|
2424
|
+
setObj.modified_by = current_user;
|
|
2425
|
+
|
|
2426
|
+
const instance_trace = instance_traces.find(trace => trace._id === trace_id);
|
|
2427
|
+
const trace_approve = instance_trace.approves.find(approve => approve._id === approve_id);
|
|
2428
|
+
|
|
2429
|
+
setObj.inbox_users = next_step_users;
|
|
2430
|
+
updateObj.$addToSet = {
|
|
2431
|
+
outbox_users: {
|
|
2432
|
+
$each: [trace_approve.handler, trace_approve.user]
|
|
2433
|
+
}
|
|
2434
|
+
};
|
|
2435
|
+
|
|
2436
|
+
updateObj.$push = {
|
|
2437
|
+
traces: newTrace
|
|
2438
|
+
};
|
|
2439
|
+
|
|
2440
|
+
setObj.state = "pending";
|
|
2441
|
+
const updated_values = await UUFlowManager.getUpdatedValues(await UUFlowManager.getInstance(instance_id), approve_id);
|
|
2442
|
+
setObj.values = updated_values;
|
|
2443
|
+
setObj.name = await UUFlowManager.getInstanceName(instance);
|
|
2444
|
+
setObj.current_step_name = next_step_name;
|
|
2445
|
+
setObj.current_step_auto_submit = await UUFlowManager.getCurrentStepAutoSubmit(flow.timeout_auto_submit, next_step.lines);
|
|
2446
|
+
}
|
|
2447
|
+
} else {
|
|
2448
|
+
// 当前trace未结束
|
|
2449
|
+
const instance_trace = instance_traces.find(trace => trace._id === trace_id);
|
|
2450
|
+
const trace_approve = instance_trace.approves.find(approve => approve._id === approve_id);
|
|
2451
|
+
|
|
2452
|
+
updateObj.$addToSet = {
|
|
2453
|
+
outbox_users: {
|
|
2454
|
+
$each: [trace_approve.handler, trace_approve.user]
|
|
2455
|
+
}
|
|
2456
|
+
};
|
|
2457
|
+
|
|
2458
|
+
instance.inbox_users.splice(instance.inbox_users.indexOf(trace_approve.handler), 1);
|
|
2459
|
+
setObj.inbox_users = instance.inbox_users;
|
|
2460
|
+
setObj.modified = new Date();
|
|
2461
|
+
setObj.modified_by = current_user;
|
|
2462
|
+
setObj.state = "pending";
|
|
2463
|
+
const updated_values = await UUFlowManager.getUpdatedValues(await UUFlowManager.getInstance(instance_id), approve_id);
|
|
2464
|
+
setObj.values = updated_values;
|
|
2465
|
+
setObj.name = await UUFlowManager.getInstanceName(instance);
|
|
2466
|
+
}
|
|
2467
|
+
|
|
2468
|
+
await db.instances.update({_id: instance_id}, { $set: setTraceObj });
|
|
2469
|
+
// 更新instance_tasks
|
|
2470
|
+
await update_many_instance_tasks(instance_id, trace_id, finishedApproveIds);
|
|
2471
|
+
|
|
2472
|
+
updateObj.$set = setObj;
|
|
2473
|
+
return updateObj;
|
|
2474
|
+
};
|
|
2475
|
+
|
|
2476
|
+
/////////////
|
|
2477
|
+
// 生成HTML格式只读表单和签核历程, 由于此方法生成的html数据会作为邮件内容发送,为了再邮件中样式显示正常,
|
|
2478
|
+
// 请不要写单独的css,所有样式请写在html标签的style属性中。
|
|
2479
|
+
UUFlowManager.ins_html = function (current_user_info, ins) {
|
|
2480
|
+
const options = {
|
|
2481
|
+
templateName: 'table',
|
|
2482
|
+
showTrace: true,
|
|
2483
|
+
showAttachments: false,
|
|
2484
|
+
tagger: 'email',
|
|
2485
|
+
width: "765px" // 此处宽度不能设置为偶数,否则会引起子表与主表线条对不齐的bug
|
|
2486
|
+
};
|
|
2487
|
+
|
|
2488
|
+
options.styles = `body { background: #ffffff !important; }.steedos .pull-right { float: right !important; }.steedos .inline-left{ display: inline;float: left; }.steedos .inline-right{ display: inline;float: right; }.steedos .no-border{ border: 0px; }.steedos .no-border td{ border: 0px; }.steedos tr:nth-child(2) td{ border-top: 0px !important; }.steedos .ins_applicant{ display: inline; background: transparent !important; border: none; }.steedos .instance-name{ width: ${options.width} !important; }.steedos table { border-spacing: 0; border-collapse: collapse; }.steedos .box { background: #ffffff; }.steedos .form-table { width: ${options.width}; border: solid 2px #000000; border-collapse: collapse; table-layout: fixed; }.steedosTable-item-field{ padding: 5px; }.steedos td{ border: solid 1px #000000; border-collapse: collapse; }.steedos th { border: 0px; border-collapse: collapse; padding: 0px; }.steedos .td-title{ padding: 4px 12px; }.steedos .td-field { padding: 4px 12px; }.instance-view .instance-name { text-align: center; font-weight: bolder; }.td-childfield { border-top: solid 1px #000000; border-right: solid 1px #000000; border-bottom: solid 1px #000000; padding: 0px; }.panel-heading{ padding: 4px 12px; font-weight: bold; color: #333; background-color: #f5f5f5; }.table-bordered tr:last-child th { border-bottom: none; }.table-bordered tr:last-child td { border-bottom: none; }.steedos-table th:first-child{ border-left: 0px !important; }.steedos-table td:first-child { border-left: 0px !important; }.steedos-table table thead .title { min-width: 50px; }.steedos-table th:last-child{ border-right: 0px !important; }.steedos-table td:last-child { border-right: 0px !important; }.steedos-table table .number { text-align: right; }.callout-default{ border-color: #D2D6DE; color: #333; background-color: #F1F1F1; font-weight: bold; }.instance-table .callout { margin: 0px; padding: 4px 12px; border-radius: 0px; border-left: none; }.approved{ color: green; }.rejected{ color: red; }.terminated{ color: black; }.reassigned{ color: black; }.retrieved{ color: black; }.trace-approve-talbe td { text-align: left; border: none; }.traces td table { width: 100%; }.approve-item .name{ width: 40%; }.approve-item .finish-date{ width: 35%; }.td-stepname{ padding: 4px 12px; }.td-approve td{ padding: 4px 12px; }.applicant-wrapper { font-weight: bolder; }`;
|
|
2489
|
+
|
|
2490
|
+
let instanceHtml = InstanceReadOnlyTemplate.getInstanceHtml(current_user_info, ins.space, ins, options);
|
|
2491
|
+
|
|
2492
|
+
// 处理outlook中,对部分css不支持的处理
|
|
2493
|
+
const replacements = [
|
|
2494
|
+
['style="width: 100%;display: inline-table;"', 'style="border:0px;text-align: center;width:765px;"'],
|
|
2495
|
+
['class="instance-table-name-td"', `class="instance-table-name-td" style="width:${options.width};border:0px"`],
|
|
2496
|
+
['class="instance-name"', `class="instance-name" style="width:${options.width}"`],
|
|
2497
|
+
['class="table-page-body form-table"', `class="table-page-body form-table" style="width:${options.width}"`],
|
|
2498
|
+
['class="table table-condensed traces"', `class="table table-condensed traces" style="width:${options.width};border:solid 2.0px #000000"`],
|
|
2499
|
+
['class="table-page-footer form-table no-border"', 'class="table-page-footer form-table no-border" style="border:0px;width:765px;"'],
|
|
2500
|
+
[/class="td-title "/g, 'class="td-title" style="width:14%"'],
|
|
2501
|
+
[/class="td-stepname"/g, `class="td-stepname" style="width:${765 * 20 / 100}px"`],
|
|
2502
|
+
[/class="td-childfield"/g, 'class="td-childfield" style="padding:0px"'],
|
|
2503
|
+
[/class="status approved"/g, 'class="status approved" style="color: green;"'],
|
|
2504
|
+
[/class="status rejected"/g, 'class="status rejected" style="color: red;"'],
|
|
2505
|
+
[/<table>/g, '<table style="width:100%;border:none">'],
|
|
2506
|
+
[/<td class="name">/g, '<td class="name" style="width: 40%;">'],
|
|
2507
|
+
[/<td class="finish-date">/g, '<td class="finish-date" style="width: 35%;">'],
|
|
2508
|
+
[/inline-left'/g, "inline-left' style='display: inline;float: left;'"],
|
|
2509
|
+
[/inline-right'/g, "inline-right' style='display: inline;float: right;'"],
|
|
2510
|
+
[/pull-right'/g, "pull-right' style='float: right;'"]
|
|
2511
|
+
];
|
|
2512
|
+
|
|
2513
|
+
replacements.forEach(([search, replace]) => {
|
|
2514
|
+
instanceHtml = instanceHtml.replace(search, replace);
|
|
2515
|
+
});
|
|
2516
|
+
|
|
2517
|
+
return instanceHtml;
|
|
2518
|
+
};
|
|
2519
|
+
|
|
2520
|
+
UUFlowManager.getFlowCompanyId = async function (flowId) {
|
|
2521
|
+
const db = {
|
|
2522
|
+
flows: await getCollection('flows')
|
|
2523
|
+
};
|
|
2524
|
+
|
|
2525
|
+
const flow = await db.flows.findOne({_id: flowId}, {
|
|
2526
|
+
fields: {
|
|
2527
|
+
company_id: 1
|
|
2528
|
+
}
|
|
2529
|
+
});
|
|
2530
|
+
|
|
2531
|
+
return flow?.company_id;
|
|
2532
|
+
};
|
|
2533
|
+
|
|
2534
|
+
UUFlowManager.create_instance = async function (instance_from_client, user_info) {
|
|
2535
|
+
const db = {
|
|
2536
|
+
instances: await getCollection('instances')
|
|
2537
|
+
};
|
|
2538
|
+
|
|
2539
|
+
const space_id = instance_from_client["space"];
|
|
2540
|
+
const flow_id = instance_from_client["flow"];
|
|
2541
|
+
const user_id = user_info._id;
|
|
2542
|
+
|
|
2543
|
+
// 获取前台所传的trace
|
|
2544
|
+
let trace_from_client = null;
|
|
2545
|
+
// 获取前台所传的approve
|
|
2546
|
+
let approve_from_client = null;
|
|
2547
|
+
|
|
2548
|
+
if (instance_from_client["traces"]?.[0]) {
|
|
2549
|
+
trace_from_client = instance_from_client["traces"][0];
|
|
2550
|
+
if (trace_from_client["approves"]?.[0]) {
|
|
2551
|
+
approve_from_client = trace_from_client["approves"][0];
|
|
2552
|
+
}
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2555
|
+
// 获取一个space
|
|
2556
|
+
const space = await UUFlowManager.getSpace(space_id);
|
|
2557
|
+
// 获取一个flow
|
|
2558
|
+
const flow = await UUFlowManager.getFlow(flow_id, { fields: { historys: 0 } });
|
|
2559
|
+
// 获取一个space下的一个user
|
|
2560
|
+
const space_user = await UUFlowManager.getSpaceUser(space_id, user_id);
|
|
2561
|
+
// 获取space_user所在的部门信息
|
|
2562
|
+
const space_user_org_info = await UUFlowManager.getSpaceUserOrgInfo(space_user);
|
|
2563
|
+
// 判断一个flow是否为启用状态
|
|
2564
|
+
UUFlowManager.isFlowEnabled(flow);
|
|
2565
|
+
// 判断一个flow和space_id是否匹配
|
|
2566
|
+
UUFlowManager.isFlowSpaceMatched(flow, space_id);
|
|
2567
|
+
|
|
2568
|
+
const form = await UUFlowManager.getForm(flow.form, { fields: { historys: 0 } });
|
|
2569
|
+
const permissions = await PermissionManager.getFlowPermissions(flow_id, user_id, flow);
|
|
2570
|
+
|
|
2571
|
+
if (!permissions.includes("add")) {
|
|
2572
|
+
throw new Error('当前用户没有此流程的新建权限');
|
|
2573
|
+
}
|
|
2574
|
+
|
|
2575
|
+
const now = new Date();
|
|
2576
|
+
const ins_obj = {};
|
|
2577
|
+
ins_obj._id = _makeNewID();
|
|
2578
|
+
ins_obj.space = space_id;
|
|
2579
|
+
ins_obj.flow = flow_id;
|
|
2580
|
+
ins_obj.flow_version = flow.current._id;
|
|
2581
|
+
ins_obj.form = flow.form;
|
|
2582
|
+
ins_obj.form_version = flow.current.form_version;
|
|
2583
|
+
ins_obj.name = flow.name;
|
|
2584
|
+
ins_obj.submitter = user_id;
|
|
2585
|
+
ins_obj.submitter_name = user_info.name;
|
|
2586
|
+
ins_obj.applicant = instance_from_client["applicant"] || user_id;
|
|
2587
|
+
ins_obj.applicant_name = instance_from_client["applicant_name"] || user_info.name;
|
|
2588
|
+
ins_obj.applicant_organization = instance_from_client["applicant_organization"] || space_user.organization;
|
|
2589
|
+
ins_obj.applicant_organization_name = instance_from_client["applicant_organization_name"] || space_user_org_info.organization_name;
|
|
2590
|
+
ins_obj.applicant_organization_fullname = instance_from_client["applicant_organization_fullname"] || space_user_org_info.organization_fullname;
|
|
2591
|
+
ins_obj.applicant_company = instance_from_client["applicant_company"] || space_user.company_id;
|
|
2592
|
+
ins_obj.state = 'draft';
|
|
2593
|
+
ins_obj.code = '';
|
|
2594
|
+
ins_obj.is_archived = false;
|
|
2595
|
+
ins_obj.is_deleted = false;
|
|
2596
|
+
ins_obj.created = now;
|
|
2597
|
+
ins_obj.created_by = user_id;
|
|
2598
|
+
ins_obj.modified = now;
|
|
2599
|
+
ins_obj.modified_by = user_id;
|
|
2600
|
+
ins_obj.values = {};
|
|
2601
|
+
|
|
2602
|
+
const companyId = flow.company_id;
|
|
2603
|
+
if (companyId) {
|
|
2604
|
+
ins_obj.company_id = companyId;
|
|
2605
|
+
}
|
|
2606
|
+
|
|
2607
|
+
// 新建Trace
|
|
2608
|
+
const trace_obj = {
|
|
2609
|
+
_id: _makeNewID(),
|
|
2610
|
+
instance: ins_obj._id,
|
|
2611
|
+
is_finished: false,
|
|
2612
|
+
step: flow.current.steps.find(step => step.step_type === 'start')._id,
|
|
2613
|
+
name: flow.current.steps.find(step => step.step_type === 'start').name,
|
|
2614
|
+
start_date: now
|
|
2615
|
+
};
|
|
2616
|
+
|
|
2617
|
+
// 新建Approve
|
|
2618
|
+
const appr_obj = {
|
|
2619
|
+
_id: _makeNewID(),
|
|
2620
|
+
instance: ins_obj._id,
|
|
2621
|
+
trace: trace_obj._id,
|
|
2622
|
+
is_finished: false,
|
|
2623
|
+
user: instance_from_client["applicant"] || user_id,
|
|
2624
|
+
user_name: instance_from_client["applicant_name"] || user_info.name,
|
|
2625
|
+
handler: user_id,
|
|
2626
|
+
handler_name: user_info.name,
|
|
2627
|
+
handler_organization: space_user.organization,
|
|
2628
|
+
handler_organization_name: space_user_org_info.organization_name,
|
|
2629
|
+
handler_organization_fullname: space_user_org_info.organization_fullname,
|
|
2630
|
+
type: 'draft',
|
|
2631
|
+
start_date: now,
|
|
2632
|
+
read_date: now,
|
|
2633
|
+
is_read: true,
|
|
2634
|
+
is_error: false,
|
|
2635
|
+
description: '',
|
|
2636
|
+
values: approve_from_client?.values || {}
|
|
2637
|
+
};
|
|
2638
|
+
|
|
2639
|
+
trace_obj.approves = [appr_obj];
|
|
2640
|
+
ins_obj.traces = [trace_obj];
|
|
2641
|
+
ins_obj.inbox_users = instance_from_client.inbox_users || [];
|
|
2642
|
+
ins_obj.current_step_name = flow.current.steps.find(step => step.step_type === 'start').name;
|
|
2643
|
+
|
|
2644
|
+
if (flow.auto_remind === true) {
|
|
2645
|
+
ins_obj.auto_remind = true;
|
|
2646
|
+
}
|
|
2647
|
+
|
|
2648
|
+
// 新建申请单时,instances记录流程名称、流程分类名称 #1313
|
|
2649
|
+
ins_obj.flow_name = flow.name;
|
|
2650
|
+
|
|
2651
|
+
if (form.category) {
|
|
2652
|
+
const category = await UUFlowManager.getCategory(form.category, { fields: { _id: 1, name: 1 } });
|
|
2653
|
+
if (category) {
|
|
2654
|
+
ins_obj.category_name = category.name;
|
|
2655
|
+
ins_obj.category = category._id;
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
|
|
2659
|
+
await db.instances.insert(ins_obj);
|
|
2660
|
+
return ins_obj._id;
|
|
2661
|
+
};
|
|
2662
|
+
|
|
2663
|
+
UUFlowManager.getCurrentStepAutoSubmit = function (timeout_auto_submit, lines) {
|
|
2664
|
+
if (timeout_auto_submit && lines) {
|
|
2665
|
+
return lines.some(l => l.timeout_line === true);
|
|
2666
|
+
}
|
|
2667
|
+
return false;
|
|
2668
|
+
};
|
|
2669
|
+
|
|
2670
|
+
UUFlowManager.getDueDate = async function (hours, spaceId) {
|
|
2671
|
+
if (hours) {
|
|
2672
|
+
// TODO: 实现异步获取超时日期
|
|
2673
|
+
// return await steedosCore.getTimeoutDateWithoutHolidays(new Date(), hours, spaceId);
|
|
2674
|
+
}
|
|
2675
|
+
return undefined;
|
|
2676
|
+
};
|
|
2677
|
+
//////////
|
|
2678
|
+
|
|
2679
|
+
UUFlowManager.submit_instance = async function (instance_from_client, user_info) {
|
|
2680
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
2681
|
+
console.time('submit_instance');
|
|
2682
|
+
}
|
|
2683
|
+
|
|
2684
|
+
const db = {
|
|
2685
|
+
instances: await getCollection('instances'),
|
|
2686
|
+
flows: await getCollection('flows')
|
|
2687
|
+
};
|
|
2688
|
+
|
|
2689
|
+
const current_user = user_info._id;
|
|
2690
|
+
const lang = user_info.locale === 'zh-cn' ? 'zh-CN' : 'en';
|
|
2691
|
+
const instance_id = instance_from_client._id;
|
|
2692
|
+
const trace_id = instance_from_client.traces[0]._id;
|
|
2693
|
+
const approve_id = instance_from_client.traces[0].approves[0]._id;
|
|
2694
|
+
let values = instance_from_client.traces[0].approves[0].values || {};
|
|
2695
|
+
|
|
2696
|
+
// 验证表单上的applicant已填写
|
|
2697
|
+
if (!instance_from_client.applicant) {
|
|
2698
|
+
throw new Error('请选择提交人');
|
|
2699
|
+
}
|
|
2700
|
+
|
|
2701
|
+
const applicant_id = instance_from_client.applicant;
|
|
2702
|
+
const submitter_id = instance_from_client.submitter;
|
|
2703
|
+
const next_steps = instance_from_client.traces[0].approves[0].next_steps;
|
|
2704
|
+
const attachments = instance_from_client.traces[0].approves[0].attachments;
|
|
2705
|
+
const description = instance_from_client.traces[0].approves[0].description;
|
|
2706
|
+
|
|
2707
|
+
// 获取一个instance
|
|
2708
|
+
const instance = await UUFlowManager.getInstance(instance_id);
|
|
2709
|
+
const space_id = instance.space;
|
|
2710
|
+
const flow_id = instance.flow;
|
|
2711
|
+
|
|
2712
|
+
// 获取一个space
|
|
2713
|
+
const space = await UUFlowManager.getSpace(space_id);
|
|
2714
|
+
// 校验申请人user_accepted = true
|
|
2715
|
+
const checkApplicant = await UUFlowManager.getSpaceUser(space_id, applicant_id);
|
|
2716
|
+
// 获取一个flow
|
|
2717
|
+
const flow = await UUFlowManager.getFlow(flow_id, { historys: 0 });
|
|
2718
|
+
// 确定instance的name
|
|
2719
|
+
const instance_name = instance_from_client.name;
|
|
2720
|
+
|
|
2721
|
+
// 判断一个instance是否为拟稿状态
|
|
2722
|
+
UUFlowManager.isInstanceDraft(instance, lang);
|
|
2723
|
+
// 获取一个space下的一个user
|
|
2724
|
+
const space_user = await UUFlowManager.getSpaceUser(space_id, current_user);
|
|
2725
|
+
// 获取space_user所在的部门信息
|
|
2726
|
+
const space_user_org_info = await UUFlowManager.getSpaceUserOrgInfo(space_user);
|
|
2727
|
+
// 判断一个用户是否是一个instance的提交者
|
|
2728
|
+
UUFlowManager.isInstanceSubmitter(instance, current_user);
|
|
2729
|
+
// 判断一个flow是否为启用状态
|
|
2730
|
+
UUFlowManager.isFlowEnabled(flow);
|
|
2731
|
+
// 验证该user_id或其所在的组有提交此申请单的权限
|
|
2732
|
+
const permissions = await PermissionManager.getFlowPermissions(flow_id, current_user, flow);
|
|
2733
|
+
|
|
2734
|
+
if (!permissions.includes("add")) {
|
|
2735
|
+
throw new Error('该提交人没有提交此申请单的权限。');
|
|
2736
|
+
}
|
|
2737
|
+
|
|
2738
|
+
const trace = instance_from_client.traces[0];
|
|
2739
|
+
// 获取一个step
|
|
2740
|
+
const step = await UUFlowManager.getStep(instance, flow, trace.step);
|
|
2741
|
+
const approve = trace.approves[0];
|
|
2742
|
+
|
|
2743
|
+
// 先执行暂存的操作
|
|
2744
|
+
// ================begin================
|
|
2745
|
+
const form = await UUFlowManager.getForm(instance.form, { fields: { historys: 0 } });
|
|
2746
|
+
// 获取Flow当前版本开始节点
|
|
2747
|
+
const start_step = flow.current.steps.find(step => step.step_type === 'start');
|
|
2748
|
+
|
|
2749
|
+
const instance_traces = instance.traces;
|
|
2750
|
+
instance_traces[0].approves[0].description = description;
|
|
2751
|
+
|
|
2752
|
+
let setObj = {};
|
|
2753
|
+
let flow_has_upgrade = false;
|
|
2754
|
+
|
|
2755
|
+
// 判断:applicant和原instance的applicant是否相等
|
|
2756
|
+
if (applicant_id !== instance.applicant) {
|
|
2757
|
+
// applicant和原instance的applicant不相等
|
|
2758
|
+
const user = await UUFlowManager.getUser(applicant_id);
|
|
2759
|
+
const applicant = await UUFlowManager.getSpaceUser(space_id, applicant_id);
|
|
2760
|
+
// 获取applicant所在的部门信息
|
|
2761
|
+
const applicant_org_info = await UUFlowManager.getSpaceUserOrgInfo(applicant);
|
|
2762
|
+
|
|
2763
|
+
// 修改instance的applicant,applicant_name,同时修改开始结点的approve的user为:applicant,user_name
|
|
2764
|
+
setObj.applicant = applicant_id;
|
|
2765
|
+
setObj.applicant_name = user.name;
|
|
2766
|
+
setObj.applicant_organization = applicant_org_info.organization;
|
|
2767
|
+
setObj.applicant_organization_name = applicant_org_info.organization_name;
|
|
2768
|
+
setObj.applicant_organization_fullname = applicant_org_info.organization_fullname;
|
|
2769
|
+
setObj.applicant_company = applicant.company_id;
|
|
2770
|
+
instance_traces[0].approves[0].user = applicant_id;
|
|
2771
|
+
instance_traces[0].approves[0].user_name = user.name;
|
|
2772
|
+
}
|
|
2773
|
+
|
|
2774
|
+
// 判断流程是否已升级,instance["flow_version"] == flow["current"]["_id"]表示流程未升级
|
|
2775
|
+
if (instance.flow_version === flow.current._id) {
|
|
2776
|
+
// 判断next_steps是否为空,不为空则写入到当前approve的next_steps中
|
|
2777
|
+
if (next_steps) {
|
|
2778
|
+
instance_traces[0].approves[0].next_steps = next_steps;
|
|
2779
|
+
}
|
|
2780
|
+
} else {
|
|
2781
|
+
// 流程已升级
|
|
2782
|
+
flow_has_upgrade = true;
|
|
2783
|
+
// 更新instance记录
|
|
2784
|
+
setObj.flow_version = flow.current._id;
|
|
2785
|
+
setObj.form_version = flow.current.form_version;
|
|
2786
|
+
// 清空原来的值,存入当前最新版flow中开始节点的step_id
|
|
2787
|
+
instance_traces[0].step = start_step._id;
|
|
2788
|
+
instance_traces[0].name = start_step.name;
|
|
2789
|
+
}
|
|
2790
|
+
|
|
2791
|
+
// 调整approves的values删除values中在当前步骤中没有编辑权限的字段值
|
|
2792
|
+
instance_traces[0].approves[0].values = await UUFlowManager.getApproveValues(
|
|
2793
|
+
values,
|
|
2794
|
+
step.permissions,
|
|
2795
|
+
instance.form,
|
|
2796
|
+
instance.form_version
|
|
2797
|
+
);
|
|
2798
|
+
|
|
2799
|
+
setObj.traces = instance_traces;
|
|
2800
|
+
setObj.modified = new Date();
|
|
2801
|
+
setObj.modified_by = current_user;
|
|
2802
|
+
|
|
2803
|
+
await db.instances.updateOne(
|
|
2804
|
+
{ _id: instance_id },
|
|
2805
|
+
{ $set: setObj }
|
|
2806
|
+
);
|
|
2807
|
+
|
|
2808
|
+
if (flow_has_upgrade) {
|
|
2809
|
+
return {
|
|
2810
|
+
alerts: t('flow.point_upgraded', {}, lang)
|
|
2811
|
+
};
|
|
2812
|
+
}
|
|
2813
|
+
// ================end================
|
|
2814
|
+
|
|
2815
|
+
// 使用最新的instance
|
|
2816
|
+
const updatedInstance = await UUFlowManager.getInstance(instance_id);
|
|
2817
|
+
// 判断一个instance是否为拟稿状态
|
|
2818
|
+
await UUFlowManager.isInstanceDraft(updatedInstance, lang);
|
|
2819
|
+
|
|
2820
|
+
const traces = updatedInstance.traces;
|
|
2821
|
+
const upObj = {};
|
|
2822
|
+
const now = new Date();
|
|
2823
|
+
|
|
2824
|
+
if (!approve.next_steps || approve.next_steps.length === 0) {
|
|
2825
|
+
throw new Error('还未指定下一步和处理人,提交失败');
|
|
2826
|
+
}
|
|
2827
|
+
|
|
2828
|
+
// 验证next_steps里面是否只有一个step
|
|
2829
|
+
if (approve.next_steps.length > 1) {
|
|
2830
|
+
throw new Error('不能指定多个后续步骤');
|
|
2831
|
+
}
|
|
2832
|
+
|
|
2833
|
+
const nextSteps = await UUFlowManager.getNextSteps(updatedInstance, flow, step, "");
|
|
2834
|
+
approve.next_steps.forEach(approve_next_step => {
|
|
2835
|
+
if (!nextSteps.includes(approve_next_step.step)) {
|
|
2836
|
+
throw new Error('下一步步骤不合法');
|
|
2837
|
+
}
|
|
2838
|
+
});
|
|
2839
|
+
|
|
2840
|
+
// 校验下一步处理人user_accepted = true
|
|
2841
|
+
for (const next_step_user of approve.next_steps[0].users) {
|
|
2842
|
+
await UUFlowManager.getSpaceUser(space_id, next_step_user);
|
|
2843
|
+
}
|
|
2844
|
+
|
|
2845
|
+
const next_step = await UUFlowManager.getStep(updatedInstance, flow, approve.next_steps[0].step);
|
|
2846
|
+
let nextTrace = null;
|
|
2847
|
+
|
|
2848
|
+
// 判断next_step是否为结束结点
|
|
2849
|
+
if (next_step.step_type === "end") {
|
|
2850
|
+
// 更新approve
|
|
2851
|
+
traces[0].approves[0].judge = "submitted";
|
|
2852
|
+
traces[0].approves[0].is_finished = true;
|
|
2853
|
+
traces[0].approves[0].finish_date = now;
|
|
2854
|
+
traces[0].approves[0].cost_time = now - traces[0].approves[0].start_date;
|
|
2855
|
+
|
|
2856
|
+
// 更新trace
|
|
2857
|
+
traces[0].is_finished = true;
|
|
2858
|
+
traces[0].judge = "submitted";
|
|
2859
|
+
traces[0].finish_date = now;
|
|
2860
|
+
|
|
2861
|
+
// 插入下一步trace记录
|
|
2862
|
+
const newTrace = {
|
|
2863
|
+
_id: _makeNewID(),
|
|
2864
|
+
instance: instance_id,
|
|
2865
|
+
previous_trace_ids: [trace._id],
|
|
2866
|
+
is_finished: true,
|
|
2867
|
+
step: next_step._id,
|
|
2868
|
+
name: next_step.name,
|
|
2869
|
+
start_date: now,
|
|
2870
|
+
finish_date: now
|
|
2871
|
+
};
|
|
2872
|
+
|
|
2873
|
+
// 更新instance记录
|
|
2874
|
+
// 申请单名称按照固定规则生成申请单名称:流程名称+' '+申请单编号
|
|
2875
|
+
upObj.submit_date = now;
|
|
2876
|
+
upObj.state = "completed";
|
|
2877
|
+
upObj.values = await UUFlowManager.getUpdatedValues(await UUFlowManager.getInstance(instance_id));
|
|
2878
|
+
upObj.code = flow.current_no + 1 + "";
|
|
2879
|
+
updatedInstance.code = upObj.code;
|
|
2880
|
+
updatedInstance.values = upObj.values;
|
|
2881
|
+
upObj.name = await UUFlowManager.getInstanceName(updatedInstance);
|
|
2882
|
+
upObj.modified = now;
|
|
2883
|
+
upObj.modified_by = current_user;
|
|
2884
|
+
upObj.inbox_users = [];
|
|
2885
|
+
upObj.outbox_users = [...new Set([current_user, traces[0].approves[0].user])];
|
|
2886
|
+
traces.push(newTrace);
|
|
2887
|
+
upObj.traces = traces;
|
|
2888
|
+
upObj.finish_date = now;
|
|
2889
|
+
upObj.current_step_name = next_step.name;
|
|
2890
|
+
upObj.final_decision = "approved";
|
|
2891
|
+
upObj.current_step_auto_submit = false;
|
|
2892
|
+
} else {
|
|
2893
|
+
// 取得下一步处理人
|
|
2894
|
+
const next_step_users = approve.next_steps[0].users;
|
|
2895
|
+
|
|
2896
|
+
// 判断nextsteps.step.users是否为空
|
|
2897
|
+
if (!next_step_users || next_step_users.length === 0) {
|
|
2898
|
+
throw new Error('未指定下一步处理人');
|
|
2899
|
+
}
|
|
2900
|
+
|
|
2901
|
+
if (next_step_users.length > 1 && next_step.step_type !== "counterSign") {
|
|
2902
|
+
throw new Error('不能指定多个处理人');
|
|
2903
|
+
}
|
|
2904
|
+
|
|
2905
|
+
// 验证下一步处理人next_user是否合法
|
|
2906
|
+
const checkUsers = await await HandlersManager.getHandlers(instance_id, approve.next_steps[0].step, current_user);
|
|
2907
|
+
|
|
2908
|
+
if (!UUFlowManager.checkNestStepUsersIsValid(next_step_users, checkUsers, next_step)) {
|
|
2909
|
+
throw new Error('指定的下一步处理人有误');
|
|
2910
|
+
}
|
|
2911
|
+
|
|
2912
|
+
// 若合法,执行流转操作
|
|
2913
|
+
// 更新approve
|
|
2914
|
+
traces[0].approves[0].judge = "submitted";
|
|
2915
|
+
traces[0].approves[0].is_finished = true;
|
|
2916
|
+
traces[0].approves[0].finish_date = now;
|
|
2917
|
+
traces[0].approves[0].cost_time = traces[0].approves[0].finish_date - traces[0].approves[0].start_date;
|
|
2918
|
+
|
|
2919
|
+
// 更新trace
|
|
2920
|
+
traces[0].is_finished = true;
|
|
2921
|
+
traces[0].finish_date = now;
|
|
2922
|
+
traces[0].judge = "submitted";
|
|
2923
|
+
|
|
2924
|
+
// 插入下一步trace记录
|
|
2925
|
+
nextTrace = {
|
|
2926
|
+
_id: _makeNewID(),
|
|
2927
|
+
instance: instance_id,
|
|
2928
|
+
previous_trace_ids: [trace._id],
|
|
2929
|
+
is_finished: false,
|
|
2930
|
+
step: next_step._id,
|
|
2931
|
+
name: next_step.name,
|
|
2932
|
+
start_date: now,
|
|
2933
|
+
due_date: await UUFlowManager.getDueDate(next_step.timeout_hours, space_id),
|
|
2934
|
+
approves: []
|
|
2935
|
+
};
|
|
2936
|
+
|
|
2937
|
+
const updated_values = await UUFlowManager.getUpdatedValues(await UUFlowManager.getInstance(instance_id));
|
|
2938
|
+
|
|
2939
|
+
// 插入下一步trace.approve记录
|
|
2940
|
+
for (let idx = 0; idx < next_step_users.length; idx++) {
|
|
2941
|
+
const next_step_user_id = next_step_users[idx];
|
|
2942
|
+
const nextApprove = {
|
|
2943
|
+
_id: _makeNewID(),
|
|
2944
|
+
instance: instance_id,
|
|
2945
|
+
trace: nextTrace._id,
|
|
2946
|
+
is_finished: false,
|
|
2947
|
+
user: next_step_user_id
|
|
2948
|
+
};
|
|
2949
|
+
|
|
2950
|
+
const user_info = await UUFlowManager.getUser(next_step_user_id);
|
|
2951
|
+
let handler_id = next_step_user_id;
|
|
2952
|
+
let handler_info = user_info;
|
|
2953
|
+
|
|
2954
|
+
const agent = await UUFlowManager.getAgent(space_id, next_step_user_id);
|
|
2955
|
+
if (agent) {
|
|
2956
|
+
next_step_users[idx] = agent;
|
|
2957
|
+
handler_id = agent;
|
|
2958
|
+
handler_info = await UUFlowManager.getUser(agent);
|
|
2959
|
+
nextApprove.agent = agent;
|
|
2960
|
+
}
|
|
2961
|
+
|
|
2962
|
+
nextApprove.user_name = user_info.name;
|
|
2963
|
+
nextApprove.handler = handler_id;
|
|
2964
|
+
nextApprove.handler_name = handler_info.name;
|
|
2965
|
+
|
|
2966
|
+
const next_step_space_user = await UUFlowManager.getSpaceUser(space_id, handler_id);
|
|
2967
|
+
// 获取next_step_user所在的部门信息
|
|
2968
|
+
const next_step_user_org_info = await UUFlowManager.getSpaceUserOrgInfo(next_step_space_user);
|
|
2969
|
+
|
|
2970
|
+
nextApprove.handler_organization = next_step_user_org_info.organization;
|
|
2971
|
+
nextApprove.handler_organization_name = next_step_user_org_info.organization_name;
|
|
2972
|
+
nextApprove.handler_organization_fullname = next_step_user_org_info.organization_fullname;
|
|
2973
|
+
nextApprove.start_date = now;
|
|
2974
|
+
nextApprove.due_date = nextTrace.due_date;
|
|
2975
|
+
nextApprove.is_read = false;
|
|
2976
|
+
nextApprove.is_error = false;
|
|
2977
|
+
nextApprove.values = {};
|
|
2978
|
+
|
|
2979
|
+
await UUFlowManager.setRemindInfo(updated_values, nextApprove);
|
|
2980
|
+
nextTrace.approves.push(nextApprove);
|
|
2981
|
+
}
|
|
2982
|
+
|
|
2983
|
+
// 更新instance记录
|
|
2984
|
+
upObj.name = instance_name;
|
|
2985
|
+
upObj.submit_date = now;
|
|
2986
|
+
upObj.state = "pending";
|
|
2987
|
+
upObj.values = updated_values;
|
|
2988
|
+
upObj.inbox_users = next_step_users;
|
|
2989
|
+
upObj.modified = now;
|
|
2990
|
+
upObj.modified_by = current_user;
|
|
2991
|
+
upObj.code = flow.current_no + 1 + "";
|
|
2992
|
+
updatedInstance.code = upObj.code;
|
|
2993
|
+
updatedInstance.values = upObj.values;
|
|
2994
|
+
upObj.name = await UUFlowManager.getInstanceName(updatedInstance);
|
|
2995
|
+
traces.push(nextTrace);
|
|
2996
|
+
upObj.traces = traces;
|
|
2997
|
+
upObj.outbox_users = [];
|
|
2998
|
+
upObj.current_step_name = next_step.name;
|
|
2999
|
+
upObj.current_step_auto_submit = await UUFlowManager.getCurrentStepAutoSubmit(flow.timeout_auto_submit, next_step.lines);
|
|
3000
|
+
}
|
|
3001
|
+
|
|
3002
|
+
upObj.keywords = await UUFlowManager.caculateKeywords(upObj.values, form, instance.form_version);
|
|
3003
|
+
// 计算extras
|
|
3004
|
+
upObj.extras = await UUFlowManager.caculateExtras(upObj.values, form, instance.form_version);
|
|
3005
|
+
|
|
3006
|
+
// 如果不是转发、分发,新建instance_tasks
|
|
3007
|
+
if (!instance.forward_from_instance && !instance.distribute_from_instance) {
|
|
3008
|
+
await insert_instance_tasks(instance_id, traces[0]._id, traces[0].approves[0]._id);
|
|
3009
|
+
}
|
|
3010
|
+
|
|
3011
|
+
await getObject('instances').update(instance_id, upObj);
|
|
3012
|
+
|
|
3013
|
+
await db.flows.updateOne(
|
|
3014
|
+
{ _id: flow._id },
|
|
3015
|
+
{ $set: { current_no: flow.current_no + 1 } }
|
|
3016
|
+
);
|
|
3017
|
+
|
|
3018
|
+
await update_instance_tasks(instance_id, traces[0]._id, traces[0].approves[0]._id);
|
|
3019
|
+
|
|
3020
|
+
if (nextTrace) {
|
|
3021
|
+
// 生成新记录
|
|
3022
|
+
const approveIds = nextTrace.approves.map(a => a._id);
|
|
3023
|
+
await insert_many_instance_tasks(instance_id, nextTrace._id, approveIds);
|
|
3024
|
+
}
|
|
3025
|
+
|
|
3026
|
+
if (next_step.step_type !== "end") {
|
|
3027
|
+
const finalInstance = await UUFlowManager.getInstance(instance_id);
|
|
3028
|
+
// 发送短消息给申请人
|
|
3029
|
+
await pushManager.send_instance_notification("first_submit_applicant", finalInstance, "", user_info, null, flow);
|
|
3030
|
+
// 发送消息给下一步处理人
|
|
3031
|
+
await pushManager.send_instance_notification("first_submit_inbox", finalInstance, "", user_info, null, flow);
|
|
3032
|
+
}
|
|
3033
|
+
|
|
3034
|
+
if (process.env.STEEDOS_DEBUG) {
|
|
3035
|
+
console.timeEnd('submit_instance');
|
|
3036
|
+
}
|
|
3037
|
+
|
|
3038
|
+
return {};
|
|
3039
|
+
};
|
|
3040
|
+
|
|
3041
|
+
/////////
|
|
3042
|
+
|
|
3043
|
+
UUFlowManager.get_SpaceChangeSet = async function (formids, is_admin, sync_token) {
|
|
3044
|
+
const db = {
|
|
3045
|
+
instances: await getCollection('instances'),
|
|
3046
|
+
deleted_instances: await getCollection('deleted_instances'),
|
|
3047
|
+
users: await getCollection('users')
|
|
3048
|
+
};
|
|
3049
|
+
|
|
3050
|
+
sync_token = new Date(Number(sync_token) * 1000);
|
|
3051
|
+
const changeSet = {
|
|
3052
|
+
sync_token: new Date().getTime() / 1000,
|
|
3053
|
+
inserts: {
|
|
3054
|
+
Spaces: [],
|
|
3055
|
+
Users: [],
|
|
3056
|
+
SpaceUsers: [],
|
|
3057
|
+
Organizations: [],
|
|
3058
|
+
Roles: [],
|
|
3059
|
+
Positions: [],
|
|
3060
|
+
Forms: [],
|
|
3061
|
+
Flows: [],
|
|
3062
|
+
Instances: []
|
|
3063
|
+
},
|
|
3064
|
+
updates: {
|
|
3065
|
+
Spaces: [],
|
|
3066
|
+
Users: [],
|
|
3067
|
+
SpaceUsers: [],
|
|
3068
|
+
Organizations: [],
|
|
3069
|
+
Roles: [],
|
|
3070
|
+
Positions: [],
|
|
3071
|
+
Forms: [],
|
|
3072
|
+
Flows: [],
|
|
3073
|
+
Instances: []
|
|
3074
|
+
},
|
|
3075
|
+
deletes: {
|
|
3076
|
+
Spaces: [],
|
|
3077
|
+
Users: [],
|
|
3078
|
+
SpaceUsers: [],
|
|
3079
|
+
Organizations: [],
|
|
3080
|
+
Roles: [],
|
|
3081
|
+
Positions: [],
|
|
3082
|
+
Forms: [],
|
|
3083
|
+
Flows: [],
|
|
3084
|
+
Instances: []
|
|
3085
|
+
}
|
|
3086
|
+
};
|
|
3087
|
+
|
|
3088
|
+
if (formids?.trim()) {
|
|
3089
|
+
const formids_ary = formids.split(",");
|
|
3090
|
+
changeSet.inserts.Instances = await db.instances.find({
|
|
3091
|
+
form: { $in: formids_ary },
|
|
3092
|
+
created: { $gt: sync_token }
|
|
3093
|
+
}).toArray();
|
|
3094
|
+
|
|
3095
|
+
changeSet.updates.Instances = await db.instances.find({
|
|
3096
|
+
form: { $in: formids_ary },
|
|
3097
|
+
created: { $lte: sync_token },
|
|
3098
|
+
modified: { $gt: sync_token }
|
|
3099
|
+
}).toArray();
|
|
3100
|
+
|
|
3101
|
+
changeSet.deletes.Instances = await db.deleted_instances.find({
|
|
3102
|
+
form: { $in: formids_ary },
|
|
3103
|
+
deleted: { $gt: sync_token }
|
|
3104
|
+
}, {
|
|
3105
|
+
projection: { _id: 1 }
|
|
3106
|
+
}).toArray();
|
|
3107
|
+
} else if (is_admin?.trim()) {
|
|
3108
|
+
changeSet.inserts.Instances = await db.instances.find({
|
|
3109
|
+
created: { $gt: sync_token }
|
|
3110
|
+
}).toArray();
|
|
3111
|
+
|
|
3112
|
+
changeSet.updates.Instances = await db.instances.find({
|
|
3113
|
+
created: { $lte: sync_token },
|
|
3114
|
+
modified: { $gt: sync_token }
|
|
3115
|
+
}).toArray();
|
|
3116
|
+
|
|
3117
|
+
changeSet.deletes.Instances = await db.deleted_instances.find({
|
|
3118
|
+
deleted: { $gt: sync_token }
|
|
3119
|
+
}, {
|
|
3120
|
+
projection: { _id: 1 }
|
|
3121
|
+
}).toArray();
|
|
3122
|
+
}
|
|
3123
|
+
|
|
3124
|
+
// Process submitter and applicant steedos_ids
|
|
3125
|
+
const processInstance = async (ins) => {
|
|
3126
|
+
const [submitter, applicant] = await Promise.all([
|
|
3127
|
+
db.users.findOne({ _id: ins.submitter }, { projection: { steedos_id: 1 } }),
|
|
3128
|
+
db.users.findOne({ _id: ins.applicant }, { projection: { steedos_id: 1 } })
|
|
3129
|
+
]);
|
|
3130
|
+
|
|
3131
|
+
if (submitter) {
|
|
3132
|
+
ins.submitter_steedos_id = submitter.steedos_id;
|
|
3133
|
+
}
|
|
3134
|
+
if (applicant) {
|
|
3135
|
+
ins.applicant_steedos_id = applicant.steedos_id;
|
|
3136
|
+
}
|
|
3137
|
+
return ins;
|
|
3138
|
+
};
|
|
3139
|
+
|
|
3140
|
+
await Promise.all([
|
|
3141
|
+
...changeSet.inserts.Instances.map(processInstance),
|
|
3142
|
+
...changeSet.updates.Instances.map(processInstance)
|
|
3143
|
+
]);
|
|
3144
|
+
|
|
3145
|
+
return { ChangeSet: changeSet };
|
|
3146
|
+
};
|
|
3147
|
+
|
|
3148
|
+
UUFlowManager.setRemindInfo = async function (values, approve) {
|
|
3149
|
+
if (!values || !approve?.start_date) return;
|
|
3150
|
+
|
|
3151
|
+
let remind_date = null;
|
|
3152
|
+
let deadline = null;
|
|
3153
|
+
const start_date = approve.start_date;
|
|
3154
|
+
|
|
3155
|
+
if (values.priority && values.deadline) {
|
|
3156
|
+
const validPriorities = ["普通", "办文", "紧急", "特急"];
|
|
3157
|
+
if (!validPriorities.includes(values.priority)) return;
|
|
3158
|
+
|
|
3159
|
+
deadline = new Date(values.deadline);
|
|
3160
|
+
if (isNaN(deadline.getTime())) return;
|
|
3161
|
+
|
|
3162
|
+
const priority = values.priority;
|
|
3163
|
+
|
|
3164
|
+
if (priority === "普通") {
|
|
3165
|
+
remind_date = WorkingTime.caculateWorkingTime(start_date, 3);
|
|
3166
|
+
} else {
|
|
3167
|
+
const halfDay = WorkingTime.caculatePlusHalfWorkingDay(start_date);
|
|
3168
|
+
const oneDay = WorkingTime.caculateWorkingTime(start_date, 1);
|
|
3169
|
+
|
|
3170
|
+
if (halfDay > deadline) {
|
|
3171
|
+
remind_date = WorkingTime.caculatePlusHalfWorkingDay(start_date, true);
|
|
3172
|
+
} else if (oneDay > deadline) {
|
|
3173
|
+
const calculateDate = (base_date) => {
|
|
3174
|
+
const plus_halfday_date = WorkingTime.caculatePlusHalfWorkingDay(base_date);
|
|
3175
|
+
if (plus_halfday_date > deadline) {
|
|
3176
|
+
remind_date = base_date;
|
|
3177
|
+
} else {
|
|
3178
|
+
calculateDate(WorkingTime.caculatePlusHalfWorkingDay(base_date, true));
|
|
3179
|
+
}
|
|
3180
|
+
};
|
|
3181
|
+
calculateDate(start_date);
|
|
3182
|
+
} else {
|
|
3183
|
+
remind_date = priority === "办文" ? oneDay : halfDay;
|
|
3184
|
+
}
|
|
3185
|
+
|
|
3186
|
+
if (priority === "紧急" || priority === "特急") {
|
|
3187
|
+
const instance = db.instances.findOne({_id: approve.instance});
|
|
3188
|
+
if (instance?.state === 'draft') {
|
|
3189
|
+
const flow = db.flows.findOne(
|
|
3190
|
+
{ _id: instance.flow },
|
|
3191
|
+
{ fields: { current_no: 1 } }
|
|
3192
|
+
);
|
|
3193
|
+
if (flow) {
|
|
3194
|
+
instance.code = flow.current_no + 1 + '';
|
|
3195
|
+
}
|
|
3196
|
+
}
|
|
3197
|
+
instance.values = values;
|
|
3198
|
+
const iname = await UUFlowManager.getInstanceName(instance);
|
|
3199
|
+
UUFlowManager.sendRemindSMS(
|
|
3200
|
+
iname,
|
|
3201
|
+
deadline,
|
|
3202
|
+
[approve.user],
|
|
3203
|
+
instance.space,
|
|
3204
|
+
instance._id
|
|
3205
|
+
);
|
|
3206
|
+
}
|
|
3207
|
+
}
|
|
3208
|
+
} else {
|
|
3209
|
+
remind_date = WorkingTime.caculateWorkingTime(start_date, 3);
|
|
3210
|
+
}
|
|
3211
|
+
|
|
3212
|
+
approve.deadline = deadline;
|
|
3213
|
+
approve.remind_date = remind_date;
|
|
3214
|
+
approve.reminded_count = 0;
|
|
3215
|
+
};
|
|
3216
|
+
|
|
3217
|
+
UUFlowManager.sendRemindSMS = async function (ins_name, deadline, users_id, space_id, ins_id) {
|
|
3218
|
+
if (!ins_name || !deadline || !users_id?.length || !space_id || !ins_id) return;
|
|
3219
|
+
|
|
3220
|
+
const skip_users = settings?.remind?.skip_users || [];
|
|
3221
|
+
const send_users = users_id.filter(uid => !skip_users.includes(uid));
|
|
3222
|
+
|
|
3223
|
+
const name = ins_name.length > 15 ? ins_name.substr(0, 12) + '...' : ins_name;
|
|
3224
|
+
const users = await db.users.find({
|
|
3225
|
+
_id: { $in: [...new Set(send_users)] },
|
|
3226
|
+
mobile: { $exists: true },
|
|
3227
|
+
mobile_verified: true
|
|
3228
|
+
}, {
|
|
3229
|
+
projection: { mobile: 1, utcOffset: 1, locale: 1, name: 1 }
|
|
3230
|
+
}).toArray();
|
|
3231
|
+
|
|
3232
|
+
await Promise.all(users.map(async (user) => {
|
|
3233
|
+
const utcOffset = user.utcOffset ?? 8;
|
|
3234
|
+
const params = {
|
|
3235
|
+
instance_name: name,
|
|
3236
|
+
deadline: moment(deadline).utcOffset(utcOffset).format('MM-DD HH:mm')
|
|
3237
|
+
};
|
|
3238
|
+
|
|
3239
|
+
const lang = user.locale === 'zh-cn' ? 'zh-CN' : 'en';
|
|
3240
|
+
|
|
3241
|
+
// Send SMS
|
|
3242
|
+
await SMSQueue.send({
|
|
3243
|
+
Format: 'JSON',
|
|
3244
|
+
Action: 'SingleSendSms',
|
|
3245
|
+
ParamString: JSON.stringify(params),
|
|
3246
|
+
RecNum: user.mobile,
|
|
3247
|
+
SignName: 'OA系统',
|
|
3248
|
+
TemplateCode: 'SMS_67200967',
|
|
3249
|
+
msg: t('sms.remind.template', {
|
|
3250
|
+
instance_name: ins_name,
|
|
3251
|
+
deadline: params.deadline,
|
|
3252
|
+
open_app_url: Meteor.absoluteUrl() + `workflow.html?space_id=${space_id}&ins_id=${ins_id}`
|
|
3253
|
+
}, lang)
|
|
3254
|
+
});
|
|
3255
|
+
|
|
3256
|
+
// Send push notification
|
|
3257
|
+
const notification = {
|
|
3258
|
+
createdAt: new Date(),
|
|
3259
|
+
createdBy: '<SERVER>',
|
|
3260
|
+
from: 'workflow',
|
|
3261
|
+
title: user.name,
|
|
3262
|
+
text: t('instance.push.body.remind', {
|
|
3263
|
+
instance_name: ins_name,
|
|
3264
|
+
deadline: params.deadline
|
|
3265
|
+
}, lang),
|
|
3266
|
+
payload: {
|
|
3267
|
+
space: space_id,
|
|
3268
|
+
instance: ins_id,
|
|
3269
|
+
host: Meteor.absoluteUrl().slice(0, -1),
|
|
3270
|
+
requireInteraction: true
|
|
3271
|
+
},
|
|
3272
|
+
query: {
|
|
3273
|
+
userId: user._id,
|
|
3274
|
+
appName: 'workflow'
|
|
3275
|
+
}
|
|
3276
|
+
};
|
|
3277
|
+
await Push.send(notification);
|
|
3278
|
+
}));
|
|
3279
|
+
};
|
|
3280
|
+
|
|
3281
|
+
UUFlowManager.checkMainAttach = async function (instance_id, name) {
|
|
3282
|
+
const main = await cfs.instances.findOne({
|
|
3283
|
+
'metadata.instance': instance_id,
|
|
3284
|
+
'metadata.main': true,
|
|
3285
|
+
'metadata.current': true
|
|
3286
|
+
});
|
|
3287
|
+
|
|
3288
|
+
if (main) {
|
|
3289
|
+
const ins = await db.instances.findOne(
|
|
3290
|
+
{ _id: instance_id },
|
|
3291
|
+
{ projection: { name: 1 } }
|
|
3292
|
+
);
|
|
3293
|
+
|
|
3294
|
+
let new_ins_name = (name || ins?.name || '')
|
|
3295
|
+
.replace(/\r|\n/g, "")
|
|
3296
|
+
.replace(/\?|\*|\:|\"|\<|\>|\\|\/|\|/g, "");
|
|
3297
|
+
|
|
3298
|
+
const main_name_split = main.name().split('.');
|
|
3299
|
+
main_name_split.pop();
|
|
3300
|
+
|
|
3301
|
+
if (new_ins_name !== main_name_split.join("")) {
|
|
3302
|
+
const file_name = `${new_ins_name}.${main.extension()}`;
|
|
3303
|
+
await main.update({
|
|
3304
|
+
$set: {
|
|
3305
|
+
'original.name': file_name,
|
|
3306
|
+
'copies.instances.name': file_name
|
|
3307
|
+
}
|
|
3308
|
+
});
|
|
3309
|
+
}
|
|
3310
|
+
}
|
|
3311
|
+
};
|
|
3312
|
+
|
|
3313
|
+
UUFlowManager.caculateKeywords = function (values = {}, form, form_version) {
|
|
3314
|
+
if (_.isEmpty(values)) return "";
|
|
3315
|
+
|
|
3316
|
+
const keywords = [];
|
|
3317
|
+
let form_v = null;
|
|
3318
|
+
|
|
3319
|
+
if (form_version === form.current._id) {
|
|
3320
|
+
form_v = form.current;
|
|
3321
|
+
} else {
|
|
3322
|
+
form_v = form.historys.find(form_h => form_version === form_h._id);
|
|
3323
|
+
}
|
|
3324
|
+
|
|
3325
|
+
if (!form_v) return "";
|
|
3326
|
+
|
|
3327
|
+
form_v.fields.forEach(field => {
|
|
3328
|
+
if (!field.is_searchable) return;
|
|
3329
|
+
|
|
3330
|
+
const value = values[field.code];
|
|
3331
|
+
if (!value) return;
|
|
3332
|
+
|
|
3333
|
+
switch (field.type) {
|
|
3334
|
+
case 'input':
|
|
3335
|
+
case 'email':
|
|
3336
|
+
case 'url':
|
|
3337
|
+
case 'number':
|
|
3338
|
+
case 'select':
|
|
3339
|
+
case 'radio':
|
|
3340
|
+
case 'multiSelect':
|
|
3341
|
+
keywords.push(value);
|
|
3342
|
+
break;
|
|
3343
|
+
|
|
3344
|
+
case 'user':
|
|
3345
|
+
case 'group':
|
|
3346
|
+
if (field.is_multiselect) {
|
|
3347
|
+
if (Array.isArray(value)) {
|
|
3348
|
+
value.forEach(singleV => {
|
|
3349
|
+
if (singleV?.name) keywords.push(singleV.name);
|
|
3350
|
+
});
|
|
3351
|
+
}
|
|
3352
|
+
} else if (value?.name) {
|
|
3353
|
+
keywords.push(value.name);
|
|
3354
|
+
}
|
|
3355
|
+
break;
|
|
3356
|
+
|
|
3357
|
+
case 'table':
|
|
3358
|
+
if (Array.isArray(value)) {
|
|
3359
|
+
value.forEach(s_value => {
|
|
3360
|
+
field.fields.forEach(s_field => {
|
|
3361
|
+
if (s_field.is_searchable) {
|
|
3362
|
+
const s_value_field = s_value[s_field.code];
|
|
3363
|
+
if (!s_value_field) return;
|
|
3364
|
+
|
|
3365
|
+
if (['input', 'email', 'url', 'number', 'select', 'radio', 'multiSelect'].includes(s_field.type)) {
|
|
3366
|
+
keywords.push(s_value_field);
|
|
3367
|
+
} else if (['user', 'group'].includes(s_field.type)) {
|
|
3368
|
+
if (s_field.is_multiselect) {
|
|
3369
|
+
if (Array.isArray(s_value_field)) {
|
|
3370
|
+
s_value_field.forEach(singleV => {
|
|
3371
|
+
if (singleV?.name) keywords.push(singleV.name);
|
|
3372
|
+
});
|
|
3373
|
+
}
|
|
3374
|
+
} else if (s_value_field?.name) {
|
|
3375
|
+
keywords.push(s_value_field.name);
|
|
3376
|
+
}
|
|
3377
|
+
}
|
|
3378
|
+
}
|
|
3379
|
+
});
|
|
3380
|
+
});
|
|
3381
|
+
}
|
|
3382
|
+
break;
|
|
3383
|
+
|
|
3384
|
+
case 'section':
|
|
3385
|
+
field.fields.forEach(s_field => {
|
|
3386
|
+
if (s_field.is_searchable) {
|
|
3387
|
+
const s_value = values[s_field.code];
|
|
3388
|
+
if (!s_value) return;
|
|
3389
|
+
|
|
3390
|
+
if (['input', 'email', 'url', 'number', 'select', 'radio', 'multiSelect'].includes(s_field.type)) {
|
|
3391
|
+
keywords.push(s_value);
|
|
3392
|
+
} else if (['user', 'group'].includes(s_field.type)) {
|
|
3393
|
+
if (s_field.is_multiselect) {
|
|
3394
|
+
if (Array.isArray(s_value)) {
|
|
3395
|
+
s_value.forEach(singleV => {
|
|
3396
|
+
if (singleV?.name) keywords.push(singleV.name);
|
|
3397
|
+
});
|
|
3398
|
+
}
|
|
3399
|
+
} else if (s_value?.name) {
|
|
3400
|
+
keywords.push(s_value.name);
|
|
3401
|
+
}
|
|
3402
|
+
}
|
|
3403
|
+
}
|
|
3404
|
+
});
|
|
3405
|
+
break;
|
|
3406
|
+
}
|
|
3407
|
+
});
|
|
3408
|
+
|
|
3409
|
+
return keywords.join(" ");
|
|
3410
|
+
};
|
|
3411
|
+
|
|
3412
|
+
UUFlowManager.checkValueFieldsRequire = function (values = {}, form, form_version) {
|
|
3413
|
+
const require_but_empty_fields = [];
|
|
3414
|
+
let form_v = null;
|
|
3415
|
+
|
|
3416
|
+
if (form_version === form.current._id) {
|
|
3417
|
+
form_v = form.current;
|
|
3418
|
+
} else {
|
|
3419
|
+
form_v = form.historys.find(form_h => form_version === form_h._id);
|
|
3420
|
+
}
|
|
3421
|
+
|
|
3422
|
+
if (!form_v) return require_but_empty_fields;
|
|
3423
|
+
|
|
3424
|
+
form_v.fields.forEach(field => {
|
|
3425
|
+
if (field.type !== 'table') {
|
|
3426
|
+
if (field.is_required && _.isEmpty(values[field.code])) {
|
|
3427
|
+
require_but_empty_fields.push(field.name || field.code);
|
|
3428
|
+
}
|
|
3429
|
+
} else {
|
|
3430
|
+
if (_.isEmpty(values[field.code])) {
|
|
3431
|
+
field.fields.forEach(s_field => {
|
|
3432
|
+
if (s_field.is_required) {
|
|
3433
|
+
require_but_empty_fields.push(s_field.name || s_field.code);
|
|
3434
|
+
}
|
|
3435
|
+
});
|
|
3436
|
+
} else {
|
|
3437
|
+
values[field.code].forEach(s_value => {
|
|
3438
|
+
field.fields.forEach(s_field => {
|
|
3439
|
+
if (s_field.is_required && _.isEmpty(s_value[s_field.code])) {
|
|
3440
|
+
require_but_empty_fields.push(s_field.name || s_field.code);
|
|
3441
|
+
}
|
|
3442
|
+
});
|
|
3443
|
+
});
|
|
3444
|
+
}
|
|
3445
|
+
}
|
|
3446
|
+
});
|
|
3447
|
+
|
|
3448
|
+
return require_but_empty_fields;
|
|
3449
|
+
};
|
|
3450
|
+
|
|
3451
|
+
UUFlowManager.triggerRecordInstanceQueue = async function (ins_id, record_ids, step_name, flow_id, ins_state) {
|
|
3452
|
+
const db = {
|
|
3453
|
+
instance_record_queue: await getCollection('instance_record_queue')
|
|
3454
|
+
};
|
|
3455
|
+
const owColl = await getCollection('object_workflows');
|
|
3456
|
+
const owDoc = await owColl.findOne(
|
|
3457
|
+
{ flow_id: flow_id },
|
|
3458
|
+
{ projection: { sync_type: 1 } }
|
|
3459
|
+
);
|
|
3460
|
+
|
|
3461
|
+
if (owDoc) {
|
|
3462
|
+
const syncType = owDoc.sync_type;
|
|
3463
|
+
if ((!syncType || syncType === 'every_step') || (syncType === 'final_step' && ins_state === 'completed')) {
|
|
3464
|
+
const newObj = {
|
|
3465
|
+
info: {
|
|
3466
|
+
instance_id: ins_id,
|
|
3467
|
+
records: record_ids,
|
|
3468
|
+
step_name: step_name,
|
|
3469
|
+
instance_finish_date: new Date()
|
|
3470
|
+
},
|
|
3471
|
+
sent: false,
|
|
3472
|
+
sending: 0,
|
|
3473
|
+
createdAt: new Date(),
|
|
3474
|
+
createdBy: '<SERVER>'
|
|
3475
|
+
};
|
|
3476
|
+
await db.instance_record_queue.insertOne(newObj);
|
|
3477
|
+
}
|
|
3478
|
+
}
|
|
3479
|
+
};
|
|
3480
|
+
|
|
3481
|
+
UUFlowManager.distributedInstancesRemind = async function (instance) {
|
|
3482
|
+
if (!instance?.distribute_from_instances?.length) return;
|
|
3483
|
+
|
|
3484
|
+
try {
|
|
3485
|
+
const flow = await db.flows.findOne({ _id: instance.flow });
|
|
3486
|
+
const current_trace = instance.traces[instance.traces.length - 1];
|
|
3487
|
+
let next_step_id;
|
|
3488
|
+
|
|
3489
|
+
if (instance.state === "draft") {
|
|
3490
|
+
const next_approves = current_trace?.approves;
|
|
3491
|
+
if (next_approves?.length === 1) {
|
|
3492
|
+
next_step_id = next_approves[0]?.next_steps?.[0]?.step;
|
|
3493
|
+
}
|
|
3494
|
+
} else {
|
|
3495
|
+
next_step_id = current_trace?.step;
|
|
3496
|
+
}
|
|
3497
|
+
|
|
3498
|
+
if (next_step_id) {
|
|
3499
|
+
const next_step = await UUFlowManager.getStep(instance, flow, next_step_id);
|
|
3500
|
+
if (next_step?.step_type === "end") {
|
|
3501
|
+
const original_instacne_id = instance.distribute_from_instances[0];
|
|
3502
|
+
const original_instacne = await db.instances.findOne(
|
|
3503
|
+
{ _id: original_instacne_id },
|
|
3504
|
+
{ projection: { flow: 1, name: 1, space: 1, created_by: 1 } }
|
|
3505
|
+
);
|
|
3506
|
+
|
|
3507
|
+
const original_flow = await db.flows.findOne(
|
|
3508
|
+
{ _id: original_instacne?.flow },
|
|
3509
|
+
{ projection: { distribute_end_notification: 1 } }
|
|
3510
|
+
);
|
|
3511
|
+
|
|
3512
|
+
if (original_flow?.distribute_end_notification) {
|
|
3513
|
+
const original_user = await db.users.findOne(
|
|
3514
|
+
{ _id: instance.created_by }
|
|
3515
|
+
);
|
|
3516
|
+
|
|
3517
|
+
if (original_user) {
|
|
3518
|
+
const lang = original_user.locale === 'zh-cn' ? 'zh-CN' : 'en';
|
|
3519
|
+
const notification = {
|
|
3520
|
+
createdAt: new Date(),
|
|
3521
|
+
createdBy: '<SERVER>',
|
|
3522
|
+
from: 'workflow',
|
|
3523
|
+
title: original_user.name,
|
|
3524
|
+
text: t('instance.push.body.distribute_remind', {
|
|
3525
|
+
instance_name: instance.name
|
|
3526
|
+
}, lang),
|
|
3527
|
+
payload: {
|
|
3528
|
+
space: original_instacne?.space,
|
|
3529
|
+
instance: original_instacne?._id,
|
|
3530
|
+
host: Meteor.absoluteUrl().slice(0, -1),
|
|
3531
|
+
requireInteraction: true
|
|
3532
|
+
},
|
|
3533
|
+
query: {
|
|
3534
|
+
userId: original_user._id,
|
|
3535
|
+
appName: 'workflow'
|
|
3536
|
+
}
|
|
3537
|
+
};
|
|
3538
|
+
await Push.send(notification);
|
|
3539
|
+
}
|
|
3540
|
+
}
|
|
3541
|
+
}
|
|
3542
|
+
}
|
|
3543
|
+
} catch (error) {
|
|
3544
|
+
console.error(error.stack);
|
|
3545
|
+
}
|
|
3546
|
+
};
|
|
3547
|
+
|
|
3548
|
+
UUFlowManager.getAgent = async function (spaceId, fromId) {
|
|
3549
|
+
const coll = await getCollection('process_delegation_rules');
|
|
3550
|
+
const now = new Date();
|
|
3551
|
+
const r = await coll.findOne({
|
|
3552
|
+
space: spaceId,
|
|
3553
|
+
from: fromId,
|
|
3554
|
+
enabled: true,
|
|
3555
|
+
start_time: { $lte: now },
|
|
3556
|
+
end_time: { $gte: now }
|
|
3557
|
+
});
|
|
3558
|
+
return r?.to;
|
|
3559
|
+
};
|
|
3560
|
+
////////////
|
|
3561
|
+
|
|
3562
|
+
UUFlowManager.cancelProcessDelegation = async function (spaceId, toId) {
|
|
3563
|
+
const db = {
|
|
3564
|
+
instances: await getCollection('instances')
|
|
3565
|
+
};
|
|
3566
|
+
|
|
3567
|
+
// Query for inbox users
|
|
3568
|
+
const inboxQuery = {
|
|
3569
|
+
space: spaceId,
|
|
3570
|
+
inbox_users: toId,
|
|
3571
|
+
traces: {
|
|
3572
|
+
$elemMatch: {
|
|
3573
|
+
is_finished: false,
|
|
3574
|
+
approves: {
|
|
3575
|
+
$elemMatch: {
|
|
3576
|
+
is_finished: false,
|
|
3577
|
+
agent: toId
|
|
3578
|
+
}
|
|
3579
|
+
}
|
|
3580
|
+
}
|
|
3581
|
+
}
|
|
3582
|
+
};
|
|
3583
|
+
|
|
3584
|
+
const inboxInstances = await db.instances.find(inboxQuery, {
|
|
3585
|
+
projection: {
|
|
3586
|
+
inbox_users: 1,
|
|
3587
|
+
traces: 1,
|
|
3588
|
+
state: 1
|
|
3589
|
+
}
|
|
3590
|
+
}).toArray();
|
|
3591
|
+
|
|
3592
|
+
await Promise.all(inboxInstances.map(async (ins) => {
|
|
3593
|
+
const trace = ins.traces.find(t => !t.is_finished);
|
|
3594
|
+
if (!trace) return;
|
|
3595
|
+
|
|
3596
|
+
await Promise.all(trace.approves.map(async (a, idx) => {
|
|
3597
|
+
if (!a.is_finished) {
|
|
3598
|
+
if (a.agent === toId) {
|
|
3599
|
+
const next_step_space_user = await UUFlowManager.getSpaceUser(spaceId, a.user);
|
|
3600
|
+
const next_step_user_org_info = await UUFlowManager.getSpaceUserOrgInfo(next_step_space_user);
|
|
3601
|
+
|
|
3602
|
+
const idxStr = `traces.$.approves.${idx}.`;
|
|
3603
|
+
const setObj = {
|
|
3604
|
+
[idxStr + 'handler']: a.user,
|
|
3605
|
+
[idxStr + 'handler_name']: a.user_name,
|
|
3606
|
+
[idxStr + 'handler_organization']: next_step_user_org_info.organization,
|
|
3607
|
+
[idxStr + 'handler_organization_name']: next_step_user_org_info.organization_name,
|
|
3608
|
+
[idxStr + 'handler_organization_fullname']: next_step_user_org_info.organization_fullname,
|
|
3609
|
+
[idxStr + 'agent']: null,
|
|
3610
|
+
inbox_users: ins.inbox_users.map(u => u === toId ? a.user : u)
|
|
3611
|
+
};
|
|
3612
|
+
|
|
3613
|
+
if (ins.state === 'draft') {
|
|
3614
|
+
setObj.submitter = a.user;
|
|
3615
|
+
setObj.submitter_name = a.user_name;
|
|
3616
|
+
}
|
|
3617
|
+
|
|
3618
|
+
await db.instances.updateOne({
|
|
3619
|
+
_id: ins._id,
|
|
3620
|
+
inbox_users: toId,
|
|
3621
|
+
'traces._id': a.trace
|
|
3622
|
+
}, { $set: setObj });
|
|
3623
|
+
|
|
3624
|
+
await update_instance_tasks(ins._id, a.trace, a._id);
|
|
3625
|
+
await pushManager.send_message_to_specifyUser('current_user', a.user);
|
|
3626
|
+
await pushManager.send_message_to_specifyUser('current_user', toId);
|
|
3627
|
+
} else if (a.user === toId) {
|
|
3628
|
+
await db.instances.updateOne(
|
|
3629
|
+
{ _id: ins._id },
|
|
3630
|
+
{ $addToSet: { inbox_users: toId } }
|
|
3631
|
+
);
|
|
3632
|
+
}
|
|
3633
|
+
}
|
|
3634
|
+
}));
|
|
3635
|
+
}));
|
|
3636
|
+
|
|
3637
|
+
// Query for CC users
|
|
3638
|
+
const ccQuery = {
|
|
3639
|
+
space: spaceId,
|
|
3640
|
+
cc_users: toId,
|
|
3641
|
+
'traces.approves': {
|
|
3642
|
+
$elemMatch: {
|
|
3643
|
+
is_finished: false,
|
|
3644
|
+
agent: toId,
|
|
3645
|
+
type: 'cc'
|
|
3646
|
+
}
|
|
3647
|
+
}
|
|
3648
|
+
};
|
|
3649
|
+
|
|
3650
|
+
const ccInstances = await db.instances.find(ccQuery, {
|
|
3651
|
+
projection: {
|
|
3652
|
+
cc_users: 1,
|
|
3653
|
+
traces: 1
|
|
3654
|
+
}
|
|
3655
|
+
}).toArray();
|
|
3656
|
+
|
|
3657
|
+
await Promise.all(ccInstances.map(async (ins) => {
|
|
3658
|
+
await Promise.all(ins.traces.map(async (t) => {
|
|
3659
|
+
await Promise.all(t.approves.map(async (a, idx) => {
|
|
3660
|
+
if (!a.is_finished && a.type === 'cc') {
|
|
3661
|
+
if (a.agent === toId) {
|
|
3662
|
+
const next_step_space_user = await UUFlowManager.getSpaceUser(spaceId, a.user);
|
|
3663
|
+
const next_step_user_org_info = await UUFlowManager.getSpaceUserOrgInfo(next_step_space_user);
|
|
3664
|
+
|
|
3665
|
+
const idxStr = `traces.$.approves.${idx}.`;
|
|
3666
|
+
const setObj = {
|
|
3667
|
+
[idxStr + 'handler']: a.user,
|
|
3668
|
+
[idxStr + 'handler_name']: a.user_name,
|
|
3669
|
+
[idxStr + 'handler_organization']: next_step_user_org_info.organization,
|
|
3670
|
+
[idxStr + 'handler_organization_name']: next_step_user_org_info.organization_name,
|
|
3671
|
+
[idxStr + 'handler_organization_fullname']: next_step_user_org_info.organization_fullname,
|
|
3672
|
+
[idxStr + 'agent']: null,
|
|
3673
|
+
cc_users: ins.cc_users.map(u => u === toId ? a.user : u)
|
|
3674
|
+
};
|
|
3675
|
+
|
|
3676
|
+
await db.instances.updateOne({
|
|
3677
|
+
_id: ins._id,
|
|
3678
|
+
cc_users: toId,
|
|
3679
|
+
'traces._id': a.trace
|
|
3680
|
+
}, { $set: setObj });
|
|
3681
|
+
|
|
3682
|
+
await update_instance_tasks(ins._id, a.trace, a._id);
|
|
3683
|
+
await pushManager.send_message_to_specifyUser('current_user', a.user);
|
|
3684
|
+
await pushManager.send_message_to_specifyUser('current_user', toId);
|
|
3685
|
+
} else if (a.user === toId) {
|
|
3686
|
+
await db.instances.updateOne(
|
|
3687
|
+
{ _id: ins._id },
|
|
3688
|
+
{ $addToSet: { cc_users: toId } }
|
|
3689
|
+
);
|
|
3690
|
+
}
|
|
3691
|
+
await UUFlowManager.updateCCcount(ins._id);
|
|
3692
|
+
}
|
|
3693
|
+
}));
|
|
3694
|
+
}));
|
|
3695
|
+
}));
|
|
3696
|
+
};
|
|
3697
|
+
|
|
3698
|
+
UUFlowManager.updateCCcount = async function (insId) {
|
|
3699
|
+
const db = {
|
|
3700
|
+
instances: await getCollection('instances')
|
|
3701
|
+
};
|
|
3702
|
+
|
|
3703
|
+
const insDoc = await db.instances.findOne(
|
|
3704
|
+
{ _id: insId },
|
|
3705
|
+
{ projection: { cc_users: 1 } }
|
|
3706
|
+
);
|
|
3707
|
+
|
|
3708
|
+
if (insDoc?.cc_users) {
|
|
3709
|
+
await db.instances.updateOne(
|
|
3710
|
+
{ _id: insId },
|
|
3711
|
+
{ $set: { cc_count: insDoc.cc_users.length } }
|
|
3712
|
+
);
|
|
3713
|
+
}
|
|
3714
|
+
};
|
|
3715
|
+
|
|
3716
|
+
UUFlowManager.timeoutAutoSubmit = async function (ins_id) {
|
|
3717
|
+
const db = {
|
|
3718
|
+
instances: await getCollection('instances')
|
|
3719
|
+
};
|
|
3720
|
+
|
|
3721
|
+
const query = {
|
|
3722
|
+
state: 'pending',
|
|
3723
|
+
current_step_auto_submit: true,
|
|
3724
|
+
traces: {
|
|
3725
|
+
$elemMatch: {
|
|
3726
|
+
is_finished: false,
|
|
3727
|
+
due_date: { $lte: new Date() }
|
|
3728
|
+
}
|
|
3729
|
+
}
|
|
3730
|
+
};
|
|
3731
|
+
|
|
3732
|
+
if (ins_id) {
|
|
3733
|
+
query._id = ins_id;
|
|
3734
|
+
}
|
|
3735
|
+
|
|
3736
|
+
const instances = await db.instances.find(query).toArray();
|
|
3737
|
+
|
|
3738
|
+
await Promise.all(instances.map(async (ins) => {
|
|
3739
|
+
try {
|
|
3740
|
+
const flow_id = ins.flow;
|
|
3741
|
+
const instance_id = ins._id;
|
|
3742
|
+
const trace = ins.traces[ins.traces.length - 1];
|
|
3743
|
+
const flow = await UUFlowManager.getFlow(flow_id);
|
|
3744
|
+
const step = await UUFlowManager.getStep(ins, flow, trace.step);
|
|
3745
|
+
const step_type = step.step_type;
|
|
3746
|
+
|
|
3747
|
+
const toLine = step.lines.find(l => l.timeout_line === true);
|
|
3748
|
+
if (!toLine) return;
|
|
3749
|
+
|
|
3750
|
+
let nextStepId = toLine.to_step;
|
|
3751
|
+
let nextStep = await UUFlowManager.getStep(ins, flow, nextStepId);
|
|
3752
|
+
|
|
3753
|
+
if (nextStep.step_type === 'condition') {
|
|
3754
|
+
const nextSteps = await UUFlowManager.getNextSteps(ins, flow, nextStep, "");
|
|
3755
|
+
console.error(nextSteps);
|
|
3756
|
+
nextStepId = nextSteps[0];
|
|
3757
|
+
nextStep = await UUFlowManager.getStep(ins, flow, nextStepId);
|
|
3758
|
+
}
|
|
3759
|
+
|
|
3760
|
+
const nextUserIds = await await HandlersManager.getHandlers(instance_id, nextStepId);
|
|
3761
|
+
const judge = step_type === "sign" ? "approved" : "submitted";
|
|
3762
|
+
|
|
3763
|
+
const approve_from_client = {
|
|
3764
|
+
instance: instance_id,
|
|
3765
|
+
trace: trace._id,
|
|
3766
|
+
judge: judge,
|
|
3767
|
+
next_steps: [{
|
|
3768
|
+
step: nextStepId,
|
|
3769
|
+
users: nextUserIds
|
|
3770
|
+
}]
|
|
3771
|
+
};
|
|
3772
|
+
|
|
3773
|
+
await Promise.all(trace.approves.map(async (a) => {
|
|
3774
|
+
approve_from_client._id = a._id;
|
|
3775
|
+
const current_user_info = await db.users.findOne(
|
|
3776
|
+
{ _id: a.handler },
|
|
3777
|
+
{ projection: { services: 0 } }
|
|
3778
|
+
);
|
|
3779
|
+
|
|
3780
|
+
const updatedInstance = await UUFlowManager.workflow_engine(
|
|
3781
|
+
approve_from_client,
|
|
3782
|
+
current_user_info,
|
|
3783
|
+
current_user_info._id,
|
|
3784
|
+
true
|
|
3785
|
+
);
|
|
3786
|
+
|
|
3787
|
+
await pushManager.send_instance_notification(
|
|
3788
|
+
"auto_submit_pending_inbox",
|
|
3789
|
+
updatedInstance,
|
|
3790
|
+
"",
|
|
3791
|
+
current_user_info
|
|
3792
|
+
);
|
|
3793
|
+
}));
|
|
3794
|
+
} catch (error) {
|
|
3795
|
+
console.error('AUTO TIMEOUT_AUTO_SUBMIT ERROR: ', error.stack);
|
|
3796
|
+
}
|
|
3797
|
+
}));
|
|
3798
|
+
|
|
3799
|
+
return true;
|
|
3800
|
+
};
|
|
3801
|
+
|
|
3802
|
+
UUFlowManager.relocate = async function (instance_from_client, current_user_info) {
|
|
3803
|
+
const db = {
|
|
3804
|
+
instances: await getCollection('instances'),
|
|
3805
|
+
users: await getCollection('users'),
|
|
3806
|
+
organizations: await getCollection('organizations'),
|
|
3807
|
+
spaces: await getCollection('spaces')
|
|
3808
|
+
};
|
|
3809
|
+
|
|
3810
|
+
const current_user = current_user_info._id;
|
|
3811
|
+
const instance = await UUFlowManager.getInstance(instance_from_client._id);
|
|
3812
|
+
const last_trace = instance.traces[instance.traces.length - 1];
|
|
3813
|
+
|
|
3814
|
+
// Verify permissions
|
|
3815
|
+
const permissions = await PermissionManager.getFlowPermissions(instance.flow, current_user);
|
|
3816
|
+
const space = await db.spaces.findOne(
|
|
3817
|
+
{ _id: instance.space },
|
|
3818
|
+
{ projection: { admins: 1 } }
|
|
3819
|
+
);
|
|
3820
|
+
|
|
3821
|
+
if (!permissions.includes("admin") && !space?.admins?.includes(current_user)) {
|
|
3822
|
+
throw new Error('用户没有对当前流程的管理权限');
|
|
3823
|
+
}
|
|
3824
|
+
|
|
3825
|
+
const space_id = instance.space;
|
|
3826
|
+
const instance_id = last_trace.instance;
|
|
3827
|
+
const inbox_users = instance.inbox_users || [];
|
|
3828
|
+
const relocate_inbox_users = instance_from_client.relocate_inbox_users || [];
|
|
3829
|
+
const relocate_comment = instance_from_client.relocate_comment;
|
|
3830
|
+
const relocate_next_step = instance_from_client.relocate_next_step;
|
|
3831
|
+
|
|
3832
|
+
const not_in_inbox_users = inbox_users.filter(u => !relocate_inbox_users.includes(u));
|
|
3833
|
+
const new_inbox_users = relocate_inbox_users.filter(u => !inbox_users.includes(u));
|
|
3834
|
+
const approve_users = [];
|
|
3835
|
+
|
|
3836
|
+
const flow = await UUFlowManager.getFlow(instance.flow);
|
|
3837
|
+
const next_step = await UUFlowManager.getStep(instance, flow, relocate_next_step);
|
|
3838
|
+
const next_step_type = next_step.step_type;
|
|
3839
|
+
const next_step_name = next_step.name;
|
|
3840
|
+
|
|
3841
|
+
const current_setp = await UUFlowManager.getStep(instance, flow, last_trace.step);
|
|
3842
|
+
const current_setp_type = current_setp.step_type;
|
|
3843
|
+
|
|
3844
|
+
const traces = instance.traces;
|
|
3845
|
+
const setObj = {};
|
|
3846
|
+
setObj.values = await UUFlowManager.getUpdatedValues(instance);
|
|
3847
|
+
|
|
3848
|
+
const now = new Date();
|
|
3849
|
+
const finishedApproveIds = [];
|
|
3850
|
+
|
|
3851
|
+
// Update traces and approves
|
|
3852
|
+
for (let i = 0; i < traces.length; i++) {
|
|
3853
|
+
if (traces[i]._id === last_trace._id) {
|
|
3854
|
+
if (!traces[i].approves) {
|
|
3855
|
+
traces[i].approves = [];
|
|
3856
|
+
}
|
|
3857
|
+
|
|
3858
|
+
// Update current trace.approve records
|
|
3859
|
+
for (let h = 0; h < traces[i].approves.length; h++) {
|
|
3860
|
+
const a = traces[i].approves[h];
|
|
3861
|
+
if (!a.is_finished && a.type !== "cc" && a.type !== "distribute") {
|
|
3862
|
+
traces[i].approves[h] = {
|
|
3863
|
+
...a,
|
|
3864
|
+
start_date: now,
|
|
3865
|
+
finish_date: now,
|
|
3866
|
+
read_date: now,
|
|
3867
|
+
is_error: false,
|
|
3868
|
+
is_read: true,
|
|
3869
|
+
is_finished: true,
|
|
3870
|
+
judge: "terminated",
|
|
3871
|
+
cost_time: now - a.start_date
|
|
3872
|
+
};
|
|
3873
|
+
|
|
3874
|
+
approve_users.push(a.user);
|
|
3875
|
+
finishedApproveIds.push(a._id);
|
|
3876
|
+
|
|
3877
|
+
// Handle sign_show logic
|
|
3878
|
+
if (a.sign_show === true) {
|
|
3879
|
+
const sameTraces = traces.filter(t => t.step === traces[i].step);
|
|
3880
|
+
let signShowApproveId = null;
|
|
3881
|
+
|
|
3882
|
+
for (let l = sameTraces.length - 1; l >= 0; l--) {
|
|
3883
|
+
const found = sameTraces[l].approves.find(a =>
|
|
3884
|
+
a.user === traces[i].approves[h].user &&
|
|
3885
|
+
a.judge !== "terminated" &&
|
|
3886
|
+
a.description
|
|
3887
|
+
);
|
|
3888
|
+
if (found) {
|
|
3889
|
+
signShowApproveId = found._id;
|
|
3890
|
+
break;
|
|
3891
|
+
}
|
|
3892
|
+
}
|
|
3893
|
+
|
|
3894
|
+
if (signShowApproveId) {
|
|
3895
|
+
for (const trace of traces) {
|
|
3896
|
+
for (const approve of trace.approves) {
|
|
3897
|
+
if (approve._id === signShowApproveId) {
|
|
3898
|
+
approve.sign_show = true;
|
|
3899
|
+
traces[i].approves[h].sign_show = false;
|
|
3900
|
+
}
|
|
3901
|
+
}
|
|
3902
|
+
}
|
|
3903
|
+
}
|
|
3904
|
+
}
|
|
3905
|
+
}
|
|
3906
|
+
}
|
|
3907
|
+
|
|
3908
|
+
// Add relocation approver record
|
|
3909
|
+
const current_space_user = await UUFlowManager.getSpaceUser(space_id, current_user);
|
|
3910
|
+
const current_user_organization = await db.organizations.findOne(
|
|
3911
|
+
{ _id: current_space_user.organization },
|
|
3912
|
+
{ projection: { name: 1, fullname: 1 } }
|
|
3913
|
+
);
|
|
3914
|
+
|
|
3915
|
+
const relocate_appr = {
|
|
3916
|
+
_id: _makeNewID(),
|
|
3917
|
+
instance: instance_id,
|
|
3918
|
+
trace: traces[i]._id,
|
|
3919
|
+
is_finished: true,
|
|
3920
|
+
user: current_user,
|
|
3921
|
+
user_name: current_user_info.name,
|
|
3922
|
+
handler: current_user,
|
|
3923
|
+
handler_name: current_user_info.name,
|
|
3924
|
+
handler_organization: current_space_user.organization,
|
|
3925
|
+
handler_organization_name: current_user_organization.name,
|
|
3926
|
+
handler_organization_fullname: current_user_organization.fullname,
|
|
3927
|
+
start_date: now,
|
|
3928
|
+
finish_date: now,
|
|
3929
|
+
due_date: traces[i].due_date,
|
|
3930
|
+
read_date: now,
|
|
3931
|
+
judge: "relocated",
|
|
3932
|
+
is_read: true,
|
|
3933
|
+
description: relocate_comment,
|
|
3934
|
+
is_error: false,
|
|
3935
|
+
values: {},
|
|
3936
|
+
cost_time: 0
|
|
3937
|
+
};
|
|
3938
|
+
|
|
3939
|
+
traces[i].approves.push(relocate_appr);
|
|
3940
|
+
traces[i].is_finished = true;
|
|
3941
|
+
traces[i].finish_date = now;
|
|
3942
|
+
traces[i].judge = "relocated";
|
|
3943
|
+
}
|
|
3944
|
+
}
|
|
3945
|
+
|
|
3946
|
+
// Create new trace
|
|
3947
|
+
let newTrace;
|
|
3948
|
+
if (next_step_type === "end") {
|
|
3949
|
+
newTrace = {
|
|
3950
|
+
_id: _makeNewID(),
|
|
3951
|
+
instance: instance_id,
|
|
3952
|
+
previous_trace_ids: [last_trace._id],
|
|
3953
|
+
is_finished: true,
|
|
3954
|
+
step: relocate_next_step,
|
|
3955
|
+
name: next_step_name,
|
|
3956
|
+
start_date: now,
|
|
3957
|
+
finish_date: now,
|
|
3958
|
+
approves: []
|
|
3959
|
+
};
|
|
3960
|
+
|
|
3961
|
+
setObj.state = "completed";
|
|
3962
|
+
setObj.inbox_users = [];
|
|
3963
|
+
setObj.final_decision = "terminated";
|
|
3964
|
+
setObj.finish_date = new Date();
|
|
3965
|
+
setObj.current_step_name = next_step_name;
|
|
3966
|
+
setObj.current_step_auto_submit = false;
|
|
3967
|
+
} else {
|
|
3968
|
+
newTrace = {
|
|
3969
|
+
_id: _makeNewID(),
|
|
3970
|
+
instance: instance_id,
|
|
3971
|
+
previous_trace_ids: [last_trace._id],
|
|
3972
|
+
is_finished: false,
|
|
3973
|
+
step: relocate_next_step,
|
|
3974
|
+
name: next_step_name,
|
|
3975
|
+
start_date: now,
|
|
3976
|
+
due_date: await UUFlowManager.getDueDate(next_step.timeout_hours, space_id),
|
|
3977
|
+
approves: []
|
|
3978
|
+
};
|
|
3979
|
+
|
|
3980
|
+
await Promise.all(relocate_inbox_users.map(async (next_step_user_id, idx) => {
|
|
3981
|
+
const user_info = await db.users.findOne(
|
|
3982
|
+
{ _id: next_step_user_id },
|
|
3983
|
+
{ projection: { name: 1 } }
|
|
3984
|
+
);
|
|
3985
|
+
|
|
3986
|
+
let handler_id = next_step_user_id;
|
|
3987
|
+
let handler_info = user_info;
|
|
3988
|
+
let agent = await UUFlowManager.getAgent(space_id, next_step_user_id);
|
|
3989
|
+
|
|
3990
|
+
if (agent) {
|
|
3991
|
+
relocate_inbox_users[idx] = agent;
|
|
3992
|
+
handler_id = agent;
|
|
3993
|
+
handler_info = await db.users.findOne(
|
|
3994
|
+
{ _id: agent },
|
|
3995
|
+
{ projection: { name: 1 } }
|
|
3996
|
+
);
|
|
3997
|
+
}
|
|
3998
|
+
|
|
3999
|
+
const next_step_space_user = await UUFlowManager.getSpaceUser(space_id, handler_id);
|
|
4000
|
+
const next_step_user_org_info = await UUFlowManager.getSpaceUserOrgInfo(next_step_space_user);
|
|
4001
|
+
|
|
4002
|
+
const newApprove = {
|
|
4003
|
+
_id: _makeNewID(),
|
|
4004
|
+
instance: instance_id,
|
|
4005
|
+
trace: newTrace._id,
|
|
4006
|
+
is_finished: false,
|
|
4007
|
+
user: next_step_user_id,
|
|
4008
|
+
user_name: user_info.name,
|
|
4009
|
+
handler: handler_id,
|
|
4010
|
+
handler_name: handler_info.name,
|
|
4011
|
+
handler_organization: next_step_user_org_info.organization,
|
|
4012
|
+
handler_organization_name: next_step_user_org_info.organization_name,
|
|
4013
|
+
handler_organization_fullname: next_step_user_org_info.organization_fullname,
|
|
4014
|
+
start_date: now,
|
|
4015
|
+
due_date: newTrace.due_date,
|
|
4016
|
+
is_read: false,
|
|
4017
|
+
is_error: false,
|
|
4018
|
+
values: {},
|
|
4019
|
+
...(agent ? { agent } : {})
|
|
4020
|
+
};
|
|
4021
|
+
|
|
4022
|
+
await UUFlowManager.setRemindInfo(instance.values, newApprove);
|
|
4023
|
+
newTrace.approves.push(newApprove);
|
|
4024
|
+
}));
|
|
4025
|
+
|
|
4026
|
+
setObj.inbox_users = relocate_inbox_users;
|
|
4027
|
+
setObj.state = "pending";
|
|
4028
|
+
setObj.current_step_name = next_step_name;
|
|
4029
|
+
setObj.current_step_auto_submit = await UUFlowManager.getCurrentStepAutoSubmit(flow.timeout_auto_submit, next_step.lines);
|
|
4030
|
+
}
|
|
4031
|
+
|
|
4032
|
+
// Update outbox users
|
|
4033
|
+
const outbox_users = [...new Set([
|
|
4034
|
+
current_user,
|
|
4035
|
+
...(instance.outbox_users || []),
|
|
4036
|
+
...inbox_users,
|
|
4037
|
+
...approve_users
|
|
4038
|
+
])];
|
|
4039
|
+
|
|
4040
|
+
setObj.outbox_users = outbox_users;
|
|
4041
|
+
setObj.modified = now;
|
|
4042
|
+
setObj.modified_by = current_user;
|
|
4043
|
+
setObj.is_archived = false;
|
|
4044
|
+
traces.push(newTrace);
|
|
4045
|
+
setObj.traces = traces;
|
|
4046
|
+
|
|
4047
|
+
// Update instance
|
|
4048
|
+
const updateOperation = setObj.state === 'completed'
|
|
4049
|
+
? { $set: setObj }
|
|
4050
|
+
: { $set: setObj, $unset: { finish_date: 1 } };
|
|
4051
|
+
|
|
4052
|
+
const result = await db.instances.updateOne(
|
|
4053
|
+
{ _id: instance_id },
|
|
4054
|
+
updateOperation
|
|
4055
|
+
);
|
|
4056
|
+
|
|
4057
|
+
if (result.modifiedCount > 0) {
|
|
4058
|
+
// Update instance tasks
|
|
4059
|
+
await remove_many_instance_tasks(finishedApproveIds);
|
|
4060
|
+
if (newTrace.approves?.length) {
|
|
4061
|
+
await insert_many_instance_tasks(
|
|
4062
|
+
instance_id,
|
|
4063
|
+
newTrace._id,
|
|
4064
|
+
newTrace.approves.map(a => a._id)
|
|
4065
|
+
);
|
|
4066
|
+
}
|
|
4067
|
+
|
|
4068
|
+
const updatedInstance = await UUFlowManager.getInstance(instance_id);
|
|
4069
|
+
|
|
4070
|
+
// Send notifications
|
|
4071
|
+
await pushManager.send_message_current_user(current_user_info);
|
|
4072
|
+
await Promise.all(not_in_inbox_users
|
|
4073
|
+
.filter(user_id => user_id !== current_user)
|
|
4074
|
+
.map(user_id => pushManager.send_message_to_specifyUser("current_user", user_id))
|
|
4075
|
+
);
|
|
4076
|
+
|
|
4077
|
+
const notifyUsers = [...new Set([
|
|
4078
|
+
updatedInstance.applicant,
|
|
4079
|
+
updatedInstance.submitter,
|
|
4080
|
+
...(updatedInstance.outbox_users || [])
|
|
4081
|
+
])];
|
|
4082
|
+
|
|
4083
|
+
await Promise.all(notifyUsers.map(user_id =>
|
|
4084
|
+
pushManager.send_message_to_specifyUser("current_user", user_id)
|
|
4085
|
+
));
|
|
4086
|
+
|
|
4087
|
+
await pushManager.send_instance_notification(
|
|
4088
|
+
"reassign_new_inbox_users",
|
|
4089
|
+
updatedInstance,
|
|
4090
|
+
relocate_comment,
|
|
4091
|
+
current_user_info
|
|
4092
|
+
);
|
|
4093
|
+
|
|
4094
|
+
await pushManager.triggerWebhook(
|
|
4095
|
+
updatedInstance.flow,
|
|
4096
|
+
updatedInstance,
|
|
4097
|
+
{},
|
|
4098
|
+
'relocate',
|
|
4099
|
+
current_user,
|
|
4100
|
+
updatedInstance.inbox_users
|
|
4101
|
+
);
|
|
4102
|
+
}
|
|
4103
|
+
|
|
4104
|
+
return result;
|
|
4105
|
+
};
|
|
4106
|
+
|
|
4107
|
+
UUFlowManager.draft_save_instance = async function (ins, userId) {
|
|
4108
|
+
const db = {
|
|
4109
|
+
instances: await getCollection('instances'),
|
|
4110
|
+
flows: await getCollection('flows'),
|
|
4111
|
+
forms: await getCollection('forms'),
|
|
4112
|
+
users: await getCollection('users'),
|
|
4113
|
+
organizations: await getCollection('organizations'),
|
|
4114
|
+
};
|
|
4115
|
+
|
|
4116
|
+
let result = true;
|
|
4117
|
+
const setObj = {};
|
|
4118
|
+
const ins_id = ins._id;
|
|
4119
|
+
const trace_id = ins.traces[0]._id;
|
|
4120
|
+
const approve_id = ins.traces[0].approves[0]._id;
|
|
4121
|
+
const description = ins.traces[0].approves[0].description;
|
|
4122
|
+
const next_steps = ins.traces[0].approves[0].next_steps;
|
|
4123
|
+
const values = ins.traces[0].approves[0].values || {};
|
|
4124
|
+
const applicant_id = ins.applicant;
|
|
4125
|
+
|
|
4126
|
+
const instance = await db.instances.findOne(
|
|
4127
|
+
{ _id: ins_id },
|
|
4128
|
+
{
|
|
4129
|
+
projection: {
|
|
4130
|
+
applicant: 1,
|
|
4131
|
+
state: 1,
|
|
4132
|
+
submitter: 1,
|
|
4133
|
+
traces: 1,
|
|
4134
|
+
form: 1,
|
|
4135
|
+
flow_version: 1,
|
|
4136
|
+
space: 1,
|
|
4137
|
+
flow: 1
|
|
4138
|
+
}
|
|
4139
|
+
}
|
|
4140
|
+
);
|
|
4141
|
+
|
|
4142
|
+
const space_id = instance.space;
|
|
4143
|
+
const flow_id = instance.flow;
|
|
4144
|
+
const form_id = instance.form;
|
|
4145
|
+
const traces = instance.traces;
|
|
4146
|
+
const current_trace = traces.find(t => t._id === trace_id);
|
|
4147
|
+
const index = current_trace.approves.findIndex(a => a._id === approve_id);
|
|
4148
|
+
const key_str = `traces.$.approves.${index}.`;
|
|
4149
|
+
|
|
4150
|
+
// Verify instance state and permissions
|
|
4151
|
+
const current_user = await db.users.findOne(
|
|
4152
|
+
{ _id: userId },
|
|
4153
|
+
{ projection: { locale: 1 } }
|
|
4154
|
+
);
|
|
4155
|
+
const lang = current_user?.locale === 'zh-cn' ? 'zh-CN' : 'en';
|
|
4156
|
+
|
|
4157
|
+
UUFlowManager.isInstanceDraft(instance, lang);
|
|
4158
|
+
UUFlowManager.isInstanceSubmitter(instance, userId);
|
|
4159
|
+
|
|
4160
|
+
const flow = await db.flows.findOne(
|
|
4161
|
+
{ _id: flow_id },
|
|
4162
|
+
{
|
|
4163
|
+
projection: {
|
|
4164
|
+
'current._id': 1,
|
|
4165
|
+
'current.form_version': 1,
|
|
4166
|
+
'name': 1,
|
|
4167
|
+
'current.steps': 1
|
|
4168
|
+
}
|
|
4169
|
+
}
|
|
4170
|
+
);
|
|
4171
|
+
|
|
4172
|
+
setObj.modified = new Date();
|
|
4173
|
+
setObj.modified_by = userId;
|
|
4174
|
+
|
|
4175
|
+
if (flow.current._id !== instance.flow_version) {
|
|
4176
|
+
result = 'upgraded';
|
|
4177
|
+
const start_step = flow.current.steps.find(s => s.step_type === 'start');
|
|
4178
|
+
|
|
4179
|
+
setObj.flow_version = flow.current._id;
|
|
4180
|
+
setObj.form_version = flow.current.form_version;
|
|
4181
|
+
setObj['traces.$.step'] = start_step._id;
|
|
4182
|
+
setObj['traces.$.name'] = start_step.name;
|
|
4183
|
+
}
|
|
4184
|
+
|
|
4185
|
+
if (instance.applicant !== applicant_id) {
|
|
4186
|
+
const [user, applicant] = await Promise.all([
|
|
4187
|
+
db.users.findOne(
|
|
4188
|
+
{ _id: applicant_id },
|
|
4189
|
+
{ projection: { name: 1 } }
|
|
4190
|
+
),
|
|
4191
|
+
db.space_users.findOne(
|
|
4192
|
+
{ space: space_id, user: applicant_id },
|
|
4193
|
+
{ projection: { organization: 1 } }
|
|
4194
|
+
)
|
|
4195
|
+
]);
|
|
4196
|
+
|
|
4197
|
+
if (user && applicant) {
|
|
4198
|
+
const organization = await db.organizations.findOne(
|
|
4199
|
+
{ _id: applicant.organization },
|
|
4200
|
+
{ projection: { name: 1, fullname: 1 } }
|
|
4201
|
+
);
|
|
4202
|
+
|
|
4203
|
+
setObj.applicant = applicant_id;
|
|
4204
|
+
setObj.applicant_name = user.name;
|
|
4205
|
+
setObj.applicant_organization = applicant.organization;
|
|
4206
|
+
setObj.applicant_organization_name = organization.name;
|
|
4207
|
+
setObj.applicant_organization_fullname = organization.fullname;
|
|
4208
|
+
setObj[key_str + 'user'] = applicant_id;
|
|
4209
|
+
setObj[key_str + 'user_name'] = user.name;
|
|
4210
|
+
}
|
|
4211
|
+
}
|
|
4212
|
+
|
|
4213
|
+
setObj[key_str + 'values'] = values;
|
|
4214
|
+
setObj[key_str + 'description'] = description;
|
|
4215
|
+
setObj[key_str + 'judge'] = 'submitted';
|
|
4216
|
+
setObj[key_str + 'read_date'] = new Date();
|
|
4217
|
+
|
|
4218
|
+
if (result !== 'upgraded' && next_steps) {
|
|
4219
|
+
setObj[key_str + 'next_steps'] = next_steps;
|
|
4220
|
+
}
|
|
4221
|
+
|
|
4222
|
+
// Calculate instance name
|
|
4223
|
+
const form = await db.forms.findOne(
|
|
4224
|
+
{ _id: form_id },
|
|
4225
|
+
{ projection: { 'current.name_forumla': 1 } }
|
|
4226
|
+
);
|
|
4227
|
+
|
|
4228
|
+
if (form?.current?.name_forumla) {
|
|
4229
|
+
setObj.name = await UUFlowManager.getInstanceName(ins, values);
|
|
4230
|
+
}
|
|
4231
|
+
|
|
4232
|
+
await db.instances.updateOne(
|
|
4233
|
+
{ _id: ins_id, 'traces._id': trace_id },
|
|
4234
|
+
{ $set: setObj }
|
|
4235
|
+
);
|
|
4236
|
+
|
|
4237
|
+
await update_instance_tasks(ins_id, trace_id, approve_id);
|
|
4238
|
+
return result;
|
|
4239
|
+
};
|
|
4240
|
+
|
|
4241
|
+
UUFlowManager.caculateExtras = async function (values = {}, formDoc, formVersionId) {
|
|
4242
|
+
if (_.isEmpty(values)) return;
|
|
4243
|
+
|
|
4244
|
+
const extras = {};
|
|
4245
|
+
const formVersion = await UUFlowManager.getFormVersion(formDoc, formVersionId);
|
|
4246
|
+
|
|
4247
|
+
formVersion.fields.forEach(field => {
|
|
4248
|
+
if (field.is_list_display) {
|
|
4249
|
+
extras[field.code] = values[field.code];
|
|
4250
|
+
} else if (field.type === 'table' && values[field.code]) {
|
|
4251
|
+
const tableExtras = values[field.code]
|
|
4252
|
+
.map(s_value => {
|
|
4253
|
+
const rowValues = {};
|
|
4254
|
+
field.fields.forEach(s_field => {
|
|
4255
|
+
if (s_field.is_list_display && s_value[s_field.code] !== undefined) {
|
|
4256
|
+
rowValues[s_field.code] = s_value[s_field.code];
|
|
4257
|
+
}
|
|
4258
|
+
});
|
|
4259
|
+
return _.isEmpty(rowValues) ? null : rowValues;
|
|
4260
|
+
})
|
|
4261
|
+
.filter(Boolean);
|
|
4262
|
+
|
|
4263
|
+
if (tableExtras.length) {
|
|
4264
|
+
extras[field.code] = tableExtras;
|
|
4265
|
+
}
|
|
4266
|
+
} else if (field.type === 'section') {
|
|
4267
|
+
field.fields.forEach(s_field => {
|
|
4268
|
+
if (s_field.is_list_display && values[s_field.code] !== undefined) {
|
|
4269
|
+
extras[s_field.code] = values[s_field.code];
|
|
4270
|
+
}
|
|
4271
|
+
});
|
|
4272
|
+
}
|
|
4273
|
+
});
|
|
4274
|
+
|
|
4275
|
+
return _.isEmpty(extras) ? undefined : extras;
|
|
4276
|
+
};
|
|
4277
|
+
|
|
4278
|
+
module.exports = UUFlowManager;
|