fix: 完善移动端审批组件 (#1042)
Reviewed-on: daoyoucloud/tachybase#1042 Co-authored-by: wjh <wwwjh0710@163.com> Co-committed-by: wjh <wwwjh0710@163.com>
This commit is contained in:
parent
ad079d4e5f
commit
63c351ea1a
@ -1,8 +1,10 @@
|
|||||||
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
|
|
||||||
import { CloseCircleFilled } from '@ant-design/icons';
|
import { CloseCircleFilled } from '@ant-design/icons';
|
||||||
import { Tag, TreeSelect } from 'antd';
|
import { Tag, TreeSelect } from 'antd';
|
||||||
import type { DefaultOptionType, TreeSelectProps } from 'rc-tree-select/es/TreeSelect';
|
import type { DefaultOptionType, TreeSelectProps } from 'rc-tree-select/es/TreeSelect';
|
||||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CollectionFieldOptions_deprecated,
|
CollectionFieldOptions_deprecated,
|
||||||
parseCollectionName,
|
parseCollectionName,
|
||||||
|
@ -1,16 +1,7 @@
|
|||||||
import {
|
import { SchemaInitializerItem, useSchemaInitializer, useSchemaInitializerItem } from '@tachybase/client';
|
||||||
ExtendCollectionsProvider,
|
|
||||||
SchemaInitializerItem,
|
|
||||||
useSchemaInitializer,
|
|
||||||
useSchemaInitializerItem,
|
|
||||||
} from '@tachybase/client';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ISchema } from '@tachybase/schema';
|
import { ISchema } from '@tachybase/schema';
|
||||||
import { CalendarOutline } from 'antd-mobile-icons';
|
import { CalendarOutline } from 'antd-mobile-icons';
|
||||||
import { CollectionWorkflows } from './collection/Workflows.collection';
|
|
||||||
import { CollectionFlowNodes } from './collection/FlowNodes.collection';
|
|
||||||
import { CollectionApprovals } from './collection/Approvals.collection';
|
|
||||||
import { CollectionApprovalTodos } from './collection/ApprovalTodos';
|
|
||||||
|
|
||||||
export const ApprovalBlockInitializer = () => {
|
export const ApprovalBlockInitializer = () => {
|
||||||
const { insert } = useSchemaInitializer();
|
const { insert } = useSchemaInitializer();
|
||||||
@ -25,6 +16,7 @@ export const ApprovalBlockInitializer = () => {
|
|||||||
'x-component': item.itemComponent,
|
'x-component': item.itemComponent,
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
collectionName: item.collectionName,
|
collectionName: item.collectionName,
|
||||||
|
settingBlock: item?.settingBlock,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
insert(schema);
|
insert(schema);
|
||||||
@ -42,26 +34,10 @@ export const ApprovalBlockInitializer = () => {
|
|||||||
|
|
||||||
export const ApprovalInitializerItem = [
|
export const ApprovalInitializerItem = [
|
||||||
{
|
{
|
||||||
type: 'itemGroup',
|
type: 'item',
|
||||||
name: 'initiations',
|
name: 'initiations',
|
||||||
title: '发起',
|
title: '发起',
|
||||||
children: [
|
itemComponent: 'InitiationsBlock',
|
||||||
{
|
|
||||||
type: 'item',
|
|
||||||
name: 'initiationsApproval',
|
|
||||||
title: '发起申请',
|
|
||||||
itemComponent: 'InitiationsBlock',
|
|
||||||
collectionName: 'workflows',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'item',
|
|
||||||
name: 'currApproval',
|
|
||||||
title: '我发起的',
|
|
||||||
itemComponent: 'UserInitiationsBlock',
|
|
||||||
dataSource: 'main',
|
|
||||||
collectionName: 'approvals',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'item',
|
type: 'item',
|
||||||
@ -69,5 +45,6 @@ export const ApprovalInitializerItem = [
|
|||||||
name: 'todos',
|
name: 'todos',
|
||||||
itemComponent: 'TodosBlock',
|
itemComponent: 'TodosBlock',
|
||||||
collectionName: 'approvalRecords',
|
collectionName: 'approvalRecords',
|
||||||
|
settingBlock: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
|
removeNullCondition,
|
||||||
SchemaSettings,
|
SchemaSettings,
|
||||||
SchemaSettingsDataScope,
|
SchemaSettingsDataScope,
|
||||||
removeNullCondition,
|
|
||||||
useCollection,
|
useCollection,
|
||||||
useCollectionManager,
|
useCollectionManager,
|
||||||
useDataLoadingMode,
|
useDataLoadingMode,
|
||||||
@ -10,6 +10,7 @@ import {
|
|||||||
useFormBlockContext,
|
useFormBlockContext,
|
||||||
} from '@tachybase/client';
|
} from '@tachybase/client';
|
||||||
import { useField, useFieldSchema } from '@tachybase/schema';
|
import { useField, useFieldSchema } from '@tachybase/schema';
|
||||||
|
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
|
||||||
export const ApprovalSettings = new SchemaSettings({
|
export const ApprovalSettings = new SchemaSettings({
|
||||||
@ -24,15 +25,33 @@ export const ApprovalSettings = new SchemaSettings({
|
|||||||
const field = useField();
|
const field = useField();
|
||||||
const { form } = useFormBlockContext();
|
const { form } = useFormBlockContext();
|
||||||
const { dn } = useDesignable();
|
const { dn } = useDesignable();
|
||||||
|
const tabKey = fieldSchema['x-component-props']?.['tabKey'];
|
||||||
|
let defaultFilter = {};
|
||||||
|
if (tabKey && field.componentProps.params) {
|
||||||
|
defaultFilter = field.componentProps.params[tabKey];
|
||||||
|
} else if (tabKey && !field.componentProps.params) {
|
||||||
|
defaultFilter = field.componentProps.parantParams?.[tabKey];
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
collectionName,
|
collectionName,
|
||||||
defaultFilter: fieldSchema?.['x-component-props']?.params?.filter || {},
|
defaultFilter: tabKey ? defaultFilter : fieldSchema?.['x-component-props']?.params || {},
|
||||||
form: form,
|
form: form,
|
||||||
onSubmit: ({ filter }) => {
|
onSubmit: ({ filter }) => {
|
||||||
|
let params;
|
||||||
|
if (tabKey) {
|
||||||
|
params = { ...field.componentProps?.params };
|
||||||
|
params[tabKey] = {
|
||||||
|
...field.componentProps?.params?.[tabKey],
|
||||||
|
...filter,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
params = {
|
||||||
|
...field.componentProps?.params,
|
||||||
|
...filter,
|
||||||
|
};
|
||||||
|
}
|
||||||
_.set(field.componentProps, 'params', {
|
_.set(field.componentProps, 'params', {
|
||||||
...field.componentProps?.params,
|
...params,
|
||||||
filter,
|
|
||||||
});
|
});
|
||||||
fieldSchema['x-component-props']['params'] = field.componentProps.params;
|
fieldSchema['x-component-props']['params'] = field.componentProps.params;
|
||||||
dn.emit('patch', {
|
dn.emit('patch', {
|
||||||
@ -41,13 +60,21 @@ export const ApprovalSettings = new SchemaSettings({
|
|||||||
'x-component-props': fieldSchema['x-component-props'],
|
'x-component-props': fieldSchema['x-component-props'],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
if (tabKey) {
|
||||||
|
dn.emit('patch', {
|
||||||
|
schema: {
|
||||||
|
['x-uid']: fieldSchema['x-component-props']['parantUid'],
|
||||||
|
'x-component-props': { params: fieldSchema['x-component-props']['params'] },
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
// useVisible() {
|
useVisible() {
|
||||||
// const fieldSchema = useFieldSchema();
|
const fieldSchema = useFieldSchema();
|
||||||
// return !isTabSearchCollapsibleInputItem(fieldSchema['x-component']);
|
return fieldSchema['x-component-props']['settingBlock'];
|
||||||
// },
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'divider',
|
name: 'divider',
|
||||||
|
@ -19,7 +19,7 @@ export const ApprovalReachDataType = observer((props) => {
|
|||||||
setPopupVisible(true);
|
setPopupVisible(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{filter['createdAt'] ? `${formatDate(startData)}-${formatDate(endData)} ` : '到达日期'}
|
{filter?.['createdAt'] ? `${formatDate(startData)}-${formatDate(endData)} ` : '到达日期'}
|
||||||
<DownOutline />
|
<DownOutline />
|
||||||
</Space>
|
</Space>
|
||||||
<Popup
|
<Popup
|
||||||
|
@ -38,7 +38,7 @@ export const ApprovalTemplateType = observer((props) => {
|
|||||||
setVisible(true);
|
setVisible(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{columns.length && filter.workflowId && filter.workflowId !== 'all'
|
{columns.length && filter?.workflowId && filter?.workflowId !== 'all'
|
||||||
? columns.find((item) => item.value === filter.workflowId).label
|
? columns.find((item) => item.value === filter.workflowId).label
|
||||||
: '模版类型'}
|
: '模版类型'}
|
||||||
<DownOutline />
|
<DownOutline />
|
||||||
|
@ -5,7 +5,6 @@ import { TodosBlock } from './todos/TodosBlock';
|
|||||||
import { InitiationsBlock } from './initiations/InitiationsBlock';
|
import { InitiationsBlock } from './initiations/InitiationsBlock';
|
||||||
import { LauncherActionConfigInitializer } from './initiations/config/LauncherActionConfig';
|
import { LauncherActionConfigInitializer } from './initiations/config/LauncherActionConfig';
|
||||||
import { ViewActionTodosContent } from './todos/component/ViewActionTodosContent';
|
import { ViewActionTodosContent } from './todos/component/ViewActionTodosContent';
|
||||||
import { UserInitiationsBlock } from './initiations/UserInitiationsBlock';
|
|
||||||
import { ViewActionUserInitiationsContent } from './initiations/component/ViewActionUserInitiationsContent';
|
import { ViewActionUserInitiationsContent } from './initiations/component/ViewActionUserInitiationsContent';
|
||||||
import { ApprovalProcess } from './component/ApprovalProcess.view';
|
import { ApprovalProcess } from './component/ApprovalProcess.view';
|
||||||
import { ViewActionInitiationsContent } from './initiations/component/ViewActionInitiationsContent';
|
import { ViewActionInitiationsContent } from './initiations/component/ViewActionInitiationsContent';
|
||||||
@ -16,7 +15,6 @@ class PluginApproval extends Plugin {
|
|||||||
ApprovalBlockInitializer,
|
ApprovalBlockInitializer,
|
||||||
InitiationsBlock,
|
InitiationsBlock,
|
||||||
TodosBlock,
|
TodosBlock,
|
||||||
UserInitiationsBlock,
|
|
||||||
ViewActionTodosContent,
|
ViewActionTodosContent,
|
||||||
ViewActionUserInitiationsContent,
|
ViewActionUserInitiationsContent,
|
||||||
ViewActionInitiationsContent,
|
ViewActionInitiationsContent,
|
||||||
|
@ -1,87 +1,105 @@
|
|||||||
import { BlockItem, ExtendCollectionsProvider, css, useAPIClient, useRequest } from '@tachybase/client';
|
import { BlockItem, ExtendCollectionsProvider, SchemaComponent, useDesignable } from '@tachybase/client';
|
||||||
import React, { useEffect, useState } from 'react';
|
import { SearchBar, Space, Tabs } from 'antd-mobile';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import React, { createContext, useEffect, useState } from 'react';
|
||||||
import { AutoCenter, Card, SearchBar, Selector, Space } from 'antd-mobile';
|
import { observer, useFieldSchema } from '@tachybase/schema';
|
||||||
import { TeamFill } from 'antd-mobile-icons';
|
import '../style/style.css';
|
||||||
import { CollectionWorkflows } from '../collection/Workflows.collection';
|
import { CollectionWorkflows } from '../collection/Workflows.collection';
|
||||||
import { CollectionFlowNodes } from '../collection/FlowNodes.collection';
|
import { CollectionFlowNodes } from '../collection/FlowNodes.collection';
|
||||||
import { CollectionApprovals } from '../collection/Approvals.collection';
|
import { CollectionApprovals } from '../collection/Approvals.collection';
|
||||||
import { CollectionApprovalTodos } from '../collection/ApprovalTodos';
|
import { CollectionApprovalTodos } from '../collection/ApprovalTodos';
|
||||||
import { observer } from '@tachybase/schema';
|
import { InitiationsItem } from './component/InitiationsItem';
|
||||||
|
import { UserInitiationsItem } from './component/UserInitiationsItem';
|
||||||
|
import { useTranslation } from '../locale';
|
||||||
|
import '../style/style.css';
|
||||||
|
|
||||||
|
export const InitiationsBlockContext = createContext({});
|
||||||
|
|
||||||
export const InitiationsBlock = observer((props) => {
|
export const InitiationsBlock = observer((props) => {
|
||||||
const { params } = props as any;
|
const fieldSchema = useFieldSchema();
|
||||||
const [filter, setFilter] = useState({});
|
const { t } = useTranslation();
|
||||||
const [options, setOptions] = useState([]);
|
const [contextFilter, setContextFilter] = useState({ key: 'initiations', inputFilter: '' });
|
||||||
const api = useAPIClient();
|
const [changeValue, setChangeValue] = useState('');
|
||||||
const navigate = useNavigate();
|
|
||||||
useEffect(() => {
|
|
||||||
api
|
|
||||||
.request({
|
|
||||||
url: 'workflows:list',
|
|
||||||
params: { pageSize: 9999, filter: { ...params?.filter, ...filter } },
|
|
||||||
})
|
|
||||||
.then((res) => {
|
|
||||||
const option = res?.data?.data.map((value) => {
|
|
||||||
return {
|
|
||||||
...value,
|
|
||||||
value: value.id,
|
|
||||||
label: (
|
|
||||||
<div
|
|
||||||
style={{ display: 'flex', flexDirection: 'column', alignContent: 'center' }}
|
|
||||||
onClick={(c) => {
|
|
||||||
navigate(`/mobile/${value.title?.replace('审批流:', '') || ''}/approval/${value.id}/page`);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div>
|
|
||||||
<TeamFill />
|
|
||||||
</div>
|
|
||||||
{value.title?.replace('审批流:', '') || ''}
|
|
||||||
</div>
|
|
||||||
),
|
|
||||||
};
|
|
||||||
});
|
|
||||||
setOptions(option);
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
}, [params, filter]);
|
|
||||||
return (
|
return (
|
||||||
<ExtendCollectionsProvider
|
<ExtendCollectionsProvider
|
||||||
collections={[CollectionWorkflows, CollectionFlowNodes, CollectionApprovals, CollectionApprovalTodos]}
|
collections={[CollectionWorkflows, CollectionFlowNodes, CollectionApprovals, CollectionApprovalTodos]}
|
||||||
>
|
>
|
||||||
<BlockItem>
|
<BlockItem>
|
||||||
<div style={{ padding: '10px', minHeight: '90vh' }}>
|
<InitiationsBlockContext.Provider value={contextFilter}>
|
||||||
<SearchBar
|
<SearchBar
|
||||||
placeholder="请输入内容"
|
placeholder="搜索内容"
|
||||||
clearable
|
clearable
|
||||||
style={{ '--background': '#ffffff' }}
|
style={{ '--background': '#ffffff', padding: '10px', marginBottom: '10px ' }}
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
if (!value) setFilter({});
|
if (!value) {
|
||||||
|
const filter = { ...contextFilter };
|
||||||
|
filter.inputFilter = '';
|
||||||
|
setContextFilter(filter);
|
||||||
|
}
|
||||||
|
setChangeValue(value);
|
||||||
}}
|
}}
|
||||||
|
value={changeValue}
|
||||||
onSearch={(value) => {
|
onSearch={(value) => {
|
||||||
setFilter({
|
const filter = { ...contextFilter };
|
||||||
title: { $includes: value },
|
filter.inputFilter = value;
|
||||||
});
|
setContextFilter(filter);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Card
|
<Tabs
|
||||||
className={css`
|
style={{ '--title-font-size': '12px', backgroundColor: '#f3f3f3' }}
|
||||||
overflow: hidden;
|
onChange={(key) => {
|
||||||
margin-top: 20px;
|
const filter = { ...contextFilter };
|
||||||
.adm-card-body {
|
filter['key'] = key;
|
||||||
padding: 0;
|
filter['inputFilter'] = '';
|
||||||
}
|
setChangeValue('');
|
||||||
`}
|
setContextFilter(filter);
|
||||||
style={{ padding: '0', backgroundColor: '#f3f3f3' }}
|
}}
|
||||||
>
|
>
|
||||||
<Selector
|
<Tabs.Tab title="发起申请" key="initiations">
|
||||||
style={{ '--color': '#ffffff', '--gap': '1px' }}
|
<SchemaComponent
|
||||||
columns={3}
|
components={{
|
||||||
showCheckMark={false}
|
InitiationsItem,
|
||||||
options={options}
|
}}
|
||||||
/>
|
schema={{
|
||||||
</Card>
|
type: 'void',
|
||||||
</div>
|
name: 'initiations',
|
||||||
|
title: t('Initiations'),
|
||||||
|
'x-settings': 'ApprovalSettings',
|
||||||
|
'x-component': 'InitiationsItem',
|
||||||
|
'x-component-props': {
|
||||||
|
...props,
|
||||||
|
collectionName: 'workflows',
|
||||||
|
settingBlock: true,
|
||||||
|
tabKey: 'initiations',
|
||||||
|
parantUid: fieldSchema['x-uid'],
|
||||||
|
parantParams: props['params'],
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Tabs.Tab>
|
||||||
|
<Tabs.Tab title="我的发起" key="userInitiations">
|
||||||
|
<SchemaComponent
|
||||||
|
components={{
|
||||||
|
UserInitiationsItem,
|
||||||
|
}}
|
||||||
|
schema={{
|
||||||
|
type: 'void',
|
||||||
|
name: 'userInitiations',
|
||||||
|
title: t('UserInitiations'),
|
||||||
|
'x-settings': 'ApprovalSettings',
|
||||||
|
'x-component': 'UserInitiationsItem',
|
||||||
|
'x-component-props': {
|
||||||
|
...props,
|
||||||
|
collectionName: 'approvals',
|
||||||
|
settingBlock: true,
|
||||||
|
tabKey: 'userInitiations',
|
||||||
|
parantUid: fieldSchema['x-uid'],
|
||||||
|
parantParams: props['params'],
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Tabs.Tab>
|
||||||
|
</Tabs>
|
||||||
|
</InitiationsBlockContext.Provider>
|
||||||
</BlockItem>
|
</BlockItem>
|
||||||
</ExtendCollectionsProvider>
|
</ExtendCollectionsProvider>
|
||||||
);
|
);
|
||||||
|
@ -1,48 +0,0 @@
|
|||||||
import { BlockItem, ExtendCollectionsProvider, SchemaComponent, css } from '@tachybase/client';
|
|
||||||
import { Divider, SearchBar, Space, Tabs } from 'antd-mobile';
|
|
||||||
import React, { useEffect, useState } from 'react';
|
|
||||||
import { observer, useFieldSchema } from '@tachybase/schema';
|
|
||||||
import { ApprovalTemplateType } from '../component/ApprovalTemplateType';
|
|
||||||
import { ApprovalStatus } from './component/ApprovalStatus';
|
|
||||||
import { ApprovalItem } from './component/ApprovalItem';
|
|
||||||
import { ApprovalReachDataType } from '../component/ApprovalReachDataType';
|
|
||||||
import '../style/style.css';
|
|
||||||
import { CollectionWorkflows } from '../collection/Workflows.collection';
|
|
||||||
import { CollectionFlowNodes } from '../collection/FlowNodes.collection';
|
|
||||||
import { CollectionApprovals } from '../collection/Approvals.collection';
|
|
||||||
import { CollectionApprovalTodos } from '../collection/ApprovalTodos';
|
|
||||||
|
|
||||||
export const UserInitiationsBlock = observer((props) => {
|
|
||||||
const [filter, setFilter] = useState({});
|
|
||||||
const fieldSchema = useFieldSchema();
|
|
||||||
const changeFilter = (data) => {
|
|
||||||
setFilter(data);
|
|
||||||
};
|
|
||||||
const filterProps = {
|
|
||||||
...props,
|
|
||||||
changeFilter,
|
|
||||||
filter,
|
|
||||||
};
|
|
||||||
return (
|
|
||||||
<ExtendCollectionsProvider
|
|
||||||
collections={[CollectionWorkflows, CollectionFlowNodes, CollectionApprovals, CollectionApprovalTodos]}
|
|
||||||
>
|
|
||||||
<BlockItem>
|
|
||||||
<SearchBar
|
|
||||||
placeholder="搜索人名,标题、内容"
|
|
||||||
clearable
|
|
||||||
style={{ '--background': '#ffffff', padding: '10px' }}
|
|
||||||
/>
|
|
||||||
<Space justify="evenly" className="userInitiationsStyle">
|
|
||||||
{/* 模版类型 */}
|
|
||||||
<ApprovalTemplateType {...filterProps} />
|
|
||||||
{/* 到达日期 */}
|
|
||||||
<ApprovalReachDataType {...filterProps} />
|
|
||||||
{/* 审批状态 */}
|
|
||||||
<ApprovalStatus {...filterProps} />
|
|
||||||
</Space>
|
|
||||||
<ApprovalItem {...filterProps} />
|
|
||||||
</BlockItem>
|
|
||||||
</ExtendCollectionsProvider>
|
|
||||||
);
|
|
||||||
});
|
|
@ -1,23 +1,34 @@
|
|||||||
import { useAPIClient, useCurrentUserContext } from '@tachybase/client';
|
import { useAPIClient, useCurrentUserContext } from '@tachybase/client';
|
||||||
import { Badge, Empty, List, Space, Tag } from 'antd-mobile';
|
import { Badge, Empty, List, Space, Tag } from 'antd-mobile';
|
||||||
import React, { useState } from 'react';
|
import React, { useContext, useEffect, useState } from 'react';
|
||||||
import { useDeepCompareEffect } from 'ahooks';
|
import { useDeepCompareEffect } from 'ahooks';
|
||||||
import { ApprovalPriorityType, ApprovalStatusEnums } from '../../constants';
|
import { ApprovalPriorityType, ApprovalStatusEnums } from '../../constants';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { useTranslation } from '../../locale';
|
import { useTranslation } from '../../locale';
|
||||||
import { observer } from '@tachybase/schema';
|
import { observer } from '@tachybase/schema';
|
||||||
|
import { InitiationsBlockContext } from '../InitiationsBlock';
|
||||||
|
|
||||||
export const ApprovalItem = observer((props) => {
|
export const ApprovalItem = observer((props) => {
|
||||||
const { filter, params } = props as any;
|
const { filter, params, tabKey } = props as any;
|
||||||
const api = useAPIClient();
|
const api = useAPIClient();
|
||||||
|
const [defaultData, setDefaultData] = useState([]);
|
||||||
const [data, setData] = useState([]);
|
const [data, setData] = useState([]);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const user = useCurrentUserContext();
|
const user = useCurrentUserContext();
|
||||||
|
const contextFilter = useContext(InitiationsBlockContext);
|
||||||
|
const inputFilter = contextFilter['key'] === 'userInitiations' ? contextFilter['inputFilter'] : '';
|
||||||
useDeepCompareEffect(() => {
|
useDeepCompareEffect(() => {
|
||||||
changService(api, setData, user, { ...params?.filter, ...filter }, t);
|
changService(api, setData, user, { ...params?.[tabKey], ...filter }, t, setDefaultData);
|
||||||
}, [filter, params]);
|
}, [filter, params]);
|
||||||
|
useEffect(() => {
|
||||||
|
if (inputFilter && defaultData.length) {
|
||||||
|
const filterData = defaultData.filter((value) => (value.title as string)?.includes(inputFilter));
|
||||||
|
setData(filterData);
|
||||||
|
} else {
|
||||||
|
setData(defaultData);
|
||||||
|
}
|
||||||
|
}, [contextFilter]);
|
||||||
return (
|
return (
|
||||||
<div style={{ minHeight: '73vh' }}>
|
<div style={{ minHeight: '73vh' }}>
|
||||||
{data.length ? (
|
{data.length ? (
|
||||||
@ -30,17 +41,17 @@ export const ApprovalItem = observer((props) => {
|
|||||||
navigate(`/mobile/approval/${item.id}/page`);
|
navigate(`/mobile/approval/${item.id}/page`);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Badge color="#6ac3ff" content={Badge.dot} style={{ '--right': '100%' }}>
|
{/* <Badge color="#6ac3ff" content={Badge.dot} style={{ '--right': '100%' }}> */}
|
||||||
<Space block>
|
<Space block>
|
||||||
{item.title}
|
{item.title}
|
||||||
<Tag color={item.statusColor} fill="outline">
|
<Tag color={item.statusColor} fill="outline">
|
||||||
{item.statusTitle}
|
{item.statusTitle}
|
||||||
</Tag>
|
</Tag>
|
||||||
<Tag color={item.priorityColor} fill="outline">
|
<Tag color={item.priorityColor} fill="outline">
|
||||||
{item.priorityTitle}
|
{item.priorityTitle}
|
||||||
</Tag>
|
</Tag>
|
||||||
</Space>
|
</Space>
|
||||||
</Badge>
|
{/* </Badge> */}
|
||||||
<Space block> 事由:{item.reason}</Space>
|
<Space block> 事由:{item.reason}</Space>
|
||||||
</List.Item>
|
</List.Item>
|
||||||
);
|
);
|
||||||
@ -58,8 +69,7 @@ const approvalTodoListStatus = (item, t) => {
|
|||||||
return ApprovalStatusEnums.find((value) => value.value === status);
|
return ApprovalStatusEnums.find((value) => value.value === status);
|
||||||
};
|
};
|
||||||
|
|
||||||
const changService = (api, setData, user, filter, t) => {
|
const changService = (api, setData, user, filter, t, setDefaultData) => {
|
||||||
console.log('🚀 ~ changService ~ filter:', filter);
|
|
||||||
api
|
api
|
||||||
.request({
|
.request({
|
||||||
url: 'approvals:listCentralized',
|
url: 'approvals:listCentralized',
|
||||||
@ -85,7 +95,9 @@ const changService = (api, setData, user, filter, t) => {
|
|||||||
return Date.parse(b.createdAt) - Date.parse(a.createdAt);
|
return Date.parse(b.createdAt) - Date.parse(a.createdAt);
|
||||||
});
|
});
|
||||||
setData(result);
|
setData(result);
|
||||||
|
setDefaultData(result);
|
||||||
})
|
})
|
||||||
|
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
console.error;
|
console.error;
|
||||||
});
|
});
|
||||||
|
@ -15,7 +15,7 @@ export const ApprovalStatus = observer((props) => {
|
|||||||
setVisible(true);
|
setVisible(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{filter['status'] && filter['status'] !== 'all'
|
{filter?.['status'] && filter?.['status'] !== 'all'
|
||||||
? t(columns.find((item) => item.value === filter['status']).label)
|
? t(columns.find((item) => item.value === filter['status']).label)
|
||||||
: '申请状态'}
|
: '申请状态'}
|
||||||
<DownOutline />
|
<DownOutline />
|
||||||
@ -30,7 +30,7 @@ export const ApprovalStatus = observer((props) => {
|
|||||||
onClose={() => {
|
onClose={() => {
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
}}
|
}}
|
||||||
value={[filter['status'] || 'all']}
|
value={[filter?.['status'] || 'all']}
|
||||||
onConfirm={(e) => {
|
onConfirm={(e) => {
|
||||||
const changeData = { ...filter };
|
const changeData = { ...filter };
|
||||||
if (e[0] === 'all') {
|
if (e[0] === 'all') {
|
||||||
|
@ -0,0 +1,69 @@
|
|||||||
|
import { BlockItem, ExtendCollectionsProvider, css, useAPIClient, useRequest } from '@tachybase/client';
|
||||||
|
import React, { useContext, useEffect, useState } from 'react';
|
||||||
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
import { AutoCenter, Card, Empty, SearchBar, Selector, Space } from 'antd-mobile';
|
||||||
|
import { TeamFill } from 'antd-mobile-icons';
|
||||||
|
import { observer } from '@tachybase/schema';
|
||||||
|
import '../../style/style.css';
|
||||||
|
import { InitiationsBlockContext } from '../InitiationsBlock';
|
||||||
|
|
||||||
|
export const InitiationsItem = observer((props) => {
|
||||||
|
const { params, tabKey } = props as any;
|
||||||
|
const [options, setOptions] = useState([]);
|
||||||
|
const api = useAPIClient();
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const contextFilter = useContext(InitiationsBlockContext);
|
||||||
|
const filter = contextFilter['key'] === 'initiations' ? contextFilter['inputFilter'] : '';
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
api
|
||||||
|
.request({
|
||||||
|
url: 'workflows:list',
|
||||||
|
params: { pageSize: 9999, filter: { ...params?.[tabKey] } },
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
const option = res?.data?.data.map((value) => {
|
||||||
|
return {
|
||||||
|
...value,
|
||||||
|
value: value.id,
|
||||||
|
label: (
|
||||||
|
<div
|
||||||
|
style={{ display: 'flex', flexDirection: 'column', alignContent: 'center' }}
|
||||||
|
onClick={(c) => {
|
||||||
|
navigate(`/mobile/${value.title?.replace('审批流:', '') || ''}/approval/${value.id}/page`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<TeamFill />
|
||||||
|
</div>
|
||||||
|
{value.title?.replace('审批流:', '') || ''}
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
if (filter && options.length) {
|
||||||
|
const filterData = option.filter((value) => (value.title as string)?.includes(filter));
|
||||||
|
setOptions(filterData);
|
||||||
|
} else {
|
||||||
|
setOptions(option);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
}, [params]);
|
||||||
|
return (
|
||||||
|
<BlockItem>
|
||||||
|
<Card className="initiationsItemCard">
|
||||||
|
{options.length ? (
|
||||||
|
<Selector
|
||||||
|
style={{ '--color': '#ffffff', '--gap': '1px' }}
|
||||||
|
columns={3}
|
||||||
|
showCheckMark={false}
|
||||||
|
options={options}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<Empty description="暂无数据" />
|
||||||
|
)}
|
||||||
|
</Card>
|
||||||
|
</BlockItem>
|
||||||
|
);
|
||||||
|
});
|
@ -0,0 +1,34 @@
|
|||||||
|
import { BlockItem } from '@tachybase/client';
|
||||||
|
import { Space } from 'antd-mobile';
|
||||||
|
import React, { useState } from 'react';
|
||||||
|
import { observer } from '@tachybase/schema';
|
||||||
|
import { ApprovalTemplateType } from '../../component/ApprovalTemplateType';
|
||||||
|
import { ApprovalStatus } from './ApprovalStatus';
|
||||||
|
import { ApprovalItem } from './ApprovalItem';
|
||||||
|
import { ApprovalReachDataType } from '../../component/ApprovalReachDataType';
|
||||||
|
import '../../style/style.css';
|
||||||
|
|
||||||
|
export const UserInitiationsItem = observer((props) => {
|
||||||
|
const [filter, setFilter] = useState([]);
|
||||||
|
const changeFilter = (data) => {
|
||||||
|
setFilter(data);
|
||||||
|
};
|
||||||
|
const filterProps = {
|
||||||
|
...props,
|
||||||
|
filter,
|
||||||
|
changeFilter,
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
<BlockItem>
|
||||||
|
<Space justify="evenly" className="userInitiationsStyle">
|
||||||
|
{/* 模版类型 */}
|
||||||
|
<ApprovalTemplateType {...filterProps} />
|
||||||
|
{/* 到达日期 */}
|
||||||
|
<ApprovalReachDataType {...filterProps} />
|
||||||
|
{/* 审批状态 */}
|
||||||
|
<ApprovalStatus {...filterProps} />
|
||||||
|
</Space>
|
||||||
|
<ApprovalItem {...filterProps} />
|
||||||
|
</BlockItem>
|
||||||
|
);
|
||||||
|
});
|
@ -77,20 +77,22 @@ export const ViewActionInitiationsContent = () => {
|
|||||||
{name}
|
{name}
|
||||||
</NavBar>
|
</NavBar>
|
||||||
<SchemaComponentContext.Provider value={{ ...context, designable: false }}>
|
<SchemaComponentContext.Provider value={{ ...context, designable: false }}>
|
||||||
<SchemaComponent
|
<div className="approvalContext">
|
||||||
schema={schema}
|
<SchemaComponent
|
||||||
components={{
|
schema={schema}
|
||||||
RemoteSchemaComponent: RemoteSchemaComponent,
|
components={{
|
||||||
CollectionProvider_deprecated: CollectionProvider_deprecated,
|
RemoteSchemaComponent: RemoteSchemaComponent,
|
||||||
ApplyActionStatusProvider: ContextInitiationsApprovalStatusProvider,
|
CollectionProvider_deprecated: CollectionProvider_deprecated,
|
||||||
ActionBarProvider,
|
ApplyActionStatusProvider: ContextInitiationsApprovalStatusProvider,
|
||||||
WithdrawActionProvider: WithdrawActionProvider,
|
ActionBarProvider,
|
||||||
}}
|
WithdrawActionProvider: WithdrawActionProvider,
|
||||||
scope={{
|
}}
|
||||||
useSubmit: useCreateSubmit,
|
scope={{
|
||||||
useWithdrawAction,
|
useSubmit: useCreateSubmit,
|
||||||
}}
|
useWithdrawAction,
|
||||||
/>
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</SchemaComponentContext.Provider>
|
</SchemaComponentContext.Provider>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
import { joinCollectionName, useAPIClient, useBlockRequestContext, useCollection_deprecated } from '@tachybase/client';
|
import { joinCollectionName, useAPIClient, useBlockRequestContext, useCollection_deprecated } from '@tachybase/client';
|
||||||
import { useField, useForm } from '@tachybase/schema';
|
import { useField, useForm } from '@tachybase/schema';
|
||||||
import { APPROVAL_ACTION_STATUS } from '../../constants';
|
import { APPROVAL_ACTION_STATUS } from '../../constants';
|
||||||
import { useParams } from 'react-router-dom';
|
import { useNavigate, useParams } from 'react-router-dom';
|
||||||
|
import { Toast } from 'antd-mobile';
|
||||||
|
|
||||||
export function useCreateSubmit() {
|
export function useCreateSubmit() {
|
||||||
const from = useForm();
|
const from = useForm();
|
||||||
const field = useField();
|
const field = useField();
|
||||||
const { __parent } = useBlockRequestContext();
|
|
||||||
const collection = useCollection_deprecated();
|
const collection = useCollection_deprecated();
|
||||||
const contextWe = APPROVAL_ACTION_STATUS.SUBMITTED;
|
const contextWe = APPROVAL_ACTION_STATUS.SUBMITTED;
|
||||||
const apiClient = useAPIClient();
|
const apiClient = useAPIClient();
|
||||||
const params = useParams();
|
const params = useParams();
|
||||||
const { id: workflowId } = params;
|
const { id: workflowId } = params;
|
||||||
|
const navigate = useNavigate();
|
||||||
return {
|
return {
|
||||||
async run() {
|
async run() {
|
||||||
try {
|
try {
|
||||||
@ -20,7 +20,7 @@ export function useCreateSubmit() {
|
|||||||
field.data = field.data || {};
|
field.data = field.data || {};
|
||||||
field.data.loading = true;
|
field.data.loading = true;
|
||||||
|
|
||||||
await apiClient.resource('approvals').create({
|
const res = await apiClient.resource('approvals').create({
|
||||||
values: {
|
values: {
|
||||||
collectionName: joinCollectionName(collection.dataSource, collection.name),
|
collectionName: joinCollectionName(collection.dataSource, collection.name),
|
||||||
data: from.values,
|
data: from.values,
|
||||||
@ -28,13 +28,17 @@ export function useCreateSubmit() {
|
|||||||
workflowId: workflowId,
|
workflowId: workflowId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
console.log('🚀 ~ res ~ res:', res);
|
||||||
from.reset();
|
if (res.status === 200) {
|
||||||
field.data.loading = false;
|
Toast.show({
|
||||||
const service = __parent.service;
|
icon: 'success',
|
||||||
if (service) {
|
content: '提交成功',
|
||||||
service.refresh();
|
});
|
||||||
|
from.reset();
|
||||||
|
navigate(`/mobile/approval/${res.data.data.id}/page`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
field.data.loading = false;
|
||||||
} catch (h) {
|
} catch (h) {
|
||||||
field.data && (field.data.loading = false);
|
field.data && (field.data.loading = false);
|
||||||
}
|
}
|
||||||
|
@ -1,20 +1,18 @@
|
|||||||
import { useAPIClient, useActionContext } from '@tachybase/client';
|
import { useAPIClient, useActionContext } from '@tachybase/client';
|
||||||
import { useFlowContext } from '@tachybase/plugin-workflow/client';
|
|
||||||
import { useField, useForm } from '@tachybase/schema';
|
import { useField, useForm } from '@tachybase/schema';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { useContextApprovalExecution } from '../../context/ApprovalExecution';
|
import { useContextApprovalExecution } from '../../context/ApprovalExecution';
|
||||||
import { useContextApprovalStatus } from '../provider/ApplyActionStatus';
|
import { useContextApprovalStatus } from '../provider/ApplyActionStatus';
|
||||||
|
import { Toast } from 'antd-mobile';
|
||||||
|
|
||||||
export function useUpdateSubmit() {
|
export function useUpdateSubmit() {
|
||||||
const from = useForm();
|
const from = useForm();
|
||||||
const field = useField();
|
const field = useField();
|
||||||
const { approval } = useContextApprovalExecution();
|
const { approval } = useContextApprovalExecution();
|
||||||
const { setVisible, setSubmitted } = useActionContext() as any;
|
const { setSubmitted } = useActionContext() as any;
|
||||||
const { id } = approval;
|
const { workflow, id } = approval;
|
||||||
const { workflow } = useFlowContext();
|
|
||||||
const contextApprovalStatus = useContextApprovalStatus();
|
const contextApprovalStatus = useContextApprovalStatus();
|
||||||
const apiClient = useAPIClient();
|
const apiClient = useAPIClient();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
async run() {
|
async run() {
|
||||||
try {
|
try {
|
||||||
@ -22,7 +20,7 @@ export function useUpdateSubmit() {
|
|||||||
|
|
||||||
_.set(field, ['data', 'loading'], true);
|
_.set(field, ['data', 'loading'], true);
|
||||||
|
|
||||||
apiClient.resource('approvals').update({
|
const res = await apiClient.resource('approvals').update({
|
||||||
filterByTk: id,
|
filterByTk: id,
|
||||||
values: {
|
values: {
|
||||||
collectionName: workflow.config.collection,
|
collectionName: workflow.config.collection,
|
||||||
@ -30,10 +28,21 @@ export function useUpdateSubmit() {
|
|||||||
status: contextApprovalStatus,
|
status: contextApprovalStatus,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
setSubmitted(true);
|
if (res.status === 200) {
|
||||||
setVisible(false);
|
Toast.show({
|
||||||
from.reset();
|
icon: 'success',
|
||||||
_.set(field, ['data', 'loading'], false);
|
content: '处理成功',
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
location.reload();
|
||||||
|
}, 1000);
|
||||||
|
setSubmitted(true);
|
||||||
|
} else {
|
||||||
|
Toast.show({
|
||||||
|
icon: 'fail',
|
||||||
|
content: '处理失败',
|
||||||
|
});
|
||||||
|
}
|
||||||
} catch (m) {
|
} catch (m) {
|
||||||
_.set(field, ['data', 'loading'], false);
|
_.set(field, ['data', 'loading'], false);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { useAPIClient, useActionContext } from '@tachybase/client';
|
import { useAPIClient, useActionContext } from '@tachybase/client';
|
||||||
import { useField } from '@tachybase/schema';
|
import { useField } from '@tachybase/schema';
|
||||||
import { useContextApprovalExecution } from '../../context/ApprovalExecution';
|
import { useContextApprovalExecution } from '../../context/ApprovalExecution';
|
||||||
|
import { Toast } from 'antd-mobile';
|
||||||
|
|
||||||
// 撤回
|
// 撤回
|
||||||
export function useWithdrawAction() {
|
export function useWithdrawAction() {
|
||||||
@ -14,12 +15,25 @@ export function useWithdrawAction() {
|
|||||||
field.data = field.data ?? {};
|
field.data = field.data ?? {};
|
||||||
field.data.loading = true;
|
field.data.loading = true;
|
||||||
|
|
||||||
await api.resource('approvals').withdraw({
|
const res = await api.resource('approvals').withdraw({
|
||||||
filterByTk: approval.id,
|
filterByTk: approval.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
setSubmitted(true);
|
if (res.status === 202) {
|
||||||
|
Toast.show({
|
||||||
|
icon: 'success',
|
||||||
|
content: '撤回成功',
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
location.reload();
|
||||||
|
}, 1000);
|
||||||
|
setSubmitted(true);
|
||||||
|
} else {
|
||||||
|
Toast.show({
|
||||||
|
icon: 'fail',
|
||||||
|
content: '撤回失败',
|
||||||
|
});
|
||||||
|
}
|
||||||
field.data.loading = false;
|
field.data.loading = false;
|
||||||
} catch (v) {
|
} catch (v) {
|
||||||
if (field.data) {
|
if (field.data) {
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
.navBarStyle{
|
.navBarStyle{
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
margin-bottom: 10px;
|
|
||||||
position: fixed;
|
position: fixed;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
height: 5vh;
|
height: 5vh;
|
||||||
@ -28,8 +27,35 @@
|
|||||||
|
|
||||||
.userInitiationsStyle{
|
.userInitiationsStyle{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-top: 10px;
|
|
||||||
padding: 10px 0 10px 0;
|
padding: 10px 0 10px 0;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
|
font-size: 10px;
|
||||||
|
color: #8e8e8e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.adm-tabs-tab-list{
|
||||||
|
background-color: #ffffff;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blockItem{
|
||||||
|
background-color: #f3f3f3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.adm-card-body {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.initiationsItemCard{
|
||||||
|
padding: 0px;
|
||||||
|
border-radius: 0px;
|
||||||
|
overflow: hidden;
|
||||||
|
background-color: #f3f3f3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.adm-tabs-content{
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,28 +15,18 @@ import { CollectionApprovals } from '../collection/Approvals.collection';
|
|||||||
import { CollectionApprovalTodos } from '../collection/ApprovalTodos';
|
import { CollectionApprovalTodos } from '../collection/ApprovalTodos';
|
||||||
|
|
||||||
export const TodosBlock = observer((props) => {
|
export const TodosBlock = observer((props) => {
|
||||||
const [tabValue, setTabValue] = useState('pending');
|
const [filter, setFilter] = useState({
|
||||||
const [filter, setFilter] = useState({});
|
status: PendingStatus,
|
||||||
|
});
|
||||||
|
const [changeInputValue, setChangeInputValue] = useState('');
|
||||||
|
const [input, setInput] = useState('');
|
||||||
const changeFilter = (data) => {
|
const changeFilter = (data) => {
|
||||||
setFilter(data);
|
setFilter(data);
|
||||||
};
|
};
|
||||||
useEffect(() => {
|
|
||||||
const changeTabs = { ...filter };
|
|
||||||
switch (tabValue) {
|
|
||||||
case 'pending':
|
|
||||||
changeTabs['status'] = PendingStatus;
|
|
||||||
break;
|
|
||||||
case 'processed':
|
|
||||||
changeTabs['status'] = ProcessedStatus;
|
|
||||||
break;
|
|
||||||
case 'duplicate':
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
setFilter(changeTabs);
|
|
||||||
}, [tabValue]);
|
|
||||||
const filterProps = {
|
const filterProps = {
|
||||||
...props,
|
...props,
|
||||||
filter,
|
filter,
|
||||||
|
input,
|
||||||
changeFilter,
|
changeFilter,
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
@ -48,11 +38,34 @@ export const TodosBlock = observer((props) => {
|
|||||||
placeholder="搜索人名,标题、内容"
|
placeholder="搜索人名,标题、内容"
|
||||||
clearable
|
clearable
|
||||||
style={{ '--background': '#ffffff', padding: '10px' }}
|
style={{ '--background': '#ffffff', padding: '10px' }}
|
||||||
|
onChange={(value) => {
|
||||||
|
if (!value) {
|
||||||
|
setInput(value);
|
||||||
|
}
|
||||||
|
setChangeInputValue(value);
|
||||||
|
}}
|
||||||
|
value={changeInputValue}
|
||||||
|
onSearch={(value) => {
|
||||||
|
setInput(value);
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<Tabs
|
<Tabs
|
||||||
onChange={(key) => {
|
onChange={(key) => {
|
||||||
setFilter({});
|
const tabFilter = { status: PendingStatus };
|
||||||
setTabValue(key);
|
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' }}
|
style={{ '--title-font-size': '12px', backgroundColor: '#ffffff', marginTop: '10px' }}
|
||||||
>
|
>
|
||||||
|
@ -1,27 +1,39 @@
|
|||||||
import { mergeFilter, useAPIClient, useCollectionManager, useRequest } from '@tachybase/client';
|
|
||||||
import { connect, observer, useFieldSchema } from '@tachybase/schema';
|
|
||||||
import { Badge, Empty, List, Space, Tag } from 'antd-mobile';
|
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
|
import { mergeFilter, useAPIClient, useCollectionManager, useCompile, useRequest } from '@tachybase/client';
|
||||||
|
import { connect, observer, useFieldSchema } from '@tachybase/schema';
|
||||||
|
|
||||||
import { useAsyncEffect } from 'ahooks';
|
import { useAsyncEffect } from 'ahooks';
|
||||||
import { APPROVAL_STATUS, ApprovalPriorityType, approvalStatusOptions } from '../../constants';
|
import { Badge, Empty, List, Space, Tag } from 'antd-mobile';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
|
import { APPROVAL_STATUS, ApprovalPriorityType, approvalStatusOptions } from '../../constants';
|
||||||
import { tval, useTranslation } from '../../locale';
|
import { tval, useTranslation } from '../../locale';
|
||||||
|
|
||||||
export const TabApprovalItem = observer((props) => {
|
export const TabApprovalItem = observer((props) => {
|
||||||
const { filter, params } = props as any;
|
const { filter, params, input } = props as any;
|
||||||
const api = useAPIClient();
|
const api = useAPIClient();
|
||||||
const [data, setData] = useState([]);
|
const [data, setData] = useState([]);
|
||||||
|
const [defData, setDefData] = useState([]);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const compile = useCompile();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
useEffect(() => {
|
||||||
|
if (input && defData.length) {
|
||||||
|
const filterData = defData.filter((value) => value.title.includes(input));
|
||||||
|
setData(filterData);
|
||||||
|
} else {
|
||||||
|
setData(defData);
|
||||||
|
}
|
||||||
|
}, [input]);
|
||||||
useAsyncEffect(async () => {
|
useAsyncEffect(async () => {
|
||||||
const { data: user } = await api.request({ url: 'users:list', params: { pageSize: 999, appends: ['roles'] } });
|
const { data: user } = await api.request({ url: 'users:list', params: { pageSize: 999, appends: ['roles'] } });
|
||||||
api
|
api
|
||||||
.request({
|
.request({
|
||||||
url: 'approvalRecords:listCentralized',
|
url: 'approvalRecords:listCentralized',
|
||||||
params: {
|
params: {
|
||||||
pageSize: 99999,
|
pageSize: 9999,
|
||||||
appends: ['execution', 'job', 'node', 'workflow'],
|
appends: ['execution', 'job', 'node', 'workflow'],
|
||||||
filter: { ...params?.filter, ...filter },
|
filter: { ...params, ...filter },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
@ -32,14 +44,19 @@ export const TabApprovalItem = observer((props) => {
|
|||||||
);
|
);
|
||||||
const statusType = approvalTodoListStatus(item, t);
|
const statusType = approvalTodoListStatus(item, t);
|
||||||
const categoryTitle = item.workflow.title.replace('审批流:', '');
|
const categoryTitle = item.workflow.title.replace('审批流:', '');
|
||||||
|
const summary = Object.entries(item.summary).map(([key, value]) => {
|
||||||
|
return {
|
||||||
|
label: compile(key),
|
||||||
|
value: value?.['name'] || value || '',
|
||||||
|
};
|
||||||
|
});
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
title: `${itemUser.nickname}的${categoryTitle}`,
|
title: `${itemUser.nickname}的${categoryTitle}`,
|
||||||
categoryTitle: categoryTitle,
|
categoryTitle: categoryTitle,
|
||||||
statusTitle: t(statusType.label),
|
statusTitle: t(statusType.label),
|
||||||
statusColor: statusType.color,
|
statusColor: statusType.color,
|
||||||
reason: item.snapshot.reason || item.snapshot.reason_pay,
|
reason: summary,
|
||||||
priorityTitle: priorityType.label,
|
priorityTitle: priorityType.label,
|
||||||
priorityColor: priorityType.color,
|
priorityColor: priorityType.color,
|
||||||
};
|
};
|
||||||
@ -48,6 +65,7 @@ export const TabApprovalItem = observer((props) => {
|
|||||||
return Date.parse(b.createdAt) - Date.parse(a.createdAt);
|
return Date.parse(b.createdAt) - Date.parse(a.createdAt);
|
||||||
});
|
});
|
||||||
setData(result);
|
setData(result);
|
||||||
|
setDefData(result);
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
console.error;
|
console.error;
|
||||||
@ -66,18 +84,20 @@ export const TabApprovalItem = observer((props) => {
|
|||||||
navigate(`/mobile/approval/${item.id}/${item.categoryTitle}/detailspage`);
|
navigate(`/mobile/approval/${item.id}/${item.categoryTitle}/detailspage`);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Badge color="#6ac3ff" content={Badge.dot} style={{ '--right': '100%' }}>
|
{/* <Badge color="#6ac3ff" content={Badge.dot} style={{ '--right': '100%' }}> */}
|
||||||
<Space block>
|
<Space block>
|
||||||
{item.title}
|
{item.title}
|
||||||
<Tag color={item.statusColor} fill="outline">
|
<Tag color={item.statusColor} fill="outline">
|
||||||
{item.statusTitle}
|
{item.statusTitle}
|
||||||
</Tag>
|
</Tag>
|
||||||
<Tag color={item.priorityColor} fill="outline">
|
<Tag color={item.priorityColor} fill="outline">
|
||||||
{item.priorityTitle}
|
{item.priorityTitle}
|
||||||
</Tag>
|
</Tag>
|
||||||
</Space>
|
</Space>
|
||||||
</Badge>
|
{/* </Badge> */}
|
||||||
<Space block> 事由:{item.reason}</Space>
|
{item.reason.map((reasonItem, index) => {
|
||||||
|
return <Space block key={index}>{`${reasonItem.label}:${reasonItem.value}`}</Space>;
|
||||||
|
})}
|
||||||
</List.Item>
|
</List.Item>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
@ -2,6 +2,7 @@ import { useAPIClient, useActionContext } from '@tachybase/client';
|
|||||||
import { useField, useForm } from '@tachybase/schema';
|
import { useField, useForm } from '@tachybase/schema';
|
||||||
import { useContextApprovalExecution } from '../../context/ApprovalExecution';
|
import { useContextApprovalExecution } from '../../context/ApprovalExecution';
|
||||||
import { useContextApprovalAction } from '../provider/ApprovalAction';
|
import { useContextApprovalAction } from '../provider/ApprovalAction';
|
||||||
|
import { Toast } from 'antd-mobile';
|
||||||
|
|
||||||
export function useSubmit() {
|
export function useSubmit() {
|
||||||
const field = useField();
|
const field = useField();
|
||||||
@ -20,14 +21,26 @@ export function useSubmit() {
|
|||||||
field.data = field.data ?? {};
|
field.data = field.data ?? {};
|
||||||
field.data.loading = true;
|
field.data.loading = true;
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
await api.resource('approvalRecords').submit({
|
const res = await api.resource('approvalRecords').submit({
|
||||||
filterByTk: id,
|
filterByTk: id,
|
||||||
values: { ...form.values, status },
|
values: { ...form.values, status },
|
||||||
});
|
});
|
||||||
field.data.loading = false;
|
field.data.loading = false;
|
||||||
await form.reset();
|
if (res.status === 202) {
|
||||||
// refreshAction?.();
|
Toast.show({
|
||||||
setSubmitted?.(true);
|
icon: 'success',
|
||||||
|
content: '处理成功',
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
location.reload();
|
||||||
|
}, 1000);
|
||||||
|
setSubmitted(true);
|
||||||
|
} else {
|
||||||
|
Toast.show({
|
||||||
|
icon: 'fail',
|
||||||
|
content: '处理失败',
|
||||||
|
});
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
field.data && (field.data.loading = false);
|
field.data && (field.data.loading = false);
|
||||||
|
@ -62,5 +62,7 @@
|
|||||||
"If checked, the workflow will be terminated after rejection branch processed.": "If checked, the workflow will be terminated after rejection branch processed.",
|
"If checked, the workflow will be terminated after rejection branch processed.": "If checked, the workflow will be terminated after rejection branch processed.",
|
||||||
"Disabled": "Disabled",
|
"Disabled": "Disabled",
|
||||||
"Trigger data": "Trigger data",
|
"Trigger data": "Trigger data",
|
||||||
"All":"All"
|
"All":"All",
|
||||||
|
"Initiations":"Initiations",
|
||||||
|
"UserInitiations":"UserInitiations"
|
||||||
}
|
}
|
||||||
|
@ -77,5 +77,7 @@
|
|||||||
"Disabled": "已失效",
|
"Disabled": "已失效",
|
||||||
"Submission may be withdrawn, please try refresh the list.": "提交可能已被撤回,请尝试刷新列表。",
|
"Submission may be withdrawn, please try refresh the list.": "提交可能已被撤回,请尝试刷新列表。",
|
||||||
"Trigger data": "触发器数据",
|
"Trigger data": "触发器数据",
|
||||||
"All":"全部"
|
"All":"全部",
|
||||||
|
"Initiations":"发起申请",
|
||||||
|
"UserInitiations":"我的发起"
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
import { SchemaInitializerItemType, useCollectionManager_deprecated, useCompile } from '@tachybase/client';
|
import { SchemaInitializerItemType, useCollectionManager_deprecated, useCompile } from '@tachybase/client';
|
||||||
import {
|
import {
|
||||||
CollectionBlockInitializer,
|
CollectionBlockInitializer,
|
||||||
|
getCollectionFieldOptions,
|
||||||
RadioWithTooltip,
|
RadioWithTooltip,
|
||||||
Trigger,
|
Trigger,
|
||||||
UseVariableOptions,
|
UseVariableOptions,
|
||||||
getCollectionFieldOptions,
|
|
||||||
useWorkflowAnyExecuted,
|
useWorkflowAnyExecuted,
|
||||||
} from '@tachybase/plugin-workflow/client';
|
} from '@tachybase/plugin-workflow/client';
|
||||||
import { useForm } from '@tachybase/schema';
|
import { useForm } from '@tachybase/schema';
|
||||||
import { ConfigButtonView } from './ConfigButton.view';
|
|
||||||
import { NAMESPACE, tval, usePluginTranslation } from '../../locale';
|
import { NAMESPACE, tval, usePluginTranslation } from '../../locale';
|
||||||
|
import { ConfigButtonView } from './ConfigButton.view';
|
||||||
import { LauncherInterface } from './launcher-interface/LauncherInterface.schema';
|
import { LauncherInterface } from './launcher-interface/LauncherInterface.schema';
|
||||||
|
|
||||||
// 工作流节点-审批触发器节点
|
// 工作流节点-审批触发器节点
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { NAMESPACE, tval } from '../../../locale';
|
|
||||||
import { css } from '@tachybase/client';
|
import { css } from '@tachybase/client';
|
||||||
|
|
||||||
|
import { NAMESPACE, tval } from '../../../locale';
|
||||||
|
|
||||||
export const SchemaApprovalBlockLaunch = {
|
export const SchemaApprovalBlockLaunch = {
|
||||||
type: 'void',
|
type: 'void',
|
||||||
name: 'launch',
|
name: 'launch',
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { Plugin } from '@tachybase/client';
|
import { Plugin } from '@tachybase/client';
|
||||||
|
|
||||||
import { tval } from '../../locale';
|
import { tval } from '../../locale';
|
||||||
import { KitApprovalCommon } from '../approval-common/plugin';
|
import { KitApprovalCommon } from '../approval-common/plugin';
|
||||||
import { ApprovalBlockComponent, SCApprovalBlock } from './ApprovalBlock.schema';
|
import { ApprovalBlockComponent, SCApprovalBlock } from './ApprovalBlock.schema';
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { css } from '@tachybase/client';
|
import { css } from '@tachybase/client';
|
||||||
|
|
||||||
import { NAMESPACE, tval } from '../../../locale';
|
import { NAMESPACE, tval } from '../../../locale';
|
||||||
|
|
||||||
export const SchemaApprovalBlockTodos = {
|
export const SchemaApprovalBlockTodos = {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { NAMESPACE, tval } from '../../locale';
|
|
||||||
import { ApprovalStatusEnums } from '../../constants';
|
import { ApprovalStatusEnums } from '../../constants';
|
||||||
|
import { NAMESPACE, tval } from '../../locale';
|
||||||
|
|
||||||
export const CollectionApprovals = {
|
export const CollectionApprovals = {
|
||||||
title: `{{t("Approval applications", { ns: "${NAMESPACE}" })}}`,
|
title: `{{t("Approval applications", { ns: "${NAMESPACE}" })}}`,
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { useCollectionManager, useCollectionRecordData, useCompile } from '@tachybase/client';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { useCollectionManager, useCollectionRecordData, useCompile } from '@tachybase/client';
|
||||||
|
|
||||||
import useStyles from './style';
|
import useStyles from './style';
|
||||||
|
|
||||||
export const ApprovalsSummary = (props) => {
|
export const ApprovalsSummary = (props) => {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { Plugin } from '@tachybase/client';
|
import { Plugin } from '@tachybase/client';
|
||||||
|
|
||||||
import { ApprovalDataProvider } from './ApprovalData.provider';
|
import { ApprovalDataProvider } from './ApprovalData.provider';
|
||||||
import { ApprovalProcess } from './ApprovalProcess.view';
|
import { ApprovalProcess } from './ApprovalProcess.view';
|
||||||
import { ApprovalsSummary } from './ApprovalsSummary.view';
|
import { ApprovalsSummary } from './ApprovalsSummary.view';
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { Plugin } from '@tachybase/client';
|
import { Plugin } from '@tachybase/client';
|
||||||
|
|
||||||
import { tval } from '../../locale';
|
import { tval } from '../../locale';
|
||||||
import { KitApprovalCommon } from '../approval-common/plugin';
|
import { KitApprovalCommon } from '../approval-common/plugin';
|
||||||
import { RecordApprovalsDecorator } from './RecordApprovals.decorator';
|
import { RecordApprovalsDecorator } from './RecordApprovals.decorator';
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { Plugin } from '@tachybase/client';
|
import { Plugin } from '@tachybase/client';
|
||||||
import { KitApprovalRecordBlock } from './approval-record-block/plugin';
|
|
||||||
import { KitApprovalBlock } from './approval-block/plugin';
|
import { KitApprovalBlock } from './approval-block/plugin';
|
||||||
|
import { KitApprovalRecordBlock } from './approval-record-block/plugin';
|
||||||
|
|
||||||
export class KitApprovalUsage extends Plugin {
|
export class KitApprovalUsage extends Plugin {
|
||||||
async afterAdd() {
|
async afterAdd() {
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
import { uid } from '@tachybase/utils';
|
|
||||||
import { Instruction, JOB_STATUS } from '@tachybase/plugin-workflow';
|
import { Instruction, JOB_STATUS } from '@tachybase/plugin-workflow';
|
||||||
import { APPROVAL_STATUS, APPROVAL_ACTION_STATUS } from './constants';
|
import { uid } from '@tachybase/utils';
|
||||||
import { UiSchemaRepository } from '@nocobase/plugin-ui-schema-storage';
|
import { UiSchemaRepository } from '@nocobase/plugin-ui-schema-storage';
|
||||||
|
|
||||||
|
import { APPROVAL_ACTION_STATUS, APPROVAL_STATUS } from './constants';
|
||||||
|
|
||||||
const NEGOTIATION_MODE = {
|
const NEGOTIATION_MODE = {
|
||||||
SINGLE: Symbol('single'),
|
SINGLE: Symbol('single'),
|
||||||
ALL: Symbol('all'),
|
ALL: Symbol('all'),
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
import { get } from 'lodash';
|
|
||||||
import { Op, BelongsTo, HasOne } from 'sequelize';
|
|
||||||
import { modelAssociationByKey } from '@tachybase/database';
|
|
||||||
import { parseCollectionName } from '@tachybase/data-source-manager';
|
import { parseCollectionName } from '@tachybase/data-source-manager';
|
||||||
import { EXECUTION_STATUS, Trigger, toJSON, JOB_STATUS } from '@tachybase/plugin-workflow';
|
import { modelAssociationByKey } from '@tachybase/database';
|
||||||
import { APPROVAL_ACTION_STATUS, APPROVAL_STATUS } from './constants';
|
import { EXECUTION_STATUS, JOB_STATUS, toJSON, Trigger } from '@tachybase/plugin-workflow';
|
||||||
import { UiSchemaRepository } from '@nocobase/plugin-ui-schema-storage';
|
import { UiSchemaRepository } from '@nocobase/plugin-ui-schema-storage';
|
||||||
|
|
||||||
|
import { get } from 'lodash';
|
||||||
|
import { BelongsTo, HasOne, Op } from 'sequelize';
|
||||||
|
|
||||||
|
import { APPROVAL_ACTION_STATUS, APPROVAL_STATUS } from './constants';
|
||||||
import { getSummary } from './tools';
|
import { getSummary } from './tools';
|
||||||
|
|
||||||
const ExecutionStatusMap = {
|
const ExecutionStatusMap = {
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import actions, { utils } from '@tachybase/actions';
|
import actions, { utils } from '@tachybase/actions';
|
||||||
import WorkflowPlugin, { EXECUTION_STATUS, JOB_STATUS, toJSON } from '@tachybase/plugin-workflow';
|
|
||||||
import { APPROVAL_STATUS, APPROVAL_ACTION_STATUS } from './constants';
|
|
||||||
import { parseCollectionName } from '@tachybase/data-source-manager';
|
import { parseCollectionName } from '@tachybase/data-source-manager';
|
||||||
|
import WorkflowPlugin, { EXECUTION_STATUS, JOB_STATUS, toJSON } from '@tachybase/plugin-workflow';
|
||||||
|
|
||||||
|
import { APPROVAL_ACTION_STATUS, APPROVAL_STATUS } from './constants';
|
||||||
import { getSummary } from './tools';
|
import { getSummary } from './tools';
|
||||||
|
|
||||||
const workflows = {
|
const workflows = {
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
|
import React, { useEffect, useState } from 'react';
|
||||||
import {
|
import {
|
||||||
CollectionFieldProvider,
|
CollectionFieldProvider,
|
||||||
css,
|
css,
|
||||||
useCollectionField_deprecated,
|
|
||||||
useCollection_deprecated,
|
useCollection_deprecated,
|
||||||
|
useCollectionField_deprecated,
|
||||||
useCompile,
|
useCompile,
|
||||||
useComponent,
|
useComponent,
|
||||||
useFormBlockContext,
|
useFormBlockContext,
|
||||||
} from '@tachybase/client';
|
} from '@tachybase/client';
|
||||||
import { Field, connect, merge, useField, useFieldSchema } from '@tachybase/schema';
|
import { connect, Field, merge, useField, useFieldSchema } from '@tachybase/schema';
|
||||||
|
|
||||||
import { Checkbox, Select, Space } from 'antd';
|
import { Checkbox, Select, Space } from 'antd';
|
||||||
import React, { useEffect, useState } from 'react';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
export const DeletedField = () => {
|
export const DeletedField = () => {
|
||||||
|
@ -1,25 +1,26 @@
|
|||||||
|
import React, { useState } from 'react';
|
||||||
import {
|
import {
|
||||||
ActionContextProvider,
|
ActionContextProvider,
|
||||||
CollectionProvider_deprecated,
|
CollectionProvider_deprecated,
|
||||||
FormBlockContext,
|
|
||||||
RecordProvider,
|
|
||||||
css,
|
css,
|
||||||
cx,
|
cx,
|
||||||
fetchTemplateData,
|
fetchTemplateData,
|
||||||
useAPIClient,
|
FormBlockContext,
|
||||||
|
RecordProvider,
|
||||||
useActionContext,
|
useActionContext,
|
||||||
|
useAPIClient,
|
||||||
useBlockRequestContext,
|
useBlockRequestContext,
|
||||||
useCollection,
|
useCollection,
|
||||||
|
useCollection_deprecated,
|
||||||
useCollectionManager_deprecated,
|
useCollectionManager_deprecated,
|
||||||
useCollectionParentRecordData,
|
useCollectionParentRecordData,
|
||||||
useCollection_deprecated,
|
|
||||||
useDesignable,
|
useDesignable,
|
||||||
useFormBlockContext,
|
useFormBlockContext,
|
||||||
useRecord,
|
useRecord,
|
||||||
} from '@tachybase/client';
|
} from '@tachybase/client';
|
||||||
import { RecursionField, observer, useField, useFieldSchema } from '@tachybase/schema';
|
import { observer, RecursionField, useField, useFieldSchema } from '@tachybase/schema';
|
||||||
|
|
||||||
import { App, Button } from 'antd';
|
import { App, Button } from 'antd';
|
||||||
import React, { useState } from 'react';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
export const actionDesignerCss = css`
|
export const actionDesignerCss = css`
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
import { PoweredByV2 as PoweredBy, css, useAPIClient, useRequest, useSystemSettings } from '@tachybase/client';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { css, PoweredByV2 as PoweredBy, useAPIClient, useRequest, useSystemSettings } from '@tachybase/client';
|
||||||
|
|
||||||
import { Outlet } from 'react-router-dom';
|
import { Outlet } from 'react-router-dom';
|
||||||
|
|
||||||
import { AuthenticatorsContext } from '../authenticator';
|
import { AuthenticatorsContext } from '../authenticator';
|
||||||
|
|
||||||
export function AuthLayout(props: any) {
|
export function AuthLayout(props: any) {
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
import { css, useCurrentDocumentTitle, usePlugin, useViewport } from '@tachybase/client';
|
|
||||||
import { Space, Tabs } from 'antd';
|
|
||||||
import React, { createElement, useContext } from 'react';
|
import React, { createElement, useContext } from 'react';
|
||||||
|
import { css, useCurrentDocumentTitle, usePlugin, useViewport } from '@tachybase/client';
|
||||||
|
|
||||||
|
import { Space, Tabs } from 'antd';
|
||||||
|
|
||||||
import AuthPlugin, { AuthOptions } from '..';
|
import AuthPlugin, { AuthOptions } from '..';
|
||||||
import { Authenticator, AuthenticatorsContext } from '../authenticator';
|
import { Authenticator, AuthenticatorsContext } from '../authenticator';
|
||||||
import { useAuthTranslation } from '../locale';
|
import { useAuthTranslation } from '../locale';
|
||||||
|
@ -1,12 +1,8 @@
|
|||||||
import { css } from '@tachybase/client';
|
|
||||||
import { createForm, Field } from '@tachybase/schema';
|
|
||||||
import { FieldContext, FormContext, useField } from '@tachybase/schema';
|
|
||||||
import { Space, Switch, Table, TableColumnProps, Tag, Tooltip } from 'antd';
|
|
||||||
import React, { useContext, useMemo } from 'react';
|
import React, { useContext, useMemo } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
|
||||||
import {
|
import {
|
||||||
Action,
|
Action,
|
||||||
AddCollectionField,
|
AddCollectionField,
|
||||||
|
css,
|
||||||
EditCollectionField,
|
EditCollectionField,
|
||||||
Input,
|
Input,
|
||||||
isDeleteButtonDisabled,
|
isDeleteButtonDisabled,
|
||||||
@ -28,6 +24,10 @@ import {
|
|||||||
useResourceContext,
|
useResourceContext,
|
||||||
ViewCollectionField,
|
ViewCollectionField,
|
||||||
} from '@tachybase/client';
|
} from '@tachybase/client';
|
||||||
|
import { createForm, Field, FieldContext, FormContext, useField } from '@tachybase/schema';
|
||||||
|
|
||||||
|
import { Space, Switch, Table, TableColumnProps, Tag, Tooltip } from 'antd';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { collection } from './schemas/collectionFields';
|
import { collection } from './schemas/collectionFields';
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { css } from '@tachybase/client';
|
import React, { useState } from 'react';
|
||||||
import { ArrayField, Field } from '@tachybase/schema';
|
|
||||||
import { RecursionField, Schema, observer, useField, useFieldSchema } from '@tachybase/schema';
|
|
||||||
import {
|
import {
|
||||||
|
css,
|
||||||
RecordIndexProvider,
|
RecordIndexProvider,
|
||||||
RecordProvider,
|
RecordProvider,
|
||||||
SchemaComponent,
|
SchemaComponent,
|
||||||
@ -11,11 +10,13 @@ import {
|
|||||||
useRequest,
|
useRequest,
|
||||||
useSchemaInitializerRender,
|
useSchemaInitializerRender,
|
||||||
} from '@tachybase/client';
|
} from '@tachybase/client';
|
||||||
|
import { ArrayField, Field, observer, RecursionField, Schema, useField, useFieldSchema } from '@tachybase/schema';
|
||||||
|
|
||||||
import { Table, TableColumnProps } from 'antd';
|
import { Table, TableColumnProps } from 'antd';
|
||||||
import { default as classNames } from 'classnames';
|
import { default as classNames } from 'classnames';
|
||||||
import { findIndex } from 'lodash';
|
import { findIndex } from 'lodash';
|
||||||
import React, { useState } from 'react';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { overridingSchema } from '../Configuration/schemas/collectionFields';
|
import { overridingSchema } from '../Configuration/schemas/collectionFields';
|
||||||
|
|
||||||
const isColumnComponent = (schema: Schema) => {
|
const isColumnComponent = (schema: Schema) => {
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import { useRecord } from '@tachybase/client';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { css, useRecord } from '@tachybase/client';
|
||||||
|
|
||||||
import { Button } from 'antd';
|
import { Button } from 'antd';
|
||||||
import { css } from '@tachybase/client';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
import { getConnectionCollectionPath } from '../constant';
|
import { getConnectionCollectionPath } from '../constant';
|
||||||
|
|
||||||
export const ViewDatabaseConnectionAction = () => {
|
export const ViewDatabaseConnectionAction = () => {
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
|
import React, { createContext, PropsWithChildren, useState } from 'react';
|
||||||
|
import { css, useDesignable } from '@tachybase/client';
|
||||||
import { ISchema } from '@tachybase/schema';
|
import { ISchema } from '@tachybase/schema';
|
||||||
import React, { PropsWithChildren, createContext, useState } from 'react';
|
|
||||||
|
import { theme } from 'antd';
|
||||||
|
|
||||||
import { ChartRendererProvider } from '../renderer';
|
import { ChartRendererProvider } from '../renderer';
|
||||||
import { ChartConfigure } from './ChartConfigure';
|
import { ChartConfigure } from './ChartConfigure';
|
||||||
import { useDesignable } from '@tachybase/client';
|
|
||||||
import { css } from '@tachybase/client';
|
|
||||||
import { theme } from 'antd';
|
|
||||||
|
|
||||||
export type ChartConfigCurrent = {
|
export type ChartConfigCurrent = {
|
||||||
schema: ISchema;
|
schema: ISchema;
|
||||||
|
@ -1,18 +1,20 @@
|
|||||||
import React, { useContext } from 'react';
|
import React, { useContext } from 'react';
|
||||||
import { FilterOutlined } from '@ant-design/icons';
|
|
||||||
import {
|
import {
|
||||||
|
css,
|
||||||
Grid,
|
Grid,
|
||||||
gridRowColWrap,
|
gridRowColWrap,
|
||||||
useDesignable,
|
|
||||||
useCurrentSchema,
|
|
||||||
SchemaInitializerSwitch,
|
SchemaInitializerSwitch,
|
||||||
|
useCurrentSchema,
|
||||||
|
useDesignable,
|
||||||
useSchemaInitializerItem,
|
useSchemaInitializerItem,
|
||||||
} from '@tachybase/client';
|
} from '@tachybase/client';
|
||||||
import { uid, merge } from '@tachybase/schema';
|
import { merge, uid } from '@tachybase/schema';
|
||||||
import { ChartFilterContext } from './FilterProvider';
|
|
||||||
import { css } from '@tachybase/client';
|
import { FilterOutlined } from '@ant-design/icons';
|
||||||
import { theme } from 'antd';
|
import { theme } from 'antd';
|
||||||
|
|
||||||
|
import { ChartFilterContext } from './FilterProvider';
|
||||||
|
|
||||||
const createFilterSchema = () => {
|
const createFilterSchema = () => {
|
||||||
return {
|
return {
|
||||||
type: 'void',
|
type: 'void',
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
import React, { useContext, useEffect } from 'react';
|
import React, { useContext, useEffect } from 'react';
|
||||||
import { SchemaComponentOptions } from '@tachybase/client';
|
import { css, SchemaComponentOptions } from '@tachybase/client';
|
||||||
import { ChartFilterItemDesigner } from './FilterItemDesigner';
|
import { ArrayItems } from '@tachybase/components';
|
||||||
|
|
||||||
|
import { useChartsTranslation } from '../locale';
|
||||||
|
import { CollectionFieldInitializer } from './CollectionFieldInitializer';
|
||||||
import {
|
import {
|
||||||
useChartFilterActionProps,
|
|
||||||
useChartFilterResetProps,
|
|
||||||
useChartFilterCollapseProps,
|
|
||||||
ChartFilterCollapseDesigner,
|
|
||||||
ChartFilterActionDesigner,
|
ChartFilterActionDesigner,
|
||||||
|
ChartFilterCollapseDesigner,
|
||||||
|
useChartFilterActionProps,
|
||||||
|
useChartFilterCollapseProps,
|
||||||
|
useChartFilterResetProps,
|
||||||
} from './FilterActionInitializers';
|
} from './FilterActionInitializers';
|
||||||
import { ChartFilterGrid } from './FilterBlockInitializer';
|
import { ChartFilterGrid } from './FilterBlockInitializer';
|
||||||
import { useChartsTranslation } from '../locale';
|
|
||||||
import { css } from '@tachybase/client';
|
|
||||||
import { ChartFilterContext } from './FilterProvider';
|
|
||||||
import { ChartFilterCheckbox } from './FilterCheckbox';
|
import { ChartFilterCheckbox } from './FilterCheckbox';
|
||||||
import { ArrayItems } from '@tachybase/components';
|
|
||||||
import { ChartFilterFormItem } from './FilterItemInitializers';
|
|
||||||
import { ChartFilterForm } from './FilterForm';
|
import { ChartFilterForm } from './FilterForm';
|
||||||
import { CollectionFieldInitializer } from './CollectionFieldInitializer';
|
import { ChartFilterItemDesigner } from './FilterItemDesigner';
|
||||||
|
import { ChartFilterFormItem } from './FilterItemInitializers';
|
||||||
|
import { ChartFilterContext } from './FilterProvider';
|
||||||
|
|
||||||
export const ChartFilterBlockProvider: React.FC = (props) => {
|
export const ChartFilterBlockProvider: React.FC = (props) => {
|
||||||
const { t } = useChartsTranslation();
|
const { t } = useChartsTranslation();
|
||||||
|
@ -1,36 +1,48 @@
|
|||||||
import { css, cx } from '@tachybase/client';
|
import React, { memo, useCallback, useContext, useMemo } from 'react';
|
||||||
import { FormItem, FormLayout } from '@tachybase/components';
|
|
||||||
import { Field, onFieldValueChange } from '@tachybase/schema';
|
|
||||||
import { Schema, SchemaOptionsContext, observer, useField, useFieldSchema, useForm } from '@tachybase/schema';
|
|
||||||
import { uid } from '@tachybase/schema';
|
|
||||||
import {
|
import {
|
||||||
ACLCollectionFieldProvider,
|
ACLCollectionFieldProvider,
|
||||||
BlockItem,
|
BlockItem,
|
||||||
CollectionFieldProvider,
|
CollectionFieldProvider,
|
||||||
CollectionManagerProvider,
|
CollectionManagerProvider,
|
||||||
CollectionProvider,
|
CollectionProvider,
|
||||||
DEFAULT_DATA_SOURCE_KEY,
|
|
||||||
CompatibleSchemaInitializer,
|
CompatibleSchemaInitializer,
|
||||||
|
css,
|
||||||
|
cx,
|
||||||
|
DEFAULT_DATA_SOURCE_KEY,
|
||||||
FormDialog,
|
FormDialog,
|
||||||
|
gridRowColWrap,
|
||||||
HTMLEncode,
|
HTMLEncode,
|
||||||
SchemaComponent,
|
SchemaComponent,
|
||||||
SchemaComponentOptions,
|
SchemaComponentOptions,
|
||||||
SchemaInitializerItem,
|
SchemaInitializerItem,
|
||||||
gridRowColWrap,
|
|
||||||
useCollectionManager_deprecated,
|
useCollectionManager_deprecated,
|
||||||
|
useCompile,
|
||||||
useDataSourceManager,
|
useDataSourceManager,
|
||||||
useDesignable,
|
useDesignable,
|
||||||
useGlobalTheme,
|
useGlobalTheme,
|
||||||
useSchemaInitializerItem,
|
useSchemaInitializerItem,
|
||||||
useCompile,
|
|
||||||
} from '@tachybase/client';
|
} from '@tachybase/client';
|
||||||
|
import { FormItem, FormLayout } from '@tachybase/components';
|
||||||
|
import {
|
||||||
|
Field,
|
||||||
|
observer,
|
||||||
|
onFieldValueChange,
|
||||||
|
Schema,
|
||||||
|
SchemaOptionsContext,
|
||||||
|
uid,
|
||||||
|
useField,
|
||||||
|
useFieldSchema,
|
||||||
|
useForm,
|
||||||
|
} from '@tachybase/schema';
|
||||||
|
|
||||||
import { useMemoizedFn } from 'ahooks';
|
import { useMemoizedFn } from 'ahooks';
|
||||||
import { Alert, ConfigProvider, Typography } from 'antd';
|
import { Alert, ConfigProvider, Typography } from 'antd';
|
||||||
import React, { memo, useCallback, useContext, useMemo } from 'react';
|
|
||||||
import { ErrorBoundary } from 'react-error-boundary';
|
import { ErrorBoundary } from 'react-error-boundary';
|
||||||
|
|
||||||
import { useChartData, useChartFilter, useChartFilterSourceFields, useFieldComponents } from '../hooks/filter';
|
import { useChartData, useChartFilter, useChartFilterSourceFields, useFieldComponents } from '../hooks/filter';
|
||||||
import { lang, useChartsTranslation } from '../locale';
|
import { lang, useChartsTranslation } from '../locale';
|
||||||
import { getPropsSchemaByComponent } from './utils';
|
import { getPropsSchemaByComponent } from './utils';
|
||||||
|
|
||||||
const { Paragraph, Text } = Typography;
|
const { Paragraph, Text } = Typography;
|
||||||
|
|
||||||
const FieldComponentProps: React.FC = observer(
|
const FieldComponentProps: React.FC = observer(
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { cx } from '@tachybase/client';
|
|
||||||
import React, { ReactChild } from 'react';
|
import React, { ReactChild } from 'react';
|
||||||
|
import { cx } from '@tachybase/client';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getCachedDateTimeFormat,
|
getCachedDateTimeFormat,
|
||||||
getDaysInMonth,
|
getDaysInMonth,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { TinyColor } from '@ctrl/tinycolor';
|
|
||||||
import { createStyles } from '@tachybase/client';
|
import { createStyles } from '@tachybase/client';
|
||||||
|
|
||||||
|
import { TinyColor } from '@ctrl/tinycolor';
|
||||||
|
|
||||||
const useStyles = createStyles(({ token, css }) => {
|
const useStyles = createStyles(({ token, css }) => {
|
||||||
const colorFillAlterSolid = new TinyColor(token.colorFillAlter)
|
const colorFillAlterSolid = new TinyColor(token.colorFillAlter)
|
||||||
.onBackground(token.colorBgContainer)
|
.onBackground(token.colorBgContainer)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { cx } from '@tachybase/client';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { cx } from '@tachybase/client';
|
||||||
|
|
||||||
type TopPartOfCalendarProps = {
|
type TopPartOfCalendarProps = {
|
||||||
value: string;
|
value: string;
|
||||||
|
@ -1,21 +1,24 @@
|
|||||||
import { css, cx } from '@tachybase/client';
|
import React, { SyntheticEvent, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
import { RecursionField, Schema, useFieldSchema } from '@tachybase/schema';
|
|
||||||
import {
|
import {
|
||||||
ActionContextProvider,
|
ActionContextProvider,
|
||||||
|
css,
|
||||||
|
cx,
|
||||||
RecordProvider,
|
RecordProvider,
|
||||||
useAPIClient,
|
useAPIClient,
|
||||||
useBlockRequestContext,
|
useBlockRequestContext,
|
||||||
useCurrentAppInfo,
|
|
||||||
useCollectionParentRecordData,
|
useCollectionParentRecordData,
|
||||||
|
useCurrentAppInfo,
|
||||||
|
useProps,
|
||||||
useTableBlockContext,
|
useTableBlockContext,
|
||||||
useToken,
|
useToken,
|
||||||
withDynamicSchemaProps,
|
withDynamicSchemaProps,
|
||||||
useProps,
|
|
||||||
} from '@tachybase/client';
|
} from '@tachybase/client';
|
||||||
|
import { RecursionField, Schema, useFieldSchema } from '@tachybase/schema';
|
||||||
|
|
||||||
import { message } from 'antd';
|
import { message } from 'antd';
|
||||||
import { debounce } from 'lodash';
|
import { debounce } from 'lodash';
|
||||||
import React, { SyntheticEvent, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { useGanttBlockContext } from '../../GanttBlockProvider';
|
import { useGanttBlockContext } from '../../GanttBlockProvider';
|
||||||
import { convertToBarTasks } from '../../helpers/bar-helper';
|
import { convertToBarTasks } from '../../helpers/bar-helper';
|
||||||
import { ganttDateRange, seedDates } from '../../helpers/date-helper';
|
import { ganttDateRange, seedDates } from '../../helpers/date-helper';
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import React, { ReactChild } from 'react';
|
||||||
import { cx } from '@tachybase/client';
|
import { cx } from '@tachybase/client';
|
||||||
import { uid } from '@tachybase/utils/client';
|
import { uid } from '@tachybase/utils/client';
|
||||||
import React, { ReactChild } from 'react';
|
|
||||||
import { addToDate } from '../../helpers/date-helper';
|
import { addToDate } from '../../helpers/date-helper';
|
||||||
import { Task } from '../../types/public-types';
|
import { Task } from '../../types/public-types';
|
||||||
import useStyles from './style';
|
import useStyles from './style';
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import React, { SyntheticEvent, useEffect, useRef } from 'react';
|
import React, { SyntheticEvent, useEffect, useRef } from 'react';
|
||||||
import { cx } from '@tachybase/client';
|
import { cx } from '@tachybase/client';
|
||||||
|
|
||||||
import useStyles from './style';
|
import useStyles from './style';
|
||||||
|
|
||||||
export const HorizontalScroll: React.FC<{
|
export const HorizontalScroll: React.FC<{
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { cx } from '@tachybase/client';
|
|
||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
|
import { cx } from '@tachybase/client';
|
||||||
|
|
||||||
import { getYmd } from '../../helpers/other-helper';
|
import { getYmd } from '../../helpers/other-helper';
|
||||||
import { BarTask } from '../../types/bar-task';
|
import { BarTask } from '../../types/bar-task';
|
||||||
import { Task } from '../../types/public-types';
|
import { Task } from '../../types/public-types';
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { cx } from '@tachybase/client';
|
|
||||||
import React, { SyntheticEvent, useEffect, useRef } from 'react';
|
import React, { SyntheticEvent, useEffect, useRef } from 'react';
|
||||||
|
import { cx } from '@tachybase/client';
|
||||||
|
|
||||||
import useStyles from './style';
|
import useStyles from './style';
|
||||||
|
|
||||||
export const VerticalScroll: React.FC<{
|
export const VerticalScroll: React.FC<{
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { cx } from '@tachybase/client';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { cx } from '@tachybase/client';
|
||||||
|
|
||||||
import { barBackground } from './style';
|
import { barBackground } from './style';
|
||||||
|
|
||||||
type BarDisplayProps = {
|
type BarDisplayProps = {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { cx } from '@tachybase/client';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { cx } from '@tachybase/client';
|
||||||
|
|
||||||
import { getProgressPoint } from '../../../helpers/bar-helper';
|
import { getProgressPoint } from '../../../helpers/bar-helper';
|
||||||
import { TaskItemProps } from '../task-item';
|
import { TaskItemProps } from '../task-item';
|
||||||
import { BarDisplay } from './bar-display';
|
import { BarDisplay } from './bar-display';
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { cx } from '@tachybase/client';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { cx } from '@tachybase/client';
|
||||||
|
|
||||||
import { getProgressPoint } from '../../../helpers/bar-helper';
|
import { getProgressPoint } from '../../../helpers/bar-helper';
|
||||||
import { TaskItemProps } from '../task-item';
|
import { TaskItemProps } from '../task-item';
|
||||||
import { BarDateHandle } from './bar-date-handle';
|
import { BarDateHandle } from './bar-date-handle';
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { cx } from '@tachybase/client';
|
import { cx } from '@tachybase/client';
|
||||||
|
|
||||||
import { TaskItemProps } from '../task-item';
|
import { TaskItemProps } from '../task-item';
|
||||||
import { milestoneWrapper, milestoneBackground } from './style';
|
import { milestoneBackground, milestoneWrapper } from './style';
|
||||||
|
|
||||||
export const Milestone: React.FC<TaskItemProps> = ({ task, isDateChangeable, onEventStart, isSelected }) => {
|
export const Milestone: React.FC<TaskItemProps> = ({ task, isDateChangeable, onEventStart, isSelected }) => {
|
||||||
const transform = `rotate(45 ${task.x1 + task.height * 0.356}
|
const transform = `rotate(45 ${task.x1 + task.height * 0.356}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { cx } from '@tachybase/client';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { cx } from '@tachybase/client';
|
||||||
|
|
||||||
import { TaskItemProps } from '../task-item';
|
import { TaskItemProps } from '../task-item';
|
||||||
import { projectBackground, projectWrapper } from './style';
|
import { projectBackground, projectWrapper } from './style';
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { cx } from '@tachybase/client';
|
|
||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
|
import { cx } from '@tachybase/client';
|
||||||
|
|
||||||
import { getYmd } from '../../helpers/other-helper';
|
import { getYmd } from '../../helpers/other-helper';
|
||||||
import { BarTask } from '../../types/bar-task';
|
import { BarTask } from '../../types/bar-task';
|
||||||
import { GanttContentMoveAction } from '../../types/gantt-task-actions';
|
import { GanttContentMoveAction } from '../../types/gantt-task-actions';
|
||||||
|
@ -1,18 +1,11 @@
|
|||||||
import { ApartmentOutlined } from '@ant-design/icons';
|
import React, { createContext, forwardRef, useContext, useEffect, useLayoutEffect, useState } from 'react';
|
||||||
import { Graph } from '@antv/x6';
|
|
||||||
import { MiniMap } from '@antv/x6-plugin-minimap';
|
|
||||||
import { Scroller } from '@antv/x6-plugin-scroller';
|
|
||||||
import { Selection } from '@antv/x6-plugin-selection';
|
|
||||||
import { Snapline } from '@antv/x6-plugin-snapline';
|
|
||||||
import { register } from '@antv/x6-react-shape';
|
|
||||||
import { cx } from '@tachybase/client';
|
|
||||||
import { SchemaOptionsContext } from '@tachybase/schema';
|
|
||||||
import {
|
import {
|
||||||
APIClientProvider,
|
APIClientProvider,
|
||||||
ApplicationContext,
|
ApplicationContext,
|
||||||
CollectionCategroriesContext,
|
CollectionCategroriesContext,
|
||||||
CollectionCategroriesProvider,
|
CollectionCategroriesProvider,
|
||||||
CurrentAppInfoContext,
|
CurrentAppInfoContext,
|
||||||
|
cx,
|
||||||
DataSourceApplicationProvider,
|
DataSourceApplicationProvider,
|
||||||
SchemaComponent,
|
SchemaComponent,
|
||||||
SchemaComponentOptions,
|
SchemaComponentOptions,
|
||||||
@ -22,15 +15,24 @@ import {
|
|||||||
useCollectionManager_deprecated,
|
useCollectionManager_deprecated,
|
||||||
useCompile,
|
useCompile,
|
||||||
useCurrentAppInfo,
|
useCurrentAppInfo,
|
||||||
useDataSourceManager,
|
|
||||||
useDataSource,
|
useDataSource,
|
||||||
|
useDataSourceManager,
|
||||||
useGlobalTheme,
|
useGlobalTheme,
|
||||||
} from '@tachybase/client';
|
} from '@tachybase/client';
|
||||||
|
import { SchemaOptionsContext } from '@tachybase/schema';
|
||||||
|
|
||||||
|
import { ApartmentOutlined } from '@ant-design/icons';
|
||||||
|
import { Graph } from '@antv/x6';
|
||||||
|
import { MiniMap } from '@antv/x6-plugin-minimap';
|
||||||
|
import { Scroller } from '@antv/x6-plugin-scroller';
|
||||||
|
import { Selection } from '@antv/x6-plugin-selection';
|
||||||
|
import { Snapline } from '@antv/x6-plugin-snapline';
|
||||||
|
import { register } from '@antv/x6-react-shape';
|
||||||
import { App, Button, ConfigProvider, Layout, Spin, Switch, Tooltip } from 'antd';
|
import { App, Button, ConfigProvider, Layout, Spin, Switch, Tooltip } from 'antd';
|
||||||
import dagre from 'dagre';
|
import dagre from 'dagre';
|
||||||
import lodash from 'lodash';
|
import lodash from 'lodash';
|
||||||
import React, { createContext, forwardRef, useContext, useEffect, useLayoutEffect, useState } from 'react';
|
|
||||||
import { useSearchParams } from 'react-router-dom';
|
import { useSearchParams } from 'react-router-dom';
|
||||||
|
|
||||||
import { useAsyncDataSource, useCreateActionAndRefreshCM } from './action-hooks';
|
import { useAsyncDataSource, useCreateActionAndRefreshCM } from './action-hooks';
|
||||||
import { AddCollectionAction } from './components/AddCollectionAction';
|
import { AddCollectionAction } from './components/AddCollectionAction';
|
||||||
import { ConnectorAction } from './components/ConnectorAction';
|
import { ConnectorAction } from './components/ConnectorAction';
|
||||||
@ -43,6 +45,7 @@ import { SimpleNodeView } from './components/ViewNode';
|
|||||||
import useStyles from './style';
|
import useStyles from './style';
|
||||||
import {
|
import {
|
||||||
cleanGraphContainer,
|
cleanGraphContainer,
|
||||||
|
collection,
|
||||||
formatData,
|
formatData,
|
||||||
getChildrenCollections,
|
getChildrenCollections,
|
||||||
getDiffEdge,
|
getDiffEdge,
|
||||||
@ -50,8 +53,8 @@ import {
|
|||||||
getInheritCollections,
|
getInheritCollections,
|
||||||
getPopupContainer,
|
getPopupContainer,
|
||||||
useGCMTranslation,
|
useGCMTranslation,
|
||||||
collection,
|
|
||||||
} from './utils';
|
} from './utils';
|
||||||
|
|
||||||
const { drop, groupBy, last, maxBy, minBy, take, uniq } = lodash;
|
const { drop, groupBy, last, maxBy, minBy, take, uniq } = lodash;
|
||||||
|
|
||||||
const LINE_HEIGHT = 40;
|
const LINE_HEIGHT = 40;
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ShareAltOutlined } from '@ant-design/icons';
|
|
||||||
import { Menu, Popover, Button } from 'antd';
|
|
||||||
import { css } from '@tachybase/client';
|
import { css } from '@tachybase/client';
|
||||||
import { getPopupContainer, useGCMTranslation } from '../utils';
|
|
||||||
|
import { ShareAltOutlined } from '@ant-design/icons';
|
||||||
|
import { Button, Menu, Popover } from 'antd';
|
||||||
|
|
||||||
import { ConnectionType } from '../GraphDrawPage';
|
import { ConnectionType } from '../GraphDrawPage';
|
||||||
|
import { getPopupContainer, useGCMTranslation } from '../utils';
|
||||||
|
|
||||||
export const ConnectorAction = (props) => {
|
export const ConnectorAction = (props) => {
|
||||||
const { onClick } = props;
|
const { onClick } = props;
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Popover, Button, Menu } from 'antd';
|
|
||||||
import { css } from '@tachybase/client';
|
import { css } from '@tachybase/client';
|
||||||
|
|
||||||
import { LineHeightOutlined } from '@ant-design/icons';
|
import { LineHeightOutlined } from '@ant-design/icons';
|
||||||
import { getPopupContainer, useGCMTranslation } from '../utils';
|
import { Button, Menu, Popover } from 'antd';
|
||||||
|
|
||||||
import { DirectionType } from '../GraphDrawPage';
|
import { DirectionType } from '../GraphDrawPage';
|
||||||
|
import { getPopupContainer, useGCMTranslation } from '../utils';
|
||||||
|
|
||||||
export const DirectionAction = (props) => {
|
export const DirectionAction = (props) => {
|
||||||
const { onClick } = props;
|
const { onClick } = props;
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
import { DeleteOutlined, DownOutlined, EditOutlined, UpOutlined } from '@ant-design/icons';
|
import React, { useContext, useRef, useState } from 'react';
|
||||||
import { css } from '@tachybase/client';
|
|
||||||
import { SchemaOptionsContext } from '@tachybase/schema';
|
|
||||||
import { uid } from '@tachybase/schema';
|
|
||||||
import {
|
import {
|
||||||
CollectionCategroriesContext,
|
CollectionCategroriesContext,
|
||||||
CollectionProvider_deprecated,
|
CollectionProvider_deprecated,
|
||||||
|
css,
|
||||||
SchemaComponent,
|
SchemaComponent,
|
||||||
SchemaComponentProvider,
|
SchemaComponentProvider,
|
||||||
Select,
|
Select,
|
||||||
@ -14,9 +12,12 @@ import {
|
|||||||
useCurrentAppInfo,
|
useCurrentAppInfo,
|
||||||
useRecord,
|
useRecord,
|
||||||
} from '@tachybase/client';
|
} from '@tachybase/client';
|
||||||
|
import { SchemaOptionsContext, uid } from '@tachybase/schema';
|
||||||
|
|
||||||
|
import { DeleteOutlined, DownOutlined, EditOutlined, UpOutlined } from '@ant-design/icons';
|
||||||
import { Badge, Tag } from 'antd';
|
import { Badge, Tag } from 'antd';
|
||||||
import lodash from 'lodash';
|
import lodash from 'lodash';
|
||||||
import React, { useContext, useRef, useState } from 'react';
|
|
||||||
import {
|
import {
|
||||||
useAsyncDataSource,
|
useAsyncDataSource,
|
||||||
useCancelAction,
|
useCancelAction,
|
||||||
@ -26,7 +27,7 @@ import {
|
|||||||
useValuesFromRecord,
|
useValuesFromRecord,
|
||||||
} from '../action-hooks';
|
} from '../action-hooks';
|
||||||
import useStyles from '../style';
|
import useStyles from '../style';
|
||||||
import { getPopupContainer, useGCMTranslation, collection } from '../utils';
|
import { collection, getPopupContainer, useGCMTranslation } from '../utils';
|
||||||
import { AddFieldAction } from './AddFieldAction';
|
import { AddFieldAction } from './AddFieldAction';
|
||||||
import { CollectionNodeProvder } from './CollectionNodeProvder';
|
import { CollectionNodeProvder } from './CollectionNodeProvder';
|
||||||
import { ConnectAssociationAction } from './ConnectAssociationAction';
|
import { ConnectAssociationAction } from './ConnectAssociationAction';
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import React, { useState, useContext } from 'react';
|
import React, { useContext, useState } from 'react';
|
||||||
import { Input, Menu, Popover, Button } from 'antd';
|
import { css, useCompile } from '@tachybase/client';
|
||||||
import { css } from '@tachybase/client';
|
|
||||||
import { MenuOutlined } from '@ant-design/icons';
|
import { MenuOutlined } from '@ant-design/icons';
|
||||||
import { useCompile } from '@tachybase/client';
|
import { Button, Input, Menu, Popover } from 'antd';
|
||||||
import { getPopupContainer, useGCMTranslation } from '../utils';
|
|
||||||
import { CollapsedContext } from '../GraphDrawPage';
|
import { CollapsedContext } from '../GraphDrawPage';
|
||||||
|
import { getPopupContainer, useGCMTranslation } from '../utils';
|
||||||
|
|
||||||
export const LocateCollectionAction = (props) => {
|
export const LocateCollectionAction = (props) => {
|
||||||
const { handleFiterCollections } = props;
|
const { handleFiterCollections } = props;
|
||||||
|
@ -1,16 +1,18 @@
|
|||||||
import { css } from '@tachybase/client';
|
import React, { useContext, useState } from 'react';
|
||||||
import { FormLayout } from '@tachybase/components';
|
|
||||||
import { observer, RecursionField, useFieldSchema } from '@tachybase/schema';
|
|
||||||
import {
|
import {
|
||||||
ActionContextProvider,
|
ActionContextProvider,
|
||||||
|
css,
|
||||||
DndContext,
|
DndContext,
|
||||||
RecordProvider,
|
RecordProvider,
|
||||||
SchemaComponentOptions,
|
SchemaComponentOptions,
|
||||||
useCollectionParentRecordData,
|
useCollectionParentRecordData,
|
||||||
} from '@tachybase/client';
|
} from '@tachybase/client';
|
||||||
|
import { FormLayout } from '@tachybase/components';
|
||||||
|
import { observer, RecursionField, useFieldSchema } from '@tachybase/schema';
|
||||||
|
|
||||||
import { Card } from 'antd';
|
import { Card } from 'antd';
|
||||||
import cls from 'classnames';
|
import cls from 'classnames';
|
||||||
import React, { useContext, useState } from 'react';
|
|
||||||
import { KanbanCardContext } from './context';
|
import { KanbanCardContext } from './context';
|
||||||
|
|
||||||
export const KanbanCard: any = observer(
|
export const KanbanCard: any = observer(
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
import { css, cx } from '@tachybase/client';
|
import React, { useEffect } from 'react';
|
||||||
import { createStyles, useAPIClient, useGlobalTheme } from '@tachybase/client';
|
import { createStyles, css, cx, useAPIClient, useGlobalTheme } from '@tachybase/client';
|
||||||
import { error } from '@tachybase/utils/client';
|
import { error } from '@tachybase/utils/client';
|
||||||
import { Button, ConfigProvider, Input, Space, message } from 'antd';
|
|
||||||
|
import { Button, ConfigProvider, Input, message, Space } from 'antd';
|
||||||
import antdEnUs from 'antd/locale/en_US';
|
import antdEnUs from 'antd/locale/en_US';
|
||||||
import antdZhCN from 'antd/locale/zh_CN';
|
import antdZhCN from 'antd/locale/zh_CN';
|
||||||
import React, { useEffect } from 'react';
|
|
||||||
import { ThemeConfig } from '../../../types';
|
import { ThemeConfig } from '../../../types';
|
||||||
import { ThemeEditor, enUS, zhCN } from '../../antd-token-previewer';
|
import { enUS, ThemeEditor, zhCN } from '../../antd-token-previewer';
|
||||||
import { useUpdateThemeSettings } from '../../hooks/useUpdateThemeSettings';
|
import { useUpdateThemeSettings } from '../../hooks/useUpdateThemeSettings';
|
||||||
import { useTranslation } from '../../locale';
|
import { useTranslation } from '../../locale';
|
||||||
import { changeAlgorithmFromFunctionToString } from '../../utils/changeAlgorithmFromFunctionToString';
|
import { changeAlgorithmFromFunctionToString } from '../../utils/changeAlgorithmFromFunctionToString';
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
import { Plugin } from '@tachybase/client';
|
import { Plugin } from '@tachybase/client';
|
||||||
|
|
||||||
import 'vditor/dist/index.css';
|
import 'vditor/dist/index.css';
|
||||||
|
|
||||||
import { MarkdownVditor } from './components';
|
import { MarkdownVditor } from './components';
|
||||||
import { MarkdownVditorFieldInterface } from './interfaces/markdown-vditor';
|
import { MarkdownVditorFieldInterface } from './interfaces/markdown-vditor';
|
||||||
|
|
||||||
export class PluginFieldMarkdownVditorClient extends Plugin {
|
export class PluginFieldMarkdownVditorClient extends Plugin {
|
||||||
async afterAdd() {}
|
async afterAdd() {}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user