From 4c6ff2bccf6828850f9b8d9b3092bc49a5361300 Mon Sep 17 00:00:00 2001 From: wjh Date: Wed, 29 May 2024 10:51:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=8C=E5=96=84=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=E7=95=8C=E9=9D=A2=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=20(#1057)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-on: https://git.daoyoucloud.com/daoyoucloud/tachybase/pulls/1057 Co-authored-by: wjh Co-committed-by: wjh --- .../approval/ApprovalBlockInitializer.tsx | 2 - .../src/client/approval/ApprovalSettings.tsx | 12 +- .../collection/UserJobs.collection.tsx | 157 ++++++++++++ .../approval/{constants.ts => constants.tsx} | 131 +++++++++- .../src/client/approval/context/FormBlock.tsx | 3 +- .../src/client/approval/index.ts | 2 + .../src/client/approval/style/style.css | 4 +- .../src/client/approval/todos/TodosBlock.tsx | 186 +++++++------- .../todos/component/TabApprovalItem.tsx | 169 ++++++++----- .../todos/component/TabApprovalType.tsx | 26 +- .../todos/component/TabDuplicateItem.tsx | 47 ++++ .../todos/component/TabExecutedItem.tsx | 47 ++++ .../todos/component/TabPendingItem.tsx | 45 ++++ .../todos/component/TabProcessedItem.tsx | 48 ++++ .../component/ViewTodosUserJobsContent.tsx | 148 ++++++++++++ .../client/approval/todos/componentSchema.tsx | 71 ++++++ .../approval/todos/hook/useFormBlockProps.tsx | 28 ++- .../client/approval/todos/hook/useSubmit.tsx | 43 +++- .../approval/todos/interface/interface.ts | 19 +- .../todos/provider/ActionBarProvider.tsx | 25 +- .../todos/provider/FormBlockProvider.tsx | 98 ++++++++ .../provider/ManualActionStatusProvider.tsx | 21 ++ .../approval/todos/provider/todosContext.tsx | 7 + .../src/client/index.tsx | 4 + .../src/locale/en-US.json | 5 +- .../src/locale/zh-CN.json | 21 +- .../departments/components/ComponentX.tsx | 10 +- pnpm-lock.yaml | 226 ++++++++++++------ 28 files changed, 1333 insertions(+), 272 deletions(-) create mode 100644 packages/plugins/@hera/plugin-approval-mobile/src/client/approval/collection/UserJobs.collection.tsx rename packages/plugins/@hera/plugin-approval-mobile/src/client/approval/{constants.ts => constants.tsx} (54%) create mode 100644 packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabDuplicateItem.tsx create mode 100644 packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabExecutedItem.tsx create mode 100644 packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabPendingItem.tsx create mode 100644 packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabProcessedItem.tsx create mode 100644 packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/ViewTodosUserJobsContent.tsx create mode 100644 packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/componentSchema.tsx create mode 100644 packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/provider/FormBlockProvider.tsx create mode 100644 packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/provider/ManualActionStatusProvider.tsx create mode 100644 packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/provider/todosContext.tsx diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/ApprovalBlockInitializer.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/ApprovalBlockInitializer.tsx index 7f95537ab..3d5eeef00 100644 --- a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/ApprovalBlockInitializer.tsx +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/ApprovalBlockInitializer.tsx @@ -45,7 +45,5 @@ export const ApprovalInitializerItem = [ title: '审批', name: 'todos', itemComponent: 'TodosBlock', - collectionName: 'approvalRecords', - settingBlock: true, }, ]; diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/ApprovalSettings.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/ApprovalSettings.tsx index 15d5306d1..3353a3121 100644 --- a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/ApprovalSettings.tsx +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/ApprovalSettings.tsx @@ -1,14 +1,4 @@ -import { - removeNullCondition, - SchemaSettings, - SchemaSettingsDataScope, - useCollection, - useCollectionManager, - useDataLoadingMode, - useDesignable, - useDetailsBlockContext, - useFormBlockContext, -} from '@tachybase/client'; +import { SchemaSettings, SchemaSettingsDataScope, useDesignable, useFormBlockContext } from '@tachybase/client'; import { useField, useFieldSchema } from '@tachybase/schema'; import _ from 'lodash'; diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/collection/UserJobs.collection.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/collection/UserJobs.collection.tsx new file mode 100644 index 000000000..ed6994854 --- /dev/null +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/collection/UserJobs.collection.tsx @@ -0,0 +1,157 @@ +import { JobStatusOptions } from '@tachybase/plugin-workflow/client'; + +import { NAMESPACE } from '../locale'; + +export const nodeCollection = { + title: `{{t("Task", { ns: "${NAMESPACE}" })}}`, + name: 'flow_nodes', + fields: [ + { + type: 'bigInt', + name: 'id', + interface: 'm2o', + uiSchema: { + type: 'number', + title: 'ID', + 'x-component': 'RemoteSelect', + 'x-component-props': { + fieldNames: { + label: 'title', + value: 'id', + }, + service: { + resource: 'flow_nodes', + params: { + filter: { + type: 'manual', + }, + }, + }, + }, + }, + }, + { + type: 'string', + name: 'title', + interface: 'input', + uiSchema: { + type: 'string', + title: '{{t("Title")}}', + 'x-component': 'Input', + }, + }, + ], +}; + +export const workflowCollection = { + title: `{{t("Workflow", { ns: "${NAMESPACE}" })}}`, + name: 'workflows', + fields: [ + { + type: 'string', + name: 'title', + interface: 'input', + uiSchema: { + title: '{{t("Name")}}', + type: 'string', + 'x-component': 'Input', + required: true, + }, + }, + ], +}; + +export const todoCollection = { + title: `{{t("Workflow todos", { ns: "${NAMESPACE}" })}}`, + name: 'users_jobs', + fields: [ + { + type: 'belongsTo', + name: 'user', + target: 'users', + foreignKey: 'userId', + interface: 'm2o', + uiSchema: { + type: 'number', + title: '{{t("User")}}', + 'x-component': 'RemoteSelect', + 'x-component-props': { + fieldNames: { + label: 'nickname', + value: 'id', + }, + service: { + resource: 'users', + }, + }, + }, + }, + { + type: 'belongsTo', + name: 'node', + target: 'flow_nodes', + foreignKey: 'nodeId', + interface: 'm2o', + isAssociation: true, + uiSchema: { + type: 'number', + title: `{{t("Task", { ns: "${NAMESPACE}" })}}`, + 'x-component': 'RemoteSelect', + 'x-component-props': { + fieldNames: { + label: 'title', + value: 'id', + }, + service: { + resource: 'flow_nodes', + }, + }, + }, + }, + { + type: 'belongsTo', + name: 'workflow', + target: 'workflows', + foreignKey: 'workflowId', + interface: 'm2o', + uiSchema: { + type: 'number', + title: `{{t("Workflow", { ns: "${NAMESPACE}" })}}`, + 'x-component': 'RemoteSelect', + 'x-component-props': { + fieldNames: { + label: 'title', + value: 'id', + }, + service: { + resource: 'workflows', + }, + }, + }, + }, + { + type: 'integer', + name: 'status', + interface: 'select', + uiSchema: { + type: 'number', + title: `{{t("Status", { ns: "${NAMESPACE}" })}}`, + 'x-component': 'Select', + enum: JobStatusOptions, + }, + }, + { + name: 'createdAt', + type: 'date', + interface: 'createdAt', + uiSchema: { + type: 'datetime', + title: '{{t("Created at")}}', + 'x-component': 'DatePicker', + 'x-component-props': { + showTime: true, + }, + }, + }, + ], +}; diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/constants.ts b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/constants.tsx similarity index 54% rename from packages/plugins/@hera/plugin-approval-mobile/src/client/approval/constants.ts rename to packages/plugins/@hera/plugin-approval-mobile/src/client/approval/constants.tsx index 890f782c5..0fa6f66c0 100644 --- a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/constants.ts +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/constants.tsx @@ -1,4 +1,18 @@ +import React from 'react'; +import { SchemaInitializerItemType } from '@tachybase/client'; import { JOB_STATUS } from '@tachybase/plugin-workflow/client'; +import { ISchema } from '@tachybase/schema'; + +import { + CheckOutlined, + ClockCircleOutlined, + CloseOutlined, + ExclamationOutlined, + HourglassOutlined, + LoadingOutlined, + MinusOutlined, + RedoOutlined, +} from '@ant-design/icons'; import { lang, NAMESPACE, tval } from './locale'; @@ -22,8 +36,6 @@ export const APPROVAL_STATUS = { export const ProcessedStatus = [1, 2, -1, -3]; -export const PendingStatus = [0]; - export const approvalStatusOptions = [ { value: APPROVAL_STATUS.ASSIGNED, label: `Assigned`, color: 'blue' }, { value: APPROVAL_STATUS.PENDING, label: `Pending`, color: 'gold' }, @@ -112,3 +124,118 @@ export function flatSchemaArray(sourceData, filter, needRecursion = false) { return flatArray; } + +type ValueOf = T[keyof T]; + +export type FormType = { + type: 'create' | 'update' | 'custom'; + title: string; + actions: ValueOf[]; + collection: + | string + | { + name: string; + fields: any[]; + [key: string]: any; + }; +}; + +export type ManualFormType = { + title: string; + config: { + useInitializer: ({ allCollections }?: { allCollections: any[] }) => SchemaInitializerItemType; + initializers?: { + [key: string]: React.FC; + }; + components?: { + [key: string]: React.FC; + }; + parseFormOptions(root: ISchema): { [key: string]: FormType }; + }; + block: { + scope?: { + [key: string]: () => any; + }; + components?: { + [key: string]: React.FC; + }; + }; +}; + +export const EXECUTION_STATUS = { + QUEUEING: null, + STARTED: 0, + RESOLVED: 1, + FAILED: -1, + ERROR: -2, + ABORTED: -3, + CANCELED: -4, + REJECTED: -5, + RETRY_NEEDED: -6, +}; + +export const ExecutionStatusOptions = [ + { + value: EXECUTION_STATUS.QUEUEING, + label: 'Queueing', + color: 'blue', + icon: , + description: 'Triggered but still waiting in queue to execute.', + }, + { + value: EXECUTION_STATUS.STARTED, + label: 'On going', + color: 'gold', + icon: , + description: 'Started and executing, maybe waiting for an async callback (manual, delay etc.).', + }, + { + value: EXECUTION_STATUS.RESOLVED, + label: 'Resolved', + color: 'green', + icon: , + description: 'Successfully finished.', + }, + { + value: EXECUTION_STATUS.FAILED, + label: 'Failed', + color: 'red', + icon: , + description: 'Failed to satisfy node configurations.', + }, + { + value: EXECUTION_STATUS.ERROR, + label: 'Error', + color: 'red', + icon: , + description: 'Some node meets error.', + }, + { + value: EXECUTION_STATUS.ABORTED, + label: 'Aborted', + color: 'red', + icon: , + description: 'Running of some node was aborted by program flow.', + }, + { + value: EXECUTION_STATUS.CANCELED, + label: 'Canceled', + color: 'volcano', + icon: , + description: 'Manually canceled whole execution when waiting.', + }, + { + value: EXECUTION_STATUS.REJECTED, + label: 'Rejected', + color: 'volcano', + icon: , + description: 'Rejected from a manual node.', + }, + { + value: EXECUTION_STATUS.RETRY_NEEDED, + label: 'Retry needed', + color: 'volcano', + icon: , + description: 'General failed but should do another try.', + }, +]; diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/context/FormBlock.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/context/FormBlock.tsx index 520d017f2..49dd46c62 100644 --- a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/context/FormBlock.tsx +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/context/FormBlock.tsx @@ -16,7 +16,8 @@ import { createForm, RecursionField, useField, useFieldSchema } from '@tachybase import { useContextApprovalExecution } from './ApprovalExecution'; export const FormBlockProvider = (props) => { - const { snapshot } = useContextApprovalExecution(); + const { approvalExecution } = useContextApprovalExecution(); + const { snapshot } = approvalExecution; const fieldSchema = useFieldSchema(); const field = useField(); const formBlockRef = useRef(null); diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/index.ts b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/index.ts index 3c7d26e28..c4c7490ad 100644 --- a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/index.ts +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/index.ts @@ -8,6 +8,7 @@ import { ViewActionUserInitiationsContent } from './initiations/component/ViewAc import { LauncherActionConfigInitializer } from './initiations/config/LauncherActionConfig'; import { InitiationsBlock } from './initiations/InitiationsBlock'; import { ViewActionTodosContent } from './todos/component/ViewActionTodosContent'; +import { ViewTodosUserJobsContent } from './todos/component/ViewTodosUserJobsContent'; import { TodosBlock } from './todos/TodosBlock'; class PluginApproval extends Plugin { @@ -19,6 +20,7 @@ class PluginApproval extends Plugin { ViewActionTodosContent, ViewActionUserInitiationsContent, ViewActionInitiationsContent, + ViewTodosUserJobsContent, 'ApprovalCommon.ViewComponent.MApprovalProcess': ApprovalProcess, }); this.app.schemaSettingsManager.add(ApprovalSettings); diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/style/style.css b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/style/style.css index ad6ddafac..1d62ed15f 100644 --- a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/style/style.css +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/style/style.css @@ -11,12 +11,12 @@ background-color: #ffffff; position: fixed; z-index: 2; - height: 5vh; + height: 6vh; width: 100vw; } .approvalContext{ - margin: 6vh 0 6vh 0; + margin: 7vh 0 7vh 0; } .todosSpacStyle{ diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/TodosBlock.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/TodosBlock.tsx index a083c99bf..272791ad4 100644 --- a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/TodosBlock.tsx +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/TodosBlock.tsx @@ -1,116 +1,106 @@ -import React, { useEffect, useState } from 'react'; -import { BlockItem, ExtendCollectionsProvider } from '@tachybase/client'; -import { observer } from '@tachybase/schema'; +import React, { useState } from 'react'; +import { BlockItem, ExtendCollectionsProvider, SchemaComponent } from '@tachybase/client'; +import { observer, useFieldSchema } from '@tachybase/schema'; -import { SearchBar, Space, Tabs } from 'antd-mobile'; - -import { TabApplicantType } from './component/TabApplicantType'; -import { TabApprovalItem } from './component/TabApprovalItem'; -import { TabApprovalType } from './component/TabApprovalType'; +import { SearchBar, Tabs } from 'antd-mobile'; import '../style/style.css'; import { CollectionApprovals } from '../collection/Approvals.collection'; import { CollectionApprovalTodos } from '../collection/ApprovalTodos'; import { CollectionFlowNodes } from '../collection/FlowNodes.collection'; +import { nodeCollection, todoCollection, workflowCollection } from '../collection/UserJobs.collection'; import { CollectionWorkflows } from '../collection/Workflows.collection'; -import { ApprovalReachDataType } from '../component/ApprovalReachDataType'; -import { ApprovalTemplateType } from '../component/ApprovalTemplateType'; -import { PendingStatus, ProcessedStatus } from '../constants'; +import { useTranslation } from '../locale'; +import { TabDuplicateItem } from './component/TabDuplicateItem'; +import { TabExecutedItem } from './component/TabExecutedItem'; +import { TabPendingItem } from './component/TabPendingItem'; +import { TabProcessedItem } from './component/TabProcessedItem'; +import { tabDuplicateSchema, tabExecutedSchema, tabPendingSchema, tabProcessedSchema } from './componentSchema'; +import { todosContext } from './provider/todosContext'; export const TodosBlock = observer((props) => { - const [filter, setFilter] = useState({ - status: PendingStatus, - }); const [changeInputValue, setChangeInputValue] = useState(''); - const [input, setInput] = useState(''); - const changeFilter = (data) => { - setFilter(data); - }; - const filterProps = { - ...props, - filter, - input, - changeFilter, - }; + const fieldSchema = useFieldSchema(); + const [contextFilter, setContextFilter] = useState({ key: 'pending', inputFilter: '' }); + const { t } = useTranslation(); return ( - { - if (!value) { - setInput(value); - } - setChangeInputValue(value); - }} - value={changeInputValue} - onSearch={(value) => { - setInput(value); - }} - /> - { - const tabFilter = { status: PendingStatus }; - switch (key) { - case 'pending': - tabFilter['status'] = PendingStatus; - break; - case 'processed': - tabFilter['status'] = ProcessedStatus; - break; - case 'duplicate': - delete tabFilter['status']; - break; - } - setChangeInputValue(''); - setInput(''); - setFilter(tabFilter); - }} - style={{ '--title-font-size': '12px', backgroundColor: '#ffffff', marginTop: '10px' }} - > - - - {/* 模版类型 */} - - {/* 申请人 */} - - {/* 到达日期 */} - - - - - - - {/* 审批状态 */} - - {/* 模版类型 */} - - {/* 申请人 */} - - {/* 到达日期 */} - - - - - - - {/* 审批状态 */} - - {/* 模版类型 */} - - {/* 申请人 */} - - {/* 到达日期 */} - - - - - + + { + const filter = { ...contextFilter }; + if (!value) { + filter.inputFilter = value; + setContextFilter(filter); + } + setChangeInputValue(value); + }} + value={changeInputValue} + onSearch={(value) => { + const filter = { ...contextFilter }; + filter.inputFilter = value; + setContextFilter(filter); + }} + /> + { + const tabFilter = { ...contextFilter }; + tabFilter.key = key; + tabFilter.inputFilter = ''; + setContextFilter(tabFilter); + setChangeInputValue(''); + }} + style={{ '--title-font-size': '12px', backgroundColor: '#ffffff', marginTop: '10px' }} + > + + + + + + + + + + + + + + ); diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabApprovalItem.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabApprovalItem.tsx index 0ffffdbec..c3eed8c43 100644 --- a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabApprovalItem.tsx +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabApprovalItem.tsx @@ -1,79 +1,31 @@ import React, { useEffect, useState } from 'react'; import { useAPIClient, useCollectionManager, useCompile } from '@tachybase/client'; +import { ExecutionStatusOptionsMap } from '@tachybase/plugin-workflow/client'; import { observer } from '@tachybase/schema'; import { useAsyncEffect } from 'ahooks'; import { Empty, List, Space, Tag } from 'antd-mobile'; import { useNavigate } from 'react-router-dom'; -import { APPROVAL_STATUS, ApprovalPriorityType, approvalStatusOptions } from '../../constants'; +import { APPROVAL_STATUS, ApprovalPriorityType, approvalStatusOptions, ExecutionStatusOptions } from '../../constants'; import { useTranslation } from '../../locale'; export const TabApprovalItem = observer((props) => { - const { filter, params, input } = props as any; + const { filter, params, input, collectionName, tabKey } = props as any; const api = useAPIClient(); const [data, setData] = useState([]); - const [defData, setDefData] = useState([]); const { t } = useTranslation(); const compile = useCompile(); const navigate = useNavigate(); const cm = useCollectionManager(); - useEffect(() => { - if (input && defData.length) { - const filterData = defData.filter((value) => value.title.includes(input)); - setData(filterData); - } else { - setData(defData); - } - }, [input]); useAsyncEffect(async () => { const { data: user } = await api.request({ url: 'users:list', params: { pageSize: 999, appends: ['roles'] } }); - api - .request({ - url: 'approvalRecords:listCentralized', - params: { - pageSize: 9999, - appends: ['execution', 'job', 'node', 'workflow'], - filter: { ...params, ...filter }, - }, - }) - .then((res) => { - const result = res.data?.data.map((item) => { - const itemUser = user.data.find((value) => value.id === item.userId); - const priorityType = ApprovalPriorityType.find( - (priorityItem) => priorityItem.value === item.snapshot.priority, - ); - const statusType = approvalTodoListStatus(item, t); - const categoryTitle = item.workflow.title.replace('审批流:', ''); - const collectionName = item.workflow?.config?.collection || item.execution?.context?.collectionName; - const summary = Object.entries(item.summary).map(([key, value]) => { - const field = cm.getCollectionField(`${collectionName}.${key}`); - return { - label: compile(field?.uiSchema?.title || key), - value: (Object.prototype.toString.call(value) === '[object Object]' ? value?.['name'] : value) || '', - }; - }); - return { - ...item, - title: `${itemUser.nickname}的${categoryTitle}`, - categoryTitle: categoryTitle, - statusTitle: t(statusType.label), - statusColor: statusType.color, - reason: summary, - priorityTitle: priorityType.label, - priorityColor: priorityType.color, - }; - }); - result.sort((a, b) => { - return Date.parse(b.createdAt) - Date.parse(a.createdAt); - }); - setData(result); - setDefData(result); - }) - .catch(() => { - console.error; - }); - }, [filter, params]); + if (collectionName === 'approvalRecords') { + changeApprovalRecordsService(api, params?.[tabKey], filter, user, cm, compile, t, setData, input); + } else if (collectionName === 'users_jobs') { + changeUsersJobsService(api, t, cm, compile, input, setData, params?.[tabKey], filter); + } + }, [filter, params, input]); return (
@@ -84,13 +36,20 @@ export const TabApprovalItem = observer((props) => { { - navigate(`/mobile/approval/${item.id}/${item.categoryTitle}/detailspage`); + let url; + if (collectionName === 'approvalRecords') { + url = `/mobile/approval/${item.id}/${item.categoryTitle}/detailspage`; + } else if (collectionName === 'users_jobs') { + url = `/mobile/approval/${item.id}/userJobspage`; + } + navigate(url); }} > {/* */} {item.title} + {item.statusIcon} {item.statusTitle} @@ -123,3 +82,97 @@ const approvalTodoListStatus = (item, t) => { return approvalStatusOptions.find((value) => value.value === status); } }; + +const changeApprovalRecordsService = (api, params, filter, user, cm, compile, t, setData, input) => { + api + .request({ + url: 'approvalRecords:listCentralized', + params: { + pageSize: 9999, + appends: ['execution', 'job', 'node', 'workflow'], + filter: { ...params, ...filter }, + }, + }) + .then((res) => { + const result = res.data?.data.map((item) => { + const itemUser = user.data.find((value) => value.id === item.userId); + const priorityType = ApprovalPriorityType.find((priorityItem) => priorityItem.value === item.snapshot.priority); + const statusType = approvalTodoListStatus(item, t); + const categoryTitle = item.workflow.title.replace('审批流:', ''); + const collectionName = item.workflow?.config?.collection || item.execution?.context?.collectionName; + const summary = Object.entries(item.summary).map(([key, value]) => { + const field = cm.getCollectionField(`${collectionName}.${key}`); + return { + label: compile(field?.uiSchema?.title || key), + value: (Object.prototype.toString.call(value) === '[object Object]' ? value?.['name'] : value) || '', + }; + }); + return { + ...item, + title: `${itemUser.nickname}的${categoryTitle}`, + categoryTitle: categoryTitle, + statusTitle: t(statusType.label), + statusColor: statusType.color, + reason: summary, + priorityTitle: priorityType.label, + priorityColor: priorityType.color, + }; + }); + const filterResult = result.filter((value) => value.title.includes(input)); + filterResult.sort((a, b) => { + return Date.parse(b.createdAt) - Date.parse(a.createdAt); + }); + setData(filterResult); + }) + .catch(() => { + console.error; + }); +}; + +const changeUsersJobsService = (api, t, cm, compile, input, setData, params, filter) => { + api + .request({ + url: 'users_jobs:list', + params: { + pageSize: 9999, + filter: { ...params, ...filter }, + appends: ['execution', 'job', 'node', 'user', 'workflow'], + }, + }) + .then((res) => { + const result = res.data?.data.map((item) => { + const priorityType = ApprovalPriorityType.find( + (priorityItem) => priorityItem.value === item.execution.context?.data?.priority, + ); + const statusType = ExecutionStatusOptions.find((value) => value.value === item.status); + const categoryTitle = item.workflow.title.replace('审批流:', ''); + const collectionName = item.workflow?.config?.collection || item.execution?.context?.collectionName; + const summary = Object.entries(item.execution?.context?.summary).map(([key, value]) => { + const field = cm.getCollectionField(`${collectionName}.${key}`); + return { + label: compile(field?.uiSchema?.title || key), + value: (Object.prototype.toString.call(value) === '[object Object]' ? value?.['name'] : value) || '', + }; + }); + return { + ...item, + title: `${item.user?.nickname}的${categoryTitle}`, + categoryTitle: categoryTitle, + statusTitle: t(statusType.label), + statusColor: statusType.color, + statusIcon: statusType.icon, + reason: summary, + priorityTitle: priorityType.label, + priorityColor: priorityType.color, + }; + }); + const filterResult = result.filter((value) => value.title.includes(input)); + filterResult.sort((a, b) => { + return Date.parse(b.createdAt) - Date.parse(a.createdAt); + }); + setData(filterResult); + }) + .catch(() => { + console.error; + }); +}; diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabApprovalType.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabApprovalType.tsx index f656c9dcb..98ceefd03 100644 --- a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabApprovalType.tsx +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabApprovalType.tsx @@ -4,23 +4,33 @@ import { observer } from '@tachybase/schema'; import { Picker, Space } from 'antd-mobile'; import { DownOutline } from 'antd-mobile-icons'; -import { approvalStatusOptions, ProcessedStatus } from '../../constants'; +import { approvalStatusOptions, ExecutionStatusOptions, ProcessedStatus } from '../../constants'; import { useTranslation } from '../../locale'; export const TabApprovalType = observer((props) => { + const { collectionName, params } = props as any; const [visible, setVisible] = useState(false); const { changeFilter, filter } = props as any; const { t } = useTranslation(); - const columns = approvalStatusOptions - .map((item) => { + const columns = []; + if (collectionName === 'approvalRecords') { + approvalStatusOptions.forEach((item) => { if (ProcessedStatus.includes(item.value)) { - return { + columns.push({ label: t(item.label), value: item.value, - }; + }); } - }) - .filter(Boolean); + }); + } else if (collectionName === 'users_jobs') { + ExecutionStatusOptions.forEach((item) => { + if (!item.value && item.value !== 0) return; + columns.push({ + label: t(item.label), + value: item.value, + }); + }); + } columns.unshift({ label: t('All'), value: 'all' }); return ( <> @@ -43,7 +53,7 @@ export const TabApprovalType = observer((props) => { onConfirm={(e) => { const changeData = { ...filter }; if (e[0] === 'all') { - changeData['status'] = ProcessedStatus; + delete changeData['status']; } else { changeData['status'] = e[0]; } diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabDuplicateItem.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabDuplicateItem.tsx new file mode 100644 index 000000000..eda45ffc8 --- /dev/null +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabDuplicateItem.tsx @@ -0,0 +1,47 @@ +import React, { useState } from 'react'; +import { BlockItem } from '@tachybase/client'; +import { observer } from '@tachybase/schema'; + +import { Space } from 'antd-mobile'; + +import { ApprovalReachDataType } from '../../component/ApprovalReachDataType'; +import { ApprovalTemplateType } from '../../component/ApprovalTemplateType'; +import { PendingStatus } from '../../constants'; +import { useTodosContext } from '../provider/todosContext'; +import { TabApplicantType } from './TabApplicantType'; +import { TabApprovalItem } from './TabApprovalItem'; +import { TabApprovalType } from './TabApprovalType'; + +import '../../style/style.css'; + +//审批-抄送我 +export const TabDuplicateItem = observer((props) => { + const [filter, setFilter] = useState({}); + const filterContext = useTodosContext(); + const changeFilter = (data) => { + setFilter(data); + }; + const filterProps = { + ...props, + filter, + changeFilter, + }; + if (filterContext['key'] === 'duplicate') { + filterProps['input'] = filterContext['inputFilter']; + } + return ( + + + {/* 审批状态 */} + + {/* 模版类型 */} + + {/* 申请人 */} + + {/* 到达日期 */} + + + + + ); +}); diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabExecutedItem.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabExecutedItem.tsx new file mode 100644 index 000000000..5e31b028f --- /dev/null +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabExecutedItem.tsx @@ -0,0 +1,47 @@ +import React, { useState } from 'react'; +import { BlockItem } from '@tachybase/client'; +import { observer } from '@tachybase/schema'; + +import { Space } from 'antd-mobile'; + +import { ApprovalReachDataType } from '../../component/ApprovalReachDataType'; +import { ApprovalTemplateType } from '../../component/ApprovalTemplateType'; +import { PendingStatus } from '../../constants'; +import { useTodosContext } from '../provider/todosContext'; +import { TabApplicantType } from './TabApplicantType'; +import { TabApprovalItem } from './TabApprovalItem'; +import { TabApprovalType } from './TabApprovalType'; + +import '../../style/style.css'; + +//审批-执行处理 +export const TabExecutedItem = observer((props) => { + const [filter, setFilter] = useState({}); + const filterContext = useTodosContext(); + const changeFilter = (data) => { + setFilter(data); + }; + const filterProps = { + ...props, + filter, + changeFilter, + }; + if (filterContext['key'] === 'executed') { + filterProps['input'] = filterContext['inputFilter']; + } + return ( + + + {/* 审批状态 */} + + {/* 模版类型 */} + + {/* 申请人 */} + + {/* 到达日期 */} + + + + + ); +}); diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabPendingItem.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabPendingItem.tsx new file mode 100644 index 000000000..d604000e7 --- /dev/null +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabPendingItem.tsx @@ -0,0 +1,45 @@ +import React, { useState } from 'react'; +import { BlockItem } from '@tachybase/client'; +import { observer } from '@tachybase/schema'; + +import { Space } from 'antd-mobile'; + +import { ApprovalReachDataType } from '../../component/ApprovalReachDataType'; +import { ApprovalTemplateType } from '../../component/ApprovalTemplateType'; +import { PendingStatus } from '../../constants'; +import { useTodosContext } from '../provider/todosContext'; +import { TabApplicantType } from './TabApplicantType'; +import { TabApprovalItem } from './TabApprovalItem'; + +import '../../style/style.css'; + +//审批-待处理 +export const TabPendingItem = observer((props) => { + const [filter, setFilter] = useState({}); + const filterContext = useTodosContext(); + const changeFilter = (data) => { + setFilter(data); + }; + const filterProps = { + ...props, + filter, + changeFilter, + }; + + if (filterContext['key'] === 'pending') { + filterProps['input'] = filterContext['inputFilter']; + } + return ( + + + {/* 模版类型 */} + + {/* 申请人 */} + + {/* 到达日期 */} + + + + + ); +}); diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabProcessedItem.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabProcessedItem.tsx new file mode 100644 index 000000000..3f8dd2868 --- /dev/null +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabProcessedItem.tsx @@ -0,0 +1,48 @@ +import React, { useState } from 'react'; +import { BlockItem } from '@tachybase/client'; +import { observer } from '@tachybase/schema'; + +import { Space } from 'antd-mobile'; + +import { ApprovalReachDataType } from '../../component/ApprovalReachDataType'; +import { ApprovalTemplateType } from '../../component/ApprovalTemplateType'; +import { useTodosContext } from '../provider/todosContext'; +import { TabApplicantType } from './TabApplicantType'; +import { TabApprovalItem } from './TabApprovalItem'; +import { TabApprovalType } from './TabApprovalType'; + +import '../../style/style.css'; + +import { ProcessedStatus } from '../../constants'; + +//审批-已处理 +export const TabProcessedItem = observer((props) => { + const [filter, setFilter] = useState({}); + const filterContext = useTodosContext(); + const changeFilter = (data) => { + setFilter(data); + }; + const filterProps = { + ...props, + filter, + changeFilter, + }; + if (filterContext['key'] === 'processed') { + filterProps['input'] = filterContext['inputFilter']; + } + return ( + + + {/* 审批状态 */} + + {/* 模版类型 */} + + {/* 申请人 */} + + {/* 到达日期 */} + + + + + ); +}); diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/ViewTodosUserJobsContent.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/ViewTodosUserJobsContent.tsx new file mode 100644 index 000000000..4889817ad --- /dev/null +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/ViewTodosUserJobsContent.tsx @@ -0,0 +1,148 @@ +import React, { useContext, useEffect, useState } from 'react'; +import { SchemaComponent, useAPIClient, useFormBlockContext, usePlugin } from '@tachybase/client'; +import PluginWorkflowClient, { + DetailsBlockProvider, + FlowContext, + linkNodes, + useAvailableUpstreams, +} from '@tachybase/plugin-workflow/client'; + +import { Result } from 'antd'; +import { NavBar, Skeleton } from 'antd-mobile'; +import _ from 'lodash'; +import { useNavigate, useParams } from 'react-router-dom'; + +import { ContextWithActionEnabled } from '../../context/WithActionEnabled'; +import { useTranslation } from '../../locale'; + +import '../../style/style.css'; + +import { MobileProvider } from '@tachybase/plugin-mobile-client/client'; +import { Registry } from '@tachybase/utils/client'; + +import { ManualFormType } from '../../constants'; +import { ContextApprovalExecution } from '../../context/ApprovalExecution'; +import { useUserJobsFormBlockProps } from '../hook/useFormBlockProps'; +import { useUserJobsSubmit } from '../hook/useSubmit'; +import { ActionBarUserJobsProvider } from '../provider/ActionBarProvider'; +import { FormBlockProvider } from '../provider/FormBlockProvider'; +import { ManualActionStatusProvider } from '../provider/ManualActionStatusProvider'; + +// 审批-执行处理-查看: 内容 +export const ViewTodosUserJobsContent = () => { + const { t } = useTranslation(); + const { actionEnabled } = useContext(ContextWithActionEnabled); + const navigate = useNavigate(); + const params = useParams(); + const { id } = params; + const api = useAPIClient(); + const [noDate, setNoDate] = useState(false); + const workflowPlugin = usePlugin(PluginWorkflowClient); + const [flowContext, setFlowContext] = useState(null); + const [jobsData, setJobsData] = useState({}); + const [node, setNode] = useState(null); + useEffect(() => { + api + .resource('users_jobs') + .get?.({ + filterByTk: id, + appends: ['node', 'job', 'workflow', 'workflow.nodes', 'execution', 'execution.jobs'], + }) + .then(({ data }) => { + if (!data.data) setNoDate(true); + const { node, workflow: { nodes = [], ...workflow } = {}, execution, ...userJob } = data?.data ?? {}; + linkNodes(nodes); + setNode(node); + setFlowContext({ + userJob, + workflow, + nodes, + execution, + }); + setJobsData(data.data); + return; + }) + .catch(() => { + console.error; + }); + }, []); + const upstreams = useAvailableUpstreams(flowContext?.nodes.find((item) => item.id === node.id)); + const nodeComponents = upstreams.reduce( + (components, { type }) => Object.assign(components, workflowPlugin.instructions.get(type).components), + {}, + ); + + if (noDate) { + return ; + } + return ( +
+ { + navigate(-1); + }} + className="navBarStyle" + > + {'执行处理'} + +
+ {node && flowContext ? ( + + + Object.assign(result, item.block.components), + {}, + ), + ...nodeComponents, + MobileProvider, + }} + scope={{ + useSubmit: useUserJobsSubmit, + useFormBlockProps: useUserJobsFormBlockProps, + useDetailsBlockProps, + // @ts-ignore + ...Array.from(manualFormTypes.getValues()).reduce( + (result, item: ManualFormType) => Object.assign(result, item.block.scope), + {}, + ), + }} + schema={{ + type: 'void', + 'x-component': 'MobileProvider', + properties: { + page: { + type: 'void', + 'x-component': 'MPage', + 'x-designer': 'MPage.Designer', + 'x-component-props': {}, + properties: Object.values(node.config?.schema)[0]['properties'], + }, + }, + }} + /> + + + ) : ( +
+ + +
+ )} +
+
+ ); +}; + +function useDetailsBlockProps() { + const { form } = useFormBlockContext(); + return { form }; +} + +export const manualFormTypes = new Registry(); diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/componentSchema.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/componentSchema.tsx new file mode 100644 index 000000000..6b19b4f74 --- /dev/null +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/componentSchema.tsx @@ -0,0 +1,71 @@ +export const tabPendingSchema = (t, props, parantUid) => { + return { + type: 'void', + name: 'TabPendingItem', + title: t('Pending'), + 'x-settings': 'ApprovalSettings', + 'x-component': 'TabPendingItem', + 'x-component-props': { + ...props, + collectionName: 'approvalRecords', + settingBlock: true, + tabKey: 'pending', + parantUid, + parantParams: props['params'], + }, + }; +}; + +export const tabProcessedSchema = (t, props, parantUid) => { + return { + type: 'void', + name: 'TabProcessedItem', + title: t('Processed'), + 'x-settings': 'ApprovalSettings', + 'x-component': 'TabProcessedItem', + 'x-component-props': { + ...props, + collectionName: 'approvalRecords', + settingBlock: true, + tabKey: 'processed', + parantUid, + parantParams: props['params'], + }, + }; +}; + +export const tabDuplicateSchema = (t, props, parantUid) => { + return { + type: 'void', + name: 'TabDuplicateItem', + title: t('Duplicate'), + 'x-settings': 'ApprovalSettings', + 'x-component': 'TabDuplicateItem', + 'x-component-props': { + ...props, + collectionName: 'approvalRecords', + settingBlock: true, + tabKey: 'duplicate', + parantUid, + parantParams: props['params'], + }, + }; +}; + +export const tabExecutedSchema = (t, props, parantUid) => { + return { + type: 'void', + name: 'TabExecutedItem', + title: t('Executed'), + 'x-settings': 'ApprovalSettings', + 'x-component': 'TabExecutedItem', + 'x-component-props': { + ...props, + collectionName: 'users_jobs', + settingBlock: true, + tabKey: 'executed', + parantUid, + parantParams: props['params'], + }, + }; +}; diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/hook/useFormBlockProps.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/hook/useFormBlockProps.tsx index 8ffbe8b87..5a793515a 100644 --- a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/hook/useFormBlockProps.tsx +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/hook/useFormBlockProps.tsx @@ -1,8 +1,12 @@ import { useEffect } from 'react'; -import { useCurrentUserContext } from '@tachybase/client'; +import { useCurrentUserContext, useFormBlockContext, useRecord } from '@tachybase/client'; +import { useFlowContext } from '@tachybase/plugin-workflow/client'; import { useForm } from '@tachybase/schema'; import { ApprovalStatusEnumDict } from '../../constants'; + +import { ApprovalStatusEnumDict } from '../../constants'; + import { useContextApprovalExecution } from '../../context/ApprovalExecution'; export function useFormBlockProps() { @@ -29,3 +33,25 @@ export function useFormBlockProps() { return { form }; } + +export function useUserJobsFormBlockProps() { + const { userJob, execution } = useFlowContext(); + const record = useRecord(); + const { data: user } = useCurrentUserContext(); + const { form } = useFormBlockContext(); + + const pattern = + execution.status || userJob.status + ? record + ? 'readPretty' + : 'disabled' + : user?.data?.id !== userJob.userId + ? 'disabled' + : 'editable'; + + useEffect(() => { + form?.setPattern(pattern); + }, [pattern, form]); + + return { form }; +} diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/hook/useSubmit.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/hook/useSubmit.tsx index 30ff1384e..8fd2ad6df 100644 --- a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/hook/useSubmit.tsx +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/hook/useSubmit.tsx @@ -1,5 +1,6 @@ -import { useActionContext, useAPIClient } from '@tachybase/client'; -import { useField, useForm } from '@tachybase/schema'; +import { useActionContext, useAPIClient, useTableBlockContext } from '@tachybase/client'; +import { useFlowContext } from '@tachybase/plugin-workflow/client'; +import { useField, useFieldSchema, useForm } from '@tachybase/schema'; import { Toast } from 'antd-mobile'; @@ -50,3 +51,41 @@ export function useSubmit() { }, }; } + +export function useUserJobsSubmit() { + const api = useAPIClient(); + const { values, submit } = useForm(); + const buttonSchema = useFieldSchema(); + const { service } = useTableBlockContext(); + const { userJob, execution } = useFlowContext(); + const { name: actionKey } = buttonSchema; + const { name: formKey } = buttonSchema.parent.parent; + return { + async run() { + if (execution.status || userJob.status) { + return; + } + await submit(); + const res = await api.resource('users_jobs').submit({ + filterByTk: userJob.id, + values: { + result: { [formKey]: values, _: actionKey }, + }, + }); + if (res.status === 202) { + Toast.show({ + icon: 'success', + content: '处理成功', + }); + setTimeout(() => { + location.reload(); + }, 1000); + } else { + Toast.show({ + icon: 'fail', + content: '处理失败', + }); + } + }, + }; +} diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/interface/interface.ts b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/interface/interface.ts index 253354cbb..3d4f88c1a 100644 --- a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/interface/interface.ts +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/interface/interface.ts @@ -1,22 +1,23 @@ export interface ApprovalExecution { id: number; - approval: Approval; + approval?: Approval; approvalExecution?: approvalExecution; - approvalId: number; + approvalId?: number; comment?: any; execution: execution; executionId: number; index?: string; - job?: job; - jobId?: number; - node?: node; - nodeId?: number; - snapshot: snapshot; + job: job; + jobId: number; + node: node; + nodeId: number; + snapshot?: snapshot; status: number; user?: user; userId?: number; - workflow?: any; - workflowId?: number; + workflow: any; + workflowId: number; + result: any; updatedAt: any; } diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/provider/ActionBarProvider.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/provider/ActionBarProvider.tsx index f26f1541f..4afe6705f 100644 --- a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/provider/ActionBarProvider.tsx +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/provider/ActionBarProvider.tsx @@ -1,5 +1,7 @@ import React from 'react'; -import { ActionBarProvider as ClientActionBarProvider, useCompile } from '@tachybase/client'; +import { ActionBarProvider as ClientActionBarProvider, useCompile, useCurrentUserContext } from '@tachybase/client'; +import { useFlowContext } from '@tachybase/plugin-workflow/client'; +import { useFieldSchema } from '@tachybase/schema'; import { str2moment } from '@tachybase/utils/client'; import { Space, Tag } from 'antd'; @@ -29,3 +31,24 @@ const ComponentUserInfo = () => {
); }; + +export function ActionBarUserJobsProvider(props) { + const { data: user } = useCurrentUserContext(); + const { userJob } = useFlowContext(); + const { status, result, userId } = userJob; + const buttonSchema = useFieldSchema(); + const { name } = buttonSchema.parent.toJSON(); + + let { children: content } = props; + if (status) { + if (!result[name]) { + content = null; + } + } else { + if (user?.data?.id !== userId) { + content = null; + } + } + + return content; +} diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/provider/FormBlockProvider.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/provider/FormBlockProvider.tsx new file mode 100644 index 000000000..f7b7e96d9 --- /dev/null +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/provider/FormBlockProvider.tsx @@ -0,0 +1,98 @@ +import React, { useMemo, useRef } from 'react'; +import { + BlockRequestContext_deprecated, + CollectionManagerProvider, + CollectionProvider_deprecated, + DEFAULT_DATA_SOURCE_KEY, + FormActiveFieldsProvider, + FormBlockContext, + FormV2, + RecordProvider, + useAPIClient, + useAssociationNames, + useBlockRequestContext, + useDataSourceHeaders, + useDesignable, + useRecord, +} from '@tachybase/client'; +import { createForm, RecursionField, useField, useFieldSchema } from '@tachybase/schema'; + +import { useContextApprovalExecution } from '../../context/ApprovalExecution'; + +export function FormBlockProvider(props) { + const userJob = useContextApprovalExecution(); + const fieldSchema = useFieldSchema(); + const field = useField(); + const formBlockRef = useRef(null); + const dataSource = props.dataSource || DEFAULT_DATA_SOURCE_KEY; + + const { getAssociationAppends } = useAssociationNames(dataSource); + const { appends, updateAssociationValues } = getAssociationAppends(); + const [formKey] = Object.keys(fieldSchema.toJSON().properties ?? {}); + const values = userJob?.result?.[formKey]; + + const { findComponent } = useDesignable(); + const Component = findComponent(field.component?.[0]) || React.Fragment; + + const form = useMemo( + () => + createForm({ + initialValues: values, + }), + [values], + ); + + const params = useMemo(() => { + return { + appends, + ...props.params, + }; + }, [appends, props.params]); + const service = useMemo(() => { + return { + loading: false, + data: { + data: values, + }, + }; + }, [values]); + const api = useAPIClient(); + const headers = useDataSourceHeaders(dataSource); + + const resource = api.resource(props.collection, undefined, headers); + const __parent = useBlockRequestContext(); + + const formBlockValue = useMemo(() => { + return { + params, + form, + field, + service, + updateAssociationValues, + formBlockRef, + }; + }, [field, form, params, service, updateAssociationValues]); + + return !userJob.status || values ? ( + + + + + + + + +
+ +
+
+
+
+
+
+
+
+ ) : null; +} diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/provider/ManualActionStatusProvider.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/provider/ManualActionStatusProvider.tsx new file mode 100644 index 000000000..30be58ddd --- /dev/null +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/provider/ManualActionStatusProvider.tsx @@ -0,0 +1,21 @@ +import React, { createContext, useEffect } from 'react'; +import { useFlowContext } from '@tachybase/plugin-workflow/client'; +import { useField, useFieldSchema } from '@tachybase/schema'; + +export const ManualActionStatusContext = createContext(null); +ManualActionStatusContext.displayName = 'ManualActionStatusContext'; + +export function ManualActionStatusProvider({ value, children }) { + const { userJob, execution } = useFlowContext(); + const button = useField(); + const buttonSchema = useFieldSchema(); + + useEffect(() => { + if (execution.status || userJob.status) { + button.disabled = true; + button.visible = userJob.status === value && userJob.result._ === buttonSchema.name; + } + }, [execution, userJob, value, button, buttonSchema.name]); + + return {children}; +} diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/provider/todosContext.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/provider/todosContext.tsx new file mode 100644 index 000000000..12a9a7040 --- /dev/null +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/provider/todosContext.tsx @@ -0,0 +1,7 @@ +import { createContext, useContext } from 'react'; + +export const todosContext = createContext({}); + +export const useTodosContext = () => { + return useContext(todosContext); +}; diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/index.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/index.tsx index ed3332461..905a4535d 100644 --- a/packages/plugins/@hera/plugin-approval-mobile/src/client/index.tsx +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/index.tsx @@ -22,6 +22,10 @@ export class PluginApprovalMobileClient extends Plugin { path: '/mobile/:name/:id/:category/detailspage', Component: 'ViewActionTodosContent', }); + this.app.router.add('mobile.approval.userJobspage', { + path: '/mobile/:name/:id/userJobspage', + Component: 'ViewTodosUserJobsContent', + }); } } diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/locale/en-US.json b/packages/plugins/@hera/plugin-approval-mobile/src/locale/en-US.json index d46f69b06..62f6c424f 100644 --- a/packages/plugins/@hera/plugin-approval-mobile/src/locale/en-US.json +++ b/packages/plugins/@hera/plugin-approval-mobile/src/locale/en-US.json @@ -64,5 +64,8 @@ "Trigger data": "Trigger data", "All":"All", "Initiations":"Initiations", - "UserInitiations":"UserInitiations" + "UserInitiations":"UserInitiations", + "Processed":"Processed", + "Duplicate":"Duplicate", + "Executed":"Executed" } diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/locale/zh-CN.json b/packages/plugins/@hera/plugin-approval-mobile/src/locale/zh-CN.json index 28af3e422..705e8e166 100644 --- a/packages/plugins/@hera/plugin-approval-mobile/src/locale/zh-CN.json +++ b/packages/plugins/@hera/plugin-approval-mobile/src/locale/zh-CN.json @@ -79,5 +79,24 @@ "Trigger data": "触发器数据", "All":"全部", "Initiations":"发起申请", - "UserInitiations":"我的发起" + "UserInitiations":"我的发起", + "Processed":"已处理", + "Duplicate":"抄送我", + "Executed":"执行处理", + "On going": "进行中", + "Resolved": "完成", + "Failed": "失败", + "Error": "出错", + "Aborted": "已终止", + "Retry needed": "需重试", + "Triggered but still waiting in queue to execute.": "已触发但仍在队列中等待执行。", + "Started and executing, maybe waiting for an async callback (manual, delay etc.).": "已开始执行,可能在等待异步回调(人工、延时等)。", + "Successfully finished.": "成功完成。", + "Failed to satisfy node configurations.": "未满足节点配置造成的失败。", + "Some node meets error.": "某个节点出错。", + "Running of some node was aborted by program flow.": "某个节点被程序流程终止。", + "Manually canceled whole execution when waiting.": "等待时被手动取消整个执行。", + "Rejected from a manual node.": "被人工节点拒绝继续。", + "General failed but should do another try.": "执行失败,需重试。", + "Queueing": "队列中" } diff --git a/packages/plugins/@hera/plugin-core/src/client/features/departments/components/ComponentX.tsx b/packages/plugins/@hera/plugin-core/src/client/features/departments/components/ComponentX.tsx index 500c35e47..5f0d6ff2a 100644 --- a/packages/plugins/@hera/plugin-core/src/client/features/departments/components/ComponentX.tsx +++ b/packages/plugins/@hera/plugin-core/src/client/features/departments/components/ComponentX.tsx @@ -1,14 +1,16 @@ -import { MoreOutlined } from '@ant-design/icons'; -import { css, useAPIClient, useResourceActionContext } from '@tachybase/client'; -import { App, Dropdown, Empty, Tree } from 'antd'; import { useContext, useEffect } from 'react'; +import { css, useAPIClient, useResourceActionContext } from '@tachybase/client'; + +import { MoreOutlined } from '@ant-design/icons'; +import { App, Dropdown, Empty, Tree } from 'antd'; import { jsx, jsxs } from 'react/jsx-runtime'; + import { useTranslation } from '../../../locale'; import { contextK } from '../context/contextK'; +import { contextN } from '../context/contextN'; import { k } from '../others/k'; import { schemaHhe } from '../schema/schemaHhe'; import { schemaYye } from '../schema/schemaYye'; -import { contextN } from '../context/contextN'; export const ComponentX = () => { const { data: e, loading: t } = useResourceActionContext(); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e820f2fc6..983360aaf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4007,7 +4007,7 @@ importers: devDependencies: '@ant-design/icons': specifier: 5.x - version: 5.3.6(react-dom@18.2.0)(react@18.2.0) + version: 5.3.7(react-dom@18.2.0)(react@18.2.0) '@tachybase/actions': specifier: workspace:* version: link:../../../core/actions @@ -4995,6 +4995,21 @@ packages: react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + /@ant-design/icons@5.3.7(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-bCPXTAg66f5bdccM4TT21SQBDO1Ek2gho9h3nO9DAKXJP4sq+5VBjrQMSxMVXSB3HyEz+cUbHQ5+6ogxCOpaew==} + engines: {node: '>=8'} + peerDependencies: + react: '>=16.0.0' + react-dom: '>=16.0.0' + dependencies: + '@ant-design/colors': 7.0.2 + '@ant-design/icons-svg': 4.4.2 + '@babel/runtime': 7.24.5 + classnames: 2.5.1 + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + /@ant-design/plots@2.1.14(lodash-es@4.17.21)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-ZFhvlNUsPcvD8d+nX4bXA9djbEUDVfKm8/xvFplffWT68rWM37d32qI7EghSvLUreszqh60DZAy80wCA08lgoQ==} peerDependencies: @@ -5048,7 +5063,7 @@ packages: '@babel/runtime': 7.24.5 '@ctrl/tinycolor': 3.6.1 antd: 5.16.1(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) swr: 2.2.4(react@18.2.0) @@ -5060,14 +5075,14 @@ packages: react: '>=17.0.0' react-dom: '>=17.0.0' dependencies: - '@ant-design/icons': 5.3.6(react-dom@18.2.0)(react@18.2.0) + '@ant-design/icons': 5.3.7(react-dom@18.2.0)(react@18.2.0) '@ant-design/pro-provider': 2.13.5(antd@5.16.1)(react-dom@18.2.0)(react@18.2.0) '@babel/runtime': 7.24.5 antd: 5.16.1(react-dom@18.2.0)(react@18.2.0) classnames: 2.5.1 dayjs: 1.11.10 lodash.merge: 4.6.2 - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) safe-stable-stringify: 2.4.3 @@ -10569,7 +10584,7 @@ packages: '@babel/runtime': 7.24.5 '@ctrl/tinycolor': 3.6.1 classnames: 2.5.1 - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -10580,7 +10595,7 @@ packages: react-dom: '>=16.9.0' dependencies: '@babel/runtime': 7.24.5 - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -10599,7 +10614,7 @@ packages: dependencies: '@babel/runtime': 7.24.5 classnames: 2.5.1 - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -10612,7 +10627,7 @@ packages: dependencies: '@babel/runtime': 7.24.5 classnames: 2.5.1 - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -10627,7 +10642,7 @@ packages: '@rc-component/portal': 1.1.2(react-dom@18.2.0)(react@18.2.0) '@rc-component/trigger': 2.1.1(react-dom@18.2.0)(react@18.2.0) classnames: 2.5.1 - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -10641,13 +10656,29 @@ packages: '@babel/runtime': 7.24.5 '@rc-component/portal': 1.1.2(react-dom@18.2.0)(react@18.2.0) classnames: 2.5.1 - rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) + rc-motion: 2.9.1(react-dom@18.2.0)(react@18.2.0) rc-resize-observer: 1.4.0(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false + /@rc-component/trigger@2.1.0(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-24BQg0M34hUDSFofZ8qpTdMXwbykXIl7svFi3OaZwYiz3HDpmv0pOJs0p3zV6hl7q4QuJypmsDQNs2ADqRu7Bw==} + engines: {node: '>=8.x'} + peerDependencies: + react: '>=16.9.0' + react-dom: '>=16.9.0' + dependencies: + '@babel/runtime': 7.24.5 + '@rc-component/portal': 1.1.2(react-dom@18.2.0)(react@18.2.0) + classnames: 2.5.1 + rc-motion: 2.9.1(react-dom@18.2.0)(react@18.2.0) + rc-resize-observer: 1.4.0(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + /@rc-component/trigger@2.1.1(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-UjHkedkgtEcgQu87w1VuWug1idoDJV7VUt0swxHXRcmei2uu1AuUzGBPEUlmOmXGJ+YtTgZfVLi7kuAUKoZTMA==} engines: {node: '>=8.x'} @@ -10658,9 +10689,9 @@ packages: '@babel/runtime': 7.24.5 '@rc-component/portal': 1.1.2(react-dom@18.2.0)(react@18.2.0) classnames: 2.5.1 - rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) + rc-motion: 2.9.1(react-dom@18.2.0)(react@18.2.0) rc-resize-observer: 1.4.0(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -14263,14 +14294,14 @@ packages: dependencies: '@ant-design/colors': 7.0.2 '@ant-design/cssinjs': 1.20.0(react-dom@18.2.0)(react@18.2.0) - '@ant-design/icons': 5.3.6(react-dom@18.2.0)(react@18.2.0) + '@ant-design/icons': 5.3.7(react-dom@18.2.0)(react@18.2.0) '@ant-design/react-slick': 1.1.2(react@18.2.0) '@babel/runtime': 7.24.5 '@ctrl/tinycolor': 3.6.1 '@rc-component/color-picker': 1.5.3(react-dom@18.2.0)(react@18.2.0) '@rc-component/mutate-observer': 1.1.0(react-dom@18.2.0)(react@18.2.0) '@rc-component/tour': 1.14.2(react-dom@18.2.0)(react@18.2.0) - '@rc-component/trigger': 2.1.1(react-dom@18.2.0)(react@18.2.0) + '@rc-component/trigger': 2.1.0(react-dom@18.2.0)(react@18.2.0) classnames: 2.5.1 copy-to-clipboard: 3.3.3 dayjs: 1.11.10 @@ -24447,7 +24478,7 @@ packages: '@babel/runtime': 7.24.5 classnames: 2.5.1 dom-align: 1.12.4 - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) resize-observer-polyfill: 1.5.1 @@ -24463,8 +24494,8 @@ packages: array-tree-filter: 2.1.0 classnames: 2.5.1 rc-select: 14.13.0(react-dom@18.2.0)(react@18.2.0) - rc-tree: 5.8.5(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-tree: 5.8.7(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24476,7 +24507,7 @@ packages: dependencies: '@babel/runtime': 7.24.5 classnames: 2.5.1 - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24488,8 +24519,8 @@ packages: dependencies: '@babel/runtime': 7.24.5 classnames: 2.5.1 - rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-motion: 2.9.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24502,8 +24533,8 @@ packages: '@babel/runtime': 7.24.5 '@rc-component/portal': 1.1.2(react-dom@18.2.0)(react@18.2.0) classnames: 2.5.1 - rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-motion: 2.9.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24516,8 +24547,8 @@ packages: '@babel/runtime': 7.24.5 '@rc-component/portal': 1.1.2(react-dom@18.2.0)(react@18.2.0) classnames: 2.5.1 - rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-motion: 2.9.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24530,7 +24561,7 @@ packages: '@babel/runtime': 7.24.5 '@rc-component/trigger': 2.1.1(react-dom@18.2.0)(react@18.2.0) classnames: 2.5.1 - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24543,7 +24574,7 @@ packages: dependencies: '@babel/runtime': 7.24.5 async-validator: 4.2.5 - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24556,7 +24587,7 @@ packages: dependencies: '@babel/runtime': 7.24.5 async-validator: 4.2.5 - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24570,8 +24601,8 @@ packages: '@rc-component/portal': 1.1.2(react-dom@18.2.0)(react@18.2.0) classnames: 2.5.1 rc-dialog: 9.4.0(react-dom@18.2.0)(react@18.2.0) - rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-motion: 2.9.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24585,7 +24616,7 @@ packages: '@rc-component/mini-decimal': 1.1.0 classnames: 2.5.1 rc-input: 1.4.5(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24597,7 +24628,7 @@ packages: dependencies: '@babel/runtime': 7.24.5 classnames: 2.5.1 - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24613,7 +24644,7 @@ packages: rc-input: 1.4.5(react-dom@18.2.0)(react@18.2.0) rc-menu: 9.13.0(react-dom@18.2.0)(react@18.2.0) rc-textarea: 1.6.3(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24626,9 +24657,9 @@ packages: '@babel/runtime': 7.24.5 '@rc-component/trigger': 2.1.1(react-dom@18.2.0)(react@18.2.0) classnames: 2.5.1 - rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) + rc-motion: 2.9.1(react-dom@18.2.0)(react@18.2.0) rc-overflow: 1.3.2(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24640,7 +24671,19 @@ packages: dependencies: '@babel/runtime': 7.24.5 classnames: 2.5.1 - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + + /rc-motion@2.9.1(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-QD4bUqByjVQs7PhUT1d4bNxvtTcK9ETwtg7psbDfo6TmYalH/1hhjj4r2hbhW7g5OOEqYHhfwfj4noIvuOVRtQ==} + peerDependencies: + react: '>=16.9.0' + react-dom: '>=16.9.0' + dependencies: + '@babel/runtime': 7.24.5 + classnames: 2.5.1 + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24653,8 +24696,8 @@ packages: dependencies: '@babel/runtime': 7.24.5 classnames: 2.5.1 - rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-motion: 2.9.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24667,7 +24710,7 @@ packages: '@babel/runtime': 7.24.5 classnames: 2.5.1 rc-resize-observer: 1.4.0(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24679,7 +24722,7 @@ packages: dependencies: '@babel/runtime': 7.24.5 classnames: 2.5.1 - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24709,7 +24752,7 @@ packages: dayjs: 1.11.10 rc-overflow: 1.3.2(react-dom@18.2.0)(react@18.2.0) rc-resize-observer: 1.4.0(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24721,7 +24764,7 @@ packages: dependencies: '@babel/runtime': 7.24.5 classnames: 2.5.1 - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24734,7 +24777,7 @@ packages: dependencies: '@babel/runtime': 7.24.5 classnames: 2.5.1 - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24746,7 +24789,7 @@ packages: dependencies: '@babel/runtime': 7.24.5 classnames: 2.5.1 - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) resize-observer-polyfill: 1.5.1 @@ -24759,8 +24802,8 @@ packages: dependencies: '@babel/runtime': 7.24.5 classnames: 2.5.1 - rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-motion: 2.9.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24773,10 +24816,10 @@ packages: dependencies: '@babel/runtime': 7.24.5 classnames: 2.5.1 - rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) + rc-motion: 2.9.1(react-dom@18.2.0)(react@18.2.0) rc-overflow: 1.3.2(react-dom@18.2.0)(react@18.2.0) rc-trigger: 5.3.4(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) rc-virtual-list: 3.11.4(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24794,8 +24837,8 @@ packages: classnames: 2.5.1 rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) rc-overflow: 1.3.2(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) - rc-virtual-list: 3.11.4(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) + rc-virtual-list: 3.11.3(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false @@ -24810,9 +24853,9 @@ packages: '@babel/runtime': 7.24.5 '@rc-component/trigger': 2.1.1(react-dom@18.2.0)(react@18.2.0) classnames: 2.5.1 - rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) + rc-motion: 2.9.1(react-dom@18.2.0)(react@18.2.0) rc-overflow: 1.3.2(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) rc-virtual-list: 3.11.4(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24826,7 +24869,7 @@ packages: dependencies: '@babel/runtime': 7.24.5 classnames: 2.5.1 - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24839,7 +24882,7 @@ packages: dependencies: '@babel/runtime': 7.24.5 classnames: 2.5.1 - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24851,7 +24894,7 @@ packages: dependencies: '@babel/runtime': 7.24.5 classnames: 2.5.1 - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24866,7 +24909,7 @@ packages: '@rc-component/context': 1.4.0(react-dom@18.2.0)(react@18.2.0) classnames: 2.5.1 rc-resize-observer: 1.4.0(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) rc-virtual-list: 3.11.4(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24882,9 +24925,9 @@ packages: classnames: 2.5.1 rc-dropdown: 4.2.0(react-dom@18.2.0)(react@18.2.0) rc-menu: 9.13.0(react-dom@18.2.0)(react@18.2.0) - rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) + rc-motion: 2.9.1(react-dom@18.2.0)(react@18.2.0) rc-resize-observer: 1.4.0(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24898,7 +24941,7 @@ packages: classnames: 2.5.1 rc-input: 1.4.5(react-dom@18.2.0)(react@18.2.0) rc-resize-observer: 1.4.0(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24938,8 +24981,8 @@ packages: '@babel/runtime': 7.24.5 classnames: 2.5.1 rc-select: 14.13.0(react-dom@18.2.0)(react@18.2.0) - rc-tree: 5.8.5(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-tree: 5.8.7(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24967,8 +25010,8 @@ packages: dependencies: '@babel/runtime': 7.24.5 classnames: 2.5.1 - rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-motion: 2.9.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) rc-virtual-list: 3.11.4(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -24984,8 +25027,8 @@ packages: '@babel/runtime': 7.24.5 classnames: 2.5.1 rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) - rc-virtual-list: 3.11.4(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) + rc-virtual-list: 3.11.3(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false @@ -24999,8 +25042,23 @@ packages: dependencies: '@babel/runtime': 7.24.5 classnames: 2.5.1 - rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-motion: 2.9.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) + rc-virtual-list: 3.11.4(react-dom@18.2.0)(react@18.2.0) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + + /rc-tree@5.8.7(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-cpsIQZ4nNYwpj6cqPRt52e/69URuNdgQF9wZ10InmEf8W3+i0A41OVmZWwHuX9gegQSqj+DPmaDkZFKQZ+ZV1w==} + engines: {node: '>=10.x'} + peerDependencies: + react: '*' + react-dom: '*' + dependencies: + '@babel/runtime': 7.24.5 + classnames: 2.5.1 + rc-motion: 2.9.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) rc-virtual-list: 3.11.4(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -25015,8 +25073,8 @@ packages: '@babel/runtime': 7.24.5 classnames: 2.5.1 rc-align: 4.0.15(react-dom@18.2.0)(react@18.2.0) - rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-motion: 2.9.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: true @@ -25029,7 +25087,7 @@ packages: dependencies: '@babel/runtime': 7.24.5 classnames: 2.5.1 - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -25055,6 +25113,32 @@ packages: react-dom: 18.2.0(react@18.2.0) react-is: 18.3.1 + /rc-util@5.41.0(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-xtlCim9RpmVv0Ar2Nnc3WfJCxjQkTf3xHPWoFdjp1fSs2NirQwqiQrfqdU9HUe0kdfb168M/T8Dq0IaX50xeKg==} + peerDependencies: + react: '>=16.9.0' + react-dom: '>=16.9.0' + dependencies: + '@babel/runtime': 7.24.5 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-is: 18.3.1 + + /rc-virtual-list@3.11.3(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-tu5UtrMk/AXonHwHxUogdXAWynaXsrx1i6dsgg+lOo/KJSF8oBAcprh1z5J3xgnPJD5hXxTL58F8s8onokdt0Q==} + engines: {node: '>=8.x'} + peerDependencies: + react: '*' + react-dom: '*' + dependencies: + '@babel/runtime': 7.24.5 + classnames: 2.5.1 + rc-resize-observer: 1.4.0(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + dev: false + /rc-virtual-list@3.11.4(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-NbBi0fvyIu26gP69nQBiWgUMTPX3mr4FcuBQiVqagU0BnuX8WQkiivnMs105JROeuUIFczLrlgUhLQwTWV1XDA==} engines: {node: '>=8.x'} @@ -25065,7 +25149,7 @@ packages: '@babel/runtime': 7.24.5 classnames: 2.5.1 rc-resize-observer: 1.4.0(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) + rc-util: 5.41.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0)