@nocobase/plugin-workflow-manual 1.3.39-beta → 1.4.0-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client/index.js
CHANGED
|
@@ -19,4 +19,4 @@
|
|
|
19
19
|
}
|
|
20
20
|
`,children:[s.jsx(b.Form.Item,{children:s.jsxs(b.Radio.Group,{value:!!e,onChange:({target:{value:t}})=>{console.log(t),n(Number(t))},children:[s.jsx(b.Radio,{value:!0,children:s.jsxs(b.Tooltip,{title:B("Each user has own task"),placement:"bottom",children:[s.jsx("span",{children:B("Separately")}),s.jsx(q.QuestionCircleOutlined,{style:{color:"#999"}})]})}),s.jsx(b.Radio,{value:!1,children:s.jsxs(b.Tooltip,{title:B("Everyone shares one task"),placement:"bottom",children:[s.jsx("span",{children:B("Collaboratively")}),s.jsx(q.QuestionCircleOutlined,{style:{color:"#999"}})]})})]})}),e?r:null]})}function Ue(e){return e.isForeignKey?e.target==="users":e.collectionName==="users"&&e.name==="id"}function _e({multiple:e=!1,value:n=[],onChange:r}){const t=l.useWorkflowVariableOptions({types:[Ue]});return s.jsx(o.Variable.Input,{scope:t,value:n[0],onChange:i=>{r([i])},children:s.jsx(o.RemoteSelect,{fieldNames:{label:"nickname",value:"id"},service:{resource:"users"},manual:!1,value:n[0],onChange:i=>{r(i!=null?[i]:[])}})})}function Ee({key:e,title:n,config:r},{types:t,fieldNames:i=l.defaultFieldNames}){var m;const a=o.useCompile(),{getCollectionFields:d}=o.useCollectionManager_deprecated(),u=Object.keys((m=r.forms)!=null?m:{});if(!u.length)return null;const p=u.map(f=>{var k;const c=r.forms[f],x=l.getCollectionFieldOptions({fields:(k=c.collection)==null?void 0:k.fields,collection:c.collection,types:t,compile:a,getCollectionFields:d}),v=a(c.title)||f;return x.length?{key:f,value:f,label:v,title:v,children:x}:null}).filter(Boolean);return p.length?{[i.value]:e,[i.label]:n,[i.children]:p}:null}class Ke extends l.Instruction{constructor(){super(...arguments);P(this,"title",`{{t("Manual", { ns: "${y}" })}}`);P(this,"type","manual");P(this,"group","manual");P(this,"description",`{{t("Could be used for manually submitting data, and determine whether to continue or exit. Workflow will generate a todo item for assigned user when it reaches a manual node, and continue processing after user submits the form.", { ns: "${y}" })}}`);P(this,"fieldset",{assignees:{type:"array",title:`{{t("Assignees", { ns: "${y}" })}}`,"x-decorator":"FormItem","x-component":"AssigneesSelect","x-component-props":{},required:!0,default:[]},mode:{type:"number",title:`{{t("Mode", { ns: "${y}" })}}`,"x-decorator":"FormItem","x-component":"ModeConfig",default:1,"x-reactions":{dependencies:["assignees"],fulfill:{state:{visible:"{{$deps[0].length > 1}}"}}}},schema:{type:"void",title:`{{t("User interface", { ns: "${y}" })}}`,"x-decorator":"FormItem","x-component":"SchemaConfigButton",properties:{schema:{type:"object","x-component":"SchemaConfig",default:null}}},forms:{type:"object",default:{}}});P(this,"components",{SchemaConfigButton:Ne,SchemaConfig:Pe,ModeConfig:$e,AssigneesSelect:_e});P(this,"useVariables",Ee)}useInitializers(r){var d;const{getCollection:t}=o.useCollectionManager_deprecated(),i=Object.keys((d=r.config.forms)!=null?d:{});if(!i.length||r.config.mode)return null;const a=i.map(u=>{var f,c;const p=r.config.forms[u],{fields:m=[]}=t(p.collection);return m.length?{name:(f=p.title)!=null?f:u,type:"item",title:(c=p.title)!=null?c:u,Component:l.CollectionBlockInitializer,collection:p.collection,dataPath:`$jobsMapByNodeKey.${r.key}.${u}`}:null}).filter(Boolean);return a.length?{name:`#${r.id}`,key:"forms",type:"subMenu",title:r.title,children:a}:null}isAvailable({engine:r,workflow:t,upstream:i,branchIndex:a}){return!r.isWorkflowSync(t)}}const qe={title:`{{t("Task", { ns: "${y}" })}}`,name:"flow_nodes",fields:[{type:"bigInt",name:"id",interface:"m2o",uiSchema:{type:"number",title:"ID","x-component":"RemoteSelect","x-component-props":{fieldNames:{label:"title",value:"id"},service:{resource:"flow_nodes",params:{filter:{type:"manual"}}}}}},{type:"string",name:"title",interface:"input",uiSchema:{type:"string",title:'{{t("Title")}}',"x-component":"Input"}}]},Ge={title:`{{t("Workflow", { ns: "${y}" })}}`,name:"workflows",fields:[{type:"string",name:"title",interface:"input",uiSchema:{title:'{{t("Name")}}',type:"string","x-component":"Input",required:!0}}]},Je={title:`{{t("Workflow todos", { ns: "${y}" })}}`,name:"users_jobs",fields:[{type:"belongsTo",name:"user",target:"users",foreignKey:"userId",interface:"m2o",uiSchema:{type:"number",title:'{{t("User")}}',"x-component":"RemoteSelect","x-component-props":{fieldNames:{label:"nickname",value:"id"},service:{resource:"users"}}}},{type:"belongsTo",name:"node",target:"flow_nodes",foreignKey:"nodeId",interface:"m2o",isAssociation:!0,uiSchema:{type:"number",title:`{{t("Task", { ns: "${y}" })}}`,"x-component":"RemoteSelect","x-component-props":{fieldNames:{label:"title",value:"id"},service:{resource:"flow_nodes"}}}},{type:"belongsTo",name:"workflow",target:"workflows",foreignKey:"workflowId",interface:"m2o",uiSchema:{type:"number",title:`{{t("Workflow", { ns: "${y}" })}}`,"x-component":"RemoteSelect","x-component-props":{fieldNames:{label:"title",value:"id"},service:{resource:"workflows"}}}},{type:"integer",name:"status",interface:"select",uiSchema:{type:"number",title:`{{t("Status", { ns: "${y}" })}}`,"x-component":"Select",enum:l.JobStatusOptions}},{name:"createdAt",type:"date",interface:"createdAt",uiSchema:{type:"datetime",title:'{{t("Created at")}}',"x-component":"DatePicker","x-component-props":{showTime:!0}}}]},Le=S.observer(()=>{var n,r,t;const e=S.useField();return(t=(n=e==null?void 0:e.value)==null?void 0:n.title)!=null?t:`#${(r=e.value)==null?void 0:r.id}`},{displayName:"NodeColumn"}),Ye=S.observer(()=>{var n,r,t;const e=S.useField();return(t=(n=e==null?void 0:e.value)==null?void 0:n.title)!=null?t:`#${(r=e.value)==null?void 0:r.id}`},{displayName:"WorkflowColumn"}),Qe=S.observer(()=>{var n,r,t;const e=S.useField();return(t=(n=e==null?void 0:e.value)==null?void 0:n.nickname)!=null?t:(r=e.value)==null?void 0:r.id},{displayName:"UserColumn"});function He(e){var t;const n=o.useCollectionRecordData(),r=B("Unprocessed");return(t=n==null?void 0:n.execution)!=null&&t.status&&!(n!=null&&n.status)?s.jsx(b.Tag,{children:r}):e.children}const J=()=>{const{defaultOpenMode:e}=o.useOpenModeContext(),n=o.useCollection();return s.jsx(o.SchemaComponent,{components:{NodeColumn:Le,WorkflowColumn:Ye,UserColumn:Qe,UserJobStatusColumn:He},schema:{type:"void",properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:"var(--nb-spacing)"}},properties:{filter:{type:"void",title:'{{ t("Filter") }}',"x-action":"filter","x-designer":"Filter.Action.Designer","x-component":"Filter.Action","x-use-component-props":"useFilterActionProps","x-component-props":{icon:"FilterOutlined"},"x-align":"left"},refresher:{type:"void",title:'{{ t("Refresh") }}',"x-action":"refresh","x-component":"Action","x-use-component-props":"useRefreshActionProps","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:refresh","x-component-props":{icon:"ReloadOutlined"},"x-align":"right"}}},table:{type:"array","x-component":"TableV2","x-use-component-props":"useTableBlockProps","x-component-props":{rowKey:"id"},properties:{actions:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:60},title:'{{t("Actions")}}',properties:{view:ae({defaultOpenMode:e,collectionName:n.name})}},node:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:null},title:`{{t("Task node", { ns: "${y}" })}}`,properties:{node:{"x-component":"NodeColumn","x-read-pretty":!0}}},workflow:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:null},title:'{{t("Workflow", { ns: "workflow" })}}',properties:{workflow:{"x-component":"WorkflowColumn","x-read-pretty":!0}}},status:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:100},title:'{{t("Status", { ns: "workflow" })}}',properties:{status:{type:"number","x-decorator":"UserJobStatusColumn","x-component":"CollectionField","x-read-pretty":!0}}},user:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:140},title:`{{t("Assignee", { ns: "${y}" })}}`,properties:{user:{"x-component":"UserColumn","x-read-pretty":!0}}},createdAt:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:160},properties:{createdAt:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}}}}}}})};function ae({defaultOpenMode:e,collectionName:n}){return{name:"view",type:"void","x-component":"Action.Link","x-component-props":{openMode:e},title:'{{t("View")}}',"x-uid":`${n}-view`,"x-action":"view","x-action-context":{dataSource:"main",collection:n,doNotUpdateContext:!0},properties:{drawer:{"x-component":J.Drawer}}}}function Xe(e){var m;const{data:n}=o.useCurrentUserContext(),{userJob:r}=l.useFlowContext(),{status:t,result:i,userId:a}=r,d=S.useFieldSchema(),{name:u}=d.parent.toJSON();let{children:p}=e;return t?i[u]||(p=null):((m=n==null?void 0:n.data)==null?void 0:m.id)!==a&&(p=null),p}const ce=h.createContext(null);ce.displayName="ManualActionStatusContext";function Ze({value:e,children:n}){const{userJob:r,execution:t}=l.useFlowContext(),i=S.useField(),a=S.useFieldSchema(),d=o.useCompile();return h.useEffect(()=>{(t.status||r.status)&&(i.disabled=!0,i.visible=r.status===e&&r.result._===a.name)},[t,r,e,i,a.name]),s.jsx(ce.Provider,{value:e,children:t.status||r.status?s.jsx(b.Button,{type:"primary",disabled:!0,children:d(a.title)}):n})}function We(){var v;const e=o.useAPIClient(),{setVisible:n,setSubmitted:r}=o.useActionContext(),{values:t,submit:i}=S.useForm(),a=S.useField(),d=S.useFieldSchema(),{service:u}=o.useTableBlockContext(),{userJob:p,execution:m}=l.useFlowContext(),{name:f}=d,{name:c}=d.parent.parent,{assignedValues:x={}}=(v=d==null?void 0:d["x-action-settings"])!=null?v:{};return{run(){return U(this,null,function*(){m.status||p.status||(yield i(),a.data=a.data||{},a.data.loading=!0,yield e.resource("users_jobs").submit({filterByTk:p.id,values:{result:{[c]:g(g({},t),x.values),_:f}}}),a.data.loading=!1,r(!0),n(!1),u==null||u.refresh())})}}}function Re(e){var f;const n=o.usePlugin(l),r=o.useAPIClient(),{id:t}=o.useCollectionRecordData()||{},[i,a]=h.useState(null),[d,u]=h.useState(null);h.useEffect(()=>{var c,x;t&&((x=(c=r.resource("users_jobs")).get)==null||x.call(c,{filterByTk:t,appends:["node","job","workflow","workflow.nodes","execution","execution.jobs"]}).then(({data:v})=>{var O;const z=(O=v==null?void 0:v.data)!=null?O:{},{node:k,workflow:N={}}=z,G=N,{nodes:w=[]}=G,I=$(G,["nodes"]),pe=z,{execution:T}=pe,A=$(pe,["node","workflow","execution"]);l.linkNodes(w),u(k),a({userJob:A,workflow:I,nodes:w,execution:T})}))},[r,t]);const m=l.useAvailableUpstreams(i==null?void 0:i.nodes.find(c=>c.id===d.id)).reduce((c,{type:x})=>Object.assign(c,n.instructions.get(x).components),{});return d&&i?s.jsx(l.FlowContext.Provider,{value:i,children:s.jsx(o.SchemaComponent,{components:g(g({FormBlockProvider:X,DetailsBlockProvider:l.DetailsBlockProvider,ActionBarProvider:Xe,ManualActionStatusProvider:Ze},Array.from(D.getValues()).reduce((c,x)=>Object.assign(c,x.block.components),{})),m),scope:g({useSubmit:We,useFormBlockProps:eo,useDetailsBlockProps:oo},Array.from(D.getValues()).reduce((c,x)=>Object.assign(c,x.block.scope),{})),schema:{type:"void",name:"tabs","x-component":"Tabs",properties:(f=d.config)==null?void 0:f.schema}})}):s.jsx(b.Spin,{})}function eo(){var d;const{userJob:e,execution:n}=l.useFlowContext(),r=o.useCollectionRecordData(),{data:t}=o.useCurrentUserContext(),{form:i}=o.useFormBlockContext(),a=n.status||e.status?r?"readPretty":"disabled":((d=t==null?void 0:t.data)==null?void 0:d.id)!==e.userId?"disabled":"editable";return h.useEffect(()=>{i==null||i.setPattern(a)},[a,i]),{form:i}}function oo(){const{form:e}=o.useFormBlockContext();return{form:e}}function to(){const e=o.useCompile(),{status:n,updatedAt:r}=o.useCollectionRecordData()||{},t=l.JobStatusOptionsMap[n];return n?s.jsxs(b.Space,{children:[s.jsx("time",{className:o.css`
|
|
21
21
|
margin-right: 0.5em;
|
|
22
|
-
`,children:me(r).format("YYYY-MM-DD HH:mm:ss")}),s.jsx(b.Tag,{icon:t.icon,color:t.color,children:e(t.label)})]}):null}function no(){var a;const e=h.useContext(o.SchemaComponentContext),{id:n,node:r,workflow:t,status:i}=o.useCollectionRecordData()||{};return s.jsx(o.SchemaComponentContext.Provider,{value:F(g({},e),{reset(){},designable:!1}),children:s.jsx(o.SchemaComponent,{components:{FooterStatus:to,FlowContextProvider:Re},schema:{type:"void",name:`drawer-${n}-${i}`,"x-component":"Action.Container","x-component-props":{className:"nb-action-popup"},title:`${t==null?void 0:t.title} - ${(a=r==null?void 0:r.title)!=null?a:`#${r==null?void 0:r.id}`}`,properties:{tabs:{type:"void","x-component":"FlowContextProvider"},footer:{type:"void","x-component":"Action.Container.Footer",properties:{content:{type:"void","x-component":"FooterStatus"}}}}}})})}function ro({params:e={},children:n}){const r={collection:"users_jobs",resource:"users_jobs",action:"list",params:F(g({pageSize:20,sort:["-createdAt"]},e),{appends:["user","node","workflow","execution.status"],except:["node.config","workflow.config","workflow.options"]}),rowKey:"id",showIndex:!0,dragSort:!1};return s.jsx(o.TableBlockProvider,F(g({name:"workflow-todo"},r),{children:n}))}J.Drawer=no,J.Decorator=ro;const le=[qe,Ge,Je],so=e=>s.jsx(o.ExtendCollectionsProvider,{collections:le,children:e.children});function io(e){e.forEach(n=>{const r=ao()?"drawer":"page",t=ae({defaultOpenMode:r,collectionName:n});o.storePopupContext(t["x-uid"],g({schema:t},t["x-action-context"]))})}io(Object.values(le).map(e=>e.name));function ao(){return window.location.pathname.startsWith("/m")}const co=()=>{const e=o.useSchemaInitializerItem(),{insert:n}=o.useSchemaInitializer();return s.jsx(o.SchemaInitializerItem,F(g({icon:s.jsx(q.TableOutlined,{})},e),{onClick:()=>{n({type:"void","x-decorator":"WorkflowTodo.Decorator","x-decorator-props":{},"x-component":"CardItem","x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:table",properties:{todos:{type:"void","x-component":"WorkflowTodo"}}})}}))};class lo extends o.Plugin{afterAdd(){return U(this,null,function*(){})}load(){return U(this,null,function*(){this.addComponents(),this.app.pm.get("workflow").registerInstruction("manual",Ke),this.app.schemaInitializerManager.add(ne),this.app.schemaInitializerManager.add(Te),this.app.schemaInitializerManager.add(ie),this.app.schemaInitializerManager.add(ze),this.app.schemaInitializerManager.add(oe),this.app.schemaInitializerManager.add(ke),this.app.schemaInitializerManager.get("page:addBlock").add("otherBlocks.workflowTodos",{title:`{{t("Workflow todos", { ns: "${y}" })}}`,Component:"WorkflowTodoBlockInitializer",icon:"CheckSquareOutlined"}),this.app.schemaInitializerManager.addItem("mobile:addBlock","otherBlocks.workflowTodos",{title:`{{t("Workflow todos", { ns: "${y}" })}}`,Component:"WorkflowTodoBlockInitializer",icon:"CheckSquareOutlined"}),this.app.addProvider(so)})}addComponents(){this.app.addComponents({WorkflowTodo:J,WorkflowTodoBlockInitializer:co})}}C.default=lo,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
22
|
+
`,children:me(r).format("YYYY-MM-DD HH:mm:ss")}),s.jsx(b.Tag,{icon:t.icon,color:t.color,children:e(t.label)})]}):null}function no(){var a;const e=h.useContext(o.SchemaComponentContext),{id:n,node:r,workflow:t,status:i}=o.useCollectionRecordData()||{};return s.jsx(o.SchemaComponentContext.Provider,{value:F(g({},e),{reset(){},designable:!1}),children:s.jsx(o.SchemaComponent,{components:{FooterStatus:to,FlowContextProvider:Re},schema:{type:"void",name:`drawer-${n}-${i}`,"x-component":"Action.Container","x-component-props":{className:"nb-action-popup"},title:`${t==null?void 0:t.title} - ${(a=r==null?void 0:r.title)!=null?a:`#${r==null?void 0:r.id}`}`,properties:{tabs:{type:"void","x-component":"FlowContextProvider"},footer:{type:"void","x-component":"Action.Container.Footer",properties:{content:{type:"void","x-component":"FooterStatus"}}}}}})})}function ro({params:e={},children:n}){const r={collection:"users_jobs",resource:"users_jobs",action:"list",params:F(g({pageSize:20,sort:["-createdAt"]},e),{appends:["user","node","workflow","execution.status"],except:["node.config","workflow.config","workflow.options"]}),rowKey:"id",showIndex:!0,dragSort:!1};return s.jsx(o.TableBlockProvider,F(g({name:"workflow-todo"},r),{children:n}))}J.Drawer=no,J.Decorator=ro;const le=[qe,Ge,Je],so=e=>s.jsx(o.ExtendCollectionsProvider,{collections:le,children:e.children});function io(e){e.forEach(n=>{const r=ao()?"drawer":"page",t=ae({defaultOpenMode:r,collectionName:n});o.storePopupContext(t["x-uid"],g({schema:t},t["x-action-context"]))})}io(Object.values(le).map(e=>e.name));function ao(){return window.location.pathname.startsWith("/m/")}const co=()=>{const e=o.useSchemaInitializerItem(),{insert:n}=o.useSchemaInitializer();return s.jsx(o.SchemaInitializerItem,F(g({icon:s.jsx(q.TableOutlined,{})},e),{onClick:()=>{n({type:"void","x-decorator":"WorkflowTodo.Decorator","x-decorator-props":{},"x-component":"CardItem","x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:table",properties:{todos:{type:"void","x-component":"WorkflowTodo"}}})}}))};class lo extends o.Plugin{afterAdd(){return U(this,null,function*(){})}load(){return U(this,null,function*(){this.addComponents(),this.app.pm.get("workflow").registerInstruction("manual",Ke),this.app.schemaInitializerManager.add(ne),this.app.schemaInitializerManager.add(Te),this.app.schemaInitializerManager.add(ie),this.app.schemaInitializerManager.add(ze),this.app.schemaInitializerManager.add(oe),this.app.schemaInitializerManager.add(ke),this.app.schemaInitializerManager.get("page:addBlock").add("otherBlocks.workflowTodos",{title:`{{t("Workflow todos", { ns: "${y}" })}}`,Component:"WorkflowTodoBlockInitializer",icon:"CheckSquareOutlined"}),this.app.schemaInitializerManager.addItem("mobile:addBlock","otherBlocks.workflowTodos",{title:`{{t("Workflow todos", { ns: "${y}" })}}`,Component:"WorkflowTodoBlockInitializer",icon:"CheckSquareOutlined"}),this.app.addProvider(so)})}addComponents(){this.app.addComponents({WorkflowTodo:J,WorkflowTodoBlockInitializer:co})}}C.default=lo,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,22 +8,22 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.
|
|
11
|
+
"@nocobase/client": "1.4.0-alpha",
|
|
12
12
|
"react": "18.2.0",
|
|
13
13
|
"@formily/react": "2.3.0",
|
|
14
14
|
"antd": "5.12.8",
|
|
15
15
|
"dayjs": "1.11.10",
|
|
16
|
-
"@nocobase/plugin-workflow": "1.
|
|
16
|
+
"@nocobase/plugin-workflow": "1.4.0-alpha",
|
|
17
17
|
"@ant-design/icons": "5.2.6",
|
|
18
18
|
"react-i18next": "11.18.6",
|
|
19
|
-
"@nocobase/utils": "1.
|
|
20
|
-
"@nocobase/server": "1.
|
|
21
|
-
"@nocobase/actions": "1.
|
|
22
|
-
"@nocobase/resourcer": "1.
|
|
23
|
-
"@nocobase/test": "1.
|
|
24
|
-
"@nocobase/plugin-workflow-test": "1.
|
|
19
|
+
"@nocobase/utils": "1.4.0-alpha",
|
|
20
|
+
"@nocobase/server": "1.4.0-alpha",
|
|
21
|
+
"@nocobase/actions": "1.4.0-alpha",
|
|
22
|
+
"@nocobase/resourcer": "1.4.0-alpha",
|
|
23
|
+
"@nocobase/test": "1.4.0-alpha",
|
|
24
|
+
"@nocobase/plugin-workflow-test": "1.4.0-alpha",
|
|
25
25
|
"@formily/core": "2.3.0",
|
|
26
26
|
"@formily/antd-v5": "1.1.9",
|
|
27
|
-
"@nocobase/database": "1.
|
|
27
|
+
"@nocobase/database": "1.4.0-alpha",
|
|
28
28
|
"lodash": "4.17.21"
|
|
29
29
|
};
|
|
@@ -30,7 +30,7 @@ export default class extends Instruction {
|
|
|
30
30
|
workflow: WorkflowPlugin;
|
|
31
31
|
formTypes: Registry<FormHandler>;
|
|
32
32
|
constructor(workflow: WorkflowPlugin);
|
|
33
|
-
run(node: any, prevJob: any, processor: Processor): Promise<
|
|
33
|
+
run(node: any, prevJob: any, processor: Processor): Promise<import("@nocobase/plugin-workflow").JobModel>;
|
|
34
34
|
resume(node: any, job: any, processor: Processor): Promise<any>;
|
|
35
35
|
}
|
|
36
36
|
export {};
|
package/dist/server/actions.js
CHANGED
|
@@ -77,16 +77,18 @@ async function submit(context, next) {
|
|
|
77
77
|
return context.throw(403);
|
|
78
78
|
}
|
|
79
79
|
const presetValues = processor.getParsedValue(actionItem.values ?? {}, userJob.nodeId, {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
80
|
+
additionalScope: {
|
|
81
|
+
// @deprecated
|
|
82
|
+
currentUser,
|
|
83
|
+
// @deprecated
|
|
84
|
+
currentRecord: values.result[formKey],
|
|
85
|
+
// @deprecated
|
|
86
|
+
currentTime: /* @__PURE__ */ new Date(),
|
|
87
|
+
$user: currentUser,
|
|
88
|
+
$nForm: values.result[formKey],
|
|
89
|
+
$nDate: {
|
|
90
|
+
now: /* @__PURE__ */ new Date()
|
|
91
|
+
}
|
|
90
92
|
}
|
|
91
93
|
});
|
|
92
94
|
userJob.set({
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "工作流:人工处理节点",
|
|
5
5
|
"description": "Could be used for workflows which some of decisions are made by users.",
|
|
6
6
|
"description.zh-CN": "用于人工控制部分决策的流程。",
|
|
7
|
-
"version": "1.
|
|
7
|
+
"version": "1.4.0-alpha",
|
|
8
8
|
"license": "AGPL-3.0",
|
|
9
9
|
"main": "./dist/server/index.js",
|
|
10
10
|
"homepage": "https://docs.nocobase.com/handbook/workflow-manual",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@nocobase/test": "1.x",
|
|
31
31
|
"@nocobase/utils": "1.x"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "f097a2bddec152522b5645bd5d451f4c866d2060",
|
|
34
34
|
"keywords": [
|
|
35
35
|
"Workflow"
|
|
36
36
|
]
|
|
File without changes
|
|
File without changes
|