11import React from "react" ;
2- import { ModalForm , ProFormText } from "@ant-design/pro-components" ;
2+ import { ModalForm , ProFormText } from "@ant-design/pro-components" ;
33import ProFormCode from "@/components/Form/ProFormCode" ;
4- import { EyeOutlined } from "@ant-design/icons" ;
4+ import { EyeOutlined } from "@ant-design/icons" ;
55import "./ScriptModal.scss" ;
66
77interface ScriptModalProps {
@@ -11,12 +11,13 @@ interface ScriptModalProps {
1111 onFinish : ( values : any ) => void ;
1212}
1313
14- const ScriptModal :React . FC < ScriptModalProps > = ( props ) => {
14+ const ScriptModal : React . FC < ScriptModalProps > = ( props ) => {
1515
1616 const [ show , setShow ] = React . useState ( false ) ;
1717
1818 return (
1919 < ModalForm
20+ className = { "ScriptModal" }
2021 form = { props . form }
2122 title = { "脚本预览" }
2223 width = { "80%" }
@@ -42,61 +43,61 @@ const ScriptModal:React.FC<ScriptModalProps> = (props)=>{
4243
4344 < a onClick = { ( ) => {
4445 setShow ( ! show ) ;
45- } } > < EyeOutlined /> 查看帮助</ a >
46+ } } > < EyeOutlined /> 查看帮助</ a >
4647
4748 { show && (
4849 < div >
49- < pre >
50- 脚本说明:
51- 函数的定义必须为
52- < code >
53- {
54- `
50+ < pre >
51+ 脚本说明:
52+ 函数的定义必须为
53+ < code >
54+ {
55+ `
5556def run(content){
5657 // 你的代码
5758 return true;
5859}
5960`
60- }
61- </ code >
62- 在设置操作人是函数返回的人员的id数组:
63- < code >
64- {
65- `
61+ }
62+ </ code >
63+ 在设置操作人是函数返回的人员的id数组:
64+ < code >
65+ {
66+ `
6667def run(content){
6768 // 你的代码
6869 return [1,2,3];
6970}
7071`
71- }
72- </ code >
73- 在设置异常配置是函数返回的是人员或节点:
74- < code >
75- {
76- `
72+ }
73+ </ code >
74+ 在设置异常配置是函数返回的是人员或节点:
75+ < code >
76+ {
77+ `
7778def run(content){
7879 // 你的代码
7980 // return content.createNodeErrTrigger("code");
8081 // return content.createOperatorErrTrigger(1,2,3);
8182}
8283`
83- }
84- </ code >
85- 在自定义标题时,返回的字符串:
86- < code >
87- {
88- `
84+ }
85+ </ code >
86+ 在自定义标题时,返回的字符串:
87+ < code >
88+ {
89+ `
8990def run(content){
9091 // 你的代码
9192 return content.getCreateOperator().getName() + '-' + content.getFlowWork().getTitle() + '-' + content.getFlowNode().getName();
9293}
9394`
94- }
95- </ code >
96- 在自定义按钮事件时,返回createMessageResult函数:
97- < code >
98- {
99- `
95+ }
96+ </ code >
97+ 在自定义按钮事件时,返回createMessageResult函数:
98+ < code >
99+ {
100+ `
100101def run(content){
101102 // 你的代码
102103 // 自定义返回标题
@@ -107,12 +108,12 @@ def run(content){
107108 return content.createMessageResult('我是自定义标题', true).addItem('我是标题1','我是内容2').addItem('我是标题2','我是内容2');
108109}
109110`
110- }
111- </ code >
112- 在自定义按钮事件时,操作流程:
113- < code >
114- {
115- `
111+ }
112+ </ code >
113+ 在自定义按钮事件时,操作流程:
114+ < code >
115+ {
116+ `
116117def run(content){
117118 // 你的代码
118119 // 自定义返回标题
@@ -135,11 +136,11 @@ def run(content){
135136 return content.createMessageResult('我是自定义标题', true).addMessage('我是标题1','我是内容2').addMessage('我是标题2','我是内容2').closeable(false);
136137}
137138`
138- }
139- </ code >
140- content对象能力,content对象下存在了flowWork 流程设计对象访问方式为content.getFlowWork(),flowNode 流程节点对象访问方式为content.getFlowNode(),createOperator 创建人对象访问方式为content.getCreateOperator(),currentOperator 当前操作人对象访问方式为content.getCurrentOperator()
141- 获取当前表单数据对象 content.getBindData(),获取当前审批意见对象 content.getOpinion(),获取当前节点的审批历史记录数据 content.getHistoryRecords(),获取spring的bean对象 content.getBean("beanName")
142- </ pre >
139+ }
140+ </ code >
141+ content对象能力,content对象下存在了flowWork 流程设计对象访问方式为content.getFlowWork(),flowNode 流程节点对象访问方式为content.getFlowNode(),createOperator 创建人对象访问方式为content.getCreateOperator(),currentOperator 当前操作人对象访问方式为content.getCurrentOperator()
142+ 获取当前表单数据对象 content.getBindData(),获取当前审批意见对象 content.getOpinion(),获取当前节点的审批历史记录数据 content.getHistoryRecords(),获取spring的bean对象 content.getBean("beanName")
143+ </ pre >
143144 </ div >
144145 ) }
145146
0 commit comments