diff --git a/src/executor/index.tsx b/src/executor/index.tsx index b37dc7c939df15eaa779af23cff1eab3afc3aed7..45d9202abb4a9f240d9744e0ff60b0dfb92dea53 100644 --- a/src/executor/index.tsx +++ b/src/executor/index.tsx @@ -25,6 +25,7 @@ const Executor: React.FC = () => { switch (cmd) { case 'open': case 'remark': + case 'openForm': if (args.length > 1 && args[1] == 'preview') { setPreview( void; + showBrower?: boolean; } /** 表单查看 */ -const FormView: React.FC = ({ form, finished }) => { +const FormView: React.FC = ({ form, finished, showBrower }) => { const [select, setSelcet] = useState(); const [loaded] = useAsyncLoad(() => form.loadContent()); const filterExp: any[] = JSON.parse( @@ -133,30 +134,34 @@ const FormView: React.FC = ({ form, finished }) => { ); }; - return ( - } - destroyOnClose - onCancel={() => finished()}> - {loaded ? ( - form.canDesign ? ( - + if (showBrower) { + return ; + } else { + return ( + } + destroyOnClose + onCancel={() => finished()}> + {loaded ? ( + form.canDesign ? ( + + ) : ( + + ) ) : ( - - ) - ) : ( - -
-
- )} -
- ); + +
+
+ )} +
+ ); + } }; export default FormView; diff --git a/src/executor/open/index.tsx b/src/executor/open/index.tsx index 7e83e886d0e2a531e2bc5f7f605ed9cbcf549c61..61ce8c9905839d3409d4f86f62f37864017b4270 100644 --- a/src/executor/open/index.tsx +++ b/src/executor/open/index.tsx @@ -3,6 +3,7 @@ import VideoView from './video'; import React from 'react'; import FormView from './form'; import WorkStart from './work'; +import WorkAllForm from './workAllForm'; import TaskContent from './task'; import OfficeView from './office'; import TransferView from './transfer'; @@ -72,13 +73,23 @@ const ExecutorOpen: React.FC = (props: IOpenProps) => { case '页面模板': return ; case '办事': - return ( - - ); + switch (props.cmd) { + case 'openForm': + return ( + + ); + default: + return ( + + ); + } case '加用户': return ( <> diff --git a/src/executor/open/workAllForm/index.tsx b/src/executor/open/workAllForm/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..a1c9cfff59836260c01b78c1d6a3a38713cad3dd --- /dev/null +++ b/src/executor/open/workAllForm/index.tsx @@ -0,0 +1,46 @@ +import React from 'react'; +import FullScreenModal from '@/components/Common/fullScreen'; +import type { TabsProps } from 'antd'; +import { Spin } from 'antd'; +import useAsyncLoad from '@/hooks/useAsyncLoad'; +import { Tabs } from 'antd'; +import FormView from '../form'; +import { IWork } from '@/ts/core'; + +interface IProps { + form: IWork; + finished: () => void; +} +/** 表单查看 */ +const WorkAllForm: React.FC = ({ form, finished }) => { + const [loaded] = useAsyncLoad(() => form.loadContent()); + if (loaded) { + let forms = [...form.primaryForms, ...form.detailForms]; + const items: TabsProps['items'] = forms.map((item, index) => { + return { + key: index.toString(), + label: item.name, + children: , + }; + }); + return ( + finished()}> + {loaded ? ( + + ) : ( + +
+
+ )} +
+ ); + } + return <>; +}; + +export default WorkAllForm; diff --git a/src/ts/core/work/index.ts b/src/ts/core/work/index.ts index 40aa09dc428189026f730f30a6b39230d63ef00f..0838a1064af438a9e5c8daaf92f8c96d93a942ff 100644 --- a/src/ts/core/work/index.ts +++ b/src/ts/core/work/index.ts @@ -358,9 +358,9 @@ export class Work extends FileInfo implements IWork { } override operates(): model.OperateModel[] { const operates = super.operates(); - if (this.isInherited) { - operates.push({ sort: 3, cmd: 'workForm', label: '查看表单', iconType: 'newForm' }); - } + // if (this.isInherited) { + operates.push({ sort: 3, cmd: 'openForm', label: '查看表单', iconType: '表单' }); + // } if (this.cache.tags?.includes('常用')) { operates.unshift(fileOperates.DelCommon); } else {